From 54fa1fd8f0050641d40ddeb1bfbed2d2ed955ec0 Mon Sep 17 00:00:00 2001 From: Cheryl King Date: Fri, 12 Jan 2024 10:25:09 -0600 Subject: [PATCH] Remove unused boolean (#263) --- .../lemminx/services/LibertyWorkspace.java | 13 +------------ .../tools/langserver/lemminx/util/LibertyUtils.java | 10 ++-------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/lemminx-liberty/src/main/java/io/openliberty/tools/langserver/lemminx/services/LibertyWorkspace.java b/lemminx-liberty/src/main/java/io/openliberty/tools/langserver/lemminx/services/LibertyWorkspace.java index 2dfaf0b9..c87de247 100644 --- a/lemminx-liberty/src/main/java/io/openliberty/tools/langserver/lemminx/services/LibertyWorkspace.java +++ b/lemminx-liberty/src/main/java/io/openliberty/tools/langserver/lemminx/services/LibertyWorkspace.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2020, 2023 IBM Corporation and others. +* Copyright (c) 2020, 2024 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 @@ -42,7 +42,6 @@ public class LibertyWorkspace { private boolean isLibertyInstalled; private List installedFeatureList; private String libertyInstallationDir; - private boolean isExternalLibertyInstallation; private FeatureListGraph featureListGraph; // devc vars @@ -62,7 +61,6 @@ public LibertyWorkspace(String workspaceFolderURI) { this.libertyVersion = null; this.libertyRuntime = null; this.isLibertyInstalled = false; - this.isExternalLibertyInstallation = false; this.libertyInstallationDir = null; this.installedFeatureList = new ArrayList(); this.containerName = null; @@ -110,7 +108,6 @@ public void setLibertyInstalled(boolean isLibertyInstalled) { this.isLibertyInstalled = isLibertyInstalled; if (!isLibertyInstalled) { // do not clear out the libertyRuntime or libertyVersion since those could be set for a live container - setExternalLibertyInstallation(isLibertyInstalled); setLibertyInstallationDir(null); // clear the cached feature list when Liberty is no longer installed this.installedFeatureList = new ArrayList(); @@ -121,14 +118,6 @@ public boolean isLibertyInstalled() { return this.isLibertyInstalled; } - public void setExternalLibertyInstallation(boolean flag) { - this.isExternalLibertyInstallation = flag; - } - - public boolean isExternalLibertyInstallation() { - return this.isExternalLibertyInstallation; - } - public void setLibertyInstallationDir(String dir) { this.libertyInstallationDir = dir; } diff --git a/lemminx-liberty/src/main/java/io/openliberty/tools/langserver/lemminx/util/LibertyUtils.java b/lemminx-liberty/src/main/java/io/openliberty/tools/langserver/lemminx/util/LibertyUtils.java index 973ec1e4..7534259d 100644 --- a/lemminx-liberty/src/main/java/io/openliberty/tools/langserver/lemminx/util/LibertyUtils.java +++ b/lemminx-liberty/src/main/java/io/openliberty/tools/langserver/lemminx/util/LibertyUtils.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2020, 2023 IBM Corporation and others. +* Copyright (c) 2020, 2024 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 @@ -354,14 +354,8 @@ public static LibertyRuntime getLibertyRuntimeInfo(LibertyWorkspace libertyWorks libertyWorkspace.setLibertyRuntime(libertyRuntimeInfo.getRuntimeType()); libertyWorkspace.setLibertyVersion(libertyRuntimeInfo.getRuntimeVersion()); - // compare paths to see if it is an external installation + // if not a container, set the Liberty installation dir if (!devcOn && (libertyRuntimeInfo.getRuntimeLocation() != null)) { - // Need to add the trailing / to avoid matching a path with similar dir (e.g. /some/path/myliberty/wlp starts with /some/path/mylib) - if (!libertyRuntimeInfo.getRuntimeLocation().startsWith(libertyWorkspace.getWorkspaceStringWithTrailingSlash())) { - libertyWorkspace.setExternalLibertyInstallation(true); - } else { - libertyWorkspace.setExternalLibertyInstallation(false); - } libertyWorkspace.setLibertyInstallationDir(libertyRuntimeInfo.getRuntimeLocation()); }