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

Additional lint option when generics not specified

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 5.0
    • tools
    • x86
    • windows_xp

      A DESCRIPTION OF THE REQUEST :
      When porting code to use generics, and also when writing new code, often it is hard to find where generics could be fuller specified in the code.

      This occurs for instance

      1. when some code is calling a method and using a non generic declaration to store the variable
      e.g.
      List x = x.foo();
      when x.foo() returns List<sometype>

      2. when constructing a new object, not specifying the generic parameters
      e.g. List x = new ArrayList()
      should be List<Object> x = new ArrayList<Object>();
      or something similar

      3. when the return value of a method is not generified, but the implementation of the method returns a generic value

      JUSTIFICATION :
      It would significantly improve the porting time if the developer could see at a glance when the new features of the language may be used

            Unassigned Unassigned
            jssunw Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: