()
| 22 | } |
| 23 | |
| 24 | public Iterable<Addable> getInstances() { |
| 25 | List<Addable> list = new LinkedList<>(); |
| 26 | try { |
| 27 | Addable a = (Addable) this.getClass() |
| 28 | .getConstructors()[0].newInstance(); |
| 29 | list.add(a); |
| 30 | } catch (InstantiationException ex) { |
| 31 | Loggger.warn("Addable " + this.getClass() |
| 32 | .getSimpleName() + " does not have a suitable constructor (InstantiationException)"); |
| 33 | } catch (IllegalAccessException ex) { |
| 34 | Loggger.warn("Addable " + this.getClass() |
| 35 | .getSimpleName() + " does not have a suitable constructor (IllegalAccessException)"); |
| 36 | } catch (IllegalArgumentException ex) { |
| 37 | Loggger.warn("Addable " + this.getClass() |
| 38 | .getSimpleName() + " does not have a suitable constructor (IllegalArgumentException)"); |
| 39 | } catch (InvocationTargetException ex) { |
| 40 | Loggger.warn("Addable " + this.getClass() |
| 41 | .getSimpleName() + " does not have a suitable constructor (InvocationTargetException)"); |
| 42 | } |
| 43 | return list; |
| 44 | } |
| 45 | |
| 46 | public String getName() { |
| 47 | return this.getClass() |
no test coverage detected