From: Lukas T. <luk...@us...> - 2007-05-13 18:51:23
|
lukas_theussl 07/05/13 11:51:22 Modified: javaapp/src/main/net/sourceforge/mavenplugins/javaapp JavaAppArtifactTypeHandler.java javaapp/src/test/net/sourceforge/mavenplugins/javaapp JavaAppArtifactTypeHandlerTest.java Added: javaapp/src/main/net/sourceforge/mavenplugins/javaapp package.html javaapp/src/test/net/sourceforge/mavenplugins/javaapp package.html Log: Checkstyle fixes. Revision Changes Path 1.2 +19 -17 maven-plugins/javaapp/src/main/net/sourceforge/mavenplugins/javaapp/JavaAppArtifactTypeHandler.java Index: JavaAppArtifactTypeHandler.java =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/javaapp/src/main/net/sourceforge/mavenplugins/javaapp/JavaAppArtifactTypeHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- JavaAppArtifactTypeHandler.java 16 Nov 2004 18:32:39 -0000 1.1 +++ JavaAppArtifactTypeHandler.java 13 May 2007 18:51:22 -0000 1.2 @@ -23,42 +23,44 @@ /** * Handler for the type extension. - * - * @author <a href="mailto:jo...@sf...">Jörg Schaible</a> + * + * @author <a href="mailto:jo...@sf...">Jörg Schaible</a> * @since 1.3 */ -public class JavaAppArtifactTypeHandler extends DefaultArtifactTypeHandler -{ - final private boolean keepExtension; - +public class JavaAppArtifactTypeHandler extends DefaultArtifactTypeHandler { + + /** Retain the original extension. */ + private final boolean keepExtension; + /** - * Constructs a type handler, that does not keep the extension in + * Constructs a type handler, that does not keep the extension in * the repository. */ public JavaAppArtifactTypeHandler() { this(false); } - + /** * Constructs a type handler. - * @param keepExtension Flag to keep the type as extension in the + * @param newExtension Flag to keep the type as extension in the * repository. */ - public JavaAppArtifactTypeHandler(final boolean keepExtension) { - this.keepExtension = keepExtension; + public JavaAppArtifactTypeHandler(final boolean newExtension) { + this.keepExtension = newExtension; } - + /** * Map an artifact to a repository path. - * + * * @param project the project for the artifact - * @param type The type of the artifact + * @param type The type of the artifact * @param version The version of the artifact (may be a snapshot) * @return the path */ - public String constructRepositoryFullPath(String type, Project project, String version) - { - StringBuffer path = new StringBuffer(constructRepositoryDirectoryPath(type, project)); + public final String constructRepositoryFullPath(final String type, + final Project project, final String version) { + StringBuffer path = + new StringBuffer(constructRepositoryDirectoryPath(type, project)); path.append(project.getArtifactId()); path.append("-"); path.append(version); 1.1 maven-plugins/javaapp/src/main/net/sourceforge/mavenplugins/javaapp/package.html Index: package.html =================================================================== <html> <body> <p> ArtifactTypeHandler for javaapp plugin. </p> </body> </html> 1.2 +22 -8 maven-plugins/javaapp/src/test/net/sourceforge/mavenplugins/javaapp/JavaAppArtifactTypeHandlerTest.java Index: JavaAppArtifactTypeHandlerTest.java =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/javaapp/src/test/net/sourceforge/mavenplugins/javaapp/JavaAppArtifactTypeHandlerTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- JavaAppArtifactTypeHandlerTest.java 16 Nov 2004 18:32:40 -0000 1.1 +++ JavaAppArtifactTypeHandlerTest.java 13 May 2007 18:51:22 -0000 1.2 @@ -24,28 +24,42 @@ import junit.framework.TestCase; /** - * @author <a href="mailto:jo...@sf...">Jörg Schaible</a> + * @author <a href="mailto:jo...@sf...">Jörg Schaible</a> */ -public class JavaAppArtifactTypeHandlerTest extends TestCase -{ +public class JavaAppArtifactTypeHandlerTest extends TestCase { + + /** A maven project. */ private Project project; - protected void setUp() throws Exception { + /** Setup: constructs a maven project. + * @throws Exception Exception. + */ + protected final void setUp() throws Exception { super.setUp(); project = new Project(); project.setArtifactId("artifact-id"); project.setGroupId("group-id"); } - public void testTypeHandlerWithDefaultExtension() throws MavenException { + /** Tests default constructor. + * @throws MavenException MavenException. + */ + public final void testTypeHandlerWithDefaultExtension() + throws MavenException { ArtifactTypeHandler typeHandler = new JavaAppArtifactTypeHandler(); - String path = typeHandler.constructRepositoryFullPath("app", project, "version"); + String path = + typeHandler.constructRepositoryFullPath("app", project, "version"); assertEquals("group-id/apps/artifact-id-version.jar", path); } - public void testTypeHandlerKeepingTheExtension() throws MavenException { + /** Tests keepExtension. + * @throws MavenException MavenException. + */ + public final void testTypeHandlerKeepingTheExtension() + throws MavenException { ArtifactTypeHandler typeHandler = new JavaAppArtifactTypeHandler(true); - String path = typeHandler.constructRepositoryFullPath("app", project, "version"); + String path = + typeHandler.constructRepositoryFullPath("app", project, "version"); assertEquals("group-id/apps/artifact-id-version.app", path); } } 1.1 maven-plugins/javaapp/src/test/net/sourceforge/mavenplugins/javaapp/package.html Index: package.html =================================================================== <html> <body> <p> Tests for ArtifactTypeHandler for javaapp plugin. </p> </body> </html> |