Clojure

Address JDK API deprecations

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: Release 1.10
  • Fix Version/s: Release 1.10
  • Component/s: None
  • Labels:
  • Patch:
    Code
  • Approval:
    Vetted

Description

The JDK now has a clearer policy regarding API deprecations. Currently, there are 5 deprecated call sites in Clojure:

class clojure/pprint$translate_param uses deprecated method java/lang/Integer::<init>(Ljava/lang/String;)V 
class clojure/java/browse_ui$open_url_in_swing uses deprecated method java/awt/Window::show()V
class clojure/core$mix_collection_hash uses deprecated method java/lang/Long::<init>(J)V
class clojure/core$hash_ordered_coll uses deprecated method java/lang/Long::<init>(J)V
class clojure/core$hash_unordered_coll uses deprecated method java/lang/Long::<init>(J)V

The first two occur in clj files, and have clear replacement calls.

The last three (the Long(long) constructors) are emitted by the compiler while boxing invokeStatic and invokePrim. The Long constructors were deprecated in JDK9 [1], with the note that Hotspot intrinsifies the preferred call (Long/valueOf).

Addressing all of these remains compatible with JDK8.

This was found by building the local clojure uberjar and running jdeprscan --release <ver> clojure.jar
[1] https://docs.oracle.com/javase/10/docs/api/java/lang/Long.html#%3Cinit%3E(long)

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: