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:23 UTC

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

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();