diff options
Diffstat (limited to 'src/main/javassist/bytecode/annotation/ByteMemberValue.java')
-rw-r--r-- | src/main/javassist/bytecode/annotation/ByteMemberValue.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/main/javassist/bytecode/annotation/ByteMemberValue.java b/src/main/javassist/bytecode/annotation/ByteMemberValue.java index 90763b0..be3f6e2 100644 --- a/src/main/javassist/bytecode/annotation/ByteMemberValue.java +++ b/src/main/javassist/bytecode/annotation/ByteMemberValue.java @@ -5,7 +5,8 @@ * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. Alternatively, the contents of this file may be used under - * the terms of the GNU Lesser General Public License Version 2.1 or later. + * the terms of the GNU Lesser General Public License Version 2.1 or later, + * or the Apache License Version 2.0. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -14,11 +15,12 @@ */ package javassist.bytecode.annotation; -import javassist.ClassPool; -import javassist.bytecode.ConstPool; import java.io.IOException; import java.lang.reflect.Method; +import javassist.ClassPool; +import javassist.bytecode.ConstPool; + /** * Byte constant value. * @@ -57,11 +59,13 @@ public class ByteMemberValue extends MemberValue { setValue((byte)0); } + @Override Object getValue(ClassLoader cl, ClassPool cp, Method m) { - return new Byte(getValue()); + return Byte.valueOf(getValue()); } - Class getType(ClassLoader cl) { + @Override + Class<?> getType(ClassLoader cl) { return byte.class; } @@ -82,6 +86,7 @@ public class ByteMemberValue extends MemberValue { /** * Obtains the string representation of this object. */ + @Override public String toString() { return Byte.toString(getValue()); } @@ -89,6 +94,7 @@ public class ByteMemberValue extends MemberValue { /** * Writes the value. */ + @Override public void write(AnnotationsWriter writer) throws IOException { writer.constValueIndex(getValue()); } @@ -96,6 +102,7 @@ public class ByteMemberValue extends MemberValue { /** * Accepts a visitor. */ + @Override public void accept(MemberValueVisitor visitor) { visitor.visitByteMemberValue(this); } |