Skip to content

Commit

Permalink
Suppress 'var' warning because aspectj doesn't support it
Browse files Browse the repository at this point in the history
  • Loading branch information
julianladisch committed Feb 26, 2024
1 parent fe39a3d commit 38a7cc2
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,11 @@ private void migrateToJakarta() {
}

private static class JakartaMigrator extends SimpleFileVisitor<Path> {
@SuppressWarnings("java:S6212") // suppress 'Declare this local variable with "var" instead.'
// because aspectj AJC doesn't support "var"
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
var java = new String(Files.readAllBytes(file), StandardCharsets.UTF_8);
String java = new String(Files.readAllBytes(file), StandardCharsets.UTF_8);
java = java.replace("import javax.validation.", "import jakarta.validation.");
Files.write(file, java.getBytes(StandardCharsets.UTF_8));
return FileVisitResult.CONTINUE;
Expand Down

0 comments on commit 38a7cc2

Please sign in to comment.