Skip to content

Commit d9c2355

Browse files
committed
minor formatting change
1 parent 1f28f4e commit d9c2355

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

examples/src/main/java/examples/PlainText.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@
1717

1818
import io.jooby.annotations.GET;
1919
import io.jooby.annotations.Path;
20+
import io.jooby.annotations.PathParam;
21+
22+
import java.util.Optional;
2023

2124
public class PlainText {
2225
@GET
2326
@Path("/plaintext")
24-
public String plainText() {
25-
return "Hello, World!";
27+
public String plainText(@PathParam Optional<String> message) {
28+
return message.orElse("Hello, World!");
2629
}
2730
}

jooby/src/main/java/io/jooby/internal/RouterImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ private String[] path(Method m) {
622622
String[] root = mvcAnnotations.pathPattern(m.getDeclaringClass());
623623
if (root == null) {
624624
if (path == null) {
625-
return new String[] {"/"};
625+
return new String[]{"/"};
626626
}
627627
return path;
628628
}
@@ -631,6 +631,7 @@ private String[] path(Method m) {
631631
}
632632
String[] result = new String[root.length * path.length];
633633
int k = 0;
634+
634635
for (String base : root) {
635636
for (String element : path) {
636637
result[k] = base + "/" + element;

0 commit comments

Comments
 (0)