blackdrag commented on code in PR #2645:
URL: https://github.com/apache/groovy/pull/2645#discussion_r3668521717
##########
src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java:
##########
@@ -424,6 +434,20 @@ public void setLogClassgenStackTraceMaxDepth(int
logClassgenStackTraceMaxDepth)
*/
private Set<String> scriptExtensions = new LinkedHashSet<>();
+ /**
+ * Consumer vetoes for {@link groovy.transform.stc.ClassTag @ClassTag}
preemption under static
+ * compilation (GROOVY-12115). Preemption is declared by the API author
+ * ({@code @ClassTag(preempt=true)}) and contained to the declaring class;
this set lets the
+ * consuming build veto it anyway. Entries use the same selector forms as
+ * {@code groovy.extension.disable}: a bare method name ({@code
withDefault}) vetoes all
+ * overloads of that name, a signature form ({@code
withDefault(Map,Class,Closure)}, simple or
+ * fully-qualified type names) vetoes the exact overload, and {@code *}
vetoes all preemption.
+ * Additive injection (supplying an otherwise-mandatory token, such as for
{@code asChecked})
+ * is never gated by this set. Seeded from the {@code
groovy.classtag.preemption.disable}
+ * system property; empty (the default) honours declared intent. Never
null.
+ */
+ private Set<String> classTagPreemptionDisabled =
splitRespectingParens(getSystemPropertySafe("groovy.classtag.preemption.disable"));
Review Comment:
I actually still do not get this part. Why do you want to override the
authors intend? Assuming we compile against a library that is compiled with
this enabled. Then code inside is already generated, the intend is kept. That
leaves code the library user writes. Then why, if I want to prevent a problem,
would I use the compiler configuration for this? And would I not maybe want to
use it one time and at another callsite not? If you say this is needed (why
though?) Then why for the whole codebase at once? How about an annotation to
turn it off? For either a receiver (annotation on variable) or the whole
method, maybe the whole class.
--
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]