### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: model/org/eclipse/jdt/internal/core/util/BindingKeyParser.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/BindingKeyParser.java,v retrieving revision 1.42 diff -u -r1.42 BindingKeyParser.java --- model/org/eclipse/jdt/internal/core/util/BindingKeyParser.java 21 Jan 2011 07:16:33 -0000 1.42 +++ model/org/eclipse/jdt/internal/core/util/BindingKeyParser.java 10 May 2011 10:17:14 -0000 @@ -445,6 +445,8 @@ private boolean hasTypeName = true; private boolean isMalformed; + + private boolean isParsingThrownExceptions = false; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=336451 public BindingKeyParser(BindingKeyParser parser) { this(""); //$NON-NLS-1$ @@ -652,7 +654,7 @@ malformedKey(); return; } - } else if (this.scanner.isAtTypeVariableStart()) { + } else if (!this.isParsingThrownExceptions && this.scanner.isAtTypeVariableStart()) { parseTypeVariable(); } else if (this.scanner.isAtWildcardStart()) { parseWildcard(); @@ -842,6 +844,7 @@ while (this.scanner.isAtThrownStart() && !this.isMalformed) { this.scanner.skipThrownStart(); BindingKeyParser parser = newParser(); + parser.isParsingThrownExceptions = true; parser.parse(); consumeParser(parser); consumeException(); #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/model/BindingKeyTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/BindingKeyTests.java,v retrieving revision 1.44 diff -u -r1.44 BindingKeyTests.java --- src/org/eclipse/jdt/core/tests/model/BindingKeyTests.java 6 Jan 2011 19:58:49 -0000 1.44 +++ src/org/eclipse/jdt/core/tests/model/BindingKeyTests.java 10 May 2011 10:17:17 -0000 @@ -639,4 +639,26 @@ "LNullBinding~One<[LNullBinding~Outer.Inner;>;" ); } + /* + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=336451 + * Make sure that the binding obtained is a type binding corresponding to the + * method type variables + */ + public void test057() { + assertBindingKeySignatureEquals( + "TT;", + "LEclipseTest$InvokerIF;.invoke(TT;)TT;|Ljava/lang/RuntimeException;:TT;" + ); + } + /* + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=336451 + * Make sure that the binding obtained is a type binding corresponding to the + * method type variables. In this case method has 2 exceptions and 2 type variables. + */ + public void test058() { + assertBindingKeySignatureEquals( + "TT;", + "LEclipseTest$InvokerIF;.invoke(TT;)TT;|Ljava/lang/RuntimeException;|Ljava/lang/IndexOutOfBoundsException;:TT;" + ); + } }