Search in sources :

Example 36 with EntryMessage

use of org.apache.logging.log4j.message.EntryMessage in project meghanada-server by mopemope.

the class FieldSignatureVisitor method visitInnerClassType.

@Override
public void visitInnerClassType(final String name) {
    final EntryMessage em = log.traceEntry("name={} typeInfo={}", name, this.typeInfo);
    this.typeInfo.innerClass = name;
    log.traceExit(em);
}
Also used : EntryMessage(org.apache.logging.log4j.message.EntryMessage)

Example 37 with EntryMessage

use of org.apache.logging.log4j.message.EntryMessage in project meghanada-server by mopemope.

the class FieldSignatureVisitor method visitFormalTypeParameter.

@Override
public void visitFormalTypeParameter(final String name) {
    final EntryMessage em = log.traceEntry("name={}", name);
    super.visitFormalTypeParameter(name);
    log.traceExit(em);
}
Also used : EntryMessage(org.apache.logging.log4j.message.EntryMessage)

Example 38 with EntryMessage

use of org.apache.logging.log4j.message.EntryMessage in project meghanada-server by mopemope.

the class FieldSignatureVisitor method visitArrayType.

@Override
public SignatureVisitor visitArrayType() {
    final TypeInfo current = this.currentType.peek();
    if (current != null) {
        current.isArray = true;
    } else {
        // on hold array flag
        this.holdArray = true;
    }
    final EntryMessage em = log.traceEntry("name={} current={} currentType={}", this.name, current, this.currentType);
    return log.traceExit(em, super.visitArrayType());
}
Also used : EntryMessage(org.apache.logging.log4j.message.EntryMessage)

Example 39 with EntryMessage

use of org.apache.logging.log4j.message.EntryMessage in project meghanada-server by mopemope.

the class FieldSignatureVisitor method visitTypeArgument.

@Override
public SignatureVisitor visitTypeArgument(final char c) {
    final EntryMessage em = log.traceEntry("name={} typeInfo={} currentType={}", this.name, this.typeInfo, this.currentType);
    this.isInstance = false;
    this.isExtends = false;
    this.isSuper = false;
    switch(c) {
        case SignatureVisitor.INSTANCEOF:
            this.isInstance = true;
            break;
        case SignatureVisitor.SUPER:
            this.isSuper = true;
            break;
        case SignatureVisitor.EXTENDS:
            this.isExtends = true;
            break;
    }
    if (this.currentType.size() == 0) {
        return log.traceExit(em, super.visitTypeArgument(c));
    }
    final TypeInfo typeInfo = this.currentType.peek();
    if (typeInfo.typeParameters == null) {
        typeInfo.typeParameters = new ArrayList<>(4);
    }
    return log.traceExit(em, super.visitTypeArgument(c));
}
Also used : EntryMessage(org.apache.logging.log4j.message.EntryMessage)

Example 40 with EntryMessage

use of org.apache.logging.log4j.message.EntryMessage in project meghanada-server by mopemope.

the class FieldSignatureVisitor method visitTypeVariable.

@Override
public void visitTypeVariable(String typeVariable) {
    final EntryMessage em = log.traceEntry("name={} typeVariable={} typeInfo={} current={}", this.name, typeVariable, this.typeInfo, this.currentType);
    TypeInfo typeInfo;
    if (this.typeMap != null && typeMap.containsKey(typeVariable)) {
        String val = typeMap.get(typeVariable);
        if (val.equals(typeVariable)) {
            FieldSignatureVisitor.getTopVisitor(this).typeParameters.add(typeVariable);
            typeVariable = ClassNameUtils.CLASS_TYPE_VARIABLE_MARK + typeVariable;
        } else {
            ClassNameUtils.getTypeVariable(val).ifPresent(tv -> FieldSignatureVisitor.getTopVisitor(this).typeParameters.add(tv));
            typeVariable = val;
        }
    } else {
        if (this.classTypeParameters.contains(typeVariable)) {
            // mark
            FieldSignatureVisitor.getTopVisitor(this).typeParameters.add(typeVariable);
            typeVariable = ClassNameUtils.CLASS_TYPE_VARIABLE_MARK + typeVariable;
        } else {
            FieldSignatureVisitor.getTopVisitor(this).typeParameters.add(typeVariable);
            typeVariable = ClassNameUtils.FORMAL_TYPE_VARIABLE_MARK + typeVariable;
        }
    }
    typeInfo = getTypeInfo(typeVariable);
    if (this.typeInfo == null) {
        this.typeInfo = typeInfo;
        if (this.holdArray) {
            this.typeInfo.isArray = true;
            this.holdArray = false;
        }
    }
    if (this.currentType.size() == 0) {
        // set main
        this.currentType.push(typeInfo);
    } else {
        TypeInfo current = this.currentType.peek();
        if (current != null && current.typeParameters != null) {
            current.typeParameters.add(typeInfo);
            // swap
            this.currentType.push(typeInfo);
        }
    }
    log.traceExit(em);
}
Also used : EntryMessage(org.apache.logging.log4j.message.EntryMessage)

Aggregations

EntryMessage (org.apache.logging.log4j.message.EntryMessage)64 ArrayList (java.util.ArrayList)9 CachedASMReflector (meghanada.reflect.asm.CachedASMReflector)8 Test (org.junit.jupiter.api.Test)8 ClassScope (meghanada.analyze.ClassScope)5 MethodCall (meghanada.analyze.MethodCall)5 IOException (java.io.IOException)3 InputStream (java.io.InputStream)3 HashSet (java.util.HashSet)3 List (java.util.List)3 Map (java.util.Map)3 Set (java.util.Set)3 ExecutionException (java.util.concurrent.ExecutionException)3 Variable (meghanada.analyze.Variable)3 Project (meghanada.project.Project)3 ClassIndex (meghanada.reflect.ClassIndex)3 ClassNameUtils (meghanada.utils.ClassNameUtils)3 LogManager (org.apache.logging.log4j.LogManager)3 Logger (org.apache.logging.log4j.Logger)3 SignatureReader (org.objectweb.asm.signature.SignatureReader)3