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

Correct unused variables #325

Open
Se-C12 opened this issue Mar 1, 2023 · 8 comments
Open

Correct unused variables #325

Se-C12 opened this issue Mar 1, 2023 · 8 comments
Labels
state: pending Pending requirements, dependencies, data, or more information. work: complicated The situation is complicated, good practices used.

Comments

@Se-C12
Copy link
Collaborator

Se-C12 commented Mar 1, 2023

Some variables are unused in code.
Maybe error-prone has a detector for that

@Riduidel
Copy link
Owner

Riduidel commented Mar 9, 2023

Seems like it exists ! https://errorprone.info/bugpattern/UnusedVariable

@Helielzel
Copy link
Collaborator

  • Add variables in cdi-config-extension,
  • create method with unused parameter
  • modify the config of error prone in the root pom until the message appears

@Helielzel
Copy link
Collaborator

Helielzel commented Mar 27, 2023

relevant ? -> google/error-prone#985

relevant ? if yes, how to read that ? -> https://mvnrepository.com/artifact/com.google.errorprone

So far i've tested the plugin with mvn install, is there something better ?

@Helielzel
Copy link
Collaborator

Helielzel commented Mar 27, 2023

aadarchi does not use javac doesn't it ? Because in an exemple I found, there's a tag in the pom like this one (in configuration) : <compilerId>javac-with-errorprone</compilerId> -> build fails
and this one : <forceJavacCompilerUse>true</forceJavacCompilerUse>

@Helielzel
Copy link
Collaborator

Helielzel commented Mar 27, 2023

In fact it's much easier if I copy paste all the config tag here :

<configuration>
                <compilerArgs>
                    <arg>-d</arg>
                    <arg>${project.build.directory}/classes-ep</arg>
                </compilerArgs>
                <compilerId>javac-with-errorprone</compilerId>
                <forceJavacCompilerUse>true</forceJavacCompilerUse>
                <!-- Erroneously inverted logic... for details, see
                https://jira.codehaus.org/browse/MCOMPILER-209 -->
                <useIncrementalCompilation>true</useIncrementalCompilation>
</configuration> `

@Riduidel
Copy link
Owner

So far i've tested the plugin with mvn install, is there something better ?

Yes, you can use mvn compile

@Riduidel
Copy link
Owner

aadarchi does not use javac doesn't it ?

aadarch uses maven-compiler-plugin, which in turn uses javac under the hood

@Helielzel
Copy link
Collaborator

Still compiles with useless class & variables (mvn clean compile -pl :cdi-config-extension)

@Riduidel Riduidel added state: pending Pending requirements, dependencies, data, or more information. priority: 2day work: complicated The situation is complicated, good practices used. and removed difficulty-🐛 priority: 2day labels Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: pending Pending requirements, dependencies, data, or more information. work: complicated The situation is complicated, good practices used.
Projects
None yet
Development

No branches or pull requests

3 participants