Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Private members are never inherited, and package-private members are only sometimes inherited, the Java import analysis needs to account for that.#8752

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
lahodaj merged 1 commit intoapache:masterfromlahodaj:proper-inheritance
Oct 10, 2025

Conversation

@lahodaj
Copy link
Contributor

@lahodajlahodaj commentedAug 22, 2025
edited by mbien
Loading

Consider these files:

packageapi;publicclassA {publicstaticvoidtest() {}publicstaticvoidtest(inti) {}}packagehierbas.del.litoral;importstaticapi.A.*;publicclassTestextendsBase {publicstaticvoidt() {    }}classBase {privatestaticvoidtest() {}privatestaticvoidtest(inti) {}}

And now consider a piece of code that tries to add (usingQualIdents) calls toA.test()/A.test(0) insideTest.t(). Given the methods are accessible using simple names, this should produce just:

test();test(0);

But import analysis sees thetest methods in the superclass, thinks there's a clash and usesA.test()/A.test(0). There's no clash, of course, as theprivate members are not inherited.

This PR tries to resolve that, but considering the modifiers of the members from supertypes.


^Add meaningful description above

Click to collapse/expand PR instructions

By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -

  • are all your own work, and you have the right to contribute them.
  • are contributed solely under the terms and conditions of the Apache License 2.0 (see section 5 of the license for more information).

Please make sure (eg.git log) that all commits have a valid name and email address for you in the Author field.

If you're a first time contributor, see the Contributing guidelines for more information.

If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.

PR approval and merge checklist:

  1. Was this PRcorrectly labeled, did the right tests run? When did they run?
  2. Is this PRsquashed?
  3. Are author name / email address correct? Areco-authors correctly listed? Do the commit messages need updates?
  4. Does the PR title and description still fit after the Nth iteration? Is the description sufficient to appear in the release notes?

If this PR targets the delivery branch:don't merge. (full wiki article)

@lahodajlahodaj added this to theNB28 milestoneAug 22, 2025
@lahodajlahodaj added the Java[ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) labelAug 22, 2025
…only sometimes inherited, the Java import analysis needs to account for that.
Copy link
Member

@mbienmbien left a comment

Choose a reason for hiding this comment

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

code makes sense to me, thanks!

@lahodajlahodaj merged commit2e80f29 intoapache:masterOct 10, 2025
35 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@mbienmbienmbien approved these changes

Assignees

No one assigned

Labels

Java[ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)

Projects

None yet

Milestone

NB28

Development

Successfully merging this pull request may close these issues.

2 participants

@lahodaj@mbien

[8]ページ先頭

©2009-2025 Movatter.jp