Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 522327 - [9] Bogus error "No exception of type IOException can be thrown"
Summary: [9] Bogus error "No exception of type IOException can be thrown"
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.8   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: BETA J9   Edit
Assignee: Till Brychcy CLA
QA Contact: Stephan Herrmann CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-14 15:11 EDT by Till Brychcy CLA
Modified: 2019-05-10 17:56 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Till Brychcy CLA 2017-09-14 15:11:08 EDT
Given the following code in a java 9 project without module-info.java:

package nonmodular;

import java.io.IOException;
import java.sql.SQLException;

public class ProblemWithThrowable {
    public void saveProperties() throws IOException {
    }
}

The following bogus error is reported:

----------
1. ERROR in nonmodular\ProblemWithThrowable.java (at line 7)
	public void saveProperties() throws IOException {
	                                    ^^^^^^^^^^^
No exception of type IOException can be thrown; an exception type must be a subclass of Throwable
----------
Comment 1 Stephan Herrmann CLA 2017-09-14 15:28:40 EDT
Reproduced
Comment 2 Eclipse Genie CLA 2017-09-15 16:33:47 EDT
New Gerrit change created: https://git.eclipse.org/r/105254
Comment 3 Stephan Herrmann CLA 2017-09-16 10:00:33 EDT
+1

Will merge once the rebased hudson build approves.
Comment 5 Till Brychcy CLA 2017-09-16 14:19:15 EDT
(In reply to Stephan Herrmann from comment #3)
> +1
> 
> Will merge once the rebased hudson build approves.

Thanks for taking a look. I've merged so I could rebase the patch for 522398.(In reply to Eclipse Genie from comment #4)
> Gerrit change https://git.eclipse.org/r/105254 was merged to [BETA_JAVA9].
> Commit:
> http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/
> ?id=ac3e5d5ce47edc6a64f2f6e3bf5db4952cedca2f

Released for BETA J9