Buggy code:
public class GTPreCompiler { public static final int maxPlainTextLength = 60000 ; public static String generatedPackageName = "play.template2.generated_templates" ; private GTInternalTagsCompiler gtInternalTagsCompiler = new GTInternalTagsCompiler ( ) ; private Map < String , String > expression2GroovyMethodLookup = null ; private Map < String , String > tagArgs2GroovyMethodLookup = null ; public GTFastTagResolver customFastTagResolver = null ; private final String varName = "ev" ; private final GTTemplateRepo templateRepo ; public static class SourceContext { public final GTTemplateLocation templateLocation ; public StringBuilder _out = new StringBuilder ( ) ; public StringBuilder _gout = new StringBuilder ( ) ; public String [ ] lines ; public int currentLineNo ; public int lineOffset ; public int nextMethodIndex = 0 ; public SourceContext ( GTTemplateLocation templateLocation ) { } public void jprintln ( String line ) { } public void jprintln ( String line , int lineNo ) { } public void gprintln ( String line ) { } public void gprintln ( String line , int lineNo ) { } } public static class Output { public final String javaClassName ; public final String javaCode ; public final String groovyClassName ; public final String groovyCode ; public final GTLineMapper javaLineMapper ; public final GTLineMapper groovyLineMapper ; public Output ( String javaClassName , String javaCode , String groovyClassName , String groovyCode , GTLineMapper javaLineMapper , GTLineMapper groovyLineMapper ) { } @ Override public String toString ( ) { } } public GTPreCompiler ( GTTemplateRepo templateRepo ) { } public GTPreCompiler . Output compile ( final GTTemplateLocation templateLocation ) { } static Pattern alwaysPimpGroovyP = Pattern . compile ( "^\\s*\\*\\{\\s*alwaysPimpGroovy\\s*\\}\\*\\s*$" ) ; public GTPreCompiler . Output compile ( final String src , final GTTemplateLocation templateLocation ) { } protected GTPreCompiler . Output internalCompile ( final String [ ] lines , final GTTemplateLocation templateLocation ) { } public static String generateTemplateClassname ( String relativePath ) { <START_BUG> return "GTTemplate_" + ( GTPreCompiler . fixStringForCode ( relativePath . replaceAll ( "[\\{\\}//\\\\\\.:]" , "_" ) , null ) ) ; <END_BUG> } public static class GTFragment { public final int startLine ; public GTFragment ( int startLine ) { } } public static class GTFragmentMethodCall extends GTPreCompiler . GTFragment { public final String methodName ; public GTFragmentMethodCall ( int startLine , String methodName ) { } } public static class GTFragmentCode extends GTPreCompiler . GTFragment { public final String code ; public GTFragmentCode ( int startLine , String code ) { } } public static class GTFragmentScript extends GTPreCompiler . GTFragment { public final String scriptSource ; public GTFragmentScript ( int startLine , String scriptSource ) { } } public static class GTFragmentEndOfMultiLineTag extends GTPreCompiler . GTFragment { public final String tagName ; public GTFragmentEndOfMultiLineTag ( int startLine , String tagName ) { } } static final Pattern partsP = Pattern . compile ( "([#\\$&]|@?@)\\{|(\\*\\{)|(%\\{)" ) ; static final Pattern tagP = Pattern . compile ( "#\\{([^\\}]+)\\}" ) ; final Pattern tagBodyP = Pattern . compile ( "([^\\s]+)(?:\\s*$|\\s+(.+))" ) ; static final Pattern endCommentP = Pattern . compile ( "\\}\\*" ) ; static final Pattern endScriptP = Pattern . compile ( "\\}%" ) ; static final Pattern endTagExpressionEtcP = Pattern . compile ( "\\}" ) ; static final Pattern valueP = Pattern . compile ( "(?:\\$|@?@|&)\\{([^\\}]+)\\}" ) ; protected GTPreCompiler . GTFragment processNextFragment ( GTPreCompiler . SourceContext sc ) { } protected String checkAndPatchActionStringsInTagArguments ( String tagArguments ) { } protected GTPreCompiler . GTFragmentCode generateRegularActionPrinter ( boolean absolute , String expression , GTPreCompiler . SourceContext sc , int lineNo ) { } private GTPreCompiler . GTFragmentCode generateExpressionPrinter ( String expression , GTPreCompiler . SourceContext sc , int lineNo ) { } private String generateGroovyExpressionResolver ( String expression , GTPreCompiler . SourceContext sc ) { } private GTPreCompiler . GTFragmentCode generateMessagePrinter ( int startLine , String messageArgs , GTPreCompiler . SourceContext sc ) { } private GTPreCompiler . GTFragmentCode createGTFragmentCodeForPlainText ( int startLine , String plainText ) { } private String checkForPlainText ( GTPreCompiler . SourceContext sc , int startLine , int startOffset , int endOfLastLine ) { } protected GTPreCompiler . GTFragment processTag ( GTPreCompiler . SourceContext sc , String tagName , String tagArgString , boolean tagWithoutBody ) { } protected GTPreCompiler . GTFragment processTag ( GTPreCompiler . SourceContext sc , String tagName , String tagArgString , boolean tagWithoutBody , final List < GTPreCompiler . GTFragment > body ) { } private String generateGroovyCodeForTagArgs ( GTPreCompiler . SourceContext sc , String tagName , String tagArgString , int srcLine ) { } private static Pattern validCodeString = Pattern . compile ( "^[A-Za-z_1234567890@]+$" ) ; protected static String fixStringForCode ( String s , GTPreCompiler . SourceContext sc ) { } private String generateMethodName ( String hint , GTPreCompiler . SourceContext sc ) { } private GTPreCompiler . GTFragmentMethodCall generateTagCode ( int startLine , String tagName , String tagArgString , GTPreCompiler . SourceContext sc , List < GTPreCompiler . GTFragment > body ) { } private String getTemplateType ( GTPreCompiler . SourceContext sc ) { } private void generateFastTagInvocation ( GTPreCompiler . SourceContext sc , String fullnameToFastTagMethod , String contentMethodName ) { } protected static void generateContentOutputCapturing ( String contentMethodName , String outputVariableName , GTPreCompiler . SourceContext sc , int line ) { } private void generateGTContentRenderer ( GTPreCompiler . SourceContext sc , String contentMethodName , String contentRendererName ) { } private void generateLegacyFastTagInvocation ( String tagName , GTPreCompiler . SourceContext sc , GTLegacyFastTagResolver . LegacyFastTagInfo legacyFastTagInfo , String contentMethodName ) { } private void generateTagFileInvocation ( String tagName , String tagFilePath , GTPreCompiler . SourceContext sc , String contentMethodName ) { } private void generateCodeForGTFragments ( GTPreCompiler . SourceContext sc , List < GTPreCompiler . GTFragment > body , String methodName ) { } public Class < ? extends GTGroovyBase > getGroovyBaseClass ( ) { } public Class < ? extends GTJavaBase > getJavaBaseClass ( ) { } public GTLegacyFastTagResolver getGTLegacyFastTagResolver ( ) { } }

Fix:
return "GTTemplate_" + ( GTPreCompiler . fixStringForCode ( relativePath . replaceAll ( "[\\{\\}//\\\\\\.:!]" , "_" ) , null ) ) ;