nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Router { private IPAdresse destIP ; private ArrayList < Route > table = new ArrayList < Route > ( ) ; public String longestPrefMatch ( IPAdresse destIP ) { Route longestPref = table . get ( 0 ) ; for ( int i = 0 ; i < ( table . size ( ) ) ; i ++ ) { Route current = table . get ( i ) ; <START_BUG> if ( ( longestPref . getNet ( ) . getMaskLength ( ) ) < ( current . getNet ( ) . getMaskLength ( ) ) ) { <END_BUG> longestPref = current ; } } if ( ( longestPref . getNet ( ) . ipMatch ( destIP ) ) == ( - 1 ) ) return "No<seq2seq4repair_space>Route<seq2seq4repair_space>to<seq2seq4repair_space>host" ; return "Route<seq2seq4repair_space>\t" + longestPref ; } public void routeAdd ( Route route ) { } public void routePrint ( ) { } }

Fix:
if ( ( longestPref . getNet ( ) . ipMatch ( destIP ) ) < ( current . getNet ( ) . ipMatch ( destIP ) ) ) {
Buggy code:
public abstract class IdentityConstraint implements XSIDCDefinition { protected short type ; protected String fNamespace ; protected String fIdentityConstraintName ; protected String fElementName ; protected Selector fSelector ; protected int fFieldCount ; protected Field [ ] fFields ; protected XSAnnotationImpl [ ] fAnnotations = null ; protected int fNumAnnotations ; protected IdentityConstraint ( String namespace , String identityConstraintName , String elemName ) { } public String getIdentityConstraintName ( ) { } public void setSelector ( Selector selector ) { } public Selector getSelector ( ) { } public void addField ( Field field ) { } public int getFieldCount ( ) { } public Field getFieldAt ( int index ) { } public String getElementName ( ) { } public String toString ( ) { } public boolean equals ( IdentityConstraint id ) { } static final Field [ ] resize ( Field [ ] oldArray , int newSize ) { } public short getType ( ) { } public String getName ( ) { } public String getNamespace ( ) { } public short getCategory ( ) { } public String getSelectorStr ( ) { <START_BUG> return fSelector . toString ( ) ; <END_BUG> } public StringList getFieldStrs ( ) { } public XSIDCDefinition getRefKey ( ) { } public XSObjectList getAnnotations ( ) { } public XSNamespaceItem getNamespaceItem ( ) { } public void addAnnotation ( XSAnnotationImpl annotation ) { } }

Fix:
return ( fSelector ) != null ? fSelector . toString ( ) : null ;
Buggy code:
public class Group extends Composite { String text = "" ; public Group ( Composite parent , int style ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } void createHandle ( ) { } void drawBackground ( int control , int context ) { } public Rectangle getClientArea ( ) { } String getNameText ( ) { } public String getText ( ) { } float getThemeAlpha ( ) { <START_BUG> return 0.25F * ( parent . getThemeAlpha ( ) ) ; <END_BUG> } public void setText ( String string ) { } }

Fix:
return ( ( background ) != null ? 1 : 0.25F ) * ( parent . getThemeAlpha ( ) ) ;
Buggy code:
public class PartitionManager { public static final Logger LOG = LoggerFactory . getLogger ( PartitionManager . class ) ; private final CombinedMetric _fetchAPILatencyMax ; private final ReducedMetric _fetchAPILatencyMean ; private final CountMetric _fetchAPICallCount ; private final CountMetric _fetchAPIMessageCount ; static class KafkaMessageId { public Partition partition ; public long offset ; public KafkaMessageId ( Partition partition , long offset ) { } } Long _emittedToOffset ; SortedSet < Long > _pending = new TreeSet < Long > ( ) ; Long _committedTo ; LinkedList < MessageAndRealOffset > _waitingToEmit = new LinkedList < MessageAndRealOffset > ( ) ; Partition _partition ; SpoutConfig _spoutConfig ; String _topologyInstanceId ; SimpleConsumer _consumer ; DynamicPartitionConnections _connections ; ZkState _state ; Map _stormConf ; public PartitionManager ( DynamicPartitionConnections connections , String topologyInstanceId , ZkState state , Map stormConf , SpoutConfig spoutConfig , Partition id ) { } public Map getMetricsDataMap ( ) { } public EmitState next ( SpoutOutputCollector collector ) { } private void fill ( ) { } private int countMessages ( ByteBufferMessageSet messageSet ) { } public void ack ( Long offset ) { } public void fail ( Long offset ) { } public void commit ( ) { } private String committedPath ( ) { <START_BUG> return ( ( ( ( _spoutConfig . zkRoot ) + "//" ) + ( _spoutConfig . id ) ) + "//" ) + ( _partition . getId ( ) ) ; <END_BUG> } public long queryPartitionOffsetLatestTime ( ) { } public long lastCommittedOffset ( ) { } public long lastCompletedOffset ( ) { } public Partition getPartition ( ) { } public void close ( ) { } }

Fix:
return ( ( ( ( ( ( _spoutConfig . zkRoot ) + "//" ) + ( _spoutConfig . id ) ) + "//" ) + ( _spoutConfig . topic ) ) + "//" ) + ( _partition . getId ( ) ) ;
Buggy code:
public class FopLatencyTest extends OnesidedTestBase { private int i ; int disp ; double tStart ; double tEnd ; private Win win ; private long [ ] sbuf = new long [ MAX_SIZE ] ; private long [ ] tbuf = new long [ MAX_SIZE ] ; @ Override protected void initialize ( String [ ] args ) { super . initialize ( args ) ; <START_BUG> getReporter ( ) . setColumnNames ( new String [ ] { "Latency<seq2seq4repair_space>(µs)" } ) ; <END_BUG> } private double collectResult ( double tStart , double tEnd ) { } private double collectResult ( double tStart , double tEnd , double multiplier ) { } @ Override protected void runTestWithFlush ( ) { } @ Override protected void runTestWithFlushLocal ( ) { } @ Override protected void runTestWithLockAll ( ) { } @ Override protected void runTestWithFence ( ) { } @ Override protected void runTestWithPscw ( ) { } @ Override protected void runTestWithLock ( ) { } }

Fix:
getReporter ( ) . setColumnNames ( new String [ ] { "Latency<seq2seq4repair_space>(us)" } ) ;
Buggy code:
public class MobileServiceConnection { public static final String JSON_CONTENTTYPE = "application//json" ; private static final String X_ZUMO_APPLICATION_HEADER = "X-ZUMO-APPLICATION" ; private static final String X_ZUMO_INSTALLATION_ID_HEADER = "X-ZUMO-INSTALLATION-ID" ; private static final String X_ZUMO_AUTH_HEADER = "X-ZUMO-AUTH" ; private static final String X_ZUMO_VERSION_HEADER = "X-ZUMO-VERSION" ; private static final String GZIP_CONTENTENCODING = "gzip" ; private static final String SDK_VERSION = "2.0.2-Beta" ; private MobileServiceClient mClient ; public MobileServiceConnection ( MobileServiceClient client ) { } static String getUserAgent ( ) { } public ListenableFuture < ServiceFilterResponse > start ( final ServiceFilterRequest request ) { } public void start ( final ServiceFilterRequest request , final ServiceFilterResponseCallback responseCallback ) { } private void configureHeadersOnRequest ( ServiceFilterRequest request ) { MobileServiceUser user = mClient . getCurrentUser ( ) ; if ( ( user != null ) && ( ( user . getAuthenticationToken ( ) ) != "" ) ) { request . addHeader ( MobileServiceConnection . X_ZUMO_AUTH_HEADER , user . getAuthenticationToken ( ) ) ; } <START_BUG> if ( ( VERSION . RELEASE ) != null ) { <END_BUG> request . addHeader ( MobileServiceConnection . X_ZUMO_VERSION_HEADER , MobileServiceConnection . SDK_VERSION ) ; } request . addHeader ( USER_AGENT , MobileServiceConnection . getUserAgent ( ) ) ; String appKey = mClient . getAppKey ( ) ; if ( ( appKey != null ) && ( ( appKey . trim ( ) . length ( ) ) > 0 ) ) { request . addHeader ( MobileServiceConnection . X_ZUMO_APPLICATION_HEADER , mClient . getAppKey ( ) ) ; } request . addHeader ( MobileServiceConnection . X_ZUMO_INSTALLATION_ID_HEADER , MobileServiceApplication . getInstallationId ( mClient . getContext ( ) ) ) ; if ( ! ( requestContainsHeader ( request , "Accept" ) ) ) { request . addHeader ( "Accept" , MobileServiceConnection . JSON_CONTENTTYPE ) ; } if ( ! ( requestContainsHeader ( request , "Accept-Encoding" ) ) ) { request . addHeader ( "Accept-Encoding" , MobileServiceConnection . GZIP_CONTENTENCODING ) ; } } private boolean requestContainsHeader ( ServiceFilterRequest request , String headerName ) { } }

Fix:
if ( ( MobileServiceConnection . SDK_VERSION ) != null ) {
Buggy code:
public class Jsonschema2PojoRule implements TestRule { private File generateDir ; private File compileDir ; private boolean active = false ; private boolean sourceDirInitialized = false ; private boolean classesDirInitialized = false ; private ClassLoader classLoader ; public File getGenerateDir ( ) { } public File getCompileDir ( ) { } public ClassLoader getClassLoader ( ) { } @ Override public Statement apply ( final Statement base , final Description description ) { } public File generate ( String schema , String targetPackage ) { } public File generate ( URL schema , String targetPackage ) { } public File generate ( String schema , String targetPackage , Map < String , Object > configValues ) { } public File generate ( final URL schema , final String targetPackage , final Map < String , Object > configValues ) { } public ClassLoader compile ( ) { } public ClassLoader compile ( List < File > classpath ) { } public ClassLoader compile ( List < File > classpath , Map < String , Object > config ) { } public ClassLoader generateAndCompile ( String schema , String targetPackage , Map < String , Object > configValues ) { } public ClassLoader generateAndCompile ( String schema , String targetPackage ) { } public ClassLoader generateAndCompile ( URL schema , String targetPackage ) { } public ClassLoader generateAndCompile ( URL schema , String targetPackage , Map < String , Object > configValues ) { } public File generated ( String relativeSourcePath ) { } private void checkActive ( ) { } private static List < File > emptyClasspath ( ) { } private static Map < String , Object > emptyConfig ( ) { } private static URL schemaUrl ( String schema ) { } static File rootDirectory ( ) { } static File classNameDir ( File baseDir , String className ) throws IOException { } static final Pattern methodNamePattern = Jsonschema2PojoRule . compilePattern ( "\\A([^\\[]+)(?:\\[(.*)\\])?\\Z" ) ; static Pattern compilePattern ( String pattern ) { } static File methodNameDir ( File baseDir , String methodName ) throws IOException { } static boolean ensureDirectoryInitialized ( File dir , boolean isInitialized ) { } static String safeDirName ( String label ) { } static String classNameToPath ( String className ) { <START_BUG> return className . replaceAll ( "\\A(?:.*\\.)?([^\\.]*)\\Z" , "$1" ) . replaceAll ( "\\$" , File . separator ) ; <END_BUG> } }

Fix:
return className . replaceAll ( "\\A(?:.*\\.)?([^\\.]*)\\Z" , "$1" ) . replaceAll ( "\\$" , Pattern . quote ( File . separator ) ) ;
Buggy code:
public abstract class AbstractProduct implements Product { protected String name ; protected String number ; protected String [ ] tags ; protected Money price ; protected boolean active ; protected ArrayList < Client > reservedPer = new ArrayList < > ( ) ; protected ArrayList < Client > soldPer = new ArrayList < > ( ) ; protected boolean shared ; public AbstractProduct ( String name , String number , double price , String [ ] tags , boolean active ) { } public AbstractProduct ( String name , String number , double price , String [ ] tags ) { } public boolean isAvailable ( ) { if ( ! ( active ) ) <START_BUG> throw new ProductNotAvailableException ( "Produkt<seq2seq4repair_space>jest<seq2seq4repair_space>niedostępny<seq2seq4repair_space>" , number , this . getClass ( ) ) ; <END_BUG> return active ; } public void setShared ( boolean bool ) { } public double calculatePrice ( ) { } public Money getPrice ( ) { } public String getNumber ( ) { } public void cancel ( ) { } public void reservePer ( Client client ) throws IllegalArgumentException { } public void unreservePer ( Client client ) throws IllegalArgumentException { } public boolean canBeReservedBy ( Client client ) { } public boolean isSoldOut ( ) throws IllegalStateException { } private boolean canBeBoughtByMany ( ) { } private boolean isSold ( ) { } private boolean isReservedByVip ( ) throws IllegalStateException { } public void sellPer ( Client client ) throws IllegalStateException { } public void setNumber ( String number ) { } @ Override public String getName ( ) { } @ Override public String [ ] getTags ( ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } }

Fix:
throw new ProductNotAvailableException ( ( ( "Produkt<seq2seq4repair_space>" + ( number ) ) + "<seq2seq4repair_space>jest<seq2seq4repair_space>niedostępny<seq2seq4repair_space>" ) , number ) ;
Buggy code:
public abstract class Statement extends ASTNode { public abstract FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } <START_BUG> public void branchChainTo ( Label label ) { <END_BUG> } public boolean complainIfUnreachable ( FlowInfo flowInfo , BlockScope scope , boolean didAlreadyComplain ) { } public void generateArguments ( MethodBinding binding , Expression [ ] arguments , BlockScope currentScope , CodeStream codeStream ) { } public abstract void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public boolean isEmptyBlock ( ) { } public boolean isValidJavaStatement ( ) { } public StringBuffer print ( int indent , StringBuffer output ) { } public abstract StringBuffer printStatement ( int indent , StringBuffer output ) { } public abstract void resolve ( BlockScope scope ) { } public Constant resolveCase ( BlockScope scope , TypeBinding testType , SwitchStatement switchStatement ) { } }

Fix:
public void branchChainTo ( BranchLabel label ) {
Buggy code:
public class ClassicPropertyResolverTestCase extends AbstractPropertyResolverTestCase { public ClassicPropertyResolverTestCase ( String name ) { } protected PropertyResolver createResolver ( ) { } public void testUndefinedProp ( ) throws Exception { final String undefinedProp = "undefinedProperty" ; final String propRef = ( "${" + undefinedProp ) + "}" ; <START_BUG> doTestResolution ( propRef , propRef , m_store ) ; <END_BUG> } }

Fix:
doTestResolution ( propRef , propRef , m_context ) ;
Buggy code:
public class GroupTableModel extends AbstractTableModel { private AdapterNode node ; private List groupList ; private String [ ] columnNames = new String [ ] { "Display<seq2seq4repair_space>Name" , "Address" , "First<seq2seq4repair_space>Name" , "Last<seq2seq4repair_space>Name" } ; private int count ; protected DefaultXmlConfig config ; public GroupTableModel ( DefaultXmlConfig config ) { } public void setNode ( AdapterNode n ) { } public void update ( ) { } public int getColumnCount ( ) { } public int getRowCount ( ) { } public String getColumnName ( int col ) { } protected int getColumnNumber ( String str ) { } public Object getValueAt ( int row , int col ) { AdapterNode contact ; contact = ( ( AdapterNode ) ( groupList . get ( row ) ) ) ; if ( contact == null ) { return "" ; } AdapterNode child = null ; <START_BUG> String str = new String ( "" ) ; <END_BUG> if ( contact . getName ( ) . equals ( "contact" ) ) { if ( col == 0 ) { child = contact . getChild ( "displayname" ) ; str = child . getValue ( ) ; } else if ( col == 1 ) { child = contact . getChild ( "address" ) ; str = child . getCDATAValue ( ) ; } else if ( col == 2 ) { child = contact . getChild ( "firstname" ) ; str = child . getValue ( ) ; } if ( col == 3 ) { child = contact . getChild ( "lastname" ) ; str = child . getValue ( ) ; } } return str ; } public Class getColumnClass ( int c ) { } }

Fix:
String str = "" ;
Buggy code:
public class Core { public static ArrayList < Peer > peerList ; public static HashMap < Peer , ArrayList < String > > index ; public static MainWindow mainWindow ; public static ArrayList < BlockedFile > blockDex ; public static ArrayList < String > potentialPeers ; public static GlobalListener gl ; public static PeerConnector pst ; public static boolean debugServer = true ; public static boolean killPeerConnector = false ; public static CountDownLatch discoveryLatch ; public static CountDownLatch punchLatch ; public static boolean firstBlockServerSocket = true ; public static SocketWaiter ssm ; public static void main ( String [ ] args ) throws IOException , InterruptedException , NoSuchAlgorithmException { try { if ( Utils . isWindows ( ) ) { UIManager . setLookAndFeel ( "com.jgoodies.looks.windows.WindowsLookAndFeel" ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } Settings . hwid = Utils . getHWID ( ) ; Settings . version = 1.0 ; Core . peerList = new ArrayList < Peer > ( ) ; Core . blockDex = new ArrayList < BlockedFile > ( ) ; Core . index = new HashMap < Peer , ArrayList < String > > ( ) ; Core . potentialPeers = new ArrayList < String > ( ) ; Core . discoveryLatch = new CountDownLatch ( 1 ) ; Core . punchLatch = new CountDownLatch ( 1 ) ; Core . mainWindow = new MainWindow ( ) ; Core . mainWindow . registerListeners ( ) ; Utils . initDir ( ) ; new Thread ( new FileWatcher ( ) ) . start ( ) ; Core . mainWindow . out ( "Loading<seq2seq4repair_space>checksum<seq2seq4repair_space>data,<seq2seq4repair_space>please<seq2seq4repair_space>wait..." ) ; <START_BUG> Utils . print ( "Generating<seq2seq4repair_space>blockDex" ) ; <END_BUG> Utils . generateBlockDex ( ) ; Core . mainWindow . resetTable ( ) ; new Thread ( new HolePunchUPNP ( Core . punchLatch ) ) . start ( ) ; Core . punchLatch . await ( ) ; Core . debugServer = false ; int sep = 1 ; if ( sep == 0 ) { Core . gl = new GlobalListener ( ) ; new Thread ( Core . gl ) . start ( ) ; } else { Core . pst = new PeerConnector ( Core . debugServer ) ; Core . potentialPeers . add ( "127.0.0.1" ) ; new Thread ( Core . pst ) . start ( ) ; Core . discoveryLatch . countDown ( ) ; } } public static void incomingDebugReset ( ) { } }

Fix:
Utils . print ( Core . class , "Generating<seq2seq4repair_space>blockDex" ) ;
Buggy code:
public class FormInputTest extends WebTestCase { public FormInputTest ( String name ) { } public void setUp ( ) throws Exception { } public void testHome ( ) { } public static Test suite ( ) { TestSuite suite = new TestSuite ( ) ; <START_BUG> suite . addTest ( new FormInputTest ( "testHelloWorld" ) ) ; <END_BUG> JettyDecorator deco = new JettyDecorator ( suite ) ; deco . setPort ( 8098 ) ; deco . setWebappContextRoot ( "src//webapp" ) ; deco . setContextPath ( "//wicket-examples" ) ; return deco ; } }

Fix:
suite . addTestSuite ( FormInputTest . class ) ;
Buggy code:
public class ConnectionBox1 extends RelativeLayout { private Context mContext = null ; private LayoutInflater mInflater = null ; private ViewGroup mRootView = null ; private TextView mIpAddr = null ; private TextView mBSSID = null ; private TextView mSecurity = null ; private TextView mChannel = null ; private TextView mPwdField = null ; private TextView mIPField = null ; private EditText mPwd = null ; private static final int LAYOUT_CONN_BOX = layout . layout_connection_box ; private static final int ID_IP_ADDR = id . id_connection_box_ip ; private static final int ID_BSSID = id . id_connection_box_bssid ; private static final int ID_SECURITY = id . id_connection_box_security ; private static final int ID_CHANNEL = id . id_connection_box_channel ; private static final int ID_PWD = id . id_connection_box_pwd ; private static final int ID_PWD_FIELD = id . id_connection_box_pwd_field ; private static final int ID_IP_FIELD = id . id_connection_box_ip_field ; public ConnectionBox1 ( Context context ) { } private void initView ( ) { } public void setWifiInfo ( WifiInfo wifiInfo , ScanReultData scanData ) { <START_BUG> if ( wifiInfo != null ) { <END_BUG> mIPField . setVisibility ( VISIBLE ) ; mIpAddr . setVisibility ( VISIBLE ) ; mIpAddr . setText ( convertIPAddr ( wifiInfo . getIpAddress ( ) ) ) ; mBSSID . setText ( wifiInfo . getBSSID ( ) ) ; mSecurity . setText ( scanData . capabilities ) ; mChannel . setText ( scanData . frequency ) ; } else { mIPField . setVisibility ( GONE ) ; mIpAddr . setVisibility ( GONE ) ; mBSSID . setText ( scanData . BSSID ) ; mSecurity . setText ( scanData . capabilities ) ; mChannel . setText ( scanData . frequency ) ; } if ( scanData . isConnection ) { mPwd . setVisibility ( GONE ) ; mPwdField . setVisibility ( GONE ) ; } else { mPwd . setVisibility ( VISIBLE ) ; mPwdField . setVisibility ( VISIBLE ) ; } } private String convertIPAddr ( int ipAddr ) { } }

Fix:
if ( scanData . isConnection ) {
Buggy code:
class Worker extends AsyncTask < String , Integer , ConnectionList > { private IOpenTransportRepository connectionSearch ; private ConnectionList connectionList ; @ Override protected void onPreExecute ( ) { } @ Override protected void onPostExecute ( ConnectionList result ) { } @ Override protected ConnectionList doInBackground ( String ... arg ) { <START_BUG> connectionList = connectionSearch . searchConnections ( arg [ 0 ] , arg [ 1 ] , null , null , null , null ) ; <END_BUG> return connectionList ; } @ Override protected void onProgressUpdate ( Integer ... values ) { } }

Fix:
connectionList = connectionSearch . searchConnections ( arg [ 0 ] , arg [ 1 ] , null , null , null , false ) ;
Buggy code:
public class CenterLayout implements LayoutManager { private Logger log = Logger . getLogger ( CenterLayout . class . getName ( ) ) ; public void layoutElements ( final LayoutPart rootElement , final List < LayoutPart > elements ) { } void handleHorizontalAlignment ( final Box rootBox , final BoxConstraints rootBoxConstraints , final Box box , final BoxConstraints constraint ) { } void handleVerticalAlignment ( final Box rootBox , final BoxConstraints rootBoxConstraints , final Box box , final BoxConstraints constraint ) { } private void handleWidthConstraint ( final Box rootBox , final BoxConstraints rootBoxConstraints , final Box box , final BoxConstraints constraint ) { } private void handleHeightConstraint ( final Box rootBox , final BoxConstraints rootBoxConstraints , final Box box , final BoxConstraints constraint ) { int rootBoxY = ( rootBox . getY ( ) ) + ( rootBoxConstraints . getPaddingTop ( ) . getValueAsInt ( rootBox . getHeight ( ) ) ) ; int rootBoxHeight = ( ( rootBox . getHeight ( ) ) - ( rootBoxConstraints . getPaddingTop ( ) . getValueAsInt ( rootBox . getHeight ( ) ) ) ) - ( rootBoxConstraints . getPaddingBottom ( ) . getValueAsInt ( rootBox . getHeight ( ) ) ) ; int boxHeight = ( ( int ) ( constraint . getHeight ( ) . getValue ( rootBoxHeight ) ) ) ; if ( constraint . getHeight ( ) . hasWidthSuffix ( ) ) { boxHeight = ( ( int ) ( constraint . getHeight ( ) . getValue ( box . getWidth ( ) ) ) ) ; } box . setHeight ( boxHeight ) ; if ( ( constraint . getVerticalAlign ( ) ) == ( VerticalAlign . top ) ) { box . setY ( rootBoxY ) ; } else if ( ( constraint . getVerticalAlign ( ) ) == ( VerticalAlign . bottom ) ) { <START_BUG> box . setY ( ( ( ( rootBox . getHeight ( ) ) - ( rootBoxConstraints . getPaddingTop ( ) . getValueAsInt ( rootBox . getHeight ( ) ) ) ) - boxHeight ) ) ; <END_BUG> } else { box . setY ( ( rootBoxY + ( ( rootBoxHeight - boxHeight ) // 2 ) ) ) ; } } public SizeValue calculateConstraintWidth ( final LayoutPart root , final List < LayoutPart > children ) { } public SizeValue calculateConstraintHeight ( final LayoutPart root , final List < LayoutPart > children ) { } }

Fix:
box . setY ( ( ( ( rootBoxY + ( rootBox . getHeight ( ) ) ) - ( rootBoxConstraints . getPaddingTop ( ) . getValueAsInt ( rootBox . getHeight ( ) ) ) ) - boxHeight ) ) ;
Buggy code:
public class GraggBulirschStoerIntegratorTest { @ Test public void testDimensionCheck ( ) { } @ Test public void testNullIntervalCheck ( ) { } @ Test public void testMinStep ( ) { } @ Test public void testBackward ( ) throws MathUserException , IntegratorException { } @ Test public void testIncreasingTolerance ( ) throws MathUserException , IntegratorException { } @ Test public void testIntegratorControls ( ) throws MathUserException , IntegratorException { } private double getMaxError ( FirstOrderIntegrator integrator , TestProblemAbstract pb ) throws MathUserException , IntegratorException { } @ Test public void testEvents ( ) throws MathUserException , IntegratorException { TestProblem4 pb = new TestProblem4 ( ) ; double minStep = 0 ; double maxStep = ( pb . getFinalTime ( ) ) - ( pb . getInitialTime ( ) ) ; double scalAbsoluteTolerance = 1.0E-10 ; double scalRelativeTolerance = 0.01 * scalAbsoluteTolerance ; FirstOrderIntegrator integ = new GraggBulirschStoerIntegrator ( minStep , maxStep , scalAbsoluteTolerance , scalRelativeTolerance ) ; TestProblemHandler handler = new TestProblemHandler ( pb , integ ) ; integ . addStepHandler ( handler ) ; EventHandler [ ] functions = pb . getEventsHandlers ( ) ; double convergence = 1.0E-8 * maxStep ; for ( int l = 0 ; l < ( functions . length ) ; ++ l ) { integ . addEventHandler ( functions [ l ] , Double . POSITIVE_INFINITY , convergence , 1000 ) ; } Assert . assertEquals ( functions . length , integ . getEventHandlers ( ) . size ( ) ) ; integ . integrate ( pb , pb . getInitialTime ( ) , pb . getInitialState ( ) , pb . getFinalTime ( ) , new double [ pb . getDimension ( ) ] ) ; <START_BUG> Assert . assertTrue ( ( ( handler . getMaximalValueError ( ) ) < 5.0E-8 ) ) ; <END_BUG> Assert . assertEquals ( 0 , handler . getMaximalTimeError ( ) , convergence ) ; Assert . assertEquals ( 12.0 , handler . getLastTime ( ) , convergence ) ; integ . clearEventHandlers ( ) ; Assert . assertEquals ( 0 , integ . getEventHandlers ( ) . size ( ) ) ; } @ Test public void testKepler ( ) throws MathUserException , IntegratorException { } @ Test public void testVariableSteps ( ) throws MathUserException , IntegratorException { } @ Test public void testUnstableDerivative ( ) throws MathUserException , IntegratorException { } @ Test public void testIssue596 ( ) throws MathUserException , IntegratorException { } private static class KeplerStepHandler implements StepHandler { public KeplerStepHandler ( TestProblem3 pb ) { } public void reset ( ) { } public void handleStep ( StepInterpolator interpolator , boolean isLast ) throws MathUserException { } private int nbSteps ; private double maxError ; private TestProblem3 pb ; } public static class VariableStepHandler implements StepHandler { public VariableStepHandler ( ) { } public void reset ( ) { } public void handleStep ( StepInterpolator interpolator , boolean isLast ) { } private boolean firstTime ; private double minStep ; private double maxStep ; } }

Fix:
Assert . assertTrue ( ( ( handler . getMaximalValueError ( ) ) < 4.0E-7 ) ) ;
Buggy code:
public class CustomerTest { private Customer customer ; public CustomerTest ( ) { } @ Test public void testGetID ( ) { } @ Test public void testGetTelephone ( ) { } @ Test public void testGetName ( ) { } @ Test public void testGetAdress ( ) { } @ Test public void testGetPostalCode ( ) { } @ Test public void testGetEMail ( ) { } @ Test public void testUpdateObject ( ) { customer . updateObject ( 24736400 , "Poul<seq2seq4repair_space>Erik<seq2seq4repair_space>Poulsen" , "Enghavevej<seq2seq4repair_space>15<seq2seq4repair_space>\n<seq2seq4repair_space>7500<seq2seq4repair_space>Viborg" , "p.e.poulsen@gmail.com" ) ; assertEquals ( 24736400 , customer . getTelephone ( ) ) ; assertEquals ( "Poul<seq2seq4repair_space>Erik<seq2seq4repair_space>Poulsen" , customer . getName ( ) ) ; <START_BUG> assertEquals ( "Enghavevej<seq2seq4repair_space>15<seq2seq4repair_space>7420<seq2seq4repair_space>Viborg" , customer . getAdress ( ) ) ; <END_BUG> assertEquals ( 7500 , customer . getPostalCode ( ) ) ; assertEquals ( "p.e.poulsen@gmail.com" , customer . getEMail ( ) ) ; } }

Fix:
assertEquals ( "Enghavevej<seq2seq4repair_space>15<seq2seq4repair_space>7500<seq2seq4repair_space>Viborg" , customer . getAdress ( ) ) ;
Buggy code:
public class MainGame { public static void main ( String [ ] args ) throws SlickException { AppGameContainer jumper = new AppGameContainer ( new GameApp ( "Jump<seq2seq4repair_space>And<seq2seq4repair_space>Run<seq2seq4repair_space>alpha<seq2seq4repair_space>0.8.5" ) ) ; jumper . setDisplayMode ( 800 , 450 , false ) ; jumper . setAlwaysRender ( true ) ; <START_BUG> jumper . setShowFPS ( true ) ; <END_BUG> jumper . start ( ) ; } }

Fix:
jumper . setShowFPS ( false ) ;
Buggy code:
public class ReturnStatement extends Statement { public Expression expression ; public TypeBinding expressionType ; public boolean isSynchronized ; public AstNode [ ] subroutines ; public LocalVariableBinding saveValueVariable ; public ReturnStatement ( Expression expr , int s , int e ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { if ( ( expression ) != null ) { flowInfo = expression . analyseCode ( currentScope , flowContext , flowInfo ) ; } FlowContext traversedContext = flowContext ; int subIndex = 0 ; int maxSub = 5 ; boolean saveValueNeeded = false ; boolean hasValueToSave = ( ( expression ) != null ) && ( ( expression . constant ) == ( NotAConstant ) ) ; while ( true ) { AstNode sub ; if ( ( sub = traversedContext . subRoutine ( ) ) != null ) { if ( ( this . subroutines ) == null ) { this . subroutines = new AstNode [ maxSub ] ; } if ( subIndex == maxSub ) { System . arraycopy ( this . subroutines , 0 , ( this . subroutines = new AstNode [ maxSub *= 2 ] ) , 0 , subIndex ) ; } this . subroutines [ ( subIndex ++ ) ] = sub ; if ( sub . cannotReturn ( ) ) { saveValueNeeded = false ; break ; } } AstNode node ; if ( ( node = traversedContext . associatedNode ) instanceof SynchronizedStatement ) { isSynchronized = true ; } else if ( ( node instanceof TryStatement ) && hasValueToSave ) { if ( ( this . saveValueVariable ) == null ) { prepareSaveValueLocation ( ( ( TryStatement ) ( node ) ) ) ; } saveValueNeeded = true ; } else if ( traversedContext instanceof InitializationFlowContext ) { currentScope . problemReporter ( ) . cannotReturnInInitializer ( this ) ; return DeadEnd ; } traversedContext . recordReturnFrom ( flowInfo . unconditionalInits ( ) ) ; FlowContext parentContext ; if ( ( parentContext = traversedContext . parent ) == null ) { break ; } else { traversedContext = parentContext ; } } if ( ( ( subroutines ) != null ) && ( subIndex != maxSub ) ) { System . arraycopy ( subroutines , 0 , ( subroutines = new AstNode [ subIndex ] ) , 0 , subIndex ) ; } if ( saveValueNeeded ) { if ( ( this . saveValueVariable ) != null ) { <START_BUG> this . saveValueVariable . used = true ; <END_BUG> } } else { this . saveValueVariable = null ; if ( ( ! ( isSynchronized ) ) && ( ( expressionType ) == ( BooleanBinding ) ) ) { this . expression . bits |= ValueForReturnMASK ; } } return DeadEnd ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public void generateReturnBytecode ( BlockScope currentScope , CodeStream codeStream ) { } public void generateStoreSaveValueIfNecessary ( BlockScope currentScope , CodeStream codeStream ) { } public boolean needValue ( ) { } public void prepareSaveValueLocation ( TryStatement targetTryStatement ) { } public void resolve ( BlockScope scope ) { } public String toString ( int tab ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope scope ) { } }

Fix:
this . saveValueVariable . useFlag = LocalVariableBinding . USED ;
Buggy code:
public class DefaultCacheableService implements CacheableService < Long > { private final AtomicLong counter = new AtomicLong ( ) ; private final AtomicLong nullInvocations = new AtomicLong ( ) ; @ Cacheable ( "default" ) public Long cache ( Object arg1 ) { } @ CacheEvict ( "default" ) public void invalidate ( Object arg1 ) { } @ CacheEvict ( "default" ) public void evictWithException ( Object arg1 ) { } @ CacheEvict ( value = "default" , allEntries = true ) public void evictAll ( Object arg1 ) { } @ CacheEvict ( value = "default" , afterInvocation = false ) public void evictEarly ( Object arg1 ) { } @ CacheEvict ( value = "default" , key = "#p0" ) public void evict ( Object arg1 , Object arg2 ) { } @ CacheEvict ( value = "default" , key = "#p0" , afterInvocation = false ) public void invalidateEarly ( Object arg1 , Object arg2 ) { } @ Cacheable ( value = "default" , condition = "#classField<seq2seq4repair_space>==<seq2seq4repair_space>3" ) public Long conditional ( int classField ) { } @ Cacheable ( value = "default" , key = "#p0" ) public Long key ( Object arg1 , Object arg2 ) { } @ Cacheable ( value = "default" , key = "#root.methodName" ) public Long name ( Object arg1 ) { } @ Cacheable ( value = "default" , key = "#root.methodName<seq2seq4repair_space>+<seq2seq4repair_space>#root.method.name<seq2seq4repair_space>+<seq2seq4repair_space>#root.targetClass<seq2seq4repair_space>+<seq2seq4repair_space>#root.target" ) public Long rootVars ( Object arg1 ) { } @ CachePut ( "default" ) public Long update ( Object arg1 ) { } @ CachePut ( value = "default" , condition = "#arg.equals(3)" ) public Long conditionalUpdate ( Object arg ) { } @ Cacheable ( "default" ) public Long nullValue ( Object arg1 ) { } public Number nullInvocations ( ) { } @ Cacheable ( "default" ) public Long throwChecked ( Object arg1 ) throws Exception { } @ Cacheable ( "default" ) public Long throwUnchecked ( Object arg1 ) { } @ Caching ( cacheable = { @ Cacheable ( "primary" ) , @ Cacheable ( "secondary" ) } ) public Long multiCache ( Object arg1 ) { } <START_BUG> @ Caching ( evict = { @ CacheEvict ( "primary" ) , @ CacheEvict ( value = "secondary" , key = "#p0" ) } ) <END_BUG> public Long multiEvict ( Object arg1 ) { return counter . getAndIncrement ( ) ; } @ Caching ( cacheable = { @ Cacheable ( value = "primary" , key = "#root.methodName" ) } , evict = { @ CacheEvict ( "secondary" ) } ) public Long multiCacheAndEvict ( Object arg1 ) { } @ Caching ( cacheable = { @ Cacheable ( value = "primary" , condition = "#p0<seq2seq4repair_space>==<seq2seq4repair_space>3" ) } , evict = { @ CacheEvict ( "secondary" ) } ) public Long multiConditionalCacheAndEvict ( Object arg1 ) { } @ Caching ( put = { @ CachePut ( "primary" ) , @ CachePut ( "secondary" ) } ) public Long multiUpdate ( Object arg1 ) { } }

Fix:
@ Caching ( evict = { @ CacheEvict ( "primary" ) , @ CacheEvict ( value = "secondary" , key = "#p0" ) , @ CacheEvict ( value = "primary" , key = "#p0<seq2seq4repair_space>+<seq2seq4repair_space>'A'" ) } )
Buggy code:
public class ContextedRuntimeExceptionTest extends AbstractExceptionContextTest < ContextedRuntimeException > { @ Override @ Before public void setUp ( ) throws Exception { } @ Test public void testContextedException ( ) { } @ Test public void testContextedExceptionString ( ) { } @ Test public void testContextedExceptionThrowable ( ) { } @ Test public void testContextedExceptionStringThrowable ( ) { } @ Test public void testContextedExceptionStringThrowableContext ( ) { <START_BUG> exceptionContext = new ContextedRuntimeException ( TEST_MESSAGE_2 , new Exception ( TEST_MESSAGE ) , new DefaultExceptionContext ( ) { } ) ; <END_BUG> final String message = exceptionContext . getMessage ( ) ; final String trace = ExceptionUtils . getStackTrace ( exceptionContext ) ; assertTrue ( ( ( trace . indexOf ( "ContextedException" ) ) >= 0 ) ) ; assertTrue ( ( ( trace . indexOf ( TEST_MESSAGE ) ) >= 0 ) ) ; assertTrue ( ( ( trace . indexOf ( TEST_MESSAGE_2 ) ) >= 0 ) ) ; assertTrue ( ( ( message . indexOf ( TEST_MESSAGE_2 ) ) >= 0 ) ) ; } @ Test public void testNullExceptionPassing ( ) { } @ Test public void testRawMessage ( ) { } }

Fix:
exceptionContext = new ContextedRuntimeException ( TEST_MESSAGE_2 , new Exception ( TEST_MESSAGE ) , new DefaultExceptionContext ( ) ) ;
Buggy code:
public class PreFactWriter extends AbstractPrerequisiteWriter implements PrerequisiteWriterInterface { @ Override public String kindHandled ( ) { } @ Override public PrerequisiteOperator [ ] operatorsHandled ( ) { } @ Override public void write ( Writer writer , Prerequisite prereq ) throws PersistenceLayerException { } @ Override public boolean specialCase ( Writer writer , Prerequisite prereq ) throws IOException { PrerequisiteOperator po = getConsolidateMethod ( kindHandled ( ) , prereq , false ) ; if ( po == null ) { return false ; } String cat = null ; boolean foundCat = false ; for ( Prerequisite p : prereq . getPrerequisites ( ) ) { if ( foundCat ) { String thiscat = p . getCategoryName ( ) ; if ( thiscat == null ) { if ( cat != null ) { return false ; } } else { if ( ! ( thiscat . equals ( cat ) ) ) { return false ; } } } else { cat = p . getCategoryName ( ) ; foundCat = true ; } } if ( ! ( po . equals ( prereq . getOperator ( ) ) ) ) { writer . write ( '!' ) ; } writer . write ( ( ( ( "PRE" + ( kindHandled ( ) . toUpperCase ( ) ) ) + ":" ) + ( prereq . isOverrideQualify ( ) ? "Q:" : "" ) ) ) ; writer . write ( ( po . equals ( GTEQ ) ? prereq . getOperand ( ) : "1" ) ) ; <START_BUG> writer . write ( ( ",ID=" + cat ) ) ; <END_BUG> for ( Prerequisite p : prereq . getPrerequisites ( ) ) { writer . write ( ',' ) ; writer . write ( p . getKey ( ) ) ; } return true ; } }

Fix:
writer . write ( ( "," + cat ) ) ;
Buggy code:
public class ExecTask extends Task { private static String lSep = System . getProperty ( "line.separator" ) ; protected boolean failOnError = false ; protected boolean newEnvironment = false ; private Integer timeout = null ; private Environment env = new Environment ( ) ; protected Commandline cmdl = new Commandline ( ) ; private FileOutputStream fos = null ; private ByteArrayOutputStream baos = null ; private boolean failIfExecFails = true ; private boolean vmLauncher = true ; private File dir ; private String os ; private File out ; private String outputprop ; private String resultProperty ; public void setDir ( File d ) throws TaskException { } public void setExecutable ( String value ) throws TaskException { } public void setFailIfExecutionFails ( boolean flag ) { } public void setFailonerror ( boolean fail ) { } public void setNewenvironment ( boolean newenv ) { } public void setOs ( String os ) { } public void setOutput ( File out ) { } public void setOutputproperty ( String outputprop ) { } public void setResultProperty ( String resultProperty ) { } public void setTimeout ( Integer value ) { } public void setVMLauncher ( boolean vmLauncher ) { } public void addEnv ( Environment . Variable var ) { } public Argument createArg ( ) { } public void execute ( ) throws TaskException { } protected boolean isValidOs ( ) { } protected final void runExecute ( Execute exe ) throws IOException , TaskException { } protected void checkConfiguration ( ) throws TaskException { } protected ExecuteStreamHandler createHandler ( ) throws TaskException { } protected ExecuteWatchdog createWatchdog ( ) throws TaskException { } protected void logFlush ( ) { } protected void maybeSetResultPropertyValue ( int result ) throws TaskException { } protected Execute prepareExec ( ) throws TaskException { if ( ( dir ) == null ) dir = getBaseDirectory ( ) ; log ( cmdl . toString ( ) , MSG_VERBOSE ) ; Execute exe = new Execute ( createHandler ( ) , createWatchdog ( ) ) ; <START_BUG> exe . setAntRun ( project ) ; <END_BUG> exe . setWorkingDirectory ( dir ) ; exe . setVMLauncher ( vmLauncher ) ; String [ ] environment = env . getVariables ( ) ; if ( environment != null ) { for ( int i = 0 ; i < ( environment . length ) ; i ++ ) { log ( ( "Setting<seq2seq4repair_space>environment<seq2seq4repair_space>variable:<seq2seq4repair_space>" + ( environment [ i ] ) ) , MSG_VERBOSE ) ; } } exe . setNewenvironment ( newEnvironment ) ; exe . setEnvironment ( environment ) ; return exe ; } protected void runExec ( Execute exe ) throws TaskException { } }

Fix:
exe . setAntRun ( getProject ( ) ) ;
Buggy code:
public class MethodReference extends SpelNodeImpl { private final String name ; private volatile MethodExecutor cachedExecutor ; private final boolean nullSafe ; public MethodReference ( boolean nullSafe , String methodName , int pos , SpelNodeImpl ... arguments ) { } @ Override public TypedValue getValueInternal ( ExpressionState state ) throws EvaluationException { } private Class < ? > [ ] getTypes ( Object ... arguments ) { Class < ? > [ ] argumentTypes = new Class [ arguments . length ] ; for ( int i = 0 ; i < ( arguments . length ) ; i ++ ) { <START_BUG> argumentTypes [ i ] = ( ( arguments [ i ] ) == null ) ? Object . class : arguments [ i ] . getClass ( ) ; <END_BUG> } return argumentTypes ; } @ Override public String toStringAST ( ) { } private MethodExecutor findAccessorForMethod ( String name , Class < ? > [ ] argumentTypes , ExpressionState state ) throws SpelEvaluationException { } }

Fix:
argumentTypes [ i ] = ( ( arguments [ i ] ) == null ) ? null : arguments [ i ] . getClass ( ) ;
Buggy code:
public abstract class TypeBinding extends Binding implements BaseTypes , TagBits , TypeConstants , TypeIds { public int id = TypeIds . NoId ; public long tagBits = 0 ; public static final TypeBinding wellKnownType ( Scope scope , int id ) { } public int kind ( ) { <START_BUG> return this . TYPE ; <END_BUG> } public boolean canBeInstantiated ( ) { } public void collectSubstitutes ( TypeBinding otherType , Map substitutes ) { } public char [ ] computeUniqueKey ( ) { } public abstract char [ ] constantPoolName ( ) { } public String debugName ( ) { } public int dimensions ( ) { } public ReferenceBinding enclosingType ( ) { } public TypeBinding erasure ( ) { } public TypeBinding genericCast ( TypeBinding otherType ) { } public char [ ] genericTypeSignature ( ) { } public abstract PackageBinding getPackage ( ) { } public boolean isAnnotationType ( ) { } public final boolean isArrayType ( ) { } public final boolean isBaseType ( ) { } public boolean isBoundParameterizedType ( ) { } public boolean isClass ( ) { } public abstract boolean isCompatibleWith ( TypeBinding right ) { } public boolean isEnum ( ) { } public boolean isEquivalentTo ( TypeBinding otherType ) { } public boolean isGenericType ( ) { } public final boolean isHierarchyInconsistent ( ) { } public boolean isInterface ( ) { } public final boolean isLocalType ( ) { } public final boolean isMemberType ( ) { } public final boolean isNestedType ( ) { } public final boolean isNumericType ( ) { } public boolean isParameterizedType ( ) { } public boolean isPartOfRawType ( ) { } public boolean isProvablyDistinctFrom ( TypeBinding otherType , int depth ) { } public boolean isRawType ( ) { } public boolean isReifiable ( ) { } public boolean isTypeArgumentContainedBy ( TypeBinding otherArgument ) { } public boolean isTypeVariable ( ) { } public boolean isUnboundWildcard ( ) { } public boolean isWildcard ( ) { } public boolean needsUncheckedConversion ( TypeBinding targetType ) { } public TypeBinding leafComponentType ( ) { } public char [ ] qualifiedPackageName ( ) { } public abstract char [ ] qualifiedSourceName ( ) { } public char [ ] signature ( ) { } public abstract char [ ] sourceName ( ) { } public void swapUnresolved ( UnresolvedReferenceBinding unresolvedType , ReferenceBinding resolvedType , LookupEnvironment environment ) { } public TypeVariableBinding [ ] typeVariables ( ) { } }

Fix:
return Binding . TYPE ;
Buggy code:
public abstract class AbstractRequestTargetUrlCodingStrategy implements IRequestTargetUrlCodingStrategy { private static Log log = LogFactory . getLog ( AbstractRequestTargetUrlCodingStrategy . class ) ; private final String mountPath ; public AbstractRequestTargetUrlCodingStrategy ( final String mountPath ) { } protected final String getMountPath ( ) { } protected PageParameters decodePageParameters ( String urlFragment ) { } protected void appendPageParameters ( StringBuffer url , PageParameters parameters ) { if ( parameters != null ) { Iterator entries = parameters . entrySet ( ) . iterator ( ) ; while ( entries . hasNext ( ) ) { Map . Entry entry = ( ( Map . Entry ) ( entries . next ( ) ) ) ; <START_BUG> String escapedValue = ( ( String ) ( entry . getValue ( ) ) ) ; <END_BUG> try { escapedValue = URLEncoder . encode ( escapedValue , Application . get ( ) . getRequestCycleSettings ( ) . getResponseRequestEncoding ( ) ) ; } catch ( UnsupportedEncodingException e ) { AbstractRequestTargetUrlCodingStrategy . log . error ( e . getMessage ( ) , e ) ; } url . append ( "//" ) . append ( entry . getKey ( ) ) . append ( "//" ) . append ( escapedValue ) ; } } } }

Fix:
String escapedValue = ( ( String ) ( entry . getValue ( ) . toString ( ) ) ) ;
Buggy code:
public class MixedDomainTestSupport extends DomainTestSupport { public MixedDomainTestSupport ( String testClass , String domainConfig , String masterConfig , String slaveConfig , String jbossHome ) throws Exception { } public static MixedDomainTestSupport create ( String testClass , Version . AsVersion version ) throws Exception { <START_BUG> OldVersionCopier oldVersionCopier = OldVersionCopier . expandOldVersions ( ) ; <END_BUG> File dir = oldVersionCopier . getVersionDir ( version ) ; return new MixedDomainTestSupport ( testClass , "master-config//domain.xml" , "master-config//host.xml" , ( ( "slave-configs//" + ( dir . getName ( ) ) ) + "//domain//configuration//host-slave.xml" ) , dir . getAbsolutePath ( ) ) ; } }

Fix:
OldVersionCopier oldVersionCopier = OldVersionCopier . expandOldVersion ( version ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ ServerSetup ( DatabaseTimerServiceTestCase . DatabaseTimerServiceTestCaseServerSetup . class ) public class DatabaseTimerServiceTestCase { private static int TIMER_INIT_TIME_MS = 100 ; private static int TIMER_TIMEOUT_TIME_MS = 100 ; private static String INFO_MSG_FOR_CHECK = "info" ; static class DatabaseTimerServiceTestCaseServerSetup implements ServerSetupTask { @ Override public void setup ( final ManagementClient managementClient , final String containerId ) throws Exception { } @ Override public void tearDown ( final ManagementClient managementClient , final String containerId ) throws Exception { } } @ Deployment public static Archive < ? > deploy ( ) { final WebArchive war = ShrinkWrap . create ( WebArchive . class , "testTimerServiceSimple.war" ) ; war . addPackage ( DatabaseTimerServiceTestCase . class . getPackage ( ) ) ; <START_BUG> war . addAsWebInfResource ( DatabaseTimerServiceTestCase . class . getPackage ( ) , "jboss-ejb3.xml" , "jboss-ejb3.xml" ) ; <END_BUG> return war ; } @ Test public void testTimedObjectTimeoutMethod ( ) throws NamingException { } }

Fix:
war . addAsManifestResource ( DatabaseTimerServiceTestCase . class . getPackage ( ) , "jboss-ejb3.xml" , "jboss-ejb3.xml" ) ;
Buggy code:
public abstract class Train extends Actor implements Clickable { private final String id ; private int speed ; private int cargoCap ; private int fuelCost ; private Cargo cargo ; private ArrayDeque < Node > pathNodes ; private ArrayDeque < Sleeper > pathSleepers ; private Node node ; private int state ; public Train ( int speed , int cargoCap , int fuelCost , String id , Node node ) { } public int getSpeed ( ) { } public int getFuelCost ( ) { } public String getId ( ) { } public int getCargoCap ( ) { } public Cargo getCargo ( ) { } public void setCargo ( Cargo cargo ) { } public Deque < Node > getPathNodes ( ) { } public Deque < Sleeper > getPathSleepers ( ) { } public void setPath ( Deque < Node > nodes , Deque < Sleeper > sleepers ) { } public Node getNode ( ) { } public void setNode ( Node node ) { } public abstract Texture getTexture ( ) { } public abstract void adjustActor ( ) { } public int getState ( ) { } public void setState ( int state ) { } @ Override public void draw ( Batch batch , float parentAlpha ) { } @ Override public Actor hit ( float x , float y , boolean touchable ) { } public void clicked ( GameCore game ) { if ( ( getState ( ) ) == ( TrainStates . ACTIVE ) ) { StartPathCommand . executeCommand ( game , this ) ; } else if ( ( getState ( ) ) == ( TrainStates . SELECTED ) ) { <START_BUG> ResetPathCommand . executeCommand ( game , this ) ; <END_BUG> } } }

Fix:
ResetPathCommand . executeCommand ( game , null ) ;