Skip to content

Commit

Permalink
Fixed java recorder problem
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertPoienar committed Jul 18, 2024
1 parent 7ba1bf9 commit f3be42e
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.alttester.AltObject;
import com.alttester.altTesterExceptions.WaitTimeOutException;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonArray;

/**
* Wait until there are no longer any objects that respect the given criteria or
Expand Down Expand Up @@ -76,11 +76,14 @@ public T Execute(Class<T> returnType) {
T propertyFound = altObject.getComponentProperty(
getComponentPropertyParams,
returnType);

if (!getPropertyAsString && propertyFound.equals(property))
return propertyFound;
String str = new Gson().toJsonTree(propertyFound).toString();
jsonElementToString = str.contains("\"") ? str : "\"" + str + "\"";
if (!(propertyFound instanceof JsonArray)) {
String str = new Gson().toJsonTree(propertyFound).toString();
jsonElementToString = str.contains("\"") ? str : "\"" + str + "\"";
} else {
jsonElementToString = propertyFound.toString();
}
if (getPropertyAsString && jsonElementToString.equals(property.toString()))
return propertyFound;

Expand Down

0 comments on commit f3be42e

Please sign in to comment.