-XDdiamondFinder misses some unnecessary type arguments

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P3
    • tbd
    • Affects Version/s: 8
    • Component/s: tools

      Consider this code:
      ---
      import java.util.*;
      public class Test {
          private void test() {
              List<String> ll = Collections.synchronizedList(new ArrayList<String>());
          }
      }
      ---

      Running javac (tip: 558fe98d1ac0) as follows:
      $ javac -XDfindDiamond -source 8 Test.java

      Does not produce any "type argument is unnecessary" warning, even though the type argument of the new ArrayList is unnecessary with -source 8, as the following is compilable with -source 8:
      ---
      import java.util.*;
      public class Test {
          private void test() {
              List<String> ll = Collections.synchronizedList(new ArrayList<>());
          }
      }
      ---

            Assignee:
            Jan Lahoda
            Reporter:
            Jan Lahoda
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: