CodeOwnerBackend: Remove unused default method implementation
The default implementation of getPathExpressionMatcher() is not used and
cannot be tested easily. Removing it increases the test coverage for
CodeOwnerBackend from 66.7% to 100%.
Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: Ia4958f33b006b5e8ccd771347f4fbbc704021805
diff --git a/java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerBackend.java b/java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerBackend.java
index be5318d..3775f89 100644
--- a/java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerBackend.java
+++ b/java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerBackend.java
@@ -112,9 +112,7 @@
* backend. It this case all {@link CodeOwnerSet}s that have path expressions are ignored and will
* not have any effect.
*/
- default Optional<PathExpressionMatcher> getPathExpressionMatcher() {
- return Optional.empty();
- }
+ Optional<PathExpressionMatcher> getPathExpressionMatcher();
/**
* Replaces the old email in the given code owner config file content with the new email.
diff --git a/javatests/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginConfigurationTest.java b/javatests/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginConfigurationTest.java
index 25420b5..9883fba 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginConfigurationTest.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginConfigurationTest.java
@@ -39,6 +39,7 @@
import com.google.gerrit.plugins.codeowners.backend.CodeOwnerConfig;
import com.google.gerrit.plugins.codeowners.backend.CodeOwnerConfigUpdate;
import com.google.gerrit.plugins.codeowners.backend.FallbackCodeOwners;
+import com.google.gerrit.plugins.codeowners.backend.PathExpressionMatcher;
import com.google.gerrit.plugins.codeowners.backend.config.BackendConfig;
import com.google.gerrit.plugins.codeowners.backend.config.CodeOwnersPluginConfiguration;
import com.google.gerrit.plugins.codeowners.backend.config.GeneralConfig;
@@ -1083,5 +1084,10 @@
public Path getFilePath(CodeOwnerConfig.Key codeOwnerConfigKey) {
throw new UnsupportedOperationException("not implemented");
}
+
+ @Override
+ public Optional<PathExpressionMatcher> getPathExpressionMatcher() {
+ return Optional.empty();
+ }
}
}