Skip to content

Rename internal classes whose name contains a $ - #1745

Closed
Marcono1234 wants to merge 1 commit into
google:mainfrom
Marcono1234:rename-dollar-classes
Closed

Marcono1234 wants to merge 1 commit into
google:mainfrom
Marcono1234:rename-dollar-classes

Conversation

@Marcono1234

Copy link
Copy Markdown
Contributor

Fixes #1744

The JLS (JLS 14 §3.8) says that only mechanically generated source code
should use the dollar sign (`$`) as part of an identifier name.
Due to these unconventional names, development of Gson can currently be
rather annoying because IDEs (at least Eclipse) does not handle the `$`
in class names very well.
@google-cla google-cla Bot added the cla: yes label Jul 31, 2020
@inder123

Copy link
Copy Markdown
Collaborator

Is there another character that we can use? Like _

@Marcono1234

Copy link
Copy Markdown
Contributor Author

Yes using the underscore would be possible as well:

The "Java letters" include [...] for historical reasons, the ASCII dollar sign ($, or \u0024) and underscore (_, or \u005f). [...] The underscore may be used in identifiers formed of two or more characters, but it cannot be used as a one-character identifier due to being a keyword.

JLS 14 §3.8

So _GsonTypes and _GsonPreconditions should work as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename internal Gson classes containing $

2 participants