src/java.management/share/classes/javax/management/NumericValueExp.java
author mbaesken
Fri, 13 Sep 2019 11:04:46 +0200
changeset 58173 6a30ad1cfeec
parent 47216 71c04702a3d5
permissions -rw-r--r--
8230901: missing ReleaseStringUTFChars in serviceability native code Reviewed-by: stuefe, sspitsyn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 21656
diff changeset
     2
 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.management;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import com.sun.jmx.mbeanserver.GetPropertyAction;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.io.ObjectInputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.io.ObjectOutputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.io.ObjectStreamField;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.security.AccessController;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * This class represents numbers that are arguments to relational constraints.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * A NumericValueExp may be used anywhere a ValueExp is required.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * <p>The <b>serialVersionUID</b> of this class is <code>-4679739485102359104L</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * @serial include
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
@SuppressWarnings("serial")  // serialVersionUID not constant
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
class NumericValueExp extends QueryEval implements ValueExp {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    // Serialization compatibility stuff:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    // Two serial forms are supported in this class. The selected form depends
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    // on system property "jmx.serial.form":
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    //  - "1.0" for JMX 1.0
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    //  - any other value for JMX 1.1 and higher
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    // Serial version for old serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    private static final long oldSerialVersionUID = -6227876276058904000L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    // Serial version for new serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    private static final long newSerialVersionUID = -4679739485102359104L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    // Serializable fields in old serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    private static final ObjectStreamField[] oldSerialPersistentFields =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        new ObjectStreamField("longVal", Long.TYPE),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        new ObjectStreamField("doubleVal", Double.TYPE),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        new ObjectStreamField("valIsLong", Boolean.TYPE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    };
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    // Serializable fields in new serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    private static final ObjectStreamField[] newSerialPersistentFields =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
        new ObjectStreamField("val", Number.class)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    };
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    // Actual serial version and serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    private static final long serialVersionUID;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * @serialField val Number The numeric value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * <p>The <b>serialVersionUID</b> of this class is <code>-4679739485102359104L</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    private static final ObjectStreamField[] serialPersistentFields;
526
61ba2d5ea9da 6701459: Synchronization bug pattern found in javax.management.relation.RelationService
emcmanus
parents: 34
diff changeset
    86
    private Number val = 0.0;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    private static boolean compat = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    static {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
            GetPropertyAction act = new GetPropertyAction("jmx.serial.form");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
            String form = AccessController.doPrivileged(act);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
            compat = (form != null && form.equals("1.0"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        } catch (Exception e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
            // OK: exception means no compat with 1.0, too bad
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        if (compat) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
            serialPersistentFields = oldSerialPersistentFields;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
            serialVersionUID = oldSerialVersionUID;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
            serialPersistentFields = newSerialPersistentFields;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
            serialVersionUID = newSerialVersionUID;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    // END Serialization compatibility stuff
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * Basic constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    public NumericValueExp() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   115
    /** Creates a new NumericValue representing the numeric literal @{code val}.*/
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    NumericValueExp(Number val)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
      this.val = val;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * Returns a double numeric value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    public double doubleValue()  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
      if (val instanceof Long || val instanceof Integer)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        return (double)(val.longValue());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
      return val.doubleValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * Returns a long numeric value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    public long longValue()  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
      if (val instanceof Long || val instanceof Integer)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        return val.longValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
      return (long)(val.doubleValue());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * Returns true is if the numeric value is a long, false otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    public boolean isLong()  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        return (val instanceof Long || val instanceof Integer);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * Returns the string representing the object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    public String toString()  {
34
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
   154
      if (val == null)
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
   155
        return "null";
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
      if (val instanceof Long || val instanceof Integer)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
      {
34
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
   158
        return Long.toString(val.longValue());
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
      }
34
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
   160
      double d = val.doubleValue();
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
   161
      if (Double.isInfinite(d))
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
   162
          return (d > 0) ? "(1.0 / 0.0)" : "(-1.0 / 0.0)";
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
   163
      if (Double.isNaN(d))
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
   164
          return "(0.0 / 0.0)";
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
   165
      return Double.toString(d);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * Applies the ValueExp on a MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * @param name The name of the MBean on which the ValueExp will be applied.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * @return  The <CODE>ValueExp</CODE>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * @exception BadStringOperationException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     * @exception BadBinaryOpValueExpException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * @exception BadAttributeValueExpException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * @exception InvalidApplicationException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    public ValueExp apply(ObjectName name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
            throws BadStringOperationException, BadBinaryOpValueExpException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
                   BadAttributeValueExpException, InvalidApplicationException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * Deserializes a {@link NumericValueExp} from an {@link ObjectInputStream}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    private void readObject(ObjectInputStream in)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
            throws IOException, ClassNotFoundException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
      if (compat)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
        // Read an object serialized in the old serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        double doubleVal;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        long longVal;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
        boolean isLong;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        ObjectInputStream.GetField fields = in.readFields();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
        doubleVal = fields.get("doubleVal", (double)0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        if (fields.defaulted("doubleVal"))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
          throw new NullPointerException("doubleVal");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        longVal = fields.get("longVal", (long)0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        if (fields.defaulted("longVal"))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
          throw new NullPointerException("longVal");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
        isLong = fields.get("valIsLong", false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        if (fields.defaulted("valIsLong"))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
          throw new NullPointerException("valIsLong");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
        if (isLong)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
        {
526
61ba2d5ea9da 6701459: Synchronization bug pattern found in javax.management.relation.RelationService
emcmanus
parents: 34
diff changeset
   216
          this.val = longVal;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
        else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
        {
526
61ba2d5ea9da 6701459: Synchronization bug pattern found in javax.management.relation.RelationService
emcmanus
parents: 34
diff changeset
   220
          this.val = doubleVal;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
      else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        // Read an object serialized in the new serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        in.defaultReadObject();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     * Serializes a {@link NumericValueExp} to an {@link ObjectOutputStream}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    private void writeObject(ObjectOutputStream out)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
            throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
      if (compat)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
        // Serializes this instance in the old serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
        ObjectOutputStream.PutField fields = out.putFields();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
        fields.put("doubleVal", doubleValue());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
        fields.put("longVal", longValue());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
        fields.put("valIsLong", isLong());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        out.writeFields();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
      else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
        // Serializes this instance in the new serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
        out.defaultWriteObject();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
    }
34
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
   254
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
   255
    @Deprecated
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
   256
    public void setMBeanServer(MBeanServer s) {
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
   257
        super.setMBeanServer(s);
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
   258
    }
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
   259
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
 }