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 package jdk.vm.ci.hotspot.test;
  25 
  26 import jdk.internal.vm.annotation.Stable;
  27 
  28 public class DummyClass {
  29 
  30     public boolean booleanField = true;
  31     public byte byteField = 2;
  32     public short shortField = 3;
  33     public char charField = 'a';
  34     public int intField = 4;
  35     public long longField = 5L;
  36     public float floatField = 4.5f;
  37     public double doubleField = 53.2;
  38     public Object objectField = new Object();
  39 
  40     public final boolean finalBooleanField = true;
  41     public final byte finalByteField = -2;
  42     public final short finalShortField = -3;
  43     public final char finalCharField = 'b';
  44     public final int finalIntField = 8;
  45     public final long finalLongField = 888L;
  46     public final float finalFloatField = 77.8f;
  47     public final double finalDoubleField = -234.2;
  48     public final Object finalObjectField = new Object();
  49 
  50     @Stable public boolean stableBooleanField = true;
  51     @Stable public byte stableByteField = -2;
  52     @Stable public short stableShortField = -3;
  53     @Stable public char stableCharField = 'c';
  54     @Stable public int stableIntField = 8;
  55     @Stable public long stableLongField = 888L;
  56     @Stable public float stableFloatField = 77.8f;
  57     @Stable public double stableDoubleField = -234.2;
  58     @Stable public Object stableObjectField = new Object();
  59 
  60     @Stable public boolean stableDefaultBooleanField;
  61     @Stable public byte stableDefaultByteField;
  62     @Stable public short stableDefaultShortField;
  63     @Stable public char stableDefaultCharField;
  64     @Stable public int stableDefaultIntField;
  65     @Stable public long stableDefaultLongField;
  66     @Stable public float stableDefaultFloatField;
  67     @Stable public double stableDefaultDoubleField;
  68     @Stable public Object stableDefaultObjectField;
  69 
  70     public final boolean finalDefaultBooleanField = false;
  71     public final byte finalDefaultByteField = 0;
  72     public final short finalDefaultShortField = 0;
  73     public final char finalDefaultCharField = 0;
  74     public final int finalDefaultIntField = 0;
  75     public final long finalDefaultLongField = 0L;
  76     public final float finalDefaultFloatField = 0.0f;
  77     public final double finalDefaultDoubleField = 0.0;
  78     public final Object finalDefaultObjectField = null;
  79 
  80     public static boolean staticBooleanField = true;
  81     public static byte staticByteField = -1;
  82     public static short staticShortField = 11;
  83     public static char staticCharField = 'e';
  84     public static int staticIntField = 344;
  85     public static long staticLongField = 34231212L;
  86     public static float staticFloatField = -4.5f;
  87     public static double staticDoubleField = 453.2;
  88     public static Object staticObjectField = new Object();
  89 
  90     public static final boolean staticFinalBooleanField = true;
  91     public static final byte staticFinalByteField = -51;
  92     public static final short staticFinalShortField = 911;
  93     public static final char staticFinalCharField = 'g';
  94     public static final int staticFinalIntField = 9344;
  95     public static final long staticFinalLongField = 54231212L;
  96     public static final float staticFinalFloatField = -42.5f;
  97     public static final double staticFinalDoubleField = 5453.2;
  98     public static final Object staticFinalObjectField = new Object();
  99 
 100     @Stable public static boolean staticStableBooleanField = true;
 101     @Stable public static byte staticStableByteField = -61;
 102     @Stable public static short staticStableShortField = 661;
 103     @Stable public static char staticStableCharField = 'y';
 104     @Stable public static int staticStableIntField = 6574;
 105     @Stable public static long staticStableLongField = -2342L;
 106     @Stable public static float staticStableFloatField = -466.5f;
 107     @Stable public static double staticStableDoubleField = 4563.2;
 108     @Stable public static Object staticStableObjectField = new Object();
 109 
 110     @Stable public static boolean staticStableDefaultBooleanField;
 111     @Stable public static byte staticStableDefaultByteField;
 112     @Stable public static short staticStableDefaultShortField;
 113     @Stable public static char staticStableDefaultCharField;
 114     @Stable public static int staticStableDefaultIntField;
 115     @Stable public static long staticStableDefaultLongField;
 116     @Stable public static float staticStableDefaultFloatField;
 117     @Stable public static double staticStableDefaultDoubleField;
 118     @Stable public static Object staticStableDefaultObjectField;
 119 
 120     public boolean[] booleanArrayWithValues = new boolean[]{true, false};
 121     public byte[] byteArrayWithValues = new byte[]{43, 0};
 122     public short[] shortArrayWithValues = new short[]{9, 0};
 123     public char[] charArrayWithValues = new char[]{'a', 0};
 124     public int[] intArrayWithValues = new int[]{99, 0};
 125     public long[] longArrayWithValues = new long[]{868L, 0L};
 126     public float[] floatArrayWithValues = new float[]{75.8f, 0f};
 127     public double[] doubleArrayWithValues = new double[]{-294.66, 0.0};
 128     public Object[] objectArrayWithValues = new Object[]{new Object(), null};
 129 
 130     @Stable public boolean[] stableBooleanArrayWithValues = new boolean[]{true, false};
 131     @Stable public byte[] stableByteArrayWithValues = new byte[]{-2, 0};
 132     @Stable public short[] stableShortArrayWithValues = new short[]{-3, 0};
 133     @Stable public char[] stableCharArrayWithValues = new char[]{'c', 0};
 134     @Stable public int[] stableIntArrayWithValues = new int[]{8, 0};
 135     @Stable public long[] stableLongArrayWithValues = new long[]{888L, 0L};
 136     @Stable public float[] stableFloatArrayWithValues = new float[]{77.8f, 0f};
 137     @Stable public double[] stableDoubleArrayWithValues = new double[]{-234.2, 0.0};
 138     @Stable public Object[] stableObjectArrayWithValues = new Object[]{new Object(), null};
 139 
 140     public boolean[][] booleanArrayArrayWithValues = new boolean[][]{{true}, null};
 141     public byte[][] byteArrayArrayWithValues = new byte[][]{{43, 0}, null};
 142     public short[][] shortArrayArrayWithValues = new short[][]{{9, 0}, null};
 143     public char[][] charArrayArrayWithValues = new char[][]{{'a', 0}, null};
 144     public int[][] intArrayArrayWithValues = new int[][]{{99, 0}, null};
 145     public long[][] longArrayArrayWithValues = new long[][]{{868L, 0L}, null};
 146     public float[][] floatArrayArrayWithValues = new float[][]{{75.8f, 0f}, null};
 147     public double[][] doubleArrayArrayWithValues = new double[][]{{-294.66, 0.0}, null};
 148     public Object[][] objectArrayArrayWithValues = new Object[][]{{new Object(), null}, null};
 149 
 150     @Stable public boolean[][] stableBooleanArrayArrayWithValues = new boolean[][]{{true, false}, null};
 151     @Stable public byte[][] stableByteArrayArrayWithValues = new byte[][]{{-2, 0}, null};
 152     @Stable public short[][] stableShortArrayArrayWithValues = new short[][]{{-3, 0}, null};
 153     @Stable public char[][] stableCharArrayArrayWithValues = new char[][]{{'c', 0}, null};
 154     @Stable public int[][] stableIntArrayArrayWithValues = new int[][]{{8, 0}, null};
 155     @Stable public long[][] stableLongArrayArrayWithValues = new long[][]{{888L, 0L}, null};
 156     @Stable public float[][] stableFloatArrayArrayWithValues = new float[][]{{77.8f, 0f}, null};
 157     @Stable public double[][] stableDoubleArrayArrayWithValues = new double[][]{{-234.2, 0.0}, null};
 158     @Stable public Object[][] stableObjectArrayArrayWithValues = new Object[][]{{new Object(), null}, null};
 159 
 160     // Strings for testing "forString" method
 161     public final String stringField = "abc";
 162     public final String stringField2 = "xyz";
 163     public final String stringEmptyField = "";
 164 }