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

1.8.0 backports 2 #11981

Merged
merged 37 commits into from
Sep 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
fc1cfe0
Bump awssdk.version from 2.14.11 to 2.14.12
dependabot[bot] Sep 4, 2020
73f8320
Make sure the application is shutdown properly in the shutdown hook
gastaldi Sep 1, 2020
e2169c9
Do not return false positive on Darwin OS
gastaldi Sep 1, 2020
ee4c30a
Normalize duration default values rendered in documentation
knutwannheden Sep 4, 2020
3b1afa7
Attempt to get around AccessDeniedException in Windows
geoand Sep 5, 2020
9e72049
Make native tests work with random port
geoand Sep 4, 2020
fc682f8
Allow transformed classes to be dumped
stuartwdouglas Sep 7, 2020
7e73e83
Docs - CDI intro - add a note about reading fields on client proxies
mkouba Sep 7, 2020
1713e67
Naryana - make LifecycleManager from SM CP unremovable
mkouba Sep 4, 2020
6f55f3b
Convert the JPA PostgreSQL test case to Quarkus config
gsmet Sep 4, 2020
9f5e398
Support the ability to create the schemas on database schema generation
gsmet Sep 4, 2020
a293f7a
Deprecate containers config in favor of sidecars for OpenshiftConfig
geoand Sep 4, 2020
acce665
Prevent K8S env vars from leaking into sidecar
geoand Sep 4, 2020
6781fb4
Fix incorrect ImagePullPolicy forced setting
geoand Sep 7, 2020
f0dafb1
Make name of Revapi artifact consistent
gsmet Sep 7, 2020
6d61852
If parent first fails see if the resource exists in this CL
stuartwdouglas Sep 7, 2020
f73f14e
Update grpc-getting-started.adoc
ghokun Sep 5, 2020
3f9aa4c
Update grpc-getting-started.adoc
ghokun Sep 7, 2020
b5db4af
Bump assertj-core from 3.17.1 to 3.17.2 in /integration-tests/gradle
dependabot[bot] Sep 7, 2020
db3c53f
Bump assertj-core from 3.17.1 to 3.17.2 in /devtools/gradle
dependabot[bot] Sep 7, 2020
7dc1c69
Bump assertj-core from 3.17.1 to 3.17.2
dependabot[bot] Sep 7, 2020
9cb72f1
Fix jbang ClassLoader issue
stuartwdouglas Sep 7, 2020
35c73aa
Update to xstream 1.4.13 to reduce illegal reflective access warnings
famod Sep 7, 2020
ac7d1c6
issue#11839 Increase connection and read timeouts in IncompletePostTe…
jaikiran Sep 8, 2020
61fd043
Fix formatting in BOM for Micrometer artifacts
gsmet Sep 7, 2020
e1fa5e4
Support DB2 in Quartz processor
gsmet Sep 8, 2020
275d685
Adjust extension point configuration for more consistency
gsmet Sep 8, 2020
bf8e5af
Make the instance name configurable
gsmet Sep 8, 2020
a4633bd
Config documentation: maps should be optional too
gsmet Sep 8, 2020
92f16b2
Fix typo in warn message
fstab Sep 8, 2020
bec9c50
Make store dir relative to build dir when saving OpenAPI schema
phillip-kruger Sep 4, 2020
e627dbb
Documentation adjustments for multiple persistence units support
gsmet Sep 7, 2020
0aaef2c
Fix a few loose ends in the multitenancy + multi PUs code path
gsmet Sep 7, 2020
18e9771
Throw an error if @PersistenceUnit is put on model classes
gsmet Sep 7, 2020
26a2be1
Make the multitenancy beans unremovable
gsmet Sep 8, 2020
339b985
Upgrade Debezium to 1.2.3.Final
gsmet Sep 8, 2020
8add702
Fix elasticsearch extension file directory
loicmathieu Sep 8, 2020
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
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ updates:
- dependency-name: com.amazon.alexa:ask-sdk-apache-client
# Apache Commons
- dependency-name: commons-io:commons-io
- dependency-name: com.thoughtworks.xstream:xstream
rebase-strategy: disabled
- package-ecosystem: gradle
directory: "/integration-tests/gradle"
Expand Down
76 changes: 38 additions & 38 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<rest-assured.version>4.3.0</rest-assured.version>
<junit.jupiter.version>5.6.2</junit.jupiter.version>
<testng.version>6.14.2</testng.version>
<assertj.version>3.17.1</assertj.version>
<assertj.version>3.17.2</assertj.version>
<json-smart.version>2.3</json-smart.version>
<infinispan.version>11.0.3.Final</infinispan.version>
<infinispan.protostream.version>4.3.3.Final</infinispan.protostream.version>
Expand All @@ -144,7 +144,7 @@
<aws-lambda-java-events.version>3.2.0</aws-lambda-java-events.version>
<aws-lambda-serverless-java-container.version>1.3.1</aws-lambda-serverless-java-container.version>
<aws-xray.version>2.4.0</aws-xray.version>
<awssdk.version>2.14.11</awssdk.version>
<awssdk.version>2.14.12</awssdk.version>
<aws-alexa-sdk.version>2.33.0</aws-alexa-sdk.version>
<azure-functions-java-library.version>1.3.0</azure-functions-java-library.version>
<kotlin.version>1.3.72</kotlin.version>
Expand Down Expand Up @@ -4411,52 +4411,52 @@

<!-- Micrometer -->
<dependency>
<groupId>org.threeten</groupId>
<artifactId>threetenbp</artifactId>
<version>${threetenbp.version}</version>
<groupId>org.threeten</groupId>
<artifactId>threetenbp</artifactId>
<version>${threetenbp.version}</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId>
<version>${micrometer.version}</version>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId>
<version>${micrometer.version}</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-datadog</artifactId>
<version>${micrometer.version}</version>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-datadog</artifactId>
<version>${micrometer.version}</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-jmx</artifactId>
<version>${micrometer.version}</version>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-jmx</artifactId>
<version>${micrometer.version}</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<version>${micrometer.version}</version>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<version>${micrometer.version}</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-stackdriver</artifactId>
<version>${micrometer.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
<exclusion>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.j2objc</groupId>
<artifactId>j2objc-annotations</artifactId>
</exclusion>
</exclusions>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-stackdriver</artifactId>
<version>${micrometer.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
<exclusion>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.j2objc</groupId>
<artifactId>j2objc-annotations</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- Picocli -->
Expand Down
2 changes: 1 addition & 1 deletion bom/test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<description>Dependency management for integration tests. Importable by third party extension developers.</description>

<properties>
<debezium.version>1.2.2.Final</debezium.version>
<debezium.version>1.2.3.Final</debezium.version>
<testcontainers.version>1.14.3</testcontainers.version>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ public static void extractDevModeClasses(Path appRoot, AppModel appModel, PostEx
//not all local projects are dependencies
continue;
}
IoUtils.recursiveDelete(moduleClasses);
Files.createDirectories(moduleClasses);
IoUtils.recursiveDeleteAndThenCreate(moduleClasses);
for (Path p : dep.getPaths()) {
if (Files.isDirectory(p)) {
Path moduleTarget = moduleClasses;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ public class AppCDSBuildStep {
public void requested(OutputTargetBuildItem outputTarget, BuildProducer<AppCDSRequestedBuildItem> producer)
throws IOException {
Path appCDSDir = outputTarget.getOutputDirectory().resolve("appcds");
IoUtils.recursiveDelete(appCDSDir);
Files.createDirectories(appCDSDir);
IoUtils.recursiveDeleteAndThenCreate(appCDSDir);

producer.produce(new AppCDSRequestedBuildItem(outputTarget.getOutputDirectory().resolve("appcds")));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,7 @@ private JarBuildItem buildLegacyThinJar(CurateOutcomeBuildItem curateOutcomeBuil
.resolve(outputTargetBuildItem.getBaseName() + packageConfig.runnerSuffix + ".jar");
Path libDir = outputTargetBuildItem.getOutputDirectory().resolve("lib");
Files.deleteIfExists(runnerJar);
IoUtils.recursiveDelete(libDir);
Files.createDirectories(libDir);
IoUtils.recursiveDeleteAndThenCreate(libDir);

try (FileSystem runnerZipFs = ZipUtils.newZip(runnerJar)) {

Expand Down Expand Up @@ -464,8 +463,7 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem,
userProviders = buildDir.resolve(packageConfig.userProvidersDirectory.get());
}
if (!rebuild) {
IoUtils.recursiveDelete(buildDir);
Files.createDirectories(buildDir);
IoUtils.recursiveDeleteAndThenCreate(buildDir);
Files.createDirectories(mainLib);
Files.createDirectories(baseLib);
Files.createDirectories(appDir);
Expand All @@ -477,8 +475,7 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem,
Files.createFile(userProviders.resolve(".keep"));
}
} else {
IoUtils.recursiveDelete(quarkus);
Files.createDirectories(quarkus);
IoUtils.recursiveDeleteAndThenCreate(quarkus);
}
Map<AppArtifactKey, List<Path>> copiedArtifacts = new HashMap<>();

Expand Down Expand Up @@ -712,8 +709,7 @@ public NativeImageSourceJarBuildItem buildNativeImageJar(CurateOutcomeBuildItem
List<UberJarRequiredBuildItem> uberJarRequired) throws Exception {
Path targetDirectory = outputTargetBuildItem.getOutputDirectory()
.resolve(outputTargetBuildItem.getBaseName() + "-native-image-source-jar");
IoUtils.recursiveDelete(targetDirectory);
Files.createDirectories(targetDirectory);
IoUtils.recursiveDeleteAndThenCreate(targetDirectory);

List<GeneratedClassBuildItem> allClasses = new ArrayList<>(generatedClasses);
allClasses.addAll(nativeImageResources.stream()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.quarkus.deployment.steps;

import java.io.File;
import java.io.FileOutputStream;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
Expand All @@ -22,6 +24,7 @@
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;

import io.quarkus.bootstrap.BootstrapDebug;
import io.quarkus.bootstrap.classloading.ClassPathElement;
import io.quarkus.bootstrap.classloading.QuarkusClassLoader;
import io.quarkus.deployment.QuarkusClassWriter;
Expand Down Expand Up @@ -77,7 +80,7 @@ TransformedClassesBuildItem handleClassTransformation(List<BytecodeTransformerBu
ClassPathElement classPathElement = archives.get(0);
Path jar = classPathElement.getRoot();
if (jar == null) {
log.warnf("Cannot transform %s as it's containing application archive could not be found.",
log.warnf("Cannot transform %s as its containing application archive could not be found.",
entry.getKey());
continue;
}
Expand All @@ -104,15 +107,30 @@ public TransformedClassesBuildItem.TransformedClass call() throws Exception {
visitor = i.apply(className, visitor);
}
cr.accept(visitor, 0);
return new TransformedClassesBuildItem.TransformedClass(className, writer.toByteArray(),
byte[] data = writer.toByteArray();
if (BootstrapDebug.DEBUG_TRANSFORMED_CLASSES_DIR != null) {
File debugPath = new File(BootstrapDebug.DEBUG_TRANSFORMED_CLASSES_DIR);
if (!debugPath.exists()) {
debugPath.mkdir();
}
File classFile = new File(debugPath, className.replace(".", "/") + ".class");
classFile.getParentFile().mkdirs();
try (FileOutputStream classWriter = new FileOutputStream(classFile)) {
classWriter.write(data);
} catch (Exception e) {
log.errorf(e, "Failed to write transformed class %s", className);
}
log.infof("Wrote transformed class to %s", classFile.getAbsolutePath());
}
return new TransformedClassesBuildItem.TransformedClass(className, data,
classFileName, eager.contains(className));
} finally {
Thread.currentThread().setContextClassLoader(old);
}
}
}));
} else {
log.warnf("Cannot transform %s as it's containing application archive could not be found.",
log.warnf("Cannot transform %s as its containing application archive could not be found.",
entry.getKey());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public Class<?> loadClass(String name) throws ClassNotFoundException {

@Override
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
if (name.startsWith("org.")) {
if (name.startsWith("org.") && !(name.startsWith("org.xml.") || name.startsWith("org.w3c."))) {
//jbang has some but not all of the maven resolver classes we need on its
//class path. These all start with org. so we filter them out to make sure
//we get a complete class path
Expand All @@ -51,7 +51,7 @@ protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundE

@Override
public URL getResource(String name) {
if (name.startsWith("org/")) {
if (name.startsWith("org/") && !(name.startsWith("org/xml/") || name.startsWith("org/w3c/"))) {
//jbang has some but not all of the maven resolver classes we need on its
//class path. These all start with org. so we filter them out to make sure
//we get a complete class path
Expand All @@ -62,7 +62,7 @@ public URL getResource(String name) {

@Override
public Enumeration<URL> getResources(String name) throws IOException {
if (name.startsWith("org/")) {
if (name.startsWith("org/") && !(name.startsWith("org/xml/") || name.startsWith("org/w3c/"))) {
//jbang has some but not all of the maven resolver classes we need on its
//class path. These all start with org. so we filter them out to make sure
//we get a complete class path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.io.IOException;
import java.nio.file.Path;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
Expand Down Expand Up @@ -216,7 +217,8 @@ private List<ConfigDocItem> recursivelyFindConfigItems(Element element, String r
DeclaredType declaredType = (DeclaredType) typeMirror;
TypeElement typeElement = (TypeElement) declaredType.asElement();
Name qualifiedName = typeElement.getQualifiedName();
optional = qualifiedName.toString().startsWith(Optional.class.getName());
optional = qualifiedName.toString().startsWith(Optional.class.getName())
|| qualifiedName.contentEquals(Map.class.getName());
list = qualifiedName.contentEquals(List.class.getName())
|| qualifiedName.contentEquals(Set.class.getName());

Expand Down Expand Up @@ -286,6 +288,8 @@ private List<ConfigDocItem> recursivelyFindConfigItems(Element element, String r
defaultValue = hyphenateEnumValue(defaultValue);
}
acceptedValues = extractEnumValues(declaredType, useHyphenateEnumValue);
} else if (isDurationType(declaredType) && !defaultValue.isEmpty()) {
defaultValue = DocGeneratorUtil.normalizeDurationValue(defaultValue);
}
}
}
Expand Down Expand Up @@ -360,6 +364,10 @@ private boolean isEnumType(TypeMirror realTypeMirror) {
&& ((DeclaredType) realTypeMirror).asElement().getKind() == ElementKind.ENUM;
}

private boolean isDurationType(TypeMirror realTypeMirror) {
return realTypeMirror.toString().equals(Duration.class.getName());
}

/**
* Scan or parse configuration items of a given configuration group.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,17 @@ static String hyphenateEnumValue(String orig) {
return target.toString();
}

static String normalizeDurationValue(String value) {
if (!value.isEmpty() && Character.isDigit(value.charAt(value.length() - 1))) {
try {
value = Integer.parseInt(value) + "S";
} catch (NumberFormatException ignore) {
}
}
value = value.toUpperCase(Locale.ROOT);
return value;
}

static String joinAcceptedValues(List<String> acceptedValues) {
if (acceptedValues == null || acceptedValues.isEmpty()) {
return "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import static io.quarkus.annotation.processor.generate_doc.DocGeneratorUtil.computeExtensionDocFileName;
import static io.quarkus.annotation.processor.generate_doc.DocGeneratorUtil.deriveConfigRootName;
import static io.quarkus.annotation.processor.generate_doc.DocGeneratorUtil.getJavaDocSiteLink;
import static io.quarkus.annotation.processor.generate_doc.DocGeneratorUtil.normalizeDurationValue;
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.math.BigInteger;
Expand Down Expand Up @@ -354,4 +355,16 @@ public void derivingConfigRootNameTestCase() {
actual = deriveConfigRootName(simpleClassName, ConfigPhase.BUILD_TIME);
assertEquals("quarkus.root-name", actual);
}

@Test
public void normalizeDurationValueTest() {
assertEquals("", normalizeDurationValue(""));
assertEquals("1S", normalizeDurationValue("1"));
assertEquals("1S", normalizeDurationValue("1S"));
assertEquals("1S", normalizeDurationValue("1s"));

// values are not validated here
assertEquals("1_000", normalizeDurationValue("1_000"));
assertEquals("FOO", normalizeDurationValue("foo"));
}
}
19 changes: 9 additions & 10 deletions core/runtime/src/main/java/io/quarkus/runtime/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,16 +228,15 @@ public void awaitShutdown() {
stateLock.lock();
try {
for (;;) {
switch (state) {
case ST_STOPPED:
return; // all good
default:
try {
stateCond.await();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw interruptedOnAwaitStop();
}
if (state == ST_STOPPED) {
return; // all good
} else {
try {
stateCond.await();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw interruptedOnAwaitStop();
}
}
}
} finally {
Expand Down
Loading