nus-yam/ex-repair huggingface dataset:
Buggy code:
public class EventPublicationInterceptorTests { private ApplicationEventPublisher publisher ; @ Before public void setUp ( ) { } @ After public void tearDown ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testWithNoApplicationEventClassSupplied ( ) throws Exception { } @ Test ( expected = IllegalArgumentException . class ) public void testWithNonApplicationEventClassSupplied ( ) throws Exception { } @ Test ( expected = IllegalArgumentException . class ) public void testWithAbstractStraightApplicationEventClassSupplied ( ) throws Exception { } @ Test ( expected = IllegalArgumentException . class ) public void testWithApplicationEventClassThatDoesntExposeAValidCtor ( ) throws Exception { } @ Test public void testExpectedBehavior ( ) throws Exception { TestBean target = new TestBean ( ) ; final TestListener listener = new TestListener ( ) ; class TestContext extends StaticApplicationContext { protected void onRefresh ( ) throws BeansException { addListener ( listener ) ; } } StaticApplicationContext ctx = new TestContext ( ) ; MutablePropertyValues pvs = new MutablePropertyValues ( ) ; <START_BUG> pvs . addPropertyValue ( "applicationEventClass" , EventPublicationInterceptorTests . TestEvent . class . getName ( ) ) ; <END_BUG> ctx . registerSingleton ( "publisher" , EventPublicationInterceptor . class , pvs ) ; ctx . registerSingleton ( "otherListener" , EventPublicationInterceptorTests . FactoryBeanTestListener . class ) ; ctx . refresh ( ) ; EventPublicationInterceptor interceptor = ( ( EventPublicationInterceptor ) ( ctx . getBean ( "publisher" ) ) ) ; ProxyFactory factory = new ProxyFactory ( target ) ; factory . addAdvice ( 0 , interceptor ) ; ITestBean testBean = ( ( ITestBean ) ( factory . getProxy ( ) ) ) ; testBean . getAge ( ) ; assertTrue ( "Interceptor<seq2seq4repair_space>must<seq2seq4repair_space>have<seq2seq4repair_space>published<seq2seq4repair_space>2<seq2seq4repair_space>events" , ( ( listener . getEventCount ( ) ) == 2 ) ) ; TestListener otherListener = ( ( TestListener ) ( ctx . getBean ( "&otherListener" ) ) ) ; assertTrue ( "Interceptor<seq2seq4repair_space>must<seq2seq4repair_space>have<seq2seq4repair_space>published<seq2seq4repair_space>2<seq2seq4repair_space>events" , ( ( otherListener . getEventCount ( ) ) == 2 ) ) ; } public static class TestEvent extends ApplicationEvent { public TestEvent ( Object source ) { } } public static final class TestEventWithNoValidOneArgObjectCtor extends ApplicationEvent { public TestEventWithNoValidOneArgObjectCtor ( ) { } } public static class FactoryBeanTestListener extends TestListener implements FactoryBean { public Object getObject ( ) throws Exception { } public Class getObjectType ( ) { } public boolean isSingleton ( ) { } } }

