Merge branch 'pmd/new-rule2' into 'master'

Ref: add more PMD rule: bestpractices.xml/UseCollectionIsEmpty

See merge request sheepitrenderfarm/client!315
This commit is contained in:
Laurent Clouet
2024-06-06 00:59:14 +00:00
2 changed files with 3 additions and 2 deletions

View File

@@ -18,6 +18,7 @@
<rule ref="category/java/bestpractices.xml/UnusedLocalVariable" />
<rule ref="category/java/bestpractices.xml/UnusedPrivateField" />
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod" />
<rule ref="category/java/bestpractices.xml/UseCollectionIsEmpty" />
<rule ref="category/java/codestyle.xml/ExtendsObject" />
<rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop" />

View File

@@ -271,7 +271,7 @@ public class Settings implements Activity {
gridbag.setConstraints(useCPU, compute_devices_constraints);
compute_devices_panel.add(useCPU);
if (gpus.size() > 0 || GPU.hasHIPDevices()) {
if (gpus.isEmpty() == false || GPU.hasHIPDevices()) {
for (GPUDevice gpu : gpus) {
JCheckBoxGPU gpuCheckBox = new JCheckBoxGPU(gpu);
gpuCheckBox.setToolTipText(gpu.getId());
@@ -819,7 +819,7 @@ public class Settings implements Activity {
changes.add("Disable large Downloads");
}
if (changes.size() > 0) {
if (changes.isEmpty() == false) {
warning = String.format(warning, String.join(", ", changes));
JOptionPane.showMessageDialog(null, warning);
}