replaced raw exception types

This commit is contained in:
Timo Westkämper 2010-04-08 08:38:07 +00:00
parent cb2e617542
commit 3aeb109a4d
4 changed files with 28 additions and 10 deletions

View File

@ -0,0 +1,18 @@
package com.mysema.codegen;
public class CodegenException extends RuntimeException{
private static final long serialVersionUID = -8704782349669898467L;
public CodegenException(String msg){
super(msg);
}
public CodegenException(String msg, Throwable t){
super(msg, t);
}
public CodegenException(Throwable t){
super(t);
}
}

View File

@ -81,7 +81,7 @@ public class EvaluatorFactory {
null,
Collections.singletonList(javaFileObject));
if (!task.call().booleanValue()) {
throw new RuntimeException("Compilation of " + source + " failed.\n" + out.toString());
throw new CodegenException("Compilation of " + source + " failed.\n" + out.toString());
}
}
@ -115,15 +115,15 @@ public class EvaluatorFactory {
}
};
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
throw new CodegenException(e);
} catch (SecurityException e) {
throw new RuntimeException(e);
throw new CodegenException(e);
} catch (NoSuchMethodException e) {
throw new RuntimeException(e);
throw new CodegenException(e);
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
throw new CodegenException(e);
} catch (IOException e) {
throw new RuntimeException(e);
throw new CodegenException(e);
}
}

View File

@ -90,11 +90,11 @@ public final class JavaWriter implements Appendable, CodeWriter{
Object value = method.invoke(annotation);
annotationConstant(value);
} catch (IllegalArgumentException e) {
throw new RuntimeException(e);
throw new CodegenException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
throw new CodegenException(e);
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
throw new CodegenException(e);
}
first = false;
}

View File

@ -45,7 +45,7 @@ public class SimpleCompiler implements JavaCompiler{
}
return path.toString();
}catch(UnsupportedEncodingException e){
throw new RuntimeException(e);
throw new CodegenException(e);
}
}