Permalink
Browse files

only creates null safe setters in the annotated class

  • Loading branch information...
1 parent 32e7475 commit 98830fbe2f7c2b2e16991cefcc9442071a8e427e @musketyr musketyr committed Aug 28, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 core/src/main/groovyx/gaelyk/datastore/EntityTransformation.groovy
@@ -45,6 +45,7 @@ import org.codehaus.groovy.ast.stmt.IfStatement;
import org.codehaus.groovy.ast.stmt.ReturnStatement
import org.codehaus.groovy.control.CompilePhase
import org.codehaus.groovy.control.SourceUnit
+import org.codehaus.groovy.control.messages.WarningMessage;
import org.codehaus.groovy.syntax.SyntaxException
import org.codehaus.groovy.syntax.Token;
import org.codehaus.groovy.syntax.Types;
@@ -398,6 +399,11 @@ class EntityTransformation extends AbstractASTTransformation {
return
}
+ if(parent != property.declaringClass) {
+ // it needs to be property of the declaring class
+ return
+ }
+
parent.addMethod new MethodNode(
name,
Modifier.PUBLIC,

0 comments on commit 98830fb

Please sign in to comment.