[OLINGO-633] Minor clean up

This commit is contained in:
Michael Bolz 2015-04-22 09:17:56 +02:00
parent 44ff6c95c0
commit fe82f525e4
1 changed files with 5 additions and 5 deletions

View File

@ -173,14 +173,15 @@ public class EdmEnumTypeImpl extends EdmTypeImpl implements EdmEnumType {
} }
} }
protected String constructEnumValue(final long value) private String constructEnumValue(final long value)
throws EdmPrimitiveTypeException { throws EdmPrimitiveTypeException {
long remaining = value; long remaining = value;
StringBuilder result = new StringBuilder(); final StringBuilder result = new StringBuilder();
final boolean flags = isFlags();
for (final EdmMember member : getMembers()) { for (final EdmMember member : getMembers()) {
if (isFlags()) {
final long memberValue = Long.parseLong(member.getValue()); final long memberValue = Long.parseLong(member.getValue());
if (flags) {
if ((memberValue & remaining) == memberValue) { if ((memberValue & remaining) == memberValue) {
if (result.length() > 0) { if (result.length() > 0) {
result.append(','); result.append(',');
@ -189,7 +190,6 @@ public class EdmEnumTypeImpl extends EdmTypeImpl implements EdmEnumType {
remaining ^= memberValue; remaining ^= memberValue;
} }
} else { } else {
final long memberValue = Long.parseLong(member.getValue());
if (value == memberValue) { if (value == memberValue) {
return member.getName(); return member.getName();
} }