Skip to content

Commit

Permalink
Remove unused boolean (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
cherylking authored Jan 12, 2024
1 parent 76d37ca commit 54fa1fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
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, 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
Expand Down Expand Up @@ -42,7 +42,6 @@ public class LibertyWorkspace {
private boolean isLibertyInstalled;
private List<Feature> installedFeatureList;
private String libertyInstallationDir;
private boolean isExternalLibertyInstallation;
private FeatureListGraph featureListGraph;

// devc vars
Expand All @@ -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<Feature>();
this.containerName = null;
Expand Down Expand Up @@ -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<Feature>();
Expand All @@ -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;
}
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, 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
Expand Down Expand Up @@ -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());
}

Expand Down

0 comments on commit 54fa1fd

Please sign in to comment.