[org.netbeans.TopSecurityManager] use of system property netbeans.user has been obsoleted in favor of InstalledFileLocator at org.netbeans.modules.autoproject.spi.Cache.<clinit>(Cache.java:76)
authorJesse Glick <jglick@netbeans.org>
Thu, 17 Nov 2011 12:46:46 -0500
changeset 176820af003af0b90
parent 17677 20c617d40685
child 17683 39650843255f
child 17684 5ff58e374e5e
[org.netbeans.TopSecurityManager] use of system property netbeans.user has been obsoleted in favor of InstalledFileLocator at org.netbeans.modules.autoproject.spi.Cache.<clinit>(Cache.java:76)
autoproject.core/nbproject/project.xml
autoproject.core/src/org/netbeans/modules/autoproject/spi/Cache.java
     1.1 --- a/autoproject.core/nbproject/project.xml	Wed Nov 16 16:56:07 2011 -0500
     1.2 +++ b/autoproject.core/nbproject/project.xml	Thu Nov 17 12:46:46 2011 -0500
     1.3 @@ -73,6 +73,14 @@
     1.4                      </run-dependency>
     1.5                  </dependency>
     1.6                  <dependency>
     1.7 +                    <code-name-base>org.openide.modules</code-name-base>
     1.8 +                    <build-prerequisite/>
     1.9 +                    <compile-dependency/>
    1.10 +                    <run-dependency>
    1.11 +                        <specification-version>7.26</specification-version>
    1.12 +                    </run-dependency>
    1.13 +                </dependency>
    1.14 +                <dependency>
    1.15                      <code-name-base>org.openide.nodes</code-name-base>
    1.16                      <build-prerequisite/>
    1.17                      <compile-dependency/>
     2.1 --- a/autoproject.core/src/org/netbeans/modules/autoproject/spi/Cache.java	Wed Nov 16 16:56:07 2011 -0500
     2.2 +++ b/autoproject.core/src/org/netbeans/modules/autoproject/spi/Cache.java	Thu Nov 17 12:46:46 2011 -0500
     2.3 @@ -51,6 +51,7 @@
     2.4  import java.util.TreeMap;
     2.5  import java.util.logging.Level;
     2.6  import java.util.logging.Logger;
     2.7 +import org.openide.modules.Places;
     2.8  import org.openide.util.EditableProperties;
     2.9  import org.openide.util.Exceptions;
    2.10  import org.openide.util.Parameters;
    2.11 @@ -73,16 +74,16 @@
    2.12  
    2.13      private static final File CACHE;
    2.14      static {
    2.15 -        String userdir = System.getProperty("netbeans.user");
    2.16 -        if (userdir != null) {
    2.17 -            File compatibilityLocation = new File(userdir, "var/cache/autoprojects.properties");
    2.18 -            if (compatibilityLocation.isFile()) {
    2.19 -                CACHE = compatibilityLocation;
    2.20 +        File compatibilityLocation = Places.getCacheSubfile("autoprojects.properties");
    2.21 +        if (compatibilityLocation.isFile()) {
    2.22 +            CACHE = compatibilityLocation;
    2.23 +        } else {
    2.24 +            File userdir = Places.getUserDirectory();
    2.25 +            if (userdir != null) {
    2.26 +                CACHE = new File(userdir, "var/autoprojects.properties");
    2.27              } else {
    2.28 -                CACHE = new File(userdir, "var/autoprojects.properties");
    2.29 +                CACHE = null;
    2.30              }
    2.31 -        } else {
    2.32 -            CACHE = null;
    2.33          }
    2.34      }
    2.35