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

java.beans.PropertyDescriptor "cannot access PropertyInfo" compilation error

XMLWordPrintable

    • x86_64
    • generic

      A DESCRIPTION OF THE PROBLEM :
      "class file for com.sun.beans.introspect.PropertyInfo not found" is displayed when compiling with '-source 1.8' and '-target 1.8' options, even if there is no direct reference of "PropertyInfo" class.

      REGRESSION : Last worked in version 8u192

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      $ /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/bin/javac -source 1.8 -target 1.8 CompileFailure.java

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      $ /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/bin/javac -source 1.8 -target 1.8 CompileFailure.java
      warning: [options] bootstrap class path not set in conjunction with -source 8
      1 warning

      ACTUAL -
      $ /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/bin/javac -source 1.8 -target 1.8 CompileFailure.java
      warning: [options] bootstrap class path not set in conjunction with -source 8
      CompileFailure.java:6: error: cannot access PropertyInfo
              new PropertyDescriptor(object.getClass().getName(), object.getClass());
              ^
        class file for com.sun.beans.introspect.PropertyInfo not found
      1 error
      1 warning

      ---------- BEGIN SOURCE ----------
      import java.beans.PropertyDescriptor;

      public class CompileFailure {
          void test(Object object) throws Exception {
              // fail to compile
              new PropertyDescriptor(object.getClass().getName(), object.getClass());
              // workaround
      // new PropertyDescriptor((String)object.getClass().getName(), object.getClass());
          }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      type casting seems to help

      FREQUENCY : always


            jjg Jonathan Gibbons
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: