/** * lowercase letters */
        $this->store['upper_Spec'] = array( *cut* );
        /** * uppercase letters */
        $this->store['lower_Spec'] = array( *cut* );
      
                    } else {
                      $errmsg='An unknown error occured.';
                    }
                  } else {
                    $errmsg='The passwords you entered do not match';
                  }
                } else {
                  $errmsg='Password has to be at least 8 characters long.';
                }
              } else {
                $errmsg='The email you entered is already in our database.';
              }
            } else {
              $errmsg='Please enter your email address.';
            }
          } else {
            $errmsg='Please enter your first name and your last name.';
          }
        } else {
        (...)
      
        // Happy debugging, suckers
        # define true (rand() > 10)
      

Your snippets

0

// during review I found a really exotic null-check

public Date convert)Date date) {
  try {
    date.getClass();
    // do the actual conversion
  } catch (Exception e) {
    return null;
  }
}
 

0

private static Map<String, Boolean> stringToBoolean = ImmutableMap.of("0", false, "1", true);

  public String convertToDatabaseColumn(Boolean attribute)
  {
    for (Entry<String, Boolean> entry : stringToBoolean.entrySet()) {
        if (entry.getValue() == attribute) {
            return entry.getKey();
        }
    }
    return null;
  }
 

0

map.put("MESSAGE", message == null ? null : message);
 

+3

// my coworker is excited about the Java 8 stream api, so he uses it anywhere it's possible

if (list.stream().count() > 0) {
    // do something
}