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

Bug 370970

Summary: Underscore in Java identifiers should be preserved when overriding a method
Product: [Eclipse Project] JDT Reporter: David Lambert <lambdav>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: amj87.iitr, lambdav, shankhba
Version: 3.5.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description David Lambert CLA 2012-02-08 11:17:17 EST
Build Identifier: Version: 3.5.2 Build id: M20100211-1343

Eclipse doesn't preserve identifiers having underscore in their name when using completion. This is the case when overriding a class method, or implementing an interface method, where a parameter like file_path is modified into filePath (underscore is removed and the following letter is transformed into an uppercase letter).

Naming convention is area (enterprise, corporation) specific, and Eclipse should not forbid underscore. At least, there should be a preference option to preserve underscore in identifiers. Generally, Eclipse should not make any replacement without having a preference option to disable it.

If there is such option, I haven't found it. In this case, preference option tree should be reviewed.


Reproducible: Always

Steps to Reproduce:
1. Create a class A with method openFile(String file_path)
2. Create a class B extending class A
3. Create an overridden version of the openFile method by starting typing "openF" and use Ctrl+Space to complete with "ile(String filePath)"
What is expected is "ile(String file_path)" instead.
Comment 1 Ayushman Jain CLA 2012-02-09 00:12:55 EST
I couldn't reproduce this with Indigo or 3.8M5. Maybe there's some missing step in the steps to reproduce (eg: A is in a library with doc attached, etc.) or this bug is fixed now. Can you please try a new release? Thanks!