evenisse 2004/03/28 13:46:06 Modified: src/java/org/apache/maven/util Tag: MAVEN-1_0-BRANCH CaseInsensitiveGlobPatternMapper.java DVSLFormatter.java DVSLPathTool.java EnhancedStringTokenizer.java Expand.java MD5Sum.java MavenTool.java ResourceBean.java StringTool.java src/java/org/apache/maven/verifier Tag: MAVEN-1_0-BRANCH ChecksumVerificationException.java LocalSettingsVerifier.java Log: Fix some checkstyle errors Revision Changes Path No revision No revision 1.2.10.2 +11 -8 maven/src/java/org/apache/maven/util/CaseInsensitiveGlobPatternMapper.java Index: CaseInsensitiveGlobPatternMapper.java =================================================================== RCS file: /home/cvs/maven/src/java/org/apache/maven/util/CaseInsensitiveGlobPatternMapper.java,v retrieving revision 1.2.10.1 retrieving revision 1.2.10.2 diff -u -r1.2.10.1 -r1.2.10.2 --- CaseInsensitiveGlobPatternMapper.java 1 Mar 2004 22:36:39 -0000 1.2.10.1 +++ CaseInsensitiveGlobPatternMapper.java 28 Mar 2004 21:46:05 -0000 1.2.10.2 @@ -16,9 +16,9 @@ * limitations under the License. * ==================================================================== */ - - import org.apache.tools.ant.util.GlobPatternMapper; - + +import org.apache.tools.ant.util.GlobPatternMapper; + /** * Implementation of FileNameMapper that does simple case insensitive * wildcard pattern replacements. @@ -29,17 +29,20 @@ * * @author <a href="mailto:[EMAIL PROTECTED]">Alexei Baranstev</a> */ -public class CaseInsensitiveGlobPatternMapper extends GlobPatternMapper { +public class CaseInsensitiveGlobPatternMapper extends GlobPatternMapper +{ /** * Returns null if the source file name doesn't match the * "from" pattern, an one-element array containing the * translated file otherwise. */ - public String[] mapFileName(String sourceFileName) { - if (fromPrefix == null - || !sourceFileName.toLowerCase().startsWith(fromPrefix.toLowerCase()) - || !sourceFileName.toLowerCase().endsWith(fromPostfix.toLowerCase())) { + public String[] mapFileName(String sourceFileName) + { + if (fromPrefix == null + || !sourceFileName.toLowerCase().startsWith(fromPrefix.toLowerCase()) + || !sourceFileName.toLowerCase().endsWith(fromPostfix.toLowerCase())) + { return null; } return new String[] {toPrefix 1.2.4.5 +3 -3 maven/src/java/org/apache/maven/util/DVSLFormatter.java Index: DVSLFormatter.java =================================================================== RCS file: /home/cvs/maven/src/java/org/apache/maven/util/DVSLFormatter.java,v retrieving revision 1.2.4.4 retrieving revision 1.2.4.5 diff -u -r1.2.4.4 -r1.2.4.5 --- DVSLFormatter.java 12 Mar 2004 09:27:18 -0000 1.2.4.4 +++ DVSLFormatter.java 28 Mar 2004 21:46:05 -0000 1.2.4.5 @@ -37,7 +37,7 @@ * Instance of a formatter. */ private static DecimalFormat formatter = new DecimalFormat(); - + /** * Log for debug output */ @@ -75,7 +75,7 @@ { valueAsNumber = Double.valueOf(value.trim()); } - catch(NumberFormatException nfe) + catch (NumberFormatException nfe) { valueAsNumber = new Double("0.00"); } 1.2.4.2 +16 -17 maven/src/java/org/apache/maven/util/DVSLPathTool.java Index: DVSLPathTool.java =================================================================== RCS file: /home/cvs/maven/src/java/org/apache/maven/util/DVSLPathTool.java,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -u -r1.2.4.1 -r1.2.4.2 --- DVSLPathTool.java 1 Mar 2004 22:36:39 -0000 1.2.4.1 +++ DVSLPathTool.java 28 Mar 2004 21:46:05 -0000 1.2.4.2 @@ -56,7 +56,7 @@ { basedir = uppercaseDrive(basedir); filename = uppercaseDrive(filename); - + /* * Verify the arguments and make sure the filename is relative * to the base directory. @@ -106,23 +106,19 @@ public static final String getRelativePath( String filename ) { filename = uppercaseDrive(filename); - + if ( filename == null || filename.length() == 0 ) { return ""; } - - - /* * Normalize the argument. First, determine the file separator * that is being used, then strip that off the end of the * filename. Then, if the filename doesn't begin with a * separator, add one. */ - - + String separator = determineSeparator( filename ); filename = StringUtils.chompLast( filename, separator ); if ( !filename.startsWith( separator ) ) @@ -232,20 +228,23 @@ return forwardCount >= backwardCount ? "/" : "\\"; } - + /** * Cygwin prefers lowercase drive letters, but other parts of maven use uppercase * @param path * @return String */ - static final String uppercaseDrive(String path) { - if (path == null) - return null; - - if (path.length() >=2 && path.charAt(1) == ':') { - path = path.substring(0, 1).toUpperCase() + path.substring(1); - } - return path; + static final String uppercaseDrive(String path) + { + if (path == null) + { + return null; + + if (path.length() >= 2 && path.charAt(1) == ':') + { + path = path.substring(0, 1).toUpperCase() + path.substring(1); + } + return path; } /** 1.1.10.3 +30 -15 maven/src/java/org/apache/maven/util/EnhancedStringTokenizer.java Index: EnhancedStringTokenizer.java =================================================================== RCS file: /home/cvs/maven/src/java/org/apache/maven/util/EnhancedStringTokenizer.java,v retrieving revision 1.1.10.2 retrieving revision 1.1.10.3 diff -u -r1.1.10.2 -r1.1.10.3 --- EnhancedStringTokenizer.java 1 Mar 2004 22:36:39 -0000 1.1.10.2 +++ EnhancedStringTokenizer.java 28 Mar 2004 21:46:05 -0000 1.1.10.3 @@ -43,7 +43,8 @@ this(str, delim, false); } - public EnhancedStringTokenizer(String str, String delim, boolean returnDelims) { + public EnhancedStringTokenizer(String str, String delim, boolean returnDelims) + { cst = new StringTokenizer(str, delim, true); cdelim = delim; creturnDelims = returnDelims; @@ -51,35 +52,43 @@ cdelimChar = delim.charAt(0); } - public boolean hasMoreTokens() { + public boolean hasMoreTokens() + { return cst.hasMoreTokens(); } String lastToken = null; boolean delimLast = true; - private String internalNextToken() { - if (lastToken != null) { + private String internalNextToken() + { + if (lastToken != null) + { String last = lastToken; lastToken = null; return last; } String token = cst.nextToken(); - if (isDelim(token)) { - if (delimLast) { + if (isDelim(token)) + { + if (delimLast) + { lastToken = token; return ""; } else { delimLast = true; return token; } - } else { + } + else + { delimLast = false; return token; } } - public String nextToken() { + public String nextToken() + { String token = internalNextToken(); if (creturnDelims) return token; @@ -89,20 +98,26 @@ return token; } - private boolean isDelim(String str) { - if (str.length() == 1) { + private boolean isDelim(String str) + { + if (str.length() == 1) + { char ch = str.charAt(0); - if (cdelimSingleChar) { - if (cdelimChar == ch) { + if (cdelimSingleChar) + { + if (cdelimChar == ch) + { return true; } - } else { - if (cdelim.indexOf(ch) >= 0) { + } + else + { + if (cdelim.indexOf(ch) >= 0) + { return true; } } } return false; - } } 1.13.4.4 +11 -11 maven/src/java/org/apache/maven/util/Expand.java Index: Expand.java =================================================================== RCS file: /home/cvs/maven/src/java/org/apache/maven/util/Expand.java,v retrieving revision 1.13.4.3 retrieving revision 1.13.4.4 diff -u -r1.13.4.3 -r1.13.4.4 --- Expand.java 11 Mar 2004 03:13:38 -0000 1.13.4.3 +++ Expand.java 28 Mar 2004 21:46:05 -0000 1.13.4.4 @@ -45,17 +45,17 @@ private File dest; /** Source. */ - private File source;// req + private File source; // req /** Should overwrite flag. */ private boolean overwrite = true; - + /** Logger. */ private static final Log log = LogFactory.getLog(Expand.class); /** file utility class */ private FileUtils fileUtils; - + /** * Do the work. * @@ -67,7 +67,7 @@ expandFile(); } - /** + /** * Expand a file. */ protected void expandFile() throws IOException @@ -121,20 +121,20 @@ throws IOException { File f = fileUtils.resolveFile( dest, entryName ); - + if ( !overwrite && f.exists() && f.lastModified() >= entryDate.getTime() ) { log.debug("Skipping " + f + " as it is up-to-date"); return; } - + log.debug("expanding " + entryName + " to " + f); // create intermediary directories - sometimes zip don't add them File dirF = f.getParentFile(); //File dirF = fileUtils.getParentFile(f); dirF.mkdirs(); - + if ( isDirectory ) { f.mkdirs(); @@ -147,13 +147,13 @@ try { fos = new FileOutputStream( f ); - + while ( ( length = compressedInputStream.read( buffer ) ) >= 0 ) { fos.write( buffer, 0, length ); } - + fos.close(); fos = null; } @@ -172,7 +172,7 @@ } } } - + fileUtils.setFileLastModified( f, entryDate.getTime() ); } @@ -208,7 +208,7 @@ { overwrite = shouldOverwrite; } - + /** * @param utils */ 1.11.4.2 +3 -3 maven/src/java/org/apache/maven/util/MD5Sum.java Index: MD5Sum.java =================================================================== RCS file: /home/cvs/maven/src/java/org/apache/maven/util/MD5Sum.java,v retrieving revision 1.11.4.1 retrieving revision 1.11.4.2 diff -u -r1.11.4.1 -r1.11.4.2 --- MD5Sum.java 1 Mar 2004 22:36:39 -0000 1.11.4.1 +++ MD5Sum.java 28 Mar 2004 21:46:05 -0000 1.11.4.2 @@ -29,7 +29,7 @@ * The 128 bit MD5 hash is converted into a 32 character long String. Each * character of the String is the hexadecimal representation of 4 bits of the * digest. - * + * * XXX The API here is a mess. It is combining a static utility class with a * message digest API. Some methods which should be static are not, presumably * so Jelly can easily access them. @@ -149,7 +149,7 @@ public void execute() throws Exception { - if ( file.exists() == false ) + if ( !file.exists() ) { System.err.println( "Specified file " + file + " doesn't exist." ); } 1.1.10.2 +1 -1 maven/src/java/org/apache/maven/util/MavenTool.java Index: MavenTool.java =================================================================== RCS file: /home/cvs/maven/src/java/org/apache/maven/util/MavenTool.java,v retrieving revision 1.1.10.1 retrieving revision 1.1.10.2 diff -u -r1.1.10.1 -r1.1.10.2 --- MavenTool.java 1 Mar 2004 22:36:39 -0000 1.1.10.1 +++ MavenTool.java 28 Mar 2004 21:46:05 -0000 1.1.10.2 @@ -160,7 +160,7 @@ { List list = null; Object key = null; - for ( Iterator index = counted.keySet().iterator(); index.hasNext(); ) + for ( Iterator index = counted.keySet().iterator(); index.hasNext();) { key = index.next(); list = (List) counted.get( key ); 1.1.10.2 +10 -8 maven/src/java/org/apache/maven/util/ResourceBean.java Index: ResourceBean.java =================================================================== RCS file: /home/cvs/maven/src/java/org/apache/maven/util/ResourceBean.java,v retrieving revision 1.1.10.1 retrieving revision 1.1.10.2 diff -u -r1.1.10.1 -r1.1.10.2 --- ResourceBean.java 1 Mar 2004 22:36:39 -0000 1.1.10.1 +++ ResourceBean.java 28 Mar 2004 21:46:05 -0000 1.1.10.2 @@ -22,7 +22,7 @@ /** * A helper bean to load the given URI from the current threads class loader or * the class loader that was used to load this class. - * + * * @author <a href="mailto:[EMAIL PROTECTED]">James Strachan</a> */ @@ -34,14 +34,14 @@ * Attempts to load the given resource from the given name. * The current thrad context class loader will be tried first, then the * class loader used to load this class. - * + * * If the classLoader property on this bean is set then that ClassLoader is * used in preference to any other. - * + * * @param name of the resource to load * @return URL of the resource or null if could not be found */ - public URL findResource(String name) + public URL findResource(String name) { URL answer = null; if (classLoader != null) @@ -53,7 +53,7 @@ { ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); if (contextClassLoader != null) - { + { answer = contextClassLoader.getResource(name); } if (answer == null) @@ -63,12 +63,13 @@ } return answer; } - + /** * Returns the classLoader. * @return ClassLoader */ - public ClassLoader getClassLoader() { + public ClassLoader getClassLoader() + { return classLoader; } @@ -76,7 +77,8 @@ * Sets the classLoader. * @param classLoader The classLoader to set */ - public void setClassLoader(ClassLoader classLoader) { + public void setClassLoader(ClassLoader classLoader) + { this.classLoader = classLoader; } 1.3.4.3 +6 -6 maven/src/java/org/apache/maven/util/StringTool.java Index: StringTool.java =================================================================== RCS file: /home/cvs/maven/src/java/org/apache/maven/util/StringTool.java,v retrieving revision 1.3.4.2 retrieving revision 1.3.4.3 diff -u -r1.3.4.2 -r1.3.4.3 --- StringTool.java 1 Mar 2004 22:36:39 -0000 1.3.4.2 +++ StringTool.java 28 Mar 2004 21:46:05 -0000 1.3.4.3 @@ -42,7 +42,7 @@ { if (s == null) { - String[] result = { null, null }; + String[] result = {null, null}; return Arrays.asList(result); } @@ -50,23 +50,23 @@ if (index == -1) { - String[] result = { s, "" }; + String[] result = {s, ""}; return Arrays.asList(result); } else { - String[] result = { s.substring(0, index), s.substring(index + 1)}; + String[] result = {s.substring(0, index), s.substring(index + 1)}; return Arrays.asList(result); } } - + /** * <p>Removes all whitespace characters from the start and end of a String.</p> * * <p>This is similar to [EMAIL PROTECTED] #trim(String)} but removes whitespace. * Whitespace is defined by [EMAIL PROTECTED] Character#isWhitespace(char)}.</p> * - * @param str the String to remove characters from, may be null + * @param s the String to remove characters from, may be null * @return the trimmed String, <code>null</code> if null String input */ public static String trim(String s) No revision No revision 1.3.10.2 +2 -2 maven/src/java/org/apache/maven/verifier/ChecksumVerificationException.java Index: ChecksumVerificationException.java =================================================================== RCS file: /home/cvs/maven/src/java/org/apache/maven/verifier/ChecksumVerificationException.java,v retrieving revision 1.3.10.1 retrieving revision 1.3.10.2 diff -u -r1.3.10.1 -r1.3.10.2 --- ChecksumVerificationException.java 1 Mar 2004 22:36:39 -0000 1.3.10.1 +++ ChecksumVerificationException.java 28 Mar 2004 21:46:05 -0000 1.3.10.2 @@ -19,7 +19,7 @@ import org.apache.maven.MavenException; -/** +/** * Specialized artifact corruption exception. * * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a> 1.6.4.4 +3 -3 maven/src/java/org/apache/maven/verifier/LocalSettingsVerifier.java Index: LocalSettingsVerifier.java =================================================================== RCS file: /home/cvs/maven/src/java/org/apache/maven/verifier/LocalSettingsVerifier.java,v retrieving revision 1.6.4.3 retrieving revision 1.6.4.4 diff -u -r1.6.4.3 -r1.6.4.4 --- LocalSettingsVerifier.java 2 Mar 2004 11:22:42 -0000 1.6.4.3 +++ LocalSettingsVerifier.java 28 Mar 2004 21:46:05 -0000 1.6.4.4 @@ -31,8 +31,8 @@ public class LocalSettingsVerifier extends AbstractMavenComponent { - /** - * Default constructor. + /** + * Default constructor. * @param project the project to verify */ public LocalSettingsVerifier( Project project )
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]