}
JVariable variable = (JVariable) node;
JExpression curRef = createVariableRef(info, variable, binding);
if (x.genericCast != null) {
JType castType = (JType) typeMap.get(x.genericCast);
curRef = maybeCast(castType, curRef);
}
/*
* Wackiness: JDT represents multiple field access as an array of fields,
* each qualified by everything to the left. So each subsequent item in
* otherBindings takes the current expression as a qualifier.
*/
if (x.otherBindings != null) {
for (int i = 0; i < x.otherBindings.length; ++i) {
FieldBinding fieldBinding = x.otherBindings[i];
JField field;
if (fieldBinding.declaringClass == null) {
// probably array.length
field = program.getIndexedField("Array.length");
if (!field.getName().equals(String.valueOf(fieldBinding.name))) {
throw new InternalCompilerException(
"Error matching fieldBinding.");
}
} else {
field = (JField) typeMap.get(fieldBinding);
}
curRef = new JFieldRef(info, curRef, field, currentClass);
if (x.otherGenericCasts != null && x.otherGenericCasts[i] != null) {
JType castType = (JType) typeMap.get(x.otherGenericCasts[i]);
curRef = maybeCast(castType, curRef);
}
}
}