diff options
Diffstat (limited to 'framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool')
17 files changed, 0 insertions, 1909 deletions
diff --git a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/ClassCPInfo.java b/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/ClassCPInfo.java deleted file mode 100644 index 8abbfc82..00000000 --- a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/ClassCPInfo.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tools.ant.taskdefs.optional.depend.constantpool; - -import java.io.DataInputStream; -import java.io.IOException; - -/** - * The constant pool entry which stores class information. - * - */ -public class ClassCPInfo extends ConstantPoolEntry { - - /** - * The class' name. This will be only valid if the entry has been - * resolved against the constant pool. - */ - private String className; - - /** - * The index into the constant pool where this class' name is stored. If - * the class name is changed, this entry is invalid until this entry is - * connected to a constant pool. - */ - private int index; - - /** - * Constructor. Sets the tag value for this entry to type Class - */ - public ClassCPInfo() { - super(CONSTANT_CLASS, 1); - } - - /** - * Read the entry from a stream. - * - * @param cpStream the stream containing the constant pool entry to be - * read. - * @exception IOException thrown if there is a problem reading the entry - * from the stream. - */ - public void read(DataInputStream cpStream) throws IOException { - index = cpStream.readUnsignedShort(); - className = "unresolved"; - } - - /** - * Generate a string readable version of this entry - * - * @return string representation of this constant pool entry - */ - public String toString() { - return "Class Constant Pool Entry for " + className + "[" + index + "]"; - } - - /** - * Resolve this class info against the given constant pool. - * - * @param constantPool the constant pool with which to resolve the - * class. - */ - public void resolve(ConstantPool constantPool) { - className = ((Utf8CPInfo) constantPool.getEntry(index)).getValue(); - - super.resolve(constantPool); - } - - /** - * Get the class name of this entry. - * - * @return the class' name. - */ - public String getClassName() { - return className; - } - -} - diff --git a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/ConstantCPInfo.java b/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/ConstantCPInfo.java deleted file mode 100644 index 6103422e..00000000 --- a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/ConstantCPInfo.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tools.ant.taskdefs.optional.depend.constantpool; - -/** - * A Constant Pool entry which represents a constant value. - * - */ -public abstract class ConstantCPInfo extends ConstantPoolEntry { - - /** - * The entry's untyped value. Each subclass interprets the constant - * value based on the subclass's type. The value here must be - * compatible. - */ - private Object value; - - /** - * Initialise the constant entry. - * - * @param tagValue the constant pool entry type to be used. - * @param entries the number of constant pool entry slots occupied by - * this entry. - */ - protected ConstantCPInfo(int tagValue, int entries) { - super(tagValue, entries); - } - - /** - * Get the value of the constant. - * - * @return the value of the constant (untyped). - */ - public Object getValue() { - return value; - } - - /** - * Set the constant value. - * - * @param newValue the new untyped value of this constant. - */ - public void setValue(Object newValue) { - value = newValue; - } - -} - diff --git a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/ConstantPool.java b/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/ConstantPool.java deleted file mode 100644 index 67d366b8..00000000 --- a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/ConstantPool.java +++ /dev/null @@ -1,358 +0,0 @@ -/* - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tools.ant.taskdefs.optional.depend.constantpool; - -import java.io.DataInputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * The constant pool of a Java class. The constant pool is a collection of - * constants used in a Java class file. It stores strings, constant values, - * class names, method names, field names etc. - * - * @see <a href="http://java.sun.com/docs/books/vmspec/">The Java Virtual - * Machine Specification</a> - */ -public class ConstantPool { - - /** The entries in the constant pool. */ - private final List<ConstantPoolEntry> entries = new ArrayList<ConstantPoolEntry>(); - - /** - * A Hashtable of UTF8 entries - used to get constant pool indexes of - * the UTF8 values quickly - */ - private final Map<String, Integer> utf8Indexes = new HashMap<String, Integer>(); - - /** Initialise the constant pool. */ - public ConstantPool() { - // The zero index is never present in the constant pool itself so - // we add a null entry for it - entries.add(null); - } - - /** - * Read the constant pool from a class input stream. - * - * @param classStream the DataInputStream of a class file. - * @exception IOException if there is a problem reading the constant pool - * from the stream - */ - public void read(DataInputStream classStream) throws IOException { - int numEntries = classStream.readUnsignedShort(); - - for (int i = 1; i < numEntries;) { - ConstantPoolEntry nextEntry - = ConstantPoolEntry.readEntry(classStream); - - i += nextEntry.getNumEntries(); - - addEntry(nextEntry); - } - } - - /** - * Get the size of the constant pool. - * - * @return the size of the constant pool - */ - public int size() { - return entries.size(); - } - - /** - * Add an entry to the constant pool. - * - * @param entry the new entry to be added to the constant pool. - * @return the index into the constant pool at which the entry is - * stored. - */ - public int addEntry(ConstantPoolEntry entry) { - int index = entries.size(); - - entries.add(entry); - - int numSlots = entry.getNumEntries(); - - // add null entries for any additional slots required. - for (int j = 0; j < numSlots - 1; ++j) { - entries.add(null); - } - - if (entry instanceof Utf8CPInfo) { - Utf8CPInfo utf8Info = (Utf8CPInfo) entry; - - utf8Indexes.put(utf8Info.getValue(), new Integer(index)); - } - - return index; - } - - /** - * Resolve the entries in the constant pool. Resolution of the constant - * pool involves transforming indexes to other constant pool entries - * into the actual data for that entry. - */ - public void resolve() { - for (ConstantPoolEntry poolInfo : entries) { - if (poolInfo != null && !poolInfo.isResolved()) { - poolInfo.resolve(this); - } - } - } - - - /** - * Get an constant pool entry at a particular index. - * - * @param index the index into the constant pool. - * @return the constant pool entry at that index. - */ - public ConstantPoolEntry getEntry(int index) { - return entries.get(index); - } - - /** - * Get the index of a given UTF8 constant pool entry. - * - * @param value the string value of the UTF8 entry. - * @return the index at which the given string occurs in the constant - * pool or -1 if the value does not occur. - */ - public int getUTF8Entry(String value) { - int index = -1; - Integer indexInteger = utf8Indexes.get(value); - - if (indexInteger != null) { - index = indexInteger.intValue(); - } - - return index; - } - - /** - * Get the index of a given CONSTANT_CLASS entry in the constant pool. - * - * @param className the name of the class for which the class entry - * index is required. - * @return the index at which the given class entry occurs in the - * constant pool or -1 if the value does not occur. - */ - public int getClassEntry(String className) { - int index = -1; - - final int size = entries.size(); - for (int i = 0; i < size && index == -1; ++i) { - Object element = entries.get(i); - - if (element instanceof ClassCPInfo) { - ClassCPInfo classinfo = (ClassCPInfo) element; - - if (classinfo.getClassName().equals(className)) { - index = i; - } - } - } - - return index; - } - - /** - * Get the index of a given constant value entry in the constant pool. - * - * @param constantValue the constant value for which the index is - * required. - * @return the index at which the given value entry occurs in the - * constant pool or -1 if the value does not occur. - */ - public int getConstantEntry(Object constantValue) { - int index = -1; - - final int size = entries.size(); - for (int i = 0; i < size && index == -1; ++i) { - Object element = entries.get(i); - - if (element instanceof ConstantCPInfo) { - ConstantCPInfo constantEntry = (ConstantCPInfo) element; - - if (constantEntry.getValue().equals(constantValue)) { - index = i; - } - } - } - - return index; - } - - /** - * Get the index of a given CONSTANT_METHODREF entry in the constant - * pool. - * - * @param methodClassName the name of the class which contains the - * method being referenced. - * @param methodName the name of the method being referenced. - * @param methodType the type descriptor of the method being referenced. - * @return the index at which the given method ref entry occurs in the - * constant pool or -1 if the value does not occur. - */ - public int getMethodRefEntry(String methodClassName, String methodName, - String methodType) { - int index = -1; - - final int size = entries.size(); - for (int i = 0; i < size && index == -1; ++i) { - Object element = entries.get(i); - - if (element instanceof MethodRefCPInfo) { - MethodRefCPInfo methodRefEntry = (MethodRefCPInfo) element; - - if (methodRefEntry.getMethodClassName().equals(methodClassName) - && methodRefEntry.getMethodName().equals(methodName) - && methodRefEntry.getMethodType().equals(methodType)) { - index = i; - } - } - } - - return index; - } - - /** - * Get the index of a given CONSTANT_INTERFACEMETHODREF entry in the - * constant pool. - * - * @param interfaceMethodClassName the name of the interface which - * contains the method being referenced. - * @param interfaceMethodName the name of the method being referenced. - * @param interfaceMethodType the type descriptor of the method being - * referenced. - * @return the index at which the given method ref entry occurs in the - * constant pool or -1 if the value does not occur. - */ - public int getInterfaceMethodRefEntry(String interfaceMethodClassName, - String interfaceMethodName, - String interfaceMethodType) { - int index = -1; - - final int size = entries.size(); - for (int i = 0; i < size && index == -1; ++i) { - Object element = entries.get(i); - - if (element instanceof InterfaceMethodRefCPInfo) { - InterfaceMethodRefCPInfo interfaceMethodRefEntry - = (InterfaceMethodRefCPInfo) element; - - if (interfaceMethodRefEntry.getInterfaceMethodClassName().equals( - interfaceMethodClassName) - && interfaceMethodRefEntry.getInterfaceMethodName().equals( - interfaceMethodName) - && interfaceMethodRefEntry.getInterfaceMethodType().equals( - interfaceMethodType)) { - index = i; - } - } - } - - return index; - } - - /** - * Get the index of a given CONSTANT_FIELDREF entry in the constant - * pool. - * - * @param fieldClassName the name of the class which contains the field - * being referenced. - * @param fieldName the name of the field being referenced. - * @param fieldType the type descriptor of the field being referenced. - * @return the index at which the given field ref entry occurs in the - * constant pool or -1 if the value does not occur. - */ - public int getFieldRefEntry(String fieldClassName, String fieldName, - String fieldType) { - int index = -1; - - final int size = entries.size(); - for (int i = 0; i < size && index == -1; ++i) { - Object element = entries.get(i); - - if (element instanceof FieldRefCPInfo) { - FieldRefCPInfo fieldRefEntry = (FieldRefCPInfo) element; - - if (fieldRefEntry.getFieldClassName().equals(fieldClassName) - && fieldRefEntry.getFieldName().equals(fieldName) - && fieldRefEntry.getFieldType().equals(fieldType)) { - index = i; - } - } - } - - return index; - } - - /** - * Get the index of a given CONSTANT_NAMEANDTYPE entry in the constant - * pool. - * - * @param name the name - * @param type the type - * @return the index at which the given NameAndType entry occurs in the - * constant pool or -1 if the value does not occur. - */ - public int getNameAndTypeEntry(String name, String type) { - int index = -1; - - final int size = entries.size(); - for (int i = 0; i < size && index == -1; ++i) { - Object element = entries.get(i); - - if (element instanceof NameAndTypeCPInfo) { - NameAndTypeCPInfo nameAndTypeEntry - = (NameAndTypeCPInfo) element; - - if (nameAndTypeEntry.getName().equals(name) - && nameAndTypeEntry.getType().equals(type)) { - index = i; - } - } - } - - return index; - } - - /** - * Dump the constant pool to a string. - * - * @return the constant pool entries as strings - */ - public String toString() { - StringBuilder sb = new StringBuilder("\n"); - final int size = entries.size(); - - for (int i = 0; i < size; ++i) { - sb.append("[" + i + "] = " + getEntry(i) + "\n"); - } - - return sb.toString(); - } - -} - diff --git a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/ConstantPoolEntry.java b/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/ConstantPoolEntry.java deleted file mode 100644 index 26a0d094..00000000 --- a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/ConstantPoolEntry.java +++ /dev/null @@ -1,242 +0,0 @@ -/* - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tools.ant.taskdefs.optional.depend.constantpool; - -import java.io.DataInputStream; -import java.io.IOException; - -/** - * An entry in the constant pool. This class contains a representation of the - * constant pool entries. It is an abstract base class for all the different - * forms of constant pool entry. - * - * @see ConstantPool - */ -public abstract class ConstantPoolEntry { - - /** Tag value for UTF8 entries. */ - public static final int CONSTANT_UTF8 = 1; - - /** Tag value for Integer entries. */ - public static final int CONSTANT_INTEGER = 3; - - /** Tag value for Float entries. */ - public static final int CONSTANT_FLOAT = 4; - - /** Tag value for Long entries. */ - public static final int CONSTANT_LONG = 5; - - /** Tag value for Double entries. */ - public static final int CONSTANT_DOUBLE = 6; - - /** Tag value for Class entries. */ - public static final int CONSTANT_CLASS = 7; - - /** Tag value for String entries. */ - public static final int CONSTANT_STRING = 8; - - /** Tag value for Field Reference entries. */ - public static final int CONSTANT_FIELDREF = 9; - - /** Tag value for Method Reference entries. */ - public static final int CONSTANT_METHODREF = 10; - - /** Tag value for Interface Method Reference entries. */ - public static final int CONSTANT_INTERFACEMETHODREF = 11; - - /** Tag value for Name and Type entries. */ - public static final int CONSTANT_NAMEANDTYPE = 12; - - /** Tag value for Method Handle entries */ - public static final int CONSTANT_METHODHANDLE = 15; - - /** Tag value for Method Type entries */ - public static final int CONSTANT_METHODTYPE = 16; - - /** Tag value for InvokeDynamic entries*/ - public static final int CONSTANT_INVOKEDYNAMIC = 18; - - /** - * This entry's tag which identifies the type of this constant pool - * entry. - */ - private int tag; - - /** - * The number of slots in the constant pool, occupied by this entry. - */ - private int numEntries; - - /** - * A flag which indicates if this entry has been resolved or not. - */ - private boolean resolved; - - /** - * Initialise the constant pool entry. - * - * @param tagValue the tag value which identifies which type of constant - * pool entry this is. - * @param entries the number of constant pool entry slots this entry - * occupies. - */ - public ConstantPoolEntry(int tagValue, int entries) { - tag = tagValue; - numEntries = entries; - resolved = false; - } - - /** - * Read a constant pool entry from a stream. This is a factory method - * which reads a constant pool entry form a stream and returns the - * appropriate subclass for the entry. - * - * @param cpStream the stream from which the constant pool entry is to - * be read. - * @return the appropriate ConstantPoolEntry subclass representing the - * constant pool entry from the stream. - * @exception IOException if the constant pool entry cannot be read - * from the stream - */ - public static ConstantPoolEntry readEntry(DataInputStream cpStream) - throws IOException { - ConstantPoolEntry cpInfo = null; - int cpTag = cpStream.readUnsignedByte(); - - switch (cpTag) { - - case CONSTANT_UTF8: - cpInfo = new Utf8CPInfo(); - - break; - case CONSTANT_INTEGER: - cpInfo = new IntegerCPInfo(); - - break; - case CONSTANT_FLOAT: - cpInfo = new FloatCPInfo(); - - break; - case CONSTANT_LONG: - cpInfo = new LongCPInfo(); - - break; - case CONSTANT_DOUBLE: - cpInfo = new DoubleCPInfo(); - - break; - case CONSTANT_CLASS: - cpInfo = new ClassCPInfo(); - - break; - case CONSTANT_STRING: - cpInfo = new StringCPInfo(); - - break; - case CONSTANT_FIELDREF: - cpInfo = new FieldRefCPInfo(); - - break; - case CONSTANT_METHODREF: - cpInfo = new MethodRefCPInfo(); - - break; - case CONSTANT_INTERFACEMETHODREF: - cpInfo = new InterfaceMethodRefCPInfo(); - - break; - case CONSTANT_NAMEANDTYPE: - cpInfo = new NameAndTypeCPInfo(); - - break; - case CONSTANT_METHODHANDLE: - cpInfo = new MethodHandleCPInfo(); - - break; - case CONSTANT_METHODTYPE: - cpInfo = new MethodTypeCPInfo(); - - break; - case CONSTANT_INVOKEDYNAMIC: - cpInfo = new InvokeDynamicCPInfo(); - - break; - default: - throw new ClassFormatError("Invalid Constant Pool entry Type " - + cpTag); - } - - cpInfo.read(cpStream); - - return cpInfo; - } - - /** - * Indicates whether this entry has been resolved. In general a constant - * pool entry can reference another constant pool entry by its index - * value. Resolution involves replacing this index value with the - * constant pool entry at that index. - * - * @return true if this entry has been resolved. - */ - public boolean isResolved() { - return resolved; - } - - /** - * Resolve this constant pool entry with respect to its dependents in - * the constant pool. - * - * @param constantPool the constant pool of which this entry is a member - * and against which this entry is to be resolved. - */ - public void resolve(ConstantPool constantPool) { - resolved = true; - } - - /** - * read a constant pool entry from a class stream. - * - * @param cpStream the DataInputStream which contains the constant pool - * entry to be read. - * @exception IOException if there is a problem reading the entry from - * the stream. - */ - public abstract void read(DataInputStream cpStream) throws IOException; - - /** - * Get the Entry's type tag. - * - * @return The Tag value of this entry - */ - public int getTag() { - return tag; - } - - /** - * Get the number of Constant Pool Entry slots within the constant pool - * occupied by this entry. - * - * @return the number of slots used. - */ - public final int getNumEntries() { - return numEntries; - } - -} - diff --git a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/DoubleCPInfo.java b/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/DoubleCPInfo.java deleted file mode 100644 index a21c0d66..00000000 --- a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/DoubleCPInfo.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tools.ant.taskdefs.optional.depend.constantpool; - -import java.io.DataInputStream; -import java.io.IOException; - -/** - * The constant pool entry subclass used to represent double constant - * values. - * - */ -public class DoubleCPInfo extends ConstantCPInfo { - /** - * Constructor - */ - public DoubleCPInfo() { - super(CONSTANT_DOUBLE, 2); - } - - /** - * read a constant pool entry from a class stream. - * - * @param cpStream the DataInputStream which contains the constant pool - * entry to be read. - * @exception IOException if there is a problem reading the entry from the - * stream. - */ - public void read(DataInputStream cpStream) throws IOException { - setValue(new Double(cpStream.readDouble())); - } - - /** - * Print a readable version of the constant pool entry. - * - * @return the string representation of this constant pool entry. - */ - public String toString() { - return "Double Constant Pool Entry: " + getValue(); - } - -} - diff --git a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/FieldRefCPInfo.java b/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/FieldRefCPInfo.java deleted file mode 100644 index 06c0925d..00000000 --- a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/FieldRefCPInfo.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tools.ant.taskdefs.optional.depend.constantpool; - -import java.io.DataInputStream; -import java.io.IOException; - -/** - * A FieldRef CP Info - * - */ -public class FieldRefCPInfo extends ConstantPoolEntry { - /** Name of the field's class */ - private String fieldClassName; - /** name of the field in that class */ - private String fieldName; - /** The type of the field */ - private String fieldType; - /** Index into the constant pool for the class */ - private int classIndex; - /** Index into the constant pool for the name and type entry */ - private int nameAndTypeIndex; - - /** Constructor. */ - public FieldRefCPInfo() { - super(CONSTANT_FIELDREF, 1); - } - - /** - * read a constant pool entry from a class stream. - * - * @param cpStream the DataInputStream which contains the constant pool - * entry to be read. - * @exception IOException if there is a problem reading the entry from - * the stream. - */ - public void read(DataInputStream cpStream) throws IOException { - classIndex = cpStream.readUnsignedShort(); - nameAndTypeIndex = cpStream.readUnsignedShort(); - } - - /** - * Resolve this constant pool entry with respect to its dependents in - * the constant pool. - * - * @param constantPool the constant pool of which this entry is a member - * and against which this entry is to be resolved. - */ - public void resolve(ConstantPool constantPool) { - ClassCPInfo fieldClass - = (ClassCPInfo) constantPool.getEntry(classIndex); - - fieldClass.resolve(constantPool); - - fieldClassName = fieldClass.getClassName(); - - NameAndTypeCPInfo nt - = (NameAndTypeCPInfo) constantPool.getEntry(nameAndTypeIndex); - - nt.resolve(constantPool); - - fieldName = nt.getName(); - fieldType = nt.getType(); - - super.resolve(constantPool); - } - - /** - * Print a readable version of the constant pool entry. - * - * @return the string representation of this constant pool entry. - */ - public String toString() { - String value; - - if (isResolved()) { - value = "Field : Class = " + fieldClassName + ", name = " - + fieldName + ", type = " + fieldType; - } else { - value = "Field : Class index = " + classIndex - + ", name and type index = " + nameAndTypeIndex; - } - - return value; - } - - /** - * Gets the name of the class defining the field - * - * @return the name of the class defining the field - */ - public String getFieldClassName() { - return fieldClassName; - } - - /** - * Get the name of the field - * - * @return the field's name - */ - public String getFieldName() { - return fieldName; - } - - /** - * Get the type of the field - * - * @return the field's type in string format - */ - public String getFieldType() { - return fieldType; - } - -} - diff --git a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/FloatCPInfo.java b/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/FloatCPInfo.java deleted file mode 100644 index 532b6725..00000000 --- a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/FloatCPInfo.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tools.ant.taskdefs.optional.depend.constantpool; - -import java.io.DataInputStream; -import java.io.IOException; - -/** - * A Float CP Info - * - */ -public class FloatCPInfo extends ConstantCPInfo { - - /** Constructor. */ - public FloatCPInfo() { - super(CONSTANT_FLOAT, 1); - } - - /** - * read a constant pool entry from a class stream. - * - * @param cpStream the DataInputStream which contains the constant pool - * entry to be read. - * @exception IOException if there is a problem reading the entry from - * the stream. - */ - public void read(DataInputStream cpStream) throws IOException { - setValue(new Float(cpStream.readFloat())); - } - - /** - * Print a readable version of the constant pool entry. - * - * @return the string representation of this constant pool entry. - */ - public String toString() { - return "Float Constant Pool Entry: " + getValue(); - } - -} - diff --git a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/IntegerCPInfo.java b/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/IntegerCPInfo.java deleted file mode 100644 index 3beaa8cd..00000000 --- a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/IntegerCPInfo.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tools.ant.taskdefs.optional.depend.constantpool; - -import java.io.DataInputStream; -import java.io.IOException; - -/** - * An Integer CP Info - * - */ -public class IntegerCPInfo extends ConstantCPInfo { - - /** Constructor. */ - public IntegerCPInfo() { - super(CONSTANT_INTEGER, 1); - } - - /** - * read a constant pool entry from a class stream. - * - * @param cpStream the DataInputStream which contains the constant pool - * entry to be read. - * @exception IOException if there is a problem reading the entry from - * the stream. - */ - public void read(DataInputStream cpStream) throws IOException { - setValue(new Integer(cpStream.readInt())); - } - - /** - * Print a readable version of the constant pool entry. - * - * @return the string representation of this constant pool entry. - */ - public String toString() { - return "Integer Constant Pool Entry: " + getValue(); - } - -} - diff --git a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/InterfaceMethodRefCPInfo.java b/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/InterfaceMethodRefCPInfo.java deleted file mode 100644 index fbc23c1c..00000000 --- a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/InterfaceMethodRefCPInfo.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tools.ant.taskdefs.optional.depend.constantpool; - -import java.io.DataInputStream; -import java.io.IOException; - -/** - * A InterfaceMethodRef CP Info - * - */ -public class InterfaceMethodRefCPInfo extends ConstantPoolEntry { - /** the class name of the class defining the interface method */ - private String interfaceMethodClassName; - /** the name of the interface nmethod */ - private String interfaceMethodName; - /** the method signature of the interface method */ - private String interfaceMethodType; - /** - * the index into the constant pool of the class entry for the interface - * class - */ - private int classIndex; - /** - * the index into the constant pool of the name and type entry - * describing the method - */ - private int nameAndTypeIndex; - - /** Constructor. */ - public InterfaceMethodRefCPInfo() { - super(CONSTANT_INTERFACEMETHODREF, 1); - } - - /** - * read a constant pool entry from a class stream. - * - * @param cpStream the DataInputStream which contains the constant pool - * entry to be read. - * @exception IOException if there is a problem reading the entry from - * the stream. - */ - public void read(DataInputStream cpStream) throws IOException { - classIndex = cpStream.readUnsignedShort(); - nameAndTypeIndex = cpStream.readUnsignedShort(); - } - - /** - * Resolve this constant pool entry with respect to its dependents in - * the constant pool. - * - * @param constantPool the constant pool of which this entry is a member - * and against which this entry is to be resolved. - */ - public void resolve(ConstantPool constantPool) { - ClassCPInfo interfaceMethodClass - = (ClassCPInfo) constantPool.getEntry(classIndex); - - interfaceMethodClass.resolve(constantPool); - - interfaceMethodClassName = interfaceMethodClass.getClassName(); - - NameAndTypeCPInfo nt - = (NameAndTypeCPInfo) constantPool.getEntry(nameAndTypeIndex); - - nt.resolve(constantPool); - - interfaceMethodName = nt.getName(); - interfaceMethodType = nt.getType(); - - super.resolve(constantPool); - } - - /** - * Print a readable version of the constant pool entry. - * - * @return the string representation of this constant pool entry. - */ - public String toString() { - String value; - - if (isResolved()) { - value = "InterfaceMethod : Class = " + interfaceMethodClassName - + ", name = " + interfaceMethodName + ", type = " - + interfaceMethodType; - } else { - value = "InterfaceMethod : Class index = " + classIndex - + ", name and type index = " + nameAndTypeIndex; - } - - return value; - } - - /** - * Gets the name of the class defining the interface method - * - * @return the name of the class defining the interface method - */ - public String getInterfaceMethodClassName() { - return interfaceMethodClassName; - } - - /** - * Get the name of the interface method - * - * @return the name of the interface method - */ - public String getInterfaceMethodName() { - return interfaceMethodName; - } - - /** - * Gets the type of the interface method - * - * @return the interface method's type signature - */ - public String getInterfaceMethodType() { - return interfaceMethodType; - } - -} - diff --git a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/InvokeDynamicCPInfo.java b/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/InvokeDynamicCPInfo.java deleted file mode 100644 index 3795db75..00000000 --- a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/InvokeDynamicCPInfo.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tools.ant.taskdefs.optional.depend.constantpool; - -import java.io.DataInputStream; -import java.io.IOException; - -/** - * An InvokeDynamic CP Info - * - */ -public class InvokeDynamicCPInfo extends ConstantCPInfo { - - /** Index into the bootstrap methods for the class */ - private int bootstrapMethodAttrIndex; - /** the value of the method descriptor pointed to */ - private int nameAndTypeIndex; - /** the name and type CP info pointed to */ - private NameAndTypeCPInfo nameAndTypeCPInfo; - /** */ - /** Constructor. */ - public InvokeDynamicCPInfo() { - super(CONSTANT_INVOKEDYNAMIC, 1); - } - - /** - * read a constant pool entry from a class stream. - * - * @param cpStream the DataInputStream which contains the constant pool - * entry to be read. - * @exception java.io.IOException if there is a problem reading the entry from - * the stream. - */ - public void read(DataInputStream cpStream) throws IOException { - bootstrapMethodAttrIndex = cpStream.readUnsignedShort(); - nameAndTypeIndex = cpStream.readUnsignedShort(); - } - - /** - * Print a readable version of the constant pool entry. - * - * @return the string representation of this constant pool entry. - */ - public String toString() { - String value; - if (isResolved()) { - value = "Name = " + nameAndTypeCPInfo.getName() + ", type = " + nameAndTypeCPInfo.getType(); - } else { - value = "BootstrapMethodAttrIndex inx = " + bootstrapMethodAttrIndex - + "NameAndType index = " + nameAndTypeIndex; - } - - return value; - } - /** - * Resolve this constant pool entry with respect to its dependents in - * the constant pool. - * - * @param constantPool the constant pool of which this entry is a member - * and against which this entry is to be resolved. - */ - public void resolve(ConstantPool constantPool) { - nameAndTypeCPInfo - = (NameAndTypeCPInfo) constantPool.getEntry(nameAndTypeIndex); - nameAndTypeCPInfo.resolve(constantPool); - super.resolve(constantPool); - } - -} - diff --git a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/LongCPInfo.java b/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/LongCPInfo.java deleted file mode 100644 index e854f04f..00000000 --- a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/LongCPInfo.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tools.ant.taskdefs.optional.depend.constantpool; - -import java.io.DataInputStream; -import java.io.IOException; - -/** - * A Long CP Info - * - */ -public class LongCPInfo extends ConstantCPInfo { - - /** Constructor. */ - public LongCPInfo() { - super(CONSTANT_LONG, 2); - } - - /** - * read a constant pool entry from a class stream. - * - * @param cpStream the DataInputStream which contains the constant pool - * entry to be read. - * @exception IOException if there is a problem reading the entry from - * the stream. - */ - public void read(DataInputStream cpStream) throws IOException { - setValue(new Long(cpStream.readLong())); - } - - /** - * Print a readable version of the constant pool entry. - * - * @return the string representation of this constant pool entry. - */ - public String toString() { - return "Long Constant Pool Entry: " + getValue(); - } - -} - diff --git a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/MethodHandleCPInfo.java b/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/MethodHandleCPInfo.java deleted file mode 100644 index e11e3aab..00000000 --- a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/MethodHandleCPInfo.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tools.ant.taskdefs.optional.depend.constantpool; - -import java.io.DataInputStream; -import java.io.IOException; - -/** - * A MethodHandle CP Info - * - */ -public class MethodHandleCPInfo extends ConstantPoolEntry { - private ConstantPoolEntry reference; - - /** reference kind **/ - private ReferenceKind referenceKind; - /** Must be a valid index into the constant pool tabel. */ - private int referenceIndex; - /** - * the index into the constant pool which defined the name and type - * signature of the method - */ - private int nameAndTypeIndex; - public enum ReferenceKind { - REF_getField(1), - REF_getStatic(2), - REF_putField(3), - REF_putStatic(4), - REF_invokeVirtual(5), - REF_invokeStatic(6), - REF_invokeSpecial(7), - REF_newInvokeSpecial(8), - REF_invokeInterface(9); - private final int referenceKind; - ReferenceKind(int referenceKind) { - this.referenceKind = referenceKind; - } - - } - /** Constructor. */ - public MethodHandleCPInfo() { - super(CONSTANT_METHODHANDLE, 1); - } - - /** - * read a constant pool entry from a class stream. - * - * @param cpStream the DataInputStream which contains the constant pool - * entry to be read. - * @exception java.io.IOException if there is a problem reading the entry from - * the stream. - */ - public void read(DataInputStream cpStream) throws IOException { - referenceKind = ReferenceKind.values()[cpStream.readUnsignedByte() - 1]; - - referenceIndex = cpStream.readUnsignedShort(); - } - - /** - * Print a readable version of the constant pool entry. - * - * @return the string representation of this constant pool entry. - */ - public String toString() { - String value; - - if (isResolved()) { - value = "MethodHandle : " + reference.toString(); - } else { - value = "MethodHandle : Reference kind = " + referenceKind - + "Reference index = " + referenceIndex; - } - - return value; - } - - /** - * Resolve this constant pool entry with respect to its dependents in - * the constant pool. - * - * @param constantPool the constant pool of which this entry is a member - * and against which this entry is to be resolved. - */ - public void resolve(ConstantPool constantPool) { - reference = constantPool.getEntry(referenceIndex); - reference.resolve(constantPool); - super.resolve(constantPool); - } - - -} - diff --git a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/MethodRefCPInfo.java b/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/MethodRefCPInfo.java deleted file mode 100644 index 6b335212..00000000 --- a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/MethodRefCPInfo.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tools.ant.taskdefs.optional.depend.constantpool; - -import java.io.DataInputStream; -import java.io.IOException; - -/** - * A MethodRef CP Info - * - */ -public class MethodRefCPInfo extends ConstantPoolEntry { - /** the name of the class defining this method */ - private String methodClassName; - /** the name of the method */ - private String methodName; - /** the method's type descriptor */ - private String methodType; - /** The index into the constant pool which defines the class of this method. */ - private int classIndex; - /** - * the index into the constant pool which defined the name and type - * signature of the method - */ - private int nameAndTypeIndex; - - /** Constructor. */ - public MethodRefCPInfo() { - super(CONSTANT_METHODREF, 1); - } - - /** - * read a constant pool entry from a class stream. - * - * @param cpStream the DataInputStream which contains the constant pool - * entry to be read. - * @exception IOException if there is a problem reading the entry from - * the stream. - */ - public void read(DataInputStream cpStream) throws IOException { - classIndex = cpStream.readUnsignedShort(); - nameAndTypeIndex = cpStream.readUnsignedShort(); - } - - /** - * Print a readable version of the constant pool entry. - * - * @return the string representation of this constant pool entry. - */ - public String toString() { - String value; - - if (isResolved()) { - value = "Method : Class = " + methodClassName + ", name = " - + methodName + ", type = " + methodType; - } else { - value = "Method : Class index = " + classIndex - + ", name and type index = " + nameAndTypeIndex; - } - - return value; - } - - /** - * Resolve this constant pool entry with respect to its dependents in - * the constant pool. - * - * @param constantPool the constant pool of which this entry is a member - * and against which this entry is to be resolved. - */ - public void resolve(ConstantPool constantPool) { - ClassCPInfo methodClass - = (ClassCPInfo) constantPool.getEntry(classIndex); - - methodClass.resolve(constantPool); - - methodClassName = methodClass.getClassName(); - - NameAndTypeCPInfo nt - = (NameAndTypeCPInfo) constantPool.getEntry(nameAndTypeIndex); - - nt.resolve(constantPool); - - methodName = nt.getName(); - methodType = nt.getType(); - - super.resolve(constantPool); - } - - /** - * Get the name of the class defining the method - * - * @return the name of the class defining this method - */ - public String getMethodClassName() { - return methodClassName; - } - - /** - * Get the name of the method. - * - * @return the name of the method. - */ - public String getMethodName() { - return methodName; - } - - /** - * Get the type signature of the method. - * - * @return the type signature of the method. - */ - public String getMethodType() { - return methodType; - } - -} - diff --git a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/MethodTypeCPInfo.java b/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/MethodTypeCPInfo.java deleted file mode 100644 index d3c35cee..00000000 --- a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/MethodTypeCPInfo.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tools.ant.taskdefs.optional.depend.constantpool; - -import java.io.DataInputStream; -import java.io.IOException; - -/** - * A Method Type CP Info - * - */ -public class MethodTypeCPInfo extends ConstantCPInfo { - - /** Index into the constant pool for the class */ - private int methodDescriptorIndex; - /** the value of the method descriptor pointed to */ - private String methodDescriptor; - /** Constructor. */ - public MethodTypeCPInfo() { - super(CONSTANT_METHODTYPE, 1); - } - - /** - * read a constant pool entry from a class stream. - * - * @param cpStream the DataInputStream which contains the constant pool - * entry to be read. - * @exception java.io.IOException if there is a problem reading the entry from - * the stream. - */ - @Override - public void read(final DataInputStream cpStream) throws IOException { - methodDescriptorIndex = cpStream.readUnsignedShort(); - } - - /** - * Resolve this constant pool entry with respect to its dependents in - * the constant pool. - * - * @param constantPool the constant pool of which this entry is a member - * and against which this entry is to be resolved. - */ - @Override - public void resolve(final ConstantPool constantPool) { - final Utf8CPInfo methodClass - = (Utf8CPInfo) constantPool.getEntry(methodDescriptorIndex); - methodClass.resolve(constantPool); - methodDescriptor = methodClass.getValue(); - super.resolve(constantPool); - } - /** - * Print a readable version of the constant pool entry. - * - * @return the string representation of this constant pool entry. - */ - @Override - public String toString() { - if (!isResolved()) { - return "MethodDescriptorIndex: " + methodDescriptorIndex; - } else { - return "MethodDescriptor: " + methodDescriptor; - - } - } - -} - diff --git a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/NameAndTypeCPInfo.java b/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/NameAndTypeCPInfo.java deleted file mode 100644 index 47f454d2..00000000 --- a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/NameAndTypeCPInfo.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tools.ant.taskdefs.optional.depend.constantpool; - -import java.io.DataInputStream; -import java.io.IOException; - -/** - * A NameAndType CP Info - * - */ -public class NameAndTypeCPInfo extends ConstantPoolEntry { - - /** Constructor. */ - public NameAndTypeCPInfo() { - super(CONSTANT_NAMEANDTYPE, 1); - } - - /** - * read a constant pool entry from a class stream. - * - * @param cpStream the DataInputStream which contains the constant pool - * entry to be read. - * @exception IOException if there is a problem reading the entry from - * the stream. - */ - public void read(DataInputStream cpStream) throws IOException { - nameIndex = cpStream.readUnsignedShort(); - descriptorIndex = cpStream.readUnsignedShort(); - } - - /** - * Print a readable version of the constant pool entry. - * - * @return the string representation of this constant pool entry. - */ - public String toString() { - String value; - - if (isResolved()) { - value = "Name = " + name + ", type = " + type; - } else { - value = "Name index = " + nameIndex - + ", descriptor index = " + descriptorIndex; - } - - return value; - } - - /** - * Resolve this constant pool entry with respect to its dependents in - * the constant pool. - * - * @param constantPool the constant pool of which this entry is a member - * and against which this entry is to be resolved. - */ - public void resolve(ConstantPool constantPool) { - name = ((Utf8CPInfo) constantPool.getEntry(nameIndex)).getValue(); - type = ((Utf8CPInfo) constantPool.getEntry(descriptorIndex)).getValue(); - - super.resolve(constantPool); - } - - /** - * Get the name component of this entry - * - * @return the name of this name and type entry - */ - public String getName() { - return name; - } - - /** - * Get the type signature of this entry - * - * @return the type signature of this entry - */ - public String getType() { - return type; - } - - /** the name component of this entry */ - private String name; - /** the type component of this entry */ - private String type; - /** - * the index into the constant pool at which the name component's string - * value is stored - */ - private int nameIndex; - /** - * the index into the constant pool where the type descriptor string is - * stored. - */ - private int descriptorIndex; -} - diff --git a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/StringCPInfo.java b/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/StringCPInfo.java deleted file mode 100644 index bc9ee24b..00000000 --- a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/StringCPInfo.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tools.ant.taskdefs.optional.depend.constantpool; - -import java.io.DataInputStream; -import java.io.IOException; - -/** - * A String Constant Pool Entry. The String info contains an index into the - * constant pool where a UTF8 string is stored. - * - */ -public class StringCPInfo extends ConstantCPInfo { - - /** Constructor. */ - public StringCPInfo() { - super(CONSTANT_STRING, 1); - } - - /** - * read a constant pool entry from a class stream. - * - * @param cpStream the DataInputStream which contains the constant pool - * entry to be read. - * @exception IOException if there is a problem reading the entry from - * the stream. - */ - public void read(DataInputStream cpStream) throws IOException { - index = cpStream.readUnsignedShort(); - - setValue("unresolved"); - } - - /** - * Print a readable version of the constant pool entry. - * - * @return the string representation of this constant pool entry. - */ - public String toString() { - return "String Constant Pool Entry for " - + getValue() + "[" + index + "]"; - } - - /** - * Resolve this constant pool entry with respect to its dependents in - * the constant pool. - * - * @param constantPool the constant pool of which this entry is a member - * and against which this entry is to be resolved. - */ - public void resolve(ConstantPool constantPool) { - setValue(((Utf8CPInfo) constantPool.getEntry(index)).getValue()); - super.resolve(constantPool); - } - - /** the index into the constant pool containing the string's content */ - private int index; -} - diff --git a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/Utf8CPInfo.java b/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/Utf8CPInfo.java deleted file mode 100644 index 5471ccde..00000000 --- a/framework/src/ant/apache-ant-1.9.6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/Utf8CPInfo.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tools.ant.taskdefs.optional.depend.constantpool; - -import java.io.DataInputStream; -import java.io.IOException; - -/** - * A UTF8 Constant Pool Entry. - * - */ -public class Utf8CPInfo extends ConstantPoolEntry { - /** The String value of the UTF-8 entry */ - private String value; - - /** Constructor. */ - public Utf8CPInfo() { - super(CONSTANT_UTF8, 1); - } - - /** - * read a constant pool entry from a class stream. - * - * @param cpStream the DataInputStream which contains the constant pool - * entry to be read. - * @exception IOException if there is a problem reading the entry from - * the stream. - */ - public void read(DataInputStream cpStream) throws IOException { - value = cpStream.readUTF(); - } - - /** - * Print a readable version of the constant pool entry. - * - * @return the string representation of this constant pool entry. - */ - public String toString() { - return "UTF8 Value = " + value; - } - - /** - * Get the string value of the UTF-8 entry - * - * @return the UTF-8 value as a Java string - */ - public String getValue() { - return value; - } - -} - |