[ 
https://issues.apache.org/jira/browse/CASSANDRA-18449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17713182#comment-17713182
 ] 

Brandon Williams edited comment on CASSANDRA-18449 at 4/17/23 4:04 PM:
-----------------------------------------------------------------------

The failing test is trying to generate an identity mismatch that the helper 
should catch, but when we switch to Integer.valueOf the identities match.  Java 
17 
[added|https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html]
 of note:

bq. This is a value-based class; programmers should treat instances that are 
equal as interchangeable

and [value-based 
classes|https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/doc-files/ValueBased.html]
 notes:

bq. the class does not provide any instance creation mechanism that promises a 
unique identity on each method call

so near as I can tell, this test is no longer valid, and I have removed it.  I 
also added checkstyle to disallow the deprecate methods.

||Branch||CI||
|[trunk|https://github.com/driftx/cassandra/tree/CASSANDRA-18449-trunk]|[j8|https://app.circleci.com/pipelines/github/driftx/cassandra/974/workflows/0ca9e799-b483-449d-83b4-815ee15fdac2],
 
[j11|https://app.circleci.com/pipelines/github/driftx/cassandra/974/workflows/e0a481ef-bd72-43a7-a2bc-529dd0e47cb6]|




was (Author: brandon.williams):
The failing test is trying to generate an identity mismatch that the helper 
should catch, but when we switch to Integer.valueOf the identities match.  Java 
17 
[added|https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html]
 of note:

> This is a value-based class; programmers should treat instances that are 
> equal as interchangeable

and [value-based 
classes|https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/doc-files/ValueBased.html]
 notes:

> the class does not provide any instance creation mechanism that promises a 
> unique identity on each method call

so near as I can tell, this test is no longer valid, and I have removed it.  I 
also added checkstyle to disallow the deprecate methods.

||Branch||CI||
|[trunk|https://github.com/driftx/cassandra/tree/CASSANDRA-18449-trunk]|[j8|https://app.circleci.com/pipelines/github/driftx/cassandra/974/workflows/0ca9e799-b483-449d-83b4-815ee15fdac2],
 
[j11|https://app.circleci.com/pipelines/github/driftx/cassandra/974/workflows/e0a481ef-bd72-43a7-a2bc-529dd0e47cb6]|



> Integer(int), Long(long), Float(double) were deprecated in JDK9
> ---------------------------------------------------------------
>
>                 Key: CASSANDRA-18449
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18449
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Build
>            Reporter: Ekaterina Dimitrova
>            Assignee: Brandon Williams
>            Priority: Normal
>             Fix For: 5.x
>
>
> Now when we are moving with Cassandra 5.0 to 11+17, it is good to declutter 
> at least a bit our build log which  contains 76 deprecation warnings.
> Half of them are for deprecation of Integer(int), Long(long) and 
> Float(double).
> Oracle advises to use factory methods which are likely to yield significantly 
> better space and time performance too. The factory methods are also marked 
> with 
> @IntrinsicCandidate
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to