
|
If you were logged in you would be able to see more operations.
|
|
|
groovy
Created: 11/Jul/08 01:44 AM
Updated: 11/Jul/08 03:07 AM
|
|
| Component/s: |
None
|
| Affects Version/s: |
None
|
| Fix Version/s: |
None
|
|
The following code produces "Repetitive method name/signature" error.
public abstract class A {
abstract protected void doIt()
}
class B extends A {
void doIt() {}
}
new ProxyGenerator(debug:true).instantiateDelegateWithBaseClass([:], [], new B())
After removing "protected" modifier it works properly.
Full output:
proxy source:
------------------
import org.codehaus.groovy.runtime.InvokerHelper
class B_delegateProxy extends B {
private delegate
private closureMap
B_delegateProxy(map, delegate) {
this.closureMap = map
this.delegate = delegate
}
void doIt() {
Object[] args = []
InvokerHelper.invokeMethod(delegate, 'doIt', args)
}
void doIt() {
Object[] args = []
InvokerHelper.invokeMethod(delegate, 'doIt', args)
} }
}
new B_delegateProxy(map, delegate)
------------------
Exception thrown: groovy.lang.GroovyRuntimeException: Error creating proxy: startup failed, Script1.groovy: 9: Repetitive method name/signature for method 'void doIt()' in class 'B_delegateProxy'.
@ line 9, column 5.Script1.groovy: 13: Repetitive method name/signature for method 'void doIt()' in class 'B_delegateProxy'.
@ line 13, column 5.
2 errors
|
|
Description
|
The following code produces "Repetitive method name/signature" error.
public abstract class A {
abstract protected void doIt()
}
class B extends A {
void doIt() {}
}
new ProxyGenerator(debug:true).instantiateDelegateWithBaseClass([:], [], new B())
After removing "protected" modifier it works properly.
Full output:
proxy source:
------------------
import org.codehaus.groovy.runtime.InvokerHelper
class B_delegateProxy extends B {
private delegate
private closureMap
B_delegateProxy(map, delegate) {
this.closureMap = map
this.delegate = delegate
}
void doIt() {
Object[] args = []
InvokerHelper.invokeMethod(delegate, 'doIt', args)
}
void doIt() {
Object[] args = []
InvokerHelper.invokeMethod(delegate, 'doIt', args)
} }
}
new B_delegateProxy(map, delegate)
------------------
Exception thrown: groovy.lang.GroovyRuntimeException: Error creating proxy: startup failed, Script1.groovy: 9: Repetitive method name/signature for method 'void doIt()' in class 'B_delegateProxy'.
@ line 9, column 5.Script1.groovy: 13: Repetitive method name/signature for method 'void doIt()' in class 'B_delegateProxy'.
@ line 13, column 5.
2 errors |
Show » |
| There are no comments yet on this issue.
|
|