From 415e750fa0afeda32887758dc972272ff71f498a Mon Sep 17 00:00:00 2001 From: Jeremy Landis Date: Sun, 27 Mar 2022 22:59:42 -0400 Subject: [PATCH] [java] Cleanup isAllowed method as it can be much more simple --- .../plugin/license/dependencies/LicensePolicy.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/LicensePolicy.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/LicensePolicy.java index b9a732752..c0eba6bb5 100644 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/LicensePolicy.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/LicensePolicy.java @@ -51,16 +51,10 @@ public boolean getPredicate() { * Simple policy decision based on whether a matcher succeeded. * * @param matched - boolean result of some matching operation. - * @return + * @return true, if is allowed */ public boolean isAllowed(final boolean matched) { - if (matched && allowed) { - return true; - } else if (!matched && !allowed) { - return true; - } else { - return false; - } + return (matched && allowed) || (!matched && !allowed); } public static Rule valueOf(final boolean allowed) {