Community
Participate
Working Groups
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; }
Fixed and added unit test asserting the units in getProperties()