| 207 | * class was included in this compile run. But that's hard, and this is close enough. |
| 208 | */ |
| 209 | private static void error( |
| 210 | ValidationReport.Builder<TypeElement> builder, |
| 211 | ExecutableElement method, |
| 212 | String enclosedError, |
| 213 | String inheritedError, |
| 214 | Object... extraArgs) { |
| 215 | if (method.getEnclosingElement().equals(builder.getSubject())) { |
| 216 | builder.addError(String.format(enclosedError, extraArgs), method); |
| 217 | } else { |
| 218 | builder.addError(String.format(inheritedError, append(extraArgs, method))); |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | private static Object[] append(Object[] initial, Object additional) { |
| 223 | Object[] newArray = Arrays.copyOf(initial, initial.length + 1); |