|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.aspectj.weaver.bcel.Utility
public class Utility
Field Summary | |
---|---|
static int |
testingParseCounter
For testing purposes: bit clunky but does work |
Constructor Summary | |
---|---|
Utility()
|
Method Summary | |
---|---|
static void |
appendConversion(InstructionList il,
InstructionFactory fact,
ResolvedType fromType,
ResolvedType toType)
|
static Attribute |
bcelAttribute(AjAttribute a,
ConstantPool pool)
|
static java.lang.String |
beautifyLocation(ISourceLocation isl)
|
static Instruction |
copyInstruction(Instruction i)
Fix for Bugzilla #39479, #40109 patch contributed by Andy Clement Need to manually copy Select instructions - if we rely on the the 'fresh' object created by copy(), the InstructionHandle array 'targets' inside the Select object will not have been deep copied, so modifying targets in fresh will modify the original Select - not what we want ! (It is a bug in BCEL to do with cloning Select objects). |
static Instruction |
createConstant(InstructionFactory fact,
int value)
|
static InstructionList |
createConversion(InstructionFactory factory,
Type fromType,
Type toType)
|
static InstructionList |
createConversion(InstructionFactory fact,
Type fromType,
Type toType,
boolean allowAutoboxing)
|
static Instruction |
createGet(InstructionFactory fact,
Member signature)
|
static Instruction |
createInstanceof(InstructionFactory fact,
ReferenceType t)
|
static Instruction |
createInvoke(InstructionFactory fact,
BcelWorld world,
Member signature)
|
static Instruction |
createInvoke(InstructionFactory fact,
LazyMethodGen m)
|
static Instruction |
createInvoke(InstructionFactory fact,
short kind,
Member member)
Create an invoke instruction |
static Instruction |
createSet(InstructionFactory fact,
Member signature)
|
static Instruction |
createSuperInvoke(InstructionFactory fact,
BcelWorld world,
Member signature)
|
static void |
deleteInstruction(InstructionHandle ih,
InstructionHandle retargetTo,
LazyMethodGen enclosingMethod)
delete an instruction handle and retarget all targeters of the deleted instruction to the provided target. |
static void |
deleteInstruction(InstructionHandle ih,
LazyMethodGen enclosingMethod)
delete an instruction handle and retarget all targeters of the deleted instruction to the next instruction. |
static int |
getSourceLine(InstructionHandle ih)
returns -1 if no source line attribute |
static java.util.List<Lint.Kind> |
getSuppressedWarnings(AnnotationAJ[] anns,
Lint lint)
|
static boolean |
isConstantPushInstruction(Instruction i)
|
static boolean |
isSuppressing(Member member,
java.lang.String lintkey)
Checks for suppression specified on the member or on the declaring type of that member |
static java.lang.String[] |
makeArgNames(int n)
|
static JavaClass |
makeJavaClass(java.lang.String filename,
byte[] bytes)
|
static int |
makePublic(int i)
|
static BcelVar[] |
pushAndReturnArrayOfVars(ResolvedType[] proceedParamTypes,
InstructionList il,
InstructionFactory fact,
LazyMethodGen enclosingMethod)
|
static java.util.List<AjAttribute> |
readAjAttributes(java.lang.String classname,
Attribute[] as,
ISourceContext context,
World w,
AjAttribute.WeaverVersionInfo version,
ConstantPoolReader dataDecompressor)
|
static void |
replaceInstruction(InstructionHandle ih,
InstructionList replacementInstructions,
LazyMethodGen enclosingMethod)
replace an instruction handle with another instruction, in this case, a branch instruction. |
static void |
setSourceLine(InstructionHandle ih,
int lineNumber)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int testingParseCounter
Constructor Detail |
---|
public Utility()
Method Detail |
---|
public static java.util.List<AjAttribute> readAjAttributes(java.lang.String classname, Attribute[] as, ISourceContext context, World w, AjAttribute.WeaverVersionInfo version, ConstantPoolReader dataDecompressor)
public static java.lang.String beautifyLocation(ISourceLocation isl)
public static Instruction createSuperInvoke(InstructionFactory fact, BcelWorld world, Member signature)
public static Instruction createInvoke(InstructionFactory fact, BcelWorld world, Member signature)
public static Instruction createGet(InstructionFactory fact, Member signature)
public static Instruction createSet(InstructionFactory fact, Member signature)
public static Instruction createInstanceof(InstructionFactory fact, ReferenceType t)
public static Instruction createInvoke(InstructionFactory fact, LazyMethodGen m)
public static Instruction createInvoke(InstructionFactory fact, short kind, Member member)
fact
- kind
- INVOKEINTERFACE, INVOKEVIRTUAL..member
-
public static java.lang.String[] makeArgNames(int n)
public static void appendConversion(InstructionList il, InstructionFactory fact, ResolvedType fromType, ResolvedType toType)
public static InstructionList createConversion(InstructionFactory factory, Type fromType, Type toType)
public static InstructionList createConversion(InstructionFactory fact, Type fromType, Type toType, boolean allowAutoboxing)
public static Instruction createConstant(InstructionFactory fact, int value)
public static JavaClass makeJavaClass(java.lang.String filename, byte[] bytes)
public static void replaceInstruction(InstructionHandle ih, InstructionList replacementInstructions, LazyMethodGen enclosingMethod)
ih
- the instruction handle to replace.branchInstruction
- the branch instruction to replace ih withenclosingMethod
- where to find ih's instruction list.public static void deleteInstruction(InstructionHandle ih, LazyMethodGen enclosingMethod)
ih
- the instruction handle to delete.enclosingMethod
- where to find ih's instruction list.public static void deleteInstruction(InstructionHandle ih, InstructionHandle retargetTo, LazyMethodGen enclosingMethod)
ih
- the instruction handle to deleteretargetTo
- the instruction handle to retarget targeters of ih to.enclosingMethod
- where to find ih's instruction list.public static Instruction copyInstruction(Instruction i)
declare error: call(* Instruction.copy()) && within(org.aspectj.weaver) && !withincode(* Utility.copyInstruction(Instruction)): "use Utility.copyInstruction to work-around bug in Select.copy()";
public static int getSourceLine(InstructionHandle ih)
public static void setSourceLine(InstructionHandle ih, int lineNumber)
public static int makePublic(int i)
public static BcelVar[] pushAndReturnArrayOfVars(ResolvedType[] proceedParamTypes, InstructionList il, InstructionFactory fact, LazyMethodGen enclosingMethod)
public static boolean isConstantPushInstruction(Instruction i)
public static boolean isSuppressing(Member member, java.lang.String lintkey)
public static java.util.List<Lint.Kind> getSuppressedWarnings(AnnotationAJ[] anns, Lint lint)
public static Attribute bcelAttribute(AjAttribute a, ConstantPool pool)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |