Skip to content

Commit

Permalink
if no cache tag
Browse files Browse the repository at this point in the history
  • Loading branch information
foolishchow committed Apr 23, 2021
1 parent f2016a5 commit ad5523f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public void process(
.addStatement("return")
.endControlFlow();

boolean hasCacheToTag = false;
for (Element element : mElements) {

String fieldName = element.getSimpleName().toString();
Expand All @@ -130,6 +131,7 @@ public void process(
addFieldKey(builder, fieldName, keyName, originName);
boolean cacheToTag = annotation.cacheToTag();
if (cacheToTag) {
hasCacheToTag = true;
createField(builder, fieldName, typeName);
}

Expand Down Expand Up @@ -159,7 +161,9 @@ public void process(
}

addNormalFragment(builder, originClassType);
addTag(builder, originClassType);
if (hasCacheToTag) {
addTag(builder, originClassType);
}
builder.addMethod(parse.build());

}
Expand Down

0 comments on commit ad5523f

Please sign in to comment.