nus-yam/ex-repair huggingface dataset:
Buggy code:
public class about_the_author extends Activity { @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( R . layout . about_the_author ) ; setTitle ( "" ) ; TextView about = ( ( TextView ) ( findViewById ( R . id . about_the_author ) ) ) ; <START_BUG> about . setText ( Html . fromHtml ( "Lily<seq2seq4repair_space>0.3.0<br//>±¾Èí¼þ×ñÑ­GPLÐí¿É£¬²¢ÇÒ½«ÓÚ½üÆÚÔÚGoogle<seq2seq4repair_space>CodeÉÏ·¢²¼Ô´´úÂë£¬ÇëÓÐÒâ²ÎÓë¿ª·¢µÄÍ¯Ð¬ºÍÎÒÁªÏµ¡£<br//>ÔÚ±¾Èí¼þµÄ¿ª·¢¹ý³ÌÖÐ£¬²»ÉÙÈË¸øÓè¾Þ´óµÄ°ïÖú£¬ÔÚÕâÀï¾Í²»Ò»Ò»Ð»¹ýÁË£¬Ã»ÓÐÄãÃÇ¾ÍÃ»ÓÐÕâ¿îÈí¼þ¡£<br//><br//><font<seq2seq4repair_space>color=\"red\">ÌØ±ð¸ÐÐ»ÎÒµÄÅ®ÅóÓÑÎâÐ¡ÜçÍ¯Ð¬Ò»Ö±ÒÔÀ´¸øÓèÎÒµÄÖ§³ÖºÍ¹ÄÀø£¬ÊÇÄãÈÃÎÒÔÚ×¼±¸·ÅÆúµÄÊ±ºòÖØÊ°ÐÅÐÄ£¬¹ÄÀøÎÒÍê³ÉÁËÕâ¿îÈí¼þ£¡<font><br//>Ð»Ð»£¡" ) ) ; <END_BUG> } }

Fix:
about . setText ( Html . fromHtml ( "Lily<seq2seq4repair_space>0.3.0<br//>±¾Èí¼þ×ñÑ­GPLÐí¿É£¬²¢ÇÒ½«ÓÚ½üÆÚÔÚGoogle<seq2seq4repair_space>CodeÉÏ·¢²¼Ô´´úÂë£¬ÇëÓÐÒâ²ÎÓë¿ª·¢µÄÍ¯Ð¬ºÍÎÒÁªÏµ¡£<br//>ÔÚ±¾Èí¼þµÄ¿ª·¢¹ý³ÌÖÐ£¬ºÜ¶àÍ¯Ð¬¸øÓè´óÁ¦Ö§³Ö£¬ÈçöÎ×Ü¡¢ËÕ×Ü¡¢ÌÎ×Ó¡¢¿üÇò¡¢Îº×Ü£¬Ã»ÓÐÄãÃÇ¾ÍÃ»ÓÐÕâ¿îÈí¼þ¡£<br//><br//><font<seq2seq4repair_space>color=\"red\">ÌØ±ð¸ÐÐ»ÎÒµÄÅ®ÅóÓÑÎâÐ¡ÜçÍ¯Ð¬Ò»Ö±ÒÔÀ´¸øÓèÎÒµÄÖ§³ÖºÍ¹ÄÀø£¬ÊÇÄãÈÃÎÒÔÚ×¼±¸·ÅÆúµÄÊ±ºòÖØÊ°ÐÅÐÄ£¬¹ÄÀøÎÒÍê³ÉÁËÕâ¿îÈí¼þ£¡<font><br//>Ð»Ð»£¡" ) ) ;
Buggy code:
public class JMSConfigGui extends JPanel { private JLabeledTextField queueuConnectionFactory = new JLabeledTextField ( JMeterUtils . getResString ( "jms_queue_connection_factory" ) ) ; private JLabeledTextField sendQueue = new JLabeledTextField ( JMeterUtils . getResString ( "jms_send_queue" ) ) ; private JLabeledTextField receiveQueue = new JLabeledTextField ( JMeterUtils . getResString ( "jms_receive_queue" ) ) ; private JLabeledTextField timeout = new JLabeledTextField ( JMeterUtils . getResString ( "jms_timeout" ) ) ; private JLabeledTextArea soapXml = new JLabeledTextArea ( JMeterUtils . getResString ( "jms_msg_content" ) , null ) ; private JLabeledTextField initialContextFactory = new JLabeledTextField ( JMeterUtils . getResString ( "jms_initial_context_factory" ) ) ; private JLabeledTextField providerUrl = new JLabeledTextField ( JMeterUtils . getResString ( "jms_provider_url" ) ) ; private String [ ] labels = new String [ ] { JMeterUtils . getResString ( "jms_request" ) , JMeterUtils . getResString ( "jms_requestreply" ) } ; private JLabeledChoice oneWay = new JLabeledChoice ( JMeterUtils . getResString ( "jms_communication_style" ) , labels ) ; private ArgumentsPanel jmsPropertiesPanel ; private ArgumentsPanel jndiPropertiesPanel ; public JMSConfigGui ( ) { } protected void configureTestElement ( TestElement element ) { } public void clear ( ) { } public TestElement createTestElement ( ) { } public void configure ( TestElement el ) { } private void init ( ) { } private JPanel createJNDIPanel ( ) { JPanel jndiPanel = new JPanel ( new BorderLayout ( ) ) ; jndiPanel . setBorder ( BorderFactory . createTitledBorder ( BorderFactory . createEtchedBorder ( ) , JMeterUtils . getResString ( "jms_jndi_props" ) ) ) ; JPanel contextPanel = new JPanel ( new BorderLayout ( 10 , 0 ) ) ; contextPanel . add ( initialContextFactory ) ; jndiPanel . add ( contextPanel , BorderLayout . NORTH ) ; JPanel providerPanel = new JPanel ( new BorderLayout ( 10 , 0 ) ) ; providerPanel . add ( providerUrl ) ; jndiPanel . add ( providerPanel , BorderLayout . SOUTH ) ; <START_BUG> jndiPropertiesPanel = new ArgumentsPanel ( JMeterUtils . getResString ( "jndi_props" ) ) ; <END_BUG> jndiPanel . add ( jndiPropertiesPanel ) ; return jndiPanel ; } }

Fix:
jndiPropertiesPanel = new ArgumentsPanel ( JMeterUtils . getResString ( "jms_jndi_props" ) ) ;
Buggy code:
public class ConverterLocator implements IConverterLocator { private static final long serialVersionUID = 1L ; private final Map classToConverter = new HashMap ( ) ; private class DefaultConverter implements IConverter { private Class type ; public DefaultConverter ( Class type ) { } private static final long serialVersionUID = 1L ; public Object convertToObject ( String value , Locale locale ) { } public String convertToString ( Object value , Locale locale ) { if ( ( value == null ) || ( "" . equals ( value ) ) ) { <START_BUG> return null ; <END_BUG> } return ( ( String ) ( Objects . convertValue ( value , String . class ) ) ) ; } } public ConverterLocator ( ) { } public final IConverter getConverter ( Class type ) { } public final IConverter get ( Class c ) { } public final IConverter remove ( Class c ) { } public final IConverter set ( final Class c , final IConverter converter ) { } }

