[ 
https://issues.apache.org/jira/browse/SLING-7752?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16668261#comment-16668261
 ] 

ASF GitHub Bot commented on SLING-7752:
---------------------------------------

andreituicu closed pull request #8: SLING-7752 - Deserializing and serializing 
a feature model file shuffles the configurations
URL: https://github.com/apache/sling-org-apache-sling-feature-io/pull/8
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/main/java/org/apache/sling/feature/io/json/JSONWriterBase.java 
b/src/main/java/org/apache/sling/feature/io/json/JSONWriterBase.java
index 3533e68..1a51d36 100644
--- a/src/main/java/org/apache/sling/feature/io/json/JSONWriterBase.java
+++ b/src/main/java/org/apache/sling/feature/io/json/JSONWriterBase.java
@@ -19,10 +19,7 @@
 import java.io.StringReader;
 import java.io.Writer;
 import java.lang.reflect.Array;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 import javax.json.Json;
 import javax.json.JsonStructure;
@@ -109,9 +106,9 @@ protected void writeConfigurations(final JsonGenerator 
generator, final Configur
 
             generator.writeStartObject(key);
 
-            final Enumeration<String> e = cfg.getProperties().keys();
-            while ( e.hasMoreElements() ) {
-                final String name = e.nextElement();
+            final Iterator<String> e = cfg.getProperties().keySet().iterator();
+            while ( e.hasNext() ) {
+                final String name = e.next();
                 if ( Configuration.PROP_ARTIFACT_ID.equals(name) ) {
                     continue;
                 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Deserializing and serializing a feature model file suffles the configurations
> -----------------------------------------------------------------------------
>
>                 Key: SLING-7752
>                 URL: https://issues.apache.org/jira/browse/SLING-7752
>             Project: Sling
>          Issue Type: Bug
>          Components: Feature Model
>            Reporter: Andrei Tuicu
>            Assignee: David Bosschaert
>            Priority: Major
>             Fix For: Feature Model 0.1.4, Feature Model IO 0.1.4
>
>
> h3. Problem
> Deserializing and serializing a feature model file suffles the 
> configurations. This happens, because unordered maps (HashMaps/Hashtables) 
> are used in the implementations. The problem is relevant in the context of 
> adding these files in code versioning systems, because a minor change to a 
> file, done in an automated fashion, produces a big diff in the versioning 
> system and it becomes very hard to see exactly what is the relevant change. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to