improved javadoc and Java toolchain implementation class name (not a

Plexus component, then DefaultComponentName convention doesn't apply)
This commit is contained in:
Hervé Boutemy 2014-11-08 22:43:09 +01:00
parent 36d746789d
commit e661aa87f5
7 changed files with 16 additions and 15 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -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 );
}

View File

@ -70,6 +70,6 @@ Maven Core
to manage toolchain selection,
* internal JDK toolchain implementation: <<<JavaToolchain>>> interface ({{{./apidocs/org/apache/maven/toolchain/java/JavaToolchain.html}javadoc}}),
with its <<<DefaultJavaToolchain>>> implementation
({{{./xref/org/apache/maven/toolchain/java/DefaultJavaToolchain.html}source}}) and <<<JavaToolchainFactory>>>
with its <<<JavaToolchainImpl>>> implementation
({{{./xref/org/apache/maven/toolchain/java/JavaToolchainImpl.html}source}}) and <<<JavaToolchainFactory>>>
factory ({{{./xref/org/apache/maven/toolchain/java/JavaToolchainFactory.html}source}}).

View File

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