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.
<code> public class NewClass { Set var; public void method() { var=otherMethod(); // error is here so open quickfix } public Date otherMethod() { return new Date(); } } </code> The dev could solve the error by * casting OR * changing the declaration But only a casting hint is shown ACTUAL: * fixable hint: cast ... to Set EXPECTED: * fixable hint: cast ... to Set * fixable hint: change declaration type of "var" to java.util.Date
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>