Skip to content

Commit

Permalink
#93: Fixed a bug Data.get throwing JsonSyntaxException when parsing s…
Browse files Browse the repository at this point in the history
…trings with spaces - added final keyword
  • Loading branch information
Marcel Pfotenhauer committed Jun 12, 2019
1 parent ccb486a commit f3c8a29
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/java/com/xceptance/neodymium/util/DataUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ public static String randomPassword()
*/
public static <T> T get(final Class<T> clazz)
{
Map<String, String> data = Neodymium.getData();
final Map<String, String> data = Neodymium.getData();

JsonObject jsonObject = new JsonObject();
JsonParser parser = new JsonParser();
final JsonObject jsonObject = new JsonObject();
final JsonParser parser = new JsonParser();

// iterate over every data entry and parse the entries to prepare complex structures for object mapping
for (Iterator<String> iterator = data.keySet().iterator(); iterator.hasNext();)
{
String key = (String) iterator.next();
String value = data.get(key);
String trimmedValue = StringUtils.defaultString(value).trim();
final String key = (String) iterator.next();
final String value = data.get(key);
final String trimmedValue = StringUtils.defaultString(value).trim();

if (value == null)
{
Expand Down Expand Up @@ -110,7 +110,7 @@ else if (trimmedValue.startsWith("{") || trimmedValue.startsWith("["))
*/
public static String asString(String key)
{
String value = Neodymium.dataValue(key);
final String value = Neodymium.dataValue(key);
if (value == null)
{
throw new IllegalArgumentException("Test data could not be found for key: " + key);
Expand Down

0 comments on commit f3c8a29

Please sign in to comment.