Skip to content

Commit

Permalink
INTELLIJ-41 remove unnecessary variable and rename
Browse files Browse the repository at this point in the history
  • Loading branch information
Terry Jia authored and gamerson committed Jan 24, 2019
1 parent 4ae2b59 commit ea2ba2f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface PortalBundle {

public String[] getRuntimeStartProgArgs();

public String[] getRuntimeStartVMArgs(Sdk javaJdk);
public String[] getRuntimeStartVMArgs(Sdk sdk);

public String getType();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ public String[] getRuntimeStartProgArgs() {
}

@Override
public String[] getRuntimeStartVMArgs(Sdk javaJdk) {
return _getRuntimeVMArgs(javaJdk);
public String[] getRuntimeStartVMArgs(Sdk sdk) {
return _getRuntimeVMArgs(sdk);
}

@Override
public String getType() {
return "tomcat";
}

private String[] _getRuntimeVMArgs(Sdk javaJdk) {
private String[] _getRuntimeVMArgs(Sdk sdk) {
List<String> args = new ArrayList<>();
Path tempPath = FileUtil.pathAppend(bundlePath, "temp");
Path endorsedPath = FileUtil.pathAppend(bundlePath, "endorsed");
Expand All @@ -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);
}
}
Expand All @@ -118,6 +120,4 @@ private String[] _getRuntimeVMArgs(Sdk javaJdk) {
return args.toArray(new String[0]);
}

private static Version _jdk8Version = Version.parseVersion("1.8");

}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public String[] getRuntimeStartProgArgs() {
}

@Override
public String[] getRuntimeStartVMArgs(Sdk javaJdk) {
public String[] getRuntimeStartVMArgs(Sdk sdk) {
List<String> args = new ArrayList<>();

args.add("-Dorg.jboss.resolver.warning=true");
Expand Down

0 comments on commit ea2ba2f

Please sign in to comment.