private static File determineClassName ( File original ) throws IOException { String text = FileUtils . readFileToString ( original , "UTF-8" ) ; if ( ! text . contains ( "//CONCURRENT" ) ) throw new IOException ( "Not a concurrent file" ) ; String pattern = "//CONCURRENT_CLASS_NAME " ; int where = text . indexOf ( pattern ) ; if ( where < 0 ) { String name = className ( original ) ; return new File ( original . getParent ( ) , name + "_MT.java" ) ; } String name = readUntilEndOfLine ( text , where + pattern . length ( ) ) ; return new File ( original . getParent ( ) , name + ".java" ) ; }
Searches the input file for an override . If none is found then _MT is added to the class name .