Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 347734

Summary: [typing] Angle brackets wrongly auto-closed when starting at the beginning of a line
Product: [Eclipse Project] JDT Reporter: Francis Sujai A <afsujai>
Component: TextAssignee: Deepak Azad <deepakazad>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: P2 CC: daniel_megert
Version: 3.7   
Target Milestone: 3.8 M3   
Hardware: All   
OS: All   
Whiteboard:

Description Francis Sujai A CLA 2011-05-31 03:26:27 EDT
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 <>".
Comment 1 Deepak Azad CLA 2011-09-22 11:07:16 EDT
Problem was in CompilationUnitEditor.BracketInserter.verifyKey(VerifyEvent), incorrect bound was passed to the scanner.

Fixed in HEAD. (commit c6d77669612d953955efd5f92f5cdb83717c8abb)
Comment 2 Dani Megert CLA 2011-10-25 10:17:46 EDT
Verified in I20111021-0800.