initializer.setSynthetic(true);
element.setInitializer(initializer);
holder.validate();
}
if (element instanceof PropertyInducingElementImpl) {
PropertyInducingElementImpl variable = (PropertyInducingElementImpl) element;
if (inFieldContext) {
((FieldElementImpl) variable).setStatic(matches(
((FieldDeclaration) node.getParent().getParent()).getStaticKeyword(),
Keyword.STATIC));
}
PropertyAccessorElementImpl getter = new PropertyAccessorElementImpl(variable);
getter.setGetter(true);
currentHolder.addAccessor(getter);
variable.setGetter(getter);
if (!isFinal) {
PropertyAccessorElementImpl setter = new PropertyAccessorElementImpl(variable);
setter.setSetter(true);
ParameterElementImpl parameter = new ParameterElementImpl(
"_" + variable.getName(),
variable.getNameOffset());
parameter.setSynthetic(true);
parameter.setParameterKind(ParameterKind.REQUIRED);
setter.setParameters(new ParameterElement[] {parameter});
currentHolder.addAccessor(setter);
variable.setSetter(setter);
}
}
return null;
}