JMethodCall call = new JMethodCall(info, trueQualifier, ctor);
addCallArgs(x.arguments, call, x.binding);
// We have to find and pass through any synthetics our supertype needs
ReferenceBinding superClass = x.binding.declaringClass;
if (superClass.isNestedType() && !superClass.isStatic()) {
ReferenceBinding myBinding = currentClassScope.referenceType().binding;
ReferenceBinding superBinding = superClass;
// enclosing types
if (superBinding.syntheticEnclosingInstanceTypes() != null) {
JExpression qualifier = dispProcessExpression(x.qualification);
for (ReferenceBinding arg : superBinding.syntheticEnclosingInstanceTypes()) {
JClassType classType = (JClassType) typeMap.get(arg);
if (qualifier == null) {
/*
* Got to be one of my params; it would be illegal to use a this
* ref at this moment-- we would most likely be passing in a
* supertype field that HASN'T BEEN INITIALIZED YET.
*
* Unfortunately, my params might not work as-is, so we have to
* check each one to see if any will make a suitable this ref.
*/
List<JExpression> workList = new ArrayList<JExpression>();
Iterator<JParameter> paramIt = getSyntheticsIterator();
for (ReferenceBinding b : myBinding.syntheticEnclosingInstanceTypes()) {
workList.add(createVariableRef(info, paramIt.next()));
}
call.addArg(createThisRef(classType, workList));
} else {
call.addArg(createThisRef(classType, qualifier));
}
}
}
// outer locals
if (superBinding.syntheticOuterLocalVariables() != null) {
for (SyntheticArgumentBinding arg : superBinding.syntheticOuterLocalVariables()) {
// Got to be one of my params
JType varType = (JType) typeMap.get(arg.type);
String varName = String.valueOf(arg.name);
JParameter param = null;
for (int i = 0; i < currentMethod.getParams().size(); ++i) {