Permalink
Browse files

get rid of checked exceptions

1 parent 0245f15 commit 8fda34e4c77cac079b711da59d5fe49b74605553 @richhickey richhickey committed Mar 21, 2011
Showing with 2,066 additions and 1,926 deletions.
  1. +26 −26 src/jvm/clojure/lang/AFn.java
  2. +2 −2 src/jvm/clojure/lang/AFunction.java
  3. +2 −2 src/jvm/clojure/lang/AMapEntry.java
  4. +2 −2 src/jvm/clojure/lang/APersistentMap.java
  5. +1 −1 src/jvm/clojure/lang/APersistentSet.java
  6. +3 −3 src/jvm/clojure/lang/APersistentVector.java
  7. +3 −3 src/jvm/clojure/lang/ARef.java
  8. +1 −1 src/jvm/clojure/lang/AReference.java
  9. +258 −258 src/jvm/clojure/lang/ASeq.java
  10. +2 −2 src/jvm/clojure/lang/ATransientMap.java
  11. +3 −3 src/jvm/clojure/lang/ATransientSet.java
  12. +6 −6 src/jvm/clojure/lang/Agent.java
  13. +1 −1 src/jvm/clojure/lang/ArrayChunk.java
  14. +16 −16 src/jvm/clojure/lang/ArraySeq.java
  15. +4 −4 src/jvm/clojure/lang/Atom.java
  16. +1 −1 src/jvm/clojure/lang/Compile.java
  17. +281 −244 src/jvm/clojure/lang/Compiler.java
  18. +2 −2 src/jvm/clojure/lang/Delay.java
  19. +13 −6 src/jvm/clojure/lang/FnLoaderThunk.java
  20. +1 −1 src/jvm/clojure/lang/IBlockingDeref.java
  21. +1 −1 src/jvm/clojure/lang/IChunk.java
  22. +3 −3 src/jvm/clojure/lang/IChunkedSeq.java
  23. +1 −1 src/jvm/clojure/lang/IDeref.java
  24. +23 −23 src/jvm/clojure/lang/IFn.java
  25. +23 −23 src/jvm/clojure/lang/IPersistentMap.java
  26. +1 −1 src/jvm/clojure/lang/IPersistentSet.java
  27. +2 −2 src/jvm/clojure/lang/IReduce.java
  28. +1 −1 src/jvm/clojure/lang/IReference.java
  29. +1 −1 src/jvm/clojure/lang/ITransientSet.java
  30. +25 −25 src/jvm/clojure/lang/Keyword.java
  31. +1 −1 src/jvm/clojure/lang/LazySeq.java
  32. +102 −84 src/jvm/clojure/lang/LispReader.java
  33. +7 −7 src/jvm/clojure/lang/LockingTransaction.java
  34. +33 −33 src/jvm/clojure/lang/MultiFn.java
  35. +2 −2 src/jvm/clojure/lang/Namespace.java
  36. +8 −8 src/jvm/clojure/lang/Numbers.java
  37. +2 −2 src/jvm/clojure/lang/PersistentArrayMap.java
  38. +2 −2 src/jvm/clojure/lang/PersistentHashMap.java
  39. +1 −1 src/jvm/clojure/lang/PersistentHashSet.java
  40. +3 −3 src/jvm/clojure/lang/PersistentList.java
  41. +6 −6 src/jvm/clojure/lang/PersistentStructMap.java
  42. +3 −3 src/jvm/clojure/lang/PersistentTreeMap.java
  43. +2 −2 src/jvm/clojure/lang/PersistentTreeSet.java
  44. +2 −2 src/jvm/clojure/lang/PersistentVector.java
  45. +51 −36 src/jvm/clojure/lang/RT.java
  46. +2 −2 src/jvm/clojure/lang/Range.java
  47. +29 −29 src/jvm/clojure/lang/Ref.java
  48. +76 −34 src/jvm/clojure/lang/Reflector.java
  49. +1 −1 src/jvm/clojure/lang/Repl.java
  50. +953 −953 src/jvm/clojure/lang/RestFn.java
  51. +1 −1 src/jvm/clojure/lang/Reversible.java
  52. +1 −1 src/jvm/clojure/lang/Script.java
  53. +2 −2 src/jvm/clojure/lang/Settable.java
  54. +2 −2 src/jvm/clojure/lang/Symbol.java
  55. +5 −5 src/jvm/clojure/lang/TransactionalHashMap.java
  56. +14 −0 src/jvm/clojure/lang/Util.java
  57. +43 −36 src/jvm/clojure/lang/Var.java
  58. +3 −3 src/jvm/clojure/main.java
