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 2022/05/22 18:53:24 UTC

[GitHub] [maven-plugin-tools] slawekjaranowski commented on a diff in pull request #85: [MPLUGIN-389] Update level to Java 8

slawekjaranowski commented on code in PR #85:
URL: https://github.com/apache/maven-plugin-tools/pull/85#discussion_r878911287


##########
maven-plugin-plugin/src/it/ant-reference-parameter/src/main/java/org/apache/maven/plugins/antWithRefs/ArtifactsTask.java:
##########
@@ -29,7 +29,7 @@
     public void execute()
         throws BuildException
     {
-        log( String.valueOf( getProject().getReference( "artifacts" ) ) );
+        log( String.valueOf( ( Object ) getProject().getReference( "artifacts" ) ) );

Review Comment:
   Without such cast we will have exception:
   
   ```
   Caused by: java.lang.ClassCastException: java.util.LinkedHashSet cannot be cast to [C
       at org.apache.maven.plugins.antWithRefs.ArtifactsTask.execute (ArtifactsTask.java:32)
       at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:299)
       at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
   ```
   
   As scripting Mojo are deprecated I didn't investigate it, simply did in such way to make test pass.



-- 
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