nus-yam/ex-repair huggingface dataset:
Buggy code:
public class AptCompilerAdapter extends DefaultCompilerAdapter { private static final int APT_COMPILER_SUCCESS = 0 ; public static final String APT_ENTRY_POINT = "com.sun.tools.apt.Main" ; public static final String APT_METHOD_NAME = "compile" ; protected Apt getApt ( ) { } static void setAptCommandlineSwitches ( Apt apt , Commandline cmd ) { <START_BUG> if ( apt . isNoCompile ( ) ) { <END_BUG> cmd . createArgument ( ) . setValue ( "-nocompile" ) ; } String factory = apt . getFactory ( ) ; if ( factory != null ) { cmd . createArgument ( ) . setValue ( "-factory" ) ; cmd . createArgument ( ) . setValue ( factory ) ; } Path factoryPath = apt . getFactoryPath ( ) ; if ( factoryPath != null ) { cmd . createArgument ( ) . setValue ( "-factorypath" ) ; cmd . createArgument ( ) . setPath ( factoryPath ) ; } File preprocessDir = apt . getPreprocessDir ( ) ; if ( preprocessDir != null ) { cmd . createArgument ( ) . setValue ( "-s" ) ; cmd . createArgument ( ) . setFile ( preprocessDir ) ; } Vector options = apt . getOptions ( ) ; Enumeration elements = options . elements ( ) ; Apt . Option opt ; StringBuffer arg = null ; while ( elements . hasMoreElements ( ) ) { opt = ( ( Apt . Option ) ( elements . nextElement ( ) ) ) ; arg = new StringBuffer ( ) ; arg . append ( "-A" ) . append ( opt . getName ( ) ) ; if ( ( opt . getValue ( ) ) != null ) { arg . append ( "=" ) . append ( opt . getValue ( ) ) ; } cmd . createArgument ( ) . setValue ( arg . toString ( ) ) ; } } protected void setAptCommandlineSwitches ( Commandline cmd ) { } public boolean execute ( ) throws BuildException { } }

