From 77d641a916a3f00a804234656e94e098a6b42229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20K=C3=BChne?= Date: Mon, 17 Feb 2003 05:21:31 +0000 Subject: [PATCH] added example for SimplifyBooleanReturn --- docs/config_misc.html | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/config_misc.html b/docs/config_misc.html index 2e0da3c03..1747df258 100644 --- a/docs/config_misc.html +++ b/docs/config_misc.html @@ -301,8 +301,23 @@

SimplifyBooleanReturn

Description

- Checks for overly complicated boolean return statements. Idea shamelessly stolen - from the equivalent PMD rule. + Checks for overly complicated boolean return statements. For example the following code +

+
+if (valid())
+    return false;
+else
+    return true;
+      
+

+ could be written as +

+return !valid();
+      
+

+

+ The Idea for this Check has been shamelessly stolen + from the equivalent PMD rule.

Example