Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removed more remnants of checked exceptions

  • Loading branch information...
commit 6a90ef712fce30a0b18071e8e0dfe7f0ace51592 1 parent f5bcf64
@netguy204 authored
View
9 src/jvm/clojure/lang/AFn.java
@@ -19,14 +19,7 @@ public Object call() {
}
public void run(){
- try
- {
- invoke();
- }
- catch(Exception e)
- {
- throw Util.runtimeException(e);
- }
+ invoke();
}
View
29 src/jvm/clojure/lang/AFunction.java
@@ -44,23 +44,16 @@ public int getRequiredArity(){
}
public int compare(Object o1, Object o2){
- try
- {
- Object o = invoke(o1, o2);
-
- if(o instanceof Boolean)
- {
- if(RT.booleanCast(o))
- return -1;
- return RT.booleanCast(invoke(o2,o1))? 1 : 0;
- }
-
- Number n = (Number) o;
- return n.intValue();
- }
- catch(Exception e)
- {
- throw Util.runtimeException(e);
- }
+ Object o = invoke(o1, o2);
+
+ if(o instanceof Boolean)
+ {
+ if(RT.booleanCast(o))
+ return -1;
+ return RT.booleanCast(invoke(o2,o1))? 1 : 0;
+ }
+
+ Number n = (Number) o;
+ return n.intValue();
}
}
View
33 src/jvm/clojure/lang/ARef.java
@@ -32,10 +32,6 @@ void validate(IFn vf, Object val){
if(vf != null && !RT.booleanCast(vf.invoke(val)))
throw new IllegalStateException("Invalid reference state");
}
- catch(RuntimeException re)
- {
- throw re;
- }
catch(Exception e)
{
throw new IllegalStateException("Invalid reference state", e);
@@ -47,14 +43,7 @@ void validate(Object val){
}
public void setValidator(IFn vf){
- try
- {
- validate(vf, deref());
- }
- catch(Exception e)
- {
- throw Util.runtimeException(e);
- }
+ validate(vf, deref());
validator = vf;
}
@@ -72,14 +61,7 @@ synchronized public IRef addWatch(Object key, IFn callback){
}
synchronized public IRef removeWatch(Object key){
- try
- {
- watches = watches.without(key);
- }
- catch(Exception e)
- {
- throw Util.runtimeException(e);
- }
+ watches = watches.without(key);
return this;
}
@@ -92,15 +74,8 @@ public void notifyWatches(Object oldval, Object newval){
{
Map.Entry e = (Map.Entry) s.first();
IFn fn = (IFn) e.getValue();
- try
- {
- if(fn != null)
- fn.invoke(e.getKey(), this, oldval, newval);
- }
- catch(Exception e1)
- {
- throw Util.runtimeException(e1);
- }
+ if(fn != null)
+ fn.invoke(e.getKey(), this, oldval, newval);
}
}
}
View
11 src/jvm/clojure/lang/LazySeq.java
@@ -37,19 +37,8 @@ public Obj withMeta(IPersistentMap meta){
final synchronized Object sval(){
if(fn != null)
{
- try
- {
sv = fn.invoke();
fn = null;
- }
- catch(RuntimeException e)
- {
- throw e;
- }
- catch(Exception e)
- {
- throw Util.runtimeException(e);
- }
}
if(sv != null)
return sv;
View
7 src/jvm/clojure/lang/RT.java
@@ -1688,12 +1688,7 @@ static public String printString(Object x){
static public Object readString(String s){
PushbackReader r = new PushbackReader(new StringReader(s));
- try {
- return LispReader.read(r, true, null, false);
- }
- catch(Exception e) {
- throw Util.runtimeException(e);
- }
+ return LispReader.read(r, true, null, false);
}
static public void print(Object x, Writer w) throws IOException{
View
9 src/jvm/clojure/lang/Ref.java
@@ -241,14 +241,7 @@ public Object call() {
}
public void run(){
- try
- {
- invoke();
- }
- catch(Exception e)
- {
- throw Util.runtimeException(e);
- }
+ invoke();
}
public Object invoke() {
View
19 src/jvm/clojure/lang/TransactionalHashMap.java
@@ -86,15 +86,7 @@ public V remove(Object k){
Ref r = bins[binFor(k)];
IPersistentMap map = (IPersistentMap) r.deref();
Object ret = map.valAt(k);
- //checked exceptions are a bad idea, especially in an interface
- try
- {
- r.set(map.without(k));
- }
- catch(Exception e)
- {
- throw Util.runtimeException(e);
- }
+ r.set(map.without(k));
return (V) ret;
}
@@ -157,14 +149,7 @@ public boolean remove(Object k, Object v){
if(e != null && e.getValue().equals(v))
{
//checked exceptions are a bad idea, especially in an interface
- try
- {
- r.set(map.without(k));
- }
- catch(Exception ex)
- {
- throw Util.runtimeException(ex);
- }
+ r.set(map.without(k));
return true;
}
return false;
View
18 src/jvm/clojure/lang/Var.java
@@ -397,14 +397,7 @@ public Object call() {
}
public void run(){
- try
- {
- invoke();
- }
- catch(Exception e)
- {
- throw Util.runtimeException(e);
- }
+ invoke();
}
public Object invoke() {
@@ -541,14 +534,7 @@ public Object invoke(Object m, Object k, Object v) {
static IFn dissoc = new AFn() {
@Override
public Object invoke(Object c, Object k) {
- try
- {
- return RT.dissoc(c, k);
- }
- catch(Exception e)
- {
- return Util.runtimeException(e);
- }
+ return RT.dissoc(c, k);
}
};
}
Please sign in to comment.
Something went wrong with that request. Please try again.