You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2018/11/19 06:12:08 UTC
[maven-compiler-plugin] branch master updated (98895a8 -> 8759478)
This is an automated email from the ASF dual-hosted git repository.
olamy pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/maven-compiler-plugin.git.
from 98895a8 fix typo
new 782112f get rid of @version $ we are now using git :)
new 8759478 use some 1.7 sugar syntax
The 2 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.
Summary of changes:
.../apache/maven/plugin/AbstractCompilerMojo.java | 1 -
.../maven/plugin/CompilationFailureException.java | 1 -
.../java/org/apache/maven/plugin/CompilerMojo.java | 1 -
.../org/apache/maven/plugin/TestCompilerMojo.java | 1 -
.../plugin/compiler/AbstractCompilerMojo.java | 42 +++++++---------------
.../apache/maven/plugin/compiler/CompilerMojo.java | 17 +++++----
.../maven/plugin/compiler/TestCompilerMojo.java | 7 ++--
7 files changed, 24 insertions(+), 46 deletions(-)
[maven-compiler-plugin] 02/02: use some 1.7 sugar syntax
Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
olamy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-compiler-plugin.git
commit 875947802d28bcf8348eb634985c0512a790170a
Author: olivier lamy <ol...@apache.org>
AuthorDate: Mon Nov 19 16:11:43 2018 +1000
use some 1.7 sugar syntax
Signed-off-by: olivier lamy <ol...@apache.org>
---
.../plugin/compiler/AbstractCompilerMojo.java | 41 +++++++---------------
.../apache/maven/plugin/compiler/CompilerMojo.java | 16 ++++-----
.../maven/plugin/compiler/TestCompilerMojo.java | 6 ++--
3 files changed, 24 insertions(+), 39 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java
index c1bd5be..0ac1e27 100644
--- a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java
+++ b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java
@@ -974,7 +974,7 @@ public abstract class AbstractCompilerMojo
}
- List<String> jpmsLines = new ArrayList<String>();
+ List<String> jpmsLines = new ArrayList<>();
// See http://openjdk.java.net/jeps/261
final List<String> runtimeArgs = Arrays.asList( "--upgrade-module-path",
@@ -1155,9 +1155,9 @@ public abstract class AbstractCompilerMojo
}
}
- List<CompilerMessage> warnings = new ArrayList<CompilerMessage>();
- List<CompilerMessage> errors = new ArrayList<CompilerMessage>();
- List<CompilerMessage> others = new ArrayList<CompilerMessage>();
+ List<CompilerMessage> warnings = new ArrayList<>();
+ List<CompilerMessage> errors = new ArrayList<>();
+ List<CompilerMessage> others = new ArrayList<>();
for ( CompilerMessage message : compilerResult.getCompilerMessages() )
{
if ( message.getKind() == CompilerMessage.Kind.ERROR )
@@ -1255,7 +1255,7 @@ public abstract class AbstractCompilerMojo
{
return new CompilerResult();
}
- List<CompilerMessage> messages = new ArrayList<CompilerMessage>( compilerErrors.size() );
+ List<CompilerMessage> messages = new ArrayList<>( compilerErrors.size() );
boolean success = true;
for ( CompilerError compilerError : compilerErrors )
{
@@ -1291,7 +1291,7 @@ public abstract class AbstractCompilerMojo
scanner.addSourceMapping( mapping );
- Set<File> compileSources = new HashSet<File>();
+ Set<File> compileSources = new HashSet<>();
for ( String sourceRoot : getCompileSourceRoots() )
{
@@ -1427,23 +1427,8 @@ public abstract class AbstractCompilerMojo
tc = tcs.get( 0 );
}
}
- catch ( NoSuchMethodException e )
- {
- // ignore
- }
- catch ( SecurityException e )
- {
- // ignore
- }
- catch ( IllegalAccessException e )
- {
- // ignore
- }
- catch ( IllegalArgumentException e )
- {
- // ignore
- }
- catch ( InvocationTargetException e )
+ catch ( NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException
+ | InvocationTargetException e )
{
// ignore
}
@@ -1488,7 +1473,7 @@ public abstract class AbstractCompilerMojo
scanner.addSourceMapping( mapping );
- Set<File> staleSources = new HashSet<File>();
+ Set<File> staleSources = new HashSet<>();
for ( String sourceRoot : getCompileSourceRoots() )
{
@@ -1543,7 +1528,7 @@ public abstract class AbstractCompilerMojo
*/
private static List<String> removeEmptyCompileSourceRoots( List<String> compileSourceRootsList )
{
- List<String> newCompileSourceRootsList = new ArrayList<String>();
+ List<String> newCompileSourceRootsList = new ArrayList<>();
if ( compileSourceRootsList != null )
{
// copy as I may be modifying it
@@ -1576,13 +1561,13 @@ public abstract class AbstractCompilerMojo
if ( fileExtensions == null || fileExtensions.isEmpty() )
{
- fileExtensions = new ArrayList<String>();
+ fileExtensions = new ArrayList<>();
fileExtensions.add( "class" );
}
Date buildStartTime = getBuildStartTime();
- List<String> pathElements = new ArrayList<String>();
+ List<String> pathElements = new ArrayList<>();
pathElements.addAll( getClasspathElements() );
pathElements.addAll( getModulepathElements() );
@@ -1646,7 +1631,7 @@ public abstract class AbstractCompilerMojo
try
{
- Set<Artifact> requiredArtifacts = new LinkedHashSet<Artifact>();
+ Set<Artifact> requiredArtifacts = new LinkedHashSet<>();
for ( DependencyCoordinate coord : annotationProcessorPaths )
{
diff --git a/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java
index ddf6c50..568b063 100644
--- a/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java
+++ b/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java
@@ -87,13 +87,13 @@ public class CompilerMojo
* A list of inclusion filters for the compiler.
*/
@Parameter
- private Set<String> includes = new HashSet<String>();
+ private Set<String> includes = new HashSet<>();
/**
* A list of exclusion filters for the compiler.
*/
@Parameter
- private Set<String> excludes = new HashSet<String>();
+ private Set<String> excludes = new HashSet<>();
/**
* <p>
@@ -216,9 +216,9 @@ public class CompilerMojo
// and we can detect if auto modules are used. In that case, MavenProject.setFile() should not be used, so
// you cannot depend on this project and so it won't be distributed.
- modulepathElements = new ArrayList<String>( compilePath.size() );
- classpathElements = new ArrayList<String>( compilePath.size() );
- pathElements = new LinkedHashMap<String, JavaModuleDescriptor>( compilePath.size() );
+ modulepathElements = new ArrayList<>( compilePath.size() );
+ classpathElements = new ArrayList<>( compilePath.size() );
+ pathElements = new LinkedHashMap<>( compilePath.size() );
ResolvePathsResult<File> resolvePathsResult;
try
@@ -284,7 +284,7 @@ public class CompilerMojo
{
if ( compilerArgs == null )
{
- compilerArgs = new ArrayList<String>();
+ compilerArgs = new ArrayList<>();
}
if ( getOutputDirectory().toPath().startsWith( file.getPath() ) )
@@ -307,7 +307,7 @@ public class CompilerMojo
if ( compilerArgs == null )
{
- compilerArgs = new ArrayList<String>();
+ compilerArgs = new ArrayList<>();
}
compilerArgs.add( "--module-version" );
compilerArgs.add( getProject().getVersion() );
@@ -328,7 +328,7 @@ public class CompilerMojo
private List<File> getCompileClasspathElements( MavenProject project )
{
// 3 is outputFolder + 2 preserved for multirelease
- List<File> list = new ArrayList<File>( project.getArtifacts().size() + 3 );
+ List<File> list = new ArrayList<>( project.getArtifacts().size() + 3 );
if ( multiReleaseOutput )
{
diff --git a/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java
index b666a60..f8b9ba1 100644
--- a/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java
+++ b/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java
@@ -83,13 +83,13 @@ public class TestCompilerMojo
* A list of inclusion filters for the compiler.
*/
@Parameter
- private Set<String> testIncludes = new HashSet<String>();
+ private Set<String> testIncludes = new HashSet<>();
/**
* A list of exclusion filters for the compiler.
*/
@Parameter
- private Set<String> testExcludes = new HashSet<String>();
+ private Set<String> testExcludes = new HashSet<>();
/**
* The -source argument for the test Java compiler.
@@ -266,7 +266,7 @@ public class TestCompilerMojo
mainModuleDescriptor = result.getMainModuleDescriptor();
- pathElements = new LinkedHashMap<String, JavaModuleDescriptor>( result.getPathElements().size() );
+ pathElements = new LinkedHashMap<>( result.getPathElements().size() );
pathElements.putAll( result.getPathElements() );
modulepathElements = result.getModulepathElements().keySet();
[maven-compiler-plugin] 01/02: get rid of @version $ we are now
using git :)
Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
olamy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-compiler-plugin.git
commit 782112fc8b902353873815e073467ede2357388a
Author: olivier lamy <ol...@apache.org>
AuthorDate: Mon Nov 19 16:04:12 2018 +1000
get rid of @version $ we are now using git :)
Signed-off-by: olivier lamy <ol...@apache.org>
---
src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java | 1 -
src/main/java/org/apache/maven/plugin/CompilationFailureException.java | 1 -
src/main/java/org/apache/maven/plugin/CompilerMojo.java | 1 -
src/main/java/org/apache/maven/plugin/TestCompilerMojo.java | 1 -
src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java | 1 -
src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java | 1 -
src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java | 1 -
7 files changed, 7 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java b/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java
index 3ecb4e0..4a69cfc 100644
--- a/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java
+++ b/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java
@@ -27,7 +27,6 @@ package org.apache.maven.plugin;
*
* @author others
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
- * @version $Id$
* @since 2.0
* @deprecated package change since 3.0
*/
diff --git a/src/main/java/org/apache/maven/plugin/CompilationFailureException.java b/src/main/java/org/apache/maven/plugin/CompilationFailureException.java
index e546337..dbf8c3d 100644
--- a/src/main/java/org/apache/maven/plugin/CompilationFailureException.java
+++ b/src/main/java/org/apache/maven/plugin/CompilationFailureException.java
@@ -26,7 +26,6 @@ import java.util.List;
/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @version $Id$
- * @since 2.0
* @deprecated package change since 3.0
*/
@SuppressWarnings ( "serial" )
diff --git a/src/main/java/org/apache/maven/plugin/CompilerMojo.java b/src/main/java/org/apache/maven/plugin/CompilerMojo.java
index 34576df..20a1fa1 100644
--- a/src/main/java/org/apache/maven/plugin/CompilerMojo.java
+++ b/src/main/java/org/apache/maven/plugin/CompilerMojo.java
@@ -23,7 +23,6 @@ package org.apache.maven.plugin;
* Compiles application sources
*
* @author <a href="mailto:jason@maven.org">Jason van Zyl </a>
- * @version $Id$
* @since 2.0
* @deprecated package change since 3.0
*/
diff --git a/src/main/java/org/apache/maven/plugin/TestCompilerMojo.java b/src/main/java/org/apache/maven/plugin/TestCompilerMojo.java
index 1247b5b..021d4db 100644
--- a/src/main/java/org/apache/maven/plugin/TestCompilerMojo.java
+++ b/src/main/java/org/apache/maven/plugin/TestCompilerMojo.java
@@ -23,7 +23,6 @@ package org.apache.maven.plugin;
* Compiles application test sources.
*
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
- * @version $Id$
* @since 2.0
* @deprecated package change since 3.0
*/
diff --git a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java
index d898020..c1bd5be 100644
--- a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java
+++ b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java
@@ -90,7 +90,6 @@ import org.codehaus.plexus.languages.java.version.JavaVersion;
*
* @author others
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
- * @version $Id$
* @since 2.0
*/
public abstract class AbstractCompilerMojo
diff --git a/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java
index d4f8b08..ddf6c50 100644
--- a/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java
+++ b/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java
@@ -56,7 +56,6 @@ import org.codehaus.plexus.languages.java.jpms.ResolvePathsResult.ModuleNameSour
* Compiles application sources
*
* @author <a href="mailto:jason@maven.org">Jason van Zyl </a>
- * @version $Id$
* @since 2.0
*/
@Mojo( name = "compile", defaultPhase = LifecyclePhase.COMPILE, threadSafe = true,
diff --git a/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java
index 7fbe75d..b666a60 100644
--- a/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java
+++ b/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java
@@ -53,7 +53,6 @@ import org.codehaus.plexus.languages.java.jpms.ResolvePathsResult;
* Compiles application test sources.
*
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
- * @version $Id$
* @since 2.0
*/
@Mojo( name = "testCompile", defaultPhase = LifecyclePhase.TEST_COMPILE, threadSafe = true,