@@ -608,7 +608,7 @@ private void verifyRecommendationWarnings(NodeData node, boolean recommendInline
608
608
609
609
if (recommendInline && !node .isGenerateInline () && mode == ParseMode .DEFAULT && node .isGenerateCached ()) {
610
610
611
- AnnotationMirror annotation = getGenerateInlineAnnotation (node .getTemplateType ());
611
+ AnnotationMirror annotation = getGenerateInlineAnnotation (node .getTemplateType (). asType () );
612
612
if (annotation == null ) {
613
613
614
614
NodeSizeEstimate estimate = computeInlinedSizeEstimate (FlatNodeGenFactory .createInlinedFields (node ));
@@ -948,7 +948,7 @@ private boolean initializeInlinable(DSLExpressionResolver resolver, NodeData nod
948
948
VariableElement instanceField = getNodeFirstInstanceField (node .getTemplateType ());
949
949
if (instanceField != null ) {
950
950
if (emitErrors ) {
951
- node .addError (getGenerateInlineAnnotation (node .getTemplateType ()), null , "Failed to generate code for @%s: The node must not declare any instance variables. " +
951
+ node .addError (getGenerateInlineAnnotation (node .getTemplateType (). asType () ), null , "Failed to generate code for @%s: The node must not declare any instance variables. " +
952
952
"Found instance variable %s.%s. Remove instance variable to resolve this." ,
953
953
getSimpleName (types .GenerateInline ),
954
954
getSimpleName (instanceField .getEnclosingElement ().asType ()), instanceField .getSimpleName ().toString ());
@@ -1018,16 +1018,16 @@ public static boolean isGenerateUncached(TypeElement templateType) {
1018
1018
}
1019
1019
1020
1020
static boolean isGenerateInline (TypeElement templateType ) {
1021
- AnnotationMirror annotation = getGenerateInlineAnnotation (templateType );
1021
+ AnnotationMirror annotation = getGenerateInlineAnnotation (templateType . asType () );
1022
1022
Boolean value = Boolean .FALSE ;
1023
1023
if (annotation != null ) {
1024
1024
value = ElementUtils .getAnnotationValue (Boolean .class , annotation , "value" );
1025
1025
}
1026
1026
return value ;
1027
1027
}
1028
1028
1029
- static AnnotationMirror getGenerateInlineAnnotation (TypeElement templateType ) {
1030
- return findGenerateAnnotation (templateType . asType () , ProcessorContext .getInstance ().getTypes ().GenerateInline );
1029
+ static AnnotationMirror getGenerateInlineAnnotation (TypeMirror type ) {
1030
+ return findGenerateAnnotation (type , ProcessorContext .getInstance ().getTypes ().GenerateInline );
1031
1031
}
1032
1032
1033
1033
public static AnnotationMirror findGenerateAnnotation (TypeMirror nodeType , DeclaredType annotationType ) {
@@ -4155,7 +4155,7 @@ private boolean forceInlineByDefault(CacheExpression cache) {
4155
4155
return hasInlineMethod (cache );
4156
4156
}
4157
4157
if (ElementUtils .isAssignable (parameterType .asType (), types .Node )) {
4158
- AnnotationMirror inlineAnnotation = getGenerateInlineAnnotation (parameterType );
4158
+ AnnotationMirror inlineAnnotation = getGenerateInlineAnnotation (parameterType . asType () );
4159
4159
if (inlineAnnotation != null ) {
4160
4160
return getAnnotationValue (Boolean .class , inlineAnnotation , "value" ) &&
4161
4161
getAnnotationValue (Boolean .class , inlineAnnotation , "inlineByDefault" );
@@ -4164,16 +4164,14 @@ private boolean forceInlineByDefault(CacheExpression cache) {
4164
4164
return false ;
4165
4165
}
4166
4166
4167
- private boolean isGenerateInlineFalse (CacheExpression cache ) {
4168
- TypeElement parameterType = ElementUtils . castTypeElement ( cache .getParameter ().getType () );
4169
- if (parameterType == null ) {
4167
+ private static boolean isGenerateInlineFalse (CacheExpression cache ) {
4168
+ TypeMirror type = cache .getParameter ().getType ();
4169
+ if (! NodeCodeGenerator . isSpecializedNode ( type ) ) {
4170
4170
return false ;
4171
4171
}
4172
- if (ElementUtils .isAssignable (parameterType .asType (), types .Node )) {
4173
- AnnotationMirror inlineAnnotation = getGenerateInlineAnnotation (parameterType );
4174
- if (inlineAnnotation != null && getAnnotationValue (Boolean .class , inlineAnnotation , "value" ) == false ) {
4175
- return true ;
4176
- }
4172
+ AnnotationMirror inlineAnnotation = getGenerateInlineAnnotation (type );
4173
+ if (inlineAnnotation != null && getAnnotationValue (Boolean .class , inlineAnnotation , "value" ) == false ) {
4174
+ return true ;
4177
4175
}
4178
4176
return false ;
4179
4177
}
0 commit comments