Fix:
pvs . add ( "applicationEventClass" , EventPublicationInterceptorTests . TestEvent . class . getName ( ) ) ;
Buggy code:
public class CaseStatement extends Statement { public Expression constantExpression ; public CaseLabel targetLabel ; boolean isEnumConstant ; public CaseStatement ( Expression constantExpression , int sourceEnd , int sourceStart ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public StringBuffer printStatement ( int tab , StringBuffer output ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public void resolve ( BlockScope scope ) { } public Constant resolveCase ( BlockScope scope , TypeBinding switchExpressionType , SwitchStatement switchStatement ) { <START_BUG> scope . switchCase = this ; <END_BUG> if ( ( constantExpression ) == null ) { if ( ( switchStatement . defaultCase ) != null ) scope . problemReporter ( ) . duplicateDefaultCase ( this ) ; switchStatement . defaultCase = this ; return NotAConstant ; } switchStatement . cases [ ( ( switchStatement . caseCount ) ++ ) ] = this ; if ( ( switchExpressionType . isEnum ( ) ) && ( ( constantExpression ) instanceof SingleNameReference ) ) { ( ( SingleNameReference ) ( constantExpression ) ) . setActualReceiverType ( ( ( ReferenceBinding ) ( switchExpressionType ) ) ) ; } TypeBinding caseType = constantExpression . resolveType ( scope ) ; if ( ( caseType == null ) || ( switchExpressionType == null ) ) return NotAConstant ; if ( ( constantExpression . isConstantValueOfTypeAssignableToType ( caseType , switchExpressionType ) ) || ( caseType . isCompatibleWith ( switchExpressionType ) ) ) { if ( caseType . isEnum ( ) ) { this . isEnumConstant = true ; if ( ( ( constantExpression ) instanceof NameReference ) && ( ( ( constantExpression . bits ) & ( ASTNode . RestrictiveFlagMASK ) ) == ( Binding . FIELD ) ) ) { NameReference reference = ( ( NameReference ) ( constantExpression ) ) ; FieldBinding field = reference . fieldBinding ( ) ; if ( ( ( field . modifiers ) & ( AccEnum ) ) == 0 ) { scope . problemReporter ( ) . enumSwitchCannotTargetField ( reference , field ) ; } else if ( reference instanceof QualifiedNameReference ) { scope . problemReporter ( ) . cannotUseQualifiedEnumConstantInCaseLabel ( reference , field ) ; } return Constant . fromValue ( field . original ( ) . id ) ; } } else { return constantExpression . constant ; } } else if ( scope . isBoxingCompatibleWith ( switchExpressionType , caseType ) ) { constantExpression . computeConversion ( scope , caseType , switchExpressionType ) ; return constantExpression . constant ; } scope . problemReporter ( ) . typeMismatchError ( caseType , switchExpressionType , constantExpression ) ; return NotAConstant ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
scope . enclosingCase = this ;
Buggy code:
public class MockWebApplication extends WebApplication { private static final long serialVersionUID = 8409647488957949834L ; private final MockServletContext context ; private Page lastRenderedPage ; private final MockHttpServletRequest servletRequest ; private final MockHttpServletResponse servletResponse ; private final MockHttpSession servletSession ; private final ApplicationSettings settings ; private WebRequest wicketRequest ; private WebResponse wicketResponse ; private WebSession wicketSession ; public MockWebApplication ( final String path ) { } public Page getLastRenderedPage ( ) { } public ServletContext getServletContext ( ) { } public MockHttpServletRequest getServletRequest ( ) { } public MockHttpServletResponse getServletResponse ( ) { } public MockHttpSession getServletSession ( ) { } public ApplicationSettings getSettings ( ) { } public WebRequest getWicketRequest ( ) { } public WebResponse getWicketResponse ( ) { } public WebSession getWicketSession ( ) { } public void processRequestCycle ( ) throws ServletException { WebRequestCycle cycle = new WebRequestCycle ( this , wicketSession , wicketRequest , wicketResponse ) ; <START_BUG> cycle . render ( ) ; <END_BUG> lastRenderedPage = cycle . getPage ( ) ; } public WebRequestCycle createRequestCycle ( ) { } public void setupRequestAndResponse ( ) throws IOException { } }

Fix:
cycle . respond ( ) ;
Buggy code:
public class qrcodesample { public static void main ( String [ ] args ) { ByteArrayOutputStream out = QRCode . from ( "Happy<seq2seq4repair_space>New<seq2seq4repair_space>Yeah!!<seq2seq4repair_space>xD" ) . to ( PNG ) . stream ( ) ; try { <START_BUG> FileOutputStream fout = new FileOutputStream ( new File ( "C:\\QR_Code.JPG" ) ) ; <END_BUG> fout . write ( out . toByteArray ( ) ) ; fout . flush ( ) ; fout . close ( ) ; } catch ( FileNotFoundException e ) { } catch ( IOException e ) { } } No newline ; at end ; of file ; }

Fix:
FileOutputStream fout = new FileOutputStream ( new File ( "C:\\QR_Code.PNG" ) ) ;
Buggy code:
public class LiftRedstoneListener extends BlockListener { private final Lift plugin ; public LiftRedstoneListener ( Lift instance ) { } public void onBlockRedstoneChange ( BlockRedstoneEvent event ) { Block block = event . getBlock ( ) ; Elevator elevator = null ; if ( ( ( ( block . getType ( ) ) == ( Material . STONE_BUTTON ) ) && ( ! ( block . isBlockIndirectlyPowered ( ) ) ) ) && ( ( block . getRelative ( UP ) . getType ( ) ) == ( Material . WALL_SIGN ) ) ) { long startTime = System . currentTimeMillis ( ) ; elevator = new Elevator ( this . plugin , block ) ; if ( ( elevator . getTotalFloors ( ) ) < 2 ) return ; int y = block . getY ( ) ; Floor startFloor = elevator . getFloormap ( ) . get ( y ) ; elevator . startFloor = startFloor ; String line = ( ( org . bukkit . block . Sign ) ( block . getRelative ( UP ) . getState ( ) ) ) . getLine ( 2 ) ; if ( line . isEmpty ( ) ) return ; String [ ] splits = line . split ( ":<seq2seq4repair_space>" ) ; if ( ( splits . length ) != 2 ) return ; int destination = Integer . parseInt ( splits [ 1 ] ) ; Floor destFloor = elevator . getFloorFromN ( destination ) ; elevator . destFloor = destFloor ; if ( plugin . debug ) { System . out . println ( ( "Elevator<seq2seq4repair_space>start<seq2seq4repair_space>floor:" + ( startFloor . getFloor ( ) ) ) ) ; System . out . println ( ( "Elevator<seq2seq4repair_space>destination<seq2seq4repair_space>floor:" + destination ) ) ; System . out . println ( ( "Elevator<seq2seq4repair_space>destination<seq2seq4repair_space>y:" + destination ) ) ; } for ( Chunk chunk : elevator . chunks ) { for ( Entity e : chunk . getEntities ( ) ) { if ( elevator . isInShaftAtFloor ( e , startFloor ) ) elevator . addPassenger ( e ) ; } } ArrayList < Floor > glassfloors = new ArrayList < Floor > ( ) ; if ( ( startFloor . getY ( ) ) < ( destFloor . getY ( ) ) ) { for ( int i = ( startFloor . getFloor ( ) ) + 1 ; i <= ( destFloor . getFloor ( ) ) ; i ++ ) { glassfloors . add ( elevator . getFloormap2 ( ) . get ( i ) ) ; } } else { for ( int i = ( destFloor . getFloor ( ) ) + 1 ; i <= ( startFloor . getFloor ( ) ) ; i ++ ) { glassfloors . add ( elevator . getFloormap2 ( ) . get ( i ) ) ; } } for ( Floor f : glassfloors ) { <START_BUG> for ( Block b : elevator . getFloorBlocks ( ) ) { <END_BUG> Block gb = block . getWorld ( ) . getBlockAt ( b . getX ( ) , ( ( f . getY ( ) ) - 2 ) , b . getZ ( ) ) ; gb . setType ( AIR ) ; elevator . glassBlocks . add ( gb ) ; } } for ( Entity p : elevator . getPassengers ( ) ) { if ( ( destFloor . getY ( ) ) > ( startFloor . getY ( ) ) ) { p . setVelocity ( new Vector ( 0.0 , 0.4 , 0.0 ) ) ; elevator . goingUp = true ; } else { p . setVelocity ( new Vector ( 0.0 , ( - 0.4 ) , 0.0 ) ) ; plugin . fallers . add ( p ) ; } } elevator . taskid = plugin . getServer ( ) . getScheduler ( ) . scheduleSyncRepeatingTask ( plugin , elevator , 2 , 2 ) ; long tt = ( System . currentTimeMillis ( ) ) - startTime ; if ( plugin . debug ) System . out . println ( ( "Total<seq2seq4repair_space>time:<seq2seq4repair_space>" + tt ) ) ; } } No newline ; at end ; of file ; }

Fix:
for ( Block b : elevator . floorBlocks ) {
Buggy code:
public class TestLoopController extends JMeterTestCase { public TestLoopController ( String name ) { } public void testProcessing ( ) throws Exception { } public void testLoopZeroTimes ( ) throws Exception { } public void testInfiniteLoop ( ) throws Exception { LoopController loop = new LoopController ( ) ; <START_BUG> loop . setLoops ( ( - 1 ) ) ; <END_BUG> loop . addTestElement ( new TestSampler ( "never<seq2seq4repair_space>run" ) ) ; loop . setRunningVersion ( true ) ; loop . initialize ( ) ; for ( int i = 0 ; i < 42 ; i ++ ) { assertNotNull ( loop . next ( ) ) ; } } public void testBug54467 ( ) throws Exception { } }

Fix:
loop . setLoops ( INFINITE_LOOP_COUNT ) ;
Buggy code:
public final class DefaultClassResolver implements IClassResolver { private ConcurrentHashMap < String , Class > classes = new ConcurrentHashMap < String , Class > ( 64 , 0.75F , 1 ) ; public final Class resolveClass ( final String classname ) { try { Class clz = classes . get ( classname ) ; if ( clz == null ) { synchronized ( classes ) { clz = DefaultClassResolver . class . getClassLoader ( ) . loadClass ( classname ) ; classes . put ( classname , clz ) ; } } return clz ; } catch ( ClassNotFoundException ex ) { <START_BUG> throw new WicketRuntimeException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>class<seq2seq4repair_space>with<seq2seq4repair_space>name:<seq2seq4repair_space>" + classname ) ) ; <END_BUG> } } }

Fix:
throw new WicketRuntimeException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>class<seq2seq4repair_space>with<seq2seq4repair_space>name:<seq2seq4repair_space>" + classname ) , ex ) ;
Buggy code:
@ Service public class ThirdServiceImpl implements ThirdService { @ Autowired private ThirdDAO thirdDAO ; @ Override public Response add ( Third third ) { } @ Override public Third findOne ( Third third ) { <START_BUG> return thirdDAO . getByThird ( third ) ; <END_BUG> } }

Fix:
return thirdDAO . getByThirdUnionId ( third ) ;
Buggy code:
public class WorkbenchLabelProvider extends LabelProvider implements IColorProvider { private Map imageTable ; private Map colorTable ; public static ILabelProvider getDecoratingWorkbenchLabelProvider ( ) { } public WorkbenchLabelProvider ( ) { } protected ImageDescriptor decorateImage ( ImageDescriptor input , Object element ) { } protected String decorateText ( String input , Object element ) { } public final void dispose ( ) { } protected final IWorkbenchAdapter getAdapter ( Object o ) { } protected final IWorkbenchAdapter2 getAdapter2 ( Object o ) { if ( ! ( o instanceof IAdaptable ) ) { return null ; } <START_BUG> return ( ( IWorkbenchAdapter2 ) ( ( ( IAdaptable ) ( o ) ) . getAdapter ( IWorkbenchAdapter . class ) ) ) ; <END_BUG> } public final Image getImage ( Object element ) { } public final String getText ( Object element ) { } public Color getForeground ( Object element ) { } public Color getBackground ( Object element ) { } private Color getColor ( Object element , boolean forground ) { } }

Fix:
return ( ( IWorkbenchAdapter2 ) ( ( ( IAdaptable ) ( o ) ) . getAdapter ( IWorkbenchAdapter2 . class ) ) ) ;
Buggy code:
public class TempFolderFactory implements MailboxTestFactory { public TempFolderFactory ( ) { } <START_BUG> public Folder createFolder ( int folderId ) { <END_BUG> return new org . columba . mail . folder . temp . TempFolder ( ( ( ( FolderTestHelper . homeDirectory ) + "//folders//" ) + folderId ) ) ; } }

Fix:
public MessageFolder createFolder ( int folderId ) {
Buggy code:
public class NullLiteral extends Expression { NullLiteral ( AST ast ) { } public int getNodeType ( ) { } ASTNode clone ( AST target ) { } public boolean subtreeMatch ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } int memSize ( ) { <START_BUG> return ( ASTNode . BASE_NODE_SIZE ) + ( 1 * 4 ) ; <END_BUG> } int treeSize ( ) { } }

Fix:
return ASTNode . BASE_NODE_SIZE ;
Buggy code:
public class FaceletHover implements ITextHover { private IProject _project ; private JSFELHover _elHover ; private HTMLTagInfoHoverProcessor _htmlHoverProcessor ; public FaceletHover ( ) { } public String getHoverInfo ( ITextViewer textViewer , IRegion hoverRegion ) { } public IRegion getHoverRegion ( ITextViewer textViewer , int offset ) { } private boolean isInAttributeValue ( final IStructuredDocumentContext context ) { } private IProject getProject ( final IStructuredDocumentContext context ) { } private class MyHTMLTagInfoHoverProcessor extends HTMLTagInfoHoverProcessor { @ Override protected CMElementDeclaration getCMElementDeclaration ( Node node ) { if ( ( ( ( _project ) != null ) && ( ( node . getNodeType ( ) ) == ( Node . ELEMENT_NODE ) ) ) && ( ( node . getPrefix ( ) ) != null ) ) { final Element element = ( ( Element ) ( node ) ) ; <START_BUG> final FaceletDocumentFactory factory = new FaceletDocumentFactory ( ) ; <END_BUG> final CMElementDeclaration elementDecl = factory . createCMElementDeclaration ( _project , element ) ; if ( elementDecl != null ) { return elementDecl ; } } return super . getCMElementDeclaration ( node ) ; } } }

Fix:
final FaceletDocumentFactory factory = new FaceletDocumentFactory ( _project ) ;
Buggy code:
@ RegisterSystem ( RegisterMode . AUTHORITY ) public class StorageModuleServerSystem extends BaseComponentSystem { @ In private EntityManager entityManager ; @ In private InventoryManager inventoryManager ; @ In private BlockEntityRegistry blockEntityRegistry ; private boolean doNotMoveInventory = false ; @ ReceiveEvent <START_BUG> public void computerModuleSlotChanged ( InventorySlotChangedEvent event , EntityRef computerEntity , ComputerComponent computer , BlockComponent block ) { <END_BUG> if ( ! ( doNotMoveInventory ) ) { ComputerModuleComponent oldModule = event . getOldItem ( ) . getComponent ( ComputerModuleComponent . class ) ; if ( ( oldModule != null ) && ( oldModule . moduleType . equals ( COMPUTER_STORAGE_MODULE_TYPE ) ) ) { dropItemsFromComputerInternalStorage ( computerEntity ) ; } } ComputerModuleComponent newModule = event . getNewItem ( ) . getComponent ( ComputerModuleComponent . class ) ; if ( ( newModule != null ) && ( newModule . moduleType . equals ( COMPUTER_STORAGE_MODULE_TYPE ) ) ) { EntityRef storageEntity = entityManager . create ( ) ; InternalStorageComponent internalStorage = new InternalStorageComponent ( ) ; internalStorage . inventoryEntity = storageEntity ; InventoryComponent inventoryComponent = new InventoryComponent ( 9 ) ; storageEntity . addComponent ( inventoryComponent ) ; computerEntity . addComponent ( internalStorage ) ; } } @ ReceiveEvent public void beforeComputerMoveStopDroppingInventory ( BeforeBlockMovesEvent event , EntityRef entity , ComputerComponent component ) { } @ ReceiveEvent public void afterComputerMoveRestartDroppingInventory ( AfterBlockMovedEvent event , EntityRef entity , ComputerComponent component ) { } @ ReceiveEvent ( priority = EventPriority . PRIORITY_TRIVIAL ) public void computerMovedCopyInternalStorage ( BlockTransitionDuringMoveEvent event , EntityRef entity , InternalStorageComponent storage ) { } private void dropItemsFromComputerInternalStorage ( EntityRef computerEntity ) { } @ ReceiveEvent ( priority = EventPriority . PRIORITY_TRIVIAL ) public void computerDestroyed ( OnBlockToItem event , EntityRef computerEntity , ComputerComponent computer ) { } @ ReceiveEvent public void preventDestructionOfBlocksByOtherInstigators ( PlaceBlocks placeBlocks , EntityRef world ) { } @ ReceiveEvent public void preventDamagingOfBlocks ( BeforeDamagedEvent event , EntityRef entity , MovingBlockReplacementComponent movingBlockReplacementComponent ) { } }

Fix:
public void computerModuleSlotChanged ( InventorySlotChangedEvent event , EntityRef computerEntity , ComputerComponent computer ) {
Buggy code:
public class TestPed { public static class Parameter { protected ArrayList < String > lines ; protected BufferedReader buffer ; protected String filename ; protected boolean isPedigree ; protected String ped_file ; protected String phe_file ; protected String converted_ped_file ; protected String converted_phe_file ; protected String id_file ; protected int [ ] cov_idx ; protected int [ ] phe_idx ; protected int method ; protected boolean adjustment ; protected boolean includeFounder ; protected int replication ; public Parameter ( ) { } public void read ( String file ) throws IOException { } public void sweepComments ( ) throws IOException { boolean flag = true ; String line ; while ( ( line = buffer . readLine ( ) ) != null ) { <START_BUG> if ( Pattern . matches ( "^\\s*////*.*" , line ) ) { <END_BUG> continue ; } else { lines . add ( line ) ; } } } public void parseValue ( ) { } } public static void main ( String [ ] args ) throws IOException { } No newline ; at end ; of file ; }

Fix:
if ( Pattern . matches ( "^////.*" , line ) ) {
Buggy code:
public class TableColumn extends Item { Table parent ; boolean resizable ; boolean moveable ; public TableColumn ( Table parent , int style ) { } public TableColumn ( Table parent , int style , int index ) { } public void addControlListener ( ControlListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } void destroyWidget ( ) { } public int getAlignment ( ) { } String getNameText ( ) { } public Table getParent ( ) { } public boolean getMoveable ( ) { } public boolean getResizable ( ) { } public int getWidth ( ) { } public void pack ( ) { } void releaseHandle ( ) { } void releaseParent ( ) { } public void removeControlListener ( ControlListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void setAlignment ( int alignment ) { } public void setImage ( Image image ) { } void setImage ( Image image , boolean sort , boolean right ) { } public void setMoveable ( boolean moveable ) { } public void setResizable ( boolean resizable ) { } void setSortDirection ( int direction ) { if ( ( OS . COMCTL32_MAJOR ) >= 6 ) { int index = parent . indexOf ( this ) ; if ( index == ( - 1 ) ) return ; int hwnd = parent . handle ; int hwndHeader = OS . SendMessage ( hwnd , LVM_GETHEADER , 0 , 0 ) ; HDITEM hdItem = new HDITEM ( ) ; hdItem . mask = ( OS . HDI_FORMAT ) | ( OS . HDI_IMAGE ) ; OS . SendMessage ( hwndHeader , HDM_GETITEM , index , hdItem ) ; switch ( direction ) { case SWT . UP : hdItem . fmt &= ~ ( ( OS . HDF_IMAGE ) | ( OS . HDF_SORTDOWN ) ) ; hdItem . fmt |= OS . HDF_SORTUP ; break ; case SWT . DOWN : hdItem . fmt &= ~ ( ( OS . HDF_IMAGE ) | ( OS . HDF_SORTUP ) ) ; hdItem . fmt |= OS . HDF_SORTDOWN ; break ; case SWT . NONE : hdItem . fmt &= ~ ( ( OS . HDF_SORTUP ) | ( OS . HDF_SORTDOWN ) ) ; if ( ( image ) != null ) { hdItem . fmt |= OS . HDF_IMAGE ; <START_BUG> hdItem . iImage = parent . imageIndex ( image ) ; <END_BUG> } else { hdItem . fmt &= ~ ( OS . HDF_IMAGE ) ; } break ; } OS . SendMessage ( hwndHeader , HDM_SETITEM , index , hdItem ) ; } else { switch ( direction ) { case SWT . UP : case SWT . DOWN : setImage ( display . getSortImage ( direction ) , true , true ) ; break ; case SWT . NONE : setImage ( image , false , false ) ; break ; } } } public void setText ( String string ) { } public void setWidth ( int width ) { } }

Fix:
hdItem . iImage = parent . imageIndexHeader ( image ) ;
Buggy code:
public class TestExpressionSorts extends LuceneTestCase { private Directory dir ; private IndexReader reader ; private IndexSearcher searcher ; @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; dir = newDirectory ( ) ; RandomIndexWriter iw = new RandomIndexWriter ( random ( ) , dir ) ; int numDocs = TestUtil . nextInt ( random ( ) , 2049 , 4000 ) ; for ( int i = 0 ; i < numDocs ; i ++ ) { Document document = new Document ( ) ; document . add ( newTextField ( "english" , English . intToEnglish ( i ) , NO ) ) ; document . add ( newTextField ( "oddeven" , ( ( i % 2 ) == 0 ? "even" : "odd" ) , NO ) ) ; document . add ( newStringField ( "byte" , ( "" + ( ( byte ) ( random ( ) . nextInt ( ) ) ) ) , NO ) ) ; document . add ( newStringField ( "short" , ( "" + ( ( short ) ( random ( ) . nextInt ( ) ) ) ) , NO ) ) ; document . add ( new org . apache . lucene . document . IntField ( "int" , random ( ) . nextInt ( ) , Store . NO ) ) ; document . add ( new org . apache . lucene . document . LongField ( "long" , random ( ) . nextLong ( ) , Store . NO ) ) ; document . add ( new org . apache . lucene . document . FloatField ( "float" , random ( ) . nextFloat ( ) , Store . NO ) ) ; document . add ( new org . apache . lucene . document . DoubleField ( "double" , random ( ) . nextDouble ( ) , Store . NO ) ) ; document . add ( new org . apache . lucene . document . NumericDocValuesField ( "intdocvalues" , random ( ) . nextInt ( ) ) ) ; document . add ( new org . apache . lucene . document . FloatDocValuesField ( "floatdocvalues" , random ( ) . nextFloat ( ) ) ) ; iw . addDocument ( document ) ; } reader = iw . getReader ( ) ; <START_BUG> iw . close ( ) ; <END_BUG> searcher = newSearcher ( reader ) ; } @ Override public void tearDown ( ) throws Exception { } public void testQueries ( ) throws Exception { } void assertQuery ( Query query , Filter filter ) throws Exception { } void assertQuery ( Query query , Filter filter , Sort sort ) throws Exception { } }

Fix:
iw . shutdown ( ) ;
Buggy code:
class Emitter { private final HashMap < String , LinkRef > linkRefs = new HashMap < String , LinkRef > ( ) ; private final Configuration config ; public boolean useExtensions = false ; public Emitter ( final Configuration config ) { } public void addLinkRef ( final String key , final LinkRef linkRef ) { } public void emit ( final StringBuilder out , final Block root ) { } private void emitLines ( final StringBuilder out , final Block block ) { } private int findToken ( final String in , final int start , final MarkToken token ) { } private int checkLink ( final StringBuilder out , final String in , final int start , final MarkToken token ) { } private int checkHtml ( final StringBuilder out , final String in , final int start ) { } private static int checkEntity ( final StringBuilder out , final String in , final int start ) { } private int recursiveEmitLine ( final StringBuilder out , final String in , final int start , final MarkToken token ) { } private static char whitespaceToSpace ( final char c ) { } private MarkToken getToken ( final String in , final int pos ) { } private void emitMarkedLines ( final StringBuilder out , final Line lines ) { } private void emitRawLines ( final StringBuilder out , final Line lines ) { } private void emitCodeLines ( final StringBuilder out , final Line lines , final String meta , final boolean removeIndent ) { Line line = lines ; if ( ( this . config . codeBlockEmitter ) != null ) { final ArrayList < String > list = new ArrayList < String > ( ) ; while ( line != null ) { if ( line . isEmpty ) { list . add ( "" ) ; } else { list . add ( ( removeIndent ? line . value . substring ( 4 ) : line . value ) ) ; } line = line . next ; } this . config . codeBlockEmitter . emitBlock ( out , list , meta ) ; } else { while ( line != null ) { if ( ! ( line . isEmpty ) ) { <START_BUG> for ( int i = 4 ; i < ( line . value . length ( ) ) ; i ++ ) { <END_BUG> final char c ; switch ( c = line . value . charAt ( i ) ) { case '&' : out . append ( "&amp;" ) ; break ; case '<' : out . append ( "&lt;" ) ; break ; case '>' : out . append ( "&gt;" ) ; break ; default : out . append ( c ) ; break ; } } } out . append ( '\n' ) ; line = line . next ; } } } }

Fix:
for ( int i = ( removeIndent ) ? 4 : 0 ; i < ( line . value . length ( ) ) ; i ++ ) {
Buggy code:
public class StationListFragment extends Fragment { private static final String ARG_PARAM1 = "param1" ; private static final String ARG_PARAM2 = "param2" ; public static final String STATION_LIST_ITEM_CLICK_PATH = "station_list_item_click" ; private String mParam1 ; private String mParam2 ; private Bundle mSavedInstanceState = null ; private StationListViewAdapter mStationListViewAdapter ; private TextView mBikesOrParkingColumn ; private ListView mStationListView ; private StationListFragment . OnStationListFragmentInteractionListener mListener ; private int mLastCheckedPos = - 1 ; public static StationListFragment newInstance ( String param1 , String param2 ) { } public StationListFragment ( ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onResume ( ) { } @ Override public void onAttach ( Activity activity ) { } @ Override public void onDetach ( ) { } @ Override public void onSaveInstanceState ( Bundle outState ) { } @ Override public void onViewStateRestored ( Bundle savedInstanceState ) { } public void setupUI ( StationsNetwork stationsNetwork , LatLng currentUserLatLng , boolean lookingForBike ) { } public Boolean isListReady ( ) { } public void setCurrentUserLatLng ( LatLng currentUserLatLng ) { } public void highlightStationFromName ( String stationName ) { } public StationItem getHighlightedStation ( ) { StationItem toReturn = null ; <START_BUG> if ( ( mStationListView . getCheckedItemPosition ( ) ) != ( AdapterView . INVALID_POSITION ) ) { <END_BUG> toReturn = ( ( StationItem ) ( mStationListViewAdapter . getItem ( mStationListView . getCheckedItemPosition ( ) ) ) ) ; } return toReturn ; } public void removeStationHighlight ( ) { } public void lookingForBikes ( boolean lookingForBike ) { } public interface OnStationListFragmentInteractionListener { void onStationListFragmentInteraction ( Uri uri ) { } } }

Fix:
if ( ( ( mStationListView . getCheckedItemPosition ( ) ) != ( AdapterView . INVALID_POSITION ) ) && ( ( mStationListViewAdapter ) != null ) ) {
Buggy code:
public class FolderFactory { private static final Pattern groupPattern = Pattern . compile ( "([^\\s]+)\\s*" ) ; private static FolderFactory instance ; private FolderPluginHandler handler ; private XmlElement folderlistElement ; private String path = config . getConfigDirectory ( ) . getPath ( ) ; protected FolderFactory ( ) { } public static FolderFactory getInstance ( ) { } public List getPossibleChilds ( AbstractFolder parent ) { List list = new LinkedList ( ) ; <START_BUG> FolderItem item = parent . getFolderItem ( ) ; <END_BUG> String parentType = item . get ( "type" ) ; String parentGroup = getGroup ( parentType ) ; Iterator it = folderlistElement . getElements ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { XmlElement next = ( ( XmlElement ) ( it . next ( ) ) ) ; String possibleParents = next . getAttribute ( "possible_parents" ) ; if ( possibleParents != null ) { Matcher matcher = FolderFactory . groupPattern . matcher ( possibleParents ) ; while ( matcher . find ( ) ) { if ( matcher . group ( 1 ) . equals ( parentGroup ) ) { list . add ( next . getAttribute ( "name" ) ) ; } } } } return list ; } public AbstractFolder createDefaultChild ( AbstractFolder parent , String name ) throws Exception { } public AbstractFolder createChild ( AbstractFolder parent , String name , String childType ) throws Exception { } private String getGroup ( String parentType ) { } }

Fix:
FolderItem item = parent . getConfiguration ( ) ;
Buggy code:
public class TileEntityLaser extends TileEntity implements ILaser { boolean prevIsPowered = false ; boolean isPowered = false ; @ Override public void updateEntity ( ) { if ( ! ( worldObj . isRemote ) ) { for ( ForgeDirection direction : ForgeDirection . VALID_DIRECTIONS ) isPowered = worldObj . isBlockIndirectlyGettingPowered ( ( ( xCoord ) + ( direction . offsetX ) ) , ( ( yCoord ) + ( direction . offsetY ) ) , ( ( zCoord ) + ( direction . offsetZ ) ) ) ; if ( ( isPowered ) && ( ! ( prevIsPowered ) ) ) { <START_BUG> ForgeDirection direction = ForgeDirection . NORTH ; <END_BUG> worldObj . spawnEntityInWorld ( new HxCKDMS . HxCLasers . Entity . EntityLaserBeam ( worldObj , ( ( ( xCoord ) + 0.5 ) + ( direction . offsetX ) ) , ( ( yCoord ) + ( direction . offsetY ) ) , ( ( ( zCoord ) + 0.5 ) + ( direction . offsetZ ) ) , UUID . randomUUID ( ) , direction , 2 ) ) ; } prevIsPowered = isPowered ; } } @ Override public void readFromNBT ( NBTTagCompound tagCompound ) { } @ Override public void writeToNBT ( NBTTagCompound tagCompound ) { } @ Override public boolean isOn ( ) { } }

Fix:
ForgeDirection direction = ForgeDirection . getOrientation ( getBlockMetadata ( ) ) ;
Buggy code:
public class QCodec extends RFC1522Codec implements StringDecoder , StringEncoder { private final String charset ; private static final BitSet PRINTABLE_CHARS = new BitSet ( 256 ) ; private static final byte BLANK = 32 ; private static final byte UNDERSCORE = 95 ; private boolean encodeBlanks = false ; public QCodec ( ) { } public QCodec ( final String charset ) { } protected String getEncoding ( ) { } protected byte [ ] doEncoding ( byte [ ] bytes ) { } protected byte [ ] doDecoding ( byte [ ] bytes ) throws DecoderException { } public String encode ( final String pString , final String charset ) throws EncoderException { if ( pString == null ) { return null ; } try { return encodeText ( pString , charset ) ; } catch ( UnsupportedEncodingException e ) { <START_BUG> throw new EncoderException ( e . getMessage ( ) ) ; <END_BUG> } } public String encode ( String pString ) throws EncoderException { } public String decode ( String pString ) throws DecoderException { } public Object encode ( Object pObject ) throws EncoderException { } public Object decode ( Object pObject ) throws DecoderException { } public String getDefaultCharset ( ) { } public boolean isEncodeBlanks ( ) { } public void setEncodeBlanks ( boolean b ) { } }

Fix:
throw new EncoderException ( e . getMessage ( ) , e ) ;
Buggy code:
public abstract class AbstractAddStepHandler implements OperationStepHandler { public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { final Resource resource = createResource ( context ) ; populateModel ( context , operation , resource ) ; final ModelNode model = resource . getModel ( ) ; if ( requiresRuntime ( context ) ) { context . addStep ( new OperationStepHandler ( ) { public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { final List < ServiceController < ? > > controllers = new ArrayList < ServiceController < ? > > ( ) ; final ServiceVerificationHandler verificationHandler = new ServiceVerificationHandler ( ) ; performRuntime ( context , operation , model , verificationHandler , controllers ) ; if ( requiresRuntimeVerification ( ) ) { context . addStep ( verificationHandler , VERIFY ) ; } context . completeStep ( new OperationContext . RollbackHandler ( ) { @ Override public void handleRollback ( OperationContext context , ModelNode operation ) { rollbackRuntime ( context , operation , model , controllers ) ; } } ) ; } } , RUNTIME ) ; } <START_BUG> context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; <END_BUG> } protected Resource createResource ( final OperationContext context ) { } protected void populateModel ( final OperationContext context , final ModelNode operation , final Resource resource ) throws OperationFailedException { } protected void populateModel ( final ModelNode operation , final Resource resource ) throws OperationFailedException { } protected abstract void populateModel ( final ModelNode operation , final ModelNode model ) throws OperationFailedException { } protected boolean requiresRuntime ( OperationContext context ) { } protected boolean requiresRuntimeVerification ( ) { } protected void performRuntime ( final OperationContext context , final ModelNode operation , final ModelNode model , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers ) throws OperationFailedException { } protected void rollbackRuntime ( OperationContext context , final ModelNode operation , final ModelNode model , List < ServiceController < ? > > controllers ) { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class TransformedSortedBag < E > extends TransformedBag < E > implements SortedBag < E > { private static final long serialVersionUID = - 251737742649401930L ; public static < E > TransformedSortedBag < E > transformingSortedBag ( final SortedBag < E > bag , final Transformer < ? super E , ? extends E > transformer ) { } public static < E > TransformedSortedBag < E > transformedSortedBag ( final SortedBag < E > bag , final Transformer < ? super E , ? extends E > transformer ) { } protected TransformedSortedBag ( final SortedBag < E > bag , final Transformer < ? super E , ? extends E > transformer ) { } protected SortedBag < E > getSortedBag ( ) { <START_BUG> return ( ( SortedBag < E > ) ( collection ) ) ; <END_BUG> } public E first ( ) { } public E last ( ) { } public Comparator < ? super E > comparator ( ) { } }

Fix:
return ( ( SortedBag < E > ) ( TransformedSortedBag . decorated ( ) ) ) ;
Buggy code:
public class Migration3 extends Migration { private Logger logger = Logger . getLogger ( getClass ( ) . getName ( ) ) ; @ Inject private AccessControlService acService ; @ Inject private WorkspacesService wsService ; @ Override public void run ( ) { Topic pluginTopic = dms . getTopic ( "uri" , new SimpleValue ( "org.deepamehta.sign-up" ) ) ; List < Association > configs = pluginTopic . getAssociations ( ) ; boolean hasConfiguration = false ; for ( Association assoc : configs ) { if ( assoc . getPlayer1 ( ) . getTypeUri ( ) . equals ( "org.deepamehta.signup.configuration" ) ) hasConfiguration = true ; } if ( ! hasConfiguration ) { logger . info ( "Sign-up<seq2seq4repair_space>=><seq2seq4repair_space>Assigning<seq2seq4repair_space>default<seq2seq4repair_space>\"Sign-up<seq2seq4repair_space>Configuration\"<seq2seq4repair_space>to<seq2seq4repair_space>\"DeepaMehta<seq2seq4repair_space>4<seq2seq4repair_space>Sign<seq2seq4repair_space>up\"<seq2seq4repair_space>Topic" ) ; dms . createAssociation ( new de . deepamehta . core . model . AssociationModel ( "dm4.core.association" , new TopicRoleModel ( pluginTopic . getId ( ) , "dm4.core.default" ) , new TopicRoleModel ( "org.deepamehta.signup.default_configuration" , "dm4.core.default" ) ) ) ; } else { logger . info ( ( "Sign-up<seq2seq4repair_space>=><seq2seq4repair_space>NOT<seq2seq4repair_space>assigning<seq2seq4repair_space>\"Sign-up<seq2seq4repair_space>Configuration\"<seq2seq4repair_space>to<seq2seq4repair_space>\"DeepaMehta<seq2seq4repair_space>4<seq2seq4repair_space>Sign<seq2seq4repair_space>up\"<seq2seq4repair_space>Topic" + "-<seq2seq4repair_space>Already<seq2seq4repair_space>done!" ) ) ; } <START_BUG> Topic config_topic = dms . getTopic ( "uri" , new SimpleValue ( "org.deepamehta.signup.wikidata_topicmaps_configuration" ) ) ; <END_BUG> Topic systemWorkspace = wsService . getWorkspace ( SYSTEM_WORKSPACE_URI ) ; wsService . assignToWorkspace ( config_topic , systemWorkspace . getId ( ) ) ; } No newline ; at end ; of file ; }

Fix:
Topic config_topic = dms . getTopic ( "uri" , new SimpleValue ( "org.deepamehta.signup.default_configuration" ) ) ;
Buggy code:
public class HighPriorityJob extends Job { public HighPriorityJob ( ) { } @ Override protected void run ( ) { } @ Override protected void addedToQueue ( ) { } public static class Builder extends Job . Builder { public Job build ( ) { <START_BUG> return new SleepForTwentyJob ( ) ; <END_BUG> } } No newline ; at end ; of file ; }

Fix:
return new HighPriorityJob ( ) ;
Buggy code:
public class IndexFiles { private IndexFiles ( ) { } public static void main ( String [ ] args ) { String usage = "java<seq2seq4repair_space>org.apache.lucene.demo.IndexFiles" + ( ( "<seq2seq4repair_space>[-index<seq2seq4repair_space>INDEX_PATH]<seq2seq4repair_space>[-docs<seq2seq4repair_space>DOCS_PATH]<seq2seq4repair_space>[-update]\n\n" + "This<seq2seq4repair_space>indexes<seq2seq4repair_space>the<seq2seq4repair_space>documents<seq2seq4repair_space>in<seq2seq4repair_space>DOCS_PATH,<seq2seq4repair_space>creating<seq2seq4repair_space>a<seq2seq4repair_space>Lucene<seq2seq4repair_space>index" ) + "in<seq2seq4repair_space>INDEX_PATH<seq2seq4repair_space>that<seq2seq4repair_space>can<seq2seq4repair_space>be<seq2seq4repair_space>searched<seq2seq4repair_space>with<seq2seq4repair_space>SearchFiles" ) ; String indexPath = "index" ; String docsPath = null ; boolean create = true ; for ( int i = 0 ; i < ( args . length ) ; i ++ ) { if ( "-index" . equals ( args [ i ] ) ) { indexPath = args [ ( i + 1 ) ] ; i ++ ; } else if ( "-docs" . equals ( args [ i ] ) ) { docsPath = args [ ( i + 1 ) ] ; i ++ ; } else if ( "-update" . equals ( args [ i ] ) ) { create = false ; } } if ( docsPath == null ) { System . err . println ( ( "Usage:<seq2seq4repair_space>" + usage ) ) ; System . exit ( 1 ) ; } final File docDir = new File ( docsPath ) ; if ( ( ! ( docDir . exists ( ) ) ) || ( ! ( docDir . canRead ( ) ) ) ) { System . out . println ( ( ( "Document<seq2seq4repair_space>directory<seq2seq4repair_space>'" + ( docDir . getAbsolutePath ( ) ) ) + "'<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist<seq2seq4repair_space>or<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>readable,<seq2seq4repair_space>please<seq2seq4repair_space>check<seq2seq4repair_space>the<seq2seq4repair_space>path" ) ) ; System . exit ( 1 ) ; } Date start = new Date ( ) ; try { System . out . println ( ( ( "Indexing<seq2seq4repair_space>to<seq2seq4repair_space>directory<seq2seq4repair_space>'" + indexPath ) + "'..." ) ) ; Directory dir = FSDirectory . open ( new File ( indexPath ) ) ; Analyzer analyzer = new org . apache . lucene . analysis . standard . StandardAnalyzer ( Version . LUCENE_50 ) ; IndexWriterConfig iwc = new IndexWriterConfig ( Version . LUCENE_50 , analyzer ) ; if ( create ) { iwc . setOpenMode ( CREATE ) ; } else { iwc . setOpenMode ( CREATE_OR_APPEND ) ; } IndexWriter writer = new IndexWriter ( dir , iwc ) ; IndexFiles . indexDocs ( writer , docDir ) ; <START_BUG> writer . close ( ) ; <END_BUG> Date end = new Date ( ) ; System . out . println ( ( ( ( end . getTime ( ) ) - ( start . getTime ( ) ) ) + "<seq2seq4repair_space>total<seq2seq4repair_space>milliseconds" ) ) ; } catch ( IOException e ) { System . out . println ( ( ( ( "<seq2seq4repair_space>caught<seq2seq4repair_space>a<seq2seq4repair_space>" + ( e . getClass ( ) ) ) + "\n<seq2seq4repair_space>with<seq2seq4repair_space>message:<seq2seq4repair_space>" ) + ( e . getMessage ( ) ) ) ) ; } } static void indexDocs ( IndexWriter writer , File file ) throws IOException { } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class MainReweavableLogging implements Advisable { private static List joinPoints = new ArrayList ( ) ; public void test1 ( ) { } public void test2 ( ) { } public void addJoinPoint ( String name ) { } public static void main ( String [ ] args ) { <START_BUG> String ERROR_STRING = "error<seq2seq4repair_space>aspect<seq2seq4repair_space>'ataspectj.ltwreweavable.AspectReweavableLogging'<seq2seq4repair_space>woven<seq2seq4repair_space>into<seq2seq4repair_space>'ataspectj.ltwreweavable.MainReweavableLogging'<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>declared<seq2seq4repair_space>in<seq2seq4repair_space>an<seq2seq4repair_space>aop.xml<seq2seq4repair_space>file." ; <END_BUG> if ( Boolean . getBoolean ( "aspectDeclared" ) ) { if ( MessageHolder . startsAs ( Arrays . asList ( new String [ ] { ERROR_STRING } ) ) ) { MessageHolder . dump ( ) ; throw new RuntimeException ( ( ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>MainReweavableLogging<seq2seq4repair_space>-<seq2seq4repair_space>unexpected<seq2seq4repair_space>error<seq2seq4repair_space>message<seq2seq4repair_space>-<seq2seq4repair_space>\"" + ERROR_STRING ) + "\"" ) ) ; } } else { if ( ! ( MessageHolder . startsAs ( Arrays . asList ( new String [ ] { ERROR_STRING } ) ) ) ) { MessageHolder . dump ( ) ; throw new RuntimeException ( ( ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>MainReweavableLogging<seq2seq4repair_space>-<seq2seq4repair_space>missing<seq2seq4repair_space>expected<seq2seq4repair_space>error<seq2seq4repair_space>message<seq2seq4repair_space>-<seq2seq4repair_space>\"" + ERROR_STRING ) + "\"" ) ) ; } } } }

Fix:
String ERROR_STRING = "error<seq2seq4repair_space>aspect<seq2seq4repair_space>'ataspectj.ltwreweavable.AspectReweavableLogging'<seq2seq4repair_space>woven<seq2seq4repair_space>into<seq2seq4repair_space>'ataspectj.ltwreweavable.MainReweavableLogging'<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>defined<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>weaver<seq2seq4repair_space>(placed<seq2seq4repair_space>on<seq2seq4repair_space>the<seq2seq4repair_space>aspectpath,<seq2seq4repair_space>or<seq2seq4repair_space>defined<seq2seq4repair_space>in<seq2seq4repair_space>an<seq2seq4repair_space>aop.xml<seq2seq4repair_space>file<seq2seq4repair_space>if<seq2seq4repair_space>using<seq2seq4repair_space>LTW)." ;
Buggy code:
public abstract class Device implements Drawable { public static boolean DEBUG ; boolean debug = Device . DEBUG ; boolean tracking = Device . DEBUG ; Error [ ] errors ; Object [ ] objects ; public int hPalette = 0 ; int [ ] colorRefCount ; int systemFont ; int nFonts = 256 ; LOGFONT [ ] logFonts ; TEXTMETRIC metrics ; int [ ] pixels ; int [ ] scripts ; int [ ] gdipToken ; boolean disposed ; static final Object CREATE_LOCK = new Object ( ) ; protected static Device CurrentDevice ; protected static Runnable DeviceFinder ; static synchronized Device getDevice ( ) { } public Device ( ) { } public Device ( DeviceData data ) { } protected void checkDevice ( ) { } void checkGDIP ( ) { if ( ( gdipToken ) != null ) return ; int oldErrorMode = OS . SetErrorMode ( SEM_FAILCRITICALERRORS ) ; try { int [ ] token = new int [ 1 ] ; GdiplusStartupInput input = new GdiplusStartupInput ( ) ; input . GdiplusVersion = 1 ; if ( ( Gdip . GdiplusStartup ( token , input , 0 ) ) == 0 ) { gdipToken = token ; } } catch ( Throwable t ) { <START_BUG> SWT . error ( ERROR_NO_GRAPHICS_LIBRARY , t ) ; <END_BUG> } finally { OS . SetErrorMode ( oldErrorMode ) ; } } protected void create ( DeviceData data ) { } int computePixels ( int height ) { } int computePoints ( LOGFONT logFont , int hFont ) { } protected void destroy ( ) { } public void dispose ( ) { } void dispose_Object ( Object object ) { } int EnumFontFamProc ( int lpelfe , int lpntme , int FontType , int lParam ) { } public Rectangle getBounds ( ) { } public DeviceData getDeviceData ( ) { } public Rectangle getClientArea ( ) { } public int getDepth ( ) { } public Point getDPI ( ) { } public FontData [ ] getFontList ( String faceName , boolean scalable ) { } String getLastError ( ) { } String getLastErrorText ( ) { } public Color getSystemColor ( int id ) { } public Font getSystemFont ( ) { } public boolean getWarnings ( ) { } protected void init ( ) { } public abstract int internal_new_GC ( GCData data ) { } public abstract void internal_dispose_GC ( int hDC , GCData data ) { } public boolean isDisposed ( ) { } void new_Object ( Object object ) { } protected void release ( ) { } public void setWarnings ( boolean warnings ) { } }

Fix:
SWT . error ( ERROR_NO_GRAPHICS_LIBRARY , t , "<seq2seq4repair_space>[GDI+<seq2seq4repair_space>is<seq2seq4repair_space>required]" ) ;
Buggy code:
public class RegisterTasklet extends AbstractResourceRegisterer { protected void registerResource ( final String name , final String classname , final URL url ) throws AntException , RegistryException { if ( null == classname ) { try { m_engine . getTskDeployer ( ) . deployTasklet ( name , url . toString ( ) , url ) ; } catch ( final DeploymentException de ) { throw new AntException ( ( ( ( "Failed<seq2seq4repair_space>deploying<seq2seq4repair_space>" + name ) + "<seq2seq4repair_space>from<seq2seq4repair_space>" ) + url ) , de ) ; } } else { final DefaultLocator locator = new DefaultLocator ( classname , url ) ; <START_BUG> m_engine . getLocatorRegistry ( ) . register ( name , locator ) ; <END_BUG> } } }

Fix:
m_engine . getRegistry ( ) . register ( name , locator ) ;
Buggy code:
public class GameScreen implements Screen { private static final int NUM_COLUMNS = 19 ; private static final String FROG_IMAGE_NAME = "images//frog-googly-eyes.png" ; private final Random randomGenerator = new Random ( ) ; InputProcessor gameInput ; TourDeFrogsGame game ; public Set < Frog > frogs = new HashSet < Frog > ( ) ; public Set < Vehicle > vehicles = new HashSet < Vehicle > ( ) ; private SpriteBatch batch ; private BitmapFont font ; private Music backgroundMusic ; private ShapeRenderer sr ; public Frog testFrog ; public GameScreen ( TourDeFrogsGame game ) { } @ Override public void render ( float delta ) { } private void drawLanes ( ) { for ( Lane l : Lane . values ( ) ) { <START_BUG> for ( int xpos = ( ( int ) ( ( ( image . getScaleX ( ) ) * ( image . getWidth ( ) ) ) // 2 ) ) ; xpos <= ( graphics . getDisplayMode ( ) . width ) ; xpos += ( image . getWidth ( ) ) * ( image . getScaleX ( ) ) ) { <END_BUG> image . setCenter ( xpos , l . getPosy ( ) ) ; image . draw ( batch ) ; } } } protected void generateFrogs ( ) { } @ Override public void show ( ) { } @ 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:
for ( int xpos = ( ( int ) ( ( ( image . getScaleX ( ) ) * ( image . getWidth ( ) ) ) // 2 ) ) ; xpos <= ( TourDeFrogsGame . CANVAS_SIZE_X ) ; xpos += ( image . getWidth ( ) ) * ( image . getScaleX ( ) ) ) {