Skip to content

Commit 6d9ff11

Browse files
IntelliJ settings
1 parent a65481e commit 6d9ff11

File tree

2 files changed

+27
-20
lines changed

2 files changed

+27
-20
lines changed

.idea/inspectionProfiles/Project_Default.xml

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,35 @@
11
# null-pointer-analysis-examples
22

33
Demonstrates capabilities of some java tools to analyze (potential) null references. These tools are:
4-
- [eclipse (4.6)](https://www.eclipse.org)
5-
- [IntelliJ (2017.1)](https://www.jetbrains.com/idea/)
4+
- [eclipse (4.7)](https://www.eclipse.org)
5+
- [IntelliJ (2017.2)](https://www.jetbrains.com/idea/)
66
- [The Checker Framework](https://checkerframework.org/)
77

88
Open the various java sources and read the comments to have an understanding of various checks that can be done (or not)
99
by these tools.
1010

1111
:warning: It is NORMAL that your IDE shows errors in the source files if it supports some checks for null reference analysis.:warning:
12-
1312
The default javac compiler does not report any error however.
1413

14+
## Comparison
15+
16+
Feature | Eclipse IDE 4.7.1 or jdt | Checker Framework | IntelliJ 2017.2.5
17+
------- | ------------------ | ----------------- | --------
18+
IDE support | :white_check_mark::white_check_mark: using plugin | :white_check_mark:
19+
Command line support | :white_check_mark: | :white_check_mark: | To be tested
20+
Java 8 type annotations support | :white_check_mark: | :white_check_mark: | :white_check_mark:
21+
Multiple annotations classes supported | :white_check_mark: | :white_check_mark: | :white_check_mark:
22+
External annotations support | :white_check_mark: using .eea files | :white_check_mark: using stubs files | :white_check_mark: using xml files
23+
External annotations provided for common libraries | :red_circle: community effort with [lastnpe.org](http://lastnpe.org)| :white_check_mark: JDK, Guava | :white_check_mark: JDK
24+
IDE support to create external annotations | :white_check_mark: | :warning: using command line tools | :white_check_mark:
25+
Treat all types as @Nonnull by default, unless annotated wih @Nullable:white_check_mark: using @NonNullByDefault for each package, allows to define the scope: field, parameters, return, generic types, etc... | :white_check_mark: by default, customizable with @DefaultQualifier:white_check_mark:
26+
@Polynull support | :red_circle::white_check_mark: using [@PolyNull](https://checkerframework.org/manual/#qualifier-polymorphism) | :white_check_mark: using [@Contract](https://www.jetbrains.com/help/idea/2017.1/contract-annotations.html), for instance @Contract("!null->!null;null->null")
27+
Method contract support (e.g. handle ``if(StringUtils.hasText(str)) {str...}`` | :red_circle: | :question: | :white_check_mark: using @Contract
28+
Automatic inference of nullability constraints in external libraries | :red_circle: | :red_circle: | :white_check_mark: for @NonNull and some @Contract. [Disabled for @Nullable due to too many false positives](https://youtrack.jetbrains.com/issue/IDEA-130063)
29+
Treat main, test or generated sources differently | :warning: not in IDE, unless ignoring all non-fatal errors for a source folder| :white_check_mark: | :white_check_mark:
30+
1531
## Eclipse
16-
Last version tested: eclipse 4.6.3.
32+
Last version tested: eclipse 4.7.1
1733

1834
The best analysis is performed using [external annotations](http://help.eclipse.org/neon/topic/org.eclipse.jdt.doc.user/tasks/task-using_external_null_annotations.htm?cp=1_3_9_2).
1935

@@ -212,19 +228,3 @@ $ mvn clean test -P checker-framework
212228
/Users/slaurent/Developer/repos/null-pointer-analysis-examples/src/main/java/test/EverythingNonNullByDefault.java:[25,11] error: [initialization.fields.uninitialized] the constructor does not initialize fields: address
213229
...
214230
```
215-
## Comparison
216-
217-
Feature | Eclipse IDE or jdt | Checker Framework | IntelliJ
218-
------- | ------------------ | ----------------- | --------
219-
IDE support | :white_check_mark::white_check_mark: using plugin | :white_check_mark:
220-
Command line support | :white_check_mark: | :white_check_mark: | :red_circle:
221-
Java 8 type annotations support | :white_check_mark: | :white_check_mark: | :red_circle: ``List<@Nonnull String>`` is the same as ``List<String>``, no error for ``list.add(null)``.
222-
Multiple annotations classes supported | :white_check_mark: | :white_check_mark: | :white_check_mark:
223-
External annotations support | :white_check_mark: using .eea files | :white_check_mark: using stubs files | :white_check_mark: using xml files
224-
External annotations provided for common libraries | :red_circle: community effort with [lastnpe.org](http://lastnpe.org)| :white_check_mark: JDK, Guava | :white_check_mark: JDK
225-
IDE support to create external annotations | :white_check_mark: | :warning: using command line tools | :white_check_mark:
226-
Treat all types as @Nonnull by default, unless annotated wih @Nullable:white_check_mark: using @NonNullByDefault for each package, allows to define the scope: field, parameters, return, generic types, etc... | :white_check_mark: by default, customizable with @DefaultQualifier:white_check_mark: IDE setting :question: global?
227-
@Polynull support | :red_circle::white_check_mark: using [@PolyNull](https://checkerframework.org/manual/#qualifier-polymorphism) | :white_check_mark: using [@Contract](https://www.jetbrains.com/help/idea/2017.1/contract-annotations.html), for instance @Contract("!null->!null;null->null")
228-
Method contract support (e.g. handle ``if(StringUtils.hasText(str)) {str...}`` | :red_circle: | :question: | :white_check_mark: using @Contract
229-
Automatic inference of nullability constraints in external libraries | :red_circle: | :red_circle: | :white_check_mark: for @NonNull and some @Contract. [Disabled for @Nullable due to too many false positives](https://youtrack.jetbrains.com/issue/IDEA-130063)
230-
Treat main, test or generated sources differently | :warning: not in IDE, unless ignoring all non-fatal errors for a source folder| :white_check_mark: | :white_check_mark:

0 commit comments

Comments
 (0)