maggu2810
(maggu2810)
April 4, 2020, 7:21am
14
There has been a possible solution for the Eclipse IDE setup years ago as the code base had been part of Eclipse SmartHome:
eclipse-archived:master
← maggu2810:external-null-annotations
opened 07:31AM - 08 Sep 17 UTC
This commit adds initial support for external annotations.
There is a new pro… ject "eclipse-external-annotations" that must be
imported in the Eclipse IDE.
If added already some annotations:
* JRE
* Object.toString() returns a `@NonNull` String
* Collections.empty... returns a `@NonNull` reference
* Collections.singleton... returns a `@NonNull` reference
* Collections.synchronized... returns a `@NonNull` reference
* Collections.unmodifiable... returns a `@NonNull` reference
* slf4j
* LoggerFactory.getLogger(...) returns a `@NonNull` reference
If a project should use external annotations this needs to be configured
for the Eclipse IDE in the project settings of each project.
See [Configuring a project to use external annotations]
Open the project settings and navigate to "Java Build Path", "Library"
tab. Set the external annotation reference for "JRE System Library" and
"Plug-in Dependencies".
This has been already applied for the core and the core.things project.
For the headless consumption a "dedicated path" is possible
("-annotationpath location").
See [Headless consumption]
This setting has been already added to the POM file.
Add new annotations is very easy as it is supported by the IDE.
See [Creating external annotations]
[Configuring a project to use external annotations]: http://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-using_external_null_annotations.htm&cp=1_3_9_2&anchor=configure
[Creating external annotations]: http://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-using_external_null_annotations.htm&cp=1_3_9_2&anchor=create
[Headless consumption]: https://wiki.eclipse.org/JDT_Core/Null_Analysis/External_Annotations#Headless_consumption
IIRC after the migration from PDE to Pure Maven projects it should be enough to add the LastNPE plugin to the Eclipse IDE (as I written in the topic @wborn comment above).
I used the EEA in the Eclipse IDE for some other projects, so in general it should work.