nus-yam/ex-repair huggingface dataset:
Buggy code:
public class NewsListAdapter extends RecyclerView . Adapter < RecyclerView . ViewHolder > implements View . OnClickListener { private static final int ANIMATED_ITEMS_COUNT = 2 ; private WeakReference < Context > wrContext ; private int lastAnimatedPosition = - 1 ; private List < NewsListAdapter . ListItem > mItemList = null ; private NewsListAdapter . ListItem mCurrentItem ; private NewsListAdapter . OnItemClickListener mOnItemClickListener ; public NewsListAdapter ( Context context ) { } @ Override public ViewHolder onCreateViewHolder ( ViewGroup parent , int viewType ) { } @ Override public void onBindViewHolder ( RecyclerView . ViewHolder viewHolder , int position ) { } private void setupItemView ( NewsListAdapter . NewsFeedViewHolder holder , int position ) { } public void updateList ( DailyNewsModel dailyModel ) { if ( dailyModel != null ) { List < NewsModel > newsList = dailyModel . getNewsList ( ) ; String date = dailyModel . getDate ( ) ; int len = newsList . size ( ) ; NewsListAdapter . ListItem section = new NewsListAdapter . ListItem ( NewsListAdapter . ListItem . SECTION , null , dailyModel . getDisplay_date ( ) , len , ( - 1 ) , date ) ; mItemList . add ( section ) ; for ( int j = 0 ; j < len ; j ++ ) { newsList . get ( j ) . setDate ( date ) ; <START_BUG> NewsListAdapter . ListItem item = new NewsListAdapter . ListItem ( NewsListAdapter . ListItem . ITEM , newsList . get ( j ) , null , len , j , date ) ; <END_BUG> mItemList . add ( item ) ; } } notifyDataSetChanged ( ) ; } public void updateAllList ( List < DailyNewsModel > list ) { } @ Override public int getItemCount ( ) { } @ Override public int getItemViewType ( int position ) { } public NewsListAdapter . ListItem getItemByPosition ( int position ) { } @ Override public void onClick ( View v ) { } public void setOnItemClickListener ( NewsListAdapter . OnItemClickListener listener ) { } private void runEnterAnimation ( View view , int position ) { } public DailyNewsModel getDailyNewsModelByDate ( String date ) { } private boolean isToday ( String date ) { } public interface OnItemClickListener { public void onItemClick ( View view , NewsListAdapter . ListItem item ) { } } public static class ListItem { public static final int ITEM = 0 ; public static final int SECTION = 1 ; public final int type ; public final String section ; public final int sectionSize ; public final NewsModel model ; public final int indexOfDay ; public final String date ; public ListItem ( int type , NewsModel model , String section , int size , int index , String date ) { } public NewsModel getModel ( ) { } public int getType ( ) { } public String getSection ( ) { } public int getSectionSize ( ) { } public int getIndexOfDay ( ) { } public String getDate ( ) { } } public static class NewsFeedViewHolder extends RecyclerView . ViewHolder { public ImageView imageView ; public TextView titleTextView ; public RelativeLayout container ; public NewsFeedViewHolder ( View view ) { } } }

Fix:
NewsListAdapter . ListItem item = new NewsListAdapter . ListItem ( NewsListAdapter . ListItem . ITEM , newsList . get ( j ) , dailyModel . getDisplay_date ( ) , len , j , date ) ;
Buggy code:
public class Brain { private static int numBitsSet ( long x ) { } private float endgameFraction ( Board board ) { int blackBishopCount = Brain . numBitsSet ( board . blackBishops ) ; int blackKnightCount = Brain . numBitsSet ( board . blackKnights ) ; int blackPawnCount = Brain . numBitsSet ( board . blackPawns ) ; int blackQueenCount = Brain . numBitsSet ( board . blackQueens ) ; int blackRookCount = Brain . numBitsSet ( board . blackRooks ) ; int whiteBishopCount = Brain . numBitsSet ( board . whiteBishops ) ; int whiteKnightCount = Brain . numBitsSet ( board . whiteKnights ) ; int whitePawnCount = Brain . numBitsSet ( board . whitePawns ) ; int whiteQueenCount = Brain . numBitsSet ( board . whiteQueens ) ; int whiteRookCount = Brain . numBitsSet ( board . whiteRooks ) ; float blackMaterial = ( ( ( ( blackBishopCount * ( this . FITNESS_BISHOP ) ) + ( blackKnightCount * ( this . FITNESS_KNIGHT ) ) ) + ( blackPawnCount * ( this . FITNESS_PAWN ) ) ) + ( blackQueenCount * ( this . FITNESS_QUEEN ) ) ) + ( blackRookCount * ( this . FITNESS_ROOK ) ) ; float whiteMaterial = ( ( ( ( whiteBishopCount * ( this . FITNESS_BISHOP ) ) + ( whiteKnightCount * ( this . FITNESS_KNIGHT ) ) ) + ( whitePawnCount * ( this . FITNESS_PAWN ) ) ) + ( whiteQueenCount * ( this . FITNESS_QUEEN ) ) ) + ( whiteRookCount * ( this . FITNESS_ROOK ) ) ; <START_BUG> return ( blackMaterial + whiteMaterial ) // ( 2 * ( this . FITNESS_START_NOKING ) ) ; <END_BUG> } private float fitness ( Board board ) { } private float probeCapture ( Board board , long target ) { } private float alphabeta ( Board board , int depth , float alpha , float beta ) { } public Move getMove ( Board board ) { } private float FITNESS_LARGE = 1000000000 ; private float FITNESS_BISHOP = 333 ; private float FITNESS_KING = 1000000 ; private float FITNESS_KNIGHT = 320 ; private float FITNESS_PAWN = 100 ; private float FITNESS_QUEEN = 880 ; private float FITNESS_ROOK = 510 ; private float FITNESS_START_NOKING = ( ( ( ( 2 * ( FITNESS_ROOK ) ) + ( 2 * ( FITNESS_KNIGHT ) ) ) + ( 2 * ( FITNESS_BISHOP ) ) ) + ( FITNESS_QUEEN ) ) + ( 8 * ( FITNESS_PAWN ) ) ; private float [ ] [ ] FITNESS_PAWN_TABLE_OPENING = new float [ ] [ ] { new float [ ] { 0 , 0 , 0 , 0 } , new float [ ] { 90 , 95 , 105 , 110 } , new float [ ] { 90 , 95 , 105 , 115 } , new float [ ] { 90 , 95 , 110 , 120 } , new float [ ] { 97 , 103 , 117 , 127 } , new float [ ] { 106 , 112 , 125 , 140 } , new float [ ] { 117 , 122 , 134 , 159 } , new float [ ] { 0 , 0 , 0 , 0 } } ; private float [ ] [ ] FITNESS_PAWN_TABLE_ENDGAME = new float [ ] [ ] { new float [ ] { 0 , 0 , 0 , 0 } , new float [ ] { 120 , 105 , 95 , 90 } , new float [ ] { 120 , 105 , 95 , 90 } , new float [ ] { 125 , 110 , 100 , 95 } , new float [ ] { 133 , 117 , 107 , 100 } , new float [ ] { 145 , 129 , 116 , 105 } , new float [ ] { 161 , 146 , 127 , 110 } , new float [ ] { 0 , 0 , 0 , 0 } } ; }

Fix:
return 1 - ( ( blackMaterial + whiteMaterial ) // ( 2 * ( this . FITNESS_START_NOKING ) ) ) ;
Buggy code:
public class Http { private static final int MAX_REDIRECTIONS = 5 ; private static enum RequestType { GET , POST , DELETE ; } public static Http . Request get ( String url ) { } public static Http . Request post ( String url ) { } public static Http . Request delete ( String url ) { } public static class Request { static Http . Request newInstance ( String url , Http . RequestType type ) { } private String mUrl ; private Http . RequestType mRequestType ; private boolean mDoRedirect = true ; private List < Http . Pair > mQueryParams ; private List < Http . Pair > mHeaders ; private String mContent ; private String mContentType ; private String mUserAgent ; private boolean mShowLogs = false ; public Http . Request query ( Http . Pair ... params ) { } public Http . Request query ( String key , String value ) { } public Http . Request header ( Http . Pair ... params ) { } public Http . Request header ( String key , String value ) { } public Http . Request userAgent ( String userAgent ) { } public Http . Request noRedirect ( ) { } public Http . Request verbose ( ) { } public Http . Request body ( String content , String type ) { } public Http . Response asIs ( ) { } public byte [ ] asBytes ( ) { } public String asString ( ) { byte [ ] bytes = asBytes ( ) ; <START_BUG> return null != bytes ? new String ( asBytes ( ) ) : null ; <END_BUG> } public < T > T map ( ResponseMapper < T > mapper ) { } private HttpURLConnection toUrlConnection ( final Http . RequestType requestType , final String url , final List < Http . Pair > queryParams , final boolean redirect ) { } private void log ( Object object ) { } } public static class Response { public static Http . Response from ( HttpURLConnection connection ) { } public int mResponseCode ; public String mResponseMessage ; public Map < String , List < String > > mResponseHeaders ; public byte [ ] mBody ; @ Override public String toString ( ) { } } public static class Pair { public static Http . Pair of ( String key , Object value ) { } public String mKey ; public Object mValue ; public String toQueryString ( ) { } } private static void setCookieHandlerIfNeeded ( ) { } private static String prepareQueryString ( final List < Http . Pair > queryParams ) { } public static void copy ( final InputStream from , final OutputStream to , final boolean closeStreams ) throws IOException { } private static void throwIt ( Throwable t ) { } }

Fix:
return null != bytes ? new String ( bytes ) : null ;
Buggy code:
public class Room implements Serializable { private static final long serialVersionUID = 1L ; private String RoomDescription ; private boolean monster ; private boolean puzzle ; private ArrayList < Item > objectsInRoom ; private int monsterInRoomID ; private int puzzleInRoomID ; private boolean complete = false ; public Room ( String roomDescription , ArrayList < Item > objectsInRoom , int monsterInRoomID , int puzzleInRoomID ) { } private void markRoomComplete ( ) { } public String investigate ( ) { } public String getRoomDescription ( ) { } public int getMonsterInRoom ( ) { } public int getPuzzleInRoom ( ) { } public boolean hasMonster ( ) { } public boolean hasPuzzle ( ) { } public boolean isComplete ( ) { } public String toString ( ) { String objectString = "" ; for ( int i = 0 ; i < ( objectsInRoom . size ( ) ) ; i ++ ) { objectString = ( objectString + ( objectsInRoom . get ( i ) . getDescription ( ) ) ) + ",<seq2seq4repair_space>" ; } <START_BUG> String roomString = ( ( ( ( ( ( RoomDescription ) + ",<seq2seq4repair_space>Monster<seq2seq4repair_space>ID:<seq2seq4repair_space>" ) + ( monsterInRoomID ) ) + ",<seq2seq4repair_space>Puzzle:<seq2seq4repair_space>" ) + ( puzzleInRoomID ) ) + "<seq2seq4repair_space>Items:<seq2seq4repair_space>" ) + objectString ; <END_BUG> return roomString ; } }

Fix:
String roomString = ( ( ( ( "Monster<seq2seq4repair_space>ID:<seq2seq4repair_space>" + ( monsterInRoomID ) ) + ",<seq2seq4repair_space>Puzzle:<seq2seq4repair_space>" ) + ( puzzleInRoomID ) ) + "<seq2seq4repair_space>Items:<seq2seq4repair_space>" ) + objectString ;
Buggy code:
public class AbstractRTSService { private InjectedValue < Host > injectedHost = new InjectedValue ( ) ; private InjectedValue < SocketBinding > injectedSocketBinding = new InjectedValue ( ) ; private volatile Deployment deployment = null ; public InjectedValue < Host > getInjectedHost ( ) { } public InjectedValue < SocketBinding > getInjectedSocketBinding ( ) { } protected DeploymentInfo getDeploymentInfo ( final String name , final String contextPath , final Map < String , String > initialParameters ) { } protected void deployServlet ( final DeploymentInfo deploymentInfo ) { } protected void undeployServlet ( ) { } protected String getBaseUrl ( ) { final String address = injectedSocketBinding . getValue ( ) . getAddress ( ) . getHostAddress ( ) ; <START_BUG> final int port = injectedSocketBinding . getValue ( ) . getAbsolutePort ( ) ; <END_BUG> if ( ( injectedSocketBinding . getValue ( ) . getAddress ( ) ) instanceof Inet4Address ) { return ( ( "http:////" + address ) + ":" ) + port ; } else { return ( ( "http:////[" + address ) + "]:" ) + port ; } } private ServletInfo getResteasyServlet ( ) { } private ListenerInfo getResteasyListener ( ) { } private ListenerInfo getRestATListener ( ) { } }

Fix:
final int port = injectedSocketBinding . getValue ( ) . getPort ( ) ;
Buggy code:
public class ElasticVertex extends ElasticElement implements Vertex , Vertex . Iterators { private ElasticService elasticService ; public ElasticVertex ( final Object id , final String label , Object [ ] keyValues , ElasticGraph graph ) { } @ Override public Property addPropertyLocal ( String key , Object value ) { } @ Override public < V > VertexProperty < V > property ( final String key , final V value , final Object ... keyValues ) { } @ Override public < V > VertexProperty < V > property ( String key , V value ) { } @ Override public < V > VertexProperty < V > property ( final String key ) { } @ Override public Edge addEdge ( final String label , final Vertex vertex , final Object ... keyValues ) { } @ Override public void remove ( ) { } @ Override public String toString ( ) { } @ Override public Iterators iterators ( ) { } @ Override public < V > Iterator < VertexProperty < V > > propertyIterator ( final String ... propertyKeys ) { } @ Override public Iterator < Edge > edgeIterator ( final Direction direction , final String ... edgeLabels ) { } private FilterBuilder getFilter ( String key ) { } @ Override public Iterator < Vertex > vertexIterator ( final Direction direction , final String ... edgeLabels ) { checkRemoved ( ) ; Iterator < Edge > edgeIterator = edgeIterator ( direction , edgeLabels ) ; ArrayList < Object > ids = new ArrayList < > ( ) ; edgeIterator . forEachRemaining ( ( edge ) -> ( ( ElasticEdge ) ( edge ) ) . getVertexId ( direction ) . forEach ( ( id ) -> ids . add ( id ) ) ) ; <START_BUG> return graph . vertexIterator ( ids . toArray ( ) ) ; <END_BUG> } @ Override protected void checkRemoved ( ) { } }

Fix:
return elasticService . getVertices ( ids . toArray ( ) ) ;
Buggy code:
public class CodeSnippetSingleNameReference extends SingleNameReference implements InvocationSite , ProblemReasons , EvaluationConstants { EvaluationContext evaluationContext ; FieldBinding delegateThis ; public CodeSnippetSingleNameReference ( char [ ] source , long pos , EvaluationContext evaluationContext ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , boolean valueRequired ) { switch ( ( bits ) & ( ASTNode . RestrictiveFlagMASK ) ) { case FIELD : FieldBinding fieldBinding ; if ( ( ( fieldBinding = ( ( FieldBinding ) ( binding ) ) ) . isFinal ( ) ) && ( currentScope . allowBlankFinalFieldAssignment ( fieldBinding ) ) ) { if ( ! ( flowInfo . isDefinitelyAssigned ( fieldBinding ) ) ) { currentScope . problemReporter ( ) . uninitializedBlankFinalField ( fieldBinding , this ) ; } } break ; case LOCAL : LocalVariableBinding localBinding ; if ( ! ( flowInfo . isDefinitelyAssigned ( ( localBinding = ( ( LocalVariableBinding ) ( binding ) ) ) ) ) ) { currentScope . problemReporter ( ) . uninitializedLocalVariable ( localBinding , this ) ; } <START_BUG> localBinding . useFlag = ( flowInfo . isFakeReachable ( ) ) ? LocalVariableBinding . FAKE_USED : LocalVariableBinding . USED ; <END_BUG> } return flowInfo ; } public TypeBinding checkFieldAccess ( BlockScope scope ) { } public void generateAssignment ( BlockScope currentScope , CodeStream codeStream , Assignment assignment , boolean valueRequired ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public void generateCompoundAssignment ( BlockScope currentScope , CodeStream codeStream , MethodBinding writeAccessor , Expression expression , int operator , int assignmentImplicitConversion , boolean valueRequired ) { } public void generatePostIncrement ( BlockScope currentScope , CodeStream codeStream , CompoundAssignment postIncrement , boolean valueRequired ) { } public void generateReceiver ( CodeStream codeStream ) { } public TypeBinding getReceiverType ( BlockScope currentScope ) { } public TypeBinding reportError ( BlockScope scope ) { } }

Fix:
localBinding . useFlag = ( flowInfo . isReachable ( ) ) ? LocalVariableBinding . USED : LocalVariableBinding . FAKE_USED ;
Buggy code:
public class OutgoingPacketHandler extends PacketHandler { private final ConcurrentHashMap < List < Byte > , FloatingPacket > floatingPacketMap = new ConcurrentHashMap < > ( ) ; private NetworkManager networkManager ; private long lastPingSend = 0 ; public OutgoingPacketHandler ( NetworkManager networkManager ) { } @ Override public void run ( ) { while ( true ) { if ( ( System . currentTimeMillis ( ) ) > ( ( networkManager . getLastTableDrop ( ) ) + ( Protocol . CONVERGE_TIME ) ) ) { synchronized ( floatingPacketMap ) { for ( FloatingPacket packet : floatingPacketMap . values ( ) ) { if ( ( ( packet . getSentOn ( ) ) + ( Protocol . TIMEOUT ) ) < ( System . currentTimeMillis ( ) ) ) { this . send ( packet ) ; packet . setSentOn ( System . currentTimeMillis ( ) ) ; } } } } if ( ( System . currentTimeMillis ( ) ) > ( ( networkManager . getLastTableDrop ( ) ) + 10000 ) ) { networkManager . dropTable ( ) ; networkManager . setDiscoverySequenceNum ( ( ( short ) ( ( networkManager . getDiscoverySequenceNum ( ) ) + 1 ) ) ) ; networkManager . sendTable ( ) ; } try { Thread . sleep ( 50 ) ; } catch ( InterruptedException e ) { System . out . println ( e . getMessage ( ) ) ; e . printStackTrace ( ) ; } if ( ( System . currentTimeMillis ( ) ) > ( ( getLastPingSend ( ) ) + ( Protocol . PING_INTERVAL ) ) ) { <START_BUG> Packet pingPacket = networkManager . constructPing ( ) ; <END_BUG> send ( pingPacket ) ; System . out . println ( ( ( "broadcasting<seq2seq4repair_space>Ping:<seq2seq4repair_space>" + "\n" ) + pingPacket ) ) ; lastPingSend = System . currentTimeMillis ( ) ; } } } public void send ( Packet packet ) { } public Packet handleACK ( Packet ackPacket ) { } public long getLastPingSend ( ) { } }

Fix:
Packet pingPacket = networkManager . constructPing ( null ) ;
Buggy code:
public class StatusRenderer extends DefaultLabelRenderer { boolean bool ; ImageIcon image1 ; ImageIcon image2 ; ImageIcon image4 ; ImageIcon image3 ; ImageIcon image5 ; ImageIcon image6 ; public StatusRenderer ( JTree tree ) { } public Component getTableCellRendererComponent ( JTable table , Object value , boolean isSelected , boolean hasFocus , int row , int column ) { super . getTableCellRendererComponent ( table , value , isSelected , hasFocus , row , column ) ; if ( value == null ) { setIcon ( null ) ; return this ; } if ( value instanceof String ) { System . out . println ( "statusrenderer-><seq2seq4repair_space>instanceof<seq2seq4repair_space>String<seq2seq4repair_space>not<seq2seq4repair_space>expected" ) ; return this ; } <START_BUG> Flags flags = ( ( Flags ) ( value ) ) ; <END_BUG> if ( flags . getDeleted ( ) ) { setIcon ( image3 ) ; } else if ( flags . getAnswered ( ) ) { setIcon ( image1 ) ; } else if ( ! ( flags . getSeen ( ) ) ) { setIcon ( image6 ) ; } else if ( flags . getSeen ( ) ) { setIcon ( image5 ) ; } else { setIcon ( null ) ; } return this ; } }

Fix:
Flags flags = ( ( Flags ) ( ( ( MessageNode ) ( value ) ) . getHeader ( ) . getFlags ( ) ) ) ;
Buggy code:
public class TxBridgeInboundRecoveryService extends AbstractService < InboundBridgeRecoveryManager > { private volatile InboundBridgeRecoveryManager inboundBridgeRecoveryManager ; public TxBridgeInboundRecoveryService ( ) { } @ Override public InboundBridgeRecoveryManager getValue ( ) throws IllegalStateException { } @ Override public synchronized void start ( final StartContext context ) throws StartException { final ClassLoader loader = TxBridgeInboundRecoveryService . class . getClassLoader ( ) ; SecurityActions . setContextLoader ( loader ) ; try { InboundBridgeRecoveryManager service = new InboundBridgeRecoveryManager ( ) ; try { service . start ( ) ; } catch ( Exception e ) { <START_BUG> throw new StartException ( "TxBridge<seq2seq4repair_space>inbound<seq2seq4repair_space>recovery<seq2seq4repair_space>service<seq2seq4repair_space>start<seq2seq4repair_space>failed" , e ) ; <END_BUG> } inboundBridgeRecoveryManager = service ; } finally { SecurityActions . setContextLoader ( null ) ; } } public synchronized void stop ( final StopContext context ) { } }

Fix:
throw MESSAGES . txBridgeInboundRecoveryServiceFailedToStart ( ) ;
Buggy code:
public class RequestAction { private int isPassed ; private List < StudentProfile > student_list ; private int userid ; private String strValue ; public String getStrValue ( ) { } public void setStrValue ( String strValue ) { } public int getUserid ( ) { } public void setUserid ( int userid ) { } public int getIsPassed ( ) { } public void setIsPassed ( int isPassed ) { } public List < StudentProfile > getStudent_list ( ) { } public void setStudent_list ( List < StudentProfile > student_list ) { } public String studentRequest ( ) throws Exception { } public String studentRequestEnsure ( ) throws Exception { } public String studentRequestResult ( ) throws Exception { } public String studentRequestChange ( ) throws Exception { Session session = sessionFactory . openSession ( ) ; Transaction trans = session . beginTransaction ( ) ; String hql = ( "update<seq2seq4repair_space>StudentProfile<seq2seq4repair_space>s<seq2seq4repair_space>set<seq2seq4repair_space>s.isPassed=0" + "<seq2seq4repair_space>where<seq2seq4repair_space>s.id=" ) + ( String . valueOf ( userid ) ) ; Query q = session . createQuery ( hql ) ; int ret = q . executeUpdate ( ) ; System . out . println ( ret ) ; trans . commit ( ) ; <START_BUG> if ( ret == 0 ) { <END_BUG> strValue = ActionSupport . SUCCESS ; return ActionSupport . SUCCESS ; } else return ActionSupport . ERROR ; } No newline ; at end ; of file ; }

Fix:
if ( ret > 0 ) {
Buggy code:
public class RequestEncodingTest extends TestCase { private static final Logger log = LoggerFactory . getLogger ( RequestEncodingTest . class ) ; private WicketApplication application ; private WicketTester tester ; @ Override protected void setUp ( ) throws Exception { } @ Override protected void tearDown ( ) throws Exception { } public void testDefault ( ) { tester . startPage ( A . class , new PageParameters ( ) . set ( "file" , "umlaut-ä-ö-ü" ) ) ; tester . assertRenderedPage ( B . class ) ; String url2 = ( ( B ) ( tester . getLastRenderedPage ( ) ) ) . getInterceptContinuationURL ( ) ; assertTrue ( url2 . contains ( "umlaut-%C3%A4-%C3%B6-%C3%BC" ) ) ; tester . clickLink ( "link" ) ; tester . assertRenderedPage ( A . class ) ; String file = ( ( A ) ( tester . getLastRenderedPage ( ) ) ) . getFileParameter ( ) ; assertEquals ( "umlaut-ä-ö-ü" , file ) ; String document = tester . getLastResponseAsString ( ) ; <START_BUG> assertTrue ( document . contains ( "ä-ö-ü" ) ) ; <END_BUG> } public void testUmlautsInRequestUri ( ) { } }

Fix:
assertTrue ( document . contains ( "umlaut-&#228;-&#246;-&#252;" ) ) ;
Buggy code:
public class TripleTest { @ Test public void testTripleOf ( ) throws Exception { Triple < Integer , String , Boolean > triple = Triple . of ( 0 , "foo" , Boolean . TRUE ) ; assertTrue ( ( triple instanceof ImmutableTriple < ? , ? , ? > ) ) ; assertEquals ( 0 , ( ( ImmutableTriple < Integer , String , Boolean > ) ( triple ) ) . left . intValue ( ) ) ; assertEquals ( "foo" , ( ( ImmutableTriple < Integer , String , Boolean > ) ( triple ) ) . middle ) ; assertEquals ( Boolean . TRUE , ( ( ImmutableTriple < Integer , String , Boolean > ) ( triple ) ) . right ) ; <START_BUG> Triple < Object , String , Long > triple2 = Triple . of ( null , "bar" , 200L ) ; <END_BUG> assertTrue ( ( triple2 instanceof ImmutableTriple < ? , ? , ? > ) ) ; assertNull ( ( ( ImmutableTriple < Object , String , Long > ) ( triple2 ) ) . left ) ; assertEquals ( "bar" , ( ( ImmutableTriple < Object , String , Long > ) ( triple2 ) ) . middle ) ; assertEquals ( new Long ( 200L ) , ( ( ImmutableTriple < Object , String , Long > ) ( triple2 ) ) . right ) ; } @ Test public void testCompatibilityBetweenTriples ( ) throws Exception { } @ Test public void testComparable1 ( ) throws Exception { } @ Test public void testComparable2 ( ) throws Exception { } @ Test public void testComparable3 ( ) throws Exception { } @ Test public void testComparable4 ( ) throws Exception { } @ Test public void testToString ( ) throws Exception { } @ Test public void testToStringCustom ( ) throws Exception { } @ Test public void testFormattable_simple ( ) throws Exception { } @ Test public void testFormattable_padded ( ) throws Exception { } }

Fix:
Triple < Object , String , Long > triple2 = Triple . of ( null , "bar" , Long . valueOf ( 200L ) ) ;
Buggy code:
public class Downloader { public static final String VERSION = "Online<seq2seq4repair_space>Manga<seq2seq4repair_space>Downloader<seq2seq4repair_space>0.1.6.6<seq2seq4repair_space>Test" ; public static final int NUMTHREADS = 3 ; private static TempDownloaderFrame frame ; private static ThreadPoolExecutor executor ; private Downloader ( ) { } public static void status ( int index , String s ) { } private static void execute ( int index , Chapter c , File d ) throws Exception { } private static int getIndex ( ) { } public static void runChapter ( Chapter _chapter , File _directory ) { final Chapter c = _chapter ; final File d = _directory ; Downloader . executor . execute ( new Runnable ( ) { public void run ( ) { int index = Downloader . getIndex ( ) ; try { Downloader . execute ( index , c , d ) ; } catch ( Exception e ) { <START_BUG> DownloaderUtils . error ( "Error<seq2seq4repair_space>while<seq2seq4repair_space>running<seq2seq4repair_space>chapter" , e , true ) ; <END_BUG> Downloader . status ( index , ( "Error:<seq2seq4repair_space>" + ( e . getLocalizedMessage ( ) ) ) ) ; } } } ) ; } public static void autodetectChapter ( ArrayList < Chapter > _chapters , File _directory ) { } public static void init ( ) throws Exception { } public static void main ( String [ ] args ) throws Exception { } No newline ; at end ; of file ; }

Fix:
DownloaderUtils . error ( "Error<seq2seq4repair_space>while<seq2seq4repair_space>running<seq2seq4repair_space>chapter" , e , false ) ;
Buggy code:
public class AOUtils { public static List < Account > getAccounts ( File prefsDir ) { } public static File geAOLocalDir ( ) { } public static File getAOPrefsDir ( ) { } public static interface Applier < T > { void apply ( T obj ) { } } public static interface Applier3 < T , U , V > { void apply ( T obj , U obj2 , V obj3 ) { } } public static void applyToBackpacks ( File prefsDir , AOUtils . Applier < Backpack > func ) { } public static void applyToBackpacks ( File prefsDir , AOUtils . Applier3 < Backpack , AOCharacter , Account > func ) { AOUtils . getAccounts ( prefsDir ) . stream ( ) . forEach ( ( account ) -> { account . getCharacters ( ) . stream ( ) . forEach ( ( toon ) -> { List < Backpack > backpacks = toon . getBackpacks ( ) ; backpacks . sort ( ( Backpack b1 , Backpack b2 ) -> { String name1 = b1 . getName ( ) ; if ( name1 == null ) { name1 = "" ; } String name2 = b2 . getName ( ) ; if ( name2 == null ) { name2 = "" ; } <START_BUG> return name1 . compareTo ( name2 ) ; <END_BUG> } ) ; backpacks . stream ( ) . forEach ( ( backpack ) -> { func . apply ( backpack , toon , account ) ; } ) ; } ) ; } ) ; } public static void applyToWindows ( File prefsDir , AOUtils . Applier < ChatWindow > func ) { } }

Fix:
return String . CASE_INSENSITIVE_ORDER . compare ( name1 , name2 ) ;
Buggy code:
public class LoadCategoriesDataRequest extends BaseClass { @ Inject EventBus eventBus ; @ Inject Cache cache ; @ Inject NetworkAccessHelper networkAccessHelper ; public void processRequest ( Context context ) { } private ErrorListener createErrorListener ( final Context context ) { } private Response . Listener < String > createSuccessListener ( final Context context ) { return new Response . Listener < String > ( ) { @ Override public void onResponse ( String json ) { Gson gson = new Gson ( ) ; try { List < CategoryWithChildCategoryDto > categoryDtoList ; GetCategoriesDataEvent event = new GetCategoriesDataEvent ( ) ; categoryDtoList = gson . fromJson ( json , new TypeToken < ArrayList < CategoryWithChildCategoryDto > > ( ) { } . getType ( ) ) ; <START_BUG> if ( categoryDtoList == null ) { <END_BUG> event . setSuccess ( false ) ; eventBus . postSticky ( event ) ; return ; } event . setSuccess ( true ) ; event . setCategoryList ( categoryDtoList ) ; eventBus . postSticky ( event ) ; cache . updateCategoriesData ( context , json ) ; } catch ( e ) { GetCategoriesDataEvent event = new GetCategoriesDataEvent ( ) ; event . setSuccess ( false ) ; event . setError ( "Invalid<seq2seq4repair_space>data<seq2seq4repair_space>from<seq2seq4repair_space>server" ) ; eventBus . postSticky ( event ) ; } } } ; } }

Fix:
if ( ( categoryDtoList == null ) || ( ( categoryDtoList . size ( ) ) == 0 ) ) {
Buggy code:
@ Path ( "competitions" ) public class CompetitionService { @ GET @ Path ( "{identity}" ) @ Produces ( { MediaType . APPLICATION_JSON , MediaType . APPLICATION_XML } ) public Response queryIdentity ( @ PathParam ( "identity" ) final long competitorIdentity ) { } @ GET @ Path ( "{identity}//logo" ) @ Produces ( MediaType . WILDCARD ) public Response queryLogo ( @ PathParam ( "identity" ) final long competitorIdentity ) { final EntityManager entityManager = TOURNAMENT_FACTORY . createEntityManager ( ) ; try { final Competition competiton = entityManager . find ( Competition . class , competitorIdentity ) ; if ( competiton == null ) return Response . status ( NOT_FOUND ) . build ( ) ; <START_BUG> final Document avatar = competiton . getDocument ( ) ; <END_BUG> return Response . ok ( avatar . getBody ( ) , avatar . getType ( ) ) . build ( ) ; } finally { try { entityManager . close ( ) ; } catch ( final Exception exception ) { } } } @ GET @ Path ( "{identity}//divisions" ) @ Produces ( { MediaType . APPLICATION_JSON , MediaType . APPLICATION_XML } ) public Response queryDivisions ( @ PathParam ( "identity" ) final long competitorIdentity ) { } @ GET @ Path ( "{identity}//divisions//derived-games" ) @ Produces ( { MediaType . APPLICATION_JSON , MediaType . APPLICATION_XML } ) public Response queryDivisionsDerivedGames ( @ PathParam ( "identity" ) final long competitorIdentity ) { } }

Fix:
final Document avatar = competiton . getLogo ( ) ;
Buggy code:
public class DebugPostProcessor extends AbstractTestElement implements PostProcessor , TestBean { public void process ( ) { StringBuffer sb = new StringBuffer ( 100 ) ; JMeterContext threadContext = getThreadContext ( ) ; PropertyIterator i = threadContext . getCurrentSampler ( ) . propertyIterator ( ) ; while ( i . hasNext ( ) ) { JMeterProperty prop = i . next ( ) ; sb . append ( prop . getName ( ) ) ; sb . append ( "=" ) ; sb . append ( prop . getStringValue ( ) ) ; sb . append ( "\n" ) ; } SampleResult sr = new SampleResult ( ) ; sr . setResponseData ( sb . toString ( ) . getBytes ( ) ) ; <START_BUG> sr . setDataType ( "text" ) ; <END_BUG> sr . setSampleLabel ( getName ( ) ) ; sr . setSuccessful ( true ) ; sr . setSamplerData ( "SamplerPropertyValues" ) ; threadContext . getPreviousResult ( ) . addSubResult ( sr ) ; } }

Fix:
sr . setDataType ( TEXT ) ;
Buggy code:
public class Camera2VideoFragment extends Fragment implements View . OnClickListener { private static final SparseIntArray ORIENTATIONS = new SparseIntArray ( ) ; private static final String TAG = "Camera2VideoFragment" ; private AutoFitTextureView mTextureView ; private Button mButtonVideo ; private CameraDevice mCameraDevice ; private CameraCaptureSession mPreviewSession ; private SurfaceTextureListener mSurfaceTextureListener = new TextureView . SurfaceTextureListener ( ) { @ Override public void onSurfaceTextureAvailable ( SurfaceTexture surfaceTexture , int width , int height ) { } @ Override public void onSurfaceTextureSizeChanged ( SurfaceTexture surfaceTexture , int width , int height ) { } @ Override public boolean onSurfaceTextureDestroyed ( SurfaceTexture surfaceTexture ) { } @ Override public void onSurfaceTextureUpdated ( SurfaceTexture surfaceTexture ) { } } ; private Size mPreviewSize ; private Size mVideoSize ; private Builder mPreviewBuilder ; private MediaRecorder mMediaRecorder ; private boolean mIsRecordingVideo ; private HandlerThread mBackgroundThread ; private Handler mBackgroundHandler ; private Semaphore mCameraOpenCloseLock = new Semaphore ( 1 ) ; private StateCallback mStateCallback = new CameraDevice . StateCallback ( ) { @ Override public void onOpened ( CameraDevice cameraDevice ) { } @ Override public void onDisconnected ( CameraDevice cameraDevice ) { } @ Override public void onError ( CameraDevice cameraDevice , int error ) { } } ; public static Camera2VideoFragment newInstance ( ) { } private static Size chooseVideoSize ( Size [ ] choices ) { } private static Size chooseOptimalSize ( Size [ ] choices , int width , int height , Size aspectRatio ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onViewCreated ( final View view , Bundle savedInstanceState ) { } @ Override public void onResume ( ) { } @ Override public void onPause ( ) { } @ Override public void onClick ( View view ) { } private void startBackgroundThread ( ) { } private void stopBackgroundThread ( ) { } private void openCamera ( int width , int height ) { } private void closeCamera ( ) { } private void startPreview ( ) { } private void updatePreview ( ) { } private void setUpCaptureRequestBuilder ( CaptureRequest . Builder builder ) { } private void configureTransform ( int viewWidth , int viewHeight ) { } private void setUpMediaRecorder ( ) throws IOException { } private File getVideoFile ( Context context ) { <START_BUG> return new File ( context . getExternalFilesDir ( null ) , ( ( "video" + ( SwingDB . getMaxID ( ) ) ) + ".mp4" ) ) ; <END_BUG> } private void startRecordingVideo ( ) { } private void stopRecordingVideo ( ) { } static class CompareSizesByArea implements Comparator < Size > { @ Override public int compare ( Size lhs , Size rhs ) { } } public static class ErrorDialog extends DialogFragment { @ Override public Dialog onCreateDialog ( Bundle savedInstanceState ) { } } }

Fix:
return new File ( context . getExternalFilesDir ( null ) , ( ( "video" + ( Swings_DB . getMaxID ( ) ) ) + ".mp4" ) ) ;
Buggy code:
class MailSessionDefinition extends SimpleResourceDefinition { static final MailSessionDefinition INSTANCE = new MailSessionDefinition ( ) ; private MailSessionDefinition ( ) { } protected static final SimpleAttributeDefinition JNDI_NAME = new org . jboss . as . controller . SimpleAttributeDefinitionBuilder ( MailSubsystemModel . JNDI_NAME , org . jboss . dmr . ModelType . STRING , false ) . setAllowExpression ( true ) . setRestartAllServices ( ) . build ( ) ; protected static final SimpleAttributeDefinition FROM = new org . jboss . as . controller . SimpleAttributeDefinitionBuilder ( MailSubsystemModel . FROM , org . jboss . dmr . ModelType . STRING , true ) . setRestartAllServices ( ) . setAllowExpression ( true ) . setAllowNull ( true ) . build ( ) ; protected static final SimpleAttributeDefinition DEBUG = new org . jboss . as . controller . SimpleAttributeDefinitionBuilder ( MailSubsystemModel . DEBUG , org . jboss . dmr . ModelType . BOOLEAN , true ) . setAllowExpression ( true ) . setDefaultValue ( new ModelNode ( false ) ) . setRestartAllServices ( ) . build ( ) ; private static final AttributeDefinition [ ] ATTRIBUTES = new AttributeDefinition [ ] { MailSessionDefinition . DEBUG , MailSessionDefinition . JNDI_NAME , MailSessionDefinition . FROM } ; @ Override public void registerAttributes ( final ManagementResourceRegistration rootResourceRegistration ) { } private static class SessionAttributeWriteHandler extends AbstractWriteAttributeHandler { protected static MailSessionDefinition . SessionAttributeWriteHandler INSTANCE = new MailSessionDefinition . SessionAttributeWriteHandler ( ) ; private SessionAttributeWriteHandler ( ) { } @ Override protected boolean applyUpdateToRuntime ( OperationContext context , ModelNode operation , String attributeName , ModelNode resolvedValue , ModelNode currentValue , HandbackHolder handbackHolder ) throws OperationFailedException { String jndiName = MailSessionDefinition . JNDI_NAME . resolveModelAttribute ( context , context . readResource ( EMPTY_ADDRESS ) . getModel ( ) ) . asString ( ) ; <START_BUG> final ServiceName serviceName = SERVICE_NAME_BASE . append ( jndiName ) ; <END_BUG> AttributeDefinition def = getAttributeDefinition ( attributeName ) ; ServiceController svcCtrl = context . getServiceRegistry ( false ) . getService ( serviceName ) ; context . removeService ( svcCtrl ) ; MailSessionService service = ( ( MailSessionService ) ( svcCtrl . getService ( ) ) ) ; if ( def == ( MailSessionDefinition . DEBUG ) ) { service . getConfig ( ) . setDebug ( resolvedValue . asBoolean ( ) ) ; } else if ( def == ( MailSessionDefinition . FROM ) ) { service . getConfig ( ) . setFrom ( resolvedValue . asString ( ) ) ; } return false ; } @ Override protected void revertUpdateToRuntime ( OperationContext context , ModelNode operation , String attributeName , ModelNode valueToRestore , ModelNode valueToRevert , Object handback ) throws OperationFailedException { } } }

Fix:
final ServiceName serviceName = MAIL_SESSION_SERVICE_NAME . append ( jndiName ) ;
Buggy code:
public class CopySuppFiles { public static void main ( String [ ] args ) throws Exception { } public static void copyFiles ( File outDir , String suppFiles ) throws IOException , ClassNotFoundException { StringTokenizer st = new StringTokenizer ( suppFiles , "," ) ; String scriptName = "" ; InputStream is = null ; while ( st . hasMoreTokens ( ) ) { scriptName = st . nextToken ( ) ; File suppFile = null ; String fileName = "" ; is = RunTest . loadTestResource ( scriptName ) ; if ( is == null ) System . out . println ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>locate:<seq2seq4repair_space>" + scriptName ) ) ; else { int index = scriptName . lastIndexOf ( '//' ) ; fileName = scriptName . substring ( ( index + 1 ) ) ; try { suppFile = new File ( new File ( outDir , fileName ) . getCanonicalPath ( ) ) ; } catch ( IOException e ) { File f = new File ( outDir , fileName ) ; FileWriter fw = new FileWriter ( f ) ; fw . close ( ) ; suppFile = new File ( f . getCanonicalPath ( ) ) ; } <START_BUG> if ( ( ( ( ( fileName . indexOf ( "sql" ) ) > 0 ) || ( ( fileName . indexOf ( "txt" ) ) > 0 ) ) || ( ( fileName . indexOf ( ".view" ) ) > 0 ) ) || ( ( fileName . indexOf ( ".policy" ) ) > 0 ) ) { <END_BUG> BufferedReader inFile = new BufferedReader ( new InputStreamReader ( is , "UTF-8" ) ) ; PrintWriter pw = new PrintWriter ( new BufferedWriter ( new FileWriter ( suppFile ) , 10000 ) , true ) ; int c ; while ( ( c = inFile . read ( ) ) != ( - 1 ) ) pw . write ( c ) ; pw . flush ( ) ; pw . close ( ) ; } else { FileOutputStream fos = new FileOutputStream ( suppFile ) ; byte [ ] data = new byte [ 4096 ] ; int len ; while ( ( len = is . read ( data ) ) != ( - 1 ) ) { fos . write ( data , 0 , len ) ; } fos . close ( ) ; } } } } }

Fix:
if ( ( ( ( ( ( ( fileName . indexOf ( "sql" ) ) > 0 ) || ( ( fileName . indexOf ( "txt" ) ) > 0 ) ) || ( ( fileName . indexOf ( ".view" ) ) > 0 ) ) || ( ( fileName . indexOf ( ".policy" ) ) > 0 ) ) || ( ( fileName . indexOf ( ".multi" ) ) > 0 ) ) || ( ( fileName . indexOf ( ".properties" ) ) > 0 ) ) {
Buggy code:
public class EditorPresentation extends BasicStackPresentation { private IPreferenceStore preferenceStore = WorkbenchPlugin . getDefault ( ) . getPreferenceStore ( ) ; private HandlerSubmission openEditorDropDownHandlerSubmission ; private CTabFolder2Adapter showListListener = new CTabFolder2Adapter ( ) { public void showList ( CTabFolderEvent event ) { } } ; private final IPropertyChangeListener propertyChangeListener = new IPropertyChangeListener ( ) { public void propertyChange ( PropertyChangeEvent propertyChangeEvent ) { } } ; public EditorPresentation ( Composite parent , IStackPresentationSite newSite , int flags ) { } public void dispose ( ) { } protected void initTab ( CTabItem tabItem , IPresentablePart part ) { } String getLabelText ( IPresentablePart presentablePart , boolean dirtyLeft , boolean includePath ) { } Image getLabelImage ( IPresentablePart presentablePart ) { } String getLabelToolTipText ( IPresentablePart presentablePart ) { } public void setActive ( boolean isActive ) { } protected void setTabStyle ( boolean traditionalTab ) { } private void showList ( Shell parentShell , int x , int y ) { } private void updateGradient ( ) { } void setSelection ( CTabItem tabItem ) { <START_BUG> selectPart ( getPartForTab ( tabItem ) ) ; <END_BUG> } void close ( IPresentablePart presentablePart ) { } protected String getCurrentTitle ( ) { } }

Fix:
getSite ( ) . selectPart ( getPartForTab ( tabItem ) ) ;
Buggy code:
public class GravityControl extends AbstractControl { private Vector3f velocity ; public GravityControl ( Vector3f initialVelocity ) { } public void applyForce ( List < Geometry > sources ) { for ( Geometry geom : sources ) { if ( geom == ( spatial ) ) <START_BUG> return ; <END_BUG> float distance = geom . getWorldTranslation ( ) . distance ( spatial . getWorldTranslation ( ) ) ; float force = ( ( com . jme3 . scene . shape . Sphere ) ( geom . getMesh ( ) ) ) . getRadius ( ) ; Vector3f direction = geom . getWorldTranslation ( ) . subtract ( spatial . getWorldTranslation ( ) ) ; velocity = velocity . add ( direction . divide ( FastMath . pow ( distance , 2 ) ) . mult ( ( force * 10 ) ) ) ; } } @ Override protected void controlUpdate ( float tpf ) { } @ Override protected void controlRender ( RenderManager rm , ViewPort vp ) { } public Control cloneForSpatial ( Spatial spatial ) { } @ Override public void read ( JmeImporter im ) throws IOException { } @ Override public void write ( JmeExporter ex ) throws IOException { } }

Fix:
continue ;
Buggy code:
@ RestController @ RequestMapping ( "topic" ) public class TopicController extends BaseController { private Logger logger = LoggerFactory . getLogger ( TopicController . class ) ; @ Autowired private TopicService topicService ; @ RequestMapping ( "reportTopic" ) public Map < String , Object > reportTopic ( HttpServletRequest request , Long groupId , String content , ModelMap modelMap , HttpServletResponse response ) { try { Lawyer lawyer = getLawyer ( request ) ; if ( ( groupId == null ) || ( StringUtils . isEmpty ( content ) ) ) { ServletUtils . responseJson ( response , new Result ( 0 , "话题所属组和话题为空！" ) ) ; return null ; } topicService . reportTopic ( groupId , content , lawyer ) ; <START_BUG> ServletUtils . responseJson ( response , new Result ( 1 , "投票成功！" ) ) ; <END_BUG> } catch ( Exception e ) { logger . error ( ( "发表话题失败:" + ( e . getMessage ( ) ) ) ) ; resultModelMap ( 0 , "发表话题失败!" , modelMap ) ; } return null ; } @ RequestMapping ( "getGroupList" ) public String getGroupList ( Pager pager , ModelMap modelMap , HttpServletResponse response ) { } @ RequestMapping ( "getGroupDetail" ) public String getGroupDetail ( HttpServletRequest request , HttpServletResponse response , Long groupId , Pager pager , ModelMap modelMap ) { } @ RequestMapping ( "getTopicDetail" ) public String getTopicDetail ( HttpServletRequest request , HttpServletResponse response , Long topicId , ModelMap modelMap ) { } @ RequestMapping ( "attentionGroup" ) public String attentionGroup ( HttpServletRequest request , Long groupId , HttpServletResponse response ) { } @ RequestMapping ( "topicReply" ) public String topicReply ( HttpServletRequest request , Long topicId , String content , HttpServletResponse response ) { } @ RequestMapping ( "attentionTopic" ) public String attentionTopic ( Long topicId , HttpServletRequest request , HttpServletResponse response ) { } @ RequestMapping ( "topicReplyPraise" ) public String topicReplyPraise ( HttpServletRequest request , Long replyId , HttpServletResponse response ) { } }

Fix:
ServletUtils . responseJson ( response , new Result ( 1 , "发表话题成功！" ) ) ;
Buggy code:
public class VLCStreamServer { private VideoSocket ingress ; private VideoSocket egress ; private boolean isAvailable ; private VLCStreamServer ( VideoSocket ingress , VideoSocket egress , boolean isAvailable ) { } public VideoSocket getIngress ( ) { } public VideoSocket getEgress ( ) { } public boolean isAvailable ( ) { } public void setInUse ( ) { } public void setNotInUse ( ) { <START_BUG> this . isAvailable = false ; <END_BUG> } public VLCStreamServer . VLCStreamServerBuilder createBuilder ( ) { } @ Override public String toString ( ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { } public static class VLCStreamServerBuilder { private VideoSocket b_ingress ; private VideoSocket b_egress ; private boolean b_isAvailable ; public VLCStreamServerBuilder ( ) { } private VLCStreamServerBuilder ( VLCStreamServer vlcStreamServer ) { } public VLCStreamServer . VLCStreamServerBuilder setIngress ( VideoSocket ingress ) { } public VLCStreamServer . VLCStreamServerBuilder setEgress ( VideoSocket egress ) { } public VLCStreamServer . VLCStreamServerBuilder setAvailable ( boolean isAvailable ) { } private void checkAllSet ( ) throws BuilderException { } public VLCStreamServer build ( ) { } @ Override public String toString ( ) { } } }

Fix:
this . isAvailable = true ;
Buggy code:
public class AppointmentDBC { public static Appointment getAppointment ( int appointmentId , String username ) { } @ SuppressWarnings ( "deprecation" ) public static ArrayList < Appointment > getAppointmentList ( String username , Date selectedDate ) { } public static int addAppointment ( Date startDate , Date endDate , String description , String location , String username , int roomId ) { } public static void removeAppointment ( int appointmentId ) { } public static void addInvitation ( int appointmentId , String username , String status ) { } public static void addGroupInvitation ( int appointmentId , int groupId ) { } public static void setInvitationStatus ( int appointmentId , String username , String status ) { } public static List < Room > getAvailableRoomList ( Date startDate , Date endDate , int minSeatCount ) { } public static Room getRoom ( int roomId ) { } public static void setCancelNotification ( int appointmentId , String username ) { List < User > invitedUserList = AppointmentDBC . getInvitedUserList ( appointmentId ) ; for ( User user : invitedUserList ) { if ( ! ( user . getUsername ( ) . equals ( username ) ) ) { <START_BUG> DBConnector . makeStatement ( ( ( ( ( ( ( ( "" + ( "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>cancel_notification<seq2seq4repair_space>VALUES" + "('" ) ) + appointmentId ) + "',<seq2seq4repair_space>'" ) + ( user . getUsername ( ) ) ) + "',<seq2seq4repair_space>'" ) + username ) + "');" ) ) ; <END_BUG> } } } public static List < User > getInvitedUserList ( int appointmentId ) { } }

Fix:
DBConnector . makeStatement ( ( ( ( ( ( ( ( "" + ( "INSERT<seq2seq4repair_space>IGNORE<seq2seq4repair_space>INTO<seq2seq4repair_space>cancel_notification<seq2seq4repair_space>VALUES" + "('" ) ) + appointmentId ) + "',<seq2seq4repair_space>'" ) + ( user . getUsername ( ) ) ) + "',<seq2seq4repair_space>'" ) + username ) + "');" ) ) ;
Buggy code:
public final class FormLayout extends Layout { public int marginWidth = 0 ; public int marginHeight = 0 ; public int marginLeft = 0 ; public int marginTop = 0 ; public int marginRight = 0 ; public int marginBottom = 0 ; public int spacing = 0 ; public FormLayout ( ) { } int computeHeight ( Control control , FormData data , boolean flushCache ) { } protected Point computeSize ( Composite composite , int wHint , int hHint , boolean flushCache ) { } protected boolean flushCache ( Control control ) { } String getName ( ) { } int computeWidth ( Control control , FormData data , boolean flushCache ) { } protected void layout ( Composite composite , boolean flushCache ) { Rectangle rect = composite . getClientArea ( ) ; int x = ( ( rect . x ) + ( marginLeft ) ) + ( marginWidth ) ; int y = ( ( rect . y ) + ( marginTop ) ) + ( marginHeight ) ; int width = Math . max ( 0 , ( ( ( ( rect . width ) - ( marginLeft ) ) - ( 2 * ( marginWidth ) ) ) - ( marginRight ) ) ) ; <START_BUG> int height = Math . max ( 0 , ( ( ( ( rect . height ) - ( marginLeft ) ) - ( 2 * ( marginHeight ) ) ) - ( marginBottom ) ) ) ; <END_BUG> layout ( composite , true , x , y , width , height , flushCache ) ; } Point layout ( Composite composite , boolean move , int x , int y , int width , int height , boolean flushCache ) { } public String toString ( ) { } }

Fix:
int height = Math . max ( 0 , ( ( ( ( rect . height ) - ( marginTop ) ) - ( 2 * ( marginHeight ) ) ) - ( marginBottom ) ) ) ;