From 9080d8544450a9beab0e5b40e7c163f0f1448ebb Mon Sep 17 00:00:00 2001 From: David Samuelson Date: Fri, 2 Jan 2015 10:00:40 -0800 Subject: [PATCH] Fix style --- .../command/status/GitStatusConsumer.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusConsumer.java b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusConsumer.java index cb11c0d86..7e5488849 100644 --- a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusConsumer.java +++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusConsumer.java @@ -222,12 +222,16 @@ private boolean isFile( String file ) return targetFile.isFile(); } - protected static String resolvePath(String fileEntry, URI path) { + protected static String resolvePath( String fileEntry, URI path ) + { /* Quotes may be included (from the git status line) when an fileEntry includes spaces */ - String cleanedEntry = stripQuotes(fileEntry); - if (path != null) { - return resolveURI(cleanedEntry, path).getPath(); - } else { + String cleanedEntry = stripQuotes( fileEntry ); + if ( path != null ) + { + return resolveURI( cleanedEntry, path ).getPath(); + } + else + { return cleanedEntry; } } @@ -243,7 +247,7 @@ public static URI resolveURI( String fileEntry, URI path ) // When using URI.create, spaces need to be escaped but not the slashes, so we can't use // URLEncoder.encode( String, String ) // new File( String ).toURI() results in an absolute URI while path is relative, so that can't be used either. - return path.relativize(URI.create(stripQuotes(fileEntry).replace(" ", "%20"))); + return path.relativize( URI.create( stripQuotes( fileEntry ).replace( " ", "%20" ) ) ); } @@ -256,8 +260,9 @@ public List getChangedFiles() * @param str the (potentially quoted) string, must not be {@code null} * @return the string with a pair of double quotes removed (if they existed) */ - private static String stripQuotes(String str) { + private static String stripQuotes( String str ) + { int strLen = str.length(); - return (strLen > 0 && str.startsWith("\"") && str.endsWith("\"")) ? str.substring(1, strLen - 1) : str; + return ( strLen > 0 && str.startsWith( "\"" ) && str.endsWith( "\"" ) ) ? str.substring( 1, strLen - 1 ) : str; } }