nus-yam/ex-repair huggingface dataset:
Buggy code:
public class CovReport extends Task { private File home = null ; private String format = null ; private File tofile = null ; private String type = null ; private Integer percent = null ; private String filters = null ; private File snapshot = null ; private Path sourcePath = null ; private boolean includeSource = true ; private Path coveragePath = null ; private CovReport . Reference reference = null ; public CovReport ( ) { } public void setFilters ( String values ) { } public void setFormat ( CovReport . ReportFormat value ) { } public void setHome ( File value ) { } public void setIncludesource ( boolean value ) { } public void setPercent ( Integer value ) { } public void setSnapshot ( File value ) { } public void setTofile ( File value ) { } public void setType ( CovReport . ReportType value ) { } public Path createCoveragepath ( ) { } public CovReport . Reference createReference ( ) { } public Path createSourcepath ( ) { } public void execute ( ) throws TaskException { } protected String [ ] getParameters ( ) throws TaskException { Vector v = new Vector ( ) ; if ( ( format ) != null ) { v . addElement ( ( "-format=" + ( format ) ) ) ; } if ( ( type ) != null ) { v . addElement ( ( "-type=" + ( type ) ) ) ; } if ( ( percent ) != null ) { v . addElement ( ( "-percent=" + ( percent ) ) ) ; } if ( ( filters ) != null ) { v . addElement ( ( "-filters=" + ( filters ) ) ) ; } v . addElement ( ( "-output=" + ( resolveFile ( tofile . getPath ( ) ) ) ) ) ; v . addElement ( ( "-snapshot=" + ( resolveFile ( snapshot . getPath ( ) ) ) ) ) ; if ( ( sourcePath ) == null ) { sourcePath = new Path ( project ) ; <START_BUG> sourcePath . createPath ( ) . setLocation ( resolveFile ( "." ) ) ; <END_BUG> } v . addElement ( ( "-sourcepath=" + ( sourcePath ) ) ) ; if ( ( "verydetailed" . equalsIgnoreCase ( format ) ) && ( "xml" . equalsIgnoreCase ( type ) ) ) { v . addElement ( ( "-inc_src_text=" + ( includeSource ? "on" : "off" ) ) ) ; } String [ ] params = new String [ v . size ( ) ] ; v . copyInto ( params ) ; return params ; } protected void checkOptions ( ) throws TaskException { } public static class ReportFormat extends EnumeratedAttribute { public String [ ] getValues ( ) { } } public static class ReportType extends EnumeratedAttribute { public String [ ] getValues ( ) { } } public class Reference { protected Path classPath ; protected ReportFilters filters ; public Path createClasspath ( ) { } public ReportFilters createFilters ( ) { } protected void createEnhancedXMLReport ( ) throws TaskException { } } }

Fix:
sourcePath . createPath ( ) . setLocation ( getBaseDirectory ( ) ) ;
Buggy code:
public class ToolBarXMLDecoder { private static final Logger LOG = Logger . getLogger ( "org.columba.core.gui.menu" ) ; private IExtensionHandler pluginHandler ; private IFrameMediator mediator ; public ToolBarXMLDecoder ( IFrameMediator mediator ) { } public ExtendableToolBar createToolBar ( InputStream is ) { } public void extendToolBar ( ExtendableToolBar toolBar , InputStream is ) { AbstractColumbaAction cancelAction = getAction ( "Cancel" , mediator ) ; JButton button = ToolBarButtonFactory . createButton ( cancelAction ) ; toolBar . add ( button ) ; Document doc = retrieveDocument ( is ) ; Element toolBarElement = doc . getRootElement ( ) ; if ( ( toolBarElement . getName ( ) . equals ( "toolbar" ) ) == false ) { <START_BUG> ToolBarXMLDecoder . LOG . severe ( "root<seq2seq4repair_space>element<seq2seq4repair_space><toolbar><seq2seq4repair_space>expected" ) ; <END_BUG> return ; } Iterator it = toolBarElement . getChildren ( ) . listIterator ( ) ; while ( it . hasNext ( ) ) { Element menuElement = ( ( Element ) ( it . next ( ) ) ) ; if ( menuElement . getName ( ) . equals ( "button" ) ) { String actionId = menuElement . getAttributeValue ( "id" ) ; if ( actionId == null ) actionId = menuElement . getAttributeValue ( "action" ) ; if ( actionId . equals ( "Cancel" ) ) continue ; AbstractColumbaAction action = getAction ( actionId , mediator ) ; if ( action == null ) continue ; toolBar . add ( action ) ; } else if ( menuElement . getName ( ) . equals ( "separator" ) ) { toolBar . addSeparator ( ) ; } else ToolBarXMLDecoder . LOG . severe ( ( ( "unkown<seq2seq4repair_space>element<seq2seq4repair_space>tag<seq2seq4repair_space><" + ( menuElement . getName ( ) ) ) + ">" ) ) ; } } private AbstractColumbaAction getAction ( String id , IFrameMediator frameMediator ) { } private Document retrieveDocument ( InputStream is ) { } }

Fix:
ToolBarXMLDecoder . LOG . severe ( ( "root<seq2seq4repair_space>element<seq2seq4repair_space><toolbar><seq2seq4repair_space>expected,<seq2seq4repair_space>but<seq2seq4repair_space>was<seq2seq4repair_space>" + ( toolBarElement . getName ( ) ) ) ) ;
Buggy code:
public class Ant1CompatBuilder { protected void _init ( BuildHelper helper ) { helper . setProperty ( "src.dir" , "src" ) ; helper . setProperty ( "lib.dir" , "lib" ) ; helper . setProperty ( "java.dir" , "${src.dir}//java" ) ; helper . setProperty ( "bin.dir" , "bin" ) ; helper . setProperty ( "dist.dir" , "dist" ) ; helper . setProperty ( "javadocs.dir" , "${dist.dir}//javadocs" ) ; helper . setProperty ( "distlib.dir" , "${dist.dir}//lib" ) ; helper . setProperty ( "debug" , "true" ) ; helper . setProperty ( "ant.package" , "org//apache//tools//ant" ) ; helper . setProperty ( "optional.package" , "${ant.package}//taskdefs//optional" ) ; helper . setProperty ( "optional.type.package" , "${ant.package}//types//optional" ) ; helper . setProperty ( "util.package" , "${ant.package}//util" ) ; helper . setProperty ( "regexp.package" , "${util.package}//regexp" ) ; helper . createPath ( "classpath" ) ; helper . addFileSetToPath ( "classpath" , "${lib.dir}//parser" , "*.jar" ) ; helper . addFileSetToPath ( "classpath" , "${lib.dir}//ant1compat" , "*.jar" ) ; helper . addPathElementToPath ( "classpath" , "${distlib.dir}//init.jar" ) ; helper . addPathElementToPath ( "classpath" , "${distlib.dir}//common//common.jar" ) ; <START_BUG> helper . addPathElementToPath ( "classpath" , "${distlib.dir}//antlibs//system.tsk" ) ; <END_BUG> } protected void check_for_optional_packages ( BuildHelper helper ) { } protected void ant1compat ( BuildHelper helper ) { } protected void clean ( BuildHelper helper ) { } }

Fix:
helper . addPathElementToPath ( "classpath" , "${distlib.dir}//antlibs//system.jar" ) ;
Buggy code:
public class MatlabShim { private MatlabShim ( ) { } public static String fileGet ( String url , String filePath , String ... headers ) throws IOException { } public static String [ ] filePut ( String url , File source , String ... headers ) throws IOException { } public static String head ( String url , String ... headers ) throws IOException { } public static String [ ] jsonGet ( String url , String ... headers ) throws IOException { } public static String [ ] jsonPost ( String url , String requestBody , String ... headers ) throws IOException { } public static String [ ] jsonPut ( String url , String requestBody , String ... headers ) throws IOException { } public static String [ ] multipartPost ( String url , String [ ] requestParts , String ... headers ) throws IOException { try ( CloseableHttpClient client = HttpClients . createDefault ( ) ) { HttpPost request = new HttpPost ( url ) ; request . setHeader ( "Accept" , APPLICATION_JSON . toString ( ) ) ; for ( int i = 0 ; i < ( headers . length ) ; i += 2 ) { request . setHeader ( headers [ i ] , headers [ ( i + 1 ) ] ) ; } MultipartEntityBuilder builder = MultipartEntityBuilder . create ( ) ; for ( String part : requestParts ) { <START_BUG> String [ ] partParts = part . split ( "\n" , 2 ) ; <END_BUG> if ( ( partParts . length ) != 3 ) { throw new IllegalArgumentException ( ( ( ( ( "RequestPart<seq2seq4repair_space>" + ( MatlabShim . prettifyRequestPart ( part ) ) ) + "<seq2seq4repair_space>has<seq2seq4repair_space>" ) + ( partParts . length ) ) + "<seq2seq4repair_space>lines<seq2seq4repair_space>(expected<seq2seq4repair_space>3)." ) ) ; } String partType = partParts [ 0 ] ; String partName = partParts [ 1 ] ; String partBody = partParts [ 2 ] ; switch ( partType ) { case "file" : FileBody fileBody = new FileBody ( new File ( partBody ) ) ; builder . addPart ( partName , fileBody ) ; break ; case "json" : StringBody jsonBody = new StringBody ( partBody , ContentType . APPLICATION_JSON ) ; builder . addPart ( partName , jsonBody ) ; break ; case "string" : StringBody stringBody = new StringBody ( partBody , ContentType . DEFAULT_TEXT ) ; builder . addPart ( partName , ( ( ContentBody ) ( stringBody ) ) ) ; break ; default : throw new IllegalArgumentException ( ( ( "RequestPart<seq2seq4repair_space>" + ( MatlabShim . prettifyRequestPart ( part ) ) ) + "<seq2seq4repair_space>has<seq2seq4repair_space>an<seq2seq4repair_space>unsupported<seq2seq4repair_space>type<seq2seq4repair_space>(expected<seq2seq4repair_space>\"file\",<seq2seq4repair_space>\"json\",<seq2seq4repair_space>or<seq2seq4repair_space>\"string\")." ) ) ; } } request . setEntity ( builder . build ( ) ) ; try ( CloseableHttpResponse response = client . execute ( request ) ) { int statusCode = response . getStatusLine ( ) . getStatusCode ( ) ; String responseBody = EntityUtils . toString ( response . getEntity ( ) ) ; String [ ] returnVal = new String [ ] { Integer . toString ( statusCode ) , responseBody } ; return returnVal ; } } } private static String prettifyRequestPart ( String part ) { } }

Fix:
String [ ] partParts = part . split ( "\n" , 3 ) ;
Buggy code:
public class TexturePanel extends JPanel { private DisplayableImageButton [ ] [ ] textures ; public TexturePanel ( ) { } private void init ( ) { } public void setTexture ( BufferedImage image , boolean gun ) { int index = getTextureIndex ( image . getWidth ( ) ) ; int size = TexturePanel . getTextureSize ( index ) ; <START_BUG> textures [ ( gun ? 0 : 1 ) ] [ index ] . updateImage ( Util . resize ( image , size , size ) ) ; <END_BUG> } public Map < Integer , BufferedImage > getTextures ( boolean gun ) { } public BufferedImage getTexture ( int i , int j ) { } public int getTextureIndex ( int size ) { } public static int getTextureSize ( int index ) { } boolean updateFile ( File file , int i , int j ) { } void updateImage ( BufferedImage image , int i , int j ) { } void selectedFile ( File file , int i , int j ) { } File getFile ( int i , int j ) { } }

Fix:
textures [ ( gun ? 0 : 1 ) ] [ index ] . updateImage ( Util . resizeImage ( image , size , size ) ) ;
Buggy code:
public class AnalyticsRDD extends RDD < Row > implements Serializable { private static final long serialVersionUID = 5948588299500227997L ; private List < String > columns ; private int tenantId ; private String tableName ; public AnalyticsRDD ( int tenantId , String tableName , List < String > columns , SparkContext sc , Seq < Dependency < ? > > deps , ClassTag < Row > evidence ) { } @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) @ Override public Iterator < Row > compute ( Partition split , TaskContext context ) { } private class RowRecordIteratorAdaptor implements Serializable , java . util . Iterator < Row > { private static final long serialVersionUID = - 8866801517386445810L ; private java . util . Iterator < Record > recordItr ; public RowRecordIteratorAdaptor ( java . util . Iterator < Record > recordItr ) { } @ Override public boolean hasNext ( ) { } @ Override public Row next ( ) { } private Row recordToRow ( Record record ) { } @ Override public void remove ( ) { } } @ Override public Partition [ ] getPartitions ( ) { RecordGroup [ ] rgs ; try { rgs = AnalyticsSparkServiceHolder . getAnalyticsDataService ( ) . get ( this . tenantId , this . tableName , this . columns , ( - 1 ) , ( - 1 ) , 0 , Integer . MAX_VALUE ) ; } catch ( AnalyticsException e ) { throw new RuntimeException ( e . getMessage ( ) , e ) ; } Partition [ ] result = new Partition [ rgs . length ] ; for ( int i = 0 ; i < ( result . length ) ; i ++ ) { <START_BUG> result [ i ] = new AnalyticsPartition ( rgs [ i ] ) ; <END_BUG> } return result ; } }

