Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cherylking committed Jan 27, 2025
1 parent 0e96090 commit 01e75d0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ public FeaturesAndPlatforms(List<Feature> publicFeatures, List<Feature> privateF
this.privateFeatures = privateFeatures;

this.platforms = privateFeatures.stream()
.filter(f -> f.getWlpInformation().getVisibility() != null && f.getWlpInformation().getVisibility().equals(LibertyConstants.PRIVATE_VISIBILITY))
.map(Feature::getWlpInformation)
.filter(Objects::nonNull)
.filter(w -> Objects.nonNull(w.getVisibility()))
.filter(w -> w.getVisibility().equals(LibertyConstants.PRIVATE_VISIBILITY))
.map(WlpInformation::getPlatforms)
.filter(Objects::nonNull)
.flatMap(List::stream).collect(Collectors.toSet());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020, 2024 IBM Corporation and others.
* Copyright (c) 2020, 2025 IBM Corporation and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020, 2023 IBM Corporation and others.
* Copyright (c) 2020, 2025 IBM Corporation and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -148,7 +148,6 @@ public LibertyWorkspace getWorkspaceFolder(String serverXMLUri) {
LibertyWorkspace matchingWorkspace = null;
String normalizeUri = serverXMLUri.replace("///", "/");
for (LibertyWorkspace folder : getInstance().getLibertyWorkspaceFolders()) {
LOGGER.info("CLK999: check workspace: "+folder.getWorkspaceString()+" for match with file URI: "+normalizeUri);
//Append workspaceString with file separator to avoid bad matches
if (normalizeUri.contains(folder.getWorkspaceStringWithTrailingSlash())) {
if (matchingWorkspace != null) {
Expand All @@ -165,7 +164,7 @@ public LibertyWorkspace getWorkspaceFolder(String serverXMLUri) {
if (matchingWorkspace == null) {
LOGGER.warning("Could not find LibertyWorkspace for file: " + serverXMLUri);
} else {
LOGGER.info("CLK999: Found matching workspace: "+matchingWorkspace.getWorkspaceString()+" for file URI: "+normalizeUri);
LOGGER.finest("Found matching workspace: "+matchingWorkspace.getWorkspaceString()+" for file URI: "+normalizeUri);
}
return matchingWorkspace;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,6 @@ public String getLibertyInstallationDir() {
return this.libertyInstallationDir;
}

// public List<Feature> getInstalledPublicFeatures() {
// return this.installedFeaturesAndPlatformsList.getPublicFeatures();
// }

// public Set<String> getInstalledPlatforms() {
// return this.installedFeaturesAndPlatformsList.getPlatforms();
// }

public FeaturesAndPlatforms getInstalledFeaturesAndPlatformsList() {
return this.installedFeaturesAndPlatformsList;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void populateVariablesForWorkspace(LibertyWorkspace workspace) {
new CommonLogger(LOGGER), null, installDirectory, userDirectory, serverDirectory);
variablesForWorkspace.putAll(serverConfigDocument.getDefaultProperties());
variablesForWorkspace.putAll(serverConfigDocument.getProperties());
LOGGER.finest("Populated variables for workspace: "+workspace.getWorkspaceString()+". Number of variables found: "+variablesForWorkspace.size());
LOGGER.finest("Populated variables for workspace: " + workspace.getWorkspaceString() + ". Number of variables found: " + variablesForWorkspace.size());
} catch (Exception e) {
LOGGER.warning("Variable resolution is not available because the necessary directory locations were not found in the liberty-plugin-config.xml file.");
LOGGER.info("Exception received: " + e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ public void testInvalidPlatformDiagnostic() throws BadLocationException {
" <platform>javaee-7.0</platform>", //
" <platform>javaee-8.0</platform>", //
" <platform>jakartaee-9.1</platform>", //
" <platform>jakartaee-11.0</platform>", //
" </featureManager>", //
"</server>" //
);
Expand All @@ -485,9 +486,14 @@ public void testInvalidPlatformDiagnostic() throws BadLocationException {
invalid4.setRange(r(8, 25, 8, 38));
invalid4.setMessage("ERROR: The following configured platform versions are in conflict [javaee-7.0, javaee-8.0, jakartaee-9.1]");

Diagnostic invalid5 = new Diagnostic();
invalid5.setRange(r(9, 25, 9, 39));
invalid5.setCode(LibertyDiagnosticParticipant.INCORRECT_PLATFORM_CODE);
invalid5.setMessage("ERROR: The platform \"jakartaee-11.0\" does not exist."); // beta platform should not be valid


XMLAssert.testDiagnosticsFor(serverXML, null, null, serverXMLURI,
invalid1, invalid2, invalid3, invalid4);
invalid1, invalid2, invalid3, invalid4, invalid5);
}

@Test
Expand Down

0 comments on commit 01e75d0

Please sign in to comment.