Skip to content
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

Use Javac's overrides to determine if the method is overridden #10281

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

dstepanov
Copy link
Contributor

I investigated why we cannot use it by default, there is some limitation to the reflection invocation of the package-private methods. Added it as a note.

@dstepanov dstepanov added the type: improvement A minor improvement to an existing feature label Dec 18, 2023
Copy link

sonarcloud bot commented Dec 18, 2023

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
80.8% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@dstepanov dstepanov merged commit 4947687 into 4.3.x Dec 18, 2023
15 checks passed
@dstepanov dstepanov deleted the javaovv branch December 18, 2023 15:26
if (!packageName.equals(callingType.getPackageName())) {
return allowReflection && hasAnnotation(ReflectiveAccess.class);
}
if (isPackagePrivate()) {
Copy link
Contributor

@Spikhalskiy Spikhalskiy Dec 18, 2023

Choose a reason for hiding this comment

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

@dstepanov Do we need one more call for isPackagePrivate() here? We just checked it in the if above.
The first part of isPackagePrivate branch looks like a copy of the isProtected branch, so it looks like it could be a refactoring leftover.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I tried to refactor and failed :) I will give it one more chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: improvement A minor improvement to an existing feature
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants