Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.7.1 backports 1 #38413

Merged
merged 15 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<extension>
<groupId>com.gradle</groupId>
<artifactId>gradle-enterprise-maven-extension</artifactId>
<version>1.18.1</version>
<version>1.20</version>
</extension>
<extension>
<groupId>com.gradle</groupId>
<artifactId>common-custom-user-data-maven-extension</artifactId>
<version>1.12.2</version>
<version>1.12.5</version>
</extension>
</extensions>
2 changes: 1 addition & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<hibernate-orm.version>6.4.2.Final</hibernate-orm.version>
<bytebuddy.version>1.14.7</bytebuddy.version> <!-- Version controlled by Hibernate ORM's needs -->
<hibernate-commons-annotations.version>6.0.6.Final</hibernate-commons-annotations.version> <!-- version controlled by Hibernate ORM -->
<hibernate-reactive.version>2.2.1.Final</hibernate-reactive.version>
<hibernate-reactive.version>2.2.2.Final</hibernate-reactive.version>
<hibernate-validator.version>8.0.1.Final</hibernate-validator.version>
<!-- When updating, align hibernate-search.version-for-documentation in docs/pom.xml -->
<hibernate-search.version>7.0.0.Final</hibernate-search.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.Map;
import java.util.regex.Pattern;

import io.quarkus.bootstrap.util.PropertyUtils;
import io.quarkus.deployment.configuration.BuildTimeConfigurationReader;
import io.quarkus.runtime.LaunchMode;

Expand Down Expand Up @@ -107,108 +108,6 @@ public static void write(Map<String, String> readOptions, ConfigTrackingConfig c
* @throws IOException in case of a failure
*/
public static void write(Writer writer, String name, String value) throws IOException {
if (value != null) {
name = toWritableValue(name, true, true);
value = toWritableValue(value, false, true);
writer.write(name);
writer.write("=");
writer.write(value);
writer.write(System.lineSeparator());
}
}

/*
* Converts unicodes to encoded &#92;uxxxx and escapes
* special characters with a preceding slash
*/

/**
* Escapes characters that are expected to be escaped when {@link java.util.Properties} load
* files from disk.
*
* @param str property name or value
* @param escapeSpace whether to escape a whitespace (should be true for property names)
* @param escapeUnicode whether to converts unicodes to encoded &#92;uxxxx
* @return property name or value that can be written to a file
*/
private static String toWritableValue(String str, boolean escapeSpace, boolean escapeUnicode) {
int len = str.length();
int bufLen = len * 2;
if (bufLen < 0) {
bufLen = Integer.MAX_VALUE;
}
StringBuilder outBuffer = new StringBuilder(bufLen);

for (int x = 0; x < len; x++) {
char aChar = str.charAt(x);
// Handle common case first, selecting largest block that
// avoids the specials below
if ((aChar > 61) && (aChar < 127)) {
if (aChar == '\\') {
outBuffer.append('\\');
outBuffer.append('\\');
continue;
}
outBuffer.append(aChar);
continue;
}
switch (aChar) {
case ' ':
if (x == 0 || escapeSpace) {
outBuffer.append('\\');
}
outBuffer.append(' ');
break;
case '\t':
outBuffer.append('\\');
outBuffer.append('t');
break;
case '\n':
outBuffer.append('\\');
outBuffer.append('n');
break;
case '\r':
outBuffer.append('\\');
outBuffer.append('r');
break;
case '\f':
outBuffer.append('\\');
outBuffer.append('f');
break;
case '=': // Fall through
case ':': // Fall through
case '#': // Fall through
case '!':
outBuffer.append('\\');
outBuffer.append(aChar);
break;
default:
if (((aChar < 0x0020) || (aChar > 0x007e)) & escapeUnicode) {
outBuffer.append('\\');
outBuffer.append('u');
outBuffer.append(toHex((aChar >> 12) & 0xF));
outBuffer.append(toHex((aChar >> 8) & 0xF));
outBuffer.append(toHex((aChar >> 4) & 0xF));
outBuffer.append(toHex(aChar & 0xF));
} else {
outBuffer.append(aChar);
}
}
}
return outBuffer.toString();
}

/**
* Convert a nibble to a hex character
*
* @param nibble the nibble to convert.
*/
private static char toHex(int nibble) {
return hexDigit[(nibble & 0xF)];
PropertyUtils.store(writer, name, value);
}

/** A table of hex digits */
private static final char[] hexDigit = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};
}
10 changes: 10 additions & 0 deletions core/processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bootstrap-app-model</artifactId>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- Test -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
import io.quarkus.annotation.processor.generate_doc.ConfigDocItemScanner;
import io.quarkus.annotation.processor.generate_doc.ConfigDocWriter;
import io.quarkus.annotation.processor.generate_doc.DocGeneratorUtil;
import io.quarkus.bootstrap.util.PropertyUtils;

public class ExtensionAnnotationProcessor extends AbstractProcessor {

Expand Down Expand Up @@ -239,23 +240,23 @@ public FileVisitResult postVisitDirectory(final Path dir, final IOException exc)
}
}

try {

final FileObject listResource = filer.createResource(StandardLocation.CLASS_OUTPUT, "",
"META-INF/quarkus-javadoc.properties");
try (OutputStream os = listResource.openOutputStream()) {
try (BufferedOutputStream bos = new BufferedOutputStream(os)) {
try (OutputStreamWriter osw = new OutputStreamWriter(bos, StandardCharsets.UTF_8)) {
try (BufferedWriter bw = new BufferedWriter(osw)) {
javaDocProperties.store(bw, Constants.EMPTY);
if (!javaDocProperties.isEmpty()) {
try {
final FileObject listResource = filer.createResource(StandardLocation.CLASS_OUTPUT, "",
"META-INF/quarkus-javadoc.properties");
try (OutputStream os = listResource.openOutputStream()) {
try (BufferedOutputStream bos = new BufferedOutputStream(os)) {
try (OutputStreamWriter osw = new OutputStreamWriter(bos, StandardCharsets.UTF_8)) {
try (BufferedWriter bw = new BufferedWriter(osw)) {
PropertyUtils.store(javaDocProperties, bw);
}
}
}
}
} catch (IOException e) {
processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "Failed to write javadoc properties: " + e);
return;
}

} catch (IOException e) {
processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "Failed to write javadoc properties: " + e);
return;
}

try {
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/getting-started-testing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -640,14 +640,14 @@ public class Profiles {
public static class SingleTag implements QuarkusTestProfile {
@Override
public Set<String> tags() {
return Collections.singleton("test1");
return List.of("test1");
}
}

public static class MultipleTags implements QuarkusTestProfile {
@Override
public Set<String> tags() {
return new HashSet<>(Arrays.asList("test1", "test2"));
return Set.of("test1", "test2");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import io.quarkus.deployment.builditem.RemovedResourceBuildItem;
import io.quarkus.deployment.builditem.SslNativeConfigBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.pkg.builditem.CurateOutcomeBuildItem;
import io.quarkus.maven.dependency.ArtifactKey;
Expand Down Expand Up @@ -408,4 +409,16 @@ void adaptOpenTelemetryJdbcInstrumentationForNative(BuildProducer<RemovedResourc
Set.of("io/opentelemetry/instrumentation.jdbc/internal/JdbcSingletons")));
}
}

@BuildStep
void registerRowSetSupport(
BuildProducer<NativeImageResourceBundleBuildItem> resourceBundleProducer,
BuildProducer<NativeImageResourceBuildItem> nativeResourceProducer,
BuildProducer<ReflectiveClassBuildItem> reflectiveClassProducer) {
resourceBundleProducer.produce(new NativeImageResourceBundleBuildItem("com.sun.rowset.RowSetResourceBundle"));
nativeResourceProducer.produce(new NativeImageResourceBuildItem("javax/sql/rowset/rowset.properties"));
reflectiveClassProducer.produce(ReflectiveClassBuildItem.builder(
"com.sun.rowset.providers.RIOptimisticProvider",
"com.sun.rowset.providers.RIXMLProvider").build());
}
}
10 changes: 10 additions & 0 deletions extensions/csrf-reactive/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-vertx-http-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-internal</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Loading
Loading