nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ToolBar extends JToolBar { public ToolBar ( ) { } public JButton add ( Action a ) { } public JButton add ( Action a , String name , String iconResourceStr ) { } public JButton add ( Action a , String name , Icon icon ) { } public JToggleButton addToggle ( Action a ) { } public JToggleButton addToggle ( Action a , String name , String iconResourceStr ) { } public JToggleButton addToggle ( Action a , String name , Icon icon ) { } public JToggleButton addToggle ( Action a , String name , String upRes , String downRes ) { } public ButtonGroup addRadioGroup ( String name1 , ImageIcon oneUp , ImageIcon oneDown , String name2 , ImageIcon twoUp , ImageIcon twoDown ) { } protected PropertyChangeListener createActionToggleListener ( JToggleButton b ) { } private class ActionToggleChangedListener implements PropertyChangeListener { JToggleButton button ; ActionToggleChangedListener ( JToggleButton b ) { } public void propertyChange ( PropertyChangeEvent e ) { } } protected static ImageIcon loadIconResource ( String imgName , String desc ) { } protected static String imageName ( String name ) { } protected static String stripJunk ( String s ) { String res = "" ; int len = s . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { char c = s . charAt ( i ) ; <START_BUG> if ( Character . isJavaLetterOrDigit ( c ) ) <END_BUG> res += c ; } return res ; } }

Fix:
if ( Character . isJavaIdentifierPart ( c ) )
Buggy code:
public class AS7Plugin implements JdrPlugin { private final PluginId pluginId = new PluginId ( "AS7_PLUGIN" , 1 , 0 , null ) ; @ Override public List < JdrCommand > getCommands ( ) throws Exception { Sanitizer xmlSanitizer = Sanitizers . xml ( "////password" ) ; Sanitizer passwordSanitizer = Sanitizers . pattern ( "password=.*" , "password=*" ) ; <START_BUG> return Arrays . asList ( new TreeCommand ( ) , new JarCheck ( ) , new CallAS7 ( "configuration" ) . param ( "recursive" , "true" ) , new CallAS7 ( "dump-services" ) . resource ( "core-service" , "service-container" ) , new CallAS7 ( "cluster-proxies-configuration" ) . resource ( "subsystem" , "modcluster" ) , new CollectFiles ( "*//standalone//configuration//*" ) . sanitizer ( xmlSanitizer , passwordSanitizer ) , new CollectFiles ( "*//domain//configuration//*" ) . sanitizer ( xmlSanitizer , passwordSanitizer ) , new CollectFiles ( "*server.log" ) . limit ( ( 50 * ( Utils . ONE_MB ) ) ) , new CollectFiles ( "*.log" ) . omit ( "*server.log" ) , new CollectFiles ( "*gc.log.*" ) , new CollectFiles ( "*.properties" ) . sanitizer ( passwordSanitizer ) , new CollectFiles ( "*.xml" ) . sanitizer ( xmlSanitizer ) ) ; <END_BUG> } public PluginId getPluginId ( ) { } }

Fix:
return Arrays . asList ( new TreeCommand ( ) , new JarCheck ( ) , new CallAS7 ( "configuration" ) . param ( "recursive" , "true" ) , new CallAS7 ( "dump-services" ) . operation ( "dump-services" ) . resource ( "core-service" , "service-container" ) , new CallAS7 ( "cluster-proxies-configuration" ) . resource ( "subsystem" , "modcluster" ) , new CollectFiles ( "*//standalone//configuration//*" ) . sanitizer ( xmlSanitizer , passwordSanitizer ) , new CollectFiles ( "*//domain//configuration//*" ) . sanitizer ( xmlSanitizer , passwordSanitizer ) , new CollectFiles ( "*server.log" ) . limit ( ( 50 * ( Utils . ONE_MB ) ) ) , new CollectFiles ( "*.log" ) . omit ( "*server.log" ) , new CollectFiles ( "*gc.log.*" ) , new CollectFiles ( "*.properties" ) . sanitizer ( passwordSanitizer ) , new CollectFiles ( "*.xml" ) . sanitizer ( xmlSanitizer ) ) ;
Buggy code:
public class SimpleDOMBuilder extends AbstractDOMBuilder implements ISourceElementRequestor { public void acceptProblem ( IProblem problem ) { } public void acceptImport ( int declarationStart , int declarationEnd , char [ ] name , boolean onDemand , int modifiers ) { } public void acceptPackage ( int declarationStart , int declarationEnd , char [ ] name ) { } public IDOMCompilationUnit createCompilationUnit ( String sourceCode , String name ) { } public IDOMCompilationUnit createCompilationUnit ( ICompilationUnit compilationUnit ) { } protected void enterAbstractMethod ( ISourceElementRequestor . MethodInfo methodInfo ) { } public void enterClass ( ISourceElementRequestor . TypeInfo typeInfo ) { } public void enterConstructor ( ISourceElementRequestor . MethodInfo methodInfo ) { } public void enterEnum ( ISourceElementRequestor . TypeInfo typeInfo ) { } public void enterField ( ISourceElementRequestor . FieldInfo fieldInfo ) { } public void enterInitializer ( int declarationSourceStart , int modifiers ) { } public void enterInterface ( ISourceElementRequestor . TypeInfo typeInfo ) { } public void enterMethod ( ISourceElementRequestor . MethodInfo methodInfo ) { } protected void enterType ( ISourceElementRequestor . TypeInfo typeInfo ) { if ( fBuildingType ) { int [ ] sourceRange = new int [ ] { typeInfo . declarationStart , - 1 } ; int [ ] nameRange = new int [ ] { typeInfo . nameSourceStart , typeInfo . nameSourceEnd } ; <START_BUG> fNode = new DOMType ( fDocument , sourceRange , new String ( typeInfo . name ) , nameRange , typeInfo . modifiers , CharOperation . charArrayToStringArray ( typeInfo . superinterfaces ) , ( ( typeInfo . kind ) == ( CLASS ) ) ) ; <END_BUG> addChild ( fNode ) ; fStack . push ( fNode ) ; } } public void exitClass ( int declarationEnd ) { } public void exitConstructor ( int declarationEnd ) { } public void exitEnum ( int declarationEnd ) { } public void exitField ( int initializationStart , int declarationEnd , int declarationSourceEnd ) { } public void exitInitializer ( int declarationEnd ) { } public void exitInterface ( int declarationEnd ) { } protected void exitMember ( int declarationEnd ) { } public void exitMethod ( int declarationEnd , int defaultValueStart , int defaultValueEnd ) { } protected void exitType ( int declarationEnd ) { } protected SourceElementParser getParser ( Map settings ) { } }

Fix:
fNode = new DOMType ( fDocument , sourceRange , new String ( typeInfo . name ) , nameRange , typeInfo . modifiers , CharOperation . charArrayToStringArray ( typeInfo . superinterfaces ) , ( ( typeInfo . kind ) == ( CLASS_DECL ) ) ) ;
Buggy code:
public class Mubble { String header ; String methName ; String name ; String code ; String packageName ; public Mubble ( String iName , String iHeader ) { } public void setPackageName ( String pack ) { } <START_BUG> public void getPackageName ( ) { <END_BUG> return this . packageName ; } public String extractMethodName ( String in ) { } public String formatMethodHeader ( String in ) { } public String convertPrimitiveType ( String s ) { } public boolean isModifier ( String s ) { } public static String getStringBetween ( String src , String start , String end ) { } public String getHeader ( ) { } public String getMethName ( ) { } public String getName ( ) { } public String getCode ( ) { } }

Fix:
public String getPackageName ( ) {
Buggy code:
public class TestRegexpQuery extends LuceneTestCase { private IndexSearcher searcher ; private IndexReader reader ; private Directory directory ; private final String FN = "field" ; @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; directory = newDirectory ( ) ; RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , directory ) ; Document doc = new Document ( ) ; doc . add ( newTextField ( FN , "the<seq2seq4repair_space>quick<seq2seq4repair_space>brown<seq2seq4repair_space>fox<seq2seq4repair_space>jumps<seq2seq4repair_space>over<seq2seq4repair_space>the<seq2seq4repair_space>lazy<seq2seq4repair_space>???<seq2seq4repair_space>dog<seq2seq4repair_space>493432<seq2seq4repair_space>49344" , NO ) ) ; writer . addDocument ( doc ) ; reader = writer . getReader ( ) ; <START_BUG> writer . close ( ) ; <END_BUG> searcher = newSearcher ( reader ) ; } @ Override public void tearDown ( ) throws Exception { } private Term newTerm ( String value ) { } private int regexQueryNrHits ( String regex ) throws IOException { } public void testRegex1 ( ) throws IOException { } public void testRegex2 ( ) throws IOException { } public void testRegex3 ( ) throws IOException { } public void testNumericRange ( ) throws IOException { } public void testRegexComplement ( ) throws IOException { } public void testCustomProvider ( ) throws IOException { } public void testBacktracking ( ) throws IOException { } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class LoginActivity extends AppMenu { EditText eEmail ; EditText ePassword ; HashMap < String , String > params = new HashMap < > ( ) ; @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void tryLogin ( View view ) { String email = eEmail . getText ( ) . toString ( ) . replaceAll ( "\\s+" , "" ) ; String password = ePassword . getText ( ) . toString ( ) ; params . put ( "email" , email ) ; params . put ( "password" , password ) ; ServerRequest sr = new ServerRequest ( ) ; JSONObject json = sr . getJSON ( LOGIN , ( ( getIpAddress ( ) ) + ":8080//login" ) , params ) ; try { if ( ( json != null ) && ( json . getBoolean ( "res" ) ) ) { Toast . makeText ( getApplication ( ) , json . getString ( "response" ) , LENGTH_SHORT ) . show ( ) ; <START_BUG> JSONObject userinfo = getFileIO ( ) . readUserInformation ( ) ; <END_BUG> userinfo . put ( "email" , email ) ; userinfo . put ( "password" , password ) ; userinfo . put ( "token" , json . getString ( "token" ) ) ; userinfo . put ( "grav" , json . getString ( "grav" ) ) ; getFileIO ( ) . writeUserInformationSaveFile ( userinfo ) ; SharedPreferences sharedPrefProf = getSharedPreferences ( getString ( profile_preferences ) , MODE_PRIVATE ) ; SharedPreferences . Editor edit = sharedPrefProf . edit ( ) ; edit . putBoolean ( getString ( isLoggedInn ) , Boolean . TRUE ) ; edit . commit ( ) ; goTo ( MainMenuController . class ) ; } else if ( ( json != null ) && ( ! ( json . getBoolean ( "res" ) ) ) ) { Toast . makeText ( getApplication ( ) , json . getString ( "response" ) , LENGTH_SHORT ) . show ( ) ; } else { Toast . makeText ( getApplication ( ) , getString ( restart_app ) , LENGTH_LONG ) . show ( ) ; } } catch ( JSONException e ) { e . printStackTrace ( ) ; } } public void goToRegister ( View view ) { } public void resetPassword ( View view ) { } }

Fix:
JSONObject userinfo = new JSONObject ( ) ;
Buggy code:
@ Mojo ( name = "generate-springmvc-api-docs" , requiresDependencyResolution = ResolutionScope . COMPILE_PLUS_RUNTIME , threadSafe = true ) public class SpringMvcRamlApiSyncMojo extends CommonApiSyncMojo { @ Parameter ( required = true , readonly = true ) protected String outputRamlFilePath ; @ Parameter ( required = true , readonly = true ) protected String restBasePath ; @ Parameter ( required = false , readonly = true , defaultValue = "false" ) protected Boolean restrictOnMediaType ; @ SuppressWarnings ( "unchecked" ) @ Override protected Class < ? extends Annotation > [ ] getSupportedClassAnnotations ( ) { } protected void generateRaml ( ) throws IOException , MojoExecutionException , MojoFailureException { } public String getFullRamlOutputPath ( ) { } public void execute ( ) throws MojoExecutionException , MojoFailureException { long startTime = System . currentTimeMillis ( ) ; if ( project . getPackaging ( ) . equals ( "pom" ) ) { this . getLog ( ) . info ( ( "Skipping<seq2seq4repair_space>[pom]<seq2seq4repair_space>project:<seq2seq4repair_space>" + ( project . getName ( ) ) ) ) ; } else if ( project . getPackaging ( ) . equals ( "maven-plugin" ) ) { this . getLog ( ) . info ( ( "Skipping<seq2seq4repair_space>[maven-plugin]<seq2seq4repair_space>project:<seq2seq4repair_space>" + ( project . getName ( ) ) ) ) ; } else if ( ! ( Files . isDirectory ( Paths . get ( project . getBuild ( ) . getSourceDirectory ( ) ) , LinkOption . NOFOLLOW_LINKS ) ) ) { this . getLog ( ) . info ( ( "Skipping<seq2seq4repair_space>project<seq2seq4repair_space>with<seq2seq4repair_space>missing<seq2seq4repair_space>src<seq2seq4repair_space>folder:<seq2seq4repair_space>" + ( project . getName ( ) ) ) ) ; } else { try { generateRaml ( ) ; } catch ( IOException e ) { ClassLoaderUtils . restoreOriginalClassLoader ( ) ; <START_BUG> throw new MojoExecutionException ( e , "Unexpected<seq2seq4repair_space>exception<seq2seq4repair_space>while<seq2seq4repair_space>executing<seq2seq4repair_space>security<seq2seq4repair_space>enforcer." , e . toString ( ) ) ; <END_BUG> } } this . getLog ( ) . info ( ( ( "Raml<seq2seq4repair_space>Generation<seq2seq4repair_space>Complete<seq2seq4repair_space>in:" + ( ( System . currentTimeMillis ( ) ) - startTime ) ) + "ms" ) ) ; } }

