Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Grails issue #12460 #257

Merged
merged 1 commit into from Apr 12, 2022
Merged

Fixed Grails issue #12460 #257

merged 1 commit into from Apr 12, 2022

Conversation

rainboyan
Copy link

Use BeanClassLoaderAware, no need to set classLoader property declaratively.

See grails/grails-core#12460

Use BeanClassLoaderAware, no need to set classLoader property declaratively.
@CLAassistant
Copy link

CLAassistant commented Apr 1, 2022

CLA assistant check
All committers have signed the CLA.

@darxriggs
Copy link

darxriggs commented Apr 2, 2022

Shouldn't springVersion in gradle.properties also be updated to make sure everything fits together?
grailsVersion and springBootVersion could be updated too.

@rainboyan
Copy link
Author

@darxriggs you're right, see another PR #258

@@ -202,7 +202,7 @@ class GroovyPagesGrailsPlugin extends Plugin {

// Setup the main templateEngine used to render GSPs
groovyPagesTemplateEngine(GroovyPagesTemplateEngine) { bean ->
classLoader = ref("classLoader")
bean.lazyInit = true
Copy link
Contributor

@puneetbehl puneetbehl Apr 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change of lazyInit related to the issue?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no. gspTagLibraryLookup is very time consuming, it is lazy, so I add too.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on my test, the lazy-init doesn't have a noticeable effect, I can remove it currently.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a method to optimize gspTagLibraryLookup, this will greatly reduce initialization time.

@@ -201,14 +201,6 @@ public void setJspTagLibraryResolver(TagLibraryResolver jspTagLibraryResolver) {
this.jspTagLibraryResolver = jspTagLibraryResolver;
}

/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any specific reason to remove the setter?

Copy link

@darxriggs darxriggs Apr 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The discussion started here in spring-framework and this answer should shed some light on this.

@puneetbehl puneetbehl merged commit cd72ca0 into grails:5.1.x Apr 12, 2022
@darxriggs darxriggs mentioned this pull request Apr 12, 2022
@rainboyan
Copy link
Author

@puneetbehl will this be merged to 5.2.x?
There is no need to set classLoader property declaratively, and the classLoader only exists in Micronaut parent context, but I don't want to use it. What do you think?

@rainboyan rainboyan deleted the issue_12460 branch September 9, 2022 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants