Stuaarts opened a new pull request, #9595:
URL: https://github.com/apache/netbeans/pull/9595

   ## Description
   
   Fixes Apache NetBeans issue #5244. Java code templates such as `sout` were 
rejected when entered as the single-statement body of a `for` loop without 
braces.
   
   The filter already supported `FOR_LOOP` and `ENHANCED_FOR_LOOP`, but it 
applied a loop-header closing-parenthesis check to the body as well. The fix 
uses the loop statement source position to distinguish body context from header 
context, preserving the existing header validation.
   
   ## Tests
   
   - `ant '-Dcluster.config=basic' build` (baseline passed)
   - `ant -f java/java.editor/build.xml test-single 
-Dtest.includes=org/netbeans/modules/editor/java/JavaCodeTemplateProcessorTest.java`
 (passed)
   - Manual test in rebuilt NetBeans IDE: original unbraced `for` body sequence 
expands `sout` to `System.out.println("");`
   - Full `java.editor` unit suite: unrelated `ComputeImportsTest` CRLF/LF 
fixture failures on Windows; other suites passed
   
   Assisted-by: GPT-5 Codex GPT-5


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to