-
Notifications
You must be signed in to change notification settings - Fork 161
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
[JENKINS-69899] Do not visit EmptyExpression when transforming fields declared using @Field #457
Conversation
… setting attributes
…other than RejectedAccessException in assertRejected
@@ -418,7 +418,7 @@ private interface Rejector { | |||
Checker.preCheckedCast(field.getType(), value, false, false, false); | |||
return super.onSetAttribute(invoker, receiver, attribute, value); | |||
} else { | |||
throw StaticWhitelist.rejectField(field); | |||
rejector = () -> StaticWhitelist.rejectField(field); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to JENKINS-69899, but fixes a minor issue in 85d16bd. See #298 (comment) for details.
I am fixing it here in case we end up backporting the JENKINS-69899 fix, since it would be nice to backport this as well. That said, the cases it fixes were already broken before 85d16bd, so it is not particularly important.
} else { | ||
errors.addError(x); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also fixes a minor test-only issue in 85d16bd. We would also want this backported to avoid introducing broken tests.
@@ -62,7 +62,7 @@ | |||
<dependency> | |||
<groupId>org.kohsuke</groupId> | |||
<artifactId>groovy-sandbox</artifactId> | |||
<version>1.30</version> | |||
<version>1.31</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW I think it would be a good investment of time to inline the lib into this plugin repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, enough of the pieces are in place now that it should be straightforward. I think the main issue would be checking to see if a new PCT hook is needed. I will try to do it as a Hacktoberfest project.
See JENKINS-69899 and jenkinsci/groovy-sandbox#94.
Ensure you have provided tests - that demonstrates feature works or fixes the issueTests are in groovy-sandbox