Re: set lvalue = rvalue

"Nathan Fiedler" <[email protected]> Tue, 25 Jan 2005 17:37:34 -0800 (PST)
Newsgroups gmane.comp.java.jswat.user
Message-ID <[email protected]>
You are right, the expression evaluator has a couple of problems in
version 2.x, all of which are being corrected for 3.0. With any luck and a
lot of hard work, 3.0 will be out sometime this year (it's a complete
rewrite for the NetBeans Platform).

I'll see what can be done about back-porting the new expression evalutor
to 2.x; will be a bit of work since the new code uses Java 5 features.

n


Brad Wetmore wrote:
> 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