if (!superInvocationFound) {
// No explicit superconstructor invocation found, so we need to manually insert
// a reference to the implicit superconstructor.
InterfaceType superclass = ((InterfaceType) entry.getKey().getReturnType()).getSuperclass();
if (superclass != null && !superclass.isObject()) {
ConstructorElement unnamedConstructor = superclass.getElement().getUnnamedConstructor();
ConstructorDeclaration superConstructorDeclaration = findConstructorDeclaration(unnamedConstructor);
if (superConstructorDeclaration != null) {
referenceGraph.addEdge(declaration, superConstructorDeclaration);
}
}
}
for (FormalParameter parameter : declaration.getParameters().getParameters()) {
referenceGraph.addNode(parameter);
referenceGraph.addEdge(declaration, parameter);
if (parameter instanceof DefaultFormalParameter) {
Expression defaultValue = ((DefaultFormalParameter) parameter).getDefaultValue();
if (defaultValue != null) {
ReferenceFinder parameterReferenceFinder = new ReferenceFinder(
parameter,
referenceGraph,
variableDeclarationMap,
constructorDeclarationMap);
defaultValue.accept(parameterReferenceFinder);
}
}
}
}
for (InstanceCreationExpression expression : constructorInvocations) {
referenceGraph.addNode(expression);
ConstructorElement constructor = expression.getStaticElement();
if (constructor == null) {
break;
}
constructor = followConstantRedirectionChain(constructor);
ConstructorDeclaration declaration = findConstructorDeclaration(constructor);