Changeset 575

Show
Ignore:
Timestamp:
16-06-10 16:29:11 (4 years ago)
Author:
keesvb
Message:

additional fix for #114, unneccesary complex invoke of giveDomainFields() in template editor

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/studycapturing/TemplateEditorController.groovy

    r571 r575  
    6565        if( selectedTemplate ) { 
    6666            template = Template.get( selectedTemplate ); 
    67  
    68                         // Find the domain classes for this template/entity 
    69                         // See http://www.javaworld.com/javaworld/javaqa/1999-07/06-qa-invoke.html 
    70                         Method m = template.entity.getDeclaredMethod("giveDomainFields", null); 
    71                         domainFields = m.invoke( null, null ); 
     67                        domainFields = template.entity.giveDomainFields(); 
    7268        } else { 
    7369                        redirect(action:"index",params:[entity:params.entity]) 
     
    252248 
    253249                // See whether this exists as domain field. If it does, raise an error 
    254                 Method m = template.entity.getDeclaredMethod("giveDomainFields", null); 
    255                 def domainFields = m.invoke( null, null ); 
     250                def domainFields = template.entity.giveDomainFields() 
    256251                if( domainFields.find { it.name.toLowerCase() == params.name.toLowerCase() } ) { 
    257252                        response.status = 500;