nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ElasticSearchModuleEndToEndTest extends GraphAwareIntegrationTest { protected ElasticSearchServer esServer ; @ Override protected String configFile ( ) { } @ Override public void setUp ( ) throws Exception { } @ Override public void tearDown ( ) throws Exception { } @ Test public void testWorkflow ( ) throws JSONException { String uuid = writeSomeStuffToNeo4j ( ) ; <START_BUG> waitFor ( 200 ) ; <END_BUG> ElasticSearchClient esClient = new JestElasticSearchClient ( "localhost" , "9201" ) ; Get get = new Get . Builder ( "neo4j-index" , uuid ) . type ( "Person" ) . build ( ) ; JestResult result = esClient . execute ( get ) ; System . out . println ( result . getJsonString ( ) ) ; JSONAssert . assertEquals ( ( ( ( ( "{\"_index\":\"neo4j-index\",\"_type\":\"Person\",\"_id\":\"" + uuid ) + "\",\"_version\":2,\"found\":true,\"_source\":{\"age\":\"31\",\"name\":\"Michal\",\"uuid\":\"" ) + uuid ) + "\"}}" ) , result . getJsonString ( ) , false ) ; } protected String writeSomeStuffToNeo4j ( ) { } }

Fix:
waitFor ( 500 ) ;
Buggy code:
public class Base64InputStreamTest { private static final String ENCODED_B64 = "AAAA////////" ; private static final byte [ ] CRLF = new byte [ ] { ( ( byte ) ( '\r' ) ) , ( ( byte ) ( '\n' ) ) } ; private static final byte [ ] LF = new byte [ ] { ( ( byte ) ( '\n' ) ) } ; private static final String STRING_FIXTURE = "Hello<seq2seq4repair_space>World" ; @ Test public void testCodec130 ( ) throws IOException { } @ Test public void testCodec105 ( ) throws IOException { } @ Test public void testCodec101 ( ) throws Exception { } @ Test public void testInputStreamReader ( ) throws Exception { } @ Test public void testCodec98NPE ( ) throws Exception { } @ Test public void testAvailable ( ) throws Throwable { } @ Test public void testBase64EmptyInputStreamMimeChuckSize ( ) throws Exception { } @ Test public void testBase64EmptyInputStreamPemChuckSize ( ) throws Exception { } private void testBase64EmptyInputStream ( int chuckSize ) throws Exception { } @ Test public void testBase64InputStreamByChunk ( ) throws Exception { } @ Test public void testBase64InputStreamByteByByte ( ) throws Exception { } private void testByChunk ( byte [ ] encoded , byte [ ] decoded , int chunkSize , byte [ ] seperator ) throws Exception { } private void testByteByByte ( byte [ ] encoded , byte [ ] decoded , int chunkSize , byte [ ] seperator ) throws Exception { } @ Test public void testMarkSupported ( ) throws Exception { } @ Test public void testRead0 ( ) throws Exception { } @ Test public void testReadNull ( ) throws Exception { } @ Test public void testReadOutOfBounds ( ) throws Exception { } @ Test public void testSkipBig ( ) throws Throwable { InputStream ins = new ByteArrayInputStream ( StringUtils . getBytesIso8859_1 ( Base64InputStreamTest . ENCODED_B64 ) ) ; Base64InputStream b64stream = new Base64InputStream ( ins ) ; <START_BUG> assertEquals ( 6 , b64stream . skip ( 1024 ) ) ; <END_BUG> assertEquals ( ( - 1 ) , b64stream . read ( ) ) ; assertEquals ( ( - 1 ) , b64stream . read ( ) ) ; } @ Test public void testSkipNone ( ) throws Throwable { } @ Test public void testSkipPastEnd ( ) throws Throwable { } @ Test public void testSkipToEnd ( ) throws Throwable { } @ Test ( expected = IllegalArgumentException . class ) public void testSkipWrongArgument ( ) throws Throwable { } }

Fix:
assertEquals ( 6 , b64stream . skip ( Integer . MAX_VALUE ) ) ;
Buggy code:
public class LList { private Node l = null ; public void add ( String s ) { } public Node find ( int n ) { Node tmp = l ; int count ; <START_BUG> for ( count = 1 ; count < n ; tmp = tmp . getNext ( ) ) { <END_BUG> count += 1 ; } return tmp ; } public void insert ( int n , String s ) { } public String toString ( ) { } }

