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

Improve diagnostics when generic method and generic class use same name for type parameter

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P5
    • Resolution: Unresolved
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: tools
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      Please, look at the following funny example:

      ExportBundler.java:1170: incompatible types
      found : java.util.Iterator<java.util.List<T>>
      required: java.util.Iterator<java.util.List<T>>
              for (Iterator<List<T>> lItr = lists.iterator(); lItr.hasNext();)

      Such error message is given if a generic method appears inside a generic
      class and both the method and the class use the same name for the type parameter.
      I believe that a new user will be really confused in this case

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ahe Peter Ahe
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Imported:
                Indexed: