This is an automated email from the ASF dual-hosted git repository. lkishalmi pushed a commit to branch release110-gradle-patch-1 in repository https://gitbox.apache.org/repos/asf/netbeans.git
commit 1811de3d3370642cdab44e7f371f88387d4ab7f5 Author: Laszlo Kishalmi <laszlo.kisha...@gmail.com> AuthorDate: Sun May 19 07:13:41 2019 -0700 [NETBEANS-2288] Fixed Auxialiary properties to use 'netbeans.' prefix as other part of the plugin expects. --- .../modules/gradle/GradleAuxiliaryPropertiesImpl.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/groovy/gradle/src/org/netbeans/modules/gradle/GradleAuxiliaryPropertiesImpl.java b/groovy/gradle/src/org/netbeans/modules/gradle/GradleAuxiliaryPropertiesImpl.java index aa70c21..8aa974e 100644 --- a/groovy/gradle/src/org/netbeans/modules/gradle/GradleAuxiliaryPropertiesImpl.java +++ b/groovy/gradle/src/org/netbeans/modules/gradle/GradleAuxiliaryPropertiesImpl.java @@ -26,8 +26,10 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.HashSet; import java.util.LinkedList; import java.util.List; +import java.util.Set; import org.netbeans.api.project.ProjectManager; import org.netbeans.spi.project.AuxiliaryProperties; import org.openide.util.EditableProperties; @@ -39,7 +41,10 @@ import org.openide.util.Mutex.Action; */ public class GradleAuxiliaryPropertiesImpl implements AuxiliaryProperties { - private static final String PROP_PREFIX = "nb-config."; //NOI18N + private static final String WRONG_PREFIX = "nb-config."; //NOI18N + // USE THIS PREFIX [NETBEANS-2288], AS IT CAN BE OVERWRITTEN IN + // GRADLE PROPERTY FILES + private static final String PROP_PREFIX = "netbeans."; //NOI18N final NbGradleProjectImpl project; @@ -52,7 +57,8 @@ public class GradleAuxiliaryPropertiesImpl implements AuxiliaryProperties { return ProjectManager.mutex().readAccess(new Action<String>() { @Override public String run() { - return getProperties(shared).get(PROP_PREFIX + key); + EditableProperties props = getProperties(shared); + return props.getOrDefault(PROP_PREFIX + key, props.get(WRONG_PREFIX + key)); } }); } @@ -65,6 +71,7 @@ public class GradleAuxiliaryPropertiesImpl implements AuxiliaryProperties { props.put(PROP_PREFIX + key, value); } else { props.remove(PROP_PREFIX + key); + props.remove(WRONG_PREFIX + key); } putProperties(props, shared); @@ -73,12 +80,15 @@ public class GradleAuxiliaryPropertiesImpl implements AuxiliaryProperties { @Override public Iterable<String> listKeys(boolean shared) { - List<String> ret = new LinkedList<>(); + Set<String> ret = new HashSet<>(); EditableProperties props = getProperties(shared); for (String key : props.keySet()) { if (key.startsWith(PROP_PREFIX)) { ret.add(key.substring(PROP_PREFIX.length())); } + if (key.startsWith(WRONG_PREFIX)) { + ret.add(key.substring(WRONG_PREFIX.length())); + } } return ret; } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists