Dave Novelli
Dave Novelli

Reputation: 2184

Beanshell XOR throwing error

When I try to use the xor operator:

if(a ^ b)

I get the following error:

internal Error: unimplemented binary operator

Is there another way to do it in beanshell, or should I just do:

if((a && !b) || (!a && b))

Upvotes: 2

Views: 901

Answers (2)

Peter
Peter

Reputation: 1312

In Beanshell2 the xor operator is implemented, see http://code.google.com/p/beanshell2

Upvotes: 2

Tony Casale
Tony Casale

Reputation: 1537

if(a != b) is equivalent to XOR (a ^ b) for booleans.

Upvotes: 4

Related Questions