---
title: Error Prone
summary: Rules to detect constructs that are either broken, extremely confusing or prone to runtime errors.
permalink: pmd_rules_vm_errorprone.html
folder: pmd/rules/vm
sidebaractiveurl: /pmd_rules_vm.html
editmepath: ../pmd-vm/src/main/resources/category/vm/errorprone.xml
keywords: Error Prone, EmptyForeachStmt, EmptyIfStmt
---
## EmptyForeachStmt

**Since:** PMD 5.1

**Priority:** Medium High (2)

Empty foreach statements should be deleted.

**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.vm.rule.errorprone.EmptyForeachStmtRule](https://github.com/pmd/pmd/blob/master/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyForeachStmtRule.java)

**Use this rule by referencing it:**
``` xml
<rule ref="category/vm/errorprone.xml/EmptyForeachStmt" />
```

## EmptyIfStmt

**Since:** PMD 5.1

**Priority:** Medium High (2)

Empty if statements should be deleted.

**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.vm.rule.errorprone.EmptyIfStmtRule](https://github.com/pmd/pmd/blob/master/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyIfStmtRule.java)

**Use this rule by referencing it:**
``` xml
<rule ref="category/vm/errorprone.xml/EmptyIfStmt" />
```

