Skip to content

Bug 576735 - "Type cannot be resolved. It is indirectly referenced from required .class files" error message not helpful#327

Merged
stephan-herrmann merged 1 commit intoeclipse-jdt:masterfrom
stephan-herrmann:Bug_576735
Sep 10, 2022
Merged

Bug 576735 - "Type cannot be resolved. It is indirectly referenced from required .class files" error message not helpful#327
stephan-herrmann merged 1 commit intoeclipse-jdt:masterfrom
stephan-herrmann:Bug_576735

Conversation

@stephan-herrmann
Copy link
Copy Markdown
Contributor

From https://bugs.eclipse.org/576735

  • propagate the ReferenceBinding requesting a type lookup
  • include that type's qualified name in the error message
  • test case modeled with findings from https://bugs.eclipse.org/577019

Mostly, LookupEnvironment acts as the information hub, but also UnresolvedReferenceBinding is used, to remember, which .class file caused the URB to be created. In case the URB is later referenced also from source we can still report the binary file referencing this type.

While I doubt that this will cover all cases of "indirectly referenced" problems, but I hope it improves the message for a significant number of cases.

@stephan-herrmann
Copy link
Copy Markdown
Contributor Author

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=577019#c4 for a slightly expanded explanation of the relevance of URB creation & resolving.

@stephan-herrmann
Copy link
Copy Markdown
Contributor Author

I might call out that I'm upping jdt.core's version because the change adds new API in IProblem.

Actually I was reluctant to introduce a new constant, but these constants control the error message shown to users, and as I am not sure additional information is always available, I didn't see how I could abandon the old (poorer) error message.

required .class files" error message not helpful

+ propagate the ReferenceBinding requesting a type lookup
+ include that type's qualified name in the error message
+ test case modeled with findings from https://bugs.eclipse.org/577019
+ adopt test from previous branch
@stephan-herrmann stephan-herrmann merged commit e2961c7 into eclipse-jdt:master Sep 10, 2022
@stephan-herrmann stephan-herrmann deleted the Bug_576735 branch September 10, 2022 11:32
stephan-herrmann added a commit to stephan-herrmann/eclipse.jdt.core that referenced this pull request Sep 11, 2022
jarthana pushed a commit to jarthana/eclipse.jdt.core that referenced this pull request Sep 21, 2022
…om required .class files" error message not helpful (eclipse-jdt#327)

+ propagate the ReferenceBinding requesting a type lookup
+ include that type's qualified name in the error message
+ test case modeled with findings from https://bugs.eclipse.org/577019
+ adopt test from previous branch
jarthana pushed a commit to jarthana/eclipse.jdt.core that referenced this pull request Sep 21, 2022
robstryker pushed a commit to robstryker/eclipse.jdt.core that referenced this pull request Jul 18, 2024
…om required .class files" error message not helpful (eclipse-jdt#327)

+ propagate the ReferenceBinding requesting a type lookup
+ include that type's qualified name in the error message
+ test case modeled with findings from https://bugs.eclipse.org/577019
+ adopt test from previous branch
robstryker pushed a commit to robstryker/eclipse.jdt.core that referenced this pull request Jul 18, 2024
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.

1 participant