Author: hboutemy Date: Sat Oct 11 16:24:52 2014 New Revision: 1631079 URL: http://svn.apache.org/r1631079 Log: fixed errors reported by Checkstyle
Modified: maven/archetype/trunk/archetype-common/pom.xml maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeGenerationRequest.java maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeManager.java maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/common/DefaultPomManager.java maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/common/util/FileCharsetDetector.java maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/common/util/ListScanner.java maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/creator/FilesetArchetypeCreator.java maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/downloader/DefaultDownloader.java maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/old/DefaultOldArchetype.java maven/archetype/trunk/archetype-testing/archetype-proxy/src/main/java/org/apache/maven/archetype/proxy/ProxyServlet.java maven/archetype/trunk/archetype-testing/archetype-proxy/src/main/java/org/apache/maven/archetype/proxy/RepositoryServlet.java maven/archetype/trunk/archetype-testing/archetype-repository/src/main/java/org/apache/maven/archetype/repository/RepositoryServlet.java maven/archetype/trunk/maven-archetype-plugin/pom.xml maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateArchetypeFromProjectMojo.java maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeFactory.java maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypePrompter.java maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeFactory.java maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/generation/ArchetypeSelectionQueryer.java Modified: maven/archetype/trunk/archetype-common/pom.xml URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-common/pom.xml?rev=1631079&r1=1631078&r2=1631079&view=diff ============================================================================== --- maven/archetype/trunk/archetype-common/pom.xml (original) +++ maven/archetype/trunk/archetype-common/pom.xml Sat Oct 11 16:24:52 2014 @@ -37,6 +37,8 @@ under the License. <properties> <cargoVersion>1.0-alpha-6</cargoVersion> + <checkstyle.violation.ignore>RedundantThrows,NewlineAtEndOfFile,ParameterNumber,MethodLength,FileLength,javadoc,EmptyBlock,InterfaceIsType</checkstyle.violation.ignore> + <checkstyle.excludes>**/MavenJDOMWriter.java,**/XMLOutputter.java,**/Format.java,**/NamespaceStack.java</checkstyle.excludes> </properties> <dependencies> Modified: maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeGenerationRequest.java URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeGenerationRequest.java?rev=1631079&r1=1631078&r2=1631079&view=diff ============================================================================== --- maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeGenerationRequest.java (original) +++ maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeGenerationRequest.java Sat Oct 11 16:24:52 2014 @@ -338,7 +338,8 @@ public class ArchetypeGenerationRequest return remoteArtifactRepositories; } - public ArchetypeGenerationRequest setRemoteArtifactRepositories( List<ArtifactRepository> remoteArtifactRepositories ) + @SuppressWarnings( "checkstyle:linelength" ) + public ArchetypeGenerationRequest setRemoteArtifactRepositories( List<ArtifactRepository> remoteArtifactRepositories ) { this.remoteArtifactRepositories = remoteArtifactRepositories; Modified: maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeManager.java URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeManager.java?rev=1631079&r1=1631078&r2=1631079&view=diff ============================================================================== --- maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeManager.java (original) +++ maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeManager.java Sat Oct 11 16:24:52 2014 @@ -32,20 +32,20 @@ public interface ArchetypeManager String ROLE = ArchetypeManager.class.getName(); /** - * A command to create an archetype from an existing Maven project given the supplied - * creation request. + * A command to create an archetype from an existing Maven project given the supplied creation request. * * @param request - * @return The result of creating the archetype from the existing project. It contains any errors that might have occurred. + * @return The result of creating the archetype from the existing project. It contains any errors that might have + * occurred. */ ArchetypeCreationResult createArchetypeFromProject( ArchetypeCreationRequest request ); /** - * A command to generate a Maven project from an archetype given the supplied - * generation request. + * A command to generate a Maven project from an archetype given the supplied generation request. * * @param request - * @return The result of creating the project from the existing archetype. It contains any errors that might have occurred. + * @return The result of creating the project from the existing archetype. It contains any errors that might have + * occurred. */ ArchetypeGenerationResult generateProjectFromArchetype( ArchetypeGenerationRequest request ); @@ -74,7 +74,8 @@ public interface ArchetypeManager ArchetypeCatalog getLocalCatalog( String path ); /** - * Gives the catalog of archetypes located at <code>http://repo.maven.apache.org/maven2/archetype-catalog.xml</code>. + * Gives the catalog of archetypes located at + * <code>http://repo.maven.apache.org/maven2/archetype-catalog.xml</code>. * * @return the catalog. */ Modified: maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/common/DefaultPomManager.java URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/common/DefaultPomManager.java?rev=1631079&r1=1631078&r2=1631079&view=diff ============================================================================== --- maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/common/DefaultPomManager.java (original) +++ maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/common/DefaultPomManager.java Sat Oct 11 16:24:52 2014 @@ -317,7 +317,8 @@ public class DefaultPomManager outputStreamWriter = new OutputStreamWriter( new FileOutputStream( pomFile ), fileEncoding ); - Format form = Format.getRawFormat().setEncoding( fileEncoding ).setLineSeparator(System.getProperty("line.separator")); + final String ls = System.getProperty( "line.separator" ); + Format form = Format.getRawFormat().setEncoding( fileEncoding ).setLineSeparator( ls ); writer.write( model, doc, outputStreamWriter, form ); } catch ( JDOMException exc ) Modified: maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/common/util/FileCharsetDetector.java URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/common/util/FileCharsetDetector.java?rev=1631079&r1=1631078&r2=1631079&view=diff ============================================================================== --- maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/common/util/FileCharsetDetector.java (original) +++ maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/common/util/FileCharsetDetector.java Sat Oct 11 16:24:52 2014 @@ -48,6 +48,7 @@ public class FileCharsetDetector det.Init( new nsICharsetDetectionObserver() { + @SuppressWarnings( "checkstyle:methodname" ) public void Notify( String charset ) { FileCharsetDetector.this.charset = charset; @@ -113,6 +114,7 @@ public class FileCharsetDetector det.Init( new nsICharsetDetectionObserver() { + @SuppressWarnings( "checkstyle:methodname" ) public void Notify( String charset ) { FileCharsetDetector.this.charset = charset; Modified: maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/common/util/ListScanner.java URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/common/util/ListScanner.java?rev=1631079&r1=1631078&r2=1631079&view=diff ============================================================================== --- maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/common/util/ListScanner.java (original) +++ maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/common/util/ListScanner.java Sat Oct 11 16:24:52 2014 @@ -435,7 +435,6 @@ public class ListScanner for ( String fileName : files ) { -// System.err.println("Checking "+(isIncluded ( fileName )?"I":"-")+(isExcluded ( fileName )?"E":"-")+fileName); if ( isIncluded( fileName ) && !isExcluded( fileName ) ) { result.add( fileName ); Modified: maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/creator/FilesetArchetypeCreator.java URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/creator/FilesetArchetypeCreator.java?rev=1631079&r1=1631078&r2=1631079&view=diff ============================================================================== --- maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/creator/FilesetArchetypeCreator.java (original) +++ maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/creator/FilesetArchetypeCreator.java Sat Oct 11 16:24:52 2014 @@ -549,7 +549,7 @@ public class FilesetArchetypeCreator { for ( Iterator<Dependency> dependencies = pom.getDependencies().iterator(); dependencies.hasNext(); ) { - rewriteDependencyReferences(dependencies.next(), rootArtifactId, groupId); + rewriteDependencyReferences( dependencies.next(), rootArtifactId, groupId ); } } @@ -560,7 +560,7 @@ public class FilesetArchetypeCreator for ( Iterator<Dependency> dependencies = pom.getDependencyManagement().getDependencies().iterator(); dependencies.hasNext(); ) { - rewriteDependencyReferences(dependencies.next(), rootArtifactId, groupId); + rewriteDependencyReferences( dependencies.next(), rootArtifactId, groupId ); } } @@ -569,7 +569,7 @@ public class FilesetArchetypeCreator { for ( Iterator<Plugin> plugins = pom.getBuild().getPlugins().iterator(); plugins.hasNext(); ) { - rewritePluginReferences(plugins.next(), rootArtifactId, groupId); + rewritePluginReferences( plugins.next(), rootArtifactId, groupId ); } } @@ -581,7 +581,7 @@ public class FilesetArchetypeCreator for ( Iterator<Plugin> plugins = pom.getBuild().getPluginManagement().getPlugins().iterator(); plugins.hasNext(); ) { - rewritePluginReferences(plugins.next(), rootArtifactId, groupId); + rewritePluginReferences( plugins.next(), rootArtifactId, groupId ); } } @@ -598,7 +598,7 @@ public class FilesetArchetypeCreator for ( Iterator<Dependency> dependencies = profile.getDependencies().iterator(); dependencies.hasNext(); ) { - rewriteDependencyReferences(dependencies.next(), rootArtifactId, groupId); + rewriteDependencyReferences( dependencies.next(), rootArtifactId, groupId ); } } @@ -610,7 +610,7 @@ public class FilesetArchetypeCreator for ( Iterator<Dependency> dependencies = profile.getDependencyManagement().getDependencies().iterator(); dependencies.hasNext(); ) { - rewriteDependencyReferences(dependencies.next(), rootArtifactId, groupId); + rewriteDependencyReferences( dependencies.next(), rootArtifactId, groupId ); } } @@ -620,7 +620,7 @@ public class FilesetArchetypeCreator { for ( Iterator<Plugin> plugins = profile.getBuild().getPlugins().iterator(); plugins.hasNext(); ) { - rewritePluginReferences(plugins.next(), rootArtifactId, groupId); + rewritePluginReferences( plugins.next(), rootArtifactId, groupId ); } } @@ -632,24 +632,25 @@ public class FilesetArchetypeCreator for ( Iterator<Plugin> plugins = profile.getBuild().getPluginManagement().getPlugins().iterator(); plugins.hasNext(); ) { - rewritePluginReferences(plugins.next(), rootArtifactId, groupId); + rewritePluginReferences( plugins.next(), rootArtifactId, groupId ); } } } } } - private void rewriteDependencyReferences(Dependency dependency, String rootArtifactId, String groupId) { + private void rewriteDependencyReferences( Dependency dependency, String rootArtifactId, String groupId ) + { if ( dependency.getArtifactId() != null && dependency.getArtifactId().indexOf( rootArtifactId ) >= 0 ) { if ( dependency.getGroupId() != null ) { - dependency.setGroupId( - StringUtils.replace(dependency.getGroupId(), groupId, "${" + Constants.GROUP_ID + "}") ); + dependency.setGroupId( StringUtils.replace( dependency.getGroupId(), groupId, "${" + Constants.GROUP_ID + + "}" ) ); } - dependency.setArtifactId( - StringUtils.replace( dependency.getArtifactId(), rootArtifactId, "${rootArtifactId}" ) ); + dependency.setArtifactId( StringUtils.replace( dependency.getArtifactId(), rootArtifactId, + "${rootArtifactId}" ) ); if ( dependency.getVersion() != null ) { @@ -658,17 +659,17 @@ public class FilesetArchetypeCreator } } - private void rewritePluginReferences(Plugin plugin, String rootArtifactId, String groupId) { + private void rewritePluginReferences( Plugin plugin, String rootArtifactId, String groupId ) + { if ( plugin.getArtifactId() != null && plugin.getArtifactId().indexOf( rootArtifactId ) >= 0 ) { if ( plugin.getGroupId() != null ) { - plugin.setGroupId( - StringUtils.replace(plugin.getGroupId(), groupId, "${" + Constants.GROUP_ID + "}") ); + String g = StringUtils.replace( plugin.getGroupId(), groupId, "${" + Constants.GROUP_ID + "}" ); + plugin.setGroupId( g ); } - plugin.setArtifactId( - StringUtils.replace( plugin.getArtifactId(), rootArtifactId, "${rootArtifactId}" ) ); + plugin.setArtifactId( StringUtils.replace( plugin.getArtifactId(), rootArtifactId, "${rootArtifactId}" ) ); if ( plugin.getVersion() != null ) { @@ -678,13 +679,14 @@ public class FilesetArchetypeCreator if ( plugin.getArtifactId() != null && "maven-ear-plugin".equals( plugin.getArtifactId() ) ) { - rewriteEARPluginReferences(plugin, rootArtifactId, groupId); + rewriteEARPluginReferences( plugin, rootArtifactId, groupId ); } } - private void rewriteEARPluginReferences(Plugin plugin, String rootArtifactId, String groupId) { + private void rewriteEARPluginReferences( Plugin plugin, String rootArtifactId, String groupId ) + { Xpp3Dom configuration = (Xpp3Dom) plugin.getConfiguration(); - Xpp3Dom[] modules = configuration.getChild("modules").getChildren(); + Xpp3Dom[] modules = configuration.getChild( "modules" ).getChildren(); for ( int i = 0; i < modules.length; i++ ) { Xpp3Dom module = modules[i]; @@ -694,29 +696,34 @@ public class FilesetArchetypeCreator Xpp3Dom moduleModuleId = module.getChild( "moduleId" ); Xpp3Dom moduleContextRoot = module.getChild( "contextRoot" ); - if (moduleGroupId != null) + if ( moduleGroupId != null ) { - moduleGroupId.setValue( StringUtils.replace(moduleGroupId.getValue(), groupId, "${" + Constants.GROUP_ID + "}") ); + moduleGroupId.setValue( StringUtils.replace( moduleGroupId.getValue(), groupId, "${" + + Constants.GROUP_ID + "}" ) ); } - if (moduleArtifactId != null) + if ( moduleArtifactId != null ) { - moduleArtifactId.setValue( StringUtils.replace( moduleArtifactId.getValue(), rootArtifactId, "${rootArtifactId}" ) ); + moduleArtifactId.setValue( StringUtils.replace( moduleArtifactId.getValue(), rootArtifactId, + "${rootArtifactId}" ) ); } - if (moduleBundleFileName != null) + if ( moduleBundleFileName != null ) { - moduleBundleFileName.setValue( StringUtils.replace( moduleBundleFileName.getValue(), rootArtifactId, "${rootArtifactId}" ) ); + moduleBundleFileName.setValue( StringUtils.replace( moduleBundleFileName.getValue(), rootArtifactId, + "${rootArtifactId}" ) ); } - if (moduleModuleId != null) + if ( moduleModuleId != null ) { - moduleModuleId.setValue( StringUtils.replace( moduleModuleId.getValue(), rootArtifactId, "${rootArtifactId}" ) ); + moduleModuleId.setValue( StringUtils.replace( moduleModuleId.getValue(), rootArtifactId, + "${rootArtifactId}" ) ); } - if (moduleContextRoot != null) + if ( moduleContextRoot != null ) { - moduleContextRoot.setValue( StringUtils.replace( moduleContextRoot.getValue(), rootArtifactId, "${rootArtifactId}" ) ); + moduleContextRoot.setValue( StringUtils.replace( moduleContextRoot.getValue(), rootArtifactId, + "${rootArtifactId}" ) ); } } } Modified: maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/downloader/DefaultDownloader.java URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/downloader/DefaultDownloader.java?rev=1631079&r1=1631078&r2=1631079&view=diff ============================================================================== --- maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/downloader/DefaultDownloader.java (original) +++ maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/downloader/DefaultDownloader.java Sat Oct 11 16:24:52 2014 @@ -87,7 +87,8 @@ public class DefaultDownloader } catch ( ArtifactNotFoundException e ) { - throw new DownloadNotFoundException( "Requested " + artifact.getId() + " download's POM does not exist.", e ); + throw new DownloadNotFoundException( "Requested " + artifact.getId() + + " download's POM does not exist.", e ); } return artifact.getFile(); Modified: maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/old/DefaultOldArchetype.java URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/old/DefaultOldArchetype.java?rev=1631079&r1=1631078&r2=1631079&view=diff ============================================================================== --- maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/old/DefaultOldArchetype.java (original) +++ maven/archetype/trunk/archetype-common/src/main/java/org/apache/maven/archetype/old/DefaultOldArchetype.java Sat Oct 11 16:24:52 2014 @@ -186,7 +186,8 @@ public class DefaultOldArchetype if ( is == null ) { - throw new ArchetypeDescriptorException( "The " + ARCHETYPE_DESCRIPTOR + " descriptor cannot be found." ); + throw new ArchetypeDescriptorException( "The " + ARCHETYPE_DESCRIPTOR + + " descriptor cannot be found." ); } descriptor = builder.build( new XmlStreamReader( is ) ); Modified: maven/archetype/trunk/archetype-testing/archetype-proxy/src/main/java/org/apache/maven/archetype/proxy/ProxyServlet.java URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-testing/archetype-proxy/src/main/java/org/apache/maven/archetype/proxy/ProxyServlet.java?rev=1631079&r1=1631078&r2=1631079&view=diff ============================================================================== --- maven/archetype/trunk/archetype-testing/archetype-proxy/src/main/java/org/apache/maven/archetype/proxy/ProxyServlet.java (original) +++ maven/archetype/trunk/archetype-testing/archetype-proxy/src/main/java/org/apache/maven/archetype/proxy/ProxyServlet.java Sat Oct 11 16:24:52 2014 @@ -1,21 +1,23 @@ +package org.apache.maven.archetype.proxy; + /* - * Copyright 2007 rafale. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ -package org.apache.maven.archetype.proxy; - import java.io.IOException; import java.io.InputStream; @@ -28,6 +30,8 @@ import java.net.URL; import java.net.URLConnection; import java.util.Enumeration; import java.util.HashSet; +import java.util.Set; + import javax.servlet.ServletConfig; import javax.servlet.ServletContext; import javax.servlet.ServletException; @@ -36,6 +40,7 @@ import javax.servlet.ServletResponse; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + import org.mortbay.util.IO; /** @@ -46,18 +51,18 @@ import org.mortbay.util.IO; public class ProxyServlet extends HttpServlet { - protected HashSet _DontProxyHeaders = new HashSet(); + protected Set<String> dontProxyHeaders = new HashSet<String>(); { - _DontProxyHeaders.add( "proxy-connection" ); - _DontProxyHeaders.add( "connection" ); - _DontProxyHeaders.add( "keep-alive" ); - _DontProxyHeaders.add( "transfer-encoding" ); - _DontProxyHeaders.add( "te" ); - _DontProxyHeaders.add( "trailer" ); - _DontProxyHeaders.add( "proxy-authorization" ); - _DontProxyHeaders.add( "proxy-authenticate" ); - _DontProxyHeaders.add( "upgrade" ); + dontProxyHeaders.add( "proxy-connection" ); + dontProxyHeaders.add( "connection" ); + dontProxyHeaders.add( "keep-alive" ); + dontProxyHeaders.add( "transfer-encoding" ); + dontProxyHeaders.add( "te" ); + dontProxyHeaders.add( "trailer" ); + dontProxyHeaders.add( "proxy-authorization" ); + dontProxyHeaders.add( "proxy-authenticate" ); + dontProxyHeaders.add( "upgrade" ); } private ServletConfig config; @@ -85,6 +90,7 @@ public class ProxyServlet /* (non-Javadoc) * @see javax.servlet.Servlet#service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) */ + @SuppressWarnings( "checkstyle:methodlength" ) public void service( ServletRequest req, ServletResponse res ) throws ServletException, IOException @@ -142,7 +148,7 @@ public class ProxyServlet String hdr = (String) enm.nextElement(); String lhdr = hdr.toLowerCase(); - if ( _DontProxyHeaders.contains( lhdr ) ) + if ( dontProxyHeaders.contains( lhdr ) ) { continue; } @@ -174,9 +180,9 @@ public class ProxyServlet connection.addRequestProperty( "X-Forwarded-For", request.getRemoteAddr() ); } // a little bit of cache control - String cache_control = request.getHeader( "Cache-Control" ); - if ( cache_control != null && - (cache_control.indexOf( "no-cache" ) >= 0 || cache_control.indexOf( "no-store" ) >= 0) ) + String cacheControl = request.getHeader( "Cache-Control" ); + if ( cacheControl != null + && ( cacheControl.indexOf( "no-cache" ) >= 0 || cacheControl.indexOf( "no-store" ) >= 0 ) ) { connection.setUseCaches( false ); @@ -202,29 +208,29 @@ public class ProxyServlet context.log( "proxy", e ); } - InputStream proxy_in = null; + InputStream proxyIn = null; // handler status codes etc. - int code = 500; + int code = HttpURLConnection.HTTP_INTERNAL_ERROR; if ( http != null ) { - proxy_in = http.getErrorStream(); + proxyIn = http.getErrorStream(); code = http.getResponseCode(); response.setStatus( code, http.getResponseMessage() ); context.log( "response = " + http.getResponseCode() ); } - if ( proxy_in == null ) + if ( proxyIn == null ) { try { - proxy_in = connection.getInputStream(); + proxyIn = connection.getInputStream(); } catch ( Exception e ) { context.log( "stream", e ); - proxy_in = http.getErrorStream(); + proxyIn = http.getErrorStream(); } } @@ -239,7 +245,7 @@ public class ProxyServlet while ( hdr != null || val != null ) { String lhdr = hdr != null ? hdr.toLowerCase() : null; - if ( hdr != null && val != null && !_DontProxyHeaders.contains( lhdr ) ) + if ( hdr != null && val != null && !dontProxyHeaders.contains( lhdr ) ) { response.addHeader( hdr, val ); } @@ -252,9 +258,9 @@ public class ProxyServlet response.addHeader( "Via", "1.1 (jetty)" ); // Handle - if ( proxy_in != null ) + if ( proxyIn != null ) { - IO.copy( proxy_in, response.getOutputStream() ); + IO.copy( proxyIn, response.getOutputStream() ); } } } @@ -291,7 +297,7 @@ public class ProxyServlet Socket socket = new Socket( inetAddress.getAddress(), inetAddress.getPort() ); context.log( "Socket: " + socket ); - response.setStatus( 200 ); + response.setStatus( HttpURLConnection.HTTP_OK ); response.setHeader( "Connection", "close" ); response.flushBuffer(); @@ -347,36 +353,4 @@ public class ProxyServlet out.close(); } } - -// // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> -// /** -// * Handles the HTTP <code>GET</code> method. -// * @param request servlet request -// * @param response servlet response -// */ -// protected void doGet( HttpServletRequest request, -// HttpServletResponse response ) throws ServletException, IOException -// { -// processRequest( request, response ); -// } -// -// /** -// * Handles the HTTP <code>POST</code> method. -// * @param request servlet request -// * @param response servlet response -// */ -// protected void doPost( HttpServletRequest request, -// HttpServletResponse response ) throws ServletException, IOException -// { -// processRequest( request, response ); -// } -// -// /** -// * Returns a short description of the servlet. -// */ -// public String getServletInfo( ) -// { -// return "Short description"; -// } -// // </editor-fold> } Modified: maven/archetype/trunk/archetype-testing/archetype-proxy/src/main/java/org/apache/maven/archetype/proxy/RepositoryServlet.java URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-testing/archetype-proxy/src/main/java/org/apache/maven/archetype/proxy/RepositoryServlet.java?rev=1631079&r1=1631078&r2=1631079&view=diff ============================================================================== --- maven/archetype/trunk/archetype-testing/archetype-proxy/src/main/java/org/apache/maven/archetype/proxy/RepositoryServlet.java (original) +++ maven/archetype/trunk/archetype-testing/archetype-proxy/src/main/java/org/apache/maven/archetype/proxy/RepositoryServlet.java Sat Oct 11 16:24:52 2014 @@ -1,20 +1,23 @@ +package org.apache.maven.archetype.proxy; + /* - * Copyright 2007 rafale. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ -package org.apache.maven.archetype.proxy; import java.io.File; import java.io.FileInputStream; Modified: maven/archetype/trunk/archetype-testing/archetype-repository/src/main/java/org/apache/maven/archetype/repository/RepositoryServlet.java URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-testing/archetype-repository/src/main/java/org/apache/maven/archetype/repository/RepositoryServlet.java?rev=1631079&r1=1631078&r2=1631079&view=diff ============================================================================== --- maven/archetype/trunk/archetype-testing/archetype-repository/src/main/java/org/apache/maven/archetype/repository/RepositoryServlet.java (original) +++ maven/archetype/trunk/archetype-testing/archetype-repository/src/main/java/org/apache/maven/archetype/repository/RepositoryServlet.java Sat Oct 11 16:24:52 2014 @@ -1,20 +1,23 @@ +package org.apache.maven.archetype.repository; + /* - * Copyright 2007 rafale. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ -package org.apache.maven.archetype.repository; import java.io.File; import java.io.FileInputStream; Modified: maven/archetype/trunk/maven-archetype-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype-plugin/pom.xml?rev=1631079&r1=1631078&r2=1631079&view=diff ============================================================================== --- maven/archetype/trunk/maven-archetype-plugin/pom.xml (original) +++ maven/archetype/trunk/maven-archetype-plugin/pom.xml Sat Oct 11 16:24:52 2014 @@ -40,6 +40,10 @@ under the License. <name>Maven Archetype Plugin</name> + <properties> + <checkstyle.violation.ignore>RedundantThrows,NewlineAtEndOfFile,ParameterNumber,MethodLength,FileLength,javadoc,LineLength</checkstyle.violation.ignore> + </properties> + <prerequisites> <maven>2.0.7</maven> </prerequisites> Modified: maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateArchetypeFromProjectMojo.java URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateArchetypeFromProjectMojo.java?rev=1631079&r1=1631078&r2=1631079&view=diff ============================================================================== --- maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateArchetypeFromProjectMojo.java (original) +++ maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/CreateArchetypeFromProjectMojo.java Sat Oct 11 16:24:52 2014 @@ -185,9 +185,7 @@ public class CreateArchetypeFromProjectM * </p> * <p> * For example, if you include a line like the following in your property file: - * <pre> - * cxf-version=2.5.1-SNAPSHOT - * </pre> + * <pre>cxf-version=2.5.1-SNAPSHOT</pre> * the plugin will search your files for the string <pre>2.5.1-SNAPSHOT</pre> and * replace them with references to a velocity macro <pre>cxf-version</pre>. It will * then list <pre>cxf-version</pre> as a <pre>requiredProperty</pre> in the Modified: maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeFactory.java URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeFactory.java?rev=1631079&r1=1631078&r2=1631079&view=diff ============================================================================== --- maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeFactory.java (original) +++ maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeFactory.java Sat Oct 11 16:24:52 2014 @@ -29,12 +29,15 @@ public interface ArchetypeFactory ArchetypeDefinition createArchetypeDefinition( Properties properties ); + @SuppressWarnings( "checkstyle:linelength" ) ArchetypeConfiguration createArchetypeConfiguration( org.apache.maven.archetype.old.descriptor.ArchetypeDescriptor archetypeDescriptor, Properties properties ); + @SuppressWarnings( "checkstyle:linelength" ) ArchetypeConfiguration createArchetypeConfiguration( org.apache.maven.archetype.metadata.ArchetypeDescriptor archetypeDescriptor, Properties properties ); + @SuppressWarnings( "checkstyle:linelength" ) ArchetypeConfiguration createArchetypeConfiguration( MavenProject project, ArchetypeDefinition archetypeDefinition, Properties properties ); Modified: maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypePrompter.java URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypePrompter.java?rev=1631079&r1=1631078&r2=1631079&view=diff ============================================================================== --- maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypePrompter.java (original) +++ maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypePrompter.java Sat Oct 11 16:24:52 2014 @@ -67,7 +67,7 @@ public class ArchetypePrompter return line; } - @SuppressWarnings( { "rawtypes", "unchecked" }) + @SuppressWarnings( { "rawtypes", "unchecked" } ) public String prompt( String message, List possibleValues, String defaultReply ) throws PrompterException { Modified: maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeFactory.java URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeFactory.java?rev=1631079&r1=1631078&r2=1631079&view=diff ============================================================================== --- maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeFactory.java (original) +++ maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/DefaultArchetypeFactory.java Sat Oct 11 16:24:52 2014 @@ -79,6 +79,7 @@ public class DefaultArchetypeFactory getLogger().debug( "Setting property " + key + "=" + configuration.getProperty( key ) ); } + @SuppressWarnings( "checkstyle:linelength" ) public ArchetypeConfiguration createArchetypeConfiguration( org.apache.maven.archetype.old.descriptor.ArchetypeDescriptor archetypeDescriptor, Properties properties ) { @@ -109,6 +110,7 @@ public class DefaultArchetypeFactory } } + @SuppressWarnings( "checkstyle:linelength" ) public ArchetypeConfiguration createArchetypeConfiguration( org.apache.maven.archetype.metadata.ArchetypeDescriptor archetypeDescriptor, Properties properties ) { @@ -214,8 +216,8 @@ public class DefaultArchetypeFactory configuration.addRequiredProperty( requiredProperty ); configuration.setProperty( requiredProperty, properties.getProperty( requiredProperty ) ); - getLogger().debug( "Setting property " + requiredProperty + "=" + - configuration.getProperty( requiredProperty ) ); + getLogger().debug( "Setting property " + requiredProperty + "=" + + configuration.getProperty( requiredProperty ) ); } } Modified: maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/generation/ArchetypeSelectionQueryer.java URL: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/generation/ArchetypeSelectionQueryer.java?rev=1631079&r1=1631078&r2=1631079&view=diff ============================================================================== --- maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/generation/ArchetypeSelectionQueryer.java (original) +++ maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/generation/ArchetypeSelectionQueryer.java Sat Oct 11 16:24:52 2014 @@ -35,7 +35,7 @@ public interface ArchetypeSelectionQuery { String ROLE = ArchetypeSelectionQueryer.class.getName(); - public Archetype selectArchetype( Map<String, List<Archetype>> map ) + Archetype selectArchetype( Map<String, List<Archetype>> map ) throws PrompterException; boolean confirmSelection( ArchetypeDefinition archetypeDefinition )