Skip to content

Commit 5e06da1

Browse files
committed
Fixes for DependencyInspection and EmptyMethodInspection.
1 parent fa775da commit 5e06da1

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

plugin/src/main/java/com/intellij/java/impl/codeInspection/dependencyViolation/DependencyInspection.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242

4343
import javax.swing.*;
4444
import java.awt.*;
45-
import java.util.ArrayList;import java.util.List;
45+
import java.util.ArrayList;
46+
import java.util.List;
4647

4748
/**
4849
* @author anna

plugin/src/main/java/com/intellij/java/impl/codeInspection/emptyMethod/EmptyMethodInspection.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public CommonProblemDescriptor[] checkElement(
101101
}
102102
}
103103

104+
@Nonnull
104105
LocalizeValue message = LocalizeValue.empty();
105106
boolean needToDeleteHierarchy = false;
106107
if (refMethod.isOnlyCallsSuper() && !refMethod.isFinal()) {
@@ -149,7 +150,7 @@ else if (!refMethod.getDerivedMethods().isEmpty()) {
149150
}
150151
}
151152

152-
if (message != null) {
153+
if (message != LocalizeValue.empty()) {
153154
List<LocalQuickFix> fixes = new ArrayList<>();
154155
fixes.add(getFix(processor, needToDeleteHierarchy));
155156
SpecialAnnotationsUtilBase.createAddToSpecialAnnotationFixes(
@@ -260,21 +261,20 @@ public void visitMethod(@Nonnull RefMethod refMethod) {
260261
return false;
261262
}
262263

263-
264-
@Override
265264
@Nonnull
265+
@Override
266266
public LocalizeValue getDisplayName() {
267267
return InspectionLocalize.inspectionEmptyMethodDisplayName();
268268
}
269269

270-
@Override
271270
@Nonnull
271+
@Override
272272
public LocalizeValue getGroupDisplayName() {
273273
return InspectionLocalize.groupNamesDeclarationRedundancy();
274274
}
275275

276-
@Override
277276
@Nonnull
277+
@Override
278278
public String getShortName() {
279279
return SHORT_NAME;
280280
}
@@ -325,8 +325,8 @@ public DeleteMethodIntention(String hint) {
325325
myHint = hint;
326326
}
327327

328-
@Override
329328
@Nonnull
329+
@Override
330330
public LocalizeValue getName() {
331331
return InspectionLocalize.inspectionEmptyMethodDeleteQuickfix();
332332
}

0 commit comments

Comments
 (0)