From e661aa87f5f001547d42bddc8d91c7729613a6a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Sat, 8 Nov 2014 22:43:09 +0100 Subject: [PATCH] improved javadoc and Java toolchain implementation class name (not a Plexus component, then DefaultComponentName convention doesn't apply) --- .../java/org/apache/maven/toolchain/DefaultToolchain.java | 5 +++-- .../java/org/apache/maven/toolchain/ToolchainManager.java | 2 +- .../java/org/apache/maven/toolchain/java/JavaToolchain.java | 2 +- .../apache/maven/toolchain/java/JavaToolchainFactory.java | 6 +++--- .../{DefaultJavaToolchain.java => JavaToolchainImpl.java} | 6 +++--- maven-core/src/site/apt/index.apt | 4 ++-- .../org/apache/maven/toolchain/DefaultToolchainTest.java | 6 +++--- 7 files changed, 16 insertions(+), 15 deletions(-) rename maven-core/src/main/java/org/apache/maven/toolchain/java/{DefaultJavaToolchain.java => JavaToolchainImpl.java} (93%) diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchain.java b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchain.java index 65d947cb40..7c39474707 100644 --- a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchain.java +++ b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchain.java @@ -27,12 +27,13 @@ import org.apache.maven.toolchain.model.ToolchainModel; import org.codehaus.plexus.logging.Logger; /** - * Default toolchain implementation. + * Default abstract toolchain implementation, to be used as base class for any toolchain implementation + * to avoid rewriting usual code. * * @author mkleint * @since 2.0.9 */ -public abstract class DefaultToolchain +public abstract class DefaultToolchain // should have been AbstractToolchain... implements Toolchain, ToolchainPrivate { diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManager.java b/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManager.java index ee49b07869..2150a19b9f 100644 --- a/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManager.java +++ b/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManager.java @@ -23,7 +23,7 @@ import org.apache.maven.execution.MavenSession; /** - * Public API for a plugin to get a toolchain instance. + * Public API for a toolchain-aware plugin to get expected toolchain instance. * * @author mkleint * @since 2.0.9 diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchain.java b/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchain.java index 8cfc8f805a..494aaf896b 100644 --- a/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchain.java +++ b/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchain.java @@ -26,7 +26,7 @@ import org.apache.maven.toolchain.Toolchain; * * @author Jason van Zyl * @author Milos Kleint - * @since 2.0.9 + * @since 2.0.9, renamed from JavaToolChain in 3.2.4 */ public interface JavaToolchain extends Toolchain diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainFactory.java b/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainFactory.java index 9df707c9b3..9b790d8f2d 100644 --- a/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainFactory.java +++ b/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainFactory.java @@ -59,7 +59,7 @@ public class JavaToolchainFactory return null; } - DefaultJavaToolchain jtc = new DefaultJavaToolchain( model, logger ); + JavaToolchainImpl jtc = new JavaToolchainImpl( model, logger ); // populate the provides section Properties provides = model.getProvides(); @@ -89,11 +89,11 @@ public class JavaToolchainFactory // populate the configuration section Xpp3Dom dom = (Xpp3Dom) model.getConfiguration(); - Xpp3Dom javahome = dom.getChild( DefaultJavaToolchain.KEY_JAVAHOME ); + Xpp3Dom javahome = dom.getChild( JavaToolchainImpl.KEY_JAVAHOME ); if ( javahome == null ) { throw new MisconfiguredToolchainException( "Java toolchain without the " - + DefaultJavaToolchain.KEY_JAVAHOME + " configuration element." ); + + JavaToolchainImpl.KEY_JAVAHOME + " configuration element." ); } File normal = new File( FileUtils.normalize( javahome.getValue() ) ); if ( normal.exists() ) diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/java/DefaultJavaToolchain.java b/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainImpl.java similarity index 93% rename from maven-core/src/main/java/org/apache/maven/toolchain/java/DefaultJavaToolchain.java rename to maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainImpl.java index ee82013bb8..71c2ce8ce3 100644 --- a/maven-core/src/main/java/org/apache/maven/toolchain/java/DefaultJavaToolchain.java +++ b/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainImpl.java @@ -31,9 +31,9 @@ import org.codehaus.plexus.util.Os; * JDK toolchain implementation. * * @author Milos Kleint - * @since 2.0.9 + * @since 2.0.9, renamed from DefaultJavaToolChain in 3.2.4 */ -public class DefaultJavaToolchain +public class JavaToolchainImpl extends DefaultToolchain implements JavaToolchain { @@ -41,7 +41,7 @@ public class DefaultJavaToolchain public static final String KEY_JAVAHOME = "jdkHome"; //NOI18N - public DefaultJavaToolchain( ToolchainModel model, Logger logger ) + public JavaToolchainImpl( ToolchainModel model, Logger logger ) { super( model, "jdk", logger ); } diff --git a/maven-core/src/site/apt/index.apt b/maven-core/src/site/apt/index.apt index 316f695d8c..390215c073 100644 --- a/maven-core/src/site/apt/index.apt +++ b/maven-core/src/site/apt/index.apt @@ -70,6 +70,6 @@ Maven Core to manage toolchain selection, * internal JDK toolchain implementation: <<>> interface ({{{./apidocs/org/apache/maven/toolchain/java/JavaToolchain.html}javadoc}}), - with its <<>> implementation - ({{{./xref/org/apache/maven/toolchain/java/DefaultJavaToolchain.html}source}}) and <<>> + with its <<>> implementation + ({{{./xref/org/apache/maven/toolchain/java/JavaToolchainImpl.html}source}}) and <<>> factory ({{{./xref/org/apache/maven/toolchain/java/JavaToolchainFactory.html}source}}). diff --git a/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainTest.java b/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainTest.java index c0470cd31c..da0318ca9a 100644 --- a/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainTest.java +++ b/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainTest.java @@ -24,7 +24,7 @@ import static org.junit.Assert.assertTrue; import java.io.InputStream; -import org.apache.maven.toolchain.java.DefaultJavaToolchain; +import org.apache.maven.toolchain.java.JavaToolchainImpl; import org.apache.maven.toolchain.model.PersistedToolchains; import org.apache.maven.toolchain.model.ToolchainModel; import org.apache.maven.toolchain.model.io.xpp3.MavenToolchainsXpp3Reader; @@ -48,8 +48,8 @@ public class DefaultToolchainTest PersistedToolchains jdks = reader.read( jdksIS ); PersistedToolchains jdksExtra = reader.read( jdksExtraIS ); - DefaultJavaToolchain tc1 = new DefaultJavaToolchain( jdks.getToolchains().get( 0 ), null ); - DefaultJavaToolchain tc2 = new DefaultJavaToolchain( jdksExtra.getToolchains().get( 0 ), null ); + JavaToolchainImpl tc1 = new JavaToolchainImpl( jdks.getToolchains().get( 0 ), null ); + JavaToolchainImpl tc2 = new JavaToolchainImpl( jdksExtra.getToolchains().get( 0 ), null ); assertTrue( tc1.equals( tc1 ) ); assertFalse( tc1.equals( tc2 ) );