{"action":"created","issue":{"url":"https://api.github.com/repos/cloudbees/groovy-cps/issues/26","repository_url":"https://api.github.com/repos/cloudbees/groovy-cps","labels_url":"https://api.github.com/repos/cloudbees/groovy-cps/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/cloudbees/groovy-cps/issues/26/comments","events_url":"https://api.github.com/repos/cloudbees/groovy-cps/issues/26/events","html_url":"https://github.com/cloudbees/groovy-cps/issues/26","id":162133534,"number":26,"title":"Interfaces cannot be declared","user":{"login":"Fiouz","id":393371,"avatar_url":"https://avatars.githubusercontent.com/u/393371?v=3","gravatar_id":"","url":"https://api.github.com/users/Fiouz","html_url":"https://github.com/Fiouz","followers_url":"https://api.github.com/users/Fiouz/followers","following_url":"https://api.github.com/users/Fiouz/following{/other_user}","gists_url":"https://api.github.com/users/Fiouz/gists{/gist_id}","starred_url":"https://api.github.com/users/Fiouz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fiouz/subscriptions","organizations_url":"https://api.github.com/users/Fiouz/orgs","repos_url":"https://api.github.com/users/Fiouz/repos","events_url":"https://api.github.com/users/Fiouz/events{/privacy}","received_events_url":"https://api.github.com/users/Fiouz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-06-24T12:07:30Z","updated_at":"2016-07-13T17:14:41Z","closed_at":"2016-07-13T17:14:41Z","body":"Declaring an interface breaks CPS compilation, this prevents basic OOP design in scripts\r\n\r\n```groovy\r\n            interface Strategy {\r\n                Closure process(Object event)\r\n            }\r\n            return true\r\n```\r\n```\r\njava.lang.NullPointerException: Cannot invoke method visit() on null object\r\n        at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:77)\r\n        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)\r\n        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)\r\n        at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:32)\r\n        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)\r\n        at org.codehaus.groovy.ast.stmt.BlockStatement$visit.call(Unknown Source)\r\n        at com.cloudbees.groovy.cps.CpsTransformer.visitMethod(CpsTransformer.groovy:166)\r\n        at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)\r\n        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n        at java.lang.reflect.Method.invoke(Method.java:498)\r\n        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)\r\n        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)\r\n        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:361)\r\n        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)\r\n        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)\r\n        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)\r\n        at com.cloudbees.groovy.cps.CpsTransformer$_call_closure1.doCall(CpsTransformer.groovy:95)\r\n        at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)\r\n        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n        at java.lang.reflect.Method.invoke(Method.java:498)\r\n        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)\r\n        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)\r\n        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)\r\n        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)\r\n        at groovy.lang.Closure.call(Closure.java:415)\r\n        at groovy.lang.Closure.call(Closure.java:428)\r\n        at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1379)\r\n        at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1351)\r\n        at org.codehaus.groovy.runtime.DefaultGroovyMethods$each.call(Unknown Source)\r\n        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)\r\n        at org.codehaus.groovy.runtime.DefaultGroovyMethods$each.call(Unknown Source)\r\n        at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.each(CpsDefaultGroovyMethods.groovy:26)\r\n        at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)\r\n        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n        at java.lang.reflect.Method.invoke(Method.java:498)\r\n        at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:51)\r\n        at org.codehaus.groovy.runtime.metaclass.NewInstanceMetaMethod.invoke(NewInstanceMetaMethod.java:54)\r\n        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)\r\n        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)\r\n        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)\r\n        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callSafe(AbstractCallSite.java:82)\r\n        at com.cloudbees.groovy.cps.CpsTransformer.call(CpsTransformer.groovy:95)\r\n        at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:970)\r\n        at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:548)\r\n        at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:526)\r\n        at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:503)\r\n        at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:302)\r\n        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:281)\r\n        at groovy.lang.GroovyShell.parseClass(GroovyShell.java:731)\r\n        at groovy.lang.GroovyShell.parse(GroovyShell.java:743)\r\n        at groovy.lang.GroovyShell.parse(GroovyShell.java:770)\r\n        at groovy.lang.GroovyShell.parse(GroovyShell.java:761)\r\n        at groovy.lang.GroovyShell$parse.call(Unknown Source)\r\n```\r\n\r\nIf the interface is empty, the exception is slightly different:\r\n```groovy\r\n            interface Empty {}\r\n            return true\r\n```\r\n```\r\nScript1.groovy: -1: The field '__timeStamp' is not 'public static final' but is defined in interface 'Empty'.\r\n @ line -1, column -1.\r\n1 error\r\n\r\n        at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302)\r\n        at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:997)\r\n        at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:548)\r\n        at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:526)\r\n        at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:503)\r\n        at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:302)\r\n        at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:281)\r\n        at groovy.lang.GroovyShell.parseClass(GroovyShell.java:731)\r\n        at groovy.lang.GroovyShell.parse(GroovyShell.java:743)\r\n        at groovy.lang.GroovyShell.parse(GroovyShell.java:770)\r\n        at groovy.lang.GroovyShell.parse(GroovyShell.java:761)\r\n        at groovy.lang.GroovyShell$parse.call(Unknown Source)\r\n```"},"comment":{"url":"https://api.github.com/repos/cloudbees/groovy-cps/issues/comments/232423381","html_url":"https://github.com/cloudbees/groovy-cps/issues/26#issuecomment-232423381","issue_url":"https://api.github.com/repos/cloudbees/groovy-cps/issues/26","id":232423381,"user":{"login":"kohsuke","id":50003,"avatar_url":"https://avatars.githubusercontent.com/u/50003?v=3","gravatar_id":"","url":"https://api.github.com/users/kohsuke","html_url":"https://github.com/kohsuke","followers_url":"https://api.github.com/users/kohsuke/followers","following_url":"https://api.github.com/users/kohsuke/following{/other_user}","gists_url":"https://api.github.com/users/kohsuke/gists{/gist_id}","starred_url":"https://api.github.com/users/kohsuke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kohsuke/subscriptions","organizations_url":"https://api.github.com/users/kohsuke/orgs","repos_url":"https://api.github.com/users/kohsuke/repos","events_url":"https://api.github.com/users/kohsuke/events{/privacy}","received_events_url":"https://api.github.com/users/kohsuke/received_events","type":"User","site_admin":false},"created_at":"2016-07-13T17:14:41Z","updated_at":"2016-07-13T17:14:41Z","body":"This issue is fixed now."}}
{"actor":{"display_login":"kohsuke"}}