anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: quarkusio/quarkus
Issue: Vert.x also provides a JSON implementation so no warning should be emitted

Since https://github.com/quarkusio/quarkus/pull/4165 , we emit a warning if our REST services produce JSON and we don't have any of the RESTEasy JSON extensions:

> [WARNING] [io.quarkus.resteasy.common.deployment.ResteasyCommonProcessor] Quarkus detected the need of REST JSON support but you have not provided the necessary JSON extension for this. You can visit https://quarkus.io/guides/rest-json for more information on how to set one.

Problem is: Vert.x also has the ability to serialize JSON via the Vert.x JSON types.

I think we should drop the warning also when we have the full Vert.x extension around.

See the Reactive MySQL client IT for an example of this issue.

Changed files:
extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/VertxProcessor.java

diff --git a/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/VertxProcessor.java b/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/VertxProcessor.java
index 70693f29b20..da8826b1c28 100644
--- a/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/VertxProcessor.java
+++ b/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/VertxProcessor.java
@@ -25,6 +25,7 @@
 import io.quarkus.arc.processor.AnnotationsTransformer;
 import io.quarkus.arc.processor.BeanInfo;
 import io.quarkus.arc.processor.BuildExtension;
+import io.quarkus.deployment.Capabilities;
 import io.quarkus.deployment.GizmoAdaptor;
 import io.quarkus.deployment.annotations.BuildProducer;
 import io.quarkus.deployment.annotations.BuildStep;
@@ -51,6 +52,11 @@ class VertxProcessor {
     @Inject
     BuildProducer<ReflectiveClassBuildItem> reflectiveClass;
 
+    @BuildStep(providesCapabilities = Capabilities.RESTEASY_JSON_EXTENSION)
+    FeatureBuildItem feature() {
+        return new FeatureBuildItem(FeatureBuildItem.VERTX);
+    }
+
     @BuildStep
     AdditionalBeanBuildItem registerBean() {
         return AdditionalBeanBuildItem.unremovableOf(VertxProducer.class);
@@ -59,13 +65,11 @@ AdditionalBeanBuildItem registerBean() {
     @BuildStep
     @Record(ExecutionTime.RUNTIME_INIT)
     VertxBuildItem build(CoreVertxBuildItem internalVertx, VertxRecorder recorder, BeanContainerBuildItem beanContainer,
-            BuildProducer<FeatureBuildItem> feature,
             List<EventConsumerBusinessMethodItem> messageConsumerBusinessMethods,
             BuildProducer<GeneratedClassBuildItem> generatedClass,
             AnnotationProxyBuildItem annotationProxy, LaunchModeBuildItem launchMode, ShutdownContextBuildItem shutdown,
             BuildProducer<ServiceStartBuildItem> serviceStart,
             List<MessageCodecBuildItem> codecs, RecorderContext recorderContext) {
-        feature.produce(new FeatureBuildItem(FeatureBuildItem.VERTX));
         Map<String, ConsumeEvent> messageConsumerConfigurations = new HashMap<>();
         ClassOutput classOutput = new GizmoAdaptor(generatedClass, true);
         for (EventConsumerBusinessMethodItem businessMethod : messageConsumerBusinessMethods) {
Repository: quarkusio/quarkus
Issue: SchedulerProcessor method collectScheduledMethods recursion check

**Describe the bug**

```
        DotName superClassName = beanClass.superName();
        if (superClassName != null) {
            ClassInfo superClass = index.getClassByName(superClassName);
            if (superClassName != null) {
                collectScheduledMethods(config, index, annotationStore, bean, superClass, scheduledBusinessMethods,
                        validationContext);
            }
        }
```

https://github.com/quarkusio/quarkus/blob/801dcb28295721fd65f9d30d1f0ad340dd6b5dd7/extensions/scheduler/deployment/src/main/java/io/quarkus/scheduler/deployment/SchedulerProcessor.java#L191

**Expected behavior**
```
            ClassInfo superClass = index.getClassByName(superClassName);
            if (superClass != null) {
                collectScheduledMethods(config, index, annotationStore, bean, superClass, scheduledBusinessMethods,
                        validationContext);
            }
```

**Actual behavior**
NPE



Changed files:
extensions/scheduler/deployment/src/main/java/io/quarkus/scheduler/deployment/SchedulerProcessor.java

diff --git a/extensions/scheduler/deployment/src/main/java/io/quarkus/scheduler/deployment/SchedulerProcessor.java b/extensions/scheduler/deployment/src/main/java/io/quarkus/scheduler/deployment/SchedulerProcessor.java
index b0bbb7efc4c..6b8c3fd30d6 100644
--- a/extensions/scheduler/deployment/src/main/java/io/quarkus/scheduler/deployment/SchedulerProcessor.java
+++ b/extensions/scheduler/deployment/src/main/java/io/quarkus/scheduler/deployment/SchedulerProcessor.java
@@ -188,7 +188,7 @@ private void collectScheduledMethods(SchedulerConfig config, IndexView index, An
         DotName superClassName = beanClass.superName();
         if (superClassName != null) {
             ClassInfo superClass = index.getClassByName(superClassName);
-            if (superClassName != null) {
+            if (superClass != null) {
                 collectScheduledMethods(config, index, annotationStore, bean, superClass, scheduledBusinessMethods,
                         validationContext);
             }
Repository: quarkusio/quarkus
Issue: Jandex WARNING using standard JAX-RS classes

**Describe the bug**
This is not a real bug but an annoying WARNING if you use classes like javax.ws.rs.core.StreamingOutput:

```
    @GET
    @Path("other")
    @Produces(MediaType.TEXT_HTML)
    public StreamingOutput renderGWTHostingPage() {

        return output -> output.write("hello".getBytes(Charset.defaultCharset()));
    }

``` 

**Expected behavior**
No WARNING

**Actual behavior**
This is printed on the console at startup:
```
[WARNING] [io.quarkus.deployment.steps.ReflectiveHierarchyStep] Unable to properly register the hierarchy of the following classes for reflection as they are not in the Jandex index:
	- javax.ws.rs.core.StreamingOutput
Consider adding them to the index either by creating a Jandex index for your dependency via the Maven plugin, an empty META-INF/beans.xml or quarkus.index-dependency properties.");.

```

**To Reproduce**
Steps to reproduce the behavior:
1. mvnw compile quarkus:dev

**Environment (please complete the following information):**
 - Darwin WMICTLM1P.local 18.7.0 Darwin Kernel Version 18.7.0: Sat Oct 12 00:02:19 PDT 2019; root:xnu-4903.278.12~1/RELEASE_X86_64 x86_64
 - openjdk version "1.8.0_232"
OpenJDK Runtime Environment (build 1.8.0_232-20191009173705.graal.jdk8u-src-tar-gz-b07)
OpenJDK 64-Bit GraalVM CE 19.3.0 (build 25.232-b07-jvmci-19.3-b05, mixed mode)
 - <quarkus.platform.version>1.2.0.Final</quarkus.platform.version>
[quarkus-120-issues.zip](https://github.com/quarkusio/quarkus/files/4142463/quarkus-120-issues.zip)


**Additional context**
Please use the reproducer project.


Changed files:
extensions/resteasy-common/deployment/src/main/java/io/quarkus/resteasy/common/deployment/ResteasyDotNames.java

diff --git a/extensions/resteasy-common/deployment/src/main/java/io/quarkus/resteasy/common/deployment/ResteasyDotNames.java b/extensions/resteasy-common/deployment/src/main/java/io/quarkus/resteasy/common/deployment/ResteasyDotNames.java
index 6f491912bce..c4f1a454b00 100644
--- a/extensions/resteasy-common/deployment/src/main/java/io/quarkus/resteasy/common/deployment/ResteasyDotNames.java
+++ b/extensions/resteasy-common/deployment/src/main/java/io/quarkus/resteasy/common/deployment/ResteasyDotNames.java
@@ -74,6 +74,7 @@ private boolean isInIgnoredPackage(String name) {
             // JAX-RS
             DotName.createSimple("javax.ws.rs.core.Response"),
             DotName.createSimple("javax.ws.rs.container.AsyncResponse"),
+            DotName.createSimple("javax.ws.rs.core.StreamingOutput"),
 
             // RESTEasy
             DotName.createSimple("org.jboss.resteasy.plugins.providers.multipart.MultipartInput"),
Repository: quarkusio/quarkus
Issue: Panache entites are not marked as dirty after deserialization with Jackson

**Describe the bug**
Using Jackson for JSON-Deserializiation Panache entities (w/out explicit setters) is problematic because generated getters & setters are marked "synthetic" by Quarkus and Jackson skips synthetic methods, i.e. it uses just the public fields. But that means that Hibernate's dirty tracking is bypassed and the (changed) entities are not persisted.

**Expected behavior**
Panache entity is persistable (aka. dirty) after deserialization with Jackson.

**Actual behavior**
Panache entity is not marked as dirty after deserialization with Jackson.

**To Reproduce**
Steps to reproduce the behavior:
1. Use Jackson for JSON handling
2. Deserialize a Panache entity w/out explicit getters & setters
3. Try to persist this entity

**Solution**
As discussed with @FroMage on the chat, the synthetic flag should be removed to make this work as it is not relevant for any (known) use case right now (see getter & setter generation in PanacheEntityEnhancer).


Changed files:
extensions/panache/panache-common/deployment/src/main/java/io/quarkus/panache/common/deployment/PanacheEntityEnhancer.java

diff --git a/extensions/panache/panache-common/deployment/src/main/java/io/quarkus/panache/common/deployment/PanacheEntityEnhancer.java b/extensions/panache/panache-common/deployment/src/main/java/io/quarkus/panache/common/deployment/PanacheEntityEnhancer.java
index c26c31e49c7..59583cedb0c 100644
--- a/extensions/panache/panache-common/deployment/src/main/java/io/quarkus/panache/common/deployment/PanacheEntityEnhancer.java
+++ b/extensions/panache/panache-common/deployment/src/main/java/io/quarkus/panache/common/deployment/PanacheEntityEnhancer.java
@@ -185,7 +185,7 @@ private void generateAccessors() {
                 String getterName = field.getGetterName();
                 String getterDescriptor = "()" + field.descriptor;
                 if (!methods.contains(getterName + "/" + getterDescriptor)) {
-                    MethodVisitor mv = super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_SYNTHETIC,
+                    MethodVisitor mv = super.visitMethod(Opcodes.ACC_PUBLIC,
                             getterName, getterDescriptor, field.signature == null ? null : "()" + field.signature, null);
                     mv.visitCode();
                     mv.visitIntInsn(Opcodes.ALOAD, 0);
@@ -204,7 +204,7 @@ private void generateAccessors() {
                 String setterName = field.getSetterName();
                 String setterDescriptor = "(" + field.descriptor + ")V";
                 if (!methods.contains(setterName + "/" + setterDescriptor)) {
-                    MethodVisitor mv = super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_SYNTHETIC,
+                    MethodVisitor mv = super.visitMethod(Opcodes.ACC_PUBLIC,
                             setterName, setterDescriptor, field.signature == null ? null : "(" + field.signature + ")V", null);
                     mv.visitCode();
                     mv.visitIntInsn(Opcodes.ALOAD, 0);
Repository: quarkusio/quarkus
Issue: Adding Groovy plugin to Gradle project fails quarkusDev

When adding the Groovy plugin like:

```
plugins {
    id "java"
    id "groovy"
    id "io.quarkus"
}
```

then `quarkusDev` fails with:

```
❯ ./gradlew clean quarkusDev

> Task :compileJava
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :quarkusDev FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Some problems were found with the configuration of task ':quarkusDev' (type 'QuarkusDev').
> Directory '/Users/marceloverdijk/workspace/demo-backend-quarkus/build/classes/groovy/main' specified for property 'workingDir' does not exist.
> Directory '/Users/marceloverdijk/workspace/demo-backend-quarkus/src/main/groovy' specified for property 'sourceDir' does not exist.
```

It seems the `src/main/groovy` folder is expected.

I'm only adding Groovy to run Spock tests from `/src/test/groovy`.

When creating an empty `src/main/groovy` folder it keeps complaining about `build/classes/groovy/main`.


Changed files:
devtools/gradle/src/main/java/io/quarkus/gradle/QuarkusPluginExtension.java

diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/QuarkusPluginExtension.java b/devtools/gradle/src/main/java/io/quarkus/gradle/QuarkusPluginExtension.java
index 3e3a0c27bfe..d48acd6ec7d 100644
--- a/devtools/gradle/src/main/java/io/quarkus/gradle/QuarkusPluginExtension.java
+++ b/devtools/gradle/src/main/java/io/quarkus/gradle/QuarkusPluginExtension.java
@@ -108,7 +108,9 @@ public AppModelResolver resolveAppModel() {
     private File getLastFile(FileCollection fileCollection) {
         File result = null;
         for (File f : fileCollection) {
-            result = f;
+            if (result == null || f.exists()) {
+                result = f;
+            }
         }
         return result;
     }
Repository: quarkusio/quarkus
Issue: gradle wrapper not created when creating projects on windows

**Describe the bug**
CreateProjectMojo calls gradle instead of gradle.bat/cmd thus on windows gradle wrappers are never created.

https://github.com/quarkusio/quarkus/blob/8582422fd071d3ef152d861ab50de5ca1064e8cf/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java#L219




Changed files:
devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java

diff --git a/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java b/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java
index 140e28bd265..7e089cd769d 100644
--- a/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java
+++ b/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java
@@ -18,6 +18,7 @@
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
@@ -58,6 +59,8 @@
 @Mojo(name = "create", requiresProject = false)
 public class CreateProjectMojo extends AbstractMojo {
 
+    final private static boolean IS_WINDOWS = System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("windows");
+
     private static String pluginKey;
 
     public static String getPluginKey() {
@@ -216,7 +219,8 @@ public void execute() throws MojoExecutionException {
 
     private void createGradleWrapper(File projectDirectory) {
         try {
-            ProcessBuilder pb = new ProcessBuilder("gradle", "wrapper",
+            String gradleName = IS_WINDOWS ? "gradle.bat" : "gradle";
+            ProcessBuilder pb = new ProcessBuilder(gradleName, "wrapper",
                     "--gradle-version=" + MojoUtils.getGradleWrapperVersion()).directory(projectDirectory)
                             .inheritIO();
             Process x = pb.start();
@@ -224,7 +228,7 @@ private void createGradleWrapper(File projectDirectory) {
             x.waitFor();
 
             if (x.exitValue() != 0) {
-                getLog().error("Unable to install the Gradle wrapper (./gradlew) in project. See log for details.");
+                getLog().warn("Unable to install the Gradle wrapper (./gradlew) in project. See log for details.");
             }
 
         } catch (InterruptedException | IOException e) {
Repository: quarkusio/quarkus
Issue: Bootstrap maven repo initializer should take into account maven.repo.local property

At this point the local repository location can be configured using settings.xml and QUARKUS_LOCAL_REPO env var with the default pointing to the `~/.m2/repository`. It should also consult `maven.repo.local` system property.

Changed files:
independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/resolver/maven/MavenRepoInitializer.java

diff --git a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/resolver/maven/MavenRepoInitializer.java b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/resolver/maven/MavenRepoInitializer.java
index d064ba697d0..c88d79b6a6c 100644
--- a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/resolver/maven/MavenRepoInitializer.java
+++ b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/resolver/maven/MavenRepoInitializer.java
@@ -437,11 +437,15 @@ public static Settings getSettings() throws AppModelResolverException {
     }
 
     public static String getLocalRepo(Settings settings) {
-        String env = System.getenv("QUARKUS_LOCAL_REPO");
-        if(env != null) {
-            return env;
+        String localRepo = System.getenv("QUARKUS_LOCAL_REPO");
+        if(localRepo != null) {
+            return localRepo;
         }
-        final String localRepo = settings.getLocalRepository();
+        localRepo = PropertyUtils.getProperty("maven.repo.local");
+        if(localRepo != null) {
+            return localRepo;
+        }
+        localRepo = settings.getLocalRepository();
         return localRepo == null ? getDefaultLocalRepo() : localRepo;
     }
Repository: quarkusio/quarkus
Issue: ClassLoader not closed

**Describe the bug**
During builds, a classloader created by the quarkus maven plugin is not closed completely, thus not releasing the jars after the build. This can cause problems when embedding maven.  This mainly happens when using concurrent builds and a maven daemon (this always occurs the second time).  This means that a reference to a zip file is not released correctly (even though the classloader created by quarkus is correctly closed).

**Expected behavior**
The classloader is closed.

**Actual behavior**
```
Caused by: java.util.zip.ZipException: ZipFile invalid LOC header (bad signature)
	at java.base/java.util.zip.ZipFile$ZipFileInputStream.initDataOffset(ZipFile.java:1003)
	at java.base/java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:1013)
	at java.base/java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:468)
	at java.base/java.util.zip.InflaterInputStream.read(InflaterInputStream.java:159)
```


Changed files:
core/deployment/src/main/java/io/quarkus/deployment/util/ServiceUtil.java

diff --git a/core/deployment/src/main/java/io/quarkus/deployment/util/ServiceUtil.java b/core/deployment/src/main/java/io/quarkus/deployment/util/ServiceUtil.java
index d57d632b8cd..6ab6e390232 100644
--- a/core/deployment/src/main/java/io/quarkus/deployment/util/ServiceUtil.java
+++ b/core/deployment/src/main/java/io/quarkus/deployment/util/ServiceUtil.java
@@ -7,6 +7,7 @@
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.net.URL;
+import java.net.URLConnection;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.nio.file.NoSuchFileException;
@@ -39,7 +40,9 @@ public static Set<String> classNamesNamedIn(ClassLoader classLoader, String file
 
         while (resources.hasMoreElements()) {
             final URL url = resources.nextElement();
-            try (InputStream is = url.openStream()) {
+            URLConnection con = url.openConnection();
+            con.setUseCaches(false);
+            try (InputStream is = con.getInputStream()) {
                 try (BufferedInputStream bis = new BufferedInputStream(is)) {
                     try (InputStreamReader isr = new InputStreamReader(bis, StandardCharsets.UTF_8)) {
                         try (BufferedReader br = new BufferedReader(isr)) {
@@ -47,6 +50,8 @@ public static Set<String> classNamesNamedIn(ClassLoader classLoader, String file
                         }
                     }
                 }
+            } catch (IOException e) {
+                throw new IOException("Error reading " + url, e);
             }
         }
Repository: quarkusio/quarkus
Issue: BuildStep utilizing InterceptorBindingRegistrarBuildItem results in IllegalArgumentException

**Describe the bug**

I followed the example from the CDI guide for implementing [additional interceptor bindings](https://quarkus.io/guides/cdi-reference#additional-interceptor-bindings). It fails with:

```
java.lang.IllegalArgumentException: Build item class must be leaf (final) types: class io.quarkus.arc.deployment.InterceptorBindingRegistrarBuildItem
	at io.quarkus.builder.item.BuildItem.<init>(BuildItem.java:22)
	at io.quarkus.builder.item.MultiBuildItem.<init>(MultiBuildItem.java:8)
	at io.quarkus.arc.deployment.InterceptorBindingRegistrarBuildItem.<init>(InterceptorBindingRegistrarBuildItem.java:9)
```

Presumably `InterceptorBindingRegistrarBuildItem` should be declared as `final` like the other `BuildItem` implementations?

**Expected behavior**

`InterceptorBindingRegistrarBuildItem` successfully registers the interceptor binding.

Changed files:
extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/InterceptorBindingRegistrarBuildItem.java

diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/InterceptorBindingRegistrarBuildItem.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/InterceptorBindingRegistrarBuildItem.java
index cf48e4cf6b3..a399b05f5bb 100644
--- a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/InterceptorBindingRegistrarBuildItem.java
+++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/InterceptorBindingRegistrarBuildItem.java
@@ -3,7 +3,7 @@
 import io.quarkus.arc.processor.InterceptorBindingRegistrar;
 import io.quarkus.builder.item.MultiBuildItem;
 
-public class InterceptorBindingRegistrarBuildItem extends MultiBuildItem {
+public final class InterceptorBindingRegistrarBuildItem extends MultiBuildItem {
     private final InterceptorBindingRegistrar registrar;
 
     public InterceptorBindingRegistrarBuildItem(InterceptorBindingRegistrar registrar) {
Repository: quarkusio/quarkus
Issue: CNFE on scope defining annotations in the default package

**Describe the bug**
Quarkus fails ungracefully with scope-defining annotations on beans in the default package.
The error: https://gist.github.com/michalszynkiewicz/c489af90ed958b4ff43c7236f4a1b09a

**Expected behavior**
Either just work or produce a user-friendly message.

**To Reproduce**
Steps to reproduce the behavior:
1. clone https://github.com/michalszynkiewicz/quarkus-krakow/tree/failing-scope-on-default/ads
2. `mvn clean compile quarkus:dev` or `mvn clean package && java -jar target/*-runner.jar`

CC @manovotn 

Changed files:
independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/AbstractGenerator.java

diff --git a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/AbstractGenerator.java b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/AbstractGenerator.java
index e29f8dc6219..d3ba8c05e78 100644
--- a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/AbstractGenerator.java
+++ b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/AbstractGenerator.java
@@ -81,8 +81,8 @@ protected String getPackageName(BeanInfo bean) {
             }
         }
         String packageName = DotNames.packageName(providerTypeName);
-        if (packageName.startsWith("java.")) {
-            // It is not possible to place a class in a JDK package
+        if (packageName.isEmpty() || packageName.startsWith("java.")) {
+            // It is not possible to place a class in a JDK package or in default package
             packageName = DEFAULT_PACKAGE;
         }
         return packageName;
Repository: quarkusio/quarkus
Issue: High contention on @Transactional annotated methods

The interceptor we use to implement the `@Transactional` does a lookup of the TransactionManager on each need.

Narayana implements this lookup with a synchronized method; however it should be totally fine to cache this lookup even in a constant.

Changed files:
extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaProducers.java

diff --git a/extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaProducers.java b/extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaProducers.java
index 2f0b8ee5cda..22b9f8c5feb 100644
--- a/extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaProducers.java
+++ b/extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaProducers.java
@@ -18,6 +18,9 @@
 @Dependent
 public class NarayanaJtaProducers {
 
+    private static final javax.transaction.UserTransaction USER_TRANSACTION = UserTransaction.userTransaction();
+    private static final javax.transaction.TransactionManager TRANSACTION_MANAGER = TransactionManager.transactionManager();
+
     @Produces
     @ApplicationScoped
     public UserTransactionRegistry userTransactionRegistry() {
@@ -27,14 +30,13 @@ public UserTransactionRegistry userTransactionRegistry() {
     @Produces
     @ApplicationScoped
     public javax.transaction.UserTransaction userTransaction() {
-        return UserTransaction.userTransaction();
+        return USER_TRANSACTION;
     }
 
     @Produces
     @ApplicationScoped
     public XAResourceRecoveryRegistry xaResourceRecoveryRegistry() {
         return new RecoveryManagerService();
-
     }
 
     @Produces
@@ -46,7 +48,7 @@ public TransactionSynchronizationRegistry transactionSynchronizationRegistry() {
     @Produces
     @ApplicationScoped
     public javax.transaction.TransactionManager transactionManager() {
-        return TransactionManager.transactionManager();
+        return TRANSACTION_MANAGER;
     }
 
     @Produces
Repository: quarkusio/quarkus
Issue: ClientProxyGenerator - handle thrown exception types correctly

Currently, we only expect a `ClassType`: https://github.com/quarkusio/quarkus/blob/0.22.0/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ClientProxyGenerator.java#L100



Changed files:
independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ClientProxyGenerator.java

diff --git a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ClientProxyGenerator.java b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ClientProxyGenerator.java
index 4079941d1af..29f0e8172a5 100644
--- a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ClientProxyGenerator.java
+++ b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ClientProxyGenerator.java
@@ -98,13 +98,7 @@ Collection<Resource> generate(BeanInfo bean, String beanClassName, ReflectionReg
 
             // Exceptions
             for (Type exception : method.exceptions()) {
-                if (exception.kind() == Type.Kind.CLASS) {
-                    forward.addException(exception.asClassType().toString());
-                } else if (exception.kind() == Type.Kind.TYPE_VARIABLE) {
-                    forward.addException(exception.asTypeVariable().bounds().get(0).asClassType().toString());
-                } else {
-                    throw new IllegalArgumentException("Unknown exception type " + exception);
-                }
+                forward.addException(exception.toString());
             }
             // Method params
             ResultHandle[] params = new ResultHandle[method.parameters().size()];
Repository: quarkusio/quarkus
Issue: HttpAuthenticationMechanism.ChallengeSender.apply - return true instead of null

HttpAuthenticationMechanism.ChallengeSender.apply should probably return `true` instead of `null`

Issue for the discussion https://github.com/quarkusio/quarkus/commit/8f39da48551c27b6e3debc7b5683a704c74f8957#r35642382

Changed files:
extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/security/HttpAuthenticationMechanism.java

diff --git a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/security/HttpAuthenticationMechanism.java b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/security/HttpAuthenticationMechanism.java
index 47af0f20216..fccef05e13d 100644
--- a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/security/HttpAuthenticationMechanism.java
+++ b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/security/HttpAuthenticationMechanism.java
@@ -37,7 +37,7 @@ public Boolean apply(ChallengeData challengeData) {
             if (challengeData.headerName != null) {
                 context.response().headers().set(challengeData.headerName, challengeData.headerContent);
             }
-            return null;
+            return true;
         }
     }
 }
Repository: quarkusio/quarkus
Issue: @InterceptorBinding no longer recognized/fired when they have additional fields

This interceptor binding is working fine, if there is an interceptor (having @Priority annotation or not, @AroundInvoke gets fired wherever @StorageThreadSession is annotated):

```
@Target({TYPE, METHOD})
@Retention(RUNTIME)
@InterceptorBinding
public @interface StorageThreadSession {
}
```

adding a field to the binding definition, @AroundInvoke stops working, it seems the interceptor binding is not recognized at all in this case:

```
@Target({TYPE, METHOD})
@Retention(RUNTIME)
@InterceptorBinding
public @interface StorageThreadSession {
	
	Class qualifier() default Object.class;
}
```

I can split up my annotation but I don't think that this is the desired behaviour.

Changed files:
independent-projects/arc/tests/src/test/java/io/quarkus/arc/test/interceptors/bindingdefaultvalue/BindingDefaultValueTest.java
independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/InterceptorResolver.java

diff --git a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/InterceptorResolver.java b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/InterceptorResolver.java
index a56248fa9f4..03b31e778f7 100644
--- a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/InterceptorResolver.java
+++ b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/InterceptorResolver.java
@@ -81,7 +81,7 @@ private boolean isInterceptorBinding(AnnotationInstance interceptorBinding, Anno
                 String annotationField = value.name();
                 if (!interceptorBindingClass.method(annotationField).hasAnnotation(DotNames.NONBINDING)
                         && !nonBindingFields.contains(annotationField)
-                        && !value.equals(interceptorBinding.value(annotationField))) {
+                        && !value.equals(interceptorBinding.valueWithDefault(beanDeployment.getIndex(), annotationField))) {
                     matches = false;
                     break;
                 }
diff --git a/independent-projects/arc/tests/src/test/java/io/quarkus/arc/test/interceptors/bindingdefaultvalue/BindingDefaultValueTest.java b/independent-projects/arc/tests/src/test/java/io/quarkus/arc/test/interceptors/bindingdefaultvalue/BindingDefaultValueTest.java
index ef050f8241c..04e98fc52a5 100644
--- a/independent-projects/arc/tests/src/test/java/io/quarkus/arc/test/interceptors/bindingdefaultvalue/BindingDefaultValueTest.java
+++ b/independent-projects/arc/tests/src/test/java/io/quarkus/arc/test/interceptors/bindingdefaultvalue/BindingDefaultValueTest.java
@@ -37,7 +37,7 @@ String ping() {
 
     }
 
-    @MyTransactional("alpha")
+    @MyTransactional
     @Priority(1)
     @Interceptor
     public static class AlphaInterceptor {
Repository: quarkusio/quarkus
Issue: Cannot add extensions to Gradle project with comma-separated extensions list

**Describe the bug**
In the guide: https://quarkus.io/guides/gradle-tooling#dealing-with-extensions

it looks like we can add extensions in a comma-separated list like so: 
`./gradlew addExtension --extensions="quarkus-artemis-jms,quarkus-vertx"`

However, for my Gradle project, I get this message:
```
> Task :addExtension
❌ Cannot find a dependency matching 'quarkus-artemis-jms,quarkus-vertx', maybe a typo?
```

I took those extensions from the list provided with ./gradlew listExtensions.

**Expected behavior**
Should be able to install each extension in the comma-separated list

**Actual behavior**
I get the error message above


**To Reproduce**
Steps to reproduce the behavior:
1. Create a new Gradle project using the Quarkus Maven plugin (as explained in the guide)
2. Create Gradle wrapper using `gradle wrapper` (I'm using Gradle 5.6.4)
3. Run `./gradlew addExtension --extensions="quarkus-artemis-jms,quarkus-vertx"`

Step 2 is optional, the extensions don't install whether or not I use the wrapper.

**Environment (please complete the following information):**
 - Output of `uname -a` or `ver`: 
Linux unused-10-15-17-2.yyz.redhat.com 5.0.17-300.fc30.x86_64 #1 SMP Mon May 20 15:36:26 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

 - Output of `java -version`: 
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-b04)
OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)

 - Quarkus version or git rev: 
0.28.1

Changed files:
devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusAddExtension.java

diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusAddExtension.java b/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusAddExtension.java
index ebb5051c2cc..9639f52ccfe 100644
--- a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusAddExtension.java
+++ b/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusAddExtension.java
@@ -1,7 +1,9 @@
 package io.quarkus.gradle.tasks;
 
+import static java.util.Arrays.stream;
+import static java.util.stream.Collectors.toSet;
+
 import java.io.IOException;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
@@ -37,10 +39,13 @@ public List<String> getExtensionsToAdd() {
 
     @TaskAction
     public void addExtension() {
-
         setupPlatformDescriptor();
 
-        Set<String> extensionsSet = new HashSet<>(getExtensionsToAdd());
+        Set<String> extensionsSet = getExtensionsToAdd()
+                .stream()
+                .flatMap(ext -> stream(ext.split(",")))
+                .map(String::trim)
+                .collect(toSet());
         try {
             new AddExtensions(new GradleBuildFile(new FileProjectWriter(getProject().getProjectDir())))
                     .addExtensions(extensionsSet);
Repository: quarkusio/quarkus
Issue: Please add null check for LambdaHttpHandler.java line 84 -> request.getMultiValueHeaders()

Hi There,

Could you please add a null value check in LambdaHttpHandler.java line 84 ->  request.getMultiValueHeaders()

I able to send a request with out any http headers from AWS Api gateway and it fails in the above mentioned class with null pointer exception.

Thanks,
Ravi

Changed files:
extensions/amazon-lambda-http/runtime/src/main/java/io/quarkus/amazon/lambda/http/LambdaHttpHandler.java

diff --git a/extensions/amazon-lambda-http/runtime/src/main/java/io/quarkus/amazon/lambda/http/LambdaHttpHandler.java b/extensions/amazon-lambda-http/runtime/src/main/java/io/quarkus/amazon/lambda/http/LambdaHttpHandler.java
index b09b474a58a..2169542d9e1 100644
--- a/extensions/amazon-lambda-http/runtime/src/main/java/io/quarkus/amazon/lambda/http/LambdaHttpHandler.java
+++ b/extensions/amazon-lambda-http/runtime/src/main/java/io/quarkus/amazon/lambda/http/LambdaHttpHandler.java
@@ -84,8 +84,10 @@ private AwsProxyResponse nettyDispatch(VirtualClientConnection connection, AwsPr
         }
         DefaultHttpRequest nettyRequest = new DefaultHttpRequest(HttpVersion.HTTP_1_1,
                 HttpMethod.valueOf(request.getHttpMethod()), path);
-        for (Map.Entry<String, List<String>> header : request.getMultiValueHeaders().entrySet()) {
-            nettyRequest.headers().add(header.getKey(), header.getValue());
+        if (request.getMultiValueHeaders() != null) { //apparently this can be null if no headers are sent
+            for (Map.Entry<String, List<String>> header : request.getMultiValueHeaders().entrySet()) {
+                nettyRequest.headers().add(header.getKey(), header.getValue());
+            }
         }
         if (!nettyRequest.headers().contains(HttpHeaderNames.HOST)) {
             nettyRequest.headers().add(HttpHeaderNames.HOST, "localhost");
Repository: quarkusio/quarkus
Issue: CLI "quarkus dev" command is not working with gradle kotlin

### Describe the bug

quarkus dev command is not working with gradle kotlin

### Expected behavior

should work

### Actual behavior

```
[ERROR] ❗  Unable to launch project in dev mode: Was not able to find a build file in: /Users/ia3andy/Downloads/code-with-quarkus
````

### How to Reproduce?

1. Generate some project with code.quarkus using Gradle Kotlin: https://stage.code.quarkus.io/?b=GRADLE_KOTLIN_DSL&e=resteasy&e=resteasy-jackson&e=hibernate-validator
2. Copy `quarkus dev` command in the popup
3. Unzip and cd
4.
```shell
$ quarkus dev
[ERROR] ❗  Unable to launch project in dev mode: Was not able to find a build file in: /Users/ia3andy/Downloads/code-with-quarkus
```

### Output of `uname -a` or `ver`

_No response_

### Output of `java -version`

_No response_

### GraalVM version (if different from Java)

_No response_

### Quarkus version or git rev

_No response_

### Build tool (ie. output of `mvnw --version` or `gradlew --version`)

_No response_

### Additional information

_No response_

Changed files:
devtools/cli/src/main/java/io/quarkus/cli/build/GradleRunner.java

diff --git a/devtools/cli/src/main/java/io/quarkus/cli/build/GradleRunner.java b/devtools/cli/src/main/java/io/quarkus/cli/build/GradleRunner.java
index faaa3c3b65d..d95bfecfcca 100644
--- a/devtools/cli/src/main/java/io/quarkus/cli/build/GradleRunner.java
+++ b/devtools/cli/src/main/java/io/quarkus/cli/build/GradleRunner.java
@@ -235,9 +235,13 @@ void setGradleProperties(ArrayDeque<String> args, boolean batchMode) {
     }
 
     void verifyBuildFile() {
-        File buildFile = projectRoot.resolve("build.gradle").toFile();
-        if (!buildFile.isFile()) {
-            throw new IllegalStateException("Was not able to find a build file in: " + projectRoot);
+        for (String buildFileName : buildTool.getBuildFiles()) {
+            File buildFile = projectRoot.resolve(buildFileName).toFile();
+            if (buildFile.exists()) {
+                return;
+            }
         }
+        throw new IllegalStateException("Was not able to find a build file in: " + projectRoot
+                + " based on the following list: " + String.join(",", buildTool.getBuildFiles()));
     }
 }
Repository: quarkusio/quarkus
Issue: DevMode Runtime ClassLoader is never closed

### Describe the bug

Tracing the constructors and `close` methods on `QuarkusClassLoader` one can see that during a live-reload this is the sequence of relevant events:
 - start a new "Deployment Class Loader: DEV"
 - stop a "Deployment Class Loader: DEV"
 - start a new "Quarkus Runtime ClassLoader: DEV"

So at each re-deply, two new classloaders are constructed, but only one is being closed. The "Runtime ClassLoader" is never explicitly closed.

It doesn't seem critical: as far as I can tell with limited testing this doesn't seem to result in a real leak, and the classloader is still eventually collected by GC.

The `closeTasks` runnables that could be registered on a "Quarkus Runtime ClassLoader: DEV" are also not executed, but as far as I can see these are typically an empty list.

`ResourceBundle.clearCache` is also not being processed, but this also seems harmless in pracice.

@stuartwdouglas could you have a look? Feel free to close if it's intended.

### Quarkus version or git rev

main @ `dcf7c09377`


Changed files:
core/deployment/src/main/java/io/quarkus/runner/bootstrap/RunningQuarkusApplicationImpl.java

diff --git a/core/deployment/src/main/java/io/quarkus/runner/bootstrap/RunningQuarkusApplicationImpl.java b/core/deployment/src/main/java/io/quarkus/runner/bootstrap/RunningQuarkusApplicationImpl.java
index 609c0433356..79a69b073fd 100644
--- a/core/deployment/src/main/java/io/quarkus/runner/bootstrap/RunningQuarkusApplicationImpl.java
+++ b/core/deployment/src/main/java/io/quarkus/runner/bootstrap/RunningQuarkusApplicationImpl.java
@@ -8,15 +8,16 @@
 import org.eclipse.microprofile.config.ConfigProvider;
 
 import io.quarkus.bootstrap.app.RunningQuarkusApplication;
+import io.quarkus.bootstrap.classloading.QuarkusClassLoader;
 
 public class RunningQuarkusApplicationImpl implements RunningQuarkusApplication {
 
     private final Closeable closeTask;
-    private final ClassLoader classLoader;
+    private final QuarkusClassLoader classLoader;
 
     private boolean closing;
 
-    public RunningQuarkusApplicationImpl(Closeable closeTask, ClassLoader classLoader) {
+    public RunningQuarkusApplicationImpl(Closeable closeTask, QuarkusClassLoader classLoader) {
         this.closeTask = closeTask;
         this.classLoader = classLoader;
     }
@@ -30,7 +31,11 @@ public ClassLoader getClassLoader() {
     public void close() throws Exception {
         if (!closing) {
             closing = true;
-            closeTask.close();
+            try {
+                closeTask.close();
+            } finally {
+                classLoader.close();
+            }
         }
     }
Repository: quarkusio/quarkus
Issue: Quarkus continuous test mode hides server output

### Describe the bug

I am using the new continuous test mode, which is awesome.
Now when I work on some test-driven coding, I write a test, write the code and then Quarkus runs my test and shows me that my code is not working:

```
2021-07-21 12:26:16,957 ERROR [io.qua.test] (Test runner thread) ==================== TEST REPORT #11 ====================
2021-07-21 12:26:16,957 ERROR [io.qua.test] (Test runner thread) Test CheckerTest#basicCheck() failed 
: java.lang.AssertionError: 1 expectation failed.
Expected status code <200> but was <500>.

        at io.restassured.internal.ValidatableResponseImpl.statusCode(ValidatableResponseImpl.groovy)
        at com.redhat.clouddot.poc.funq.CheckerTest.basicCheck(CheckerTest.java:26)

2021-07-21 12:26:16,957 ERROR [io.qua.test] (Test runner thread) >>>>>>>>>>>>>>>>>>>> 1 TEST FAILED <<<<<<<<<<<<<<<<<<<<


--
1 test failed (1 passing, 0 skipped), 2 tests were run in 467ms. Tests completed at 12:26:16.
Press [r] to re-run, [v] to view full results, [p] to pause, [h] for more options>
```

But it hides the internal error message that the server would produce, which would help me understand why my code fails.

E.g. when I trigger the same rest-test not from a `@QuarkusTest` and `RestAssured`, but via `curl` , I get my normal stack trace that tells me what does not work in my code.


### Expected behavior

Test failure output and server output are shown

### Actual behavior

Only test output is shown, but server output is omitted

### How to Reproduce?

_No response_

### Output of `uname -a` or `ver`

_No response_

### Output of `java -version`

_No response_

### GraalVM version (if different from Java)

_No response_

### Quarkus version or git rev

2.1.0.CR1

### Build tool (ie. output of `mvnw --version` or `gradlew --version`)

_No response_

### Additional information

_No response_

Changed files:
core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestConsoleHandler.java

diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestConsoleHandler.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestConsoleHandler.java
index 3ba2ce6afc4..019c1c0680a 100644
--- a/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestConsoleHandler.java
+++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestConsoleHandler.java
@@ -33,7 +33,8 @@ public class TestConsoleHandler implements TestListener {
 
     private static final Logger log = Logger.getLogger("io.quarkus.test");
 
-    public static final ConsoleCommand TOGGLE_TEST_OUTPUT = new ConsoleCommand('o', "Toggle test output",
+    public static final ConsoleCommand TOGGLE_TEST_OUTPUT = new ConsoleCommand('o', "Toggle test output", "Toggle test output",
+            1000,
             new ConsoleCommand.HelpState(TestSupport.instance().get()::isDisplayTestOutput),
             () -> TestSupport.instance().get().toggleTestOutput());
Repository: quarkusio/quarkus
Issue: Deprecate usage of `@ConfigProperty` in ReactiveMessagingKafkaConfig

### Describe the bug

The usage of `@ConfigProperty` in https://github.com/quarkusio/quarkus/blob/7820ff6111f97d82c5e5855bf4f503d59b4d4471/extensions/smallrye-reactive-messaging-kafka/runtime/src/main/java/io/quarkus/smallrye/reactivemessaging/kafka/ReactiveMessagingKafkaConfig.java#L16 is leading to have this warning message when using this extension:

```
WARN  [io.qua.con.build] (main) Using @ConfigProperty for Quarkus configuration items is deprecated (use @ConfigItem instead) at io.quarkus.smallrye.reactivemessaging.kafka.ReactiveMessagingKafkaConfig#enableGracefulShutdownInDevAndTestMode
``` 

We should replace `@ConfigProperty` by `@ConfigItem`.

### Expected behavior

_No response_

### Actual behavior

_No response_

### How to Reproduce?

_No response_

### Output of `uname -a` or `ver`

_No response_

### Output of `java -version`

_No response_

### GraalVM version (if different from Java)

_No response_

### Quarkus version or git rev

2.1.1.Final

### Build tool (ie. output of `mvnw --version` or `gradlew --version`)

_No response_

### Additional information

_No response_

Changed files:
extensions/smallrye-reactive-messaging-kafka/runtime/src/main/java/io/quarkus/smallrye/reactivemessaging/kafka/ReactiveMessagingKafkaConfig.java

diff --git a/extensions/smallrye-reactive-messaging-kafka/runtime/src/main/java/io/quarkus/smallrye/reactivemessaging/kafka/ReactiveMessagingKafkaConfig.java b/extensions/smallrye-reactive-messaging-kafka/runtime/src/main/java/io/quarkus/smallrye/reactivemessaging/kafka/ReactiveMessagingKafkaConfig.java
index 1e45d53a154..8278f33d0c1 100644
--- a/extensions/smallrye-reactive-messaging-kafka/runtime/src/main/java/io/quarkus/smallrye/reactivemessaging/kafka/ReactiveMessagingKafkaConfig.java
+++ b/extensions/smallrye-reactive-messaging-kafka/runtime/src/main/java/io/quarkus/smallrye/reactivemessaging/kafka/ReactiveMessagingKafkaConfig.java
@@ -1,7 +1,6 @@
 package io.quarkus.smallrye.reactivemessaging.kafka;
 
-import org.eclipse.microprofile.config.inject.ConfigProperty;
-
+import io.quarkus.runtime.annotations.ConfigItem;
 import io.quarkus.runtime.annotations.ConfigRoot;
 
 @ConfigRoot(name = "reactive-messaging.kafka")
@@ -13,7 +12,7 @@ public class ReactiveMessagingKafkaConfig {
      * While this setting is highly recommended in production, in dev and test modes, it's disabled by default.
      * This setting allows to re-enable it.
      */
-    @ConfigProperty(defaultValue = "false")
+    @ConfigItem(defaultValue = "false")
     public boolean enableGracefulShutdownInDevAndTestMode;
 
 }