From ea2ba2f9ad88ea5dd2cd0881e058ee8e5e85564f Mon Sep 17 00:00:00 2001 From: Terry Jia Date: Thu, 24 Jan 2019 11:41:53 +0800 Subject: [PATCH] INTELLIJ-41 remove unnecessary variable and rename --- .../ide/idea/server/portal/PortalBundle.java | 2 +- .../ide/idea/server/portal/PortalTomcatBundle.java | 14 +++++++------- .../idea/server/portal/PortalWildFlyBundle.java | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/liferay/ide/idea/server/portal/PortalBundle.java b/src/main/java/com/liferay/ide/idea/server/portal/PortalBundle.java index a1b3f6422..0e970f7dd 100644 --- a/src/main/java/com/liferay/ide/idea/server/portal/PortalBundle.java +++ b/src/main/java/com/liferay/ide/idea/server/portal/PortalBundle.java @@ -31,7 +31,7 @@ public interface PortalBundle { public String[] getRuntimeStartProgArgs(); - public String[] getRuntimeStartVMArgs(Sdk javaJdk); + public String[] getRuntimeStartVMArgs(Sdk sdk); public String getType(); diff --git a/src/main/java/com/liferay/ide/idea/server/portal/PortalTomcatBundle.java b/src/main/java/com/liferay/ide/idea/server/portal/PortalTomcatBundle.java index f05d84302..fda1ace8d 100644 --- a/src/main/java/com/liferay/ide/idea/server/portal/PortalTomcatBundle.java +++ b/src/main/java/com/liferay/ide/idea/server/portal/PortalTomcatBundle.java @@ -77,8 +77,8 @@ public String[] getRuntimeStartProgArgs() { } @Override - public String[] getRuntimeStartVMArgs(Sdk javaJdk) { - return _getRuntimeVMArgs(javaJdk); + public String[] getRuntimeStartVMArgs(Sdk sdk) { + return _getRuntimeVMArgs(sdk); } @Override @@ -86,7 +86,7 @@ public String getType() { return "tomcat"; } - private String[] _getRuntimeVMArgs(Sdk javaJdk) { + private String[] _getRuntimeVMArgs(Sdk sdk) { List args = new ArrayList<>(); Path tempPath = FileUtil.pathAppend(bundlePath, "temp"); Path endorsedPath = FileUtil.pathAppend(bundlePath, "endorsed"); @@ -95,12 +95,14 @@ private String[] _getRuntimeVMArgs(Sdk javaJdk) { args.add("-Dcatalina.home=" + bundlePath); args.add("-Dfile.encoding=UTF8"); - String jdkVersionString = JdkUtil.getJdkMainAttribute(javaJdk, Attributes.Name.SPECIFICATION_VERSION); + String jdkVersionString = JdkUtil.getJdkMainAttribute(sdk, Attributes.Name.SPECIFICATION_VERSION); if (!CoreUtil.isNullOrEmpty(jdkVersionString)) { Version jdkVersion = Version.parseVersion(jdkVersionString); - if (jdkVersion.compareTo(_jdk8Version) <= 0) { + Version jdk8Version = Version.parseVersion("1.8"); + + if (jdkVersion.compareTo(jdk8Version) <= 0) { args.add("-Djava.endorsed.dirs=" + endorsedPath); } } @@ -118,6 +120,4 @@ private String[] _getRuntimeVMArgs(Sdk javaJdk) { return args.toArray(new String[0]); } - private static Version _jdk8Version = Version.parseVersion("1.8"); - } \ No newline at end of file diff --git a/src/main/java/com/liferay/ide/idea/server/portal/PortalWildFlyBundle.java b/src/main/java/com/liferay/ide/idea/server/portal/PortalWildFlyBundle.java index 589c229e6..256af2562 100644 --- a/src/main/java/com/liferay/ide/idea/server/portal/PortalWildFlyBundle.java +++ b/src/main/java/com/liferay/ide/idea/server/portal/PortalWildFlyBundle.java @@ -88,7 +88,7 @@ public String[] getRuntimeStartProgArgs() { } @Override - public String[] getRuntimeStartVMArgs(Sdk javaJdk) { + public String[] getRuntimeStartVMArgs(Sdk sdk) { List args = new ArrayList<>(); args.add("-Dorg.jboss.resolver.warning=true");