Fix:
result [ i ] = new AnalyticsPartition ( rgs [ i ] , i ) ;
Buggy code:
public class P4Add extends P4Base { private String addCmd = "" ; private Vector filesets = new Vector ( ) ; private int m_cmdLength = 450 ; private int m_changelist ; public void setChangelist ( int changelist ) throws TaskException { } public void setCommandlength ( int len ) throws TaskException { } public void addFileset ( FileSet set ) { } public void execute ( ) throws TaskException { if ( ( P4View ) != null ) { addCmd = P4View ; } P4CmdOpts = ( ( m_changelist ) > 0 ) ? "-c<seq2seq4repair_space>" + ( m_changelist ) : "" ; StringBuffer filelist = new StringBuffer ( ) ; for ( int i = 0 ; i < ( filesets . size ( ) ) ; i ++ ) { FileSet fs = ( ( FileSet ) ( filesets . elementAt ( i ) ) ) ; <START_BUG> DirectoryScanner ds = fs . getDirectoryScanner ( project ) ; <END_BUG> String [ ] srcFiles = ds . getIncludedFiles ( ) ; if ( srcFiles != null ) { for ( int j = 0 ; j < ( srcFiles . length ) ; j ++ ) { File f = new File ( ds . getBasedir ( ) , srcFiles [ j ] ) ; filelist . append ( "<seq2seq4repair_space>" ) . append ( '"' ) . append ( f . getAbsolutePath ( ) ) . append ( '"' ) ; if ( ( filelist . length ( ) ) > ( m_cmdLength ) ) { execP4Add ( filelist ) ; filelist . setLength ( 0 ) ; } } if ( ( filelist . length ( ) ) > 0 ) { execP4Add ( filelist ) ; } } else { log ( "No<seq2seq4repair_space>files<seq2seq4repair_space>specified<seq2seq4repair_space>to<seq2seq4repair_space>add!" , MSG_WARN ) ; } } } private void execP4Add ( StringBuffer list ) { } }

Fix:
DirectoryScanner ds = fs . getDirectoryScanner ( getProject ( ) ) ;
Buggy code:
public class HyperSearchRequest extends WorkRequest { public HyperSearchRequest ( View view , SearchMatcher matcher , HyperSearchResults results , Selection [ ] selection ) { } public void run ( ) { SearchFileSet fileset = SearchAndReplace . getSearchFileSet ( ) ; <START_BUG> setProgressMaximum ( fileset . getFileCount ( ) ) ; <END_BUG> setStatus ( jEdit . getProperty ( "hypersearch.status" ) ) ; int resultCount = 0 ; int bufferCount = 0 ; String [ ] files = fileset . getFiles ( view ) ; try { if ( ( selection ) != null ) { Buffer buffer = jEdit . openTemporary ( null , null , files [ 0 ] , false ) ; if ( buffer == null ) return ; bufferCount = 1 ; resultCount = searchInSelection ( buffer ) ; } else { int current = 0 ; loop : for ( int i = 0 ; i < ( files . length ) ; i ++ ) { setProgressValue ( ( ++ current ) ) ; Buffer buffer = jEdit . openTemporary ( null , null , files [ i ] , false ) ; if ( buffer == null ) continue loop ; int thisResultCount = doHyperSearch ( buffer , 0 , buffer . getLength ( ) ) ; if ( thisResultCount != 0 ) { bufferCount ++ ; resultCount += thisResultCount ; } } } } catch ( final Exception e ) { Log . log ( ERROR , this , e ) ; SwingUtilities . invokeLater ( new Runnable ( ) { public void run ( ) { GUIUtilities . error ( view , "searcherror" , new String [ ] { e . toString ( ) } ) ; } } ) ; } catch ( WorkThread a ) { } finally { final int _resultCount = resultCount ; final int _bufferCount = bufferCount ; VFSManager . runInAWTThread ( new Runnable ( ) { public void run ( ) { results . searchDone ( _resultCount , _bufferCount ) ; } } ) ; } } private View view ; private SearchMatcher matcher ; private HyperSearchResults results ; private DefaultTreeModel resultTreeModel ; private DefaultMutableTreeNode resultTreeRoot ; private Selection [ ] selection ; private int searchInSelection ( Buffer buffer ) throws Exception { } private int doHyperSearch ( Buffer buffer , int start , int end ) throws Exception { } private int doHyperSearch ( Buffer buffer , int start , int end , DefaultMutableTreeNode bufferNode ) { } }

Fix:
setProgressMaximum ( fileset . getFileCount ( view ) ) ;
Buggy code:
public class Common { public static final ResponseCodeHandler MOVED_PERMANENTLY = new ResponseCodeHandler ( 301 ) ; public static final ResponseCodeHandler TEMPORARY_REDIRECT = new ResponseCodeHandler ( 307 ) ; public static final ResponseCodeHandler UNAUTHORIZED = new ResponseCodeHandler ( 403 ) ; public static final ResponseCodeHandler NOT_FOUND = ResponseCodeHandler . HANDLE_404 ; public static final ResponseCodeHandler METHOD_NOT_ALLOWED_HANDLER = new ResponseCodeHandler ( 405 ) ; public static final ResponseCodeHandler UNSUPPORTED_MEDIA_TYPE = new ResponseCodeHandler ( 415 ) ; public static final ResponseCodeHandler INTERNAL_SERVER_ERROR = new ResponseCodeHandler ( 500 ) ; public static final ResponseCodeHandler SERVICE_UNAVAIABLE = new ResponseCodeHandler ( 503 ) ; static final String APPLICATION_DMR_ENCODED = "application//dmr-encoded" ; static final String APPLICATION_JSON = "application//json" ; static final String TEXT_PLAIN = "text//plain" ; static final String TEXT_HTML = "text//html" ; static final int ONE_WEEK = ( ( 7 * 24 ) * 60 ) * 60 ; static String UTF_8 = "utf-8" ; static void sendError ( HttpServerExchange exchange , boolean encode , String msg ) { } static void sendError ( HttpServerExchange exchange , boolean encode , ModelNode msg ) { } private static void sendError ( HttpServerExchange exchange , boolean encode , ModelNode msg , int errorCode ) { if ( encode ) { try { ModelNode response = new ModelNode ( ) ; response . set ( msg ) ; ByteArrayOutputStream bout = new ByteArrayOutputStream ( ) ; response . writeBase64 ( bout ) ; byte [ ] bytes = bout . toByteArray ( ) ; exchange . getResponseHeaders ( ) . put ( CONTENT_TYPE , ( ( ( Common . APPLICATION_DMR_ENCODED ) + ";<seq2seq4repair_space>charset=" ) + ( Common . UTF_8 ) ) ) ; exchange . getResponseHeaders ( ) . put ( CONTENT_LENGTH , String . valueOf ( bytes . length ) ) ; exchange . setResponseCode ( errorCode ) ; exchange . getResponseSender ( ) . send ( new String ( bytes ) , END_EXCHANGE ) ; } catch ( IOException e ) { Common . sendError ( exchange , false , msg ) ; } } else { StringWriter stringWriter = new StringWriter ( ) ; final PrintWriter print = new PrintWriter ( stringWriter ) ; try { msg . writeJSONString ( print , false ) ; } finally { print . flush ( ) ; stringWriter . flush ( ) ; print . close ( ) ; } String msgString = stringWriter . toString ( ) ; byte [ ] bytes = msgString . getBytes ( ) ; <START_BUG> exchange . getResponseHeaders ( ) . put ( CONTENT_TYPE , ( ( ( Common . APPLICATION_JSON ) + ";<seq2seq4repair_space>charset=" ) + ( Common . UTF_8 ) ) ) ; <END_BUG> exchange . getResponseHeaders ( ) . put ( CONTENT_LENGTH , String . valueOf ( bytes . length ) ) ; exchange . setResponseCode ( errorCode ) ; exchange . getResponseSender ( ) . send ( msgString , END_EXCHANGE ) ; } } private static int getErrorResponseCode ( String failureMsg ) { } }

