Project: JDT
Bug 347734 [typing] Angle brackets wrongly auto-closed when starting at the beginning of a line
Reported: 2011-05-31 03:26:27 | Status: verified fixed

Build Identifier: Version: 3.6.2, Build id: M20110210-1200 This happens only if the identifier is single letter. This happens only if the identifier is typed in the first column. I understand this is a rare scenario. But, text editors inherited from AbstractTextEditor will have the same behavior as well. That's why I raise this as a Minor bug. I guess, the problem might be in org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.scanBackward() method. Reproducible: Always Steps to Reproduce: 1. Open a Java editor. 2. Type "int x = 10;" in the class body. 3. Then try typing "x <" in the first column. 4. Even with the identifier context (i.e. x), angular brace is auto completed as "x <>".

Files changed in fix:
org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/BracketInserterTest.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java