diff --git a/.gitignore b/.gitignore index 0d3f451b..07eede17 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ target/ # ---- Mac OS X .DS_Store? +.DS_Store Icon? # Thumbnails ._* diff --git a/plugin-api/src/main/java/org/sonar/api/batch/fs/FilePredicates.java b/plugin-api/src/main/java/org/sonar/api/batch/fs/FilePredicates.java index 98e3828b..e8af5bad 100644 --- a/plugin-api/src/main/java/org/sonar/api/batch/fs/FilePredicates.java +++ b/plugin-api/src/main/java/org/sonar/api/batch/fs/FilePredicates.java @@ -168,7 +168,11 @@ public interface FilePredicates { /** * Explicitely look for InputFile having any {@link InputFile#status()} * @since 6.6 + * @deprecated since 11.4, use {@link #hasStatus(InputFile.Status)} instead */ - FilePredicate hasAnyStatus(); + @Deprecated(forRemoval = true, since = "11.4") + default FilePredicate hasAnyStatus(){ + return input -> true; + } } diff --git a/plugin-api/src/test/java/org/sonar/api/batch/fs/FilePredicatesTest.java b/plugin-api/src/test/java/org/sonar/api/batch/fs/FilePredicatesTest.java new file mode 100644 index 00000000..cb213161 --- /dev/null +++ b/plugin-api/src/test/java/org/sonar/api/batch/fs/FilePredicatesTest.java @@ -0,0 +1,36 @@ +/* + * Sonar Plugin API + * Copyright (C) 2009-2025 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.api.batch.fs; + +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +import static org.junit.jupiter.api.Assertions.*; + +class FilePredicatesTest { + + FilePredicates filePredicates = Mockito.spy(FilePredicates.class); + + @Test + void hasAnyStatus_always_match() { + FilePredicate filePredicate = filePredicates.hasAnyStatus(); + assertTrue(filePredicate.apply(null)); + } +} \ No newline at end of file