tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1360806 - in /tomcat/trunk/java/javax/el: BeanELResolver.java ELContext.java ExpressionFactory.java ListELResolver.java MapELResolver.java ResourceBundleELResolver.java
Date Thu, 12 Jul 2012 16:40:55 GMT
Author: markt
Date: Thu Jul 12 16:40:55 2012
New Revision: 1360806

URL: http://svn.apache.org/viewvc?rev=1360806&view=rev
Log:
Code clean-up for javax.el
 - Add final prompted by UCDetector
 - Java 7 use of <>

Modified:
    tomcat/trunk/java/javax/el/BeanELResolver.java
    tomcat/trunk/java/javax/el/ELContext.java
    tomcat/trunk/java/javax/el/ExpressionFactory.java
    tomcat/trunk/java/javax/el/ListELResolver.java
    tomcat/trunk/java/javax/el/MapELResolver.java
    tomcat/trunk/java/javax/el/ResourceBundleELResolver.java

Modified: tomcat/trunk/java/javax/el/BeanELResolver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/BeanELResolver.java?rev=1360806&r1=1360805&r2=1360806&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/BeanELResolver.java (original)
+++ tomcat/trunk/java/javax/el/BeanELResolver.java Thu Jul 12 16:40:55 2012
@@ -61,7 +61,7 @@ public class BeanELResolver extends ELRe
     private final boolean readOnly;
 
     private final ConcurrentCache<String, BeanProperties> cache =
-        new ConcurrentCache<String, BeanProperties>(CACHE_SIZE);
+        new ConcurrentCache<>(CACHE_SIZE);
 
     public BeanELResolver() {
         this.readOnly = false;
@@ -218,7 +218,7 @@ public class BeanELResolver extends ELRe
 
         public BeanProperties(Class<?> type) throws ELException {
             this.type = type;
-            this.properties = new HashMap<String, BeanProperty>();
+            this.properties = new HashMap<>();
             try {
                 BeanInfo info = Introspector.getBeanInfo(this.type);
                 PropertyDescriptor[] pds = info.getPropertyDescriptors();
@@ -365,8 +365,8 @@ public class BeanELResolver extends ELRe
 
         public ConcurrentCache(int size) {
             this.size = size;
-            this.eden = new ConcurrentHashMap<K,V>(size);
-            this.longterm = new WeakHashMap<K,V>(size);
+            this.eden = new ConcurrentHashMap<>(size);
+            this.longterm = new WeakHashMap<>(size);
         }
 
         public V get(K key) {

Modified: tomcat/trunk/java/javax/el/ELContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ELContext.java?rev=1360806&r1=1360805&r2=1360806&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/ELContext.java (original)
+++ tomcat/trunk/java/javax/el/ELContext.java Thu Jul 12 16:40:55 2012
@@ -55,7 +55,7 @@ public abstract class ELContext {
         }
 
         if (this.map == null) {
-            this.map = new HashMap<Class<?>, Object>();
+            this.map = new HashMap<>();
         }
 
         this.map.put(key, contextObject);

Modified: tomcat/trunk/java/javax/el/ExpressionFactory.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ExpressionFactory.java?rev=1360806&r1=1360805&r2=1360806&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/ExpressionFactory.java (original)
+++ tomcat/trunk/java/javax/el/ExpressionFactory.java Thu Jul 12 16:40:55 2012
@@ -55,8 +55,8 @@ public abstract class ExpressionFactory 
     private static final String PROPERTY_FILE;
 
     private static final CacheValue nullTcclFactory = new CacheValue();
-    private static ConcurrentMap<CacheKey, CacheValue> factoryCache
-        = new ConcurrentHashMap<CacheKey, CacheValue>();
+    private static final ConcurrentMap<CacheKey, CacheValue> factoryCache =
+            new ConcurrentHashMap<>();
 
     static {
         if (IS_SECURITY_ENABLED) {
@@ -240,7 +240,7 @@ public abstract class ExpressionFactory 
 
         public CacheKey(ClassLoader cl) {
             hash = cl.hashCode();
-            ref = new WeakReference<ClassLoader>(cl);
+            ref = new WeakReference<>(cl);
         }
 
         @Override

Modified: tomcat/trunk/java/javax/el/ListELResolver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ListELResolver.java?rev=1360806&r1=1360805&r2=1360806&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/ListELResolver.java (original)
+++ tomcat/trunk/java/javax/el/ListELResolver.java Thu Jul 12 16:40:55 2012
@@ -29,7 +29,7 @@ public class ListELResolver extends ELRe
     private final boolean readOnly;
 
     private static final Class<?> UNMODIFIABLE =
-        Collections.unmodifiableList(new ArrayList<Object>()).getClass();
+        Collections.unmodifiableList(new ArrayList<>()).getClass();
 
     public ListELResolver() {
         this.readOnly = false;

Modified: tomcat/trunk/java/javax/el/MapELResolver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/MapELResolver.java?rev=1360806&r1=1360805&r2=1360806&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/MapELResolver.java (original)
+++ tomcat/trunk/java/javax/el/MapELResolver.java Thu Jul 12 16:40:55 2012
@@ -27,8 +27,8 @@ import java.util.Map;
 
 public class MapELResolver extends ELResolver {
 
-    private static final Class<?> UNMODIFIABLE = Collections.unmodifiableMap(
-            new HashMap<Object, Object>()).getClass();
+    private static final Class<?> UNMODIFIABLE =
+            Collections.unmodifiableMap(new HashMap<>()).getClass();
 
     private final boolean readOnly;
 
@@ -117,7 +117,7 @@ public class MapELResolver extends ELRes
     public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object
base) {
         if (base instanceof Map<?, ?>) {
             Iterator<?> itr = ((Map<?, ?>) base).keySet().iterator();
-            List<FeatureDescriptor> feats = new ArrayList<FeatureDescriptor>();
+            List<FeatureDescriptor> feats = new ArrayList<>();
             Object key;
             FeatureDescriptor desc;
             while (itr.hasNext()) {

Modified: tomcat/trunk/java/javax/el/ResourceBundleELResolver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ResourceBundleELResolver.java?rev=1360806&r1=1360805&r2=1360806&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/ResourceBundleELResolver.java (original)
+++ tomcat/trunk/java/javax/el/ResourceBundleELResolver.java Thu Jul 12 16:40:55 2012
@@ -108,7 +108,7 @@ public class ResourceBundleELResolver ex
     public Iterator getFeatureDescriptors(
             ELContext context, Object base) {
         if (base instanceof ResourceBundle) {
-            List<FeatureDescriptor> feats = new ArrayList<FeatureDescriptor>();
+            List<FeatureDescriptor> feats = new ArrayList<>();
             Enumeration<String> e = ((ResourceBundle) base).getKeys();
             FeatureDescriptor feat;
             String key;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message