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

Navigate to source does not work for annotation with default value of type Class #4186

Closed
hlavki opened this issue Jun 2, 2022 · 5 comments · Fixed by #7378
Closed

Navigate to source does not work for annotation with default value of type Class #4186

hlavki opened this issue Jun 2, 2022 · 5 comments · Fixed by #7378
Assignees
Labels
Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) kind:bug Bug report or fix

Comments

@hlavki
Copy link
Contributor

hlavki commented Jun 2, 2022

Apache NetBeans version

Apache NetBeans latest daily build

What happened

When I have code e.g.:

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Inherited
public @interface RunWith {

    Class<?> value();
}

@RunWith(String.class)
public class Runner {}

Pressing key Ctrl and click mouse on String.class, netbeans opens source of RunWith.java instead of String.java. Also JavaDoc shows RunWith.java.

How to reproduce

See the description above.

Did this work correctly in an earlier version?

No

Operating System

Linux 5.17.9-1-default, openSUSE Tumbleweed, x86_64

JDK

18.0.1

Apache NetBeans packaging

Own source build

Anything else

No response

Are you willing to submit a pull request?

Yes

Code of Conduct

Yes

@hlavki hlavki added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Jun 2, 2022
@mbien mbien added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) and removed needs:triage Requires attention from one of the committers labels Jun 2, 2022
@mbien
Copy link
Member

mbien commented Jun 2, 2022

good catch. thanks for the compact reproducer.

@Saljack
Copy link

Saljack commented May 13, 2024

It is really annoying mainly if you heavily work with annotations e.g. Spring Boot, Quarkus...

@matthiasblaesing
Copy link
Contributor

@hlavki @Saljack could you please test the nightly build available from PR #7378?

Direct link: https://github.com/apache/netbeans/suites/23738068067/artifacts/1498621505

@Saljack
Copy link

Saljack commented May 14, 2024

It works like a charm 👍 Thank you so much. I tested these combinations:

@Import(Something.class)
@Import(value = {Something.class} )
@Import(value = {Something.class, Object.class} )
@Import
@SpringBootApplication(scanBasePackageClasses = Something.class, exclude = Object.class)

and in all cases, it is linked to a correct annotation or a class parameter. I assume it is too late for NetBeans 22 😢

@matthiasblaesing
Copy link
Contributor

@Saljack thank you for the quick check.

I assume it is too late for NetBeans 22 😢

NB22 is still in RC phase. While I wanted to wait for CI/CD to complete and then decide, @mbien beat me to it and went ahead, reviewed and added to NB22 milestone. Meanwhile @ebarboni also merged the change to delivery for the next RC. So yes, it should be released with next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) kind:bug Bug report or fix
Projects
None yet
4 participants