mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inspection profile: no need to initialize on write when tool was not initialized (=had default settings on read)
This commit is contained in:
@@ -313,7 +313,7 @@ public class InspectionProfileTest extends LightIdeaTestCase {
|
||||
assertEquals(0, countInitializedTools(profile));
|
||||
profile.writeExternal(new Element("profile"));
|
||||
List<InspectionToolWrapper> initializedTools = getInitializedTools(profile);
|
||||
if (initializedTools.size() != 1) {
|
||||
if (initializedTools.size() > 0) {
|
||||
for (InspectionToolWrapper initializedTool : initializedTools) {
|
||||
System.out.println(initializedTool.getShortName());
|
||||
}
|
||||
|
||||
@@ -145,7 +145,9 @@ public class ToolsImpl implements Tools {
|
||||
scopeElement.setAttribute(LEVEL_ATTRIBUTE, state.getLevel().toString());
|
||||
scopeElement.setAttribute(ENABLED_ATTRIBUTE, Boolean.toString(state.isEnabled()));
|
||||
InspectionToolWrapper toolWrapper = state.getTool();
|
||||
toolWrapper.getTool().writeSettings(scopeElement);
|
||||
if (toolWrapper.isInitialized()) {
|
||||
toolWrapper.getTool().writeSettings(scopeElement);
|
||||
}
|
||||
inspectionElement.addContent(scopeElement);
|
||||
}
|
||||
}
|
||||
@@ -153,7 +155,9 @@ public class ToolsImpl implements Tools {
|
||||
inspectionElement.setAttribute(LEVEL_ATTRIBUTE, getLevel().toString());
|
||||
inspectionElement.setAttribute(ENABLED_BY_DEFAULT_ATTRIBUTE, Boolean.toString(myDefaultState.isEnabled()));
|
||||
InspectionToolWrapper toolWrapper = myDefaultState.getTool();
|
||||
toolWrapper.getTool().writeSettings(inspectionElement);
|
||||
if (toolWrapper.isInitialized()) {
|
||||
toolWrapper.getTool().writeSettings(inspectionElement);
|
||||
}
|
||||
}
|
||||
|
||||
void readExternal(@NotNull Element toolElement, @NotNull InspectionProfile profile) throws InvalidDataException {
|
||||
|
||||
Reference in New Issue
Block a user