nus-yam/ex-repair huggingface dataset:
Buggy code:
public class EvaluateAndInitiateReportConverter { AdverseEventConverter aeConverter = new AdverseEventConverter ( ) ; ExpeditedAdverseEventReportConverterUtility utility = new ExpeditedAdverseEventReportConverterUtility ( ) ; public void setStudyDao ( StudyDao studyDao ) { } public ExpeditedAdverseEventReport convert ( EvaluateAndInitiateInputMessage evaluateInputMessage , AdverseEventReportingPeriod repPeriod , SaveAndEvaluateAEsOutputMessage response ) { Timestamp now = new Timestamp ( System . currentTimeMillis ( ) ) ; ExpeditedAdverseEventReport aeSrcReport = new ExpeditedAdverseEventReport ( ) ; for ( AdverseEvent adverseEvent : repPeriod . getAdverseEvents ( ) ) { <START_BUG> aeSrcReport . addAdverseEvent ( adverseEvent ) ; <END_BUG> } aeSrcReport . setExternalId ( evaluateInputMessage . getReportId ( ) ) ; aeSrcReport . setReporter ( utility . convertReporter ( evaluateInputMessage . getReporter ( ) ) ) ; aeSrcReport . setPhysician ( utility . convertPhysician ( evaluateInputMessage . getPhysician ( ) ) ) ; aeSrcReport . setExternalId ( evaluateInputMessage . getReportId ( ) ) ; aeSrcReport . setCreatedAt ( now ) ; aeSrcReport . setReportingPeriod ( repPeriod ) ; List < Report > reports = new ArrayList < Report > ( ) ; if ( ( ( response . getRecommendedActions ( ) ) != null ) && ( ( response . getRecommendedActions ( ) . size ( ) ) > 0 ) ) { Report report = new Report ( ) ; report . setReportDefinition ( new ReportDefinition ( ) ) ; report . getReportDefinition ( ) . setName ( response . getRecommendedActions ( ) . get ( 0 ) . getReport ( ) ) ; if ( ( ( evaluateInputMessage . isWithdrawReport ( ) ) != null ) && ( evaluateInputMessage . isWithdrawReport ( ) . booleanValue ( ) ) ) { report . setWithdrawnOn ( now ) ; } reports . add ( report ) ; } aeSrcReport . setReports ( reports ) ; return aeSrcReport ; } No newline ; at end ; of file ; }

Fix:
aeSrcReport . addAdverseEventUnidirectional ( adverseEvent ) ;
Buggy code:
@ XmlAccessorType ( XmlAccessType . FIELD ) @ XmlRootElement ( name = "BlockTypes" ) public class BlockTypes { @ XmlElement ( name = "BlockType" , type = BlockType . class ) private List < BlockType > blocktypes = new ArrayList < BlockType > ( ) ; public BlockTypes ( ) { } public List < BlockType > getBlocktypes ( ) { } public BlockType getBlockType ( String typeId ) { for ( int x = 0 ; x < ( blocktypes . size ( ) ) ; x ++ ) { BlockType blockType = blocktypes . get ( x ) ; <START_BUG> if ( blockType . equals ( typeId ) ) <END_BUG> return blockType ; } return null ; } }

Fix:
if ( blockType . getTypeId ( ) . equals ( typeId ) )
Buggy code:
public class TestIR { private Corpus corpus ; @ BeforeClass public static void before ( ) { } @ Before public void setUp ( ) throws Exception { } @ Test public void testCorpus ( ) { } @ Test public void testLinearSearch ( ) { LinearSearch linear = new LinearSearch ( corpus ) ; String query = "Brutus" ; Set < Integer > result = linear . search ( query ) ; assertTrue ( "Ergebnis<seq2seq4repair_space>sollte<seq2seq4repair_space>nicht<seq2seq4repair_space>leer<seq2seq4repair_space>sein." , ( ( result . size ( ) ) > 0 ) ) ; System . out . println ( result ) ; String query2 = "Brutus<seq2seq4repair_space>Caesar" ; Set < Integer > result2 = linear . search ( query2 ) ; assertTrue ( "Ergebnismenge<seq2seq4repair_space>sollte<seq2seq4repair_space>gewachsen<seq2seq4repair_space>sein." , ( ( result2 . size ( ) ) > ( result . size ( ) ) ) ) ; <START_BUG> System . out . println ( result ) ; <END_BUG> } @ Test public void testMatrixSearch ( ) { } @ Test public void testIndexSearch ( ) { } @ After public void tearDown ( ) { } @ AfterClass public static void finish ( ) { } }

Fix:
System . out . println ( result2 ) ;
Buggy code:
public class LocalVariablePattern extends VariablePattern { LocalVariable localVariable ; public LocalVariablePattern ( boolean findDeclarations , boolean readAccess , boolean writeAccess , LocalVariable localVariable , int matchMode , boolean isCaseSensitive ) { } protected void acceptPath ( IIndexSearchRequestor requestor , String path ) { } <START_BUG> public void findIndexMatches ( IIndex index , IIndexSearchRequestor requestor , int detailLevel , IProgressMonitor progressMonitor , IJavaSearchScope scope ) { <END_BUG> String path = this . localVariable . getPath ( ) . toString ( ) ; if ( scope . encloses ( path ) ) acceptPath ( requestor , path ) ; } public String toString ( ) { } }

Fix:
public void findIndexMatches ( IIndex index , IIndexSearchRequestor requestor , IProgressMonitor progressMonitor , IJavaSearchScope scope ) {
Buggy code:
@ WebServlet ( "//default" ) public class DefaultPageServlet extends HttpServlet { private static final long serialVersionUID = 1L ; private ScenarioService scenarioService ; public DefaultPageServlet ( ) { } @ Override public void init ( ) throws ServletException { } protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { <START_BUG> request . setAttribute ( "scenarii" , scenarioService . loadAll ( ) ) ; <END_BUG> WebUtils . forward ( request , response , "default.jsp" ) ; } protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } }

