Skip to content

Commit

Permalink
Ignore module-info.java files for now (#4380)
Browse files Browse the repository at this point in the history
Pending proper support in #4054 (comment)
  • Loading branch information
timtebeek authored Aug 4, 2024
1 parent c3bddfe commit 62a94be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.stream.Stream;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.openrewrite.java.Assertions.java;

/**
Expand Down Expand Up @@ -157,4 +158,11 @@ void shouldResolvePathUsingPublicClasses(@Language("java") String source) {
)
);
}

@Test
@Issue("https://github.com/openrewrite/rewrite/issues/1895")
void moduleInfo(){
// Ignored until properly handled: https://github.com/openrewrite/rewrite/issues/4054#issuecomment-2267605739
assertFalse(JavaParser.fromJavaVersion().build().accept(Path.of("src/main/java/foo/module-info.java")));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ default Stream<SourceFile> parse(@Language("java") String... sources) {

@Override
default boolean accept(Path path) {
return path.toString().endsWith(".java");
return path.toString().endsWith(".java") && !path.endsWith("module-info.java");
}

/**
Expand Down

0 comments on commit 62a94be

Please sign in to comment.