mirror of https://github.com/apache/maven.git
little coding style fixes (no code change)
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@804535 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
10c3b8f499
commit
3acee5c76e
|
@ -45,7 +45,7 @@ public class DefaultJavaToolChain
|
|||
super( model, "jdk", logger );
|
||||
}
|
||||
|
||||
public String getJavaHome( )
|
||||
public String getJavaHome()
|
||||
{
|
||||
return javaHome;
|
||||
}
|
||||
|
@ -55,18 +55,17 @@ public class DefaultJavaToolChain
|
|||
this.javaHome = javaHome;
|
||||
}
|
||||
|
||||
public String toString( )
|
||||
public String toString()
|
||||
{
|
||||
return "JDK[" + getJavaHome( ) + "]";
|
||||
return "JDK[" + getJavaHome() + "]";
|
||||
}
|
||||
|
||||
public String findTool( String toolName )
|
||||
{
|
||||
File toRet = findTool( toolName,
|
||||
new File( FileUtils.normalize( getJavaHome( ) ) ) );
|
||||
File toRet = findTool( toolName, new File( FileUtils.normalize( getJavaHome() ) ) );
|
||||
if ( toRet != null )
|
||||
{
|
||||
return toRet.getAbsolutePath( );
|
||||
return toRet.getAbsolutePath();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -74,15 +73,14 @@ public class DefaultJavaToolChain
|
|||
private static File findTool( String toolName, File installFolder )
|
||||
{
|
||||
File bin = new File( installFolder, "bin" ); //NOI18N
|
||||
if ( bin.exists( ) )
|
||||
if ( bin.exists() )
|
||||
{
|
||||
File tool = new File( bin,
|
||||
toolName + (Os.isFamily( "windows" ) ? ".exe" : "") ); //NOI18N
|
||||
if ( tool.exists( ) )
|
||||
File tool = new File( bin, toolName + ( Os.isFamily( "windows" ) ? ".exe" : "" ) ); // NOI18N
|
||||
if ( tool.exists() )
|
||||
{
|
||||
return tool;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -44,22 +44,24 @@ public class DefaultJavaToolchainFactory
|
|||
@Requirement
|
||||
private Logger logger;
|
||||
|
||||
public DefaultJavaToolchainFactory( )
|
||||
public DefaultJavaToolchainFactory()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public ToolchainPrivate createToolchain( ToolchainModel model )
|
||||
throws MisconfiguredToolchainException
|
||||
{
|
||||
if (model == null) {
|
||||
if ( model == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
DefaultJavaToolChain jtc = new DefaultJavaToolChain( model , logger);
|
||||
DefaultJavaToolChain jtc = new DefaultJavaToolChain( model, logger );
|
||||
Xpp3Dom dom = (Xpp3Dom) model.getConfiguration();
|
||||
Xpp3Dom javahome = dom.getChild( DefaultJavaToolChain.KEY_JAVAHOME );
|
||||
if ( javahome == null )
|
||||
{
|
||||
throw new MisconfiguredToolchainException( "Java toolchain without the " + DefaultJavaToolChain.KEY_JAVAHOME + " configuration element." );
|
||||
throw new MisconfiguredToolchainException( "Java toolchain without the "
|
||||
+ DefaultJavaToolChain.KEY_JAVAHOME + " configuration element." );
|
||||
}
|
||||
File normal = new File( FileUtils.normalize( javahome.getValue() ) );
|
||||
if ( normal.exists() )
|
||||
|
@ -68,7 +70,8 @@ public class DefaultJavaToolchainFactory
|
|||
}
|
||||
else
|
||||
{
|
||||
throw new MisconfiguredToolchainException( "Non-existing JDK home configuration at " + normal.getAbsolutePath( ) );
|
||||
throw new MisconfiguredToolchainException( "Non-existing JDK home configuration at "
|
||||
+ normal.getAbsolutePath() );
|
||||
}
|
||||
|
||||
//now populate the provides section.
|
||||
|
@ -100,13 +103,13 @@ public class DefaultJavaToolchainFactory
|
|||
public ToolchainPrivate createDefaultToolchain()
|
||||
{
|
||||
//not sure it's necessary to provide a default toolchain here.
|
||||
//only version can be eventually supplied, and
|
||||
//only version can be eventually supplied, and
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
protected Logger getLogger()
|
||||
{
|
||||
return logger;
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue