This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 185268 - Unable to navigate to or fix imports for class or method having name of '$'
Summary: Unable to navigate to or fix imports for class or method having name of '$'
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Navigation (show other bugs)
Version: -S1S-
Hardware: PC Other
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-29 15:34 UTC by rptmaestro
Modified: 2015-09-17 11:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rptmaestro 2010-04-29 15:34:59 UTC
In my Java application, I'm implementing some JQuery-style lookup using '$' as both a static method name and a class name.

Although a '$' is not recommended as an identifier for casual use, it is a valid identifier should be supported for features such as "Fix Imports" and "Navigate > Go to Source".

If the desire is to discourage the use of '$' as a class name identifier, it would be preferable to have the editor display a warning rather than simply not support the use of '$' as an identifier.
Comment 1 Tomas Zezula 2011-02-09 09:21:11 UTC
According to the java spec:

The $ character should be used only in mechanically generated source code or, rarely, to access preexisting names on legacy systems.

But it's legal and I agree that it's a bug. Unfortunately to fix it I will need internally to encode inner class by some other separator. But the exotic identifiers which should be part of JDK 8 does not offer much chances. Not for NB 7.0
Comment 2 Martin Balin 2015-09-17 11:16:14 UTC
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.