
resources.report.rules.pmd.AvoidInstantiatingObjectsInLoops.html Maven / Gradle / Ivy
AvoidInstantiatingObjectsInLoops
AvoidInstantiatingObjectsInLoops
Detects when a new object is created inside a loop
This rule is defined by the following Java class:
net.sourceforge.pmd.rules.optimization.AvoidInstantiatingObjectsInLoops
Example:
public class Something {
public static void main( String as[] ) {
for (int i = 0; i < 10; i++) {
Foo f = new Foo(); //Avoid this whenever you can it's really expensive
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy