score:1
it is possible to use @nonnullbydefault
with inherited, unconstrained classes, but an explicit @nullable
constraint must be applied to method parameters of any method which is overriden. this is because the default, unconstrained behavior for java, is to allow nulls.
the confusion here is a result of a misplacement of the @nullable
annotation. the placement in the original question suggests that the array contents should not be null rather than the array itself.
there is a bug but it's not with the annotation; it's a result of eclipse (as of 4.6) placing the annotation in the wrong location with the quick fix feature, reinforcing an erroneous placement which does not correct the error.
the correct placement for arrays is:
public void somemethod(
string @nullable[] a)
{
}
Source: stackoverflow.com
Related Query
- Can I not mix @NonNullByDefault with inherited classes that have no null annotation constraint?
- When using Eclipse with FindBugs can you mark a bug as not a bug and have it removed from the bug list?
- RegEx Expression for Eclipse that searches for all items that have not been dealt with
- Can I have classes with same name in one Java project in Eclipse IDE?
- Can not connect to MySQL with Eclipse java IDE on linux ubuntu, but with a code that worked perfectly on windows
- Classes with errors do not have a red cross next to them in Project Explorer
- ctrl-click goes to the declaration of the method I clicked. For interfaces with one implementation, how can I just directly go to that implementation?
- maven error: element dependency can not have character children
- Opening JSF Facelets page shows "This XML file does not appear to have any style information associated with it."
- What is the best, free, subversion control repository that can be used with the Eclipse subversion plugin?
- Is there a Java program snippet which can compile with a Java 5 compiler on JRE 6 but not Java 6 compiler?
- Eclipse: The selection did not contain any resource that can run on a server
- Any way of working with Eclipse WTP that does not mean redeploying the _WHOLE_ application when a JSP page is changed
- How can I use classes from other project with maven? (ClassNotFoundException and NoClassDefFoundError is thrown)
- I have build errors with m2eclipse but not with maven2 on the command line - is my m2eclipse misconfigured?
- How to resolve warning: You are installing software that contain unsigned content and authenticity and validity of this software can not established
- How do you attach JSdoc in Eclipse so that I can have autocomplete for a personal library
- When you get a stack trace in Eclipse with SDK classes in the stack, how can you see the SDK sources?
- How to use eclipse with ssh, so that the remote projects can be edited by local eclipse?
- How to make (EPIC perl) plugin on eclipse do syntax coloring for a file that does not have .pl extension
- In Eclipse, how do you find methods that you have defined but not used/called anywhere in the app?
- eclipse 3.5.1 (Galileo) with ubuntu 9.10 (Karmic) busted! Can not install maven2 plugin! (Or any other plugin)
- can Eclipse Che be used for traditional monolithic application development? Application that does not make use of Docker
- How to fix the error: test source folder 'src/test/java' in project must have an output folder that is not also used for main source"?
- Can not share new project with Subversive SVN in Eclipse Neon
- Source not found for a file that I have open
- Can I have a workspace that is both a git workspace and a svn workspace?
- Can I run an application that was built with Java 1.8 on a system that has JRE 1.6?
- Can not display plot with matplotlib under eclipse
- Androidannotations: Classes can not be resolved when from different package on clean build
More Query from same tag
- Program terminates in eclipse
- Add all Ant tasks and types within a .jar to Eclipse
- Java - Error: Could not find or load main class
- Can anyone explain to me why I Eclipse is claiming an invalid tag, yet the JSP seems to be working
- Why does the Eclipse code formatter break </a> in a Javadoc @see tag?
- Best practices for command-line builds
- No resource identifier found for attribute 'ProgressIndeterminate in package 'cn.pedant.sweetalert'
- What's the meaning of this in Eclipse: "Path for project must have only one segment."
- MANIFEST.MF issue with jhall.jar
- Android/Java - Convert int values from a equation to double
- How to create svg file in Eclipse
- How do I set up Eclipse/EGit with GitHub?
- Adding .so lib into .pro file in eclipse. C++ / Eclipse / Linux
- Primefaces message nor work with stream file
- how can i overcome this compilation error?
- Eclipse/Zend Studio, stop validation for parts of a project tree
- BUILD FAILURE in installing maven plug in
- Birt Conditional Page Break
- Jetty 6 Eclipse Datasource NameNotFoundException
- Debugging Visual Studio builds from Eclipse
- My NQueens isSafeMove() function is constantly returning false
- Selenium - eCLIPSE - WebDriver Alert Handling - Query
- Cannot create Class of type "JSF Managed Bean" in Eclipse. JavaServer Faces category Missing
- Websockets Tomcat 7 does not work in existing project
- Export runnable JAR in Eclipse with only imported classes
- Property of HTML Meta - Tags throw a warning in eclipse
- console view in eclipse rcp development?
- android app developed in eclipse-ADT crashes cause of unknown reason
- Separate eclipse plugin.xml for SWTBot test
- Errors in Android app