Skip to content

Commit

Permalink
fix: optimize isQuarkusModule computation
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Bricon <[email protected]>
  • Loading branch information
fbricon authored and angelozerr committed Aug 3, 2023
1 parent cfa3f27 commit 768ccf0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,15 @@ public class QuarkusConstants {
public static final String QUARKUS_ARC_CONFIG_PROPERTIES_DEFAULT_NAMING_STRATEGY = "quarkus.arc.config-properties-default-naming-strategy";


public static final String QUARKUS_CORE_PREFIX = "io.quarkus:quarkus-core:";
public static final String QUARKUS_PREFIX = "quarkus";
public static final String QUARKUS_JAVADOC_PROPERTIES_FILE = "quarkus-javadoc.properties";
public static final String QUARKUS_EXTENSION_PROPERTIES = "META-INF/quarkus-extension.properties";
public static final String QUARKUS_DEPLOYMENT_PROPERTY_NAME = "deployment-artifact";

public static final String QUARKUS_DEPLOYMENT_LIBRARY_NAME = "Quarkus (deployment)";

public static final Integer QUARKUS_DEPLOYMENT_LIBRARY_VERSION = 1;

public static final String LSP_PLUGIN_ID = "com.github.gtache.lsp";
public static final String DISPLAY_CHECK_NOTIFACTION_PROPERTY_NAME = QuarkusConstants.class.getPackage().getName() + ".displayCheckNotification";
public static final String NOTIFICATION_GROUP = "Quarkus Tools";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,18 @@ public static boolean isQuarkusModule(Module module) {
return libraries.process(new RootPolicy<Boolean>() {
@Override
public Boolean visitLibraryOrderEntry(@NotNull LibraryOrderEntry libraryOrderEntry, Boolean value) {
return value | isQuarkusLibrary(libraryOrderEntry);
return value || isQuarkusLibrary(libraryOrderEntry);
}
}, false);
}

public static boolean isQuarkusLibrary(@NotNull LibraryOrderEntry libraryOrderEntry) {
return libraryOrderEntry != null &&
libraryOrderEntry.getLibraryName() != null &&
libraryOrderEntry.getLibraryName().contains("io.quarkus:quarkus-core:");
return libraryOrderEntry.getLibraryName() != null &&
libraryOrderEntry.getLibraryName().contains(QuarkusConstants.QUARKUS_CORE_PREFIX);
}

public static boolean isQuarkusDeploymentLibrary(@NotNull LibraryOrderEntry libraryOrderEntry) {
return libraryOrderEntry != null &&
libraryOrderEntry.getLibraryName() != null &&
return libraryOrderEntry.getLibraryName() != null &&
libraryOrderEntry.getLibraryName().equalsIgnoreCase(QuarkusConstants.QUARKUS_DEPLOYMENT_LIBRARY_NAME);
}

Expand Down

0 comments on commit 768ccf0

Please sign in to comment.