Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 1801 Details for
Bug 22196
Quick Fix broken due to bug 21768 [quick fix]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch for add throw decl. quick fix
patch-22196.txt (text/plain), 2.32 KB, created by
Martin Aeschlimann
on 2002-08-06 12:38:11 EDT
(
hide
)
Description:
patch for add throw decl. quick fix
Filename:
MIME Type:
Creator:
Martin Aeschlimann
Created:
2002-08-06 12:38:11 EDT
Size:
2.32 KB
patch
obsolete
>Index: LocalCorrectionsSubProcessor.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java,v >retrieving revision 1.12 >diff -u -r1.12 LocalCorrectionsSubProcessor.java >--- LocalCorrectionsSubProcessor.java 11 Jun 2002 10:58:34 -0000 1.12 >+++ LocalCorrectionsSubProcessor.java 6 Aug 2002 16:34:49 -0000 >@@ -1,6 +1,7 @@ > package org.eclipse.jdt.internal.ui.text.correction; > > import java.util.ArrayList; >+import java.util.List; > > import org.eclipse.core.runtime.CoreException; > >@@ -9,6 +10,9 @@ > import org.eclipse.jdt.core.ICompilationUnit; > import org.eclipse.jdt.core.JavaModelException; > import org.eclipse.jdt.core.Signature; >+import org.eclipse.jdt.core.compiler.IScanner; >+import org.eclipse.jdt.core.compiler.ITerminalSymbols; >+import org.eclipse.jdt.core.compiler.InvalidInputException; > import org.eclipse.jdt.core.dom.AST; > import org.eclipse.jdt.core.dom.ASTNode; > import org.eclipse.jdt.core.dom.Assignment; >@@ -148,13 +152,31 @@ > > MethodDeclaration methodDecl= (MethodDeclaration) decl; > SimpleName name= methodDecl.getName(); >+ > int pos= name.getStartPosition() + name.getLength(); >+ > StringBuffer insertString= new StringBuffer(); > if (methodDecl.thrownExceptions().isEmpty()) { > insertString.append(" throws "); //$NON-NLS-1$ >+ try { >+ IScanner scanner= ASTResolving.createScanner(cu, name.getStartPosition()); >+ int nextNoken= scanner.getNextToken(); >+ while (nextNoken != ITerminalSymbols.TokenNameRPAREN) { >+ nextNoken= scanner.getNextToken(); >+ if (nextNoken == ITerminalSymbols.TokenNameEOF) { >+ return; >+ } >+ } >+ pos= scanner.getCurrentTokenEndPosition() + 1; >+ } catch (InvalidInputException e) { >+ return; >+ } > } else { > insertString.append(", "); //$NON-NLS-1$ >- } >+ List thrownExceptions= methodDecl.thrownExceptions(); >+ ASTNode last= (ASTNode) thrownExceptions.get(thrownExceptions.size() - 1); >+ pos= last.getStartPosition() + last.getLength(); >+ } > insertString.append(Signature.getSimpleName(uncaughtName)); > > String label= CorrectionMessages.getString("LocalCorrectionsSubProcessor.addthrows.description"); //$NON-NLS-1$
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 22196
: 1801 |
1805