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

(1.1) Class.isAssignableFrom fails on unloaded class

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.1.8
    • Fix Version/s: None
    • Component/s: hotspot
    • Subcomponent:
    • CPU:
      generic, x86
    • OS:
      generic, windows_95, windows_nt

      Description



      Name: vi73552 Date: 04/13/99


      /* the following code demonstrates the problem */
      import java.lang.reflect.Field;
      import java.lang.reflect.Modifier;


      interface Intf {
          public int f();
      }
      interface Intf2 {
          public int f();
      }


      class Class1 {
          public Intf i;
      }

      public class Test {

          static public final void main(String args[]) {
      Field[] cfields = Class1.class.getDeclaredFields();
      // Class c = Intf.class; // if this line uncommented ==> works
      for (int i=0; i<cfields.length; i++) {
      Class type = cfields[i].getType();
      Intf2.class.isAssignableFrom(cfields[i].getType());
      }
          }
      }
      (Review ID: 56460)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sliangsunw Sheng Liang (Inactive)
              Reporter:
              vasya Vassili Igouchkine (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: