http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/util/ListConfigurator.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/ListConfigurator.java b/container/openejb-core/src/main/java/org/apache/openejb/util/ListConfigurator.java index 6d0af2f..221324b 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/ListConfigurator.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/ListConfigurator.java @@ -40,7 +40,7 @@ public final class ListConfigurator { return null; } - final List<T> list = new ArrayList<T>(); + final List<T> list = new ArrayList<>(); final String[] split = features.trim().split(","); for (final String feature : split) { if (feature == null || feature.trim().isEmpty()) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/util/Log4jLogStreamFactory.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/Log4jLogStreamFactory.java b/container/openejb-core/src/main/java/org/apache/openejb/util/Log4jLogStreamFactory.java index 47ad692..cf8ef5d 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/Log4jLogStreamFactory.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/Log4jLogStreamFactory.java @@ -137,7 +137,7 @@ public class Log4jLogStreamFactory implements LogStreamFactory { final File[] paths = {confDir, baseDir, userDir}; - final List<File> missing = new ArrayList<File>(); + final List<File> missing = new ArrayList<>(); for (final Map.Entry<Object, Object> entry : properties.entrySet()) { final String key = (String) entry.getKey(); http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/util/Logger.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/Logger.java b/container/openejb-core/src/main/java/org/apache/openejb/util/Logger.java index 2ccc43b..640a064 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/Logger.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/Logger.java @@ -329,7 +329,7 @@ public class Logger { isLog4j = false; - final List<String> locations = new ArrayList<String>(); + final List<String> locations = new ArrayList<>(); { final Properties configFile = log4j(loadLoggingProperties()); http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/util/Memoizer.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/Memoizer.java b/container/openejb-core/src/main/java/org/apache/openejb/util/Memoizer.java index 7b1c035..7bb7ea8 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/Memoizer.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/Memoizer.java @@ -25,7 +25,7 @@ import java.util.concurrent.Future; import java.util.concurrent.FutureTask; public class Memoizer<K, V> implements Computable<K, V> { - private final ConcurrentMap<K, Future<V>> cache = new ConcurrentHashMap<K, Future<V>>(); + private final ConcurrentMap<K, Future<V>> cache = new ConcurrentHashMap<>(); private final Computable<K, V> c; @@ -52,7 +52,7 @@ public class Memoizer<K, V> implements Computable<K, V> { return c.compute(key); } }; - final FutureTask<V> futureTask = new FutureTask<V>(eval); + final FutureTask<V> futureTask = new FutureTask<>(eval); future = cache.putIfAbsent(key, futureTask); if (future == null) { future = futureTask; http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/util/Messages.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/Messages.java b/container/openejb-core/src/main/java/org/apache/openejb/util/Messages.java index d125672..ddaf1b0 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/Messages.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/Messages.java @@ -70,7 +70,7 @@ public class Messages { messages = new EmptyResourceBundle(); } - formats = new ConcurrentHashMap<String, MessageFormat>(); + formats = new ConcurrentHashMap<>(); _rbBundles.put(resourceName, messages); _rbFormats.put(resourceName, formats); http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/util/ObjectRecipeHelper.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/ObjectRecipeHelper.java b/container/openejb-core/src/main/java/org/apache/openejb/util/ObjectRecipeHelper.java index 39db725..dc62e2a 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/ObjectRecipeHelper.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/ObjectRecipeHelper.java @@ -32,7 +32,7 @@ public final class ObjectRecipeHelper { public static Object createMeFromSystemProps(final String prefix, final String suffix, final Class<?> clazz) { final Properties props = SystemInstance.get().getProperties(); - final Map<String, Object> usedOnes = new HashMap<String, Object>(); + final Map<String, Object> usedOnes = new HashMap<>(); for (final Map.Entry<Object, Object> entry : props.entrySet()) { final String key = entry.getKey().toString(); http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/util/OpenEJBScripter.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/OpenEJBScripter.java b/container/openejb-core/src/main/java/org/apache/openejb/util/OpenEJBScripter.java index 31d74aa..5dcc3bd 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/OpenEJBScripter.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/OpenEJBScripter.java @@ -41,7 +41,7 @@ public class OpenEJBScripter { private static final ThreadLocal<Map<String, ScriptEngine>> ENGINES = new ThreadLocal<Map<String, ScriptEngine>>() { @Override protected Map<String, ScriptEngine> initialValue() { - return new HashMap<String, ScriptEngine>(); + return new HashMap<>(); } }; http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/util/PojoSerialization.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/PojoSerialization.java b/container/openejb-core/src/main/java/org/apache/openejb/util/PojoSerialization.java index ed6bc11..c08d18c 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/PojoSerialization.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/PojoSerialization.java @@ -270,7 +270,7 @@ public class PojoSerialization implements Serializable { } protected void write(final ObjectOutput out) throws IOException { - final List<Class> classes = new ArrayList<Class>(); + final List<Class> classes = new ArrayList<>(); Class c = object.getClass(); while (c != null && !c.equals(Object.class)) { classes.add(c); http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/util/Pool.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/Pool.java b/container/openejb-core/src/main/java/org/apache/openejb/util/Pool.java index a743978..738633b 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/Pool.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/Pool.java @@ -178,7 +178,7 @@ public class Pool<T> { private Executor createExecutor() { final ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(3, 10, 60L, SECONDS, - new LinkedBlockingQueue<Runnable>(2), new DaemonThreadFactory("org.apache.openejb.util.Pool", hashCode())); + new LinkedBlockingQueue<>(2), new DaemonThreadFactory("org.apache.openejb.util.Pool", hashCode())); threadPoolExecutor.setRejectedExecutionHandler(new RejectedExecutionHandler() { @Override http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/util/PropertiesHelper.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/PropertiesHelper.java b/container/openejb-core/src/main/java/org/apache/openejb/util/PropertiesHelper.java index 4dde67a..4a64fad 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/PropertiesHelper.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/PropertiesHelper.java @@ -42,7 +42,7 @@ public final class PropertiesHelper { } public static Map<String, Object> map(final Properties props) { - final Map<String, Object> map = new HashMap<String, Object>(); + final Map<String, Object> map = new HashMap<>(); for (final Map.Entry<Object, Object> entry : props.entrySet()) { map.put((String) entry.getKey(), entry.getValue()); } http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/util/References.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/References.java b/container/openejb-core/src/main/java/org/apache/openejb/util/References.java index 6e6be22..af015e3 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/References.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/References.java @@ -45,7 +45,7 @@ public class References { return objects; } - final Map<String, Node> nodes = new LinkedHashMap<String, Node>(); + final Map<String, Node> nodes = new LinkedHashMap<>(); // Create nodes for (final T obj : objects) { @@ -77,16 +77,16 @@ public class References { //detect circus if (circuitFounded) { - final Set<Circuit> circuits = new LinkedHashSet<Circuit>(); + final Set<Circuit> circuits = new LinkedHashSet<>(); for (final Node node : nodes.values()) { - findCircuits(circuits, node, new Stack<Node>()); + findCircuits(circuits, node, new Stack<>()); } - final ArrayList<Circuit> list = new ArrayList<Circuit>(circuits); + final ArrayList<Circuit> list = new ArrayList<>(circuits); Collections.sort(list); - final List<List> all = new ArrayList<List>(); + final List<List> all = new ArrayList<>(); for (final Circuit circuit : list) { all.add(unwrap(circuit.nodes)); } @@ -156,7 +156,7 @@ public class References { } private static <T> List<T> unwrap(final List<Node> nodes) { - final ArrayList<T> referees = new ArrayList<T>(nodes.size()); + final ArrayList<T> referees = new ArrayList<>(nodes.size()); for (final Node node : nodes) { referees.add((T) node.object); } @@ -167,7 +167,7 @@ public class References { if (stack.contains(node)) { final int fromIndex = stack.indexOf(node); final int toIndex = stack.size(); - final ArrayList<Node> circularity = new ArrayList<Node>(stack.subList(fromIndex, toIndex)); + final ArrayList<Node> circularity = new ArrayList<>(stack.subList(fromIndex, toIndex)); // add ending node to list so a full circuit is shown circularity.add(node); @@ -191,8 +191,8 @@ public class References { private static class Node implements Comparable<Node> { private final String name; private final Object object; - private final List<Node> initialReferences = new ArrayList<Node>(); - private final Set<Node> references = new HashSet<Node>(); + private final List<Node> initialReferences = new ArrayList<>(); + private final Set<Node> references = new HashSet<>(); private Node next; private Node previous; @@ -234,7 +234,7 @@ public class References { public Circuit(final List<Node> nodes) { this.nodes = nodes; - atomic = new ArrayList<Node>(nodes); + atomic = new ArrayList<>(nodes); atomic.remove(atomic.size() - 1); Collections.sort(atomic); } http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/util/SimpleJSonParser.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/SimpleJSonParser.java b/container/openejb-core/src/main/java/org/apache/openejb/util/SimpleJSonParser.java index 99ea6a7..3b98bd5 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/SimpleJSonParser.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/SimpleJSonParser.java @@ -36,11 +36,11 @@ public final class SimpleJSonParser { current = (char) read; // cast after otherwise -1 test will likely fail if the input file is not correct if (current == '{') { - json = new HashMap<String, Object>(); + json = new HashMap<>(); } else if (current == '}') { return json; } else if (current == '[') { - array = new ArrayList<Object>(); + array = new ArrayList<>(); } else if (current == ']') { return array; } else if (current == '"') { http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/util/SuperProperties.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/SuperProperties.java b/container/openejb-core/src/main/java/org/apache/openejb/util/SuperProperties.java index ae2049b..bac40b7 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/SuperProperties.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/SuperProperties.java @@ -72,17 +72,17 @@ public class SuperProperties extends Properties { /** * Actual property values. */ - protected LinkedHashMap<Object, Object> properties = new LinkedHashMap<Object, Object>(); + protected LinkedHashMap<Object, Object> properties = new LinkedHashMap<>(); /** * Comments for individual the properties. */ - protected LinkedHashMap<String, String> comments = new LinkedHashMap<String, String>(); + protected LinkedHashMap<String, String> comments = new LinkedHashMap<>(); /** * Attributes for the properties. */ - protected LinkedHashMap<String, LinkedHashMap<String, String>> attributes = new LinkedHashMap<String, LinkedHashMap<String, String>>(); + protected LinkedHashMap<String, LinkedHashMap<String, String>> attributes = new LinkedHashMap<>(); /** * The default property values. @@ -432,7 +432,7 @@ public class SuperProperties extends Properties { // never null, contains the comment for the property or nothing if no comment StringBuilder comment = new StringBuilder(); // never null, contains attributes for a property - LinkedHashMap<String, String> attributes = new LinkedHashMap<String, String>(); + LinkedHashMap<String, String> attributes = new LinkedHashMap<>(); int indent = 0; boolean globalIndentSet = false; @@ -491,7 +491,7 @@ public class SuperProperties extends Properties { } // add attributes this.attributes.put(normalize(key.toString()), attributes); - attributes = new LinkedHashMap<String, String>(); + attributes = new LinkedHashMap<>(); // set line indent if (!globalIndentSet) { setIndent(indent); @@ -781,7 +781,7 @@ public class SuperProperties extends Properties { return keys(); } - final Hashtable<Object, Object> set = new Hashtable<Object, Object>(defaults.size() + size()); + final Hashtable<Object, Object> set = new Hashtable<>(defaults.size() + size()); Enumeration<?> keys = defaults.propertyNames(); while (keys.hasMoreElements()) { set.put(keys.nextElement(), set); @@ -969,7 +969,7 @@ public class SuperProperties extends Properties { // read comment line by line final StringBuilder comment = new StringBuilder(); - final LinkedHashMap<String, String> attributes = new LinkedHashMap<String, String>(); + final LinkedHashMap<String, String> attributes = new LinkedHashMap<>(); int nextByte; char nextChar; @@ -1199,7 +1199,7 @@ public class SuperProperties extends Properties { if (key instanceof String) { final String name = (String) key; if (!attributes.containsKey(name)) { - attributes.put(name, new LinkedHashMap<String, String>()); + attributes.put(name, new LinkedHashMap<>()); } } return properties.put(key, value); http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/util/URISupport.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/URISupport.java b/container/openejb-core/src/main/java/org/apache/openejb/util/URISupport.java index 208ed85..bb2c6cb 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/URISupport.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/URISupport.java @@ -83,7 +83,7 @@ public class URISupport { } } - final List<String> path = new ArrayList<String>(); + final List<String> path = new ArrayList<>(); for (int x = pathA.size() - lastMatch; x > 0; x--) { path.add(".."); } @@ -168,7 +168,7 @@ public class URISupport { public static Map<String, String> parseQuery(final String uri) throws URISyntaxException { try { - final Map<String, String> rc = new LinkedHashMap<String, String>(); + final Map<String, String> rc = new LinkedHashMap<>(); if (uri != null) { final String[] parameters = uri.split("&"); for (int i = 0; i < parameters.length; i++) { @@ -265,7 +265,7 @@ public class URISupport { } private static String[] splitComponents(final String str) { - final ArrayList<String> l = new ArrayList<String>(); + final ArrayList<String> l = new ArrayList<>(); int last = 0; int depth = 0; http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/util/UrlCache.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/UrlCache.java b/container/openejb-core/src/main/java/org/apache/openejb/util/UrlCache.java index 362d5ea..25c20a1 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/UrlCache.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/UrlCache.java @@ -60,7 +60,7 @@ public class UrlCache { } - private final Map<String, Map<URL, File>> cache = new TreeMap<String, Map<URL, File>>(); + private final Map<String, Map<URL, File>> cache = new TreeMap<>(); public synchronized URL[] cacheUrls(final String appId, final URL[] urls) { if (!antiJarLocking) { @@ -68,11 +68,11 @@ public class UrlCache { } // the final cached urls - final LinkedHashSet<URL> cachedUrls = new LinkedHashSet<URL>(); + final LinkedHashSet<URL> cachedUrls = new LinkedHashSet<>(); // this stack contains the urls to be processed... when manifest class path entries // are added they are added to the top (front) of the stack so manifest order is maintained - final LinkedList<URL> locationStack = new LinkedList<URL>(Arrays.asList(urls)); + final LinkedList<URL> locationStack = new LinkedList<>(Arrays.asList(urls)); while (!locationStack.isEmpty()) { final URL url = locationStack.removeFirst(); @@ -246,7 +246,7 @@ public class UrlCache { private synchronized Map<URL, File> getAppCache(final String appId) { Map<URL, File> urlFileMap = cache.get(appId); if (urlFileMap == null) { - urlFileMap = new LinkedHashMap<URL, File>(); + urlFileMap = new LinkedHashMap<>(); cache.put(appId, urlFileMap); } return urlFileMap; @@ -269,7 +269,7 @@ public class UrlCache { // build the urls... // the class-path attribute is space delimited - final LinkedList<URL> classPathUrls = new LinkedList<URL>(); + final LinkedList<URL> classPathUrls = new LinkedList<>(); for (final StringTokenizer tokenizer = new StringTokenizer(manifestClassPath, " "); tokenizer.hasMoreTokens(); ) { final String entry = tokenizer.nextToken(); try { http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/util/UrlComparator.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/UrlComparator.java b/container/openejb-core/src/main/java/org/apache/openejb/util/UrlComparator.java index 8603132..2d6bf74 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/UrlComparator.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/UrlComparator.java @@ -66,7 +66,7 @@ public class UrlComparator implements Comparator<URL> { } private List<String> path(final File file) { - final ArrayList<String> path = new ArrayList<String>(); + final ArrayList<String> path = new ArrayList<>(); path(file, path); return path; } http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/Jdk13ProxyFactory.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/Jdk13ProxyFactory.java b/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/Jdk13ProxyFactory.java index 2b313b1..5444628 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/Jdk13ProxyFactory.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/Jdk13ProxyFactory.java @@ -110,7 +110,7 @@ public class Jdk13ProxyFactory implements ProxyFactory { } private static ClassLoader reconciliate(final Class<?>... interfaces) { - final Set<ClassLoader> classloaders = new LinkedHashSet<ClassLoader>(); + final Set<ClassLoader> classloaders = new LinkedHashSet<>(); for (final Class<?> clazz : interfaces) { classloaders.add(clazz.getClassLoader()); } http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java b/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java index 053e4d4..07667ad 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java @@ -174,7 +174,7 @@ public class LocalBeanProxyFactory implements Opcodes { cw.visitField(ACC_FINAL + ACC_PRIVATE, BUSSINESS_HANDLER_NAME, "Ljava/lang/reflect/InvocationHandler;", null, null).visitEnd(); cw.visitField(ACC_FINAL + ACC_PRIVATE, NON_BUSINESS_HANDLER_NAME, "Ljava/lang/reflect/InvocationHandler;", null, null).visitEnd(); - final Map<String, List<Method>> methodMap = new HashMap<String, List<Method>>(); + final Map<String, List<Method>> methodMap = new HashMap<>(); getNonPrivateMethods(classToProxy, methodMap); @@ -220,7 +220,7 @@ public class LocalBeanProxyFactory implements Opcodes { List<Method> methods = methodMap.get(method.getName()); if (methods == null) { - methods = new ArrayList<Method>(); + methods = new ArrayList<>(); methods.add(method); methodMap.put(method.getName(), methods); } else { http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/ProxyEJB.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/ProxyEJB.java b/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/ProxyEJB.java index 6677d66..eae97d8 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/ProxyEJB.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/ProxyEJB.java @@ -62,7 +62,7 @@ public final class ProxyEJB { private final Object deploymentID; public Handler(final BeanContext bc) { - beanContextRef = new WeakReference<BeanContext>(bc); + beanContextRef = new WeakReference<>(bc); deploymentID = bc.getDeploymentID(); } http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/QueryProxy.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/QueryProxy.java b/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/QueryProxy.java index ae3b673..19ee12c 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/QueryProxy.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/QueryProxy.java @@ -62,8 +62,8 @@ public class QueryProxy implements InvocationHandler { public static final String AND = "And"; // cache for finders of the current instance - private final Map<String, Class<?>> returnsTypes = new ConcurrentHashMap<String, Class<?>>(); - private final Map<String, List<String>> conditions = new ConcurrentHashMap<String, List<String>>(); + private final Map<String, Class<?>> returnsTypes = new ConcurrentHashMap<>(); + private final Map<String, List<String>> conditions = new ConcurrentHashMap<>(); private EntityManager em; @@ -367,7 +367,7 @@ public class QueryProxy implements InvocationHandler { if (conditions.containsKey(methodName)) { parsed = conditions.get(methodName); } else { - parsed = new ArrayList<String>(); + parsed = new ArrayList<>(); String toParse = methodName.substring(FIND_PREFIX.length()); if (toParse.startsWith(BY)) { http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/web/LightweightWebAppBuilder.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/web/LightweightWebAppBuilder.java b/container/openejb-core/src/main/java/org/apache/openejb/web/LightweightWebAppBuilder.java index 00267f7..2c72a19 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/web/LightweightWebAppBuilder.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/web/LightweightWebAppBuilder.java @@ -109,10 +109,10 @@ public class LightweightWebAppBuilder implements WebAppBuilder { } } - private final Map<WebAppInfo, DeployedWebObjects> servletDeploymentInfo = new HashMap<WebAppInfo, DeployedWebObjects>(); - private final Map<WebAppInfo, List<Object>> listeners = new HashMap<WebAppInfo, List<Object>>(); - private final Map<WebAppInfo, ServletContextEvent> servletContextEvents = new HashMap<WebAppInfo, ServletContextEvent>(); - private final Map<String, ClassLoader> loaderByWebContext = new HashMap<String, ClassLoader>(); + private final Map<WebAppInfo, DeployedWebObjects> servletDeploymentInfo = new HashMap<>(); + private final Map<WebAppInfo, List<Object>> listeners = new HashMap<>(); + private final Map<WebAppInfo, ServletContextEvent> servletContextEvents = new HashMap<>(); + private final Map<String, ClassLoader> loaderByWebContext = new HashMap<>(); public void setClassLoader(final String id, final ClassLoader loader) { loaderByWebContext.put(id, loader); @@ -137,13 +137,13 @@ public class LightweightWebAppBuilder implements WebAppBuilder { classLoader = appClassLoader; } - final Set<Injection> injections = new HashSet<Injection>(appContext.getInjections()); + final Set<Injection> injections = new HashSet<>(appContext.getInjections()); injections.addAll(new InjectionBuilder(classLoader).buildInjections(webAppInfo.jndiEnc)); final List<BeanContext> beanContexts; if (!appInfo.webAppAlone) { // add module bindings in app final Assembler assembler = SystemInstance.get().getComponent(Assembler.class); - beanContexts = assembler.initEjbs(classLoader, appInfo, appContext, injections, new ArrayList<BeanContext>(), webAppInfo.moduleId); + beanContexts = assembler.initEjbs(classLoader, appInfo, appContext, injections, new ArrayList<>(), webAppInfo.moduleId); appContext.getBeanContexts().addAll(beanContexts); } else { beanContexts = null; @@ -195,7 +195,7 @@ public class LightweightWebAppBuilder implements WebAppBuilder { List<Object> list = listeners.get(webAppInfo); if (list == null) { - list = new ArrayList<Object>(); + list = new ArrayList<>(); listeners.put(webAppInfo, list); } list.add(instance); @@ -218,7 +218,7 @@ public class LightweightWebAppBuilder implements WebAppBuilder { List<Object> list = listeners.get(webAppInfo); if (list == null) { - list = new ArrayList<Object>(); + list = new ArrayList<>(); listeners.put(webAppInfo, list); } list.add(instance); @@ -293,7 +293,7 @@ public class LightweightWebAppBuilder implements WebAppBuilder { } } - final Map<String, PortInfo> ports = new TreeMap<String, PortInfo>(); + final Map<String, PortInfo> ports = new TreeMap<>(); for (final PortInfo port : webAppInfo.portInfos) { ports.put(port.serviceLink, port); } @@ -491,8 +491,8 @@ public class LightweightWebAppBuilder implements WebAppBuilder { } private static class DeployedWebObjects { - public List<String> mappings = new ArrayList<String>(); - public List<String> filterMappings = new ArrayList<String>(); + public List<String> mappings = new ArrayList<>(); + public List<String> filterMappings = new ArrayList<>(); public WebContext webContext; } http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/DependenceValidationTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/DependenceValidationTest.java b/container/openejb-core/src/test/java/org/apache/openejb/DependenceValidationTest.java index 965c77b..01c5750 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/DependenceValidationTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/DependenceValidationTest.java @@ -88,7 +88,7 @@ public class DependenceValidationTest extends TestCase { private void assertNotDependentOn(final String referringPacakge, final String referredPackage, final String... exemptionsArray) { if (referringPacakge.equals(referredPackage)) return; - final List<String> exemptions = new ArrayList<String>(Arrays.asList(exemptionsArray)); + final List<String> exemptions = new ArrayList<>(Arrays.asList(exemptionsArray)); exemptions.add(referredPackage); for (final Map.Entry<String, Map<String, Integer>> entry : depsOfPackages.entrySet()) { http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/DependencyVisitor.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/DependencyVisitor.java b/container/openejb-core/src/test/java/org/apache/openejb/DependencyVisitor.java index 5898626..d6abf86 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/DependencyVisitor.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/DependencyVisitor.java @@ -65,9 +65,9 @@ import java.util.Set; * @version $Rev$ $Date$ */ public class DependencyVisitor extends EmptyVisitor { - Set<String> packages = new HashSet<String>(); + Set<String> packages = new HashSet<>(); - Map<String, Map<String, Integer>> groups = new HashMap<String, Map<String, Integer>>(); + Map<String, Map<String, Integer>> groups = new HashMap<>(); Map<String, Integer> current; @@ -90,12 +90,12 @@ public class DependencyVisitor extends EmptyVisitor { final String[] interfaces) { if (name.startsWith("org/apache/openejb/OpenEjbContainer")) { - current = new HashMap<String, Integer>(); + current = new HashMap<>(); } else { final String p = getGroupKey(name); current = groups.get(p); if (current == null) { - current = new HashMap<String, Integer>(); + current = new HashMap<>(); groups.put(p, current); } http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/OpenEjbContainerTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/OpenEjbContainerTest.java b/container/openejb-core/src/test/java/org/apache/openejb/OpenEjbContainerTest.java index d929e46..07c1418 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/OpenEjbContainerTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/OpenEjbContainerTest.java @@ -35,7 +35,7 @@ public class OpenEjbContainerTest extends TestCase { public void testInject() throws Exception { - final Map<String, Object> map = new HashMap<String, Object>(); + final Map<String, Object> map = new HashMap<>(); final EjbJar ejbJar = new EjbJar(); @@ -68,7 +68,7 @@ public class OpenEjbContainerTest extends TestCase { private Widget widget; public void startTheContainer() throws Exception { - final Map<String, Object> map = new HashMap<String, Object>(); + final Map<String, Object> map = new HashMap<>(); final EjbJar ejbJar = new EjbJar(); http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/assembler/DeployerEjbTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/assembler/DeployerEjbTest.java b/container/openejb-core/src/test/java/org/apache/openejb/assembler/DeployerEjbTest.java index 1cb0052..6d152de 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/assembler/DeployerEjbTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/assembler/DeployerEjbTest.java @@ -158,7 +158,7 @@ public class DeployerEjbTest { Collection<AppInfo> deployedApps = deployer.getDeployedApps(); if (null == deployedApps) { - deployedApps = new ArrayList<AppInfo>(); + deployedApps = new ArrayList<>(); } if (deployedApps.size() < 1) { http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/AccessTimeoutTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/AccessTimeoutTest.java b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/AccessTimeoutTest.java index 127db6a..47c052e 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/AccessTimeoutTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/AccessTimeoutTest.java @@ -124,8 +124,8 @@ public class AccessTimeoutTest extends TestCase { private void loadAttributes(final EjbJarInfo ejbJarInfo, final String deploymentId) { final ContainerSystem system = SystemInstance.get().getComponent(ContainerSystem.class); final BeanContext beanContext = system.getBeanContext(deploymentId); - final List<MethodConcurrencyInfo> lockInfos = new ArrayList<MethodConcurrencyInfo>(); - final List<MethodConcurrencyInfo> accessTimeoutInfos = new ArrayList<MethodConcurrencyInfo>(); + final List<MethodConcurrencyInfo> lockInfos = new ArrayList<>(); + final List<MethodConcurrencyInfo> accessTimeoutInfos = new ArrayList<>(); MethodConcurrencyBuilder.normalize(ejbJarInfo.methodConcurrency, lockInfos, accessTimeoutInfos); attributes = MethodInfoUtil.resolveAttributes(accessTimeoutInfos, beanContext); } http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/AppNamingReadOnlyTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/AppNamingReadOnlyTest.java b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/AppNamingReadOnlyTest.java index e63a275..8262ddd 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/AppNamingReadOnlyTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/AppNamingReadOnlyTest.java @@ -87,9 +87,9 @@ public class AppNamingReadOnlyTest extends TestCase { AppContext mockAppContext = new AppContext("appId", SystemInstance.get(), this.getClass().getClassLoader(), context, context, false); ModuleContext mockModuleContext = new ModuleContext("moduleId", new URI(""), "uniqueId", mockAppContext, context, this.getClass().getClassLoader()); - BeanContext mockBeanContext = new BeanContext("test", context, mockModuleContext, this.getClass(), this.getClass(), new HashMap<String, String>()); + BeanContext mockBeanContext = new BeanContext("test", context, mockModuleContext, this.getClass(), this.getClass(), new HashMap<>()); - List<BeanContext> beanContextsList = new ArrayList<BeanContext>(); + List<BeanContext> beanContextsList = new ArrayList<>(); beanContextsList.add(mockBeanContext); return beanContextsList; http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/ConcurrentLockTypeTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/ConcurrentLockTypeTest.java b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/ConcurrentLockTypeTest.java index 072605a..714565d 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/ConcurrentLockTypeTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/ConcurrentLockTypeTest.java @@ -131,8 +131,8 @@ public class ConcurrentLockTypeTest extends TestCase { private void loadAttributes(final EjbJarInfo ejbJarInfo, final String deploymentId) { final ContainerSystem system = SystemInstance.get().getComponent(ContainerSystem.class); final BeanContext beanContext = system.getBeanContext(deploymentId); - final List<MethodConcurrencyInfo> lockInfos = new ArrayList<MethodConcurrencyInfo>(); - final List<MethodConcurrencyInfo> accessTimeoutInfos = new ArrayList<MethodConcurrencyInfo>(); + final List<MethodConcurrencyInfo> lockInfos = new ArrayList<>(); + final List<MethodConcurrencyInfo> accessTimeoutInfos = new ArrayList<>(); MethodConcurrencyBuilder.normalize(ejbJarInfo.methodConcurrency, lockInfos, accessTimeoutInfos); attributes = MethodInfoUtil.resolveAttributes(lockInfos, beanContext); } http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/ConcurrentMethodTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/ConcurrentMethodTest.java b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/ConcurrentMethodTest.java index 9eab0ab..8d7de62 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/ConcurrentMethodTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/ConcurrentMethodTest.java @@ -85,8 +85,8 @@ public class ConcurrentMethodTest extends TestCase { private void loadAttributes(final EjbJarInfo ejbJarInfo, final String deploymentId) { final ContainerSystem system = SystemInstance.get().getComponent(ContainerSystem.class); final BeanContext beanContext = system.getBeanContext(deploymentId); - final List<MethodConcurrencyInfo> lockInfos = new ArrayList<MethodConcurrencyInfo>(); - final List<MethodConcurrencyInfo> accessTimeoutInfos = new ArrayList<MethodConcurrencyInfo>(); + final List<MethodConcurrencyInfo> lockInfos = new ArrayList<>(); + final List<MethodConcurrencyInfo> accessTimeoutInfos = new ArrayList<>(); MethodConcurrencyBuilder.normalize(ejbJarInfo.methodConcurrency, lockInfos, accessTimeoutInfos); accessTimeoutAttributes = MethodInfoUtil.resolveAttributes(accessTimeoutInfos, beanContext); lockAttributes = MethodInfoUtil.resolveAttributes(lockInfos, beanContext); http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/DataSourceDefinitionTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/DataSourceDefinitionTest.java b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/DataSourceDefinitionTest.java index 8565047..92d001a 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/DataSourceDefinitionTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/DataSourceDefinitionTest.java @@ -213,7 +213,7 @@ public class DataSourceDefinitionTest { } public List<Movie> getMovies() throws Exception { - final ArrayList<Movie> movies = new ArrayList<Movie>(); + final ArrayList<Movie> movies = new ArrayList<>(); final Connection conn = movieDatabase.getConnection(); try { final PreparedStatement sql = conn.prepareStatement("SELECT director, title, year from movie"); http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/DescriptorDataSourceDefinitionTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/DescriptorDataSourceDefinitionTest.java b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/DescriptorDataSourceDefinitionTest.java index 00ec64b..b7abc32 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/DescriptorDataSourceDefinitionTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/DescriptorDataSourceDefinitionTest.java @@ -194,7 +194,7 @@ public class DescriptorDataSourceDefinitionTest { } public List<Movie> getMovies() throws Exception { - final ArrayList<Movie> movies = new ArrayList<Movie>(); + final ArrayList<Movie> movies = new ArrayList<>(); final Connection conn = movieDatabase.getConnection(); try { final PreparedStatement sql = conn.prepareStatement("SELECT director, title, year from movie"); http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/InterceptorBindingInfoComparatorTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/InterceptorBindingInfoComparatorTest.java b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/InterceptorBindingInfoComparatorTest.java index d4ce19c..50299ff 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/InterceptorBindingInfoComparatorTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/InterceptorBindingInfoComparatorTest.java @@ -30,7 +30,7 @@ public class InterceptorBindingInfoComparatorTest extends TestCase { public void testHighLevelOrdering() throws Exception { - final ArrayList<InterceptorBindingInfo> expected = new ArrayList<InterceptorBindingInfo>(); + final ArrayList<InterceptorBindingInfo> expected = new ArrayList<>(); InterceptorBindingInfo info = null; @@ -57,10 +57,10 @@ public class InterceptorBindingInfoComparatorTest extends TestCase { info.interceptors.add("BeanTwoMethodInterceptorDos"); info.method = new NamedMethodInfo(); info.method.methodName = "ping"; - info.method.methodParams = new ArrayList<String>(); + info.method.methodParams = new ArrayList<>(); info.method.methodParams.add("java.lang.String"); - final ArrayList<InterceptorBindingInfo> actual = new ArrayList<InterceptorBindingInfo>(expected); + final ArrayList<InterceptorBindingInfo> actual = new ArrayList<>(expected); Collections.shuffle(actual); Collections.sort(actual, new InterceptorBindingBuilder.IntercpetorBindingComparator()); @@ -73,8 +73,8 @@ public class InterceptorBindingInfoComparatorTest extends TestCase { public void testInnerLevelOrdering() { - final ArrayList<InterceptorBindingInfo> expected = new ArrayList<InterceptorBindingInfo>(); - final ArrayList<InterceptorBindingInfo> actual = new ArrayList<InterceptorBindingInfo>(7); + final ArrayList<InterceptorBindingInfo> expected = new ArrayList<>(); + final ArrayList<InterceptorBindingInfo> actual = new ArrayList<>(7); for (int i = 0; i < 7; i++) actual.add(null); InterceptorBindingInfo info = null; http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/JdbcConfigTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/JdbcConfigTest.java b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/JdbcConfigTest.java index 5779764..b2180be 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/JdbcConfigTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/JdbcConfigTest.java @@ -75,7 +75,7 @@ public class JdbcConfigTest extends TestCase { } private void verifyManagedConnections(final DataSource dataSource) throws SQLException { - final List<Connection> managedConnections = new ArrayList<Connection>(); + final List<Connection> managedConnections = new ArrayList<>(); try { for (int i = 0; i < 4; i++) { final Connection connection = dataSource.getConnection(); @@ -102,7 +102,7 @@ public class JdbcConfigTest extends TestCase { } private void verifyUnmanagedConnections(final DataSource dataSource) throws SQLException { - final List<Connection> unmanagedConnections = new ArrayList<Connection>(); + final List<Connection> unmanagedConnections = new ArrayList<>(); try { for (int i = 0; i < 4; i++) { final Connection connection = dataSource.getConnection(); http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/LinkResolverTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/LinkResolverTest.java b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/LinkResolverTest.java index e41e54d..71fde08 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/LinkResolverTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/LinkResolverTest.java @@ -24,7 +24,7 @@ import java.net.URI; public class LinkResolverTest extends TestCase { public void test() throws Exception { - final LinkResolver<Thing> resolver = new LinkResolver<Thing>(); + final LinkResolver<Thing> resolver = new LinkResolver<>(); resolver.add("my/module.jar", "one", Thing.ONE); resolver.add("some/other.jar", "two", Thing.TWO); http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/MethodTransactionInfoComparatorTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/MethodTransactionInfoComparatorTest.java b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/MethodTransactionInfoComparatorTest.java index 0feb88d..3246bff 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/MethodTransactionInfoComparatorTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/MethodTransactionInfoComparatorTest.java @@ -29,7 +29,7 @@ public class MethodTransactionInfoComparatorTest extends TestCase { public void testOrdering() throws Exception { - final ArrayList<MethodTransactionInfo> expected = new ArrayList<MethodTransactionInfo>(); + final ArrayList<MethodTransactionInfo> expected = new ArrayList<>(); MethodTransactionInfo info = null; MethodInfo method = null; @@ -67,11 +67,11 @@ public class MethodTransactionInfoComparatorTest extends TestCase { method.ejbName = "PingEJB"; method.className = "*"; method.methodName = "ping"; - method.methodParams = new ArrayList<String>(); + method.methodParams = new ArrayList<>(); method.methodParams.add("java.lang.String"); info.methods.add(method); - final ArrayList<MethodTransactionInfo> actual = new ArrayList<MethodTransactionInfo>(expected); + final ArrayList<MethodTransactionInfo> actual = new ArrayList<>(expected); Collections.shuffle(actual); Collections.sort(actual, new MethodTransactionBuilder.MethodTransactionComparator()); http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/OpenEjbConfigurationValidationTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/OpenEjbConfigurationValidationTest.java b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/OpenEjbConfigurationValidationTest.java index 17d7c07..95109c7 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/OpenEjbConfigurationValidationTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/OpenEjbConfigurationValidationTest.java @@ -54,7 +54,7 @@ import java.util.Set; */ public class OpenEjbConfigurationValidationTest extends TestCase { - private final List<Class> seen = new ArrayList<Class>(); + private final List<Class> seen = new ArrayList<>(); public void testValidate() throws Exception { seen.add(Object.class); http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/ResourceInfoComparatorTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/ResourceInfoComparatorTest.java b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/ResourceInfoComparatorTest.java index 0fa95b8..c7694c0 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/ResourceInfoComparatorTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/assembler/classic/ResourceInfoComparatorTest.java @@ -31,7 +31,7 @@ import java.util.Properties; public class ResourceInfoComparatorTest extends TestCase { public void test() throws Exception { - final List<ResourceInfo> resources = new ArrayList<ResourceInfo>(); + final List<ResourceInfo> resources = new ArrayList<>(); resources.add(new ResourceInfo()); resources.get(0).id = "Red"; @@ -69,7 +69,7 @@ public class ResourceInfoComparatorTest extends TestCase { } public void testRealWorld() throws Exception { - final List<ResourceInfo> resources = new ArrayList<ResourceInfo>(); + final List<ResourceInfo> resources = new ArrayList<>(); resources.add(new ResourceInfo()); resources.get(0).id = "My DataSource"; @@ -99,7 +99,7 @@ public class ResourceInfoComparatorTest extends TestCase { } public void testRealWorld2() throws Exception { - final List<ResourceInfo> resources = new ArrayList<ResourceInfo>(); + final List<ResourceInfo> resources = new ArrayList<>(); resources.add(new ResourceInfo()); resources.get(0).id = "My JMS Connection Factory"; http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/cdi/BasicObserverTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/cdi/BasicObserverTest.java b/container/openejb-core/src/test/java/org/apache/openejb/cdi/BasicObserverTest.java index 8f2bc11..bcad148 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/cdi/BasicObserverTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/cdi/BasicObserverTest.java @@ -66,7 +66,7 @@ public class BasicObserverTest { } public static class Catastrophy { - private final List<Class> classes = new ArrayList<Class>(); + private final List<Class> classes = new ArrayList<>(); public List<Class> getClasses() { return classes; http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/cdi/DependentScopedTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/cdi/DependentScopedTest.java b/container/openejb-core/src/test/java/org/apache/openejb/cdi/DependentScopedTest.java index 563a065..542f95d 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/cdi/DependentScopedTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/cdi/DependentScopedTest.java @@ -97,7 +97,7 @@ public class DependentScopedTest extends TestCase { public static class ColorWheel implements ColorWheelLocal { - private final List<Color> colors = new ArrayList<Color>(); + private final List<Color> colors = new ArrayList<>(); @Inject public void set(final Red color) { http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/config/AnnotationDeployerTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/config/AnnotationDeployerTest.java b/container/openejb-core/src/test/java/org/apache/openejb/config/AnnotationDeployerTest.java index 3b0a075..71e7666 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/config/AnnotationDeployerTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/config/AnnotationDeployerTest.java @@ -286,7 +286,7 @@ public class AnnotationDeployerTest { public void testConfigProperties() throws Exception { final ClassFinder finder = new ClassFinder(TestAdminObject.class); - final List<ConfigProperty> configProperty = new ArrayList<ConfigProperty>(); + final List<ConfigProperty> configProperty = new ArrayList<>(); final Object object = new Object() { public List<ConfigProperty> getConfigProperty() { http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/config/ApplicationPropertiesTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/config/ApplicationPropertiesTest.java b/container/openejb-core/src/test/java/org/apache/openejb/config/ApplicationPropertiesTest.java index e98e11f..c3c0eea 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/config/ApplicationPropertiesTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/config/ApplicationPropertiesTest.java @@ -62,7 +62,7 @@ public class ApplicationPropertiesTest extends TestCase { } { - final Map<String, String> map = new HashMap<String, String>(); + final Map<String, String> map = new HashMap<>(); map.put("META-INF/application.properties", "color=orange"); final File app = Archives.fileArchive(map, WidgetBean.class); @@ -94,13 +94,13 @@ public class ApplicationPropertiesTest extends TestCase { } { - final Map<String, String> moduleFiles = new HashMap<String, String>(); + final Map<String, String> moduleFiles = new HashMap<>(); moduleFiles.put("META-INF/ejb-jar.xml", "<ejb-jar id=\"fooModule\"/>"); moduleFiles.put("META-INF/application.properties", "color=white"); final File module = Archives.jarArchive(moduleFiles, "fooModule", WidgetBean.class); - final Map<String, String> appFiles = new HashMap<String, String>(); + final Map<String, String> appFiles = new HashMap<>(); appFiles.put("META-INF/application.xml", "" + "<application id=\"fooApp\">\n" + " <module>\n" + @@ -134,7 +134,7 @@ public class ApplicationPropertiesTest extends TestCase { { SystemInstance.get().getProperties().put("fooApp.color", "orange"); - final Map<String, String> map = new HashMap<String, String>(); + final Map<String, String> map = new HashMap<>(); map.put("META-INF/ejb-jar.xml", "<ejb-jar id=\"fooModule\"/>"); final File module = Archives.fileArchive(map, WidgetBean.class); @@ -160,7 +160,7 @@ public class ApplicationPropertiesTest extends TestCase { { SystemInstance.get().getProperties().put("fooApp.color", "orange"); - final Map<String, String> map = new HashMap<String, String>(); + final Map<String, String> map = new HashMap<>(); map.put("META-INF/ejb-jar.xml", "<ejb-jar id=\"fooModule\"/>"); map.put("META-INF/application.properties", "color=white"); @@ -189,7 +189,7 @@ public class ApplicationPropertiesTest extends TestCase { SystemInstance.get().getProperties().put("openejb.fooApp.color", "orange"); SystemInstance.get().getProperties().put("fooApp.color", "green"); - final Map<String, String> map = new HashMap<String, String>(); + final Map<String, String> map = new HashMap<>(); map.put("META-INF/ejb-jar.xml", "<ejb-jar id=\"fooModule\"/>"); final File module = Archives.fileArchive(map, WidgetBean.class); @@ -216,7 +216,7 @@ public class ApplicationPropertiesTest extends TestCase { SystemInstance.get().getProperties().put("tomee.fooApp.color", "orange"); SystemInstance.get().getProperties().put("fooApp.color", "green"); - final Map<String, String> map = new HashMap<String, String>(); + final Map<String, String> map = new HashMap<>(); map.put("META-INF/ejb-jar.xml", "<ejb-jar id=\"fooModule\"/>"); final File module = Archives.fileArchive(map, WidgetBean.class); http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/config/AutoConfigMdbContainerTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/config/AutoConfigMdbContainerTest.java b/container/openejb-core/src/test/java/org/apache/openejb/config/AutoConfigMdbContainerTest.java index 0863ca7..7069d19 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/config/AutoConfigMdbContainerTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/config/AutoConfigMdbContainerTest.java @@ -116,7 +116,7 @@ public class AutoConfigMdbContainerTest extends TestCase { public static class EmailResourceAdapter implements javax.resource.spi.ResourceAdapter { public boolean started; - private final Map<String, EmailConsumer> consumers = new HashMap<String, EmailConsumer>(); + private final Map<String, EmailConsumer> consumers = new HashMap<>(); public void start(final BootstrapContext bootstrapContext) throws ResourceAdapterInternalException { } http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/config/AutoConfigResourceRefsTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/config/AutoConfigResourceRefsTest.java b/container/openejb-core/src/test/java/org/apache/openejb/config/AutoConfigResourceRefsTest.java index 79f6b2b..db44041 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/config/AutoConfigResourceRefsTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/config/AutoConfigResourceRefsTest.java @@ -60,7 +60,7 @@ public class AutoConfigResourceRefsTest extends TestCase { final EnterpriseBeanInfo beanInfo = ejbJarInfo.enterpriseBeans.get(0); - final Map<String, ResourceReferenceInfo> refs = new HashMap<String, ResourceReferenceInfo>(); + final Map<String, ResourceReferenceInfo> refs = new HashMap<>(); for (final ResourceReferenceInfo ref : beanInfo.jndiEnc.resourceRefs) { refs.put(ref.referenceName.replaceAll(".*/", ""), ref); } @@ -102,7 +102,7 @@ public class AutoConfigResourceRefsTest extends TestCase { final EnterpriseBeanInfo beanInfo = ejbJarInfo.enterpriseBeans.get(0); - final Map<String, ResourceReferenceInfo> refs = new HashMap<String, ResourceReferenceInfo>(); + final Map<String, ResourceReferenceInfo> refs = new HashMap<>(); for (final ResourceReferenceInfo ref : beanInfo.jndiEnc.resourceRefs) { refs.put(ref.referenceName.replaceAll(".*/", ""), ref); } http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/config/AutoDeployerTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/config/AutoDeployerTest.java b/container/openejb-core/src/test/java/org/apache/openejb/config/AutoDeployerTest.java index 42b9aff..1c60d5e 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/config/AutoDeployerTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/config/AutoDeployerTest.java @@ -337,7 +337,7 @@ public class AutoDeployerTest { private File createEar(final File tmpdir, final Class<?>... aClass) throws IOException { final File ear = new File(tmpdir, "colors.ear"); - final Map<String, Object> contents = new HashMap<String, Object>(); + final Map<String, Object> contents = new HashMap<>(); contents.put("foo.jar", Archives.jarArchive(aClass)); Archives.jarArchive(ear, contents); return ear; http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/config/BeanPropertiesTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/config/BeanPropertiesTest.java b/container/openejb-core/src/test/java/org/apache/openejb/config/BeanPropertiesTest.java index faf759e..31c54b3 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/config/BeanPropertiesTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/config/BeanPropertiesTest.java @@ -61,7 +61,7 @@ public class BeanPropertiesTest extends TestCase { } { - final Map<String, String> map = new HashMap<String, String>(); + final Map<String, String> map = new HashMap<>(); map.put("META-INF/openejb-jar.xml", "<openejb-jar>\n" + " <ejb-deployment ejb-name=\"WidgetBean\">\n" + @@ -93,7 +93,7 @@ public class BeanPropertiesTest extends TestCase { { SystemInstance.get().getProperties().put("WidgetBean.color", "orange"); - final Map<String, String> map = new HashMap<String, String>(); + final Map<String, String> map = new HashMap<>(); final File app = Archives.fileArchive(map, WidgetBean.class); assembler.createApplication(config.configureApplication(app)); @@ -116,7 +116,7 @@ public class BeanPropertiesTest extends TestCase { { SystemInstance.get().getProperties().put("WidgetBean.color", "orange"); - final Map<String, String> map = new HashMap<String, String>(); + final Map<String, String> map = new HashMap<>(); map.put("META-INF/openejb-jar.xml", "<openejb-jar>\n" + " <ejb-deployment ejb-name=\"WidgetBean\">\n" + @@ -145,7 +145,7 @@ public class BeanPropertiesTest extends TestCase { } { - final Map<String, String> map = new HashMap<String, String>(); + final Map<String, String> map = new HashMap<>(); map.put("META-INF/openejb-jar.xml", "<openejb-jar>\n" + " <ejb-deployment ejb-name=\"WidgetBean\">\n" + @@ -176,7 +176,7 @@ public class BeanPropertiesTest extends TestCase { } { - final Map<String, String> map = new HashMap<String, String>(); + final Map<String, String> map = new HashMap<>(); map.put("META-INF/openejb-jar.xml", "<openejb-jar>\n" + " <ejb-deployment ejb-name=\"WidgetBean\">\n" + @@ -207,7 +207,7 @@ public class BeanPropertiesTest extends TestCase { } { - final Map<String, String> map = new HashMap<String, String>(); + final Map<String, String> map = new HashMap<>(); map.put("META-INF/ejb-jar.xml", "<ejb-jar id=\"Foo\"/>"); map.put("META-INF/openejb-jar.xml", "<openejb-jar>\n" + http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/config/BusinessInterfacesTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/config/BusinessInterfacesTest.java b/container/openejb-core/src/test/java/org/apache/openejb/config/BusinessInterfacesTest.java index 52243c4..bc55a01 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/config/BusinessInterfacesTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/config/BusinessInterfacesTest.java @@ -428,7 +428,7 @@ public class BusinessInterfacesTest extends TestCase { setUp(); strict(strict); - final List<String> expectedKeys = new ArrayList<String>(); + final List<String> expectedKeys = new ArrayList<>(); expectedKeys.add("ann.local.noAttributes"); expectedKeys.add("ann.remote.noAttributes"); expectedKeys.add("noInterfaceDeclared.session"); @@ -556,7 +556,7 @@ public class BusinessInterfacesTest extends TestCase { public void testOrangeStrict() throws Exception { strict(true); - final List<String> expectedKeys = new ArrayList<String>(); + final List<String> expectedKeys = new ArrayList<>(); expectedKeys.add("ann.localRemote.conflict"); expectedKeys.add("ann.localRemote.conflict"); @@ -712,7 +712,7 @@ public class BusinessInterfacesTest extends TestCase { } private Map<String, EnterpriseBeanInfo> asMap(final List<EnterpriseBeanInfo> enterpriseBeans) { - final Map<String, EnterpriseBeanInfo> map = new HashMap<String, EnterpriseBeanInfo>(); + final Map<String, EnterpriseBeanInfo> map = new HashMap<>(); for (final EnterpriseBeanInfo bean : enterpriseBeans) { map.put(bean.ejbName, bean); } @@ -721,7 +721,7 @@ public class BusinessInterfacesTest extends TestCase { } private List<String> list(final Class... classes) { - final ArrayList<String> list = new ArrayList<String>(); + final ArrayList<String> list = new ArrayList<>(); for (final Class clazz : classes) { list.add(clazz.getName()); } http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/config/CheckDescriptorLocationTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/config/CheckDescriptorLocationTest.java b/container/openejb-core/src/test/java/org/apache/openejb/config/CheckDescriptorLocationTest.java index 36d11ed..2b38fa1 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/config/CheckDescriptorLocationTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/config/CheckDescriptorLocationTest.java @@ -37,7 +37,7 @@ public class CheckDescriptorLocationTest { @Keys({@Key(value = "descriptor.incorrectLocation", type = KeyType.WARNING)}) public AppModule testJar() throws Exception { - final Map<String, String> map = new HashMap<String, String>(); + final Map<String, String> map = new HashMap<>(); map.put("ejb-jar.xml", "<ejb-jar/>"); // Place the descriptor in // incorrect location (directly // under root) @@ -52,7 +52,7 @@ public class CheckDescriptorLocationTest { @Keys({@Key(value = "descriptor.incorrectLocation", type = KeyType.WARNING, count = 1)}) public AppModule testWarWithDescriptorInMetaInf() throws Exception { - final Map<String, String> map = new HashMap<String, String>(); + final Map<String, String> map = new HashMap<>(); map.put("META-INF/ejb-jar.xml", "<ejb-jar/>"); map.put("WEB-INF/web.xml", "<web-app/>"); @@ -70,7 +70,7 @@ public class CheckDescriptorLocationTest { @Keys({@Key(value = "descriptor.incorrectLocation", type = KeyType.WARNING, count = 1)}) public AppModule testWarWithDescriptorInRoot() throws Exception { - final Map<String, String> map = new HashMap<String, String>(); + final Map<String, String> map = new HashMap<>(); map.put("ejb-jar.xml", "<ejb-jar/>"); map.put("WEB-INF/web.xml", "<web-app/>"); http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/config/CheckDescriptorLocationTestFileDeletionHelper.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/config/CheckDescriptorLocationTestFileDeletionHelper.java b/container/openejb-core/src/test/java/org/apache/openejb/config/CheckDescriptorLocationTestFileDeletionHelper.java index 53fce89..586ead8 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/config/CheckDescriptorLocationTestFileDeletionHelper.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/config/CheckDescriptorLocationTestFileDeletionHelper.java @@ -36,7 +36,7 @@ public class CheckDescriptorLocationTestFileDeletionHelper { if (list != null) { asList = Arrays.asList(list); } else { - asList = new ArrayList<File>(); + asList = new ArrayList<>(); } deleteTestCreatedFiles(asList); http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/config/CleanEnvEntriesTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/config/CleanEnvEntriesTest.java b/container/openejb-core/src/test/java/org/apache/openejb/config/CleanEnvEntriesTest.java index e8c308a..5f270fd 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/config/CleanEnvEntriesTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/config/CleanEnvEntriesTest.java @@ -88,7 +88,7 @@ public class CleanEnvEntriesTest extends TestCase { } private Map<String, EnvEntryInfo> map(final List<EnvEntryInfo> envEntries) { - final Map<String, EnvEntryInfo> map = new HashMap<String, EnvEntryInfo>(); + final Map<String, EnvEntryInfo> map = new HashMap<>(); for (final EnvEntryInfo entry : envEntries) { map.put(entry.referenceName, entry); } http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/config/DeploymentLoaderTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/config/DeploymentLoaderTest.java b/container/openejb-core/src/test/java/org/apache/openejb/config/DeploymentLoaderTest.java index ff4b87b..142ba31 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/config/DeploymentLoaderTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/config/DeploymentLoaderTest.java @@ -39,7 +39,7 @@ public class DeploymentLoaderTest extends TestCase { * - META-INF/persistence.xml * - META-INF/test.env-entry.properties */ - final Map<String, URL> original = new HashMap<String, URL>(); + final Map<String, URL> original = new HashMap<>(); original.put("ejb-jar.xml", new File("META-INF/ejb-jar.xml").toURI().toURL()); original.put("test.ejb-jar.xml", new File("META-INF/test.ejb-jar.xml").toURI().toURL()); original.put("footest.ejb-jar.xml", new File("META-INF/footest.ejb-jar.xml").toURI().toURL()); @@ -49,7 +49,7 @@ public class DeploymentLoaderTest extends TestCase { SystemInstance.get().setProperty("openejb.altdd.prefix", "footest, test"); - final Map<String, URL> processed = new HashMap<String, URL>(original); + final Map<String, URL> processed = new HashMap<>(original); DeploymentLoader.altDDSources(processed, false); // an item that existed and should have been replaced http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/config/DeploymentsElementTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/config/DeploymentsElementTest.java b/container/openejb-core/src/test/java/org/apache/openejb/config/DeploymentsElementTest.java index 22c4a37..1218d02 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/config/DeploymentsElementTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/config/DeploymentsElementTest.java @@ -71,7 +71,7 @@ public class DeploymentsElementTest extends Assert { final File ear = new File(apps, appName + ".ear"); { - final Map<String, Object> contents = new HashMap<String, Object>(); + final Map<String, Object> contents = new HashMap<>(); contents.put("foo.jar", Archives.jarArchive(Orange.class)); contents.put("META-INF/application.xml", "<application><module><ejb>foo.jar</ejb></module></application>"); Archives.jarArchive(ear, contents); @@ -101,7 +101,7 @@ public class DeploymentsElementTest extends Assert { final File ear = new File(apps, appName + ".ear"); { - final Map<String, Object> contents = new HashMap<String, Object>(); + final Map<String, Object> contents = new HashMap<>(); contents.put("foo.jar", Archives.jarArchive(Orange.class)); Archives.jarArchive(ear, contents); } @@ -131,7 +131,7 @@ public class DeploymentsElementTest extends Assert { final File ear = new File(server.getBase(), appName + ".ear"); { - final Map<String, Object> contents = new HashMap<String, Object>(); + final Map<String, Object> contents = new HashMap<>(); contents.put("foo.jar", Archives.jarArchive(Orange.class)); contents.put("META-INF/application.xml", "<application><module><ejb>foo.jar</ejb></module></application>"); Archives.jarArchive(ear, contents); @@ -163,7 +163,7 @@ public class DeploymentsElementTest extends Assert { final File ear = new File(server.getBase(), appName + ".ear"); { - final Map<String, Object> contents = new HashMap<String, Object>(); + final Map<String, Object> contents = new HashMap<>(); contents.put("foo.jar", Archives.jarArchive(Orange.class)); Archives.jarArchive(ear, contents); } @@ -196,7 +196,7 @@ public class DeploymentsElementTest extends Assert { final File ear = new File(server.getBase(), appName + ".ear"); { - final Map<String, Object> contents = new HashMap<String, Object>(); + final Map<String, Object> contents = new HashMap<>(); contents.put("foo.jar", Archives.jarArchive(Orange.class)); contents.put("META-INF/application.xml", "<application><module><ejb>foo.jar</ejb></module></application>"); Archives.jarArchive(ear, contents); @@ -230,7 +230,7 @@ public class DeploymentsElementTest extends Assert { final File ear = new File(server.getBase(), appName + ".ear"); { - final Map<String, Object> contents = new HashMap<String, Object>(); + final Map<String, Object> contents = new HashMap<>(); contents.put("foo.jar", Archives.jarArchive(Orange.class)); Archives.jarArchive(ear, contents); } @@ -267,7 +267,7 @@ public class DeploymentsElementTest extends Assert { { // Unpacked version -- Orange final File ear = new File(server.getBase(), appName + ".ear"); - final Map<String, Object> contents = new HashMap<String, Object>(); + final Map<String, Object> contents = new HashMap<>(); contents.put("foo.jar", Archives.jarArchive(Orange.class)); contents.put("META-INF/application.xml", "<application><module><ejb>foo.jar</ejb></module></application>"); Archives.jarArchive(ear, contents); @@ -279,7 +279,7 @@ public class DeploymentsElementTest extends Assert { { // Packed version -- Yellow final File ear = new File(server.getBase(), appName + ".ear"); - final Map<String, Object> contents = new HashMap<String, Object>(); + final Map<String, Object> contents = new HashMap<>(); contents.put("foo.jar", Archives.jarArchive(Yellow.class)); contents.put("META-INF/application.xml", "<application><module><ejb>foo.jar</ejb></module></application>"); Archives.jarArchive(ear, contents); http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/test/java/org/apache/openejb/config/EarModuleNamesTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/config/EarModuleNamesTest.java b/container/openejb-core/src/test/java/org/apache/openejb/config/EarModuleNamesTest.java index cbb6096..b57745f 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/config/EarModuleNamesTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/config/EarModuleNamesTest.java @@ -66,7 +66,7 @@ public class EarModuleNamesTest { final File ear = new File(appsDir, "testDefaultIdEjbJar.ear"); - final Map<String, Object> contents = new HashMap<String, Object>(); + final Map<String, Object> contents = new HashMap<>(); contents.put("testDefaultIdEjbJar.jar", Archives.jarArchive(Orange.class)); Archives.jarArchive(ear, contents); @@ -84,7 +84,7 @@ public class EarModuleNamesTest { final File ear = new File(appsDir, "testDefaultIdWebapp.ear"); - final Map<String, Object> contents = new HashMap<String, Object>(); + final Map<String, Object> contents = new HashMap<>(); contents.put("testDefaultIdWebapp.war", Archives.jarArchive(Orange.class)); Archives.jarArchive(ear, contents); @@ -101,9 +101,9 @@ public class EarModuleNamesTest { final ConfigurationFactory factory = new ConfigurationFactory(); final File ear = new File(appsDir, "testModuleNameEjbJar.ear"); - final Map<String, Object> contents = new HashMap<String, Object>(); + final Map<String, Object> contents = new HashMap<>(); - final Map<String, Object> metaInf = new HashMap<String, Object>(); + final Map<String, Object> metaInf = new HashMap<>(); metaInf.put("META-INF/ejb-jar.xml", "<ejb-jar><module-name>orange</module-name></ejb-jar>"); final File ejbJar = Archives.jarArchive(metaInf, "orange", Orange.class); contents.put("green.jar", ejbJar); @@ -123,9 +123,9 @@ public class EarModuleNamesTest { final ConfigurationFactory factory = new ConfigurationFactory(); final File ear = new File(appsDir, "testModuleNameAppClient.ear"); - final Map<String, Object> contents = new HashMap<String, Object>(); + final Map<String, Object> contents = new HashMap<>(); - final Map<String, Object> metaInf = new HashMap<String, Object>(); + final Map<String, Object> metaInf = new HashMap<>(); metaInf.put("META-INF/application-client.xml", "<application-client><module-name>testModuleNameAppClient</module-name></application-client>"); final File ejbJar = Archives.jarArchive(metaInf, "testModuleNameAppClient", Orange.class); contents.put("green.jar", ejbJar); @@ -144,9 +144,9 @@ public class EarModuleNamesTest { final ConfigurationFactory factory = new ConfigurationFactory(); final File ear = new File(appsDir, "testModuleNameWebapp.ear"); - final Map<String, Object> contents = new HashMap<String, Object>(); + final Map<String, Object> contents = new HashMap<>(); - final Map<String, Object> metaInf = new HashMap<String, Object>(); + final Map<String, Object> metaInf = new HashMap<>(); metaInf.put("WEB-INF/web.xml", "<webapp><module-name>testModuleNameWebapp</module-name></webapp>"); final File ejbJar = Archives.jarArchive(metaInf, "testModuleNameWebapp", Orange.class); contents.put("green.war", ejbJar); @@ -167,11 +167,11 @@ public class EarModuleNamesTest { final File ear = new File(appsDir, "testIdEjbJar.ear"); - final Map<String, Object> metaInf = new HashMap<String, Object>(); + final Map<String, Object> metaInf = new HashMap<>(); metaInf.put("META-INF/ejb-jar.xml", "<ejb-jar id=\"testIdEjbJar\" />"); final File ejbJar = Archives.jarArchive(metaInf, "testIdEjbJar", Orange.class); - final Map<String, Object> contents = new HashMap<String, Object>(); + final Map<String, Object> contents = new HashMap<>(); contents.put("green.jar", ejbJar); Archives.jarArchive(ear, contents); @@ -189,11 +189,11 @@ public class EarModuleNamesTest { final File ear = new File(appsDir, "testIdApplicationClient.ear"); - final Map<String, Object> metaInf = new HashMap<String, Object>(); + final Map<String, Object> metaInf = new HashMap<>(); metaInf.put("META-INF/application-client.xml", "<application-client id=\"testIdApplicationClient\" />"); final File jar = Archives.jarArchive(metaInf, "testIdApplicationClient", Orange.class); - final Map<String, Object> contents = new HashMap<String, Object>(); + final Map<String, Object> contents = new HashMap<>(); contents.put("green.jar", jar); Archives.jarArchive(ear, contents); @@ -210,9 +210,9 @@ public class EarModuleNamesTest { final ConfigurationFactory factory = new ConfigurationFactory(); final File ear = new File(appsDir, "testIdWebapp.ear"); - final Map<String, Object> contents = new HashMap<String, Object>(); + final Map<String, Object> contents = new HashMap<>(); - final Map<String, Object> metaInf = new HashMap<String, Object>(); + final Map<String, Object> metaInf = new HashMap<>(); metaInf.put("WEB-INF/web.xml", "<webapp id=\"testIdWebapp\" />"); final File ejbJar = Archives.jarArchive(metaInf, "testIdWebapp", Orange.class); contents.put("green.war", ejbJar);