[GRADLE-488] TestNGOptions propertyMissing and methodMissing returns null if suiteXmlBuilder is null. Created: 19/May/09  Updated: 04/Jan/13  Resolved: 20/May/09

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 0.6

Type: Bug
Reporter: Hans Dockter Assignee: Tom Eyckmans
Resolution: Fixed Votes: 0


 Description   
public def propertyMissing(String name) {
        if ( suiteXmlBuilder != null ) {
            return suiteXmlBuilder.getMetaClass()."${name}"
        }
        else {
            super.propertyMissing(name)
        }
    }

    public def methodMissing(String name, args) {
        if ( suiteXmlBuilder != null ) {
            return suiteXmlBuilder.getMetaClass().invokeMethod(suiteXmlBuilder, name, args);
        }
        else {
            super.methodMissing(name, args)
        }
    }

The else value won't be used by Groovy as the return value. Thus the methods returns null in the else case. In Groovy 1.6 this behavior has changed (but we are still with 1.5.6). The code fix is obvious but we should also have a unit test checking this.


Generated at Wed Jun 30 11:31:21 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.