This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Wrong hint "Unnecessary cast to T" ("Typecast is too strong") for overloaded methods (leads to ambiguous calls) | ||
---|---|---|---|
Product: | java | Reporter: | xehpuk |
Component: | Hints | Assignee: | Svata Dedic <sdedic> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 8.0 | ||
Hardware: | PC | ||
OS: | Windows 8 | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
xehpuk
2014-03-13 11:21:32 UTC
Also happens with constructors: public class LoginWindow extends JDialog { public LoginWindow() { super((Frame) null); // "Unnecessary cast to Frame" (NetBeans 8.0.2) } } Also, after removing the cast, the error message suggests there are only two matching constructors ("both constructor JDialog(Frame) in JDialog and constructor JDialog(Dialog) in JDialog match") while there are actually three (the third one being JDialog(Window)), so maybe the error message could be extended. As for the error, it would be nice if there would be a hint with fixing options, e. g. "cast to Frame", "cast to Dialog", "cast to Window" so one can just click the desired type. Duplicate -- method call resolution now detects ambiguity of the result. *** This bug has been marked as a duplicate of bug 250627 *** |