Skip to content

Commit

Permalink
INTELLIJ-285 SF
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjhy committed Dec 11, 2023
1 parent 35831cd commit 1cfc591
Showing 1 changed file with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.liferay.ide.idea.core.WorkspaceProvider;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

Expand Down Expand Up @@ -63,7 +62,7 @@ public static Map<String, ProductInfo> getProductInfos() {
try (JsonReader jsonReader = new JsonReader(Files.newBufferedReader(_workspaceCacheFile.toPath()))) {
return gson.fromJson(jsonReader, typeToken.getType());
}
catch (Exception exception) {
catch (Exception exception1) {
File bladeJar = BladeCLI.getBladeJar(BladeCLI.getBladeJarVersion(null));

if (bladeJar != null) {
Expand All @@ -76,20 +75,16 @@ public static Map<String, ProductInfo> getProductInfos() {
String entryName = entry.getName();

if (entryName.equals(".product_info.json")) {
try (InputStream resourceAsStream = zipFile.getInputStream(entry)) {
if (Objects.nonNull(resourceAsStream)) {
try (JsonReader jsonReader = new JsonReader(
new InputStreamReader(resourceAsStream))) {

return gson.fromJson(jsonReader, typeToken.getType());
}
}
try (InputStream resourceAsStream = zipFile.getInputStream(entry);
JsonReader jsonReader = new JsonReader(new InputStreamReader(resourceAsStream))) {

return gson.fromJson(jsonReader, typeToken.getType());
}
}
}
}
catch (IOException ioException) {
_logger.error(ioException);
catch (Exception exception2) {
_logger.error(exception2);
}
}
}
Expand Down

0 comments on commit 1cfc591

Please sign in to comment.