Mantis - Quercus
Viewing Issue Advanced Details
2254 minor always 12-13-07 14:21 12-17-07 08:24
koreth  
ferg  
normal  
closed 3.1.4  
fixed  
none    
none 3.1.5  
0002254: Can't call array_key_exists() on a Java Map
f Java code returns a Map object, PHP code can't call array_key_exists() on it; an UnsupportedOperationException is thrown. It's because containsKey() isn't implemented in JavaMapAdapter. The fix is trivial.


--- a/modules/quercus/src/com/caucho/quercus/env/JavaMapAdapter.java
+++ b/modules/quercus/src/com/caucho/quercus/env/JavaMapAdapter.java
@@ -141,7 +141,16 @@ public class JavaMapAdapter
    else
      return UnsetValue.UNSET;
  }
-
+
+ /**
+ * Returns true if the map contains a key.
+ */
+ @Override
+ public BooleanValue containsKey(Value key)
+ {
+ return BooleanValue.create(_map.containsKey(key.toJavaObject()));
+ }
+
  /**
   * Removes a value.
   */

Notes
(0002578)
ferg   
12-17-07 08:24   
php/0cfr