Fix:
return "" ;
Buggy code:
public class PortletSessionStore implements ISessionStore { private static final int SCOPE = PortletSession . APPLICATION_SCOPE ; protected static Log log = LogFactory . getLog ( PortletSessionStore . class ) ; protected final PortletApplication application ; public PortletSessionStore ( ) { } public final void invalidate ( Request request ) { } public final String getSessionId ( Request request ) { } public final void bind ( Request request , Session newSession ) { } public final void unbind ( String sessionId ) { } public Session lookup ( Request request ) { } protected final WicketPortletRequest toPortletRequest ( Request request ) { } protected final PortletSession getPortletSession ( WicketPortletRequest request ) { } protected void onBind ( Request request , Session newSession ) { } protected void onUnbind ( String sessionId ) { } public void setAttribute ( Request request , String name , Object value ) { <START_BUG> if ( PortletSessionStore . log . isDebugEnabled ( ) ) { <END_BUG> String valueTypeName = ( value != null ) ? value . getClass ( ) . getName ( ) : "null" ; try { final ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; new ObjectOutputStream ( out ) . writeObject ( value ) ; PortletSessionStore . log . debug ( ( ( ( ( ( "Stored<seq2seq4repair_space>attribute<seq2seq4repair_space>" + name ) + "{<seq2seq4repair_space>" ) + valueTypeName ) + "}<seq2seq4repair_space>with<seq2seq4repair_space>size:<seq2seq4repair_space>" ) + ( Bytes . bytes ( out . size ( ) ) ) ) ) ; } catch ( Exception e ) { throw new WicketRuntimeException ( ( "Internal<seq2seq4repair_space>error<seq2seq4repair_space>cloning<seq2seq4repair_space>object.<seq2seq4repair_space>Make<seq2seq4repair_space>sure<seq2seq4repair_space>all<seq2seq4repair_space>dependent<seq2seq4repair_space>objects<seq2seq4repair_space>implement<seq2seq4repair_space>Serializable.<seq2seq4repair_space>Class:<seq2seq4repair_space>" + valueTypeName ) , e ) ; } } WicketPortletRequest webRequest = toPortletRequest ( request ) ; PortletSession httpSession = getPortletSession ( webRequest ) ; if ( httpSession != null ) { IRequestLogger logger = application . getRequestLogger ( ) ; String attributeName = ( getSessionAttributePrefix ( webRequest ) ) + name ; if ( logger != null ) { if ( ( httpSession . getAttribute ( attributeName , PortletSessionStore . SCOPE ) ) == null ) { logger . objectCreated ( value ) ; } else { logger . objectUpdated ( value ) ; } } httpSession . setAttribute ( attributeName , value , PortletSessionStore . SCOPE ) ; } } public Object getAttribute ( Request request , String name ) { } public void removeAttribute ( Request request , String name ) { } public List < String > getAttributeNames ( Request request ) { } private String getSessionAttributePrefix ( final WicketPortletRequest request ) { } public PageMap createPageMap ( String name , Session session ) { } public final String getSessionId ( Request request , boolean create ) { } public void onBeginRequest ( Request request ) { } public void onEndRequest ( Request request ) { } }

Fix:
if ( Application . get ( ) . getDebugSettings ( ) . getSerializeSessionAttributes ( ) ) {
Buggy code:
public class Version { private Version ( ) { } public static String id ( ) { <START_BUG> return "4.5-SNAPSHOT-20080513-1059" ; <END_BUG> } public static void main ( String [ ] args ) { } }

Fix:
return "4.5-SNAPSHOT-20080602-1631" ;
Buggy code:
public class Utils { public static Document connect ( String url , HttpClient client ) throws IOException , JDOMException { HttpGet httpget = new HttpGet ( url ) ; HttpResponse response = client . execute ( httpget ) ; HttpEntity entity = response . getEntity ( ) ; InputStream instream = entity . getContent ( ) ; try { String content = "" ; <START_BUG> BufferedReader reader = new BufferedReader ( new InputStreamReader ( instream ) ) ; <END_BUG> String line ; while ( ( line = reader . readLine ( ) ) != null ) { content = ( content + line ) + "\n" ; } reader . close ( ) ; SAXBuilder jdomBuilder = new SAXBuilder ( ) ; Document jdomDocument = jdomBuilder . build ( new StringReader ( content ) ) ; return jdomDocument ; } finally { instream . close ( ) ; } } public static String update ( String url , HttpClient client , Map < String , String > attributes ) throws Exception { } public static WSPathwayInfo parseWSPathwayInfo ( Element pathwayInfo ) { } public static WSIndexField parseWSIndexField ( Element indexField ) { } public static WSSearchResult parseWSSearchResult ( Element searchResult ) { } public static WSOntologyTerm parseOntologyTerm ( Element term ) { } public static WSPathway parsePathway ( Element pathway ) throws UnsupportedEncodingException { } public static WSPathwayHistory parsePathwayHistory ( Element hist ) { } public static WSHistoryRow parseHistoryRow ( Element historyRow ) { } public static WSCurationTagHistory parseCurationTagHistory ( Element history ) { } public static WSCurationTag parseCurationTag ( Element tag ) { } }

Fix:
BufferedReader reader = new BufferedReader ( new InputStreamReader ( instream , "UTF-8" ) ) ;
Buggy code:
public class ForwardAction extends FrameAction implements Observer , SelectionListener { private XmlElement forward ; private String forwardStyle ; public ForwardAction ( AbstractFrameController frameController ) { } public void actionPerformed ( ActionEvent evt ) { <START_BUG> FolderCommandReference [ ] r = ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( getFrameController ( ) ) ) . getTableSelection ( ) ; <END_BUG> if ( forwardStyle . equals ( "attachment" ) ) processor . addOp ( new org . columba . mail . gui . composer . command . ForwardCommand ( r ) ) ; else processor . addOp ( new org . columba . mail . gui . composer . command . ForwardInlineCommand ( r ) ) ; } public void selectionChanged ( SelectionChangedEvent e ) { } public void update ( Observable arg0 , Object arg1 ) { } }

Fix:
FolderCommandReference [ ] r = ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( getFrameMediator ( ) ) ) . getTableSelection ( ) ;
Buggy code:
public class Test { private final int PORT = 50000 ; private ServerSocket server ; public static void main ( String [ ] args ) { } public void testObjectSocket ( ) { } public void testFileTransferSocket ( ) { <START_BUG> final File f = new File ( "//Users//czifro//Desktop//HW5.zip" ) ; <END_BUG> if ( f . exists ( ) ) { if ( f . isFile ( ) ) { try { server = new ServerSocket ( PORT ) ; final Socket [ ] conns = new Socket [ 2 ] ; final FileTransferSocket [ ] fts_s = new FileTransferSocket [ 2 ] ; Thread serverThread = new Thread ( ) { @ Override public void run ( ) { try { conns [ 0 ] = server . accept ( ) ; fts_s [ 0 ] = new FileTransferSocket ( conns [ 0 ] ) ; File rF = fts_s [ 0 ] . recv_file ( "//Users//czifro//Desktop//new_" ) ; if ( ( rF . length ( ) ) == ( f . length ( ) ) ) { System . out . println ( "All<seq2seq4repair_space>bytes<seq2seq4repair_space>were<seq2seq4repair_space>transferred" ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } } } ; serverThread . start ( ) ; conns [ 1 ] = new Socket ( "10.0.0.32" , PORT ) ; fts_s [ 1 ] = new FileTransferSocket ( conns [ 1 ] ) ; fts_s [ 1 ] . send_file ( f ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } finally { try { if ( ( server ) != null ) server . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } } } } private class Person { public int Age ; private String DOB ; public String Name ; public Person ( int Age , String DOB , String Name ) { } } }

Fix:
final File f = new File ( "//Users//czifro//Desktop//server.js" ) ;
Buggy code:
public class StorageDir { private static final Logger LOG = LoggerFactory . getLogger ( LOGGER_TYPE ) ; private Map < Long , BlockMeta > mBlockIdToBlockMap ; private Map < Long , TempBlockMeta > mBlockIdToTempBlockMap ; private Map < Long , Set < Long > > mUserIdToTempBlockIdsMap ; private final long mCapacityBytes ; private long mAvailableBytes ; private String mDirPath ; private int mDirIndex ; private StorageTier mTier ; public StorageDir ( StorageTier tier , int dirIndex , long capacityBytes , String dirPath ) { } public long getCapacityBytes ( ) { } public long getAvailableBytes ( ) { } public String getDirPath ( ) { } public StorageTier getParentTier ( ) { } public int getDirIndex ( ) { } public long getStorageDirId ( ) { } public List < Long > getBlockIds ( ) { } public Collection < BlockMeta > getBlocks ( ) { } public boolean hasBlockMeta ( long blockId ) { } public boolean hasTempBlockMeta ( long blockId ) { } public Optional < BlockMeta > getBlockMeta ( long blockId ) { } public Optional < TempBlockMeta > getTempBlockMeta ( long blockId ) { } public Optional < BlockMeta > addBlockMeta ( BlockMeta block ) { } public boolean addTempBlockMeta ( TempBlockMeta tempBlockMeta ) { } public boolean removeBlockMeta ( BlockMeta block ) { Preconditions . checkNotNull ( block ) ; mBlockIdToBlockMap . remove ( block . getBlockId ( ) ) ; mAvailableBytes += block . getBlockSize ( ) ; <START_BUG> return false ; <END_BUG> } public boolean removeTempBlockMeta ( TempBlockMeta tempBlockMeta ) { } public void cleanupUser ( long userId ) { } }

Fix:
return true ;
Buggy code:
public class MinimaxAlphaBeta extends Agent { private final int numPlys ; private static int infinity = 999999999 ; public MinimaxAlphaBeta ( int playernum , String [ ] args ) { } @ Override public Map < Integer , Action > initialStep ( State . StateView newstate , History . HistoryView statehistory ) { } @ Override public Map < Integer , Action > middleStep ( State . StateView newstate , History . HistoryView statehistory ) { } @ Override public void terminalStep ( State . StateView newstate , History . HistoryView statehistory ) { } @ Override public void savePlayerData ( OutputStream os ) { } @ Override public void loadPlayerData ( InputStream is ) { } public GameStateChild alphaBetaSearch ( GameStateChild node , int depth , double alpha , double beta ) { int maxval = - ( MinimaxAlphaBeta . infinity ) ; int childval ; List < GameStateChild > children = new ArrayList < GameStateChild > ( ) ; children = node . state . getChildren ( ) ; if ( children == null ) return node ; children = orderChildrenWithHeuristics ( children ) ; for ( int i = 0 ; i < ( children . size ( ) ) ; i ++ ) { <START_BUG> childval = alphabeta ( children . get ( i ) , depth , alpha , beta , true ) ; <END_BUG> if ( childval > maxval ) { maxval = childval ; node = children . get ( i ) ; } } return node ; } public int alphabeta ( GameStateChild node , int depth , double alpha , double beta , boolean maximizingPlayer ) { } public List < GameStateChild > orderChildrenWithHeuristics ( List < GameStateChild > children ) { } public List < GameStateChild > insertionSort ( List < GameStateChild > list ) { } }

Fix:
childval = alphabeta ( children . get ( i ) , ( depth - 1 ) , alpha , beta , false ) ;
Buggy code:
class PeriodicJob extends CountingJob { long period ; Vector desiredTimeVector ; Vector actualExecutionTime ; PeriodicJob ( int id , long desiredExecutionTime , long period ) { } public void execute ( ) { } void sanityCheck ( long currentTime ) { System . out . println ( ( "sanity<seq2seq4repair_space>check<seq2seq4repair_space>on<seq2seq4repair_space>job<seq2seq4repair_space>" + ( id ) ) ) ; if ( ! ( deleted ) ) { int expectedNumberOfExecutions = ( ( int ) ( ( currentTime - ( desiredTime ) ) // ( period ) ) ) ; <START_BUG> if ( ( ( actualExecutionTime . size ( ) ) * 1.15 ) < expectedNumberOfExecutions ) { <END_BUG> throw new IllegalStateException ( ( ( ( ( ( "Too<seq2seq4repair_space>few<seq2seq4repair_space>executions.<seq2seq4repair_space>Was<seq2seq4repair_space>" + ( actualExecutionTime . size ( ) ) ) + "<seq2seq4repair_space>expected<seq2seq4repair_space>" ) + expectedNumberOfExecutions ) + "<seq2seq4repair_space>period=" ) + ( period ) ) ) ; } } for ( int i = 0 ; i < ( actualExecutionTime . size ( ) ) ; i ++ ) { long actual = ( ( Long ) ( actualExecutionTime . get ( i ) ) ) . longValue ( ) ; long desired = ( ( Long ) ( desiredTimeVector . get ( i ) ) ) . longValue ( ) ; if ( actual < desired ) { throw new IllegalStateException ( "Job<seq2seq4repair_space>executed<seq2seq4repair_space>too<seq2seq4repair_space>early." ) ; } else if ( ( actual - desired ) > ( ( SchedulerTest . TOLERATED_GAP ) * ( i + 1 ) ) ) { String msg = ( ( ( "Job<seq2seq4repair_space>id<seq2seq4repair_space>" + ( id ) ) + "<seq2seq4repair_space>executed<seq2seq4repair_space>" ) + ( actual - desired ) ) + "<seq2seq4repair_space>too<seq2seq4repair_space>late<seq2seq4repair_space>" ; System . out . println ( msg ) ; throw new IllegalStateException ( msg ) ; } } } }

Fix:
if ( ( ( actualExecutionTime . size ( ) ) * 1.25 ) < expectedNumberOfExecutions ) {
Buggy code:
public class GcmIntentService extends IntentService { public static final int NOTIFICATION_ID = 1 ; private NotificationManager mNotificationManager ; Builder builder ; public GcmIntentService ( ) { } @ Override protected void onHandleIntent ( Intent intent ) { } private void sendNotification ( String msg , int townId , String townName , String senderName ) { mNotificationManager = ( ( NotificationManager ) ( this . getSystemService ( NOTIFICATION_SERVICE ) ) ) ; Intent intent = null ; if ( townId != 0 ) { intent = new Intent ( this , ViewTownActivity . class ) ; intent . putExtra ( EXTRA_TOWN_ID , townId ) ; intent . putExtra ( EXTRA_TOWN_NAME , townName ) ; } else { intent = new Intent ( this , MainActivity . class ) ; } <START_BUG> PendingIntent contentIntent = PendingIntent . getActivity ( this , 0 , intent , 0 ) ; <END_BUG> Uri alarmSound = RingtoneManager . getDefaultUri ( TYPE_NOTIFICATION ) ; NotificationCompat . Builder mBuilder = new NotificationCompat . Builder ( this ) . setSmallIcon ( ic_launcher ) . setContentTitle ( townName ) . setStyle ( new NotificationCompat . BigTextStyle ( ) . bigText ( msg ) ) . setLights ( - 65281 , 1000 , 1000 ) . setAutoCancel ( true ) . setContentText ( msg ) . setSound ( alarmSound ) ; mBuilder . setContentIntent ( contentIntent ) ; mNotificationManager . notify ( GcmIntentService . NOTIFICATION_ID , mBuilder . build ( ) ) ; Vibrator v = ( ( Vibrator ) ( this . getSystemService ( VIBRATOR_SERVICE ) ) ) ; v . vibrate ( 500 ) ; } }

Fix:
PendingIntent contentIntent = PendingIntent . getActivity ( this , 0 , intent , FLAG_CANCEL_CURRENT ) ;
Buggy code:
public class CookieValuePersister implements IValuePersister { private static final long serialVersionUID = 1L ; private static final Log log = LogFactory . getLog ( CookieValuePersister . class ) ; public void clear ( final FormComponent component ) { } public void load ( final FormComponent component ) { } public void save ( final FormComponent component ) { } private void clear ( final Cookie cookie ) { } private String cookieToDebugString ( final Cookie cookie ) { } private Cookie getCookie ( final FormComponent component ) { } private Cookie [ ] getCookies ( ) { } private CookieValuePersisterSettings getSettings ( ) { <START_BUG> return wicket . RequestCycle . get ( ) . getApplication ( ) . getSettings ( ) . getCookieValuePersisterSettings ( ) ; <END_BUG> } private WebRequest getWebRequest ( ) { } private WebResponse getWebResponse ( ) { } private Cookie save ( final Cookie cookie ) { } }

Fix:
return RequestCycle . get ( ) . getApplication ( ) . getSecuritySettings ( ) . getCookieValuePersisterSettings ( ) ;
Buggy code:
public final class NullReturn { public static final NullReturn NULL = new NullReturn ( ) ; private NullReturn ( ) { } public String toString ( ) { <START_BUG> return String . valueOf ( null ) ; <END_BUG> } }

Fix:
return "null" ;
Buggy code:
public class UpdateFX { public static final String VERSION_PIN_FILE_NAME = "version-pin.txt" ; private static Logger log = LoggerFactory . getLogger ( UpdateFX . class ) ; public static void bootstrap ( Class mainClass , Path updatesDirectory , String [ ] args ) { } private static Path codePathToInstallDir ( Path origJarPath ) { } public static void restartApp ( ) { } public static Path findAppExecutable ( Path appInstallDir ) throws IOException { if ( appInstallDir == null ) throw new NullPointerException ( ) ; String os = System . getProperty ( "os.name" ) . toLowerCase ( ) ; if ( os . contains ( "mac" ) ) { List < Path > exes = Utils . listDir ( appInstallDir . resolve ( "Contents//MacOS" ) ) ; for ( Path exe : exes ) { if ( ! ( exe . toString ( ) . toLowerCase ( ) . endsWith ( ".dylib" ) ) ) { return exe ; } } <START_BUG> throw new IllegalStateException ( "We<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>the<seq2seq4repair_space>application." ) ; <END_BUG> } else { List < Path > exes = Utils . listDir ( appInstallDir ) ; List < Path > orig = new LinkedList < > ( exes ) ; if ( os . contains ( "win" ) ) { exes . removeIf ( ( path ) -> ! ( path . toString ( ) . toLowerCase ( ) . endsWith ( ".exe" ) ) ) ; exes . removeIf ( ( path ) -> path . toString ( ) . toLowerCase ( ) . endsWith ( "unins000.exe" ) ) ; } else { exes . removeIf ( ( path ) -> ( ( ! ( Files . isExecutable ( path ) ) ) || ( path . getFileName ( ) . toString ( ) . contains ( "." ) ) ) || ( Files . isDirectory ( path ) ) ) ; } if ( ( exes . size ( ) ) != 1 ) throw new IllegalStateException ( ( ( ( "App<seq2seq4repair_space>install<seq2seq4repair_space>dir<seq2seq4repair_space>didn't<seq2seq4repair_space>look<seq2seq4repair_space>like<seq2seq4repair_space>what<seq2seq4repair_space>we<seq2seq4repair_space>expected:<seq2seq4repair_space>" + orig ) + "<seq2seq4repair_space>vs<seq2seq4repair_space>" ) + exes ) ) ; return exes . get ( 0 ) ; } } private static void invoke ( Path appInstallDir , Class mainClass , String [ ] args , Path bestJarSeen ) throws Exception { } public static Path appInstallDir ; public static String [ ] initArgs ; private static void runRealMain ( Path appInstallDir , String [ ] args , Class < ? > newClass ) throws ClassNotFoundException , IllegalAccessException , NoSuchFieldException , NoSuchMethodException , InvocationTargetException { } public static Path findCodePath ( Class mainClass ) { } public static void pinToVersion ( Path updatesDirectory , int version ) { } public static int getVersionPin ( Path updatesDirectory ) { } public static void unpin ( Path updatesDirectory ) { } private static Path findRightJar ( Path origJarPath , Path updatesDirectory ) throws IOException { } private static int extractVerFromFilename ( Path path ) { } private static Path findBestJar ( Path origJarPath , Path updatesDirectory ) throws IOException { } }

Fix:
throw new IllegalStateException ( "We<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>the<seq2seq4repair_space>application." ) ;
Buggy code:
public class Main { public static void main ( String [ ] args ) { <START_BUG> GameMap gameMap = new GameMap ( "maps//world.map" ) ; <END_BUG> GameLogic . startOccupyingPhase ( ) ; TestingTerritory terr1 = new TestingTerritory ( 4 ) ; TestingTerritory terr2 = new TestingTerritory ( 2 ) ; System . out . println ( gameMap . toString ( ) ) ; } }

Fix:
GameMap gameMap = new GameMap ( "maps//squares.map" ) ;
Buggy code:
public abstract class ServiceCommandDispatcher < C > implements CommandDispatcher < C > { private static final RspFilter FILTER = new RspFilter ( ) { @ Override public boolean isAcceptable ( Object response , Address sender ) { } @ Override public boolean needMoreResponses ( ) { } } ; private final MessageDispatcher dispatcher ; private final CommandMarshaller < C > marshaller ; private final NodeFactory < Address > factory ; private final long timeout ; public ServiceCommandDispatcher ( MessageDispatcher dispatcher , CommandMarshaller < C > marshaller , NodeFactory < Address > factory , long timeout ) { } @ Override public < R > Map < Node , CommandResponse < R > > executeOnCluster ( Command < R , C > command , Node ... excludedNodes ) { } @ Override public < R > Map < Node , Future < R > > submitOnCluster ( Command < R , C > command , Node ... excludedNodes ) { } @ Override public < R > CommandResponse < R > executeOnNode ( Command < R , C > command , Node node ) { } @ Override public < R > Future < R > submitOnNode ( Command < R , C > command , Node node ) { } private < R > Message createMessage ( Command < R , C > command ) { } private < R > Message createMessage ( Command < R , C > command , Node node ) { } private static Address getAddress ( Node node ) { } private RequestOptions createRequestOptions ( Node ... excludedNodes ) { } private RequestOptions createRequestOptions ( ) { <START_BUG> return new RequestOptions ( ResponseMode . GET_ALL , this . timeout , false , ServiceCommandDispatcher . FILTER , Flag . DONT_BUNDLE ) ; <END_BUG> } static < R > CommandResponse < R > createCommandResponse ( Rsp < R > response ) { } private Address getLocalAddress ( ) { } private static class SimpleCommandResponse < T > implements CommandResponse < T > { private final T value ; private final ExecutionException exception ; SimpleCommandResponse ( T value ) { } SimpleCommandResponse ( Throwable exception ) { } @ Override public T get ( ) throws ExecutionException { } } private static class SimpleFuture < T > extends ServiceCommandDispatcher . SimpleCommandResponse < T > implements Future < T > { SimpleFuture ( T value ) { } SimpleFuture ( Throwable exception ) { } @ Override public boolean cancel ( boolean mayInterruptIfRunning ) { } @ Override public boolean isCancelled ( ) { } @ Override public boolean isDone ( ) { } @ Override public T get ( long timeout , TimeUnit unit ) throws ExecutionException { } } }

Fix:
return new RequestOptions ( ResponseMode . GET_ALL , this . timeout , false , ServiceCommandDispatcher . FILTER , Flag . DONT_BUNDLE , Flag . OOB ) ;
Buggy code:
public class InlineEnclosureAjaxPage extends WebPage { private static final long serialVersionUID = 1L ; private final WebMarkupContainer toggleable ; private final AjaxLink < Void > link ; @ SuppressWarnings ( "serial" ) public InlineEnclosureAjaxPage ( ) { } private void ajaxRepaintOnlyToggleableComponentsContainer ( AjaxRequestTarget target ) { <START_BUG> target . addComponent ( toggleable ) ; <END_BUG> } public WebMarkupContainer getToggleable ( ) { } public AjaxLink < Void > getLink ( ) { } }

Fix:
target . add ( toggleable ) ;
Buggy code:
public class AppointmentTest { public static void main ( String [ ] args ) { Appointment test = Appointment . getAppointment ( 9 ) ; <START_BUG> test . addAttendant ( "andrealr" ) ; <END_BUG> } }

Fix:
test . addAttendant ( "tuvaeri" ) ;
Buggy code:
public class Cell implements Serializable { private double jx ; private double jy ; private double jz ; private double rho ; private double phi ; private double Ex ; private double Ey ; private double Ez ; private double Bx ; private double By ; private double Bz ; private double Exo ; private double Eyo ; private double Ezo ; private double Bxo ; private double Byo ; private double Bzo ; public double getJx ( ) { } public synchronized void addJx ( double value ) { } public double getJy ( ) { } public synchronized void addJy ( double value ) { } public double getJz ( ) { } public synchronized void addJz ( double value ) { } public double getRho ( ) { } public void setRho ( double rho ) { } public synchronized void addRho ( double value ) { } public double getPhi ( ) { } public void setPhi ( double phi ) { } public double getEx ( ) { } public void setEx ( double ex ) { } public double getEy ( ) { } public void setEy ( double ey ) { } public double getEz ( ) { } public void setEz ( double ez ) { <START_BUG> Ex = ez ; <END_BUG> } public double getBx ( ) { } public void setBx ( double bx ) { } public double getBy ( ) { } public void setBy ( double by ) { } public double getBz ( ) { } public void setBz ( double bz ) { } public double getExo ( ) { } public void setExo ( double exo ) { } public double getEyo ( ) { } public void setEyo ( double eyo ) { } public double getEzo ( ) { } public void setEzo ( double ezo ) { } public double getBxo ( ) { } public void setBxo ( double bxo ) { } public double getByo ( ) { } public void setByo ( double byo ) { } public double getBzo ( ) { } public void setBzo ( double bzo ) { } public void resetCurrent ( ) { } public void resetCharge ( ) { } public void storeFields ( ) { } public void copyFrom ( Cell other ) { } @ Override public String toString ( ) { } }

Fix:
Ez = ez ;
Buggy code:
class ModClusterSubsystemAdd extends AbstractAddStepHandler { static final ModClusterSubsystemAdd INSTANCE = new ModClusterSubsystemAdd ( ) ; @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { } @ Override protected void populateModel ( OperationContext context , ModelNode operation , Resource resource ) throws OperationFailedException { if ( operation . hasDefined ( MOD_CLUSTER_CONFIG ) ) { PathAddress opAddress = PathAddress . pathAddress ( operation . get ( OP_ADDR ) ) ; PathAddress parent = opAddress . append ( CONFIGURATION_PATH ) ; ModelNode targetOperation = Util . createAddOperation ( parent ) ; for ( AttributeDefinition def : ModClusterConfigResourceDefinition . ModClusterConfigResourceDefinition . ATTRIBUTES ) { def . validateAndSet ( operation , targetOperation ) ; } <START_BUG> context . addStep ( targetOperation , ModClusterConfigAdd . INSTANCE , IMMEDIATE ) ; <END_BUG> } } @ Override protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { } private ModClusterConfig getModClusterConfig ( final OperationContext context , ModelNode model ) throws OperationFailedException { } private LoadBalanceFactorProvider getModClusterLoadProvider ( final OperationContext context , ModelNode model ) throws OperationFailedException { } private void addLoadMetrics ( Set < LoadMetric > metrics , ModelNode nodes , final OperationContext context ) throws OperationFailedException { } }

Fix:
context . addStep ( targetOperation , ModClusterConfigAdd . INSTANCE , MODEL , true ) ;
Buggy code:
@ Immutable @ Beta public final class TrieNode { private final boolean fullWord ; private final char [ ] nextChars ; private final TrieNode [ ] nextNodes ; @ SuppressWarnings ( "MethodCanBeVariableArityMethod" ) TrieNode ( final boolean fullWord , final char [ ] nextChars , final TrieNode [ ] nextNodes ) { } public int search ( final String needle , final boolean ignoreCase ) { } private int doSearch ( final CharBuffer buffer , final int matchedLength , final int currentLength , final boolean ignoreCase ) { final int nextLength = ( fullWord ) ? currentLength : matchedLength ; if ( ! ( buffer . hasRemaining ( ) ) ) return nextLength ; char c = buffer . get ( ) ; int index = Arrays . binarySearch ( nextChars , c ) ; <START_BUG> if ( ( index == ( - 1 ) ) && ignoreCase ) { <END_BUG> final boolean isUpper = Character . isUpperCase ( c ) ; final boolean isLower = Character . isLowerCase ( c ) ; if ( isUpper != isLower ) { c = ( isUpper ) ? Character . toLowerCase ( c ) : Character . toUpperCase ( c ) ; index = Arrays . binarySearch ( nextChars , c ) ; } } if ( index < 0 ) return nextLength ; return nextNodes [ index ] . doSearch ( buffer , nextLength , ( currentLength + 1 ) , ignoreCase ) ; } }

Fix:
if ( ( index < 0 ) && ignoreCase ) {
Buggy code:
abstract class _Aggregation2DBase < T extends IElementSet > extends FunctionAttribute < T > { _Aggregation2DBase ( final EAttributeType type ) { } public abstract IDimension getXDimension ( ) { } public abstract UnaryFunction getXTransformation ( ) { } public abstract IDimension getYDimension ( ) { } public abstract UnaryFunction getYTransformation ( ) { } public abstract StatisticalParameter getStatisticalParameter ( ) { } public abstract StatisticalParameter getSecondaryStatisticalParameter ( ) { } @ Override public String getPathComponentSuggestion ( ) { } @ Override protected ETextCase appendXAxisTitlePlain ( final ITextOutput textOut , final ETextCase textCase ) { } @ Override public void appendXAxisTitle ( final IMath math ) { } @ Override protected ETextCase appendYAxisTitlePlain ( final ITextOutput textOut , final ETextCase textCase ) { final UnaryFunction func ; final StatisticalParameter second ; ETextCase use ; use = ETextCase . ensure ( textCase ) ; second = this . getSecondaryStatisticalParameter ( ) ; if ( second != null ) { use = ETextCase . ensure ( second . appendName ( textOut , use ) ) ; textOut . append ( '<seq2seq4repair_space>' ) ; } use = ETextCase . ensure ( this . getStatisticalParameter ( ) . appendName ( textOut , use ) ) ; textOut . append ( '<seq2seq4repair_space>' ) ; func = this . getYTransformation ( ) ; if ( func != null ) { use = use . appendWord ( func . toString ( ) , textOut ) ; textOut . append ( '<seq2seq4repair_space>' ) ; } <START_BUG> return this . getXDimension ( ) . appendName ( textOut , use ) ; <END_BUG> } @ SuppressWarnings ( "resource" ) @ Override public void appendYAxisTitle ( final IMath math ) { } @ Override @ SuppressWarnings ( "rawtypes" ) public final boolean equals ( final Object o ) { } @ Override protected final int calcHashCode ( ) { } @ SuppressWarnings ( "incomplete-switch" ) static final IMatrix _aggregate ( final MatrixIterator2D iterator , final StatisticalParameter param ) { } }

Fix:
return this . getYDimension ( ) . appendName ( textOut , use ) ;
Buggy code:
public class MultipleAlignmentWriter { public static String toFASTA ( MultipleAlignment alignment ) { List < String > alnSequences = MultipleAlignmentTools . getSequenceAlignment ( alignment ) ; String fasta = "" ; for ( int st = 0 ; st < ( alignment . size ( ) ) ; st ++ ) { <START_BUG> fasta += ( ( ( ">" + ( alignment . getEnsemble ( ) . getStructureIdentifiers ( ) . get ( st ) ) ) + "\n" ) + ( alnSequences . get ( st ) ) ) + "\n" ; <END_BUG> } return fasta ; } public static String toFatCat ( MultipleAlignment alignment ) { } public static String toAlignedResidues ( MultipleAlignment multAln ) { } public static String toTransformMatrices ( MultipleAlignment alignment ) { } public static String toXML ( MultipleAlignmentEnsemble ensemble ) throws IOException { } public static String to3DFormat ( MultipleAlignment alignment , int queryIndex , int templateIndex ) throws StructureException { } No newline ; at end ; of file ; }

Fix:
fasta += ( ( ( ">" + ( alignment . getEnsemble ( ) . getStructureIdentifiers ( ) . get ( st ) . getIdentifier ( ) ) ) + "\n" ) + ( alnSequences . get ( st ) ) ) + "\n" ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class ExternalTagLibTestCase { private static final String MODULE_NAME = "external-tag-lib" ; private static TempTestModule testModule ; public static void doSetup ( ) throws Exception { } @ AfterClass public static void tearDown ( ) throws Exception { } @ Deployment public static WebArchive deployment ( ) throws Exception { ExternalTagLibTestCase . doSetup ( ) ; <START_BUG> return ShrinkWrap . create ( WebArchive . class , "test-external.war" ) . addClass ( InternalTag . class ) . addAsManifestResource ( ExternalTagLibTestCase . class . getPackage ( ) , "internal.tld" , "internal.tld" ) . addAsManifestResource ( new StringAsset ( ( ( "Dependencies:<seq2seq4repair_space>test." + ( ExternalTagLibTestCase . MODULE_NAME ) ) + "<seq2seq4repair_space>meta-inf\n" ) ) , "MANIFEST.MF" ) . addAsWebResource ( ExternalTagLibTestCase . class . getPackage ( ) , "test.jsp" , "test.jsp" ) ; <END_BUG> } @ ArquillianResource private URL url ; @ Test public void testExternalTagLib ( ) throws Exception { } }

Fix:
return ShrinkWrap . create ( WebArchive . class , "test-external.war" ) . addClass ( InternalTag . class ) . addAsWebInfResource ( ExternalTagLibTestCase . class . getPackage ( ) , "internal.tld" , "internal.tld" ) . addAsManifestResource ( new StringAsset ( ( ( "Dependencies:<seq2seq4repair_space>test." + ( ExternalTagLibTestCase . MODULE_NAME ) ) + "<seq2seq4repair_space>meta-inf\n" ) ) , "MANIFEST.MF" ) . addAsWebResource ( ExternalTagLibTestCase . class . getPackage ( ) , "test.jsp" , "test.jsp" ) ;
Buggy code:
public class PCEnhancerAgent { public static void premain ( String args , Instrumentation inst ) { OpenJPAConfiguration conf = new OpenJPAConfigurationImpl ( ) ; Options opts = Configurations . parseProperties ( args ) ; Configurations . populateConfiguration ( conf , opts ) ; conf . setConnectionUserName ( null ) ; conf . setConnectionPassword ( null ) ; conf . setConnectionURL ( null ) ; conf . setConnectionDriverName ( null ) ; conf . setConnectionFactoryName ( null ) ; final ClassLoader tmpLoader = new TemporaryClassLoader ( Thread . currentThread ( ) . getContextClassLoader ( ) ) ; conf . setClassResolver ( new ClassResolver ( ) { public ClassLoader getClassLoader ( Class context , ClassLoader env ) { return tmpLoader ; } } ) ; conf . setReadOnly ( true ) ; conf . instantiateAll ( ) ; <START_BUG> PCClassFileTransformer transformer = new PCClassFileTransformer ( new org . apache . openjpa . meta . MetaDataRepository ( conf ) , opts , tmpLoader ) ; <END_BUG> inst . addTransformer ( transformer ) ; } }

Fix:
PCClassFileTransformer transformer = new PCClassFileTransformer ( conf . newMetaDataRepositoryInstance ( ) , opts , tmpLoader ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class JmsClientTestCase { private static final String QUEUE_NAME = "createdTestQueue" ; @ Deployment public static Archive < ? > createDeployment ( ) { } @ Test public void testMessagingClient ( ) throws Exception { QueueConnection conn = null ; QueueSession session = null ; ModelControllerClient client = Factory . create ( InetAddress . getByName ( "127.0.0.1" ) , 9999 , getCallbackHandler ( ) ) ; boolean actionsApplied = false ; try { ModelNode op = new ModelNode ( ) ; op . get ( "operation" ) . set ( "add" ) ; op . get ( "address" ) . add ( "subsystem" , "messaging" ) ; op . get ( "address" ) . add ( "hornetq-server" , "default" ) ; op . get ( "address" ) . add ( "jms-queue" , JmsClientTestCase . QUEUE_NAME ) ; op . get ( "entries" ) . add ( JmsClientTestCase . QUEUE_NAME ) ; JmsClientTestCase . applyUpdate ( op , client ) ; actionsApplied = true ; QueueConnectionFactory qcf = lookup ( client , "RemoteConnectionFactory" , QueueConnectionFactory . class ) ; Queue queue = lookup ( client , JmsClientTestCase . QUEUE_NAME , Queue . class ) ; <START_BUG> conn = qcf . createQueueConnection ( ) ; <END_BUG> conn . start ( ) ; session = conn . createQueueSession ( false , AUTO_ACKNOWLEDGE ) ; final CountDownLatch latch = new CountDownLatch ( 10 ) ; final List < String > result = new ArrayList < String > ( ) ; QueueReceiver recv = session . createReceiver ( queue ) ; recv . setMessageListener ( new MessageListener ( ) { @ Override public void onMessage ( Message message ) { TextMessage msg = ( ( TextMessage ) ( message ) ) ; try { result . add ( msg . getText ( ) ) ; latch . countDown ( ) ; } catch ( JMSException e ) { e . printStackTrace ( ) ; } } } ) ; QueueSender sender = session . createSender ( queue ) ; for ( int i = 0 ; i < 10 ; i ++ ) { String s = "Test" + i ; TextMessage msg = session . createTextMessage ( s ) ; sender . send ( msg ) ; } Assert . assertTrue ( latch . await ( 3 , TimeUnit . SECONDS ) ) ; Assert . assertEquals ( 10 , result . size ( ) ) ; for ( int i = 0 ; i < ( result . size ( ) ) ; i ++ ) { Assert . assertEquals ( ( "Test" + i ) , result . get ( i ) ) ; } } finally { try { conn . stop ( ) ; } catch ( Exception ignore ) { } try { session . close ( ) ; } catch ( Exception ignore ) { } try { conn . close ( ) ; } catch ( Exception ignore ) { } if ( actionsApplied ) { ModelNode op = new ModelNode ( ) ; op . get ( "operation" ) . set ( "remove" ) ; op . get ( "address" ) . add ( "subsystem" , "messaging" ) ; op . get ( "address" ) . add ( "hornetq-server" , "default" ) ; op . get ( "address" ) . add ( "jms-queue" , JmsClientTestCase . QUEUE_NAME ) ; JmsClientTestCase . applyUpdate ( op , client ) ; } safeClose ( client ) ; } } static void applyUpdate ( ModelNode update , final ModelControllerClient client ) throws IOException { } private < T > T lookup ( ModelControllerClient client , String name , Class < T > expected ) throws Exception { } }

Fix:
conn = qcf . createQueueConnection ( "guest" , "guest" ) ;
Buggy code:
public class Preference { public static enum TYPES { REFRESHTIME , CHECK_SHOWCLIX , CHECK_PAX , CHECK_TWITTER , PLAY_ALARM , EVENT , EMAIL , CELLNUM , SAVE_PREFS , LAST_EVENT , USE_BETA , LAST_NOTIFICATION_ID , LOAD_NOTIFICATIONS , LOAD_UPDATES , TWITTER_CONSUMER_KEY , TWITTER_CONSUMER_SECRET , TWITTER_APP_KEY , TWITTER_APP_SECRET ; } protected Preference ( Preference . TYPES pref ) { } private final Preference . TYPES type ; private Object value ; private boolean shouldSave ; private boolean forceSave ; public boolean isSavedInPreferences ( ) { } public Preference . TYPES getPrefType ( ) { } public boolean shouldSave ( ) { } public void setShouldSave ( boolean save ) { <START_BUG> shouldSave = save && ( ( value ) != null ) ; <END_BUG> } public Object getValue ( ) { } public void setValue ( Object val ) { } public boolean forceSave ( ) { } public void setForceSave ( boolean fSave ) { } @ Override public String toString ( ) { } }

Fix:
shouldSave = save ;
Buggy code:
public final class ImageOnMap extends ZPlugin { private static final String IMAGES_DIRECTORY_NAME = "images" ; private static final String MAPS_DIRECTORY_NAME = "maps" ; private static ImageOnMap plugin ; private File imagesDirectory ; private final File mapsDirectory ; public ImageOnMap ( ) { } public static ImageOnMap getPlugin ( ) { } public File getImagesDirectory ( ) { } public File getMapsDirectory ( ) { } public File getImageFile ( short mapID ) { } @ SuppressWarnings ( "unchecked" ) @ Override public void onEnable ( ) { try { imagesDirectory = checkPluginDirectory ( imagesDirectory , V3Migrator . getOldImagesDirectory ( this ) ) ; checkPluginDirectory ( mapsDirectory ) ; } catch ( IOException ex ) { <START_BUG> PluginLogger . error ( ( "FATAL<seq2seq4repair_space>:<seq2seq4repair_space>" + ( ex . getMessage ( ) ) ) , null ) ; <END_BUG> this . setEnabled ( false ) ; return ; } loadComponents ( Gui . class , Commands . class , ImageIOExecutor . class , ImageRendererExecutor . class ) ; PluginConfiguration . init ( this ) ; MetricsLite . startMetrics ( ) ; MapManager . init ( ) ; MapInitEvent . init ( this ) ; MapItemManager . init ( ) ; Commands . register ( "maptool" , NewCommand . class , ListCommand . class , GetCommand . class , DeleteConfirmCommand . class , DeleteNoConfirmCommand . class , GetRemainingCommand . class , ExploreCommand . class , MigrateCommand . class ) ; Commands . registerShortcut ( "maptool" , NewCommand . class , "tomap" ) ; Commands . registerShortcut ( "maptool" , ExploreCommand . class , "maps" ) ; } @ Override public void onDisable ( ) { } private File checkPluginDirectory ( File primaryFile , File ... alternateFiles ) throws IOException { } }

Fix:
PluginLogger . error ( ( "FATAL<seq2seq4repair_space>:<seq2seq4repair_space>" + ( ex . getMessage ( ) ) ) ) ;
Buggy code:
public class UMLExtendBaseComboBoxModel extends UMLComboBoxModel2 { public UMLExtendBaseComboBoxModel ( ) { } protected void buildModelList ( ) { } protected Object getSelectedModelElement ( ) { } <START_BUG> protected boolean isValidElement ( MBase element ) { <END_BUG> return element instanceof MUseCase ; } }

Fix:
protected boolean isValidElement ( Object element ) {
Buggy code:
public class PrepareForElasticSearch extends BaseFunction { private String esIndex ; @ Override public void prepare ( Map conf , TridentOperationContext context ) { } @ Override public void execute ( TridentTuple tridentTuple , TridentCollector tridentCollector ) { String url = JSONObject . escape ( tridentTuple . getString ( 0 ) ) ; String content_html = JSONObject . escape ( tridentTuple . getString ( 1 ) ) ; String title = JSONObject . escape ( tridentTuple . getString ( 2 ) ) ; String task = JSONObject . escape ( tridentTuple . getString ( 3 ) ) ; <START_BUG> String user = JSONObject . escape ( tridentTuple . getString ( 2 ) ) ; <END_BUG> JSONObject json = new JSONObject ( ) ; json . put ( "url" , url ) ; json . put ( "content" , content_html ) ; json . put ( "title" , title ) ; json . put ( "task" , task ) ; json . put ( "user" , user ) ; tridentCollector . emit ( new backtype . storm . tuple . Values ( this . esIndex , task , url , json . toJSONString ( ) ) ) ; } No newline ; at end ; of file ; }

Fix:
String user = JSONObject . escape ( tridentTuple . getString ( 4 ) ) ;
Buggy code:
public class SynchronizedSortedBag < E > extends SynchronizedBag < E > implements SortedBag < E > { private static final long serialVersionUID = 722374056718497858L ; public static < E > SynchronizedSortedBag < E > synchronizedSortedBag ( final SortedBag < E > bag ) { } protected SynchronizedSortedBag ( final SortedBag < E > bag ) { } protected SynchronizedSortedBag ( final Bag < E > bag , final Object lock ) { } protected SortedBag < E > getSortedBag ( ) { <START_BUG> return ( ( SortedBag < E > ) ( collection ) ) ; <END_BUG> } public synchronized E first ( ) { } public synchronized E last ( ) { } public synchronized Comparator < ? super E > comparator ( ) { } }

Fix:
return ( ( SortedBag < E > ) ( SynchronizedSortedBag . decorated ( ) ) ) ;
Buggy code:
public class TestFieldCacheTermsFilter extends LuceneTestCase { public void testMissingTerms ( ) throws Exception { String fieldName = "field1" ; MockRAMDirectory rd = new MockRAMDirectory ( ) ; IndexWriter w = new IndexWriter ( rd , new KeywordAnalyzer ( ) , MaxFieldLength . UNLIMITED ) ; for ( int i = 0 ; i < 100 ; i ++ ) { Document doc = new Document ( ) ; int term = i * 10 ; doc . add ( new org . apache . lucene . document . Field ( fieldName , ( "" + term ) , Store . YES , Index . NOT_ANALYZED ) ) ; w . addDocument ( doc ) ; } w . close ( ) ; <START_BUG> IndexReader reader = IndexReader . open ( rd ) ; <END_BUG> IndexSearcher searcher = new IndexSearcher ( reader ) ; int numDocs = reader . numDocs ( ) ; ScoreDoc [ ] results ; MatchAllDocsQuery q = new MatchAllDocsQuery ( ) ; List terms = new ArrayList ( ) ; terms . add ( "5" ) ; results = searcher . search ( q , new FieldCacheTermsFilter ( fieldName , ( ( String [ ] ) ( terms . toArray ( new String [ 0 ] ) ) ) ) , numDocs ) . scoreDocs ; assertEquals ( "Must<seq2seq4repair_space>match<seq2seq4repair_space>nothing" , 0 , results . length ) ; terms = new ArrayList ( ) ; terms . add ( "10" ) ; results = searcher . search ( q , new FieldCacheTermsFilter ( fieldName , ( ( String [ ] ) ( terms . toArray ( new String [ 0 ] ) ) ) ) , numDocs ) . scoreDocs ; assertEquals ( "Must<seq2seq4repair_space>match<seq2seq4repair_space>1" , 1 , results . length ) ; terms = new ArrayList ( ) ; terms . add ( "10" ) ; terms . add ( "20" ) ; results = searcher . search ( q , new FieldCacheTermsFilter ( fieldName , ( ( String [ ] ) ( terms . toArray ( new String [ 0 ] ) ) ) ) , numDocs ) . scoreDocs ; assertEquals ( "Must<seq2seq4repair_space>match<seq2seq4repair_space>2" , 2 , results . length ) ; reader . close ( ) ; rd . close ( ) ; } }

Fix:
IndexReader reader = IndexReader . open ( rd , true ) ;