Bug 180082 - API breakage: IClassFile.getType no longer throws JavaModelException
Summary: API breakage: IClassFile.getType no longer throws JavaModelException
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M7   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-29 17:31 EDT by Steve Francisco CLA
Modified: 2007-03-29 22:26 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Francisco CLA 2007-03-29 17:31:07 EDT
The method org.eclipse.jdt.core.IClassFile.getType() method used to be defined as throwing JavaModelException.  Code exists that make use of this method, and that code no longer compiles with error messages similar to this:
>> 37. ERROR in /some/path/SomeClass.java  (at line 2306)
>>		 } catch (JavaModelException e) {
>>		          ^^^^^^^^^^^^^^^^^^
>> Unreachable catch block for JavaModelException. This exception is never thrown >> from the try statement body

This seems like an unintentional API change to the getType method that appeared between M5 and M6 of Eclipse 3.3.  Can the throws statement be put back to avoid these errors?
Comment 1 Olivier Thomann CLA 2007-03-29 19:04:53 EDT
This is a consequence of fix for bug 154667.
You need to remove the try/catch.
Closing as WONTFIX.
Comment 2 Steve Francisco CLA 2007-03-29 22:26:55 EDT
Thanks for clarifying the API change rules.  We'll remove the catch and move on.