mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inspections: introduce empty tool wrapper array
This commit is contained in:
@@ -37,6 +37,8 @@ import java.net.URL;
|
||||
* Date: 9/28/11
|
||||
*/
|
||||
public abstract class InspectionToolWrapper<T extends InspectionProfileEntry, E extends InspectionEP> {
|
||||
public static final InspectionToolWrapper[] EMPTY_ARRAY = new InspectionToolWrapper[0];
|
||||
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.ex.InspectionToolWrapper");
|
||||
|
||||
protected T myTool;
|
||||
|
||||
@@ -35,7 +35,6 @@ import java.util.Map;
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
public class GotoInspectionModel extends SimpleChooseByNameModel {
|
||||
private static final InspectionToolWrapper[] EMPTY_WRAPPERS_ARRAY = new InspectionToolWrapper[0];
|
||||
private final Map<String, InspectionToolWrapper> myToolNames = new HashMap<>();
|
||||
private final String[] myNames;
|
||||
private final InspectionListCellRenderer myListCellRenderer = new InspectionListCellRenderer();
|
||||
@@ -69,7 +68,7 @@ public class GotoInspectionModel extends SimpleChooseByNameModel {
|
||||
public Object[] getElementsByName(final String name, final String pattern) {
|
||||
final InspectionToolWrapper tool = myToolNames.get(name);
|
||||
if (tool == null) {
|
||||
return EMPTY_WRAPPERS_ARRAY;
|
||||
return InspectionToolWrapper.EMPTY_ARRAY;
|
||||
}
|
||||
return new InspectionToolWrapper[] {tool};
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ import java.util.Set;
|
||||
* @author peter
|
||||
*/
|
||||
public class MockInspectionProfile extends InspectionProfileImpl {
|
||||
private InspectionToolWrapper[] myInspectionTools = new InspectionToolWrapper[0];
|
||||
private InspectionToolWrapper[] myInspectionTools = InspectionToolWrapper.EMPTY_ARRAY;
|
||||
private final Set<InspectionToolWrapper> myDisabledTools = new THashSet<>();
|
||||
|
||||
public MockInspectionProfile() {
|
||||
|
||||
Reference in New Issue
Block a user