Skip to content

Commit 3dad4ae

Browse files
committed
Improvements after code review
1 parent d496888 commit 3dad4ae

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

nucleus/common/simple-glassfish-api/src/main/java/org/glassfish/embeddable/GlassFishVariable.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import java.util.Arrays;
2020
import java.util.Map;
21-
import java.util.Optional;
2221
import java.util.stream.Collectors;
2322

2423
/**
@@ -129,10 +128,6 @@ public String getSystemPropertyName() {
129128
return this.sysPropName;
130129
}
131130

132-
public Optional<String> getSystemPropertyValue() {
133-
return Optional.ofNullable(System.getProperty(getSystemPropertyName()));
134-
}
135-
136131
/**
137132
* The map contains pairs of {@link #getEnvName()} and {@link #getSystemPropertyName()}.
138133
* When the {@link #getEnvName()} returns null, the mapping is not included.

nucleus/core/kernel/src/main/java/com/sun/enterprise/v3/server/SystemTasksImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ private void setVersion() {
135135
private void setSystemPropertiesFromEnv(boolean forceOverwrite) {
136136
// adding our version of some system properties.
137137
setProperty(JAVA_ROOT.getSystemPropertyName(), System.getProperty(JAVA_HOME.getSystemPropertyName()), forceOverwrite);
138-
if (HOST_NAME.getSystemPropertyValue().isEmpty()) {
138+
if (forceOverwrite || null == System.getProperty(HOST_NAME.getSystemPropertyName())) {
139139
String hostname = "localhost";
140140
try {
141141
// canonical name checks to make sure host is proper
@@ -144,7 +144,7 @@ private void setSystemPropertiesFromEnv(boolean forceOverwrite) {
144144
LOG.log(Level.SEVERE, KernelLoggerInfo.exceptionHostname, ex);
145145
}
146146
if (hostname != null) {
147-
setProperty(HOST_NAME.getSystemPropertyName(), hostname, false);
147+
setProperty(HOST_NAME.getSystemPropertyName(), hostname, true);
148148
}
149149
}
150150
}

nucleus/core/kernel/src/main/java/org/glassfish/runnablejar/UberMain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ private void executeCommandFromString(String stringCommand) {
185185
commandParams = new String[split.length - 1];
186186
for (int i = 1; i < split.length; i++) {
187187
commandParams[i - 1] = split[i].trim();
188-
}
188+
}
189189
}
190190
try {
191191
CommandResult result = commandParams == null

0 commit comments

Comments
 (0)