Skip to content

GH-2169: Remove compiler warnings around graph copy code#2333

Merged
afs merged 1 commit intoapache:mainfrom
afs:copy-clean
Mar 15, 2024
Merged

GH-2169: Remove compiler warnings around graph copy code#2333
afs merged 1 commit intoapache:mainfrom
afs:copy-clean

Conversation

@afs
Copy link
Copy Markdown
Member

@afs afs commented Mar 14, 2024

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.

@afs
Copy link
Copy Markdown
Member Author

afs commented Mar 14, 2024

@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.

{
var graphImplementingCopyable = new GraphMem2Fast();

assertTrue(graphImplementingCopyable instanceof Copyable<?>);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generic, not bare class, keeps Eclipse happy.

GraphMem2 copy = sut.copy();

assertTrue(copy instanceof GraphMem2);
assertNotNull(copy);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy is a GraphMem2 so the instanceof is false only if copy is null.

@afs afs merged commit f4882b8 into apache:main Mar 15, 2024
@afs afs deleted the copy-clean branch March 15, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants