/** readObject is called to restore the state of the BasicPermissionCollection from a stream. */
  private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
    // Don't call defaultReadObject()

    // Read in serialized fields
    ObjectInputStream.GetField gfields = in.readFields();

    // Get permissions
    Hashtable permissions = (Hashtable) gfields.get("permissions", null);
    perms = new HashMap(permissions.size() * 2);
    perms.putAll(permissions);

    // Get all_allowed
    all_allowed = gfields.get("all_allowed", false);

    // Get permClass
    permClass = (Class) gfields.get("permClass", null);

    if (permClass == null) {
      // set permClass
      Enumeration e = permissions.elements();
      if (e.hasMoreElements()) {
        Permission p = (Permission) e.nextElement();
        permClass = p.getClass();
      }
    }
  }
 private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
   ObjectInputStream.GetField fields = stream.readFields();
   groupingUsed = fields.get("groupingUsed", true);
   parseIntegerOnly = fields.get("parseIntegerOnly", false);
   if (fields.get("serialVersionOnStream", 0) == 0) {
     maximumFractionDigits = fields.get("maxFractionDigits", (byte) 3);
     maximumIntegerDigits = fields.get("maxIntegerDigits", (byte) 40);
     minimumFractionDigits = fields.get("minFractionDigits", (byte) 0);
     minimumIntegerDigits = fields.get("minIntegerDigits", (byte) 1);
   } else {
     maximumFractionDigits = fields.get("maximumFractionDigits", 3);
     maximumIntegerDigits = fields.get("maximumIntegerDigits", 40);
     minimumFractionDigits = fields.get("minimumFractionDigits", 0);
     minimumIntegerDigits = fields.get("minimumIntegerDigits", 1);
   }
   if (minimumIntegerDigits > maximumIntegerDigits
       || minimumFractionDigits > maximumFractionDigits) {
     throw new InvalidObjectException("min digits greater than max digits");
   }
   if (minimumIntegerDigits < 0
       || maximumIntegerDigits < 0
       || minimumFractionDigits < 0
       || maximumFractionDigits < 0) {
     throw new InvalidObjectException("min or max digits negative");
   }
 }
示例#3
0
  private void readObject(java.io.ObjectInputStream s)
      throws java.io.IOException, ClassNotFoundException {

    java.io.ObjectInputStream.GetField fields = s.readFields();
    value = (char[]) fields.get("value", null);
    count = fields.get("count", 0);
  }
  /**
   * Overrides the default readObject implementation since we decided it would be cleaner not to
   * serialize the entire tranformer factory. [ ref bugzilla 12317 ] We need to check if the user
   * defined class for URIResolver also implemented Serializable if yes then we need to deserialize
   * the URIResolver Fix for bugzilla bug 22438
   */
  @SuppressWarnings("unchecked")
  private void readObject(ObjectInputStream is) throws IOException, ClassNotFoundException {
    SecurityManager security = System.getSecurityManager();
    if (security != null) {
      String temp = SecuritySupport.getSystemProperty(DESERIALIZE_TRANSLET);
      if (temp == null || !(temp.length() == 0 || temp.equalsIgnoreCase("true"))) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.DESERIALIZE_TRANSLET_ERR);
        throw new UnsupportedOperationException(err.toString());
      }
    }

    // We have to read serialized fields first.
    ObjectInputStream.GetField gf = is.readFields();
    _name = (String) gf.get("_name", null);
    _bytecodes = (byte[][]) gf.get("_bytecodes", null);
    _class = (Class[]) gf.get("_class", null);
    _transletIndex = gf.get("_transletIndex", -1);

    _outputProperties = (Properties) gf.get("_outputProperties", null);
    _indentNumber = gf.get("_indentNumber", 0);

    if (is.readBoolean()) {
      _uriResolver = (URIResolver) is.readObject();
    }

    _tfactory = new TransformerFactoryImpl();
  }
 private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
   ObjectInputStream.GetField fields = stream.readFields();
   int addr = fields.get("address", 0); // $NON-NLS-1$
   ipaddress = new byte[4];
   intToBytes(addr, ipaddress, 0);
   hostName = (String) fields.get("hostName", null); // $NON-NLS-1$
   family = fields.get("family", 2); // $NON-NLS-1$
 }
 private void readObject(ObjectInputStream ois) throws IOException {
   // note aField2 is not read
   try {
     ObjectInputStream.GetField fields = ois.readFields();
     aField1 = (String) fields.get("aField1", "Zap");
   } catch (Exception e) {
   }
 }
 private synchronized void readObject(java.io.ObjectInputStream in)
     throws IOException, ClassNotFoundException {
   ObjectInputStream.GetField gfields = in.readFields();
   HashMap<String, SubsystemPermission> p =
       (HashMap<String, SubsystemPermission>) gfields.get("permissions", null);
   permissions = p;
   all_allowed = gfields.get("all_allowed", false);
 }
