harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjanu...@apache.org
Subject svn commit: r703113 - in /harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony: pack200/CpBands.java unpack200/AttributeLayout.java unpack200/ClassBands.java unpack200/NewAttributeBands.java unpack200/SegmentUtils.java
Date Thu, 09 Oct 2008 10:13:21 GMT
Author: sjanuary
Date: Thu Oct  9 03:13:20 2008
New Revision: 703113

URL: http://svn.apache.org/viewvc?rev=703113&view=rev
Log:
More changes to use the more efficient String.indexOf method

Modified:
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/AttributeLayout.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/ClassBands.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/NewAttributeBands.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/SegmentUtils.java

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java?rev=703113&r1=703112&r2=703113&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java
Thu Oct  9 03:13:20 2008
@@ -398,7 +398,7 @@
         if (cpS == null) {
             List cpClasses = new ArrayList();
             CPUTF8 signatureUTF8;
-            if (signature.length() > 1 && signature.indexOf("L") != -1) {
+            if (signature.length() > 1 && signature.indexOf('L') != -1) {
                 List classes = new ArrayList();
                 char[] chars = signature.toCharArray();
                 StringBuffer signatureString = new StringBuffer();

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/AttributeLayout.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/AttributeLayout.java?rev=703113&r1=703112&r2=703113&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/AttributeLayout.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/AttributeLayout.java
Thu Oct  9 03:13:20 2008
@@ -171,14 +171,14 @@
     }
 
     public Codec getCodec() {
-        if (layout.indexOf("O") >= 0) { //$NON-NLS-1$
+        if (layout.indexOf('O') >= 0) {
             return Codec.BRANCH5;
-        } else if (layout.indexOf("P") >= 0) { //$NON-NLS-1$
+        } else if (layout.indexOf('P') >= 0) {
             return Codec.BCI5;
-        } else if (layout.indexOf("S") >= 0 && layout.indexOf("KS") < 0 //$NON-NLS-1$
//$NON-NLS-2$
+        } else if (layout.indexOf('S') >= 0 && layout.indexOf("KS") < 0 //$NON-NLS-1$
                 && layout.indexOf("RS") < 0) { //$NON-NLS-1$
             return Codec.SIGNED5;
-        } else if (layout.indexOf("B") >= 0) { //$NON-NLS-1$
+        } else if (layout.indexOf('B') >= 0) {
             return Codec.BYTE1;
         } else {
             return Codec.UNSIGNED5;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/ClassBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/ClassBands.java?rev=703113&r1=703112&r2=703113&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/ClassBands.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/ClassBands.java
Thu Oct  9 03:13:20 2008
@@ -1003,7 +1003,7 @@
         for (int i = 0; i < RxA.length; i++) {
             mbg[i] = new MetadataBandGroup(RxA[i], cpBands);
             String rxa = RxA[i];
-            if (rxa.indexOf("P") >= 0) {
+            if (rxa.indexOf('P') >= 0) {
                 mbg[i].param_NB = decodeBandInt(contextName + "_" + rxa
                         + "_param_NB", in, Codec.BYTE1, RxACount[i]);
             }

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/NewAttributeBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/NewAttributeBands.java?rev=703113&r1=703112&r2=703113&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/NewAttributeBands.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/NewAttributeBands.java
Thu Oct  9 03:13:20 2008
@@ -874,14 +874,14 @@
      * @param layoutElement
      */
     public BHSDCodec getCodec(String layoutElement) {
-        if (layoutElement.indexOf("O") >= 0) { //$NON-NLS-1$
+        if (layoutElement.indexOf('O') >= 0) {
             return Codec.BRANCH5;
-        } else if (layoutElement.indexOf("P") >= 0) { //$NON-NLS-1$
+        } else if (layoutElement.indexOf('P') >= 0) {
             return Codec.BCI5;
-        } else if (layoutElement.indexOf("S") >= 0 && layoutElement.indexOf("KS")
< 0 //$NON-NLS-1$ //$NON-NLS-2$
+        } else if (layoutElement.indexOf('S') >= 0 && layoutElement.indexOf("KS")
< 0 //$NON-NLS-1$
                 && layoutElement.indexOf("RS") < 0) { //$NON-NLS-1$
             return Codec.SIGNED5;
-        } else if (layoutElement.indexOf("B") >= 0) { //$NON-NLS-1$
+        } else if (layoutElement.indexOf('B') >= 0) {
             return Codec.BYTE1;
         } else {
             return Codec.UNSIGNED5;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/SegmentUtils.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/SegmentUtils.java?rev=703113&r1=703112&r2=703113&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/SegmentUtils.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/SegmentUtils.java
Thu Oct  9 03:13:20 2008
@@ -42,8 +42,8 @@
      * @return integer count
      */
     protected static int countArgs(String descriptor, int widthOfLongsAndDoubles) {
-        int bra = descriptor.indexOf("(");
-        int ket = descriptor.indexOf(")");
+        int bra = descriptor.indexOf('(');
+        int ket = descriptor.indexOf(')');
         if (bra == -1 || ket == -1 || ket < bra)
             throw new IllegalArgumentException("No arguments");
 



Mime
View raw message