Fix:
throw new MojoExecutionException ( e , "Unexpected<seq2seq4repair_space>exception<seq2seq4repair_space>while<seq2seq4repair_space>executing<seq2seq4repair_space>Raml<seq2seq4repair_space>Sync<seq2seq4repair_space>Plugin." , e . toString ( ) ) ;
Buggy code:
@ Mojo ( name = "os-check" ) public class OpenSourceLicenseCheckMojo extends AbstractMojo { private static final Locale LOCALE = Locale . ENGLISH ; @ Component RepositorySystem repoSystem ; @ Component final MavenProject project = null ; @ Parameter ( defaultValue = "${repositorySystemSession}" ) RepositorySystemSession repoSession ; @ Parameter ( defaultValue = "${project.remotePluginRepositories}" ) List < RemoteRepository > remoteRepos ; @ Parameter ( property = "os-check.recursion-limit" , defaultValue = "12" ) int maxSearchDepth ; @ Parameter ( property = "os-check.excludes" ) String [ ] excludes ; @ Parameter ( property = "os-check.excludesRegex" ) String [ ] excludesRegex ; @ Parameter ( property = "os-check.blacklist" ) String [ ] blacklist ; @ Parameter ( property = "os-check.whitelist" ) String [ ] whitelist ; @ Parameter ( property = "os-check.excludedScopes" ) String [ ] excludedScopes ; List < LicenseDescriptor > descriptors = null ; public void execute ( ) throws MojoExecutionException , MojoFailureException { } Set < String > getAsLowerCaseSet ( final String [ ] src ) { } List < Pattern > getAsPatternList ( final String [ ] src ) { } String toCoordinates ( Artifact artifact ) { } String recurseForLicenseName ( final Artifact artifact , final int currentDepth ) { } String readPomContents ( final String path ) { } String extractLicenseName ( final String raw ) { } String extractParentCoords ( final String raw ) { } Artifact retrieveArtifact ( final String coordinates ) { } String convertLicenseNameToCode ( final String licenseName ) { } void loadDescriptors ( ) { } boolean artifactIsOnExcludeList ( final Set < String > excludeSet , final List < Pattern > patternList , final Set < String > excludedScopes , final Artifact artifact ) { } boolean isExcludedTemplate ( final Set < String > excludeSet , final List < Pattern > patternList , final String template ) { } boolean isContained ( final Set < String > set , final String template ) { <START_BUG> if ( ( set != null ) || ( template != null ) ) { <END_BUG> return set . contains ( template . toLowerCase ( OpenSourceLicenseCheckMojo . LOCALE ) ) ; } return false ; } }

