| 115 | } |
| 116 | |
| 117 | private static final class Failed<T> extends Produced<T> { |
| 118 | private final Throwable throwable; |
| 119 | |
| 120 | private Failed(Throwable throwable) { |
| 121 | this.throwable = checkNotNull(throwable); |
| 122 | } |
| 123 | |
| 124 | @Override |
| 125 | public T get() throws ExecutionException { |
| 126 | throw new ExecutionException(throwable); |
| 127 | } |
| 128 | |
| 129 | @Override |
| 130 | public boolean equals(Object o) { |
| 131 | if (o == this) { |
| 132 | return true; |
| 133 | } else if (o instanceof Failed) { |
| 134 | Failed<?> that = (Failed<?>) o; |
| 135 | return this.throwable.equals(that.throwable); |
| 136 | } else { |
| 137 | return false; |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | @Override |
| 142 | public int hashCode() { |
| 143 | return throwable.hashCode(); |
| 144 | } |
| 145 | |
| 146 | @Override |
| 147 | public String toString() { |
| 148 | return "Produced[failed with " + throwable.getClass().getCanonicalName() + "]"; |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | private Produced() {} |
| 153 | } |
nothing calls this directly
no outgoing calls
no test coverage detected