Fix:
request . getSession ( ) . setAttribute ( "scenarii" , scenarioService . loadAll ( ) ) ;
Buggy code:
@ Path ( "//articles" ) public class ArticleServices { private ArticleDao articleDao = new ArticleDaoImpl ( ) ; private UserProfileDao userProfileDao = new UserProfileDaoImpl ( ) ; @ Path ( "//lastarticles" ) @ GET @ Produces ( MediaType . APPLICATION_JSON ) public List < ArticlesResponseDto > findLastArticles ( ) { } @ Path ( "//searchedarticles" ) @ POST @ Consumes ( "application//x-www-form-urlencoded" ) @ Produces ( MediaType . APPLICATION_JSON ) public List < ArticlesResponseDto > findSearchedArticles ( @ FormParam ( "search" ) String search ) { } <START_BUG> @ Path ( "//searchedarticles" ) <END_BUG> @ POST @ Consumes ( "application//x-www-form-urlencoded" ) @ Produces ( MediaType . APPLICATION_JSON ) public Map < String , List < ArticlesResponseDto > > findSearchedArticles2 ( @ FormParam ( "search" ) String search ) { List < String > requestList = new ArrayList < String > ( ) ; if ( search != null ) { StringTokenizer st = new StringTokenizer ( search ) ; while ( st . hasMoreTokens ( ) ) { requestList . add ( st . nextToken ( ) ) ; } } Map < String , List < Article > > searchedArticlesMap = articleDao . findSearchedArticles2 ( requestList ) ; Map < String , List < ArticlesResponseDto > > mapArticle = null ; return mapArticle ; } private List < ArticlesResponseDto > doArticlesMapping ( List < Article > lastArticlesList ) { } No newline ; at end ; of file ; }

Fix:
@ Path ( "//searchedarticles2" )
Buggy code:
abstract class NewPartToOldWrapper extends NewPartToWorkbenchPartAdapter { private Part part = null ; private SelectionProviderAdapter selectionProvider ; private NewPartToOldWrapper . PartServices services ; private IWorkbenchPartSite partSite ; private final class PartServices implements IAdaptable , ISecondaryId , ISelectionHandler { public String getSecondaryId ( ) { } public Object getAdapter ( Class adapter ) { } public void setSelection ( ISelection newSelection ) { } } public NewPartToOldWrapper ( IPartPropertyProvider provider ) { } protected abstract IMemento getMemento ( ) { } public void createPartControl ( Composite parent ) { try { FactoryMap args = new FactoryMap ( ) ; args . addInstance ( services ) ; args . addInstance ( getPropertyProvider ( ) ) ; addServices ( args ) ; args . mapInstance ( Composite . class , parent ) ; parent . setLayout ( new FillLayout ( ) ) ; part = createPart ( parent , args ) ; } catch ( ComponentException e ) { WorkbenchPlugin . getDefault ( ) . getLog ( ) . log ( e . getStatus ( ) ) ; <START_BUG> new ErrorPart ( parent ) ; <END_BUG> } } protected void addServices ( FactoryMap context ) { } protected abstract Part createPart ( Composite parent , ServiceFactory args ) throws ComponentException { } protected abstract String getSecondaryId ( ) { } public void setFocus ( ) { } private SelectionProviderAdapter getSelectionProvider ( ) { } protected Part getPart ( ) { } protected IWorkbenchPartFactory getFactory ( ) { } protected void setSite ( IWorkbenchPartSite site ) { } public IWorkbenchPartSite getSite ( ) { } public Object getAdapter ( Class adapter ) { } }

Fix:
new StatusPart ( parent , e . getStatus ( ) ) ;
Buggy code:
public class NeutronNetworkAware implements INeutronNetworkAware { private static final Logger LOG = LoggerFactory . getLogger ( NeutronNetworkAware . class ) ; private final DataBroker dataProvider ; public NeutronNetworkAware ( DataBroker dataProvider ) { } @ Override public int canCreateNetwork ( NeutronNetwork network ) { } @ Override public void neutronNetworkCreated ( NeutronNetwork network ) { } private void addEpgExternalIfMissing ( TenantId tenantId , ReadWriteTransaction rwTx ) { Optional < EndpointGroup > potentialEpgExternal = DataStoreHelper . readFromDs ( CONFIGURATION , IidFactory . endpointGroupIid ( tenantId , EPG_EXTERNAL_ID ) , rwTx ) ; if ( ! ( potentialEpgExternal . isPresent ( ) ) ) { EndpointGroup epgExternal = new EndpointGroupBuilder ( ) . setId ( EPG_EXTERNAL_ID ) . setDescription ( new org . opendaylight . yang . gen . v1 . urn . opendaylight . groupbasedpolicy . common . rev140421 . Description ( ( ( MappingUtils . NEUTRON_EXTERNAL__ ) + "epg_external_networks" ) ) ) . setIntraGroupPolicy ( RequireContract ) . build ( ) ; <START_BUG> rwTx . put ( CONFIGURATION , IidFactory . endpointGroupIid ( tenantId , EPG_EXTERNAL_ID ) , epgExternal ) ; <END_BUG> } } private void addEpgDhcpIfMissing ( TenantId tenantId , ReadWriteTransaction rwTx ) { } private void addEpgRouterIfMissing ( TenantId tenantId , ReadWriteTransaction rwTx ) { } @ Override public int canUpdateNetwork ( NeutronNetwork delta , NeutronNetwork original ) { } @ Override public void neutronNetworkUpdated ( NeutronNetwork network ) { } @ Override public int canDeleteNetwork ( NeutronNetwork network ) { } @ Override public void neutronNetworkDeleted ( NeutronNetwork network ) { } }

Fix:
rwTx . put ( CONFIGURATION , IidFactory . endpointGroupIid ( tenantId , EPG_EXTERNAL_ID ) , epgExternal , true ) ;
Buggy code:
public class DeletedColumn extends Column { private static Logger logger = LoggerFactory . getLogger ( DeletedColumn . class ) ; public DeletedColumn ( ByteBuffer name , int localDeletionTime , long timestamp ) { } public DeletedColumn ( ByteBuffer name , ByteBuffer value , long timestamp ) { } @ Override public boolean isMarkedForDelete ( ) { } @ Override public long getMarkedForDeleteAt ( ) { } @ Override public int getLocalDeletionTime ( ) { <START_BUG> return value . getInt ( ( ( value . position ( ) ) + ( value . arrayOffset ( ) ) ) ) ; <END_BUG> } @ Override public IColumn deepCopy ( ) { } }

Fix:
return value . getInt ( value . position ( ) ) ;
Buggy code:
class MozillaDelegate { Browser browser ; Listener listener ; boolean hasFocus ; static boolean GtkLoaded ; static boolean IsLinux ; MozillaDelegate ( Browser browser ) { } static Browser findBrowser ( int handle ) { } static Browser findBrowser ( Control control , int gtkHandle ) { } static char [ ] mbcsToWcs ( String codePage , byte [ ] buffer ) { } static byte [ ] wcsToMbcs ( String codePage , String string , boolean terminate ) { } int getHandle ( ) { } String getLibraryName ( ) { } String getSWTInitLibraryName ( ) { } void handleFocus ( ) { } void handleMouseDown ( ) { int shellStyle = browser . getShell ( ) . getStyle ( ) ; if ( ( ( shellStyle & ( SWT . ON_TOP ) ) != 0 ) && ( ( ( shellStyle & ( SWT . NO_FOCUS ) ) == 0 ) || ( ( ( browser . getStyle ( ) ) & ( SWT . NO_FOCUS ) ) == 0 ) ) ) { browser . getDisplay ( ) . asyncExec ( new Runnable ( ) { public void run ( ) { <START_BUG> if ( browser . isDisposed ( ) ) <END_BUG> return ; ( ( Mozilla ) ( browser . webBrowser ) ) . Activate ( ) ; } } ) ; } } boolean hookEnterExit ( ) { } void init ( ) { } boolean needsSpinup ( ) { } void onDispose ( int embedHandle ) { } void setSize ( int embedHandle , int width , int height ) { } }

