Skip to content

Commit 2f1b830

Browse files
committed
Smaller improvements
1 parent a04b9ac commit 2f1b830

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

exist-start/src/main/java/org/exist/start/Classpath.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public Classpath(final String initial)
6464
}
6565

6666
public boolean addComponent(final String component) {
67-
if (component != null && component.length() > 0) {
67+
if (component != null && !component.isEmpty()) {
6868
try {
6969
final Path p = Paths.get(component);
7070
if (Files.exists(p))

exist-start/src/main/java/org/exist/start/Main.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,8 @@ private Optional<String> getFromSysPropOrEnv(final String sysPropName, final Str
290290
Optional<String> value = Optional.ofNullable(System.getProperty(sysPropName));
291291
if (!value.isPresent()) {
292292
value = Optional.ofNullable(System.getenv().get(envVarName));
293-
if (value.isPresent()) {
294-
// if we managed to detect from environment, store it in a system property
295-
System.setProperty(sysPropName, value.get());
296-
}
293+
// if we managed to detect from environment, store it in a system property
294+
value.ifPresent(s -> System.setProperty(sysPropName, s));
297295
}
298296

299297
if (_debug && value.isPresent()) {

0 commit comments

Comments
 (0)