You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2021/12/25 22:47:03 UTC

[GitHub] [maven] michael-o opened a new pull request #643: Mng 5561

michael-o opened a new pull request #643:
URL: https://github.com/apache/maven/pull/643


   Following this checklist to help us incorporate your 
   contribution quickly and easily:
   
    - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MNG) filed 
          for the change (usually before you start working on it).  Trivial changes like typos do not 
          require a JIRA issue.  Your pull request should address just this issue, without 
          pulling in other changes.
    - [ ] Each commit in the pull request should have a meaningful subject line and body.
    - [ ] Format the pull request title like `[MNG-XXX] - Fixes bug in ApproximateQuantiles`,
          where you replace `MNG-XXX` with the appropriate JIRA issue. Best practice
          is to use the JIRA issue title in the pull request title and in the first line of the 
          commit message.
    - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    - [ ] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will 
          be performed on your pull request automatically.
    - [ ] You have run the [Core IT][core-its] successfully.
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under 
   the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
    - [ ] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
    - [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   [core-its]: https://maven.apache.org/core-its/core-it-suite/
   


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] michael-o closed pull request #643: [MNG-5561] Plugin relocation loses configuration

Posted by GitBox <gi...@apache.org>.
michael-o closed pull request #643:
URL: https://github.com/apache/maven/pull/643


   


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] michael-o edited a comment on pull request #643: [MNG-5561] Plugin relocation loses configuration

Posted by GitBox <gi...@apache.org>.
michael-o edited a comment on pull request #643:
URL: https://github.com/apache/maven/pull/643#issuecomment-1002980003


   @mthmulders Should I remove the `@Override`?


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] michael-o commented on a change in pull request #643: [MNG-5561] Plugin relocation loses configuration

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #643:
URL: https://github.com/apache/maven/pull/643#discussion_r776673637



##########
File path: maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java
##########
@@ -86,6 +86,39 @@ public String getVersion()
         }
     }
 
+    @Override

Review comment:
       Yes, we are using the new object. Checked myself and tripped over. I can drop the `@Override`, no issue.
   Another issue was also that the outcome was *not* a `RelocatedArtifact`, but a `DefaultArtifact`. This means that the original information was lost.




-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] mthmulders commented on a change in pull request #643: [MNG-5561] Plugin relocation loses configuration

Posted by GitBox <gi...@apache.org>.
mthmulders commented on a change in pull request #643:
URL: https://github.com/apache/maven/pull/643#discussion_r776665661



##########
File path: maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java
##########
@@ -86,6 +86,39 @@ public String getVersion()
         }
     }
 
+    @Override
+    public Artifact setVersion( String version )
+    {
+         String current = getVersion();
+         if ( current.equals( version ) || ( version == null && current.length() <= 0 ) )

Review comment:
       How could the length of `current` be `< 0`?




-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] michael-o commented on a change in pull request #643: [MNG-5561] Plugin relocation loses configuration

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #643:
URL: https://github.com/apache/maven/pull/643#discussion_r776669482



##########
File path: maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java
##########
@@ -86,6 +86,39 @@ public String getVersion()
         }
     }
 
+    @Override
+    public Artifact setVersion( String version )
+    {
+         String current = getVersion();
+         if ( current.equals( version ) || ( version == null && current.length() <= 0 ) )

Review comment:
       It can't. You see this pattern everywhere in Maven space. I simply copied the code from the parent class. I intentionally did not want to change it in this spot. It should be changed all at once everywhere.




-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] michael-o commented on a change in pull request #643: [MNG-5561] Plugin relocation loses configuration

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #643:
URL: https://github.com/apache/maven/pull/643#discussion_r776670895



##########
File path: maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java
##########
@@ -86,6 +86,39 @@ public String getVersion()
         }
     }
 
+    @Override
+    public Artifact setVersion( String version )
+    {
+         String current = getVersion();
+         if ( current.equals( version ) || ( version == null && current.length() <= 0 ) )

Review comment:
       Negative (black) magic.




-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] michael-o commented on pull request #643: [MNG-5561] Plugin relocation loses configuration

Posted by GitBox <gi...@apache.org>.
michael-o commented on pull request #643:
URL: https://github.com/apache/maven/pull/643#issuecomment-1002980003


   @mthmulders Should I remove the `@Override`.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] michael-o commented on pull request #643: [MNG-5561] Plugin relocation loses configuration

Posted by GitBox <gi...@apache.org>.
michael-o commented on pull request #643:
URL: https://github.com/apache/maven/pull/643#issuecomment-1006702346


   Merged.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] mthmulders commented on pull request #643: [MNG-5561] Plugin relocation loses configuration

Posted by GitBox <gi...@apache.org>.
mthmulders commented on pull request #643:
URL: https://github.com/apache/maven/pull/643#issuecomment-1002980811


   > @mthmulders Should I remove the `@Override`?
   
   I don't see a reason for that... If it is a valid override (and it is), I think it makes sense to keep the annotation there.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] mthmulders commented on a change in pull request #643: [MNG-5561] Plugin relocation loses configuration

Posted by GitBox <gi...@apache.org>.
mthmulders commented on a change in pull request #643:
URL: https://github.com/apache/maven/pull/643#discussion_r776671359



##########
File path: maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java
##########
@@ -86,6 +86,39 @@ public String getVersion()
         }
     }
 
+    @Override

Review comment:
       On a related note, why is it necessary to override these setters? I can see that in certain conditions, they will create a new instance of the `RelocatedArtifact` class rather than mutating the existing one. In general: yay for immutability!
   
   But the Maven codebase usually assumes a `setX` method to mutate the object it is called upon and ignores the return value (if any). So what problem does it solve, and are we sure that whenever we invoke it, we continue with the new object rather than the (unmodified) original object?




-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] mthmulders commented on a change in pull request #643: [MNG-5561] Plugin relocation loses configuration

Posted by GitBox <gi...@apache.org>.
mthmulders commented on a change in pull request #643:
URL: https://github.com/apache/maven/pull/643#discussion_r776670249



##########
File path: maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java
##########
@@ -86,6 +86,39 @@ public String getVersion()
         }
     }
 
+    @Override
+    public Artifact setVersion( String version )
+    {
+         String current = getVersion();
+         if ( current.equals( version ) || ( version == null && current.length() <= 0 ) )

Review comment:
       It's the first time I encounter it... Just being curious




-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] michael-o commented on a change in pull request #643: [MNG-5561] Plugin relocation loses configuration

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #643:
URL: https://github.com/apache/maven/pull/643#discussion_r776673637



##########
File path: maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java
##########
@@ -86,6 +86,39 @@ public String getVersion()
         }
     }
 
+    @Override

Review comment:
       Yes, we are using the new object. Checked myself and tripped over. I can drop the `@Override`, no issue.




-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org