@@ -14,7 +14,7 @@
public abstract class AFn implements IFn {
-public Object call() throws Exception{
+public Object call() {
return invoke();
}
@@ -25,116 +25,116 @@ public void run(){
}
catch(Exception e)
{
- throw new RuntimeException(e);
+ throw Util.runtimeException(e);
}
}
-public Object invoke() throws Exception{
+public Object invoke() {
return throwArity(0);
}
-public Object invoke(Object arg1) throws Exception{
+public Object invoke(Object arg1) {
return throwArity(1);
}
-public Object invoke(Object arg1, Object arg2) throws Exception{
+public Object invoke(Object arg1, Object arg2) {
return throwArity(2);
}
-public Object invoke(Object arg1, Object arg2, Object arg3) throws Exception{
+public Object invoke(Object arg1, Object arg2, Object arg3) {
return throwArity(3);
}
-public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4) throws Exception{
+public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4) {
return throwArity(4);
}
-public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) throws Exception{
+public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) {
return throwArity(5);
}
-public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) throws Exception{
+public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) {
return throwArity(6);
}
public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7)
- throws Exception{
+ {
return throwArity(7);
}
public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7,
- Object arg8) throws Exception{
+ Object arg8) {
return throwArity(8);
}
public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7,
- Object arg8, Object arg9) throws Exception{
+ Object arg8, Object arg9) {
return throwArity(9);
}
public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7,
- Object arg8, Object arg9, Object arg10) throws Exception{
+ Object arg8, Object arg9, Object arg10) {
return throwArity(10);
}
public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7,
- Object arg8, Object arg9, Object arg10, Object arg11) throws Exception{
+ Object arg8, Object arg9, Object arg10, Object arg11) {
return throwArity(11);
}
public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7,
- Object arg8, Object arg9, Object arg10, Object arg11, Object arg12) throws Exception{
+ Object arg8, Object arg9, Object arg10, Object arg11, Object arg12) {
return throwArity(12);
}
public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7,
Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13)
- throws Exception{
+ {
return throwArity(13);
}
public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7,
Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14)
- throws Exception{
+ {
return throwArity(14);
}
public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7,
Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14,
- Object arg15) throws Exception{
+ Object arg15) {
return throwArity(15);
}
public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7,
Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14,
- Object arg15, Object arg16) throws Exception{
+ Object arg15, Object arg16) {
return throwArity(16);
}
public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7,
Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14,
- Object arg15, Object arg16, Object arg17) throws Exception{
+ Object arg15, Object arg16, Object arg17) {
return throwArity(17);
}
public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7,
Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14,
- Object arg15, Object arg16, Object arg17, Object arg18) throws Exception{
+ Object arg15, Object arg16, Object arg17, Object arg18) {
return throwArity(18);
}
public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7,
Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14,
- Object arg15, Object arg16, Object arg17, Object arg18, Object arg19) throws Exception{
+ Object arg15, Object arg16, Object arg17, Object arg18, Object arg19) {
return throwArity(19);
}
public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7,
Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14,
Object arg15, Object arg16, Object arg17, Object arg18, Object arg19, Object arg20)
- throws Exception{
+ {
return throwArity(20);
}
@@ -143,15 +143,15 @@ public Object invoke(Object arg1, Object arg2, Object arg3, Object arg4, Object
Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14,
Object arg15, Object arg16, Object arg17, Object arg18, Object arg19, Object arg20,
Object... args)
- throws Exception{
+ {
return throwArity(21);
}
-public Object applyTo(ISeq arglist) throws Exception{
+public Object applyTo(ISeq arglist) {
return applyToHelper(this, Util.ret1(arglist,arglist = null));
}
-static public Object applyToHelper(IFn ifn, ISeq arglist) throws Exception{
+static public Object applyToHelper(IFn ifn, ISeq arglist) {
switch(RT.boundedLength(arglist, 20))
{
case 0:
@@ -25,7 +25,7 @@ public IPersistentMap meta(){
public IObj withMeta(final IPersistentMap meta){
return new RestFn(){
- protected Object doInvoke(Object args) throws Exception{
+ protected Object doInvoke(Object args) {
return AFunction.this.applyTo((ISeq) args);
}
@@ -60,7 +60,7 @@ public int compare(Object o1, Object o2){
}
catch(Exception e)
{
- throw new RuntimeException(e);
+ throw Util.runtimeException(e);
}
}
}
@@ -78,7 +78,7 @@ public String toString(){
catch(Exception e)
{
//checked exceptions stink!
- throw new RuntimeException(e);
+ throw Util.runtimeException(e);
}
return sw.toString();
}
@@ -141,7 +141,7 @@ public Object peek(){
}
-public ISeq rseq() throws Exception{
+public ISeq rseq() {
return asVector().rseq();
}
*/
@@ -173,11 +173,11 @@ public ValSeq withMeta(IPersistentMap meta){
}
-public Object invoke(Object arg1) throws Exception{
+public Object invoke(Object arg1) {
return valAt(arg1);
}
-public Object invoke(Object arg1, Object notFound) throws Exception{
+public Object invoke(Object arg1, Object notFound) {
return valAt(arg1, notFound);
}
@@ -45,7 +45,7 @@ public ISeq seq(){
return RT.keys(impl);
}
-public Object invoke(Object arg1) throws Exception{
+public Object invoke(Object arg1) {
return get(arg1);
}
@@ -244,7 +244,7 @@ public boolean addAll(int i, Collection c){
}
-public Object invoke(Object arg1) throws Exception{
+public Object invoke(Object arg1) {
if(Util.isInteger(arg1))
return nth(((Number) arg1).intValue());
throw new IllegalArgumentException("Key must be integer");
@@ -445,14 +445,14 @@ public int count(){
return new APersistentVector.Seq(meta, v, i);
}
- public Object reduce(IFn f) throws Exception{
+ public Object reduce(IFn f) {
Object ret = v.nth(i);
for(int x = i + 1; x < v.count(); x++)
ret = f.invoke(ret, v.nth(x));
return ret;
}
- public Object reduce(IFn f, Object start) throws Exception{
+ public Object reduce(IFn f, Object start) {
Object ret = f.invoke(start, v.nth(i));
for(int x = i + 1; x < v.count(); x++)
ret = f.invoke(ret, v.nth(x));
@@ -53,7 +53,7 @@ public void setValidator(IFn vf){
}
catch(Exception e)
{
- throw new RuntimeException(e);
+ throw Util.runtimeException(e);
}
validator = vf;
}
@@ -78,7 +78,7 @@ synchronized public IRef removeWatch(Object key){
}
catch(Exception e)
{
- throw new RuntimeException(e);
+ throw Util.runtimeException(e);
}
return this;
@@ -99,7 +99,7 @@ public void notifyWatches(Object oldval, Object newval){
}
catch(Exception e1)
{
- throw new RuntimeException(e1);
+ throw Util.runtimeException(e1);
}
}
}
@@ -27,7 +27,7 @@ synchronized public IPersistentMap meta() {
return _meta;
}
- synchronized public IPersistentMap alterMeta(IFn alter, ISeq args) throws Exception {
+ synchronized public IPersistentMap alterMeta(IFn alter, ISeq args) {
_meta = (IPersistentMap) alter.applyTo(new Cons(_meta, args));
return _meta;
}
Oops, something went wrong.

0 comments on commit 8fda34e

Please sign in to comment.