Buggy code:
public class JavaResourceGenerator extends JavaBaseGenerator { public enum JavaGenClass { Structure , Type , Resource , BackboneElement , Constraint ; } private JavaResourceGenerator . JavaGenClass clss ; public JavaResourceGenerator ( OutputStream out , Definitions definitions ) throws UnsupportedEncodingException { } private Map < ElementDefn , String > typeNames = new HashMap < ElementDefn , String > ( ) ; private List < String > typeNameStrings = new ArrayList < String > ( ) ; private List < ElementDefn > enums = new ArrayList < ElementDefn > ( ) ; private List < String > enumNames = new ArrayList < String > ( ) ; private List < ElementDefn > strucs = new ArrayList < ElementDefn > ( ) ; private String classname ; private String allfields ; private long hashSum ; private String inheritedHash ; public Map < ElementDefn , String > getTypeNames ( ) { } public void generate ( ElementDefn root , String name , JavaResourceGenerator . JavaGenClass clss , ProfiledType cd , Date genDate , String version , boolean isAbstract , Map < String , SearchParameterDefn > nameToSearchParamDef ) throws Exception { } private void writeSearchParameterField ( String name , JavaResourceGenerator . JavaGenClass clss , boolean isAbstract , SearchParameterDefn sp , String code , String [ ] theCompositeOf , Map < String , SearchParameterDefn > theNameToSearchParamDef ) throws IOException { } private void generateTypeSpecificConstructors ( String theName ) throws IOException { } private void generateTypeSpecificAccessors ( String name ) throws IOException { } private void generateFhirType ( String path ) throws IOException { } private String cleanSpName ( String code ) { } private String pipeSeparate ( List < String > paths ) { } private void jdoc ( String indent , String text ) throws IOException { } private void generateChildrenRegister ( ElementDefn p , String indent , boolean isAbstract ) throws IOException { } private void generatePropertySetter ( ElementDefn p , String indent ) throws Exception { } private void generateChildAdder ( ElementDefn p , String indent , String parent ) throws Exception { } private boolean generateChildAddItem ( String indent , String parent , boolean first , ElementDefn e , String tn , String name , String namet ) throws IOException { } private List < TypeRef > getTypes ( List < TypeRef > types ) { } private boolean isAbstract ( String typeCode ) { } private void generateConstructor ( String className , List < ElementDefn > params , String indent ) throws IOException { } private String upFirst ( String name ) { } private boolean hasList ( ElementDefn root ) { } private boolean hasDecimal ( ElementDefn root ) { } private boolean hasString ( ElementDefn root ) { } private boolean hasSharedEnums ( ElementDefn root ) { } private boolean hasXhtml ( ElementDefn root ) { } private boolean hasListInner ( ElementDefn e ) { } private boolean hasXhtmlInner ( ElementDefn e ) { } private boolean hasDecimalInner ( ElementDefn e ) { } private void generateEnum ( ElementDefn e ) throws Exception { } private void generateType ( ElementDefn e , JavaResourceGenerator . JavaGenClass clss ) throws Exception { } private void generateEquals ( ElementDefn e , String tn , boolean owner , boolean isAbstract ) throws IOException { } private void generateCopy ( ElementDefn e , String tn , boolean owner , boolean isAbstract ) throws IOException { } private void generateIsEmpty ( ElementDefn e , String tn , boolean owner , boolean isAbstract ) throws IOException { } private void scanNestedTypes ( ElementDefn root , String path , ElementDefn e ) throws Exception { } private Object getElementForPath ( ElementDefn root , String pathname ) throws Exception { } private String getCodeListType ( String binding ) { } private void generateField ( ElementDefn root , ElementDefn e , String indent , int order ) throws Exception { } private void writeAttributeAnnotation ( String indent , ElementDefn e , int order , String tn ) throws Exception { } private String getTypeClassList ( ElementDefn e , String tn ) throws Exception { CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder ( ) ; for ( TypeRef tr : e . getTypes ( ) ) { if ( tr . isResourceReference ( ) ) { for ( String p : tr . getParams ( ) ) if ( ! ( p . equalsIgnoreCase ( "Any" ) ) ) if ( p . equals ( "List" ) ) <START_BUG> b . append ( ( p + "_.class" ) ) ; <END_BUG> else b . append ( ( p + ".class" ) ) ; } else if ( definitions . hasPrimitiveType ( tr . getName ( ) ) ) { b . append ( ( ( upFirst ( tr . getName ( ) ) ) + "Type.class" ) ) ; } else if ( tr . getName ( ) . startsWith ( "@" ) ) { b . append ( ( tn + ".class" ) ) ; } else if ( ( ! ( tr . getName ( ) . equalsIgnoreCase ( "*" ) ) ) && ( ! ( tr . getName ( ) . equalsIgnoreCase ( "xhtml" ) ) ) ) { b . append ( ( ( getTypename ( tr ) ) + ".class" ) ) ; } } return b . toString ( ) ; } private void writeWithHash ( String string ) throws IOException { } private String getSimpleType ( String n ) { } private void generateAccessors ( ElementDefn root , ElementDefn e , String indent , String className ) throws Exception { } private void generateSetter ( ElementDefn e , String indent , String className , String tn , String simpleType ) throws IOException { } private boolean isString ( String tn ) { } public long getHashSum ( ) { } public void setInheritedHash ( String value ) { } }

Fix:
b . append ( ( p + "Resource.class" ) ) ;