From 3656e43728739aa2a47bc5b4dfb7c7925cd102c2 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Tue, 26 Nov 2013 18:11:31 +0100 Subject: [PATCH] CR-IC-3403#CFR-62470 leads to changes between IDEA versions and we try to avoid this as much as possible --- .../com/maddyhome/idea/copyright/CopyrightManager.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/copyright/src/com/maddyhome/idea/copyright/CopyrightManager.java b/plugins/copyright/src/com/maddyhome/idea/copyright/CopyrightManager.java index 278a1f254b16..7eff178c58e3 100644 --- a/plugins/copyright/src/com/maddyhome/idea/copyright/CopyrightManager.java +++ b/plugins/copyright/src/com/maddyhome/idea/copyright/CopyrightManager.java @@ -164,13 +164,13 @@ public class CopyrightManager extends AbstractProjectComponent implements Persis state.addContent(map); } - if (myDefaultCopyright != null) { - state.setAttribute(DEFAULT, myDefaultCopyright.getName()); - } + boolean hasAttributes = myDefaultCopyright != null; + // CR-IC-3403#CFR-62470, idea <= 12 compatibility + state.setAttribute(DEFAULT, hasAttributes ? myDefaultCopyright.getName() : ""); myOptions.writeExternal(state); - return state.getChildren().isEmpty() && state.getAttributes().isEmpty() ? null : state; + return !hasAttributes && state.getChildren().isEmpty() ? null : state; } catch (WriteExternalException e) { LOG.error(e);