-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix warnings caused by deprecated constructor calls with primitive argument #58
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Explicit manual boxing (i.e. wrapping of primitive values in objects) is unnecessary under Java 5 and newer, and can be safely removed. Issue: javapathfinder#47
Explicit manual boxing (i.e. wrapping of primitive values in objects) is unnecessary under Java 5 and newer, and can be safely removed. Issue: javapathfinder#47
Explicit manual boxing (i.e. wrapping of primitive values in objects) is unnecessary under Java 5 and newer, and can be safely removed. Issue: javapathfinder#47
Instantiating a new Long, Integer, Short or Byte object from a primitive long, integer, short or byte argument is deprecated. It is recommended that we use the more efficient static method valueOf() (introduced in Java 5) instead, which caches objects for values between -128 and 127 inclusive. However in JPF, there are few cases where the use of Number constructor is intentional (So to bypass the caching). This commit suppress warnings from appearing in such cases. Issue: javapathfinder#47
I'm not sure if the Integer constructor calls are used intendedly or not in the following.
line 88: assertEquals(new Integer(42), obj.i); jpf-core/src/tests/gov/nasa/jpf/util/SparseClusterArrayTest.java Lines 172 to 190 in 18a0c42
Also here in line 184: return new Integer(other); |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes some of the deprecation warnings as stated in #47 (due to the use of the Number constructor on the primitive types) by removing unnecessary explicit manual boxing and by use of
@SuppressWarnings("deprecation")
annotation.Issue: #47