org.benf.cfr.reader.entities.ClassFile Java Examples

The following examples show how to use org.benf.cfr.reader.entities.ClassFile. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: VisibilityHelper.java    From cfr with MIT License 6 votes vote down vote up
public static boolean isVisibleTo(JavaRefTypeInstance maybeCaller, ClassFile classFile, boolean accPublic, boolean accPrivate, boolean accProtected) {
    if (accPublic) return true;
    if (maybeCaller.equals(classFile.getClassType())) return true;
    if (accPrivate) {
        return isInnerVisibleTo(maybeCaller, classFile);
    }
    if (accProtected) {
        // If it's derived, it can see it - if it's inner, it can see it.
        BindingSuperContainer bindingSuperContainer = maybeCaller.getBindingSupers();
        // paranoia.
        if (bindingSuperContainer == null) return false;
        if (bindingSuperContainer.containsBase(classFile.getClassType())) return true;
        return isInnerVisibleTo(maybeCaller, classFile);
    }
    // Otherwise, we're left with package visibility.
    if (maybeCaller.getPackageName().equals(classFile.getRefClassType().getPackageName())) return true;
    return false;
}
 
Example #2
Source File: AbstractMemberFunctionInvokation.java    From cfr with MIT License 6 votes vote down vote up
protected OverloadMethodSet getOverloadMethodSetInner(JavaTypeInstance objectType) {
    JavaTypeInstance deGenerifiedObjectType = objectType.getDeGenerifiedType();
    // Could well be null....
    JavaTypeInstance protoClassType = getFunction().getMethodPrototype().getClassType();
    if (protoClassType == null || deGenerifiedObjectType != protoClassType.getDeGenerifiedType()) {
        // TODO : This is more expensive than I'd like.
        OverloadMethodSet overloadMethodSet = getMethodPrototype().getOverloadMethodSet();
        if (deGenerifiedObjectType instanceof JavaRefTypeInstance) {
            ClassFile classFile = ((JavaRefTypeInstance) deGenerifiedObjectType).getClassFile();
            if (classFile != null) {
                overloadMethodSet = classFile.getOverloadMethodSet(getMethodPrototype());
            }
        }
        return overloadMethodSet;
    }
    return null;
}
 
Example #3
Source File: Op02GetClassRewriter.java    From cfr with MIT License 6 votes vote down vote up
private void tryRemove(ClassFile classFile, Op02WithProcessedDataAndRefs item, GetClassTest classTest) {

        Op02WithProcessedDataAndRefs pop = getSinglePrev(item);
        if (pop == null) return;

        if (pop.getInstr() != JVMInstr.POP) return;
        Op02WithProcessedDataAndRefs getClass = getSinglePrev(pop);
        if (getClass == null) return;
        if (!(isGetClass(getClass) || isRequireNonNull(getClass))) {
            return;
        }

        Op02WithProcessedDataAndRefs dup = getSinglePrev(getClass);
        if (dup == null) return;
        if (dup.getInstr() != JVMInstr.DUP) return;

        if (!classTest.test(classFile, item)) return;

        dup.nop();
        getClass.nop();
        pop.nop();
    }
 
Example #4
Source File: ExceptionCheckImpl.java    From cfr with MIT License 6 votes vote down vote up
private boolean checkAgainstInternal(Set<? extends JavaTypeInstance> thrown) {
    if (thrown.isEmpty()) return false;

    for (JavaTypeInstance thrownType : thrown) {
        try {
            ClassFile thrownClassFile = dcCommonState.getClassFile(thrownType);
            if (thrownClassFile == null) {
                return true;
            }
            BindingSuperContainer bindingSuperContainer = thrownClassFile.getBindingSupers();
            if (bindingSuperContainer == null) {
                return true;
            }
            Map<JavaRefTypeInstance, ?> boundSuperClasses = bindingSuperContainer.getBoundSuperClasses();
            if (boundSuperClasses == null) {
                return true;
            }
            if (SetUtil.hasIntersection(caughtChecked, boundSuperClasses.keySet())) {
                return true;
            }
        } catch (CannotLoadClassException e) {
            return true;
        }
    }
    return false;
}
 
Example #5
Source File: GetClassTestLambda.java    From cfr with MIT License 6 votes vote down vote up
@Override
public boolean test(ClassFile classFile, Op02WithProcessedDataAndRefs item) {
    ConstantPoolEntry[] cpEntries = item.getCpEntries();
    ConstantPoolEntryInvokeDynamic invokeDynamic = (ConstantPoolEntryInvokeDynamic) cpEntries[0];

    // Should have this as a member on name and type
    int idx = invokeDynamic.getBootstrapMethodAttrIndex();

    BootstrapMethodInfo bootstrapMethodInfo = classFile.getBootstrapMethods().getBootStrapMethodInfo(idx);
    ConstantPoolEntryMethodRef methodRef = bootstrapMethodInfo.getConstantPoolEntryMethodRef();
    String methodName = methodRef.getName();

    DynamicInvokeType dynamicInvokeType = DynamicInvokeType.lookup(methodName);
    if (dynamicInvokeType == DynamicInvokeType.UNKNOWN) return false;

    return true;
}
 
Example #6
Source File: MemberNameResolver.java    From cfr with MIT License 6 votes vote down vote up
private void rePushBadNames(ClassFile c, Set<MethodKey> clashes, Stack<ClassFile> parents) {
    MemberInfo memberInfo = infoMap.get(c);
    if (memberInfo != null) {
        memberInfo.addClashes(clashes);
        if (!memberInfo.getClashes().isEmpty()) {
            clashes = SetFactory.newSet(clashes);
            clashes.addAll(memberInfo.getClashes());
        }
    }

    parents.push(c);
    for (ClassFile child : parentToChild.get(c)) {
        rePushBadNames(child, clashes, parents);
    }
    parents.pop();

}
 
Example #7
Source File: StructuredDefinition.java    From cfr with MIT License 6 votes vote down vote up
@Override
public Dumper dump(Dumper dumper) {
    Class<?> clazz = scopedEntity.getClass();
    if (clazz == LocalVariable.class) {
        return LValue.Creation.dump(dumper, scopedEntity).endCodeln();
    } else if (clazz == SentinelLocalClassLValue.class) {
        JavaTypeInstance type = ((SentinelLocalClassLValue) scopedEntity).getLocalClassType().getDeGenerifiedType();
        if (type instanceof JavaRefTypeInstance) {
            ClassFile classFile = ((JavaRefTypeInstance) type).getClassFile();
            if (classFile != null) {
                return classFile.dumpAsInlineClass(dumper);
            }
        }
    }
    return dumper;
}
 
Example #8
Source File: ClassFileDumperModule.java    From cfr with MIT License 6 votes vote down vote up
@Override
public Dumper dump(ClassFile classFile, InnerClassDumpType innerClass, Dumper d) {
    AttributeModule module = classFile.getAttributes().getByName(AttributeModule.ATTRIBUTE_NAME);
    ConstantPool cp = module.getCp();
    Set<AttributeModule.ModuleFlags> flags = module.getFlags();
    d.print(CollectionUtils.joinPostFix(flags, " "));
    d.print("module ").print(module.getModuleName()).print(" {").newln();
    d.indent(1);
    dumpRequires(cp, d, module.getRequires());
    dumpOpensExports(cp, d, module.getExports(), "exports");
    dumpOpensExports(cp, d, module.getOpens(), "opens");
    dumpProvides(cp, d, module.getProvides());
    d.indent(-1);
    d.print("}").newln();
    return d;
}
 
Example #9
Source File: ClassFileDumperRecord.java    From cfr with MIT License 6 votes vote down vote up
private void dumpHeader(ClassFile c, InnerClassDumpType innerClassDumpType, Dumper d) {
    d.keyword(getAccessFlagsString(c.getAccessFlags(), dumpableAccessFlagsClass));

    d.keyword("record ").dump(c.getClassType()).print("(");
    List<ClassFileField> fields = Functional.filter(c.getFields(), new Predicate<ClassFileField>() {
                @Override
                public boolean test(ClassFileField in) {
                    return !in.getField().testAccessFlag(AccessFlag.ACC_STATIC);
                }
            });
    boolean first = true;
    for (ClassFileField f : fields) {
        first = StringUtils.comma(first, d);
        f.dumpAsRecord(d, c);
    }
    d.print(") ");
}
 
