Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4846976

System property "sun.io.useCanonPrefixCache" is used, but cant be set

XMLWordPrintable

    • tiger
    • generic
    • generic
    • Verified



      Name: aaR10208 Date: 04/11/2003


      Filed By : J2SE-SQA [###@###.###
      JDK : JDK1.5.0-b04 (the same code exists in jdk1.4.2-b19).
      Platform[s] : generic
      switch/Mode : generic

      java.io.FileSystem class uses two system properties for enabling/disabling performance
      optimisation for file names canonicalization, but these properties cant be set apart.

      Here is a part of java/io/FileSystem.java:
      =====
          208 static boolean useCanonCaches = true;
          209 static boolean useCanonPrefixCache = true;
      [...]
          221 static {
          222 useCanonCaches = getBooleanProperty("sun.io.useCanonCaches",
          223 useCanonCaches);
          224 useCanonPrefixCache = getBooleanProperty("sun.io.useCanonPrefixCache",
          225 useCanonPrefixCache);
      =====
      Note, that these values are retrieved via different system props.

      The problem is in the getBoolenProperty() which ignores the first parameter:
      =====
      !> 211 private static boolean getBooleanProperty(String prop, boolean defaultVal) {
      !> 212 String val = System.getProperty("sun.io.useCanonCaches");
          213 if (val == null) return defaultVal;
          214 if (val.equalsIgnoreCase("true")) {
          215 return true;
          216 } else {
          217 return false;
          218 }
          219 }
      =====

      Looks like a copy-paste bug.


      ======================================================================

            kbr Kenneth Russell (Inactive)
            sundrsunw Sundr Sundr (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: