Repository: commons-testing Updated Branches: refs/heads/master 1696bcfef -> 4da6b2902
Use default Eclipse sort order for members and adjust package declaration. Project: http://git-wip-us.apache.org/repos/asf/commons-testing/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-testing/commit/4da6b290 Tree: http://git-wip-us.apache.org/repos/asf/commons-testing/tree/4da6b290 Diff: http://git-wip-us.apache.org/repos/asf/commons-testing/diff/4da6b290 Branch: refs/heads/master Commit: 4da6b2902984395dc2a1405c0dcce40d30ba77f7 Parents: 1696bcf Author: Gary Gregory <[email protected]> Authored: Thu Mar 1 16:49:46 2018 -0700 Committer: Gary Gregory <[email protected]> Committed: Thu Mar 1 16:49:46 2018 -0700 ---------------------------------------------------------------------- .../testing/junit4/SecurityManagerTestRule.java | 29 ++++++++++---------- 1 file changed, 15 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-testing/blob/4da6b290/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/SecurityManagerTestRule.java ---------------------------------------------------------------------- diff --git a/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/SecurityManagerTestRule.java b/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/SecurityManagerTestRule.java index 9a600ef..effadd1 100644 --- a/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/SecurityManagerTestRule.java +++ b/commons-testing-junit4/src/main/java/org/apache/commons/testing/junit4/SecurityManagerTestRule.java @@ -15,7 +15,7 @@ * limitations under the license. */ -package org.apache.logging.log4j.junit; +package org.apache.commons.testing.junit4; import org.junit.rules.TestRule; import org.junit.runner.Description; @@ -41,6 +41,10 @@ import org.junit.runners.model.Statement; */ public class SecurityManagerTestRule implements TestRule { + private final SecurityManager securityManager; + + private SecurityManager securityManagerBefore; + /** * Constructs a new instance with the given {@link SecurityManager}. * <p> @@ -61,22 +65,9 @@ public class SecurityManagerTestRule implements TestRule { this.securityManager = securityManager; } - private SecurityManager securityManagerBefore; - private final SecurityManager securityManager; - @Override public Statement apply(final Statement base, final Description description) { return new Statement() { - @Override - public void evaluate() throws Throwable { - before(); - try { - base.evaluate(); - } finally { - after(); - } - } - private void after() { System.setSecurityManager(securityManagerBefore); } @@ -86,6 +77,16 @@ public class SecurityManagerTestRule implements TestRule { System.setSecurityManager(securityManager); } + + @Override + public void evaluate() throws Throwable { + before(); + try { + base.evaluate(); + } finally { + after(); + } + } }; }
