use of org.apache.logging.log4j.message.EntryMessage in project meghanada-server by mopemope.
the class ExpressionScope method getExpressionReturn.
public Optional<AccessSymbol> getExpressionReturn() {
EntryMessage em = log.traceEntry("expressionReturn={}", this.expressionReturn);
Optional<Variable> var = this.variables.stream().filter(Variable::isDecl).findFirst();
if (var.isPresent()) {
return log.traceExit(em, Optional.empty());
}
Optional<AccessSymbol> aReturn = Optional.ofNullable(this.expressionReturn);
return log.traceExit(em, aReturn);
}
use of org.apache.logging.log4j.message.EntryMessage in project meghanada-server by mopemope.
the class Source method dump.
public void dump() {
final EntryMessage entryMessage = log.traceEntry("{}", Strings.repeat("*", 100));
for (final ClassScope cs : classScopes) {
cs.dump();
}
log.trace("unused={}", this.unused);
log.trace("unknown={}", this.unknown);
log.traceExit(entryMessage);
}
use of org.apache.logging.log4j.message.EntryMessage in project meghanada-server by mopemope.
the class ReferenceSearcher method searchFieldAccessCondition.
private static Optional<SearchCondition> searchFieldAccessCondition(Source source, int line, int col, String symbol) {
EntryMessage msg = log.traceEntry("line={} col={} symbol={}", line, col, symbol);
Optional<SearchCondition> result = source.searchFieldAccess(line, col, symbol).map(fa -> new SearchCondition(fa.declaringClass, fa.name, SearchCondition.Type.FIELD));
log.traceExit(msg);
return result;
}
use of org.apache.logging.log4j.message.EntryMessage in project meghanada-server by mopemope.
the class ReferenceSearcher method searchMemberCondition.
private static Optional<SearchCondition> searchMemberCondition(Source source, int line, int col, String symbol) {
EntryMessage msg = log.traceEntry("line={} col={} symbol={}", line, col, symbol);
for (ClassScope classScope : source.getClassScopes()) {
for (Variable variable : classScope.getVariables()) {
if (variable.isField) {
Position pos = variable.range.begin;
String name = variable.name;
if (pos.line == line && name.equals(symbol)) {
String clazz = classScope.getFQCN();
SearchCondition condition = new SearchCondition(clazz, name, SearchCondition.Type.FIELD);
return Optional.of(condition);
}
}
}
for (BlockScope blockScope : classScope.getScopes()) {
if (blockScope instanceof MethodScope) {
MethodScope methodScope = ((MethodScope) blockScope);
Position pos = methodScope.getNameRange().begin;
String name = methodScope.getName();
if (pos.line == line && name.equals(symbol)) {
String clazz = classScope.getFQCN();
SearchCondition condition = new SearchCondition(clazz, name, SearchCondition.Type.METHOD, methodScope.getParameters());
return Optional.of(condition);
}
}
}
}
log.traceExit(msg);
return Optional.empty();
}
use of org.apache.logging.log4j.message.EntryMessage in project meghanada-server by mopemope.
the class MethodDescriptor method renderTypeParameters.
@Override
protected String renderTypeParameters(final String template, final boolean formalType) {
final EntryMessage entryMessage = log.traceEntry("template={}, formalType={} typeParameterMap={} typeParameters={}", template, formalType, typeParameterMap, typeParameters);
String temp = template;
if (this.typeParameterMap.size() > 0) {
for (final Map.Entry<String, String> entry : this.typeParameterMap.entrySet()) {
final String k = entry.getKey();
final String v = entry.getValue();
temp = ClassNameUtils.replace(temp, ClassNameUtils.CLASS_TYPE_VARIABLE_MARK + k, v);
if (formalType) {
// follow intellij
temp = ClassNameUtils.replace(temp, ClassNameUtils.FORMAL_TYPE_VARIABLE_MARK + k, v);
}
}
} else {
for (final String entry : this.typeParameters) {
temp = ClassNameUtils.replace(temp, ClassNameUtils.CLASS_TYPE_VARIABLE_MARK + entry, ClassNameUtils.OBJECT_CLASS);
if (formalType) {
// follow intellij
temp = ClassNameUtils.replace(temp, ClassNameUtils.FORMAL_TYPE_VARIABLE_MARK + entry, ClassNameUtils.OBJECT_CLASS);
}
}
if (!this.modifier.contains("static")) {
temp = TRIM_RE.matcher(temp).replaceAll("");
}
}
final String rendered = ClassNameUtils.replace(temp, ClassNameUtils.FORMAL_TYPE_VARIABLE_MARK, "").trim();
return log.traceExit(entryMessage, rendered);
}
Aggregations