You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Sean Owen (JIRA)" <ji...@apache.org> on 2018/11/08 23:14:00 UTC

[jira] [Created] (SPARK-25984) Remove deprecated .newInstance(), primitive box class constructor calls

Sean Owen created SPARK-25984:
---------------------------------

             Summary: Remove deprecated .newInstance(), primitive box class constructor calls
                 Key: SPARK-25984
                 URL: https://issues.apache.org/jira/browse/SPARK-25984
             Project: Spark
          Issue Type: Sub-task
          Components: Spark Core, SQL, Structured Streaming
    Affects Versions: 3.0.0
            Reporter: Sean Owen
            Assignee: Sean Owen


While working on JDK 11 support, I noticed a lot of new deprecation warnings. 80% of them seem to be from two easily-fixable sources:

- Class.newInstance() is deprecated
- Almost all constructors from primitive box classes like Integer are deprecated

These are easy to fix because there have long been equivalent, better alternatives:

- Just call .getConstructor().getInstance()
- Replace new Integer(x) with Integer.valueOf(x), etc

The latter has the advantage, for integral types, of not even allocating a new object for small values.

We should just fix these to clean up the build output.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org