nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Tetris extends JFrame { private static final long serialVersionUID = - 4722429764792514382L ; private static final long FRAME_TIME = 1000L // 50L ; private static final int TYPE_COUNT = TileType . values ( ) . length ; private BoardPanel board ; private SidePanel side ; private boolean isPaused ; private boolean isNewGame ; private boolean isGameOver ; private int level ; private int score ; private Random random ; private Clock logicTimer ; private TileType currentType ; private TileType nextType ; private int currentCol ; private int currentRow ; private int currentRotation ; private int dropCooldown ; private float gameSpeed ; private Tetris ( ) { } private void startGame ( ) { } private void updateGame ( ) { } private void renderGame ( ) { } private void resetGame ( ) { } private void spawnPiece ( ) { this . currentType = nextType ; this . currentCol = currentType . getSpawnColumn ( ) ; this . currentRow = currentType . getSpawnRow ( ) ; this . currentRotation = 0 ; this . nextType = TileType . values ( ) [ random . nextInt ( Tetris . TYPE_COUNT ) ] ; if ( ! ( board . isValidAndEmpty ( currentType , currentCol , currentRow , currentRotation ) ) ) { this . isGameOver = true ; logicTimer . setPaused ( true ) ; <START_BUG> String gameoverSound = this . getClass ( ) . getResource ( "//Tetris.mp3" ) . toString ( ) ; <END_BUG> Media sound2 = new Media ( gameoverSound ) ; MediaPlayer mediaPlayer = new MediaPlayer ( sound2 ) ; mediaPlayer . setVolume ( 0.8 ) ; mediaPlayer . play ( ) ; } } private void rotatePiece ( int newRotation ) { } public boolean isPaused ( ) { } public boolean isGameOver ( ) { } public boolean isNewGame ( ) { } public int getScore ( ) { } public int getLevel ( ) { } public TileType getPieceType ( ) { } public TileType getNextPieceType ( ) { } public int getPieceCol ( ) { } public int getPieceRow ( ) { } public int getPieceRotation ( ) { } public static void main ( String [ ] args ) { } }

Fix:
String gameoverSound = this . getClass ( ) . getResource ( "schoolbellringing.wav" ) . toString ( ) ;
Buggy code:
public abstract class VariableInterpolator { protected final String string ; private boolean exceptionOnNullVarValue = false ; public VariableInterpolator ( final String string ) { } public VariableInterpolator ( final String string , boolean exceptionOnNullVarValue ) { } protected abstract String getValue ( String variableName ) { } private int lowerPositive ( int i1 , int i2 ) { } @ Override public String toString ( ) { <START_BUG> final StringBuffer buffer = new StringBuffer ( ) ; <END_BUG> int start ; int pos = 0 ; while ( ( start = lowerPositive ( string . indexOf ( "$$" , pos ) , string . indexOf ( "${" , pos ) ) ) != ( - 1 ) ) { buffer . append ( string . substring ( pos , start ) ) ; if ( ( string . charAt ( ( start + 1 ) ) ) == '$' ) { buffer . append ( "$" ) ; pos = start + 2 ; continue ; } pos = start ; final int startVariableName = start + 2 ; final int endVariableName = string . indexOf ( '}' , startVariableName ) ; if ( endVariableName != ( - 1 ) ) { final String variableName = string . substring ( startVariableName , endVariableName ) ; final String value = getValue ( variableName ) ; if ( value == null ) { if ( exceptionOnNullVarValue ) { throw new IllegalArgumentException ( ( ( ( ( "Value<seq2seq4repair_space>of<seq2seq4repair_space>variable<seq2seq4repair_space>[[" + variableName ) + "]]<seq2seq4repair_space>could<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>resolved<seq2seq4repair_space>while<seq2seq4repair_space>interpolating<seq2seq4repair_space>[[" ) + ( string ) ) + "]]" ) ) ; } else { buffer . append ( ( ( "${" + variableName ) + "}" ) ) ; } } else { buffer . append ( value ) ; } pos = endVariableName + 1 ; } else { break ; } } if ( pos < ( string . length ( ) ) ) { buffer . append ( string . substring ( pos ) ) ; } return buffer . toString ( ) ; } }

Fix:
final StringBuilder buffer = new StringBuilder ( ) ;
Buggy code:
public class OPSChecker implements ContentChecker , DocumentValidator { private final OCFPackage ocf ; private final Report report ; private final String path ; private final String mimeType ; private final XRefChecker xrefChecker ; private final EPUBVersion version ; private final EPUBProfile profile ; private final GenericResourceProvider resourceProvider ; private final String properties ; private final Set < String > pubTypes ; private static final OPSType XHTML_20 = new OPSType ( "application//xhtml+xml" , EPUBVersion . VERSION_2 ) ; private static final OPSType XHTML_30 = new OPSType ( "application//xhtml+xml" , EPUBVersion . VERSION_3 ) ; private static final OPSType SVG_20 = new OPSType ( "image//svg+xml" , EPUBVersion . VERSION_2 ) ; private static final OPSType SVG_30 = new OPSType ( "image//svg+xml" , EPUBVersion . VERSION_3 ) ; private ListMultimap < OPSType , XMLValidator > validatorMap ; private void initEpubValidatorMap ( ) { ImmutableListMultimap . Builder < OPSType , XMLValidator > builder = ImmutableListMultimap . builder ( ) ; builder . putAll ( OPSChecker . XHTML_20 , XHTML_20_NVDL . get ( ) , IDUNIQUE_20_SCH . get ( ) ) . putAll ( OPSChecker . XHTML_30 , XHTML_30_RNC . get ( ) , XHTML_30_SCH . get ( ) ) . putAll ( OPSChecker . SVG_20 , SVG_20_RNG . get ( ) , IDUNIQUE_20_SCH . get ( ) ) . putAll ( OPSChecker . SVG_30 , SVG_30_RNC . get ( ) , SVG_30_SCH . get ( ) ) ; if ( ( ( profile ) == ( EPUBProfile . EDUPUB ) ) || ( pubTypes . contains ( DC_TYPE_EDUPUB ) ) ) { <START_BUG> builder . put ( OPSChecker . XHTML_30 , XHTML_EDUPUB_HEADINGS_SCH . get ( ) ) ; <END_BUG> builder . put ( OPSChecker . XHTML_30 , XHTML_EDUPUB_SEMANTICS_SCH . get ( ) ) ; } validatorMap = builder . build ( ) ; } public OPSChecker ( OCFPackage ocf , Report report , String path , String mimeType , String properties , XRefChecker xrefChecker , EPUBVersion version , Set < String > pubTypes , EPUBProfile profile ) { } public OPSChecker ( String path , String mimeType , GenericResourceProvider resourceProvider , Report report , EPUBVersion version , EPUBProfile profile ) { } private OPSChecker ( OCFPackage ocf , GenericResourceProvider resourceProvider , Report report , String path , String mimeType , String properties , XRefChecker xrefChecker , EPUBVersion version , Set < String > pubTypes , EPUBProfile profile ) { } public void runChecks ( ) { } public boolean validate ( ) { } void validate ( List < XMLValidator > validators ) throws IOException { } }

Fix:
builder . put ( OPSChecker . XHTML_30 , XHTML_EDUPUB_STRUCTURE_SCH . get ( ) ) ;
Buggy code:
public class FragmentWishList extends DebugFragment implements IOnFriendSelectedListener { public static final String WISH_LIST_MODE = "Wish<seq2seq4repair_space>list" ; public static final String GIFT_LIST_MODE = "Gift<seq2seq4repair_space>list" ; public static final String WISH_LIST_ID = "WISH_LIST_ID" ; public static final String FRIEND_ID = "FRIEND_ID" ; public static final String MODE = "mode" ; private WishListAdapter adapter ; private FirebaseUtil firebaseUtil ; private String friendId ; @ Bind ( id . fab_menu ) FloatingActionMenu mFab ; public static FragmentWishList newInstance ( String mode , String friendId ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Nullable @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onViewCreated ( View view , @ Nullable Bundle savedInstanceState ) { } @ Override public void onFriendSelected ( String id ) { } public void onClick ( View v , String wishListId ) { } <START_BUG> @ OnClick ( { id . fab_menu , id . fab_add , id . fab_choose } ) <END_BUG> public void initWishList ( final View view ) { final Firebase wishListTable = firebaseUtil . getFirebaseRoot ( ) . child ( firebaseUtil . WISH_LIST_TABLE ) ; wishListTable . orderByChild ( "forUser" ) . equalTo ( friendId ) . addListenerForSingleValueEvent ( new ValueEventListener ( ) { @ Override public void onDataChange ( DataSnapshot dataSnapshot ) { Log . d ( LOG_TAG , ( ( ".onDataChange(" + dataSnapshot ) + ")" ) ) ; for ( DataSnapshot wishListDS : dataSnapshot . getChildren ( ) ) { if ( wishListDS . getValue ( WishList . class ) . getOwner ( ) . equals ( firebaseUtil . getCurrentUser ( ) . getId ( ) ) ) { onClick ( view , wishListDS . getKey ( ) ) ; return ; } } WishList wishList = new WishList ( wishListTable . push ( ) . getKey ( ) , firebaseUtil . getCurrentUser ( ) . getId ( ) , friendId ) ; wishListTable . child ( wishList . getId ( ) ) . setValue ( wishList ) ; onClick ( view , wishList . getId ( ) ) ; } @ Override public void onCancelled ( FirebaseError firebaseError ) { Log . e ( LOG_TAG , firebaseError . toString ( ) ) ; } } ) ; } }

Fix:
@ OnClick ( { id . fab_add , id . fab_choose } )
Buggy code:
public class AnnotationsViewContentProvider implements ITreeContentProvider { public Object [ ] getChildren ( Object parentElement ) { } public Object getParent ( Object element ) { } public boolean hasChildren ( Object element ) { } public Object [ ] getElements ( Object inputElement ) { if ( inputElement != null ) { <START_BUG> return AnnotationsManager . getAnnotations ( inputElement ) ; <END_BUG> } return new Object [ ] { } ; } public void dispose ( ) { } public void inputChanged ( Viewer viewer , Object oldInput , Object newInput ) { } }

Fix:
return AnnotationsManager . getAnnotations ( inputElement ) . toArray ( ) ;
Buggy code:
public class Start extends BaseMojo { public void execute ( ) throws MojoExecutionException , MojoFailureException { } private CommandLine determineStartScript ( ) { } private void processArguments ( CommandLine cmdLine ) { <START_BUG> logger . info ( "Parsing<seq2seq4repair_space>for<seq2seq4repair_space>boot<seq2seq4repair_space>arguments<seq2seq4repair_space>to<seq2seq4repair_space>pass<seq2seq4repair_space>on" ) ; <END_BUG> boolean jmxParam = false ; for ( String argument : getStartParams ( ) ) { if ( jmxParam ) { setJmxPort ( argument . trim ( ) ) ; logger . debug ( ( "JMX<seq2seq4repair_space>port<seq2seq4repair_space>found:<seq2seq4repair_space>" + ( getJmxPort ( ) ) ) ) ; jmxParam = false ; } if ( "-jmxport" . equalsIgnoreCase ( argument . trim ( ) ) ) { logger . debug ( "JMX<seq2seq4repair_space>argument<seq2seq4repair_space>found,<seq2seq4repair_space>expect<seq2seq4repair_space>next<seq2seq4repair_space>argument<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>port<seq2seq4repair_space>number" ) ; jmxParam = true ; } logger . info ( ( "Adding<seq2seq4repair_space>start<seq2seq4repair_space>argument:<seq2seq4repair_space>" + argument ) ) ; cmdLine . addArgument ( argument ) ; } } }

Fix:
logger . info ( "Parsing<seq2seq4repair_space>for<seq2seq4repair_space>start<seq2seq4repair_space>arguments<seq2seq4repair_space>to<seq2seq4repair_space>pass<seq2seq4repair_space>on" ) ;
Buggy code:
@ Slf4j @ Component public class ProgramTransformer implements ITransformer { private final DCP dcp ; private final MediaReader mediaReader ; private final Mapper mapper ; @ Autowired public ProgramTransformer ( DCP dcp , MediaReader mediaReader , DCPMedia dcpMedia , Mapper mapper ) { } public Program createProgram ( ProgramDTO dto ) throws IOException { Program program = dcp . getProgram ( dto . getKey ( ) ) ; <START_BUG> if ( ( program . getExtraDataFile ( ) ) != null ) { <END_BUG> program . setExtraDataFile ( mediaReader . createText ( dto . getExtraData ( ) ) . getOriginal ( ) ) ; } program . getMedias ( ) . clear ( ) ; for ( MediaDTO mediaDTO : dto . getMedia ( ) ) { program . getMedias ( ) . add ( createResourceMedia ( mediaDTO ) ) ; } return program ; } private ResourceMedia createResourceMedia ( MediaDTO rmDTO ) throws IOException { } @ Override public boolean isApplicable ( Class < ? > clazz ) { } @ Override public LocalizedKeyValue transform ( DTO dto ) throws IOException { } }

Fix:
if ( ( dto . getExtraData ( ) ) != null ) {
Buggy code:
public class MapDyads extends CommandLineTool { private static final Logger log = Logger . getLogger ( MapDyads . class ) ; @ Parameter ( names = { "-i" , "--input" } , description = "Input<seq2seq4repair_space>file<seq2seq4repair_space>(reads)" , required = true ) public IntervalFile < ? extends Interval > inputFile ; @ Parameter ( names = { "-s" , "--size" } , description = "Mononucleosome<seq2seq4repair_space>length<seq2seq4repair_space>(default:<seq2seq4repair_space>read<seq2seq4repair_space>length)" ) public Integer nucleosomeSize ; @ Parameter ( names = { "-a" , "--assembly" } , description = "Genome<seq2seq4repair_space>assembly" , required = true ) public Assembly assembly ; @ Parameter ( names = { "-o" , "--output" } , description = "Output<seq2seq4repair_space>file<seq2seq4repair_space>(Wig)" , required = true ) public Path outputFile ; @ Override public void run ( ) throws IOException { MapDyads . log . debug ( "Initializing<seq2seq4repair_space>output<seq2seq4repair_space>file" ) ; int mapped = 0 ; try ( BufferedWriter writer = Files . newBufferedWriter ( outputFile , Charset . defaultCharset ( ) ) ) { TrackHeader header = new TrackHeader ( "wiggle_0" ) ; header . setName ( ( "Converted<seq2seq4repair_space>" + ( inputFile . getPath ( ) . getFileName ( ) ) ) ) ; header . setDescription ( ( "Converted<seq2seq4repair_space>" + ( inputFile . getPath ( ) . getFileName ( ) ) ) ) ; writer . write ( header . toString ( ) ) ; writer . newLine ( ) ; for ( String chr : assembly ) { MapDyads . log . debug ( ( "Processing<seq2seq4repair_space>chromosome<seq2seq4repair_space>" + chr ) ) ; writer . write ( ( ( "fixedStep<seq2seq4repair_space>chrom=" + chr ) + "<seq2seq4repair_space>start=1<seq2seq4repair_space>step=1<seq2seq4repair_space>span=1" ) ) ; writer . newLine ( ) ; int start = 1 ; while ( start < ( assembly . getChrLength ( chr ) ) ) { int stop = ( start + ( DEFAULT_CHUNK_SIZE ) ) - 1 ; int length = ( stop - start ) + 1 ; int [ ] count = new int [ length ] ; Iterator < ? extends Interval > it = inputFile . query ( chr , start , stop ) ; while ( it . hasNext ( ) ) { Interval entry = it . next ( ) ; if ( ( ( nucleosomeSize ) == null ) || ( ( nucleosomeSize ) == ( - 1 ) ) ) { ( count [ ( ( entry . center ( ) ) - start ) ] ) ++ ; } else { ( count [ ( ( ( entry . getStart ( ) ) + ( nucleosomeSize ) ) - start ) ] ) ++ ; } mapped ++ ; } for ( int i = 0 ; i < ( count . length ) ; i ++ ) { <START_BUG> writer . write ( count [ i ] ) ; <END_BUG> writer . newLine ( ) ; } start = stop + 1 ; } } } MapDyads . log . info ( ( ( "Mapped<seq2seq4repair_space>" + mapped ) + "<seq2seq4repair_space>reads" ) ) ; } public static void main ( String [ ] args ) { } No newline ; at end ; of file ; }

Fix:
writer . write ( Integer . toString ( count [ i ] ) ) ;
Buggy code:
public class MongoDBCacheLoader < K , V > extends AbstractCacheLoader < K , V , Mongo > { private Mongo mongoClient ; private List < ServerAddress > hosts ; private SchemaOptions schemaOptions ; private String keySpace ; private boolean isTableCreated = false ; private Class < V > clazz ; public MongoDBCacheLoader ( Class < V > clazz , List < ServerAddress > hosts , SchemaOptions schemaOptions , String keySpace ) { } @ Override public String getName ( ) { } public void create ( String name , Object k ) { } private void createKeySpace ( ) { } void createTable ( ) { } public void put ( Object k , Object v ) { <START_BUG> ops ( ) . insert ( v ) ; <END_BUG> } public void remove ( Object k ) { } @ Override public Object load ( Object key ) throws Exception { } @ Override public void close ( ) { } @ Override public Mongo getDriverSession ( ) { } private MongoOperations ops ( ) { } public static Mongo connect ( List < ServerAddress > hosts ) { } }

Fix:
ops ( ) . save ( v ) ;
Buggy code:
public class TempFolder extends AbstractMessageFolder { private static final Logger LOG = Logger . getLogger ( "org.columba.mail.folder.temp" ) ; protected IHeaderList headerList ; protected Hashtable messageList ; protected int nextUid = 0 ; protected IColumbaMessage aktMessage ; public TempFolder ( String path ) { } public void clear ( ) { } public Object [ ] getUids ( ) throws Exception { } protected Object generateNextUid ( ) { } public void setNextUid ( int next ) { } public boolean exists ( Object uid ) throws Exception { } public IHeaderList getHeaderList ( ) throws Exception { } public void removeMessage ( Object uid ) throws Exception { } public MimeTree getMimePartTree ( Object uid ) throws Exception { } public IColumbaHeader getMessageHeader ( Object uid ) throws Exception { } public IColumbaMessage getMessage ( Object uid ) throws Exception { } public Object [ ] searchMessages ( Filter filter , Object [ ] uids ) throws Exception { } public Object [ ] searchMessages ( Filter filter ) throws Exception { } public String getDefaultChild ( ) { } public String getName ( ) { } public String toString ( ) { } public void innerCopy ( IMailbox destFolder , Object [ ] uids ) throws Exception { } public Object addMessage ( InputStream in , Attributes attributes , Flags flags ) throws Exception { Message message = MessageParser . parse ( TempSourceFactory . createTempSource ( in , ( - 1 ) ) ) ; Object newUid = generateNextUid ( ) ; TempFolder . LOG . info ( ( "new<seq2seq4repair_space>UID=" + newUid ) ) ; ColumbaHeader h = new ColumbaHeader ( message . getHeader ( ) ) ; if ( attributes != null ) { h . setAttributes ( ( ( Attributes ) ( attributes . clone ( ) ) ) ) ; } if ( flags != null ) { h . setFlags ( ( ( Flags ) ( flags . clone ( ) ) ) ) ; } h . getAttributes ( ) . put ( "columba.uid" , newUid ) ; headerList . add ( h , newUid ) ; messageList . put ( newUid , new org . columba . mail . message . ColumbaMessage ( h , message ) ) ; <START_BUG> fireMessageAdded ( newUid ) ; <END_BUG> return newUid ; } public Object getAttribute ( Object uid , String key ) throws Exception { } public Flags getFlags ( Object uid ) throws Exception { } public Attributes getAttributes ( Object uid ) throws Exception { } public Header getHeaderFields ( Object uid , String [ ] keys ) throws Exception { } public InputStream getMessageSourceStream ( Object uid ) throws Exception { } public InputStream getMimePartBodyStream ( Object uid , Integer [ ] address ) throws Exception { } public InputStream getMimePartSourceStream ( Object uid , Integer [ ] address ) throws Exception { } public void setAttribute ( Object uid , String key , Object value ) throws Exception { } public Object addMessage ( InputStream in ) throws Exception { } public Object addMessage ( IColumbaMessage message ) throws Exception { } public void removeFolder ( ) throws Exception { } public Header getAllHeaderFields ( Object uid ) throws Exception { } }

Fix:
fireMessageAdded ( newUid , getFlags ( newUid ) ) ;
Buggy code:
public class SugarplusCommand implements ICommand { public List aliases ; public SugarplusCommand ( ) { } public int compareTo ( Object object ) { } public String getCommandName ( ) { } public String getCommandUsage ( ICommandSender iCommandSender ) { } public List getCommandAliases ( ) { } public void processCommand ( ICommandSender iCommandSender , String [ ] string ) { } public boolean canCommandSenderUseCommand ( ICommandSender iCommandSender ) { } public List addTabCompletionOptions ( ICommandSender iCommandSender , String [ ] string ) { } <START_BUG> public boolean isUsernameIndex ( String [ ] string , int i ) { <END_BUG> return false ; } }

Fix:
public boolean isUsernameIndex ( String [ ] string , int index ) {
Buggy code:
public class CommandLineMain { private static CommandLineParser parser = new GnuParser ( ) ; private static Options options = new Options ( ) ; private static HelpFormatter formatter = new HelpFormatter ( ) ; private static final String usage = "jdr.{sh,bat}<seq2seq4repair_space>[options]" ; public static void main ( String [ ] args ) { String port = "9990" ; String host = "localhost" ; try { <START_BUG> CommandLine line = CommandLineMain . parser . parse ( CommandLineMain . options , args , true ) ; <END_BUG> if ( line . hasOption ( "help" ) ) { CommandLineMain . formatter . printHelp ( CommandLineMain . usage , CommandLineMain . options ) ; return ; } if ( line . hasOption ( "host" ) ) { host = line . getOptionValue ( "host" ) ; } if ( line . hasOption ( "port" ) ) { port = line . getOptionValue ( "port" ) ; } } catch ( ParseException e ) { System . out . println ( e . getMessage ( ) ) ; CommandLineMain . formatter . printHelp ( CommandLineMain . usage , CommandLineMain . options ) ; return ; } System . out . println ( "Initializing<seq2seq4repair_space>JBoss<seq2seq4repair_space>Diagnostic<seq2seq4repair_space>Reporter..." ) ; JdrReportService reportService = new JdrReportService ( ) ; JdrReport response = null ; try { response = reportService . standaloneCollect ( host , port ) ; } catch ( OperationFailedException e ) { System . out . println ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>complete<seq2seq4repair_space>the<seq2seq4repair_space>JDR<seq2seq4repair_space>report:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } System . out . println ( ( "JDR<seq2seq4repair_space>started:<seq2seq4repair_space>" + ( response . getStartTime ( ) . toString ( ) ) ) ) ; System . out . println ( ( "JDR<seq2seq4repair_space>ended:<seq2seq4repair_space>" + ( response . getEndTime ( ) . toString ( ) ) ) ) ; System . out . println ( ( "JDR<seq2seq4repair_space>location:<seq2seq4repair_space>" + ( response . getLocation ( ) ) ) ) ; } }

Fix:
CommandLine line = CommandLineMain . parser . parse ( CommandLineMain . options , args , false ) ;
Buggy code:
public class Main { public static void main ( String [ ] args ) throws FileNotFoundException , IOException { try { int i = Integer . parseInt ( args [ 0 ] ) ; System . out . println ( ( "k=" + i ) ) ; Automaton a = new Automaton ( ) ; a . loadFromFile ( "InputAuto.txt" ) ; DirectedGraph sdf = a . makeGraph ( i ) ; <START_BUG> sdf . makeFile ( "graph.dot" ) ; <END_BUG> } catch ( Exception e ) { System . out . println ( e ) ; } } }

Fix:
sdf . makeFile ( "graph.dot" , i ) ;
Buggy code:
public class SnapshotWriter implements BufferOutput < SnapshotWriter > { final Buffer buffer ; private final Snapshot snapshot ; SnapshotWriter ( Buffer buffer , Snapshot snapshot ) { } @ Override public SnapshotWriter write ( Bytes bytes ) { } @ Override public SnapshotWriter write ( byte [ ] bytes ) { } @ Override public SnapshotWriter write ( Bytes bytes , long offset , long length ) { } @ Override public SnapshotWriter write ( byte [ ] bytes , long offset , long length ) { } @ Override public SnapshotWriter write ( Buffer buffer ) { <START_BUG> buffer . write ( buffer ) ; <END_BUG> return this ; } @ Override public SnapshotWriter writeByte ( int b ) { } @ Override public SnapshotWriter writeUnsignedByte ( int b ) { } @ Override public SnapshotWriter writeChar ( char c ) { } @ Override public SnapshotWriter writeShort ( short s ) { } @ Override public SnapshotWriter writeUnsignedShort ( int s ) { } @ Override public SnapshotWriter writeMedium ( int m ) { } @ Override public SnapshotWriter writeUnsignedMedium ( int m ) { } @ Override public SnapshotWriter writeInt ( int i ) { } @ Override public SnapshotWriter writeUnsignedInt ( long i ) { } @ Override public SnapshotWriter writeLong ( long l ) { } @ Override public SnapshotWriter writeFloat ( float f ) { } @ Override public SnapshotWriter writeDouble ( double d ) { } @ Override public SnapshotWriter writeBoolean ( boolean b ) { } @ Override public SnapshotWriter writeString ( String s ) { } @ Override public SnapshotWriter writeUTF8 ( String s ) { } @ Override public SnapshotWriter flush ( ) { } @ Override public void close ( ) { } }

Fix:
this . buffer . write ( buffer ) ;
Buggy code:
public class Config { public Properties props = new Properties ( ) ; File file ; public Config ( File file ) { } public void create ( ) { props = new Properties ( ) ; try { if ( ! ( file . getParentFile ( ) . exists ( ) ) ) { file . getParentFile ( ) . mkdirs ( ) ; } FileOutputStream out = new FileOutputStream ( file ) ; <START_BUG> props . setProperty ( "maven" , "http:////ci.builtbroken.com//maven" ) ; <END_BUG> props . setProperty ( "group" , "icbm" ) ; props . setProperty ( "id" , "ICBM" ) ; props . setProperty ( "adfly" , "2380428" ) ; props . store ( out , "" ) ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } public boolean load ( ) { } public String maven_url_string ( ) { } public String maven_group ( ) { } public String maven_id ( ) { } public String adfly_id ( ) { } No newline ; at end ; of file ; }

Fix:
props . setProperty ( "maven" , "ci.builtbroken.com//maven" ) ;
Buggy code:
public class FuzzyKMeansDriver { private static final Logger log = LoggerFactory . getLogger ( FuzzyKMeansDriver . class ) ; public static final String MAPPER_VALUE_SEPARATOR = "~" ; public static final String COMBINER_VALUE_SEPARATOR = "\t" ; private FuzzyKMeansDriver ( ) { } private static void printMessage ( ) { } public static void main ( String [ ] args ) { } public static void runJob ( String input , String clustersIn , String output , String measureClass , double convergenceDelta , int maxIterations , int numMapTasks , int numReduceTasks , float m ) { } private static boolean runIteration ( String input , String clustersIn , String clustersOut , String measureClass , String convergenceDelta , int numMapTasks , int numReduceTasks , int iterationNumber , float m ) { JobConf conf = new JobConf ( FuzzyKMeansJob . class ) ; conf . setJobName ( ( ( "Fuzzy<seq2seq4repair_space>K<seq2seq4repair_space>Means{" + iterationNumber ) + '}' ) ) ; conf . setOutputKeyClass ( Text . class ) ; conf . setOutputValueClass ( Text . class ) ; FileInputFormat . setInputPaths ( conf , new Path ( input ) ) ; Path outPath = new Path ( clustersOut ) ; FileOutputFormat . setOutputPath ( conf , outPath ) ; conf . setMapperClass ( FuzzyKMeansMapper . class ) ; conf . setCombinerClass ( FuzzyKMeansCombiner . class ) ; conf . setReducerClass ( FuzzyKMeansReducer . class ) ; conf . setNumMapTasks ( numMapTasks ) ; conf . setNumReduceTasks ( numReduceTasks ) ; conf . set ( CLUSTER_PATH_KEY , clustersIn ) ; conf . set ( DISTANCE_MEASURE_KEY , measureClass ) ; conf . set ( CLUSTER_CONVERGENCE_KEY , convergenceDelta ) ; conf . set ( M_KEY , String . valueOf ( m ) ) ; try { JobClient . runJob ( conf ) ; <START_BUG> FileSystem fs = FileSystem . get ( conf ) ; <END_BUG> return FuzzyKMeansDriver . isConverged ( clustersOut , conf , fs ) ; } catch ( IOException e ) { FuzzyKMeansDriver . log . warn ( e . toString ( ) , e ) ; return true ; } } private static void runClustering ( String input , String clustersIn , String output , String measureClass , String convergenceDelta , int numMapTasks , float m ) { } private static boolean isConverged ( String filePath , JobConf conf , FileSystem fs ) throws IOException { } }

Fix:
FileSystem fs = FileSystem . get ( outPath . toUri ( ) , conf ) ;
Buggy code:
public class MoveSelection extends SurfaceView implements SurfaceHolder . Callback { private SurfaceHolder mSurfaceHolder ; private MoveSelection . DrawThread mThread = null ; private Bitmap bitmap ; private Bitmap background ; private float x = 0 ; private float y = 0 ; float saved_dx = 0 ; float saved_dy = 0 ; private Context context_ = null ; private final int NONE = 0 ; private final int DRAG = 1 ; private final int PINCH = 2 ; private int MODE = NONE ; private final int DEFAULT_SELECTION_SIZE = 200 ; private final float DEFAULT_EPSILON = ( ( float ) ( 0.5 ) ) ; private class ImageParams { float epsilon = DEFAULT_EPSILON ; public float euclidianDist ( float x1 , float y1 , float x2 , float y2 ) { } } public MoveSelection ( Context context ) { } public MoveSelection ( Context context , AttributeSet attrs ) { } public MoveSelection ( Context context , AttributeSet attrs , int defStyle ) { } private void sendMockPB ( ) { } public void initSurface ( ) { } public void initResources ( ) { } @ Override protected void onDraw ( Canvas canvas ) { } public void resizeBitmap ( int newWidth , int newHeight ) { } @ Override public boolean onTouchEvent ( MotionEvent event ) { float current_x = event . getX ( ) ; float current_y = event . getY ( ) ; float oldDist ; MoveSelection . ImageParams image = new MoveSelection . ImageParams ( ) ; switch ( ( event . getAction ( ) ) & ( MotionEvent . ACTION_MASK ) ) { case MotionEvent . ACTION_POINTER_UP : if ( ( MODE ) == ( PINCH ) ) { <START_BUG> MODE = DRAG ; <END_BUG> } break ; case MotionEvent . ACTION_UP : if ( ( MODE ) == ( DRAG ) ) { x = current_x - ( saved_dx ) ; y = current_y - ( saved_dy ) ; } MODE = NONE ; break ; case MotionEvent . ACTION_DOWN : if ( ( ( Math . abs ( ( current_x - ( x ) ) ) ) <= ( ( bitmap . getWidth ( ) ) // 2 ) ) && ( ( Math . abs ( ( current_y - ( y ) ) ) ) <= ( ( bitmap . getHeight ( ) ) // 2 ) ) ) { MODE = DRAG ; saved_dx = current_x - ( x ) ; saved_dy = current_y - ( y ) ; } break ; case MotionEvent . ACTION_MOVE : if ( ( MODE ) == ( DRAG ) ) { x = current_x - ( saved_dx ) ; y = current_y - ( saved_dy ) ; } else if ( ( MODE ) == ( PINCH ) ) { float newDist = image . euclidianDist ( event . getX ( 0 ) , event . getY ( 0 ) , event . getX ( 1 ) , event . getY ( 1 ) ) ; if ( newDist > 10.0F ) resizeBitmap ( ( ( int ) ( newDist ) ) , ( ( int ) ( newDist ) ) ) ; } break ; case MotionEvent . ACTION_POINTER_DOWN : oldDist = image . euclidianDist ( event . getX ( 0 ) , event . getY ( 0 ) , event . getX ( 1 ) , event . getY ( 1 ) ) ; if ( oldDist > 10.0F ) MODE = PINCH ; break ; } return true ; } @ Override public void surfaceCreated ( SurfaceHolder holder ) { } @ Override public void surfaceDestroyed ( SurfaceHolder holder ) { } @ Override public void surfaceChanged ( SurfaceHolder holder , int format , int width , int height ) { } class DrawThread extends Thread { private SurfaceHolder surfaceHolder ; private MoveSelection panel ; private boolean run ; public DrawThread ( SurfaceHolder surfaceHolder , MoveSelection panel ) { } public void setRunning ( boolean run ) { } @ Override public void run ( ) { } } No newline ; at end ; of file ; }

Fix:
MODE = NONE ;
Buggy code:
public class LocalCacheAdd extends CacheAdd { static final LocalCacheAdd INSTANCE = new LocalCacheAdd ( ) ; private LocalCacheAdd ( ) { } static ModelNode createOperation ( ModelNode address , ModelNode model ) { } @ Override void populateCacheMode ( ModelNode fromModel , ModelNode toModel ) throws OperationFailedException { <START_BUG> toModel . get ( CACHE_MODE ) . set ( LOCAL . name ( ) ) ; <END_BUG> } }

Fix:
toModel . get ( MODE ) . set ( LOCAL . name ( ) ) ;
Buggy code:
public class ForbidOveridingManagedPluginsRule extends AbstractFilterableRule { public void execute ( EnforcerRuleHelper helper ) throws EnforcerRuleException { Log log = helper . getLog ( ) ; try { MavenProject project = getProject ( helper ) ; checkPluginManagementDiffs ( project , log ) ; <START_BUG> if ( ( isShouldBuildFail ( ) ) && ( failureDetected ) ) { <END_BUG> throw new EnforcerRuleException ( "Failing<seq2seq4repair_space>because<seq2seq4repair_space>of<seq2seq4repair_space>overridden<seq2seq4repair_space>managed<seq2seq4repair_space>plugins" ) ; } } catch ( ExpressionEvaluationException e ) { throw new EnforcerRuleException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>lookup<seq2seq4repair_space>an<seq2seq4repair_space>expression<seq2seq4repair_space>" + ( e . getLocalizedMessage ( ) ) ) , e ) ; } } private void checkPluginManagementDiffs ( MavenProject project , Log log ) { } }

Fix:
if ( ( shouldBuildFail ( ) ) && ( failureDetected ) ) {
Buggy code:
public class ButtonTest extends WicketTestCase { public ButtonTest ( ) { } public void testRender ( ) { } public void testRender_2 ( ) { tester . startPage ( MockFormAndButtonPage . class ) ; tester . assertContains ( "<input<seq2seq4repair_space>name=\"button\"<seq2seq4repair_space>type=\"submit\"<seq2seq4repair_space>wicket:id=\"button\"//>" ) ; String doc = tester . getServletResponse ( ) . getDocument ( ) ; <START_BUG> boolean contains = doc . contains ( "<input<seq2seq4repair_space>onclick=\"var<seq2seq4repair_space>e=document.getElementById(\'form:hf:fs\');<seq2seq4repair_space>e.name=\'button2\';<seq2seq4repair_space>e.value=\'x\';var<seq2seq4repair_space>f=document.getElementById(\'form\');var<seq2seq4repair_space>ff=f;if<seq2seq4repair_space>(ff.onsubmit<seq2seq4repair_space>!=<seq2seq4repair_space>undefined)<seq2seq4repair_space>{<seq2seq4repair_space>if<seq2seq4repair_space>(ff.onsubmit()==false)<seq2seq4repair_space>return<seq2seq4repair_space>false;<seq2seq4repair_space>}f.submit();e.value=\'\';e.name=\'\';return<seq2seq4repair_space>false;\"<seq2seq4repair_space>type=\"submit\"<seq2seq4repair_space>name=\"button2\"<seq2seq4repair_space>wicket:id=\"button2\"//>" ) ; <END_BUG> assertTrue ( contains ) ; } }

Fix:
boolean contains = doc . contains ( "<input<seq2seq4repair_space>onclick=\"var<seq2seq4repair_space>e=document.getElementById(\'form0:hf:fs\');<seq2seq4repair_space>e.name=\'button2\';<seq2seq4repair_space>e.value=\'x\';var<seq2seq4repair_space>f=document.getElementById(\'form0\');var<seq2seq4repair_space>ff=f;if<seq2seq4repair_space>(ff.onsubmit<seq2seq4repair_space>!=<seq2seq4repair_space>undefined)<seq2seq4repair_space>{<seq2seq4repair_space>if<seq2seq4repair_space>(ff.onsubmit()==false)<seq2seq4repair_space>return<seq2seq4repair_space>false;<seq2seq4repair_space>}f.submit();e.value=\'\';e.name=\'\';return<seq2seq4repair_space>false;\"<seq2seq4repair_space>type=\"submit\"<seq2seq4repair_space>name=\"button2\"<seq2seq4repair_space>wicket:id=\"button2\"//>" ) ;
Buggy code:
public class SpawnParticlePacket implements IMessage { public static class Handler implements IMessageHandler < SpawnParticlePacket , IMessage > { @ Override public IMessage onMessage ( SpawnParticlePacket message , MessageContext ctx ) { if ( message . type . equals ( "blood_eat" ) ) { Class [ ] paramtype = new Class [ ] { ItemStack . class , Integer . TYPE } ; ItemStack is = new ItemStack ( Item . getItemById ( 260 ) ) ; <START_BUG> Reflection . callMethod ( EntityPlayer . class , ( ( EntityPlayer ) ( Minecraft . getMinecraft ( ) . thePlayer ) ) , "updateItemUse" , paramtype , new Object [ ] { is , message . amount } ) ; <END_BUG> return null ; } WorldClient world = Minecraft . getMinecraft ( ) . theWorld ; world . spawnParticle ( message . type , message . x , message . y , message . z , message . velX , message . velY , message . velZ ) ; for ( int i = 1 ; i < ( message . amount ) ; i ++ ) { Random ran = world . rand ; double x = ( message . x ) + ( ran . nextGaussian ( ) ) ; double y = ( message . y ) + ( ran . nextGaussian ( ) ) ; double z = ( message . z ) + ( ran . nextGaussian ( ) ) ; world . spawnParticle ( message . type , x , y , z , ran . nextDouble ( ) , ran . nextGaussian ( ) , ran . nextGaussian ( ) ) ; } return null ; } } private String type ; private double x ; private double y ; private double z ; private double velX ; private double velY ; private double velZ ; private int amount ; public SpawnParticlePacket ( ) { } public SpawnParticlePacket ( String ptype , double px , double py , double pz , double pvelx , double pvely , double pvelz , int pamount ) { } @ Override public void fromBytes ( ByteBuf buf ) { } @ Override public void toBytes ( ByteBuf buf ) { } }

Fix:
Reflection . callMethod ( EntityPlayer . class , ( ( EntityPlayer ) ( Minecraft . getMinecraft ( ) . thePlayer ) ) , Obfuscation . getPosNames ( "EntityPlayer//updateItemUse" ) , paramtype , new Object [ ] { is , message . amount } ) ;
Buggy code:
public abstract class ShapeFieldCacheProvider < T extends Shape > { private Logger log = Logger . getLogger ( getClass ( ) . getName ( ) ) ; WeakHashMap < IndexReader , ShapeFieldCache < T > > sidx = new WeakHashMap < IndexReader , ShapeFieldCache < T > > ( ) ; protected final int defaultSize ; protected final String shapeField ; public ShapeFieldCacheProvider ( String shapeField , int defaultSize ) { } protected abstract T readShape ( BytesRef term ) { } public synchronized ShapeFieldCache < T > getCache ( AtomicReader reader ) throws IOException { ShapeFieldCache < T > idx = sidx . get ( reader ) ; if ( idx != null ) { return idx ; } long startTime = System . currentTimeMillis ( ) ; log . fine ( ( ( "Building<seq2seq4repair_space>Cache<seq2seq4repair_space>[" + ( reader . maxDoc ( ) ) ) + "]" ) ) ; idx = new ShapeFieldCache < T > ( reader . maxDoc ( ) , defaultSize ) ; int count = 0 ; DocsEnum docs = null ; Terms terms = reader . terms ( shapeField ) ; TermsEnum te = null ; if ( terms != null ) { te = terms . iterator ( te ) ; BytesRef term = te . next ( ) ; while ( term != null ) { T shape = readShape ( term ) ; if ( shape != null ) { <START_BUG> docs = te . docs ( null , docs , 0 ) ; <END_BUG> Integer docid = docs . nextDoc ( ) ; while ( docid != ( DocIdSetIterator . NO_MORE_DOCS ) ) { idx . add ( docid , shape ) ; docid = docs . nextDoc ( ) ; count ++ ; } } term = te . next ( ) ; } } sidx . put ( reader , idx ) ; long elapsed = ( System . currentTimeMillis ( ) ) - startTime ; log . fine ( ( ( ( ( ( "Cached:<seq2seq4repair_space>[" + count ) + "<seq2seq4repair_space>in<seq2seq4repair_space>" ) + elapsed ) + "ms]<seq2seq4repair_space>" ) + idx ) ) ; return idx ; } }

Fix:
docs = te . docs ( null , docs , false ) ;
Buggy code:
public class VelocityProperties extends Task implements PropertyInterceptor { VelocityEngine engine ; VelocityContext context ; public static final String PREFIX = "vm:" ; public VelocityProperties ( ) { } public boolean setProperty ( Object c , String ns , String name , Object v ) { } public Object getProperty ( Object p , String ns , String name ) { } public VelocityEngine getVelocityEngine ( ) { } public void execute ( ) { try { <START_BUG> PropertyHelper phelper = PropertyHelper . getPropertyHelper ( project ) ; <END_BUG> phelper . addPropertyInterceptor ( this ) ; engine = new VelocityEngine ( ) ; engine . init ( ) ; context = new VelocityContext ( ) ; context . put ( "ant" , project ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } } }

Fix:
PropertyHelper2 phelper = PropertyHelper2 . getPropertyHelper ( project ) ;
Buggy code:
public class UsersBusinessesAdapter extends ArrayAdapter < Business > { private ArrayList < Business > mBusinesses ; private LayoutInflater mInflater ; private Context context ; public UsersBusinessesAdapter ( Context context , ArrayList < Business > businesses ) { } @ Override public View getView ( int position , View convertView , ViewGroup group ) { final UsersBusinessesAdapter . ViewHolder holder ; final Business business = mBusinesses . get ( position ) ; if ( convertView == null ) { holder = new UsersBusinessesAdapter . ViewHolder ( ) ; convertView = mInflater . inflate ( layout_drawer_businesses , null ) ; holder . picture = ( ( ImageViewCircle ) ( convertView . findViewById ( img_drawer_business_picture ) ) ) ; holder . name = ( ( TextViewFont ) ( convertView . findViewById ( txt_drawer_business_name ) ) ) ; holder . item = ( ( RelativeLayout ) ( convertView . findViewById ( rl_drawer_business ) ) ) ; convertView . setTag ( holder ) ; } else { holder = ( ( UsersBusinessesAdapter . ViewHolder ) ( convertView . getTag ( ) ) ) ; } if ( business != null ) { holder . name . setText ( business . name ) ; <START_BUG> holder . item . setOnClickListener ( new View . OnClickListener ( ) { <END_BUG> @ Override public void onClick ( View view ) { InnerFragment innerFragment = new InnerFragment ( getContext ( ) ) ; innerFragment . newProfile ( context , PROFILE_BUSINESS , true , business . id ) ; ( ( ActivityMain ) ( getContext ( ) ) ) . closeDrawer ( RIGHT ) ; } } ) ; } return convertView ; } class ViewHolder { RelativeLayout item ; ImageViewCircle picture ; TextViewFont name ; int id ; } No newline ; at end ; of file ; }

Fix:
convertView . setOnClickListener ( new View . OnClickListener ( ) {
Buggy code:
@ Lazy @ Service public class UserProteinListServiceImpl implements UserProteinListService { @ Autowired private UserProteinListDao proteinListDao ; @ Override public List < UserProteinList > getUserProteinLists ( String username ) { } @ Override @ Transactional public UserProteinList createUserProteinList ( UserProteinList userProteinList ) { NPreconditions . checkNotNull ( userProteinList , "The<seq2seq4repair_space>user<seq2seq4repair_space>protein<seq2seq4repair_space>list<seq2seq4repair_space>should<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; <START_BUG> NPreconditions . checkTrue ( ( ! ( userProteinList . isPersisted ( ) ) ) , "The<seq2seq4repair_space>user<seq2seq4repair_space>protein<seq2seq4repair_space>list<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>new" ) ; <END_BUG> long id = proteinListDao . createUserProteinList ( userProteinList ) ; userProteinList . setId ( id ) ; Set < String > accessions = userProteinList . getAccessionNumbers ( ) ; if ( ( accessions != null ) && ( ! ( accessions . isEmpty ( ) ) ) ) { proteinListDao . createUserProteinListAccessions ( id , accessions ) ; } return userProteinList ; } @ Override public void deleteUserProteinList ( UserProteinList proteinList ) { } @ Override public UserProteinList getUserProteinListById ( long listId ) { } @ Override public UserProteinList getUserProteinListByNameForUser ( String username , String listName ) { } @ Override @ Transactional public UserProteinList updateUserProteinList ( UserProteinList proteinList ) { } @ Override public UserProteinList combine ( String name , String description , String username , String list1 , String list2 , Operator op ) { } }

Fix:
NPreconditions . checkTrue ( ( ( userProteinList . getId ( ) ) == 0 ) , "The<seq2seq4repair_space>user<seq2seq4repair_space>protein<seq2seq4repair_space>list<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>new" ) ;
Buggy code:
public class AlignmentSpanController extends LineStyleController < AlignmentSpanController . RichAlignmentSpanStandard , Layout . Alignment > implements EndStyleProperty { private static final String TEXT_ALIGN = "text-align" ; public AlignmentSpanController ( ) { } @ Override public Alignment getValueFromSpan ( AlignmentSpanController . RichAlignmentSpanStandard span ) { } @ Override public AlignmentSpanController . RichAlignmentSpanStandard add ( Layout . Alignment value , Editable editable , int selectionStart , int selectionEnd , int flags ) { } @ Override public Alignment getDefaultValue ( BaseRichEditText editText ) { } @ Override protected Alignment getMultiValue ( ) { } @ Override public String beginTag ( Object span ) { } @ Override protected AlignmentSpanController . RichAlignmentSpanStandard createSpan ( Map < String , String > styleMap , Attributes attributes ) { } @ Override public boolean setPropertyFromTag ( SpannableStringBuilder editable , Map < String , String > styleMap ) { if ( styleMap . containsKey ( AlignmentSpanController . TEXT_ALIGN ) ) { AlignmentSpanController . RichAlignmentSpanStandard span = createSpan ( styleMap , null ) ; if ( span != null ) { <START_BUG> performSpan ( createSpan ( styleMap , null ) , editable , StyleSelectionInfo . getStyleSelectionInfo ( editable ) ) ; <END_BUG> return true ; } } return false ; } public static class RichAlignmentSpanStandard extends AlignmentSpan . Standard { public RichAlignmentSpanStandard ( Layout . Alignment align ) { } } No newline ; at end ; of file ; }

Fix:
performSpan ( span , editable , StyleSelectionInfo . getStyleSelectionInfo ( editable ) ) ;
Buggy code:
public class Engine { private static final String PACKAGE_NAME = Engine . class . getPackage ( ) . getName ( ) ; private boolean debug ; private String path ; private String encoding ; private String left ; private String right ; private String [ ] extFunctions ; private String [ ] extModifiers ; private Map < String , String > configures ; private Map < String , Class < ? > > functions = new HashMap < String , Class < ? > > ( 256 ) ; private Map < String , Class < ? > > modifiers = new HashMap < String , Class < ? > > ( 256 ) ; private Map < String , Template > templates = new HashMap < String , Template > ( 256 ) ; public Engine ( ) { } public Engine ( Map < String , String > configuration ) { } public boolean isDebug ( ) { } public void setDebug ( boolean isDebug ) { } public String getEncoding ( ) { } public void setEncoding ( String encoding ) { } public String getTemplatePath ( ) { } public void setTemplatePath ( String path ) { } public String getLeftDelimiter ( ) { } public void setLeftDelimiter ( String leftDelimiter ) { } public String getRightDelimiter ( ) { } public void setRightDelimiter ( String rightDelimiter ) { } public void addConfig ( String key , String value ) { } public Object createNode ( String name , boolean isFunction ) throws ParseException { } public Template getTemplate ( String name ) throws IOException , TemplateException { } public Template parseTemplate ( String smartyCode ) throws IOException , TemplateException { Template template = templates . get ( smartyCode ) ; <START_BUG> if ( ( template != null ) && ( ! ( ( debug ) && ( template . isUpdated ( ) ) ) ) ) { <END_BUG> return template ; } template = new Template ( this , smartyCode ) ; templates . put ( smartyCode , template ) ; return template ; } Map < String , String > getConfigures ( ) { } No newline ; at end ; of file ; }

Fix:
if ( template != null ) {
Buggy code:
public class PlatformMBeanTestModelControllerService extends AbstractControllerService { private static final DescriptionProvider DESC_PROVIDER = new DescriptionProvider ( ) { @ Override public ModelNode getModelDescription ( Locale locale ) { } } ; final CountDownLatch latch = new CountDownLatch ( 2 ) ; protected PlatformMBeanTestModelControllerService ( ) { } @ Override <START_BUG> protected void initModel ( Resource rootResource , ManagementResourceRegistration rootRegistration , Resource modelControllerResource ) { <END_BUG> GlobalOperationHandlers . registerGlobalOperations ( rootRegistration , processType ) ; rootRegistration . registerOperationHandler ( DEFINITION , INSTANCE ) ; PlatformMBeanResourceRegistrar . registerPlatformMBeanResources ( rootRegistration ) ; rootResource . registerChild ( ROOT_PATH , new RootPlatformMBeanResource ( ) ) ; } @ Override public void start ( StartContext context ) throws StartException { } @ Override protected void bootThreadDone ( ) { } }

Fix:
protected void initModel ( Resource rootResource , ManagementResourceRegistration rootRegistration ) {