question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dev mode compiler does not use `-parameters`

See original GitHub issue

Due to the RESTEasy version of @*Param which requires no value and uses the reflection parameter name, we’d ideally like the compiler to default to -parameters but we can’t, so we tell users to set <maven.compiler.parameters>true</...> in their pom.xml.

This setting is ignored by the dev mojo. Similarly the longer configuration is also ignored:

<configuration>
 <parameters>true</parameters>
</configuration>

I’d rather we just always add the -parameters flag to javac, but it would behave differently in dev mode than when generating jar/native, so I think we should respect the user’s config. I can make a PR for this.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:23 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
geoandcommented, Oct 17, 2019

@gsmet It does not, but we in out gradle templates we enable it with

compileJava {
    options.compilerArgs << '-parameters'
}
1reaction
FroMagecommented, Oct 17, 2019
import java.util.Set;
import java.util.concurrent.CompletionStage;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
import org.jboss.resteasy.annotations.jaxrs.PathParam;

@Path("/v2")
@RegisterRestClient
public interface CountriesService {

    @GET
    @Path("/name/{name}")
    @Produces("application/json")
    CompletionStage<Set<Country>> getByName(@PathParam String name);
}

This is enough to see this in the logs:

2019-10-17 11:25:33,723 WARN  [io.qua.resteasy] (build-7) Detected RESTEasy annotation org.jboss.resteasy.annotations.jaxrs.PathParam on method parameter org.acme.CountriesService.getByName with no name. Either specify its name, or tell your compiler to enable debug info (-g) or parameter names (-parameters). This message is only logged for the first such parameter.
Read more comments on GitHub >

github_iconTop Results From Across the Web

[GWT] Documentation - Compile & Debug
When an application is running in development mode, the Java Virtual Machine (JVM) is actually executing the application code as compiled Java bytecode,...
Read more >
Experimental DevMode arguments in IntelliJ IDEA launch ...
Assuming the CodeHaus Mojo gwt-maven-plugin, it will only pass arguments that are supported by the forked tool; launch with mvn -X to get ......
Read more >
Building applications with Maven - Quarkus
Dev mode enables hot deployment with background compilation, which means that when you modify your Java files or your resource files and refresh...
Read more >
Dev mode :: Open Liberty Docs
Otherwise, the dependent modules might fail to compile. Open Liberty server configuration files, such as the server.xml , are used from the module...
Read more >
Understanding the Restrictions Imposed by the Closure ...
When you use with the Compiler can't distinguish between a local ... you to use the names of arguments in your code, Simple...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found