diff --git a/bindings/java/src/jni/javasigar.c b/bindings/java/src/jni/javasigar.c index 8b18d683..dbed606c 100644 --- a/bindings/java/src/jni/javasigar.c +++ b/bindings/java/src/jni/javasigar.c @@ -268,7 +268,7 @@ enum { #define STRING_SIG "Ljava/lang/String;" -JNIEXPORT jobjectArray SIGAR_JNI(Sigar_getFileSystemList) +JNIEXPORT jobjectArray SIGAR_JNI(Sigar_getFileSystemListNative) (JNIEnv *env, jobject sigar_obj) { int status; diff --git a/bindings/java/src/net/hyperic/sigar/Sigar.java b/bindings/java/src/net/hyperic/sigar/Sigar.java index 6cf3bb39..32c47aef 100644 --- a/bindings/java/src/net/hyperic/sigar/Sigar.java +++ b/bindings/java/src/net/hyperic/sigar/Sigar.java @@ -489,11 +489,20 @@ public class Sigar implements SigarProxy { return ThreadCpu.fetch(this, 0); } + + private native FileSystem[] getFileSystemListNative() throws SigarException; + /** * Get list of file systems. * @exception SigarException on failure. */ - public native FileSystem[] getFileSystemList() throws SigarException; + public FileSystem[] getFileSystemList() throws SigarException { + FileSystem[] fslist = getFileSystemListNative(); + if (this.mounts != null) { + this.mounts.init(fslist); + } + return fslist; + } /** * Get file system usage. @@ -547,7 +556,7 @@ public class Sigar implements SigarProxy { this.mounts = new FileSystemMap(); } - this.mounts.init(getFileSystemList()); + getFileSystemList(); //this.mounts.init() return this.mounts; }