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: | Error hint for incompatible types - change declaration | ||
---|---|---|---|
Product: | java | Reporter: | markiewb |
Component: | Hints | Assignee: | Svata Dedic <sdedic> |
Status: | NEW --- | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 7.3 | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: | Shows the current state, only error hint "add cast" |
Description
markiewb
2013-03-16 07:03:43 UTC
Created attachment 132671 [details]
Shows the current state, only error hint "add cast"
Do you think the user expects that the result will be (again) uncompilable because otherMethod() declared return type does not match the method's body? (In reply to Svata Dedic from comment #2) > Do you think the user expects that the result will be (again) uncompilable > because otherMethod() declared return type does not match the method's body? Sorry, Svata. I do not understand, what you mean. Here are the expected results a) fixable hint: cast ... to Set <code> public class NewClass { Set var; public void method() { var=(Set) otherMethod(); //fixed } public Date otherMethod() { return new Date(); } } </code> b) fixable hint: change declaration type of "var" to java.util.Date <code> public class NewClass { java.util.Date var; public void method() { var=otherMethod(); //fixed } public Date otherMethod() { return new Date(); } } </code> |