mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 10:58:51 +00:00
deps: Refactor dependencies (#3224)
* remove spring dep move junit, logging, mockito under dep mgmt * upgrade anti-corruption-layer deps * async method invocation * balking, bloc * bridge to bytecode * caching * callback - cqrs * component - health check * hexagonal - metadata mapping * rest of the patterns * remove checkstyle, take spotless into use
This commit is contained in:
@@ -39,9 +39,7 @@ public abstract class ObjectPool<T> {
|
||||
|
||||
protected abstract T create();
|
||||
|
||||
/**
|
||||
* Checkout object from pool.
|
||||
*/
|
||||
/** Checkout object from pool. */
|
||||
public synchronized T checkOut() {
|
||||
if (available.isEmpty()) {
|
||||
available.add(create());
|
||||
|
||||
@@ -28,20 +28,15 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Oliphaunts are expensive to create.
|
||||
*/
|
||||
/** Oliphaunts are expensive to create. */
|
||||
@Slf4j
|
||||
public class Oliphaunt {
|
||||
|
||||
private static final AtomicInteger counter = new AtomicInteger(0);
|
||||
|
||||
@Getter
|
||||
private final int id;
|
||||
@Getter private final int id;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
/** Constructor. */
|
||||
public Oliphaunt() {
|
||||
id = counter.incrementAndGet();
|
||||
try {
|
||||
|
||||
@@ -24,9 +24,7 @@
|
||||
*/
|
||||
package com.iluwatar.object.pool;
|
||||
|
||||
/**
|
||||
* Oliphaunt object pool.
|
||||
*/
|
||||
/** Oliphaunt object pool. */
|
||||
public class OliphauntPool extends ObjectPool<Oliphaunt> {
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user