Skip to content

Commit

Permalink
Add some moar debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
ksclarke committed Dec 21, 2024
1 parent 5887e08 commit 884317d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/info/freelibrary/iiif/webrepl/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ private String getImports() throws IOException {
* @return A list of Java imports
* @throws IOException If there is trouble reading the imports file
*/
@SuppressWarnings(PMD.SYSTEM_PRINTLN)
private String getImports(final String aSnippet) throws IOException {
File importsFile = Path.of("/etc/jshell/imports.jsh").toFile();

Expand All @@ -338,10 +339,13 @@ private String getImports(final String aSnippet) throws IOException {
}

try (BufferedReader reader = Files.newBufferedReader(importsFile.toPath())) {
return reader.lines().filter(line -> !line.isBlank()).filter(line -> {
final String imports = reader.lines().filter(line -> !line.isBlank()).filter(line -> {
final String className = line.substring(line.lastIndexOf('.') + 1, line.length() - 1);
return aSnippet == null || aSnippet.contains(className);
}).collect(Collectors.joining(EOL)) + EOL;

System.err.println(imports);
return imports;
}
}

Expand Down

0 comments on commit 884317d

Please sign in to comment.