Skip to Navigation | Skip to Content

Ref_impl_Eiffel mailing list archives

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[ref_impl_eiffel] [668] EDT-291: Fix a precondition violation in C_CODE_

  • To: ref_impl_eiffel@openehr.org
  • Subject: [ref_impl_eiffel] [668] EDT-291: Fix a precondition violation in C_CODE_PHRASE.make_from_pattern, caused by revision 659.
  • From: svn@openehr.org
  • Date: Fri, 06 Jun 2008 07:10:49 +0100

Revision: 668
Author:   peter.gummer
Date:     2008-06-06 07:10:48 +0100 (Fri, 06 Jun 2008)

Log Message:
-----------
EDT-291: Fix a precondition violation in 
C_CODE_PHRASE.make_from_pattern, caused by revision 659. The violation 
was in valid_pattern. There is a side-effect in valid_pattern: it calls 
parse_pattern, which initialises code_list. Because the cADL parser now 
calls valid_pattern prior to calling make_from_pattern in order to 
satisfy the precondition, the side-effect has already populated 
code_list; therefore, when make_from_pattern's precondition calls 
valid_pattern again, it finds that the codes are already in code_list 
and therefore rejects the pattern, because it thinks the codes are 
duplicated. This is fixed by resetting code_list to Void in 
default_create, which is called at the start of parse_pattern, so that 
it always begins parsing with a fresh code_list. The side-effect is 
still there, however.

This bug only affected builds with preconditions enabled. Without 
assertions, make_from_pattern avoided the bug by not re-parsing if 
terminology_id is attached.

Modified Paths:
--------------
    
TRUNK/libraries/openehr/src/am/openehr_profile/data_types/text/c_code_phrase.e


_______________________________________________
Ref_impl_eiffel mailing list
Ref_impl_eiffel@openehr.org
http://lists.chime.ucl.ac.uk/mailman/listinfo/ref_impl_eiffel