incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r899563 - in /sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java: CompilationContext.java CompilerUtil.java jdt/CompilationUnit.java
Date Fri, 15 Jan 2010 08:38:47 GMT
Author: cziegeler
Date: Fri Jan 15 08:38:47 2010
New Revision: 899563

URL: http://svn.apache.org/viewvc?rev=899563&view=rev
Log:
Use string builder instead of string buffer

Modified:
    sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/CompilationContext.java
    sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/CompilerUtil.java
    sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java

Modified: sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/CompilationContext.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/CompilationContext.java?rev=899563&r1=899562&r2=899563&view=diff
==============================================================================
--- sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/CompilationContext.java
(original)
+++ sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/CompilationContext.java
Fri Jan 15 08:38:47 2010
@@ -211,7 +211,7 @@
     protected final static class CompilerException extends ServletException {
 
         public static CompilerException create(List<CompilerError> errors) {
-            final StringBuffer buffer = new StringBuffer();
+            final StringBuilder buffer = new StringBuilder();
             buffer.append("Compilation errors:\n");
             for(final CompilerError e : errors) {
                 buffer.append(e.getFile());

Modified: sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/CompilerUtil.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/CompilerUtil.java?rev=899563&r1=899562&r2=899563&view=diff
==============================================================================
--- sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/CompilerUtil.java
(original)
+++ sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/CompilerUtil.java
Fri Jan 15 08:38:47 2010
@@ -59,8 +59,8 @@
      * @return Legal Java identifier corresponding to the given identifier
      */
     public static final String makeJavaIdentifier(String identifier) {
-        StringBuffer modifiedIdentifier =
-            new StringBuffer(identifier.length());
+        StringBuilder modifiedIdentifier =
+            new StringBuilder(identifier.length());
         if (!Character.isJavaIdentifierStart(identifier.charAt(0))) {
             modifiedIdentifier.append('_');
         }

Modified: sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java?rev=899563&r1=899562&r2=899563&view=diff
==============================================================================
--- sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java
(original)
+++ sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java
Fri Jan 15 08:38:47 2010
@@ -84,7 +84,7 @@
             final Reader reader = new BufferedReader(new InputStreamReader(fr, this.options.getJavaEncoding()));
             try {
                 char[] chars = new char[8192];
-                StringBuffer buf = new StringBuffer();
+                StringBuilder buf = new StringBuilder();
                 int count;
                 while ((count = reader.read(chars, 0, chars.length)) > 0) {
                     buf.append(chars, 0, count);
@@ -128,7 +128,7 @@
      * @see org.eclipse.jdt.internal.compiler.env.INameEnvironment#findType(char[][])
      */
     public NameEnvironmentAnswer findType(char[][] compoundTypeName) {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         for (int i = 0; i < compoundTypeName.length; i++) {
             if (i > 0) {
                 result.append(".");
@@ -142,7 +142,7 @@
      * @see org.eclipse.jdt.internal.compiler.env.INameEnvironment#findType(char[], char[][])
      */
     public NameEnvironmentAnswer findType(char[] typeName, char[][] packageName) {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         for (int i = 0; i < packageName.length; i++) {
             if (i > 0) {
                 result.append(".");
@@ -213,7 +213,7 @@
      * @see org.eclipse.jdt.internal.compiler.env.INameEnvironment#isPackage(char[][], char[])
      */
     public boolean isPackage(char[][] parentPackageName, char[] packageName) {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         if (parentPackageName != null) {
             for (int i = 0; i < parentPackageName.length; i++) {
                 if (i > 0) {
@@ -254,7 +254,7 @@
                 for (int i = 0; i < classFiles.length; i++) {
                     ClassFile classFile = classFiles[i];
                     char[][] compoundName = classFile.getCompoundName();
-                    StringBuffer className = new StringBuffer();
+                    StringBuilder className = new StringBuilder();
                     for (int j = 0;  j < compoundName.length; j++) {
                         if (j > 0) {
                             className.append(".");
@@ -262,7 +262,7 @@
                         className.append(compoundName[j]);
                     }
                     byte[] bytes = classFile.getBytes();
-                    final StringBuffer b = new StringBuffer(this.options.getDestinationPath());
+                    final StringBuilder b = new StringBuilder(this.options.getDestinationPath());
                     b.append('/');
                     b.append(className.toString().replace('.', '/'));
                     b.append(".class");



Mime
View raw message