Author: olamy Date: Mon Oct 10 09:59:17 2011 New Revision: 1180852 URL: http://svn.apache.org/viewvc?rev=1180852&view=rev Log: fix some checkstyle issues
Modified: tomcat/maven-plugin/trunk/BUILD.TXT tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/DefaultMessagesProvider.java tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/MessagesProvider.java tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ClassLoaderEntriesCalculator.java tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/EmbeddedRegistry.java tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ExternalRepositoriesReloadableWebappLoader.java tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/TomcatRunException.java Modified: tomcat/maven-plugin/trunk/BUILD.TXT URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/BUILD.TXT?rev=1180852&r1=1180851&r2=1180852&view=diff ============================================================================== --- tomcat/maven-plugin/trunk/BUILD.TXT (original) +++ tomcat/maven-plugin/trunk/BUILD.TXT Mon Oct 10 09:59:17 2011 @@ -15,3 +15,5 @@ Note you need some configuration in ~/.m </server If you have a nice ssh key in ~/.ssh/ no need of configuring password, privateKey, passphrase. + +Checkstyle: this project use the Apache Maven checkstyle configuration for ide codestyle files see http://maven.apache.org/developers/committer-environment.html . Modified: tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/DefaultMessagesProvider.java URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/DefaultMessagesProvider.java?rev=1180852&r1=1180851&r2=1180852&view=diff ============================================================================== --- tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/DefaultMessagesProvider.java (original) +++ tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/DefaultMessagesProvider.java Mon Oct 10 09:59:17 2011 @@ -1,4 +1,5 @@ package org.apache.tomcat.maven.common.messages; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file Modified: tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/MessagesProvider.java URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/MessagesProvider.java?rev=1180852&r1=1180851&r2=1180852&view=diff ============================================================================== --- tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/MessagesProvider.java (original) +++ tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/messages/MessagesProvider.java Mon Oct 10 09:59:17 2011 @@ -1,4 +1,5 @@ package org.apache.tomcat.maven.common.messages; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file Modified: tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ClassLoaderEntriesCalculator.java URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ClassLoaderEntriesCalculator.java?rev=1180852&r1=1180851&r2=1180852&view=diff ============================================================================== --- tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ClassLoaderEntriesCalculator.java (original) +++ tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ClassLoaderEntriesCalculator.java Mon Oct 10 09:59:17 2011 @@ -1,4 +1,5 @@ package org.apache.tomcat.maven.common.run; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file Modified: tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java?rev=1180852&r1=1180851&r2=1180852&view=diff ============================================================================== --- tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java (original) +++ tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java Mon Oct 10 09:59:17 2011 @@ -1,4 +1,5 @@ package org.apache.tomcat.maven.common.run; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -39,7 +40,7 @@ import java.util.Set; public class DefaultClassLoaderEntriesCalculator implements ClassLoaderEntriesCalculator { - public List<String> calculateClassPathEntries(MavenProject project, Set<Artifact> dependencies, Log log) + public List<String> calculateClassPathEntries( MavenProject project, Set<Artifact> dependencies, Log log ) throws TomcatRunException { List<String> classLoaderEntries = new ArrayList<String>(); @@ -52,18 +53,18 @@ public class DefaultClassLoaderEntriesCa { for ( String classPathElement : classPathElements ) { - File classPathElementFile = new File(classPathElement); + File classPathElementFile = new File( classPathElement ); if ( classPathElementFile.exists() && classPathElementFile.isDirectory() ) { - log.debug("adding classPathElementFile " + classPathElementFile.toURI().toString()); - classLoaderEntries.add(classPathElementFile.toURI().toString()); + log.debug( "adding classPathElementFile " + classPathElementFile.toURI().toString() ); + classLoaderEntries.add( classPathElementFile.toURI().toString() ); } } } } catch ( DependencyResolutionRequiredException e ) { - throw new TomcatRunException(e.getMessage(), e); + throw new TomcatRunException( e.getMessage(), e ); } // add artifacts to loader @@ -74,18 +75,18 @@ public class DefaultClassLoaderEntriesCa String scope = artifact.getScope(); // skip provided and test scoped artifacts - if ( !Artifact.SCOPE_PROVIDED.equals(scope) && !Artifact.SCOPE_TEST.equals(scope) ) + if ( !Artifact.SCOPE_PROVIDED.equals( scope ) && !Artifact.SCOPE_TEST.equals( scope ) ) { log.debug( "add dependency to webapploader " + artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" - + artifact.getVersion() + ":" + artifact.getScope()); - if ( !isInProjectReferences(artifact, project) ) + + artifact.getVersion() + ":" + artifact.getScope() ); + if ( !isInProjectReferences( artifact, project ) ) { - classLoaderEntries.add(artifact.getFile().toURI().toString()); + classLoaderEntries.add( artifact.getFile().toURI().toString() ); } else { - log.debug("skip adding artifact " + artifact.getArtifactId() + " as it's in reactors"); + log.debug( "skip adding artifact " + artifact.getArtifactId() + " as it's in reactors" ); } } } @@ -93,7 +94,7 @@ public class DefaultClassLoaderEntriesCa return classLoaderEntries; } - protected boolean isInProjectReferences(Artifact artifact, MavenProject project) + protected boolean isInProjectReferences( Artifact artifact, MavenProject project ) { if ( project.getProjectReferences() == null || project.getProjectReferences().isEmpty() ) { @@ -103,7 +104,7 @@ public class DefaultClassLoaderEntriesCa project.getProjectReferences().values(); for ( MavenProject mavenProject : mavenProjects ) { - if ( StringUtils.equals(mavenProject.getId(), artifact.getId()) ) + if ( StringUtils.equals( mavenProject.getId(), artifact.getId() ) ) { return true; } Modified: tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/EmbeddedRegistry.java URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/EmbeddedRegistry.java?rev=1180852&r1=1180851&r2=1180852&view=diff ============================================================================== --- tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/EmbeddedRegistry.java (original) +++ tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/EmbeddedRegistry.java Mon Oct 10 09:59:17 2011 @@ -19,8 +19,6 @@ package org.apache.tomcat.maven.common.r * under the License. */ -import org.apache.catalina.LifecycleException; -import org.apache.catalina.startup.Embedded; import org.apache.maven.plugin.logging.Log; import java.lang.reflect.InvocationTargetException; @@ -41,7 +39,7 @@ public final class EmbeddedRegistry { private static EmbeddedRegistry instance; - private Set<Object> containers = new HashSet<Object>(1); + private Set<Object> containers = new HashSet<Object>( 1 ); /** * Don't instantiate - use the instance through {@link #getInstance()}. @@ -61,14 +59,14 @@ public final class EmbeddedRegistry if ( instance == null ) { instance = new EmbeddedRegistry(); - Runtime.getRuntime().addShutdownHook(new Thread() + Runtime.getRuntime().addShutdownHook( new Thread() { @Override public void run() { try { - getInstance().shutdownAll(null); + getInstance().shutdownAll( null ); } catch ( Exception e ) { @@ -87,9 +85,9 @@ public final class EmbeddedRegistry * @param container the container to register * @return true if it got added; false if not */ - public synchronized boolean register(final Object container) + public synchronized boolean register( final Object container ) { - return containers.add(container); + return containers.add( container ); } /** @@ -100,7 +98,7 @@ public final class EmbeddedRegistry * @throws org.apache.catalina.LifecycleException * the first exception which occurred will be rethrown */ - public synchronized void shutdownAll(final Log log) + public synchronized void shutdownAll( final Log log ) throws Exception { Exception firstException = null; @@ -109,8 +107,8 @@ public final class EmbeddedRegistry Object embedded = iterator.next(); try { - Method method = embedded.getClass().getMethod("stop", null); - method.invoke(embedded, null); + Method method = embedded.getClass().getMethod( "stop", null ); + method.invoke( embedded, null ); iterator.remove(); } catch ( NoSuchMethodException e ) @@ -118,11 +116,11 @@ public final class EmbeddedRegistry if ( firstException == null ) { firstException = e; - error(log, e, "no stop method in class " + embedded.getClass().getName()); + error( log, e, "no stop method in class " + embedded.getClass().getName() ); } else { - error(log, e, "Error while shutting down embedded Tomcat."); + error( log, e, "Error while shutting down embedded Tomcat." ); } } catch ( IllegalAccessException e ) @@ -130,11 +128,11 @@ public final class EmbeddedRegistry if ( firstException == null ) { firstException = e; - error(log, e, "IllegalAccessException for stop method in class " + embedded.getClass().getName()); + error( log, e, "IllegalAccessException for stop method in class " + embedded.getClass().getName() ); } else { - error(log, e, "Error while shutting down embedded Tomcat."); + error( log, e, "Error while shutting down embedded Tomcat." ); } } catch ( InvocationTargetException e ) @@ -143,11 +141,11 @@ public final class EmbeddedRegistry if ( firstException == null ) { firstException = e; - error(log, e, "IllegalAccessException for stop method in class " + embedded.getClass().getName()); + error( log, e, "IllegalAccessException for stop method in class " + embedded.getClass().getName() ); } else { - error(log, e, "Error while shutting down embedded Tomcat."); + error( log, e, "Error while shutting down embedded Tomcat." ); } } } @@ -165,16 +163,16 @@ public final class EmbeddedRegistry * @param e exception which shall be reported * @param message message which shall be reported */ - private void error(final Log log, final Exception e, final String message) + private void error( final Log log, final Exception e, final String message ) { if ( log == null ) { - System.err.println("ERROR: " + message); + System.err.println( "ERROR: " + message ); e.printStackTrace(); } else { - log.error(message, e); + log.error( message, e ); } } Modified: tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ExternalRepositoriesReloadableWebappLoader.java URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ExternalRepositoriesReloadableWebappLoader.java?rev=1180852&r1=1180851&r2=1180852&view=diff ============================================================================== --- tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ExternalRepositoriesReloadableWebappLoader.java (original) +++ tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ExternalRepositoriesReloadableWebappLoader.java Mon Oct 10 09:59:17 2011 @@ -57,7 +57,7 @@ public class ExternalRepositoriesReloada * Convenience Constructor allows setting of a parent ClassLoader. * @param parent the ClassLoader instance to set as this Loader's parent ClassLoader. */ - public ExternalRepositoriesReloadableWebappLoader(ClassLoader parent, Log log) + public ExternalRepositoriesReloadableWebappLoader( ClassLoader parent, Log log ) { super( parent ); this.log = log; @@ -127,7 +127,7 @@ public class ExternalRepositoriesReloada boolean modified = super.modified(); if ( !modified ) { - if (log != null ) + if ( log != null ) { log.debug( "classPath scanning started at " + new Date().toString() ); } @@ -154,7 +154,7 @@ public class ExternalRepositoriesReloada } } } - if (log != null ) + if ( log != null ) { log.debug( "context " + modified + " at " + new Date().toString() ); } Modified: tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/TomcatRunException.java URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/TomcatRunException.java?rev=1180852&r1=1180851&r2=1180852&view=diff ============================================================================== --- tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/TomcatRunException.java (original) +++ tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/TomcatRunException.java Mon Oct 10 09:59:17 2011 @@ -1,4 +1,5 @@ package org.apache.tomcat.maven.common.run; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -27,6 +28,6 @@ public class TomcatRunException { public TomcatRunException( String s, Throwable throwable ) { - super(s, throwable); + super( s, throwable ); } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org