| Summary: | Throws declaration not enforced anymore? | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | J.F.Lanting <J.F.Lanting> |
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
| Status: | CLOSED INVALID | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | jarthana, Olivier_Thomann |
| Version: | 4.4 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | |||
|
Description
J.F.Lanting
Can you give me an example where you find this problem? This method may show:
/**
* Message can not delete/recycle/trash argument file.
*
* @param f file to be deleted.
* @param operation text for the failure message.
*/
static void cantDeleteFile(File f, String operation)
{
String type = f.isDirectory() ? "DIRECTORY:" : "FILE:";
Object[] options = { "Continue", "Stop" };
int answer;
To.warning();
answer = JOptionPane.showOptionDialog
(
Ui.getMainFrame(),
"<HTML>"
+ "<CENTER>FAILED TO "
+ operation
+ type
+ "</CENTER><CENTER><STRONG STYLE=COLOR:BLUE>"
+ f.getAbsolutePath()
+ "</STRONG></CENTER>",
"FAILURE",
JOptionPane.YES_NO_OPTION,
JOptionPane.WARNING_MESSAGE,
null,
options,
options[0]
);
if(answer == 1)
{
throw new CancelledKeyException();
}
}
Of course only the last lines are of interest.
Thanks for your quick response.
;JOOP!
CancelledKeyException is a runtime exception (unchecked exception). There is no need to add it into the throws clause of the method. Replace it with a checked exception (not under the RuntimeException) and it will work as expected. Apparently I'm not an expert. The thing is: it works. So you may close and I stop worrying. ;JOOP! |