Issue2407

classification
Title: Unimplemented abstract methods should raise a more detailed exception
Type: Severity: normal
Components: Versions:
Milestone: Jython 2.7.1
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: zyasoft Nosy List: zyasoft
Priority: Keywords:

Created on 2015-09-29.03:46:35 by zyasoft, last changed 2015-10-01.18:19:37 by zyasoft.

Messages
msg10300 (view) Author: Jim Baker (zyasoft) Date: 2015-09-29.03:46:34
Not implementing an abstract method from an abstract class or interface in Java currently raises a NotImplementedError exception. However, it does not specify the offending type, method, or object, which makes debugging extremely difficult.

At the very least, we should provide the same level of detail as AttributeError on objects.

>>> from javax.servlet.http import HttpServletResponse
>>> class MockResponse(HttpServletResponse): pass
...

Compare

>>> x = MockResponse()
>>> x.getOutputStream()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NotImplementedError

vs

>>> x.getBaz()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'MockResponse' object has no attribute 'getBaz'
msg10303 (view) Author: Jim Baker (zyasoft) Date: 2015-10-01.18:19:36
Fixed as of https://hg.python.org/jython/rev/62f6901dc1ee
History
Date User Action Args
2015-10-01 18:19:37zyasoftsetstatus: open -> closed
resolution: fixed
messages: + msg10303
2015-09-29 03:46:35zyasoftcreate