Author: markt
Date: Wed Jan 20 14:35:09 2016
New Revision: 1725727
URL: http://svn.apache.org/viewvc?rev=1725727&view=rev
Log:
Update Tomcat's internal fork of BCEL to BCEL/trunk
Added:
tomcat/trunk/java/org/apache/tomcat/util/bcel/Const.java
- copied, changed from r1725726,
tomcat/trunk/java/org/apache/tomcat/util/bcel/Constants.java
Removed:
tomcat/trunk/java/org/apache/tomcat/util/bcel/Constants.java
Modified:
tomcat/trunk/SVN-MERGE.txt
tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/ (props changed)
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/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/Constant.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantClass.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantDouble.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantFloat.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantInteger.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantLong.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantUtf8.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/EnumElementValue.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/SimpleElementValue.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java
Modified: tomcat/trunk/SVN-MERGE.txt
URL:
http://svn.apache.org/viewvc/tomcat/trunk/SVN-MERGE.txt?rev=1725727&r1=1725726&r2=1725727&view=diff
==============================================================================
--- tomcat/trunk/SVN-MERGE.txt (original)
+++ tomcat/trunk/SVN-MERGE.txt Wed Jan 20 14:35:09 2016
@@ -29,7 +29,7 @@ to assist committers in keeping them up
BCEL
org.apache.tomcat.util.bcel is copied from:
-/commons/proper/bcel/trunk/src/main/java/org/apache/bcel
+/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6
DBCP
org.apache.tomcat.dbcp.dbcp2 is copied from:
Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1725727&r1=1725726&r2=1725727&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Wed Jan 20
14:35:09 2016
@@ -2081,7 +2081,7 @@ public class ContextConfig implements Li
}
if ((javaClass.getAccessFlags() &
- org.apache.tomcat.util.bcel.Constants.ACC_ANNOTATION) > 0) {
+ org.apache.tomcat.util.bcel.Const.ACC_ANNOTATION) > 0) {
// Skip annotations.
return;
}
Propchange: tomcat/trunk/java/org/apache/tomcat/util/bcel/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 20 14:35:09 2016
@@ -1,2 +1,3 @@
/commons/proper/bcel/trunk/src/main/java/org/apache/bcel:1149512-1694910
+/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6:1694911-1725718
/jakarta/bcel/trunk/src/main/java/org/apache/bcel:886845-1149511
Copied: tomcat/trunk/java/org/apache/tomcat/util/bcel/Const.java (from
r1725726, tomcat/trunk/java/org/apache/tomcat/util/bcel/Constants.java)
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/Const.java?p2=tomcat/trunk/java/org/apache/tomcat/util/bcel/Const.java&p1=tomcat/trunk/java/org/apache/tomcat/util/bcel/Constants.java&r1=1725726&r2=1725727&rev=1725727&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/Constants.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/Const.java Wed Jan 20
14:35:09 2016
@@ -1,12 +1,12 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,79 +19,114 @@ package org.apache.tomcat.util.bcel;
/**
* Constants for the project, mostly defined in the JVM specification.
- *
- * @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
-public interface Constants {
-
- /**
- * One of the access flags for fields, methods, or classes.
- * @see "<a
href='http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.5'>Flag
definitions for Fields in the Java Virtual Machine Specification (Java SE 8
Edition).</a>"
- * @see "<a
href='http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6'>Flag
definitions for Methods in the Java Virtual Machine Specification (Java SE 8
Edition).</a>"
- * @see "<a
href='http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.6-300-D.1-D.1'>Flag
definitions for Classes in the Java Virtual Machine Specification (Java SE 8
Edition).</a>"
- */
- public static final short ACC_FINAL = 0x0010;
-
- /** One of the access flags for fields, methods, or classes.
- */
- public static final short ACC_INTERFACE = 0x0200;
-
- /** One of the access flags for fields, methods, or classes.
- */
- public static final short ACC_ABSTRACT = 0x0400;
-
- /** One of the access flags for fields, methods, or classes.
- */
- public static final short ACC_ANNOTATION = 0x2000;
-
- /** Marks a constant pool entry as type UTF-8. */
- public static final byte CONSTANT_Utf8 = 1;
-
- /** Marks a constant pool entry as type Integer. */
- public static final byte CONSTANT_Integer = 3;
-
- /** Marks a constant pool entry as type Float. */
- public static final byte CONSTANT_Float = 4;
-
- /** Marks a constant pool entry as type Long. */
- public static final byte CONSTANT_Long = 5;
-
- /** Marks a constant pool entry as type Double. */
- public static final byte CONSTANT_Double = 6;
+public final class Const {
- /** Marks a constant pool entry as a Class. */
- public static final byte CONSTANT_Class = 7;
-
- /** Marks a constant pool entry as a Field Reference. */
- public static final byte CONSTANT_Fieldref = 9;
-
- /** Marks a constant pool entry as type String. */
- public static final byte CONSTANT_String = 8;
-
- /** Marks a constant pool entry as a Method Reference. */
- public static final byte CONSTANT_Methodref = 10;
-
- /** Marks a constant pool entry as an Interface Method Reference. */
- public static final byte CONSTANT_InterfaceMethodref = 11;
-
- /** Marks a constant pool entry as a name and type. */
- public static final byte CONSTANT_NameAndType = 12;
-
- /** Marks a constant pool entry as a Method Handle. */
- public static final byte CONSTANT_MethodHandle = 15;
-
- /** Marks a constant pool entry as a Method Type. */
- public static final byte CONSTANT_MethodType = 16;
-
- /** Marks a constant pool entry as an Invoke Dynamic */
- public static final byte CONSTANT_InvokeDynamic = 18;
-
- /** The names of the types of entries in a constant pool. */
- public static final String[] CONSTANT_NAMES = {
+ /** One of the access flags for fields, methods, or classes.
+ * @see <a
href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.5">
+ * Flag definitions for Fields in the Java Virtual Machine Specification
(Java SE 8 Edition).</a>
+ * @see <a
href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6">
+ * Flag definitions for Methods in the Java Virtual Machine Specification
(Java SE 8 Edition).</a>
+ * @see <a
href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.6-300-D.1-D.1">
+ * Flag definitions for Classes in the Java Virtual Machine Specification
(Java SE 8 Edition).</a>
+ */
+ public static final short ACC_FINAL = 0x0010;
+
+ /** One of the access flags for fields, methods, or classes.
+ */
+ public static final short ACC_INTERFACE = 0x0200;
+
+ /** One of the access flags for fields, methods, or classes.
+ */
+ public static final short ACC_ABSTRACT = 0x0400;
+
+ /** One of the access flags for fields, methods, or classes.
+ */
+ public static final short ACC_ANNOTATION = 0x2000;
+
+ /** Marks a constant pool entry as type UTF-8.
+ * @see <a
href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.7">
+ * The Constant Pool in The Java Virtual Machine Specification</a> */
+ public static final byte CONSTANT_Utf8 = 1;
+
+ /** Marks a constant pool entry as type Integer.
+ * @see <a
href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.4">
+ * The Constant Pool in The Java Virtual Machine Specification</a> */
+ public static final byte CONSTANT_Integer = 3;
+
+ /** Marks a constant pool entry as type Float.
+ * @see <a
href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.4">
+ * The Constant Pool in The Java Virtual Machine Specification</a> */
+ public static final byte CONSTANT_Float = 4;
+
+ /** Marks a constant pool entry as type Long.
+ * @see <a
href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.5">
+ * The Constant Pool in The Java Virtual Machine Specification</a> */
+ public static final byte CONSTANT_Long = 5;
+
+ /** Marks a constant pool entry as type Double.
+ * @see <a
href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.5">
+ * The Constant Pool in The Java Virtual Machine Specification</a> */
+ public static final byte CONSTANT_Double = 6;
+
+ /** Marks a constant pool entry as a Class
+ * @see <a
href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.1">
+ * The Constant Pool in The Java Virtual Machine Specification</a> */
+ public static final byte CONSTANT_Class = 7;
+
+ /** Marks a constant pool entry as a Field Reference.
+ * @see <a
href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.2">
+ * The Constant Pool in The Java Virtual Machine Specification</a> */
+ public static final byte CONSTANT_Fieldref = 9;
+
+ /** Marks a constant pool entry as type String
+ * @see <a
href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.3">
+ * The Constant Pool in The Java Virtual Machine Specification</a> */
+ public static final byte CONSTANT_String = 8;
+
+ /** Marks a constant pool entry as a Method Reference.
+ * @see <a
href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.2">
+ * The Constant Pool in The Java Virtual Machine Specification</a> */
+ public static final byte CONSTANT_Methodref = 10;
+
+ /** Marks a constant pool entry as an Interface Method Reference.
+ * @see <a
href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.2">
+ * The Constant Pool in The Java Virtual Machine Specification</a> */
+ public static final byte CONSTANT_InterfaceMethodref = 11;
+
+ /** Marks a constant pool entry as a name and type.
+ * @see <a
href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.6">
+ * The Constant Pool in The Java Virtual Machine Specification</a> */
+ public static final byte CONSTANT_NameAndType = 12;
+
+ /** Marks a constant pool entry as a Method Handle.
+ * @see <a
href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.8">
+ * The Constant Pool in The Java Virtual Machine Specification</a> */
+ public static final byte CONSTANT_MethodHandle = 15;
+
+ /** Marks a constant pool entry as a Method Type.
+ * @see <a
href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.9">
+ * The Constant Pool in The Java Virtual Machine Specification</a> */
+ public static final byte CONSTANT_MethodType = 16;
+
+ /** Marks a constant pool entry as an Invoke Dynamic
+ * @see <a
href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.10">
+ * The Constant Pool in The Java Virtual Machine Specification</a> */
+ public static final byte CONSTANT_InvokeDynamic = 18;
+
+ /**
+ * The names of the types of entries in a constant pool.
+ * Use getConstantName instead
+ */
+ private static final String[] CONSTANT_NAMES = {
"", "CONSTANT_Utf8", "", "CONSTANT_Integer",
"CONSTANT_Float", "CONSTANT_Long", "CONSTANT_Double",
"CONSTANT_Class", "CONSTANT_String", "CONSTANT_Fieldref",
"CONSTANT_Methodref", "CONSTANT_InterfaceMethodref",
"CONSTANT_NameAndType", "", "", "CONSTANT_MethodHandle",
"CONSTANT_MethodType", "", "CONSTANT_InvokeDynamic" };
+
+ public static String getConstantName(int index) {
+ return CONSTANT_NAMES[index];
+ }
}
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=1725727&r1=1725726&r2=1725727&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
Wed Jan 20 14:35:09 2016
@@ -22,22 +22,19 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-import org.apache.tomcat.util.bcel.Constants;
+import org.apache.tomcat.util.bcel.Const;
/**
* represents one annotation in the annotation table
- *
- * @author <A HREF="mailto:[email protected]">D. Brosius</A>
- * @since 6.0
*/
-public class AnnotationEntry implements Constants {
+public class AnnotationEntry {
private final int type_index;
private final ConstantPool constant_pool;
private final List<ElementValuePair> element_value_pairs;
- /**
+ /*
* Creates an AnnotationEntry from a DataInputStream
*
* @param input
@@ -61,7 +58,7 @@ public class AnnotationEntry implements
* @return the annotation type name
*/
public String getAnnotationType() {
- final ConstantUtf8 c = (ConstantUtf8)
constant_pool.getConstant(type_index, CONSTANT_Utf8);
+ final ConstantUtf8 c = (ConstantUtf8)
constant_pool.getConstant(type_index, Const.CONSTANT_Utf8);
return c.getBytes();
}
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=1725727&r1=1725726&r2=1725727&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
Wed Jan 20 14:35:09 2016
@@ -22,9 +22,6 @@ import java.io.IOException;
/**
* base class for annotations
- *
- * @author <A HREF="mailto:[email protected]">D. Brosius</A>
- * @since 6.0
*/
public class Annotations {
@@ -35,7 +32,7 @@ public class Annotations {
* @param constant_pool Array of constants
*/
Annotations(DataInput input, ConstantPool constant_pool) throws
IOException {
- final int annotation_table_length = (input.readUnsignedShort());
+ final int annotation_table_length = input.readUnsignedShort();
annotation_table = new AnnotationEntry[annotation_table_length];
for (int i = 0; i < annotation_table_length; i++) {
annotation_table[i] = new AnnotationEntry(input, constant_pool);
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=1725727&r1=1725726&r2=1725727&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
Wed Jan 20 14:35:09 2016
@@ -17,7 +17,7 @@
*/
package org.apache.tomcat.util.bcel.classfile;
-import org.apache.tomcat.util.bcel.Constants;
+import org.apache.tomcat.util.bcel.Const;
public class ClassElementValue extends ElementValue
{
@@ -35,8 +35,8 @@ public class ClassElementValue extends E
@Override
public String stringifyValue()
{
- ConstantUtf8 cu8 = (ConstantUtf8) cpool.getConstant(idx,
- Constants.CONSTANT_Utf8);
+ ConstantUtf8 cu8 = (ConstantUtf8)
super.getConstantPool().getConstant(idx,
+ Const.CONSTANT_Utf8);
return cu8.getBytes();
}
}
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=1725727&r1=1725726&r2=1725727&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
Wed Jan 20 14:35:09 2016
@@ -21,8 +21,6 @@ package org.apache.tomcat.util.bcel.clas
* Thrown when the BCEL attempts to read a class file and determines
* that the file is malformed or otherwise cannot be interpreted as a
* class file.
- *
- * @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class ClassFormatException extends RuntimeException {
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=1725727&r1=1725726&r2=1725727&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
Wed Jan 20 14:35:09 2016
@@ -23,7 +23,7 @@ import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
-import org.apache.tomcat.util.bcel.Constants;
+import org.apache.tomcat.util.bcel.Const;
/**
* Wrapper class that parses a given Java .class file. The method <A
@@ -36,8 +36,6 @@ import org.apache.tomcat.util.bcel.Const
* exactly with the <A href="http://docs.oracle.com/javase/specs/">
* JVM specification 1.0</a>. See this paper for
* further details about the structure of a bytecode file.
- *
- * @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public final class ClassParser {
@@ -117,7 +115,7 @@ public final class ClassParser {
// Get class name from constant pool via `name_index' indirection
name_index = dataInputStream.readUnsignedShort();
c = (ConstantUtf8) constant_pool.getConstant(name_index,
- Constants.CONSTANT_Utf8);
+ Const.CONSTANT_Utf8);
name = c.getBytes();
// Length of data in bytes
length = dataInputStream.readInt();
@@ -146,11 +144,11 @@ public final class ClassParser {
/* Interfaces are implicitely abstract, the flag should be set
* according to the JVM specification.
*/
- if ((access_flags & Constants.ACC_INTERFACE) != 0) {
- access_flags |= Constants.ACC_ABSTRACT;
+ if ((access_flags & Const.ACC_INTERFACE) != 0) {
+ access_flags |= Const.ACC_ABSTRACT;
}
- if (((access_flags & Constants.ACC_ABSTRACT) != 0)
- && ((access_flags & Constants.ACC_FINAL) != 0)) {
+ if (((access_flags & Const.ACC_ABSTRACT) != 0)
+ && ((access_flags & Const.ACC_FINAL) != 0)) {
throw new ClassFormatException("Class can't be both final and
abstract");
}
Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Constant.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Constant.java?rev=1725727&r1=1725726&r2=1725727&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Constant.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Constant.java Wed
Jan 20 14:35:09 2016
@@ -20,7 +20,7 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInput;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
+import org.apache.tomcat.util.bcel.Const;
/**
* Abstract superclass for classes to represent the different constant types
@@ -67,30 +67,30 @@ public abstract class Constant {
byte b = input.readByte(); // Read tag byte
int skipSize;
switch (b) {
- case Constants.CONSTANT_Class:
+ case Const.CONSTANT_Class:
return new ConstantClass(input);
- case Constants.CONSTANT_Integer:
+ case Const.CONSTANT_Integer:
return new ConstantInteger(input);
- case Constants.CONSTANT_Float:
+ case Const.CONSTANT_Float:
return new ConstantFloat(input);
- case Constants.CONSTANT_Long:
+ case Const.CONSTANT_Long:
return new ConstantLong(input);
- case Constants.CONSTANT_Double:
+ case Const.CONSTANT_Double:
return new ConstantDouble(input);
- case Constants.CONSTANT_Utf8:
+ case Const.CONSTANT_Utf8:
return ConstantUtf8.getInstance(input);
- case Constants.CONSTANT_String:
- case Constants.CONSTANT_MethodType:
+ case Const.CONSTANT_String:
+ case Const.CONSTANT_MethodType:
skipSize = 2; // unsigned short
break;
- case Constants.CONSTANT_MethodHandle:
+ case Const.CONSTANT_MethodHandle:
skipSize = 3; // unsigned byte, unsigned short
break;
- case Constants.CONSTANT_Fieldref:
- case Constants.CONSTANT_Methodref:
- case Constants.CONSTANT_InterfaceMethodref:
- case Constants.CONSTANT_NameAndType:
- case Constants.CONSTANT_InvokeDynamic:
+ case Const.CONSTANT_Fieldref:
+ case Const.CONSTANT_Methodref:
+ case Const.CONSTANT_InterfaceMethodref:
+ case Const.CONSTANT_NameAndType:
+ case Const.CONSTANT_InvokeDynamic:
skipSize = 4; // unsigned short, unsigned short
break;
default:
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantClass.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantClass.java?rev=1725727&r1=1725726&r2=1725727&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantClass.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantClass.java
Wed Jan 20 14:35:09 2016
@@ -20,14 +20,12 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInput;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
+import org.apache.tomcat.util.bcel.Const;
/**
- * This class is derived from the abstract
- * <A HREF="org.apache.tomcat.util.bcel.classfile.Constant.html">Constant</A>
class
+ * This class is derived from the abstract {@link Constant}
* and represents a reference to a (external) class.
*
- * @author <A HREF="mailto:[email protected]">M. Dahm</A>
* @see Constant
*/
public final class ConstantClass extends Constant {
@@ -42,7 +40,7 @@ public final class ConstantClass extends
* @throws IOException
*/
ConstantClass(DataInput file) throws IOException {
- super(Constants.CONSTANT_Class);
+ super(Const.CONSTANT_Class);
this.name_index = file.readUnsignedShort();
}
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantDouble.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantDouble.java?rev=1725727&r1=1725726&r2=1725727&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantDouble.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantDouble.java
Wed Jan 20 14:35:09 2016
@@ -20,14 +20,12 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInput;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
+import org.apache.tomcat.util.bcel.Const;
/**
- * This class is derived from the abstract
- * <A HREF="org.apache.tomcat.util.bcel.classfile.Constant.html">Constant</A>
class
+ * This class is derived from the abstract {@link Constant}
* and represents a reference to a Double object.
*
- * @author <A HREF="mailto:[email protected]">M. Dahm</A>
* @see Constant
*/
public final class ConstantDouble extends Constant {
@@ -42,7 +40,7 @@ public final class ConstantDouble extend
* @throws IOException
*/
ConstantDouble(DataInput file) throws IOException {
- super(Constants.CONSTANT_Double);
+ super(Const.CONSTANT_Double);
this.bytes = file.readDouble();
}
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantFloat.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantFloat.java?rev=1725727&r1=1725726&r2=1725727&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantFloat.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantFloat.java
Wed Jan 20 14:35:09 2016
@@ -20,14 +20,12 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInput;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
+import org.apache.tomcat.util.bcel.Const;
/**
- * This class is derived from the abstract
- * <A HREF="org.apache.tomcat.util.bcel.classfile.Constant.html">Constant</A>
class
+ * This class is derived from the abstract {@link Constant}
* and represents a reference to a float object.
*
- * @author <A HREF="mailto:[email protected]">M. Dahm</A>
* @see Constant
*/
public final class ConstantFloat extends Constant {
@@ -42,7 +40,7 @@ public final class ConstantFloat extends
* @throws IOException
*/
ConstantFloat(DataInput file) throws IOException {
- super(Constants.CONSTANT_Float);
+ super(Const.CONSTANT_Float);
this.bytes = file.readFloat();
}
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantInteger.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantInteger.java?rev=1725727&r1=1725726&r2=1725727&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantInteger.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantInteger.java
Wed Jan 20 14:35:09 2016
@@ -20,14 +20,12 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInput;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
+import org.apache.tomcat.util.bcel.Const;
/**
- * This class is derived from the abstract
- * <A HREF="org.apache.tomcat.util.bcel.classfile.Constant.html">Constant</A>
class
+ * This class is derived from the abstract {@link Constant}
* and represents a reference to an int object.
*
- * @author <A HREF="mailto:[email protected]">M. Dahm</A>
* @see Constant
*/
public final class ConstantInteger extends Constant {
@@ -42,7 +40,7 @@ public final class ConstantInteger exten
* @throws IOException
*/
ConstantInteger(DataInput file) throws IOException {
- super(Constants.CONSTANT_Integer);
+ super(Const.CONSTANT_Integer);
this.bytes = file.readInt();
}
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantLong.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantLong.java?rev=1725727&r1=1725726&r2=1725727&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantLong.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantLong.java
Wed Jan 20 14:35:09 2016
@@ -20,14 +20,12 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInput;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
+import org.apache.tomcat.util.bcel.Const;
/**
- * This class is derived from the abstract
- * <A HREF="org.apache.tomcat.util.bcel.classfile.Constant.html">Constant</A>
class
+ * This class is derived from the abstract {@link Constant}
* and represents a reference to a long object.
*
- * @author <A HREF="mailto:[email protected]">M. Dahm</A>
* @see Constant
*/
public final class ConstantLong extends Constant {
@@ -42,7 +40,7 @@ public final class ConstantLong extends
* @throws IOException
*/
ConstantLong(DataInput input) throws IOException {
- super(Constants.CONSTANT_Long);
+ super(Const.CONSTANT_Long);
this.bytes = input.readLong();
}
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java?rev=1725727&r1=1725726&r2=1725727&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
Wed Jan 20 14:35:09 2016
@@ -20,7 +20,7 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInput;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
+import org.apache.tomcat.util.bcel.Const;
/**
* This class represents the constant pool, i.e., a table of constants, of
@@ -31,7 +31,6 @@ import org.apache.tomcat.util.bcel.Const
* ConstantPoolGen</a>.
* @see Constant
- * @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class ConstantPool {
@@ -62,7 +61,7 @@ public class ConstantPool {
*/
if (constant_pool[i] != null) {
byte tag = constant_pool[i].getTag();
- if ((tag == Constants.CONSTANT_Double) || (tag ==
Constants.CONSTANT_Long)) {
+ if ((tag == Const.CONSTANT_Double) || (tag ==
Const.CONSTANT_Long)) {
i++;
}
}
@@ -103,7 +102,7 @@ public class ConstantPool {
throw new ClassFormatException("Constant pool at index " + index +
" is null.");
}
if (c.getTag() != tag) {
- throw new ClassFormatException("Expected class `" +
Constants.CONSTANT_NAMES[tag]
+ throw new ClassFormatException("Expected class `" +
Const.getConstantName(tag)
+ "' at index " + index + " and got " + c);
}
return c;
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantUtf8.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantUtf8.java?rev=1725727&r1=1725726&r2=1725727&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantUtf8.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantUtf8.java
Wed Jan 20 14:35:09 2016
@@ -19,14 +19,13 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInput;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
+import org.apache.tomcat.util.bcel.Const;
/**
* This class is derived from the abstract
* <A HREF="org.apache.tomcat.util.bcel.classfile.Constant.html">Constant</A>
class
* and represents a reference to a Utf8 encoded string.
*
- * @author <A HREF="mailto:[email protected]">M. Dahm</A>
* @see Constant
*/
public final class ConstantUtf8 extends Constant {
@@ -43,7 +42,7 @@ public final class ConstantUtf8 extends
* @param bytes Data
*/
private ConstantUtf8(String bytes) {
- super(Constants.CONSTANT_Utf8);
+ super(Const.CONSTANT_Utf8);
if (bytes == null) {
throw new IllegalArgumentException("bytes must not be null!");
}
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=1725727&r1=1725726&r2=1725727&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
Wed Jan 20 14:35:09 2016
@@ -19,15 +19,11 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInput;
import java.io.IOException;
-/**
- * @author <A HREF="mailto:[email protected]">D. Brosius</A>
- * @since 6.0
- */
public abstract class ElementValue
{
- protected final int type;
+ private final int type;
- protected final ConstantPool cpool;
+ private final ConstantPool cpool;
ElementValue(int type, ConstantPool cpool) {
@@ -92,4 +88,12 @@ public abstract class ElementValue
"Unexpected element value kind in annotation: " +
type);
}
}
+
+ final ConstantPool getConstantPool() {
+ return cpool;
+ }
+
+ final int getType() {
+ return 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=1725727&r1=1725726&r2=1725727&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
Wed Jan 20 14:35:09 2016
@@ -20,12 +20,11 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInput;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
+import org.apache.tomcat.util.bcel.Const;
/**
* an annotation's element value pair
*
- * @author <A HREF="mailto:[email protected]">D. Brosius</A>
* @since 6.0
*/
public class ElementValuePair
@@ -45,7 +44,7 @@ public class ElementValuePair
public String getNameString()
{
ConstantUtf8 c = (ConstantUtf8) constantPool.getConstant(
- elementNameIndex, Constants.CONSTANT_Utf8);
+ elementNameIndex, Const.CONSTANT_Utf8);
return c.getBytes();
}
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=1725727&r1=1725726&r2=1725727&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
Wed Jan 20 14:35:09 2016
@@ -17,7 +17,7 @@
*/
package org.apache.tomcat.util.bcel.classfile;
-import org.apache.tomcat.util.bcel.Constants;
+import org.apache.tomcat.util.bcel.Const;
public class EnumElementValue extends ElementValue
{
@@ -34,8 +34,8 @@ public class EnumElementValue extends El
@Override
public String stringifyValue()
{
- ConstantUtf8 cu8 = (ConstantUtf8) cpool.getConstant(valueIdx,
- Constants.CONSTANT_Utf8);
+ ConstantUtf8 cu8 = (ConstantUtf8)
super.getConstantPool().getConstant(valueIdx,
+ Const.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=1725727&r1=1725726&r2=1725727&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 Wed
Jan 20 14:35:09 2016
@@ -24,8 +24,6 @@ package org.apache.tomcat.util.bcel.clas
* The intent of this class is to represent a parsed or otherwise existing
* class file. Those interested in programatically generating classes
* should see the <a href="../generic/ClassGen.html">ClassGen</a> class.
-
- * @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class JavaClass {
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/SimpleElementValue.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/SimpleElementValue.java?rev=1725727&r1=1725726&r2=1725727&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/SimpleElementValue.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/SimpleElementValue.java
Wed Jan 20 14:35:09 2016
@@ -17,7 +17,7 @@
*/
package org.apache.tomcat.util.bcel.classfile;
-import org.apache.tomcat.util.bcel.Constants;
+import org.apache.tomcat.util.bcel.Const;
public class SimpleElementValue extends ElementValue
{
@@ -41,51 +41,51 @@ public class SimpleElementValue extends
@Override
public String stringifyValue()
{
- switch (type)
+ ConstantPool cpool = super.getConstantPool();
+ final int _type = super.getType();
+ switch (_type)
{
case PRIMITIVE_INT:
ConstantInteger c = (ConstantInteger) cpool.getConstant(getIndex(),
- Constants.CONSTANT_Integer);
+ Const.CONSTANT_Integer);
return Integer.toString(c.getBytes());
case PRIMITIVE_LONG:
ConstantLong j = (ConstantLong) cpool.getConstant(getIndex(),
- Constants.CONSTANT_Long);
+ Const.CONSTANT_Long);
return Long.toString(j.getBytes());
case PRIMITIVE_DOUBLE:
ConstantDouble d = (ConstantDouble) cpool.getConstant(getIndex(),
- Constants.CONSTANT_Double);
+ Const.CONSTANT_Double);
return Double.toString(d.getBytes());
case PRIMITIVE_FLOAT:
ConstantFloat f = (ConstantFloat) cpool.getConstant(getIndex(),
- Constants.CONSTANT_Float);
+ Const.CONSTANT_Float);
return Float.toString(f.getBytes());
case PRIMITIVE_SHORT:
ConstantInteger s = (ConstantInteger) cpool.getConstant(getIndex(),
- Constants.CONSTANT_Integer);
+ Const.CONSTANT_Integer);
return Integer.toString(s.getBytes());
case PRIMITIVE_BYTE:
ConstantInteger b = (ConstantInteger) cpool.getConstant(getIndex(),
- Constants.CONSTANT_Integer);
+ Const.CONSTANT_Integer);
return Integer.toString(b.getBytes());
case PRIMITIVE_CHAR:
ConstantInteger ch = (ConstantInteger) cpool.getConstant(
- getIndex(), Constants.CONSTANT_Integer);
+ getIndex(), Const.CONSTANT_Integer);
return String.valueOf((char)ch.getBytes());
case PRIMITIVE_BOOLEAN:
ConstantInteger bo = (ConstantInteger) cpool.getConstant(
- getIndex(), Constants.CONSTANT_Integer);
+ getIndex(), Const.CONSTANT_Integer);
if (bo.getBytes() == 0) {
return "false";
}
return "true";
case STRING:
ConstantUtf8 cu8 = (ConstantUtf8) cpool.getConstant(getIndex(),
- Constants.CONSTANT_Utf8);
+ Const.CONSTANT_Utf8);
return cu8.getBytes();
default:
- throw new RuntimeException(
- "SimpleElementValue class does not know how to stringify
type "
- + type);
+ throw new RuntimeException("SimpleElementValue class does not know
how to stringify type " + _type);
}
}
}
Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java?rev=1725727&r1=1725726&r2=1725727&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java Wed
Jan 20 14:35:09 2016
@@ -20,12 +20,10 @@ import java.io.DataInput;
import java.io.EOFException;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
+import org.apache.tomcat.util.bcel.Const;
/**
* Utility functions that do not really belong to any class in particular.
- *
- * @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
final class Utility {
@@ -47,11 +45,11 @@ final class Utility {
}
static String getClassName(ConstantPool constant_pool, int index) {
- Constant c = constant_pool.getConstant(index,
Constants.CONSTANT_Class);
+ Constant c = constant_pool.getConstant(index, Const.CONSTANT_Class);
int i = ((ConstantClass) c).getNameIndex();
// Finally get the string from the constant pool
- c = constant_pool.getConstant(i, Constants.CONSTANT_Utf8);
+ c = constant_pool.getConstant(i, Const.CONSTANT_Utf8);
String name = ((ConstantUtf8) c).getBytes();
return compactClassName(name);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]