Skip to content
Snippets Groups Projects
Commit 542de559 authored by felmer's avatar felmer
Browse files

make resolve() method more robust

SVN: 12593
parent 4b286a39
No related branches found
No related tags found
No related merge requests found
...@@ -43,21 +43,26 @@ public enum BooleanOrUnknown ...@@ -43,21 +43,26 @@ public enum BooleanOrUnknown
return niceRepresentation; return niceRepresentation;
} }
public final static BooleanOrUnknown resolve(final String niceRepresentation) public final static BooleanOrUnknown resolve(final String niceRepresentationOrNull)
{ {
if (niceRepresentation.equals("FALSE")) if (niceRepresentationOrNull == null)
{
return U;
}
if (niceRepresentationOrNull.equals("FALSE"))
{ {
return F; return F;
} }
if (niceRepresentation.equals("TRUE")) if (niceRepresentationOrNull.equals("TRUE"))
{ {
return T; return T;
} }
if (niceRepresentation.equals("UNKNOWN")) if (niceRepresentationOrNull.equals("UNKNOWN"))
{ {
return U; return U;
} }
throw new IllegalArgumentException(String.format("Given nice representation '%s' unknown.")); throw new IllegalArgumentException(String.format("Given nice representation '%s' unknown.",
niceRepresentationOrNull));
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment