Checks the year in LICENSE.txt.
()
| 360 | * Checks the year in {@code LICENSE.txt}. |
| 361 | */ |
| 362 | private void licenseYear() throws IOException { |
| 363 | final List<String> lines = FileUtils.readLines(new File("checkstyle.xml"), SOURCE_ENCODING); |
| 364 | boolean check = false; |
| 365 | final String copyright = "Copyright (c) 2002-" + LocalDate.now().getYear(); |
| 366 | for (final String line : lines) { |
| 367 | if (line.contains("<property name=\"header\"")) { |
| 368 | if (!line.contains(copyright)) { |
| 369 | addFailure("checkstyle.xml", 0, "Incorrect year in checkstyle.xml"); |
| 370 | } |
| 371 | check = true; |
| 372 | } |
| 373 | } |
| 374 | if (!check) { |
| 375 | addFailure("checkstyle.xml", 0, "No \"header\" found"); |
| 376 | } |
| 377 | } |
| 378 | |
| 379 | /** |
| 380 | * Checks the year in the {@link Version}. |
no test coverage detected