sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r902946 - in /sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl: SlingScriptAdapterFactory.java helper/ProtectedBindings.java
Date Mon, 25 Jan 2010 19:32:22 GMT
Author: justin
Date: Mon Jan 25 19:32:22 2010
New Revision: 902946

URL: http://svn.apache.org/viewvc?rev=902946&view=rev
Log:
SLING-1303 SLING-1318 - upgrading SLING-1303 modifications to use generics

Modified:
    sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/SlingScriptAdapterFactory.java
    sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/helper/ProtectedBindings.java

Modified: sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/SlingScriptAdapterFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/SlingScriptAdapterFactory.java?rev=902946&r1=902945&r2=902946&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/SlingScriptAdapterFactory.java
(original)
+++ sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/SlingScriptAdapterFactory.java
Mon Jan 25 19:32:22 2010
@@ -22,7 +22,6 @@
 import java.io.InputStreamReader;
 import java.net.URL;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.Dictionary;
 import java.util.HashMap;
 import java.util.HashSet;

Modified: sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/helper/ProtectedBindings.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/helper/ProtectedBindings.java?rev=902946&r1=902945&r2=902946&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/helper/ProtectedBindings.java
(original)
+++ sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/helper/ProtectedBindings.java
Mon Jan 25 19:32:22 2010
@@ -2,17 +2,15 @@
 
 import java.util.Collection;
 import java.util.Collections;
-import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
 import javax.script.Bindings;
 
-@SuppressWarnings("restriction")
 public class ProtectedBindings implements Bindings {
 
     private final Bindings wrapped;
-    private final Set<Object> protectedKeys;
+    private final Set<String> protectedKeys;
 
     public ProtectedBindings(Bindings wrapped) {
         this.wrapped = wrapped;
@@ -24,7 +22,7 @@
      *
      * @throws an IllegalArgumentException if the key is protected
      */
-    public Object put(Object key, Object value) {
+    public Object put(String key, Object value) {
         if (protectedKeys.contains(key)) {
             throw new IllegalArgumentException(String.format("Key %s is protected.", key));
         }
@@ -34,8 +32,8 @@
     /**
      * {@inheritDoc}
      */
-    public void putAll(Map toMerge) {
-        for (Object key : toMerge.keySet()) {
+    public void putAll(Map<? extends String, ? extends Object> toMerge) {
+        for (String key : toMerge.keySet()) {
             if (!protectedKeys.contains(key)) {
                 wrapped.put(key, toMerge.get(key));
             }
@@ -74,7 +72,7 @@
      *
      * @return an unmodifiable Set view of the map
      */
-    public Set<java.util.Map.Entry<Object, Object>> entrySet() {
+    public Set<Entry<String, Object>> entrySet() {
         return Collections.unmodifiableSet(wrapped.entrySet());
     }
 
@@ -91,7 +89,7 @@
      *
      * @return an unmodifiable Set view of the map's keys
      */
-    public Set<Object> keySet() {
+    public Set<String> keySet() {
         return Collections.unmodifiableSet(wrapped.keySet());
     }
 



Mime
View raw message