|
From: Dominik R. <re...@bu...> - 2011-07-31 17:46:48
|
New submission from Dominik Roblek <do...@ke...>:
I have a Java interface:
---
public interface JavaInterface {
Object add(Object a, Object b);
void multiply(Object a, Object b);
}
---
I also have a Jython implementation which implements only the "add" method, but not the "multiply" method:
---
class JythonImpl(JavaInterface):
def __init__ (self):
pass
def add(self, a, b):
return a + b
if __name__ == "__main__":
jythonClass = JythonImpl()
try:
print jythonClass.multiply(10, 20)
except Exception, e:
print e
---
The 'jythonClass.multiply(10, 20)' statement above should throw an 'abstract method "multiply" not implemented' exception, but it doesn't when using Jython 2.5.*. Instead it returns None.
The old Jython 2.2.1 did throw the mentioned exception in such case.
----------
components: None
messages: 6592
nosy: dominik
severity: normal
status: open
title: No exception thrown when calling not-implemented Java interface method
type: behaviour
versions: 2.5.0, 2.5.1, 2.5.2, 2.5.2b1, 2.5.2rc, 2.5b0, 2.5b1
_______________________________________
Jython tracker <re...@bu...>
<http://bugs.jython.org/issue1785>
_______________________________________
|