Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
Null annotations: alter severity of IDE warnings (#4402)
Browse files Browse the repository at this point in the history
* Null annotations: alter severity and avoid IDE warnings

Also: Make null reference check happy.

Signed-off-by: Henning Treu <henning.treu@telekom.de>
  • Loading branch information
htreu authored and maggu2810 committed Oct 13, 2017
1 parent 74592eb commit b4be492
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
Expand Up @@ -122,10 +122,12 @@ public E update(E element) {
String key = getKeyAsString(element);
if (storage.get(key) != null) {
PE persistableElement = storage.put(key, toPersistableElement(element));
E oldElement = toElement(key, persistableElement);
notifyListenersAboutUpdatedElement(oldElement, element);
logger.debug("Updated element {} in {}.", key, this.getClass().getSimpleName());
return oldElement;
if (persistableElement != null) {
E oldElement = toElement(key, persistableElement);
notifyListenersAboutUpdatedElement(oldElement, element);
logger.debug("Updated element {} in {}.", key, this.getClass().getSimpleName());
return oldElement;
}
} else {
logger.warn("Could not update element with key {} in {}, because it does not exists.", key,
this.getClass().getSimpleName());
Expand Down
24 changes: 24 additions & 0 deletions targetplatform/EclipseSmartHome.setup
Expand Up @@ -105,14 +105,34 @@
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts"
value="enabled"/>
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation"
value="ignore"/>
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict"
value="error"/>
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.problem.nullReference"
value="error"/>
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.problem.nullSpecViolation"
value="error"/>
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion"
value="ignore"/>
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.problem.parameterAssignment"
value="warning"/>
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables"
value="ignore"/>
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment"
Expand All @@ -121,6 +141,10 @@
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.problem.potentialNullReference"
value="warning"/>
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.problem.redundantNullCheck"
value="warning"/>
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields"
Expand Down

0 comments on commit b4be492

Please sign in to comment.