1919
2020package freemarker .core ;
2121
22- import java .io .IOException ;
23-
24- import freemarker .debug .impl .DebuggerService ;
2522import freemarker .template .TemplateException ;
2623
24+ import java .io .IOException ;
25+
2726/**
28- * <b>Internal API - subject to change: A debug breakpoint inserted into the template</b>
29- *
27+ * <b>Internal API - subject to change: A debug breakpoint inserted into the template</b>
28+ *
29+ * <p>Not used anymore: This was used by {@code freemarker.debug} package, which was removed. We left it here in case
30+ * some tools that traverse the AST links to this class.</p>
31+ *
3032 * @deprecated This is an internal FreeMarker API with no backward compatibility guarantees, so you shouldn't depend on
31- * it.
33+ * it.
3234 */
3335@ Deprecated
3436public class DebugBreak extends TemplateElement {
3537 public DebugBreak (TemplateElement nestedBlock ) {
3638 addChild (nestedBlock );
3739 copyLocationFrom (nestedBlock );
3840 }
39-
41+
4042 @ Override
4143 protected TemplateElement [] accept (Environment env ) throws TemplateException , IOException {
42- if (!DebuggerService .suspendEnvironment (
43- env , this .getTemplate ().getSourceName (), getChild (0 ).getBeginLine ())) {
44- return getChild (0 ).accept (env );
45- } else {
46- throw new StopException (env , "Stopped by debugger" );
47- }
44+ // This was conditional before freemarker.debug was removed. DebugBreak was kept to decrease the change of
45+ // backward compatibility issues.
46+ throw new StopException (env , "Stopped by debugger" );
4847 }
4948
5049 @ Override
@@ -57,15 +56,15 @@ protected String dump(boolean canonical) {
5756 sb .append (" /-->" );
5857 } else {
5958 sb .append (" -->" );
60- sb .append (getChild (0 ).getCanonicalForm ());
59+ sb .append (getChild (0 ).getCanonicalForm ());
6160 sb .append ("<#--/ debug break -->" );
6261 }
6362 return sb .toString ();
6463 } else {
6564 return "debug break" ;
6665 }
6766 }
68-
67+
6968 @ Override
7069 String getNodeTypeSymbol () {
7170 return "#debug_break" ;
@@ -90,5 +89,5 @@ ParameterRole getParameterRole(int idx) {
9089 boolean isNestedBlockRepeater () {
9190 return false ;
9291 }
93-
92+
9493}
0 commit comments