1 /*
   2  * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 package compiler.jvmci.constantReflectionProviderTest;
  26 
  27 import jdk.internal.vm.annotation.Stable;
  28 
  29 public class DummyClass {
  30 
  31     public boolean booleanField = true;
  32     public byte byteField = 2;
  33     public short shortField = 3;
  34     public char charField = 'a';
  35     public int intField = 4;
  36     public long longField = 5L;
  37     public float floatField = 4.5f;
  38     public double doubleField = 53.2;
  39     public Object objectField = new Object();
  40 
  41     public final boolean finalBooleanField = true;
  42     public final byte finalByteField = -2;
  43     public final short finalShortField = -3;
  44     public final char finalCharField = 'b';
  45     public final int finalIntField = 8;
  46     public final long finalLongField = 888L;
  47     public final float finalFloatField = 77.8f;
  48     public final double finalDoubleField = -234.2;
  49     public final Object finalObjectField = new Object();
  50 
  51     @Stable public boolean stableBooleanField = true;
  52     @Stable public byte stableByteField = -2;
  53     @Stable public short stableShortField = -3;
  54     @Stable public char stableCharField = 'c';
  55     @Stable public int stableIntField = 8;
  56     @Stable public long stableLongField = 888L;
  57     @Stable public float stableFloatField = 77.8f;
  58     @Stable public double stableDoubleField = -234.2;
  59     @Stable public Object stableObjectField = new Object();
  60 
  61     @Stable public boolean stableDefaultBooleanField;
  62     @Stable public byte stableDefaultByteField;
  63     @Stable public short stableDefaultShortField;
  64     @Stable public char stableDefaultCharField;
  65     @Stable public int stableDefaultIntField;
  66     @Stable public long stableDefaultLongField;
  67     @Stable public float stableDefaultFloatField;
  68     @Stable public double stableDefaultDoubleField;
  69     @Stable public Object stableDefaultObjectField;
  70 
  71     public final boolean finalDefaultBooleanField = false;
  72     public final byte finalDefaultByteField = 0;
  73     public final short finalDefaultShortField = 0;
  74     public final char finalDefaultCharField = 0;
  75     public final int finalDefaultIntField = 0;
  76     public final long finalDefaultLongField = 0L;
  77     public final float finalDefaultFloatField = 0.0f;
  78     public final double finalDefaultDoubleField = 0.0;
  79     public final Object finalDefaultObjectField = null;
  80 
  81     public static boolean staticBooleanField = true;
  82     public static byte staticByteField = -1;
  83     public static short staticShortField = 11;
  84     public static char staticCharField = 'e';
  85     public static int staticIntField = 344;
  86     public static long staticLongField = 34231212L;
  87     public static float staticFloatField = -4.5f;
  88     public static double staticDoubleField = 453.2;
  89     public static Object staticObjectField = new Object();
  90 
  91     public static final boolean staticFinalBooleanField = true;
  92     public static final byte staticFinalByteField = -51;
  93     public static final short staticFinalShortField = 911;
  94     public static final char staticFinalCharField = 'g';
  95     public static final int staticFinalIntField = 9344;
  96     public static final long staticFinalLongField = 54231212L;
  97     public static final float staticFinalFloatField = -42.5f;
  98     public static final double staticFinalDoubleField = 5453.2;
  99     public static final Object staticFinalObjectField = new Object();
 100 
 101     public static @Stable boolean staticStableBooleanField = true;
 102     public static @Stable byte staticStableByteField = -61;
 103     public static @Stable short staticStableShortField = 661;
 104     public static @Stable char staticStableCharField = 'y';
 105     public static @Stable int staticStableIntField = 6574;
 106     public static @Stable long staticStableLongField = -2342L;
 107     public static @Stable float staticStableFloatField = -466.5f;
 108     public static @Stable double staticStableDoubleField = 4563.2;
 109     public static @Stable Object staticStableObjectField = new Object();
 110 
 111     public static @Stable boolean staticStableDefaultBooleanField;
 112     public static @Stable byte staticStableDefaultByteField;
 113     public static @Stable short staticStableDefaultShortField;
 114     public static @Stable char staticStableDefaultCharField;
 115     public static @Stable int staticStableDefaultIntField;
 116     public static @Stable long staticStableDefaultLongField;
 117     public static @Stable float staticStableDefaultFloatField;
 118     public static @Stable double staticStableDefaultDoubleField;
 119     public static @Stable Object staticStableDefaultObjectField;
 120 
 121     public boolean[] booleanArrayWithValues = new boolean[]{true, false};
 122     public byte[] byteArrayWithValues = new byte[]{43, 0};
 123     public short[] shortArrayWithValues = new short[]{9, 0};
 124     public char[] charArrayWithValues = new char[]{'a', 0};
 125     public int[] intArrayWithValues = new int[]{99, 0};
 126     public long[] longArrayWithValues = new long[]{868L, 0L};
 127     public float[] floatArrayWithValues = new float[]{75.8f, 0f};
 128     public double[] doubleArrayWithValues = new double[]{-294.66, 0.0};
 129     public Object[] objectArrayWithValues = new Object[]{new Object(), null};
 130 
 131     @Stable public boolean[] stableBooleanArrayWithValues = new boolean[]{true, false};
 132     @Stable public byte[] stableByteArrayWithValues = new byte[]{-2, 0};
 133     @Stable public short[] stableShortArrayWithValues = new short[]{-3, 0};
 134     @Stable public char[] stableCharArrayWithValues = new char[]{'c', 0};
 135     @Stable public int[] stableIntArrayWithValues = new int[]{8, 0};
 136     @Stable public long[] stableLongArrayWithValues = new long[]{888L, 0L};
 137     @Stable public float[] stableFloatArrayWithValues = new float[]{77.8f, 0f};
 138     @Stable public double[] stableDoubleArrayWithValues = new double[]{-234.2, 0.0};
 139     @Stable public Object[] stableObjectArrayWithValues = new Object[]{new Object(), null};
 140 
 141     public boolean[][] booleanArrayArrayWithValues = new boolean[][]{{true}, null};
 142     public byte[][] byteArrayArrayWithValues = new byte[][]{{43, 0}, null};
 143     public short[][] shortArrayArrayWithValues = new short[][]{{9, 0}, null};
 144     public char[][] charArrayArrayWithValues = new char[][]{{'a', 0}, null};
 145     public int[][] intArrayArrayWithValues = new int[][]{{99, 0}, null};
 146     public long[][] longArrayArrayWithValues = new long[][]{{868L, 0L}, null};
 147     public float[][] floatArrayArrayWithValues = new float[][]{{75.8f, 0f}, null};
 148     public double[][] doubleArrayArrayWithValues = new double[][]{{-294.66, 0.0}, null};
 149     public Object[][] objectArrayArrayWithValues = new Object[][]{{new Object(), null}, null};
 150 
 151     @Stable public boolean[][] stableBooleanArrayArrayWithValues = new boolean[][]{{true, false}, null};
 152     @Stable public byte[][] stableByteArrayArrayWithValues = new byte[][]{{-2, 0}, null};
 153     @Stable public short[][] stableShortArrayArrayWithValues = new short[][]{{-3, 0}, null};
 154     @Stable public char[][] stableCharArrayArrayWithValues = new char[][]{{'c', 0}, null};
 155     @Stable public int[][] stableIntArrayArrayWithValues = new int[][]{{8, 0}, null};
 156     @Stable public long[][] stableLongArrayArrayWithValues = new long[][]{{888L, 0L}, null};
 157     @Stable public float[][] stableFloatArrayArrayWithValues = new float[][]{{77.8f, 0f}, null};
 158     @Stable public double[][] stableDoubleArrayArrayWithValues = new double[][]{{-234.2, 0.0}, null};
 159     @Stable public Object[][] stableObjectArrayArrayWithValues = new Object[][]{{new Object(), null}, null};
 160 
 161     // Strings for testing "forString" method
 162     public final String stringField = "abc";
 163     public final String stringField2 = "xyz";
 164     public final String stringEmptyField = "";
 165 }