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 //
26 // Help test archived box cache consistency.
27 //
28 // args[0]: the expected maximum value expected to be archived
29 //
30 public class CheckIntegerCacheApp {
31 public static void main(String[] args) throws Exception {
32 if (args.length != 1) {
33 throw new RuntimeException(
34 "FAILED. Incorrect argument length: " + args.length);
35 }
36
37 // Base JLS compliance check
38 for (int i = -128; i <= 127; i++) {
39 if (Integer.valueOf(i) != Integer.valueOf(i)) {
40 throw new RuntimeException(
41 "FAILED. All values in range [-128, 127] should be interned in cache: " + i);
42 }
43 if (Byte.valueOf((byte)i) != Byte.valueOf((byte)i)) {
44 throw new RuntimeException(
45 "FAILED. All Byte values in range [-128, 127] should be interned in cache: " + (byte)i);
46 }
47 if (Short.valueOf((short)i) != Short.valueOf((short)i)) {
48 throw new RuntimeException(
49 "FAILED. All Short values in range [-128, 127] should be interned in cache: " + (byte)i);
|
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 //
26 // Help test archived box cache consistency.
27 //
28 // args[0]: the expected maximum value expected to be archived
29 //
30
31 /*
32 * test
33 * @run main CheckIntegerCacheApp
34 * @run main/othervm --enable-preview CheckIntegerCacheApp
35 */
36 public class CheckIntegerCacheApp {
37 public static void main(String[] args) throws Exception {
38 if (args.length != 1) {
39 throw new RuntimeException(
40 "FAILED. Incorrect argument length: " + args.length);
41 }
42
43 // Base JLS compliance check
44 for (int i = -128; i <= 127; i++) {
45 if (Integer.valueOf(i) != Integer.valueOf(i)) {
46 throw new RuntimeException(
47 "FAILED. All values in range [-128, 127] should be interned in cache: " + i);
48 }
49 if (Byte.valueOf((byte)i) != Byte.valueOf((byte)i)) {
50 throw new RuntimeException(
51 "FAILED. All Byte values in range [-128, 127] should be interned in cache: " + (byte)i);
52 }
53 if (Short.valueOf((short)i) != Short.valueOf((short)i)) {
54 throw new RuntimeException(
55 "FAILED. All Short values in range [-128, 127] should be interned in cache: " + (byte)i);
|