You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2018/12/04 04:54:40 UTC
[09/12] tomee git commit: Added diamond operator usage to the OpenEJB
Container Core project, where appropriate
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java b/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
index 98b5484..169cdde 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
@@ -981,7 +981,7 @@ public class AnnotationDeployer implements DynamicDeployer {
}
private Class<?> getWrapper(final String primitiveType) {
- final Map<String, Class<?>> builtInMap = new HashMap<String, Class<?>>();
+ final Map<String, Class<?>> builtInMap = new HashMap<>();
{
builtInMap.put("int", Integer.class);
builtInMap.put("long", Long.class);
@@ -1101,7 +1101,7 @@ public class AnnotationDeployer implements DynamicDeployer {
webModule.setWebApp(webApp);
}
- final List<String> existingServlets = new ArrayList<String>();
+ final List<String> existingServlets = new ArrayList<>();
for (final Servlet servlet : webApp.getServlet()) {
if (servlet.getServletClass() != null) {
existingServlets.add(servlet.getServletClass());
@@ -1109,7 +1109,7 @@ public class AnnotationDeployer implements DynamicDeployer {
}
final IAnnotationFinder finder = webModule.getFinder();
- final List<Class> classes = new ArrayList<Class>();
+ final List<Class> classes = new ArrayList<>();
classes.addAll(finder.findAnnotatedClasses(WebService.class));
classes.addAll(finder.findAnnotatedClasses(WebServiceProvider.class));
@@ -1201,7 +1201,7 @@ public class AnnotationDeployer implements DynamicDeployer {
continue;
}
- final Set<String> convertedClasses = new HashSet<String>();
+ final Set<String> convertedClasses = new HashSet<>();
if (parentFinder != null) {
final List<Annotated<Class<?>>> foundParent = parentFinder.findMetaAnnotatedClasses(clazz);
@@ -1773,7 +1773,7 @@ public class AnnotationDeployer implements DynamicDeployer {
}
// just keep the potential ones to not load all classes during boot
- notManaged.put(entry.getKey(), new ArrayList<String>(beans));
+ notManaged.put(entry.getKey(), new ArrayList<>(beans));
}
}
}
@@ -1942,7 +1942,7 @@ public class AnnotationDeployer implements DynamicDeployer {
}
// no need of meta currently since JPA providers doesn't support it
- final List<Class<?>> classes = new ArrayList<Class<?>>();
+ final List<Class<?>> classes = new ArrayList<>();
classes.addAll(finder.findAnnotatedClasses(Entity.class));
classes.addAll(finder.findAnnotatedClasses(Embeddable.class));
classes.addAll(finder.findAnnotatedClasses(MappedSuperclass.class));
@@ -2042,7 +2042,7 @@ public class AnnotationDeployer implements DynamicDeployer {
client = new ApplicationClient();
}
- final Set<Class> remoteClients = new HashSet<Class>();
+ final Set<Class> remoteClients = new HashSet<>();
if (clientModule.getMainClass() != null) {
final String className = realClassName(clientModule.getMainClass());
@@ -2206,7 +2206,7 @@ public class AnnotationDeployer implements DynamicDeployer {
/*
* Classes added to this set will be scanned for annotations
*/
- final Set<Class> classes = new HashSet<Class>();
+ final Set<Class> classes = new HashSet<>();
final ClassLoader classLoader = webModule.getClassLoader();
@@ -2479,7 +2479,7 @@ public class AnnotationDeployer implements DynamicDeployer {
final String ejbClassName = realClassName(bean.getEjbClass());
if (ejbClassName == null) {
- final List<String> others = new ArrayList<String>();
+ final List<String> others = new ArrayList<>();
for (final EnterpriseBean otherBean : enterpriseBeans) {
others.add(otherBean.getEjbName());
}
@@ -2607,7 +2607,7 @@ public class AnnotationDeployer implements DynamicDeployer {
for (final InterceptorBinding binding : assemblyDescriptor.getInterceptorBinding()) {
final EjbJar ejbJar = ejbModule.getEjbJar();
- final List<String> list = new ArrayList<String>(binding.getInterceptorClass());
+ final List<String> list = new ArrayList<>(binding.getInterceptorClass());
if (binding.getInterceptorOrder() != null) {
list.clear();
@@ -2927,7 +2927,7 @@ public class AnnotationDeployer implements DynamicDeployer {
* Determine the MessageListener interface
*/
if (mdb.getMessagingType() == null) {
- final List<Class<?>> interfaces = new ArrayList<Class<?>>();
+ final List<Class<?>> interfaces = new ArrayList<>();
for (final Class<?> intf : clazz.getInterfaces()) {
final String name = intf.getName();
if (!name.equals("java.io.Serializable") &&
@@ -3092,7 +3092,7 @@ public class AnnotationDeployer implements DynamicDeployer {
* We will subtract these from the interfaces implemented
* by the bean and do annotation scanning on the remainder.
*/
- final List<String> descriptor = new ArrayList<String>();
+ final List<String> descriptor = new ArrayList<>();
descriptor.add(sessionBean.getHome());
descriptor.add(sessionBean.getRemote());
descriptor.add(sessionBean.getLocalHome());
@@ -3169,7 +3169,7 @@ public class AnnotationDeployer implements DynamicDeployer {
* java.io.Externalizable
* javax.ejb.*
*/
- final List<Class<?>> interfaces = new ArrayList<Class<?>>();
+ final List<Class<?>> interfaces = new ArrayList<>();
if (!clazz.isInterface()) { // dynamic proxy implementation
for (final Class<?> interfce : clazz.getInterfaces()) {
final String name = interfce.getName();
@@ -3242,7 +3242,7 @@ public class AnnotationDeployer implements DynamicDeployer {
* Cannot imply either @Local or @Remote and list multiple interfaces
*/
// Need to extract the class names and append .class to them to show proper validation level 3 message
- final List<String> interfaceNames = new ArrayList<String>();
+ final List<String> interfaceNames = new ArrayList<>();
for (final Class<?> intrfce : interfaces) {
interfaceNames.add(intrfce.getName() + ".class");
}
@@ -3445,8 +3445,8 @@ public class AnnotationDeployer implements DynamicDeployer {
}
private static class BusinessInterfaces {
- private final Set<Class> local = new LinkedHashSet<Class>();
- private final Set<Class> remote = new LinkedHashSet<Class>();
+ private final Set<Class> local = new LinkedHashSet<>();
+ private final Set<Class> remote = new LinkedHashSet<>();
public void addLocals(final Collection<String> names, final ClassLoader loader) {
add(loader, names, local);
@@ -3566,7 +3566,7 @@ public class AnnotationDeployer implements DynamicDeployer {
/*
* Process annotations at the method level
*/
- final List<Method> seen = new ArrayList<Method>();
+ final List<Method> seen = new ArrayList<>();
/*
* @RolesAllowed
@@ -3626,7 +3626,7 @@ public class AnnotationDeployer implements DynamicDeployer {
seen.add(method.get());
}
- final List<String> annotations = new ArrayList<String>();
+ final List<String> annotations = new ArrayList<>();
for (final Class<? extends Annotation> annotation : Arrays.asList(RolesAllowed.class, PermitAll.class, DenyAll.class)) {
if (method.getAnnotation(annotation) != null) {
annotations.add("@" + annotation.getSimpleName());
@@ -3643,14 +3643,14 @@ public class AnnotationDeployer implements DynamicDeployer {
return;
}
final TimerConsumer timerConsumer = (TimerConsumer) bean;
- final Set<Annotated<Method>> scheduleMethods = new HashSet<Annotated<Method>>();
+ final Set<Annotated<Method>> scheduleMethods = new HashSet<>();
scheduleMethods.addAll(annotationFinder.findMetaAnnotatedMethods(Schedules.class));
scheduleMethods.addAll(annotationFinder.findMetaAnnotatedMethods(Schedule.class));
final List<Timer> timers = timerConsumer.getTimer();
// TODO : The NamedMethod object implements equals and hashCode, so we could rely on that rather than collecting strings
- final Set<String> methodsConfiguredInDeploymentXml = new HashSet<String>();
+ final Set<String> methodsConfiguredInDeploymentXml = new HashSet<>();
for (final Timer timer : timers) {
final NamedMethod namedMethod = timer.getTimeoutMethod();
methodsConfiguredInDeploymentXml.add(namedMethod.getMethodName() + (namedMethod.getMethodParams() == null ? "" : Join.join("", namedMethod.getMethodParams().getMethodParam())));
@@ -3664,7 +3664,7 @@ public class AnnotationDeployer implements DynamicDeployer {
continue;
}
- final List<Schedule> scheduleAnnotationList = new ArrayList<Schedule>();
+ final List<Schedule> scheduleAnnotationList = new ArrayList<>();
final Schedules schedulesAnnotation = method.getAnnotation(Schedules.class);
if (schedulesAnnotation != null) {
@@ -3827,7 +3827,7 @@ public class AnnotationDeployer implements DynamicDeployer {
* @Remove
*/
final List<Annotated<Method>> removeMethods = sortMethods(annotationFinder.findMetaAnnotatedMethods(Remove.class));
- final Map<NamedMethod, RemoveMethod> declaredRemoveMethods = new HashMap<NamedMethod, RemoveMethod>();
+ final Map<NamedMethod, RemoveMethod> declaredRemoveMethods = new HashMap<>();
for (final RemoveMethod removeMethod : session.getRemoveMethod()) {
declaredRemoveMethods.put(removeMethod.getBeanMethod(), removeMethod);
}
@@ -3868,7 +3868,7 @@ public class AnnotationDeployer implements DynamicDeployer {
// @EJB
//
- final List<EJB> ejbList = new ArrayList<EJB>();
+ final List<EJB> ejbList = new ArrayList<>();
for (final Annotated<Class<?>> clazz : annotationFinder.findMetaAnnotatedClasses(EJBs.class)) {
final EJBs ejbs = clazz.getAnnotation(EJBs.class);
ejbList.addAll(Arrays.asList(ejbs.value()));
@@ -3902,7 +3902,7 @@ public class AnnotationDeployer implements DynamicDeployer {
// @Resource
//
- final List<Resource> resourceList = new ArrayList<Resource>();
+ final List<Resource> resourceList = new ArrayList<>();
for (final Annotated<Class<?>> clazz : annotationFinder.findMetaAnnotatedClasses(Resources.class)) {
final Resources resources = clazz.getAnnotation(Resources.class);
resourceList.addAll(Arrays.asList(resources.value()));
@@ -3944,7 +3944,7 @@ public class AnnotationDeployer implements DynamicDeployer {
// @WebServiceRef
//
- final List<WebServiceRef> webservicerefList = new ArrayList<WebServiceRef>();
+ final List<WebServiceRef> webservicerefList = new ArrayList<>();
for (final Annotated<Class<?>> clazz : annotationFinder.findMetaAnnotatedClasses(WebServiceRefs.class)) {
final WebServiceRefs webServiceRefs = clazz.getAnnotation(WebServiceRefs.class);
webservicerefList.addAll(Arrays.asList(webServiceRefs.value()));
@@ -3981,7 +3981,7 @@ public class AnnotationDeployer implements DynamicDeployer {
// @PersistenceUnit
//
- final List<PersistenceUnit> persistenceUnitList = new ArrayList<PersistenceUnit>();
+ final List<PersistenceUnit> persistenceUnitList = new ArrayList<>();
for (final Annotated<Class<?>> clazz : annotationFinder.findMetaAnnotatedClasses(PersistenceUnits.class)) {
final PersistenceUnits persistenceUnits = clazz.getAnnotation(PersistenceUnits.class);
persistenceUnitList.addAll(Arrays.asList(persistenceUnits.value()));
@@ -4009,7 +4009,7 @@ public class AnnotationDeployer implements DynamicDeployer {
//
final PersistenceContextAnnFactory pcFactory = new PersistenceContextAnnFactory();
- final List<PersistenceContext> persistenceContextList = new ArrayList<PersistenceContext>();
+ final List<PersistenceContext> persistenceContextList = new ArrayList<>();
for (final Annotated<Class<?>> clazz : annotationFinder.findMetaAnnotatedClasses(PersistenceContexts.class)) {
final PersistenceContexts persistenceContexts = clazz.getAnnotation(PersistenceContexts.class);
persistenceContextList.addAll(Arrays.asList(persistenceContexts.value()));
@@ -4694,7 +4694,7 @@ public class AnnotationDeployer implements DynamicDeployer {
List<Property> persistenceProperties = persistenceContextRef.getPersistenceProperty();
if (persistenceProperties == null) {
- persistenceProperties = new ArrayList<Property>();
+ persistenceProperties = new ArrayList<>();
persistenceContextRef.setPersistenceProperty(persistenceProperties);
}
@@ -5110,7 +5110,7 @@ public class AnnotationDeployer implements DynamicDeployer {
private List<String> getDeclaredClassPermissions(final AssemblyDescriptor assemblyDescriptor, final String ejbName) {
final List<MethodPermission> permissions = assemblyDescriptor.getMethodPermission();
- final List<String> classPermissions = new ArrayList<String>();
+ final List<String> classPermissions = new ArrayList<>();
for (final MethodPermission permission : permissions) {
for (final org.apache.openejb.jee.Method method : permission.getMethod()) {
if (!method.getEjbName().equals(ejbName)) {
@@ -5188,12 +5188,12 @@ public class AnnotationDeployer implements DynamicDeployer {
}
public Map<String, List<MethodAttribute>> getExistingDeclarations() {
- final Map<String, List<MethodAttribute>> declarations = new HashMap<String, List<MethodAttribute>>();
+ final Map<String, List<MethodAttribute>> declarations = new HashMap<>();
final List<ConcurrentMethod> methods = bean.getConcurrentMethod();
for (final ConcurrentMethod method : methods) {
List<MethodAttribute> list = declarations.get(method.getMethod().getMethodName());
if (list == null) {
- list = new ArrayList<MethodAttribute>();
+ list = new ArrayList<>();
declarations.put(method.getMethod().getMethodName(), list);
}
list.add(new MethodAttribute(null, bean.getEjbName(), method.getMethod()));
@@ -5432,7 +5432,7 @@ public class AnnotationDeployer implements DynamicDeployer {
* @return
*/
private AnnotationFinder createFinder(final Class<?>... classes) {
- final Set<Class<?>> parents = new HashSet<Class<?>>();
+ final Set<Class<?>> parents = new HashSet<>();
for (final Class<?> clazz : classes) {
parents.addAll(Classes.ancestors(clazz));
}
@@ -5446,7 +5446,7 @@ public class AnnotationDeployer implements DynamicDeployer {
* @return
*/
private String[] asStrings(final Class[] types) {
- final List<String> names = new ArrayList<String>();
+ final List<String> names = new ArrayList<>();
for (final Class clazz : types) {
names.add(clazz.getName());
}
@@ -5708,7 +5708,7 @@ public class AnnotationDeployer implements DynamicDeployer {
}
public static Collection<String> findRestClasses(final WebModule webModule, final IAnnotationFinder finder) {
- final Collection<String> classes = new HashSet<String>();
+ final Collection<String> classes = new HashSet<>();
// annotations on classes
final List<Annotated<Class<?>>> annotatedClasses = finder.findMetaAnnotatedClasses(Path.class);
@@ -5784,7 +5784,7 @@ public class AnnotationDeployer implements DynamicDeployer {
}
private static Collection<Class<?>> metaToClass(final List<Annotated<Class<?>>> found) {
- final Collection<Class<?>> classes = new ArrayList<Class<?>>(found.size());
+ final Collection<Class<?>> classes = new ArrayList<>(found.size());
for (final Annotated<Class<?>> clazz : found) {
classes.add(clazz.get());
}
@@ -5812,7 +5812,7 @@ public class AnnotationDeployer implements DynamicDeployer {
Set<String> list = classes.get(url);
if (list == null) {
- list = new HashSet<String>();
+ list = new HashSet<>();
classes.put(url, list);
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/AppContextConfigDeployer.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/AppContextConfigDeployer.java b/container/openejb-core/src/main/java/org/apache/openejb/config/AppContextConfigDeployer.java
index 9ebce3f..a51ea5d 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/AppContextConfigDeployer.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/AppContextConfigDeployer.java
@@ -49,7 +49,7 @@ public class AppContextConfigDeployer implements DynamicDeployer {
deploymentModule.add(appModule);
// parse files once since it is application scoped (we don't want duplicates)
- final Set<String> alreadyParsed = new HashSet<String>();
+ final Set<String> alreadyParsed = new HashSet<>();
for (final DeploymentModule module : deploymentModule) {
final Object o = module.getAltDDs().get(CONFIG_NAME);
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java b/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java
index 0c2264c..868b9dd 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java
@@ -174,7 +174,7 @@ class AppInfoBuilder {
//
// EJB Jars
//
- final Map<EjbModule, EjbJarInfo> ejbJarInfos = new HashMap<EjbModule, EjbJarInfo>();
+ final Map<EjbModule, EjbJarInfo> ejbJarInfos = new HashMap<>();
for (final EjbModule ejbModule : appModule.getEjbModules()) {
try {
final EjbJarInfo ejbJarInfo = this.ejbJarInfoBuilder.buildInfo(ejbModule);
@@ -251,7 +251,7 @@ class AppInfoBuilder {
jndiEncInfoBuilder.build(appModule.getApplication(), appInfo.appId, null, appModule.getModuleUri(), new JndiEncInfo(), new JndiEncInfo());
}
- final List<EnterpriseBeanInfo> beans = new ArrayList<EnterpriseBeanInfo>();
+ final List<EnterpriseBeanInfo> beans = new ArrayList<>();
// Build the JNDI tree for each ejb
for (final EjbModule ejbModule : appModule.getEjbModules()) {
@@ -283,7 +283,7 @@ class AppInfoBuilder {
@Override
public Set<String> getReferences(final EnterpriseBeanInfo bean) {
- return new LinkedHashSet<String>(bean.dependsOn);
+ return new LinkedHashSet<>(bean.dependsOn);
}
});
} catch (final CircularReferencesException e) {
@@ -921,7 +921,7 @@ class AppInfoBuilder {
}
}
- final Set<String> keys = new HashSet<String>(info.properties.stringPropertyNames());
+ final Set<String> keys = new HashSet<>(info.properties.stringPropertyNames());
for (final String key : keys) {
if (key.matches("openjpa.Connection(DriverName|URL|UserName|Password)")) {
final Object o = info.properties.remove(key);
@@ -1013,7 +1013,7 @@ class AppInfoBuilder {
private List<PortInfo> configureWebservices(final Webservices webservices) {
- final List<PortInfo> portMap = new ArrayList<PortInfo>();
+ final List<PortInfo> portMap = new ArrayList<>();
if (webservices == null) {
return portMap;
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/AppModule.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/AppModule.java b/container/openejb-core/src/main/java/org/apache/openejb/config/AppModule.java
index c5a647c..88b6d16 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/AppModule.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/AppModule.java
@@ -53,27 +53,27 @@ public class AppModule implements DeploymentModule {
private final Properties properties = new SuperProperties().caseInsensitive(true);
private final Application application;
private final ValidationContext validation;
- private final List<URL> additionalLibraries = new ArrayList<URL>();
- private final List<URL> scannableContainerUrls = new ArrayList<URL>();
- private final List<ConnectorModule> connectorModules = new ArrayList<ConnectorModule>();
- private final List<WebModule> webModules = new ArrayList<WebModule>();
- private final List<ClientModule> clientModules = new ArrayList<ClientModule>();
- private final List<EjbModule> ejbModules = new ArrayList<EjbModule>();
- private final List<PersistenceModule> persistenceModules = new ArrayList<PersistenceModule>();
- private final Map<String, TransactionType> txTypeByUnit = new HashMap<String, TransactionType>();
+ private final List<URL> additionalLibraries = new ArrayList<>();
+ private final List<URL> scannableContainerUrls = new ArrayList<>();
+ private final List<ConnectorModule> connectorModules = new ArrayList<>();
+ private final List<WebModule> webModules = new ArrayList<>();
+ private final List<ClientModule> clientModules = new ArrayList<>();
+ private final List<EjbModule> ejbModules = new ArrayList<>();
+ private final List<PersistenceModule> persistenceModules = new ArrayList<>();
+ private final Map<String, TransactionType> txTypeByUnit = new HashMap<>();
// TODO We could turn this into the Resources JAXB object and support containers and other things as well
private final Collection<Resource> resources = new LinkedHashSet<>();
- private final Collection<Container> containers = new HashSet<Container>();
- private final Collection<Service> services = new HashSet<Service>();
+ private final Collection<Container> containers = new HashSet<>();
+ private final Collection<Service> services = new HashSet<>();
private final ClassLoader classLoader;
private EntityMappings cmpMappings;
- private final Map<String, Object> altDDs = new HashMap<String, Object>();
- private final Set<String> watchedResources = new TreeSet<String>();
+ private final Map<String, Object> altDDs = new HashMap<>();
+ private final Set<String> watchedResources = new TreeSet<>();
private final boolean standaloneModule;
private boolean delegateFirst = DELEGATE_FIRST_DEFAULT;
- private final Set<String> additionalLibMbeans = new TreeSet<String>();
- private final Collection<String> jaxRsProviders = new TreeSet<String>();
- private final Map<String, PojoConfiguration> pojoConfigurations = new HashMap<String, PojoConfiguration>();
+ private final Set<String> additionalLibMbeans = new TreeSet<>();
+ private final Collection<String> jaxRsProviders = new TreeSet<>();
+ private final Map<String, PojoConfiguration> pojoConfigurations = new HashMap<>();
private IAnnotationFinder earLibFinder;
private ID id;
@@ -268,7 +268,7 @@ public class AppModule implements DeploymentModule {
}
public List<ValidationContext> getValidationContexts() {
- final List<ValidationContext> contexts = new ArrayList<ValidationContext>();
+ final List<ValidationContext> contexts = new ArrayList<>();
contexts.add(getValidation());
@@ -376,7 +376,7 @@ public class AppModule implements DeploymentModule {
}
public Collection<DeploymentModule> getDeploymentModule() {
- final ArrayList<DeploymentModule> modules = new ArrayList<DeploymentModule>();
+ final ArrayList<DeploymentModule> modules = new ArrayList<>();
modules.addAll(ejbModules);
modules.addAll(webModules);
modules.addAll(connectorModules);
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/AppValidator.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/AppValidator.java b/container/openejb-core/src/main/java/org/apache/openejb/config/AppValidator.java
index 6d6b8a8..9bb664f 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/AppValidator.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/AppValidator.java
@@ -63,7 +63,7 @@ public class AppValidator {
private boolean printWarnings = true;
private boolean printCount;
- private final List<ValidationResults> sets = new ArrayList<ValidationResults>();
+ private final List<ValidationResults> sets = new ArrayList<>();
private ValidationBase[] additionalValidators;
/*------------------------------------------------------*/
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java b/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java
index 5f1ec3f..4c8e877 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java
@@ -317,7 +317,7 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
refShortName = refShortName.replaceFirst(".*/", "");
}
- final List<String> availableUnits = new ArrayList<String>();
+ final List<String> availableUnits = new ArrayList<>();
for (final PersistenceUnit persistenceUnit : persistenceUnits.values()) {
availableUnits.add(persistenceUnit.getName());
}
@@ -342,7 +342,7 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
if (vagueMatches.size() != 0) {
// Print the full rootUrls
- final List<String> possibleUnits = new ArrayList<String>();
+ final List<String> possibleUnits = new ArrayList<>();
for (final PersistenceUnit persistenceUnit : persistenceUnits.values()) {
try {
URI unitURI = URLs.uri(persistenceUnit.getId());
@@ -484,7 +484,7 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
*/
private void resolveDestinationLinks(final AppModule appModule) throws OpenEJBException {
// build up a link resolver
- final LinkResolver<MessageDestination> destinationResolver = new LinkResolver<MessageDestination>();
+ final LinkResolver<MessageDestination> destinationResolver = new LinkResolver<>();
for (final EjbModule ejbModule : appModule.getEjbModules()) {
final AssemblyDescriptor assembly = ejbModule.getEjbJar().getAssemblyDescriptor();
if (assembly != null) {
@@ -505,7 +505,7 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
}
// remember the type of each destination so we can use it to fillin MDBs that don't declare destination type
- final Map<MessageDestination, String> destinationTypes = new HashMap<MessageDestination, String>();
+ final Map<MessageDestination, String> destinationTypes = new HashMap<>();
// resolve all MDBs with destination links
// if MessageDestination does not have a mapped name assigned, give it the destination from the MDB
@@ -908,7 +908,7 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
return;
}
- final List<JndiConsumer> jndiConsumers = new ArrayList<JndiConsumer>();
+ final List<JndiConsumer> jndiConsumers = new ArrayList<>();
for (final WebModule webModule : module.getWebModules()) {
final JndiConsumer consumer = webModule.getWebApp();
jndiConsumers.add(consumer);
@@ -918,8 +918,8 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
Collections.addAll(jndiConsumers, ejbModule.getEjbJar().getEnterpriseBeans());
}
- List<ResourceInfo> resourceInfos = new ArrayList<ResourceInfo>();
- final Map<ResourceInfo, Resource> resourcesMap = new HashMap<ResourceInfo, Resource>(resources.size());
+ List<ResourceInfo> resourceInfos = new ArrayList<>();
+ final Map<ResourceInfo, Resource> resourcesMap = new HashMap<>(resources.size());
for (final Resource resource : resources) {
final String originalId = PropertyPlaceHolderHelper.value(resource.getId());
final String modulePrefix = module.getModuleId() + "/";
@@ -943,7 +943,7 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
final Collection<String> aliases = resource.getAliases();
if (!aliases.isEmpty()) {
- final Collection<String> newAliases = new ArrayList<String>();
+ final Collection<String> newAliases = new ArrayList<>();
for (final String s : aliases) {
newAliases.add(module.getModuleId() + "/" + s);
}
@@ -1591,7 +1591,7 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
// 2. The web module id
// 3. The web module context root
// 4. The application module id
- final List<String> ids = new ArrayList<String>();
+ final List<String> ids = new ArrayList<>();
ids.add(unit.getName());
for (final WebModule webModule : app.getWebModules()) {
ids.add(webModule.getModuleId());
@@ -1804,7 +1804,7 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
private static void suffixAliases(final ResourceInfo ri, final String suffix) {
final Collection<String> aliases = ri.aliases;
- final List<String> newAliases = new ArrayList<String>();
+ final List<String> newAliases = new ArrayList<>();
for (final String alias : aliases) {
newAliases.add(alias + suffix);
}
@@ -2111,7 +2111,7 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
private List<String> getResourceIds(final AppResources appResources, final String type, final Properties required) {
final List<String> resourceIds;
- resourceIds = new ArrayList<String>();
+ resourceIds = new ArrayList<>();
if (appResources != null) {
resourceIds.addAll(appResources.getResourceIds(type));
}
@@ -2274,10 +2274,10 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
private String appId;
@SuppressWarnings({"MismatchedQueryAndUpdateOfCollection"})
- private final Set<String> resourceAdapterIds = new TreeSet<String>();
- private final Map<String, List<String>> resourceIdsByType = new TreeMap<String, List<String>>();
- private final Map<String, List<String>> resourceEnvIdsByType = new TreeMap<String, List<String>>();
- private final Map<String, List<String>> containerIdsByType = new TreeMap<String, List<String>>();
+ private final Set<String> resourceAdapterIds = new TreeSet<>();
+ private final Map<String, List<String>> resourceIdsByType = new TreeMap<>();
+ private final Map<String, List<String>> resourceEnvIdsByType = new TreeMap<>();
+ private final Map<String, List<String>> containerIdsByType = new TreeMap<>();
private final Collection<ContainerInfo> containerInfos = new HashSet<>();
public void dump() {
@@ -2326,7 +2326,7 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
if (messageListenerInterface != null) {
List<String> containerIds = containerIdsByType.get(messageListenerInterface);
if (containerIds == null) {
- containerIds = new ArrayList<String>();
+ containerIds = new ArrayList<>();
containerIdsByType.put(messageListenerInterface, containerIds);
}
containerIds.add(containerInfo.id);
@@ -2363,7 +2363,7 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
List<String> resourceIds = resourceIdsByType.get(type);
if (resourceIds == null) {
- resourceIds = new ArrayList<String>();
+ resourceIds = new ArrayList<>();
resourceIdsByType.put(type, resourceIds);
}
resourceIds.add(resourceId);
@@ -2386,7 +2386,7 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
List<String> containerIds = containerIdsByType.get(type);
if (containerIds == null) {
- containerIds = new ArrayList<String>();
+ containerIds = new ArrayList<>();
containerIdsByType.put(type, containerIds);
}
containerIds.add(containerId);
@@ -2407,7 +2407,7 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
List<String> resourceEnvIds = resourceEnvIdsByType.get(type);
if (resourceEnvIds == null) {
- resourceEnvIds = new ArrayList<String>();
+ resourceEnvIds = new ArrayList<>();
resourceEnvIdsByType.put(type, resourceEnvIds);
}
resourceEnvIds.add(resourceEnvId);
@@ -2421,7 +2421,7 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
for (final String t : types) {
List<String> ids = resourceIdsByType.get(t);
if (ids == null) {
- ids = new ArrayList<String>();
+ ids = new ArrayList<>();
resourceIdsByType.put(t, ids);
}
ids.add(r.getId());
@@ -2471,7 +2471,7 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
public List<String> getResourceIds(final String type) {
if (type == null) {
- final List<String> allResourceIds = new ArrayList<String>();
+ final List<String> allResourceIds = new ArrayList<>();
for (final List<String> resourceIds : resourceIdsByType.values()) {
allResourceIds.addAll(resourceIds);
}
@@ -2496,7 +2496,7 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
}
public List<String> getContainerIds() {
- final ArrayList<String> ids = new ArrayList<String>();
+ final ArrayList<String> ids = new ArrayList<>();
for (final List<String> list : containerIdsByType.values()) {
ids.addAll(list);
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/AutoDeployer.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/AutoDeployer.java b/container/openejb-core/src/main/java/org/apache/openejb/config/AutoDeployer.java
index 9602208..946a4bb 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/AutoDeployer.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/AutoDeployer.java
@@ -54,9 +54,9 @@ public class AutoDeployer {
private final ConfigurationFactory factory;
private final long pollIntervalMillis;
- private final Map<String, FileInfo> files = new HashMap<String, FileInfo>();
+ private final Map<String, FileInfo> files = new HashMap<>();
private final Timer timer;
- private final List<Deployments> deployments = new ArrayList<Deployments>();
+ private final List<Deployments> deployments = new ArrayList<>();
public AutoDeployer(final ConfigurationFactory factory, final List<Deployments> deployments) {
final Options options = SystemInstance.get().getOptions();
@@ -268,7 +268,7 @@ public class AutoDeployer {
try {
final List<File> files = list();
- final HashSet<String> missingFilesList = new HashSet<String>(this.files.keySet());
+ final HashSet<String> missingFilesList = new HashSet<>(this.files.keySet());
for (final File file : files) {
@@ -320,7 +320,7 @@ public class AutoDeployer {
}
private List<File> list() {
- final List<File> files = new ArrayList<File>();
+ final List<File> files = new ArrayList<>();
{ // list all the files associated with hot deploy locations
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/BaseConvertDefinitions.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/BaseConvertDefinitions.java b/container/openejb-core/src/main/java/org/apache/openejb/config/BaseConvertDefinitions.java
index c543c2d..b1872cf 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/BaseConvertDefinitions.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/BaseConvertDefinitions.java
@@ -34,7 +34,7 @@ public abstract class BaseConvertDefinitions implements DynamicDeployer {
protected List<JndiConsumer> collectConsumers(final AppModule appModule) {
- final List<JndiConsumer> jndiConsumers = new ArrayList<JndiConsumer>();
+ final List<JndiConsumer> jndiConsumers = new ArrayList<>();
for (final ClientModule module : appModule.getClientModules()) {
final JndiConsumer consumer = module.getApplicationClient();
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/BeanProperties.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/BeanProperties.java b/container/openejb-core/src/main/java/org/apache/openejb/config/BeanProperties.java
index db3cdb5..f2e97a7 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/BeanProperties.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/BeanProperties.java
@@ -37,7 +37,7 @@ public class BeanProperties implements DynamicDeployer {
private static final Logger log = Logger.getInstance(LogCategory.OPENEJB_STARTUP_CONFIG, ModuleProperties.class);
- private final Map<String, Properties> additionalProperties = new HashMap<String, Properties>();
+ private final Map<String, Properties> additionalProperties = new HashMap<>();
private final Properties globalProperties = new Properties();
@Override
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/CleanEnvEntries.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/CleanEnvEntries.java b/container/openejb-core/src/main/java/org/apache/openejb/config/CleanEnvEntries.java
index b52586f..6409ab8 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/CleanEnvEntries.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/CleanEnvEntries.java
@@ -173,7 +173,7 @@ public class CleanEnvEntries implements DynamicDeployer {
return;
}
- final Set<Class> types = new HashSet<Class>();
+ final Set<Class> types = new HashSet<>();
for (final InjectionTarget target : entry.getInjectionTarget()) {
if (target.getInjectionTargetClass() == null) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/ClearEmptyMappedName.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/ClearEmptyMappedName.java b/container/openejb-core/src/main/java/org/apache/openejb/config/ClearEmptyMappedName.java
index d6e6df7..4e5c1ef 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/ClearEmptyMappedName.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/ClearEmptyMappedName.java
@@ -49,7 +49,7 @@ public class ClearEmptyMappedName implements DynamicDeployer {
return;
}
- final List<JndiReference> refs = new ArrayList<JndiReference>();
+ final List<JndiReference> refs = new ArrayList<>();
refs.addAll(consumer.getEjbLocalRef());
refs.addAll(consumer.getEjbRef());
refs.addAll(consumer.getEnvEntry());
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/ClientModule.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/ClientModule.java b/container/openejb-core/src/main/java/org/apache/openejb/config/ClientModule.java
index d897c43..ea769f0 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/ClientModule.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/ClientModule.java
@@ -36,10 +36,10 @@ public class ClientModule extends Module implements DeploymentModule {
private String mainClass;
private boolean ejbModuleGenerated;
private AtomicReference<IAnnotationFinder> finder;
- private final Set<String> localClients = new HashSet<String>();
- private final Set<String> remoteClients = new HashSet<String>();
+ private final Set<String> localClients = new HashSet<>();
+ private final Set<String> remoteClients = new HashSet<>();
private ID id;
- private final Set<String> watchedResources = new TreeSet<String>();
+ private final Set<String> watchedResources = new TreeSet<>();
public ClientModule(final ApplicationClient applicationClient, final ClassLoader classLoader, final String jarLocation, final String mainClass, final String moduleId) {
this.applicationClient = applicationClient;
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java b/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java
index 7f0e3f1..d744b23 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java
@@ -132,7 +132,7 @@ public class CmpJpaConversion implements DynamicDeployer {
final Relationships relationships = ejbJar.getRelationships();
if (relationships != null) {
- final Map<String, Entity> entitiesByEjbName = new TreeMap<String, Entity>();
+ final Map<String, Entity> entitiesByEjbName = new TreeMap<>();
for (final Entity entity : cmpMappings.getEntity()) {
entitiesByEjbName.put(entity.getEjbName(), entity);
}
@@ -673,7 +673,7 @@ public class CmpJpaConversion implements DynamicDeployer {
* primary key classes.
*/
private Collection<MappedSuperclass> mapClass2x(final Mapping mapping, final EntityBean bean, final ClassLoader classLoader) {
- final Set<String> allFields = new TreeSet<String>();
+ final Set<String> allFields = new TreeSet<>();
// get an acculated set of the CMP fields.
for (final CmpField cmpField : bean.getCmpField()) {
allFields.add(cmpField.getFieldName());
@@ -755,7 +755,7 @@ public class CmpJpaConversion implements DynamicDeployer {
//
// id: the primary key
//
- final Set<String> primaryKeyFields = new HashSet<String>();
+ final Set<String> primaryKeyFields = new HashSet<>();
if (bean.getPrimkeyField() != null) {
@@ -841,7 +841,7 @@ public class CmpJpaConversion implements DynamicDeployer {
}
// all of the fields should now be identified by type, so return a set of
// the field mappings
- return new HashSet<MappedSuperclass>(superclassByField.values());
+ return new HashSet<>(superclassByField.values());
}
@@ -864,7 +864,7 @@ public class CmpJpaConversion implements DynamicDeployer {
final Class ejbClass = loadClass(classLoader, ejbClassName);
// build a set of all field names
- final Set<String> allFields = new TreeSet<String>();
+ final Set<String> allFields = new TreeSet<>();
for (final CmpField cmpField : bean.getCmpField()) {
allFields.add(cmpField.getFieldName());
}
@@ -874,7 +874,7 @@ public class CmpJpaConversion implements DynamicDeployer {
//
// id: the primary key
//
- final Set<String> primaryKeyFields = new HashSet<String>();
+ final Set<String> primaryKeyFields = new HashSet<>();
if (bean.getPrimkeyField() != null) {
final String fieldName = bean.getPrimkeyField();
final MappedSuperclass superclass = superclassByField.get(fieldName);
@@ -945,7 +945,7 @@ public class CmpJpaConversion implements DynamicDeployer {
// all of the fields should now be identified by type, so return a set of
// the field mappings
- return new HashSet<MappedSuperclass>(superclassByField.values());
+ return new HashSet<>(superclassByField.values());
}
@@ -1020,8 +1020,8 @@ public class CmpJpaConversion implements DynamicDeployer {
* @return A map of fieldname-to-defining class relationships.
*/
private Map<String, MappedSuperclass> mapFields(Class clazz, Set<String> persistantFields) {
- persistantFields = new TreeSet<String>(persistantFields);
- final Map<String, MappedSuperclass> fields = new TreeMap<String, MappedSuperclass>();
+ persistantFields = new TreeSet<>(persistantFields);
+ final Map<String, MappedSuperclass> fields = new TreeMap<>();
// spin down the class hierarchy until we've either processed all of the fields
// or we've reached the Object class.
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurableClasspathArchive.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurableClasspathArchive.java b/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurableClasspathArchive.java
index d122ffc..76e7376 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurableClasspathArchive.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurableClasspathArchive.java
@@ -64,7 +64,7 @@ public class ConfigurableClasspathArchive extends CompositeArchive implements Sc
}
public static List<Archive> archive(final Module module, final Iterable<URL> urls, final boolean forceDescriptor) {
- final List<Archive> archives = new ArrayList<Archive>();
+ final List<Archive> archives = new ArrayList<>();
for (final URL location : urls) {
try {
archives.add(archive(module, location, forceDescriptor));
@@ -117,7 +117,7 @@ public class ConfigurableClasspathArchive extends CompositeArchive implements Sc
}
private static Filter filters(final Set<String> packageNames) {
- final List<Filter> filters = new ArrayList<Filter>();
+ final List<Filter> filters = new ArrayList<>();
for (final String packageName : packageNames) {
filters.add(new PackageFilter(packageName));
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java b/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java
index 0856e7e..cdc19c5 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java
@@ -335,7 +335,7 @@ public class ConfigurationFactory implements OpenEjbConfigurationFactory {
}
public static List<HandlerChainInfo> toHandlerChainInfo(final HandlerChains chains) {
- final List<HandlerChainInfo> handlerChains = new ArrayList<HandlerChainInfo>();
+ final List<HandlerChainInfo> handlerChains = new ArrayList<>();
if (chains == null) {
return handlerChains;
}
@@ -408,7 +408,7 @@ public class ConfigurationFactory implements OpenEjbConfigurationFactory {
public static class Chain implements DynamicDeployer {
- private final List<DynamicDeployer> chain = new ArrayList<DynamicDeployer>();
+ private final List<DynamicDeployer> chain = new ArrayList<>();
public boolean add(final DynamicDeployer o) {
return chain.add(o);
@@ -636,7 +636,7 @@ public class ConfigurationFactory implements OpenEjbConfigurationFactory {
private List<File> getDeclaredApps() {
// make a copy of the list because we update it
- final List<Deployments> deployments = new ArrayList<Deployments>();
+ final List<Deployments> deployments = new ArrayList<>();
if (openejb != null) {
deployments.addAll(openejb.getDeployments());
@@ -666,9 +666,9 @@ public class ConfigurationFactory implements OpenEjbConfigurationFactory {
final FileUtils base = SystemInstance.get().getBase();
- final List<Deployments> autoDeploy = new ArrayList<Deployments>();
+ final List<Deployments> autoDeploy = new ArrayList<>();
- final List<File> declaredAppsUrls = new ArrayList<File>();
+ final List<File> declaredAppsUrls = new ArrayList<>();
for (final Deployments deployment : deployments) {
try {
@@ -704,7 +704,7 @@ public class ConfigurationFactory implements OpenEjbConfigurationFactory {
final List<URL> classpathAppsUrls = DeploymentsResolver.loadFromClasspath(classLoader);
- final ArrayList<File> jarFiles = new ArrayList<File>();
+ final ArrayList<File> jarFiles = new ArrayList<>();
for (final URL path : classpathAppsUrls) {
final File file = URLs.toFile(path);
@@ -994,8 +994,8 @@ public class ConfigurationFactory implements OpenEjbConfigurationFactory {
public AppInfo configureApplication(final AppModule appModule) throws OpenEJBException {
try {
- final Collection<Class<?>> extensions = new HashSet<Class<?>>();
- final Collection<String> notLoaded = new HashSet<String>();
+ final Collection<Class<?>> extensions = new HashSet<>();
+ final Collection<String> notLoaded = new HashSet<>();
final List<URL> libs = appModule.getAdditionalLibraries();
if (libs != null && libs.size() > 0) {
@@ -1312,7 +1312,7 @@ public class ConfigurationFactory implements OpenEjbConfigurationFactory {
if (provider == null) {
final List<ServiceProvider> providers = ServiceUtils.getServiceProvidersByServiceType(providerType);
final StringBuilder sb = new StringBuilder();
- final List<String> types = new ArrayList<String>();
+ final List<String> types = new ArrayList<>();
for (final ServiceProvider p : providers) {
for (final String type : p.getTypes()) {
if (types.contains(type)) {
@@ -1600,7 +1600,7 @@ public class ConfigurationFactory implements OpenEjbConfigurationFactory {
}
public List<String> getResourceIds(final String type, Properties required) {
- final List<String> resourceIds = new ArrayList<String>();
+ final List<String> resourceIds = new ArrayList<>();
if (required == null) {
required = new Properties();
@@ -1631,7 +1631,7 @@ public class ConfigurationFactory implements OpenEjbConfigurationFactory {
// the above sys instance
if (openejb != null) {
for (final Resource resource : openejb.getResource()) {
- final ArrayList<String> types = new ArrayList<String>();
+ final ArrayList<String> types = new ArrayList<>();
if (resource.getType() != null) {
types.add(resource.getType());
}
@@ -1680,7 +1680,7 @@ public class ConfigurationFactory implements OpenEjbConfigurationFactory {
}
protected List<String> getContainerIds() {
- final List<String> containerIds = new ArrayList<String>();
+ final List<String> containerIds = new ArrayList<>();
final OpenEjbConfiguration runningConfig = getRunningConfig();
if (runningConfig != null) {
@@ -1707,7 +1707,7 @@ public class ConfigurationFactory implements OpenEjbConfigurationFactory {
}
protected List<ContainerInfo> getContainerInfos() {
- final List<ContainerInfo> containers = new ArrayList<ContainerInfo>();
+ final List<ContainerInfo> containers = new ArrayList<>();
final OpenEjbConfiguration runningConfig = getRunningConfig();
if (runningConfig != null) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/ConnectorModule.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/ConnectorModule.java b/container/openejb-core/src/main/java/org/apache/openejb/config/ConnectorModule.java
index 7d3842d..e50de75 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/ConnectorModule.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/ConnectorModule.java
@@ -35,8 +35,8 @@ public class ConnectorModule extends Module implements DeploymentModule {
private final ValidationContext validation;
private Connector connector;
- private final List<URL> libraries = new ArrayList<URL>();
- private final Set<String> watchedResources = new TreeSet<String>();
+ private final List<URL> libraries = new ArrayList<>();
+ private final Set<String> watchedResources = new TreeSet<>();
private final ID id;
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/ContainerUtils.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/ContainerUtils.java b/container/openejb-core/src/main/java/org/apache/openejb/config/ContainerUtils.java
index ce6eed2..9873597 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/ContainerUtils.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/ContainerUtils.java
@@ -26,7 +26,7 @@ import java.util.List;
public class ContainerUtils {
public static List<ContainerInfo> getContainerInfos(final AppModule module, final ConfigurationFactory configFactory) throws OpenEJBException {
- final List<ContainerInfo> containerInfos = new ArrayList<ContainerInfo>();
+ final List<ContainerInfo> containerInfos = new ArrayList<>();
if (module.getContainers().isEmpty()) {
return containerInfos;
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/ConvertDataSourceDefinitions.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/ConvertDataSourceDefinitions.java b/container/openejb-core/src/main/java/org/apache/openejb/config/ConvertDataSourceDefinitions.java
index d7bb6f3..53ef1fe 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/ConvertDataSourceDefinitions.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/ConvertDataSourceDefinitions.java
@@ -42,8 +42,8 @@ public class ConvertDataSourceDefinitions extends BaseConvertDefinitions {
final List<JndiConsumer> jndiConsumers = collectConsumers(appModule);
- final KeyedCollection<String, DataSource> dataSources = new KeyedCollection<String, DataSource>();
- final KeyedCollection<String, DataSource> dataSourcesFromCompManagedBeans = new KeyedCollection<String, DataSource>();
+ final KeyedCollection<String, DataSource> dataSources = new KeyedCollection<>();
+ final KeyedCollection<String, DataSource> dataSourcesFromCompManagedBeans = new KeyedCollection<>();
for (final JndiConsumer consumer : jndiConsumers) {
if (consumer == null) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/DebuggableVmHackery.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/DebuggableVmHackery.java b/container/openejb-core/src/main/java/org/apache/openejb/config/DebuggableVmHackery.java
index 9e739b1..3bb7b33 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/DebuggableVmHackery.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/DebuggableVmHackery.java
@@ -55,7 +55,7 @@ class DebuggableVmHackery implements DynamicDeployer {
ejbJar.setRelationships(null);
- final List<String> removed = new ArrayList<String>();
+ final List<String> removed = new ArrayList<>();
for (final EnterpriseBean bean : ejbJar.getEnterpriseBeans()) {
@@ -149,6 +149,6 @@ class DebuggableVmHackery implements DynamicDeployer {
}
public <T> List<T> copy(final Collection<T> list) {
- return new ArrayList<T>(list);
+ return new ArrayList<>(list);
}
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java b/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
index e3ec208..22d92e4 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
@@ -203,7 +203,7 @@ public class DeploymentLoader implements DeploymentFilterable {
final String jarLocation = URLs.toFilePath(baseUrl);
final ConnectorModule connectorModule = createConnectorModule(jarLocation, jarLocation, getOpenEJBClassLoader(), null);
if (connectorModule != null) {
- final List<ConnectorModule> connectorModules = new ArrayList<ConnectorModule>();
+ final List<ConnectorModule> connectorModules = new ArrayList<>();
// let it be able to deploy the same connector several times
final String id = connectorModule.getModuleId();
@@ -268,7 +268,7 @@ public class DeploymentLoader implements DeploymentFilterable {
}
public static void addWebModuleDescriptors(final URL baseUrl, final WebModule webModule, final AppModule appModule) throws OpenEJBException {
- final Map<String, Object> otherDD = new HashMap<String, Object>();
+ final Map<String, Object> otherDD = new HashMap<>();
final List<URL> urls = webModule.getScannableUrls();
final ResourceFinder finder = new ResourceFinder("", urls.toArray(new URL[urls.size()]));
otherDD.putAll(getDescriptors(finder, false));
@@ -361,7 +361,7 @@ public class DeploymentLoader implements DeploymentFilterable {
if (otherDD.containsKey(name)) {
List<URL> persistenceUrls = (List<URL>) appModule.getAltDDs().get(name);
if (persistenceUrls == null) {
- persistenceUrls = new ArrayList<URL>();
+ persistenceUrls = new ArrayList<>();
appModule.getAltDDs().put(name, persistenceUrls);
}
@@ -403,14 +403,14 @@ public class DeploymentLoader implements DeploymentFilterable {
// Find all the modules using either the application xml or by searching for all .jar, .war and .rar files.
//
- final Map<String, URL> ejbModules = new LinkedHashMap<String, URL>();
- final Map<String, URL> clientModules = new LinkedHashMap<String, URL>();
- final Map<String, URL> resouceModules = new LinkedHashMap<String, URL>();
- final Map<String, URL> webModules = new LinkedHashMap<String, URL>();
- final Map<String, String> webContextRoots = new LinkedHashMap<String, String>();
+ final Map<String, URL> ejbModules = new LinkedHashMap<>();
+ final Map<String, URL> clientModules = new LinkedHashMap<>();
+ final Map<String, URL> resouceModules = new LinkedHashMap<>();
+ final Map<String, URL> webModules = new LinkedHashMap<>();
+ final Map<String, String> webContextRoots = new LinkedHashMap<>();
final URL applicationXmlUrl = appDescriptors.get("application.xml");
- final List<URL> extraLibs = new ArrayList<URL>();
+ final List<URL> extraLibs = new ArrayList<>();
final Application application;
if (applicationXmlUrl != null) {
@@ -439,7 +439,7 @@ public class DeploymentLoader implements DeploymentFilterable {
}
} else {
application = new Application();
- final HashMap<String, URL> files = new HashMap<String, URL>();
+ final HashMap<String, URL> files = new HashMap<>();
scanDir(appDir, files, "", false);
files.remove("META-INF/MANIFEST.MF");
@@ -500,7 +500,7 @@ public class DeploymentLoader implements DeploymentFilterable {
}
// All jars nested in the Resource Adapter
- final HashMap<String, URL> rarLibs = new HashMap<String, URL>();
+ final HashMap<String, URL> rarLibs = new HashMap<>();
for (final Map.Entry<String, URL> entry : resouceModules.entrySet()) {
try {
// unpack the resource adapter archive
@@ -546,7 +546,7 @@ public class DeploymentLoader implements DeploymentFilterable {
appModule.getWatchedResources().add(URLs.toFilePath(applicationXmlUrl));
}
if (appDescriptors.containsKey(RESOURCES_XML)) {
- final Map<String, Object> altDd = new HashMap<String, Object>(appDescriptors);
+ final Map<String, Object> altDd = new HashMap<>(appDescriptors);
ReadDescriptors.readResourcesXml(new org.apache.openejb.config.Module(false) {
@Override
public Map<String, Object> getAltDDs() {
@@ -975,7 +975,7 @@ public class DeploymentLoader implements DeploymentFilterable {
final String externalRepos = systemInstance.getProperty("tomee." + warFile.getName().replace(".war", "") + ".externalRepositories");
List<URL> externalUrls = null;
if (externalRepos != null) {
- externalUrls = new ArrayList<URL>();
+ externalUrls = new ArrayList<>();
for (final String additional : externalRepos.split(",")) {
final String trim = additional.trim();
if (!trim.isEmpty()) {
@@ -992,7 +992,7 @@ public class DeploymentLoader implements DeploymentFilterable {
final Map<String, URL[]> urls = getWebappUrlsAndRars(warFile);
webUrls.addAll(Arrays.asList(urls.get(URLS_KEY)));
- final List<URL> addedUrls = new ArrayList<URL>();
+ final List<URL> addedUrls = new ArrayList<>();
for (final URL url : urls.get(RAR_URLS_KEY)) { // eager unpack to be able to use it in classloader
final File[] files = unpack(URLs.toFile(url)).listFiles();
if (files != null) {
@@ -1276,8 +1276,8 @@ public class DeploymentLoader implements DeploymentFilterable {
}
public static Map<String, URL[]> getWebappUrlsAndRars(final File warFile) {
- final Set<URL> webClassPath = new HashSet<URL>();
- final Set<URL> webRars = new HashSet<URL>();
+ final Set<URL> webClassPath = new HashSet<>();
+ final Set<URL> webRars = new HashSet<>();
final File webInfDir = new File(warFile, "WEB-INF");
try {
webClassPath.add(new File(webInfDir, "classes").toURI().toURL());
@@ -1314,7 +1314,7 @@ public class DeploymentLoader implements DeploymentFilterable {
}
// create the class loader
- final Map<String, URL[]> urls = new HashMap<String, URL[]>();
+ final Map<String, URL[]> urls = new HashMap<>();
urls.put(URLS_KEY, webClassPath.toArray(new URL[webClassPath.size()]));
urls.put(RAR_URLS_KEY, webRars.toArray(new URL[webRars.size()]));
return urls;
@@ -1353,7 +1353,7 @@ public class DeploymentLoader implements DeploymentFilterable {
}
// parse the webservices.xml file
- final Map<URL, JavaWsdlMapping> jaxrpcMappingCache = new HashMap<URL, JavaWsdlMapping>();
+ final Map<URL, JavaWsdlMapping> jaxrpcMappingCache = new HashMap<>();
final Webservices webservices = ReadDescriptors.readWebservices(webservicesUrl);
wsModule.setWebservices(webservices);
if ("file".equals(webservicesUrl.getProtocol())) {
@@ -1385,7 +1385,7 @@ public class DeploymentLoader implements DeploymentFilterable {
}
private void addTagLibraries(final WebModule webModule) throws OpenEJBException {
- final Set<URL> tldLocations = new HashSet<URL>();
+ final Set<URL> tldLocations = new HashSet<>();
// web.xml contains tag lib locations in nested jsp config elements
final File warFile = new File(webModule.getJarLocation());
@@ -1442,7 +1442,7 @@ public class DeploymentLoader implements DeploymentFilterable {
//*************************IMPORTANT*******************************************
// TODO : kmalhi :: Add support to scrape META-INF/faces-config.xml in jar files
// look at section 10.4.2 of the JSF v1.2 spec, bullet 1 for details
- final Set<URL> facesConfigLocations = new HashSet<URL>();
+ final Set<URL> facesConfigLocations = new HashSet<>();
// web.xml contains faces config locations in the context parameter javax.faces.CONFIG_FILES
final File warFile = new File(webModule.getJarLocation());
@@ -1532,7 +1532,7 @@ public class DeploymentLoader implements DeploymentFilterable {
}
// find the nested jar files
- final HashMap<String, URL> rarLibs = new HashMap<String, URL>();
+ final HashMap<String, URL> rarLibs = new HashMap<>();
scanDir(rarFile, rarLibs, "");
for (final Iterator<Map.Entry<String, URL>> iterator = rarLibs.entrySet().iterator(); iterator.hasNext(); ) {
// remove all non jars from the rarLibs
@@ -1543,7 +1543,7 @@ public class DeploymentLoader implements DeploymentFilterable {
}
// create the class loader
- final List<URL> classPath = new ArrayList<URL>();
+ final List<URL> classPath = new ArrayList<>();
classPath.addAll(rarLibs.values());
final ClassLoaderConfigurer configurer = QuickJarsTxtParser.parse(new File(rarFile, "META-INF/" + QuickJarsTxtParser.FILE_NAME));
@@ -1577,12 +1577,12 @@ public class DeploymentLoader implements DeploymentFilterable {
webFragmentUrls = (List<URL>) webModule.getAltDDs().get(WEB_FRAGMENT_XML);
} catch (final ClassCastException e) {
final Object value = webModule.getAltDDs().get(WEB_FRAGMENT_XML);
- webFragmentUrls = new ArrayList<URL>();
+ webFragmentUrls = new ArrayList<>();
webFragmentUrls.add(URL.class.cast(value));
webModule.getAltDDs().put(WEB_FRAGMENT_XML, webFragmentUrls);
}
if (webFragmentUrls == null) {
- webFragmentUrls = new ArrayList<URL>();
+ webFragmentUrls = new ArrayList<>();
webModule.getAltDDs().put(WEB_FRAGMENT_XML, webFragmentUrls);
}
@@ -1609,7 +1609,7 @@ public class DeploymentLoader implements DeploymentFilterable {
@SuppressWarnings({"unchecked"})
protected static Collection<URL> addPersistenceUnits(final AppModule appModule, final URL... urls) throws OpenEJBException {
- final Collection<URL> added = new ArrayList<URL>();
+ final Collection<URL> added = new ArrayList<>();
// OPENEJB-1059: Anything in the appModule.getAltDDs() map has already been
// processed by the altdd code, so anything in here should not cause OPENEJB-1059
@@ -1621,20 +1621,20 @@ public class DeploymentLoader implements DeploymentFilterable {
//lets try to get a single object instead
final Object value = appModule.getAltDDs().get("persistence.xml");
- persistenceUrls = new ArrayList<URL>();
+ persistenceUrls = new ArrayList<>();
persistenceUrls.add(URL.class.cast(value));
added.add(persistenceUrls.iterator().next());
appModule.getAltDDs().put("persistence.xml", persistenceUrls);
}
if (persistenceUrls == null) {
- persistenceUrls = new ArrayList<URL>();
+ persistenceUrls = new ArrayList<>();
appModule.getAltDDs().put("persistence.xml", persistenceUrls);
}
List<URL> persistenceFragmentsUrls = (List<URL>) appModule.getAltDDs().get("persistence-fragment.xml");
if (persistenceFragmentsUrls == null) {
- persistenceFragmentsUrls = new ArrayList<URL>();
+ persistenceFragmentsUrls = new ArrayList<>();
appModule.getAltDDs().put("persistence-fragment.xml", persistenceFragmentsUrls);
}
@@ -1744,10 +1744,10 @@ public class DeploymentLoader implements DeploymentFilterable {
return map;
}
- final List<String> list = new ArrayList<String>(Arrays.asList(ALTDD.split(",")));
+ final List<String> list = new ArrayList<>(Arrays.asList(ALTDD.split(",")));
Collections.reverse(list);
- final Map<String, URL> alts = new HashMap<String, URL>();
+ final Map<String, URL> alts = new HashMap<>();
for (String prefix : list) {
prefix = prefix.trim();
@@ -1755,7 +1755,7 @@ public class DeploymentLoader implements DeploymentFilterable {
prefix += ".";
}
- for (final Map.Entry<String, URL> entry : new HashMap<String, URL>(map).entrySet()) {
+ for (final Map.Entry<String, URL> entry : new HashMap<>(map).entrySet()) {
String key = entry.getKey();
final URL value = entry.getValue();
if (key.startsWith(prefix)) {
@@ -1785,7 +1785,7 @@ public class DeploymentLoader implements DeploymentFilterable {
}
public static Map<String, URL> getWebDescriptors(final File warFile) throws IOException {
- final Map<String, URL> descriptors = new TreeMap<String, URL>();
+ final Map<String, URL> descriptors = new TreeMap<>();
// xbean resource finder has a bug when you use any uri but "META-INF"
// and the jar file does not contain a directory entry for the uri
@@ -1909,7 +1909,7 @@ public class DeploymentLoader implements DeploymentFilterable {
}
public Class<? extends DeploymentModule> discoverModuleType(final URL baseUrl, final ClassLoader classLoader, final boolean searchForDescriptorlessApplications) throws IOException, UnknownModuleTypeException {
- final Set<RequireDescriptors> search = new HashSet<RequireDescriptors>();
+ final Set<RequireDescriptors> search = new HashSet<>();
if (!searchForDescriptorlessApplications) {
search.addAll(Arrays.asList(RequireDescriptors.values()));
@@ -2062,7 +2062,7 @@ public class DeploymentLoader implements DeploymentFilterable {
if (scanPotentialEjbModules || scanPotentialClientModules) {
final AnnotationFinder classFinder = new AnnotationFinder(classLoader, urls);
- final Set<Class<? extends DeploymentModule>> otherTypes = new LinkedHashSet<Class<? extends DeploymentModule>>();
+ final Set<Class<? extends DeploymentModule>> otherTypes = new LinkedHashSet<>();
final AnnotationFinder.Filter filter = new AnnotationFinder.Filter() {
final String packageName = LocalClient.class.getName().replace("LocalClient", "");
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentModule.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentModule.java b/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentModule.java
index 77939f6..71db257 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentModule.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentModule.java
@@ -67,7 +67,7 @@ public interface DeploymentModule {
/**
* The intention of this is to hold the extracted and archived versions
*/
- private final Set<String> locations = new LinkedHashSet<String>();
+ private final Set<String> locations = new LinkedHashSet<>();
public ID(final NamedModule vendorDd, final NamedModule specDd, final String name, final File location, final URI uri, final DeploymentModule module) {
this.name = name(vendorDd, specDd, uri, location, name, module);
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentsResolver.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentsResolver.java b/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentsResolver.java
index 171d196..5bcaf38 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentsResolver.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentsResolver.java
@@ -153,7 +153,7 @@ public class DeploymentsResolver implements DeploymentFilterable {
Files.dir(dir);
Files.notHidden(dir);
- final Map<String, File> files = new LinkedHashMap<String, File>();
+ final Map<String, File> files = new LinkedHashMap<>();
final File[] list = dir.listFiles(new FileFilter() {
@Override
public boolean accept(final File f) {
@@ -298,7 +298,7 @@ public class DeploymentsResolver implements DeploymentFilterable {
logger.fatal("ADJUST THE EXCLUDE/INCLUDE!!!. Current settings: " +
CLASSPATH_EXCLUDE + "='" + searchResult.exclude + "', " +
CLASSPATH_INCLUDE + "='" + searchResult.include + "'");
- final List<String> list = new ArrayList<String>();
+ final List<String> list = new ArrayList<>();
for (final URL url : searchResult.urls) {
list.add(url.toExternalForm());
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/EnvEntriesPropertiesDeployer.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/EnvEntriesPropertiesDeployer.java b/container/openejb-core/src/main/java/org/apache/openejb/config/EnvEntriesPropertiesDeployer.java
index 3da2596..989a4e1 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/EnvEntriesPropertiesDeployer.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/EnvEntriesPropertiesDeployer.java
@@ -46,7 +46,7 @@ public class EnvEntriesPropertiesDeployer implements DynamicDeployer {
public static final String ENV_ENTRY_PROPERTIES = "env-entries.properties";
private final String descriptorName;
- private final Map<String, String> additionalEnvEntries = new HashMap<String, String>();
+ private final Map<String, String> additionalEnvEntries = new HashMap<>();
public EnvEntriesPropertiesDeployer() {
this(ENV_ENTRY_PROPERTIES);
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/FinderFactory.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/FinderFactory.java b/container/openejb-core/src/main/java/org/apache/openejb/config/FinderFactory.java
index 54418e7..0a17e0c 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/FinderFactory.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/FinderFactory.java
@@ -278,7 +278,7 @@ public class FinderFactory {
final Archive archive = ((AnnotationFinder) limitedFinder).getArchive();
if (archive instanceof WebappAggregatedArchive) {
final Map<URL, List<String>> index = ((WebappAggregatedArchive) archive).getClassesMap();
- final Map<String, String> urlByClasses = new HashMap<String, String>();
+ final Map<String, String> urlByClasses = new HashMap<>();
for (final Map.Entry<URL, List<String>> entry : index.entrySet()) {
final String url = entry.getKey().toExternalForm();
for (final String current : entry.getValue()) {
@@ -401,12 +401,12 @@ public class FinderFactory {
@Override
public <T> List<Class<? extends T>> findSubclasses(final Class<T> clazz) {
- return filter(delegate.findSubclasses(clazz), new ClassPredicate<T>(getAnnotatedClassNames()));
+ return filter(delegate.findSubclasses(clazz), new ClassPredicate<>(getAnnotatedClassNames()));
}
@Override
public <T> List<Class<? extends T>> findImplementations(final Class<T> clazz) {
- return filter(delegate.findImplementations(clazz), new ClassPredicate<T>(getAnnotatedClassNames()));
+ return filter(delegate.findImplementations(clazz), new ClassPredicate<>(getAnnotatedClassNames()));
}
@Override
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/GeneratedClientModules.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/GeneratedClientModules.java b/container/openejb-core/src/main/java/org/apache/openejb/config/GeneratedClientModules.java
index 3094123..06ecf55 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/GeneratedClientModules.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/GeneratedClientModules.java
@@ -62,7 +62,7 @@ public class GeneratedClientModules {
*/
public static class Prune implements DynamicDeployer {
public AppModule deploy(final AppModule appModule) throws OpenEJBException {
- final List<ClientModule> clientModules = new ArrayList<ClientModule>(appModule.getClientModules());
+ final List<ClientModule> clientModules = new ArrayList<>(appModule.getClientModules());
for (final ClientModule clientModule : clientModules) {
// we automatically add a ClientModule to every EjbModule
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/InitEjbDeployments.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/InitEjbDeployments.java b/container/openejb-core/src/main/java/org/apache/openejb/config/InitEjbDeployments.java
index 47c2784..c9b768c 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/InitEjbDeployments.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/InitEjbDeployments.java
@@ -48,7 +48,7 @@ public class InitEjbDeployments implements DynamicDeployer {
public synchronized AppModule deploy(final AppModule appModule) throws OpenEJBException {
- final Set<String> abstractSchemaNames = new HashSet<String>();
+ final Set<String> abstractSchemaNames = new HashSet<>();
for (final EjbModule ejbModule : appModule.getEjbModules()) {
for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) {
if (isCmpEntity(bean)) {
@@ -62,7 +62,7 @@ public class InitEjbDeployments implements DynamicDeployer {
}
- final Map<String, String> contextData = new HashMap<String, String>();
+ final Map<String, String> contextData = new HashMap<>();
contextData.put("appId", appModule.getModuleId());
for (final EjbModule ejbModule : appModule.getEjbModules()) {
@@ -99,7 +99,7 @@ public class InitEjbDeployments implements DynamicDeployer {
}
public EjbModule deploy(final EjbModule ejbModule) throws OpenEJBException {
- return deploy(ejbModule, new HashMap<String, String>(), new HashSet<String>());
+ return deploy(ejbModule, new HashMap<>(), new HashSet<>());
}
private EjbModule deploy(final EjbModule ejbModule, final Map<String, String> contextData, final Set<String> abstractSchemaNames) throws OpenEJBException {
http://git-wip-us.apache.org/repos/asf/tomee/blob/bfb1ed40/container/openejb-core/src/main/java/org/apache/openejb/config/JndiEncInfoBuilder.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/JndiEncInfoBuilder.java b/container/openejb-core/src/main/java/org/apache/openejb/config/JndiEncInfoBuilder.java
index 20bdaf0..202d8ea 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/JndiEncInfoBuilder.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/JndiEncInfoBuilder.java
@@ -77,7 +77,7 @@ import static org.apache.openejb.assembler.classic.EjbResolver.Scope.EJBJAR;
public class JndiEncInfoBuilder {
public static final Logger logger = Logger.getInstance(LogCategory.OPENEJB_STARTUP, JndiEncInfoBuilder.class);
private final EjbResolver earResolver;
- private final Map<String, EjbResolver> ejbJarResolvers = new HashMap<String, EjbResolver>();
+ private final Map<String, EjbResolver> ejbJarResolvers = new HashMap<>();
private final AppInfo appInfo;
public JndiEncInfoBuilder(final AppInfo appInfo) {
@@ -127,7 +127,7 @@ public class JndiEncInfoBuilder {
private void buildEjbRefs(final JndiConsumer jndiConsumer, final URI moduleUri, final String moduleId, final String ejbName, final JndiEncInfo moduleJndiEnc, final JndiEncInfo compJndiEnc) throws OpenEJBException {
final Collection<EjbRef> ejbRefs = jndiConsumer.getEjbRef();
final Collection<EjbLocalRef> ejbLocalRefs = jndiConsumer.getEjbLocalRef();
- final List<EjbReference> references = new ArrayList<EjbReference>(ejbRefs.size() + ejbLocalRefs.size());
+ final List<EjbReference> references = new ArrayList<>(ejbRefs.size() + ejbLocalRefs.size());
references.addAll(ejbRefs);
references.addAll(ejbLocalRefs);
@@ -414,7 +414,7 @@ public class JndiEncInfoBuilder {
}
private Collection<? extends InjectionInfo> buildInjectionInfos(final Injectable injectable) {
- final List<InjectionInfo> infos = new ArrayList<InjectionInfo>();
+ final List<InjectionInfo> infos = new ArrayList<>();
for (final InjectionTarget target : injectable.getInjectionTarget()) {
final InjectionInfo info = new InjectionInfo();
info.className = target.getInjectionTargetClass();