fix(java): borked glue methods

This commit is contained in:
zaaarf 2024-09-09 16:06:05 +02:00
parent 5218042ca0
commit f6ee2f0806
No known key found for this signature in database
GPG key ID: C91CFF9E2262BBA1
4 changed files with 10 additions and 8 deletions

View file

@ -52,3 +52,4 @@ tasks.register('cargoBuild', Exec) {
} }
build.dependsOn cargoBuild build.dependsOn cargoBuild
build.finalizedBy shadowJar

View file

@ -50,9 +50,9 @@ public class Client {
return leave_workspace(this.ptr, id); return leave_workspace(this.ptr, id);
} }
private static native Workspace get_workspace(long self); private static native Workspace get_workspace(long self, String workspace);
public Optional<Workspace> getWorkspace() { public Optional<Workspace> getWorkspace(String workspace) {
return Optional.ofNullable(get_workspace(this.ptr)); return Optional.ofNullable(get_workspace(this.ptr, workspace));
} }
private static native void refresh_native(long self) throws ConnectionRemoteException; private static native void refresh_native(long self) throws ConnectionRemoteException;
@ -70,8 +70,8 @@ public class Client {
static { static {
try { try {
if(System.getProperty("os.name").startsWith("Windows")) if(System.getProperty("os.name").startsWith("Windows"))
NativeUtils.loadLibraryFromJar("/natives/codemp_intellij.dll"); NativeUtils.loadLibraryFromJar("/natives/codemp.dll");
else NativeUtils.loadLibraryFromJar("/natives/libcodemp_intellij.so"); else NativeUtils.loadLibraryFromJar("/natives/libcodemp.so");
setup_tracing(System.getenv().get("CODEMP_TRACING_LOG")); setup_tracing(System.getenv().get("CODEMP_TRACING_LOG"));
} catch(IOException e) { } catch(IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);

View file

@ -3,7 +3,7 @@ package mp.code.exceptions;
/** /**
* An exception returned by the server as a response. * An exception returned by the server as a response.
*/ */
public abstract class ConnectionRemoteException extends Exception { public abstract class ConnectionRemoteException extends ConnectionException {
protected ConnectionRemoteException(String msg) { protected ConnectionRemoteException(String msg) {
super(msg); super(msg);
} }

View file

@ -204,8 +204,9 @@ pub extern "system" fn Java_mp_code_Client_setup_1tracing<'local>(
super::setup_logger( super::setup_logger(
true, true,
Some(path) Some(path)
.filter(|p| p.is_null()) .filter(|p| !p.is_null())
.map(|p| env.get_string(&p).map(|s| s.into()).jexcept(&mut env)) .map(|p| env.get_string(&p).map(|s| s.into())
.jexcept(&mut env))
); );
} }