changeset 22199:e3aef4c65ea1

add Location#canSet(value)
author Andreas Woess <andreas.woess@oracle.com>
date Fri, 25 Sep 2015 16:36:10 +0200
parents 0e5aa5fd5060
children 7abcbeb12d08
files truffle/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/Location.java truffle/com.oracle.truffle.object/src/com/oracle/truffle/object/LocationImpl.java
diffstat 2 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/Location.java	Tue Sep 22 16:46:09 2015 +0200
+++ b/truffle/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/Location.java	Fri Sep 25 16:36:10 2015 +0200
@@ -135,6 +135,15 @@
     }
 
     /**
+     * Returns {@code true} if the location can be set to the value.
+     *
+     * @param value the value in question
+     */
+    public boolean canSet(Object value) {
+        return canStore(value);
+    }
+
+    /**
      * Returns {@code true} if the location is compatible with the value.
      *
      * The value may still be rejected if {@link #canSet(DynamicObject, Object)} returns false.
--- a/truffle/com.oracle.truffle.object/src/com/oracle/truffle/object/LocationImpl.java	Tue Sep 22 16:46:09 2015 +0200
+++ b/truffle/com.oracle.truffle.object/src/com/oracle/truffle/object/LocationImpl.java	Fri Sep 25 16:36:10 2015 +0200
@@ -77,6 +77,11 @@
     }
 
     @Override
+    public final boolean canSet(Object value) {
+        return canSet(null, value);
+    }
+
+    @Override
     public boolean canStore(Object value) {
         return true;
     }