【发布时间】:2017-05-17 03:06:19
【问题描述】:
Sonar 在 null != textEditor 处显示错误。
TextEditor textEditor = null;
try{
/* Initialize text editor for the current operation */
textEditor = textEditorFactory.getCurrentEditingContext();
if(null == textEditor){
return;
}
/* doSomeOperation */
} catch (final Exception e) {
if (null != textEditor) {
textEditor.cancelEdit();
}
}
错误消息:更改此条件,使其不总是 评估为“假”。
【问题讨论】:
-
您能准确地说出您使用的是哪种语言吗? (我猜是 Java 吗?)您能否准确地说一下 SonarJava Analyzer 的版本是什么?