示例#8
0
 private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
   java.io.ObjectInputStream.GetField fields = null;
   fields = s.readFields();
   Object[] keys =
       (Object[]) fields.get(SerializationValuesFieldKey, ((_NSUtilities._NoObjectArray)));
   keys = keys != null ? keys : _NSUtilities._NoObjectArray;
   initFromObjects(keys, true);
 }
示例#9
0
 /** Deserializes a {@link DescriptorSupport} from an {@link ObjectInputStream}. */
 private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   ObjectInputStream.GetField fields = in.readFields();
   Map<String, Object> descriptor = cast(fields.get("descriptor", null));
   init(null);
   if (descriptor != null) {
     descriptorMap.putAll(descriptor);
   }
 }
示例#10
0
  /**
   * For serialization, read this object as a single long value.
   *
   * @param stream the input stream to read serialized objects from
   */
  private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {

    ObjectInputStream.GetField fields = stream.readFields();
    long value = fields.get("numberValue", 0L);

    // Recreate the original fields
    this.value = new FastNumber(value);
  }
  /**
   * Provides custom deserialization.
   *
   * @param stream the object input stream containing the serialized object
   * @throws java.lang.Exception in case of failure
   */
  private void readObject(final ObjectInputStream stream) throws Exception {
    ObjectInputStream.GetField fields = stream.readFields();

    m_expression = (Expression) fields.get("m_expression", null);
    m_pointcutPatterns = (Map) fields.get("m_pointcutPatterns", null);
    m_names = (String[]) fields.get("m_names", null);
    m_indexes = (IndexTuple[]) fields.get("m_indexes", null);
    m_uuid = (String) fields.get("m_uuid", null);
  }
 private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   // don't call defaultReadObject()
   ObjectInputStream.GetField fields = in.readFields();
   name = (String) fields.get("theName", "unknown");
   number = fields.get("theNumber", -1);
   someSoftware = (Software) fields.get("theSoftware", null);
   polymorphic = fields.get("thePolymorphic", null);
   nothing = fields.get("theNothing", null);
 }
  /*
   * Reads in a Vector of ServicePermissions and saves them in the perms field.
   */
  private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    // Don't call defaultReadObject()

    // Read in serialized fields
    ObjectInputStream.GetField gfields = in.readFields();

    // Get the one we want
    Vector<Permission> permissions = (Vector<Permission>) gfields.get("permissions", null);
    perms = new ArrayList<Permission>(permissions.size());
    perms.addAll(permissions);
  }
 private synchronized void readObject(java.io.ObjectInputStream in)
     throws IOException, ClassNotFoundException {
   ObjectInputStream.GetField gfields = in.readFields();
   @SuppressWarnings("unchecked")
   HashMap<String, CapabilityPermission> p =
       (HashMap<String, CapabilityPermission>) gfields.get("permissions", null);
   permissions = p;
   all_allowed = gfields.get("all_allowed", false);
   @SuppressWarnings("unchecked")
   HashMap<String, CapabilityPermission> fp =
       (HashMap<String, CapabilityPermission>) gfields.get("filterPermissions", null);
   filterPermissions = fp;
 }
 /** Deserializes an {@link InvalidTargetObjectTypeException} from an {@link ObjectInputStream}. */
 private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   if (compat) {
     // Read an object serialized in the old serial form
     //
     ObjectInputStream.GetField fields = in.readFields();
     exception = (Exception) fields.get("relatedExcept", null);
     if (fields.defaulted("relatedExcept")) {
       throw new NullPointerException("relatedExcept");
     }
   } else {
     // Read an object serialized in the new serial form
     //
     in.defaultReadObject();
   }
 }
  /**
   * Provides custom deserialization.
   *
   * @todo implement
   * @param stream the object input stream containing the serialized object
   * @throws java.lang.Exception in case of failure
   */
  private void readObject(final ObjectInputStream stream) throws Exception {
    ObjectInputStream.GetField fields = stream.readFields();

    //        m_expression = (String)fields.get("m_expression", null);
    //        m_cflowExpression = (String)fields.get("m_cflowExpression", null);
    //        m_pointcutRefs = (List)fields.get("m_pointcutRefs", null);
    //        m_methodPointcutPatterns = (Map)fields.get("m_methodPointcutPatterns", null);
    //        m_setFieldPointcutPatterns = (Map)fields.get("m_setFieldPointcutPatterns", null);
    //        m_getFieldPointcutPatterns = (Map)fields.get("m_getFieldPointcutPatterns", null);
    //        m_throwsPointcutPatterns = (Map)fields.get("m_throwsPointcutPatterns", null);
    //        m_callerSidePointcutPatterns = (Map)fields.get("m_callerSidePointcutPatterns", null);
    //
    //        createJexlExpression();
    //        createJexlCFlowExpression();
  }
  private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    // this fixes a problem with JFreeChart that changed the default value of isCircular at some
    // point.
    // look into SVN history for details
    ObjectInputStream.GetField fields = in.readFields();
    // the following lines are required because above we called readFields(), not
    // defaultReadObject()
    labelFormat = (String) fields.get("labelFormat", null);
    legendLabelFormat = (String) fields.get("legendLabelFormat", null);
    itemLabel = (JRItemLabel) fields.get("itemLabel", null);

    PSEUDO_SERIAL_VERSION_UID = fields.get("PSEUDO_SERIAL_VERSION_UID", 0);
    if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_1_3) {
      boolean circularField = fields.get("isCircular", true);
      circular = Boolean.valueOf(circularField);
    } else {
      circular = (Boolean) fields.get("circular", null);
    }
  }
 /** {@collect.stats} Deserializes a {@link RoleUnresolved} from an {@link ObjectInputStream}. */
 private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   if (compat) {
     // Read an object serialized in the old serial form
     //
     ObjectInputStream.GetField fields = in.readFields();
     roleName = (String) fields.get("myRoleName", null);
     if (fields.defaulted("myRoleName")) {
       throw new NullPointerException("myRoleName");
     }
     roleValue = cast(fields.get("myRoleValue", null));
     if (fields.defaulted("myRoleValue")) {
       throw new NullPointerException("myRoleValue");
     }
     problemType = fields.get("myPbType", 0);
     if (fields.defaulted("myPbType")) {
       throw new NullPointerException("myPbType");
     }
   } else {
     // Read an object serialized in the new serial form
     //
     in.defaultReadObject();
   }
 }
