Skip to content

Commit

Permalink
[playframework#3] Result now extends FastRuntimeException. All exisin…
Browse files Browse the repository at this point in the history
…g tests pass - cannot see any speed improvemet when runing the tests. Note sure if this is a needed patch
  • Loading branch information
mbknor committed Mar 22, 2011
1 parent 4418dee commit 6641f6c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
3 changes: 2 additions & 1 deletion framework/src/play/mvc/results/Result.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package play.mvc.results;

import play.mvc.Http;
import play.utils.FastRuntimeException;

/**
* Result support
*/
public abstract class Result extends RuntimeException {
public abstract class Result extends FastRuntimeException {

public Result() {
super();
Expand Down
33 changes: 33 additions & 0 deletions framework/src/play/utils/FastRuntimeException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package play.utils;

/**
* Fast Exception - skips creating stackTrace.
*
* More info here: http://www.javaspecialists.eu/archive/Issue129.html
*/
public class FastRuntimeException extends RuntimeException {

public FastRuntimeException(){
super();
}

public FastRuntimeException( String desc){
super(desc);
}

public FastRuntimeException(String desc, Throwable cause){
super(desc, cause);
}

public FastRuntimeException(Throwable cause){
super(cause);
}

/**
* Since we override this method, no stacktrace is generated - much faster
* @return always null
*/
public Throwable fillInStackTrace() {
return null;
}
}

0 comments on commit 6641f6c

Please sign in to comment.