Skip to content

Commit 322829a

Browse files
committed
Fix parsing of clock status for non specified (0xFF) value
1 parent 8aaf95f commit 322829a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

development/src/main/java/gurux/dlms/enums/ClockStatus.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,10 @@ private static ClockStatus[] getEnumConstants() {
132132
* @return The enumerated value, which represents the integer.
133133
*/
134134
public static java.util.Set<ClockStatus> forValue(final int value) {
135-
java.util.Set<ClockStatus> types;
135+
java.util.Set<ClockStatus> types = new HashSet<ClockStatus>();
136136
if (value == 0) {
137-
types = new HashSet<ClockStatus>();
138137
types.add(ClockStatus.OK);
139-
} else {
140-
types = new HashSet<ClockStatus>();
138+
} else if (value != 0xFF) {
141139
ClockStatus[] enums = getEnumConstants();
142140
for (int pos = 0; pos != enums.length; ++pos) {
143141
if (enums[pos] != ClockStatus.OK

0 commit comments

Comments
 (0)