PR# 18031 Unneeded "if" in {EIFFEL_ENV}.check_environment_variable

Problem Report Summary
Submitter: prestoat2000
Category: Compiler
Priority: Low
Date: 2011/12/02
Class: Bug
Severity: Non-critical
Number: 18031
Release: 7.0.88099
Confidential: No
Status: Open
Responsible:
Environment: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.9.0.10) Gecko/2009042715 Firefox/3.0.10
Synopsis: Unneeded "if" in {EIFFEL_ENV}.check_environment_variable

Description
In routine {EIFFEL_ENV}.check_environment_variable, we have the following
fragment near the end of the routine:

   if is_valid_environment then
      -- Some code I have omitted
   end
ensure
   is_valid_environment: is_valid_environment
end

This is confusing.

The "if" statement is not needed.  If `is_valid_environment' is not true
at that point, then the postcondition will be violated.  The "if" should
probably be replaced by:

   check
      environment_valid: is_valid_environment
   end

The above check assertion is guaranteed to be true because 
`on_check_environment_failure' calls `die'.
To Reproduce

										
Problem Report Interactions