| Summary: | UcumEssenceService.getProperties() does not return all the quantitative properties | ||
|---|---|---|---|
| Product: | [Technology] UOMo | Reporter: | Peter Melnikov <peter.melnikov> |
| Component: | UCUM | Assignee: | Werner Keil <werner.keil> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | ||
| Version: | 0.6.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | All | ||
| Whiteboard: | |||
Fixed and added unit test asserting the units in getProperties() |
UcumEssenceService.getProperties() does not return all the physical properties used in definition of units. Current implementation returns only the properties for DefinedUnit-s: public Set<String> getProperties() { Set<String> result = new HashSet<String>(); for (DefinedUnit unit : model.getDefinedUnits()) { result.add(unit.getProperty()); } return result; } but "luminous intensity" is missed in the returned set, because it used in one of BaseUnit-s. Proposed fix for the method: public Set<String> getProperties() { Set<String> result = new HashSet<String>(); for (DefinedUnit unit : model.getDefinedUnits()) { result.add(unit.getProperty()); } for (BaseUnit unit : model.getBaseUnits()) { result.add(unit.getProperty()); } return result; }