### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/model/CompletionTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java,v retrieving revision 1.146 diff -u -r1.146 CompletionTests.java --- src/org/eclipse/jdt/core/tests/model/CompletionTests.java 15 Feb 2007 14:52:05 -0000 1.146 +++ src/org/eclipse/jdt/core/tests/model/CompletionTests.java 15 Feb 2007 15:02:08 -0000 @@ -1110,6 +1110,41 @@ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); assertResults( + "IZZBException[TYPE_REF]{IZZBException, test, Ltest.IZZBException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}\n" + + "IZZException[TYPE_REF]{IZZException, test, Ltest.IZZException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}", + requestor.getResults()); +} +public void testCatchClauseExceptionRef13b() throws JavaModelException { + this.workingCopies = new ICompilationUnit[1]; + this.workingCopies[0] = getWorkingCopy( + "/Completion/src/test/Test.java", + "package test;"+ + "class IZZAException extends Exception {\n" + + "}\n" + + "class IZZBException extends Exception {\n" + + "}\n" + + "class IZZException extends IZZAException {\n" + + "}\n" + + "public class Test {\n" + + " public void throwing() throws IZZException {}\n" + + " public void foo() {\n" + + " try {\n" + + " throwing();\n" + + " }\n" + + " catch (IZZAException e) {\n" + + " }\n" + + " catch (IZZ) {\n" + + " }\n" + + " }" + + "}\n"); + + CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); + String str = this.workingCopies[0].getSource(); + String completeBehind = "IZZ"; + int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); + this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); + + assertResults( "IZZBException[TYPE_REF]{IZZBException, test, Ltest.IZZBException;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXCEPTION + R_NON_RESTRICTED) + "}", requestor.getResults()); } #P org.eclipse.jdt.core Index: buildnotes_jdt-core.html =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/buildnotes_jdt-core.html,v retrieving revision 1.5697 diff -u -r1.5697 buildnotes_jdt-core.html --- buildnotes_jdt-core.html 15 Feb 2007 14:52:12 -0000 1.5697 +++ buildnotes_jdt-core.html 15 Feb 2007 15:02:11 -0000 @@ -52,7 +52,9 @@

What's new in this drop

Problem Reports Fixed

-174001 +174002 +[assist] Exceptions which are already covered by the another exception are proposed +
174001 [assist] Unexpected types are proposed inside catch block
149154 BinaryMethod#getParameterNames() should not try to extract from attached javadoc for synthetics Index: codeassist/org/eclipse/jdt/internal/codeassist/ThrownExceptionFinder.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/ThrownExceptionFinder.java,v retrieving revision 1.2 diff -u -r1.2 ThrownExceptionFinder.java --- codeassist/org/eclipse/jdt/internal/codeassist/ThrownExceptionFinder.java 13 Feb 2007 08:54:00 -0000 1.2 +++ codeassist/org/eclipse/jdt/internal/codeassist/ThrownExceptionFinder.java 15 Feb 2007 15:02:13 -0000 @@ -125,7 +125,20 @@ for (int i = 0; i < length; i++) { TypeBinding exception = catchArguments[i].type.resolvedType; if (exception != null && exception.isValidBinding()) { - this.thrownExceptions.remove(exception); + this.removeCaughtException((ReferenceBinding)exception); + + } + } + } + + private void removeCaughtException(ReferenceBinding caughtException) { + Object[] exceptions = this.thrownExceptions.values; + for (int i = 0; i < exceptions.length; i++) { + ReferenceBinding exception = (ReferenceBinding)exceptions[i]; + if (exception != null) { + if (exception == caughtException || caughtException.isSuperclassOf(exception)) { + this.thrownExceptions.remove(exception); + } } } } Index: codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java,v retrieving revision 1.319 diff -u -r1.319 CompletionEngine.java --- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 15 Feb 2007 14:52:12 -0000 1.319 +++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 15 Feb 2007 15:02:13 -0000 @@ -2293,11 +2293,6 @@ ObjectVector typesFound, boolean searchSuperClasses) { - if (isForbidden(exceptionType)) { - this.knownTypes.put(CharOperation.concat(exceptionType.qualifiedPackageName(), exceptionType.qualifiedSourceName(), '.'), this); - return; - } - if (searchSuperClasses) { ReferenceBinding javaLangThrowable = scope.getJavaLangThrowable(); if (exceptionType != javaLangThrowable) {