codeconsole commented on code in PR #16224:
URL: https://github.com/apache/grails-core/pull/16224#discussion_r3899769270


##########
grails-beans-dsl/src/main/java/org/grails/compiler/beans/GrailsBeansASTTransformation.java:
##########
@@ -324,9 +330,26 @@ private ClassNode createAutoConfigurationSibling(ClassNode 
pluginClass, Annotati
         sibling.addAnnotations(siblingAnnotations);
         pluginClass.getAnnotations().removeAll(siblingAnnotations);
 
+        // The name is settled here and nowhere else. The global transform 
consumes this metadata
+        // and registers it using its Eclipse-aware compilation target 
resolution.
+        
pluginClass.putNodeMetaData(GENERATED_AUTO_CONFIGURATION_NAME_METADATA, 
siblingName);
+        if (!isEclipseSourceUnit(source)) {
+            AutoConfigurationImportsWriter.register(siblingName, 
targetDirectory(source), source, compilationUnit);

Review Comment:
   Correcting the previous reply: I said the gate could stay as defence, and 
that was the wrong call. Removed in d178826, along with the counting claim in 
its specification.
   
   Checked rather than assumed this time. There is one call site for `register` 
now, so the same name cannot reach the hand-authored branch twice in a 
compilation - the gate reported on nothing. Worse, its specification passed 
with the gate taken out, so it was a test that could not fail sitting in front 
of a branch nobody was holding.
   
   The case itself is worth keeping, so it stays with the counting dropped: a 
hand-authored file missing the generated class is told which name to add, and 
no second file is generated beside it. That one does fail when the warning is 
removed - verified by suppressing it.
   
   Net effect for the original point: the duplicate is gone structurally rather 
than suppressed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to