mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Do not instantiate inspection while copying wrapper if tool is null
This commit is contained in:
@@ -60,13 +60,9 @@ public abstract class InspectionToolWrapper<T extends InspectionProfileEntry, E
|
||||
protected InspectionToolWrapper(@NotNull InspectionToolWrapper<T, E> other) {
|
||||
myEP = other.myEP;
|
||||
// we need to create a copy for buffering
|
||||
if (myEP != null) {
|
||||
if (other.myTool != null) {
|
||||
//noinspection unchecked
|
||||
myTool = (T)myEP.instantiateTool();
|
||||
}
|
||||
else if (other.myTool != null) {
|
||||
//noinspection unchecked
|
||||
myTool = (T)InspectionToolsRegistrarCore.instantiateTool(other.myTool.getClass());
|
||||
myTool = myEP != null ? (T)myEP.instantiateTool() : (T)InspectionToolsRegistrarCore.instantiateTool(other.myTool.getClass());
|
||||
}
|
||||
else {
|
||||
myTool = null;
|
||||
|
||||
Reference in New Issue
Block a user