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.

Bug 250607

Summary: Unable to do "Fix code" to add throws clause for unreported exception
Product: java Reporter: terje7601
Component: HintsAssignee: Svata Dedic <sdedic>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 8.0.2   
Hardware: PC   
OS: Other   
Issue Type: DEFECT Exception Reporter:

Description terje7601 2015-02-22 08:22:09 UTC
With the code below, I'm unable to hit Alt+Enter & be able to select the "Add throws clause" option to automatically add the possible IOException to the throws clause.


import java.io.InputStreamReader;
import java.io.Reader;
import static java.nio.charset.StandardCharsets.UTF_8;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;

public class Nashorn {
	
	public static void main(String[] args) throws ScriptException {
		try(Reader in = new InputStreamReader(Nashorn.class.getResourceAsStream("nashorn.js"), UTF_8)) {
			new ScriptEngineManager().getEngineByName("nashorn").eval(in);
		}
	}
	
}
Comment 1 Svata Dedic 2015-04-15 12:34:30 UTC
Fixed in jet-main#d4d51ea9cfd7
Comment 2 Quality Engineering 2015-04-23 02:10:36 UTC
Integrated into 'main-silver', will be available in build *201504230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/d4d51ea9cfd7
User: Svata Dedic <sdedic@netbeans.org>
Log: #250607: Added support for exceptions from implicit close() method