Skip to content

Commit

Permalink
Update LibertyRunManagerListener.java
Browse files Browse the repository at this point in the history
  • Loading branch information
anusreelakshmi934 committed Feb 26, 2024
1 parent d956a03 commit 2ec5b98
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.net.MalformedURLException;
import java.net.URL;
import java.nio.file.Paths;

/**
* Listens to creation/deletion of Liberty run configurations
Expand All @@ -39,12 +40,12 @@ public void runConfigurationRemoved(@NotNull RunnerAndConfigurationSettings sett
LibertyRunConfiguration runConfig = (LibertyRunConfiguration) settings.getConfiguration();
LibertyModules libertyModules = LibertyModules.getInstance();
try {
VirtualFile vBuildFile = VfsUtil.findFileByURL(new URL("file://" + runConfig.getBuildFile()));
VirtualFile vBuildFile = VfsUtil.findFile(Paths.get(runConfig.getBuildFile()), true);
LibertyModule libertyModule = libertyModules.getLibertyModule(vBuildFile);
if (libertyModule != null && libertyModule.getCustomStartParams().equals(runConfig.getParams())) {
libertyModule.clearCustomStartParams();
}
} catch (MalformedURLException e) {
} catch (Exception e) {
LOGGER.warn(String.format("Unable to clear custom start parameters for Liberty run configuration associated with: %s. Could not resolve build file.", runConfig.getBuildFile()), e);
}

Expand Down

0 comments on commit 2ec5b98

Please sign in to comment.