![JAR search and dependency download from the Maven repository](/logo.png)
com.massfords.javac.effectivelyfinal.EffectivelyFinalPlugin Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of effectively-final Show documentation
Show all versions of effectively-final Show documentation
Javac plugin that requires method parameters to either be
explicitly final or effectively final. This enforces the best practice
of treating the parameters as final without the burden of having to type
final everywhere.
The newest version!
package com.massfords.javac.effectivelyfinal;
import com.sun.source.util.JavacTask;
/**
* Plugin that produces a compiler error if a method param is assigned to. This prevents the bad practice of assigning
* to a param which should be treated as final (at least in Java) without having to add the final modifier to every
* param.
*/
public class EffectivelyFinalPlugin implements com.sun.source.util.Plugin {
@Override
public String getName() {
return "EffectivelyFinal";
}
@Override
public void init(JavacTask task, String... args) {
task.addTaskListener(new EffectivelyFinalTaskListener(task));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy