nus-yam/ex-repair huggingface dataset:
Buggy code:
class DefaultRegistryAnnotatedBindingBuilderImpl < T > extends RegistryAnnotatedBindingBuilderImpl < T > { DefaultRegistryAnnotatedBindingBuilderImpl ( Binder binder , Key < T > key ) { } DefaultRegistryAnnotatedBindingBuilderImpl ( Binder binder , TypeLiteral < T > typeLiteral ) { } DefaultRegistryAnnotatedBindingBuilderImpl ( Binder binder , Class < T > clazz ) { } @ Override public void toRegistry ( long timeout , TimeUnit unit ) { } @ Override Iterable < RegistryProvider < ? > > doToRegistry ( ) { } private RegistryProvider < BlockingSupplier < T > > bindSuppliers ( ) { Key < BlockingSupplier < T > > blockingSupplierKey = newBlockingSupplierKey ( ) ; <START_BUG> BlockingSupplierRegistryProvider < BlockingSupplier < T > > blockingSupplierRegistryProvider = BlockingSupplierRegistryProvider . newProviderOf ( blockingSupplierKey ) ; <END_BUG> DefaultRegistryAnnotatedBindingBuilderImpl . binder ( ) . bind ( blockingSupplierKey ) . toProvider ( blockingSupplierRegistryProvider ) ; Key < Supplier < T > > yarSupplierKey = newYarSupplierKey ( ) ; DefaultRegistryAnnotatedBindingBuilderImpl . binder ( ) . bind ( yarSupplierKey ) . to ( blockingSupplierKey ) ; DefaultRegistryAnnotatedBindingBuilderImpl . binder ( ) . bind ( newGuavaSupplierKey ( ) ) . to ( yarSupplierKey ) ; DefaultRegistryAnnotatedBindingBuilderImpl . binder ( ) . bind ( newJavaSupplierKey ( ) ) . to ( yarSupplierKey ) ; return blockingSupplierRegistryProvider ; } private Key < com . google . common . base . Supplier < T > > newGuavaSupplierKey ( ) { } private Key < java . util . function . Supplier < T > > newJavaSupplierKey ( ) { } private Key < Supplier < T > > newYarSupplierKey ( ) { } private Key < BlockingSupplier < T > > newBlockingSupplierKey ( ) { } private RegistryProvider < ? extends T > newRegistryProvider ( long timeout , TimeUnit unit ) { } private RegistryProvider < T > newRegistryProvider ( ) { } }

Fix:
BlockingSupplierRegistryProvider < T > blockingSupplierRegistryProvider = BlockingSupplierRegistryProvider . newProviderOf ( DefaultRegistryAnnotatedBindingBuilderImpl . key ( ) ) ;
Buggy code:
public class LoginCtrl extends CtrlBase { @ FXML private TextField mBannerIdText ; @ FXML private PasswordField mPasswordField ; public LoginCtrl ( ) { } public void updateState ( String key , Object value ) { if ( ( ( key . equals ( "LoginError" ) ) == true ) && ( ! ( value . equals ( "" ) ) ) ) { <START_BUG> displayErrorMessage ( mMessages . getString ( ( ( String ) ( value ) ) ) ) ; <END_BUG> } } public void loginHit ( ) { } public void login ( String bannerId , String password ) { } }

Fix:
displayErrorMessage ( ( ( String ) ( value ) ) ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public final class SarInjectionTestCase { @ Deployment public static JavaArchive createDeployment ( ) throws Exception { } @ Test public void testMBean ( ) throws Exception { final ModelControllerClient client = Factory . create ( InetAddress . getByName ( "127.0.0.1" ) , 9999 , getCallbackHandler ( ) ) ; try { <START_BUG> final MBeanServerConnection mbeanServer = JMXConnectorFactory . connect ( new JMXServiceURL ( "service:jmx:remote:////localhost:9999" ) ) . getMBeanServerConnection ( ) ; <END_BUG> final ObjectName objectName = new ObjectName ( "jboss:name=POJOService" ) ; Assert . assertTrue ( ( 2 == ( ( Integer ) ( mbeanServer . getAttribute ( objectName , "Count" ) ) ) ) ) ; Assert . assertTrue ( ( ( Boolean ) ( mbeanServer . getAttribute ( objectName , "CreateCalled" ) ) ) ) ; Assert . assertTrue ( ( ( Boolean ) ( mbeanServer . getAttribute ( objectName , "StartCalled" ) ) ) ) ; Assert . assertFalse ( ( ( Boolean ) ( mbeanServer . getAttribute ( objectName , "StopCalled" ) ) ) ) ; Assert . assertFalse ( ( ( Boolean ) ( mbeanServer . getAttribute ( objectName , "DestroyCalled" ) ) ) ) ; } finally { try { client . close ( ) ; } catch ( IOException ignore ) { } } } }

Fix:
final MBeanServerConnection mbeanServer = JMXConnectorFactory . connect ( new JMXServiceURL ( "service:jmx:remoting-jmx:////localhost:9999" ) ) . getMBeanServerConnection ( ) ;
Buggy code:
public class ServiceActivator implements org . jboss . msc . service . ServiceActivator { public void activate ( ServiceActivatorContext serviceActivatorContext ) throws ServiceRegistryException { System . out . println ( "Running" ) ; final ServiceTarget serviceTarget = serviceActivatorContext . getServiceTarget ( ) ; final LookupService rebindService = new LookupService ( "BeanWithSimpleInjected" ) ; final Injector < Context > injector = rebindService . getLookupContextInjector ( ) ; <START_BUG> serviceTarget . addService ( JBOSS . append ( "BeanWithSimpleInjected" , "rebind" ) , rebindService ) . addDependency ( JBOSS . append ( "deployment" , "unit" , "managedbean-example.ear" , "managedbean-example.jar" , "component" , "BeanWithSimpleInjected" , "START" ) ) . addDependency ( ContextNames . contextServiceNameOfModule ( "managedbean-example.ear" , "managedbean-example.jar" ) , NamingStore . class , new Injector < NamingStore > ( ) { <END_BUG> public void inject ( final NamingStore value ) throws InjectionException { try { injector . inject ( ( ( Context ) ( value . lookup ( new CompositeName ( ) ) ) ) ) ; } catch ( NamingException e ) { throw new InjectionException ( e ) ; } } public void uninject ( ) { injector . uninject ( ) ; } } ) . setInitialMode ( ACTIVE ) . install ( ) ; } }

Fix:
serviceTarget . addService ( JBOSS . append ( "BeanWithSimpleInjected" , "rebind" ) , rebindService ) . addDependency ( JBOSS . append ( "deployment" , "unit" , "managedbean-example.ear" , "managedbean-example.jar" , "component" , "BeanWithSimpleInjected" , "START" ) ) . addDependency ( ContextNames . contextServiceNameOfModule ( "managedbean-example" , "managedbean-example" ) , NamingStore . class , new Injector < NamingStore > ( ) {
Buggy code:
public class Container { private String name ; private int height ; private boolean wasUsed ; public Container ( String name ) { } public void setUsed ( boolean used ) { } public void setHeight ( int height ) { } public boolean WasUsed ( ) { } public int getHeight ( ) { } public String getName ( ) { } @ Override public String toString ( ) { <START_BUG> return ( ( ( ( getName ( ) ) + "," ) + ( getHeight ( ) ) ) + "," ) + ( WasUsed ( ) ) ; <END_BUG> } }

Fix:
return ( ( getHeight ( ) ) + "," ) + ( WasUsed ( ) ) ;
Buggy code:
public abstract class CompositeFormat extends Format { private static final long serialVersionUID = 5358685519349262494L ; protected static NumberFormat getDefaultNumberFormat ( ) { } protected static NumberFormat getDefaultNumberFormat ( final Locale locale ) { } protected void parseAndIgnoreWhitespace ( final String source , final ParsePosition pos ) { } protected char parseNextCharacter ( final String source , final ParsePosition pos ) { } private Number parseNumber ( final String source , final double value , final ParsePosition pos ) { Number ret = null ; <START_BUG> StringBuffer sb = new StringBuffer ( ) ; <END_BUG> sb . append ( '(' ) ; sb . append ( value ) ; sb . append ( ')' ) ; final int n = sb . length ( ) ; final int startIndex = pos . getIndex ( ) ; final int endIndex = startIndex + n ; if ( endIndex < ( source . length ( ) ) ) { if ( ( source . substring ( startIndex , endIndex ) . compareTo ( sb . toString ( ) ) ) == 0 ) { ret = Double . valueOf ( value ) ; pos . setIndex ( endIndex ) ; } } return ret ; } protected Number parseNumber ( final String source , final NumberFormat format , final ParsePosition pos ) { } protected boolean parseFixedstring ( final String source , final String expected , final ParsePosition pos ) { } protected StringBuffer formatDouble ( final double value , final NumberFormat format , final StringBuffer toAppendTo , final FieldPosition pos ) { } }

Fix:
StringBuilder sb = new StringBuilder ( ) ;
Buggy code:
public class MockPageManager implements IPageManager { private final Map < Integer , IManageablePage > pages = new HashMap < Integer , IManageablePage > ( ) ; public MockPageManager ( ) { } public void commitRequest ( ) { } public void destroy ( ) { } public IManageablePage getPage ( int id ) { } public void newSessionCreated ( ) { } public void sessionExpired ( String sessionId ) { } public void setContext ( IPageManagerContext context ) { } public boolean supportsVersioning ( ) { } public void touchPage ( IManageablePage page ) { <START_BUG> if ( ( page . isPageStateless ( ) ) == false ) { <END_BUG> pages . put ( page . getPageId ( ) , page ) ; } } public IPageManagerContext getContext ( ) { } }

Fix:
if ( true || ( ( page . isPageStateless ( ) ) == false ) ) {
Buggy code:
public class ProcessorAgent extends AbstractProcessAgent { private static final Logger LOG = Logger . getLogger ( ProcessorAgent . class . getName ( ) ) ; private List < TextProcessor > processors = new ArrayList < > ( ) ; public ProcessorAgent add ( TextProcessor processor ) { } public List < TextProcessor > getProcessors ( ) { } @ Override protected Logger getLogger ( ) { } @ Override protected boolean run ( Date date , Feed feed , URL url , Config config ) { VFS vfs = config . getVFS ( ) ; VFSPathService pathService = config . getVFSPathService ( ) ; String bucket = config . getBucket ( ) ; try { String downloadKey = pathService . download ( date , feed , url ) ; if ( ! ( vfs . exists ( bucket , downloadKey ) ) ) { ProcessorAgent . LOG . fine ( ( "Not<seq2seq4repair_space>downloaded:<seq2seq4repair_space>" + url ) ) ; return false ; } String metaKey = pathService . meta ( date , feed , url ) ; if ( ( vfs . exists ( bucket , metaKey ) ) && ( ! ( force ) ) ) { ProcessorAgent . LOG . fine ( ( "Already<seq2seq4repair_space>processed:<seq2seq4repair_space>" + url ) ) ; return false ; } FSObject obj = vfs . get ( bucket , downloadKey ) ; ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; obj . copyContent ( out ) ; String html = out . toString ( ENCODING ) ; Context ctx = new Context ( feed , config ) ; TextPipeline pipeline = new TextPipeline ( ctx ) ; for ( TextProcessor processor : processors ) { pipeline . chain ( processor ) ; } pipeline . process ( html ) ; <START_BUG> ctx . put ( Context . URL , url ) ; <END_BUG> String article = ctx . getString ( HTML_ARTICLE ) ; String articleKey = pathService . article ( date , feed , url ) ; vfs . upload ( bucket , articleKey , new ByteArrayInputStream ( article . getBytes ( ENCODING ) ) , "text//html" ) ; String meta = meta ( ctx ) ; vfs . upload ( bucket , metaKey , new ByteArrayInputStream ( meta . getBytes ( ENCODING ) ) , "text//plain" ) ; return true ; } catch ( Exception e ) { ProcessorAgent . LOG . log ( Level . WARNING , ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>process<seq2seq4repair_space>" + url ) , e ) ; return false ; } } private String meta ( Context context ) { } private List < String > toList ( Map map ) { } }

Fix:
ctx . put ( Context . URL , url . toString ( ) ) ;
Buggy code:
public class DropDownChoice extends AbstractSingleSelectChoice implements IOnChangeListener { private static final long serialVersionUID = 122777360064586107L ; public DropDownChoice ( final String id , final Collection choices ) { } public DropDownChoice ( final String id , final IChoiceList choices ) { } public DropDownChoice ( final String id , IModel model , final Collection choices ) { } public DropDownChoice ( final String id , IModel model , final IChoiceList choices ) { } public final void onSelectionChanged ( ) { } protected void onComponentTag ( final ComponentTag tag ) { checkComponentTag ( tag , "select" ) ; <START_BUG> final String url = getRequestCycle ( ) . urlFor ( this , IOnChangeListener . class ) ; <END_BUG> if ( wantOnSelectionChangedNotifications ( ) ) { tag . put ( "onChange" , ( ( ( ( "location.href='" + url ) + "&" ) + ( getPath ( ) ) ) + "='<seq2seq4repair_space>+<seq2seq4repair_space>this.options[this.selectedIndex].value;" ) ) ; } super . onComponentTag ( tag ) ; } protected void onSelectionChanged ( final Object newSelection ) { } protected boolean wantOnSelectionChangedNotifications ( ) { } }

Fix:
final String url = getPage ( ) . urlFor ( this , IOnChangeListener . class ) ;
Buggy code:
public abstract class SimplePaginatedResult < T > extends PaginatedResult < T > { protected final String header ; public SimplePaginatedResult ( String header ) { } public SimplePaginatedResult ( String header , int resultsPerPage ) { } @ Override public String formatHeader ( int page , int maxPages ) { <START_BUG> return ( ( ( ( ( ( ( ( ( ( ( ( ChatColor . AQUA ) + ( this . header ) ) + ( ChatColor . GRAY ) ) + "<seq2seq4repair_space>(" ) + ( ChatColor . DARK_AQUA ) ) + "page" ) + ( AQUA . toString ( ) ) ) + page ) + ( ChatColor . DARK_RED ) ) + ( "//" . GREEN . toString ( ) ) ) + maxPages ) + ( ChatColor . GRAY ) ) + ")" ; <END_BUG> } }

Fix:
return ( ( ( ( ( ( ( ( ( ( ( ( ( ChatColor . AQUA ) + ( this . header ) ) + ( ChatColor . GRAY ) ) + "<seq2seq4repair_space>(" ) + ( ChatColor . DARK_AQUA ) ) + "page" ) + ( AQUA . toString ( ) ) ) + page ) + ( ChatColor . DARK_RED ) ) + "//" ) + ( GREEN . toString ( ) ) ) + maxPages ) + ( ChatColor . GRAY ) ) + ")" ;
Buggy code:
public class ImmutableIntArrayDocIdSet extends DocIdSet { private final int [ ] _array ; public ImmutableIntArrayDocIdSet ( int [ ] array ) { } @ Override public DocIdSetIterator iterator ( ) { } @ Override public final boolean isCacheable ( ) { } public static class ImmutableIntArrayDocIdSetIterator extends DocIdSetIterator { private int _doc ; private int cursor ; private final int [ ] _array ; public ImmutableIntArrayDocIdSetIterator ( int [ ] array ) { } @ Override public final int docID ( ) { } @ Override public int nextDoc ( ) throws IOException { } @ Override public int advance ( int target ) throws IOException { if ( ( ( cursor ) >= ( _array . length ) ) || ( ( _array . length ) == ( - 1 ) ) ) return DocIdSetIterator . NO_MORE_DOCS ; if ( target <= ( _doc ) ) target = ( _doc ) + 1 ; int index = Arrays . binarySearch ( _array , target ) ; if ( index > 0 ) { cursor = index ; _doc = _array [ cursor ] ; return _doc ; } else { cursor = - ( index + 1 ) ; <START_BUG> if ( ( cursor ) > ( _array . length ) ) { <END_BUG> _doc = DocIdSetIterator . NO_MORE_DOCS ; } else { _doc = _array [ cursor ] ; } return _doc ; } } } }

Fix:
if ( ( cursor ) >= ( _array . length ) ) {
Buggy code:
public class DirectoryRepository { private static final String FILE = "db//directories.db" ; private static DirectoryRepository instance ; private Map < String , Directory > directories ; private DirectoryRepository ( ) { } public static DirectoryRepository getInstance ( ) { } private synchronized void readDirectories ( ) { try ( BufferedReader br = new BufferedReader ( new FileReader ( DirectoryRepository . FILE ) ) ) { String line ; while ( ( line = br . readLine ( ) ) != null ) { String [ ] split = line . split ( "<seq2seq4repair_space>" ) ; <START_BUG> directories . put ( split [ 0 ] , new Directory ( split [ 0 ] , Boolean . parseBoolean ( split [ 1 ] ) , Boolean . parseBoolean ( split [ 2 ] ) , new Group ( split [ 3 ] ) ) ) ; <END_BUG> } } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } public Group setDirectories ( Group group ) { } }

Fix:
directories . put ( ( ( ( split [ 0 ] ) + "<seq2seq4repair_space>" ) + ( split [ 3 ] ) ) , new Directory ( split [ 0 ] , Boolean . parseBoolean ( split [ 1 ] ) , Boolean . parseBoolean ( split [ 2 ] ) , new Group ( split [ 3 ] ) ) ) ;
Buggy code:
public class App { public static void main ( String [ ] args ) throws IOException , UnsupportedAudioFileException { if ( ( args . length ) < 1 ) { System . out . println ( "Where<seq2seq4repair_space>is<seq2seq4repair_space>the<seq2seq4repair_space>input<seq2seq4repair_space>file??????" ) ; } FeatureWorker worker = new FeatureWorker ( FeatureQueue . getInstance ( ) ) ; worker . setIConsumer ( new businessLayer . DBCreator ( Constants . numOfDimensions , Constants . numOfClusters ) ) ; new Thread ( worker , "Worker" ) . start ( ) ; DispatchManager dispatchManager = new DispatchManager ( ) ; <START_BUG> dispatchManager . initDispatcher ( new JVMAudioInputStream ( AudioSystem . getAudioInputStream ( new File ( args [ 0 ] ) ) ) ) ; <END_BUG> worker . stopWorker ( ) ; } }

Fix:
dispatchManager . initDispatcher ( new JVMAudioInputStream ( AudioSystem . getAudioInputStream ( new File ( args [ 2 ] ) ) ) ) ;
Buggy code:
public class FEMSHandlerFactory extends BaseThingHandlerFactory { private Logger logger = LoggerFactory . getLogger ( FEMSHandlerFactory . class ) ; @ Override public boolean supportsThingType ( ThingTypeUID thingTypeUID ) { } @ Override protected void activate ( ComponentContext componentContext ) { super . activate ( componentContext ) ; <START_BUG> logger . info ( "activate" ) ; <END_BUG> try { Files . deleteIfExists ( Paths . get ( "//var//lock//LCK..ttyUSB0" ) ) ; } catch ( IOException e1 ) { e1 . printStackTrace ( ) ; } try { Files . write ( Paths . get ( "//sys//class//leds//beaglebone:green:usr3//brightness" ) , "1" . getBytes ( ) ) ; } catch ( IOException e1 ) { logger . error ( e1 . getMessage ( ) ) ; } try { NetworkInterface n = NetworkInterface . getByName ( "eth0" ) ; Enumeration < InetAddress > ee = n . getInetAddresses ( ) ; while ( ee . hasMoreElements ( ) ) { InetAddress i = ( ( InetAddress ) ( ee . nextElement ( ) ) ) ; if ( i instanceof Inet4Address ) { FEMSDisplayAgent . getFEMSDisplay ( ) . offer ( ( "<seq2seq4repair_space>" + ( i . getHostAddress ( ) ) ) , false ) ; } } } catch ( SocketException e ) { } Properties properties = new Properties ( ) ; BufferedInputStream stream = null ; try { stream = new BufferedInputStream ( new FileInputStream ( "//etc//fems" ) ) ; properties . load ( stream ) ; if ( stream != null ) stream . close ( ) ; } catch ( IOException e ) { logger . error ( e . getMessage ( ) ) ; } ONLINE_MONITORING_AGENT . start ( ) ; ONLINE_MONITORING_AGENT . setApikey ( properties . getProperty ( "apikey" ) ) ; ONLINE_MONITORING_AGENT . sendSystemMessage ( "openHAB<seq2seq4repair_space>started" ) ; } @ Override protected ThingHandler createHandler ( Thing thing ) { } }

Fix:
logger . info ( "Activated<seq2seq4repair_space>FEMS<seq2seq4repair_space>Binding" ) ;
Buggy code:
@ RestController public class HyperlinkAPIController { private static final Logger logger = LoggerFactory . getLogger ( HyperlinkAPIController . class ) ; ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext ( "spring//spring-hyper.xml" ) ; HyperlinkDAO hyperlinkDAO = ctx . getBean ( "hyperlinkDAO" , HyperlinkDAO . class ) ; MetaTagDAO metaTagDAO = ctx . getBean ( "metaTagDAO" , MetaTagDAO . class ) ; CommentDAO commentDAO = ctx . getBean ( "commentDAO" , CommentDAO . class ) ; HyperlinkService hyperlinkService = ctx . getBean ( "hyperlinkService" , HyperlinkService . class ) ; @ RequestMapping ( value = "//api//add" , method = RequestMethod . POST ) public Hyperlink addHyperlink ( @ RequestBody Hyperlink hyperlink ) { } @ RequestMapping ( value = "//api//addtag" , method = RequestMethod . POST ) public boolean addMetaTag ( @ RequestBody MetaTag tag ) { } @ RequestMapping ( value = "//api//addcomment" , method = RequestMethod . POST ) public boolean addComment ( @ RequestBody Comment comment ) { } @ RequestMapping ( value = "//api//edit" , method = RequestMethod . POST ) public Hyperlink editHyperlink ( @ RequestBody Hyperlink hyperlink ) { } @ RequestMapping ( value = "//api//editcomment" , method = RequestMethod . POST ) public Hyperlink editComment ( @ RequestBody Comment comment ) { } @ RequestMapping ( value = "//api" , method = RequestMethod . GET ) public List < Hyperlink > getAllHyperlinks ( ) { } @ RequestMapping ( value = "//api//show//{id}" , method = RequestMethod . GET ) public Hyperlink show ( @ PathVariable ( "id" ) long id ) { } @ RequestMapping ( value = "//api//getallwithtag" , method = RequestMethod . POST ) public List < Hyperlink > getAllWithTag ( @ RequestBody QueryString q ) { HyperlinkAPIController . logger . info ( "Start<seq2seq4repair_space>getAllWithTag." ) ; try { <START_BUG> return hyperlinkService . getAllWithTag ( new MetaTag ( q . getQuery ( ) ) , "" ) ; <END_BUG> } catch ( DataAccessException ex ) { return null ; } } @ RequestMapping ( value = "//api//getallwithhyperlink" , method = RequestMethod . POST ) public List < Hyperlink > getAllWithHyperlink ( @ RequestBody QueryString q ) { } @ RequestMapping ( value = "//api//delete//{id}" , method = RequestMethod . PUT ) public boolean delete ( @ PathVariable ( "id" ) long id ) { } @ RequestMapping ( value = "//api//deletetag//{id}" , method = RequestMethod . PUT ) public boolean deleteMetaTag ( @ PathVariable ( "id" ) long id ) { } @ RequestMapping ( value = "//api//deletecomment//{id}" , method = RequestMethod . PUT ) public boolean deleteComment ( @ PathVariable ( "id" ) long id ) { } No newline ; at end ; of file ; }

Fix:
return hyperlinkService . getAllWithTag ( q . getQuery ( ) , "" ) ;
Buggy code:
public final class LevelingLogic { private LevelingLogic ( ) { } public static final String TAG_EXP = "ToolEXP" ; public static final String TAG_LEVEL = "ToolLevel" ; public static final String TAG_BOOST_EXP = "HeadEXP" ; public static final String TAG_IS_BOOSTED = "HarvestLevelModified" ; public static int getLevel ( NBTTagCompound tags ) { } public static int getHarvestLevel ( NBTTagCompound tags ) { } public static long getXp ( NBTTagCompound tags ) { } public static long getBoostXp ( NBTTagCompound tags ) { } public static boolean hasLevel ( NBTTagCompound tags ) { } public static boolean hasXp ( NBTTagCompound tags ) { } public static boolean hasBoostXp ( NBTTagCompound tags ) { } public static boolean isBoosted ( NBTTagCompound tags ) { } public static boolean isMaxLevel ( NBTTagCompound tags ) { } public static boolean canBoostMiningLevel ( NBTTagCompound tags ) { } public static void addLevelingTags ( NBTTagCompound tag , ToolCore tool ) { } public static void addBoostTags ( NBTTagCompound tag , ToolCore tool ) { } public static void updateXP ( ItemStack tool , EntityPlayer player , long toolXP , long boostXP ) { } public static void addXP ( ItemStack tool , EntityPlayer player , long xp ) { } public static int getRequiredBoostXp ( ItemStack tool ) { } public static int getRequiredXp ( ItemStack tool , NBTTagCompound tags ) { } protected static int getRequiredXp ( ItemStack tool , NBTTagCompound tags , boolean miningBoost ) { } private static float getXPMulter ( ItemStack tool , NBTTagCompound tags ) { ToolCore core = ( ( ToolCore ) ( tool . getItem ( ) ) ) ; double numberOfParts = 0 ; <START_BUG> double xpModSoFar = 0 ; <END_BUG> if ( ( ReplacementLogic . getPart ( core , HEAD ) ) != null ) { numberOfParts ++ ; int toolMaterialHead = ReplacementLogic . getToolPartMaterial ( tags , HEAD ) ; String matName = TConstructRegistry . getMaterial ( toolMaterialHead ) . name ( ) ; xpModSoFar *= XPAdjustmentMap . get ( matName ) ; } if ( ( ReplacementLogic . getPart ( core , HANDLE ) ) != null ) { numberOfParts ++ ; int toolMaterialHandle = ReplacementLogic . getToolPartMaterial ( tags , HANDLE ) ; String matName = TConstructRegistry . getMaterial ( toolMaterialHandle ) . name ( ) ; xpModSoFar *= XPAdjustmentMap . get ( matName ) ; } if ( ( ReplacementLogic . getPart ( core , ACCESSORY ) ) != null ) { numberOfParts ++ ; int toolMaterialAccessory = ReplacementLogic . getToolPartMaterial ( tags , ACCESSORY ) ; String matName = TConstructRegistry . getMaterial ( toolMaterialAccessory ) . name ( ) ; xpModSoFar *= XPAdjustmentMap . get ( matName ) ; } if ( ( ReplacementLogic . getPart ( core , EXTRA ) ) != null ) { numberOfParts ++ ; int toolMaterialExtra = ReplacementLogic . getToolPartMaterial ( tags , EXTRA ) ; String matName = TConstructRegistry . getMaterial ( toolMaterialExtra ) . name ( ) ; xpModSoFar *= XPAdjustmentMap . get ( matName ) ; } return ( ( float ) ( Math . pow ( xpModSoFar , ( 1.0 // numberOfParts ) ) ) ) ; } public static void levelUpTool ( ItemStack stack , EntityPlayer player ) { } public static void levelUpMiningLevel ( ItemStack stack , EntityPlayer player , boolean leveled ) { } }

Fix:
double xpModSoFar = 1 ;
Buggy code:
public class PropertyPrinter implements PropertyGetter . PropertyCallback { protected int numAppenders = 0 ; protected Hashtable appenderNames = new Hashtable ( ) ; protected Hashtable layoutNames = new Hashtable ( ) ; protected PrintWriter out ; protected boolean doCapitalize ; public PropertyPrinter ( PrintWriter out ) { } public PropertyPrinter ( PrintWriter out , boolean doCapitalize ) { } protected String genAppName ( ) { } protected boolean isGenAppName ( String name ) { } public void print ( PrintWriter out ) { } protected void printOptions ( PrintWriter out , Category cat ) { Enumeration appenders = cat . getAllAppenders ( ) ; <START_BUG> Priority prio = cat . getPriority ( ) ; <END_BUG> String appenderString = ( prio == null ) ? "" : prio . toString ( ) ; while ( appenders . hasMoreElements ( ) ) { Appender app = ( ( Appender ) ( appenders . nextElement ( ) ) ) ; String name ; if ( ( name = ( ( String ) ( appenderNames . get ( app ) ) ) ) == null ) { if ( ( ( name = app . getName ( ) ) == null ) || ( isGenAppName ( name ) ) ) { name = genAppName ( ) ; } appenderNames . put ( app , name ) ; printOptions ( out , app , ( "log4j.appender." + name ) ) ; if ( ( app . getLayout ( ) ) != null ) { printOptions ( out , app . getLayout ( ) , ( ( "log4j.appender." + name ) + ".layout" ) ) ; } } appenderString += ",<seq2seq4repair_space>" + name ; } String catKey = ( cat == ( Category . getRoot ( ) ) ) ? "log4j.rootCategory" : "log4j.category." + ( cat . getName ( ) ) ; if ( appenderString != "" ) { out . println ( ( ( catKey + "=" ) + appenderString ) ) ; } } protected void printOptions ( PrintWriter out , Object obj , String fullname ) { } public void foundProperty ( Object obj , String prefix , String name , Object value ) { } public static String capitalize ( String name ) { } public static void main ( String [ ] args ) { } }

Fix:
Level prio = cat . getLevel ( ) ;
Buggy code:
public class NestedTypeBinding extends SourceTypeBinding { public SourceTypeBinding enclosingType ; public SyntheticArgumentBinding [ ] enclosingInstances ; public SyntheticArgumentBinding [ ] outerLocalVariables ; public int enclosingInstancesSlotSize ; public int outerLocalVariablesSlotSize ; public NestedTypeBinding ( char [ ] [ ] typeName , ClassScope scope , SourceTypeBinding enclosingType ) { } public SyntheticArgumentBinding addSyntheticArgument ( LocalVariableBinding actualOuterLocalVariable ) { } public SyntheticArgumentBinding addSyntheticArgument ( ReferenceBinding targetEnclosingType ) { } public SyntheticArgumentBinding addSyntheticArgumentAndField ( LocalVariableBinding actualOuterLocalVariable ) { } public SyntheticArgumentBinding addSyntheticArgumentAndField ( ReferenceBinding targetEnclosingType ) { } public final void computeSyntheticArgumentSlotSizes ( ) { } public ReferenceBinding enclosingType ( ) { } public SyntheticArgumentBinding getSyntheticArgument ( LocalVariableBinding actualOuterLocalVariable ) { } public SyntheticArgumentBinding [ ] syntheticEnclosingInstances ( ) { } public ReferenceBinding [ ] syntheticEnclosingInstanceTypes ( ) { } public SyntheticArgumentBinding [ ] syntheticOuterLocalVariables ( ) { } public void updateInnerEmulationDependents ( ) { } public SyntheticArgumentBinding getSyntheticArgument ( ReferenceBinding targetEnclosingType , boolean onlyExactMatch ) { if ( ( enclosingInstances ) == null ) return null ; for ( int i = enclosingInstances . length ; ( -- i ) >= 0 ; ) if ( ( enclosingInstances [ i ] . type ) == targetEnclosingType ) if ( ( enclosingInstances [ i ] . actualOuterLocalVariable ) == null ) return enclosingInstances [ i ] ; if ( ! onlyExactMatch ) { for ( int i = enclosingInstances . length ; ( -- i ) >= 0 ; ) if ( ( enclosingInstances [ i ] . actualOuterLocalVariable ) == null ) <START_BUG> if ( targetEnclosingType . isSuperclassOf ( ( ( ReferenceBinding ) ( enclosingInstances [ i ] . type ) ) ) ) <END_BUG> return enclosingInstances [ i ] ; } return null ; } }

Fix:
if ( ( ( ( ReferenceBinding ) ( enclosingInstances [ i ] . type ) ) . findSuperTypeErasingTo ( targetEnclosingType ) ) != null )
Buggy code:
public class FiremindClient { protected static final GeneralConfig CONFIG = GeneralConfig . getInstance ( ) ; static String firemindHost ; static List < String > addedScripts ; public static Duel popDeckJob ( ) { } private static void saveScriptFile ( String name , String extension , String content ) { } public static void resetChangedScripts ( ) { } public static boolean postGame ( Integer duel_id , Integer game_number , Date play_time , boolean win_deck1 , Integer magarena_version_major , Integer magarena_version_minor , String logFile ) { FiremindClient . CONFIG . load ( ) ; String url = ( ( ( FiremindClient . firemindHost ) + "//api//v1//duel_jobs//" ) + duel_id ) + "//games" ; System . out . println ( ( "Posting<seq2seq4repair_space>game<seq2seq4repair_space>result<seq2seq4repair_space>" + game_number ) ) ; URL object ; try { object = new URL ( url ) ; HttpURLConnection con = ( ( HttpURLConnection ) ( object . openConnection ( ) ) ) ; con . setRequestProperty ( "Content-Type" , "application//json" ) ; con . setRequestProperty ( "Accept" , "application//json" ) ; con . setRequestProperty ( "Authorization" , ( "Token<seq2seq4repair_space>token=" + ( FiremindClient . CONFIG . getFiremindAccessToken ( ) ) ) ) ; con . setRequestMethod ( "POST" ) ; JSONObject parent = new JSONObject ( ) ; parent . put ( "game_number" , game_number ) ; <START_BUG> parent . put ( "play_time" , play_time ) ; <END_BUG> parent . put ( "win_deck1" , win_deck1 ) ; parent . put ( "magarena_version_major" , magarena_version_major ) ; parent . put ( "magarena_version_minor" , magarena_version_minor ) ; parent . put ( "log" , new String ( Files . readAllBytes ( Paths . get ( logFile ) ) ) ) ; con . setDoOutput ( true ) ; con . setDoInput ( true ) ; OutputStreamWriter wr = new OutputStreamWriter ( con . getOutputStream ( ) ) ; wr . write ( parent . toString ( ) ) ; wr . flush ( ) ; int HttpResult = con . getResponseCode ( ) ; if ( HttpResult == ( HttpURLConnection . HTTP_OK ) ) { return true ; } else { System . err . println ( con . getResponseMessage ( ) ) ; } } catch ( MalformedURLException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return false ; } public static boolean postFailure ( Integer duel_id , String text ) { } public static boolean postSuccess ( Integer duel_id ) { } public static JSONObject readJsonFromUrl ( String url ) throws IOException , JSONException { } private static String readAll ( Reader rd ) throws IOException { } public static void setFiremindHost ( String host ) { } public static boolean checkMagarenaVersion ( String magarenaVersion ) { } public static void setHostByEnvironment ( ) { } }

Fix:
parent . put ( "play_time" , play_time . toGMTString ( ) ) ;
Buggy code:
public class AlarmReceiver extends BroadcastReceiver { @ Override public void onReceive ( Context context , Intent intent ) { long id = intent . getExtras ( ) . getLong ( "requestCode" ) ; System . out . println ( id ) ; AlarmsDataSource dataSource = new AlarmsDataSource ( context ) ; dataSource . open ( ) ; dataSource . updateActive ( id , "<seq2seq4repair_space>" ) ; AlarmListAdapter adapter = new AlarmListAdapter ( context , dataSource . getAllAlarms ( ) ) ; adapter . refreshList ( dataSource . getAllAlarms ( ) ) ; dataSource . close ( ) ; Intent isnt = new Intent ( context , EnterText . class ) ; <START_BUG> isnt . addFlags ( FLAG_ACTIVITY_NEW_TASK ) ; <END_BUG> context . startActivity ( isnt ) ; } No newline ; at end ; of file ; }

Fix:
isnt . addFlags ( ( ( Intent . FLAG_ACTIVITY_NEW_TASK ) | ( Intent . FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS ) ) ) ;
Buggy code:
public class ClassCryptFactory implements ICryptFactory { private static final Logger log = LoggerFactory . getLogger ( ClassCryptFactory . class ) ; private final WeakReference < Class < ? > > cryptClass ; private final String encryptionKey ; public ClassCryptFactory ( final Class < ? > cryptClass , final String encryptionKey ) { } public ICrypt newCrypt ( ) { try { ICrypt crypt = ( ( ICrypt ) ( cryptClass . get ( ) . newInstance ( ) ) ) ; ClassCryptFactory . log . info ( ( "using<seq2seq4repair_space>encryption//decryption<seq2seq4repair_space>object<seq2seq4repair_space>" + crypt ) ) ; crypt . setKey ( encryptionKey ) ; return crypt ; <START_BUG> } catch ( Throwable e ) { <END_BUG> ClassCryptFactory . log . warn ( "**************************<seq2seq4repair_space>WARNING<seq2seq4repair_space>**************************" ) ; ClassCryptFactory . log . warn ( "As<seq2seq4repair_space>the<seq2seq4repair_space>instantion<seq2seq4repair_space>of<seq2seq4repair_space>encryption//decryption<seq2seq4repair_space>class:" ) ; ClassCryptFactory . log . warn ( ( "\t" + ( cryptClass ) ) ) ; ClassCryptFactory . log . warn ( "failed,<seq2seq4repair_space>Wicket<seq2seq4repair_space>will<seq2seq4repair_space>fallback<seq2seq4repair_space>on<seq2seq4repair_space>a<seq2seq4repair_space>dummy<seq2seq4repair_space>implementation" ) ; ClassCryptFactory . log . warn ( ( ( "\t(" + ( NoCrypt . class . getName ( ) ) ) + ")" ) ) ; ClassCryptFactory . log . warn ( "This<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>recommended<seq2seq4repair_space>for<seq2seq4repair_space>production<seq2seq4repair_space>systems." ) ; ClassCryptFactory . log . warn ( "Please<seq2seq4repair_space>override<seq2seq4repair_space>method<seq2seq4repair_space>org.apache.wicket.Application.newCrypt()" ) ; ClassCryptFactory . log . warn ( "to<seq2seq4repair_space>provide<seq2seq4repair_space>a<seq2seq4repair_space>custom<seq2seq4repair_space>encryption//decryption<seq2seq4repair_space>implementation" ) ; ClassCryptFactory . log . warn ( "The<seq2seq4repair_space>cause<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>instantion<seq2seq4repair_space>failure:<seq2seq4repair_space>" ) ; ClassCryptFactory . log . warn ( ( "\t" + ( e . getMessage ( ) ) ) ) ; if ( ClassCryptFactory . log . isDebugEnabled ( ) ) { ClassCryptFactory . log . debug ( "exception:<seq2seq4repair_space>" , e ) ; } else { ClassCryptFactory . log . warn ( "set<seq2seq4repair_space>log<seq2seq4repair_space>level<seq2seq4repair_space>to<seq2seq4repair_space>DEBUG<seq2seq4repair_space>to<seq2seq4repair_space>display<seq2seq4repair_space>the<seq2seq4repair_space>stack<seq2seq4repair_space>trace." ) ; } ClassCryptFactory . log . warn ( "*************************************************************" ) ; return new NoCrypt ( ) ; } } }

Fix:
} catch ( Exception e ) {
Buggy code:
class XSDNotationTraverser extends XSDAbstractTraverser { XSDNotationTraverser ( XSDHandler handler , XMLErrorReporter errorReporter , XSAttributeChecker gAttrCheck ) { } int traverse ( Element elmNode , XSDocumentInfo schemaDoc , SchemaGrammar grammar ) { <START_BUG> return - 1 ; <END_BUG> } }

Fix:
return XSDHandler . I_EMPTY_DECL ;
Buggy code:
public class MainActivity extends AppCompatActivity implements View . OnClickListener { public static final String TAG = MainActivity . class . getSimpleName ( ) ; @ Bind ( id . findShopsButton ) Button mFindShopsButton ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override <START_BUG> public void onClick ( View view ) { <END_BUG> Intent intent = new Intent ( this , CoffeeShopsActivity . class ) ; startActivity ( intent ) ; } }

Fix:
public void onClick ( View v ) {
Buggy code:
public final class PageParameters extends ValueMap { public static final PageParameters NULL = new PageParameters ( ) ; private static final long serialVersionUID = 1L ; public PageParameters ( ) { } public PageParameters ( final Map parameterMap ) { } public PageParameters ( final String keyValuePairs ) { } public PageParameters ( final String keyValuePairs , final String delimiter ) { } public Object put ( Object key , Object value ) { if ( ( value instanceof String ) || ( value instanceof String [ ] ) ) { return super . put ( key , value ) ; } else { <START_BUG> throw new WicketRuntimeException ( ( ( ( ( "You<seq2seq4repair_space>tried<seq2seq4repair_space>to<seq2seq4repair_space>add<seq2seq4repair_space>an<seq2seq4repair_space>object<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>" + ( value . getClass ( ) . getName ( ) ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>your<seq2seq4repair_space>PageParameters<seq2seq4repair_space>for<seq2seq4repair_space>key<seq2seq4repair_space>" ) + key ) + ",<seq2seq4repair_space>but<seq2seq4repair_space>you<seq2seq4repair_space>are<seq2seq4repair_space>only<seq2seq4repair_space>allowed<seq2seq4repair_space>to<seq2seq4repair_space>use<seq2seq4repair_space>String<seq2seq4repair_space>or<seq2seq4repair_space>String[]." ) ) ; <END_BUG> } } private void setOnRequestCycle ( ) { } }

Fix:
throw new IllegalArgumentException ( ( ( ( ( "You<seq2seq4repair_space>tried<seq2seq4repair_space>to<seq2seq4repair_space>add<seq2seq4repair_space>an<seq2seq4repair_space>object<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>" + ( value . getClass ( ) . getName ( ) ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>your<seq2seq4repair_space>PageParameters<seq2seq4repair_space>for<seq2seq4repair_space>key<seq2seq4repair_space>" ) + key ) + ",<seq2seq4repair_space>but<seq2seq4repair_space>you<seq2seq4repair_space>are<seq2seq4repair_space>only<seq2seq4repair_space>allowed<seq2seq4repair_space>to<seq2seq4repair_space>use<seq2seq4repair_space>String<seq2seq4repair_space>or<seq2seq4repair_space>String[]." ) ) ;
Buggy code:
public class SectionManager { String collection_ ; Agent agent_ ; static final int HOLD = 0 ; static final int NO_HOLD = 1 ; Stack freeSectionsNonHold_ = null ; Stack freeSectionsHold_ = null ; int nextAvailableSectionNumber_ = 1 ; public static byte [ ] holdPKGNAMCBytes = null ; public static byte [ ] noHoldPKGNAMCBytes = null ; static final String packageNameWithHold__ = "SYSLH000" ; static final String packageNameWithNoHold__ = "SYSLN000" ; static final String cursorNamePrefixWithHold__ = "SQL_CURLH000C" ; static final String cursorNamePrefixWithNoHold__ = "SQL_CURLN000C" ; private Hashtable positionedUpdateCursorNameToQuerySection_ = new Hashtable ( ) ; private Hashtable positionedUpdateCursorNameToResultSet_ = new Hashtable ( ) ; String databaseName ; int maxNumSections_ = 32768 ; public SectionManager ( String collection , Agent agent , String databaseName ) { } public void setPKGNAMCBytes ( byte [ ] b , int resultSetHoldability ) { } public Section getDynamicSection ( int resultSetHoldability ) throws SqlException { } protected Section getSection ( Stack freeSections , String packageName , String cursorNamePrefix , int resultSetHoldability ) throws SqlException { } public void freeSection ( Section section , int resultSetHoldability ) { } Section getPositionedUpdateSection ( Section querySection ) throws SqlException { Connection connection = agent_ . connection_ ; <START_BUG> return getDynamicSection ( connection . resultSetHoldability_ ) ; <END_BUG> } Section getPositionedUpdateSection ( String cursorName , boolean useExecuteImmediateSection ) throws SqlException { } void mapCursorNameToQuerySection ( String cursorName , Section section ) { } void mapCursorNameToResultSet ( String cursorName , ResultSet resultSet ) { } ResultSet getPositionedUpdateResultSet ( String cursorName ) throws SqlException { } void removeCursorNameToResultSetMapping ( String clientCursorName , String serverCursorName ) { } void removeCursorNameToQuerySectionMapping ( String clientCursorName , String serverCursorName ) { } }

Fix:
return getDynamicSection ( connection . holdability ( ) ) ;
Buggy code:
public class ManifestTest extends TestCase { public void testReadInfo ( ) throws Exception { } public void testReadProvides ( ) throws Exception { File manifest = new File ( this . getClass ( ) . getResource ( "//Manifest.json" ) . getPath ( ) ) ; Manifest m = Manifest . read ( manifest ) ; Map < String , String > expected = new LinkedHashMap < String , String > ( ) { } ; for ( String key : expected . keySet ( ) ) { <START_BUG> assertEquals ( expected . get ( key ) , ( ( String ) ( m . info ( key ) ) ) ) ; <END_BUG> } assertEquals ( expected . get ( "namespace" ) , m . getNamespace ( ) ) ; assertEquals ( expected . get ( "encoding" ) , m . getEncoding ( ) ) ; assertEquals ( expected . get ( "class" ) , m . getKlass ( ) ) ; assertEquals ( expected . get ( "resource" ) , m . getResource ( ) ) ; assertEquals ( expected . get ( "translation" ) , m . getTranslation ( ) ) ; assertEquals ( expected . get ( "type" ) , m . getType ( ) ) ; } }

Fix:
assertEquals ( expected . get ( key ) , ( ( String ) ( m . provides ( key ) ) ) ) ;
Buggy code:
@ SuppressWarnings ( "deprecation" ) public class ManualTagController extends SimpleFormController { protected final Log logger = LogFactory . getLog ( getClass ( ) ) ; private MastersService mastersManager ; public MastersService getMastersManager ( ) { } public void setMastersManager ( MastersService mastersManager ) { } private HttpSession cursess ; private int currmeterid ; public ModelAndView onSubmit ( Object command ) throws ParseException , ServletException { } protected Object formBackingObject ( HttpServletRequest request ) throws ServletException { } @ SuppressWarnings ( "unchecked" ) protected Map referenceData ( HttpServletRequest request ) throws Exception { HashMap referenceData = new HashMap ( ) ; <START_BUG> List < Section > sectionlist = mastersManager . getUserSectionList ( ) ; <END_BUG> referenceData . put ( "AssetList" , sectionlist ) ; return referenceData ; } }

Fix:
List < Section > sectionlist = mastersManager . getAllSectionList ( ) ;
Buggy code:
public class DeploymentHandlerUtil { private DeploymentHandlerUtil ( ) { } public static void deploy ( ModelNode deploymentModel , NewOperationContext context , ResultHandler resultHandler , ModelNode compensatingOp ) { if ( context instanceof NewRuntimeOperationContext ) { NewRuntimeOperationContext updateContext = ( ( NewRuntimeOperationContext ) ( context ) ) ; String deploymentUnitName = deploymentModel . require ( NAME ) . asString ( ) ; <START_BUG> final ServiceName deploymentUnitServiceName = JBOSS_DEPLOYMENT . append ( deploymentUnitName ) ; <END_BUG> final ServiceRegistry serviceRegistry = updateContext . getServiceRegistry ( ) ; final ServiceController < ? > controller = serviceRegistry . getService ( deploymentUnitServiceName ) ; if ( controller != null ) { controller . setMode ( ACTIVE ) ; } else { final ServiceTarget serviceTarget = updateContext . getServiceTarget ( ) ; final String runtimeName = deploymentModel . require ( RUNTIME_NAME ) . asString ( ) ; final byte [ ] hash = deploymentModel . require ( HASH ) . asBytes ( ) ; final RootDeploymentUnitService service = new RootDeploymentUnitService ( deploymentUnitName , runtimeName , hash , null ) ; serviceTarget . addService ( deploymentUnitServiceName , service ) . addDependency ( JBOSS_DEPLOYMENT_CHAINS , DeployerChains . class , service . getDeployerChainsInjector ( ) ) . addDependency ( SERVICE_NAME , ServerDeploymentRepository . class , service . getServerDeploymentRepositoryInjector ( ) ) . setInitialMode ( ACTIVE ) . install ( ) ; } resultHandler . handleResultComplete ( compensatingOp ) ; } else { resultHandler . handleResultComplete ( compensatingOp ) ; } } public static void replace ( final ModelNode deploymentModel , final String toReplace , final NewOperationContext context , final ResultHandler resultHandler , final ModelNode compensatingOp ) { } }

Fix:
final ServiceName deploymentUnitServiceName = Services . deploymentUnitName ( deploymentUnitName ) ;
Buggy code:
public class TownGenerator extends MapGenerator { private char UNUSED = '<seq2seq4repair_space>' ; private char WALL = '-' ; private char VERTWALL = '|' ; private char FLOOR = '.' ; private char STONEWALL = 'O' ; private char CORRIDOR = '#' ; private char DOOR = 'D' ; private char UPSTAIRS = '>' ; private char DOWNSTAIRS = '<' ; private int _objects ; private int _xsize ; private int _ysize ; private int SMALLHOUSESIZE = 5 ; private int LARGEHOUSESIZE = 12 ; private int DOORCHANCE = 30 ; private int TESTING = 1000 ; @ Override public void createMap ( int xMap , int yMap , int objects ) { } public void placeStairs ( ) { } public void checkDoorPlacement ( ) { for ( int x = 0 ; x < ( _xsize ) ; x ++ ) for ( int y = 0 ; y < ( _ysize ) ; y ++ ) if ( ( getCell ( x , y ) ) == ( DOOR ) ) { <START_BUG> if ( ( ( ( ( x - 2 ) < 0 ) || ( ( y - 2 ) < 0 ) ) || ( ( x + 2 ) > ( _xsize ) ) ) || ( ( y + 2 ) > ( _ysize ) ) ) <END_BUG> break ; else if ( ( ( getCell ( ( x - 1 ) , y ) ) == ( STONEWALL ) ) && ( ( getCell ( ( x - 2 ) , y ) ) == ( FLOOR ) ) ) setCell ( ( x - 1 ) , y , FLOOR ) ; else if ( ( ( getCell ( ( x + 1 ) , y ) ) == ( STONEWALL ) ) && ( ( getCell ( ( x + 2 ) , y ) ) == ( FLOOR ) ) ) setCell ( ( x + 1 ) , y , FLOOR ) ; else if ( ( ( getCell ( x , ( y - 1 ) ) ) == ( STONEWALL ) ) && ( ( getCell ( x , ( y - 2 ) ) ) == ( FLOOR ) ) ) setCell ( x , ( y - 1 ) , FLOOR ) ; else if ( ( ( getCell ( x , ( y + 1 ) ) ) == ( STONEWALL ) ) && ( ( getCell ( x , ( y + 2 ) ) ) == ( FLOOR ) ) ) setCell ( x , ( y + 1 ) , FLOOR ) ; } } public void removeEdge ( ) { } public boolean checkHousePlacement ( int xStart , int yStart , int xsize , int ysize ) { } public void placeHouse ( int xStart , int yStart , int xSize , int ySize ) { } public boolean wasDoorPlaced ( int x , int y , int xStart , int yStart , int xSize , int ySize ) { } public void createHouse ( int xHouseSize , int yHouseSize ) { } public void setup ( ) { } @ Override public String showMap ( ) { } @ Override public void setCell ( int x , int y , char cellType ) { } @ Override public char getCell ( int x , int y ) { } @ Override public char [ ] [ ] getMap ( ) { } }

Fix:
if ( ( ( ( ( x - 2 ) < 0 ) || ( ( y - 2 ) < 0 ) ) || ( ( x + 2 ) > ( ( _xsize ) - 1 ) ) ) || ( ( y + 2 ) > ( ( _ysize ) - 1 ) ) )
Buggy code:
public class Server { public static final PrintStream out = System . out ; public static ConnectionListener listener ; protected static Thread listenerThread ; public static ClientHandler clientHandler ; public static Processing process ; protected static Thread processThread ; public static int port = 2727 ; protected static String password = "all-star" ; public static void main ( String [ ] args ) { Server . clientHandler = new ClientHandler ( Defaults . MAX_CLIENTS ) ; ( Server . processThread = new Thread ( ( Server . process = new Processing ( ) ) ) ) . start ( ) ; ( Server . listenerThread = new Thread ( ( Server . listener = new ConnectionListener ( ) ) ) ) . start ( ) ; BufferedReader line = new BufferedReader ( new InputStreamReader ( System . in ) ) ; <START_BUG> String cmd = "" ; <END_BUG> try { while ( ( cmd = line . readLine ( ) ) != null ) { if ( ( cmd . equalsIgnoreCase ( "close" ) ) || ( cmd . equalsIgnoreCase ( "stop" ) ) ) { Server . process . Stop ( ) ; try { Server . processThread . join ( ) ; } catch ( InterruptedException ie ) { ie . printStackTrace ( ) ; } return ; } } } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; } System . exit ( 0 ) ; } }

Fix:
String cmd ;
Buggy code:
@ RunWith ( Arquillian . class ) @ ServerSetup ( PureTestCase . PureTestCaseSetup . class ) public class PureTestCase extends ContainerResourceMgmtTestBase { static class PureTestCaseSetup extends AbstractMgmtServerSetupTask { @ Override public void doSetup ( final ManagementClient managementClient ) throws Exception { String xml = FileUtils . readFile ( PureTestCase . class , "pure.xml" ) ; <START_BUG> List < ModelNode > operations = xmlToModelOperations ( xml , CURRENT . getUriString ( ) , new ResourceAdapterSubsystemParser ( ) ) ; <END_BUG> executeOperation ( operationListToCompositeOperation ( operations ) ) ; } @ Override public void tearDown ( final ManagementClient managementClient , final String containerId ) throws Exception { } } @ Deployment public static ResourceAdapterArchive createDeployment ( ) throws Exception { } @ Inject public ServiceContainer serviceContainer ; @ Test public void testRegistryConfiguration ( ) throws Throwable { } @ Test public void testMetadataConfiguration ( ) throws Throwable { } }

Fix:
List < ModelNode > operations = xmlToModelOperations ( xml , RESOURCEADAPTERS_1_0 . getUriString ( ) , new ResourceAdapterSubsystemParser ( ) ) ;