示例#19
0
 /** Deserializes a {@link RelationTypeSupport} from an {@link ObjectInputStream}. */
 private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   if (compat) {
     // Read an object serialized in the old serial form
     //
     ObjectInputStream.GetField fields = in.readFields();
     typeName = (String) fields.get("myTypeName", null);
     if (fields.defaulted("myTypeName")) {
       throw new NullPointerException("myTypeName");
     }
     roleName2InfoMap = cast(fields.get("myRoleName2InfoMap", null));
     if (fields.defaulted("myRoleName2InfoMap")) {
       throw new NullPointerException("myRoleName2InfoMap");
     }
     isInRelationService = fields.get("myIsInRelServFlg", false);
     if (fields.defaulted("myIsInRelServFlg")) {
       throw new NullPointerException("myIsInRelServFlg");
     }
   } else {
     // Read an object serialized in the new serial form
     //
     in.defaultReadObject();
   }
 }
 /** Restores internal state. */
 private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
   ObjectInputStream.GetField fields = in.readFields();
   if (fields.get("all_allowed", false)) { // $NON-NLS-1$
     all = new AllPermission();
   }
 }
示例#21
0
 private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   ObjectInputStream.GetField fields = in.readFields();
   isCircular = fields.get("isCircular", true);
 }
  private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
    ObjectInputStream.GetField gf = ois.readFields();
    String[] t = (String[]) gf.get("types", null);

    types = (t != null && t.length != 0) ? t.clone() : NO_TYPES;
  }
 private void readObject(java.io.ObjectInputStream in)
     throws java.io.IOException, ClassNotFoundException {
   in.readFields();
 }
 private void readObject(java.io.ObjectInputStream in)
     throws java.io.IOException, ClassNotFoundException {
   ObjectInputStream.GetField fields = in.readFields();
   anInstanceVar = Integer.parseInt((String) fields.get(SIMULATED_FIELD_NAME, "-5"));
 }
 private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   ObjectInputStream.GetField fields = in.readFields();
   name = ((String) fields.get("name", "unknown"));
   number = fields.get("number", 10000);
 }