Java Code Examples for java.util.Hashtable#putAll()

The following examples show how to use java.util.Hashtable#putAll() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BasicPermission.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the perms field out as a Hashtable for
 * serialization compatibility with earlier releases. all_allowed
 * and permClass unchanged.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<String, Permission> permissions =
            new Hashtable<>(perms.size()*2);

    synchronized (this) {
        permissions.putAll(perms);
    }

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();
    pfields.put("all_allowed", all_allowed);
    pfields.put("permissions", permissions);
    pfields.put("permClass", permClass);
    out.writeFields();
}
 
Example 2
Source File: Permissions.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the permsMap field out as a Hashtable for
 * serialization compatibility with earlier releases. allPermission
 * unchanged.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<Class<?>, PermissionCollection> perms =
        new Hashtable<>(permsMap.size()*2); // no sync; estimate
    synchronized (this) {
        perms.putAll(permsMap);
    }

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();

    pfields.put("allPermission", allPermission); // no sync; staleness OK
    pfields.put("perms", perms);
    out.writeFields();
}
 
Example 3
Source File: Permissions.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the permsMap field out as a Hashtable for
 * serialization compatibility with earlier releases.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<Permission, Permission> perms =
            new Hashtable<>(permsMap.size()*2);
    synchronized (this) {
        perms.putAll(permsMap);
    }

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();
    pfields.put("perms", perms);
    out.writeFields();
}
 
Example 4
Source File: Permissions.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the permsMap field out as a Hashtable for
 * serialization compatibility with earlier releases.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<Permission, Permission> perms =
            new Hashtable<>(permsMap.size()*2);
    synchronized (this) {
        perms.putAll(permsMap);
    }

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();
    pfields.put("perms", perms);
    out.writeFields();
}
 
Example 5
Source File: Permissions.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the permsMap field out as a Hashtable for
 * serialization compatibility with earlier releases.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<Permission, Permission> perms =
            new Hashtable<>(permsMap.size()*2);
    perms.putAll(permsMap);

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();
    pfields.put("perms", perms);
    out.writeFields();
}
 
Example 6
Source File: BasicPermission.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the perms field out as a Hashtable for
 * serialization compatibility with earlier releases. all_allowed
 * and permClass unchanged.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<String, Permission> permissions =
            new Hashtable<>(perms.size()*2);

    synchronized (this) {
        permissions.putAll(perms);
    }

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();
    pfields.put("all_allowed", all_allowed);
    pfields.put("permissions", permissions);
    pfields.put("permClass", permClass);
    out.writeFields();
}
 
Example 7
Source File: PropertyPermission.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the perms field out as a Hashtable for
 * serialization compatibility with earlier releases. all_allowed
 * unchanged.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<String, Permission> permissions =
        new Hashtable<>(perms.size()*2);
    synchronized (this) {
        permissions.putAll(perms);
    }

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();
    pfields.put("all_allowed", all_allowed);
    pfields.put("permissions", permissions);
    out.writeFields();
}
 
Example 8
Source File: CourseSolverContainerRemote.java    From unitime with Apache License 2.0 6 votes vote down vote up
public Hashtable getAssignmentInfoTable(Collection classesOrClassIds) throws Exception {
    Set deptIds = iRemoteSolverProxy.getDepartmentIds();
    Hashtable infos = new Hashtable();
    Vector solverClassesOrClassIds = new Vector(classesOrClassIds.size());
    for (Iterator i=classesOrClassIds.iterator();i.hasNext();) {
        Object classOrClassId = i.next();
        if (classOrClassId instanceof Object[]) classOrClassId = ((Object[])classOrClassId)[0];
        Class_ clazz = (classOrClassId instanceof Class_ ? (Class_)classOrClassId : (new Class_DAO()).get((Long)classOrClassId));
        if (clazz.getManagingDept()==null || !deptIds.contains(clazz.getManagingDept().getUniqueId())) {
            AssignmentPreferenceInfo info = iCommitedClassAssignmentProxy.getAssignmentInfo(clazz);
            if (info!=null)
                infos.put(clazz.getUniqueId(), info);
        } else {
            solverClassesOrClassIds.add(clazz.getUniqueId());
        }
    }
    if (!solverClassesOrClassIds.isEmpty())
        infos.putAll(iRemoteSolverProxy.getAssignmentInfoTable2(solverClassesOrClassIds));
    return infos;
}
 
Example 9
Source File: Permissions.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the permsMap field out as a Hashtable for
 * serialization compatibility with earlier releases. allPermission
 * unchanged.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<Class<?>, PermissionCollection> perms =
        new Hashtable<>(permsMap.size()*2); // no sync; estimate
    synchronized (this) {
        perms.putAll(permsMap);
    }

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();

    pfields.put("allPermission", allPermission); // no sync; staleness OK
    pfields.put("perms", perms);
    out.writeFields();
}
 
Example 10
Source File: BasicPermission.java    From jdk-1.7-annotated with Apache License 2.0 6 votes vote down vote up
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the perms field out as a Hashtable for
 * serialization compatibility with earlier releases. all_allowed
 * and permClass unchanged.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<String, Permission> permissions =
            new Hashtable<>(perms.size()*2);

    synchronized (this) {
        permissions.putAll(perms);
    }

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();
    pfields.put("all_allowed", all_allowed);
    pfields.put("permissions", permissions);
    pfields.put("permClass", permClass);
    out.writeFields();
}
 
Example 11
Source File: BasicPermission.java    From Java8CN with Apache License 2.0 6 votes vote down vote up
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the perms field out as a Hashtable for
 * serialization compatibility with earlier releases. all_allowed
 * and permClass unchanged.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<String, Permission> permissions =
            new Hashtable<>(perms.size()*2);

    synchronized (this) {
        permissions.putAll(perms);
    }

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();
    pfields.put("all_allowed", all_allowed);
    pfields.put("permissions", permissions);
    pfields.put("permClass", permClass);
    out.writeFields();
}
 
Example 12
Source File: BasicPermission.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the perms field out as a Hashtable for
 * serialization compatibility with earlier releases. all_allowed
 * and permClass unchanged.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<String, Permission> permissions =
            new Hashtable<>(perms.size()*2);

    synchronized (this) {
        permissions.putAll(perms);
    }

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();
    pfields.put("all_allowed", all_allowed);
    pfields.put("permissions", permissions);
    pfields.put("permClass", permClass);
    out.writeFields();
}
 
Example 13
Source File: Permissions.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the permsMap field out as a Hashtable for
 * serialization compatibility with earlier releases. allPermission
 * unchanged.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<Class<?>, PermissionCollection> perms =
        new Hashtable<>(permsMap.size()*2); // no sync; estimate
    synchronized (this) {
        perms.putAll(permsMap);
    }

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();

    pfields.put("allPermission", allPermission); // no sync; staleness OK
    pfields.put("perms", perms);
    out.writeFields();
}
 
Example 14
Source File: Permissions.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the permsMap field out as a Hashtable for
 * serialization compatibility with earlier releases. allPermission
 * unchanged.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<Class<?>, PermissionCollection> perms =
        new Hashtable<>(permsMap.size()*2); // no sync; estimate
    synchronized (this) {
        perms.putAll(permsMap);
    }

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();

    pfields.put("allPermission", allPermission); // no sync; staleness OK
    pfields.put("perms", perms);
    out.writeFields();
}
 
Example 15
Source File: Permissions.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the permsMap field out as a Hashtable for
 * serialization compatibility with earlier releases.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<Permission, Permission> perms =
            new Hashtable<>(permsMap.size()*2);
    synchronized (this) {
        perms.putAll(permsMap);
    }

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();
    pfields.put("perms", perms);
    out.writeFields();
}
 
Example 16
Source File: Permissions.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the permsMap field out as a Hashtable for
 * serialization compatibility with earlier releases.
 */
@java.io.Serial
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<Permission, Permission> perms =
            new Hashtable<>(permsMap.size()*2);
    perms.putAll(permsMap);

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();
    pfields.put("perms", perms);
    out.writeFields();
}
 
Example 17
Source File: BasicPermission.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the perms field out as a Hashtable for
 * serialization compatibility with earlier releases. all_allowed
 * and permClass unchanged.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<String, Permission> permissions =
            new Hashtable<>(perms.size()*2);

    synchronized (this) {
        permissions.putAll(perms);
    }

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();
    pfields.put("all_allowed", all_allowed);
    pfields.put("permissions", permissions);
    pfields.put("permClass", permClass);
    out.writeFields();
}
 
Example 18
Source File: RhnPostMockStrutsTestCase.java    From uyuni with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns all request elements, including uploaded files.
 *
 * @return the all elements
 */
@Override
public Hashtable<String, Object> getAllElements() {
    Hashtable<String, Object> result =
            new Hashtable<String, Object>(uploadedFileElements);
    result.putAll(request.getParameterMap());
    return result;
}
 
Example 19
Source File: FWProps.java    From knopflerfish.org with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public Dictionary<String, String> getProperties() {
  final Hashtable<String, String> p = new Hashtable<String, String>(props_default);
  @SuppressWarnings({ "rawtypes", "unchecked" })
  final
  Hashtable<String,String> sysProps = (Hashtable) System.getProperties();
  p.putAll(sysProps);
  p.putAll(props);
  p.put(KEY_KEYS, makeKeys());
  return p;
}
 
Example 20
Source File: ConfigManager.java    From pacbot with Apache License 2.0 4 votes vote down vote up
/**
 * Gets the configurations map.
 *
 * @return the configurations map
 */
public static Hashtable<String, Object> getConfigurationsMap() {
	
	JsonArray propertySourcesArray = new JsonArray();
	Hashtable<String, Object> appPropsHashtable = new Hashtable<>();
	Hashtable<String, Object> rulePropsHashtable = new Hashtable<>();
	Hashtable<String, Object> configHashtable = new Hashtable<>();
	
	String configServerURL = CommonHttpUtils.getEnvironmentVariable(PacmanSdkConstants.CONFIG_SERVICE_URL);
	String configCredentials = CommonHttpUtils.getEnvironmentVariable(PacmanSdkConstants.CONFIG_CREDENTIALS);

	if (StringUtils.isNullOrEmpty(configServerURL) || StringUtils.isNullOrEmpty(configCredentials)) {
		logger.info(PacmanSdkConstants.MISSING_CONFIGURATION);
		throw new InvalidInputException(PacmanSdkConstants.MISSING_CONFIGURATION);
	}

	Map<String, Object> configCreds = CommonHttpUtils.getHeader(configCredentials);

	JsonObject configurationsFromPacmanTable = CommonHttpUtils.getConfigurationsFromConfigApi(configServerURL, configCreds);
	logger.info("Configured values {} ",configurationsFromPacmanTable);
	if (configurationsFromPacmanTable != null) {
		propertySourcesArray = configurationsFromPacmanTable.get("propertySources").getAsJsonArray();
	}

	
	if (propertySourcesArray.size() > 0) {
		for (int i = 0; i < propertySourcesArray.size(); i++) {
			JsonObject propertySource = (JsonObject) propertySourcesArray.get(i);

			if (propertySource.get(PacmanSdkConstants.NAME).toString().contains("application")) {
				JsonObject appProps = propertySource.get(PacmanSdkConstants.SOURCE).getAsJsonObject();
				appPropsHashtable = new Gson().fromJson(appProps,new TypeToken<Hashtable<String, Object>>() {}.getType());
			}
			if (propertySource.get(PacmanSdkConstants.NAME).toString().contains("rule")) {
				JsonObject ruleProps = propertySource.get(PacmanSdkConstants.SOURCE).getAsJsonObject();
				rulePropsHashtable = new Gson().fromJson(ruleProps,new TypeToken<Hashtable<String, Object>>() {}.getType());
			}
		}
	} else {
		logger.info(PacmanSdkConstants.MISSING_DB_CONFIGURATION);
		throw new InvalidInputException(PacmanSdkConstants.MISSING_DB_CONFIGURATION);
	}

	
	configHashtable.putAll(appPropsHashtable);
	configHashtable.putAll(rulePropsHashtable);
	return configHashtable;
}