equal
deleted
inserted
replaced
103 return (Formatter) instance; |
103 return (Formatter) instance; |
104 } else { |
104 } else { |
105 throw new FormatterException("Formatter " + instance + " does not implement the " + Formatter.class.getName() + " interface"); |
105 throw new FormatterException("Formatter " + instance + " does not implement the " + Formatter.class.getName() + " interface"); |
106 } |
106 } |
107 } catch (ClassNotFoundException e) { |
107 } catch (ClassNotFoundException e) { |
108 throw new FormatterException("No formatter class with name: " + className, e); |
108 throw new FormatterException("Formatter class does not exist: " + className, e); |
109 } catch (NoSuchMethodException e) { |
109 } catch (NoSuchMethodException e) { |
110 throw new FormatterException("Formatter class with no valid constructor: " + className, e); |
110 throw new FormatterException("Formatter class with no valid constructor: " + className, e); |
111 } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { |
111 } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { |
112 throw new FormatterException("Formatter's constructor caused an error: " + className, e); |
112 throw new FormatterException("Formatter's constructor caused an error: " + className, e); |
113 } |
113 } |