Example #10
Source File: ObjectTypeUsageRewriter.java    From cfr with MIT License 5 votes vote down vote up
private Expression handleMemberFunction(final MemberFunctionInvokation funcInv) {

        class MemberCheck implements UnaryFunction<ClassFile, Boolean> {
            @Override
            public Boolean invoke(ClassFile classFile) {
                return classFile.getMethodByPrototypeOrNull(funcInv.getMethodPrototype()) != null;
            }
        }

        Expression lhsObject = funcInv.getObject();
        JavaTypeInstance owningClassType = funcInv.getMethodPrototype().getClassType();
        if (owningClassType == null) return funcInv;
        if (!needsReWrite(lhsObject, owningClassType, new MemberCheck())) return funcInv;
        return funcInv.withReplacedObject(new CastExpression(new InferredJavaType(owningClassType, InferredJavaType.Source.FORCE_TARGET_TYPE), lhsObject));
    }
 
Example #11
Source File: FakeMethodRewriter.java    From cfr with MIT License 5 votes vote down vote up
public static void rewrite(ClassFile classFile, TypeUsageCollectingDumper typeUsage) {
    ExpressionRewriterTransformer trans = new ExpressionRewriterTransformer(new Rewriter(classFile, typeUsage));
    for (Method method : classFile.getMethods()) {
        if (method.hasCodeAttribute()) {
            Op04StructuredStatement code = method.getAnalysis();
            trans.transform(code);
        }
    }
}
 
Example #12
Source File: RecordRewriter.java    From cfr with MIT License 5 votes vote down vote up
private static Method getMethod(ClassFile classFile, final List<JavaTypeInstance> args, String name) {
    List<Method> methods = classFile.getMethodsByNameOrNull(name);
    if (methods == null) return null;
    methods = Functional.filter(methods, new Predicate<Method>() {
        @Override
        public boolean test(Method in) {
            if (!in.testAccessFlag(AccessFlagMethod.ACC_PUBLIC)) return false;
            return in.getMethodPrototype().getArgs().equals(args);
        }
    });
    return methods.size() == 1 ? methods.get(0) : null;
}
 
Example #13
Source File: ClassMapping.java    From cfr with MIT License 5 votes vote down vote up
private String getFieldNameOrNull(String name, JavaTypeInstance type, Dumper d, Mapping mapping) {
    if (name.endsWith(MiscConstants.DOT_THIS)) {
        String preName = name.substring(0, name.length() - MiscConstants.DOT_THIS.length());
        Set<JavaTypeInstance> parents = SetFactory.newOrderedSet();
        type.getInnerClassHereInfo().collectTransitiveDegenericParents(parents);
        for (JavaTypeInstance parent : parents) {
            if (((JavaRefTypeInstance)parent).getRawShortName().equals(preName)) {
                JavaRefTypeInstance mappedParent = (JavaRefTypeInstance)mapping.get(parent);
                if (mappedParent != null) {
                    return mappedParent.getRawShortName() + MiscConstants.DOT_THIS;
                }
            }
        }
    }
    FieldMapping f = fieldMappings.get(name);
    if (f == null) {

        if (type instanceof JavaRefTypeInstance) {
            /*
             * Try in bases
             */
            ClassFile classFile = ((JavaRefTypeInstance) type).getClassFile();
            if (classFile != null) {
                JavaTypeInstance baseType = classFile.getBaseClassType().getDeGenerifiedType();
                String res = getClassFieldNameOrNull(name, d, mapping, baseType);
                if (res != null) return res;
            }
        }
        return null;
    }
    return f.getRename();
}
 
Example #14
Source File: VariableNameTidier.java    From cfr with MIT License 5 votes vote down vote up
@Override
public LValue rewriteExpression(LValue lValue, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags) {
    if (lValue.getClass() == StaticVariable.class) {
        StaticVariable staticVariable = (StaticVariable) lValue;
        String fieldName = staticVariable.getFieldName();
        if (!localScope.isDefined(fieldName)) {
            JavaTypeInstance owningClassType = staticVariable.getOwningClassType();
            if (owningClassType.equals(ownerClassType)) {
                if (!MiscConstants.CLASS.equals(fieldName)) {
                    return staticVariable.getSimpleCopy();
                }
            } else {
                // From Java12 and up, we generate direct accessors to private static variables in outer classes!
                InnerClassInfo innerClassInfo = ownerClassType.getInnerClassHereInfo();
                while (innerClassInfo.isInnerClass()) {
                    JavaRefTypeInstance clazz = innerClassInfo.getOuterClass();
                    ClassFile classFile = clazz.getClassFile();
                    if (classFile == null) break;
                    if (owningClassType.equals(clazz)) {
                        return staticVariable.getSimpleCopy();
                    }
                    if (classFile.hasLocalField(fieldName)) break;
                    innerClassInfo = clazz.getInnerClassHereInfo();
                }
            }
        }
    }
    return lValue;
}
 
Example #15
Source File: DeadMethodRemover.java    From cfr with MIT License 5 votes vote down vote up
public static void removeDeadMethod(ClassFile classFile, Method method) {
    Op04StructuredStatement code = method.getAnalysis();
    StructuredStatement statement = code.getStatement();
    if (!(statement instanceof Block)) return;

    Block block = (Block) statement;
    for (Op04StructuredStatement inner : block.getBlockStatements()) {
        StructuredStatement innerStatement = inner.getStatement();
        if (!(innerStatement instanceof StructuredComment)) {
            return;
        }
    }
    method.hideDead();
}
 
Example #16
Source File: ObjectTypeUsageRewriter.java    From cfr with MIT License 5 votes vote down vote up
private LValue handleFieldVariable(final FieldVariable fieldVariable) {

        class FieldCheck implements UnaryFunction<ClassFile, Boolean> {
            @Override
            public Boolean invoke(ClassFile classFile) {
                return classFile.hasLocalField(fieldVariable.getFieldName());
            }
        }

        Expression lhsObject = fieldVariable.getObject();
        JavaTypeInstance owningClassType = fieldVariable.getOwningClassType();
        if (!needsReWrite(lhsObject, owningClassType, new FieldCheck())) return fieldVariable;

        return fieldVariable.withReplacedObject(new CastExpression(new InferredJavaType(owningClassType, InferredJavaType.Source.FORCE_TARGET_TYPE), lhsObject));
    }
 
Example #17
Source File: Op02GetClassRewriter.java    From cfr with MIT License 5 votes vote down vote up
public static void removeInvokeGetClass(ClassFile classFile, List<Op02WithProcessedDataAndRefs> op02list, GetClassTest classTest) {
    JVMInstr testInstr = classTest.getInstr();
    for (Op02WithProcessedDataAndRefs item : op02list) {
        if (item.getInstr() == testInstr) {
            INSTANCE.tryRemove(classFile, item, classTest);
        }
    }
}
 
Example #18
Source File: GetClassTestInnerConstructor.java    From cfr with MIT License 5 votes vote down vote up
@Override
public boolean test(ClassFile classFile, Op02WithProcessedDataAndRefs item) {
    ConstantPoolEntryMethodRef function = (ConstantPoolEntryMethodRef) item.getCpEntries()[0];
    if (!function.getName().equals(MiscConstants.INIT_METHOD)) return false;
    JavaTypeInstance initType = function.getClassEntry().getTypeInstance();
    InnerClassInfo innerClassInfo = initType.getInnerClassHereInfo();
    if (!innerClassInfo.isInnerClass()) return false;
    return true;
}
 
Example #19
Source File: InferredJavaType.java    From cfr with MIT License 5 votes vote down vote up
private void mergeGenericInfo(JavaGenericRefTypeInstance otherTypeInstance) {
    if (this.value.isLocked()) return;
    JavaGenericRefTypeInstance thisType = (JavaGenericRefTypeInstance) this.value.getJavaTypeInstance();
    if (!thisType.hasUnbound()) return;
    ClassFile degenerifiedThisClassFile = thisType.getDeGenerifiedType().getClassFile();
    if (degenerifiedThisClassFile == null) {
        return;
    }
    JavaTypeInstance boundThisType = degenerifiedThisClassFile.getBindingSupers().getBoundAssignable(thisType, otherTypeInstance);
    if (!boundThisType.equals(thisType)) {
        mkDelegate(this.value, new IJTInternal_Impl(boundThisType, Source.GENERICCALL, true));
    }
}
 
