Fixes find-usages and call-hierarchy on enum constructors.#8991
Fixes find-usages and call-hierarchy on enum constructors.#8991mbien merged 1 commit intoapache:masterfrom
Conversation
matthiasblaesing
left a comment
There was a problem hiding this comment.
I think this is an improvement over the prior state. It might be worth extending the comment in line 208 noting, that the rendering is not perfect (empty label) for these cases, but at least it does not blow.
|
I tried to track the label problem down yesterday, I might give it another try in case it would only be a UI change. I suspect that it could be, because find-usages does seem to do a better job to find the name of the enum constants than call-hierarchy - while both use the same code path to compute the usages. |
|
i also forgot to mention that i can't access the old bugzilla atm. I asked on slack and it seems like more can't log in. I would also be good to read through the bug IDs which were mentioned in the comments marked as hotfix. I might open a infra issue (edit: INFRA-27390). |
|
i can now view the bugzilla bugs again since my account got repaired, the comment mentions the hotfix for https://bz.apache.org/netbeans/show_bug.cgi?id=213723 which is the exact same bug. public enum Tester {
ENUM1 {
{
System.out.println("");
}
},
ENUM2 {
@Override
public String toString() {
return super.toString();
}
};
private Tester() {
}
}what I believe happened is that So this PR essentially activates the old hotfix again. cc @jlahoda |
lahodaj
left a comment
There was a problem hiding this comment.
Looks sensible. Would be good if we could fix the tests/start to run them at some point.
770455d to
d773653
Compare
Use the fallback codepath if the end position is negative.
d773653 to
49d04ad
Compare
Use the fallback codepath if the end position is negative.
unfortunately all tests for the find usage functionality are disabled atm which makes changes in this area a bit risky.
to trigger the exception in NB 28, at least one enum field must have a class body
{}.fixes #8985