Make Java problem matcher opt-in (#1326)

Default the problem-matcher input to false so setup-java no longer
registers Java compiler and uncaught-exception annotations unless
explicitly enabled with problem-matcher: true.

Fixes #1322

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Bruno Borges
2026-11-13 23:47:17 -05:00
committed by GitHub
parent 5fb63c9bc9
commit d1374f8ac7
6 changed files with 21 additions and 12 deletions
+10 -1
View File
@@ -27,7 +27,16 @@ describe('configureProblemMatcher', () => {
jest.resetAllMocks();
});
it('registers the Java problem matcher by default', () => {
it('does not register the Java problem matcher by default', () => {
configureProblemMatcher('/matchers/java.json');
expect(mockInfo).not.toHaveBeenCalled();
expect(mockDebug).toHaveBeenCalledWith('Java problem matcher is disabled');
});
it('registers the Java problem matcher when explicitly enabled', () => {
inputs[INPUT_PROBLEM_MATCHER] = 'true';
configureProblemMatcher('/matchers/java.json');
expect(mockInfo).toHaveBeenCalledWith('##[add-matcher]/matchers/java.json');