Skip to content

Commit

Permalink
fix spotbugs
Browse files Browse the repository at this point in the history
  • Loading branch information
mikir committed Feb 5, 2024
1 parent f924092 commit f4fa77d
Showing 1 changed file with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -774,19 +774,16 @@ public boolean arrayTraitsNeedsOwner()
//@compound_read_field_inner
public String readFieldInner(boolean packed)
{
String callExpr = null;
StringBuilder callExpr = null;
String expr = null;
if (packed && isPackable && array == null)
{
if (compound != null)
{
callExpr = "read(context." + getterName + "(), in";
if (compound != null)
{
for (InstantiatedParameterData param : compound.getInstantiatedParameters())
callExpr += ", " + param.getExpression();
}
callExpr += ", allocator)";
callExpr = new StringBuilder("read(context." + getterName + "(), in");
for (InstantiatedParameterData param : compound.getInstantiatedParameters())
callExpr.append(", " + param.getExpression());
callExpr.append(", allocator)");
}
else if (typeInfo.getIsEnum())
{
Expand Down Expand Up @@ -831,17 +828,17 @@ else if (array != null)
if (array.getLength() != null)
args.add("static_cast<size_t>(" + array.getLength() + ")");

callExpr = "read";
callExpr = new StringBuilder("read");
if (isPackable && (packed || array.getIsPacked()))
callExpr += "Packed";
callExpr += "(" + String.join(", ", args) + ")";
callExpr.append("Packed");
callExpr.append("(" + String.join(", ", args) + ")");
}
else if (compound != null)
{
callExpr = "read(in";
callExpr = new StringBuilder("read(in");
for (InstantiatedParameterData param : compound.getInstantiatedParameters())
callExpr += ", " + param.getExpression();
callExpr += ", allocator)";
callExpr.append(", " + param.getExpression());
callExpr.append(", allocator)");
}
else
{
Expand Down

0 comments on commit f4fa77d

Please sign in to comment.