Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6af6176
update oss-parent version to use latest snapshot
xsalefter May 26, 2026
340d120
add dependency to killbill-utils
xsalefter May 26, 2026
82a8391
initial commit for Closeables.java
xsalefter May 26, 2026
d932e13
add jakarta.annotation-api dependency
xsalefter May 26, 2026
aaf40ad
replace guava classes with JDK API
xsalefter May 26, 2026
098c9ee
add jakarta.annotation-api and remove remove com.google.code.findbugs
xsalefter May 27, 2026
50a8d2c
move from javax.annotation to jakarta.annotation
xsalefter May 27, 2026
21aa3a8
override @toString() and update docs
xsalefter May 27, 2026
c75b2ee
replace guava classes with killbill-utils
xsalefter May 27, 2026
0464c1d
add new method: padStart() and padEnd()
xsalefter May 27, 2026
90de41a
add new method: join(Object[])
xsalefter May 27, 2026
12e82f1
exclude Subscriber, SubscriberRegistry and AbstractInvocationHandler
xsalefter May 27, 2026
5b7c127
add port more guava classes and methods to killbill-utils
xsalefter May 28, 2026
38ae425
replace guava classes with new killbill-utils classes from previous c…
xsalefter May 28, 2026
5f31230
jooby SseRenderer use killbill-utils' (modified) ByteSource instead o…
xsalefter May 30, 2026
f7c6e5b
add CharMatcher#anyOf() and its implementation
xsalefter May 30, 2026
8e40e4c
port (sub-set) of Guava's Splitter and apply to various jobby classes
xsalefter May 30, 2026
80d97da
port (sub-set) various Guava's Escapers and apply to various jobby cl…
xsalefter May 30, 2026
8bcdecb
update Cache javadocs to more loose and leave behaviors to implementa…
xsalefter Jun 2, 2026
147eeb7
initial commit for CacheBuilder and ConcurrentCache
xsalefter Jun 2, 2026
f793136
remove guava dependency
xsalefter Jun 2, 2026
cf37ae1
replace guava cache classes with killbill-utils new cache classes
xsalefter Jun 2, 2026
82c5e10
run loader outside ConcurrentHashMap lock via in-flight future map
xsalefter Jun 3, 2026
0bcf7aa
add CaffeineCache and use it as default implementation in CacheBuilder
xsalefter Jun 5, 2026
df3bd63
delete ConcurrentCache.java and deprecating DefaultCache
xsalefter Jun 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions automaton/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
<check.spotbugs-exclude-filter-file>spotbugs-exclude.xml</check.spotbugs-exclude-filter-file>
</properties>
<dependencies>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</dependency>
<dependency>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions concurrent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
<artifactId>reload4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import java.util.List;
import java.util.stream.Collectors;

import javax.annotation.Nullable;
import jakarta.annotation.Nullable;

public class ProfilingData {

Expand Down
8 changes: 4 additions & 4 deletions embeddeddb/postgresql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
<artifactId>killbill-embeddeddb-postgresql</artifactId>
<name>Kill Bill library of embedded dbs: PostgreSQL</name>
<dependencies>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</dependency>
<dependency>
<groupId>io.airlift</groupId>
<artifactId>command</artifactId>
Expand All @@ -47,6 +43,10 @@
<artifactId>embedded-postgres</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</dependency>
<dependency>
<groupId>org.kill-bill.commons</groupId>
<artifactId>killbill-embeddeddb-common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions jdbi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@
<groupId>com.fasterxml</groupId>
<artifactId>classmate</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
Expand All @@ -58,6 +54,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions jooby/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe</groupId>
<artifactId>config</artifactId>
Expand Down Expand Up @@ -177,6 +173,10 @@
<version>4.5.14</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.kill-bill.commons</groupId>
<artifactId>killbill-utils</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
10 changes: 5 additions & 5 deletions jooby/src/main/java/org/jooby/Asset.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
11 changes: 3 additions & 8 deletions jooby/src/main/java/org/jooby/Cookie.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

/**
Expand Down Expand Up @@ -417,9 +415,6 @@ public Optional<Integer> maxAge() {
*/
public class Signature {

/** Remove trailing '='. */
private static final Pattern EQ = Pattern.compile("=+$");

/** Algorithm name. */
public static final String HMAC_SHA256 = "HmacSHA256";

Expand Down Expand Up @@ -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);
}
Expand Down
17 changes: 9 additions & 8 deletions jooby/src/main/java/org/jooby/Env.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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<Throwing.Consumer<Registry>> start = ImmutableList.builder();
private List<Throwing.Consumer<Registry>> start = new ArrayList<>();

private ImmutableList.Builder<Throwing.Consumer<Registry>> started = ImmutableList.builder();
private List<Throwing.Consumer<Registry>> started = new ArrayList<>();

private ImmutableList.Builder<Throwing.Consumer<Registry>> shutdown = ImmutableList.builder();
private List<Throwing.Consumer<Registry>> shutdown = new ArrayList<>();

private Map<String, Function<String, String>> xss = new HashMap<>();

Expand Down Expand Up @@ -393,7 +394,7 @@ public String toString() {

@Override
public List<Throwing.Consumer<Registry>> stopTasks() {
return shutdown.build();
return Collections.unmodifiableList(shutdown);
}

@Override
Expand All @@ -416,12 +417,12 @@ public LifeCycle onStarted(final Throwing.Consumer<Registry> task) {

@Override
public List<Throwing.Consumer<Registry>> startTasks() {
return this.start.build();
return Collections.unmodifiableList(this.start);
}

@Override
public List<Throwing.Consumer<Registry>> startedTasks() {
return this.started.build();
return Collections.unmodifiableList(this.started);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion jooby/src/main/java/org/jooby/Err.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
43 changes: 22 additions & 21 deletions jooby/src/main/java/org/jooby/Jooby.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -513,7 +511,7 @@ static class MvcClass implements Route.Props<MvcClass> {

String path;

ImmutableMap.Builder<String, Object> attrs = ImmutableMap.builder();
Map<String, Object> attrs = new LinkedHashMap<>();

private List<MediaType> consumes;

Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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. */
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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<Config> reversedModules = new ArrayList<>(modules);
Collections.reverse(reversedModules);
for (Config module : reversedModules) {
moduleStack = moduleStack.withFallback(module);
}

Expand Down Expand Up @@ -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"));
}
Expand Down Expand Up @@ -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<File> files = ImmutableList.builder();
List<File> files = new ArrayList<>();
// TODO: sanitization of arguments
File userdir = new File(System.getProperty("user.dir"));
File confdir = new File(userdir, "conf");
Expand All @@ -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()
Expand Down
Loading
Loading