Fix:
for ( count = 1 ; ( count < n ) && ( tmp != null ) ; tmp = tmp . getNext ( ) ) {
Buggy code:
public class CallHandOverEvent extends Event { private final double speed ; private final int stationId ; private final int channelId ; private final int remainingDuration ; public CallHandOverEvent ( int time , double speed , int stationId , int channelId , int remainingDuration ) { } public double getSpeed ( ) { } public int getStationId ( ) { } public int getChannelId ( ) { } public int getRemainingDuration ( ) { } @ Override public void handle ( ) { TelecomSimulator . release ( ( ( stationId ) - 1 ) , channelId ) ; int newChannelId = TelecomSimulator . tryReserve ( stationId ) ; if ( newChannelId == ( - 1 ) ) { TelecomSimulator . recordDroppedCall ( ) ; return ; } double distanceToNextStation = 2 ; int durationToNextStation = ( ( int ) ( Math . round ( ( ( ( distanceToNextStation // ( speed ) ) * 3600 ) * 1000 ) ) ) ) ; if ( ( ( remainingDuration ) > durationToNextStation ) && ( ( stationId ) != 19 ) ) { int newEventTime = ( time ) + durationToNextStation ; int newEventStationId = ( stationId ) + 1 ; int newRemainingDuration = ( remainingDuration ) - durationToNextStation ; <START_BUG> TelecomSimulator . insertEvent ( new CallHandOverEvent ( newEventTime , speed , newEventStationId , channelId , newRemainingDuration ) ) ; <END_BUG> } else if ( ( ( remainingDuration ) > durationToNextStation ) && ( ( stationId ) == 19 ) ) { int newEventTime = ( time ) + durationToNextStation ; TelecomSimulator . insertEvent ( new CallTerminationEvent ( newEventTime , stationId , newChannelId ) ) ; } else { int newEventTime = ( time ) + ( remainingDuration ) ; TelecomSimulator . insertEvent ( new CallTerminationEvent ( newEventTime , stationId , newChannelId ) ) ; } } }

Fix:
TelecomSimulator . insertEvent ( new CallHandOverEvent ( newEventTime , speed , newEventStationId , newChannelId , newRemainingDuration ) ) ;
Buggy code:
public class DynamicCompositeType extends AbstractCompositeType { private static final Logger logger = LoggerFactory . getLogger ( DynamicCompositeType . class ) ; private final Map < Byte , AbstractType > aliases ; private static final Map < Map < Byte , AbstractType > , DynamicCompositeType > instances = new HashMap < Map < Byte , AbstractType > , DynamicCompositeType > ( ) ; public static synchronized DynamicCompositeType getInstance ( TypeParser parser ) throws ConfigurationException { } public static synchronized DynamicCompositeType getInstance ( Map < Byte , AbstractType > aliases ) { } private DynamicCompositeType ( Map < Byte , AbstractType > aliases ) { } private AbstractType getComparator ( ByteBuffer bb ) { } protected AbstractType getNextComparator ( int i , ByteBuffer bb ) { } protected AbstractType getNextComparator ( int i , ByteBuffer bb1 , ByteBuffer bb2 ) { } protected AbstractType getAndAppendNextComparator ( int i , ByteBuffer bb , StringBuilder sb ) { } protected ParsedComparator parseNextComparator ( int i , String part ) { } protected AbstractType validateNextComparator ( int i , ByteBuffer bb ) throws MarshalException { } private class DynamicParsedComparator implements ParsedComparator { final AbstractType type ; final boolean isAlias ; final String comparatorName ; final String remainingPart ; DynamicParsedComparator ( String part ) { } public AbstractType getAbstractType ( ) { } public String getRemainingPart ( ) { } public int getComparatorSerializedSize ( ) { } public void serializeComparator ( ByteBuffer bb ) { int header = 0 ; if ( isAlias ) <START_BUG> header = 32768 | ( ( byte ) ( comparatorName . charAt ( 0 ) ) ) ; <END_BUG> else header = comparatorName . length ( ) ; putShortLength ( bb , header ) ; if ( ! ( isAlias ) ) bb . put ( ByteBufferUtil . bytes ( comparatorName ) ) ; } } @ Override public String toString ( ) { } }

Fix:
header = 32768 | ( ( ( byte ) ( comparatorName . charAt ( 0 ) ) ) & 255 ) ;
Buggy code:
public class MainPanel extends JPanel implements Runnable { private static final int PWIDTH = 1280 ; private static final int PHEIGHT = 720 ; private static final int NO_DELAYS_PER_YIELD = 16 ; private static int MAX_FRAME_SKIPS = 5 ; private long gameStartTime ; private long lastUpdateTime ; private Thread animator ; private volatile boolean running = false ; private volatile boolean isPaused = false ; private int period ; private volatile boolean gameOver = false ; private volatile boolean gameStarted = false ; private Graphics dbg ; private Image dbImage = null ; private GameState state ; private Update update ; private Render render ; private Setup setup ; public MainPanel ( Main main , int period ) { } public static int getFrameHeight ( ) { } public static int getFrameWidth ( ) { } private void readyForTermination ( ) { } private void readyForStart ( ) { } public void addNotify ( ) { } private void startGame ( ) { } public void resumeGame ( ) { } public void pauseGame ( ) { } public void stopGame ( ) { } public void run ( ) { } private void gameUpdate ( ) { <START_BUG> if ( ( ! ( isPaused ) ) && ( ! ( gameOver ) ) ) { <END_BUG> long timePassed = ( System . currentTimeMillis ( ) ) - ( lastUpdateTime ) ; update . gameUpdate ( timePassed ) ; lastUpdateTime = System . currentTimeMillis ( ) ; } } private void gameRender ( ) { } private void paintScreen ( ) { } }

Fix:
if ( ( ( gameStarted ) && ( ! ( isPaused ) ) ) && ( ! ( gameOver ) ) ) {
Buggy code:
public class TreeDAO { private static String TreeTable = "SB_Tree_Tree" ; public TreeDAO ( ) { } public static String createRoot ( Connection con , TreeNode root ) throws SQLException { } public static TreeNodePK createNode ( Connection con , TreeNode node ) throws SQLException { } public static void updateNode ( Connection con , TreeNode node ) throws SQLException { } public static void deleteNode ( Connection con , TreeNodePK treeNodePK , String treeId ) throws SQLException { String deleteQuery = "DELETE<seq2seq4repair_space>FROM<seq2seq4repair_space>SB_Tree_Tree<seq2seq4repair_space>WHERE<seq2seq4repair_space>treeId=<seq2seq4repair_space>?<seq2seq4repair_space>AND<seq2seq4repair_space>id<seq2seq4repair_space>=<seq2seq4repair_space>?" ; PreparedStatement stmt = null ; try { stmt = con . prepareStatement ( deleteQuery ) ; stmt . setInt ( 1 , Integer . parseInt ( treeId ) ) ; stmt . setInt ( 2 , Integer . parseInt ( treeNodePK . getId ( ) ) ) ; <START_BUG> stmt . executeUpdate ( deleteQuery ) ; <END_BUG> } finally { DBUtil . close ( stmt ) ; } } public static void levelUp ( Connection con , String path , String treeId ) throws SQLException { } public static void levelDown ( Connection con , String path , String treeId ) throws SQLException { } public static void changeFatherAndPath ( Connection con , int oldFather , int newFather , String path , String treeId ) throws SQLException { } public static void updatePath ( Connection con , String oldFather , String treeId ) throws SQLException { } private static void updatePath ( Connection con , String oldPath , String newPath , String treeId ) throws SQLException { } private static List < String > getPathes ( Connection con , String oldFather , String treeId ) throws SQLException { } private static synchronized int getNextValueIdToTree ( Connection con , String treeId ) throws SQLException { } No newline ; at end ; of file ; }

Fix:
stmt . executeUpdate ( ) ;
Buggy code:
final class ObjectFactory { private static final String DEFAULT_PROPERTIES_FILENAME = "xerces.properties" ; private static final boolean DEBUG = ObjectFactory . isDebugEnabled ( ) ; private static final int DEFAULT_LINE_LENGTH = 80 ; private static Properties fXercesProperties = null ; private static long fLastModified = - 1 ; static Object createObject ( String factoryId , String fallbackClassName ) throws ObjectFactory . ConfigurationError { } static Object createObject ( String factoryId , String propertiesFilename , String fallbackClassName ) throws ObjectFactory . ConfigurationError { } private static boolean isDebugEnabled ( ) { } private static void debugPrintln ( String msg ) { } static ClassLoader findClassLoader ( ) throws ObjectFactory . ConfigurationError { } static Object newInstance ( String className , ClassLoader cl , boolean doFallback ) throws ObjectFactory . ConfigurationError { } static Class findProviderClass ( String className , ClassLoader cl , boolean doFallback ) throws ClassNotFoundException , ObjectFactory . ConfigurationError { SecurityManager security = System . getSecurityManager ( ) ; if ( security != null ) { <START_BUG> final int lastDot = className . lastIndexOf ( "." ) ; <END_BUG> String packageName = className ; if ( lastDot != ( - 1 ) ) packageName = className . substring ( 0 , lastDot ) ; security . checkPackageAccess ( packageName ) ; } Class providerClass ; if ( cl == null ) { providerClass = Class . forName ( className ) ; } else { try { providerClass = cl . loadClass ( className ) ; } catch ( ClassNotFoundException x ) { if ( doFallback ) { ClassLoader current = ObjectFactory . class . getClassLoader ( ) ; if ( current == null ) { providerClass = Class . forName ( className ) ; } else if ( cl != current ) { cl = current ; providerClass = cl . loadClass ( className ) ; } else { throw x ; } } else { throw x ; } } } return providerClass ; } private static Object findJarServiceProvider ( String factoryId ) throws ObjectFactory . ConfigurationError { } static final class ConfigurationError extends Error { private static final long serialVersionUID = 3689636882459932976L ; private Exception exception ; ConfigurationError ( String msg , Exception x ) { } Exception getException ( ) { } } }

Fix:
final int lastDot = className . lastIndexOf ( '.' ) ;
Buggy code:
public class Get extends Task { private URL source ; private File dest ; private boolean verbose = false ; private boolean useTimestamp = false ; private boolean ignoreErrors = false ; private String uname = null ; private String pword = null ; public void execute ( ) throws BuildException { } public void setSrc ( URL u ) { } public void setDest ( File dest ) { } public void setVerbose ( boolean v ) { } public void setIgnoreErrors ( boolean v ) { } public void setUseTimestamp ( boolean v ) { <START_BUG> if ( JavaEnvUtils . isJavaVersion ( JAVA_1_1 ) ) { <END_BUG> useTimestamp = v ; } } public void setUsername ( String u ) { } public void setPassword ( String p ) { } class Base64Converter { public final char [ ] alphabet = new char [ ] { 'A' , 'B' , 'C' , 'D' , 'E' , 'F' , 'G' , 'H' , 'I' , 'J' , 'K' , 'L' , 'M' , 'N' , 'O' , 'P' , 'Q' , 'R' , 'S' , 'T' , 'U' , 'V' , 'W' , 'X' , 'Y' , 'Z' , 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' , 'h' , 'i' , 'j' , 'k' , 'l' , 'm' , 'n' , 'o' , 'p' , 'q' , 'r' , 's' , 't' , 'u' , 'v' , 'w' , 'x' , 'y' , 'z' , '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '+' , '//' } ; public String encode ( String s ) { } public String encode ( byte [ ] octetString ) { } } }

Fix:
if ( ! ( JavaEnvUtils . isJavaVersion ( JAVA_1_1 ) ) ) {
Buggy code:
public class CityPreference { SharedPreferences prefs ; public CityPreference ( Activity activity ) { } String getCity ( ) { <START_BUG> return prefs . getString ( "city" , "Jakarta,<seq2seq4repair_space>JK" ) ; <END_BUG> } void setCity ( String city ) { } }

Fix:
return prefs . getString ( "city" , "Jakarta,<seq2seq4repair_space>ID" ) ;
Buggy code:
public class DiscardWorkingCopyOperation extends JavaModelOperation { public DiscardWorkingCopyOperation ( IJavaElement workingCopy ) { } protected void executeOperation ( ) throws JavaModelException { CompilationUnit workingCopy = getWorkingCopy ( ) ; int useCount = JavaModelManager . getJavaModelManager ( ) . discardPerWorkingCopyInfo ( workingCopy ) ; if ( useCount == 0 ) { if ( ! ( workingCopy . isPrimary ( ) ) ) { JavaElementDelta delta = new JavaElementDelta ( this . getJavaModel ( ) ) ; delta . removed ( workingCopy ) ; addDelta ( delta ) ; removeReconcileDelta ( workingCopy ) ; } else { if ( workingCopy . getResource ( ) . isAccessible ( ) ) { JavaElementDelta delta = new JavaElementDelta ( this . getJavaModel ( ) ) ; delta . changed ( workingCopy , IJavaElementDelta . F_PRIMARY_WORKING_COPY ) ; addDelta ( delta ) ; } else { JavaElementDelta delta = new JavaElementDelta ( this . getJavaModel ( ) ) ; <START_BUG> delta . removed ( workingCopy ) ; <END_BUG> addDelta ( delta ) ; } } } } protected CompilationUnit getWorkingCopy ( ) { } public boolean isReadOnly ( ) { } }

Fix:
delta . removed ( workingCopy , IJavaElementDelta . F_PRIMARY_WORKING_COPY ) ;
Buggy code:
public class ShortKeyAnalyzer implements KeyAnalyzer < Short > { private static final long serialVersionUID = - 8631376733513512017L ; public static final ShortKeyAnalyzer INSTANCE = new ShortKeyAnalyzer ( ) ; public static final int LENGTH = Short . SIZE ; private static final int MSB = 32768 ; private static int mask ( final int bit ) { } public int bitsPerElement ( ) { } public int lengthInBits ( final Short key ) { } public boolean isBitSet ( final Short key , final int bitIndex , final int lengthInBits ) { <START_BUG> return ( key & ( ShortKeyAnalyzer . mask ( bitIndex ) ) ) != 0 ; <END_BUG> } public int bitIndex ( final Short key , final int offsetInBits , final int lengthInBits , final Short other , final int otherOffsetInBits , final int otherLengthInBits ) { } public int compare ( final Short o1 , final Short o2 ) { } public boolean isPrefix ( final Short prefix , final int offsetInBits , final int lengthInBits , final Short key ) { } }

Fix:
return ( ( key . intValue ( ) ) & ( ShortKeyAnalyzer . mask ( bitIndex ) ) ) != 0 ;
Buggy code:
@ RunWith ( Arquillian . class ) @ ServerSetup ( PoolOverrideTestCase . PoolOverrideTestCaseSetup . class ) public class PoolOverrideTestCase { private static final Logger logger = Logger . getLogger ( PoolOverrideTestCase . class ) ; static class PoolOverrideTestCaseSetup 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 createDeployment ( ) { final JavaArchive jar = ShrinkWrap . create ( JavaArchive . class , "ejb-pool-override-test.jar" ) ; jar . addPackage ( PoolAnnotatedEJB . class . getPackage ( ) ) ; <START_BUG> jar . addAsManifestResource ( "ejb//pool//override//jboss-ejb3.xml" , "jboss-ejb3.xml" ) ; <END_BUG> return jar ; } @ Test public void testSLSBWithPoolAnnotation ( ) throws Exception { } @ Test public void testSLSBWithPoolReferenceInDD ( ) throws Exception { } @ Test public void testPoolConfigInDDOverridesAnnotation ( ) throws Exception { } private void testSimulatenousInvocationOnEJBsWithSingleInstanceInPool ( final AbstractSlowBean bean ) throws Exception { } private class PooledBeanInvoker implements Callable < Void > { private AbstractSlowBean bean ; private long beanProcessingTime ; PooledBeanInvoker ( final AbstractSlowBean bean , final long beanProcessingTime ) { } @ Override public Void call ( ) throws Exception { } } }

Fix:
jar . addAsManifestResource ( PoolOverrideTestCase . class . getPackage ( ) , "jboss-ejb3.xml" , "jboss-ejb3.xml" ) ;
Buggy code:
public class Jdk14RegexpMatcher implements RegexpMatcher { private String pattern ; public Jdk14RegexpMatcher ( ) { } public void setPattern ( String pattern ) { } public Vector getGroups ( String argument ) throws BuildException { } public Vector getGroups ( String input , int options ) throws BuildException { } public String getPattern ( ) { } public boolean matches ( String argument ) throws BuildException { } public boolean matches ( String input , int options ) throws BuildException { try { Pattern p = getCompiledPattern ( options ) ; return p . matcher ( input ) . find ( ) ; } catch ( Exception e ) { <START_BUG> throw new BuildException ( e ) ; <END_BUG> } } protected Pattern getCompiledPattern ( int options ) throws BuildException { } protected int getCompilerOptions ( int options ) { } }

Fix:
throw new BuildException ( "Error" , e ) ;
Buggy code:
public class ChangeCollector { HashMap changes = new HashMap ( ) ; TypeHierarchy hierarchy ; public ChangeCollector ( TypeHierarchy hierarchy ) { } private void addAffectedChildren ( IJavaElementDelta delta ) throws JavaModelException { } public void addChange ( ICompilationUnit cu , IJavaElementDelta newDelta ) throws JavaModelException { } private void addChange ( IImportContainer importContainer , IJavaElementDelta newDelta ) throws JavaModelException { } private void addChange ( IImportDeclaration importDecl , IJavaElementDelta newDelta ) { } private void addChange ( IMember member , IJavaElementDelta newDelta ) throws JavaModelException { } private void addChange ( IType type , IJavaElementDelta newDelta ) throws JavaModelException { } private void addTypeAddition ( IType type , SimpleDelta existingDelta ) throws JavaModelException { } private void addTypeChange ( IType type , int newFlags , SimpleDelta existingDelta ) throws JavaModelException { } private void addTypeRemoval ( IType type , SimpleDelta existingDelta ) { } private void getAllTypesFromElement ( IJavaElement element , ArrayList allTypes ) throws JavaModelException { } private void getAllTypesFromHierarchy ( JavaElement element , ArrayList allTypes ) { } private boolean hasSuperTypeChange ( IType type ) throws JavaModelException { } private boolean hasVisibilityChange ( IType type ) throws JavaModelException { } public boolean needsRefresh ( ) { <START_BUG> return ( changes . size ( ) ) != 0 ; <END_BUG> } public String toString ( ) { } }

Fix:
return ( this . changes . size ( ) ) != 0 ;
Buggy code:
abstract class BsonObjectCursor extends JsonStreamContext { private final BsonObjectCursor parent ; public BsonObjectCursor ( int contextType , BsonObjectCursor p ) { } @ Override public final BsonObjectCursor getParent ( ) { } @ Override public abstract String getCurrentName ( ) { } public abstract JsonToken nextToken ( ) { } public abstract JsonToken endToken ( ) { } public abstract Object currentNode ( ) { } public boolean currentHasChildren ( ) { } public final BsonObjectCursor iterateChildren ( ) { } protected static final class ArrayCursor extends BsonObjectCursor { Iterator < ? > contents ; Object currentNode ; public ArrayCursor ( Iterable n , BsonObjectCursor p ) { } @ Override public String getCurrentName ( ) { } @ Override public JsonToken nextToken ( ) { } @ Override public JsonToken endToken ( ) { } @ Override public Object currentNode ( ) { } } protected static final class ObjectCursor extends BsonObjectCursor { Iterator < String > fields ; BSONObject object ; String currentFieldName ; boolean needField ; public ObjectCursor ( BSONObject object , BsonObjectCursor p ) { } @ Override public String getCurrentName ( ) { } @ Override public JsonToken nextToken ( ) { } @ Override public JsonToken endToken ( ) { } @ Override public Object currentNode ( ) { } } private static JsonToken getToken ( Object o ) { if ( o == null ) { return JsonToken . VALUE_NULL ; } else if ( o instanceof Iterable ) { return JsonToken . START_ARRAY ; } else if ( o instanceof BSONObject ) { return JsonToken . START_OBJECT ; } else if ( o instanceof Number ) { if ( ( ( o instanceof Double ) || ( o instanceof Float ) ) || ( o instanceof BigDecimal ) ) { return JsonToken . VALUE_NUMBER_FLOAT ; } else { return JsonToken . VALUE_NUMBER_INT ; } } else if ( o instanceof Boolean ) { if ( ( ( Boolean ) ( o ) ) ) { return JsonToken . VALUE_TRUE ; } else { return JsonToken . VALUE_FALSE ; } } else if ( o instanceof CharSequence ) { return JsonToken . VALUE_STRING ; } else if ( o instanceof ObjectId ) { <START_BUG> return JsonToken . VALUE_STRING ; <END_BUG> } else if ( o instanceof DBRef ) { return JsonToken . VALUE_EMBEDDED_OBJECT ; } else if ( o instanceof Date ) { return JsonToken . VALUE_EMBEDDED_OBJECT ; } else if ( o instanceof byte [ ] ) { return JsonToken . VALUE_EMBEDDED_OBJECT ; } else { throw new IllegalStateException ( ( "Don't<seq2seq4repair_space>know<seq2seq4repair_space>how<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>type:<seq2seq4repair_space>" + ( o . getClass ( ) ) ) ) ; } } }

Fix:
return JsonToken . VALUE_EMBEDDED_OBJECT ;
Buggy code:
public class TestMockAnalyzer extends BaseTokenStreamTestCase { public void testWhitespace ( ) throws Exception { } public void testSimple ( ) throws Exception { } public void testKeyword ( ) throws Exception { } public void testSingleChar ( ) throws Exception { } public void testTwoChars ( ) throws Exception { } public void testThreeChars ( ) throws Exception { } public void testUppercase ( ) throws Exception { } public void testStop ( ) throws Exception { } public void testKeep ( ) throws Exception { } public void testLength ( ) throws Exception { } public void testTooLongToken ( ) throws Exception { } public void testLUCENE_3042 ( ) throws Exception { } public void testRandomStrings ( ) throws Exception { } public void testRandomRegexps ( ) throws Exception { } public void testForwardOffsets ( ) throws Exception { } public void testWrapReader ( ) throws Exception { } public void testChangeGaps ( ) throws Exception { final int positionGap = random ( ) . nextInt ( 1000 ) ; final int offsetGap = random ( ) . nextInt ( 1000 ) ; final Analyzer delegate = new MockAnalyzer ( random ( ) ) ; final Analyzer a = new AnalyzerWrapper ( delegate . getReuseStrategy ( ) ) { @ Override protected Analyzer getWrappedAnalyzer ( String fieldName ) { return delegate ; } @ Override public int getPositionIncrementGap ( String fieldName ) { return positionGap ; } @ Override public int getOffsetGap ( String fieldName ) { return offsetGap ; } } ; final RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , newDirectory ( ) ) ; final Document doc = new Document ( ) ; final FieldType ft = new FieldType ( ) ; ft . setIndexed ( true ) ; ft . setIndexOptions ( DOCS_ONLY ) ; ft . setTokenized ( true ) ; ft . setStoreTermVectors ( true ) ; ft . setStoreTermVectorPositions ( true ) ; ft . setStoreTermVectorOffsets ( true ) ; doc . add ( new org . apache . lucene . document . Field ( "f" , "a" , ft ) ) ; doc . add ( new org . apache . lucene . document . Field ( "f" , "a" , ft ) ) ; writer . addDocument ( doc , a ) ; final AtomicReader reader = getOnlySegmentReader ( writer . getReader ( ) ) ; final Fields fields = reader . getTermVectors ( 0 ) ; final Terms terms = fields . terms ( "f" ) ; final TermsEnum te = terms . iterator ( null ) ; assertEquals ( new BytesRef ( "a" ) , te . next ( ) ) ; final DocsAndPositionsEnum dpe = te . docsAndPositions ( null , null ) ; assertEquals ( 0 , dpe . nextDoc ( ) ) ; assertEquals ( 2 , dpe . freq ( ) ) ; assertEquals ( 0 , dpe . nextPosition ( ) ) ; assertEquals ( 0 , dpe . startOffset ( ) ) ; final int endOffset = dpe . endOffset ( ) ; assertEquals ( ( 1 + positionGap ) , dpe . nextPosition ( ) ) ; assertEquals ( ( ( 1 + endOffset ) + offsetGap ) , dpe . endOffset ( ) ) ; assertEquals ( null , te . next ( ) ) ; reader . close ( ) ; <START_BUG> writer . close ( ) ; <END_BUG> writer . w . getDirectory ( ) . close ( ) ; } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class SessionInfo { public static final SessionInfo NoneSession = new SessionInfo ( null , null ) ; public static final SessionInfo AnonymousSession = SessionInfo . getAnonymousSession ( ) ; private final String sessionId ; private String ipAddress ; private final UserDetail userDetail ; private final long openingTimestamp ; private long lastAccessTimestamp ; private final Map < String , Object > attributes = new HashMap < String , Object > ( ) ; private long idleTimestamp ; private final InMemoryCacheService cache = new InMemoryCacheService ( ) ; private static SessionInfo getAnonymousSession ( ) { UserDetail anonymousUser = UserDetail . getAnonymousUser ( ) ; <START_BUG> if ( ( UserDetail . getAnonymousUser ( ) ) != null ) { <END_BUG> return new SessionInfo ( null , anonymousUser ) ; } return SessionInfo . NoneSession ; } public SessionInfo ( final String sessionId , final UserDetail user ) { } public void setIPAddress ( String ip ) { } public String getIPAddress ( ) { } public long getLastAccessTimestamp ( ) { } public long getOpeningTimestamp ( ) { } public long getLastIdleDuration ( ) { } public void setAsIdle ( ) { } public String getSessionId ( ) { } public UserDetail getUserDetail ( ) { } public void updateLastAccess ( ) { } public < T > void setAttribute ( String name , T value ) { } public < T > T getAttribute ( String name ) { } public void unsetAttribute ( String name ) { } public void onClosed ( ) { } public boolean isDefined ( ) { } public InMemoryCacheService getCache ( ) { } }

Fix:
if ( anonymousUser != null ) {
Buggy code:
public class WicketTesterTest extends TestCase { public void testViewBook ( ) throws Exception { } public void testCreateBook_validateFail ( ) throws Exception { MyMockApplication tester = new MyMockApplication ( ) ; Session . get ( ) . setLocale ( Locale . US ) ; tester . startPage ( CreateBook . class ) ; FormTester formTester = tester . newFormTester ( "createForm" ) ; formTester . setValue ( "id" , "" ) ; formTester . setValue ( "name" , "" ) ; formTester . submit ( ) ; tester . assertRenderedPage ( CreateBook . class ) ; <START_BUG> tester . assertErrorMessages ( new String [ ] { "field<seq2seq4repair_space>'id'<seq2seq4repair_space>is<seq2seq4repair_space>required" , "field<seq2seq4repair_space>'name'<seq2seq4repair_space>is<seq2seq4repair_space>required" } ) ; <END_BUG> } public void testCreateBook_validatePass ( ) throws Exception { } }

Fix:
tester . assertErrorMessages ( new String [ ] { "id<seq2seq4repair_space>is<seq2seq4repair_space>required" , "name<seq2seq4repair_space>is<seq2seq4repair_space>required" } ) ;
Buggy code:
public interface StorelessUnivariateStatistic extends UnivariateStatistic { <START_BUG> public double increment ( double d ) ; <END_BUG> public double getValue ( ) { } public void clear ( ) { } }

Fix:
public void increment ( double d ) ;
Buggy code:
public class TaskManagerActivity extends DroidGap { @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; <START_BUG> super . loadUrl ( "file:////assets//www//index.html" ) ; <END_BUG> } No newline ; at end ; of file ; }

Fix:
super . loadUrl ( "//assets//www//index.html" ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class IronJacamarDoubleDeploymentTestCase extends ContainerResourceMgmtTestBase { private static final String deploymentName = "test-ij.ear" ; private static final String deployment2Name = "test-ij2.ear" ; private static final String deploymentConfigName = "ironjacamar.xml" ; private static final String deployment2ConfigName = "ironjacamar-2.xml" ; private static final String subDeploymentName = "ij.rar" ; private static ResourceAdapterArchive createSubDeployment ( final String configName ) throws Exception { } @ Deployment ( name = IronJacamarDoubleDeploymentTestCase . deploymentName ) public static EnterpriseArchive createEARDeployment ( ) throws Exception { } @ Deployment ( name = IronJacamarDoubleDeploymentTestCase . deployment2Name ) public static EnterpriseArchive createEAR2Deployment ( ) throws Exception { } @ Test public void testEarConfiguration ( ) throws Throwable { } private ModelNode getAddress ( String deploymentName ) { final ModelNode address = new ModelNode ( ) ; <START_BUG> address . add ( DEPLOYMENT , deploymentName ) . add ( SUBDEPLOYMENT , IronJacamarDoubleDeploymentTestCase . subDeploymentName ) . add ( SUBSYSTEM , "resource-adapters" ) . add ( "ironjacamar" , "ironjacamar" ) . add ( "resource-adapter" , ( deploymentName + "#ij" ) ) ; <END_BUG> address . protect ( ) ; return address ; } }

Fix:
address . add ( DEPLOYMENT , deploymentName ) . add ( SUBDEPLOYMENT , IronJacamarDoubleDeploymentTestCase . subDeploymentName ) . add ( SUBSYSTEM , "resource-adapters" ) . add ( "ironjacamar" , "ironjacamar" ) . add ( "resource-adapter" , ( deploymentName + "#ij.rar" ) ) ;
Buggy code:
public class TaxonomyMergeUtils { public static void merge ( Directory srcIndexDir , Directory srcTaxDir , Directory destIndexDir , Directory destTaxDir ) throws IOException { } public static void merge ( Directory srcIndexDir , Directory srcTaxDir , IndexWriter destIndexWriter , DirectoryTaxonomyWriter destTaxWriter ) throws IOException { } public static void merge ( Directory srcIndexDir , Directory srcTaxDir , OrdinalMap map , IndexWriter destIndexWriter , DirectoryTaxonomyWriter destTaxWriter ) throws IOException { <START_BUG> destTaxWriter . addTaxonomies ( new Directory [ ] { srcTaxDir } , new OrdinalMap [ ] { map } ) ; <END_BUG> PayloadProcessorProvider payloadProcessor = new org . apache . lucene . facet . index . FacetsPayloadProcessorProvider ( srcIndexDir , map . getMap ( ) , new DefaultFacetIndexingParams ( ) ) ; destIndexWriter . setPayloadProcessorProvider ( payloadProcessor ) ; IndexReader reader = IndexReader . open ( srcIndexDir ) ; try { destIndexWriter . addIndexes ( reader ) ; destTaxWriter . commit ( ) ; destIndexWriter . commit ( ) ; } finally { reader . close ( ) ; } } }

Fix:
destTaxWriter . addTaxonomy ( srcTaxDir , map ) ;
Buggy code:
public class StreamOut { private static Logger logger = LoggerFactory . getLogger ( StreamOut . class ) ; static String TABLE_NAME = "STREAMING-TABLE-NAME" ; public static void transferRanges ( InetAddress target , String tableName , Collection < Range > ranges , Runnable callback ) { } public static void transferSSTables ( InetAddress target , List < SSTableReader > sstables , String table ) throws IOException { PendingFile [ ] pendingFiles = new PendingFile [ ( SSTable . FILES_ON_DISK ) * ( sstables . size ( ) ) ] ; int i = 0 ; for ( SSTableReader sstable : sstables ) { <START_BUG> for ( String component : sstable . getAllComponents ( ) ) { <END_BUG> SSTable . Descriptor desc = sstable . getDescriptor ( ) ; long filelen = new File ( desc . filenameFor ( component ) ) . length ( ) ; pendingFiles [ ( i ++ ) ] = new PendingFile ( desc , component , filelen ) ; } } StreamOut . logger . info ( ( "Stream<seq2seq4repair_space>context<seq2seq4repair_space>metadata<seq2seq4repair_space>" + ( StringUtils . join ( pendingFiles , ( ( ( ",<seq2seq4repair_space>" + "<seq2seq4repair_space>" ) + ( sstables . size ( ) ) ) + "<seq2seq4repair_space>sstables." ) ) ) ) ) ; StreamOutManager . get ( target ) . addFilesToStream ( pendingFiles ) ; StreamInitiateMessage biMessage = new StreamInitiateMessage ( pendingFiles ) ; Message message = StreamInitiateMessage . makeStreamInitiateMessage ( biMessage ) ; message . setHeader ( StreamOut . TABLE_NAME , table . getBytes ( ) ) ; StreamOut . logger . info ( ( ( "Sending<seq2seq4repair_space>a<seq2seq4repair_space>stream<seq2seq4repair_space>initiate<seq2seq4repair_space>message<seq2seq4repair_space>to<seq2seq4repair_space>" + target ) + "<seq2seq4repair_space>..." ) ) ; instance . sendOneWay ( message , target ) ; if ( ( pendingFiles . length ) > 0 ) { StreamOut . logger . info ( ( ( "Waiting<seq2seq4repair_space>for<seq2seq4repair_space>transfer<seq2seq4repair_space>to<seq2seq4repair_space>" + target ) + "<seq2seq4repair_space>to<seq2seq4repair_space>complete" ) ) ; StreamOutManager . get ( target ) . waitForStreamCompletion ( ) ; StreamOut . logger . info ( ( "Done<seq2seq4repair_space>with<seq2seq4repair_space>transfer<seq2seq4repair_space>to<seq2seq4repair_space>" + target ) ) ; } } }

Fix:
for ( String component : SSTable . components ) {
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 ) { } protected void printOptions ( PrintWriter out , Category cat ) { Enumeration appenders = cat . getAllAppenders ( ) ; Level prio = cat . getLevel ( ) ; 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 ; } <START_BUG> String catKey = ( cat == ( Category . getRoot ( ) ) ) ? "log4j.rootCategory" : "log4j.category." + ( cat . getName ( ) ) ; <END_BUG> 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:
String catKey = ( cat == ( Logger . getRootLogger ( ) ) ) ? "log4j.rootCategory" : "log4j.category." + ( cat . getName ( ) ) ;
Buggy code:
public class ToolBar extends Composite { ToolItem lastFocus ; ImageList imageList ; public ToolBar ( Composite parent , int style ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } void createHandle ( int index ) { <START_BUG> state |= HANDLE ; <END_BUG> fixedHandle = OS . g_object_new ( display . gtk_fixed_get_type ( ) , 0 ) ; if ( ( fixedHandle ) == 0 ) error ( ERROR_NO_HANDLES ) ; OS . gtk_fixed_set_has_window ( fixedHandle , true ) ; handle = OS . gtk_toolbar_new ( ) ; if ( ( handle ) == 0 ) error ( ERROR_NO_HANDLES ) ; OS . gtk_container_add ( fixedHandle , handle ) ; if ( ( ( style ) & ( SWT . FLAT ) ) != 0 ) { byte [ ] swt_toolbar_flat = Converter . wcsToMbcs ( null , "swt-toolbar-flat" , true ) ; OS . gtk_widget_set_name ( handle , swt_toolbar_flat ) ; } } public Point computeSize ( int wHint , int hHint , boolean changed ) { } int eventHandle ( ) { } void fixChildren ( Shell newShell , Shell oldShell , Decorations newDecorations , Decorations oldDecorations , Menu [ ] menus ) { } boolean forceFocus ( int focusHandle ) { } public ToolItem getItem ( int index ) { } public ToolItem getItem ( Point point ) { } public int getItemCount ( ) { } public ToolItem [ ] getItems ( ) { } public int getRowCount ( ) { } int gtk_key_press_event ( int widget , int eventPtr ) { } boolean hasFocus ( ) { } public int indexOf ( ToolItem item ) { } boolean mnemonicHit ( char key ) { } boolean mnemonicMatch ( char key ) { } void relayout ( ) { } void releaseChildren ( boolean destroy ) { } void releaseWidget ( ) { } void removeControl ( Control control ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize ) { } void setFontDescription ( int font ) { } void setForegroundColor ( GdkColor color ) { } public void setToolTipText ( String string ) { } }

Fix:
state |= ( HANDLE ) | ( THEME_BACKGROUND ) ;
Buggy code:
public class AsciiBytes { private static final Charset UTF_8 = Charset . forName ( "UTF-8" ) ; private static final int INITIAL_HASH = 7 ; private static final int MULTIPLIER = 31 ; private final byte [ ] bytes ; private final int offset ; private final int length ; private String string ; public AsciiBytes ( String string ) { } public AsciiBytes ( byte [ ] bytes ) { } public AsciiBytes ( byte [ ] bytes , int offset , int length ) { } public int length ( ) { } public boolean startsWith ( AsciiBytes prefix ) { } public boolean endsWith ( AsciiBytes postfix ) { } public AsciiBytes substring ( int beginIndex ) { } public AsciiBytes substring ( int beginIndex , int endIndex ) { } public AsciiBytes append ( String string ) { } public AsciiBytes append ( AsciiBytes asciiBytes ) { } public AsciiBytes append ( byte [ ] bytes ) { } @ Override public String toString ( ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { if ( obj == null ) { return false ; } if ( ( this ) == obj ) { return true ; } <START_BUG> if ( obj . getClass ( ) . equals ( AsciiBytes . class ) ) { <END_BUG> AsciiBytes other = ( ( AsciiBytes ) ( obj ) ) ; if ( ( this . length ) == ( other . length ) ) { for ( int i = 0 ; i < ( this . length ) ; i ++ ) { if ( ( this . bytes [ ( ( this . offset ) + i ) ] ) != ( other . bytes [ ( ( other . offset ) + i ) ] ) ) { return false ; } } return true ; } } return false ; } }

Fix:
if ( ( this . getClass ( ) ) == ( obj . getClass ( ) ) ) {
Buggy code:
public class LiftStrategyPredecessor extends LiftStrategy { Queue < Vertex > queue ; boolean [ ] queued ; public LiftStrategyPredecessor ( ParityGame pg ) { } @ Override public void lifted ( Vertex v ) { <START_BUG> for ( Vertex w : v . getSuccessors ( ) ) { <END_BUG> if ( ( ! ( queued [ w . getID ( ) ] ) ) && ( ! ( w . getTuple ( ) . isTop ( ) ) ) ) { queue . add ( w ) ; queued [ w . getID ( ) ] = true ; } } } @ Override public Vertex next ( ) { } }

Fix:
for ( Vertex w : v . getPredecessors ( ) ) {
Buggy code:
public abstract class AbstractCompendiumHandler extends ServiceTracker implements MBeanHandler { protected final JMXAgentContext agentContext ; protected StandardMBean mbean ; protected Long trackedId ; protected AbstractCompendiumHandler ( JMXAgentContext agentContext , Filter filter ) { } protected AbstractCompendiumHandler ( JMXAgentContext agentContext , String clazz ) { } public Object addingService ( ServiceReference reference ) { Logger logger = agentContext . getLogger ( ) ; Object trackedService = null ; Long serviceId = ( ( Long ) ( reference . getProperty ( Constants . SERVICE_ID ) ) ) ; <START_BUG> if ( ( getTrackingCount ( ) ) > 0 ) { <END_BUG> String serviceDescription = ( ( String ) ( ( ( reference . getProperty ( Constants . SERVICE_DESCRIPTION ) ) != null ) ? reference . getProperty ( Constants . SERVICE_DESCRIPTION ) : reference . getProperty ( Constants . OBJECTCLASS ) ) ) ; logger . log ( LogService . LOG_WARNING , ( ( ( ( ( ( "Detected<seq2seq4repair_space>secondary<seq2seq4repair_space>ServiceReference<seq2seq4repair_space>for<seq2seq4repair_space>[" + serviceDescription ) + "]<seq2seq4repair_space>with<seq2seq4repair_space>" ) + ( Constants . SERVICE_ID ) ) + "<seq2seq4repair_space>[" ) + serviceId ) + "]<seq2seq4repair_space>Only<seq2seq4repair_space>1<seq2seq4repair_space>instance<seq2seq4repair_space>will<seq2seq4repair_space>be<seq2seq4repair_space>JMX<seq2seq4repair_space>managed" ) ) ; } else { logger . log ( LogService . LOG_INFO , ( ( ( ( ( ( "Registering<seq2seq4repair_space>MBean<seq2seq4repair_space>with<seq2seq4repair_space>ObjectName<seq2seq4repair_space>[" + ( getName ( ) ) ) + "]<seq2seq4repair_space>for<seq2seq4repair_space>service<seq2seq4repair_space>with<seq2seq4repair_space>" ) + ( Constants . SERVICE_ID ) ) + "<seq2seq4repair_space>[" ) + serviceId ) + "]" ) ) ; trackedService = context . getService ( reference ) ; mbean = constructInjectMBean ( trackedService ) ; ExecutorService executor = agentContext . getRegistrationExecutor ( ) ; executor . submit ( new Runnable ( ) { public void run ( ) { agentContext . registerMBean ( AbstractCompendiumHandler . this ) ; } } ) ; trackedId = serviceId ; } return trackedService ; } public void removedService ( ServiceReference reference , Object service ) { } public StandardMBean getMbean ( ) { } protected abstract StandardMBean constructInjectMBean ( Object targetService ) { } }

Fix:
if ( ( trackedId ) != null ) {
Buggy code:
public interface VoldInterface { public void insert ( String source , Map < Key , Set < String > > map ) { } public Map < String , String > refresh ( String source , Set < Key > set ) { } <START_BUG> public Map < String , String > delete ( String source , Set < Key > set ) ; <END_BUG> public Map < Key , Set < String > > lookup ( Set < Key > keys ) { } }

Fix:
public void delete ( String source , Set < Key > set ) ;
Buggy code:
public class MockWebApplicationTest extends TestCase { private MockWebApplication application ; public MockWebApplicationTest ( String name ) { } protected void setUp ( ) throws Exception { } public void testRenderHomePage ( ) throws Exception { } public void testClickLink ( ) throws Exception { } private boolean validateDocument ( String document , int expectedLinkClickCount ) { HtmlDocumentValidator validator = new HtmlDocumentValidator ( ) ; Tag html = new Tag ( "html" ) ; Tag head = new Tag ( "head" ) ; html . addExpectedChild ( head ) ; Tag title = new Tag ( "title" ) ; head . addExpectedChild ( title ) ; title . addExpectedChild ( new TextContent ( "Mock<seq2seq4repair_space>Page" ) ) ; Tag body = new Tag ( "body" ) ; html . addExpectedChild ( body ) ; Tag a = new Tag ( "a" ) ; <START_BUG> a . addExpectedAttribute ( "href" , "//MockWebApplication//MockWebApplication\\?component=[0-9]*.actionLink&amp;version=[0-9]*&amp;interface=ILinkListener" ) ; <END_BUG> a . addExpectedAttribute ( "id" , "wicket-actionLink" ) ; body . addExpectedChild ( a ) ; a . addExpectedChild ( new TextContent ( "Action<seq2seq4repair_space>link<seq2seq4repair_space>clicked<seq2seq4repair_space>" ) ) ; Tag span = new Tag ( "span" ) ; span . addExpectedChild ( new TextContent ( ( "" + expectedLinkClickCount ) ) ) ; a . addExpectedChild ( span ) ; a . addExpectedChild ( new TextContent ( "<seq2seq4repair_space>times" ) ) ; validator . addRootElement ( html ) ; return validator . isDocumentValid ( document ) ; } }

Fix:
a . addExpectedAttribute ( "href" , "//MockWebApplication//MockWebApplication\\?component=[0-9]*.actionLink&amp;version=\\-?[0-9]*&amp;interface=ILinkListener" ) ;
Buggy code:
public class EntityFire extends Entity { EntityPlayer player ; public EntityFire ( World world ) { } public EntityFire ( World world , EntityPlayer sender , double x , double y , double z , int level ) { } @ Override public void onUpdate ( ) { if ( ( player ) == null ) { return ; } int rotation = 0 ; if ( ! ( worldObj . isRemote ) ) { <START_BUG> PacketDispatcher . sendToAllAround ( new SpawnFireParticles ( this ) , player , 64.0 ) ; <END_BUG> } this . rotationYaw = ( rotation + 1 ) % 360 ; if ( ( ticksExisted ) > 15 ) { setDead ( ) ; } if ( ( ticksExisted ) < 10 ) { player . getEntityAttribute ( movementSpeed ) . setBaseValue ( 0.0 ) ; } else { player . getEntityAttribute ( movementSpeed ) . setBaseValue ( 0.10000000149011612 ) ; } AxisAlignedBB aabb = player . getEntityBoundingBox ( ) . expand ( 2 , 2 , 2 ) ; List list = this . worldObj . getEntitiesWithinAABBExcludingEntity ( player , aabb ) ; if ( ! ( list . isEmpty ( ) ) ) { for ( int i = 0 ; i < ( list . size ( ) ) ; i ++ ) { Entity e = ( ( Entity ) ( list . get ( i ) ) ) ; e . attackEntityFrom ( magic , 3.0F ) ; e . setFire ( 5 ) ; } } aabb . contract ( 2 , 2 , 2 ) ; super . onUpdate ( ) ; } @ Override protected void entityInit ( ) { } @ Override protected void readEntityFromNBT ( NBTTagCompound tagCompund ) { } @ Override protected void writeEntityToNBT ( NBTTagCompound tagCompound ) { } @ Override public AxisAlignedBB getEntityBoundingBox ( ) { } }

Fix:
PacketDispatcher . sendToAllAround ( new SpawnFireParticles ( this , 1 ) , player , 64.0 ) ;
Buggy code:
public class HighamHall54IntegratorTest extends TestCase { public HighamHall54IntegratorTest ( String name ) { } public void testWrongDerivative ( ) { } public void testMinStep ( ) { } public void testIncreasingTolerance ( ) throws DerivativeException , IntegratorException { } public void testBackward ( ) throws DerivativeException , IntegratorException { } public void testEvents ( ) throws DerivativeException , IntegratorException { } public void testEventsErrors ( ) { } public void testEventsNoConvergence ( ) { } public void testSanityChecks ( ) { } public void testKepler ( ) throws DerivativeException , IntegratorException { } private static class KeplerHandler implements StepHandler { public KeplerHandler ( TestProblem3 pb ) { } public boolean requiresDenseOutput ( ) { } public void reset ( ) { } public void handleStep ( StepInterpolator interpolator , boolean isLast ) throws DerivativeException { ++ ( nbSteps ) ; double [ ] interpolatedY = interpolator . getInterpolatedState ( ) ; double [ ] theoreticalY = pb . computeTheoreticalState ( interpolator . getCurrentTime ( ) ) ; double dx = ( interpolatedY [ 0 ] ) - ( theoreticalY [ 0 ] ) ; double dy = ( interpolatedY [ 1 ] ) - ( theoreticalY [ 1 ] ) ; double error = ( dx * dx ) + ( dy * dy ) ; if ( error > ( maxError ) ) { maxError = error ; } if ( isLast ) { <START_BUG> assertTrue ( ( ( maxError ) < 4.0E-11 ) ) ; <END_BUG> assertTrue ( ( ( nbSteps ) < 670 ) ) ; } } private TestProblem3 pb ; private int nbSteps ; private double maxError ; } }

Fix:
assertTrue ( ( ( maxError ) < 4.2E-11 ) ) ;