This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new 1a4542c Trivial refactoring: extract common variable
1a4542c is described below
commit 1a4542c9645b5cf4eeeeb325f141114d6f2e4083
Author: Daniel Sun <[email protected]>
AuthorDate: Sun Jul 19 18:22:58 2020 +0800
Trivial refactoring: extract common variable
---
src/main/java/org/codehaus/groovy/vmplugin/v8/Java8.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/codehaus/groovy/vmplugin/v8/Java8.java
b/src/main/java/org/codehaus/groovy/vmplugin/v8/Java8.java
index 4e56e63..bf865da 100644
--- a/src/main/java/org/codehaus/groovy/vmplugin/v8/Java8.java
+++ b/src/main/java/org/codehaus/groovy/vmplugin/v8/Java8.java
@@ -311,14 +311,15 @@ public class Java8 implements VMPlugin {
public void configureAnnotationNodeFromDefinition(AnnotationNode
definition, AnnotationNode root) {
ClassNode type = definition.getClassNode();
- if ("java.lang.annotation.Retention".equals(type.getName())) {
+ final String typeName = type.getName();
+ if ("java.lang.annotation.Retention".equals(typeName)) {
Expression exp = definition.getMember("value");
if (!(exp instanceof PropertyExpression)) return;
PropertyExpression pe = (PropertyExpression) exp;
String name = pe.getPropertyAsString();
RetentionPolicy policy = RetentionPolicy.valueOf(name);
setRetentionPolicy(policy, root);
- } else if ("java.lang.annotation.Target".equals(type.getName())) {
+ } else if ("java.lang.annotation.Target".equals(typeName)) {
Expression exp = definition.getMember("value");
if (!(exp instanceof ListExpression)) return;
ListExpression le = (ListExpression) exp;