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

Fix compiler warning msg for a method call from raw type.

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      For the following example

         String t = "test"
         Class c = t.getClass();
         Class sig[] = new Class[2];
         sig[0] = null;
         sig[1] = null;
         c.getMethod("foo", sig);

      compiler prints the following warning msg:

      warning: [unchecked] unchecked call to getMethod(java.lang.String,java.lang.Class<?>...)
      as a member of the raw type java.lang.Class

      Changing the Class type of "c" to Class<?> removes the warning msg.

      Discussed this with Peter and he said:
      >I don't think the compiler needs to give a warning in this particular
      >case.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              swamyv Swamy Venkataramanappa
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Imported:
                Indexed: