| Summary: | IMethodBinding.overrides(IMethodBinding) | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Mathieu N <mathieu_5656> |
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | stephan.herrmann |
| Version: | 4.8 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 10 | ||
| Whiteboard: | stalebug | ||
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. Going by the letter, yes, the method's javadoc claims to conform to JLS 8.4.8.1, which doesn't apply to constructors. @Mathieu, can you additionally motivate why this would be practically relevant? Since this is long standing behavior, I'd prefer not to change the implementation unless it causes actual problems. We might instead add a hint that this method should not be applied for constructors. |
IMethodBinding.overrides(IMethodBinding) returns true on constructors with similar arguments. Consider this code, class Foo { public Foo(short x) { } } class Bug extends Foo { public Bug(short x) { super(x); } } After obtaining the IMethodBinding for the constructor of Bug, calling methodBinding.overrides(methodBinding.getDeclaringClass().getSuperclass().getDeclaredMethods()[0]) returns true. According to JLS3 8.4.8.1, only instance methods (i.e., not constructors) can override another method.