set lvalue = rvalue

Brad Wetmore <[email protected]> Tue, 25 Jan 2005 15:25:41 -0800
Newsgroups gmane.comp.java.jswat.user
Message-ID <[email protected]>
I'm afraid I already know the answer to this question, but want to make 
sure there's not some other way to do it.  I want to dynamically change 
an object variable to change the flow of my application.  It appears 
JSWAT's set only works on primitive types.

class PermissionCollection {
     java.util.Hashtable perms;

     public void doit(PermissionCollection p) {
	if (this.perms.implies(...) {
	    doSomething();
     }
}

Basically, I want to assign p.perms to this.perms before running the if.

According to the docs, with the set command, the lvalue type implies the 
right value's type.

 > set this.perms = p.perms
Invalid type on right-hand side of assignment: value: p.perms, type: 
java.lang.String, expected: java.util.Hashtable
 > set this.perms = (java.util.Hashtable) p.perms
Invalid type on right-hand side of assignment: value: 
(java.util.Hashtable) p.perms, type: java.lang.String, expected: 
java.util.Hashtable

I hope I'm just missing something simple, or am I out of luck until a 
future release?  From the Help section on "Expression Evaluation"

     Type casting is not (yet) supported.

Thanks!

Brad