logic: add type information of variable decl to name hierarchy

* implemented this feature for both, CXX and Java
* adjusted tests to reflect these changes
* added NameElement and NameHierarchy to Java code
* created more specialized JavaDeclName classes: JavaFunctionDeclName and JavaVariableDeclName
* implemented recording static modifier for Java methods and variables

fortune cookie message = You will enjoy true success in whatever you do.
This commit is contained in:
malte_langkabel
2017-07-28 09:12:32 +02:00
parent 2e117c4b6d
commit 01b1e0d6f1
21 changed files with 526 additions and 135 deletions
@@ -15,6 +15,10 @@ import com.github.javaparser.symbolsolver.model.declarations.TypeDeclaration;
import com.github.javaparser.symbolsolver.model.declarations.TypeParameterDeclaration;
import com.github.javaparser.symbolsolver.model.resolution.TypeSolver;
import com.sourcetrail.name.JavaDeclName;
import com.sourcetrail.name.JavaFunctionDeclName;
import com.sourcetrail.name.JavaTypeName;
public class JavaSymbolSolverDeclNameResolver extends JavaNameResolver
{
public JavaSymbolSolverDeclNameResolver(TypeSolver typeSolver, ArrayList<BodyDeclaration> ignoredContexts)
@@ -86,11 +90,12 @@ public class JavaSymbolSolverDeclNameResolver extends JavaNameResolver
));
}
declName = new JavaDeclName(
declName = new JavaFunctionDeclName(
methodDecl.getName(),
getTypeParameterNames(methodDecl.getTypeParameters()),
JavaSymbolSolverTypeNameResolver.getQualifiedTypeName(methodDecl.getReturnType(), m_typeSolver, m_ignoredContexts),
parameterNames
parameterNames,
methodDecl.isStatic()
);
declName.setParent(