Mercurial > hg > truffle
annotate agent/src/share/classes/sun/jvm/hotspot/jdi/PrimitiveValueImpl.java @ 6842:b9a9ed0f8eeb
7197424: update copyright year to match last edit in jdk8 hotspot repository
Summary: Update copyright year to 2012 for relevant files
Reviewed-by: dholmes, coleenp
author | mikael |
---|---|
date | Tue, 09 Oct 2012 10:09:34 -0700 |
parents | c18cbe5936b8 |
children |
rev | line source |
---|---|
0 | 1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
2 * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
25 package sun.jvm.hotspot.jdi; | |
26 | |
27 import com.sun.jdi.*; | |
28 | |
29 public abstract class PrimitiveValueImpl extends ValueImpl | |
30 implements PrimitiveValue { | |
31 | |
32 PrimitiveValueImpl(VirtualMachine aVm) { | |
33 super(aVm); | |
34 } | |
35 | |
36 abstract public boolean booleanValue(); | |
37 abstract public byte byteValue(); | |
38 abstract public char charValue(); | |
39 abstract public short shortValue(); | |
40 abstract public int intValue(); | |
41 abstract public long longValue(); | |
42 abstract public float floatValue(); | |
43 abstract public double doubleValue(); | |
44 | |
45 /* | |
46 * The checked versions of the value accessors throw | |
47 * InvalidTypeException if the required conversion is | |
48 * narrowing and would result in the loss of information | |
49 * (either magnitude or precision). | |
50 * | |
51 * Default implementations here do no checking; subclasses | |
52 * override as necessary to do the proper checking. | |
53 */ | |
54 byte checkedByteValue() throws InvalidTypeException { | |
55 return byteValue(); | |
56 } | |
57 char checkedCharValue() throws InvalidTypeException { | |
58 return charValue(); | |
59 } | |
60 short checkedShortValue() throws InvalidTypeException { | |
61 return shortValue(); | |
62 } | |
63 int checkedIntValue() throws InvalidTypeException { | |
64 return intValue(); | |
65 } | |
66 long checkedLongValue() throws InvalidTypeException { | |
67 return longValue(); | |
68 } | |
69 float checkedFloatValue() throws InvalidTypeException { | |
70 return floatValue(); | |
71 } | |
72 | |
73 final boolean checkedBooleanValue() throws InvalidTypeException { | |
74 /* | |
75 * Always disallow a conversion to boolean from any other | |
76 * primitive | |
77 */ | |
78 if (this instanceof BooleanValue) { | |
79 return booleanValue(); | |
80 } else { | |
81 throw new InvalidTypeException("Can't convert non-boolean value to boolean"); | |
82 } | |
83 } | |
84 | |
85 final double checkedDoubleValue() throws InvalidTypeException { | |
86 /* | |
87 * Can't overflow by converting to double, so this method | |
88 * is never overridden | |
89 */ | |
90 return doubleValue(); | |
91 } | |
92 | |
93 } |