private int type_index;
private ConstantPool constant_pool;
- private List element_value_pairs;
+ private List<ElementValuePair> element_value_pairs;
/**
* Factory method to create an AnnotionEntry from a DataInputStream
final AnnotationEntry annotationEntry = new AnnotationEntry(file.readUnsignedShort(), constant_pool);
final int num_element_value_pairs = (file.readUnsignedShort());
- annotationEntry.element_value_pairs = new ArrayList();
+ annotationEntry.element_value_pairs = new ArrayList<ElementValuePair>();
for (int i = 0; i < num_element_value_pairs; i++) {
annotationEntry.element_value_pairs.add(new ElementValuePair(file.readUnsignedShort(), ElementValue.readElementValue(file, constant_pool),
constant_pool));
*/
public ElementValuePair[] getElementValuePairs() {
// TOFO return List
- return (ElementValuePair[]) element_value_pairs.toArray(new ElementValuePair[element_value_pairs.size()]);
+ return element_value_pairs.toArray(new ElementValuePair[element_value_pairs.size()]);
}
dos.writeShort(type_index); // u2 index of type name in cpool
dos.writeShort(element_value_pairs.size()); // u2 element_value pair count
for (int i = 0 ; i<element_value_pairs.size();i++) {
- ElementValuePair envp = (ElementValuePair) element_value_pairs.get(i);
+ ElementValuePair envp = element_value_pairs.get(i);
envp.dump(dos);
}
}
file.writeInt(length);
}
- private static final Map readers = new HashMap();
+ private static final Map<String,AttributeReader> readers =
+ new HashMap<String,AttributeReader>();
/*
* Class method reads one attribute from the input data stream. This method
switch (tag)
{
case Constants.ATTR_UNKNOWN:
- AttributeReader r = (AttributeReader) readers.get(name);
+ AttributeReader r = readers.get(name);
if (r != null)
{
return r.createAttribute(name_index, length, file,
* @version $Id$
* @author <A HREF="mailto:m.dahm@gmx.de">M. Dahm</A>
*/
-public class JavaClass extends AccessFlags implements Cloneable, Comparable {
+public class JavaClass extends AccessFlags
+ implements Cloneable, Comparable<JavaClass> {
private static final long serialVersionUID = 7029227708237523236L;
private String file_name;
if (annotationsOutOfDate) {
// Find attributes that contain annotation data
Attribute[] attrs = getAttributes();
- List accumulatedAnnotations = new ArrayList();
+ List<AnnotationEntry> accumulatedAnnotations = new ArrayList<AnnotationEntry>();
for (int i = 0; i < attrs.length; i++) {
Attribute attribute = attrs[i];
if (attribute instanceof Annotations) {
accumulatedAnnotations.add(runtimeAnnotations.getAnnotationEntries()[j]);
}
}
- annotations = (AnnotationEntry[])accumulatedAnnotations.toArray(new AnnotationEntry[accumulatedAnnotations.size()]);
+ annotations = accumulatedAnnotations.toArray(new AnnotationEntry[accumulatedAnnotations.size()]);
annotationsOutOfDate = false;
}
return annotations;
* This ordering is based on the class name
*/
@Override
- public int compareTo( Object obj ) {
- return getClassName().compareTo(((JavaClass) obj).getClassName());
+ public int compareTo(JavaClass obj) {
+ return getClassName().compareTo(obj.getClassName());
}
private static final long serialVersionUID = -4152422704743201314L;
private byte[] bytes;
private String name;
- private static final Map unknown_attributes = new HashMap();
+ private static final Map<String, Unknown> unknown_attributes =
+ new HashMap<String, Unknown>();
/**
*/
public abstract class Utility {
- private static int unwrap( ThreadLocal tl ) {
- return ((Integer) tl.get()).intValue();
+ private static int unwrap( ThreadLocal<Integer> tl ) {
+ return tl.get().intValue();
}
- private static void wrap( ThreadLocal tl, int value ) {
+ private static void wrap( ThreadLocal<Integer> tl, int value ) {
tl.set(new Integer(value));
}
- private static ThreadLocal consumed_chars = new ThreadLocal() {
-
+ private static ThreadLocal<Integer> consumed_chars =
+ new ThreadLocal<Integer>() {
@Override
- protected Object initialValue() {
+ protected Integer initialValue() {
return new Integer(0);
}
};/* How many chars have been consumed
Keep the MBean names for web applications consistent between Tomcat 6
and Tomcat 7. (markt)
</fix>
+ <fix>
+ <bug>49876</bug>: Fix the generics warnings in the copied Apache Jakarta
+ BCEL code. Based on a patch by Gábor. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">