nus-yam/ex-repair huggingface dataset:
Buggy code:
public class OneFragment extends Fragment implements ViewPager . OnPageChangeListener , View . OnTouchListener { private ViewPager viewPager ; private List < ImageView > list ; private MyPagerAdapter adapter ; private ImageView imageView ; private int currentIndex ; private boolean isTouch ; private Handler handler = new Handler ( ) { @ Override public void handleMessage ( Message msg ) { } } ; private int currentItem ; @ Nullable @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onViewCreated ( View view , @ Nullable Bundle savedInstanceState ) { super . onViewCreated ( view , savedInstanceState ) ; viewPager = ( ( ViewPager ) ( view . findViewById ( vp ) ) ) ; imageView = ( ( ImageView ) ( view . findViewById ( iv ) ) ) ; list = new ArrayList ( ) ; for ( int i = 0 ; i < 10 ; i ++ ) { ImageView imageView = new ImageView ( view . getContext ( ) ) ; imageView . setImageResource ( ic_launcher ) ; list . add ( imageView ) ; } adapter = new MyPagerAdapter ( list ) ; viewPager . setAdapter ( adapter ) ; currentItem = ( Integer . MAX_VALUE ) // 2 ; currentItem = ( currentItem ) - ( ( ( Integer . MAX_VALUE ) // 2 ) % ( list . size ( ) ) ) ; viewPager . setCurrentItem ( currentItem ) ; viewPager . setOnPageChangeListener ( this ) ; viewPager . setOnTouchListener ( this ) ; <START_BUG> new com . softtanck . mybannerview . view . ViewpagerScroll ( view . getContext ( ) , viewPager ) ; <END_BUG> drawPoint ( ) ; handler . sendEmptyMessageDelayed ( ( ++ ( currentItem ) ) , 3000 ) ; } private void drawPoint ( ) { } @ Override public void onPageScrolled ( int position , float positionOffset , int positionOffsetPixels ) { } @ Override public void onPageSelected ( int position ) { } @ Override public void onPageScrollStateChanged ( int state ) { } @ Override public boolean onTouch ( View v , MotionEvent event ) { } }

Fix:
new com . softtanck . mybannerview . view . ViewpagerScroll ( view . getContext ( ) , viewPager , 1500 ) ;
Buggy code:
public class DatabaseConnection { static final String JDBC_DRIVER = DatabaseCredentials . getJdbcDriver ( ) ; static final String DB_URL = DatabaseCredentials . getDbUrl ( ) ; static final String USER = DatabaseCredentials . getUser ( ) ; static final String PASS = DatabaseCredentials . getPass ( ) ; private Connection conn = null ; private Statement stmt = null ; PreparedStatement preparedStatement ; private ResultSet rs ; public void establishConnection ( ) { } public void insert ( String query ) { } public ArrayList < String > select ( String query ) { ArrayList < String > result = new ArrayList < String > ( ) ; try { stmt = conn . createStatement ( ) ; rs = stmt . executeQuery ( query ) ; ResultSetMetaData meta = rs . getMetaData ( ) ; while ( rs . next ( ) ) { StringBuilder row = new StringBuilder ( ) ; for ( int i = 1 ; i <= ( meta . getColumnCount ( ) ) ; i ++ ) { String label = meta . getColumnName ( i ) ; <START_BUG> row . append ( label ) . append ( ":" ) ; <END_BUG> row . append ( rs . getString ( label ) ) ; if ( i != ( meta . getColumnCount ( ) ) ) { row . append ( "," ) ; } } result . add ( row . toString ( ) ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } return result ; } public void terminateConnection ( ) { } }

Fix:
row . append ( label ) . append ( ";" ) ;
Buggy code:
public class DropTarget extends Widget { Control control ; Listener controlListener ; Transfer [ ] transferAgents = new Transfer [ 0 ] ; DropTargetEffect dropEffect ; int feedback = DND . FEEDBACK_NONE ; TransferData selectedDataType ; int selectedOperation ; int keyOperation = - 1 ; long dragOverStart ; Runnable dragOverHeartbeat ; DNDEvent dragOverEvent ; static DropTarget CurrentDropTarget = null ; static final String DEFAULT_DROP_TARGET_EFFECT = "DEFAULT_DROP_TARGET_EFFECT" ; static final int DRAGOVER_HYSTERESIS = 50 ; static Callback DragTrackingHandler ; static Callback DragReceiveHandler ; public DropTarget ( Control control , int style ) { } static int checkStyle ( int style ) { } static int DragReceiveHandler ( int theWindow , int handlerRefCon , int theDrag ) { } static int DragTrackingHandler ( int message , int theWindow , int handlerRefCon , int theDrag ) { } static DropTarget FindDropTarget ( int theWindow , int theDrag ) { Display display = Display . findDisplay ( Thread . currentThread ( ) ) ; if ( ( display == null ) || ( display . isDisposed ( ) ) ) return null ; Point mouse = new Point ( ) ; OS . GetDragMouse ( theDrag , mouse , null ) ; int [ ] theRoot = new int [ 1 ] ; OS . GetRootControl ( theWindow , theRoot ) ; int [ ] theControl = new int [ 1 ] ; Rect rect = new Rect ( ) ; <START_BUG> OS . GetWindowBounds ( theWindow , ( ( short ) ( kWindowContentRgn ) ) , rect ) ; <END_BUG> CGPoint inPoint = new CGPoint ( ) ; inPoint . x = ( mouse . h ) - ( rect . left ) ; inPoint . y = ( mouse . v ) - ( rect . top ) ; int [ ] event = new int [ 1 ] ; OS . CreateEvent ( 0 , kEventClassMouse , kEventMouseDown , 0.0 , 0 , event ) ; OS . SetEventParameter ( event [ 0 ] , kEventParamWindowMouseLocation , typeHIPoint , sizeof , inPoint ) ; OS . HIViewGetViewForMouseEvent ( theRoot [ 0 ] , event [ 0 ] , theControl ) ; OS . ReleaseEvent ( event [ 0 ] ) ; if ( ! ( OS . IsControlEnabled ( theControl [ 0 ] ) ) ) return null ; Widget widget = display . findWidget ( theControl [ 0 ] ) ; if ( widget == null ) return null ; return ( ( DropTarget ) ( widget . getData ( DROP_TARGET_KEY ) ) ) ; } public void addDropListener ( DropTargetListener listener ) { } protected void checkSubclass ( ) { } int dragReceiveHandler ( int theWindow , int handlerRefCon , int theDrag ) { } int dragTrackingHandler ( int message , int theWindow , int handlerRefCon , int theDrag ) { } public Control getControl ( ) { } public DropTargetListener [ ] getDropListeners ( ) { } public DropTargetEffect getDropTargetEffect ( ) { } int getOperationFromKeyState ( int theDrag ) { } public Transfer [ ] getTransfer ( ) { } void onDispose ( ) { } int opToOsOp ( int operation ) { } int osOpToOp ( int osOperation ) { } public void removeDropListener ( DropTargetListener listener ) { } public void setDropTargetEffect ( DropTargetEffect effect ) { } boolean setEventData ( int theDrag , DNDEvent event ) { } public void setTransfer ( Transfer [ ] transferAgents ) { } void updateDragOverHover ( long delay , DNDEvent event ) { } }

Fix:
OS . GetWindowBounds ( theWindow , ( ( short ) ( kWindowStructureRgn ) ) , rect ) ;
Buggy code:
public class MainInteractorImpl implements MainInteractor { CancelableCallback < MovieListWrapper > callback ; @ Override public void fetchData ( final FinishListner listner ) { <START_BUG> ApiClient . getYifyApiClient ( ) . getMovieList ( new HashMap < String , String > ( ) , ( callback = new CancelableCallback ( new retrofit . Callback < MovieListWrapper > ( ) { <END_BUG> @ Override public void success ( MovieListWrapper movieListWrapper , Response response ) { listner . onSuccess ( movieListWrapper ) ; } @ Override public void failure ( RetrofitError error ) { listner . onFailure ( error ) ; } } ) ) ) ; } @ Override public void destroy ( ) { } }

Fix:
ApiClient . getApiClient ( ) . getMovieList ( new HashMap < String , String > ( ) , ( callback = new CancelableCallback ( new retrofit . Callback < MovieListWrapper > ( ) {
Buggy code:
public class MainActivity extends AppCompatActivity { @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void launchLocationPermsFlow ( View view ) { } public void launchContactsPermsFlow ( View view ) { } public void launchMultiplePermsFlow ( View view ) { Permission readCalendar = new Permission ( Permissions . READ_CALENDAR , Permissions . READ_CALENDAR_EXPLANATION ) ; Permission writeCalendar = new Permission ( Permissions . WRITE_CALENDAR , Permissions . WRITE_CALENDAR_EXPLANATION ) ; Permission camera = new Permission ( Permissions . CAMERA , Permissions . CAMERA_EXPLANATION ) ; Permission writeContacts = new Permission ( Permissions . WRITE_CONTACTS , Permissions . WRITE_CONTACTS_EXPLANATION ) ; Permission location = new Permission ( Permissions . ACCESS_FINE_LOCATION , Permissions . ACCESS_FINE_LOCATION_EXPLANATION ) ; Permission audio = new Permission ( Permissions . RECORD_AUDIO , Permissions . RECORD_AUDIO_EXPLANATION ) ; Permission phone = new Permission ( Permissions . READ_PHONE_STATE , Permissions . READ_PHONE_STATE_EXPLANATION ) ; Permission sensors = new Permission ( Permissions . BODY_SENSORS , Permissions . BODY_SENSORS_EXPLANATION ) ; Permission sms = new Permission ( Permissions . SEND_SMS , Permissions . SEND_SMS_EXPLANATION ) ; <START_BUG> Permission storage = new Permission ( Permissions . WRITE_EXTERNAL_STORAGE , Permissions . WRITE_EXTERNAL_STORAGE_EXPLANATION ) ; <END_BUG> new PermissionsActivity ( getBaseContext ( ) ) . withAppName ( getResources ( ) . getString ( app_name ) ) . withPermissions ( readCalendar , writeCalendar , writeContacts , location , camera , audio , phone , sensors , sms , storage ) . withPermissionFlowCallback ( new PermissionsActivity . PermissionFlowCallback ( ) { @ Override public void onPermissionGranted ( Permission permission ) { AndroidHelper . shortToast ( getBaseContext ( ) , ( ( "Permission<seq2seq4repair_space>" + ( permission . getPermissionName ( ) ) ) + "<seq2seq4repair_space>granted!" ) ) ; } @ Override public void onPermissionDenied ( Permission permission ) { AndroidHelper . shortToast ( getBaseContext ( ) , ( ( "Permission<seq2seq4repair_space>" + ( permission . getPermissionName ( ) ) ) + "<seq2seq4repair_space>denied!" ) ) ; } } ) . launch ( ) ; } }

Fix:
Permission storage = new Permission ( Permissions . READ_EXTERNAL_STORAGE , Permissions . WRITE_EXTERNAL_STORAGE_EXPLANATION ) ;
Buggy code:
public class ProxyConfig implements Serializable { private static final long serialVersionUID = - 8409359707199703185L ; private boolean proxyTargetClass = false ; private boolean optimize = false ; boolean opaque = false ; boolean exposeProxy = false ; private boolean frozen = false ; public void setProxyTargetClass ( boolean proxyTargetClass ) { } public boolean isProxyTargetClass ( ) { } public void setOptimize ( boolean optimize ) { } public boolean isOptimize ( ) { } public void setOpaque ( boolean opaque ) { } public boolean isOpaque ( ) { } public void setExposeProxy ( boolean exposeProxy ) { } public boolean isExposeProxy ( ) { } public void setFrozen ( boolean frozen ) { } public boolean isFrozen ( ) { } public void copyFrom ( ProxyConfig other ) { } @ Override public String toString ( ) { <START_BUG> StringBuffer sb = new StringBuffer ( ) ; <END_BUG> sb . append ( "proxyTargetClass=" ) . append ( this . proxyTargetClass ) . append ( ";<seq2seq4repair_space>" ) ; sb . append ( "optimize=" ) . append ( this . optimize ) . append ( ";<seq2seq4repair_space>" ) ; sb . append ( "opaque=" ) . append ( this . opaque ) . append ( ";<seq2seq4repair_space>" ) ; sb . append ( "exposeProxy=" ) . append ( this . exposeProxy ) . append ( ";<seq2seq4repair_space>" ) ; sb . append ( "frozen=" ) . append ( this . frozen ) ; return sb . toString ( ) ; } }

Fix:
StringBuilder sb = new StringBuilder ( ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class SimpleApplicationClientTestCase { private static Archive archive ; private static final String APP_NAME = "simple-app-client-test" ; private static final String MODULE_NAME = "ejb" ; @ ArquillianResource private ManagementClient managementClient ; @ Deployment ( testable = false ) public static Archive < ? > deploy ( ) { } @ Test public void simpleAppClientTest ( ) throws Exception { } @ Test public void descriptorBasedAppClientTest ( ) throws Exception { } @ Test public void testAppClientJBossDescriptor ( ) throws Exception { final StatelessEJBLocator < AppClientSingletonRemote > locator = new StatelessEJBLocator ( AppClientSingletonRemote . class , SimpleApplicationClientTestCase . APP_NAME , SimpleApplicationClientTestCase . MODULE_NAME , AppClientStateSingleton . class . getSimpleName ( ) , "" ) ; final AppClientSingletonRemote remote = EJBClient . createProxy ( locator ) ; remote . reset ( ) ; URL props = getClass ( ) . getClassLoader ( ) . getResource ( "jboss-ejb-client.properties" ) ; <START_BUG> final AppClientWrapper wrapper = new AppClientWrapper ( SimpleApplicationClientTestCase . archive , ( "--ejb-client-properties=" + props ) , "client-override.jar" , "" ) ; <END_BUG> try { final String result = remote . awaitAppClientCall ( ) ; assertTrue ( ( "App<seq2seq4repair_space>client<seq2seq4repair_space>call<seq2seq4repair_space>failed.<seq2seq4repair_space>App<seq2seq4repair_space>client<seq2seq4repair_space>output:<seq2seq4repair_space>" + ( wrapper . readAllUnformated ( 1000 ) ) ) , ( result != null ) ) ; assertEquals ( "OverridenEnvEntry" , result ) ; } finally { wrapper . quit ( ) ; } } }

Fix:
final AppClientWrapper wrapper = new AppClientWrapper ( SimpleApplicationClientTestCase . archive , ( ( ( "<seq2seq4repair_space>-Dnode0=" + ( managementClient . getMgmtAddress ( ) ) ) + "<seq2seq4repair_space>--ejb-client-properties=" ) + props ) , "client-override.jar" , "" ) ;
Buggy code:
public class CSVRecord implements Serializable , Iterable < String > { private static final long serialVersionUID = 1L ; private static final String [ ] EMPTY_STRING_ARRAY = new String [ 0 ] ; private final String [ ] values ; private final Map < String , Integer > mapping ; private final String comment ; private final long recordNumber ; CSVRecord ( final String [ ] values , final Map < String , Integer > mapping , final String comment , final long recordNumber ) { } public String get ( final int i ) { } public String get ( final String name ) { if ( ( mapping ) == null ) { throw new IllegalStateException ( "No<seq2seq4repair_space>header<seq2seq4repair_space>mapping<seq2seq4repair_space>was<seq2seq4repair_space>specified,<seq2seq4repair_space>the<seq2seq4repair_space>record<seq2seq4repair_space>values<seq2seq4repair_space>can't<seq2seq4repair_space>be<seq2seq4repair_space>accessed<seq2seq4repair_space>by<seq2seq4repair_space>name" ) ; } final Integer index = mapping . get ( name ) ; try { return index != null ? values [ index . intValue ( ) ] : null ; <START_BUG> } catch ( ArrayIndexOutOfBoundsException e ) { <END_BUG> throw new IllegalArgumentException ( String . format ( "Index<seq2seq4repair_space>for<seq2seq4repair_space>header<seq2seq4repair_space>'%s'<seq2seq4repair_space>is<seq2seq4repair_space>%d<seq2seq4repair_space>but<seq2seq4repair_space>CSVRecord<seq2seq4repair_space>only<seq2seq4repair_space>has<seq2seq4repair_space>%d<seq2seq4repair_space>values!" , name , index . intValue ( ) , values . length ) ) ; } } public boolean isConsistent ( ) { } public boolean isMapped ( final String name ) { } public boolean isSet ( final String name ) { } public Iterator < String > iterator ( ) { } String [ ] values ( ) { } public String getComment ( ) { } public long getRecordNumber ( ) { } public int size ( ) { } @ Override public String toString ( ) { } }

Fix:
} catch ( final ArrayIndexOutOfBoundsException e ) {
Buggy code:
public class TestDefaultInheritanceStrategy extends SingleEMFTestCase { public void setUp ( ) { } private Class [ ] classArray ( Class ... classes ) { } public void testSimpleDefaultInheritance ( ) { } public void testMappedSuperclass ( ) { } public void testTwoLevelInheritance ( ) { EntityManager em = emf . createEntityManager ( ) ; em . getTransaction ( ) . begin ( ) ; SubclassE sc = new SubclassE ( ) ; sc . setId ( 0 ) ; sc . setName ( "SubclassEBaseClassName" ) ; sc . setMidClassName ( "SubclassEMidClassName" ) ; sc . setClassEName ( "SubclassCName" ) ; MidClass mc = new MidClass ( ) ; mc . setId ( 1 ) ; mc . setName ( "MidClassBaseClassName" ) ; mc . setMidClassName ( "MidClassName" ) ; BaseClass2 b2 = new BaseClass2 ( ) ; b2 . setName ( "BaseClass2Name" ) ; b2 . setId ( 2 ) ; em . persist ( sc ) ; em . persist ( mc ) ; em . persist ( b2 ) ; em . getTransaction ( ) . commit ( ) ; em . clear ( ) ; <START_BUG> verifyDtypeColumnEntriesAndMapping ( em , "BASECLASS2" , 3 , BaseClass2 . class ) ; <END_BUG> verifyNoDypeColumn ( em , "MidClass" ) ; verifyNoDypeColumn ( em , "SubclassE" ) ; verifyInheritanceQueryResult ( em , "SubclassE" , classArray ( SubclassE . class , MidClass . class , BaseClass2 . class ) , 0 ) ; verifyInheritanceQueryResult ( em , "MidClass" , classArray ( MidClass . class ) , 0 , 1 ) ; verifyInheritanceQueryResult ( em , "BaseClass2" , classArray ( BaseClass2 . class ) , 0 , 1 , 2 ) ; em . close ( ) ; } public void testManagedInterface ( ) { } public void testManagedInterfaceAndBase ( ) { } public void testSubclassSpecifiedInheritance ( ) { } public void testCircularInheritedRelationships ( ) { } public void testAbstractEntityInheritance ( ) { } public void testMidNonEntityInheritance ( ) { } public void testFinder ( ) { } private void verifyDtypeColumnEntriesAndMapping ( EntityManager em , String table , int entries , Class baseClass ) { } private void verifyNoDypeColumn ( EntityManager em , String table ) { } private void verifyInheritanceQueryResult ( EntityManager em , String entity , Class [ ] types , int ... expectedValues ) { } private void verifyInheritanceFinderResult ( EntityManager em , Class entityType , int ... ids ) { } }

Fix:
verifyDtypeColumnEntriesAndMapping ( em , "BaseClass2" , 3 , BaseClass2 . class ) ;
Buggy code:
public class EJBAnnotationPropertyReplacement { public static PropertyReplacer propertyReplacer ( final DeploymentUnit deploymentUnit ) { <START_BUG> Boolean replacement = deploymentUnit . getAttachment ( ANNOTATION_PROPERTY_REPLACEMENT ) ; <END_BUG> if ( ( replacement == null ) || replacement ) { final PropertyResolver propertyResolver = deploymentUnit . getAttachment ( FINAL_PROPERTY_RESOLVER ) ; return PropertyReplacers . resolvingReplacer ( propertyResolver ) ; } else { return PropertyReplacers . noop ( ) ; } } private EJBAnnotationPropertyReplacement ( ) { } }

Fix:
Boolean replacement = deploymentUnit . getAttachment ( EJB_ANNOTATION_PROPERTY_REPLACEMENT ) ;
Buggy code:
public class SOContext implements ISharedObjectContext { protected SOContainer container = null ; protected ID sharedObjectID ; protected ID homeContainerID ; protected boolean isActive ; protected Map properties ; protected IQueueEnqueue queue ; public SOContext ( ID objID , ID homeID , SOContainer cont , Map props , IQueueEnqueue queue ) { } public boolean isActive ( ) { } protected void trace ( String msg ) { <START_BUG> Trace . trace ( PLUGIN_ID , DEBUG , ( ( msg + ":" ) + ( container . getID ( ) ) ) ) ; <END_BUG> } protected void traceStack ( String msg , Throwable e ) { } protected void makeInactive ( ) { } protected boolean isInactive ( ) { } public ID getLocalContainerID ( ) { } public ISharedObjectManager getSharedObjectManager ( ) { } public IQueueEnqueue getQueue ( ) { } public void connect ( ID groupID , IConnectContext joinContext ) throws ContainerConnectException { } public void disconnect ( ) { } public ID getConnectedID ( ) { } public boolean isGroupManager ( ) { } public boolean isGroupServer ( ) { } public ID [ ] getGroupMemberIDs ( ) { } public void sendCreate ( ID toContainerID , ReplicaSharedObjectDescription sd ) throws IOException { } public void sendCreateResponse ( ID toContainerID , Throwable throwable , long identifier ) throws IOException { } public void sendDispose ( ID toContainerID ) throws IOException { } public void sendMessage ( ID toContainerID , Object data ) throws IOException { } public Object getAdapter ( Class clazz ) { } public Namespace getConnectNamespace ( ) { } public Map getLocalContainerProperties ( ) { } }

Fix:
Trace . trace ( PLUGIN_ID , SHAREDOBJECTCONTEXT , ( ( msg + ":" ) + ( container . getID ( ) ) ) ) ;
Buggy code:
public class Test { private static final String PERSISTENCE_UNIT_NAME = "Person" ; private static EntityManagerFactory factory ; public static void main ( String [ ] args ) { Test . factory = Persistence . createEntityManagerFactory ( Test . PERSISTENCE_UNIT_NAME ) ; EntityManager em = Test . factory . createEntityManager ( ) ; <START_BUG> Person p = new Person ( "002" , "Cao" , "Zhi" ) ; <END_BUG> em . getTransaction ( ) . begin ( ) ; em . persist ( p ) ; em . getTransaction ( ) . commit ( ) ; em . close ( ) ; } No newline ; at end ; of file ; }

Fix:
Person p = new Person ( 11 , "Cao" , "Zhi" ) ;
Buggy code:
class XSDComplexTypeTraverser extends XSDAbstractParticleTraverser { XSDComplexTypeTraverser ( XSDHandler handler , XSAttributeChecker gAttrCheck ) { } private class ComplexTypeRecoverableError extends Exception { ComplexTypeRecoverableError ( ) { } ComplexTypeRecoverableError ( String s ) { } } XSComplexTypeDecl traverseLocal ( Element complexTypeNode , XSDocumentInfo schemaDoc , SchemaGrammar grammar ) { } XSComplexTypeDecl traverseGlobal ( Element complexTypeNode , XSDocumentInfo schemaDoc , SchemaGrammar grammar ) { } private XSComplexTypeDecl traverseComplexTypeDecl ( Element complexTypeDecl , String complexTypeName , Object [ ] attrValues , XSDocumentInfo schemaDoc , SchemaGrammar grammar ) { } private void processComplexContent ( Element complexContentChild , XSComplexTypeDecl typeInfo , QName baseName , boolean isMixed , XSDocumentInfo schemaDoc , SchemaGrammar grammar ) throws XSDComplexTypeTraverser . ComplexTypeRecoverableError { } private boolean isAttrOrAttrGroup ( Element child ) { } private void traverseSimpleContentDecl ( Element simpleContentDecl , XSComplexTypeDecl typeInfo ) { } private void traverseComplexContentDecl ( Element complexContentDecl , XSComplexTypeDecl typeInfo , boolean mixedOnComplexTypeDecl ) { } private String genAnonTypeName ( Element complexTypeDecl ) { String typeName ; Element node = DOMUtil . getParent ( complexTypeDecl ) ; typeName = "#AnonType_" ; <START_BUG> while ( node != null ) { <END_BUG> typeName = typeName + ( node . getAttribute ( ATT_NAME ) ) ; node = DOMUtil . getParent ( node ) ; } return typeName ; } }

Fix:
while ( ( node != null ) && ( node != ( DOMUtil . getRoot ( DOMUtil . getDocument ( node ) ) ) ) ) {
Buggy code:
public class PlaypenControls extends RelativeLayout { public PlaypenControls ( Context c ) { } public PlaypenControls ( Context c , AttributeSet s ) { } public PlaypenControls ( Context c , AttributeSet s , int d ) { } public void showFor ( Deck d ) { View left = findViewById ( left_stub ) ; View right = findViewById ( right_stub ) ; View upDown = findViewById ( swipe_up_down ) ; <START_BUG> boolean hideSwipe = ( d . isOpen ( ) ) ? d . isProcessed ( ) ? d . isLastStep ( ) : true : false ; <END_BUG> upDown . setVisibility ( ( hideSwipe ? View . GONE : View . VISIBLE ) ) ; if ( d . isSwipeable ( ) ) { if ( d . isOnOptionOne ( ) ) { int y = ( d . midYOfTex ( ) ) - ( ( right . getHeight ( ) ) // 2 ) ; right . setY ( y ) ; right . setVisibility ( VISIBLE ) ; left . setVisibility ( GONE ) ; } else { left . setVisibility ( VISIBLE ) ; right . setVisibility ( GONE ) ; } } else { left . setVisibility ( GONE ) ; right . setVisibility ( GONE ) ; } } public void hideLeftSwipe ( ) { } public void showLeftSwipe ( ) { } public void hideRightSwipe ( ) { } public void showRightSwipe ( ) { } public void hideLeftRightSwipes ( ) { } public void hideUpDownSwipe ( ) { } public void showUpDownSwipe ( ) { } }

Fix:
boolean hideSwipe = ( d . isLastStep ( ) ) || ( ! ( d . isProcessed ( ) ) ) ;
Buggy code:
public class ActionNewChangeEvent extends ActionNewEvent { public static ActionNewChangeEvent SINGLETON = new ActionNewChangeEvent ( ) ; protected ActionNewChangeEvent ( ) { } protected Object createEvent ( ) { <START_BUG> return StateMachinesFactory . getFactory ( ) . createChangeEvent ( ) ; <END_BUG> } }

Fix:
return StateMachinesFactory . getFactory ( ) . buildChangeEvent ( ) ;
Buggy code:
public abstract class AbstractHornetQComponentControlHandler < T extends HornetQComponentControl > extends AbstractRuntimeOnlyHandler { private static final SimpleAttributeDefinition STARTED = SimpleAttributeDefinitionBuilder . create ( CommonAttributes . STARTED , ModelType . BOOLEAN ) . setFlags ( STORAGE_RUNTIME ) . build ( ) ; private ParametersValidator readAttributeValidator = new ParametersValidator ( ) ; protected AbstractHornetQComponentControlHandler ( ) { } @ Override protected void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { } public void registerAttributes ( final ManagementResourceRegistration registry ) { } public void registerOperations ( final ManagementResourceRegistration registry , final ResourceDescriptionResolver resolver ) { } protected abstract T getHornetQComponentControl ( HornetQServer hqServer , PathAddress address ) { } protected abstract String getDescriptionPrefix ( ) { } protected void handleReadAttribute ( String attributeName , OperationContext context , ModelNode operation ) throws OperationFailedException { } protected Object handleOperation ( String operationName , OperationContext context , ModelNode operation ) throws OperationFailedException { } protected void handleRevertOperation ( String operationName , OperationContext context , ModelNode operation , Object handback ) { } protected final void unsupportedAttribute ( final String attributeName ) { } protected final void unsupportedOperation ( final String operationName ) { } protected final T getHornetQComponentControl ( final OperationContext context , final ModelNode operation , final boolean forWrite ) throws OperationFailedException { final ServiceName hqServiceName = MessagingServices . getHornetQServiceName ( PathAddress . pathAddress ( operation . get ( OP_ADDR ) ) ) ; ServiceController < ? > hqService = context . getServiceRegistry ( forWrite ) . getService ( hqServiceName ) ; HornetQServer server = HornetQServer . class . cast ( hqService . getValue ( ) ) ; PathAddress address = PathAddress . pathAddress ( operation . require ( ModelDescriptionConstants . OP_ADDR ) ) ; T control = getHornetQComponentControl ( server , address ) ; if ( control == null ) { <START_BUG> throw new OperationFailedException ( MESSAGES . noHandler ( ModelDescriptionConstants . READ_ATTRIBUTE_OPERATION , PathAddress . pathAddress ( operation . require ( ModelDescriptionConstants . OP_ADDR ) ) ) ) ; <END_BUG> } return control ; } }

Fix:
throw new OperationFailedException ( MESSAGES . hqServerManagementServiceResourceNotFound ( PathAddress . pathAddress ( operation . require ( ModelDescriptionConstants . OP_ADDR ) ) ) ) ;
Buggy code:
public class Condition implements Expression { Expression left ; String type ; Expression right ; public Condition ( Expression left , String type , Expression right ) { } public int result ( int [ ] stats ) { switch ( type ) { case "==" : if ( ( left . result ( stats ) ) == ( right . result ( stats ) ) ) { return 1 ; } break ; case ">" : if ( ( left . result ( stats ) ) > ( right . result ( stats ) ) ) { return 1 ; } break ; case "<" : if ( ( left . result ( stats ) ) < ( right . result ( stats ) ) ) { return 1 ; } break ; case ">=" : if ( ( left . result ( stats ) ) >= ( right . result ( stats ) ) ) { return 1 ; } break ; case "<=" : <START_BUG> if ( ( left . result ( stats ) ) >= ( right . result ( stats ) ) ) { <END_BUG> return 1 ; } break ; case "!=" : if ( ( left . result ( stats ) ) != ( right . result ( stats ) ) ) { return 1 ; } break ; } return 0 ; } public String toString ( ) { } }

Fix:
if ( ( left . result ( stats ) ) <= ( right . result ( stats ) ) ) {
Buggy code:
public class TestFileRowColContainer extends JMeterTestCase { public void testNull ( ) throws Exception { try { <START_BUG> new FileRowColContainer ( "testfiles//xyzxyz" ) ; <END_BUG> fail ( "Should<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>the<seq2seq4repair_space>file" ) ; } catch ( FileNotFoundException e ) { } } public void testrowNum ( ) throws Exception { } public void testColumns ( ) throws Exception { } public void testColumnsComma ( ) throws Exception { } public void testColumnsTab ( ) throws Exception { } public void testEmptyCols ( ) throws Exception { } }

Fix:
new FileRowColContainer ( findTestPath ( "testfiles//xyzxyz" ) ) ;
Buggy code:
public class Connection implements Closeable { private String host = Protocol . DEFAULT_HOST ; private int port = Protocol . DEFAULT_PORT ; private Socket socket ; private RedisOutputStream outputStream ; private RedisInputStream inputStream ; private int connectionTimeout = Protocol . DEFAULT_TIMEOUT ; private int soTimeout = Protocol . DEFAULT_TIMEOUT ; private boolean broken = false ; public Connection ( ) { } public Connection ( final String host ) { } public Connection ( final String host , final int port ) { } public Socket getSocket ( ) { } public int getConnectionTimeout ( ) { } public int getSoTimeout ( ) { } public void setConnectionTimeout ( int connectionTimeout ) { } public void setSoTimeout ( int soTimeout ) { } public void setTimeoutInfinite ( ) { } public void rollbackTimeout ( ) { } protected Connection sendCommand ( final Command cmd , final String ... args ) { } protected Connection sendCommand ( final Command cmd , final byte [ ] ... args ) { } protected Connection sendCommand ( final Command cmd ) { } public String getHost ( ) { } public void setHost ( final String host ) { } public int getPort ( ) { } public void setPort ( final int port ) { } public void connect ( ) { } @ Override public void close ( ) { } public void disconnect ( ) { } public boolean isConnected ( ) { } public String getStatusCodeReply ( ) { } public String getBulkReply ( ) { } public byte [ ] getBinaryBulkReply ( ) { } public Long getIntegerReply ( ) { } public List < String > getMultiBulkReply ( ) { } @ SuppressWarnings ( "unchecked" ) public List < byte [ ] > getBinaryMultiBulkReply ( ) { } @ SuppressWarnings ( "unchecked" ) public List < Object > getRawObjectMultiBulkReply ( ) { } public List < Object > getObjectMultiBulkReply ( ) { } @ SuppressWarnings ( "unchecked" ) public List < Long > getIntegerMultiBulkReply ( ) { flush ( ) ; <START_BUG> return ( ( List < Long > ) ( Protocol . read ( inputStream ) ) ) ; <END_BUG> } public Object getOne ( ) { } public boolean isBroken ( ) { } protected void flush ( ) { } protected Object readProtocolWithCheckingBroken ( ) { } public List < Object > getMany ( final int count ) { } }

Fix:
return ( ( List < Long > ) ( readProtocolWithCheckingBroken ( ) ) ) ;
Buggy code:
@ Controller public class FeedsController { @ Autowired private UserRepository userRepository ; @ Autowired private FollowersRepository followersRepository ; @ Autowired private FollowingsRepository followingsRepository ; @ Autowired private FeedService feedService ; @ Autowired private CommentRepository commentRepository ; @ Autowired private TimeLineRepository timeLineRepository ; @ RequestMapping ( value = "//post" , method = RequestMethod . POST ) public void postPin ( @ RequestParam String username , @ RequestParam String description ) { } @ RequestMapping ( value = "//follow" , method = RequestMethod . POST ) public String follow ( @ RequestParam String usernameToFollow , HttpServletRequest request ) { String username = ( ( String ) ( SecurityUtils . getSubject ( ) . getPrincipal ( ) ) ) ; UUID userId = userRepository . findByUsername ( username ) . getId ( ) ; UUID userIdToFollow = userRepository . findByUsername ( usernameToFollow ) . getId ( ) ; Date since = new Date ( ) ; Followers followers = new Followers ( new FollowersKey ( userIdToFollow , userId ) , since ) ; followersRepository . save ( followers ) ; Followings followings = new Followings ( new FollowingsKey ( userId , userIdToFollow ) , since ) ; followingsRepository . save ( followings ) ; List < Pins > pins = feedService . findPinsByUserId ( userIdToFollow ) ; for ( Pins p : pins ) { <START_BUG> timeLineRepository . save ( new TimeLine ( new vivid . feed . compositekey . TimeLineKey ( userIdToFollow , p . getTime ( ) ) , p . getPk ( ) . getPinId ( ) ) ) ; <END_BUG> } return "redirect:" + ( request . getHeader ( "Referer" ) ) ; } @ RequestMapping ( value = "//un_follow" , method = RequestMethod . POST ) public String unFollow ( @ RequestParam String usernameToUnFollow , HttpServletRequest request ) { } @ RequestMapping ( value = "//timeline" , method = RequestMethod . GET ) @ ResponseBody public Map showTimeLine ( @ DateTimeFormat ( pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ" ) @ RequestParam ( "last_updated_till" ) Date lastUpdatedTill , @ RequestParam int count ) { } @ RequestMapping ( value = "//comment" , method = RequestMethod . POST ) public String createComment ( @ RequestParam UUID pinId , @ RequestParam String body , HttpServletRequest request ) { } @ RequestMapping ( value = "//list_comment" , method = RequestMethod . POST ) @ ResponseBody public Map showComment ( @ RequestParam UUID pinId ) { } @ RequestMapping ( value = "//detail//{id}" , method = RequestMethod . GET ) public String detail ( @ PathVariable UUID id , Model model ) { } }

Fix:
timeLineRepository . save ( new TimeLine ( new vivid . feed . compositekey . TimeLineKey ( userId , p . getTime ( ) ) , p . getPk ( ) . getPinId ( ) ) ) ;
Buggy code:
@ Repository public class WithdrawRequestDetailDaoImpl extends AbstractBaseDaoImpl < WithdrawRequestDetail > implements WithdrawRequestDetailDao { @ Override public List < WithdrawRequestDetail > getWithdrawRequestList ( ) throws UserException { } @ Override public List < WithdrawRequestDetailDto > getWithdrawRequestList ( final WithdrawRequestDetailDto withdrawRequestDetailDto , final PaginationDataDTO paginationDataDto ) throws UserException { } @ Override public int withdrawRequestCountForUser ( final String firstName , final String lastName , final Date dob , final GdeUser user ) { } @ Override public String findWithdrawlUserReason ( final long userId ) { <START_BUG> StringBuffer queryString = new StringBuffer ( "select<seq2seq4repair_space>withdraw_reason<seq2seq4repair_space>from<seq2seq4repair_space>withdraw_request_details" ) . append ( "<seq2seq4repair_space>where<seq2seq4repair_space>user_id<seq2seq4repair_space>=" ) . append ( userId ) . append ( "<seq2seq4repair_space>order<seq2seq4repair_space>by<seq2seq4repair_space>id<seq2seq4repair_space>asc" ) . append ( userId ) ; <END_BUG> Query query = this . createQuery ( queryString . toString ( ) , true ) ; List < Object > list = query . getResultList ( ) ; if ( ! ( CollectionUtils . isEmpty ( list ) ) ) { return list . get ( ( ( list . size ( ) ) - 1 ) ) . toString ( ) ; } else { return "" ; } } }

Fix:
StringBuffer queryString = new StringBuffer ( "select<seq2seq4repair_space>withdraw_reason<seq2seq4repair_space>from<seq2seq4repair_space>withdraw_request_details" ) . append ( "<seq2seq4repair_space>where<seq2seq4repair_space>user_id<seq2seq4repair_space>=" ) . append ( userId ) . append ( "<seq2seq4repair_space>order<seq2seq4repair_space>by<seq2seq4repair_space>id<seq2seq4repair_space>asc" ) ;
Buggy code:
public class GamePropertiesController extends PropertiesViewController { @ FXML private TextField titleField ; @ FXML private TextArea descriptionField ; @ FXML private RadioButton gameTypeCyclingButton ; @ FXML private RadioButton gameTypeRowingButton ; @ FXML private TextField audioFileNameField ; @ FXML private Button browseButton ; @ FXML private ButtonBar actionButtonBar ; @ FXML private TextField widthTextField ; @ FXML private TextField heightTextField ; @ FXML private Button openDesignerButton ; @ Override public void init ( ) { } private void initFields ( ) { } @ FXML private void handleAudioBrowseDialog ( ) { } @ FXML private void handleSave ( ) { } @ FXML private void handleCancel ( ) { } private boolean isInputValid ( ) { } @ Override protected String getViewTitle ( ) { } private Game getGame ( ) { } private void setGame ( Game game ) { } public void show ( Action action , Game game ) { try { FXMLLoader loader = new FXMLLoader ( ) ; loader . setLocation ( getClass ( ) . getResource ( "GameProperties.fxml" ) ) ; AnchorPane pane = ( ( AnchorPane ) ( loader . load ( ) ) ) ; <START_BUG> if ( ! ( action . equals ( VIEW ) ) ) { <END_BUG> game = new GameDao ( ) . findGameWithDetails ( game . getIdNo ( ) ) ; } GamePropertiesController controller = ( ( GamePropertiesController ) ( loader . getController ( ) ) ) ; controller . setCurrentAction ( action ) ; controller . setGame ( game ) ; controller . init ( ) ; MainLayout . getRootLayout ( ) . setCenter ( pane ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } private void disableFields ( boolean disable ) { } @ FXML private void showMapDesigner ( ) { } private void loadMapDetails ( ) { } private boolean isValidDetails ( ) { } private Boolean isValidMap ( ) { } private Map getMap ( ) { } }

Fix:
if ( action . equals ( EDIT ) ) {
Buggy code:
class SubqueryList extends QueryTreeNodeVector < SubqueryNode > { SubqueryList ( ContextManager cm ) { } void addSubqueryNode ( SubqueryNode subqueryNode ) throws StandardException { } void preprocess ( int numTables , FromList outerFromList , SubqueryList outerSubqueryList , PredicateList outerPredicateList ) throws StandardException { } void optimize ( DataDictionary dataDictionary , double outerRows ) throws StandardException { } void modifyAccessPaths ( ) throws StandardException { } boolean referencesTarget ( String name , boolean baseTable ) throws StandardException { } @ Override public boolean referencesSessionSchema ( ) throws StandardException { for ( SubqueryNode sqn : this ) { <START_BUG> if ( sqn . getResultSet ( ) . referencesSessionSchema ( ) ) { <END_BUG> return true ; } } return false ; } void setPointOfAttachment ( int pointOfAttachment ) throws StandardException { } void decrementLevel ( int decrement ) { } void markHavingSubqueries ( ) { } void markWhereSubqueries ( ) { } }

Fix:
if ( sqn . referencesSessionSchema ( ) ) {
Buggy code:
public class MD5HexAssertion extends AbstractTestElement implements Serializable , Assertion { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final String MD5HEX_KEY = "MD5HexAssertion.size" ; public AssertionResult getResult ( SampleResult response ) { <START_BUG> AssertionResult result = new AssertionResult ( ) ; <END_BUG> result . setFailure ( false ) ; byte [ ] resultData = response . getResponseData ( ) ; if ( ( resultData . length ) == 0 ) { result . setError ( false ) ; result . setFailure ( true ) ; result . setFailureMessage ( "Response<seq2seq4repair_space>was<seq2seq4repair_space>null" ) ; return result ; } if ( getAllowedMD5Hex ( ) . equals ( "" ) ) { result . setError ( false ) ; result . setFailure ( true ) ; result . setFailureMessage ( "MD5Hex<seq2seq4repair_space>to<seq2seq4repair_space>test<seq2seq4repair_space>against<seq2seq4repair_space>is<seq2seq4repair_space>empty" ) ; return result ; } String md5Result = MD5HexAssertion . baMD5Hex ( resultData ) ; if ( ! ( md5Result . equalsIgnoreCase ( getAllowedMD5Hex ( ) ) ) ) { result . setFailure ( true ) ; Object [ ] arguments = new Object [ ] { md5Result , getAllowedMD5Hex ( ) } ; String message = MessageFormat . format ( JMeterUtils . getResString ( "md5hex_assertion_failure" ) , arguments ) ; result . setFailureMessage ( message ) ; } return result ; } public void setAllowedMD5Hex ( String hex ) { } public String getAllowedMD5Hex ( ) { } static String baToHex ( byte [ ] ba ) { } static String baMD5Hex ( byte [ ] ba ) { } }

Fix:
AssertionResult result = new AssertionResult ( getName ( ) ) ;
Buggy code:
public class UnknownElement extends Task { private String elementName ; private Task realTask ; private Vector children = new Vector ( ) ; public UnknownElement ( String elementName ) { } public String getTag ( ) { } public void maybeConfigure ( ) throws BuildException { } public void execute ( ) { } public void addChild ( UnknownElement child ) { } protected void handleChildren ( Object parent , RuntimeConfigurable parentWrapper ) throws BuildException { if ( parent instanceof TaskAdapter ) { parent = ( ( TaskAdapter ) ( parent ) ) . getProxy ( ) ; } Class parentClass = parent . getClass ( ) ; IntrospectionHelper ih = IntrospectionHelper . getHelper ( parentClass ) ; for ( int i = 0 ; i < ( children . size ( ) ) ; i ++ ) { UnknownElement child = ( ( UnknownElement ) ( children . elementAt ( i ) ) ) ; <START_BUG> Object realChild = ih . createElement ( parent , child . getTag ( ) ) ; <END_BUG> RuntimeConfigurable childWrapper = parentWrapper . getChild ( i ) ; childWrapper . setProxy ( realChild ) ; child . handleChildren ( realChild , childWrapper ) ; } } }

Fix:
Object realChild = ih . createElement ( project , parent , child . getTag ( ) ) ;
Buggy code:
public final class DedupStep < S > extends FilterStep < S > implements FunctionHolder < S , Object > , Reducing , Reversible { private static final Set < TraverserRequirement > REQUIREMENTS = new HashSet ( Arrays . asList ( BULK , OBJECT ) ) ; private Function < S , Object > uniqueFunction = null ; private Set < Object > duplicateSet = new HashSet < > ( ) ; public DedupStep ( final Traversal traversal ) { } public boolean hasUniqueFunction ( ) { <START_BUG> return null == ( this . uniqueFunction ) ; <END_BUG> } @ Override public void addFunction ( final Function < S , Object > function ) { } @ Override public List < Function < S , Object > > getFunctions ( ) { } @ Override public Pair < Supplier < Set > , BiFunction < Set , Traverser < S > , Set > > getReducer ( ) { } @ Override public DedupStep < S > clone ( ) throws CloneNotSupportedException { } @ Override public void reset ( ) { } @ Override public String toString ( ) { } @ Override public Set < TraverserRequirement > getRequirements ( ) { } private static final < S > void generatePredicate ( final DedupStep < S > dedupStep ) { } }

Fix:
return null != ( this . uniqueFunction ) ;
Buggy code:
public class ResourceContentSource extends ContentSource { public ResourceContentSource ( String id ) { } protected void destroy ( StorageReference reference ) throws IOException { } protected Object load ( ContentDescriptor descriptor ) throws IOException { byte [ ] data = null ; String url = descriptor . getUrl ( ) ; try { InputStream stream = getClass ( ) . getResourceAsStream ( url ) ; data = StreamHelper . toBytes ( stream ) ; return data ; <START_BUG> } catch ( IllegalArgumentException e ) { <END_BUG> throw new IOException ( ( "unable<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>" + url ) ) ; } } protected Object load ( StorageReference reference ) throws IOException { } protected Object store ( ContentDescriptor descriptor , Object data ) throws IOException { } }

Fix:
} catch ( Exception e ) {
Buggy code:
public class MapperConverter implements GenericConverter { private Mapper mapper ; private MapperTargetFactory mappingTargetFactory ; public MapperConverter ( Mapper mapper ) { } public MapperConverter ( Mapper mapper , MapperTargetFactory mappingTargetFactory ) { } public Object convert ( Object source , TypeDescriptor sourceType , TypeDescriptor targetType ) { if ( source == null ) { return null ; } <START_BUG> if ( SpelMappingContextHolder . contains ( source ) ) { <END_BUG> return source ; } if ( ( sourceType . isAssignableTo ( targetType ) ) && ( isCopyByReference ( sourceType , targetType ) ) ) { return source ; } return createAndMap ( targetType , source , sourceType ) ; } private boolean isCopyByReference ( TypeDescriptor sourceType , TypeDescriptor targetType ) { } private Object createAndMap ( TypeDescriptor targetType , Object source , TypeDescriptor sourceType ) { } }

Fix:
if ( MappingContextHolder . contains ( source ) ) {
Buggy code:
public class Equation extends ArrayList < String > { public String getText ( ) { } public void setText ( String text ) { } public void attachToLast ( char c ) { } public void detachFromLast ( ) { } public void removeLast ( ) { } public String getLast ( ) { } public char getLastChar ( ) { String s = getLast ( ) ; if ( ( s . length ( ) ) > 0 ) <START_BUG> return s . charAt ( 0 ) ; <END_BUG> return '<seq2seq4repair_space>' ; } public String getRecent ( int indexFromLast ) { } public boolean isNumber ( int i ) { } public boolean isOperator ( int i ) { } public boolean isRawNumber ( int i ) { } public boolean isStartCharacter ( int i ) { } public int numOf ( char c ) { } }

Fix:
return s . charAt ( ( ( s . length ( ) ) - 1 ) ) ;
Buggy code:
public class AssociationsFacetsExample { private final Directory indexDir = new RAMDirectory ( ) ; private final Directory taxoDir = new RAMDirectory ( ) ; private final FacetsConfig config ; public AssociationsFacetsExample ( ) { } private void index ( ) throws IOException { IndexWriterConfig iwc = new IndexWriterConfig ( FacetExamples . EXAMPLES_VER , new org . apache . lucene . analysis . core . WhitespaceAnalyzer ( FacetExamples . EXAMPLES_VER ) ) ; IndexWriter indexWriter = new IndexWriter ( indexDir , iwc ) ; DirectoryTaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter ( taxoDir ) ; Document doc = new Document ( ) ; doc . add ( new IntAssociationFacetField ( 3 , "tags" , "lucene" ) ) ; doc . add ( new FloatAssociationFacetField ( 0.87F , "genre" , "computing" ) ) ; indexWriter . addDocument ( config . build ( taxoWriter , doc ) ) ; doc = new Document ( ) ; doc . add ( new IntAssociationFacetField ( 1 , "tags" , "lucene" ) ) ; doc . add ( new IntAssociationFacetField ( 2 , "tags" , "solr" ) ) ; doc . add ( new FloatAssociationFacetField ( 0.75F , "genre" , "computing" ) ) ; doc . add ( new FloatAssociationFacetField ( 0.34F , "genre" , "software" ) ) ; indexWriter . addDocument ( config . build ( taxoWriter , doc ) ) ; <START_BUG> indexWriter . close ( ) ; <END_BUG> taxoWriter . close ( ) ; } private List < FacetResult > sumAssociations ( ) throws IOException { } private FacetResult drillDown ( ) throws IOException { } public List < FacetResult > runSumAssociations ( ) throws IOException { } public FacetResult runDrillDown ( ) throws IOException { } public static void main ( String [ ] args ) throws Exception { } }

Fix:
indexWriter . shutdown ( ) ;
Buggy code:
public class BacktrackingGenerator { private static final Direction [ ] [ ] perms = new Direction [ ] [ ] { new Direction [ ] { Direction . UP , Direction . DOWN , Direction . LEFT , Direction . RIGHT } , new Direction [ ] { Direction . DOWN , Direction . LEFT , Direction . RIGHT , Direction . UP } , new Direction [ ] { Direction . RIGHT , Direction . LEFT , Direction . DOWN , Direction . UP } , new Direction [ ] { Direction . LEFT , Direction . UP , Direction . DOWN , Direction . RIGHT } } ; private final Labyrinth labyrinth ; private LabyrinthNode current = null ; private final Random random ; private List < LabyrinthNode > nodeStack = new ArrayList < LabyrinthNode > ( ) ; private Set < LabyrinthNode > alreadyVisited = new HashSet < LabyrinthNode > ( ) ; private void visit ( LabyrinthNode node ) { } public BacktrackingGenerator ( Labyrinth labyrinth ) { } public Labyrinth getLabyrinth ( ) { } public void stepGenerate ( ) { Direction [ ] perm = BacktrackingGenerator . perms [ random . nextInt ( BacktrackingGenerator . perms . length ) ] ; while ( true ) { for ( Direction thetry : perm ) { LabyrinthNode trynode = current . getDirection ( thetry ) ; <START_BUG> if ( ! ( isInsideLaby ( trynode ) ) ) { <END_BUG> continue ; } if ( this . alreadyVisited . contains ( trynode ) ) { continue ; } visit ( trynode ) ; return ; } if ( this . nodeStack . isEmpty ( ) ) return ; current = nodeStack . get ( 0 ) ; nodeStack . remove ( current ) ; } } }

Fix:
if ( ! ( labyrinth . isInsideLaby ( trynode ) ) ) {