Pankraz76 commented on code in PR #2436:
URL: https://github.com/apache/maven/pull/2436#discussion_r2128851337


##########
src/mdo/java/WrapperProperties.java:
##########
@@ -350,28 +325,32 @@ public synchronized void loadFromXML(InputStream in) 
throws IOException, Invalid
 
     @Override
     public void storeToXML(OutputStream os, String comment) throws IOException 
{
-        Properties props = new Properties();
-        props.putAll(getter.get());
+        OrderedProperties props = new OrderedProperties(getter.get());
         props.storeToXML(os, comment);
     }
 
     @Override
     public void storeToXML(OutputStream os, String comment, String encoding) 
throws IOException {
-        Properties props = new Properties();
-        props.putAll(getter.get());
+        OrderedProperties props = new OrderedProperties(getter.get());
         props.storeToXML(os, comment, encoding);
     }
 
 
     private Object writeReplace() throws java.io.ObjectStreamException {
-        Properties props = new Properties();
-        props.putAll(getter.get());
+        OrderedProperties props = new OrderedProperties(getter.get());

Review Comment:
   yes it is, its declared `L:340` and used `L:341` in `return props;`.
   
   lets just ask judge `PMD`, im sure it will point out the same.  
   
   <img width="1795" alt="image" 
src="https://github.com/user-attachments/assets/68ae2c0e-6208-4a7e-9c2f-408589882f9c";
 />
   



##########
src/mdo/java/WrapperProperties.java:
##########
@@ -350,28 +325,32 @@ public synchronized void loadFromXML(InputStream in) 
throws IOException, Invalid
 
     @Override
     public void storeToXML(OutputStream os, String comment) throws IOException 
{
-        Properties props = new Properties();
-        props.putAll(getter.get());
+        OrderedProperties props = new OrderedProperties(getter.get());
         props.storeToXML(os, comment);
     }
 
     @Override
     public void storeToXML(OutputStream os, String comment, String encoding) 
throws IOException {
-        Properties props = new Properties();
-        props.putAll(getter.get());
+        OrderedProperties props = new OrderedProperties(getter.get());
         props.storeToXML(os, comment, encoding);
     }
 
 
     private Object writeReplace() throws java.io.ObjectStreamException {
-        Properties props = new Properties();
-        props.putAll(getter.get());

Review Comment:
   because its not used anymore.



##########
src/mdo/java/WrapperProperties.java:
##########
@@ -350,28 +325,32 @@ public synchronized void loadFromXML(InputStream in) 
throws IOException, Invalid
 
     @Override
     public void storeToXML(OutputStream os, String comment) throws IOException 
{
-        Properties props = new Properties();
-        props.putAll(getter.get());
+        OrderedProperties props = new OrderedProperties(getter.get());
         props.storeToXML(os, comment);
     }
 
     @Override
     public void storeToXML(OutputStream os, String comment, String encoding) 
throws IOException {
-        Properties props = new Properties();
-        props.putAll(getter.get());
+        OrderedProperties props = new OrderedProperties(getter.get());
         props.storeToXML(os, comment, encoding);
     }
 
 
     private Object writeReplace() throws java.io.ObjectStreamException {
-        Properties props = new Properties();
-        props.putAll(getter.get());
+        OrderedProperties props = new OrderedProperties(getter.get());
         return props;

Review Comment:
   direct return now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to