aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/bytecode/FieldInfo.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/javassist/bytecode/FieldInfo.java')
-rw-r--r--src/main/javassist/bytecode/FieldInfo.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/main/javassist/bytecode/FieldInfo.java b/src/main/javassist/bytecode/FieldInfo.java
index 926b8137..7d26327a 100644
--- a/src/main/javassist/bytecode/FieldInfo.java
+++ b/src/main/javassist/bytecode/FieldInfo.java
@@ -19,8 +19,8 @@ package javassist.bytecode;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
-import java.util.List;
import java.util.ArrayList;
+import java.util.List;
/**
* <code>field_info</code> structure.
@@ -43,7 +43,7 @@ public final class FieldInfo {
String cachedName;
String cachedType;
int descriptor;
- ArrayList attribute; // may be null.
+ List<AttributeInfo> attribute; // may be null.
private FieldInfo(ConstPool cp) {
constPool = cp;
@@ -75,6 +75,7 @@ public final class FieldInfo {
/**
* Returns a string representation of the object.
*/
+ @Override
public String toString() {
return getName() + " " + getDescriptor();
}
@@ -95,7 +96,7 @@ public final class FieldInfo {
}
void prune(ConstPool cp) {
- ArrayList newAttributes = new ArrayList();
+ List<AttributeInfo> newAttributes = new ArrayList<AttributeInfo>();
AttributeInfo invisibleAnnotations
= getAttribute(AnnotationsAttribute.invisibleTag);
if (invisibleAnnotations != null) {
@@ -110,13 +111,13 @@ public final class FieldInfo {
newAttributes.add(visibleAnnotations);
}
- AttributeInfo signature
+ AttributeInfo signature
= getAttribute(SignatureAttribute.tag);
if (signature != null) {
signature = signature.copy(cp, null);
newAttributes.add(signature);
}
-
+
int index = getConstantValue();
if (index != 0) {
index = constPool.copy(index, cp, null);
@@ -206,8 +207,7 @@ public final class FieldInfo {
= (ConstantAttribute)getAttribute(ConstantAttribute.tag);
if (attr == null)
return 0;
- else
- return attr.getConstantValue();
+ return attr.getConstantValue();
}
/**
@@ -220,9 +220,9 @@ public final class FieldInfo {
* @return a list of <code>AttributeInfo</code> objects.
* @see AttributeInfo
*/
- public List getAttributes() {
+ public List<AttributeInfo> getAttributes() {
if (attribute == null)
- attribute = new ArrayList();
+ attribute = new ArrayList<AttributeInfo>();
return attribute;
}
@@ -262,7 +262,7 @@ public final class FieldInfo {
*/
public void addAttribute(AttributeInfo info) {
if (attribute == null)
- attribute = new ArrayList();
+ attribute = new ArrayList<AttributeInfo>();
AttributeInfo.remove(attribute, info.getName());
attribute.add(info);
@@ -273,7 +273,7 @@ public final class FieldInfo {
name = in.readUnsignedShort();
descriptor = in.readUnsignedShort();
int n = in.readUnsignedShort();
- attribute = new ArrayList();
+ attribute = new ArrayList<AttributeInfo>();
for (int i = 0; i < n; ++i)
attribute.add(AttributeInfo.read(constPool, in));
}