Author: rgoers Date: Tue Nov 16 07:46:38 2010 New Revision: 1035547 URL: http://svn.apache.org/viewvc?rev=1035547&view=rev Log: Change more StringBuffers to StringBuilders
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileName.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/UriParser.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsClientFactory.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/DefaultLocalFileProvider.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/tasks/ShowFileTask.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/CombinedResources.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DefaultCryptor.java Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java?rev=1035547&r1=1035546&r2=1035547&view=diff ============================================================================== --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java Tue Nov 16 07:46:38 2010 @@ -157,7 +157,7 @@ public class StaticUserAuthenticator imp @Override public String toString() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); if (domain != null) { buffer.append(domain).append('\\'); Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileName.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileName.java?rev=1035547&r1=1035546&r2=1035547&view=diff ============================================================================== --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileName.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileName.java Tue Nov 16 07:46:38 2010 @@ -319,7 +319,7 @@ public abstract class AbstractFileName } // Strip the common prefix off the path - final StringBuffer buffer = new StringBuffer(); + final StringBuilder buffer = new StringBuilder(); if (pathLen > 1 && (pos < pathLen || getPath().charAt(pos) != SEPARATOR_CHAR)) { // Not a direct ancestor, need to back up Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/UriParser.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/UriParser.java?rev=1035547&r1=1035546&r2=1035547&view=diff ============================================================================== --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/UriParser.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/UriParser.java Tue Nov 16 07:46:38 2010 @@ -55,7 +55,7 @@ public final class UriParser /** * Extracts the first element of a path. - * @param name StringBuffer containing the path. + * @param name StringBuilder containing the path. * @return The first element of the path. */ public static String extractFirstElement(final StringBuilder name) @@ -199,8 +199,8 @@ public final class UriParser /** * Normalises the separators in a name. - * @param name The StringBuffer containing the name - * @return true if the StringBuffer was modified. + * @param name The StringBuilder containing the name + * @return true if the StringBuilder was modified. */ public static boolean fixSeparators(final StringBuilder name) { @@ -312,7 +312,7 @@ public final class UriParser /** * Removes %nn encodings from a string. - * @param buffer StringBuffer containing the string to decode. + * @param buffer StringBuilder containing the string to decode. * @param offset The position in the string to start decoding. * @param length The number of characters to decode. * @throws FileSystemException if an error occurs. @@ -355,8 +355,8 @@ public final class UriParser } /** - * Encodes and appends a string to a StringBuffer. - * @param buffer The StringBuffer to append to. + * Encodes and appends a string to a StringBuilder. + * @param buffer The StringBuilder to append to. * @param unencodedValue The String to encode and append. * @param reserved characters to encode. */ @@ -369,9 +369,9 @@ public final class UriParser } /** - * Encodes a set of reserved characters in a StringBuffer, using the URI %nn + * Encodes a set of reserved characters in a StringBuilder, using the URI %nn * encoding. Always encodes % characters. - * @param buffer The StringBuffer to append to. + * @param buffer The StringBuilder to append to. * @param offset The position in the buffer to start encoding at. * @param length The number of characters to encode. * @param reserved characters to encode. @@ -523,7 +523,7 @@ public final class UriParser /** * Extract the query String from the URI. - * @param name StringBuffer containing the URI. + * @param name StringBuilder containing the URI. * @return The query string, if any. null otherwise. */ public static String extractQueryString(StringBuilder name) Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java?rev=1035547&r1=1035546&r2=1035547&view=diff ============================================================================== --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java Tue Nov 16 07:46:38 2010 @@ -103,7 +103,7 @@ public final class FtpClientFactory FtpFileSystemConfigBuilder.getInstance().getShortMonthNames(fileSystemOptions); if (shortMonthNames != null) { - StringBuffer shortMonthNamesStr = new StringBuffer(BUFSZ); + StringBuilder shortMonthNamesStr = new StringBuilder(BUFSZ); for (int i = 0; i < shortMonthNames.length; i++) { if (shortMonthNamesStr.length() > 0) Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsClientFactory.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsClientFactory.java?rev=1035547&r1=1035546&r2=1035547&view=diff ============================================================================== --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsClientFactory.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsClientFactory.java Tue Nov 16 07:46:38 2010 @@ -111,7 +111,7 @@ public final class FtpsClientFactory fileSystemOptions); if (shortMonthNames != null) { - StringBuffer shortMonthNamesStr = new StringBuffer(40); + StringBuilder shortMonthNamesStr = new StringBuilder(40); for (int i = 0; i < shortMonthNames.length; i++) { if (shortMonthNamesStr.length() > 0) Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/DefaultLocalFileProvider.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/DefaultLocalFileProvider.java?rev=1035547&r1=1035546&r2=1035547&view=diff ============================================================================== --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/DefaultLocalFileProvider.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/DefaultLocalFileProvider.java Tue Nov 16 07:46:38 2010 @@ -95,7 +95,7 @@ public class DefaultLocalFileProvider public FileObject findLocalFile(final String name) throws FileSystemException { - StringBuffer uri = new StringBuffer(name.length() + 5); + StringBuilder uri = new StringBuilder(name.length() + 5); uri.append("file:"); uri.append(name); FileName filename = parseUri(null, uri.toString()); Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/tasks/ShowFileTask.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/tasks/ShowFileTask.java?rev=1035547&r1=1035546&r2=1035547&view=diff ============================================================================== --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/tasks/ShowFileTask.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/tasks/ShowFileTask.java Tue Nov 16 07:46:38 2010 @@ -93,7 +93,7 @@ public class ShowFileTask private void showFile(final FileObject file, final String prefix) throws Exception { // Write details - StringBuffer msg = new StringBuffer(prefix); + StringBuilder msg = new StringBuilder(prefix); msg.append(file.getName().getBaseName()); if (file.exists()) { Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/CombinedResources.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/CombinedResources.java?rev=1035547&r1=1035546&r2=1035547&view=diff ============================================================================== --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/CombinedResources.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/CombinedResources.java Tue Nov 16 07:46:38 2010 @@ -62,7 +62,7 @@ public class CombinedResources extends R return; } String[] parts = new String[]{locale.getLanguage(), locale.getCountry(), locale.getVariant()}; - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); for (int i = 0; i < 3; i++) { sb.append(getResourceName()); Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DefaultCryptor.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DefaultCryptor.java?rev=1035547&r1=1035546&r2=1035547&view=diff ============================================================================== --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DefaultCryptor.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DefaultCryptor.java Tue Nov 16 07:46:38 2010 @@ -80,7 +80,7 @@ public class DefaultCryptor implements C private String encode(byte[] bytes) { - StringBuffer builder = new StringBuffer(); + StringBuilder builder = new StringBuilder(); for (int i = 0; i < bytes.length; ++i) {