Author: hboutemy
Date: Tue Oct 23 17:48:34 2012
New Revision: 1401362
URL: http://svn.apache.org/viewvc?rev=1401362&view=rev
Log:
code formatting
Modified:
maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/PathTool.java
maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/io/FileUtils.java
Modified:
maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/PathTool.java
URL:
http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/PathTool.java?rev=1401362&r1=1401361&r2=1401362&view=diff
==============================================================================
---
maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/PathTool.java
(original)
+++
maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/PathTool.java
Tue Oct 23 17:48:34 2012
@@ -153,16 +153,16 @@ public class PathTool
// check for the presence of windows drives. No relative way of
// traversing from one to the other.
- if ( ( toPath.startsWith( ":", 1 ) && fromPath.startsWith( ":", 1 ) )
&& ( !toPath.substring( 0, 1 ).equals(
- fromPath.substring( 0, 1 ) ) ) )
+ if ( ( toPath.startsWith( ":", 1 ) && fromPath.startsWith( ":", 1 ) )
+ && ( !toPath.substring( 0, 1 ).equals( fromPath.substring( 0, 1 )
) ) )
{
// they both have drive path element but they dont match, no
// relative path
return null;
}
- if ( ( toPath.startsWith( ":", 1 ) && !fromPath.startsWith( ":", 1 ) )
|| ( !toPath.startsWith( ":", 1 )
- && fromPath.startsWith( ":", 1 ) ) )
+ if ( ( toPath.startsWith( ":", 1 ) && !fromPath.startsWith( ":", 1 ) )
+ || ( !toPath.startsWith( ":", 1 ) && fromPath.startsWith( ":", 1 )
) )
{
// one has a drive path element and the other doesnt, no relative
// path.
@@ -315,27 +315,27 @@ public class PathTool
{
fromTokeniser.nextToken();
- relativePath.append("..");
+ relativePath.append( ".." );
if ( fromTokeniser.hasMoreTokens() )
{
- relativePath.append( separatorChar);
+ relativePath.append( separatorChar );
}
}
if ( relativePath.length() != 0 && toTokeniser.hasMoreTokens() )
{
- relativePath.append(separatorChar);
+ relativePath.append( separatorChar );
}
// add fwd fills for whatevers left of newPath.
while ( toTokeniser.hasMoreTokens() )
{
- relativePath.append(toTokeniser.nextToken());
+ relativePath.append( toTokeniser.nextToken() );
if ( toTokeniser.hasMoreTokens() )
{
- relativePath.append( separatorChar);
+ relativePath.append( separatorChar );
}
}
return relativePath.toString();
Modified:
maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/io/FileUtils.java
URL:
http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/io/FileUtils.java?rev=1401362&r1=1401361&r2=1401362&view=diff
==============================================================================
---
maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/io/FileUtils.java
(original)
+++
maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/io/FileUtils.java
Tue Oct 23 17:48:34 2012
@@ -597,9 +597,9 @@ public class FileUtils
if ( Os.isFamily( Os.FAMILY_WINDOWS ) && !isValidWindowsFileName( file
) )
{
- throw new IllegalArgumentException(
- "The file (" + dir + ") cannot contain any of the following
characters: \n" + StringUtils.join(
- INVALID_CHARACTERS_FOR_WINDOWS_FILE_NAME, " " ) );
+ throw new IllegalArgumentException( "The file (" + dir
+ + ") cannot contain any of the following characters: \n"
+ + StringUtils.join( INVALID_CHARACTERS_FOR_WINDOWS_FILE_NAME,
" " ) );
}
if ( !file.exists() )
@@ -1647,7 +1647,7 @@ public class FileUtils
File[] files = sourceDirectory.listFiles();
- if (files == null)
+ if ( files == null )
{
return;
}
@@ -1772,19 +1772,21 @@ public class FileUtils
Random rand = new Random( secureInitializer +
Runtime.getRuntime().freeMemory() );
do
{
- result = new File( parent, prefix +
fmt.format(positiveRandom(rand)) + suffix );
+ result = new File( parent, prefix + fmt.format( positiveRandom(
rand ) ) + suffix );
}
while ( result.exists() );
return result;
}
- private static int positiveRandom(Random rand) {
+ private static int positiveRandom( Random rand )
+ {
int a = rand.nextInt();
- while (a==Integer.MIN_VALUE){
+ while ( a == Integer.MIN_VALUE )
+ {
a = rand.nextInt();
}
- return Math.abs(a);
+ return Math.abs( a );
}
/**
@@ -1882,10 +1884,10 @@ public class FileUtils
if ( file.exists() )
{
- FileReader fileReader = new FileReader(file);
+ FileReader fileReader = new FileReader( file );
try
{
- BufferedReader reader = new BufferedReader(fileReader);
+ BufferedReader reader = new BufferedReader( fileReader );
String line = reader.readLine();
@@ -1901,7 +1903,9 @@ public class FileUtils
}
reader.close();
- } finally {
+ }
+ finally
+ {
fileReader.close();
}
}