Example #20
Source File: JavaRefTypeInstance.java    From cfr with MIT License 5 votes vote down vote up
@Override
public JavaAnnotatedTypeInstance getAnnotatedInstance() {
    JavaRefTypeInstance rti = this;
    Annotated prev = null;
    boolean couldLoadOuterClasses = true;

    do {
        InnerClassInfo ici = rti.getInnerClassHereInfo();
        boolean isInner = ici.isInnerClass();
        prev = new Annotated(prev, rti);
        /*
         * JLS 9.7.4 ("admissible"):
         * Annotation relates to runtime object, so if inner class is non-static, an instance of outer
         * class exists as runtime object and can therefore be annotated. However, for static nested
         * classes no instance of outer class exists, so outer class is just a name and cannot be
         * annotated.
         */
        ClassFile classFile = rti.getClassFile();
        if (isInner && (classFile == null || !classFile.testAccessFlag(AccessFlag.ACC_STATIC))) {
            rti = ici.getOuterClass();

            // Annotation placement might be incorrect if determining whether outer
            // is static is not possible
            if (couldLoadOuterClasses && classFile == null) {
                couldLoadOuterClasses = false;
            }
        } else {
            rti = null;
        }
    } while (rti != null);

    if (!couldLoadOuterClasses) {
        prev.setComment(DecompilerComment.BAD_ANNOTATION_ON_INNER);
    }

    return prev;
}
 
Example #21
Source File: JavaRefTypeInstance.java    From cfr with MIT License 5 votes vote down vote up
@Override
public BindingSuperContainer getBindingSupers() {
    if (cachedBindingSupers != BindingSuperContainer.POISON) return cachedBindingSupers;
    try {
        ClassFile classFile = getClassFile();
        cachedBindingSupers = classFile == null ? null : classFile.getBindingSupers();
    } catch (CannotLoadClassException e) {
        cachedBindingSupers = null;
    }
    return cachedBindingSupers;
}
 
Example #22
Source File: JavaRefTypeInstance.java    From cfr with MIT License 5 votes vote down vote up
public ClassFile getClassFile() {
    if (dcCommonState == null) return null;
    try {
        ClassFile classFile = dcCommonState.getClassFile(this);
        return classFile;
    } catch (CannotLoadClassException e) {
        return null;
    }
}
 
Example #23
Source File: UnreachableStaticRewriter.java    From cfr with MIT License 5 votes vote down vote up
private boolean defines(JavaRefTypeInstance type, StaticFunctionInvokation sfe) {
    ClassFile classFile = type.getClassFile();
    if (classFile == null) return true;
    OverloadMethodSet oms = classFile.getOverloadMethodSet(sfe.getMethodPrototype());
    if (oms == null) return true;
    return oms.size() != 1;
}
 
Example #24
Source File: RecordRewriter.java    From cfr with MIT License 5 votes vote down vote up
private static void hideHashCode(ClassFile classFile, JavaTypeInstance thisType, List<ClassFileField> fields) {
    Method method = getMethod(classFile, Collections.<JavaTypeInstance>emptyList(), MiscConstants.HASHCODE);
    if (method == null) return;

    WildcardMatch wcm = new WildcardMatch();
    StructuredStatement stm = new StructuredReturn(new CastExpression(new InferredJavaType(RawJavaType.INT, InferredJavaType.Source.TEST),
            wcm.getStaticFunction("func", TypeConstants.OBJECTMETHODS, TypeConstants.OBJECT, "bootstrap",
                    new Literal(TypedLiteral.getString(QuotingUtils.enquoteString(MiscConstants.HASHCODE))),
                    wcm.getExpressionWildCard("array"),
                    wcm.getExpressionWildCard("this"))), RawJavaType.INT);

    hideIfMatch(thisType, fields, method, wcm, stm);
}
 
Example #25
Source File: RecordRewriter.java    From cfr with MIT License 5 votes vote down vote up
private static void hideToString(ClassFile classFile, JavaTypeInstance thisType, List<ClassFileField> fields) {
    Method method = getMethod(classFile, Collections.<JavaTypeInstance>emptyList(), MiscConstants.TOSTRING);
    if (method == null) return;

    WildcardMatch wcm = new WildcardMatch();
    StructuredStatement stm = new StructuredReturn(
            wcm.getStaticFunction("func", TypeConstants.OBJECTMETHODS, TypeConstants.OBJECT, "bootstrap",
                    new Literal(TypedLiteral.getString(QuotingUtils.enquoteString(MiscConstants.TOSTRING))),
                    wcm.getExpressionWildCard("array"),
                    wcm.getExpressionWildCard("this")), TypeConstants.STRING);

    hideIfMatch(thisType, fields, method, wcm, stm);
}
 
