for (PropertyNode propertyNode : declaringClass.getProperties()) {
if (propertyNode.getName().equals(fieldName)) {
if (field.isStatic()) {
//noinspection ThrowableInstanceNeverThrown
source.getErrorCollector().addErrorAndContinue(
new SyntaxErrorMessage(new SyntaxException(
"@groovy.beans.Bindable cannot annotate a static property.",
node.getLineNumber(),
node.getColumnNumber()),
source));
} else {
if (needsPropertyChangeSupport(declaringClass, source)) {
addPropertyChangeSupport(declaringClass);
}
createListenerSetter(source, node, declaringClass, propertyNode);
}
return;
}
}
//noinspection ThrowableInstanceNeverThrown
source.getErrorCollector().addErrorAndContinue(
new SyntaxErrorMessage(new SyntaxException(
"@groovy.beans.Bindable must be on a property, not a field. Try removing the private, protected, or public modifier.",
node.getLineNumber(),
node.getColumnNumber()),
source));
}