Skip to content

Commit

Permalink
Merge pull request #31897 from gsmet/2.16.5-backports-1
Browse files Browse the repository at this point in the history
2.16.5 backports 1
  • Loading branch information
gsmet authored Mar 21, 2023
2 parents 91bb7da + a22f5db commit 34accfc
Show file tree
Hide file tree
Showing 54 changed files with 521 additions and 93 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public interface Capability {
String REST = QUARKUS_PREFIX + "rest";
String REST_CLIENT = REST + ".client";
String REST_CLIENT_REACTIVE = REST_CLIENT + ".reactive";
String REST_CLIENT_REACTIVE_JACKSON = REST_CLIENT_REACTIVE + ".jackson";
String REST_JACKSON = REST + ".jackson";
String REST_JSONB = REST + ".jsonb";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ public void suppressNonRuntimeConfigChanged(
suppressNonRuntimeConfigChanged.produce(new SuppressNonRuntimeConfigChangedWarningBuildItem("quarkus.uuid"));
suppressNonRuntimeConfigChanged.produce(new SuppressNonRuntimeConfigChangedWarningBuildItem("quarkus.default-locale"));
suppressNonRuntimeConfigChanged.produce(new SuppressNonRuntimeConfigChangedWarningBuildItem("quarkus.locales"));
suppressNonRuntimeConfigChanged.produce(new SuppressNonRuntimeConfigChangedWarningBuildItem("quarkus.test.arg-line"));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,20 +512,22 @@ private void processCtorConfigItem(ExecutableElement ctor, Properties javadocPro
final String docComment = getRequiredJavadoc(ctor);
final StringBuilder buf = new StringBuilder();
appendParamTypes(ctor, buf);
javadocProps.put(className + Constants.DOT + buf.toString(), docComment);
javadocProps.put(className + Constants.DOT + buf, docComment);
}

private void processMethodConfigItem(ExecutableElement method, Properties javadocProps, String className) {
final String docComment = getRequiredJavadoc(method);
final StringBuilder buf = new StringBuilder();
buf.append(method.getSimpleName().toString());
appendParamTypes(method, buf);
javadocProps.put(className + Constants.DOT + buf.toString(), docComment);
javadocProps.put(className + Constants.DOT + buf, docComment);
}

private void processMethodConfigMapping(ExecutableElement method, Properties javadocProps, String className) {
final String docComment = getRequiredJavadoc(method);
javadocProps.put(className + Constants.DOT + method.getSimpleName().toString(), docComment);
if (method.getModifiers().contains(Modifier.ABSTRACT)) {
final String docComment = getRequiredJavadoc(method);
javadocProps.put(className + Constants.DOT + method.getSimpleName().toString(), docComment);
}
}

private void processConfigGroup(RoundEnvironment roundEnv, TypeElement annotation) {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/lra.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ quarkus.lra.coordinator-url=http://localhost:8080/lra-coordinator
----

For a Narayana coordinator the path component of the url is normally `lra-coordinator`.
Coordinators can be obtained from `https://hub.docker.com/r/jbosstm/lra-coordinator`
Coordinators can be obtained from https://quay.io/repository/jbosstm/lra-coordinator
or you can build your own coordinator using a maven pom that includes the appropriate
dependencies. A Quarkus quickstart will be provided to show how to do this, or you can
take a look at one of the https://github.com/jbosstm/quickstart/tree/master/rts/lra-examples/lra-coordinator[Narayana quickstarts].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void validateConfigProperties(Set<ConfigValidationMetadata> properties) {
ConfigProducerUtil.getValue(property.getName(), effectivePropertyType, property.getDefaultValue(), config);
} catch (Exception e) {
msg.append("Failed to load config value of type ").append(effectivePropertyType).append(" for: ")
.append(property.getName());
.append(property.getName()).append(System.lineSeparator());
problems.add(property.getName());
suppressed.add(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public static String[] typesNeedingConstructorsRegistered() {
"com.github.benmanes.caffeine.cache.PSMS",
"com.github.benmanes.caffeine.cache.PSW",
"com.github.benmanes.caffeine.cache.PSMW",
"com.github.benmanes.caffeine.cache.PSAMW",
"com.github.benmanes.caffeine.cache.PSAWMW",
"com.github.benmanes.caffeine.cache.PSWMS",
"com.github.benmanes.caffeine.cache.PSWMW",
"com.github.benmanes.caffeine.cache.SILMS",
Expand All @@ -88,6 +90,7 @@ public static String[] typesNeedingConstructorsRegistered() {
"com.github.benmanes.caffeine.cache.SSLMS",
"com.github.benmanes.caffeine.cache.SSMS",
"com.github.benmanes.caffeine.cache.SSMSA",
"com.github.benmanes.caffeine.cache.SSMSAW",
"com.github.benmanes.caffeine.cache.SSMSW",
"com.github.benmanes.caffeine.cache.SSW",
};
Expand All @@ -102,6 +105,7 @@ public static String[] typesNeedingConstructorsRegisteredWhenRecordingStats() {
"com.github.benmanes.caffeine.cache.SSSMS",
"com.github.benmanes.caffeine.cache.SSSMSA",
"com.github.benmanes.caffeine.cache.SSSMSW",
"com.github.benmanes.caffeine.cache.SSSMSAW",
"com.github.benmanes.caffeine.cache.SSSW"
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import io.quarkus.deployment.builditem.nativeimage.NativeImageAllowIncompleteClasspathBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.RuntimeReinitializedClassBuildItem;
import io.quarkus.maven.dependency.ArtifactKey;

/**
Expand Down Expand Up @@ -66,7 +67,8 @@ void build(BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
}

@BuildStep
void runtimeInitializeDriver(BuildProducer<RuntimeInitializedClassBuildItem> runtimeInitialized) {
void runtimeInitializeDriver(BuildProducer<RuntimeInitializedClassBuildItem> runtimeInitialized,
BuildProducer<RuntimeReinitializedClassBuildItem> runtimeReinitialized) {
//These re-implement all the "--initialize-at-build-time" arguments found in the native-image.properties :

// Override: the original metadata marks the drivers as "runtime initialized" but this makes it incompatible with
Expand All @@ -93,10 +95,14 @@ void runtimeInitializeDriver(BuildProducer<RuntimeInitializedClassBuildItem> run
runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.net.nt.TcpMultiplexer"));
runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.net.nt.TcpMultiplexer"));
runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.net.nt.TcpMultiplexer$LazyHolder"));
runtimeInitialized
.produce(new RuntimeInitializedClassBuildItem("oracle.jdbc.driver.BlockSource$ThreadedCachingBlockSource"));
runtimeInitialized.produce(new RuntimeInitializedClassBuildItem(

// Needs to be REinitialized to avoid problems when also using the Elasticsearch Java client
// See https://github.com/quarkusio/quarkus/issues/31624#issuecomment-1457706253
runtimeReinitialized.produce(new RuntimeReinitializedClassBuildItem(
"oracle.jdbc.driver.BlockSource$ThreadedCachingBlockSource"));
runtimeReinitialized.produce(new RuntimeReinitializedClassBuildItem(
"oracle.jdbc.driver.BlockSource$ThreadedCachingBlockSource$BlockReleaser"));

runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.jdbc.xa.client.OracleXADataSource"));
runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.jdbc.replay.OracleXADataSourceImpl"));
runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.jdbc.datasource.OracleXAConnection"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;

/**
* @author Sanne Grinovero <[email protected]>
Expand Down Expand Up @@ -35,10 +34,4 @@ void reflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, "com.sun.jndi.rmi.registry.RegistryContextFactory"));
}

@BuildStep
void runtimeInitialization(BuildProducer<RuntimeInitializedClassBuildItem> runtimeInitializedClass) {
runtimeInitializedClass
.produce(new RuntimeInitializedClassBuildItem("oracle.jdbc.driver.BlockSource$ThreadedCachingBlockSource"));
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
artifact: ${project.groupId}:${project.artifactId}:${project.version}
name: "Reactive Keycloak Admin Client"
metadata:
keywords:
- "keycloak"
- "keycloak-admin-client"
- "admin"
- "openid-connect"
- "reactive"
categories:
- "security"
- "reactive"
status: "stable"
10 changes: 0 additions & 10 deletions extensions/kubernetes-client/deployment-internal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,6 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-devservices-deployment</artifactId>
</dependency>
<dependency>
<groupId>com.dajudge.kindcontainer</groupId>
<artifactId>kindcontainer</artifactId>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<build>
Expand Down
15 changes: 15 additions & 0 deletions extensions/kubernetes-client/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jackson-deployment</artifactId>
</dependency>
<dependency>
<groupId>com.dajudge.kindcontainer</groupId>
<artifactId>kindcontainer</artifactId>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-internal</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package io.quarkus.liquibase;

import java.io.FileNotFoundException;

import liquibase.resource.ResourceAccessor;
import liquibase.resource.ZipPathHandler;

// https://github.com/liquibase/liquibase/issues/3524#issuecomment-1465282155
public class LiquibaseLenientZipPathHandler extends ZipPathHandler {

@Override
public int getPriority(String root) {
if (root != null && root.startsWith("jar:") && root.contains("!/")) {
return PRIORITY_SPECIALIZED;
}
return PRIORITY_NOT_APPLICABLE;
}

@Override
public ResourceAccessor getResourceAccessor(String root) throws FileNotFoundException {
int idx = root.indexOf("!/");
return super.getResourceAccessor(idx > 0 ? root.substring(0, idx) : root);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
io.quarkus.liquibase.LiquibaseLenientZipPathHandler
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ public void beforeParsing(ParserHelper parserHelper) {
@BuildStep
void validateCheckedFragments(List<CheckedFragmentValidationBuildItem> validations,
List<TemplateExpressionMatchesBuildItem> expressionMatches,
List<TemplateGlobalBuildItem> templateGlobals,
BeanArchiveIndexBuildItem beanArchiveIndex,
BuildProducer<ValidationErrorBuildItem> validationErrors) {

Expand All @@ -657,6 +658,8 @@ void validateCheckedFragments(List<CheckedFragmentValidationBuildItem> validatio
Map<DotName, AssignableInfo> assignableCache = new HashMap<>();
String[] hintPrefixes = { LoopSectionHelper.Factory.HINT_PREFIX, WhenSectionHelper.Factory.HINT_PREFIX,
SetSectionHelper.Factory.HINT_PREFIX };
Set<String> globals = templateGlobals.stream().map(TemplateGlobalBuildItem::getName)
.collect(Collectors.toUnmodifiableSet());

for (CheckedFragmentValidationBuildItem validation : validations) {
Map<String, Type> paramNamesToTypes = new HashMap<>();
Expand All @@ -672,33 +675,40 @@ void validateCheckedFragments(List<CheckedFragmentValidationBuildItem> validatio
}

for (Expression expression : validation.fragmentExpressions) {
// Note that we ignore literals and expressions with no type info and expressions with a hint referencing an expression from inside the fragment
if (expression.isLiteral()) {
// Note that we ignore:
// - literals,
// - globals,
// - expressions with no type info,
// - loop metadata; e.g. |java.lang.Integer|<loop-metadata>
// - expressions with a hint referencing an expression from inside the fragment
if (expression.isLiteral() || globals.contains(expression.getParts().get(0).getName())) {
continue;
}
if (expression.hasTypeInfo()) {
Info info = TypeInfos.create(expression, index, null).get(0);
if (info.isTypeInfo()) {
// |org.acme.Foo|.name
paramNamesToTypes.put(expression.getParts().get(0).getName(), info.asTypeInfo().resolvedType);
} else if (info.hasHints()) {
// foo<set#123>.name
hintLoop: for (String helperHint : info.asHintInfo().hints) {
for (String prefix : hintPrefixes) {
if (helperHint.startsWith(prefix)) {
int generatedId = parseHintId(helperHint, prefix);
Expression localExpression = findExpression(generatedId, validation.fragmentExpressions);
if (localExpression == null) {
Match match = matchResults.getMatch(generatedId);
if (match == null) {
throw new IllegalStateException(
"Match result not found for expression [" + expression.toOriginalString()
+ "] in: "
+ validation.templateId);
}
paramNamesToTypes.put(expression.getParts().get(0).getName(), match.type);
break hintLoop;
String typeInfo = expression.getParts().get(0).getTypeInfo();
if (typeInfo == null || (typeInfo != null && typeInfo.endsWith(LoopSectionHelper.Factory.HINT_METADATA))) {
continue;
}
Info info = TypeInfos.create(expression, index, null).get(0);
if (info.isTypeInfo()) {
// |org.acme.Foo|.name
paramNamesToTypes.put(expression.getParts().get(0).getName(), info.asTypeInfo().resolvedType);
} else if (info.hasHints()) {
// foo<set#123>.name
hintLoop: for (String helperHint : info.asHintInfo().hints) {
for (String prefix : hintPrefixes) {
if (helperHint.startsWith(prefix)) {
int generatedId = parseHintId(helperHint, prefix);
Expression localExpression = findExpression(generatedId, validation.fragmentExpressions);
if (localExpression == null) {
Match match = matchResults.getMatch(generatedId);
if (match == null) {
throw new IllegalStateException(
"Match result not found for expression [" + expression.toOriginalString()
+ "] in: "
+ validation.templateId);
}
paramNamesToTypes.put(expression.getParts().get(0).getName(), match.type);
break hintLoop;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.qute.CheckedTemplate;
import io.quarkus.qute.TemplateGlobal;
import io.quarkus.qute.TemplateInstance;
import io.quarkus.test.QuarkusUnitTest;

Expand All @@ -20,21 +21,30 @@ public class CheckedTemplateFragmentTest {
.addClasses(Templates.class, Item.class)
.addAsResource(new StringAsset(
"{#each items}{#fragment id='item'}{it.name}{#if it.name.length > 5} is a long name{/if}{/fragment}{/each}"),
"templates/CheckedTemplateFragmentTest/items.html"));
"templates/CheckedTemplateFragmentTest/items.html")
.addAsResource(new StringAsset(
"{#fragment id=foo}{#for i in bar}{i_count}. <{i}>{#if i_hasNext}, {/if}{/for}{/fragment}"),
"templates/CheckedTemplateFragmentTest/foos.html"));

@Test
public void testFragment() {
assertEquals("Foo", Templates.items(null).getFragment("item").data("it", new Item("Foo")).render());
assertEquals("Foo", Templates.items$item(new Item("Foo")).render());
assertEquals("FooAndBar is a long name", Templates.items$item(new Item("FooAndBar")).render());
assertEquals("1. <1>, 2. <2>, 3. <3>, 4. <4>, 5. <5>", Templates.foos$foo().render());
}

@CheckedTemplate
public static class Templates {

@TemplateGlobal
static int bar = 5;

static native TemplateInstance items(List<Item> items);

static native TemplateInstance items$item(Item it);

static native TemplateInstance foos$foo();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,9 @@ protected String getScoreAsString(double score) {

final List<ScoredValue<V>> decodeAsListOfScoredValues(Response response) {
List<ScoredValue<V>> list = new ArrayList<>();
if (!response.iterator().hasNext()) {
return Collections.emptyList();
}
if (response.iterator().next().type() == ResponseType.BULK) {
// Redis 5
V current = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,12 @@ void zrevrange() {
.isEqualTo(List.of(Place.suze, Place.grignan, Place.crussol));
}

@Test
@RequiresRedis6OrHigher
void zrevrangeWithScoreEmpty() {
assertThat(ds.sortedSet(String.class).zrangeWithScores("top-products", 0, 2, new ZRangeArgs().rev())).isEmpty();
}

@Test
@RequiresRedis6OrHigher
void zrevrangeWithScores() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public class RestClientConfig {
/**
* If set to false disables the keep alive completely.
*/
@ConfigItem(defaultValue = "true")
@ConfigItem
public Optional<Boolean> keepAliveEnabled;

/**
Expand Down
Loading

0 comments on commit 34accfc

Please sign in to comment.