Example #26
Source File: RecordRewriter.java    From cfr with MIT License 5 votes vote down vote up
public static void rewrite(ClassFile classFile, DCCommonState state) {
    if (!TypeConstants.RECORD.equals(classFile.getBaseClassType())) return;

    /* For a record, we can eliminate
     * * the constructor (if it only assigns fields, and assigns ALL fields)
     *    (but we must leave validation code in place).
     * * equals, hashcode and toString, if they exactly match the expected bootstrap pattern.
     * * getters (if they are exactly getters).
     */
    rewriteIfRecord(classFile, state);
}
 
Example #27
Source File: MethodHandlePlaceholder.java    From cfr with MIT License 5 votes vote down vote up
public FakeMethod addFakeMethod(ClassFile classFile) {
    fake = classFile.addFakeMethod(handle, "ldc", new UnaryFunction<String, FakeMethod>() {
        @Override
        public FakeMethod invoke(String name) {
            return generateFake(name);
        }
    });
    return fake;
}
 
Example #28
Source File: ConstantPool.java    From cfr with MIT License 5 votes vote down vote up
public ConstantPool(ClassFile classFile, DCCommonState dcCommonState, ByteData raw, int count) {
    this.classFile = classFile;
    this.options = dcCommonState.getOptions();
    count--;

    RawTmp tmp = processRaw(raw, count);
    this.entries = tmp.entries;
    this.length = tmp.rawLength;
    this.dynamicConstants = tmp.dynamicConstants;
    this.dcCommonState = dcCommonState;
    this.classCache = dcCommonState.getClassCache();
    this.isLoaded = true;
}
 
Example #29
Source File: ExceptionCheckImpl.java    From cfr with MIT License 5 votes vote down vote up
@Override
public boolean checkAgainstException(Expression expression) {
    if (missingInfo) return true;
    /*
     * If this exception is a new checked, then see if we're catching it.  If it's not a checked
     * or we can't tell what it is, default to not being able to handle it.
     */
    if (!(expression instanceof ConstructorInvokationSimple)) return true;
    ConstructorInvokationSimple constructorInvokation = (ConstructorInvokationSimple) expression;
    JavaTypeInstance type = constructorInvokation.getTypeInstance();
    Map<JavaRefTypeInstance, ?> boundSuperClasses;
    try {
        ClassFile classFile = dcCommonState.getClassFile(type);
        if (classFile == null) return true;
        BindingSuperContainer bindingSuperContainer = classFile.getBindingSupers();
        if (bindingSuperContainer == null) return true;
        boundSuperClasses = bindingSuperContainer.getBoundSuperClasses();
        if (boundSuperClasses == null) return true;
        // This is a runtime exception, we're not catching those, cool.
    } catch (CannotLoadClassException e) {
        return true;
    }
    /*
     * Ok, if we're catching runtime exceptions,
     */
    Collection<JavaRefTypeInstance> throwingBases = boundSuperClasses.keySet();
    if (SetUtil.hasIntersection(caughtChecked, throwingBases)) return true;
    if (SetUtil.hasIntersection(caughtUnchecked, throwingBases)) return true;
    return false;
}
 
Example #30
Source File: AbstractClassFileDumper.java    From cfr with MIT License 5 votes vote down vote up
void dumpAnnotations(ClassFile classFile, Dumper d) {
    AttributeMap classFileAttributes = classFile.getAttributes();
    AttributeRuntimeVisibleAnnotations runtimeVisibleAnnotations = classFileAttributes.getByName(AttributeRuntimeVisibleAnnotations.ATTRIBUTE_NAME) ;
    AttributeRuntimeInvisibleAnnotations runtimeInvisibleAnnotations = classFileAttributes.getByName(AttributeRuntimeInvisibleAnnotations.ATTRIBUTE_NAME);
    if (runtimeVisibleAnnotations != null) runtimeVisibleAnnotations.dump(d);
    if (runtimeInvisibleAnnotations != null) runtimeInvisibleAnnotations.dump(d);
}