codeconsole commented on code in PR #16134:
URL: https://github.com/apache/grails-core/pull/16134#discussion_r3817398795
##########
grails-gsp/core/src/main/groovy/org/grails/gsp/GroovyPage.java:
##########
@@ -296,6 +310,23 @@ public Object getProperty(String property) {
return resolveProperty(property);
}
+ /**
+ * Resolves a tag called without a namespace, as {@code ${message(code:
'x')}} is.
+ *
+ * <p>A real method rather than one installed onto this page's metaclass.
Installing it, along with
+ * a method for every tag and a property for every namespace, meant
writing to an
+ * ExpandoMetaClass for every page compiled and made every later tag call
a read of an initialised
+ * metaclass, which is guarded by a lock.
+ *
+ * @param name the tag name
+ * @param args the arguments the tag was called with
+ * @return whatever the tag produces
+ */
+ public Object methodMissing(String name, Object args) {
+ return TagLibraryMetaUtils.methodMissingForTagLib(getMetaClass(),
getClass(), gspTagLibraryLookup,
Review Comment:
Kept — the guard stays, with the comment stating the contract and
`GroovyPageMethodMissingSpec` pinning it.
##########
grails-gsp/grails-taglib/src/main/groovy/org/grails/taglib/index/TagLibraryIndexEntry.java:
##########
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.grails.taglib.index;
+
+/**
+ * One tag recorded in the {@link TagLibraryIndex} at compile time.
+ *
+ * @param namespace the tag library namespace the tag is reachable through
+ * @param tagName the tag name within that namespace
+ * @param tagLibraryClassName the binary name of the tag library declaring the
tag
+ * @param kind how the tag is implemented, which decides whether a call to it
can be resolved
+ * @param acceptsBody whether the tag can be called with a body
+ * @since 8.0.0
+ */
+public record TagLibraryIndexEntry(String namespace, String tagName, String
tagLibraryClassName,
Review Comment:
Kept all three — `lookup`, `getTagNamesForClass` and `isClassDescribed`,
beside `isAmbiguous`. Only `getAmbiguousTagNames` and `getIncompleteNamespaces`
were removed.
--
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]