|
288 | 288 | import org.slf4j.LoggerFactory; |
289 | 289 |
|
290 | 290 | import javax.annotation.Nonnull; |
| 291 | +import javax.annotation.Nullable; |
291 | 292 | import javax.inject.Singleton; |
292 | 293 | import javax.net.ssl.SSLContext; |
293 | 294 | import java.io.File; |
@@ -925,7 +926,7 @@ public Jooby use(final Jooby app) { |
925 | 926 | return use(prefixPath(null), app); |
926 | 927 | } |
927 | 928 |
|
928 | | - private Optional<String> prefixPath(String tail) { |
| 929 | + private Optional<String> prefixPath(@Nullable String tail) { |
929 | 930 | return path.size() == 0 |
930 | 931 | ? tail == null ? Optional.empty() : Optional.of(Route.normalize(tail)) |
931 | 932 | : Optional.of(path.stream() |
@@ -2196,7 +2197,7 @@ private void start(final String[] args, final Consumer<List<Route.Definition>> r |
2196 | 2197 | this.injector = bootstrap(args(args), routes); |
2197 | 2198 |
|
2198 | 2199 | // shutdown hook |
2199 | | - Runtime.getRuntime().addShutdownHook(new Thread(() -> stop())); |
| 2200 | + Runtime.getRuntime().addShutdownHook(new Thread(this::stop)); |
2200 | 2201 |
|
2201 | 2202 | Config conf = injector.getInstance(Config.class); |
2202 | 2203 |
|
@@ -3395,11 +3396,10 @@ private Config defaultConfig(final Config conf, final String cpath) { |
3395 | 3396 | defs = defs.withValue("application.charset", fromAnyRef(charset.name())); |
3396 | 3397 | } |
3397 | 3398 | if (port != null) { |
3398 | | - defs = defs.withValue("application.port", fromAnyRef(port.intValue())); |
| 3399 | + defs = defs.withValue("application.port", fromAnyRef(port)); |
3399 | 3400 | } |
3400 | 3401 | if (securePort != null) { |
3401 | | - defs = defs.withValue("application.securePort", |
3402 | | - fromAnyRef(securePort.intValue())); |
| 3402 | + defs = defs.withValue("application.securePort", fromAnyRef(securePort)); |
3403 | 3403 | } |
3404 | 3404 | if (dateFormat != null) { |
3405 | 3405 | defs = defs.withValue("application.dateFormat", fromAnyRef(dateFormat)); |
@@ -3495,8 +3495,8 @@ static String logback(final Config conf) { |
3495 | 3495 | files.add(new File(confdir, "logback.xml")); |
3496 | 3496 | logback = files.build() |
3497 | 3497 | .stream() |
3498 | | - .filter(f -> f.exists()) |
3499 | | - .map(f -> f.getAbsolutePath()) |
| 3498 | + .filter(File::exists) |
| 3499 | + .map(File::getAbsolutePath) |
3500 | 3500 | .findFirst() |
3501 | 3501 | .orElseGet(() -> { |
3502 | 3502 | return Optional.ofNullable(Jooby.class.getResource("/logback." + env + ".xml")) |
|
0 commit comments