question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeDeclaration.getAnnotationTarget() returning null for @Inject

See original GitHub issue

The typechecker’s Java annotation constraint validation seems to be completely disabled.

TypeDeclaration.getAnnotationTarget() simply returns null, in IntelliJ, Eclipse, and the CLI!

Code:

module stuff "1.0.0" {
    import maven:"javax.inject:javax.inject" "1";
}

import javax.inject { inject }

void run() {
    inject
    value name = "";
}

The code above should produce an error from the typechecker, but it doesn’t.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:24 (24 by maintainers)

github_iconTop GitHub Comments

1reaction
tombentleycommented, Nov 10, 2016

Done

0reactions
gavinkingcommented, Nov 10, 2016

Thanks Tom!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Null after @InjectMocks - Stack Overflow
initMocks to initiate the @Mock and @InjectMocks objects. ... computeAnswer() does not return NULL for the input of new BigDecimal(2), 2)).
Read more >
Play2.4 Field Injection always return null MailerClient · Issue #78
Using Play.application().injector().instanceOf(MailerClient.class).send(email); works fine, but that is not clear form the current documentation ...
Read more >
AEM - Why injected property is giving null inside sling model ...
Why injected property is giving null inside sling model . Use of @ Inject, @ValueMapValue,@Via annotationsConnect with me on ...
Read more >
Null Pointer Exceptions In Java - What EXACTLY ... - YouTube
We'll talk about What a null pointer exception is, how to fix it, and how to avoid them in our Java code. NullPointerExceptions...
Read more >
How to Fix and Avoid NullPointerException in Java - Rollbar
NullPointerException in Java occurs when a variable is accessed which is not pointing to any object and refers to nothing or null.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found