Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build error on String.isEmpty() in NativeLibraryLoad.java #6

Closed
jafingerhut opened this issue Oct 5, 2010 · 2 comments
Closed

build error on String.isEmpty() in NativeLibraryLoad.java #6

jafingerhut opened this issue Oct 5, 2010 · 2 comments

Comments

@jafingerhut
Copy link

I replaced the call to isEmpty() to checking if the length() is equal to 0, and things compile fine:

diff --git a/src/main/java/com/jezhumble/javasysmon/NativeLibraryLoader.java b/src/main/java/com/jezhumble/javasysmon/NativeLibraryLoader.java
index 6a658cd..602b9a2 100644
--- a/src/main/java/com/jezhumble/javasysmon/NativeLibraryLoader.java
+++ b/src/main/java/com/jezhumble/javasysmon/NativeLibraryLoader.java
@@ -45,7 +45,7 @@ class NativeLibraryLoader {

 private File createTempFile(String suffix, String prefix) throws IOException {
     String tempDirProp = System.getProperty(JAVA_SYS_MON_TEMP_DIR);
  •    if (tempDirProp == null || tempDirProp.isEmpty()) {
    
  •    if (tempDirProp == null || tempDirProp.length() == 0) {
         return File.createTempFile(prefix, suffix);
     }
     return File.createTempFile(prefix, suffix, new File(tempDirProp));
    
@itspanzi
Copy link
Contributor

Hey,

isEmpty is a Java 1.6 feature and does not work on 1.5. But I guess just to do an isEmpty, we should not enforce 1.6! :)

@jezhumble
Copy link
Owner

Fixed. Thanks for the bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants