
org.sonar.l10n.pmd.rules.pmd.UseVarargs.html Maven / Gradle / Ivy
Go to download
PMD is a tool that looks for potential problems like possible bugs, dead code, suboptimal code, overcomplicated expressions or duplicate code.
Java 5 introduced the varargs parameter declaration for methods and constructors. This syntactic
sugar provides flexibility for users of these methods and constructors, allowing them to avoid
having to deal with the creation of an array. Example:
public class Foo {
public void foo(String s, Object[] args) {
// Do something here...
}
public void bar(String s, Object... args) {
// Ahh, varargs tastes much better...
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy