add lint warning for anachronistic array declaration syntax

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: None
    • Component/s: 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.

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

              Created:
              Updated: