Problem 295

Summary: G4MaterialPropertiesTable::DumpTable() prints incorrect information, can cause coredump
Product: Geant4 Reporter: gas
Component: materialsAssignee: gum
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.2   
Hardware: PC   
OS: Linux   
URL: http://citnp.caltech.edu/kamland/montecarlo/KLG4sim/G4MaterialPropertiesTable.cc.patch

Description gas 2001-08-27 15:02:05 CEST
Only the first character of each property name is printed by
G4MaterialPropertiesTable::DumpTable(), due to an extra * in the source code.
This is an easy fix.

Additionally, a check for NULL property vector should be added because NULL
entries are created by GetProperty(), at least when using the g++ implementation
of STL maps.  For example, entries with key "RINDEX" and NULL pointers will
exist in any opaque material touched by optical photons in a simulation using
G4OpBoundary process, because the process looks to see if the material has an
RINDEX by calling GetProperty().  This is perfectly reasonable, but the segment
violation from DumpTable is a problem.

While you're at it, might as well fix the warning message in RemoveEntry() to
say "RemoveEntry" instead of "AddEntry".