GH-2169: Remove compiler warnings around graph copy code#2333
Merged
afs merged 1 commit intoapache:mainfrom Mar 15, 2024
Merged
GH-2169: Remove compiler warnings around graph copy code#2333afs merged 1 commit intoapache:mainfrom
afs merged 1 commit intoapache:mainfrom
Conversation
kinow
approved these changes
Mar 14, 2024
Member
Author
|
@arne-bdt - I can't add you as a reviewer - this may be because your github account isn't in the ASF organisation. This PR removes some warnings there were showing up in the codebase. |
afs
commented
Mar 14, 2024
| { | ||
| var graphImplementingCopyable = new GraphMem2Fast(); | ||
|
|
||
| assertTrue(graphImplementingCopyable instanceof Copyable<?>); |
Member
Author
There was a problem hiding this comment.
graphImplementingCopyable is already a Copyable and can't be null.
| * @param baseToCopy | ||
| */ | ||
| protected <T extends FastHashBase> FastHashBase(final T baseToCopy) { | ||
| protected <T extends FastHashBase<?>> FastHashBase(final T baseToCopy) { |
Member
Author
There was a problem hiding this comment.
Generic, not bare class, keeps Eclipse happy.
| GraphMem2 copy = sut.copy(); | ||
|
|
||
| assertTrue(copy instanceof GraphMem2); | ||
| assertNotNull(copy); |
Member
Author
There was a problem hiding this comment.
copy is a GraphMem2 so the instanceof is false only if copy is null.
rvesse
approved these changes
Mar 15, 2024
This file contains hidden or 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
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.
Clean the codebase of compiler warnings, mainly about unnecessary casts.
This follows on from PR #2316 that improves in-memory graph copy performance.
By submitting this pull request, I acknowledge that I am making a contribution to the Apache Software Foundation under the terms and conditions of the Contributor's Agreement.