150
150
InstructionList il = new InstructionList();
152
152
// If it is null jump past the advice call
153
il.append(fact.createBranchInstruction(Constants.IFNULL, fk));
153
il.append(InstructionFactory.createBranchInstruction(Constants.IFNULL, fk));
155
155
// Load up the var again
156
156
il.append(((BcelVar) hasAnnotation.getVar()).createLoad(fact));
158
Member getClass = MemberImpl.method(UnresolvedType.OBJECT, 0, UnresolvedType.JAVA_LANG_CLASS, "getClass",
158
Member getClass = MemberImpl.method(UnresolvedType.OBJECT, 0, UnresolvedType.JL_CLASS, "getClass",
159
159
UnresolvedType.NONE);
160
160
il.append(Utility.createInvoke(fact, world, getClass));
161
161
// aload annotationClass
162
162
il.append(fact.createConstant(new ObjectType(hasAnnotation.getAnnotationType().getName())));
163
163
// int annClassIndex = fact.getConstantPool().addClass(hasAnnotation.getAnnotationType().getSignature());
164
164
// il.append(new LDC_W(annClassIndex));
165
Member isAnnotationPresent = MemberImpl.method(UnresolvedType.JAVA_LANG_CLASS, 0, ResolvedType.BOOLEAN,
166
"isAnnotationPresent", new UnresolvedType[] { UnresolvedType.JAVA_LANG_CLASS });
165
Member isAnnotationPresent = MemberImpl.method(UnresolvedType.JL_CLASS, 0, ResolvedType.BOOLEAN,
166
"isAnnotationPresent", new UnresolvedType[] { UnresolvedType.JL_CLASS });
167
167
il.append(Utility.createInvoke(fact, world, isAnnotationPresent));
168
168
il.append(createJumpBasedOnBooleanOnStack());
169
169
instructions.insert(il);
203
203
public void visit(Literal literal) {
204
if (literal == Literal.FALSE)
204
if (literal == Literal.FALSE) {
205
205
throw new BCException("visiting a false expression");
208
209
public void visit(Call call) {