tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r978845 [1/2] - in /tomcat/trunk/java/org/apache: coyote/ coyote/ajp/ coyote/http11/filters/ naming/ naming/factory/ naming/resources/ tomcat/ tomcat/util/ tomcat/util/bcel/ tomcat/util/bcel/classfile/ tomcat/util/buf/ tomcat/util/digester/...
Date Sat, 24 Jul 2010 11:03:02 GMT
Author: markt
Date: Sat Jul 24 11:03:00 2010
New Revision: 978845

URL: http://svn.apache.org/viewvc?rev=978845&view=rev
Log:
More tab police

Modified:
    tomcat/trunk/java/org/apache/coyote/RequestInfo.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpMessage.java
    tomcat/trunk/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java
    tomcat/trunk/java/org/apache/naming/NamingContextBindingsEnumeration.java
    tomcat/trunk/java/org/apache/naming/NamingContextEnumeration.java
    tomcat/trunk/java/org/apache/naming/factory/MailSessionFactory.java
    tomcat/trunk/java/org/apache/naming/factory/SendMailFactory.java
    tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java
    tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java
    tomcat/trunk/java/org/apache/naming/resources/RecyclableNamingEnumeration.java
    tomcat/trunk/java/org/apache/naming/resources/WARDirContext.java
    tomcat/trunk/java/org/apache/tomcat/InstanceManager.java
    tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/Constants.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationDefault.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationElementValue.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ArrayElementValue.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassElementValue.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassFormatException.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValue.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValuePair.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/EnclosingMethod.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/EnumElementValue.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTypeTable.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotationEntry.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeInvisibleAnnotations.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeVisibleAnnotations.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/SimpleElementValue.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTableEntry.java
    tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java
    tomcat/trunk/java/org/apache/tomcat/util/buf/MessageBytes.java
    tomcat/trunk/java/org/apache/tomcat/util/digester/FactoryCreateRule.java
    tomcat/trunk/java/org/apache/tomcat/util/digester/WithDefaultsRulesWrapper.java
    tomcat/trunk/java/org/apache/tomcat/util/http/CookieSupport.java
    tomcat/trunk/java/org/apache/tomcat/util/modeler/BaseModelMBean.java
    tomcat/trunk/java/org/apache/tomcat/util/net/DefaultServerSocketFactory.java
    tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
    tomcat/trunk/java/org/apache/tomcat/util/net/SSLImplementation.java
    tomcat/trunk/java/org/apache/tomcat/util/net/ServerSocketFactory.java
    tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java

Modified: tomcat/trunk/java/org/apache/coyote/RequestInfo.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/RequestInfo.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/RequestInfo.java (original)
+++ tomcat/trunk/java/org/apache/coyote/RequestInfo.java Sat Jul 24 11:03:00 2010
@@ -52,7 +52,7 @@ public class RequestInfo  {
             this.global=global;
             global.addRequestProcessor( this );
         } else {
-        	if (this.global != null) {
+            if (this.global != null) {
                 this.global.removeRequestProcessor( this ); 
                 this.global = null;
             }

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpMessage.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpMessage.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpMessage.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpMessage.java Sat Jul 24 11:03:00 2010
@@ -144,7 +144,7 @@ public class AjpMessage {
     public void appendByte(int val) {
         buf[pos++] = (byte) val;
     }
-	
+
     
     /**
      * Append an int (4 bytes) to the message.
@@ -350,7 +350,7 @@ public class AjpMessage {
             log.error(sm.getString("ajpmessage.read", "" + length));
             return 0;
         }
-	
+
         if ((length == 0xFFFF) || (length == -1)) {
             return 0;
         }

Modified: tomcat/trunk/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java Sat Jul 24 11:03:00 2010
@@ -29,9 +29,9 @@ import org.apache.tomcat.util.buf.ByteCh
  */
 public class SavedRequestInputFilter implements InputFilter {
 
-	/**
+    /**
      * The original request body.
-	 */
+     */
     protected ByteChunk input = null;
 
     /**
@@ -53,7 +53,7 @@ public class SavedRequestInputFilter imp
         if (chunk.getLimit() > 0 && chunk.getLimit() < input.getLength()) {
             writeLength = chunk.getLimit();
         } else {
-        	writeLength = input.getLength();
+            writeLength = input.getLength();
         }
         
         if(input.getOffset()>= input.getEnd())

Modified: tomcat/trunk/java/org/apache/naming/NamingContextBindingsEnumeration.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/NamingContextBindingsEnumeration.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/NamingContextBindingsEnumeration.java (original)
+++ tomcat/trunk/java/org/apache/naming/NamingContextBindingsEnumeration.java Sat Jul 24 11:03:00 2010
@@ -42,7 +42,7 @@ public class NamingContextBindingsEnumer
 
     public NamingContextBindingsEnumeration(Iterator<NamingEntry> entries,
             Context ctx) {
-    	iterator = entries;
+        iterator = entries;
         this.ctx = ctx;
     }
 

Modified: tomcat/trunk/java/org/apache/naming/NamingContextEnumeration.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/NamingContextEnumeration.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/NamingContextEnumeration.java (original)
+++ tomcat/trunk/java/org/apache/naming/NamingContextEnumeration.java Sat Jul 24 11:03:00 2010
@@ -39,7 +39,7 @@ public class NamingContextEnumeration 
 
 
     public NamingContextEnumeration(Iterator<NamingEntry> entries) {
-    	iterator = entries;
+        iterator = entries;
     }
 
 

Modified: tomcat/trunk/java/org/apache/naming/factory/MailSessionFactory.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/factory/MailSessionFactory.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/factory/MailSessionFactory.java (original)
+++ tomcat/trunk/java/org/apache/naming/factory/MailSessionFactory.java Sat Jul 24 11:03:00 2010
@@ -89,11 +89,10 @@ public class MailSessionFactory implemen
      * @exception Exception if an error occurs during object creation
      */
     public Object getObjectInstance(Object refObj, Name name, Context context,
-				    Hashtable<?,?> env) throws Exception 
-    {
+            Hashtable<?,?> env) throws Exception {
 
         // Return null if we cannot create an object of the requested type
-	final Reference ref = (Reference) refObj;
+        final Reference ref = (Reference) refObj;
         if (!ref.getClassName().equals(factoryType))
             return (null);
 
@@ -103,7 +102,7 @@ public class MailSessionFactory implemen
         //
         // Bugzilla 31288, 33077: add support for authentication.
         return AccessController.doPrivileged(new PrivilegedAction<Session>() {
-		public Session run() {
+                public Session run() {
 
                     // Create the JavaMail properties we will use
                     Properties props = new Properties();
@@ -148,10 +147,7 @@ public class MailSessionFactory implemen
                     Session session = Session.getInstance(props, auth);
                     return (session);
 
-		}
-	    } );
-
+                }
+        } );
     }
-
-
 }

Modified: tomcat/trunk/java/org/apache/naming/factory/SendMailFactory.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/factory/SendMailFactory.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/factory/SendMailFactory.java (original)
+++ tomcat/trunk/java/org/apache/naming/factory/SendMailFactory.java Sat Jul 24 11:03:00 2010
@@ -77,51 +77,50 @@ public class SendMailFactory implements 
 {
     // The class name for the javamail MimeMessageDataSource
     protected final String DataSourceClassName = 
-	"javax.mail.internet.MimePartDataSource";
+        "javax.mail.internet.MimePartDataSource";
 
     public Object getObjectInstance(Object RefObj, Name Nm, Context Ctx,
-				    Hashtable<?,?> Env) throws Exception 
-    {
-	final Reference Ref = (Reference)RefObj;
+            Hashtable<?,?> Env) throws Exception {
+        final Reference Ref = (Reference)RefObj;
 
-	// Creation of the DataSource is wrapped inside a doPrivileged
-	// so that javamail can read its default properties without
-	// throwing Security Exceptions
-	if (Ref.getClassName().equals(DataSourceClassName)) {
-	    return AccessController.doPrivileged(
-	            new PrivilegedAction<MimePartDataSource>()
-	    {
-		public MimePartDataSource run() {
-        	    // set up the smtp session that will send the message
-	            Properties props = new Properties();
-		    // enumeration of all refaddr
-		    Enumeration<RefAddr> list = Ref.getAll();
-		    // current refaddr to be set
-		    RefAddr refaddr;
-	            // set transport to smtp
-	            props.put("mail.transport.protocol", "smtp");
+        // Creation of the DataSource is wrapped inside a doPrivileged
+        // so that javamail can read its default properties without
+        // throwing Security Exceptions
+        if (Ref.getClassName().equals(DataSourceClassName)) {
+            return AccessController.doPrivileged(
+                    new PrivilegedAction<MimePartDataSource>()
+            {
+                public MimePartDataSource run() {
+                    // set up the smtp session that will send the message
+                    Properties props = new Properties();
+                    // enumeration of all refaddr
+                    Enumeration<RefAddr> list = Ref.getAll();
+                    // current refaddr to be set
+                    RefAddr refaddr;
+                    // set transport to smtp
+                    props.put("mail.transport.protocol", "smtp");
 
-		    while (list.hasMoreElements()) {
-			refaddr = list.nextElement();
+                    while (list.hasMoreElements()) {
+                        refaddr = list.nextElement();
 
-			// set property
-			props.put(refaddr.getType(), refaddr.getContent());
-		    }
-		    MimeMessage message = new MimeMessage(
-			Session.getInstance(props));
-		    try {
-			String from = (String)Ref.get("mail.from").getContent();
-		        message.setFrom(new InternetAddress(from));
-		        message.setSubject("");
-		    } catch (Exception e) {}
-		    MimePartDataSource mds = new MimePartDataSource(
-			(MimePart)message);
-		    return mds;
-		}
-	    } );
-	}
-	else { // We can't create an instance of the DataSource
-	    return null;
-	}
+                        // set property
+                        props.put(refaddr.getType(), refaddr.getContent());
+                    }
+                    MimeMessage message = new MimeMessage(
+                        Session.getInstance(props));
+                    try {
+                        String from = (String)Ref.get("mail.from").getContent();
+                        message.setFrom(new InternetAddress(from));
+                        message.setSubject("");
+                    } catch (Exception e) {}
+                    MimePartDataSource mds = new MimePartDataSource(
+                        (MimePart)message);
+                    return mds;
+                }
+            } );
+        }
+        else { // We can't create an instance of the DataSource
+            return null;
+        }
     }
 }

Modified: tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java Sat Jul 24 11:03:00 2010
@@ -67,7 +67,7 @@ public class DirContextURLConnection 
                 ("Directory context can't be null");
         if (org.apache.naming.Constants.IS_SECURITY_ENABLED) {
             this.permission = new JndiPermission(url.toString());
-	}
+    }
         this.context = context;
     }
     

Modified: tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java Sat Jul 24 11:03:00 2010
@@ -794,9 +794,9 @@ public class FileDirContext extends Base
         File file = new File(base, name);
         if (file.exists() && file.canRead()) {
 
-        	if (allowLinking)
-        		return file;
-        	
+            if (allowLinking)
+                return file;
+            
             // Check that this file belongs to our root path
             String canPath = null;
             try {

Modified: tomcat/trunk/java/org/apache/naming/resources/RecyclableNamingEnumeration.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/RecyclableNamingEnumeration.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/RecyclableNamingEnumeration.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/RecyclableNamingEnumeration.java Sat Jul 24 11:03:00 2010
@@ -105,7 +105,7 @@ public class RecyclableNamingEnumeration
      * Recycle.
      */
     void recycle() {
-    	enumeration = entries.elements();
+        enumeration = entries.elements();
     }
 
 

Modified: tomcat/trunk/java/org/apache/naming/resources/WARDirContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/WARDirContext.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/WARDirContext.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/WARDirContext.java Sat Jul 24 11:03:00 2010
@@ -121,26 +121,26 @@ public class WARDirContext extends BaseD
     @Override
     public void setDocBase(String docBase) {
 
-	// Validate the format of the proposed document root
-	if (docBase == null)
-	    throw new IllegalArgumentException
-		(sm.getString("resources.null"));
-	if (!(docBase.endsWith(".war")))
-	    throw new IllegalArgumentException
-		(sm.getString("warResources.notWar"));
-
-	// Calculate a File object referencing this document base directory
-	File base = new File(docBase);
-
-	// Validate that the document base is an existing directory
-	if (!base.exists() || !base.canRead() || base.isDirectory())
-	    throw new IllegalArgumentException
-		(sm.getString("warResources.invalidWar", docBase));
+        // Validate the format of the proposed document root
+        if (docBase == null)
+            throw new IllegalArgumentException
+                (sm.getString("resources.null"));
+        if (!(docBase.endsWith(".war")))
+            throw new IllegalArgumentException
+                (sm.getString("warResources.notWar"));
+
+        // Calculate a File object referencing this document base directory
+        File base = new File(docBase);
+
+        // Validate that the document base is an existing directory
+        if (!base.exists() || !base.canRead() || base.isDirectory())
+            throw new IllegalArgumentException
+                (sm.getString("warResources.invalidWar", docBase));
         try {
             this.base = new ZipFile(base);
         } catch (Exception e) {
-	    throw new IllegalArgumentException
-		(sm.getString("warResources.invalidWar", e.getMessage()));
+            throw new IllegalArgumentException
+                (sm.getString("warResources.invalidWar", e.getMessage()));
         }
         super.setDocBase(docBase);
 

Modified: tomcat/trunk/java/org/apache/tomcat/InstanceManager.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/InstanceManager.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/InstanceManager.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/InstanceManager.java Sat Jul 24 11:03:00 2010
@@ -30,16 +30,16 @@ import javax.naming.NamingException;
 public interface InstanceManager {
 
     public Object newInstance(String className)
-    	throws IllegalAccessException, InvocationTargetException, NamingException, 
-    		InstantiationException, ClassNotFoundException;
+        throws IllegalAccessException, InvocationTargetException, NamingException, 
+            InstantiationException, ClassNotFoundException;
 
     public Object newInstance(String fqcn, ClassLoader classLoader) 
-    	throws IllegalAccessException, InvocationTargetException, NamingException, 
-    		InstantiationException, ClassNotFoundException;
+        throws IllegalAccessException, InvocationTargetException, NamingException, 
+            InstantiationException, ClassNotFoundException;
 
     public void newInstance(Object o) 
-		throws IllegalAccessException, InvocationTargetException, NamingException;
+        throws IllegalAccessException, InvocationTargetException, NamingException;
 
     public void destroyInstance(Object o)
-    	throws IllegalAccessException, InvocationTargetException;
+        throws IllegalAccessException, InvocationTargetException;
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java Sat Jul 24 11:03:00 2010
@@ -48,7 +48,7 @@ public final class IntrospectionUtils {
         Method executeM = null;
         Class<?> c = proxy.getClass();
         Class<?> params[] = new Class[0];
-        //	params[0]=args.getClass();
+        // params[0]=args.getClass();
         executeM = findMethod(c, method, params);
         if (executeM == null) {
             throw new RuntimeException("No execute in " + proxy.getClass());
@@ -164,7 +164,7 @@ public final class IntrospectionUtils {
         StringTokenizer st = new StringTokenizer(cpath, pathSep);
         while (st.hasMoreTokens()) {
             String path = st.nextToken();
-            //	    log( "path " + path );
+            // log( "path " + path );
             if (path.endsWith(jarName)) {
                 home = path.substring(0, path.length() - jarName.length());
                 try {

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/Constants.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/Constants.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/Constants.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/Constants.java Sat Jul 24 11:03:00 2010
@@ -494,26 +494,26 @@ public interface Constants {
 
   /** Attributes and their corresponding names.
    */
-  public static final byte ATTR_UNKNOWN                       			= -1;
-  public static final byte ATTR_SOURCE_FILE                   			= 0;
-  public static final byte ATTR_CONSTANT_VALUE                			= 1;
-  public static final byte ATTR_CODE                          			= 2;
-  public static final byte ATTR_EXCEPTIONS                    			= 3;
-  public static final byte ATTR_LINE_NUMBER_TABLE             			= 4;
-  public static final byte ATTR_LOCAL_VARIABLE_TABLE          			= 5;
-  public static final byte ATTR_INNER_CLASSES                 			= 6;
-  public static final byte ATTR_SYNTHETIC                     			= 7;
-  public static final byte ATTR_DEPRECATED                    			= 8;
-  public static final byte ATTR_PMG                           			= 9;
-  public static final byte ATTR_SIGNATURE                     			= 10;
-  public static final byte ATTR_STACK_MAP                     			= 11;
-  public static final byte ATTR_RUNTIME_VISIBLE_ANNOTATIONS    			= 12;
-  public static final byte ATTR_RUNTIMEIN_VISIBLE_ANNOTATIONS  			= 13;
-  public static final byte ATTR_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS 	= 14;
+  public static final byte ATTR_UNKNOWN                                 = -1;
+  public static final byte ATTR_SOURCE_FILE                             = 0;
+  public static final byte ATTR_CONSTANT_VALUE                          = 1;
+  public static final byte ATTR_CODE                                    = 2;
+  public static final byte ATTR_EXCEPTIONS                              = 3;
+  public static final byte ATTR_LINE_NUMBER_TABLE                       = 4;
+  public static final byte ATTR_LOCAL_VARIABLE_TABLE                    = 5;
+  public static final byte ATTR_INNER_CLASSES                           = 6;
+  public static final byte ATTR_SYNTHETIC                               = 7;
+  public static final byte ATTR_DEPRECATED                              = 8;
+  public static final byte ATTR_PMG                                     = 9;
+  public static final byte ATTR_SIGNATURE                               = 10;
+  public static final byte ATTR_STACK_MAP                               = 11;
+  public static final byte ATTR_RUNTIME_VISIBLE_ANNOTATIONS             = 12;
+  public static final byte ATTR_RUNTIMEIN_VISIBLE_ANNOTATIONS           = 13;
+  public static final byte ATTR_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS   = 14;
   public static final byte ATTR_RUNTIMEIN_VISIBLE_PARAMETER_ANNOTATIONS = 15;
   public static final byte ATTR_ANNOTATION_DEFAULT                      = 16;
   public static final byte ATTR_LOCAL_VARIABLE_TYPE_TABLE               = 17;
-  public static final byte ATTR_ENCLOSING_METHOD                      	= 18;
+  public static final byte ATTR_ENCLOSING_METHOD                        = 18;
   public static final byte ATTR_STACK_MAP_TABLE                         = 19;
 
   public static final short KNOWN_ATTRIBUTES = 20;

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationDefault.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationDefault.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationDefault.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationDefault.java Sat Jul 24 11:03:00 2010
@@ -31,63 +31,63 @@ import org.apache.tomcat.util.bcel.Const
  */
 public class AnnotationDefault extends Attribute
 {
-	ElementValue default_value;
+    ElementValue default_value;
 
-	/**
-	 * @param annotation_type
-	 *            the subclass type of the annotation
-	 * @param name_index
-	 *            Index pointing to the name <em>Code</em>
-	 * @param length
-	 *            Content length in bytes
-	 * @param file
-	 *            Input stream
-	 * @param constant_pool
-	 *            Array of constants
-	 */
-	public AnnotationDefault(int name_index, int length,
-			DataInputStream file, ConstantPool constant_pool)
-			throws IOException
-	{
-		this(name_index, length, (ElementValue) null,
-				constant_pool);
-		default_value = ElementValue.readElementValue(file, constant_pool);
-	}
-
-	/**
-	 * @param annotation_type
-	 *            the subclass type of the annotation
-	 * @param name_index
-	 *            Index pointing to the name <em>Code</em>
-	 * @param length
-	 *            Content length in bytes
-	 * @param defaultValue
-	 *            the annotation's default value
-	 * @param constant_pool
-	 *            Array of constants
-	 */
-	public AnnotationDefault(int name_index, int length,
-			ElementValue defaultValue, ConstantPool constant_pool)
-	{
-		super(Constants.ATTR_ANNOTATION_DEFAULT, name_index, length, constant_pool);
-		setDefaultValue(defaultValue);
-	}
-
-	/**
-	 * @param defaultValue
-	 *            the default value of this methodinfo's annotation
-	 */
-	public final void setDefaultValue(ElementValue defaultValue)
-	{
-		default_value = defaultValue;
-	}
-
-	
-
-	public Attribute copy(ConstantPool _constant_pool)
-	{
-		throw new RuntimeException("Not implemented yet!");
-	}
+    /**
+     * @param annotation_type
+     *            the subclass type of the annotation
+     * @param name_index
+     *            Index pointing to the name <em>Code</em>
+     * @param length
+     *            Content length in bytes
+     * @param file
+     *            Input stream
+     * @param constant_pool
+     *            Array of constants
+     */
+    public AnnotationDefault(int name_index, int length,
+            DataInputStream file, ConstantPool constant_pool)
+            throws IOException
+    {
+        this(name_index, length, (ElementValue) null,
+                constant_pool);
+        default_value = ElementValue.readElementValue(file, constant_pool);
+    }
+
+    /**
+     * @param annotation_type
+     *            the subclass type of the annotation
+     * @param name_index
+     *            Index pointing to the name <em>Code</em>
+     * @param length
+     *            Content length in bytes
+     * @param defaultValue
+     *            the annotation's default value
+     * @param constant_pool
+     *            Array of constants
+     */
+    public AnnotationDefault(int name_index, int length,
+            ElementValue defaultValue, ConstantPool constant_pool)
+    {
+        super(Constants.ATTR_ANNOTATION_DEFAULT, name_index, length, constant_pool);
+        setDefaultValue(defaultValue);
+    }
+
+    /**
+     * @param defaultValue
+     *            the default value of this methodinfo's annotation
+     */
+    public final void setDefaultValue(ElementValue defaultValue)
+    {
+        default_value = defaultValue;
+    }
+
+    
+
+    public Attribute copy(ConstantPool _constant_pool)
+    {
+        throw new RuntimeException("Not implemented yet!");
+    }
 
     public final void dump(DataOutputStream dos) throws IOException
     {

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationElementValue.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationElementValue.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationElementValue.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationElementValue.java Sat Jul 24 11:03:00 2010
@@ -22,39 +22,39 @@ import java.io.IOException;
 
 public class AnnotationElementValue extends ElementValue
 {
-	// For annotation element values, this is the annotation
-	private AnnotationEntry annotationEntry;
+    // For annotation element values, this is the annotation
+    private AnnotationEntry annotationEntry;
 
-	public AnnotationElementValue(int type, AnnotationEntry annotationEntry,
-			ConstantPool cpool)
-	{
-		super(type, cpool);
-		if (type != ANNOTATION)
-			throw new RuntimeException(
-					"Only element values of type annotation can be built with this ctor - type specified: " + type);
-		this.annotationEntry = annotationEntry;
-	}
-
-	public void dump(DataOutputStream dos) throws IOException
-	{
-		dos.writeByte(type); // u1 type of value (ANNOTATION == '@')
-		annotationEntry.dump(dos);
-	}
-
-	public String stringifyValue()
-	{
-		StringBuffer sb = new StringBuffer();
-		sb.append(annotationEntry.toString());
-		return sb.toString();
-	}
-
-	public String toString()
-	{
-		return stringifyValue();
-	}
-
-	public AnnotationEntry getAnnotationEntry()
-	{
-		return annotationEntry;
-	}
+    public AnnotationElementValue(int type, AnnotationEntry annotationEntry,
+            ConstantPool cpool)
+    {
+        super(type, cpool);
+        if (type != ANNOTATION)
+            throw new RuntimeException(
+                    "Only element values of type annotation can be built with this ctor - type specified: " + type);
+        this.annotationEntry = annotationEntry;
+    }
+
+    public void dump(DataOutputStream dos) throws IOException
+    {
+        dos.writeByte(type); // u1 type of value (ANNOTATION == '@')
+        annotationEntry.dump(dos);
+    }
+
+    public String stringifyValue()
+    {
+        StringBuffer sb = new StringBuffer();
+        sb.append(annotationEntry.toString());
+        return sb.toString();
+    }
+
+    public String toString()
+    {
+        return stringifyValue();
+    }
+
+    public AnnotationEntry getAnnotationEntry()
+    {
+        return annotationEntry;
+    }
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java Sat Jul 24 11:03:00 2010
@@ -55,19 +55,15 @@ public class AnnotationEntry implements 
     
     public static AnnotationEntry read(DataInputStream file, ConstantPool constant_pool, boolean isRuntimeVisible) throws IOException 
     {
-    	AnnotationEntry annotationEntry = new AnnotationEntry(file.readUnsignedShort(), constant_pool, isRuntimeVisible);
-    	annotationEntry.num_element_value_pairs = (file.readUnsignedShort());
-    	annotationEntry.element_value_pairs = new ArrayList();
+        AnnotationEntry annotationEntry = new AnnotationEntry(file.readUnsignedShort(), constant_pool, isRuntimeVisible);
+        annotationEntry.num_element_value_pairs = (file.readUnsignedShort());
+        annotationEntry.element_value_pairs = new ArrayList();
         for (int i = 0; i < annotationEntry.num_element_value_pairs; i++) {
-        	annotationEntry.element_value_pairs.add(new ElementValuePair(file.readUnsignedShort(), ElementValue.readElementValue(file, constant_pool), constant_pool));
+            annotationEntry.element_value_pairs.add(new ElementValuePair(file.readUnsignedShort(), ElementValue.readElementValue(file, constant_pool), constant_pool));
         }
         return annotationEntry;
     }
 
-
-    
-
-
     /**
      * @return the annotation type name
      */
@@ -76,36 +72,24 @@ public class AnnotationEntry implements 
         c = (ConstantUtf8) constant_pool.getConstant(type_index, CONSTANT_Utf8);
         return c.getBytes();
     }
-    
-    
-
-
-    
-
 
     /**
      * @return the element value pairs in this annotation entry
      */
     public ElementValuePair[] getElementValuePairs() {
-    	// TOFO return List
+        // TOFO return List
         return (ElementValuePair[]) element_value_pairs.toArray(new ElementValuePair[element_value_pairs.size()]);
     }
 
 
-	public void dump(DataOutputStream dos) throws IOException
-	{
-		dos.writeShort(type_index);	// u2 index of type name in cpool
-		dos.writeShort(element_value_pairs.size()); // u2 element_value pair count
-		for (int i = 0 ; i<element_value_pairs.size();i++) {
-			ElementValuePair envp = (ElementValuePair) element_value_pairs.get(i);
-			envp.dump(dos);
-		}
-	}
-
-
-	
-
-	
+    public void dump(DataOutputStream dos) throws IOException
+    {
+        dos.writeShort(type_index);    // u2 index of type name in cpool
+        dos.writeShort(element_value_pairs.size()); // u2 element_value pair count
+        for (int i = 0 ; i<element_value_pairs.size();i++) {
+            ElementValuePair envp = (ElementValuePair) element_value_pairs.get(i);
+            envp.dump(dos);
+        }
+    }
 
-	
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java Sat Jul 24 11:03:00 2010
@@ -98,9 +98,9 @@ public abstract class Annotations extend
     
     
     protected void writeAnnotations(DataOutputStream dos) throws IOException
-	{
-		dos.writeShort(annotation_table_length);
-		for (int i = 0; i < annotation_table_length; i++)
-			annotation_table[i].dump(dos);
-	}
+    {
+        dos.writeShort(annotation_table_length);
+        for (int i = 0; i < annotation_table_length; i++)
+            annotation_table[i].dump(dos);
+    }
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ArrayElementValue.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ArrayElementValue.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ArrayElementValue.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ArrayElementValue.java Sat Jul 24 11:03:00 2010
@@ -22,60 +22,60 @@ import java.io.IOException;
 
 public class ArrayElementValue extends ElementValue
 {
-	// For array types, this is the array
-	private ElementValue[] evalues;
+    // For array types, this is the array
+    private ElementValue[] evalues;
 
-	public String toString()
-	{
-		StringBuffer sb = new StringBuffer();
-		sb.append("{");
-		for (int i = 0; i < evalues.length; i++)
-		{
-			sb.append(evalues[i].toString());
-			if ((i + 1) < evalues.length)
-				sb.append(",");
-		}
-		sb.append("}");
-		return sb.toString();
-	}
-
-	public ArrayElementValue(int type, ElementValue[] datums, ConstantPool cpool)
-	{
-		super(type, cpool);
-		if (type != ARRAY)
-			throw new RuntimeException(
-					"Only element values of type array can be built with this ctor - type specified: " + type);
-		this.evalues = datums;
-	}
-
-	public void dump(DataOutputStream dos) throws IOException
-	{
-		dos.writeByte(type); // u1 type of value (ARRAY == '[')
-		dos.writeShort(evalues.length);
-		for (int i = 0; i < evalues.length; i++)
-		{
-			evalues[i].dump(dos);
-		}
-	}
-
-	public String stringifyValue()
-	{
-		StringBuffer sb = new StringBuffer();
-		sb.append("[");
-		for (int i = 0; i < evalues.length; i++)
-		{
-			sb.append(evalues[i].stringifyValue());
-			if ((i + 1) < evalues.length)
-				sb.append(",");
-		}
-		sb.append("]");
-		return sb.toString();
-	}
-
-	public ElementValue[] getElementValuesArray()
-	{
-		return evalues;
-	}
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer();
+        sb.append("{");
+        for (int i = 0; i < evalues.length; i++)
+        {
+            sb.append(evalues[i].toString());
+            if ((i + 1) < evalues.length)
+                sb.append(",");
+        }
+        sb.append("}");
+        return sb.toString();
+    }
+
+    public ArrayElementValue(int type, ElementValue[] datums, ConstantPool cpool)
+    {
+        super(type, cpool);
+        if (type != ARRAY)
+            throw new RuntimeException(
+                    "Only element values of type array can be built with this ctor - type specified: " + type);
+        this.evalues = datums;
+    }
+
+    public void dump(DataOutputStream dos) throws IOException
+    {
+        dos.writeByte(type); // u1 type of value (ARRAY == '[')
+        dos.writeShort(evalues.length);
+        for (int i = 0; i < evalues.length; i++)
+        {
+            evalues[i].dump(dos);
+        }
+    }
+
+    public String stringifyValue()
+    {
+        StringBuffer sb = new StringBuffer();
+        sb.append("[");
+        for (int i = 0; i < evalues.length; i++)
+        {
+            sb.append(evalues[i].stringifyValue());
+            if ((i + 1) < evalues.length)
+                sb.append(",");
+        }
+        sb.append("]");
+        return sb.toString();
+    }
+
+    public ElementValue[] getElementValuesArray()
+    {
+        return evalues;
+    }
 
-	
+    
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java Sat Jul 24 11:03:00 2010
@@ -50,202 +50,202 @@ import org.apache.tomcat.util.bcel.class
  */
 public abstract class Attribute implements Cloneable, Serializable
 {
-	protected int name_index; // Points to attribute name in constant pool
+    protected int name_index; // Points to attribute name in constant pool
 
-	protected int length; // Content length of attribute field
+    protected int length; // Content length of attribute field
 
-	protected byte tag; // Tag to distiguish subclasses
+    protected byte tag; // Tag to distiguish subclasses
 
-	protected ConstantPool constant_pool;
+    protected ConstantPool constant_pool;
 
-	protected Attribute(byte tag, int name_index, int length,
-			ConstantPool constant_pool)
-	{
-		this.tag = tag;
-		this.name_index = name_index;
-		this.length = length;
-		this.constant_pool = constant_pool;
-	}
-
-	/**
-	 * Dump attribute to file stream in binary format.
-	 * 
-	 * @param file
-	 *            Output file stream
-	 * @throws IOException
-	 */
-	public void dump(DataOutputStream file) throws IOException
-	{
-		file.writeShort(name_index);
-		file.writeInt(length);
-	}
-
-	private static Map readers = new HashMap();
-
-	
-
-	
-
-	/*
-	 * Class method reads one attribute from the input data stream. This method
-	 * must not be accessible from the outside. It is called by the Field and
-	 * Method constructor methods.
-	 * 
-	 * @see Field
-	 * @see Method @param file Input stream @param constant_pool Array of
-	 *      constants @return Attribute @throws IOException @throws
-	 *      ClassFormatException
-	 */
-	public static final Attribute readAttribute(DataInputStream file,
-			ConstantPool constant_pool) throws IOException,
-			ClassFormatException
-	{
-		ConstantUtf8 c;
-		String name;
-		int name_index;
-		int length;
-		byte tag = Constants.ATTR_UNKNOWN; // Unknown attribute
-		// Get class name from constant pool via `name_index' indirection
-		name_index = file.readUnsignedShort();
-		c = (ConstantUtf8) constant_pool.getConstant(name_index,
-				Constants.CONSTANT_Utf8);
-		name = c.getBytes();
-		// Length of data in bytes
-		length = file.readInt();
-		// Compare strings to find known attribute
-		// System.out.println(name);
-		for (byte i = 0; i < Constants.KNOWN_ATTRIBUTES; i++)
-		{
-			if (name.equals(Constants.ATTRIBUTE_NAMES[i]))
-			{
-				tag = i; // found!
-				break;
-			}
-		}
-		// Call proper constructor, depending on `tag'
-		switch (tag)
-		{
-		case Constants.ATTR_UNKNOWN:
-			AttributeReader r = (AttributeReader) readers.get(name);
-			if (r != null)
-			{
-				return r.createAttribute(name_index, length, file,
-						constant_pool);
-			}
-			return new Unknown(name_index, length, file, constant_pool);
-		case Constants.ATTR_CONSTANT_VALUE:
-			return new ConstantValue(name_index, length, file, constant_pool);
-		case Constants.ATTR_SOURCE_FILE:
-			return new SourceFile(name_index, length, file, constant_pool);
-		case Constants.ATTR_CODE:
-			return new Code(name_index, length, file, constant_pool);
-		case Constants.ATTR_EXCEPTIONS:
-			return new ExceptionTable(name_index, length, file, constant_pool);
-		case Constants.ATTR_LINE_NUMBER_TABLE:
-			return new LineNumberTable(name_index, length, file, constant_pool);
-		case Constants.ATTR_LOCAL_VARIABLE_TABLE:
-			return new LocalVariableTable(name_index, length, file,
-					constant_pool);
-		case Constants.ATTR_INNER_CLASSES:
-			return new InnerClasses(name_index, length, file, constant_pool);
-		case Constants.ATTR_SYNTHETIC:
-			return new Synthetic(name_index, length, file, constant_pool);
-		case Constants.ATTR_DEPRECATED:
-			return new Deprecated(name_index, length, file, constant_pool);
-		case Constants.ATTR_PMG:
-			return new PMGClass(name_index, length, file, constant_pool);
-		case Constants.ATTR_SIGNATURE:
-			return new Signature(name_index, length, file, constant_pool);
-		case Constants.ATTR_STACK_MAP:
-			return new StackMap(name_index, length, file, constant_pool);
-		case Constants.ATTR_RUNTIME_VISIBLE_ANNOTATIONS:
-			return new RuntimeVisibleAnnotations(name_index, length, file,
-					constant_pool);
-		case Constants.ATTR_RUNTIMEIN_VISIBLE_ANNOTATIONS:
-			return new RuntimeInvisibleAnnotations(name_index, length, file,
-					constant_pool);
-		case Constants.ATTR_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS:
-			return new RuntimeVisibleParameterAnnotations(name_index, length,
-					file, constant_pool);
-		case Constants.ATTR_RUNTIMEIN_VISIBLE_PARAMETER_ANNOTATIONS:
-			return new RuntimeInvisibleParameterAnnotations(name_index, length,
-					file, constant_pool);
-		case Constants.ATTR_ANNOTATION_DEFAULT:
-			return new AnnotationDefault(name_index, length, file,
-					constant_pool);
-		case Constants.ATTR_LOCAL_VARIABLE_TYPE_TABLE:
-			return new LocalVariableTypeTable(name_index, length, file,
-					constant_pool);
-		case Constants.ATTR_ENCLOSING_METHOD:
-			return new EnclosingMethod(name_index, length, file, constant_pool);
-		case Constants.ATTR_STACK_MAP_TABLE:
-			return new StackMapTable(name_index, length, file, constant_pool);
-		default: // Never reached
-			throw new IllegalStateException("Unrecognized attribute type tag parsed: " + tag);
-		}
-	}
-
-	/**
-	 * @return Name of attribute
-	 */
-	public String getName()
-	{
-		ConstantUtf8 c = (ConstantUtf8) constant_pool.getConstant(name_index,
-				Constants.CONSTANT_Utf8);
-		return c.getBytes();
-	}
-
-	
-
-	
-
-	
-
-	
-
-	/**
-	 * @return Tag of attribute, i.e., its type. Value may not be altered, thus
-	 *         there is no setTag() method.
-	 */
-	public final byte getTag()
-	{
-		return tag;
-	}
-
-	
-
-	
-
-	/**
-	 * Use copy() if you want to have a deep copy(), i.e., with all references
-	 * copied correctly.
-	 * 
-	 * @return shallow copy of this attribute
-	 */
-	public Object clone()
-	{
-		Object o = null;
-		try
-		{
-			o = super.clone();
-		}
-		catch (CloneNotSupportedException e)
-		{
-			e.printStackTrace(); // Never occurs
-		}
-		return o;
-	}
-
-	/**
-	 * @return deep copy of this attribute
-	 */
-	public abstract Attribute copy(ConstantPool _constant_pool);
-
-	/**
-	 * @return attribute name.
-	 */
-	public String toString()
-	{
-		return Constants.ATTRIBUTE_NAMES[tag];
-	}
+    protected Attribute(byte tag, int name_index, int length,
+            ConstantPool constant_pool)
+    {
+        this.tag = tag;
+        this.name_index = name_index;
+        this.length = length;
+        this.constant_pool = constant_pool;
+    }
+
+    /**
+     * Dump attribute to file stream in binary format.
+     * 
+     * @param file
+     *            Output file stream
+     * @throws IOException
+     */
+    public void dump(DataOutputStream file) throws IOException
+    {
+        file.writeShort(name_index);
+        file.writeInt(length);
+    }
+
+    private static Map readers = new HashMap();
+
+    
+
+    
+
+    /*
+     * Class method reads one attribute from the input data stream. This method
+     * must not be accessible from the outside. It is called by the Field and
+     * Method constructor methods.
+     * 
+     * @see Field
+     * @see Method @param file Input stream @param constant_pool Array of
+     *      constants @return Attribute @throws IOException @throws
+     *      ClassFormatException
+     */
+    public static final Attribute readAttribute(DataInputStream file,
+            ConstantPool constant_pool) throws IOException,
+            ClassFormatException
+    {
+        ConstantUtf8 c;
+        String name;
+        int name_index;
+        int length;
+        byte tag = Constants.ATTR_UNKNOWN; // Unknown attribute
+        // Get class name from constant pool via `name_index' indirection
+        name_index = file.readUnsignedShort();
+        c = (ConstantUtf8) constant_pool.getConstant(name_index,
+                Constants.CONSTANT_Utf8);
+        name = c.getBytes();
+        // Length of data in bytes
+        length = file.readInt();
+        // Compare strings to find known attribute
+        // System.out.println(name);
+        for (byte i = 0; i < Constants.KNOWN_ATTRIBUTES; i++)
+        {
+            if (name.equals(Constants.ATTRIBUTE_NAMES[i]))
+            {
+                tag = i; // found!
+                break;
+            }
+        }
+        // Call proper constructor, depending on `tag'
+        switch (tag)
+        {
+        case Constants.ATTR_UNKNOWN:
+            AttributeReader r = (AttributeReader) readers.get(name);
+            if (r != null)
+            {
+                return r.createAttribute(name_index, length, file,
+                        constant_pool);
+            }
+            return new Unknown(name_index, length, file, constant_pool);
+        case Constants.ATTR_CONSTANT_VALUE:
+            return new ConstantValue(name_index, length, file, constant_pool);
+        case Constants.ATTR_SOURCE_FILE:
+            return new SourceFile(name_index, length, file, constant_pool);
+        case Constants.ATTR_CODE:
+            return new Code(name_index, length, file, constant_pool);
+        case Constants.ATTR_EXCEPTIONS:
+            return new ExceptionTable(name_index, length, file, constant_pool);
+        case Constants.ATTR_LINE_NUMBER_TABLE:
+            return new LineNumberTable(name_index, length, file, constant_pool);
+        case Constants.ATTR_LOCAL_VARIABLE_TABLE:
+            return new LocalVariableTable(name_index, length, file,
+                    constant_pool);
+        case Constants.ATTR_INNER_CLASSES:
+            return new InnerClasses(name_index, length, file, constant_pool);
+        case Constants.ATTR_SYNTHETIC:
+            return new Synthetic(name_index, length, file, constant_pool);
+        case Constants.ATTR_DEPRECATED:
+            return new Deprecated(name_index, length, file, constant_pool);
+        case Constants.ATTR_PMG:
+            return new PMGClass(name_index, length, file, constant_pool);
+        case Constants.ATTR_SIGNATURE:
+            return new Signature(name_index, length, file, constant_pool);
+        case Constants.ATTR_STACK_MAP:
+            return new StackMap(name_index, length, file, constant_pool);
+        case Constants.ATTR_RUNTIME_VISIBLE_ANNOTATIONS:
+            return new RuntimeVisibleAnnotations(name_index, length, file,
+                    constant_pool);
+        case Constants.ATTR_RUNTIMEIN_VISIBLE_ANNOTATIONS:
+            return new RuntimeInvisibleAnnotations(name_index, length, file,
+                    constant_pool);
+        case Constants.ATTR_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS:
+            return new RuntimeVisibleParameterAnnotations(name_index, length,
+                    file, constant_pool);
+        case Constants.ATTR_RUNTIMEIN_VISIBLE_PARAMETER_ANNOTATIONS:
+            return new RuntimeInvisibleParameterAnnotations(name_index, length,
+                    file, constant_pool);
+        case Constants.ATTR_ANNOTATION_DEFAULT:
+            return new AnnotationDefault(name_index, length, file,
+                    constant_pool);
+        case Constants.ATTR_LOCAL_VARIABLE_TYPE_TABLE:
+            return new LocalVariableTypeTable(name_index, length, file,
+                    constant_pool);
+        case Constants.ATTR_ENCLOSING_METHOD:
+            return new EnclosingMethod(name_index, length, file, constant_pool);
+        case Constants.ATTR_STACK_MAP_TABLE:
+            return new StackMapTable(name_index, length, file, constant_pool);
+        default: // Never reached
+            throw new IllegalStateException("Unrecognized attribute type tag parsed: " + tag);
+        }
+    }
+
+    /**
+     * @return Name of attribute
+     */
+    public String getName()
+    {
+        ConstantUtf8 c = (ConstantUtf8) constant_pool.getConstant(name_index,
+                Constants.CONSTANT_Utf8);
+        return c.getBytes();
+    }
+
+    
+
+    
+
+    
+
+    
+
+    /**
+     * @return Tag of attribute, i.e., its type. Value may not be altered, thus
+     *         there is no setTag() method.
+     */
+    public final byte getTag()
+    {
+        return tag;
+    }
+
+    
+
+    
+
+    /**
+     * Use copy() if you want to have a deep copy(), i.e., with all references
+     * copied correctly.
+     * 
+     * @return shallow copy of this attribute
+     */
+    public Object clone()
+    {
+        Object o = null;
+        try
+        {
+            o = super.clone();
+        }
+        catch (CloneNotSupportedException e)
+        {
+            e.printStackTrace(); // Never occurs
+        }
+        return o;
+    }
+
+    /**
+     * @return deep copy of this attribute
+     */
+    public abstract Attribute copy(ConstantPool _constant_pool);
+
+    /**
+     * @return attribute name.
+     */
+    public String toString()
+    {
+        return Constants.ATTRIBUTE_NAMES[tag];
+    }
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassElementValue.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassElementValue.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassElementValue.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassElementValue.java Sat Jul 24 11:03:00 2010
@@ -23,31 +23,31 @@ import org.apache.tomcat.util.bcel.Const
 
 public class ClassElementValue extends ElementValue
 {
-	// For primitive types and string type, this points to the value entry in
-	// the cpool
-	// For 'class' this points to the class entry in the cpool
-	private int idx;
-
-	public ClassElementValue(int type, int idx, ConstantPool cpool)
-	{
-		super(type, cpool);
-		this.idx = idx;
-	}
-
-	
-
-	
-
-	public String stringifyValue()
-	{
-		ConstantUtf8 cu8 = (ConstantUtf8) cpool.getConstant(idx,
-				Constants.CONSTANT_Utf8);
-		return cu8.getBytes();
-	}
-
-	public void dump(DataOutputStream dos) throws IOException
-	{
-		dos.writeByte(type); // u1 kind of value
-		dos.writeShort(idx);
-	}
+    // For primitive types and string type, this points to the value entry in
+    // the cpool
+    // For 'class' this points to the class entry in the cpool
+    private int idx;
+
+    public ClassElementValue(int type, int idx, ConstantPool cpool)
+    {
+        super(type, cpool);
+        this.idx = idx;
+    }
+
+    
+
+    
+
+    public String stringifyValue()
+    {
+        ConstantUtf8 cu8 = (ConstantUtf8) cpool.getConstant(idx,
+                Constants.CONSTANT_Utf8);
+        return cu8.getBytes();
+    }
+
+    public void dump(DataOutputStream dos) throws IOException
+    {
+        dos.writeByte(type); // u1 kind of value
+        dos.writeShort(idx);
+    }
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassFormatException.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassFormatException.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassFormatException.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassFormatException.java Sat Jul 24 11:03:00 2010
@@ -37,6 +37,6 @@ public class ClassFormatException extend
     }
     
     public ClassFormatException(String s, Throwable initCause) {
-    	super(s, initCause);
+        super(s, initCause);
     }
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java Sat Jul 24 11:03:00 2010
@@ -139,23 +139,23 @@ public final class ClassParser {
             //        byte[] buf = new byte[bytes];
             //        file.read(buf);
             //        if(!(is_zip && (buf.length == 1))) {
-            //  	System.err.println("WARNING: Trailing garbage at end of " + file_name);
-            //  	System.err.println(bytes + " extra bytes: " + Utility.toHexString(buf));
+            //          System.err.println("WARNING: Trailing garbage at end of " + file_name);
+            //          System.err.println(bytes + " extra bytes: " + Utility.toHexString(buf));
             //        }
             //      }
         } finally {
             // Read everything of interest, so close the file
             if (fileOwned) {
-            	try {
-	                if (file != null) {
-	                    file.close();
-	                }
-	                if (zip != null) {
-	                    zip.close();
-	                }
-            	} catch (IOException ioe) {
-            		//ignore close exceptions
-            	}
+                try {
+                    if (file != null) {
+                        file.close();
+                    }
+                    if (zip != null) {
+                        zip.close();
+                    }
+                } catch (IOException ioe) {
+                    //ignore close exceptions
+                }
             }
         }
         // Return the information we have gathered in a new object

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValue.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValue.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValue.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValue.java Sat Jul 24 11:03:00 2010
@@ -28,108 +28,108 @@ import java.io.IOException;
  */
 public abstract class ElementValue
 {
-	protected int type;
+    protected int type;
 
-	protected ConstantPool cpool;
+    protected ConstantPool cpool;
 
-	public String toString()
-	{
-		return stringifyValue();
-	}
-
-	protected ElementValue(int type, ConstantPool cpool)
-	{
-		this.type = type;
-		this.cpool = cpool;
-	}
-
-	
-
-	public abstract String stringifyValue();
-
-	public abstract void dump(DataOutputStream dos) throws IOException;
-
-	public static final int STRING = 's';
-
-	public static final int ENUM_CONSTANT = 'e';
-
-	public static final int CLASS = 'c';
-
-	public static final int ANNOTATION = '@';
-
-	public static final int ARRAY = '[';
-
-	public static final int PRIMITIVE_INT = 'I';
-
-	public static final int PRIMITIVE_BYTE = 'B';
-
-	public static final int PRIMITIVE_CHAR = 'C';
-
-	public static final int PRIMITIVE_DOUBLE = 'D';
-
-	public static final int PRIMITIVE_FLOAT = 'F';
-
-	public static final int PRIMITIVE_LONG = 'J';
-
-	public static final int PRIMITIVE_SHORT = 'S';
-
-	public static final int PRIMITIVE_BOOLEAN = 'Z';
-
-	public static ElementValue readElementValue(DataInputStream dis,
-			ConstantPool cpool) throws IOException
-	{
-		byte type = dis.readByte();
-		switch (type)
-		{
-		case 'B': // byte
-			return new SimpleElementValue(PRIMITIVE_BYTE, dis
-					.readUnsignedShort(), cpool);
-		case 'C': // char
-			return new SimpleElementValue(PRIMITIVE_CHAR, dis
-					.readUnsignedShort(), cpool);
-		case 'D': // double
-			return new SimpleElementValue(PRIMITIVE_DOUBLE, dis
-					.readUnsignedShort(), cpool);
-		case 'F': // float
-			return new SimpleElementValue(PRIMITIVE_FLOAT, dis
-					.readUnsignedShort(), cpool);
-		case 'I': // int
-			return new SimpleElementValue(PRIMITIVE_INT, dis
-					.readUnsignedShort(), cpool);
-		case 'J': // long
-			return new SimpleElementValue(PRIMITIVE_LONG, dis
-					.readUnsignedShort(), cpool);
-		case 'S': // short
-			return new SimpleElementValue(PRIMITIVE_SHORT, dis
-					.readUnsignedShort(), cpool);
-		case 'Z': // boolean
-			return new SimpleElementValue(PRIMITIVE_BOOLEAN, dis
-					.readUnsignedShort(), cpool);
-		case 's': // String
-			return new SimpleElementValue(STRING, dis.readUnsignedShort(),
-					cpool);
-		case 'e': // Enum constant
-			return new EnumElementValue(ENUM_CONSTANT, dis.readUnsignedShort(),
-					dis.readUnsignedShort(), cpool);
-		case 'c': // Class
-			return new ClassElementValue(CLASS, dis.readUnsignedShort(), cpool);
-		case '@': // Annotation
-			// TODO isRuntimeVisible
-			return new AnnotationElementValue(ANNOTATION, AnnotationEntry.read(
-					dis, cpool, false), cpool);
-		case '[': // Array
-			int numArrayVals = dis.readUnsignedShort();
-			ElementValue[] evalues = new ElementValue[numArrayVals];
-			for (int j = 0; j < numArrayVals; j++)
-			{
-				evalues[j] = ElementValue.readElementValue(dis, cpool);
-			}
-			return new ArrayElementValue(ARRAY, evalues, cpool);
-		default:
-			throw new RuntimeException(
-					"Unexpected element value kind in annotation: " + type);
-		}
-	}
+    public String toString()
+    {
+        return stringifyValue();
+    }
+
+    protected ElementValue(int type, ConstantPool cpool)
+    {
+        this.type = type;
+        this.cpool = cpool;
+    }
+
+    
+
+    public abstract String stringifyValue();
+
+    public abstract void dump(DataOutputStream dos) throws IOException;
+
+    public static final int STRING = 's';
+
+    public static final int ENUM_CONSTANT = 'e';
+
+    public static final int CLASS = 'c';
+
+    public static final int ANNOTATION = '@';
+
+    public static final int ARRAY = '[';
+
+    public static final int PRIMITIVE_INT = 'I';
+
+    public static final int PRIMITIVE_BYTE = 'B';
+
+    public static final int PRIMITIVE_CHAR = 'C';
+
+    public static final int PRIMITIVE_DOUBLE = 'D';
+
+    public static final int PRIMITIVE_FLOAT = 'F';
+
+    public static final int PRIMITIVE_LONG = 'J';
+
+    public static final int PRIMITIVE_SHORT = 'S';
+
+    public static final int PRIMITIVE_BOOLEAN = 'Z';
+
+    public static ElementValue readElementValue(DataInputStream dis,
+            ConstantPool cpool) throws IOException
+    {
+        byte type = dis.readByte();
+        switch (type)
+        {
+        case 'B': // byte
+            return new SimpleElementValue(PRIMITIVE_BYTE, dis
+                    .readUnsignedShort(), cpool);
+        case 'C': // char
+            return new SimpleElementValue(PRIMITIVE_CHAR, dis
+                    .readUnsignedShort(), cpool);
+        case 'D': // double
+            return new SimpleElementValue(PRIMITIVE_DOUBLE, dis
+                    .readUnsignedShort(), cpool);
+        case 'F': // float
+            return new SimpleElementValue(PRIMITIVE_FLOAT, dis
+                    .readUnsignedShort(), cpool);
+        case 'I': // int
+            return new SimpleElementValue(PRIMITIVE_INT, dis
+                    .readUnsignedShort(), cpool);
+        case 'J': // long
+            return new SimpleElementValue(PRIMITIVE_LONG, dis
+                    .readUnsignedShort(), cpool);
+        case 'S': // short
+            return new SimpleElementValue(PRIMITIVE_SHORT, dis
+                    .readUnsignedShort(), cpool);
+        case 'Z': // boolean
+            return new SimpleElementValue(PRIMITIVE_BOOLEAN, dis
+                    .readUnsignedShort(), cpool);
+        case 's': // String
+            return new SimpleElementValue(STRING, dis.readUnsignedShort(),
+                    cpool);
+        case 'e': // Enum constant
+            return new EnumElementValue(ENUM_CONSTANT, dis.readUnsignedShort(),
+                    dis.readUnsignedShort(), cpool);
+        case 'c': // Class
+            return new ClassElementValue(CLASS, dis.readUnsignedShort(), cpool);
+        case '@': // Annotation
+            // TODO isRuntimeVisible
+            return new AnnotationElementValue(ANNOTATION, AnnotationEntry.read(
+                    dis, cpool, false), cpool);
+        case '[': // Array
+            int numArrayVals = dis.readUnsignedShort();
+            ElementValue[] evalues = new ElementValue[numArrayVals];
+            for (int j = 0; j < numArrayVals; j++)
+            {
+                evalues[j] = ElementValue.readElementValue(dis, cpool);
+            }
+            return new ArrayElementValue(ARRAY, evalues, cpool);
+        default:
+            throw new RuntimeException(
+                    "Unexpected element value kind in annotation: " + type);
+        }
+    }
 
-	
+    
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValuePair.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValuePair.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValuePair.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValuePair.java Sat Jul 24 11:03:00 2010
@@ -30,38 +30,38 @@ import org.apache.tomcat.util.bcel.Const
  */
 public class ElementValuePair
 {
-	private ElementValue elementValue;
+    private ElementValue elementValue;
 
-	private ConstantPool constantPool;
+    private ConstantPool constantPool;
 
-	private int elementNameIndex;
+    private int elementNameIndex;
 
-	public ElementValuePair(int elementNameIndex, ElementValue elementValue,
-			ConstantPool constantPool)
-	{
-		this.elementValue = elementValue;
-		this.elementNameIndex = elementNameIndex;
-		this.constantPool = constantPool;
-	}
-
-	public String getNameString()
-	{
-		ConstantUtf8 c = (ConstantUtf8) constantPool.getConstant(
-				elementNameIndex, Constants.CONSTANT_Utf8);
-		return c.getBytes();
-	}
-
-	public final ElementValue getValue()
-	{
-		return elementValue;
-	}
-
-	
-
-	
-	
-	protected void dump(DataOutputStream dos) throws IOException {
-		dos.writeShort(elementNameIndex); // u2 name of the element
-		elementValue.dump(dos);
-	}
+    public ElementValuePair(int elementNameIndex, ElementValue elementValue,
+            ConstantPool constantPool)
+    {
+        this.elementValue = elementValue;
+        this.elementNameIndex = elementNameIndex;
+        this.constantPool = constantPool;
+    }
+
+    public String getNameString()
+    {
+        ConstantUtf8 c = (ConstantUtf8) constantPool.getConstant(
+                elementNameIndex, Constants.CONSTANT_Utf8);
+        return c.getBytes();
+    }
+
+    public final ElementValue getValue()
+    {
+        return elementValue;
+    }
+
+    
+
+    
+    
+    protected void dump(DataOutputStream dos) throws IOException {
+        dos.writeShort(elementNameIndex); // u2 name of the element
+        elementValue.dump(dos);
+    }
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/EnclosingMethod.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/EnclosingMethod.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/EnclosingMethod.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/EnclosingMethod.java Sat Jul 24 11:03:00 2010
@@ -27,41 +27,41 @@ import org.apache.tomcat.util.bcel.Const
  * anonymous classes and ... there can be only one.
  */
 public class EnclosingMethod extends Attribute {
-	
-	// Pointer to the CONSTANT_Class_info structure representing the 
-	// innermost class that encloses the declaration of the current class.
-	private int classIndex;
-	
-	// If the current class is not immediately enclosed by a method or 
-	// constructor, then the value of the method_index item must be zero.  
-	// Otherwise, the value of the  method_index item must point to a 
-	// CONSTANT_NameAndType_info structure representing the name and the 
-	// type of a method in the class referenced by the class we point 
-	// to in the class_index.  *It is the compiler responsibility* to 
-	// ensure that the method identified by this index is the closest 
-	// lexically enclosing method that includes the local/anonymous class.
-	private int methodIndex;
+    
+    // Pointer to the CONSTANT_Class_info structure representing the 
+    // innermost class that encloses the declaration of the current class.
+    private int classIndex;
+    
+    // If the current class is not immediately enclosed by a method or 
+    // constructor, then the value of the method_index item must be zero.  
+    // Otherwise, the value of the  method_index item must point to a 
+    // CONSTANT_NameAndType_info structure representing the name and the 
+    // type of a method in the class referenced by the class we point 
+    // to in the class_index.  *It is the compiler responsibility* to 
+    // ensure that the method identified by this index is the closest 
+    // lexically enclosing method that includes the local/anonymous class.
+    private int methodIndex;
 
-	// Ctors - and code to read an attribute in.
-	public EnclosingMethod(int nameIndex, int len, DataInputStream dis, ConstantPool cpool) throws IOException {
-		this(nameIndex, len, dis.readUnsignedShort(), dis.readUnsignedShort(), cpool);
-	}
+    // Ctors - and code to read an attribute in.
+    public EnclosingMethod(int nameIndex, int len, DataInputStream dis, ConstantPool cpool) throws IOException {
+        this(nameIndex, len, dis.readUnsignedShort(), dis.readUnsignedShort(), cpool);
+    }
 
-	private EnclosingMethod(int nameIndex, int len, int classIdx,int methodIdx, ConstantPool cpool) {
-	    super(Constants.ATTR_ENCLOSING_METHOD, nameIndex, len, cpool);
-	    classIndex  = classIdx;
-	    methodIndex = methodIdx;
-	}
+    private EnclosingMethod(int nameIndex, int len, int classIdx,int methodIdx, ConstantPool cpool) {
+        super(Constants.ATTR_ENCLOSING_METHOD, nameIndex, len, cpool);
+        classIndex  = classIdx;
+        methodIndex = methodIdx;
+    }
 
-	public Attribute copy(ConstantPool constant_pool) {
-		throw new RuntimeException("Not implemented yet!");
-		// is this next line sufficient?
-		// return (EnclosingMethod)clone();
-	}
-	
+    public Attribute copy(ConstantPool constant_pool) {
+        throw new RuntimeException("Not implemented yet!");
+        // is this next line sufficient?
+        // return (EnclosingMethod)clone();
+    }
+    
     public final void dump(DataOutputStream file) throws IOException {
-	    super.dump(file);
-	    file.writeShort(classIndex);
-	    file.writeShort(methodIndex);
+        super.dump(file);
+        file.writeShort(classIndex);
+        file.writeShort(methodIndex);
     }    
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/EnumElementValue.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/EnumElementValue.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/EnumElementValue.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/EnumElementValue.java Sat Jul 24 11:03:00 2010
@@ -23,41 +23,34 @@ import org.apache.tomcat.util.bcel.Const
 
 public class EnumElementValue extends ElementValue
 {
-	// For enum types, these two indices point to the type and value
-	private int typeIdx;
+    // For enum types, these two indices point to the type and value
+    private int typeIdx;
 
-	private int valueIdx;
+    private int valueIdx;
 
-	public EnumElementValue(int type, int typeIdx, int valueIdx,
-			ConstantPool cpool)
-	{
-		super(type, cpool);
-		if (type != ENUM_CONSTANT)
-			throw new RuntimeException(
-					"Only element values of type enum can be built with this ctor - type specified: " + type);
-		this.typeIdx = typeIdx;
-		this.valueIdx = valueIdx;
-	}
-
-	public void dump(DataOutputStream dos) throws IOException
-	{
-		dos.writeByte(type); // u1 type of value (ENUM_CONSTANT == 'e')
-		dos.writeShort(typeIdx); // u2
-		dos.writeShort(valueIdx); // u2
-	}
-
-	public String stringifyValue()
-	{
-		ConstantUtf8 cu8 = (ConstantUtf8) cpool.getConstant(valueIdx,
-				Constants.CONSTANT_Utf8);
-		return cu8.getBytes();
-	}
+    public EnumElementValue(int type, int typeIdx, int valueIdx,
+            ConstantPool cpool)
+    {
+        super(type, cpool);
+        if (type != ENUM_CONSTANT)
+            throw new RuntimeException(
+                    "Only element values of type enum can be built with this ctor - type specified: " + type);
+        this.typeIdx = typeIdx;
+        this.valueIdx = valueIdx;
+    }
+
+    public void dump(DataOutputStream dos) throws IOException
+    {
+        dos.writeByte(type); // u1 type of value (ENUM_CONSTANT == 'e')
+        dos.writeShort(typeIdx); // u2
+        dos.writeShort(valueIdx); // u2
+    }
+
+    public String stringifyValue()
+    {
+        ConstantUtf8 cu8 = (ConstantUtf8) cpool.getConstant(valueIdx,
+                Constants.CONSTANT_Utf8);
+        return cu8.getBytes();
+    }
 
-	
-
-	
-
-	
-
-	
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java Sat Jul 24 11:03:00 2010
@@ -177,23 +177,24 @@ public class JavaClass extends AccessFla
     }
     
     public AnnotationEntry[] getAnnotationEntries() {
-      	if (annotationsOutOfDate) { 
-      		// Find attributes that contain annotation data
-      		Attribute[] attrs = getAttributes();
-      		List accumulatedAnnotations = new ArrayList();
-      		for (int i = 0; i < attrs.length; i++) {
-    			Attribute attribute = attrs[i];
-    			if (attribute instanceof Annotations) {				
-    				Annotations runtimeAnnotations = (Annotations)attribute;
-    				for(int j = 0; j < runtimeAnnotations.getAnnotationEntries().length; j++)
-    					accumulatedAnnotations.add(runtimeAnnotations.getAnnotationEntries()[j]);
-    			}
-    		}
-      		annotations = (AnnotationEntry[])accumulatedAnnotations.toArray(new AnnotationEntry[accumulatedAnnotations.size()]);
-      		annotationsOutOfDate = false;
-      	}
-      	return annotations;
-      }
+        if (annotationsOutOfDate) { 
+            // Find attributes that contain annotation data
+            Attribute[] attrs = getAttributes();
+            List accumulatedAnnotations = new ArrayList();
+            for (int i = 0; i < attrs.length; i++) {
+                Attribute attribute = attrs[i];
+                if (attribute instanceof Annotations) {
+                    Annotations runtimeAnnotations = (Annotations)attribute;
+                    for(int j = 0; j < runtimeAnnotations.getAnnotationEntries().length; j++)
+                        accumulatedAnnotations.add(runtimeAnnotations.getAnnotationEntries()[j]);
+                }
+            }
+            annotations = (AnnotationEntry[])accumulatedAnnotations.toArray(new AnnotationEntry[accumulatedAnnotations.size()]);
+            annotationsOutOfDate = false;
+        }
+        return annotations;
+    }
+
     /**
      * @return Class name.
      */
@@ -237,9 +238,9 @@ public class JavaClass extends AccessFla
         }
         AnnotationEntry[] annotations = getAnnotationEntries();
         if (annotations!=null && annotations.length>0) {
-        	buf.append("\nAnnotation(s):\n");
-        	for (int i=0; i<annotations.length; i++) 
-        		buf.append(indent(annotations[i]));
+            buf.append("\nAnnotation(s):\n");
+            for (int i=0; i<annotations.length; i++) 
+                buf.append(indent(annotations[i]));
         }
         if (fields.length > 0) {
             buf.append("\n").append(fields.length).append(" fields:\n");

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTypeTable.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTypeTable.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTypeTable.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTypeTable.java Sat Jul 24 11:03:00 2010
@@ -22,16 +22,16 @@ import  java.io.*;
 // The new table is used when generic types are about...
 
 //LocalVariableTable_attribute {
-//	   u2 attribute_name_index;
-//	   u4 attribute_length;
-//	   u2 local_variable_table_length;
-//	   {  u2 start_pc;
-//	      u2 length;
-//	      u2 name_index;
-//	      u2 descriptor_index;
-//	      u2 index;
-//	   } local_variable_table[local_variable_table_length];
-//	 }
+//     u2 attribute_name_index;
+//     u4 attribute_length;
+//     u2 local_variable_table_length;
+//     {  u2 start_pc;
+//        u2 length;
+//        u2 name_index;
+//        u2 descriptor_index;
+//        u2 index;
+//     } local_variable_table[local_variable_table_length];
+//   }
 
 //LocalVariableTypeTable_attribute {
 //    u2 attribute_name_index;
@@ -51,8 +51,8 @@ public class LocalVariableTypeTable exte
   private LocalVariable[] local_variable_type_table;        // variables
 
   public LocalVariableTypeTable(int name_index, int length,
-			    LocalVariable[] local_variable_table,
-			    ConstantPool    constant_pool)
+                                LocalVariable[] local_variable_table,
+                                ConstantPool    constant_pool)
   {
     super(Constants.ATTR_LOCAL_VARIABLE_TYPE_TABLE, name_index, length, constant_pool);
     setLocalVariableTable(local_variable_table);

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotationEntry.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotationEntry.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotationEntry.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotationEntry.java Sat Jul 24 11:03:00 2010
@@ -43,7 +43,7 @@ public class ParameterAnnotationEntry im
         annotation_table_length = (file.readUnsignedShort());
         annotation_table = new AnnotationEntry[annotation_table_length];
         for (int i = 0; i < annotation_table_length; i++) {
-//        	 TODO isRuntimeVisible
+            // TODO isRuntimeVisible
             annotation_table[i] = AnnotationEntry.read(file, constant_pool, false);
         }
     }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeInvisibleAnnotations.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeInvisibleAnnotations.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeInvisibleAnnotations.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeInvisibleAnnotations.java Sat Jul 24 11:03:00 2010
@@ -32,36 +32,36 @@ import org.apache.tomcat.util.bcel.Const
  */
 public class RuntimeInvisibleAnnotations extends Annotations
 {
-	/**
-	 * @param name_index
-	 *            Index pointing to the name <em>Code</em>
-	 * @param length
-	 *            Content length in bytes
-	 * @param file
-	 *            Input stream
-	 * @param constant_pool
-	 *            Array of constants
-	 */
-	RuntimeInvisibleAnnotations(int name_index, int length,
-			DataInputStream file, ConstantPool constant_pool)
-			throws IOException
-	{
-		super(Constants.ATTR_RUNTIMEIN_VISIBLE_ANNOTATIONS, name_index, length,
-				file, constant_pool, false);
-	}
+    /**
+     * @param name_index
+     *            Index pointing to the name <em>Code</em>
+     * @param length
+     *            Content length in bytes
+     * @param file
+     *            Input stream
+     * @param constant_pool
+     *            Array of constants
+     */
+    RuntimeInvisibleAnnotations(int name_index, int length,
+                                DataInputStream file, ConstantPool constant_pool)
+                                throws IOException
+    {
+        super(Constants.ATTR_RUNTIMEIN_VISIBLE_ANNOTATIONS, name_index, length,
+                file, constant_pool, false);
+    }
 
-	/**
-	 * @return deep copy of this attribute
-	 */
-	public Attribute copy(ConstantPool constant_pool)
-	{
-		Annotations c = (Annotations) clone();
-		return c;
-	}
+    /**
+     * @return deep copy of this attribute
+     */
+    public Attribute copy(ConstantPool constant_pool)
+    {
+        Annotations c = (Annotations) clone();
+        return c;
+    }
 
-	public final void dump(DataOutputStream dos) throws IOException
-	{
-		super.dump(dos);
-		writeAnnotations(dos);
-	}
+    public final void dump(DataOutputStream dos) throws IOException
+    {
+        super.dump(dos);
+        writeAnnotations(dos);
+    }
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeVisibleAnnotations.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeVisibleAnnotations.java?rev=978845&r1=978844&r2=978845&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeVisibleAnnotations.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeVisibleAnnotations.java Sat Jul 24 11:03:00 2010
@@ -32,36 +32,36 @@ import org.apache.tomcat.util.bcel.Const
  */
 public class RuntimeVisibleAnnotations extends Annotations
 {
-	/**
-	 * @param name_index
-	 *            Index pointing to the name <em>Code</em>
-	 * @param length
-	 *            Content length in bytes
-	 * @param file
-	 *            Input stream
-	 * @param constant_pool
-	 *            Array of constants
-	 */
-	public RuntimeVisibleAnnotations(int name_index, int length,
-			DataInputStream file, ConstantPool constant_pool)
-			throws IOException
-	{
-		super(Constants.ATTR_RUNTIME_VISIBLE_ANNOTATIONS, name_index, length,
-				file, constant_pool, true);
-	}
+    /**
+     * @param name_index
+     *            Index pointing to the name <em>Code</em>
+     * @param length
+     *            Content length in bytes
+     * @param file
+     *            Input stream
+     * @param constant_pool
+     *            Array of constants
+     */
+    public RuntimeVisibleAnnotations(int name_index, int length,
+            DataInputStream file, ConstantPool constant_pool)
+            throws IOException
+    {
+        super(Constants.ATTR_RUNTIME_VISIBLE_ANNOTATIONS, name_index, length,
+                file, constant_pool, true);
+    }
 
-	/**
-	 * @return deep copy of this attribute
-	 */
-	public Attribute copy(ConstantPool constant_pool)
-	{
-		Annotations c = (Annotations) clone();
-		return c;
-	}
+    /**
+     * @return deep copy of this attribute
+     */
+    public Attribute copy(ConstantPool constant_pool)
+    {
+        Annotations c = (Annotations) clone();
+        return c;
+    }
 
-	public final void dump(DataOutputStream dos) throws IOException
-	{
-		super.dump(dos);
-		writeAnnotations(dos);
-	}
+    public final void dump(DataOutputStream dos) throws IOException
+    {
+        super.dump(dos);
+        writeAnnotations(dos);
+    }
 }



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


Mime
View raw message