Fix:
if ( ( set != null ) && ( template != null ) ) {
Buggy code:
public abstract class DistanceReader { public short getDistance ( int globalRow , int globalCol ) { } public static DistanceReader readRowRange ( String fname , int startRow , int numRows , int globalColCount , ByteOrder endianness , boolean mmap ) throws IOException { if ( mmap ) { try ( FileChannel fc = ( ( FileChannel ) ( Files . newByteChannel ( Paths . get ( fname ) , StandardOpenOption . READ ) ) ) ) { long pos = ( ( ( long ) ( startRow ) ) * globalColCount ) * 2 ; <START_BUG> MappedByteBuffer mappedBytes = fc . map ( FileChannel . MapMode . READ_ONLY , pos , ( ( numRows * globalColCount ) * 2L ) ) ; <END_BUG> mappedBytes . order ( endianness ) ; return new DistanceReader ( ) { @ Override public short getDistance ( int globalRow , int globalCol ) { int pos = ( ( globalRow - startRow ) * globalColCount ) + globalCol ; return mappedBytes . getShort ( ( pos * 2 ) ) ; } } ; } } else { try ( FileInputStream fis = new FileInputStream ( fname ) ) { DataInput di = ( endianness == ( ByteOrder . BIG_ENDIAN ) ) ? new DataInputStream ( fis ) : new LittleEndianDataInputStream ( fis ) ; int numBytesToSkip = ( startRow * globalColCount ) * ( Short . BYTES ) ; int skippedBytes = di . skipBytes ( numBytesToSkip ) ; if ( skippedBytes != numBytesToSkip ) throw new IOException ( Constants . errWrongNumOfBytesSkipped ( numBytesToSkip , skippedBytes ) ) ; short [ ] [ ] buffer = new short [ numRows ] [ ] ; for ( int i = 0 ; i < numRows ; ++ i ) { buffer [ i ] = new short [ globalColCount ] ; for ( int j = 0 ; j < globalColCount ; ++ j ) { buffer [ i ] [ j ] = di . readShort ( ) ; } } return new DistanceReader ( ) { @ Override public short getDistance ( int globalRow , int globalCol ) { int localRow = globalRow - startRow ; return buffer [ localRow ] [ globalCol ] ; } } ; } } } }

Fix:
MappedByteBuffer mappedBytes = fc . map ( FileChannel . MapMode . READ_ONLY , pos , ( ( ( ( long ) ( numRows ) ) * globalColCount ) * 2 ) ) ;
Buggy code:
public class ManagementPermissionAuthorizer implements Authorizer { private static final Action FAKE_JMX_ACTION = new Action ( Util . createOperation ( "test" , EMPTY_ADDRESS ) , null ) ; private final PermissionFactory permissionFactory ; private final JmxPermissionFactory jmxPermissionFactory ; public ManagementPermissionAuthorizer ( PermissionFactory permissionFactory , JmxPermissionFactory jmxPermissionFactory ) { } @ Override public AuthorizerDescription getDescription ( ) { } @ Override public AuthorizationResult authorize ( Caller caller , Environment callEnvironment , Action action , TargetAttribute target ) { } @ Override public AuthorizationResult authorize ( Caller caller , Environment callEnvironment , Action action , TargetResource target ) { } private AuthorizationResult authorize ( PermissionCollection userPermissions , PermissionCollection requiredPermissions ) { } @ Override public AuthorizationResult authorizeJmxOperation ( Caller caller , Environment callEnvironment , JmxAction action ) { } @ Override <START_BUG> public Set < String > getCallerRoles ( Caller caller , Environment callEnvironment , Set < String > runAsroles ) { <END_BUG> return null ; } private AuthorizationResult authorize ( Set < String > callerRoles , StandardRole ... roles ) { } }

Fix:
public Set < String > getCallerRoles ( Caller caller , Environment callEnvironment , Set < String > runAsRoles ) {
Buggy code:
public class FibManagerProvider implements AutoCloseable , BindingAwareProvider , IFibManager { private static final Logger LOG = LoggerFactory . getLogger ( FibManagerProvider . class ) ; private FibManager fibManager ; private IMdsalApiManager mdsalManager ; private IVpnManager vpnmanager ; private FibNodeCapableListener fibNcListener ; @ Override public void onSessionInitiated ( ProviderContext session ) { } @ Override public void close ( ) throws Exception { } public void setMdsalManager ( IMdsalApiManager mdsalManager ) { } public void setVpnmanager ( IVpnManager vpnmanager ) { } @ Override public void populateFibOnNewDpn ( long dpnId , long vpnId , String rd ) { } @ Override public void cleanUpDpnForVpn ( long dpnId , long vpnId , String rd ) { <START_BUG> fibManager . populateFibOnNewDpn ( dpnId , vpnId , rd ) ; <END_BUG> } }

Fix:
fibManager . cleanUpDpnForVpn ( dpnId , vpnId , rd ) ;
Buggy code:
public class MainActivity extends Activity { AgendaModel model ; Day currentDay ; ListView boxTasksLayout ; ListView boxDayLayout ; ArrayAdapter < iprog . group7 . agendabuilder . model . Activity > adapterBoxTasksLayout ; ArrayAdapter < iprog . group7 . agendabuilder . model . Activity > adapterBoxDayLayout ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void setupActivities ( ) { } public void addTask ( View view ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public class DragTaskListener implements View . OnDragListener { @ Override public boolean onDrag ( View v , DragEvent event ) { final int action = event . getAction ( ) ; switch ( action ) { case DragEvent . ACTION_DRAG_STARTED : if ( event . getClipDescription ( ) . hasMimeType ( MIMETYPE_TEXT_PLAIN ) ) { v . invalidate ( ) ; return true ; } return false ; case DragEvent . ACTION_DRAG_ENTERED : v . invalidate ( ) ; return true ; case DragEvent . ACTION_DRAG_LOCATION : return true ; case DragEvent . ACTION_DRAG_EXITED : v . invalidate ( ) ; return true ; case DragEvent . ACTION_DROP : iprog . group7 . agendabuilder . model . Activity item = ( ( iprog . group7 . agendabuilder . model . Activity ) ( event . getLocalState ( ) ) ) ; List < iprog . group7 . agendabuilder . model . Activity > parkedActivities ; List < iprog . group7 . agendabuilder . model . Activity > dayActivities ; parkedActivities = model . getParkedActivites ( ) ; dayActivities = currentDay . getActivities ( ) ; if ( v == ( boxTasksLayout ) ) { if ( ! ( parkedActivities . contains ( item ) ) ) { <START_BUG> int currentPosition = 1 ; <END_BUG> for ( iprog . group7 . agendabuilder . model . Activity a : dayActivities ) { if ( a == item ) { break ; } currentPosition ++ ; } model . moveActivity ( currentDay , currentPosition , null , parkedActivities . size ( ) ) ; } } else if ( v == ( boxDayLayout ) ) { if ( ! ( dayActivities . contains ( item ) ) ) { int currentPosition = 0 ; for ( iprog . group7 . agendabuilder . model . Activity a : parkedActivities ) { if ( a == item ) { break ; } currentPosition ++ ; } model . moveActivity ( null , currentPosition , currentDay , dayActivities . size ( ) ) ; } } adapterBoxDayLayout . notifyDataSetChanged ( ) ; adapterBoxTasksLayout . notifyDataSetChanged ( ) ; v . invalidate ( ) ; return true ; case DragEvent . ACTION_DRAG_ENDED : v . invalidate ( ) ; return true ; default : break ; } return false ; } } }

Fix:
int currentPosition = 0 ;
Buggy code:
public class NewMemoryFragLayout extends BaseFragment { public interface OnNewMemoryFragmentListener { public void onAddPhotosClicked ( ) { } public void onChangeCoverClicked ( ) { } public void onSaveClicked ( ) { } } private Activity context ; private NewMemoryFragLayout . OnNewMemoryFragmentListener listener ; private View view ; private ArrayList < EditText > friendsEditText = new ArrayList < > ( ) ; private LayoutInflater inflater ; private ImageView coverImageView ; private Photo coverPhoto ; private ImageView image1ImageView ; private ImageView image2ImageView ; private ImageView image3ImageView ; private TextView memoryDatePicker ; private RelativeLayout newPhotoView1 ; private RelativeLayout newPhotoView2 ; private RelativeLayout newPhotoView3 ; private List < String > imagesPaths = new ArrayList < > ( ) ; @ Override public void onAttach ( Activity activity ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } private void initAll ( ) { } private void initTopBar ( ) { ViewGroup topBarLayout = ( ( ViewGroup ) ( view . findViewById ( new_memory_fragment_top_bar ) ) ) ; RelativeLayout backButtonLayout = ( ( RelativeLayout ) ( topBarLayout . findViewById ( topbar_new_memory_back_container ) ) ) ; RelativeLayout doneButtonLayout = ( ( RelativeLayout ) ( topBarLayout . findViewById ( topbar_new_memory_done_container ) ) ) ; backButtonLayout . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { <START_BUG> getActivity ( ) . finish ( ) ; <END_BUG> hideKeyboard ( ) ; } } ) ; doneButtonLayout . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { listener . onSaveClicked ( ) ; hideKeyboard ( ) ; } } ) ; } private void updateView ( ) { } public void initCover ( Photo coverPhoto ) { } private void initFriends ( final ViewGroup finalMemoryItem , final LinearLayout friendsContainer ) { } private void initPhotos ( final ViewGroup finalMemoryItem , final LinearLayout photosContainer ) { } private void openGallery ( ) { } public void updatePhotos ( ) { } private OnDateSetListener datePickerListener = new DatePickerDialog . OnDateSetListener ( ) { public void onDateSet ( DatePicker view , int selectedYear , int selectedMonth , int selectedDay ) { } } ; private void hideKeyboard ( ) { } }

Fix:
( ( example . com . memkeeper . Activities . NewMemoryActivity ) ( context ) ) . onBackPressed ( ) ;
Buggy code:
public class GameScreen implements Screen { Stage stage ; private int timer ; boolean wasTouched ; boolean isTouched ; List < Letter > letters ; List < Letter > lastWord ; int score ; Texture black = new Texture ( "black_dot.png" ) ; Group top ; Group middle ; Group back ; @ Override public void show ( ) { } @ Override public void render ( float delta ) { wasTouched = isTouched ; isTouched = input . isTouched ( ) ; if ( ( isTouched ) && ( ! ( wasTouched ) ) ) { WordBuilder . start ( ) ; } else if ( ( ! ( isTouched ) ) && ( wasTouched ) ) { int ts = WordBuilder . stop ( ) ; if ( ts > 0 ) { lastWord = new ArrayList < Letter > ( ) ; for ( Letter l : letters ) { lastWord . add ( l ) ; l . remove ( ) ; } } else { for ( Letter l : letters ) l . activate ( ) ; } letters . clear ( ) ; } if ( isTouched ) { Vector2 tc = stage . screenToStageCoordinates ( new Vector2 ( input . getX ( ) , input . getY ( ) ) ) ; float x = tc . x ; float y = tc . y ; Letter A = ( ( Letter ) ( stage . hit ( x , y , true ) ) ) ; if ( A != null ) { if ( A . isActive ( ) ) { A . deactivate ( ) ; WordBuilder . add ( A ) ; letters . add ( A ) ; } } } if ( ( ( timer ) % 20 ) == 9 ) { Letter L = new Letter ( ( ( int ) ( ( Math . random ( ) ) * 26 ) ) , ( ( int ) ( ( Math . random ( ) ) * ( GdxGame . WIDTH ) ) ) , ( ( int ) ( ( GdxGame . HEIGHT ) + ( 100 * ( GdxGame . H_RATIO ) ) ) ) ) ; L . setZIndex ( 0 ) ; middle . addActor ( L ) ; } int length = lastWord . size ( ) ; if ( ( length > 0 ) && ( length < 10 ) ) { float lspacer = ( Letter . SIZE ) // 16.0F ; float spacer = ( ( Letter . SIZE ) * ( 9 - length ) ) // 2.0F ; <START_BUG> int space = ( GdxGame . REN_WIDTH ) // 9 ; <END_BUG> int count = 0 ; for ( Letter l : lastWord ) { float x = ( ( int ) ( ( spacer + ( count * space ) ) + lspacer ) ) ; float y = lspacer ; top . addActor ( new Letter ( l . getLetterVal ( ) , x , y ) ) ; System . out . print ( l ) ; System . out . println ( ( ( x + "<seq2seq4repair_space>" ) + y ) ) ; count ++ ; } } stage . act ( ) ; gl20 . glClearColor ( 0 , 0 , 0 , 1 ) ; gl . glClear ( GL_COLOR_BUFFER_BIT ) ; stage . draw ( ) ; wasTouched = isTouched ; isTouched = input . isTouched ( ) ; ( timer ) ++ ; } @ Override public void resize ( int width , int height ) { } @ Override public void pause ( ) { } @ Override public void resume ( ) { } @ Override public void hide ( ) { } @ Override public void dispose ( ) { } }

Fix:
int space = ( GdxGame . WIDTH ) // 9 ;
Buggy code:
public final class YuiLib implements IClusterable { private static final long serialVersionUID = 1L ; private static ResourceReference YUILOADER ; public static void load ( IHeaderResponse response ) { } private static ResourceReference getYuiLoader ( ) { if ( ( YuiLib . YUILOADER ) == null ) { <START_BUG> StringBuffer sb = new StringBuffer ( ) ; <END_BUG> sb . append ( "yuiloader" ) ; if ( Application . get ( ) . usesDeploymentConfig ( ) ) { sb . append ( "-min" ) ; } sb . append ( ".js" ) ; YuiLib . YUILOADER = new CompressedResourceReference ( YuiLib . class , sb . toString ( ) ) ; } return YuiLib . YUILOADER ; } private YuiLib ( ) { } }

Fix:
StringBuilder sb = new StringBuilder ( ) ;
Buggy code:
public class Graph { private ArrayList < LinkedList < Integer > > neighbours ; private int vertexCount ; private int edgeCount ; private int lowerBoundPursuers ; private int upperBoundPursuers ; private int [ ] indegree ; private int [ ] translator ; public Graph ( int [ ] [ ] m ) { } public Graph ( int [ ] [ ] m , int [ ] newToOldTranslator ) { } public Graph ( ArrayList < LinkedList < Integer > > neighbours ) { } public ArrayList < LinkedList < Integer > > getAdjacencyList ( ) { } public int getVertexCount ( ) { } public int getEdgeCount ( ) { } public ArrayList < LinkedList < Integer > > getCycles ( ) { } private void dfs ( int previous , int current , boolean [ ] visited , boolean [ ] traversed , LinkedList < Integer > path , ArrayList < LinkedList < Integer > > cycles ) { } private LinkedList < Integer > extractCycle ( LinkedList < Integer > path ) { } public HashSet < Integer > intersect ( LinkedList < Integer > a , LinkedList < Integer > b ) { } public int getLowerBoundNrOfPursuers ( ) { } private int [ ] getIndegree ( ) { } public int getEstimateNrOfPursuers ( ) { } public int getUpperBoundNrOfPursuers ( ) { } private boolean validEstimatePathExists ( int v_0 , int x , int maxInDegree , final int [ ] indegree ) { } private boolean dfsEstimate ( int v_i , int x , int i , int maxInDegree , boolean [ ] visited , final int [ ] indegree ) { } public int [ ] [ ] getAdjacencyMatrix ( ) { } public Graph [ ] getStrongComponents ( ) { } private Graph [ ] getSubgraphs ( List < Integer > [ ] partitions ) { } private Integer getComponent ( int vertex , ArrayList < HashSet < Integer > > sets ) { } private void buildStrongComponent ( int vertex , boolean [ ] visited , LinkedList < Integer > path , int [ ] comp , int compNumber ) { } private void markPath ( int [ ] comp , int compNumber , LinkedList < Integer > path ) { } @ Override public String toString ( ) { if ( ( this . getEdgeCount ( ) ) == 0 ) return "no<seq2seq4repair_space>edges\n" ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < ( neighbours . size ( ) ) ; i ++ ) { LinkedList < Integer > queue = neighbours . get ( i ) ; if ( queue . isEmpty ( ) ) continue ; Collections . sort ( queue ) ; for ( int neighbour : queue ) { <START_BUG> sb . append ( ( ( ( ( i + 1 ) + "<seq2seq4repair_space>--><seq2seq4repair_space>" ) + ( neighbour + 1 ) ) + "\n" ) ) ; <END_BUG> } } return sb . toString ( ) ; } public int translate ( int vertex ) { } }

Fix:
sb . append ( ( ( ( ( ( translate ( i ) ) + 1 ) + "<seq2seq4repair_space>--><seq2seq4repair_space>" ) + ( ( translate ( neighbour ) ) + 1 ) ) + "\n" ) ) ;
Buggy code:
public class FixCrLfTest extends BuildFileTest { public FixCrLfTest ( String name ) { } public void setUp ( ) { } public void tearDown ( ) { } public void test1 ( ) throws IOException { } public void test2 ( ) throws IOException { } public void test3 ( ) throws IOException { } public void test4 ( ) throws IOException { } public void test5 ( ) throws IOException { } public void test6 ( ) throws IOException { } public void test7 ( ) throws IOException { } public void test8 ( ) throws IOException { } public void test9 ( ) throws IOException { } public void testMacLines ( ) throws IOException { } public void testNoOverwrite ( ) throws IOException { executeTarget ( "test1" ) ; File result = new File ( System . getProperty ( "root" ) , "src//etc//testcases//taskdefs//fixcrlf//result//Junk1.java" ) ; long modTime = result . lastModified ( ) ; try { <START_BUG> Thread . currentThread ( ) . sleep ( 5000 ) ; <END_BUG> } catch ( InterruptedException ie ) { fail ( ie . getMessage ( ) ) ; } configureProject ( "src//etc//testcases//taskdefs//fixcrlf//build.xml" ) ; executeTarget ( "test1" ) ; result = new File ( System . getProperty ( "root" ) , "src//etc//testcases//taskdefs//fixcrlf//result//Junk1.java" ) ; assertEquals ( modTime , result . lastModified ( ) ) ; } public void testEncoding ( ) throws IOException { } public void testLongLines ( ) throws IOException { } public void testCrCrLfSequenceUnix ( ) throws IOException { } public void testCrCrLfSequenceDos ( ) throws IOException { } public void testCrCrLfSequenceMac ( ) throws IOException { } public void testFixlastDos ( ) throws IOException { } public void testFixlastFalseMac ( ) throws IOException { } public void testCreateParentDirs ( ) { } public void assertEqualContent ( File expect , File result ) throws IOException , AssertionFailedError { } }

Fix:
Thread . sleep ( 5000 ) ;
Buggy code:
public abstract class ReferenceManager < G > implements Closeable { private static final String REFERENCE_MANAGER_IS_CLOSED_MSG = "this<seq2seq4repair_space>ReferenceManager<seq2seq4repair_space>is<seq2seq4repair_space>closed" ; protected volatile G current ; private final Lock refreshLock = new ReentrantLock ( ) ; private void ensureOpen ( ) { } private synchronized void swapReference ( G newReference ) throws IOException { } protected abstract void decRef ( G reference ) throws IOException { } protected abstract G refreshIfNeeded ( G referenceToRefresh ) throws IOException { } protected abstract boolean tryIncRef ( G reference ) { } public final G acquire ( ) { } public final synchronized void close ( ) throws IOException { } protected void afterClose ( ) throws IOException { } private void doMaybeRefresh ( ) throws IOException { } public final boolean maybeRefresh ( ) throws IOException { } public final void maybeRefreshBlocking ( ) throws IOException , InterruptedException { ensureOpen ( ) ; refreshLock . lock ( ) ; try { doMaybeRefresh ( ) ; } finally { <START_BUG> refreshLock . lock ( ) ; <END_BUG> } } protected void afterRefresh ( ) throws IOException { } public final void release ( G reference ) throws IOException { } }

Fix:
refreshLock . unlock ( ) ;
Buggy code:
public class RunTimeGui extends AbstractControllerGui implements ActionListener { private static final long serialVersionUID = 240L ; private JTextField seconds ; private boolean displayName = true ; public RunTimeGui ( ) { } public RunTimeGui ( boolean displayName ) { } @ Override public void configure ( TestElement element ) { } public TestElement createTestElement ( ) { } public void modifyTestElement ( TestElement lc ) { } @ Override public void clearGui ( ) { } public void actionPerformed ( ActionEvent event ) { } public String getLabelResource ( ) { } private void init ( ) { } private JPanel createLoopCountPanel ( ) { } private void setState ( String secsCount ) { } private void setState ( long secsCount ) { seconds . setEnabled ( true ) ; <START_BUG> seconds . setText ( ( "" + secsCount ) ) ; <END_BUG> } }

Fix:
seconds . setText ( Long . toString ( secsCount ) ) ;
Buggy code:
public class TestPolynomial { private static int coeff ; private static int exp ; private static String coeffStr = "" ; private static String expStr = "" ; private static String choiceStr = "" ; public static void main ( String [ ] args ) { } public static void readPoly ( ) { BufferedReader con1 = new BufferedReader ( new InputStreamReader ( System . in ) ) ; System . out . println ( "Press<seq2seq4repair_space>\"x\"<seq2seq4repair_space>to<seq2seq4repair_space>Exit." ) ; System . out . println ( "Enter<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>coeffecent<seq2seq4repair_space>integer<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>next<seq2seq4repair_space>term:<seq2seq4repair_space>" ) ; try { TestPolynomial . coeffStr = con1 . readLine ( ) ; } catch ( IOException e ) { System . out . println ( TestPolynomial . coeffStr ) ; e . printStackTrace ( ) ; } <START_BUG> if ( TestPolynomial . coeffStr . equalsIgnoreCase ( "t" ) ) <END_BUG> System . exit ( 0 ) ; TestPolynomial . coeff = Integer . valueOf ( TestPolynomial . coeffStr ) ; System . out . println ( "\nEnter<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>exponent<seq2seq4repair_space>integer<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>next<seq2seq4repair_space>term:<seq2seq4repair_space>" ) ; try { TestPolynomial . expStr = con1 . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } if ( TestPolynomial . expStr . equalsIgnoreCase ( "x" ) ) System . exit ( 0 ) ; TestPolynomial . exp = Integer . valueOf ( TestPolynomial . expStr ) ; System . out . println ( "Press<seq2seq4repair_space>A<seq2seq4repair_space>to<seq2seq4repair_space>Add<seq2seq4repair_space>or<seq2seq4repair_space>M<seq2seq4repair_space>to<seq2seq4repair_space>multiply<seq2seq4repair_space>this<seq2seq4repair_space>term?" ) ; try { TestPolynomial . choiceStr = con1 . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } No newline ; at end ; of file ; }

Fix:
if ( TestPolynomial . coeffStr . equalsIgnoreCase ( "x" ) )
Buggy code:
public class HandlerEnable implements OperationStepHandler { static final HandlerEnable INSTANCE = new HandlerEnable ( ) ; public void execute ( final OperationContext context , ModelNode operation ) { final PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; final String name = address . getLastElement ( ) . getValue ( ) ; if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { context . addStep ( new OperationStepHandler ( ) { public void execute ( final OperationContext context , ModelNode operation ) { <START_BUG> final ServiceRegistry serviceRegistry = context . getServiceRegistry ( false ) ; <END_BUG> final ServiceController < ? > controller = serviceRegistry . getService ( LogServices . handlerName ( name ) ) ; if ( controller != null ) { controller . addListener ( new org . jboss . msc . service . AbstractServiceListener < Object > ( ) { public void listenerAdded ( ServiceController < ? > serviceController ) { serviceController . setMode ( ACTIVE ) ; } public void serviceStarted ( ServiceController < ? > serviceController ) { context . completeStep ( ) ; } } ) ; } else { context . completeStep ( ) ; } context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
final ServiceRegistry serviceRegistry = context . getServiceRegistry ( true ) ;
Buggy code:
public class InfoFragment extends Fragment { public static ArrayList < WeedPlant > weedArray ; View view ; @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { FragmentManager mFragmentMgr = getChildFragmentManager ( ) ; FragmentTransaction mTransaction = mFragmentMgr . beginTransaction ( ) ; mTransaction . add ( new BlankFragment ( ) , "viewFrag" ) ; mTransaction . commit ( ) ; View rootView = inflater . inflate ( activity_info , container , false ) ; view = rootView ; InfoFragment . weedArray = wr . weedArray ; ListView lv = ( ( ListView ) ( view . findViewById ( listView1 ) ) ) ; WeedPlant [ ] plantList = InfoFragment . weedArray . toArray ( new WeedPlant [ InfoFragment . weedArray . size ( ) ] ) ; String [ ] [ ] plantStrList = new String [ WeedService . wr . weedArray . size ( ) ] [ 3 ] ; for ( int i = 0 ; i < ( plantList . length ) ; i ++ ) { plantStrList [ i ] [ 0 ] = "Plant<seq2seq4repair_space>" + ( i + 1 ) ; plantStrList [ i ] [ 1 ] = ( "Water:<seq2seq4repair_space>" + ( WeedService . wr . weedArray . get ( i ) . getWater ( ) ) ) + "%" ; plantStrList [ i ] [ 2 ] = WeedService . wr . weedArray . get ( i ) . getGrowth ( ) ; } HashMap < String , String > item ; List < HashMap < String , String > > list = new ArrayList < HashMap < String , String > > ( ) ; for ( int i = 0 ; i < ( WeedService . wr . weedArray . size ( ) ) ; i ++ ) { item = new HashMap < String , String > ( ) ; item . put ( "line1" , plantStrList [ i ] [ 0 ] ) ; item . put ( "line2" , plantStrList [ i ] [ 1 ] ) ; <START_BUG> item . put ( "line3" , plantStrList [ i ] [ 2 ] ) ; <END_BUG> list . add ( item ) ; } lv . setAdapter ( new com . ocelotworks . weedsim . adapter . MultilineArrayAdapter ( this . getActivity ( ) , list ) ) ; viewPlant ( ) ; lv . setOnItemClickListener ( new OnItemClickListener ( ) { @ Override public void onItemClick ( AdapterView < ? > parent , View view , int arg2 , long arg3 ) { FragmentManager mFragmentMgr = getChildFragmentManager ( ) ; FragmentTransaction mTransaction = mFragmentMgr . beginTransaction ( ) ; Fragment childFragment = mFragmentMgr . findFragmentByTag ( "viewFrag" ) ; if ( childFragment != null ) { mTransaction . remove ( childFragment ) ; } mTransaction . add ( linearLayout13 , new PlantInfoFragment ( arg2 ) , "viewFrag" ) ; mTransaction . commit ( ) ; getActivity ( ) . getActionBar ( ) . setTitle ( ( "Plant<seq2seq4repair_space>Status<seq2seq4repair_space>-<seq2seq4repair_space>Plant<seq2seq4repair_space>" + ( arg2 + 1 ) ) ) ; } } ) ; isRunning = true ; startLoop ( ) ; return rootView ; } private void viewPlant ( ) { } @ Override public void onSaveInstanceState ( Bundle outsave ) { } public void handleWater ( ) { } public void handleHarvest ( ) { } protected ListView getListView ( ) { } private boolean isRunning = false ; private void startLoop ( ) { } }

Fix:
item . put ( "line3" , plantStrList [ i ] [ 2 ] . substring ( 0 , ( ( plantStrList [ i ] [ 2 ] . length ( ) ) - 2 ) ) ) ;
Buggy code:
public final class Iterators { private Iterators ( ) { } public interface Getter { Iterator get ( Object target ) { } } public interface Filter { Iterator filter ( Iterator in ) { } } public static Iterators . Filter dupFilter ( ) { } public static Iterator array ( final Object [ ] o ) { return new Iterator ( ) { int i = 0 ; <START_BUG> int len = o . length ; <END_BUG> public boolean hasNext ( ) { return ( i ) < ( len ) ; } public Object next ( ) { if ( ( i ) < ( len ) ) { return o [ ( ( i ) ++ ) ] ; } else { throw new NoSuchElementException ( ) ; } } public void remove ( ) { throw new UnsupportedOperationException ( ) ; } } ; } public static Iterator mapOver ( final Iterator a , final Iterators . Getter g ) { } public static Iterator recur ( final Object a , final Iterators . Getter g ) { } public static Iterator append ( final Iterator a , final Iterator b ) { } public static Iterator append1 ( final Iterator a , final Iterator b ) { } public static Iterator snoc ( final Iterator first , final Object last ) { } public static Iterator one ( final Object it ) { } public static final Iterator EMPTY = new Iterator ( ) { public boolean hasNext ( ) { } public Object next ( ) { } public void remove ( ) { } } ; }

Fix:
int len = ( o == null ) ? 0 : o . length ;
Buggy code:
public class SocketBindingAdd extends AbstractSocketBindingUpdate { private static final long serialVersionUID = - 4940876367809265620L ; private final String name ; private final int port ; private boolean fixedPort ; private int multicastPort ; private InetAddress multicastAddress ; private String interfaceName ; public SocketBindingAdd ( String name , int port ) { } SocketBindingAdd ( SocketBindingElement original ) { } public AbstractSocketBindingUpdate getCompensatingUpdate ( SocketBindingGroupElement original ) { } protected void applyUpdate ( SocketBindingGroupElement group ) throws UpdateFailedException { <START_BUG> final SocketBindingElement socketBinding = new SocketBindingElement ( name , group . getInterfaceResolver ( ) , group . getDefaultInterface ( ) ) ; <END_BUG> socketBinding . setConfiguredInterfaceName ( interfaceName ) ; socketBinding . setFixedPort ( fixedPort ) ; socketBinding . setPort ( port ) ; socketBinding . setMulticastAddress ( multicastAddress ) ; socketBinding . setMulticastPort ( multicastPort ) ; socketBinding . setDefaultInterfaceName ( group . getDefaultInterface ( ) ) ; if ( group . addSocketBinding ( name , socketBinding ) ) { throw new UpdateFailedException ( String . format ( "duplicate<seq2seq4repair_space>socket-binding<seq2seq4repair_space>(%s)<seq2seq4repair_space>in<seq2seq4repair_space>binding-group<seq2seq4repair_space>(%s)" , name , group . getName ( ) ) ) ; } } protected < P > void applyUpdate ( UpdateContext updateContext , UpdateResultHandler < ? super Void , P > resultHandler , P param ) { } public String getName ( ) { } public int getPort ( ) { } public boolean isFixedPort ( ) { } public void setFixedPort ( boolean fixedPort ) { } public int getMulticastPort ( ) { } public void setMulticastPort ( int multicastPort ) { } public InetAddress getMulticastAddress ( ) { } public void setMulticastAddress ( InetAddress multicastAddress ) { } public String getInterfaceName ( ) { } public void setInterfaceName ( String interfaceName ) { } }

Fix:
final SocketBindingElement socketBinding = new SocketBindingElement ( name , group . getDefaultInterface ( ) ) ;
Buggy code:
public class Game { private final Player host ; private final List < Player > players ; private final Player playingPlayer ; private final List < Team > teams ; private final Map map ; private final GameSettings gameSettings ; private final TurnLogic turnLogic ; private boolean turnState ; public Game ( GameSettings gameSettings , Map map , List < Player > players , Player playingPlayer , Player host ) { } public List < Player > getPlayers ( ) { } public Player getPlayer ( String ip ) { } public Player getPlayer ( int index ) { } public Player getPlayingPlayer ( ) { } public Player getHost ( ) { } public List < Team > getTeams ( ) { } public Team getTeam ( int index ) { } public Team getActiveTeam ( ) { } public Map getMap ( ) { } public Boolean getTurnState ( ) { } public void beginTurn ( ) { } public void beginTurnReceive ( Vector2 windForce ) { } public void setActiveUnit ( Team team ) { } public void endTurn ( ) { <START_BUG> if ( ( playingPlayer . getID ( ) ) == ( getActiveTeam ( ) . getPlayer ( ) . getID ( ) ) ) { <END_BUG> GameStage gameStage = ( ( GameStage ) ( teams . get ( 0 ) . getUnit ( 0 ) . getStage ( ) ) ) ; int unitCount = 0 ; NetworkMessage syncUnitsMsg = new NetworkMessage ( Command . SYNCUNITS ) ; for ( Team team : teams ) { for ( Unit unit : team . getUnits ( ) ) { syncUnitsMsg . addParameter ( ( ( "u" + unitCount ) + "x" ) , Float . toString ( unit . getPosition ( ) . x ) ) ; syncUnitsMsg . addParameter ( ( ( "u" + unitCount ) + "y" ) , Float . toString ( unit . getPosition ( ) . y ) ) ; syncUnitsMsg . addParameter ( ( ( "u" + unitCount ) + "hp" ) , Integer . toString ( unit . getHealth ( ) ) ) ; unitCount ++ ; } } gameStage . getNetworkingUtil ( ) . sendToHost ( syncUnitsMsg ) ; NetworkMessage endTurnMsg = new NetworkMessage ( Command . ENDTURN ) ; gameStage . getNetworkingUtil ( ) . sendToHost ( endTurnMsg ) ; } } public void endTurnReceive ( ) { } public void update ( Float deltaTime ) { } public GameSettings getGameSettings ( ) { } public TurnLogic getTurnLogic ( ) { } }

Fix:
if ( ( playingPlayer . getId ( ) ) == ( getActiveTeam ( ) . getPlayer ( ) . getId ( ) ) ) {