Skip to content

Commit

Permalink
Trivial refactoring: extract constants
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellansun committed Nov 23, 2024
1 parent 501ea69 commit 86b327a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/org/codehaus/groovy/classgen/Verifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ public class Verifier implements GroovyClassVisitor, Opcodes {
private static final ClassNode GENERATED_ANNOTATION = ClassHelper.make(Generated.class);
private static final ClassNode INTERNAL_ANNOTATION = ClassHelper.make(Internal .class);
private static final ClassNode TRANSIENT_ANNOTATION = ClassHelper.make(Transient.class);
private static final ClassNode POJO_ANNOTATION = ClassHelper.make(POJO.class);
private static final ClassNode COMPILESTATIC_ANNOTATION = ClassHelper.make(CompileStatic.class);

// NOTE: timeStamp constants shouldn't belong to Verifier but kept here for binary compatibility
public static final String __TIMESTAMP = "__timeStamp";
Expand Down Expand Up @@ -251,8 +253,7 @@ public void visitClass(final ClassNode node) {
addDefaultParameterMethods(node);
addDefaultParameterConstructors(node);

boolean skipGroovify = hasAnnotation(node, ClassHelper.make(POJO.class))
&& hasAnnotation(node, ClassHelper.make(CompileStatic.class));
boolean skipGroovify = hasAnnotation(node, POJO_ANNOTATION) && hasAnnotation(node, COMPILESTATIC_ANNOTATION);
if (!skipGroovify) {
String classInternalName = BytecodeHelper.getClassInternalName(node);

Expand Down

0 comments on commit 86b327a

Please sign in to comment.