Fix:
if ( ! ( apt . isCompile ( ) ) ) {
Buggy code:
final class AnnotationMetadataReadingVisitor extends ClassMetadataReadingVisitor implements AnnotationMetadata { private final ClassLoader classLoader ; private final Set < String > annotationSet = new LinkedHashSet < String > ( ) ; private final Map < String , Set < String > > metaAnnotationMap = new LinkedHashMap < String , Set < String > > ( ) ; private final Map < String , Map < String , Object > > attributeMap = new LinkedHashMap < String , Map < String , Object > > ( ) ; private final Set < MethodMetadata > methodMetadataSet = new LinkedHashSet < MethodMetadata > ( ) ; public AnnotationMetadataReadingVisitor ( ClassLoader classLoader ) { } @ Override public MethodVisitor visitMethod ( int access , String name , String desc , String signature , String [ ] exceptions ) { <START_BUG> MethodMetadataReadingVisitor mm = new MethodMetadataReadingVisitor ( name , access , this . classLoader ) ; <END_BUG> this . methodMetadataSet . add ( mm ) ; return mm ; } @ Override public AnnotationVisitor visitAnnotation ( final String desc , boolean visible ) { } public Set < String > getAnnotationTypes ( ) { } public Set < String > getMetaAnnotationTypes ( String annotationType ) { } public boolean hasAnnotation ( String annotationType ) { } public boolean hasMetaAnnotation ( String metaAnnotationType ) { } public boolean isAnnotated ( String annotationType ) { } public Map < String , Object > getAnnotationAttributes ( String annotationType ) { } public Map < String , Object > getAnnotationAttributes ( String annotationType , boolean classValuesAsString ) { } public boolean hasAnnotatedMethods ( String annotationType ) { } public Set < MethodMetadata > getAnnotatedMethods ( String annotationType ) { } }

Fix:
MethodMetadataReadingVisitor mm = new MethodMetadataReadingVisitor ( name , access , this . getClassName ( ) , this . classLoader ) ;
Buggy code:
public class ParentResolver implements IComponentResolver { private static final long serialVersionUID = 1L ; public boolean resolve ( final MarkupContainer container , final MarkupStream markupStream , final ComponentTag tag ) { MarkupContainer parent = container ; <START_BUG> while ( ( parent != null ) && ( parent . isTransparent ( ) ) ) { <END_BUG> parent = parent . getParent ( ) ; if ( parent != null ) { Component component = parent . get ( tag . getId ( ) ) ; if ( component != null ) { component . render ( markupStream ) ; return true ; } } } parent = container . getParent ( ) ; if ( parent instanceof IComponentResolver ) { return ( ( IComponentResolver ) ( parent ) ) . resolve ( container , markupStream , tag ) ; } return false ; } }

Fix:
while ( ( parent != null ) && ( parent . isTransparentResolver ( ) ) ) {
Buggy code:
public class Apartment { private int m_id ; private String m_street ; private int m_buildNo ; private String m_housing ; private int m_price ; private int m_floor ; private int m_totalFloors ; private int m_countRooms ; private boolean m_hasBalcony ; private int m_buildTypeId ; private int m_yearBuild ; private String m_agencyName ; private String m_agentName ; private String m_agentPhone ; Apartment ( String street , int buildNo , String housing , int price , int floor , int totalFloors , int countRooms , boolean hasBalcony , int buildTypeId , int yearBuild , String agencyName , String agentName , String agentPhone ) { } Apartment ( ) { } public boolean isEmpty ( ) { <START_BUG> return getStreet ( ) . isEmpty ( ) ; <END_BUG> } public void setId ( int _id ) { } public int getId ( ) { } public void setStreet ( String _street ) { } public String getStreet ( ) { } public void setBuildNo ( int _buildNo ) { } public int getBuildNo ( ) { } public void setHousing ( String _house ) { } public String getHousing ( ) { } public void setPrice ( int _price ) { } public int getPrice ( ) { } public void setFloor ( int _floor ) { } public int getFloor ( ) { } public void setTotalFloors ( int _tf ) { } public int getTotalFloors ( ) { } public void setCountRooms ( int _cr ) { } public int getCountRooms ( ) { } public void setBalcony ( boolean _b ) { } public boolean hasBalcony ( ) { } public void setBuildTypeId ( int _btId ) { } public int getBuildTypeId ( ) { } public void setYearBuild ( int _yb ) { } public int getYearBuild ( ) { } public void setAgencyName ( String _agName ) { } public String getAgencyName ( ) { } public void setAgentName ( String _aName ) { } public String getAgentName ( ) { } public void setAgentPhone ( String _phone ) { } public String getAgentPhone ( ) { } }

Fix:
return getStreet ( ) . equals ( "" ) ;
Buggy code:
public class DataDownloader implements Runnable { protected static final Logger logger = LoggerFactory . getLogger ( DataDownloader . class ) ; private LinkedBlockingQueue < Chunk > queue ; private Address addr ; public DataDownloader ( Address addr , LinkedBlockingQueue < Chunk > queue ) { } @ Override public void run ( ) { try { URL url = new URL ( addr . getUrl_addr ( ) ) ; BufferedInputStream is = new BufferedInputStream ( url . openStream ( ) ) ; int chunk_seq = 0 ; byte [ ] buffer = new byte [ Config . MAX_CHUNK_SIZE ] ; while ( ( is . read ( buffer , 0 , MAX_CHUNK_SIZE ) ) != ( - 1 ) ) { Chunk chunk = new Chunk ( ) ; chunk . setChunk_id ( UUID . randomUUID ( ) ) ; <START_BUG> chunk . setChunk_seq_id ( chunk_seq ) ; <END_BUG> chunk . setUrl_id ( addr . getUrl_id ( ) ) ; chunk . setChunk_data ( new String ( buffer ) ) ; queue . put ( chunk ) ; } Chunk marker = new Chunk ( ) ; marker . setChunk_seq_id ( Integer . MIN_VALUE ) ; queue . put ( marker ) ; is . close ( ) ; DataDownloader . logger . info ( "Download<seq2seq4repair_space>finished." ) ; } catch ( IOException | InterruptedException e ) { DataDownloader . logger . error ( "{}" , e ) ; System . exit ( ( - 1 ) ) ; } } }

Fix:
chunk . setChunk_seq_id ( ( chunk_seq ++ ) ) ;
Buggy code:
public abstract class MSVSS extends Task { private static final String SS_EXE = "ss" ; public static final String PROJECT_PREFIX = "$" ; public static final String COMMAND_GET = "Get" ; public static final String COMMAND_CHECKOUT = "Checkout" ; public static final String COMMAND_CHECKIN = "Checkin" ; public static final String COMMAND_LABEL = "Label" ; public static final String COMMAND_HISTORY = "History" ; public static final String FLAG_LOGIN = "-Y" ; public static final String FLAG_OVERRIDE_WORKING_DIR = "-GL" ; public static final String FLAG_AUTORESPONSE_DEF = "-I-" ; public static final String FLAG_AUTORESPONSE_YES = "-I-Y" ; public static final String FLAG_AUTORESPONSE_NO = "-I-N" ; public static final String FLAG_RECURSION = "-R" ; public static final String FLAG_VERSION = "-V" ; public static final String FLAG_VERSION_DATE = "-Vd" ; public static final String FLAG_VERSION_LABEL = "-VL" ; public static final String FLAG_WRITABLE = "-W" ; public static final String VALUE_NO = "-N" ; public static final String VALUE_YES = "-Y" ; public static final String FLAG_QUIET = "-O-" ; private String m_SSDir = "" ; private String m_vssLogin = null ; private String m_vssPath = null ; private String m_serverPath = null ; public final void setLogin ( String login ) { } public final void setServerpath ( String serverPath ) { } public final void setSsdir ( String dir ) { } public final void setVsspath ( String vssPath ) { } public final String getSSCommand ( ) { } public void getLoginCommand ( Commandline cmd ) { } public String getVsspath ( ) { } protected int run ( Commandline cmd ) { try { Execute exe = new Execute ( new org . apache . tools . ant . taskdefs . LogStreamHandler ( this , Project . MSG_INFO , Project . MSG_WARN ) ) ; if ( ( m_serverPath ) != null ) { String [ ] env = exe . getEnvironment ( ) ; if ( env == null ) { env = new String [ 0 ] ; } String [ ] newEnv = new String [ ( env . length ) + 1 ] ; for ( int i = 0 ; i < ( env . length ) ; i ++ ) { newEnv [ i ] = env [ i ] ; } newEnv [ env . length ] = "SSDIR=" + ( m_serverPath ) ; exe . setEnvironment ( newEnv ) ; } exe . setAntRun ( project ) ; exe . setWorkingDirectory ( project . getBaseDir ( ) ) ; exe . setCommandline ( cmd . getCommandline ( ) ) ; return exe . execute ( ) ; } catch ( IOException e ) { <START_BUG> throw new BuildException ( e ) ; <END_BUG> } } }

Fix:
throw new BuildException ( "Error" , e ) ;
Buggy code:
@ VisPlugin public class SpineSupport implements EntitySupport { private SkeletonRenderer skeletonRenderer ; public SpineSupport ( ) { } @ Override public void setLoaders ( AssetManager manager ) { } @ Override public void resolveDependencies ( Array < AssetDescriptor > dependencies , EntityData entityData , Component component ) { } @ Override public void registerSystems ( RuntimeConfiguration configuration , AssetManager manager , EntityEngine engine ) { RenderBatchingSystem renderBatchingSystem = engine . getSystem ( RenderBatchingSystem . class ) ; engine . setSystem ( new SpineRenderSystem ( renderBatchingSystem ) , true ) ; <START_BUG> engine . setSystem ( new SpineInflaterSystem ( configuration , manager ) , configuration . passiveInflaters ) ; <END_BUG> } }

Fix:
engine . setSystem ( new SpineInflaterSystem ( configuration , manager ) ) ;
Buggy code:
public class PagedTableNavigatorTest extends TestCase { public PagedTableNavigatorTest ( ) { } public PagedTableNavigatorTest ( String name ) { } @ SuppressWarnings ( "unchecked" ) public void testPagedTable ( ) throws Exception { } private boolean validatePage ( final String document , final String file ) throws IOException { <START_BUG> return DiffUtil . validatePage ( document , this . getClass ( ) , file ) ; <END_BUG> } }

Fix:
return DiffUtil . validatePage ( document , this . getClass ( ) , file , true ) ;
Buggy code:
public class Activator implements BundleActivator { private BundleContext context ; private ServiceTracker serviceTracker ; private static Activator plugin ; public static Activator getDefault ( ) { } public void start ( BundleContext ctxt ) throws Exception { } public void stop ( BundleContext context ) throws Exception { } public IDocumentSynchronizationStrategyFactory [ ] getSynchStrategyFactories ( ) { } public IDocumentSynchronizationStrategyFactory getSynchStrategyFactory ( String serviceProvider ) { if ( ( serviceTracker ) == null ) { serviceTracker = new ServiceTracker ( context , IDocumentSynchronizationStrategyFactory . class . getName ( ) , null ) ; serviceTracker . open ( ) ; } ServiceReference [ ] refs = serviceTracker . getServiceReferences ( ) ; if ( refs == null ) return null ; IDocumentSynchronizationStrategyFactory result = null ; for ( int i = 0 ; i < ( refs . length ) ; i ++ ) { <START_BUG> String prop = ( ( String ) ( refs [ i ] . getProperty ( SYNCSTRATEGY_TYPE_PROPERTY ) ) ) ; <END_BUG> if ( ( prop != null ) && ( prop . equals ( serviceProvider ) ) ) { result = ( ( IDocumentSynchronizationStrategyFactory ) ( serviceTracker . getService ( refs [ i ] ) ) ) ; } } return result ; } public IDocumentSynchronizationStrategyFactory getColaSynchronizationStrategyFactory ( ) { } public IDocumentSynchronizationStrategyFactory getIdentitySynchronizationStrategy ( ) { } }

Fix:
String prop = ( ( String ) ( refs [ i ] . getProperty ( SYNCSTRATEGY_PROVIDER_PROPETY ) ) ) ;
Buggy code:
public class MainActivity extends BaseActivity { @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( ac_main ) ; netRequest . get ( "http:////www.baidu.com" , null , new RequestHandler ( ) { @ Override public void start ( ) { } @ Override <START_BUG> public void success ( JsonObject jsonObject ) { <END_BUG> } @ Override public void failure ( String responseBody , Throwable error ) { } @ Override public void finish ( ) { } } ) ; } }

Fix:
public void success ( String response ) {
Buggy code:
public interface MultipartFile { String getName ( ) { } String getOriginalFilename ( ) { } String getContentType ( ) { } boolean isEmpty ( ) { } long getSize ( ) { } byte [ ] getBytes ( ) throws IOException { } InputStream getInputStream ( ) throws IOException { } void transferTo ( File dest ) throws IOException , IllegalStateException { } String getHeader ( String name ) { } String [ ] getHeaders ( String name ) { } <START_BUG> Iterator < String > getHeaderNames ( String name ) ; <END_BUG> }

Fix:
Iterator < String > getHeaderNames ( ) ;
Buggy code:
public class JBossContextConfig extends ContextConfig { private DeploymentUnit deploymentUnitContext = null ; private Set < String > overlays = new HashSet < String > ( ) ; private final InjectedValue < DistributedCacheManagerFactory > factory = new InjectedValue < DistributedCacheManagerFactory > ( ) ; private Map < String , AuthenticatorValve > authenValves = null ; public JBossContextConfig ( DeploymentUnit deploymentUnitContext ) { } public JBossContextConfig ( DeploymentUnit deploymentUnitContext , WebServerService service ) { } @ Override public void lifecycleEvent ( LifecycleEvent event ) { } @ Override protected void applicationWebConfig ( ) { } @ Override protected void defaultWebConfig ( ) { } protected void processJBossWebMetaData ( JBossWebMetaData metaData ) { } protected Object getInstance ( String moduleName , String className , List < ParamValueMetaData > params ) { } protected void processWebMetaData ( JBossWebMetaData metaData ) { } @ Override protected void init ( ) { } @ Override protected void destroy ( ) { } @ Override protected void applicationTldConfig ( ) { } protected void processTld ( ArrayList < TagLibraryInfo > tagLibraries , String location , TldMetaData tldMetaData ) { } @ Override public void applicationServletContainerInitializerConfig ( ) { } @ Override protected void createFragmentsOrder ( ) { } @ Override protected void applicationExtraDescriptorsConfig ( ) { } protected void resolveAnnotations ( JBossAnnotationsMetaData annotations ) { } @ Override protected void completeConfig ( ) { final WarMetaData warMetaData = deploymentUnitContext . getAttachment ( ATTACHMENT_KEY ) ; JBossWebMetaData metaData = warMetaData . getMergedJBossWebMetaData ( ) ; if ( ( ok ) && ( metaData != null ) ) { metaData . resolveAnnotations ( ) ; resolveAnnotations ( metaData . getAnnotations ( ) ) ; } if ( ok ) { resolveServletSecurity ( ) ; } if ( ok ) { validateSecurityRoles ( ) ; } if ( ( ok ) && ( metaData != null ) ) { metaData . resolveRunAs ( ) ; } if ( ok ) { <START_BUG> if ( ( authenValves ) != null ) { <END_BUG> Map < String , Valve > authenvalves = new HashMap < String , Valve > ( ) ; for ( String name : authenValves . keySet ( ) ) { AuthenticatorValve authenvalve = ( ( AuthenticatorValve ) ( authenValves . get ( name ) ) ) ; Valve valve = null ; try { valve = ( ( Valve ) ( authenvalve . classz . newInstance ( ) ) ) ; } catch ( InstantiationException e ) { ok = false ; break ; } catch ( IllegalAccessException e ) { ok = false ; break ; } if ( ( authenvalve . properties ) != null ) { for ( String pro : authenvalve . properties . keySet ( ) ) { IntrospectionUtils . setProperty ( valve , pro , authenvalve . properties . get ( pro ) ) ; } } authenvalves . put ( name , valve ) ; } if ( ok ) setCustomAuthenticators ( authenvalves ) ; } } if ( ok ) { authenticatorConfig ( ) ; } if ( ! ( ok ) ) { WEB_LOGGER . unavailable ( context . getName ( ) ) ; context . setConfigured ( false ) ; } } Injector < DistributedCacheManagerFactory > getDistributedCacheManagerFactoryInjector ( ) { } }

Fix:
if ( ! ( authenValves . isEmpty ( ) ) ) {
Buggy code:
public class SetSwitchResponse extends Response { public SetSwitchResponse ( Request request , String responseText ) { } @ Override protected void decodeResponseText ( String responseText ) { try { JSONObject obj = new JSONObject ( responseText ) ; if ( ! ( obj . getBoolean ( RESULT ) ) ) { <START_BUG> setError ( obj . getInt ( ERROR_CODE ) ) ; <END_BUG> } } catch ( JSONException e ) { setError ( JSON_PARSE_ERROR , e . getMessage ( ) ) ; } } }

Fix:
setError ( obj . getInt ( ERROR_CODE ) , obj . getString ( MESSAGE ) ) ;
Buggy code:
public class CFrame { public double wheelvelocity ; private boolean isDraggingProgress ; private boolean isMouseInside ; private int ix ; private int iy ; private ShadowWindow shadows ; private JFrame frame ; public CCanvas canvas ; public CFrame ( ) { } public void update ( ) { if ( ( Math . abs ( this . wheelvelocity ) ) > 0.1 ) this . wheelvelocity = ( wheelvelocity ) // 1.1 ; else this . wheelvelocity = 0 ; if ( ! ( this . canvas . state ) ) <START_BUG> this . canvas . progression += 10 ; <END_BUG> if ( this . isVisible ( ) ) { if ( ! ( this . shadows . isVisible ( ) ) ) { shadows . setVisible ( true ) ; frame . setVisible ( true ) ; } Res . restore ( ) ; this . canvas . update ( this . canvas . getGraphics ( ) ) ; if ( PlaylistHolder . doOneNeedSave ( ) ) PlaylistHolder . saveAll ( ) ; } else shadows . setVisible ( false ) ; } public boolean isOnPos ( int x1 , int y1 , int x2 , int y2 ) { } public boolean isMouseInside ( ) { } public boolean isVisible ( ) { } public void changeSize ( int width , int height ) { } }

Fix:
this . canvas . progression += 20 ;
Buggy code:
public class DictionaryToDicUI { public static String inputDataPath = ".//dati//" ; protected static String splitPattern = "\\s(?=(GR|RU|NO|NS|PI|PN|FS|FR|FN|FP|DS|DE|DG|AN|DN|CD|LI|NG|AG|PG|FG)\\s)|" + "\\s(?=IN\\s([^I]|I[^N]|IN[^\\s]))" ; protected static String removePattern = "\\s(@5|@2)((?=\\s)|$)" ; public static void main ( String [ ] args ) throws IOException { } protected static String [ ] convertEntry ( String entry ) { } protected static void printEntry ( String [ ] entryElements , BufferedWriter out ) throws IOException { for ( String elem : entryElements ) { <START_BUG> out . write ( elem ) ; <END_BUG> out . newLine ( ) ; } out . newLine ( ) ; out . flush ( ) ; } }

Fix:
out . write ( elem . trim ( ) ) ;
Buggy code:
public class EventHandler { @ SubscribeEvent @ SideOnly ( Side . CLIENT ) public void onKey ( InputEvent . KeyInputEvent event ) { } @ SubscribeEvent public void onLivingUpdate ( LivingUpdateEvent event ) { } @ SubscribeEvent public void onConfigChanged ( ConfigChangedEvent . OnConfigChangedEvent event ) { } @ SubscribeEvent public void onWorldSave ( WorldEvent . Save event ) { } @ SubscribeEvent public void onWorldUnload ( WorldEvent . Unload event ) { } @ SubscribeEvent public void onWorldLoad ( WorldEvent . Load event ) { if ( ( event . world . isRemote ) || ( ( BQ_Settings . curWorldDir ) != null ) ) { return ; } MinecraftServer server = MinecraftServer . getServer ( ) ; if ( proxy . isClient ( ) ) { BQ_Settings . curWorldDir = server . getFile ( ( "saves//" + ( server . getFolderName ( ) ) ) ) ; } else { BQ_Settings . curWorldDir = server . getFile ( server . getFolderName ( ) ) ; } File f1 = new File ( BQ_Settings . curWorldDir , "QuestDatabase.json" ) ; JsonObject j1 = new JsonObject ( ) ; if ( f1 . exists ( ) ) { j1 = JsonIO . ReadFromFile ( f1 ) ; } else { <START_BUG> f1 = server . getFile ( ( ( BQ_Settings . defaultDir ) + "DefaultQuests.json" ) ) ; <END_BUG> if ( f1 . exists ( ) ) { j1 = JsonIO . ReadFromFile ( f1 ) ; } } QuestDatabase . readFromJson ( j1 ) ; File f2 = new File ( BQ_Settings . curWorldDir , "QuestingParties.json" ) ; JsonObject j2 = new JsonObject ( ) ; if ( f2 . exists ( ) ) { j2 = JsonIO . ReadFromFile ( f2 ) ; } PartyManager . readFromJson ( j2 ) ; logger . log ( INFO , ( ( ( ( "Loaded<seq2seq4repair_space>" + ( questDB . size ( ) ) ) + "<seq2seq4repair_space>quest<seq2seq4repair_space>instances<seq2seq4repair_space>and<seq2seq4repair_space>" ) + ( questLines . size ( ) ) ) + "<seq2seq4repair_space>quest<seq2seq4repair_space>lines" ) ) ; } @ SubscribeEvent public void onPlayerJoin ( PlayerEvent . PlayerLoggedInEvent event ) { } @ SubscribeEvent public void onLivingDeath ( LivingDeathEvent event ) { } @ SubscribeEvent @ SideOnly ( Side . CLIENT ) public void onTextureStitch ( TextureStitchEvent . Pre event ) { } }

Fix:
f1 = new File ( BQ_Settings . defaultDir , "DefaultQuests.json" ) ;
Buggy code:
public class ItemRootBeer extends ItemDrink { int potionLength = 0 ; public ItemRootBeer ( int amount , float saturation , boolean isWolfFood , int potionLength ) { } public ItemRootBeer ( int amount , float saturation , boolean isWolfFood ) { } protected void onFoodEaten ( ItemStack stack , World worldIn , EntityPlayer player ) { if ( ( ! ( worldIn . isRemote ) ) && ( ( this . potionLength ) != 0 ) ) { <START_BUG> player . addPotionEffect ( new net . minecraft . potion . PotionEffect ( jump . id , this . potionLength , 0 ) ) ; <END_BUG> } } public ItemStack onItemUseFinish ( ItemStack stack , World worldIn , EntityPlayer playerIn ) { } }

Fix:
player . addPotionEffect ( new net . minecraft . potion . PotionEffect ( fireResistance . id , this . potionLength , 0 ) ) ;
Buggy code:
@ Controller @ RequestMapping ( "//user" ) public class CustomerOrdersController { @ Autowired private AuthorizedUserSite authorizedUserSiteService ; @ Autowired private Identification identificationService ; @ Autowired private DtosBuilder dtosBuilder ; @ RequestMapping ( value = "//myorders" , method = RequestMethod . GET ) public ModelAndView myorders ( @ RequestParam ( value = "page" , required = false ) Long page , Authentication auth ) { } @ RequestMapping ( value = "//myorders//{orderId}" , method = RequestMethod . GET ) public ModelAndView myorder ( @ PathVariable ( "orderId" ) Order order ) { Calendar now = new GregorianCalendar ( ) ; Calendar nowDate = new GregorianCalendar ( now . get ( Calendar . YEAR ) , now . get ( Calendar . MONTH ) , now . get ( Calendar . DAY_OF_MONTH ) ) ; boolean change = false ; if ( ( order . getCompleteDate ( ) ) != null ) { if ( ( order . getCompleteDate ( ) . compareTo ( nowDate ) ) < 0 ) { change = true ; } } StationsDto stationsDto = dtosBuilder . build ( ) ; CustomerOrderDto customerOrderDto = dtosBuilder . build ( order ) ; String [ ] [ ] services = new String [ customerOrderDto . getServiceNames ( ) . size ( ) ] [ 3 ] ; for ( int i = 0 ; i < ( customerOrderDto . getServiceNames ( ) . size ( ) ) ; i ++ ) { <START_BUG> services [ i ] [ 0 ] = customerOrderDto . getPartNames ( ) . get ( i ) ; <END_BUG> services [ i ] [ 1 ] = customerOrderDto . getServiceCounts ( ) . get ( i ) . toString ( ) ; services [ i ] [ 2 ] = customerOrderDto . getServiceSums ( ) . get ( i ) . toString ( ) ; } String [ ] [ ] parts = new String [ customerOrderDto . getPartNames ( ) . size ( ) ] [ 2 ] ; for ( int i = 0 ; i < ( customerOrderDto . getPartNames ( ) . size ( ) ) ; i ++ ) { parts [ i ] [ 0 ] = customerOrderDto . getPartNames ( ) . get ( i ) ; parts [ i ] [ 1 ] = customerOrderDto . getPartCounts ( ) . get ( i ) . toString ( ) ; } ModelAndView mav = new ModelAndView ( ) ; mav . addObject ( "parts" , parts ) ; mav . addObject ( "services" , services ) ; mav . addObject ( "customerOrderDto" , customerOrderDto ) ; mav . addObject ( "stationsDto" , stationsDto ) ; mav . addObject ( "change" , change ) ; mav . setViewName ( "customer.order.data" ) ; return mav ; } @ RequestMapping ( value = "//myorders//changestation" , method = RequestMethod . POST ) public ModelAndView changeServiceStation ( @ RequestParam ( "orderId" ) Order order , @ RequestParam ( "stationId" ) Station station , Authentication auth ) { } No newline ; at end ; of file ; }

Fix:
services [ i ] [ 0 ] = customerOrderDto . getServiceNames ( ) . get ( i ) ;
Buggy code:
public class CharacterUtilities { private static String [ ] maleNames = new String [ ] { "Erik" , "Karl" , "Anders" , "Johan" , "Per" , "Nils" , "Carl" , "Jan" , "Mikale" , "Lennart" , "Hans" , "Olof" , "Peter" , "Gunnar" } ; private static String [ ] femaleNames = new String [ ] { "Maria" , "Anna" , "Margareta" , "Elisabeth" , "Eva" , "Kristina" , "Birgitta" , "Karin" , "Marie" , "Ingrid" , "Christina" , "Linnea" , "Sofia" , "Kerstin" , "Helena" } ; private static Gender [ ] genderArray = new Gender [ ] { Gender . FEMALE , Gender . MALE , Gender . OTHER } ; private static Random randomGen = new Random ( ) ; private static final String [ ] DUMMYDIALOG = new String [ ] { "hej" } ; private CharacterUtilities ( ) { } public static Gender generateGender ( ) { } public static String generateName ( Gender gender ) { } public static Dialog generateDialog ( ) { List < List < String > > dialogs = null ; try { dialogs = FileUtilities . readFile ( "Dialogs.loc" ) ; } catch ( FileNotFoundException e ) { return new Dialog ( CharacterUtilities . DUMMYDIALOG , false ) ; } List < Integer > randomDialogIds = new ArrayList < Integer > ( ) ; for ( List < String > stringList : dialogs ) { int id = Integer . parseInt ( stringList . get ( 0 ) ) ; if ( ( id >= 9000 ) && ( id <= 9999 ) ) { randomDialogIds . add ( id ) ; } } Random random = new Random ( ) ; <START_BUG> int index = random . nextInt ( ( ( randomDialogIds . size ( ) ) - 1 ) ) ; <END_BUG> try { return new Dialog ( randomDialogIds . get ( index ) , "Dialogs.loc" ) ; } catch ( FileNotFoundException e ) { return new Dialog ( CharacterUtilities . DUMMYDIALOG , false ) ; } } }

Fix:
int index = random . nextInt ( randomDialogIds . size ( ) ) ;
Buggy code:
public class ParamModifierGui extends AbstractPreProcessorGui implements FocusListener { private static final long serialVersionUID = 240L ; private static final String NAME = "name" ; private static final String PREFIX = "prefix" ; private static final String LOWERBOUND = "lowerBound" ; private static final String UPPERBOUND = "upperBound" ; private static final String INCREMENT = "increment" ; private static final String SUFFIX = "suffix" ; private static final String ZERO = "0" ; private JTextField _fieldName ; private JTextField _prefix ; private JTextField _lowerBound ; private JTextField _upperBound ; private JTextField _increment ; private JTextField _suffix ; public ParamModifierGui ( ) { } @ Override public String getLabelResource ( ) { } @ Override public void configure ( TestElement el ) { } @ Override public TestElement createTestElement ( ) { } @ Override public void modifyTestElement ( TestElement m ) { } @ Override public void clearGui ( ) { } @ Override public void focusGained ( FocusEvent evt ) { } @ Override public void focusLost ( FocusEvent evt ) { } private void init ( ) { } private void updateGui ( ParamModifier model ) { } private JPanel createLabeledField ( String labelResName , JTextField field ) { } private JPanel getParameterMaskPanel ( ) { } private long checkTextField ( FocusEvent evt , String defaultValue ) { JTextField temp = ( ( JTextField ) ( evt . getSource ( ) ) ) ; long longVal = 0 ; try { longVal = Long . parseLong ( temp . getText ( ) ) ; } catch ( NumberFormatException err ) { JOptionPane . showMessageDialog ( this , "This<seq2seq4repair_space>field<seq2seq4repair_space>must<seq2seq4repair_space>have<seq2seq4repair_space>a<seq2seq4repair_space>long<seq2seq4repair_space>value!" , "Value<seq2seq4repair_space>Required" , JOptionPane . ERROR_MESSAGE ) ; temp . setText ( defaultValue ) ; <START_BUG> temp . requestFocus ( ) ; <END_BUG> } return longVal ; } }

Fix:
temp . requestFocusInWindow ( ) ;
Buggy code:
public class TestStressIndexing extends LuceneTestCase { private static final Analyzer ANALYZER = new SimpleAnalyzer ( ) ; private Random RANDOM ; private abstract static class TimedThread extends Thread { boolean failed ; int count ; private static int RUN_TIME_SEC = 6 ; private TestStressIndexing . TimedThread [ ] allThreads ; public abstract void doWork ( ) throws Throwable ; TimedThread ( TestStressIndexing . TimedThread [ ] threads ) { } public void run ( ) { } private boolean anyErrors ( ) { } } private class IndexerThread extends TestStressIndexing . TimedThread { IndexWriter writer ; public int count ; int nextID ; public IndexerThread ( IndexWriter writer , TestStressIndexing . TimedThread [ ] threads ) { } public void doWork ( ) throws Exception { for ( int j = 0 ; j < 10 ; j ++ ) { Document d = new Document ( ) ; int n = RANDOM . nextInt ( ) ; d . add ( new Field ( "id" , Integer . toString ( ( ( nextID ) ++ ) ) , Store . YES , Index . NOT_ANALYZED ) ) ; d . add ( new Field ( "contents" , English . intToEnglish ( n ) , Store . NO , Index . ANALYZED ) ) ; writer . addDocument ( d ) ; } int deleteID = ( nextID ) - 1 ; for ( int j = 0 ; j < 5 ; j ++ ) { writer . deleteDocuments ( new Term ( "id" , ( "" + deleteID ) ) ) ; deleteID -= 2 ; } } } private static class SearcherThread extends TestStressIndexing . TimedThread { private Directory directory ; public SearcherThread ( Directory directory , TestStressIndexing . TimedThread [ ] threads ) { } public void doWork ( ) throws Throwable { for ( int i = 0 ; i < 100 ; i ++ ) <START_BUG> new IndexSearcher ( directory ) . close ( ) ; <END_BUG> count += 100 ; } } public void runStressTest ( Directory directory , boolean autoCommit , MergeScheduler mergeScheduler ) throws Exception { } public void testStressIndexAndSearching ( ) throws Exception { } }

Fix:
new IndexSearcher ( directory , true ) . close ( ) ;
Buggy code:
public class HTMLDocumentImpl extends DocumentImpl implements HTMLDocument { private HTMLCollectionImpl _anchors ; private HTMLCollectionImpl _forms ; private HTMLCollectionImpl _images ; private HTMLCollectionImpl _links ; private HTMLCollectionImpl _applets ; private StringWriter _writer ; private static Hashtable _elementTypesHTML ; private static final Class [ ] _elemClassSigHTML = new Class [ ] { HTMLDocumentImpl . class , String . class } ; public HTMLDocumentImpl ( ) { } public synchronized Element getDocumentElement ( ) { } public synchronized HTMLElement getHead ( ) { } public synchronized String getTitle ( ) { } public synchronized void setTitle ( String newTitle ) { } public synchronized HTMLElement getBody ( ) { } public synchronized void setBody ( HTMLElement newBody ) { } public synchronized Element getElementById ( String elementId ) { } public NodeList getElementsByName ( String elementName ) { } public final NodeList getElementsByTagName ( String tagName ) { } public final NodeList getElementsByTagNameNS ( String namespaceURI , String localName ) { } public Element createElementNS ( String namespaceURI , String qualifiedName , String localpart ) throws DOMException { } public Element createElementNS ( String namespaceURI , String qualifiedName ) { } public Element createElement ( String tagName ) throws DOMException { } public Attr createAttribute ( String name ) throws DOMException { } public String getReferrer ( ) { } public String getDomain ( ) { } public String getURL ( ) { } public String getCookie ( ) { } public void setCookie ( String cookie ) { } public HTMLCollection getImages ( ) { } public HTMLCollection getApplets ( ) { } public HTMLCollection getLinks ( ) { } public HTMLCollection getForms ( ) { } public HTMLCollection getAnchors ( ) { } public void open ( ) { } public void close ( ) { } public void write ( String text ) { } public void writeln ( String text ) { } public Node cloneNode ( boolean deep ) { } private Element getElementById ( String elementId , Node node ) { } private static synchronized void populateElementTypes ( ) { } private static void populateElementType ( String tagName , String className ) { try { <START_BUG> HTMLDocumentImpl . _elementTypesHTML . put ( tagName , ObjectFactory . findProviderClass ( ( "org.apache.html.dom." + className ) , HTMLDocumentImpl . class . getClassLoader ( ) , false ) ) ; <END_BUG> } catch ( Exception except ) { new RuntimeException ( ( ( ( ( ( ( ( "HTM019<seq2seq4repair_space>OpenXML<seq2seq4repair_space>Error:<seq2seq4repair_space>Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>or<seq2seq4repair_space>execute<seq2seq4repair_space>class<seq2seq4repair_space>" + className ) + "<seq2seq4repair_space>implementing<seq2seq4repair_space>HTML<seq2seq4repair_space>element<seq2seq4repair_space>" ) + tagName ) + "\n" ) + className ) + "\t" ) + tagName ) ) ; } } }

Fix:
HTMLDocumentImpl . _elementTypesHTML . put ( tagName , ObjectFactory . findProviderClass ( ( "org.apache.html.dom." + className ) , HTMLDocumentImpl . class . getClassLoader ( ) , true ) ) ;
Buggy code:
public class ProducesRequestConditionTests { @ Test public void consumesMatch ( ) { } @ Test public void negatedConsumesMatch ( ) { } @ Test public void consumesWildcardMatch ( ) { } @ Test public void consumesMultipleMatch ( ) { } @ Test public void consumesSingleNoMatch ( ) { } @ Test public void compareToSingle ( ) { } @ Test public void compareToMultiple ( ) { } @ Test public void compareToMultipleAccept ( ) { } @ Test public void combine ( ) { } @ Test public void combineWithDefault ( ) { ProducesRequestCondition condition1 = new ProducesRequestCondition ( "text//plain" ) ; <START_BUG> ProducesRequestCondition condition2 = new ProducesRequestCondition ( "*//*" ) ; <END_BUG> ProducesRequestCondition result = condition1 . combine ( condition2 ) ; assertEquals ( condition1 , result ) ; } @ Test public void parseConsumesAndHeaders ( ) { } @ Test public void parseConsumesDefault ( ) { } @ Test public void parseConsumesDefaultAndHeaders ( ) { } @ Test public void getMatchingCondition ( ) { } private void assertConditions ( ProducesRequestCondition condition , String ... expected ) { } }

Fix:
ProducesRequestCondition condition2 = new ProducesRequestCondition ( ) ;
Buggy code:
public class Snippet267 { static Browser browser ; public static void main ( String [ ] args ) { Display display = new Display ( ) ; Shell shell = new Shell ( display ) ; shell . setLayout ( new GridLayout ( 2 , true ) ) ; shell . setText ( "Use<seq2seq4repair_space>Mozilla's<seq2seq4repair_space>Design<seq2seq4repair_space>Mode" ) ; try { Snippet267 . browser = new Browser ( shell , SWT . MOZILLA ) ; } catch ( SWTError e ) { <START_BUG> System . out . println ( ( "Count<seq2seq4repair_space>not<seq2seq4repair_space>instantiate<seq2seq4repair_space>Browser:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; <END_BUG> return ; } Snippet267 . browser . setLayoutData ( new GridData ( GridData . FILL , GridData . FILL , true , true , 2 , 1 ) ) ; final Button offButton = new Button ( shell , SWT . RADIO ) ; offButton . setText ( "Design<seq2seq4repair_space>Mode<seq2seq4repair_space>Off" ) ; offButton . addListener ( Selection , new Listener ( ) { public void handleEvent ( Event event ) { if ( ! ( offButton . getSelection ( ) ) ) return ; Snippet267 . setDesignMode ( "off" ) ; } } ) ; final Button onButton = new Button ( shell , SWT . RADIO ) ; onButton . setText ( "Design<seq2seq4repair_space>Mode<seq2seq4repair_space>On" ) ; onButton . addListener ( Selection , new Listener ( ) { public void handleEvent ( Event event ) { if ( ! ( onButton . getSelection ( ) ) ) return ; boolean success = Snippet267 . setDesignMode ( "on" ) ; if ( ! success ) { onButton . setSelection ( false ) ; offButton . setSelection ( true ) ; } } } ) ; offButton . setSelection ( true ) ; Snippet267 . browser . setUrl ( "http:////www.google.com" ) ; shell . setSize ( 400 , 400 ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } public static boolean setDesignMode ( String value ) { } }

Fix:
System . out . println ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>instantiate<seq2seq4repair_space>Browser:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ;
Buggy code:
public class ThreadMXBeanCpuTimeHandler implements OperationStepHandler , DescriptionProvider { public static final ThreadMXBeanCpuTimeHandler INSTANCE = new ThreadMXBeanCpuTimeHandler ( ) ; private final ParametersValidator validator = new ParametersValidator ( ) ; private ThreadMXBeanCpuTimeHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { validator . validate ( operation ) ; try { long id = operation . require ( ID ) . asLong ( ) ; context . getResult ( ) . set ( ManagementFactory . getThreadMXBean ( ) . getThreadCpuTime ( id ) ) ; } catch ( UnsupportedOperationException e ) { throw new OperationFailedException ( new ModelNode ( ) . set ( e . toString ( ) ) ) ; } <START_BUG> context . completeStep ( ) ; <END_BUG> } @ Override public ModelNode getModelDescription ( Locale locale ) { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class TreeViewTransferHandler extends TransferHandler { public boolean importData ( JComponent comp , Transferable transferProxy ) { } private boolean importFolderReferences ( TreeView treeView , FolderTransfer transferable ) { } private boolean importMessageReferences ( TreeView treeView , MessageReferencesTransfer transferable ) { } protected void exportDone ( JComponent source , Transferable data , int action ) { } private void exportFolder ( TreeView treeView , AbstractMessageFolder folder ) { } public int getSourceActions ( JComponent c ) { } protected Transferable createTransferable ( JComponent c ) { } public boolean canImport ( JComponent comp , DataFlavor [ ] transferFlavors ) { } private boolean canHandleFolderImport ( TreeView treeView , AbstractFolder dropTarget ) { boolean canImport = false ; AbstractFolder dragTarget = treeView . getSelectedNodeBeforeDragAction ( ) ; if ( ( ( dragTarget != null ) && ( ! ( dragTarget . isNodeDescendant ( dropTarget ) ) ) ) && ( dragTarget != dropTarget ) ) { <START_BUG> canImport = dropTarget . supportsAddFolder ( dragTarget ) ; <END_BUG> } return canImport ; } private boolean canHandleMessageImport ( TreeView treeView , AbstractFolder dropTarget ) { } }

Fix:
canImport = dropTarget . supportsAddFolder ( dragTarget . getType ( ) ) ;
Buggy code:
public class TestNewestSegment extends LuceneTestCase { public void testNewestSegment ( ) throws Exception { Directory directory = newDirectory ( ) ; IndexWriter writer = new IndexWriter ( directory , newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) ) ; assertNull ( writer . newestSegment ( ) ) ; <START_BUG> writer . close ( ) ; <END_BUG> directory . close ( ) ; } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class LineBreakHandler implements CharacterHandler { private final boolean fallbackToEscape ; private final boolean leaveOnLnBreak ; public LineBreakHandler ( boolean leaveOnLnBreak , boolean fallbackToEscape ) { } @ Override public void handle ( ParsingContext ctx ) throws CommandFormatException { if ( ( ctx . getCharacter ( ) ) == '\\' ) { if ( ( ( ctx . getInput ( ) . length ( ) ) > ( ( ctx . getLocation ( ) ) + ( LINE_SEPARATOR . length ( ) ) ) ) && ( ctx . getInput ( ) . startsWith ( LINE_SEPARATOR , ( ( ctx . getLocation ( ) ) + 1 ) ) ) ) { if ( leaveOnLnBreak ) { ctx . leaveState ( ) ; ctx . advanceLocation ( LINE_SEPARATOR . length ( ) ) ; } } else if ( fallbackToEscape ) { ctx . enterState ( INSTANCE ) ; } else { <START_BUG> ctx . enterState ( KEEP_ESCAPE ) ; <END_BUG> } } else { doHandle ( ctx ) ; } } protected void doHandle ( ParsingContext ctx ) throws CommandFormatException { } }

Fix:
doHandle ( ctx ) ;
Buggy code:
int sizeOfLabelProc = OS . CALLBACK_sizeOfLabel_ ( proc3 ) ; <START_BUG> int drawLabelInRectProc = OS . CALLBACK_drawLabelInRect_ ( proc4 ) ; <END_BUG>

Fix:
int drawLabelInRectProc = OS . CALLBACK_drawLabel_inRect_ ( proc4 ) ;
Buggy code:
public final class ObjectVector { static int INITIAL_SIZE = 10 ; public int size ; int maxSize ; Object [ ] elements ; public ObjectVector ( ) { } public ObjectVector ( int initialSize ) { } public void add ( Object newElement ) { } public void addAll ( Object [ ] newElements ) { } public void addAll ( ObjectVector newVector ) { } public boolean containsIdentical ( Object element ) { } public boolean contains ( Object element ) { } public void copyInto ( Object [ ] targetArray ) { } public void copyInto ( Object [ ] targetArray , int index ) { } public Object elementAt ( int index ) { } public Object find ( Object element ) { for ( int i = this . size ; ( -- i ) >= 0 ; ) if ( element . equals ( this . elements [ i ] ) ) <START_BUG> return element ; <END_BUG> return null ; } public Object remove ( Object element ) { } public void removeAll ( ) { } public int size ( ) { } public String toString ( ) { } }

Fix:
return this . elements [ i ] ;
Buggy code:
public class GameScreen extends AbstractScreen { private static final Vector3 tmp = new Vector3 ( ) ; private static final float SLOW_MO_TIME_GAP = 1.5F ; private static final float DEATH_TIME_GAP = 3.0F ; private static final float SLOW_MO = 0.35F ; private GameWorld gameWorld ; private InputMultiplexer inputMultiplexer ; private CentreGUI centreGUI ; private Label scoreLabel ; private ImageButton pauseButton ; private TextureRegionDrawable starCollected ; private TextureRegionDrawable starEmpty ; private Image [ ] starImages = new Image [ 3 ] ; private Table starTable ; private int levelId ; private int packId ; private boolean logicPaused = false ; private boolean pauseClicked = false ; private float gameOverTime = 0.0F ; public GameScreen ( LSD game , int packId , int levelId ) { } @ Override public void pauseLogic ( ) { } @ Override public void resumeLogic ( ) { } public int getLevelId ( ) { } public int getPackId ( ) { } private void setupUI ( ) { } @ Override public void resize ( int width , int height ) { } @ Override public void show ( ) { } @ Override public void hide ( ) { } @ Override public void render ( float delta ) { super . render ( delta ) ; if ( ( gameWorld . isGameOver ( ) ) && ( ( gameOverTime ) < ( GameScreen . SLOW_MO_TIME_GAP ) ) ) { gameWorld . update ( ( delta * ( GameScreen . SLOW_MO ) ) ) ; } else { gameWorld . update ( delta ) ; } scoreLabel . setText ( gameWorld . getScore ( ) ) ; pauseButton . setChecked ( pauseButton . isOver ( ) ) ; LevelDescriptor levelDescriptor = gameWorld . getLevelDescriptor ( ) ; <START_BUG> for ( int i = 0 ; i < 2 ; i ++ ) <END_BUG> starImages [ i ] . setDrawable ( ( levelDescriptor . isStarCollected ( i ) ? starCollected : starEmpty ) ) ; centreGUI . render ( delta ) ; if ( ( ! ( logicPaused ) ) && ( gameWorld . isGameOver ( ) ) ) { if ( ( gameOverTime ) == 0 ) { input . setInputProcessor ( null ) ; gameWorld . stopShake ( ) ; } gameOverTime += delta ; if ( ( gameOverTime ) > ( GameScreen . DEATH_TIME_GAP ) ) { if ( gameWorld . isGameWon ( ) ) game . setScreen ( new net . net63 . codearcade . LSD . screens . overlays . LevelCompleteScreen ( game , this ) ) ; else game . setScreen ( new net . net63 . codearcade . LSD . screens . overlays . GameOverScreen ( game , this ) ) ; } } if ( pauseClicked ) { pauseClicked = false ; game . setScreen ( new net . net63 . codearcade . LSD . screens . overlays . PauseScreen ( game , this ) ) ; } } @ Override public void dispose ( ) { } private class GameEventListener extends GestureDetector . GestureAdapter { private float zoomRatio = 1.0F ; private float currentZoom = 1.0F ; private boolean zoomed = false ; @ Override public boolean touchDown ( float x , float y , int pointer , int button ) { } @ Override public boolean pan ( float x , float y , float deltaX , float deltaY ) { } @ Override public boolean tap ( float x , float y , int count , int button ) { } @ Override public boolean panStop ( float x , float y , int pointer , int button ) { } @ Override public boolean zoom ( float initialDistance , float distance ) { } } }

Fix:
for ( int i = 0 ; i < 3 ; i ++ )
Buggy code:
public class WordsEnvironment { private HashMap < String , WordsClass > classes ; private LinkedList < HashMap < String , WordsObject > > objectsByName ; private HashMap < WordsClass , HashSet < WordsObject > > objectsByClass ; private ArrayList < WordsEventListener > eventListeners ; private static final String BASE_SUPERCLASS = "thing" ; public WordsEnvironment ( ) { } private void setupEnvironment ( ) { } public void resetEnvironment ( ) { } public WordsClass createClass ( String className , String parent ) throws WordsRuntimeException { } public WordsClass getClass ( String className ) throws WordsClassNotFoundException { } public void enterNewLocalScope ( ) { } public void exitLocalScope ( ) { } public int getNumberOfScopes ( ) { } public WordsObject createObject ( String objectName , String className , WordsPosition position ) throws WordsRuntimeException { } public void addObjectToCurrentNameScope ( String objectName , WordsObject object ) { } public WordsObject getObject ( String objectName ) throws WordsRuntimeException { } public Collection < WordsObject > getObjects ( ) { } public HashSet < WordsObject > getObjectsByClass ( String className ) throws WordsClassNotFoundException { WordsClass wc = getClass ( className ) ; HashSet < WordsObject > objectsToReturn = objectsByClass . get ( wc ) ; for ( WordsClass childClass : wc . getChildren ( ) ) { <START_BUG> objectsToReturn . addAll ( objectsByClass . get ( childClass ) ) ; <END_BUG> } return objectsToReturn ; } public void createListener ( AST predicate , AST statementList , boolean temporary ) { } public Collection < WordsEventListener > getEventListeners ( ) { } No newline ; at end ; of file ; }

Fix:
objectsToReturn . addAll ( getObjectsByClass ( childClass . getClassName ( ) ) ) ;
Buggy code:
public class MoveMessageCommand extends CopyMessageCommand { protected Folder destFolder ; protected FolderCommandAdapter adapter ; public MoveMessageCommand ( DefaultCommandReference [ ] references ) { } public void updateGUI ( ) throws Exception { } public void execute ( Worker worker ) throws Exception { super . execute ( worker ) ; adapter = new FolderCommandAdapter ( ( ( FolderCommandReference [ ] ) ( getReferences ( ) ) ) ) ; FolderCommandReference [ ] r = adapter . getSourceFolderReferences ( ) ; destFolder = ( ( Folder ) ( adapter . getDestinationFolder ( ) ) ) ; for ( int i = 0 ; i < ( r . length ) ; i ++ ) { Object [ ] uids = r [ i ] . getUids ( ) ; Folder srcFolder = ( ( Folder ) ( r [ i ] . getFolder ( ) ) ) ; uids = r [ i ] . getUids ( ) ; log . debug ( ( ( ( "src=" + srcFolder ) + "<seq2seq4repair_space>dest=" ) + ( destFolder ) ) ) ; worker . setDisplayText ( ( ( "Moving<seq2seq4repair_space>messages<seq2seq4repair_space>to<seq2seq4repair_space>" + ( destFolder . getName ( ) ) ) + "..." ) ) ; worker . setProgressBarMaximum ( uids . length ) ; srcFolder . markMessage ( uids , MARK_AS_EXPUNGED , worker ) ; <START_BUG> srcFolder . expungeFolder ( uids , worker ) ; <END_BUG> } } }

Fix:
srcFolder . expungeFolder ( worker ) ;
Buggy code:
public class Verlinkung extends Controller { public static Result index ( ) { } public static Result account ( ) { } public static Result agb ( ) { } public static Result impressum ( ) { } public static Result konfigurator ( ) { } public static Result kontakt ( ) { } public static Result login ( ) { } public static Result registrieren ( ) { <START_BUG> return ok ( registrieren . render ( "Got<seq2seq4repair_space>it" ) ) ; <END_BUG> } public static Result step02 ( ) { } public static Result step03 ( ) { } public static Result step04 ( ) { } public static Result step05 ( ) { } public static Result step06 ( ) { } public static Result step07 ( ) { } public static Result step08 ( ) { } public static Result step09 ( ) { } public static Result step10 ( ) { } public static Result bestellen ( ) { } public static Result warenkorb ( ) { } }

Fix:
return ok ( registrieren . render ( null ) ) ;