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

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: