You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2019/08/02 12:01:20 UTC

[maven-compiler-plugin] branch github-19 created (now ccd124a)

This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a change to branch github-19
in repository https://gitbox.apache.org/repos/asf/maven-compiler-plugin.git.


      at ccd124a  (doc) Simplify CompilationFailureException's shortMessage() method

This branch includes the following new commits:

     new 4d566f0  (doc) Add more javadoc to CompilationFailureExceptio
     new 4aa80ed  (doc) Remove nullity check in CompilationFailureException
     new ccd124a  (doc) Simplify CompilationFailureException's shortMessage() method

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-compiler-plugin] 02/03: (doc) Remove nullity check in CompilationFailureException

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch github-19
in repository https://gitbox.apache.org/repos/asf/maven-compiler-plugin.git

commit 4aa80ed34fd2b8ff8183ec4748bcf37860f32a47
Author: Russell Howe <rh...@siksai.co.uk>
AuthorDate: Sun May 5 14:43:37 2019 +0100

    (doc) Remove nullity check in CompilationFailureException
    
    If the messages list is null, this class will throw a NullPointerException in
    its shortMessage() method, so having a check for a null message list in
    longMessage() seems unnecessary. Remove it.
---
 .../maven/plugin/compiler/CompilationFailureException.java | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugin/compiler/CompilationFailureException.java b/src/main/java/org/apache/maven/plugin/compiler/CompilationFailureException.java
index 12c72e1..e47b058 100644
--- a/src/main/java/org/apache/maven/plugin/compiler/CompilationFailureException.java
+++ b/src/main/java/org/apache/maven/plugin/compiler/CompilationFailureException.java
@@ -37,7 +37,7 @@ public class CompilationFailureException
     /**
      * Wrap error messages from the compiler
      *
-     * @param messages the messages
+     * @param messages the messages, not null
      * @since 2.0
      */
     public CompilationFailureException( List<CompilerMessage> messages )
@@ -48,7 +48,7 @@ public class CompilationFailureException
     /**
      * Long message will have all messages, one per line
      *
-     * @param messages the messages
+     * @param messages the messages, not null
      * @return the long error message
      * @since 2.0
      */
@@ -56,20 +56,18 @@ public class CompilationFailureException
     {
         StringBuilder sb = new StringBuilder();
 
-        if ( messages != null )
+        for ( CompilerMessage compilerError : messages )
         {
-            for ( CompilerMessage compilerError : messages )
-            {
-                sb.append( compilerError ).append( LS );
-            }
+            sb.append( compilerError ).append( LS );
         }
+
         return sb.toString();
     }
 
     /**
      * Short message will have the error message if there's only one, useful for errors forking the compiler
      *
-     * @param messages the messages
+     * @param messages the messages, not null
      * @return the short error message
      * @since 2.0.2
      */


[maven-compiler-plugin] 01/03: (doc) Add more javadoc to CompilationFailureExceptio

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch github-19
in repository https://gitbox.apache.org/repos/asf/maven-compiler-plugin.git

commit 4d566f074c32a923d9b793ab1267fd1491dcd9ea
Author: Russell Howe <rh...@siksai.co.uk>
AuthorDate: Tue Jun 4 08:56:44 2019 +0100

    (doc) Add more javadoc to CompilationFailureExceptio
---
 .../maven/plugin/compiler/CompilationFailureException.java  | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/main/java/org/apache/maven/plugin/compiler/CompilationFailureException.java b/src/main/java/org/apache/maven/plugin/compiler/CompilationFailureException.java
index b231c8e..12c72e1 100644
--- a/src/main/java/org/apache/maven/plugin/compiler/CompilationFailureException.java
+++ b/src/main/java/org/apache/maven/plugin/compiler/CompilationFailureException.java
@@ -34,11 +34,24 @@ public class CompilationFailureException
 {
     private static final String LS = System.getProperty( "line.separator" );
 
+    /**
+     * Wrap error messages from the compiler
+     *
+     * @param messages the messages
+     * @since 2.0
+     */
     public CompilationFailureException( List<CompilerMessage> messages )
     {
         super( null, shortMessage( messages ), longMessage( messages ) );
     }
 
+    /**
+     * Long message will have all messages, one per line
+     *
+     * @param messages the messages
+     * @return the long error message
+     * @since 2.0
+     */
     public static String longMessage( List<CompilerMessage> messages )
     {
         StringBuilder sb = new StringBuilder();


[maven-compiler-plugin] 03/03: (doc) Simplify CompilationFailureException's shortMessage() method

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch github-19
in repository https://gitbox.apache.org/repos/asf/maven-compiler-plugin.git

commit ccd124ad951cc94e008fd540bde5d08eec294493
Author: Russell Howe <rh...@siksai.co.uk>
AuthorDate: Sun May 5 14:45:59 2019 +0100

    (doc) Simplify CompilationFailureException's shortMessage() method
---
 .../maven/plugin/compiler/CompilationFailureException.java     | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugin/compiler/CompilationFailureException.java b/src/main/java/org/apache/maven/plugin/compiler/CompilationFailureException.java
index e47b058..4d62454 100644
--- a/src/main/java/org/apache/maven/plugin/compiler/CompilationFailureException.java
+++ b/src/main/java/org/apache/maven/plugin/compiler/CompilationFailureException.java
@@ -73,17 +73,11 @@ public class CompilationFailureException
      */
     public static String shortMessage( List<CompilerMessage> messages )
     {
-        StringBuilder sb = new StringBuilder();
-
-        sb.append( "Compilation failure" );
+        StringBuilder sb = new StringBuilder( "Compilation failure" );
 
         if ( messages.size() == 1 )
         {
-            sb.append( LS );
-
-            CompilerMessage compilerError = messages.get( 0 );
-
-            sb.append( compilerError ).append( LS );
+            sb.append( LS ).append( messages.get( 0 ) ).append( LS );
         }
 
         return sb.toString();