Fix:
if ( ( ( browser ) == null ) || ( browser . isDisposed ( ) ) )
Buggy code:
public class AnimControl { final SolidModel model ; private SolidSprite bound = null ; final ObjectMap < Node , AnimControl . Transform > transforms = new ObjectMap < Node , AnimControl . Transform > ( ) ; final AnimControl . Transform temp = new AnimControl . Transform ( ) ; protected AnimControl ( final SolidModel model ) { } protected void begin ( SolidSprite toBind ) { } protected void apply ( final Animation animation , final float time , final float alpha ) { if ( ( bound ) == null ) throw new GdxRuntimeException ( "You<seq2seq4repair_space>must<seq2seq4repair_space>call<seq2seq4repair_space>begin()<seq2seq4repair_space>before<seq2seq4repair_space>adding<seq2seq4repair_space>an<seq2seq4repair_space>animation" ) ; for ( final NodeAnimation nodeAnim : animation . nodeAnimations ) { final NodeKeyframe [ ] frames ; frames = nodeAnim . keyframes . toArray ( NodeKeyframe . class ) ; if ( ( frames . length ) == 0 ) continue ; int top = ( frames . length ) - 2 ; int bot = 0 ; int mid ; NodeKeyframe firstFrame = null ; NodeKeyframe secondFrame = null ; <START_BUG> if ( top <= bot ) <END_BUG> firstFrame = frames [ 0 ] ; else while ( true ) { mid = ( top + bot ) // 2 ; final float time1 = ( firstFrame = frames [ mid ] ) . keytime ; final float time2 = ( secondFrame = frames [ ( mid + 1 ) ] ) . keytime ; if ( ( ( time >= time1 ) && ( time <= time2 ) ) || ( ( top - bot ) < 2 ) ) break ; else if ( time < time2 ) top = mid ; else if ( time > time1 ) bot = mid ; } if ( firstFrame == null ) continue ; temp . set ( firstFrame . translation , firstFrame . rotation , firstFrame . scale ) ; if ( ( secondFrame != null ) && ( secondFrame != firstFrame ) ) { final float progress = ( time - ( firstFrame . keytime ) ) // ( ( secondFrame . keytime ) - ( firstFrame . keytime ) ) ; temp . lerp ( secondFrame . translation , secondFrame . rotation , secondFrame . scale , progress ) ; } final AnimControl . Transform t = transforms . get ( nodeAnim . node ) ; if ( alpha > 0.999F ) t . set ( temp ) ; else t . lerp ( temp , alpha ) ; } } public static final class Transform { final Vector3 translation = new Vector3 ( ) ; final Quaternion rotation = new Quaternion ( ) ; final Vector3 scale = new Vector3 ( 1 , 1 , 1 ) ; AnimControl . Transform idt ( ) { } AnimControl . Transform set ( final Vector3 t , final Quaternion r , final Vector3 s ) { } AnimControl . Transform set ( final AnimControl . Transform other ) { } AnimControl . Transform lerp ( final AnimControl . Transform target , final float alpha ) { } AnimControl . Transform lerp ( final Vector3 targetT , final Quaternion targetR , final Vector3 targetS , final float alpha ) { } Matrix4 toMatrix4 ( final Matrix4 out ) { } } protected void end ( ) { } }

Fix:
if ( top < bot )
Buggy code:
public class WiFiDirectActivity extends ActionBarActivity implements ChannelListener , DeviceActionListener { public static int groupOwnerIntent ; public static final String TAG = "wifidirectdemo" ; private WifiP2pManager manager ; private boolean isWifiP2pEnabled = false ; private boolean retryChannel = false ; private boolean isHost = false ; private final IntentFilter intentFilter = new IntentFilter ( ) ; private Channel channel ; private BroadcastReceiver receiver = null ; private WifiP2pDnsSdServiceRequest serviceRequest ; final HashMap < String , String > buddies = new HashMap < String , String > ( ) ; public void setIsWifiP2pEnabled ( boolean isWifiP2pEnabled ) { } @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( main ) ; Toolbar toolbar = ( ( Toolbar ) ( findViewById ( wifidirect_toolbar ) ) ) ; setSupportActionBar ( toolbar ) ; getSupportActionBar ( ) . setDisplayHomeAsUpEnabled ( true ) ; intentFilter . addAction ( WIFI_P2P_STATE_CHANGED_ACTION ) ; intentFilter . addAction ( WIFI_P2P_PEERS_CHANGED_ACTION ) ; intentFilter . addAction ( WIFI_P2P_CONNECTION_CHANGED_ACTION ) ; intentFilter . addAction ( WIFI_P2P_THIS_DEVICE_CHANGED_ACTION ) ; manager = ( ( WifiP2pManager ) ( getSystemService ( WIFI_P2P_SERVICE ) ) ) ; channel = manager . initialize ( this , getMainLooper ( ) , null ) ; isHost = getIntent ( ) . getBooleanExtra ( "isHost" , false ) ; if ( isHost ) { WiFiDirectActivity . groupOwnerIntent = 15 ; <START_BUG> ServerInstance . getServerInstance ( ) ; <END_BUG> } } @ Override public void onResume ( ) { } @ Override public void onPause ( ) { } public void initiateDiscoverPeers ( ) { } private static String getWiFiP2pFailureMessage ( int errorCode ) { } public void resetData ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public void showDetails ( WifiP2pDevice device ) { } @ Override public void connect ( WifiP2pConfig config ) { } @ Override public void disconnect ( ) { } @ Override public void onChannelDisconnected ( ) { } @ Override public void cancelDisconnect ( ) { } }

Fix:
ServerInstance . getServerInstance ( ) . startServer ( ) ;
Buggy code:
public final class WorkbenchWindowConfigurer implements IWorkbenchWindowConfigurer { private WorkbenchWindow window ; private boolean showShortcutBar = true ; private boolean showStatusLine = true ; private boolean showToolBar = true ; private boolean showMenuBar = true ; private boolean showTitleBar = true ; private Map extraData = new HashMap ( 1 ) ; private ArrayList transferTypes = new ArrayList ( 3 ) ; private DropTargetListener dropTargetListener = null ; private WorkbenchWindowConfigurer . WindowActionBarConfigurer actionBarConfigurer = null ; class WindowActionBarConfigurer extends AbstractActionBarConfigurer { private ArrayList coolItemIds = new ArrayList ( 4 ) ; boolean containsCoolItem ( String id ) { } public IStatusLineManager getStatusLineManager ( ) { } public IMenuManager getMenuManager ( ) { } public CoolBarManager getCoolBarManager ( ) { } public void addEditorToolBarGroup ( ) { } public void registerGlobalAction ( IAction action ) { } public IToolBarManager addToolBar ( String id ) { } public void removeToolBar ( String id ) { } } WorkbenchWindowConfigurer ( WorkbenchWindow window ) { } void init ( ) { } public IWorkbenchWindow getWindow ( ) { } public IWorkbenchConfigurer getWorkbenchConfigurer ( ) { } public String getTitle ( ) { } public void setTitle ( String title ) { if ( title == null ) { throw new IllegalArgumentException ( ) ; } Shell shell = window . getShell ( ) ; <START_BUG> if ( shell != null ) { <END_BUG> shell . setText ( title ) ; } else { } } public boolean getShowTitleBar ( ) { } public void setShowTitleBar ( boolean show ) { } public boolean getShowMenuBar ( ) { } public void setShowMenuBar ( boolean show ) { } public boolean getShowToolBar ( ) { } public void setShowToolBar ( boolean show ) { } public boolean getShowShortcutBar ( ) { } public void setShowShortcutBar ( boolean show ) { } public boolean getShowStatusLine ( ) { } public void setShowStatusLine ( boolean show ) { } public Object getData ( String key ) { } public void setData ( String key , Object data ) { } public void addEditorAreaTransfer ( Transfer tranfer ) { } public void configureEditorAreaDropListener ( DropTargetListener dropTargetListener ) { } Transfer [ ] getTransfers ( ) { } DropTargetListener getDropTargetListener ( ) { } public IActionBarConfigurer getActionBarConfigurer ( ) { } boolean containsCoolItem ( String id ) { } }

Fix:
if ( ( shell != null ) && ( ! ( shell . isDisposed ( ) ) ) ) {
Buggy code:
public abstract class AbstractTypeDeclaration extends BodyDeclaration { SimpleName typeName = null ; ASTNode . NodeList bodyDeclarations ; abstract ChildListPropertyDescriptor internalBodyDeclarationsProperty ( ) { } abstract ChildPropertyDescriptor internalNameProperty ( ) { } static final ChildListPropertyDescriptor internalBodyDeclarationPropertyFactory ( Class nodeClass ) { } static final ChildPropertyDescriptor internalNamePropertyFactory ( Class nodeClass ) { } AbstractTypeDeclaration ( AST ast ) { } public SimpleName getName ( ) { if ( ( this . typeName ) == null ) { <START_BUG> synchronized ( this . ast ) { <END_BUG> if ( ( this . typeName ) == null ) { preLazyInit ( ) ; this . typeName = new SimpleName ( this . ast ) ; postLazyInit ( this . typeName , internalNameProperty ( ) ) ; } } } return this . typeName ; } public void setName ( SimpleName typeName ) { } public List bodyDeclarations ( ) { } public boolean isPackageMemberTypeDeclaration ( ) { } public boolean isMemberTypeDeclaration ( ) { } public boolean isLocalTypeDeclaration ( ) { } int memSize ( ) { } }

Fix:
synchronized ( this ) {
Buggy code:
public class TabFolder extends Composite { TabItem [ ] items ; int itemCount ; public TabFolder ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } void createHandle ( ) { <START_BUG> SWTTabView widget = ( ( SWTTabView ) ( new SWTTabView ( ) . alloc ( ) ) ) ; <END_BUG> widget . initWithFrame ( new NSRect ( ) ) ; widget . setDelegate ( widget ) ; if ( ( ( style ) & ( SWT . BOTTOM ) ) != 0 ) { widget . setTabViewType ( NSBottomTabsBezelBorder ) ; } view = widget ; } void createItem ( TabItem item , int index ) { } void createWidget ( ) { } void destroyItem ( TabItem item ) { } public Rectangle getClientArea ( ) { } public TabItem getItem ( int index ) { } public TabItem getItem ( Point point ) { } public int getItemCount ( ) { } public TabItem [ ] getItems ( ) { } public TabItem [ ] getSelection ( ) { } public int getSelectionIndex ( ) { } public int indexOf ( TabItem item ) { } Point minimumSize ( int wHint , int hHint , boolean flushCache ) { } void releaseChildren ( boolean destroy ) { } void removeControl ( Control control ) { } public void removeSelectionListener ( SelectionListener listener ) { } void setFont ( NSFont font ) { } public void setSelection ( TabItem item ) { } public void setSelection ( TabItem [ ] items ) { } public void setSelection ( int index ) { } void setSelection ( int index , boolean notify , boolean force ) { } boolean traversePage ( boolean next ) { } void willSelectTabViewItem ( int tabView , int tabViewItem ) { } }

Fix:
NSTabView widget = ( ( NSTabView ) ( new SWTTabView ( ) . alloc ( ) ) ) ;
Buggy code:
public class HBaseState implements State { private static final Logger LOG = LoggerFactory . getLogger ( HBaseState . class ) ; private HBaseState . Options options ; private HBaseClient hBaseClient ; private Map map ; private int numPartitions ; private int partitionIndex ; protected HBaseState ( Map map , int partitionIndex , int numPartitions , HBaseState . Options options ) { } public static class Options implements Serializable { private TridentHBaseMapper mapper ; private Durability durability = Durability . SKIP_WAL ; private HBaseProjectionCriteria projectionCriteria ; private HBaseValueMapper rowToStormValueMapper ; private String configKey ; private String tableName ; public HBaseState . Options withDurability ( Durability durability ) { } public HBaseState . Options withProjectionCriteria ( HBaseProjectionCriteria projectionCriteria ) { } public HBaseState . Options withConfigKey ( String configKey ) { } public HBaseState . Options withTableName ( String tableName ) { } public HBaseState . Options withRowToStormValueMapper ( HBaseValueMapper rowToStormValueMapper ) { } public HBaseState . Options withMapper ( TridentHBaseMapper mapper ) { } } protected void prepare ( ) { final Configuration hbConfig = HBaseConfiguration . create ( ) ; Map < String , Object > conf = ( ( Map < String , Object > ) ( map . get ( options . configKey ) ) ) ; if ( conf == null ) { HBaseState . LOG . info ( ( ( "HBase<seq2seq4repair_space>configuration<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>using<seq2seq4repair_space>key<seq2seq4repair_space>'" + ( options . configKey ) ) + "'" ) ) ; HBaseState . LOG . info ( "Using<seq2seq4repair_space>HBase<seq2seq4repair_space>config<seq2seq4repair_space>from<seq2seq4repair_space>first<seq2seq4repair_space>hbase-site.xml<seq2seq4repair_space>found<seq2seq4repair_space>on<seq2seq4repair_space>classpath." ) ; } else { if ( ( conf . get ( "hbase.rootdir" ) ) == null ) { HBaseState . LOG . warn ( "No<seq2seq4repair_space>'hbase.rootdir'<seq2seq4repair_space>value<seq2seq4repair_space>found<seq2seq4repair_space>in<seq2seq4repair_space>configuration!<seq2seq4repair_space>Using<seq2seq4repair_space>HBase<seq2seq4repair_space>defaults." ) ; } for ( String key : conf . keySet ( ) ) { <START_BUG> hbConfig . set ( key , String . valueOf ( conf . get ( key ) ) ) ; <END_BUG> } } Map < String , Object > hbaseConfMap = new HashMap < String , Object > ( conf ) ; hbaseConfMap . put ( TOPOLOGY_AUTO_CREDENTIALS , map . get ( TOPOLOGY_AUTO_CREDENTIALS ) ) ; this . hBaseClient = new HBaseClient ( hbaseConfMap , hbConfig , options . tableName ) ; } @ Override public void beginCommit ( Long aLong ) { } @ Override public void commit ( Long aLong ) { } public void updateState ( List < TridentTuple > tuples , TridentCollector collector ) { } public List < List < Values > > batchRetrieve ( List < TridentTuple > tridentTuples ) { } }

Fix:
hbConfig . set ( key , String . valueOf ( map . get ( key ) ) ) ;
Buggy code:
public class MenuItem extends Item { int accelerator ; Menu parent ; Menu menu ; public MenuItem ( Menu parent , int style ) { } public MenuItem ( Menu parent , int style , int index ) { } void addAccelerator ( ) { } void addAccelerators ( ) { } public void addArmListener ( ArmListener listener ) { } public void addHelpListener ( HelpListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } void createHandle ( int index ) { } void destroyWidget ( ) { } public int getAccelerator ( ) { } public boolean getEnabled ( ) { } public Menu getMenu ( ) { } String getNameText ( ) { } public Menu getParent ( ) { } public boolean getSelection ( ) { } void hookEvents ( ) { } boolean isAccelActive ( ) { Menu menu = parent ; <START_BUG> while ( ( menu != null ) && ( ( menu . cascade ) != null ) ) { <END_BUG> menu = menu . cascade . parent ; } Decorations shell = menu . parent ; return ( shell . menuBar ) == menu ; } public boolean isEnabled ( ) { } String keysymName ( int keysym ) { } void manageChildren ( ) { } void releaseChild ( ) { } void releaseWidget ( ) { } void removeAccelerator ( ) { } void removeAccelerators ( ) { } public void removeArmListener ( ArmListener listener ) { } public void removeHelpListener ( HelpListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } void selectRadio ( ) { } public void setAccelerator ( int accelerator ) { } public void setEnabled ( boolean enabled ) { } public void setMenu ( Menu menu ) { } boolean setRadioSelection ( boolean value ) { } public void setSelection ( boolean selected ) { } public void setText ( String string ) { } boolean translateAccelerator ( int accel , boolean doit ) { } int XmNactivateCallback ( int w , int client_data , int call_data ) { } int XmNarmCallback ( int w , int client_data , int call_data ) { } int XmNcascadingCallback ( int w , int client_data , int call_data ) { } int XmNhelpCallback ( int w , int client_data , int call_data ) { } int XmNvalueChangedCallback ( int w , int client_data , int call_data ) { } }

Fix:
while ( ( menu . cascade ) != null ) {
Buggy code:
public class CanvasUpdateThread extends Thread { public class PixelsSetEvent { private Image image_ ; public PixelsSetEvent ( Image image ) { } public Image getImage ( ) { } } private Datastore store_ ; private MMVirtualStack stack_ ; private ImagePlus plus_ ; private EventBus displayBus_ ; private LinkedBlockingQueue < Coords > coordsQueue_ ; private AtomicBoolean shouldStop_ ; private Thread displayThread_ ; private int imagesDisplayed_ = 0 ; private long lastImageIndex_ = 0 ; private long lastFPSUpdateTimestamp_ = - 1 ; public CanvasUpdateThread ( Datastore store , MMVirtualStack stack , ImagePlus plus , EventBus bus ) { } public void setImagePlus ( ImagePlus plus ) { } @ Override public void run ( ) { } private void showImage ( Image image ) { } private void sendFPSUpdate ( Image image ) { long curTimestamp = System . currentTimeMillis ( ) ; if ( image == null ) { displayBus_ . post ( new FPSEvent ( 0 , 0 ) ) ; return ; } if ( ( lastFPSUpdateTimestamp_ ) == ( - 1 ) ) { lastFPSUpdateTimestamp_ = curTimestamp ; } else if ( ( curTimestamp - ( lastFPSUpdateTimestamp_ ) ) >= 500 ) { double elapsedTime = ( curTimestamp - ( lastFPSUpdateTimestamp_ ) ) // 1000.0 ; try { <START_BUG> Integer imageIndex = image . getMetadata ( ) . getImageNumber ( ) ; <END_BUG> if ( imageIndex != null ) { if ( ( lastImageIndex_ ) != 0 ) { displayBus_ . post ( new FPSEvent ( ( ( imageIndex - ( lastImageIndex_ ) ) // elapsedTime ) , ( ( imagesDisplayed_ ) // elapsedTime ) ) ) ; } lastImageIndex_ = imageIndex ; } } catch ( Exception e ) { displayBus_ . post ( new FPSEvent ( 0 , 0 ) ) ; } imagesDisplayed_ = 0 ; lastFPSUpdateTimestamp_ = curTimestamp ; } } public void stopDisplayUpdates ( ) { } public void addCoords ( Coords coords ) { } @ Subscribe public void onDisplayDestroyed ( DisplayDestroyedEvent event ) { } }

Fix:
Long imageIndex = image . getMetadata ( ) . getImageNumber ( ) ;
Buggy code:
public class CoreSdkLocationResolver implements IDynamicVariableResolver { public String resolveValue ( IDynamicVariable variable , String argument ) throws CoreException { } private String findStrategies ( ) { } private String findShippedCoreSDK ( ) { } private String findInstalledCoreSDK ( ) { String os = Platform . getOS ( ) ; Path possiblePath = null ; if ( os . equals ( Platform . OS_WIN32 ) ) { <START_BUG> possiblePath = new Path ( "C:\\Program<seq2seq4repair_space>Files\\Sausalito<seq2seq4repair_space>CoreSDK<seq2seq4repair_space>1.0.0" ) ; <END_BUG> } else { possiblePath = new Path ( "//opt//sausalito" ) ; } return locateScriptIn ( possiblePath ) ; } private String locateScriptIn ( IPath coreSdkPath ) { } public static IStatus log ( int severity , String message , Throwable t ) { } }

Fix:
possiblePath = new Path ( "C:\\Program<seq2seq4repair_space>Files\\Sausalito<seq2seq4repair_space>CoreSDK<seq2seq4repair_space>1.0.12" ) ;
Buggy code:
public class App1Test2 { private static final Log log = LogFactory . getLog ( App1Test2 . class ) ; public static void main ( String [ ] args ) throws Exception { <START_BUG> List < String > gets = Arrays . asList ( new String [ ] { "//app1?wicket:bookmarkablePage=one:org.apache.wicket.threadtest.apps.app1.Home" } ) ; <END_BUG> SimpleGetCommand getCmd = new SimpleGetCommand ( gets , 5 ) ; Tester tester = new Tester ( getCmd , 100 , false ) ; tester . run ( ) ; } }

Fix:
List < String > gets = Arrays . asList ( new String [ ] { "//app1//wicket//bookmarkable//org.apache.wicket.threadtest.apps.app1.Home" } ) ;
Buggy code:
public class TestRegexpRandom extends LuceneTestCase { private IndexSearcher searcher ; private IndexReader reader ; private Directory dir ; @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; dir = newDirectory ( ) ; RandomIndexWriter writer = new RandomIndexWriter ( random , dir , newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ) ) . setMaxBufferedDocs ( _TestUtil . nextInt ( random , 50 , 1000 ) ) ) ; Document doc = new Document ( ) ; FieldType customType = new FieldType ( TextField . TYPE_STORED ) ; customType . setOmitNorms ( true ) ; Field field = newField ( "field" , "" , customType ) ; doc . add ( field ) ; NumberFormat df = new DecimalFormat ( "000" , new DecimalFormatSymbols ( Locale . ENGLISH ) ) ; for ( int i = 0 ; i < 1000 ; i ++ ) { <START_BUG> field . setValue ( df . format ( i ) ) ; <END_BUG> writer . addDocument ( doc ) ; } reader = writer . getReader ( ) ; writer . close ( ) ; searcher = newSearcher ( reader ) ; } private char N ( ) { } private String fillPattern ( String wildcardPattern ) { } private void assertPatternHits ( String pattern , int numHits ) throws Exception { } @ Override public void tearDown ( ) throws Exception { } public void testRegexps ( ) throws Exception { } }

Fix:
field . setStringValue ( df . format ( i ) ) ;
Buggy code:
public class NowPlayingFilesListActivity extends AppCompatActivity implements IItemListViewContainer { private ListView mFileListView ; private ProgressBar mLoadingProgressBar ; private ViewAnimator viewAnimator ; private NowPlayingFloatingActionButton nowPlayingFloatingActionButton ; @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; final ActionBar actionBar = getSupportActionBar ( ) ; if ( actionBar != null ) actionBar . setDisplayHomeAsUpEnabled ( true ) ; setContentView ( activity_view_items ) ; mFileListView = ( ( ListView ) ( findViewById ( lvItems ) ) ) ; mLoadingProgressBar = ( ( ProgressBar ) ( findViewById ( pbLoadingItems ) ) ) ; this . setTitle ( title_view_now_playing_files ) ; LibrarySession . GetActiveLibrary ( this , new NowPlayingFilesListActivity . OnGetLibraryNowComplete ( this , mFileListView , mLoadingProgressBar ) ) ; <START_BUG> nowPlayingFloatingActionButton = NowPlayingFloatingActionButton . addNowPlayingFloatingActionButton ( ( ( RelativeLayout ) ( findViewById ( rlViewFiles ) ) ) ) ; <END_BUG> } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public void onStart ( ) { } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public void updateViewAnimator ( ViewAnimator viewAnimator ) { } @ Override public NowPlayingFloatingActionButton getNowPlayingFloatingActionButton ( ) { } private static class OnGetLibraryNowComplete implements TwoParameterRunnable < FluentTask < Integer , Void , Library > , Library > { private final NowPlayingFilesListActivity mNowPlayingFilesListActivity ; private final ListView mFileListView ; private final ProgressBar mLoadingProgressBar ; public OnGetLibraryNowComplete ( NowPlayingFilesListActivity nowPlayingFilesListActivity , ListView fileListView , ProgressBar loadingProgressBar ) { } @ Override public void run ( FluentTask < Integer , Void , Library > owner , final Library library ) { } } public void setViewAnimator ( ViewAnimator viewAnimator ) { } @ Override public void onBackPressed ( ) { } }

Fix:
nowPlayingFloatingActionButton = NowPlayingFloatingActionButton . addNowPlayingFloatingActionButton ( ( ( RelativeLayout ) ( findViewById ( rlViewItems ) ) ) ) ;
Buggy code:
public class ObjectFactory { private static ObjectFactory FACTORY = null ; private static Parser PARSER = null ; protected ObjectFactory ( ) { } public static ObjectFactory getInstance ( ) { } public synchronized Status parseBytes ( byte [ ] bytes ) { } public Status parseString ( String content ) { } public Status parseSampleResult ( SampleResult result ) { } public Status createStatus ( ) { } public Connector createConnector ( ) { } public Jvm createJvm ( ) { } public Memory createMemory ( ) { } public RequestInfo createRequestInfo ( ) { } public ThreadInfo createThreadInfo ( ) { } public Worker createWorker ( ) { } public Workers createWorkers ( ) { } protected class MonitorParser extends ParserImpl { public MonitorParser ( ObjectFactory factory ) { } } public static void main ( String [ ] args ) { <START_BUG> if ( ( args != null ) & ( ( args . length ) == 2 ) ) { <END_BUG> String file = null ; if ( ( args [ 0 ] ) != null ) { file = args [ 0 ] ; } if ( ( args [ 1 ] ) != null ) { } try { ObjectFactory of = ObjectFactory . getInstance ( ) ; File infile = new File ( file ) ; FileInputStream fis = new FileInputStream ( infile ) ; InputStreamReader isr = new InputStreamReader ( fis ) ; StringBuffer buf = new StringBuffer ( ) ; BufferedReader br = new BufferedReader ( isr ) ; String line = null ; while ( ( line = br . readLine ( ) ) != null ) { buf . append ( line ) ; } System . out . println ( "contents:<seq2seq4repair_space>" ) ; System . out . println ( buf . toString ( ) ) ; System . out . println ( "----------------------" ) ; Status st = of . parseBytes ( buf . toString ( ) . getBytes ( ) ) ; if ( st == null ) { System . out . println ( "parse<seq2seq4repair_space>failed" ) ; } else { System . out . println ( "parse<seq2seq4repair_space>successful:" ) ; System . out . println ( st . getJvm ( ) . getMemory ( ) . getFree ( ) ) ; System . out . println ( st . getJvm ( ) . getMemory ( ) . getTotal ( ) ) ; System . out . println ( st . getJvm ( ) . getMemory ( ) . getMax ( ) ) ; System . out . println ( ( "connector<seq2seq4repair_space>size:<seq2seq4repair_space>" + ( st . getConnector ( ) . size ( ) ) ) ) ; Connector conn = ( ( Connector ) ( st . getConnector ( ) . get ( 0 ) ) ) ; System . out . println ( ( "conn:<seq2seq4repair_space>" + ( conn . getThreadInfo ( ) . getMaxThreads ( ) ) ) ) ; } } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } else { } } }

Fix:
if ( ( args != null ) && ( ( args . length ) == 2 ) ) {
Buggy code:
class VariableBinding implements IVariableBinding { private static final int VALID_MODIFIERS = ( ( ( ( ( ( Modifier . PUBLIC ) | ( Modifier . PROTECTED ) ) | ( Modifier . PRIVATE ) ) | ( Modifier . STATIC ) ) | ( Modifier . FINAL ) ) | ( Modifier . TRANSIENT ) ) | ( Modifier . VOLATILE ) ; private org . eclipse . jdt . internal . compiler . lookup . VariableBinding binding ; private ITypeBinding declaringClass ; private String key ; private String name ; private BindingResolver resolver ; private ITypeBinding type ; VariableBinding ( BindingResolver resolver , org . eclipse . jdt . internal . compiler . lookup . VariableBinding binding ) { } public Object getConstantValue ( ) { if ( ! ( this . binding . isConstantValue ( ) ) ) return null ; Constant c = this . binding . constant ( ) ; if ( c == null ) return null ; switch ( c . typeID ( ) ) { case TypeIds . T_boolean : return Boolean . valueOf ( c . booleanValue ( ) ) ; case TypeIds . T_byte : return new Byte ( c . byteValue ( ) ) ; case TypeIds . T_char : return new Character ( c . charValue ( ) ) ; case TypeIds . T_double : return new Double ( c . doubleValue ( ) ) ; case TypeIds . T_float : return new Float ( c . floatValue ( ) ) ; case TypeIds . T_int : return new Integer ( c . intValue ( ) ) ; case TypeIds . T_long : return new Long ( c . longValue ( ) ) ; case TypeIds . T_short : return new Short ( c . shortValue ( ) ) ; <START_BUG> case T_String : <END_BUG> return c . stringValue ( ) ; } return null ; } public ITypeBinding getDeclaringClass ( ) { } public IMethodBinding getDeclaringMethod ( ) { } public IJavaElement getJavaElement ( ) { } public String getKey ( ) { } public int getKind ( ) { } public int getModifiers ( ) { } public String getName ( ) { } public ITypeBinding getType ( ) { } public int getVariableId ( ) { } public boolean isDeprecated ( ) { } public boolean isEqualTo ( IBinding other ) { } public boolean isField ( ) { } public boolean isSynthetic ( ) { } public String toString ( ) { } }

Fix:
case TypeIds . T_JavaLangString :
Buggy code:
public class OperationType { public static enum COMMAND_TYPE { ADD_TASK , EDIT_TASK , INVALID , SEARCH_TASK , DELETE_TASK , UNDO , BACK , CHANGEDIR , CLEAR , DONE , UNDONE ; } public static OperationType . COMMAND_TYPE determineCommandType ( String commandTypeString ) { if ( commandTypeString == null ) throw new Error ( "command<seq2seq4repair_space>type<seq2seq4repair_space>string<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>null!" ) ; if ( ( commandTypeString . equalsIgnoreCase ( "add" ) ) || ( commandTypeString . equalsIgnoreCase ( "create" ) ) ) { return OperationType . COMMAND_TYPE . ADD_TASK ; } else if ( commandTypeString . equalsIgnoreCase ( "delete" ) ) { return OperationType . COMMAND_TYPE . DELETE_TASK ; } else if ( ( commandTypeString . equalsIgnoreCase ( "edit" ) ) || ( commandTypeString . equalsIgnoreCase ( "update" ) ) ) { return OperationType . COMMAND_TYPE . EDIT_TASK ; } else if ( commandTypeString . equalsIgnoreCase ( "search" ) ) { return OperationType . COMMAND_TYPE . SEARCH_TASK ; } else if ( commandTypeString . equalsIgnoreCase ( "undo" ) ) { return OperationType . COMMAND_TYPE . UNDO ; } else if ( commandTypeString . equalsIgnoreCase ( "clear" ) ) { return OperationType . COMMAND_TYPE . CLEAR ; } else if ( commandTypeString . equalsIgnoreCase ( "changedir" ) ) { return OperationType . COMMAND_TYPE . CHANGEDIR ; } else if ( ( commandTypeString . equalsIgnoreCase ( "done" ) ) || ( commandTypeString . equalsIgnoreCase ( "mark" ) ) ) { return OperationType . COMMAND_TYPE . DONE ; } else if ( ( commandTypeString . equalsIgnoreCase ( "undone" ) ) || ( commandTypeString . equalsIgnoreCase ( "unmark" ) ) ) { <START_BUG> return OperationType . COMMAND_TYPE . DONE ; <END_BUG> } else if ( commandTypeString . isEmpty ( ) ) { return OperationType . COMMAND_TYPE . BACK ; } else { return OperationType . COMMAND_TYPE . INVALID ; } } }

Fix:
return OperationType . COMMAND_TYPE . UNDONE ;
Buggy code:
public class DfsProver extends Prover { private static final Logger log = Logger . getLogger ( DfsProver . class ) ; private Backtrace < State > backtrace = new Backtrace < State > ( DfsProver . log ) ; protected boolean trueLoop ; protected boolean restart ; public DfsProver ( ) { } public DfsProver ( APROptions apr ) { } public DfsProver ( FeatureDictWeighter w , APROptions apr ) { } public DfsProver ( FeatureDictWeighter w , APROptions apr , boolean trueLoop , boolean restart ) { } private void init ( ) { } private void init ( boolean trueLoop , boolean restart ) { } public Prover copy ( ) { } protected class Entry { public State state ; public double w ; public Entry ( State s , Double d ) { } } protected List < DfsProver . Entry > dfs ( ProofGraph pg , State s , int depth ) throws LogicProgramException { } protected void dfs ( ProofGraph pg , State s , int depth , double incomingEdgeWeight , List < DfsProver . Entry > tail ) throws LogicProgramException { beforeDfs ( s , pg , depth ) ; tail . add ( new DfsProver . Entry ( s , incomingEdgeWeight ) ) ; if ( ( ! ( s . isCompleted ( ) ) ) && ( depth < ( this . apr . maxDepth ) ) ) { backtrace . push ( s ) ; List < Outlink > outlinks = pg . pgOutlinks ( s , trueLoop , restart ) ; if ( ( outlinks . size ( ) ) == 0 ) if ( DfsProver . log . isDebugEnabled ( ) ) DfsProver . log . debug ( ( "exit<seq2seq4repair_space>dfs:<seq2seq4repair_space>no<seq2seq4repair_space>outlinks<seq2seq4repair_space>for<seq2seq4repair_space>" + s ) ) ; double z = 0 ; Outlink reset = null ; for ( Outlink o : outlinks ) { o . wt = this . weighter . w ( o . fd ) ; z += o . wt ; if ( o . child . equals ( pg . getStartState ( ) ) ) reset = o ; } <START_BUG> if ( reset . fd . containsKey ( ALPHABOOSTER ) ) { <END_BUG> rescaleResetLink ( reset , z ) ; } for ( Outlink o : outlinks ) { dfs ( pg , o . child , ( depth + 1 ) , o . wt , tail ) ; } backtrace . pop ( s ) ; } else if ( DfsProver . log . isDebugEnabled ( ) ) DfsProver . log . debug ( ( "exit<seq2seq4repair_space>dfs:<seq2seq4repair_space>" + ( s . isCompleted ( ) ? "state<seq2seq4repair_space>completed" : ( ( "depth<seq2seq4repair_space>" + depth ) + ">" ) + ( this . apr . maxDepth ) ) ) ) ; } protected void beforeDfs ( State s , ProofGraph pg , int depth ) throws LogicProgramException { } @ Override public Map < State , Double > prove ( ProofGraph pg ) { } }

Fix:
if ( ( restart ) && ( reset . fd . containsKey ( ALPHABOOSTER ) ) ) {
Buggy code:
public class Proxy implements IProxy { private HttpURLConnection mCon ; private Cookie mCookie ; public Proxy ( ) { } public int getPlayerID ( ) { } public String getPlayerName ( ) { } public void setGameCookie ( int gameID ) { } public synchronized String post ( String requestPath , String json ) { String url = "http:////localhost:8081" + requestPath ; URL obj ; try { obj = new URL ( url ) ; mCon = ( ( HttpURLConnection ) ( obj . openConnection ( ) ) ) ; mCon . setDoOutput ( true ) ; mCon . setDoInput ( true ) ; mCon . setRequestProperty ( "Content-Type" , "application//json" ) ; mCon . setRequestProperty ( "Accept" , "application//json" ) ; mCon . setRequestProperty ( "Cookie" , mCookie . getCookie ( ) ) ; mCon . setRequestMethod ( "POST" ) ; OutputStreamWriter wr = new OutputStreamWriter ( mCon . getOutputStream ( ) ) ; wr . write ( json ) ; wr . flush ( ) ; wr . close ( ) ; int responseCode = mCon . getResponseCode ( ) ; if ( responseCode != 200 ) { System . out . println ( ( ( requestPath + "<seq2seq4repair_space>responseCode:" ) + responseCode ) ) ; return ( "Failed<seq2seq4repair_space>with<seq2seq4repair_space>a<seq2seq4repair_space>" + responseCode ) + "<seq2seq4repair_space>response<seq2seq4repair_space>from<seq2seq4repair_space>server." ; } System . out . println ( ( ( ( "Proxy<seq2seq4repair_space>responseCode:" + responseCode ) + "<seq2seq4repair_space>" ) + requestPath ) ) ; BufferedReader in = new BufferedReader ( new InputStreamReader ( mCon . getInputStream ( ) ) ) ; String inputLine ; StringBuffer response = new StringBuffer ( ) ; while ( ( inputLine = in . readLine ( ) ) != null ) { response . append ( inputLine ) ; } in . close ( ) ; <START_BUG> if ( requestPath . equalsIgnoreCase ( "//user//login" ) ) { <END_BUG> String cookieResponse = mCon . getHeaderField ( "Set-cookie" ) ; cookieResponse = cookieResponse . replace ( "catan.user=" , "" ) ; cookieResponse = cookieResponse . replace ( ";Path=//;" , "" ) ; mCookie . setCatanUser ( cookieResponse ) ; } else if ( requestPath . equalsIgnoreCase ( "//games//join" ) ) { String cookieResponse = mCon . getHeaderField ( "Set-cookie" ) ; cookieResponse = cookieResponse . replace ( "catan.game=" , "" ) ; cookieResponse = cookieResponse . replace ( ";Path=//;" , "" ) ; mCookie . setCatanGame ( cookieResponse ) ; } return response . toString ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return "Shouldn't<seq2seq4repair_space>get<seq2seq4repair_space>here1" ; } public synchronized String get ( String requestPath ) { } }

Fix:
if ( ( requestPath . equalsIgnoreCase ( "//user//login" ) ) || ( requestPath . equalsIgnoreCase ( "//user//register" ) ) ) {
Buggy code:
public class RegexCSVColumns { private String [ ] headerNames ; public RegexCSVColumns ( String [ ] headerNames ) { } public void setValue ( Object entity , Field field , String [ ] aRow ) throws IllegalAccessException { } private Set < String > getMatchingHeaders ( String [ ] headerNames , String regexPattern ) { } private List < KeyValue > createKeyValue ( String headerName , String regexPattern , String [ ] aRow ) { List < KeyValue > values = new ArrayList < > ( ) ; for ( int i = 0 ; i < ( headerNames . length ) ; i ++ ) { String name = headerNames [ i ] ; <START_BUG> if ( name . toLowerCase ( ) . startsWith ( headerName . toLowerCase ( ) ) ) { <END_BUG> KeyValue keyValue = new KeyValue ( ) ; keyValue . setKey ( headerName . replace ( regexPattern . replace ( "*" , "" ) , "" ) ) ; keyValue . setValue ( aRow [ i ] ) ; values . add ( keyValue ) ; } } if ( values . isEmpty ( ) ) { throw new MigrationException ( ( "No<seq2seq4repair_space>Column<seq2seq4repair_space>found<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>csv<seq2seq4repair_space>file.<seq2seq4repair_space>" + headerName ) ) ; } return values ; } protected int getPosition ( String headerValueInClass , int startIndex ) { } }

Fix:
if ( name . toLowerCase ( ) . equals ( headerName . toLowerCase ( ) ) ) {
Buggy code:
public class ShowMessagePreviewAction extends AbstractSelectableAction implements Observer { private XmlElement element ; public ShowMessagePreviewAction ( FrameMediator controller ) { } public void actionPerformed ( ActionEvent arg0 ) { } public void update ( Observable arg0 , Object arg1 ) { IDefaultItem item = new org . columba . core . config . DefaultItem ( element ) ; <START_BUG> boolean enabled = item . getBoolean ( "header_enabled" , true ) ; <END_BUG> setState ( enabled ) ; } }

Fix:
boolean enabled = item . getBooleanWithDefault ( "header_enabled" , true ) ;