View | Details | Raw Unified | Return to bug 336451 | Differences between
and this patch

Collapse All | Expand All

(-)model/org/eclipse/jdt/internal/core/util/BindingKeyParser.java (-1 / +4 lines)
Lines 445-450 Link Here
445
	private boolean hasTypeName = true;
445
	private boolean hasTypeName = true;
446
446
447
	private boolean isMalformed;
447
	private boolean isMalformed;
448
	
449
	private boolean isParsingThrownExceptions = false;	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=336451
448
450
449
	public BindingKeyParser(BindingKeyParser parser) {
451
	public BindingKeyParser(BindingKeyParser parser) {
450
		this(""); //$NON-NLS-1$
452
		this(""); //$NON-NLS-1$
Lines 652-658 Link Here
652
					malformedKey();
654
					malformedKey();
653
					return;
655
					return;
654
			}
656
			}
655
		} else if (this.scanner.isAtTypeVariableStart()) {
657
		} else if (!this.isParsingThrownExceptions && this.scanner.isAtTypeVariableStart()) {
656
			parseTypeVariable();
658
			parseTypeVariable();
657
		} else if (this.scanner.isAtWildcardStart()) {
659
		} else if (this.scanner.isAtWildcardStart()) {
658
			parseWildcard();
660
			parseWildcard();
Lines 842-847 Link Here
842
		while (this.scanner.isAtThrownStart() && !this.isMalformed) {
844
		while (this.scanner.isAtThrownStart() && !this.isMalformed) {
843
			this.scanner.skipThrownStart();
845
			this.scanner.skipThrownStart();
844
			BindingKeyParser parser = newParser();
846
			BindingKeyParser parser = newParser();
847
			parser.isParsingThrownExceptions = true;
845
			parser.parse();
848
			parser.parse();
846
			consumeParser(parser);
849
			consumeParser(parser);
847
			consumeException();
850
			consumeException();
(-)src/org/eclipse/jdt/core/tests/model/BindingKeyTests.java (+22 lines)
Lines 639-642 Link Here
639
			"LNullBinding~One<[LNullBinding~Outer<Ljava/lang/Integer;>.Inner<Ljava/lang/Double;>;>;"
639
			"LNullBinding~One<[LNullBinding~Outer<Ljava/lang/Integer;>.Inner<Ljava/lang/Double;>;>;"
640
		);
640
		);
641
	}
641
	}
642
	/*
643
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=336451
644
	 * Make sure that the binding obtained is a type binding corresponding to the
645
	 * method type variables
646
	 */
647
	public void test057() {
648
		assertBindingKeySignatureEquals(
649
			"TT;",
650
			"LEclipseTest$InvokerIF;.invoke<T::LEclipseTest$ArgIF;>(TT;)TT;|Ljava/lang/RuntimeException;:TT;"
651
		);
652
	}
653
	/*
654
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=336451
655
	 * Make sure that the binding obtained is a type binding corresponding to the
656
	 * method type variables. In this case method has 2 exceptions and 2 type variables.
657
	 */
658
	public void test058() {
659
		assertBindingKeySignatureEquals(
660
			"TT;",
661
			"LEclipseTest$InvokerIF;.invoke<T::LEclipseTest$ArgIF;Y:Ljava/lang/Object;>(TT;)TT;|Ljava/lang/RuntimeException;|Ljava/lang/IndexOutOfBoundsException;:TT;"
662
		);
663
	}
642
}
664
}

Return to bug 336451