[Codenarc-developer] (no subject)
Brought to you by:
chrismair
From: Brian S. <bri...@ta...> - 2014-01-29 18:45:23
|
Hi all, I'm working on a mass assignment rule ( http://sourceforge.net/p/codenarc/feature-requests/392/) and I can't seem to get type or interface based detection to work. Here's my test code: public interface GrailsDomainClass {} class Person implements GrailsDomainClass { String name Boolean isAdmin } params = [name: 'John', isAdmin: true] def person = new Person(params) Ideally, I'd 1) visit the Person constructor 2) Check that it implements GrailsDomainClass 3) and check that the parameter implements java.util.Map. Unfortunately, getInterfaces()/getAllInterfaces() seems to always return an empty set. I've resorted to checking for a variable named "params" but that seems too fragile. Is there anything I can do to have more robust type and interface information available? Thanks -Brian Soby |