All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.java.rules.squid.S1195.html Maven / Gradle / Ivy

There is a newer version: 8.6.0.37351
Show newest version

According to the Java Language Specification:

For compatibility with older versions of the Java SE platform,

the declaration of a method that returns an array is allowed to place (some or all of) the empty bracket pairs that form the declaration of the array type after the formal parameter list.

This obsolescent syntax should not be used in new code.

The following code snippet illustrates this rule:

public int getVector()[] { /* ... */ }    // Noncompliant

public int[] getVector() { /* ... */ }    // Compliant

public int[] getMatrix()[] { /* ... */ }  // Noncompliant

public int[][] getMatrix() { /* ... */ }  // Compliant




© 2015 - 2025 Weber Informatics LLC | Privacy Policy