JAVA-26705 Upgrade lombok to latest version (#15305)
Co-authored-by: timis1 <noreplay@yahoo.com>
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
<version>${lombok.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class OrdersController {
|
||||
public ResponseEntity<Order> getOrderById(@PathVariable Long id) {
|
||||
|
||||
Optional<Order> o = orders.findById(id);
|
||||
if (o.isEmpty()) {
|
||||
if (!o.isPresent()) {
|
||||
return ResponseEntity.notFound().build();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ public class NotificationHandler implements Consumer<PGNotification>{
|
||||
public void accept(PGNotification t) {
|
||||
log.info("Notification received: pid={}, name={}, param={}",t.getPID(),t.getName(),t.getParameter());
|
||||
Optional<Order> order = orders.findById(Long.valueOf(t.getParameter()));
|
||||
if ( !order.isEmpty()) {
|
||||
if ( order.isPresent()) {
|
||||
log.info("order details: {}", order.get());
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -43,14 +43,14 @@ public class OrdersService {
|
||||
@Transactional(readOnly = true)
|
||||
public Optional<Order> findById(Long id) {
|
||||
Optional<Order> o = Optional.ofNullable(ordersCache.get(id, Order.class));
|
||||
if ( !o.isEmpty() ) {
|
||||
if ( o.isPresent() ) {
|
||||
log.info("findById: cache hit, id={}",id);
|
||||
return o;
|
||||
}
|
||||
|
||||
log.info("findById: cache miss, id={}",id);
|
||||
o = repo.findById(id);
|
||||
if ( o.isEmpty()) {
|
||||
if ( !o.isPresent()) {
|
||||
return o;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user