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.
The Hint System "try-catch" feature doesn't work at all when used in a class outside of a method, ie: public class Main { String FileName = "new.txt"; File fr = new File(FileName); |FileOutputStream fo = new FileOutputStream(fr); ... Error annotation is displayed properly, but no hint is aviable (See attached screenshot). Inside of a method, try-catch hint works fine. This may be related to issue 61967 (Caused by the fix?)
Created attachment 23715 [details] screenshot
Changing it to enhancement. Could be solved via initializer, like this: class smtg { String FileName = "new.txt"; File fr = new File(FileName); FileOutputStream fo; { try { fo = new FileOutputStream(fr); } catch (FileNotFoundException ex) { ex.printStackTrace(); } } } I can also use "Surround with Try-Catch" inside an initializer, but no hint is aviable there.