Skip to content

Commit

Permalink
No need for this.
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabii committed Jun 12, 2024
1 parent 5020bd8 commit 7cb088d
Showing 1 changed file with 22 additions and 29 deletions.
51 changes: 22 additions & 29 deletions src/IKVM.Runtime/Java/Externs/java/io/WinNTFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -540,40 +540,33 @@ public static string[] list(object self, object f)
#if FIRST_PASS
throw new NotImplementedException();
#else
try
if (JVM.Vfs.IsPath(((global::java.io.File)f).getPath()))
{
if (JVM.Vfs.IsPath(((global::java.io.File)f).getPath()))
{
if (JVM.Vfs.GetEntry(((global::java.io.File)f).getPath()) is VfsDirectory vfs)
return vfs.List();
if (JVM.Vfs.GetEntry(((global::java.io.File)f).getPath()) is VfsDirectory vfs)
return vfs.List();

return null;
return null;
}
else
{
__callerID ??= global::ikvm.@internal.CallerID.create(WinNTFileSystemAccessor.Type.TypeHandle);
__jniPtr__list ??= Marshal.GetDelegateForFunctionPointer<__jniDelegate__list>(JNIFrame.GetFuncPtr(__callerID, "java/io/WinNTFileSystem", nameof(list), "(Ljava/io/File;)[Ljava/lang/String;"));
var jniFrm = new JNIFrame();
var jniEnv = jniFrm.Enter(__callerID);
try
{
return (string[])jniFrm.UnwrapLocalRef(__jniPtr__list(jniEnv, jniFrm.MakeLocalRef(self), jniFrm.MakeLocalRef(f)));
}
else
catch (Exception ex)
{
__callerID ??= global::ikvm.@internal.CallerID.create(WinNTFileSystemAccessor.Type.TypeHandle);
__jniPtr__list ??= Marshal.GetDelegateForFunctionPointer<__jniDelegate__list>(JNIFrame.GetFuncPtr(__callerID, "java/io/WinNTFileSystem", nameof(list), "(Ljava/io/File;)[Ljava/lang/String;"));
var jniFrm = new JNIFrame();
var jniEnv = jniFrm.Enter(__callerID);
try
{
return (string[])jniFrm.UnwrapLocalRef(__jniPtr__list(jniEnv, jniFrm.MakeLocalRef(self), jniFrm.MakeLocalRef(f)));
}
catch (Exception ex)
{
System.Console.WriteLine("*** exception in native code ***");
System.Console.WriteLine(ex);
throw;
}
finally
{
jniFrm.Leave();
}
System.Console.WriteLine("*** exception in native code ***");
System.Console.WriteLine(ex);
throw;
}
finally
{
jniFrm.Leave();
}
}
catch (global::java.lang.NegativeArraySizeException e)
{
throw new global::java.lang.NegativeArraySizeException("listing " + ((global::java.io.File)f).getPath());
}
#endif
}
Expand Down

0 comments on commit 7cb088d

Please sign in to comment.