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

java.lang.Class#getFields() is not deterministic

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: P3 P3
    • None
    • 7u7
    • core-libs
    • None

      FULL PRODUCT VERSION :
      java version " 1.7.0_07 "
      Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
      Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      Class#getFields() erratically reports fields of the same class mutiple times or leaves existing fields out. If -Dsun.reflect.noCaches=true is set the error vanishes.

      One example for this behaviour involved a class concrete class with a hierachy analog to

      public interface IBase

      public interface IDerived extends IBase

      public abstract class AbstractBase implements IBase

      public abstract class AbstractDerived extends AbstractBase
        implements IDerived

      public abstract class AbstractOther extends AbstractDerived
        implements IOther

      public class Concrete extends AbstractOther


      (Static) fields from IBase were sometimes reported twice; fields from Concrete were ignored.


      REPRODUCIBILITY :
      This bug can be reproduced always.

            jfranck Joel Borggrén-Franck (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: