Skip to content

Commit acaf6e3

Browse files
authored
Enable annotation-based null analysis (#2677)
* enable annotation-based null analysis Signed-off-by: Shi Chen <[email protected]>
1 parent 092bd4e commit acaf6e3

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,10 @@ New in 1.10.0
210210
* `java.jdt.ls.protobufSupport.enabled`: Specify whether to automatically add Protobuf output source directories to the classpath. **Note:** Only works for Gradle `com.google.protobuf` plugin `0.8.4` or higher. Defaults to `true`.
211211
* `java.jdt.ls.androidSupport.enabled`: [Experimental] Specify whether to enable Android project importing. When set to `auto`, the Android support will be enabled in Visual Studio Code - Insiders. **Note:** Only works for Android Gradle Plugin `3.2.0` or higher. Defaults to `auto`.
212212

213+
New in 1.11.0
214+
* `java.compile.nullAnalysis.nonnull`: Specify the Nonnull annotation types to be used for null analysis. If more than one annotation is specified, then the topmost annotation will be used first if it exists in your project dependencies.
215+
* `java.compile.nullAnalysis.nullable`: Specify the Nullable annotation types to be used for null analysis. If more than one annotation is specified, then the topmost annotation will be used first if it exists in your project dependencies.
216+
213217
Semantic Highlighting
214218
===============
215219
[Semantic Highlighting](https://github.com/redhat-developer/vscode-java/wiki/Semantic-Highlighting) fixes numerous syntax highlighting issues with the default Java Textmate grammar. However, you might experience a few minor issues, particularly a delay when it kicks in, as it needs to be computed by the Java Language server, when opening a new file or when typing. Semantic highlighting can be disabled for all languages using the `editor.semanticHighlighting.enabled` setting, or for Java only using [language-specific editor settings](https://code.visualstudio.com/docs/getstarted/settings#_languagespecific-editor-settings).

package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,26 @@
960960
"default": true,
961961
"description": "Reordering of fields, enum constants, and initializers can result in semantic and runtime changes due to different initialization and persistence order. This setting prevents this from occurring.",
962962
"scope": "window"
963+
},
964+
"java.compile.nullAnalysis.nonnull": {
965+
"type": "array",
966+
"default": [
967+
"javax.annotation.Nonnull",
968+
"org.eclipse.jdt.annotation.NonNull",
969+
"org.springframework.lang.NonNull"
970+
],
971+
"markdownDescription": "Specify the Nonnull annotation types to be used for null analysis. If more than one annotation is specified, then the topmost annotation will be used first if it exists in your project dependencies.",
972+
"scope": "window"
973+
},
974+
"java.compile.nullAnalysis.nullable": {
975+
"type": "array",
976+
"default": [
977+
"javax.annotation.Nullable",
978+
"org.eclipse.jdt.annotation.Nullable",
979+
"org.springframework.lang.Nullable"
980+
],
981+
"markdownDescription": "Specify the Nullable annotation types to be used for null analysis. If more than one annotation is specified, then the topmost annotation will be used first if it exists in your project dependencies.",
982+
"scope": "window"
963983
}
964984
}
965985
},

0 commit comments

Comments
 (0)