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

SQE lib PIT b30 1.5.0-auto-tiger-322c: java.lang.reflect.Field isEnumConstant

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Cannot Reproduce
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: core-libs

      Description

      Tiger PIT build30 (build 1.5.0-auto-tiger-322c) os: win2000
      -------------------------------------------------------------

      java.lang.reflect.Field isEnumConstant() not returning correct values.
       output is false in the following:
        (expected output is true)
      Colour02.RED isEnumConstant() = false
      Colour02.BLUE isEnumConstant() = false
      Colour02.GREEN isEnumConstant() = false
      Colour02.WHITE isEnumConstant()= false

      The java version used, output of the test program and test program is given below:

      java version
      -------------
      java version "1.5.0-auto-tiger"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-auto-tiger-322c)
      Java HotSpot(TM) Client VM (build 1.5.0-beta-b28, mixed mode)

      Test program output:
      -------------------
      D:\testing\lang\reflect\IsEnumConstantTest>java IsEnumConstantTest
      fArray.length = 5
      fArray.[0]= public static final Colour02 Colour02.RED isEnumConstant() = false
      fArray.[1]= public static final Colour02 Colour02.BLUE isEnumConstant() = false

      fArray.[2]= public static final Colour02 Colour02.GREEN isEnumConstant() = false
      fArray.[3]= public static final Colour02 Colour02.WHITE isEnumConstant()= false
      fArray.[4]=private static final Colour02[]Colour02.$VALUES isEnumConstant() = false

      Test program:
      ------------
      import java.lang.reflect.*;

      public class IsEnumConstantTest {

          public static void main(String[] args) throws Exception {
             //isEnumConstant()
             Field [] fArray = Colour02.class.getDeclaredFields();
             System.out.println("fArray.length = " + fArray.length);
             for (int i = 0; i < fArray.length; i++) {
                 System.out.println("fArray.[" + i + "]= " + fArray[i] + " isEnumConstant() = " + fArray[i].isEnumConstant());
             }

          }
      }
      enum Colour02 { RED,BLUE,GREEN,WHITE,}

      ###@###.### 2003-11-30

        Attachments

          Activity

            People

            Assignee:
            darcy Joe Darcy
            Reporter:
            spandeorcl Shantaram Pande (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: