jamesfredley commented on code in PR #15398:
URL: https://github.com/apache/grails-core/pull/15398#discussion_r2829632522


##########
grails-gsp/core/src/main/groovy/org/grails/gsp/compiler/GroovyPageParser.java:
##########
@@ -463,14 +463,11 @@ public void writeLineNumbers(File filename) throws 
IOException {
     }
 
     private void declare(boolean gsp) {
-        if (finalPass) {
-            return;
-        }
-
-        out.println();
-        write(scan.getToken().trim(), gsp);

Review Comment:
   With https://github.com/jamesfredley/grails-gsp-declaration-block-bug it can 
be reproduced.  The reason this was not brought up for fixed before is likely 
that `<%! int counter = 0; %>` has been a known anti-pattern for a long time in 
JSP and most user didn't try it in GSP because it is not a good idea.  This is 
a super edge case, but does produce a runtime exception if you do it.    



-- 
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]

Reply via email to