Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-145

Incorrect test case in SandboxTest

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 3.0
    • Labels:
      None
    • Environment:

      JDK 1.7.0_45

      Description

      Whilst debugging blacklisting of static functions using the Sandbox class and unable to get it to work I checked the testcase SandboxTest. I subsequently found that the test of System.exit() in testRestrict() passes not because System.currentTimeMillis() is whitelisted but because of a signature mismatch i.e System.exit() requires an int parameter. Changing the expression to System.exit(1) causes the test to end prematruely due to exit() being called.

      The white listing fails in SandboxUberspectImpl.getMethod() because obj is a Class and getClass().getName() returns "java.lang.Class" which doesn't match "java.lang.System" as specified in SandboxTest.testRestrict().

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ianc Ian Cunningham
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: