forked from playframework/play1
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[playframework#3] Result now extends FastRuntimeException. All exisin…
…g tests pass - cannot see any speed improvemet when runing the tests. Note sure if this is a needed patch
- Loading branch information
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |