Author: markt
Date: Sat Nov  9 19:55:59 2013
New Revision: 1540385

URL: http://svn.apache.org/r1540385
Log:
Simplify - merge locally used methods into constructor

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapType.java

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapType.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapType.java?rev=1540385&r1=1540384&r2=1540385&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapType.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapType.java 
Sat Nov  9 19:55:59 2013
@@ -37,33 +37,19 @@ public final class StackMapType implemen
 
     private static final long serialVersionUID = 1L;
 
-    private byte type;
-
-
     /**
      * Construct object from file stream.
      * @param file Input stream
      * @throws IOException
      */
     StackMapType(DataInput file) throws IOException {
-        setType(file.readByte());
-        if (hasIndex()) {
-            file.readShort();   // Unused index
+        byte type = file.readByte();
+        if ((type < Constants.ITEM_Bogus) || (type > 
Constants.ITEM_NewObject)) {
+            throw new RuntimeException("Illegal type for StackMapType: " + 
type);
         }
-    }
-
-
-    public void setType( byte t ) {
-        if ((t < Constants.ITEM_Bogus) || (t > Constants.ITEM_NewObject)) {
-            throw new RuntimeException("Illegal type for StackMapType: " + t);
+        // Check to see if type has an index
+        if ((type == Constants.ITEM_Object) || (type == 
Constants.ITEM_NewObject)) {
+            file.readShort();   // Unused index
         }
-        type = t;
-    }
-
-
-    /** @return true, if type is either ITEM_Object or ITEM_NewObject
-     */
-    public final boolean hasIndex() {
-        return ((type == Constants.ITEM_Object) || (type == 
Constants.ITEM_NewObject));
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to