Back to Intellij Community

CStyleArrayDeclaration

java/java-impl/resources/inspectionDescriptions/CStyleArrayDeclaration.html

2025.3-rc-2603 B
Original Source

Reports array declarations written in C-style syntax, where the array brackets are placed after a variable name or after a method parameter list. Most code styles prefer Java-style array declarations, where the array brackets are placed after the type name.

Example:

public String process(String value[])[] {
    return value;
  }

After the quick-fix is applied:

public String[] process(String[] value) {
    return value;
  }

Configure the inspection:

Use the Ignore C-style declarations in variables option to report C-style array declaration of method return types only.