diff options
author | Christian Melchior <christian@ilios.dk> | 2017-11-12 15:37:15 +0100 |
---|---|---|
committer | Christian Melchior <christian@ilios.dk> | 2017-11-12 15:37:15 +0100 |
commit | 215a61f3a0a1d2794df51611218068ab09a90d56 (patch) | |
tree | 7309f91e448e346a26d7f339fbd84464402d9406 /src/main/javassist/bytecode/FieldInfo.java | |
parent | f4769c7ad702fa529a790106ea5c318a7af5c7b7 (diff) | |
parent | e1f0bba5de4dc03a9debfab333683f07cfbcb594 (diff) | |
download | javassist-215a61f3a0a1d2794df51611218068ab09a90d56.tar.gz javassist-215a61f3a0a1d2794df51611218068ab09a90d56.zip |
Merge branch 'master' into cm/bug/classpath-close
# Conflicts:
# pom.xml
# src/main/javassist/ByteArrayClassPath.java
# src/main/javassist/ClassClassPath.java
# src/main/javassist/ClassPoolTail.java
# src/main/javassist/LoaderClassPath.java
# src/main/javassist/URLClassPath.java
Diffstat (limited to 'src/main/javassist/bytecode/FieldInfo.java')
-rw-r--r-- | src/main/javassist/bytecode/FieldInfo.java | 22 |
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)); } |