diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 6d31c9149..805b9a37d 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -27,11 +27,11 @@ jobs:
steps:
- name: Checkout code
if: github.event.inputs.perform_version == ''
- uses: actions/checkout@v4
+ uses: actions/checkout@v6
- name: Checkout full repository
# Required when performing an existing release.
if: github.event.inputs.perform_version != ''
- uses: actions/checkout@v4
+ uses: actions/checkout@v6
with:
fetch-depth: '0'
- name: Setup git user
@@ -43,7 +43,7 @@ jobs:
git config --global user.name "Kill Bill core team"
git config --global url."https://${BUILD_USER}:${BUILD_TOKEN}@github.com/".insteadOf "git@github.com:"
- name: Configure Java
- uses: actions/setup-java@v4
+ uses: actions/setup-java@v5
with:
java-version: 21
distribution: temurin
@@ -65,7 +65,7 @@ jobs:
# Will be pushed as part of the release process, only if the release is successful
git commit -m "pom.xml: update killbill-oss-parent to ${{ github.event.inputs.parent_version }}"
- name: Configure settings.xml for release
- uses: actions/setup-java@v4
+ uses: actions/setup-java@v5
with:
java-version: 21
distribution: temurin
@@ -102,4 +102,3 @@ jobs:
run: |
PROJECT_VERSION=$(git describe --abbrev=0 | cut -d '-' -f 3)
gh workflow -R killbill/killbill-oss-parent run release.yml -f commons_version=${PROJECT_VERSION}
-
diff --git a/automaton/pom.xml b/automaton/pom.xml
index 988ac7c60..02874c53f 100644
--- a/automaton/pom.xml
+++ b/automaton/pom.xml
@@ -31,15 +31,15 @@
spotbugs-exclude.xml
-
- com.google.code.findbugs
- jsr305
-
jakarta.activation
jakarta.activation-api
runtime
+
+ jakarta.annotation
+ jakarta.annotation-api
+
jakarta.xml.bind
jakarta.xml.bind-api
diff --git a/automaton/src/main/java/org/killbill/automaton/dot/DOTBuilder.java b/automaton/src/main/java/org/killbill/automaton/dot/DOTBuilder.java
index 32b138695..1a3646b5b 100644
--- a/automaton/src/main/java/org/killbill/automaton/dot/DOTBuilder.java
+++ b/automaton/src/main/java/org/killbill/automaton/dot/DOTBuilder.java
@@ -22,7 +22,7 @@
import java.util.HashMap;
import java.util.Map;
-import javax.annotation.Nullable;
+import jakarta.annotation.Nullable;
import org.killbill.commons.utils.MapJoiner;
diff --git a/clock/pom.xml b/clock/pom.xml
index f6c3d0919..21e07470d 100644
--- a/clock/pom.xml
+++ b/clock/pom.xml
@@ -33,6 +33,13 @@
guice
runtime
+
+
+ io.netty
+ netty-common
+ ${netty.version}
+ test
+
it.ozimov
embedded-redis
@@ -51,6 +58,12 @@
org.redisson
redisson
test
+
+
+ io.netty
+ netty-common
+
+
org.slf4j
diff --git a/concurrent/pom.xml b/concurrent/pom.xml
index 8b5eeb4dc..5eb8ab489 100644
--- a/concurrent/pom.xml
+++ b/concurrent/pom.xml
@@ -33,15 +33,15 @@
reload4j
test
-
- com.google.code.findbugs
- jsr305
-
com.google.inject
guice
runtime
+
+ jakarta.annotation
+ jakarta.annotation-api
+
org.slf4j
slf4j-api
diff --git a/concurrent/src/main/java/org/killbill/commons/profiling/ProfilingData.java b/concurrent/src/main/java/org/killbill/commons/profiling/ProfilingData.java
index a4a2ddde2..675b91bd8 100644
--- a/concurrent/src/main/java/org/killbill/commons/profiling/ProfilingData.java
+++ b/concurrent/src/main/java/org/killbill/commons/profiling/ProfilingData.java
@@ -25,7 +25,7 @@
import java.util.List;
import java.util.stream.Collectors;
-import javax.annotation.Nullable;
+import jakarta.annotation.Nullable;
public class ProfilingData {
diff --git a/embeddeddb/postgresql/pom.xml b/embeddeddb/postgresql/pom.xml
index 046a06ee3..f8456a2b1 100644
--- a/embeddeddb/postgresql/pom.xml
+++ b/embeddeddb/postgresql/pom.xml
@@ -28,10 +28,6 @@
killbill-embeddeddb-postgresql
Kill Bill library of embedded dbs: PostgreSQL
-
- com.google.code.findbugs
- jsr305
-
io.airlift
command
@@ -47,6 +43,10 @@
embedded-postgres
test
+
+ jakarta.annotation
+ jakarta.annotation-api
+
org.kill-bill.commons
killbill-embeddeddb-common
diff --git a/embeddeddb/postgresql/src/test/java/org/killbill/commons/embeddeddb/postgresql/KillBillTestingPostgreSqlServer.java b/embeddeddb/postgresql/src/test/java/org/killbill/commons/embeddeddb/postgresql/KillBillTestingPostgreSqlServer.java
index 83d71baad..6963b8c66 100644
--- a/embeddeddb/postgresql/src/test/java/org/killbill/commons/embeddeddb/postgresql/KillBillTestingPostgreSqlServer.java
+++ b/embeddeddb/postgresql/src/test/java/org/killbill/commons/embeddeddb/postgresql/KillBillTestingPostgreSqlServer.java
@@ -25,7 +25,7 @@
import java.sql.SQLException;
import java.sql.Statement;
-import javax.annotation.Nullable;
+import jakarta.annotation.Nullable;
import org.killbill.commons.utils.Preconditions;
import org.slf4j.Logger;
diff --git a/jdbi/pom.xml b/jdbi/pom.xml
index 30d36c908..7f6f6b032 100644
--- a/jdbi/pom.xml
+++ b/jdbi/pom.xml
@@ -37,10 +37,6 @@
com.fasterxml
classmate
-
- com.google.code.findbugs
- jsr305
-
com.h2database
h2
@@ -58,6 +54,10 @@
+
+ jakarta.annotation
+ jakarta.annotation-api
+
jakarta.inject
jakarta.inject-api
diff --git a/jdbi/src/main/java/org/killbill/commons/jdbi/guice/DBIProvider.java b/jdbi/src/main/java/org/killbill/commons/jdbi/guice/DBIProvider.java
index bfa9bc80b..c082ad757 100644
--- a/jdbi/src/main/java/org/killbill/commons/jdbi/guice/DBIProvider.java
+++ b/jdbi/src/main/java/org/killbill/commons/jdbi/guice/DBIProvider.java
@@ -22,7 +22,7 @@
import java.util.LinkedHashSet;
import java.util.Set;
-import javax.annotation.Nullable;
+import jakarta.annotation.Nullable;
import jakarta.inject.Inject;
import jakarta.inject.Provider;
import javax.sql.DataSource;
diff --git a/jdbi/src/main/java/org/killbill/commons/jdbi/guice/DataSourceProvider.java b/jdbi/src/main/java/org/killbill/commons/jdbi/guice/DataSourceProvider.java
index a79114596..b7679b6b4 100644
--- a/jdbi/src/main/java/org/killbill/commons/jdbi/guice/DataSourceProvider.java
+++ b/jdbi/src/main/java/org/killbill/commons/jdbi/guice/DataSourceProvider.java
@@ -24,7 +24,7 @@
import java.sql.SQLException;
import java.util.concurrent.TimeUnit;
-import javax.annotation.Nullable;
+import jakarta.annotation.Nullable;
import jakarta.inject.Inject;
import jakarta.inject.Provider;
import javax.sql.DataSource;
diff --git a/jooby/pom.xml b/jooby/pom.xml
index 8e837dcd0..ed71aab20 100644
--- a/jooby/pom.xml
+++ b/jooby/pom.xml
@@ -35,10 +35,6 @@
com.google.inject
guice
-
- com.google.guava
- guava
-
com.typesafe
config
@@ -177,6 +173,10 @@
4.5.14
test
+
+ org.kill-bill.commons
+ killbill-utils
+
diff --git a/jooby/src/main/java/org/jooby/Asset.java b/jooby/src/main/java/org/jooby/Asset.java
index 8f8465b69..d255c11b5 100644
--- a/jooby/src/main/java/org/jooby/Asset.java
+++ b/jooby/src/main/java/org/jooby/Asset.java
@@ -20,9 +20,9 @@
import java.io.InputStream;
import java.net.URISyntaxException;
import java.net.URL;
+import java.nio.ByteBuffer;
+import java.util.Base64;
-import com.google.common.io.BaseEncoding;
-import com.google.common.primitives.Longs;
import org.jooby.funzy.Throwing;
import jakarta.annotation.Nonnull;
@@ -138,11 +138,11 @@ default String etag() {
StringBuilder b = new StringBuilder(32);
b.append("W/\"");
- BaseEncoding b64 = BaseEncoding.base64();
+ Base64.Encoder b64 = Base64.getEncoder();
int lhash = resource().toURI().hashCode();
- b.append(b64.encode(Longs.toByteArray(lastModified() ^ lhash)));
- b.append(b64.encode(Longs.toByteArray(length() ^ lhash)));
+ b.append(b64.encodeToString(ByteBuffer.allocate(Long.BYTES).putLong(lastModified() ^ lhash).array()));
+ b.append(b64.encodeToString(ByteBuffer.allocate(Long.BYTES).putLong(length() ^ lhash).array()));
b.append('"');
return b.toString();
} catch (URISyntaxException x) {
diff --git a/jooby/src/main/java/org/jooby/Cookie.java b/jooby/src/main/java/org/jooby/Cookie.java
index 36cfa0c75..79d656be4 100644
--- a/jooby/src/main/java/org/jooby/Cookie.java
+++ b/jooby/src/main/java/org/jooby/Cookie.java
@@ -15,9 +15,8 @@
*/
package org.jooby;
-import com.google.common.base.Splitter;
-import com.google.common.base.Strings;
-import com.google.common.io.BaseEncoding;
+import org.killbill.commons.utils.Splitter;
+import org.killbill.commons.utils.Strings;
import static java.util.Objects.requireNonNull;
import org.jooby.funzy.Throwing;
import org.jooby.internal.CookieImpl;
@@ -35,7 +34,6 @@
import java.util.Objects;
import java.util.Optional;
import java.util.function.Function;
-import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
@@ -417,9 +415,6 @@ public Optional maxAge() {
*/
public class Signature {
- /** Remove trailing '='. */
- private static final Pattern EQ = Pattern.compile("=+$");
-
/** Algorithm name. */
public static final String HMAC_SHA256 = "HmacSHA256";
@@ -448,7 +443,7 @@ public static String sign(final String value, final String secret) {
Mac mac = Mac.getInstance(HMAC_SHA256);
mac.init(new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), HMAC_SHA256));
byte[] bytes = mac.doFinal(value.getBytes(StandardCharsets.UTF_8));
- return EQ.matcher(BaseEncoding.base64().encode(bytes)).replaceAll("") + SEP + value;
+ return java.util.Base64.getEncoder().withoutPadding().encodeToString(bytes) + SEP + value;
} catch (Exception ex) {
throw new IllegalArgumentException("Can't sign value", ex);
}
diff --git a/jooby/src/main/java/org/jooby/Env.java b/jooby/src/main/java/org/jooby/Env.java
index 432f3d70e..ba8e9beb3 100644
--- a/jooby/src/main/java/org/jooby/Env.java
+++ b/jooby/src/main/java/org/jooby/Env.java
@@ -15,8 +15,7 @@
*/
package org.jooby;
-import com.google.common.base.Splitter;
-import com.google.common.collect.ImmutableList;
+import org.killbill.commons.utils.Splitter;
import com.google.inject.Key;
import com.google.inject.name.Names;
import com.typesafe.config.Config;
@@ -25,6 +24,8 @@
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;
+
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
@@ -332,11 +333,11 @@ default Env build(final Config config) {
String name = config.hasPath("application.env") ? config.getString("application.env") : "dev";
return new Env() {
- private ImmutableList.Builder> start = ImmutableList.builder();
+ private List> start = new ArrayList<>();
- private ImmutableList.Builder> started = ImmutableList.builder();
+ private List> started = new ArrayList<>();
- private ImmutableList.Builder> shutdown = ImmutableList.builder();
+ private List> shutdown = new ArrayList<>();
private Map> xss = new HashMap<>();
@@ -393,7 +394,7 @@ public String toString() {
@Override
public List> stopTasks() {
- return shutdown.build();
+ return Collections.unmodifiableList(shutdown);
}
@Override
@@ -416,12 +417,12 @@ public LifeCycle onStarted(final Throwing.Consumer task) {
@Override
public List> startTasks() {
- return this.start.build();
+ return Collections.unmodifiableList(this.start);
}
@Override
public List> startedTasks() {
- return this.started.build();
+ return Collections.unmodifiableList(this.started);
}
@Override
diff --git a/jooby/src/main/java/org/jooby/Err.java b/jooby/src/main/java/org/jooby/Err.java
index 9640bb0e9..0d4fdd7c2 100644
--- a/jooby/src/main/java/org/jooby/Err.java
+++ b/jooby/src/main/java/org/jooby/Err.java
@@ -25,7 +25,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.base.Throwables;
+import org.killbill.commons.utils.Throwables;
import jakarta.annotation.Nullable;
diff --git a/jooby/src/main/java/org/jooby/Jooby.java b/jooby/src/main/java/org/jooby/Jooby.java
index aeb0ad1e9..14f70ded3 100644
--- a/jooby/src/main/java/org/jooby/Jooby.java
+++ b/jooby/src/main/java/org/jooby/Jooby.java
@@ -15,16 +15,13 @@
*/
package org.jooby;
-import com.google.common.base.Joiner;
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkState;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.escape.Escaper;
-import com.google.common.html.HtmlEscapers;
-import com.google.common.net.UrlEscapers;
-import com.google.common.util.concurrent.MoreExecutors;
+import org.killbill.commons.utils.escape.Escaper;
+import org.killbill.commons.utils.html.HtmlEscapers;
+import org.killbill.commons.utils.net.UrlEscapers;
+import org.killbill.commons.utils.Joiner;
+import static org.killbill.commons.utils.Preconditions.checkArgument;
+import static org.killbill.commons.utils.Preconditions.checkState;
+import org.killbill.commons.utils.concurrent.DirectExecutor;
import com.google.inject.Binder;
import com.google.inject.Guice;
import com.google.inject.Injector;
@@ -118,6 +115,7 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
@@ -513,7 +511,7 @@ static class MvcClass implements Route.Props {
String path;
- ImmutableMap.Builder attrs = ImmutableMap.builder();
+ Map attrs = new LinkedHashMap<>();
private List consumes;
@@ -583,7 +581,7 @@ public MvcClass renderer(final String name) {
}
public Route.Definition apply(final Route.Definition route) {
- attrs.build().forEach(route::attr);
+ attrs.forEach(route::attr);
if (name != null) {
route.name(name);
}
@@ -2640,9 +2638,9 @@ private Injector bootstrap(final Config args,
/** executors: */
if (!defaultExecSet) {
// default executor
- executor(MoreExecutors.directExecutor());
+ executor(DirectExecutor.INSTANCE);
}
- executor("direct", MoreExecutors.directExecutor());
+ executor("direct", DirectExecutor.INSTANCE);
executor("server", ServerExecutorProvider.class);
/** Some basic xss functions. */
@@ -2822,9 +2820,9 @@ private Injector bootstrap(final Config args,
// clear bag and freeze it
this.bag.clear();
- this.bag = ImmutableSet.of();
+ this.bag = Collections.emptySet();
this.executors.clear();
- this.executors = ImmutableList.of();
+ this.executors = Collections.emptyList();
return injector;
}
@@ -3024,7 +3022,11 @@ private Config buildConfig(final Config source, final Config args,
// set module config
Config moduleStack = ConfigFactory.empty();
- for (Config module : ImmutableList.copyOf(modules).reverse()) {
+ // FIXME: Java 21 has better .reverse() support.
+ // Not using it yet since I don't think we really need hard 'Java 21' minimum, yet
+ List reversedModules = new ArrayList<>(modules);
+ Collections.reverse(reversedModules);
+ for (Config module : reversedModules) {
moduleStack = moduleStack.withFallback(module);
}
@@ -3162,7 +3164,7 @@ private Config defaultConfig(final Config conf, final String cpath) {
if (!conf.hasPath("application.lang")) {
locales = Optional.ofNullable(this.languages)
.map(langs -> LocaleUtils.parse(Joiner.on(",").join(langs)))
- .orElse(ImmutableList.of(Locale.getDefault()));
+ .orElse(List.of(Locale.getDefault()));
} else {
locales = LocaleUtils.parse(conf.getString("application.lang"));
}
@@ -3303,7 +3305,7 @@ static String logback(final Config conf) {
logback = conf.getString("logback.configurationFile");
} else {
String env = conf.hasPath("application.env") ? conf.getString("application.env") : null;
- ImmutableList.Builder files = ImmutableList.builder();
+ List files = new ArrayList<>();
// TODO: sanitization of arguments
File userdir = new File(System.getProperty("user.dir"));
File confdir = new File(userdir, "conf");
@@ -3313,8 +3315,7 @@ static String logback(final Config conf) {
}
files.add(new File(userdir, "logback.xml"));
files.add(new File(confdir, "logback.xml"));
- logback = files.build()
- .stream()
+ logback = files.stream()
.filter(File::exists)
.map(File::getAbsolutePath)
.findFirst()
diff --git a/jooby/src/main/java/org/jooby/MediaType.java b/jooby/src/main/java/org/jooby/MediaType.java
index c23881b73..cebf81130 100644
--- a/jooby/src/main/java/org/jooby/MediaType.java
+++ b/jooby/src/main/java/org/jooby/MediaType.java
@@ -15,7 +15,7 @@
*/
package org.jooby;
-import static com.google.common.base.Preconditions.checkArgument;
+import static org.killbill.commons.utils.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;
import java.io.File;
@@ -28,8 +28,6 @@
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
@@ -79,7 +77,7 @@ public static class Matcher {
* @return True if the matcher matches the given media type.
*/
public boolean matches(final MediaType candidate) {
- return doFirst(ImmutableList.of(candidate)).isPresent();
+ return doFirst(List.of(candidate)).isPresent();
}
/**
@@ -117,7 +115,7 @@ public boolean matches(final List candidates) {
* @return A first most relevant media type or an empty optional.
*/
public Optional first(final MediaType candidate) {
- return first(ImmutableList.of(candidate));
+ return first(List.of(candidate));
}
/**
@@ -160,10 +158,10 @@ public Optional first(final List candidates) {
*/
public List filter(final List types) {
checkArgument(types != null && types.size() > 0, "Media types are required");
- ImmutableList.Builder result = ImmutableList.builder();
+ List result = new ArrayList<>();
final List sortedTypes;
if (types.size() == 1) {
- sortedTypes = ImmutableList.of(types.get(0));
+ sortedTypes = List.of(types.get(0));
} else {
sortedTypes = new ArrayList<>(types);
Collections.sort(sortedTypes);
@@ -175,7 +173,7 @@ public List filter(final List types) {
}
}
}
- return result.build();
+ return Collections.unmodifiableList(result);
}
/**
@@ -202,7 +200,7 @@ private Optional doFirst(final List candidates) {
/**
* Default parameters.
*/
- private static final Map DEFAULT_PARAMS = ImmutableMap.of("q", "1");
+ private static final Map DEFAULT_PARAMS = Map.of("q", "1");
/**
* A JSON media type.
@@ -247,7 +245,7 @@ private Optional doFirst(final List candidates) {
public static final MediaType all = new MediaType("*", "*");
/** Any media type. */
- public static final List ALL = ImmutableList.of(MediaType.all);
+ public static final List ALL = List.of(MediaType.all);
/** Form multipart-data media type. */
public static final MediaType multipart = new MediaType("multipart", "form-data");
@@ -300,15 +298,15 @@ private Optional doFirst(final List candidates) {
private static final ConcurrentHashMap> cache = new ConcurrentHashMap<>();
static {
- cache.put("html", ImmutableList.of(html));
- cache.put("json", ImmutableList.of(json));
- cache.put("css", ImmutableList.of(css));
- cache.put("js", ImmutableList.of(js));
- cache.put("octetstream", ImmutableList.of(octetstream));
- cache.put("form", ImmutableList.of(form));
- cache.put("multipart", ImmutableList.of(multipart));
- cache.put("xml", ImmutableList.of(xml));
- cache.put("plain", ImmutableList.of(plain));
+ cache.put("html", List.of(html));
+ cache.put("json", List.of(json));
+ cache.put("css", List.of(css));
+ cache.put("js", List.of(js));
+ cache.put("octetstream", List.of(octetstream));
+ cache.put("form", List.of(form));
+ cache.put("multipart", List.of(multipart));
+ cache.put("xml", List.of(xml));
+ cache.put("plain", List.of(plain));
cache.put("*", ALL);
}
@@ -326,7 +324,7 @@ private Optional doFirst(final List candidates) {
private MediaType(final String type, final String subtype, final Map parameters) {
this.type = requireNonNull(type, "A mime type is required.");
this.subtype = requireNonNull(subtype, "A mime subtype is required.");
- this.params = ImmutableMap.copyOf(requireNonNull(parameters, "Parameters are required."));
+ this.params = Collections.unmodifiableMap(new LinkedHashMap<>(requireNonNull(parameters, "Parameters are required.")));
this.wildcardType = "*".equals(type);
this.wildcardSubtype = "*".equals(subtype);
this.name = type + "/" + subtype;
@@ -576,7 +574,7 @@ public static List parse(final String value) throws Err.BadMediaType
* @return A media type matcher.
*/
public static Matcher matcher(final MediaType acceptable) {
- return matcher(ImmutableList.of(acceptable));
+ return matcher(List.of(acceptable));
}
/**
diff --git a/jooby/src/main/java/org/jooby/Mutant.java b/jooby/src/main/java/org/jooby/Mutant.java
index b6925c876..6e52dbace 100644
--- a/jooby/src/main/java/org/jooby/Mutant.java
+++ b/jooby/src/main/java/org/jooby/Mutant.java
@@ -21,7 +21,7 @@
import java.util.Set;
import java.util.SortedSet;
-import com.google.common.primitives.Primitives;
+import org.killbill.commons.utils.Primitives;
import com.google.inject.TypeLiteral;
import com.google.inject.util.Types;
diff --git a/jooby/src/main/java/org/jooby/Renderer.java b/jooby/src/main/java/org/jooby/Renderer.java
index bd03c534a..f0e4fe1be 100644
--- a/jooby/src/main/java/org/jooby/Renderer.java
+++ b/jooby/src/main/java/org/jooby/Renderer.java
@@ -25,7 +25,7 @@
import java.util.Map;
import java.util.Set;
-import com.google.common.base.CaseFormat;
+import org.killbill.commons.utils.CaseFormat;
import com.google.inject.Key;
import com.google.inject.TypeLiteral;
diff --git a/jooby/src/main/java/org/jooby/Request.java b/jooby/src/main/java/org/jooby/Request.java
index 470a60001..fce58a662 100644
--- a/jooby/src/main/java/org/jooby/Request.java
+++ b/jooby/src/main/java/org/jooby/Request.java
@@ -15,9 +15,7 @@
*/
package org.jooby;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.net.UrlEscapers;
+import org.killbill.commons.utils.net.UrlEscapers;
import com.google.inject.Key;
import com.google.inject.TypeLiteral;
import static java.util.Objects.requireNonNull;
@@ -27,6 +25,7 @@
import jakarta.annotation.Nullable;
import java.io.IOException;
import java.nio.charset.Charset;
+import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Locale.LanguageRange;
@@ -680,7 +679,7 @@ default boolean is(final List types) {
*/
@Nonnull
default Optional accepts(final MediaType... types) {
- return accepts(ImmutableList.copyOf(types));
+ return accepts(List.of(types));
}
/**
@@ -1310,7 +1309,7 @@ default Request set(final TypeLiteral> type, final Object value) {
*/
@Nonnull
default Request push(final String path) {
- return push(path, ImmutableMap.of());
+ return push(path, Collections.emptyMap());
}
/**
diff --git a/jooby/src/main/java/org/jooby/Response.java b/jooby/src/main/java/org/jooby/Response.java
index fd5203502..f043e77b7 100644
--- a/jooby/src/main/java/org/jooby/Response.java
+++ b/jooby/src/main/java/org/jooby/Response.java
@@ -21,12 +21,11 @@
import java.io.FileInputStream;
import java.io.InputStream;
import java.nio.charset.Charset;
+import java.util.List;
import java.util.Optional;
import org.jooby.Cookie.Definition;
-import com.google.common.collect.ImmutableList;
-
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;
@@ -384,7 +383,7 @@ default Response cookie(final String name, final String value) {
*/
@Nonnull
default Response header(final String name, final Object... values) {
- return header(name, ImmutableList.builder().add(values).build());
+ return header(name, List.of(values));
}
/**
diff --git a/jooby/src/main/java/org/jooby/Result.java b/jooby/src/main/java/org/jooby/Result.java
index 78d229eb3..c632cd711 100644
--- a/jooby/src/main/java/org/jooby/Result.java
+++ b/jooby/src/main/java/org/jooby/Result.java
@@ -17,15 +17,14 @@
import static java.util.Objects.requireNonNull;
+import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Supplier;
-import com.google.common.base.Joiner;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
+import org.killbill.commons.utils.Joiner;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;
@@ -107,7 +106,7 @@ public Optional