sbglasius commented on code in PR #15109:
URL: https://github.com/apache/grails-core/pull/15109#discussion_r2411653858
##########
grails-gsp/core/src/main/groovy/org/grails/gsp/compiler/GroovyPageCompiler.groovy:
##########
@@ -225,11 +224,11 @@ class GroovyPageCompiler {
gpp.generateGsp(gsptarget)
gsptarget.flush()
// write static html parts to data file (read from classpath
at runtime)
- File htmlDataFile = new File(new File(targetDir, packageDir),
className + GroovyPageMetaInfo.HTML_DATA_POSTFIX)
+ File htmlDataFile = new File(new File(targetDir, packageDir),
className + GroovyPageMetaInfo.HTML_DATA_POSTFIX)
Review Comment:
Seems redundant to create two `new File(targetDir, packageDir)` here and in
line 231
##########
grails-gsp/core/src/main/groovy/org/grails/gsp/compiler/GroovyPageCompiler.groovy:
##########
@@ -30,29 +30,30 @@ import groovy.transform.CompileStatic
import org.codehaus.groovy.control.CompilationUnit
import org.codehaus.groovy.control.CompilerConfiguration
import org.codehaus.groovy.control.Phases
-
-import org.apache.commons.logging.Log
-import org.apache.commons.logging.LogFactory
-
+import org.slf4j.LoggerFactory
+import org.slf4j.Logger
import org.springframework.core.CollectionFactory
-
import grails.config.ConfigMap
import org.apache.grails.gradle.common.PropertyFileUtils
import org.grails.config.CodeGenConfig
import org.grails.gsp.GroovyPageMetaInfo
import org.grails.gsp.compiler.transform.GroovyPageInjectionOperation
import org.grails.taglib.encoder.OutputEncodingSettings
+import org.grails.gsp.GroovyPage
/**
- * Used to compile GSP files into a specified target directory.
+ * Used to compile GSP files into a specified target directory. The compiler
creates 3 files per page.
+ * Firstly, it generates a {@link GroovyPage} derived class which is then
compiled to a .class file.
+ * It also will generate a "_html.data" and a "_linenumbers.data" file which
contain the static HTML parts of the page.
+ * These are read at runtime by the {@link
org.grails.gsp.GroovyPagesTemplateEngine} class.
*
* @author Graeme Rocher
* @since 1.2
*/
@CompileStatic
class GroovyPageCompiler {
- private static final Log LOG = LogFactory.getLog(GroovyPageCompiler)
+ private static final Logger LOG =
LoggerFactory.getLogger(GroovyPageCompiler)
Review Comment:
Why not just `@Slf4j('LOG')` and you get `log` statements wrapped in
`if(log.isDebugenabled())` "for free"
--
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]