JAVA-26705 Upgrade lombok to latest version (#15305)

Co-authored-by: timis1 <noreplay@yahoo.com>
This commit is contained in:
timis1
2023-12-03 21:19:12 +02:00
committed by GitHub
parent 641ae1e973
commit e6501ada07
52 changed files with 46 additions and 18 deletions
@@ -41,6 +41,7 @@
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
<version>${lombok.version}</version>
</dependency>
</dependencies>
@@ -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();
}
@@ -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());
}
}
@@ -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;
}