Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318255 - [rename] RenameMethodProcessor.checkNewElementName(..) should allow _ at beginning
Summary: [rename] RenameMethodProcessor.checkNewElementName(..) should allow _ at begi...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 trivial (vote)
Target Milestone: 3.7 M1   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-28 17:40 EDT by Mike Schrag CLA
Modified: 2010-06-29 13:36 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Schrag CLA 2010-06-28 17:40:08 EDT
Build Identifier: 3.6

At my company, it is a common naming practice to use underscores in front of methods that are "logically protected" -- that is, they have to be public to support cross-package calling, but should be considered protected or discouraged API. This is a convention brought over from Objective-C and WebObjects.

RenameMethodProcess.checkNewElementNames when you refactor a method to have a leading underscore because it has a hardcoded "only lowercase names should be used" check. It would actually be nice if this check was either a configuration option or possible leading-underscore could be a case that doesn't trip this check.

Reproducible: Always

Steps to Reproduce:
1. Create a method named "test"
2. Refactor=>rename the method to "_test"
3. Warning points out that this is discouraged naming in Java
Comment 1 Olivier Thomann CLA 2010-06-28 17:47:51 EDT
Moving to JDT/UI
Comment 2 Markus Keller CLA 2010-06-29 13:36:13 EDT
The other refactorings (e.g. Rename Field) also treat _ as lowercase. Rename Method should behave the same.

Fixed in HEAD of RenameMethodProcessor and Checks.