Skip to content

Commit 1502133

Browse files
committed
Minor code clean up
1 parent 66536f4 commit 1502133

File tree

2 files changed

+3
-3
lines changed
  • querydsl-examples
    • querydsl-example-jpa-quarkus/src/main/java/com/querydsl/example
    • querydsl-example-jpa-spring/src/main/java/com/querydsl/example

2 files changed

+3
-3
lines changed

querydsl-examples/querydsl-example-jpa-quarkus/src/main/java/com/querydsl/example/FruitResource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ public Response toResponse(Exception exception) {
101101
LOGGER.error("Failed to handle request", exception);
102102

103103
int code = 500;
104-
if (exception instanceof WebApplicationException) {
105-
code = ((WebApplicationException) exception).getResponse().getStatus();
104+
if (exception instanceof WebApplicationException applicationException) {
105+
code = applicationException.getResponse().getStatus();
106106
}
107107

108108
ObjectNode exceptionJson = objectMapper.createObjectNode();

querydsl-examples/querydsl-example-jpa-spring/src/main/java/com/querydsl/example/Customer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public Customer(String firstName, String lastName) {
2424

2525
@Override
2626
public String toString() {
27-
return String.format("Customer[id=%d, firstName='%s', lastName='%s']", id, firstName, lastName);
27+
return "Customer[id=%d, firstName='%s', lastName='%s']".formatted(id, firstName, lastName);
2828
}
2929

3030
public Long getId() {

0 commit comments

Comments
 (0)