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

PatternSyntaxException: private field 'nl' is assigned but never accessed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 6
    • core-libs

      FULL PRODUCT VERSION :
      java version "1.6.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-beta2-b74)
      Java HotSpot(TM) Client VM (build 1.6.0-beta2-b74, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP Home Edition
      5.1.2600 Service Pack 2 Build 2600


      A DESCRIPTION OF THE PROBLEM :
      In the class java.util.regex.PatternSyntaxException a private static field "nl" is declared and initialized the the value of the "line.separator" system property. The value of that field is never used in the class. In the getMessage() method a new local variable with the same name and value is created and used instead.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Analyze the source of java.util.regex.PatternSyntaxException.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The private static field should be used or removed.
      ACTUAL -
      An unnecessary field.

      REPRODUCIBILITY :
      This bug can be reproduced always.

            sherman Xueming Shen
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: