Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
fix bug that could cause errors "org.omg.CORBA.MARSHAL: Cannot marsha…
Browse files Browse the repository at this point in the history
…ll null string."
  • Loading branch information
gwen-soleil committed Aug 24, 2020
1 parent d903bf9 commit bcb9a7d
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,9 @@ void load(final String deviceName, final String attributeName) throws DevFailed
// use a second map for attribute props that have one value
final Map<String, String> propValuesSingle = new CaseInsensitiveMap<>(propValues.size());
for (final Entry<String, String[]> entry : propValues.entrySet()) {
System.out.println(attributeName + "- "+ entry.getKey() + " = "+ Arrays.toString(entry.getValue()));
final String[] value = entry.getValue();
System.out.println(value.length);
if (value.length == 1 && !value[0].equalsIgnoreCase(Constants.NOT_SPECIFIED)) {
propValuesSingle.put(entry.getKey(), value[0]);
}
Expand All @@ -677,25 +679,27 @@ void load(final String deviceName, final String attributeName) throws DevFailed
if (propValues.containsKey(Constants.LABEL)) {

This comment has been minimized.

Copy link
@bourtemb

bourtemb Aug 25, 2020

Member

@gwen-soleil , shouldn't this line be:
if (propValuesSingle.containsKey(Constants.LABEL)) {
instead as done below for format, unit, etc... ?

This comment has been minimized.

Copy link
@gwen-soleil

gwen-soleil Aug 25, 2020

Collaborator

Ooops, thanks you -> fixed

setLabel(propValuesSingle.get(Constants.LABEL));
}
System.out.println(attributeName + "load " + propValues);
System.out.println(attributeName + "load propValuesSingle " + propValuesSingle);
if (!isFwdAttribute) {
if (propValues.containsKey(Constants.FORMAT)) {
if (propValuesSingle.containsKey(Constants.FORMAT)) {
setFormat(propValuesSingle.get(Constants.FORMAT));
}
if (propValues.containsKey(Constants.UNIT)) {
if (propValuesSingle.containsKey(Constants.UNIT)) {
setUnit(propValuesSingle.get(Constants.UNIT));
}
if (propValues.containsKey(Constants.DISPLAY_UNIT)) {
if (propValuesSingle.containsKey(Constants.DISPLAY_UNIT)) {
setDisplayUnit(propValuesSingle.get(Constants.DISPLAY_UNIT));
}
if (propValues.containsKey(Constants.STANDARD_UNIT)) {
if (propValuesSingle.containsKey(Constants.STANDARD_UNIT)) {
setStandardUnit(propValuesSingle.get(Constants.STANDARD_UNIT));
}
setMinMax(propValuesSingle);
if (propValues.containsKey(Constants.DESC)) {
if (propValuesSingle.containsKey(Constants.DESC)) {
setDescription(propValuesSingle.get(Constants.DESC));
}
setEventProperties(propValuesSingle);
if (propValues.containsKey(Constants.ENUM_LABELS)) {
if (propValuesSingle.containsKey(Constants.ENUM_LABELS)) {
setEnumLabels(propValues.get(Constants.ENUM_LABELS));
}
}
Expand Down

0 comments on commit bcb9a7d

Please sign in to comment.