Clojure

Minor change to Clojure source code to prevent warnings when compiled with JDK 8

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Completed
  • Affects Version/s: Release 1.5
  • Fix Version/s: Release 1.6
  • Component/s: None
  • Labels:
    None
  • Environment:
    JDK 8
  • Patch:
    Code
  • Approval:
    Ok

Description

When compiling the Clojure source code using the early access version of JDK 8 (I saw this with 1.8.0-ea-b103 in particular), there are 6 warnings produced because the character _ is used as an identifier in Java source code.

    [javac] /home/jafinger/clj/latest-clj/clojure/src/jvm/clojure/lang/PersistentHashMap.java:1089: warning: '_' used as an identifier
    [javac] 	Box _ = new Box(null);
    [javac] 	    ^
    [javac]   (use of '_' as an identifier might not be supported in releases after Java SE 8)

The warning implies that this is likely to continue to be a warning for the lifetime of JDK 8, and could become an error with later JDKs.

Eliminating these warnings is as simple as changing the identifier name used on those 6 lines of one Java source file.

Patch: clj-1264-1.diff

Screened by: Alex Miller

  1. clj-1264-1.diff
    22/Oct/13 9:17 AM
    2 kB
    Alex Miller
  2. clj-1264-1.txt
    18/Sep/13 12:23 AM
    2 kB
    Andy Fingerhut

Activity

Hide
Andy Fingerhut added a comment -

Patch clj-1264-1.txt changes the identifier _ used on 6 lines of file PersistentHashMap.java to the name addedLeaf, which is used for a similar purpose elsewhere in the file.

Show
Andy Fingerhut added a comment - Patch clj-1264-1.txt changes the identifier _ used on 6 lines of file PersistentHashMap.java to the name addedLeaf, which is used for a similar purpose elsewhere in the file.
Andy Fingerhut made changes -
Field Original Value New Value
Attachment clj-1264-1.txt [ 12267 ]
Andy Fingerhut made changes -
Patch Code [ 10001 ]
Andy Fingerhut made changes -
Attachment clj-1264-1.txt [ 12267 ]
Andy Fingerhut made changes -
Attachment clj-1264-1.txt [ 12268 ]
Alex Miller made changes -
Approval Triaged [ 10120 ]
Alex Miller made changes -
Approval Triaged [ 10120 ] Vetted [ 10003 ]
Priority Minor [ 4 ] Critical [ 2 ]
Fix Version/s Release 1.6 [ 10157 ]
Alex Miller made changes -
Approval Vetted [ 10003 ] Screened [ 10004 ]
Description When compiling the Clojure source code using the early access version of JDK 8 (I saw this with 1.8.0-ea-b103 in particular), there are 6 warnings produced because the character _ is used as an identifier in Java source code.

{noformat}
    [javac] /home/jafinger/clj/latest-clj/clojure/src/jvm/clojure/lang/PersistentHashMap.java:1089: warning: '_' used as an identifier
    [javac] Box _ = new Box(null);
    [javac] ^
    [javac] (use of '_' as an identifier might not be supported in releases after Java SE 8)
{noformat}

The warning implies that this is likely to continue to be a warning for the lifetime of JDK 8, and could become an error with later JDKs.

Eliminating these warnings is as simple as changing the identifier name used on those 6 lines of one Java source file.
When compiling the Clojure source code using the early access version of JDK 8 (I saw this with 1.8.0-ea-b103 in particular), there are 6 warnings produced because the character _ is used as an identifier in Java source code.

{noformat}
    [javac] /home/jafinger/clj/latest-clj/clojure/src/jvm/clojure/lang/PersistentHashMap.java:1089: warning: '_' used as an identifier
    [javac] Box _ = new Box(null);
    [javac] ^
    [javac] (use of '_' as an identifier might not be supported in releases after Java SE 8)
{noformat}

The warning implies that this is likely to continue to be a warning for the lifetime of JDK 8, and could become an error with later JDKs.

Eliminating these warnings is as simple as changing the identifier name used on those 6 lines of one Java source file.

*Screened by:* Alex Miller
Alex Miller made changes -
Description When compiling the Clojure source code using the early access version of JDK 8 (I saw this with 1.8.0-ea-b103 in particular), there are 6 warnings produced because the character _ is used as an identifier in Java source code.

{noformat}
    [javac] /home/jafinger/clj/latest-clj/clojure/src/jvm/clojure/lang/PersistentHashMap.java:1089: warning: '_' used as an identifier
    [javac] Box _ = new Box(null);
    [javac] ^
    [javac] (use of '_' as an identifier might not be supported in releases after Java SE 8)
{noformat}

The warning implies that this is likely to continue to be a warning for the lifetime of JDK 8, and could become an error with later JDKs.

Eliminating these warnings is as simple as changing the identifier name used on those 6 lines of one Java source file.

*Screened by:* Alex Miller
When compiling the Clojure source code using the early access version of JDK 8 (I saw this with 1.8.0-ea-b103 in particular), there are 6 warnings produced because the character _ is used as an identifier in Java source code.

{noformat}
    [javac] /home/jafinger/clj/latest-clj/clojure/src/jvm/clojure/lang/PersistentHashMap.java:1089: warning: '_' used as an identifier
    [javac] Box _ = new Box(null);
    [javac] ^
    [javac] (use of '_' as an identifier might not be supported in releases after Java SE 8)
{noformat}

The warning implies that this is likely to continue to be a warning for the lifetime of JDK 8, and could become an error with later JDKs.

Eliminating these warnings is as simple as changing the identifier name used on those 6 lines of one Java source file.

*Patch:* clj-1264-1.diff

*Screened by:* Alex Miller
Alex Miller made changes -
Attachment clj-1264-1.diff [ 12371 ]
Rich Hickey made changes -
Approval Screened [ 10004 ] Ok [ 10007 ]
Stuart Halloway made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: