Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 403924 - [1.8] Replace usages of MethodDeclaration#thrownExceptions() in the AST
Summary: [1.8] Replace usages of MethodDeclaration#thrownExceptions() in the AST
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: BETA J8   Edit
Assignee: Noopur Gupta CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 407056 409520
  Show dependency tree
 
Reported: 2013-03-20 13:29 EDT by Markus Keller CLA
Modified: 2013-10-24 16:05 EDT (History)
3 users (show)

See Also:
markus.kell.r: review+


Attachments
Patch (62.26 KB, patch)
2013-04-03 07:04 EDT, Noopur Gupta CLA
no flags Details | Diff
Updated Patch (59.00 KB, patch)
2013-09-24 08:42 EDT, Noopur Gupta CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2013-03-20 13:29:35 EDT
Replace usages of MethodDeclaration#thrownExceptions() in the AST.

For jsr308, MethodDeclaration's thrownExceptions property has been replaced with thrownExceptionTypes. Make a pass over all JDT UI code that uses the old property in any way (direct access or via property descriptor) and update usages.

File separate bugs if things get too complicated somewhere or if you think we should add new features for handling these constructs.
Comment 1 Noopur Gupta CLA 2013-04-03 07:04:57 EDT
Created attachment 229281 [details]
Patch

The attached patch updates the usages of old 'thrownExceptions' property of MethodDeclaration in JDT UI code, except the usage in ExceptionOccurrencesFinder.
Comment 2 Noopur Gupta CLA 2013-09-24 08:42:06 EDT
Created attachment 235754 [details]
Updated Patch

Updated the patch with JUnit fixes for thrownExceptionTypes.
Comment 3 Markus Keller CLA 2013-10-24 16:05:36 EDT
In a few places, you replaced
 ASTNodeFactory.newName(fAST, fImportRewriter.addImport(exceptionType, context))
with
 ASTNodeFactory.newType(fAST, fImportRewriter.addImport(exceptionType, context))

The original code was a kludge from times before ImportRewrite could take an AST. I used the better replacement
 fImportRewriter.addImport(exceptionType, fAST, context)

Fixed with http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=c11b26a1362f47a11287b295af6e00b350648613


http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=4cfd5392c2e3139a9903acc170a1fb06f3bc06c8 doesn't look completely correct. The revert of ChangeMethodSignatureProposal is good, although this could break again when ImportRewrite considers annotations.

JavadocTagsSubProcessor/LocalCorrectionsSubProcessor only worked for un-annotated types. A Javadoc @throws tag cannot contain annotations.

Fixed with http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=83079ba6f0bba9525f7776d99c306db57c54d2c0