Skip to content
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-25118] Allow signatures with primitives #6

Merged

Conversation

ikedam
Copy link
Member

@ikedam ikedam commented Oct 13, 2014

JENKINS-25118

As Class#isinstance(Object) always returns false for primitives, the sandbox fails to identify methods with primitive arguments.
http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html#isInstance%28java.lang.Object%29

This change allows the sandbox work for methods with primitive arguments.

@ikedam
Copy link
Member Author

ikedam commented Oct 13, 2014

test #71 demonstrates reproduction of this problem (committed a test with no fix).

java.lang.AssertionError: org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: unclassified method java.lang.String charAt java.lang.Integer
    at org.junit.Assert.fail(Assert.java:88)
    at org.junit.Assert.assertTrue(Assert.java:41)
    at org.junit.Assert.assertNotNull(Assert.java:621)
    at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptorTest.primitiveTypes(SandboxInterceptorTest.java:339)

@jenkinsadmin
Copy link
Member

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@jglick jglick merged commit ba5b9ac into jenkinsci:master Oct 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants