Closed shrtminded closed 10 years ago
I was able to fix this issue locally but not sure if this is how you would want to fix it. Below is the patch for the changes I made if you want to use them ...
From 897f595008f18798503e6a339c55c91c4455bb9d Mon Sep 17 00:00:00 2001
Date: Wed, 15 Jan 2014 08:40:21 -0500
Subject: [PATCH] Fixing logical and/or statements
---
src/main/java/org/kohsuke/groovy/sandbox/impl/Ops.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/main/java/org/kohsuke/groovy/sandbox/impl/Ops.java b/src/main/java/org/kohsuke/groovy/sandbox/impl/Ops.java
index 57b3f02..e8fcc62 100644
--- a/src/main/java/org/kohsuke/groovy/sandbox/impl/Ops.java
+++ b/src/main/java/org/kohsuke/groovy/sandbox/impl/Ops.java
@@ -64,6 +64,8 @@ public class Ops {
b.put(BITWISE_OR,"or");
b.put(BITWISE_AND,"and");
b.put(BITWISE_XOR,"xor");
+ b.put(LOGICAL_OR,"or");
+ b.put(LOGICAL_AND,"and");
b.put(LEFT_SHIFT,"leftShift");
b.put(RIGHT_SHIFT,"rightShift");
b.put(RIGHT_SHIFT_UNSIGNED,"rightShiftUnsigned");
--
1.8.3.4 (Apple Git-47)
I've fixed this issue. The patch is actually incorrect because the "or" method is for overloading bitwise-or, which is not the same thing as logical or.
I am receiving a IllegalArgumentException when I have an logical operation.
For example:
Cause this exception to be thrown
I am not sure if this is related to issue #9.