boolean isInGetterContext = node.inGetterContext();
boolean isInSetterContext = node.inSetterContext();
if (isInGetterContext && isInSetterContext) {
// lookup setter
MethodElement setterStaticMethod = lookUpMethod(target, staticType, setterMethodName);
MethodElement setterPropagatedMethod = lookUpMethod(target, propagatedType, setterMethodName);
// set setter element
node.setStaticElement(setterStaticMethod);
node.setPropagatedElement(setterPropagatedMethod);
// generate undefined method warning
checkForUndefinedIndexOperator(
node,
target,
getterMethodName,
setterStaticMethod,
setterPropagatedMethod,
staticType,
propagatedType);
// lookup getter method
MethodElement getterStaticMethod = lookUpMethod(target, staticType, getterMethodName);
MethodElement getterPropagatedMethod = lookUpMethod(target, propagatedType, getterMethodName);
// set getter element
AuxiliaryElements auxiliaryElements = new AuxiliaryElements(
getterStaticMethod,
getterPropagatedMethod);
node.setAuxiliaryElements(auxiliaryElements);
// generate undefined method warning
checkForUndefinedIndexOperator(
node,
target,
getterMethodName,
getterStaticMethod,
getterPropagatedMethod,
staticType,
propagatedType);
} else if (isInGetterContext) {
// lookup getter method
MethodElement staticMethod = lookUpMethod(target, staticType, getterMethodName);
MethodElement propagatedMethod = lookUpMethod(target, propagatedType, getterMethodName);
// set getter element
node.setStaticElement(staticMethod);
node.setPropagatedElement(propagatedMethod);
// generate undefined method warning
checkForUndefinedIndexOperator(
node,
target,
getterMethodName,
staticMethod,
propagatedMethod,
staticType,
propagatedType);
} else if (isInSetterContext) {
// lookup setter method
MethodElement staticMethod = lookUpMethod(target, staticType, setterMethodName);
MethodElement propagatedMethod = lookUpMethod(target, propagatedType, setterMethodName);
// set setter element
node.setStaticElement(staticMethod);
node.setPropagatedElement(propagatedMethod);
// generate undefined method warning
checkForUndefinedIndexOperator(