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

Clarify in ParameterizedType.getRawType() doc that only Class is returned

    Details

      Description

      A DESCRIPTION OF THE PROBLEM :
      As pointed out in JDK-6255169 the return type of java.lang.reflect.ParameterizedType.getRawType() should have been Class instead of Type. However, this cannot be changed anymore due to binary backward compatibility.

      Nonetheless it would be good to clarify in ParameterizedType.getRawType() documentation that the caller can always expect a Class to be returned, but the return type cannot be changed for backward compatibility reasons.
      Or if there is actually a valid case where it might not return a Class, then it would be good to describe this case in the documentation.

      An example where the return type caused confusion can be seen here:
      https://github.com/google/gson/blob/ceae88bd6667f4263bbe02e6b3710b8a683906a2/gson/src/main/java/com/google/gson/internal/%24Gson%24Types.java#L135


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: