/** * Sets the parameters for the transformer. */ private void setTransformationParameters() { params.forEach((key, value) -> transformer.setParameter(key, value)); }
allProps.forEach((k, v) -> props.put(String.valueOf(k), String.valueOf(v)));
saxParser.parse(new InputSource(in), handler); handler.getFiles().forEach(ejbFiles::put); } catch (Exception e) { throw new BuildException(
env.forEach((key, value) -> log.debugf(" Property [%s] with value [%s]", key, key != InitialDirContext.SECURITY_CREDENTIALS ? Arrays2.objectToString(value) : "******"));
dirContext.getEnvironment().forEach(props::put); props.put(LdapContext.PROVIDER_URL, namingProviderURL); props.put(LdapContext.SECURITY_PRINCIPAL, distinguishedName);
/** * Set the properties to be used in the test. * @param p the properties. * This is a copy of the projects ant properties. */ public void setProperties(Hashtable<?, ?> p) { props = new Properties(); p.forEach(props::put); }
public final class ShorterFoo { public static void main(final String... args) { System.getProperties() .forEach((key, value) -> System.out.println(key + ": " + value)); } }
Properties vmProps = System.getProperties(); vmProps.forEach((t,u) -> System.out.println("Property: " + t + "\nValue: " + u + "\n"));
@Override public synchronized void forEach(BiConsumer<? super K,? super V> action) { getDelegate().forEach(action); }
@Override public synchronized void forEach(BiConsumer<? super K,? super V> action) { getDelegate().forEach(action); }
/** * */ private synchronized void syncMonitor() { observers.forEach((path, observer) -> this.monitor.getObservers().forEach(observer2 -> { Path path1 = Paths.get(observer2.getDirectory().toString()); if (!observers.containsKey(path1)) { this.monitor.removeObserver(observer2); } })); }
@Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { try { Hashtable<String, Object> uri = getURI(request); uri.forEach(MDC::put); filterChain.doFilter(request, response); } finally { clearMDC(); } }
/** Copy eligible files from the srcDir to destDir */ private void copyFilesToDestination() { if (!filecopyList.isEmpty()) { log("Copying " + filecopyList.size() + " file" + (filecopyList.size() == 1 ? "" : "s") + " to " + destDir.getAbsolutePath()); filecopyList.forEach((fromFile, toFile) -> { try { FileUtils.getFileUtils().copyFile(fromFile, toFile); } catch (IOException ioe) { throw new BuildException("Failed to copy " + fromFile + " to " + toFile + " due to " + ioe.getMessage(), ioe); } }); } }
private void addStringAttributesToCollectionSet(JMXDataSource ds, AbstractJmxSample sample, Resource resource, ObjectName objectName) { final String groupName = fixGroupName(JmxUtils.getGroupName(stringMap, sample.getMbean())); final String domain = objectName.getDomain(); final Hashtable<String, String> properties = objectName.getKeyPropertyList(); properties.forEach( (key, value) -> collectionSetBuilder.withStringAttribute(resource, groupName, key, value)); if (domain != null) { collectionSetBuilder.withStringAttribute(resource, groupName, "domain", objectName.getDomain()); } }
private void addStringAttributesToCollectionSet(JMXDataSource ds, AbstractJmxSample sample, Resource resource, ObjectName objectName) { final String groupName = fixGroupName(JmxUtils.getGroupName(stringMap, sample.getMbean())); final String domain = objectName.getDomain(); final Hashtable<String, String> properties = objectName.getKeyPropertyList(); properties.forEach( (key, value) -> collectionSetBuilder.withStringAttribute(resource, groupName, key, value)); if (domain != null) { collectionSetBuilder.withStringAttribute(resource, groupName, "domain", objectName.getDomain()); } }
env.forEach((key, value) -> log.debugf(" Property [%s] with value [%s]", key, key != InitialDirContext.SECURITY_CREDENTIALS ? Arrays2.objectToString(value) : "******"));
@Test(expected = ReactiveAuditException.class) public void forEach() { ReactiveAudit.off.commit(); Hashtable hash=new Hashtable(); TestTools.strict.commit(); hash.forEach(null); } @Test(expected = ReactiveAuditException.class)
dirContext.getEnvironment().forEach(props::put); props.put(LdapContext.PROVIDER_URL, namingProviderURL); props.put(LdapContext.SECURITY_PRINCIPAL, distinguishedName);
dirContext.getEnvironment().forEach(props::put); props.put(LdapContext.PROVIDER_URL, namingProviderURL); props.put(LdapContext.SECURITY_PRINCIPAL, distinguishedName);
dirContext.getEnvironment().forEach(props::put); props.put(LdapContext.PROVIDER_URL, namingProviderURL); props.put(LdapContext.SECURITY_PRINCIPAL, distinguishedName);