Avoid using dollar signs in variable names


ID: java-code-style/avoid-dollar-signs

Language: Java

Severity: Notice

Category: Code Style


Avoid using dollar signs in identifiers as auto-generated names containing dollar signs ($) may lead to unexpected issues that can be difficult to diagnose.

Non-Compliant Code Examples

public class $Foo {}
public class Fo$o {}
public class Foo$ {
    String bar$ = "bar";

    public String ba$ (){
        return "baz";

Compliant Code Examples

public class Foo { }
https://static.datadoghq.com/static/images/logos/github_avatar.svg https://static.datadoghq.com/static/images/logos/vscode_avatar.svg jetbrains

Seamless integrations. Try Datadog Code Analysis