New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing property exception for closure parameter when used in while statement #59
Comments
My current workaround is to do the following, which also seems to work def noneMatch = list.stream().noneMatch({s -> s.indexOf((int) somec) >= 0})
while (noneMatch) {
somec++
noneMatch = list.stream().noneMatch({s -> s.indexOf((int) somec) >= 0})
} |
Thanks for the bug report! I looked into this today to try to understand whether the bug could be used to bypass the sandbox by confusing the transformer. I think it's safe, since the problem appears to be that the expression in question is being transformed by the sandbox multiple times. This happens because When The call to I think the fix is relatively straightforward.
|
Has this been forgotten? Or waiting for approval? |
Hi: |
Any resolution for this bug nowadays? |
Hi,
I have the following sample code which works fine when running it in a groovy class:
However, when trying to execute this code via the GroovyShell, a MissingPropertyException is thrown for the closure parameter 's'. It seems that
org.kohsuke.groovy.sandbox.impl.Checker
is trying to find the property on the Script object, rather than within the closure. When changing the while to an if statement everything seems to work andorg.kohsuke.groovy.sandbox.impl.Checker#checkedGetProperty
is never called in the first place.Full stack trace:
The text was updated successfully, but these errors were encountered: