Skip to content

Commit

Permalink
minor: fix IDEA violations
Browse files Browse the repository at this point in the history
  • Loading branch information
romani committed Jun 26, 2021
1 parent f6068e0 commit d9ebde5
Showing 1 changed file with 5 additions and 7 deletions.
Expand Up @@ -76,13 +76,10 @@ private static List<String> readFile(Path filePath) throws CheckstyleException {
private static void setCheckName(InputConfiguration.Builder inputConfigBuilder,
String filePath, List<String> lines)
throws CheckstyleException {
final String checkName;
try {
checkName = lines.get(1);
}
catch (IndexOutOfBoundsException ex) {
throw new CheckstyleException("Config not specified in " + filePath, ex);
if (lines.size() < 2) {
throw new CheckstyleException("Config not specified in " + filePath);
}
final String checkName = lines.get(1);
final String checkPath = getPackageFromFilePath(filePath) + "." + checkName + "Check";
inputConfigBuilder.setCheckName(checkPath);
}
Expand All @@ -92,7 +89,8 @@ private static void setCheckProperties(InputConfiguration.Builder inputConfigBui
throws Exception {
final StringBuilder stringBuilder = new StringBuilder(128);
int lineNo = 2;
for (String line = lines.get(lineNo); !line.contains("*/"); line = lines.get(++lineNo)) {
for (String line = lines.get(lineNo); !line.contains("*/");
++lineNo, line = lines.get(lineNo)) {
stringBuilder.append(line).append('\n');
}
final Properties properties = new Properties();
Expand Down

0 comments on commit d9ebde5

Please sign in to comment.