use of org.apache.logging.log4j.message.EntryMessage in project meghanada-server by mopemope.
the class MethodSignatureVisitor method visitBaseType.
@Override
public void visitBaseType(char c) {
final String baseType = ASMReflector.toPrimitive(c);
final EntryMessage message = log.traceEntry("baseType={} parameterTypes={} c={}", baseType, this.parameterTypes, c);
TypeInfo typeInfo = new TypeInfo(baseType, baseType);
if (this.parent != null && this.isReturn) {
// set return type
this.parent.returnType = typeInfo;
log.traceExit(message);
return;
}
if (this.current == null) {
this.current = typeInfo;
this.visitEnd();
}
log.traceExit(message);
}
use of org.apache.logging.log4j.message.EntryMessage in project meghanada-server by mopemope.
the class MethodSignatureVisitor method visitParameterType.
@Override
public SignatureVisitor visitParameterType() {
final EntryMessage message = log.traceEntry("name={} current={}", this.name, this.current);
MethodSignatureVisitor visitor = new MethodSignatureVisitor(this.name, this);
visitor.isParameter = true;
log.traceExit(message);
return visitor;
}
use of org.apache.logging.log4j.message.EntryMessage in project meghanada-server by mopemope.
the class FileUtils method getChecksum.
public static String getChecksum(final File file) throws IOException {
final EntryMessage entryMessage = log.traceEntry("file={}", file);
try {
final MessageDigest md = MessageDigest.getInstance(ALGORITHM_SHA_512);
try (final InputStream is = Files.newInputStream(file.toPath());
DigestInputStream dis = new DigestInputStream(is, md)) {
final byte[] buf = new byte[4096];
while (dis.read(buf) != -1) {
}
final byte[] digest = md.digest();
final StringBuilder sb = new StringBuilder(128);
for (final int b : digest) {
sb.append(Character.forDigit(b >> 4 & 0xF, 16));
sb.append(Character.forDigit(b & 0xF, 16));
}
log.traceExit(entryMessage);
return sb.toString();
}
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
}
use of org.apache.logging.log4j.message.EntryMessage in project meghanada-server by mopemope.
the class DeclarationSearcher method searchField.
private static Optional<Declaration> searchField(final Source source, final Integer line, final Integer col, final String symbol) {
final EntryMessage entryMessage = log.traceEntry("line={} col={} symbol={}", line, col, symbol);
final Optional<Declaration> result = source.searchFieldAccess(line, col, symbol).map(fa -> {
String scope = fa.scope;
if (scope != null && !scope.isEmpty()) {
scope = scope + '.' + symbol;
} else {
scope = symbol;
}
return new Declaration(scope.trim(), fa.returnType, Declaration.Type.FIELD, fa.argumentIndex);
});
log.traceExit(entryMessage);
return result;
}
use of org.apache.logging.log4j.message.EntryMessage in project meghanada-server by mopemope.
the class DeclarationSearcher method searchReserved.
private static Optional<Declaration> searchReserved(@SuppressWarnings("unused") final Source source, final Integer line, final Integer col, final String symbol) {
final EntryMessage entryMessage = log.traceEntry("line={} col={} symbol={}", line, col, symbol);
Optional<Declaration> result = Optional.empty();
if (symbol.equals("package") || symbol.equals("import") || symbol.equals("new") || symbol.equals("try") || symbol.equals("throw") || symbol.equals("finally") || symbol.equals("public") || symbol.equals("private") || symbol.equals("protected") || symbol.equals("return") || symbol.equals("static") || symbol.equals("final")) {
result = Optional.of(new Declaration(symbol, "", Declaration.Type.OTHER, 0));
}
log.traceExit(entryMessage);
return result;
}
Aggregations