From 2a22661a7a9e60a290d36ea4777bcc0f71f679f2 Mon Sep 17 00:00:00 2001 From: nimakarimipour Date: Thu, 10 Oct 2024 12:42:22 -0500 Subject: [PATCH] bug fix --- injector/src/main/java/edu/ucr/cs/riple/injector/Helper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/injector/src/main/java/edu/ucr/cs/riple/injector/Helper.java b/injector/src/main/java/edu/ucr/cs/riple/injector/Helper.java index 6985f66b5..a509ae61c 100644 --- a/injector/src/main/java/edu/ucr/cs/riple/injector/Helper.java +++ b/injector/src/main/java/edu/ucr/cs/riple/injector/Helper.java @@ -393,7 +393,9 @@ public static Type getTypeFromNode(NodeWithAnnotations node) { return ((MethodDeclaration) node).getType(); } if (node instanceof FieldDeclaration) { - return ((FieldDeclaration) node).getElementType(); + FieldDeclaration fd = (FieldDeclaration) node; + Preconditions.checkArgument(!fd.getVariables().isEmpty()); + return fd.getVariables().get(0).getType(); } if (node instanceof VariableDeclarationExpr) { NodeList decls = ((VariableDeclarationExpr) node).getVariables();