Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8210681

add lint warning for anachronistic array declaration syntax

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • None
    • tools
    • None

      An array variable declaration, or a method returning an array type, may include bracket pairs either on the type or on the declarator, or in both locations:

          int a[];
          public int foo() [] { ... }
          float[][] f[][], g[][][], h[]; // Yechh! (see JLS Example 10.2-2)

      The preferred location of brackets for array types nowadays is on the type. Javac should issue a lint warning if brackets appear on a declarator.

            Unassigned Unassigned
            smarks Stuart Marks
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: