Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
fad1efd
refactor: convert grails-gsp-core to Groovy
borinquenkid Oct 10, 2026
fa3b80a
fix: keep the Java-facing API of the converted grails-gsp-core classes
borinquenkid Oct 10, 2026
b0d675f
Merge refactor/java-to-groovy-grails-taglib into refactor/java-to-gro…
borinquenkid Oct 11, 2026
74c56b5
Merge refactor/java-to-groovy-grails-taglib into refactor/java-to-gro…
borinquenkid Oct 13, 2026
5fb84ec
Merge refactor/java-to-groovy-grails-taglib into refactor/java-to-gro…
borinquenkid Oct 13, 2026
a711c06
Merge refactor/java-to-groovy-grails-taglib into refactor/java-to-gro…
borinquenkid Oct 13, 2026
ef0f80c
Merge branch 'refactor/java-to-groovy-grails-taglib' into refactor/ja…
borinquenkid Oct 17, 2026
ec229e4
fix(grails-gsp-core): rename-fix stage 2 for module 17 (6 files)
borinquenkid Oct 17, 2026
0a23dbc
Merge branch 'refactor/java-to-groovy-grails-taglib' into refactor/ja…
borinquenkid Oct 18, 2026
9ff47f1
Merge branch 'refactor/java-to-groovy-grails-taglib' into refactor/ja…
borinquenkid Oct 18, 2026
1a8d1fe
Merge branch 'refactor/java-to-groovy-grails-taglib' into refactor/ja…
borinquenkid Oct 18, 2026
aad4fda
Merge branch 'refactor/java-to-groovy-grails-taglib' into refactor/ja…
borinquenkid Oct 18, 2026
321fb1d
Merge branch 'refactor/java-to-groovy-grails-taglib' into refactor/ja…
borinquenkid Oct 19, 2026
8aadaa6
Merge branch 'refactor/java-to-groovy-grails-taglib' into refactor/ja…
borinquenkid Oct 20, 2026
da34c43
Merge branch 'refactor/java-to-groovy-grails-taglib' into refactor/ja…
borinquenkid Oct 20, 2026
c9af49e
Merge commit '2af7487e91ad27d06f0622a11c1d27e022cd2366' into refactor…
borinquenkid Oct 20, 2026
0c00cfc
Merge branch 'refactor/java-to-groovy-grails-taglib' into refactor/ja…
borinquenkid Oct 21, 2026
a5a4233
Merge branch 'refactor/java-to-groovy-grails-taglib' into refactor/ja…
borinquenkid Oct 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.grails.gsp.aot;
package org.apache.grails.gsp.aot

import org.jspecify.annotations.Nullable;
import groovy.transform.CompileStatic
import org.jspecify.annotations.Nullable
import org.springframework.aot.hint.RuntimeHints
import org.springframework.aot.hint.RuntimeHintsRegistrar

import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.RuntimeHintsRegistrar;

import org.grails.gsp.GroovyPageMetaInfo;
import org.grails.gsp.GroovyPageMetaInfo

/**
* Registers what a page compiled at build time is read from.
Expand All @@ -38,15 +38,17 @@
*
* @since 8.0
*/
public class PrecompiledPageRuntimeHints implements RuntimeHintsRegistrar {
@CompileStatic
class PrecompiledPageRuntimeHints implements RuntimeHintsRegistrar {

/** Where the pages compiled at build time are listed, read to find them at all. */
private static final String VIEWS = "gsp/views.properties";
private static final String VIEWS = 'gsp/views.properties'

@Override
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
hints.resources().registerPattern(VIEWS);
hints.resources().registerPattern("*" + GroovyPageMetaInfo.HTML_DATA_POSTFIX);
hints.resources().registerPattern("*" + GroovyPageMetaInfo.LINENUMBERS_DATA_POSTFIX);
void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
hints.resources().registerPattern(VIEWS)
hints.resources().registerPattern('*' + GroovyPageMetaInfo.HTML_DATA_POSTFIX)
hints.resources().registerPattern('*' + GroovyPageMetaInfo.LINENUMBERS_DATA_POSTFIX)
}

}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,86 +16,86 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.grails.gsp;
package org.grails.gsp

import java.util.Map;
import groovy.transform.CompileStatic
import org.apache.commons.logging.Log
import org.apache.commons.logging.LogFactory

import groovy.lang.Binding;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import grails.plugins.GrailsPlugin;
import org.grails.taglib.TemplateVariableBinding;
import grails.plugins.GrailsPlugin
import org.grails.taglib.TemplateVariableBinding

/**
* Script Binding that is used in GSP evaluation.
*
* @author Lari Hotari
*/
public class GroovyPageBinding extends TemplateVariableBinding {
private static final Log log = LogFactory.getLog(GroovyPageBinding.class);
@CompileStatic
class GroovyPageBinding extends TemplateVariableBinding {

public GroovyPageBinding() {
super();
private static final Log log = LogFactory.getLog(GroovyPageBinding)

GroovyPageBinding() {
super()
}

public GroovyPageBinding(Binding parent) {
super(parent);
GroovyPageBinding(Binding parent) {
super(parent)
}

public GroovyPageBinding(String pluginContextPath) {
setPluginContextPath(pluginContextPath);
GroovyPageBinding(String pluginContextPath) {
setPluginContextPath(pluginContextPath)
}

@SuppressWarnings("rawtypes")
public GroovyPageBinding(Map variables) {
super(variables);
@SuppressWarnings('rawtypes')
GroovyPageBinding(Map variables) {
super(variables)
}

public GroovyPageBinding(String[] args) {
super(args);
GroovyPageBinding(String[] args) {
super(args)
}

@SuppressWarnings("unchecked")
@SuppressWarnings('unchecked')
@Override
public Object getVariable(String name) {
Object val = getVariablesMap().get(name);
Object getVariable(String name) {
Object val = getVariablesMap().get(name)
if (val == null && !getVariablesMap().containsKey(name)) {
if (GroovyPage.PAGE_SCOPE.equals(name)) return this;
return super.getVariable(name);
if (GroovyPage.PAGE_SCOPE.equals(name)) return this
return super.getVariable(name)
}
return val;
return val
}

protected boolean shouldUseChildBinding(TemplateVariableBinding childBinding) {
return isRoot() || hasSameOwnerClass(childBinding);
return isRoot() || hasSameOwnerClass(childBinding)
}

private boolean hasSameOwnerClass(TemplateVariableBinding otherBinding) {
// owner class can be same in recursive rendering; in that case, the child binding should be used for setting variable values
return (getOwner() != null && otherBinding.getOwner() != null && getOwner().getClass() == otherBinding.getOwner().getClass());
return (getOwner() != null && otherBinding.getOwner() != null && getOwner().getClass() == otherBinding.getOwner().getClass())
}

public String getPluginContextPath() {
return (String) getVariable(GroovyPage.PLUGIN_CONTEXT_PATH);
String getPluginContextPath() {
return (String) getVariable(GroovyPage.PLUGIN_CONTEXT_PATH)
}

@SuppressWarnings("unchecked")
public void setPluginContextPath(String pluginContextPath) {
getVariablesMap().put(GroovyPage.PLUGIN_CONTEXT_PATH, pluginContextPath);
@SuppressWarnings('unchecked')
void setPluginContextPath(String pluginContextPath) {
getVariablesMap().put(GroovyPage.PLUGIN_CONTEXT_PATH, pluginContextPath)
}

@SuppressWarnings("unchecked")
public void setPagePlugin(GrailsPlugin plugin) {
getVariablesMap().put("pagePlugin", plugin);
@SuppressWarnings('unchecked')
void setPagePlugin(GrailsPlugin plugin) {
getVariablesMap().put('pagePlugin', plugin)
}

public GrailsPlugin getPagePlugin() {
return (GrailsPlugin) getVariable("pagePlugin");
GrailsPlugin getPagePlugin() {
return (GrailsPlugin) getVariable('pagePlugin')
}

protected boolean isReservedName(String name) {
return GroovyPage.isReservedName(name);
return GroovyPage.isReservedName(name)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,57 +16,59 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.grails.gsp;
package org.grails.gsp

import java.security.CodeSource;
import java.security.CodeSource

import groovy.lang.GroovyClassLoader;
import org.codehaus.groovy.control.CompilationUnit;
import org.codehaus.groovy.control.CompilerConfiguration;
import org.codehaus.groovy.control.Phases;
import groovy.transform.CompileStatic
import org.codehaus.groovy.control.CompilationUnit
import org.codehaus.groovy.control.CompilerConfiguration
import org.codehaus.groovy.control.Phases

import org.grails.gsp.compiler.transform.GroovyPageInjectionOperation;
import org.grails.gsp.compiler.transform.GroovyPageInjectionOperation

/**
* A class loader that is aware of Groovy Pages and injection operations.
*
* @author Stephane Maldini
* @since 2.0
*/
public class GroovyPageClassLoader extends GroovyClassLoader {
@CompileStatic
class GroovyPageClassLoader extends GroovyClassLoader {

public GroovyPageClassLoader() {
GroovyPageClassLoader() {
// default
}

public GroovyPageClassLoader(ClassLoader loader) {
super(loader);
GroovyPageClassLoader(ClassLoader loader) {
super(loader)
}

public GroovyPageClassLoader(GroovyClassLoader parent) {
super(parent);
GroovyPageClassLoader(GroovyClassLoader parent) {
super(parent)
}

public GroovyPageClassLoader(ClassLoader parent, CompilerConfiguration config, boolean useConfigurationClasspath) {
super(parent, config, useConfigurationClasspath);
GroovyPageClassLoader(ClassLoader parent, CompilerConfiguration config, boolean useConfigurationClasspath) {
super(parent, config, useConfigurationClasspath)
}

public GroovyPageClassLoader(ClassLoader loader, CompilerConfiguration config) {
super(loader, config);
GroovyPageClassLoader(ClassLoader loader, CompilerConfiguration config) {
super(loader, config)
}

/**
* @see groovy.lang.GroovyClassLoader#createCompilationUnit(org.codehaus.groovy.control.CompilerConfiguration, java.security.CodeSource)
*/
@Override
protected CompilationUnit createCompilationUnit(CompilerConfiguration config, CodeSource source) {
CompilationUnit cu = super.createCompilationUnit(config, source);
CompilationUnit cu = super.createCompilationUnit(config, source)

GroovyPageInjectionOperation operation;
GroovyPageInjectionOperation operation

operation = new GroovyPageInjectionOperation();
operation = new GroovyPageInjectionOperation()

cu.addPhaseOperation(operation, Phases.CANONICALIZATION);
return cu;
cu.addPhaseOperation(operation, Phases.CANONICALIZATION)
return cu
}

}
Loading