Fix:
exchange . getResponseHeaders ( ) . put ( CONTENT_TYPE , ( ( ( Common . TEXT_PLAIN ) + ";<seq2seq4repair_space>charset=" ) + ( Common . UTF_8 ) ) ) ;
Buggy code:
public final class SignIn extends WicketExamplePage { public SignIn ( ) { } public SignIn ( final PageParameters parameters ) { } public final class SignInForm extends Form { private final ValueMap properties = new ValueMap ( ) ; public SignInForm ( final String componentName , final FeedbackPanel feedback ) { } public final void onSubmit ( ) { SignInSession session = ( ( SignInSession ) ( getSession ( ) ) ) ; if ( session . authenticate ( properties . getString ( "username" ) , properties . getString ( "password" ) ) ) { final RequestCycle cycle = getRequestCycle ( ) ; if ( ! ( cycle . continueToOriginalDestination ( ) ) ) { <START_BUG> cycle . setPage ( new Home ( PageParameters . NULL ) ) ; <END_BUG> } } else { final String errmsg = getLocalizer ( ) . getString ( "loginError" , this , "Unable<seq2seq4repair_space>to<seq2seq4repair_space>sign<seq2seq4repair_space>you<seq2seq4repair_space>in" ) ; error ( errmsg ) ; } } } }

Fix:
cycle . setResponsePage ( new Home ( PageParameters . NULL ) ) ;
Buggy code:
public class PhoneCallBroadcastReceiver extends PhoneCallReceiver { private static AudioManager audioManager = null ; private static int savedMode = AudioManager . MODE_NORMAL ; private static boolean savedSpeakerphone = false ; private static boolean speakerphoneSelected = false ; public static final String BROADCAST_RECEIVER_TYPE = "phoneCall" ; public static final int CALL_EVENT_UNDEFINED = 0 ; public static final int CALL_EVENT_INCOMING_CALL_RINGING = 1 ; public static final int CALL_EVENT_OUTGOING_CALL_STARTED = 2 ; public static final int CALL_EVENT_INCOMING_CALL_ANSWERED = 3 ; public static final int CALL_EVENT_OUTGOING_CALL_ANSWERED = 4 ; public static final int CALL_EVENT_INCOMING_CALL_ENDED = 5 ; public static final int CALL_EVENT_OUTGOING_CALL_ENDED = 6 ; protected boolean onStartReceive ( ) { } protected void onEndReceive ( ) { } private void doCallEvent ( int eventType , String phoneNumber , DataWrapper dataWrapper ) { SharedPreferences preferences = savedContext . getSharedPreferences ( APPLICATION_PREFS_NAME , MODE_PRIVATE ) ; Editor editor = preferences . edit ( ) ; editor . putInt ( PREF_EVENT_CALL_EVENT_TYPE , eventType ) ; editor . putString ( PREF_EVENT_CALL_PHONE_NUMBER , phoneNumber ) ; editor . commit ( ) ; if ( GlobalData . getGlobalEventsRuning ( savedContext ) ) { boolean callEventsExists = ( dataWrapper . getDatabaseHandler ( ) . getTypeEventsCount ( ETYPE_CALL ) ) > 0 ; <START_BUG> if ( callEventsExists ) { <END_BUG> Intent eventsServiceIntent = new Intent ( savedContext , EventsService . class ) ; eventsServiceIntent . putExtra ( EXTRA_BROADCAST_RECEIVER_TYPE , PhoneCallBroadcastReceiver . BROADCAST_RECEIVER_TYPE ) ; startWakefulService ( savedContext , eventsServiceIntent ) ; } } } private void callStarted ( boolean incoming , String phoneNumber ) { } private void callAnswered ( boolean incoming , String phoneNumber ) { } private void setBackNotificationVolume ( DataWrapper dataWrapper ) { } private void callEnded ( boolean incoming , String phoneNumber ) { } protected void onIncomingCallStarted ( String number , Date start ) { } protected void onOutgoingCallStarted ( String number , Date start ) { } protected void onIncomingCallAnswered ( String number , Date start ) { } protected void onOutgoingCallAnswered ( String number , Date start ) { } protected void onIncomingCallEnded ( String number , Date start , Date end ) { } protected void onOutgoingCallEnded ( String number , Date start , Date end ) { } protected void onMissedCall ( String number , Date start ) { } }

Fix:
if ( callEventsExists || ( ( GlobalData . getSeparateVolumes ( savedContext ) ) != 0 ) ) {
Buggy code:
public class GreekAnalyzerTest extends BaseTokenStreamTestCase { public void testAnalyzer ( ) throws Exception { } @ Deprecated public void testAnalyzerBWCompat ( ) throws Exception { } public void testReusableTokenStream ( ) throws Exception { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , new GreekAnalyzer ( TEST_VERSION_CURRENT ) , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } }

Fix:
checkRandomData ( random ( ) , new GreekAnalyzer ( TEST_VERSION_CURRENT ) , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class ModuleAccessesBundleServiceTestCase extends AbstractXServiceTestCase { private static final String TARGET_BUNDLE_NAME = "example-xservice-mab-target-bundle" ; private static final String CLIENT_MODULE_NAME = "example-xservice-mab-client-module" ; @ Inject public ServiceContainer serviceContainer ; @ ArquillianResource public Deployer deployer ; @ ArquillianResource BundleContext context ; @ ArquillianResource PackageAdmin packageAdmin ; @ Deployment public static JavaArchive createdeployment ( ) { final JavaArchive archive = ShrinkWrap . create ( JavaArchive . class , "xservice-module-access" ) ; archive . addClasses ( FrameworkUtils . class , AbstractXServiceTestCase . class ) ; archive . setManifest ( new Asset ( ) { public InputStream openStream ( ) { OSGiManifestBuilder builder = OSGiManifestBuilder . newInstance ( ) ; builder . addBundleSymbolicName ( archive . getName ( ) ) ; builder . addBundleManifestVersion ( 2 ) ; <START_BUG> builder . addImportPackages ( Logger . class , PackageAdmin . class , Module . class ) ; <END_BUG> return builder . openStream ( ) ; } } ) ; return archive ; } @ Test public void moduleInvokesBundleService ( ) throws Exception { } @ Deployment ( name = ModuleAccessesBundleServiceTestCase . CLIENT_MODULE_NAME , managed = false , testable = false ) public static JavaArchive getClientModuleArchive ( ) { } @ Deployment ( name = ModuleAccessesBundleServiceTestCase . TARGET_BUNDLE_NAME , managed = false , testable = false ) public static JavaArchive getTargetBundleArchive ( ) { } }

Fix:
builder . addImportPackages ( Logger . class , PackageAdmin . class , Module . class , ServiceContainer . class ) ;
Buggy code:
public class BattlefieldViewer extends JPanel implements MouseListener { private ActionController actController ; public BattlefieldViewer ( ActionController actController ) { } private void initBattlefieldViewer2 ( ) { this . setLayout ( new GridBagLayout ( ) ) ; this . setBackground ( Color . LIGHT_GRAY ) ; GridBagConstraints c = new GridBagConstraints ( ) ; c . gridx = 0 ; c . gridy = 0 ; <START_BUG> this . actController . getLocalPlayer ( ) . getBattlefield ( ) . setButtonsEnable ( ) ; <END_BUG> this . add ( this . actController . getLocalPlayer ( ) . getBattlefield ( ) . getPanel ( ) , c ) ; c . gridx = 1 ; c . gridy = 1 ; this . actController . getRemotePlayer ( ) . getBattlefield ( ) . setButtonsDisable ( ) ; this . add ( this . actController . getRemotePlayer ( ) . getBattlefield ( ) . getPanel ( ) , c ) ; this . addTilesListener ( ) ; } private void addTilesListener ( ) { } public void mouseClicked ( MouseEvent e ) { } public void mouseEntered ( MouseEvent e ) { } public void mouseExited ( MouseEvent e ) { } public void mousePressed ( MouseEvent e ) { } public void mouseReleased ( MouseEvent e ) { } }

Fix:
this . actController . getLocalPlayer ( ) . getBattlefield ( ) . setButtonsDisable ( ) ;
Buggy code:
public class DeclarePrecedence extends Declare { private TypePatternList patterns ; public DeclarePrecedence ( List patterns ) { } private DeclarePrecedence ( TypePatternList patterns ) { } public Object accept ( PatternNodeVisitor visitor , Object data ) { } public Declare parameterizeWith ( Map typeVariableBindingMap ) { } public String toString ( ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public void write ( DataOutputStream s ) throws IOException { } public static Declare read ( VersionedDataInputStream s , ISourceContext context ) throws IOException { } public void resolve ( IScope scope ) { patterns = patterns . resolveBindings ( scope , NONE , false , false ) ; boolean seenStar = false ; for ( int i = 0 ; i < ( patterns . size ( ) ) ; i ++ ) { TypePattern pi = patterns . get ( i ) ; if ( pi . isStar ( ) ) { if ( seenStar ) { scope . getWorld ( ) . showMessage ( ERROR , WeaverMessages . format ( TWO_STARS_IN_PRECEDENCE ) , pi . getSourceLocation ( ) , null ) ; } seenStar = true ; continue ; } ResolvedType exactType = pi . getExactType ( ) . resolve ( scope . getWorld ( ) ) ; <START_BUG> if ( exactType == ( ResolvedType . MISSING ) ) <END_BUG> continue ; if ( ( ( ! ( exactType . isAspect ( ) ) ) && ( ! ( pi . isIncludeSubtypes ( ) ) ) ) && ( ! ( exactType . isTypeVariableReference ( ) ) ) ) { scope . getWorld ( ) . showMessage ( ERROR , WeaverMessages . format ( CLASSES_IN_PRECEDENCE , exactType . getName ( ) ) , pi . getSourceLocation ( ) , null ) ; } for ( int j = 0 ; j < ( patterns . size ( ) ) ; j ++ ) { if ( j == i ) continue ; TypePattern pj = patterns . get ( j ) ; if ( pj . isStar ( ) ) continue ; if ( pj . matchesStatically ( exactType ) ) { scope . getWorld ( ) . showMessage ( ERROR , WeaverMessages . format ( TWO_PATTERN_MATCHES_IN_PRECEDENCE , exactType . getName ( ) ) , pi . getSourceLocation ( ) , pj . getSourceLocation ( ) ) ; } } } } public TypePatternList getPatterns ( ) { } private int matchingIndex ( ResolvedType a ) { } public int compare ( ResolvedType aspect1 , ResolvedType aspect2 ) { } public boolean isAdviceLike ( ) { } public String getNameSuffix ( ) { } }

Fix:
if ( exactType . isMissing ( ) )
Buggy code:
public class CharacterConverter extends AbstractConverter < Character > { private static final long serialVersionUID = 1L ; public static final IConverter < Character > INSTANCE = new CharacterConverter ( ) ; public Character convertToObject ( final String value , Locale locale ) { int length = value . length ( ) ; if ( length == 0 ) { return null ; } else if ( length == 1 ) { <START_BUG> return new Character ( value . charAt ( 0 ) ) ; <END_BUG> } throw newConversionException ( ( ( "Cannot<seq2seq4repair_space>convert<seq2seq4repair_space>'" + value ) + "'<seq2seq4repair_space>to<seq2seq4repair_space>Character" ) , value , locale ) ; } @ Override protected Class < Character > getTargetType ( ) { } }

Fix:
return value . charAt ( 0 ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ Run ( RunModeType . AS_CLIENT ) public class WarTestCase { @ Deployment public static Archive < ? > getDeployment ( ) { } @ Test public void testServlet ( ) throws Exception { } @ Test public void testLegacyServlet ( ) throws Exception { } private static String performCall ( String urlPattern , String param ) throws Exception { URL url = new URL ( ( ( ( "http:////localhost:8080//war-example//" + urlPattern ) + "?input=" ) + param ) ) ; UrlConnectionTask task = new UrlConnectionTask ( url ) ; <START_BUG> PollingUtils . retryWithTimeout ( 1000 , task ) ; <END_BUG> return task . getResponse ( ) ; } }

Fix:
PollingUtils . retryWithTimeout ( 10000 , task ) ;
Buggy code:
public class Canvas extends Composite { Caret caret ; Canvas ( ) { } public Canvas ( Composite parent , int style ) { } void clearArea ( int x , int y , int width , int height ) { } public Caret getCaret ( ) { } void releaseChildren ( boolean destroy ) { } public void scroll ( int destX , int destY , int x , int y , int width , int height , boolean all ) { } public void setCaret ( Caret caret ) { checkWidget ( ) ; Caret newCaret = caret ; Caret oldCaret = this . caret ; this . caret = newCaret ; <START_BUG> if ( isFocusControl ( ) ) { <END_BUG> if ( oldCaret != null ) oldCaret . killFocus ( ) ; if ( newCaret != null ) { if ( newCaret . isDisposed ( ) ) error ( ERROR_INVALID_ARGUMENT ) ; newCaret . setFocus ( ) ; } } } public void setFont ( Font font ) { } LRESULT WM_INPUTLANGCHANGE ( int wParam , int lParam ) { } LRESULT WM_KILLFOCUS ( int wParam , int lParam ) { } LRESULT WM_SETFOCUS ( int wParam , int lParam ) { } LRESULT WM_SIZE ( int wParam , int lParam ) { } LRESULT WM_WINDOWPOSCHANGED ( int wParam , int lParam ) { } LRESULT WM_WINDOWPOSCHANGING ( int wParam , int lParam ) { } }

Fix:
if ( hasFocus ( ) ) {
Buggy code:
public abstract class AnnotSpringWebApplication extends SpringWebApplication { protected void internalInit ( ) { super . internalInit ( ) ; InjectorHolder . setInjector ( new AnnotSpringInjector ( getSpringContextLocator ( ) ) ) ; <START_BUG> add ( new ComponentInjector ( ) ) ; <END_BUG> } }

Fix:
addComponentInstantiationListener ( new ComponentInjector ( ) ) ;
Buggy code:
public class CookieUtilsTest extends WicketTestCase { @ Override protected void setUp ( ) throws Exception { } @ SuppressWarnings ( { "unchecked" } ) public void test1 ( ) throws Exception { final Page page = tester . getLastRenderedPage ( ) ; final TestForm form = ( ( TestForm ) ( page . get ( "form" ) ) ) ; final TextField < String > textField = ( ( TextField < String > ) ( form . get ( "input" ) ) ) ; assertEquals ( 0 , getRequestCookies ( ) . size ( ) ) ; assertEquals ( 0 , getResponseCookies ( ) . size ( ) ) ; final CookieUtils persister = new CookieUtils ( ) ; persister . remove ( textField ) ; <START_BUG> assertNull ( getRequestCookies ( ) ) ; <END_BUG> assertEquals ( 0 , getResponseCookies ( ) . size ( ) ) ; persister . save ( textField ) ; assertNull ( getRequestCookies ( ) ) ; assertEquals ( 1 , getResponseCookies ( ) . size ( ) ) ; assertEquals ( "test" , getResponseCookies ( ) . get ( 0 ) . getValue ( ) ) ; assertEquals ( "form.input" , getResponseCookies ( ) . get ( 0 ) . getName ( ) ) ; assertEquals ( "//WicketTester$DummyWebApplication//WicketTester$DummyWebApplication" , getResponseCookies ( ) . get ( 0 ) . getPath ( ) ) ; persister . remove ( textField ) ; assertNull ( getRequestCookies ( ) ) ; assertEquals ( 1 , getResponseCookies ( ) . size ( ) ) ; assertEquals ( "test" , getResponseCookies ( ) . get ( 0 ) . getValue ( ) ) ; assertEquals ( "form.input" , getResponseCookies ( ) . get ( 0 ) . getName ( ) ) ; assertEquals ( "//WicketTester$DummyWebApplication//WicketTester$DummyWebApplication" , getResponseCookies ( ) . get ( 0 ) . getPath ( ) ) ; persister . load ( textField ) ; assertEquals ( "test" , textField . getDefaultModelObjectAsString ( ) ) ; assertEquals ( "test" , textField . getDefaultModelObjectAsString ( ) ) ; textField . setDefaultModelObject ( "new<seq2seq4repair_space>text" ) ; assertEquals ( "new<seq2seq4repair_space>text" , textField . getDefaultModelObjectAsString ( ) ) ; copyCookieFromResponseToRequest ( ) ; assertEquals ( 1 , getRequestCookies ( ) . size ( ) ) ; assertEquals ( 1 , getResponseCookies ( ) . size ( ) ) ; persister . load ( textField ) ; assertEquals ( "test" , textField . getDefaultModelObjectAsString ( ) ) ; assertEquals ( 1 , getRequestCookies ( ) . size ( ) ) ; assertEquals ( 1 , getResponseCookies ( ) . size ( ) ) ; persister . remove ( textField ) ; assertEquals ( 1 , getRequestCookies ( ) . size ( ) ) ; assertEquals ( 1 , getResponseCookies ( ) . size ( ) ) ; assertEquals ( "form.input" , getResponseCookies ( ) . get ( 0 ) . getName ( ) ) ; assertEquals ( 0 , getResponseCookies ( ) . get ( 0 ) . getMaxAge ( ) ) ; } private void copyCookieFromResponseToRequest ( ) { } private Collection < Cookie > getRequestCookies ( ) { } private List < Cookie > getResponseCookies ( ) { } }

Fix:
assertEquals ( 0 , getRequestCookies ( ) . size ( ) ) ;
Buggy code:
public class AllocationExpression extends Expression implements InvocationSite { public TypeReference type ; public Expression [ ] arguments ; public MethodBinding binding ; MethodBinding syntheticAccessor ; public TypeReference [ ] typeArguments ; public TypeBinding [ ] genericTypeArguments ; public FieldDeclaration enumConstant ; public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { checkCapturedLocalInitializationIfNecessary ( ( ( ReferenceBinding ) ( this . binding . declaringClass . erasure ( ) ) ) , currentScope , flowInfo ) ; if ( ( this . arguments ) != null ) { for ( int i = 0 , count = this . arguments . length ; i < count ; i ++ ) { flowInfo = this . arguments [ i ] . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; } } ReferenceBinding [ ] thrownExceptions ; if ( ( ( thrownExceptions = this . binding . thrownExceptions ) . length ) != 0 ) { <START_BUG> if ( ( ( this . bits ) & ( ASTNode . Unchecked ) ) != 0 ) { <END_BUG> thrownExceptions = currentScope . environment ( ) . convertToRawTypes ( this . binding . original ( ) . thrownExceptions , true , true ) ; } flowContext . checkExceptionHandlers ( thrownExceptions , this , flowInfo . unconditionalCopy ( ) , currentScope ) ; } manageEnclosingInstanceAccessIfNecessary ( currentScope , flowInfo ) ; manageSyntheticAccessIfNecessary ( currentScope , flowInfo ) ; return flowInfo ; } public void checkCapturedLocalInitializationIfNecessary ( ReferenceBinding checkedType , BlockScope currentScope , FlowInfo flowInfo ) { } public Expression enclosingInstance ( ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public TypeBinding [ ] genericTypeArguments ( ) { } public boolean isSuperAccess ( ) { } public boolean isTypeAccess ( ) { } public void manageEnclosingInstanceAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { } public void setActualReceiverType ( ReferenceBinding receiverType ) { } public void setDepth ( int i ) { } public void setFieldIndex ( int i ) { } public void setUnchecked ( boolean isUnchecked ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
if ( ( ( ( this . bits ) & ( ASTNode . Unchecked ) ) != 0 ) && ( ( this . genericTypeArguments ) == null ) ) {
Buggy code:
public class SaveAllFoldersPlugin implements TaskInterface { public void run ( ) { } public void saveAllFolders ( ) { } public void saveFolder ( FolderTreeNode parentFolder ) { int count = parentFolder . getChildCount ( ) ; FolderTreeNode child ; FolderTreeNode folder ; for ( Enumeration e = parentFolder . children ( ) ; e . hasMoreElements ( ) ; ) { child = ( ( FolderTreeNode ) ( e . nextElement ( ) ) ) ; FolderCommandReference [ ] r = new FolderCommandReference [ 1 ] ; r [ 0 ] = new FolderCommandReference ( child ) ; <START_BUG> log . debug ( ( "saving<seq2seq4repair_space>folder:<seq2seq4repair_space>" + ( child . getName ( ) ) ) ) ; <END_BUG> processor . addOp ( new org . columba . mail . folder . command . SaveFolderConfigurationCommand ( r ) ) ; saveFolder ( child ) ; } } }

Fix:
log . info ( ( "saving<seq2seq4repair_space>folder:<seq2seq4repair_space>" + ( child . getName ( ) ) ) ) ;
Buggy code:
public class Projection implements IProjection { private final ProjectionFactory factory ; private GeometryCoordinateSequenceTransformer transformer ; private GeometryCoordinateSequenceTransformer inverseTransformer ; CoordinateReferenceSystem initialCRS ; Envelope projectedEnv ; final IProjection referenceProjection ; Projection ( final IProjection world , final ProjectionFactory fact ) { } Projection ( final IProjection world , final CoordinateReferenceSystem crs , final Envelope env , final ProjectionFactory fact ) { } @ Override public void createTransformation ( final MathTransform t ) { } @ Override public Geometry transform ( final Geometry g ) { } public Geometry transform ( final Geometry g , final boolean translate ) { } Envelope transform ( final Envelope g , final boolean translate ) { } Envelope transform ( final Envelope g ) { } @ Override public Geometry inverseTransform ( final Geometry g ) { } MathTransform computeProjection ( ) { MathTransform crsTransformation = null ; try { <START_BUG> crsTransformation = CRS . findMathTransform ( initialCRS , getTargetCRS ( ) ) ; <END_BUG> } catch ( FactoryException e ) { e . printStackTrace ( ) ; return null ; } return crsTransformation ; } @ Override public CoordinateReferenceSystem getInitialCRS ( ) { } @ Override public Envelope getProjectedEnvelope ( ) { } @ Override public CoordinateReferenceSystem getTargetCRS ( ) { } @ Override public void translate ( final Geometry geom ) { } @ Override public void inverseTranslate ( final Geometry geom ) { } }

Fix:
crsTransformation = CRS . findMathTransform ( initialCRS , getTargetCRS ( ) , true ) ;
Buggy code:
public class XMPPSNamespace extends Namespace { private static final long serialVersionUID = 390139788867091795L ; private static final String XMPP_PROTOCOL = "xmpps" ; <START_BUG> public ID createInstance ( Class [ ] argTypes , Object [ ] args ) throws IDCreateException { <END_BUG> try { return new XMPPID ( this , ( ( String ) ( args [ 0 ] ) ) ) ; } catch ( Exception e ) { throw new IDCreateException ( "XMPP<seq2seq4repair_space>ID<seq2seq4repair_space>creation<seq2seq4repair_space>exception" , e ) ; } } public String getScheme ( ) { } }

Fix:
public ID createInstance ( Object [ ] args ) throws IDCreateException {
Buggy code:
public class settings extends Activity { EditText localTax ; EditText defaultTipET ; SharedPreferences sharedPreferences ; private static final String PreferancesName = "net.techredesign.uxForTips" ; int tempValue = 0 ; static int theme ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void setTax ( View view ) { } public void setDefaultTip ( View view ) { int tip = 0 ; try { Log . w ( "output" , String . valueOf ( defaultTipET . getText ( ) . toString ( ) ) ) ; tip = Integer . valueOf ( defaultTipET . getText ( ) . toString ( ) ) ; } catch ( Exception couldNotParseInteger ) { Toast . makeText ( getApplicationContext ( ) , faildToParseInt , LENGTH_SHORT ) . show ( ) ; couldNotParseInteger . printStackTrace ( ) ; } tempValue = 0 ; if ( ( sharedPreferences . getInt ( "tip" , 0 ) ) != 0 ) { tempValue = sharedPreferences . getInt ( "tip" , 0 ) ; } final SharedPreferences . Editor editor = sharedPreferences . edit ( ) ; editor . putInt ( "tip" , tip ) ; editor . apply ( ) ; <START_BUG> SnackbarManager . show ( Snackbar . with ( getApplicationContext ( ) ) . text ( getString ( taxSet ) ) . actionLabel ( getString ( undoTax ) ) . colorResource ( accentOrange ) . actionColor ( getResources ( ) . getColor ( accentOrange ) ) . actionListener ( new ActionClickListener ( ) { <END_BUG> @ Override public void onActionClicked ( Snackbar snackbar ) { editor . putInt ( "tip" , tempValue ) ; editor . apply ( ) ; } } ) , this ) ; } }

Fix:
SnackbarManager . show ( Snackbar . with ( getApplicationContext ( ) ) . text ( getString ( tipSet ) ) . actionLabel ( getString ( undoTax ) ) . colorResource ( accentOrange ) . actionColor ( getResources ( ) . getColor ( accentOrange ) ) . actionListener ( new ActionClickListener ( ) {
Buggy code:
public class TileEntityNuclearChamberWall extends AbstractTileEntityNuclearComponent { public List < IMultiBlockable > subList ; public TileEntityNuclearChamberWall ( ) { } @ Override public Block getBlock ( ) { } @ Override public boolean isUnique ( ) { } @ Override public boolean isSubstituable ( ) { } @ Override public int getAmountFromSize ( int width , int height , int depth ) { <START_BUG> return ( ( ( width * height ) * depth ) - 10 ) - ( ( ( width - 2 ) * ( height - 2 ) ) * ( depth - 2 ) ) ; <END_BUG> } @ Override public List < IMultiBlockable > getSubList ( ) { } @ Override public void reset ( ) { } @ Override public void readFromNBT ( NBTTagCompound comp ) { } @ Override public void writeToNBT ( NBTTagCompound comp ) { } }

Fix:
return ( ( ( width * height ) * depth ) - 9 ) - ( ( ( width - 2 ) * ( height - 2 ) ) * ( depth - 2 ) ) ;
Buggy code:
public class Question extends XmlElementUtils { protected String text ; protected int num ; protected int subNum ; protected long numVotes ; protected ArrayList < QuestionAnswer > answers ; protected ArrayList < Question > subQuestions ; public Question ( ) { } public Question ( int num , String txt ) { } public void fill ( Element li ) { } private void getOneAnswer ( Node item ) { } public void addAnswer ( QuestionAnswer ans ) { } public void addSubQuestion ( Question subq ) { } public String toString ( ) { } public void setNum ( int val ) { num = val ; if ( ( subQuestions ) == null ) return ; for ( int i = 0 ; i < ( subQuestions . size ( ) ) ; i ++ ) <START_BUG> subQuestions . get ( i ) . setSubqNum ( val , i ) ; <END_BUG> } public void setSubqNum ( int i ) { } public void setSubqNum ( int n , int subn ) { } public void print ( ) { } private void print ( String prefix ) { } No newline ; at end ; of file ; }

Fix:
subQuestions . get ( i ) . setSubqNum ( val , ( i + 1 ) ) ;
Buggy code:
public class XMLAssertionGui extends AbstractAssertionGui { public XMLAssertionGui ( ) { } public String getLabelResource ( ) { } public TestElement createTestElement ( ) { } public void modifyTestElement ( TestElement el ) { } public void configure ( TestElement el ) { } private void init ( ) { <START_BUG> setLayout ( new VerticalLayout ( 5 , VerticalLayout . LEFT , VerticalLayout . TOP ) ) ; <END_BUG> setBorder ( makeBorder ( ) ) ; add ( makeTitlePanel ( ) ) ; } }

Fix:
setLayout ( new VerticalLayout ( 5 , VerticalLayout . BOTH , VerticalLayout . TOP ) ) ;
Buggy code:
public class Engine { public static final int AI_RANDOM = 0 ; public static final int AI_VERY_EASY = 1 ; public static final int AI_EASY = 2 ; public static final int AI_NORMAL = 3 ; public static FullGameState makeMove ( int difficulty , boolean whiteToMove , FullGameState currentGameState ) { } private static FullGameState makeNormalMove ( FullGameState currentGameState , boolean whiteToMove ) { ArrayList < FullGameState > nextDepth ; if ( whiteToMove ) { nextDepth = MoveGenerator . generateWhiteLegalMoves ( currentGameState ) ; } else { nextDepth = MoveGenerator . generateBlackLegalMoves ( currentGameState ) ; } String nextBookMove = OpeningBook . makeBookMove ( ZobristKey . getKey ( currentGameState ) ) ; if ( ! ( nextBookMove . equals ( "N" ) ) ) { Scanner myScanner = new Scanner ( nextBookMove ) ; myScanner . useDelimiter ( "-" ) ; String one = myScanner . next ( ) ; String two = myScanner . next ( ) ; for ( int i = 0 ; i < ( nextDepth . size ( ) ) ; i ++ ) { if ( ( ( nextDepth . get ( i ) . getFromSquare ( ) ) == ( Integer . parseInt ( one ) ) ) && ( ( nextDepth . get ( i ) . getToSquare ( ) ) == ( Integer . parseInt ( two ) ) ) ) { System . out . println ( "book<seq2seq4repair_space>move<seq2seq4repair_space>made" ) ; myScanner . close ( ) ; return nextDepth . get ( i ) ; } } myScanner . close ( ) ; } else { return Engine . calculateAlphaBeta ( currentGameState , whiteToMove , nextDepth ) ; } <START_BUG> return currentGameState ; <END_BUG> } private static FullGameState calculateAlphaBeta ( FullGameState currentGameState , boolean whiteToMove , ArrayList < FullGameState > nextDepth ) { } private static FullGameState calculateAlphaBeta ( FullGameState currentGameState , boolean whiteToMove ) { } private static long alphaBeta ( FullGameState currentGameState , int depth , long alpha , long beta , boolean whiteToMove ) { } private static FullGameState makeEvaluatedMove ( boolean playingWhite , FullGameState currentGameState ) { } private static FullGameState makeRandomMove ( boolean playingWhite , FullGameState gamestate ) { } private static ArrayList < FullGameState > generateWhiteLegalMoves ( FullGameState gamestate ) { } private static ArrayList < FullGameState > generateBlackLegalMoves ( FullGameState gamestate ) { } public static void printBoard ( char [ ] [ ] board ) { } }

Fix:
return Engine . calculateAlphaBeta ( currentGameState , whiteToMove , nextDepth ) ;
Buggy code:
public class StatsWriter { public static void run ( final String filesDir ) { String eventsFile = filesDir + "//output_events.xml.gz" ; String plansFile = filesDir + "//output_plans.xml.gz" ; String networkFile = filesDir + "//output_network.xml.gz" ; Scenario scenario = LoadMyScenarios . loadScenarioFromPlansAndNetwork ( plansFile , networkFile ) ; EventsManager events = EventsUtils . createEventsManager ( ) ; Vehicle2DriverEventHandler vehicle2Driver = new Vehicle2DriverEventHandler ( ) ; events . addHandler ( vehicle2Driver ) ; final KNAnalysisEventsHandler . Builder builder = new KNAnalysisEventsHandler . Builder ( scenario ) ; final KNAnalysisEventsHandler calcLegTimes = builder . build ( ) ; events . addHandler ( calcLegTimes ) ; new org . matsim . core . events . MatsimEventsReader ( events ) . readFile ( eventsFile ) ; <START_BUG> calcLegTimes . writeStats ( ( filesDir + "//_stats_" ) ) ; <END_BUG> } No newline ; at end ; of file ; }

Fix:
calcLegTimes . writeStats ( ( filesDir + "//analysis//_stats_" ) ) ;
Buggy code:
public abstract class CharSequenceTranslator { public abstract int translate ( CharSequence input , int index , Writer out ) throws IOException { } public final String translate ( CharSequence input ) { } public final void translate ( CharSequence input , Writer out ) throws IOException { if ( out == null ) { throw new IllegalArgumentException ( "The<seq2seq4repair_space>Writer<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; } if ( input == null ) { return ; } int pos = 0 ; int len = input . length ( ) ; while ( pos < len ) { int consumed = translate ( input , pos , out ) ; if ( consumed == 0 ) { char [ ] c = Character . toChars ( Character . codePointAt ( input , pos ) ) ; out . write ( c ) ; pos += c . length ; continue ; } for ( int pt = 0 ; pt < consumed ; pt ++ ) { <START_BUG> pos += Character . charCount ( Character . codePointAt ( input , pos ) ) ; <END_BUG> } } } public final CharSequenceTranslator with ( CharSequenceTranslator ... translators ) { } public static String hex ( int codepoint ) { } }

Fix:
pos += Character . charCount ( Character . codePointAt ( input , pt ) ) ;