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 - Unable to do "Fix code" to add throws clause for unreported exception
Summary: Unable to do "Fix code" to add throws clause for unreported exception
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0.2
Hardware: PC Other
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-22 08:22 UTC by terje7601
Modified: 2015-04-23 02:10 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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