Skip to content

Commit

Permalink
chore(engx): Add class object to TypeNode (#654)
Browse files Browse the repository at this point in the history
  • Loading branch information
miraleung authored Feb 16, 2021
1 parent 851cf1e commit d686c96
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ public enum TypeKind {
public static final TypeNode SHORT_OBJECT =
withReference(ConcreteReference.withClazz(Short.class));

public static final TypeNode CLASS_OBJECT =
withReference(ConcreteReference.withClazz(Class.class));

public static final TypeNode BYTESTRING =
TypeNode.withReference(ConcreteReference.withClazz(ByteString.class));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,7 @@ public static Expr createLroSettingsBuilderExpr(
t ->
VariableExpr.builder()
.setVariable(
Variable.builder()
.setType(TypeNode.withReference(ConcreteReference.withClazz(Class.class)))
.setName("class")
.build())
Variable.builder().setType(TypeNode.CLASS_OBJECT).setName("class").build())
.setStaticReferenceType(t)
.build();
builderSettingsExpr =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1561,11 +1561,7 @@ private static List<Statement> createRpcLroExceptionTestCatchBody(

Expr testExpectedValueExpr =
VariableExpr.builder()
.setVariable(
Variable.builder()
.setType(TypeNode.withReference(ConcreteReference.withClazz(Class.class)))
.setName("class")
.build())
.setVariable(Variable.builder().setType(TypeNode.CLASS_OBJECT).setName("class").build())
.setStaticReferenceType(FIXED_TYPESTORE.get("InvalidArgumentException"))
.build();
Expr getCauseExpr =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -999,11 +999,7 @@ private static List<MethodDefinition> createDefaultHelperAndGetterMethods(
.setArguments(
VariableExpr.builder()
.setVariable(
Variable.builder()
.setType(
TypeNode.withReference(ConcreteReference.withClazz(Class.class)))
.setName("class")
.build())
Variable.builder().setType(TypeNode.CLASS_OBJECT).setName("class").build())
.setStaticReferenceType(
typeStore.get(ClassNames.getServiceStubSettingsClassName(service)))
.build())
Expand Down

0 comments on commit d686c96

Please sign in to comment.