Skip to content

Commit

Permalink
Add review suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
parkavi11 committed Oct 23, 2020
1 parent 54ac04a commit 601a753
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/org/ballerinalang/command/cmd/ListCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.ballerinalang.command.util.Channel;
import org.ballerinalang.command.util.Distribution;
import org.ballerinalang.command.util.ErrorUtil;
import org.ballerinalang.command.util.OSUtils;
import org.ballerinalang.command.util.ToolUtil;

import java.io.BufferedReader;
Expand All @@ -36,8 +37,6 @@
import java.util.Arrays;
import java.util.List;

import static org.ballerinalang.command.util.OSUtils.getBallerinaDistListFilePath;

/**
* This class represents the "Update" command and it holds arguments and flags specified by the user.
*/
Expand Down Expand Up @@ -165,7 +164,7 @@ private static String markVersion(String used, String current) {
*/
private static void writeLocalDistsIntoJson(List<String> installedVersions) throws IOException {
FileWriter writer;
String distListPath = getBallerinaDistListFilePath();
String distListPath = OSUtils.getBallerinaDistListFilePath();
try {
writer = new FileWriter(distListPath);
} catch (IOException e) {
Expand All @@ -186,7 +185,7 @@ private static void writeLocalDistsIntoJson(List<String> installedVersions) thro
private static void readLocalDistsFromJson(PrintStream outStream, String currentBallerinaVersion) {
BufferedReader reader;
try {
reader = new BufferedReader(new FileReader(getBallerinaDistListFilePath()));
reader = new BufferedReader(new FileReader(OSUtils.getBallerinaDistListFilePath()));
String line;
while ((line = reader.readLine()) != null) {
outStream.println(markVersion(currentBallerinaVersion, line) + " " + ToolUtil.getTypeName(line));
Expand Down

0 comments on commit 601a753

Please sign in to comment.