diff --git a/framework/src/play/mvc/Controller.java b/framework/src/play/mvc/Controller.java index 7112a9d515..b94a8092f0 100644 --- a/framework/src/play/mvc/Controller.java +++ b/framework/src/play/mvc/Controller.java @@ -1234,7 +1234,7 @@ private static void verifyContinuationsEnhancement() { } if (haveSeenFirstApplicationClass) { - if (className.startsWith("sun.") || className.startsWith("play.")) { + if (shouldBeCheckedForEnhancement(className)) { // we're back into the play framework code... return; // done checking } else { @@ -1252,6 +1252,17 @@ private static void verifyContinuationsEnhancement() { } } + + /** + * Checks if the classname is from the jdk, sun or play package and therefore should not be checked for enhancement + * @param String className + * @return boolean + */ + static boolean shouldBeCheckedForEnhancement(String className) + { + return className.startsWith("jdk.") || className.startsWith("sun.") || className.startsWith("play."); + } + protected static void await(Future future, F.Action callback) { Request.current().isNew = false; Request.current().args.put(ActionInvoker.F, future); diff --git a/framework/test-src/play/mvc/ControllerTest.java b/framework/test-src/play/mvc/ControllerTest.java new file mode 100644 index 0000000000..8f1900511b --- /dev/null +++ b/framework/test-src/play/mvc/ControllerTest.java @@ -0,0 +1,14 @@ +package play.mvc; + +import org.junit.Test; +import static org.junit.Assert.*; +import static play.mvc.Controller.shouldBeCheckedForEnhancement; + +public class ControllerTest{ + @Test + public void jdkAndPlayClassesShouldNeverBeenCheckedForEnhancement() { + assertTrue(shouldBeCheckedForEnhancement("sun.blah")); + assertTrue(shouldBeCheckedForEnhancement("play.foo")); + assertFalse(shouldBeCheckedForEnhancement("com.bar")); + } +} \ No newline at end of file