nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ResourceRequestHandler implements IRequestHandler { private final IResource resource ; private final Locale locale ; private final String style ; private final String variation ; private final PageParameters pageParameters ; public ResourceRequestHandler ( IResource resource , Locale locale , String style , String variation , PageParameters pageParameters ) { } public Locale getLocale ( ) { } public String getStyle ( ) { } public String getVariation ( ) { } public PageParameters getPageParameters ( ) { } public IResource getResource ( ) { } public void respond ( final RequestCycle requestCycle ) { <START_BUG> IResource . Attributes a = new IResource . Attributes ( requestCycle . getRequest ( ) , requestCycle . getResponse ( ) , locale , style , variation , pageParameters ) ; <END_BUG> resource . respond ( a ) ; } public void detach ( RequestCycle requestCycle ) { } }

Fix:
IResource . Attributes a = new IResource . Attributes ( requestCycle . getRequest ( ) , requestCycle . getResponse ( ) , pageParameters ) ;
Buggy code:
public class RowMutation { private static ICompactSerializer < RowMutation > serializer_ ; public static final String HINT = "HINT" ; public static ICompactSerializer < RowMutation > serializer ( ) { } private String table_ ; private byte [ ] key_ ; protected Map < Integer , ColumnFamily > modifications_ = new HashMap < Integer , ColumnFamily > ( ) ; public RowMutation ( String table , byte [ ] key ) { } public RowMutation ( String table , Row row ) { } protected RowMutation ( String table , byte [ ] key , Map < Integer , ColumnFamily > modifications ) { } public String getTable ( ) { } public byte [ ] key ( ) { } public Collection < ColumnFamily > getColumnFamilies ( ) { } void addHints ( RowMutation rm ) throws IOException { for ( ColumnFamily cf : rm . getColumnFamilies ( ) ) { byte [ ] combined = HintedHandOffManager . makeCombinedName ( rm . getTable ( ) , cf . metadata ( ) . cfName ) ; QueryPath path = new QueryPath ( HintedHandOffManager . HINTS_CF , rm . key ( ) , combined ) ; <START_BUG> add ( path , EMPTY_BYTE_ARRAY , new TimestampClock ( System . currentTimeMillis ( ) ) ) ; <END_BUG> } } public void add ( ColumnFamily columnFamily ) { } public boolean isEmpty ( ) { } public void add ( QueryPath path , byte [ ] value , IClock clock , int timeToLive ) { } public void add ( QueryPath path , byte [ ] value , IClock clock ) { } public void delete ( QueryPath path , IClock clock ) { } public void apply ( ) throws IOException { } void applyBinary ( ) throws IOException , InterruptedException , ExecutionException { } public Message makeRowMutationMessage ( ) throws IOException { } public Message makeRowMutationMessage ( StorageService . Verb verb ) throws IOException { } public static RowMutation getRowMutationFromMutations ( String keyspace , byte [ ] key , Map < String , List < Mutation > > cfmap ) { } public static RowMutation getRowMutation ( String table , byte [ ] key , Map < String , List < ColumnOrSuperColumn > > cfmap ) { } public DataOutputBuffer getSerializedBuffer ( ) throws IOException { } public String toString ( ) { } public String toString ( boolean shallow ) { } private static void addColumnOrSuperColumnToRowMutation ( RowMutation rm , String cfName , ColumnOrSuperColumn cosc ) { } private static void deleteColumnOrSuperColumnToRowMutation ( RowMutation rm , String cfName , Deletion del ) { } private static IClock unthriftifyClock ( Clock clock ) { } }

Fix:
add ( path , EMPTY_BYTE_ARRAY , new TimestampClock ( System . currentTimeMillis ( ) ) , DatabaseDescriptor . getGcGraceInSeconds ( ) ) ;
Buggy code:
public class RemoteChannelPairSetup implements RemotingChannelPairSetup { static final String ENDPOINT_NAME = "endpoint" ; static final String URI_SCHEME = "test123" ; static final String TEST_CHANNEL = "Test-Channel" ; static final int PORT = 32123 ; ChannelServer channelServer ; protected ExecutorService executorService ; protected ManagementChannel serverChannel ; protected ManagementChannel clientChannel ; final CountDownLatch clientConnectedLatch = new CountDownLatch ( 1 ) ; public ManagementChannel getServerChannel ( ) { } public ManagementChannel getClientChannel ( ) { } public ExecutorService getExecutorService ( ) { } public void setupRemoting ( ) throws IOException { } public void startChannels ( ) throws IOException , URISyntaxException { ProtocolChannelClient . Configuration < ManagementChannel > configuration = new ProtocolChannelClient . Configuration < ManagementChannel > ( ) ; configuration . setEndpointName ( RemoteChannelPairSetup . ENDPOINT_NAME ) ; configuration . setUriScheme ( RemoteChannelPairSetup . URI_SCHEME ) ; configuration . setUri ( new URI ( ( ( ( ( "" + ( RemoteChannelPairSetup . URI_SCHEME ) ) + ":////127.0.0.1:" ) + ( RemoteChannelPairSetup . PORT ) ) + "" ) ) ) ; configuration . setExecutor ( executorService ) ; configuration . setChannelFactory ( new ManagementChannelFactory ( ) ) ; ProtocolChannelClient < ManagementChannel > client = ProtocolChannelClient . create ( configuration ) ; <START_BUG> client . connect ( new org . jboss . remoting3 . security . PasswordClientCallbackHandler ( "TestUser" , configuration . getEndpointName ( ) , "TestUserPassword" . toCharArray ( ) ) ) ; <END_BUG> clientChannel = client . openChannel ( RemoteChannelPairSetup . TEST_CHANNEL ) ; try { clientConnectedLatch . await ( ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( e ) ; } } public void stopChannels ( ) { } public void shutdownRemoting ( ) throws IOException , InterruptedException { } }

Fix:
client . connect ( new PasswordClientCallbackHandler ( "TestUser" , "localhost.localdomain" , "TestUserPassword" . toCharArray ( ) ) ) ;
Buggy code:
final class RangeToken extends Token implements Serializable { private static final long serialVersionUID = - 553983121197679934L ; int [ ] ranges ; boolean sorted ; boolean compacted ; RangeToken icaseCache = null ; int [ ] map = null ; int nonMapIndex ; RangeToken ( int type ) { } protected void addRange ( int start , int end ) { } private final boolean isSorted ( ) { } private final void setSorted ( boolean sort ) { } private final boolean isCompacted ( ) { } private final void setCompacted ( ) { } protected void sortRanges ( ) { } protected void compactRanges ( ) { } protected void mergeRanges ( Token token ) { } protected void subtractRanges ( Token token ) { } protected void intersectRanges ( Token token ) { RangeToken tok = ( ( RangeToken ) ( token ) ) ; if ( ( ( tok . ranges ) == null ) || ( ( this . ranges ) == null ) ) return ; this . icaseCache = null ; this . sortRanges ( ) ; this . compactRanges ( ) ; tok . sortRanges ( ) ; tok . compactRanges ( ) ; int [ ] result = new int [ ( this . ranges . length ) + ( tok . ranges . length ) ] ; int wp = 0 ; int src1 = 0 ; int src2 = 0 ; while ( ( src1 < ( this . ranges . length ) ) && ( src2 < ( tok . ranges . length ) ) ) { int src1begin = this . ranges [ src1 ] ; int src1end = this . ranges [ ( src1 + 1 ) ] ; int src2begin = tok . ranges [ src2 ] ; int src2end = tok . ranges [ ( src2 + 1 ) ] ; if ( src1end < src2begin ) { src1 += 2 ; } else if ( ( src1end >= src2begin ) && ( src1begin <= src2end ) ) { <START_BUG> if ( ( src2begin <= src2begin ) && ( src1end <= src2end ) ) { <END_BUG> result [ ( wp ++ ) ] = src1begin ; result [ ( wp ++ ) ] = src1end ; src1 += 2 ; } else if ( src2begin <= src1begin ) { result [ ( wp ++ ) ] = src1begin ; result [ ( wp ++ ) ] = src2end ; this . ranges [ src1 ] = src2end + 1 ; src2 += 2 ; } else if ( src1end <= src2end ) { result [ ( wp ++ ) ] = src2begin ; result [ ( wp ++ ) ] = src1end ; src1 += 2 ; } else { result [ ( wp ++ ) ] = src2begin ; result [ ( wp ++ ) ] = src2end ; this . ranges [ src1 ] = src2end + 1 ; } } else if ( src2end < src1begin ) { src2 += 2 ; } else { throw new RuntimeException ( ( ( ( ( ( ( ( ( "Token#intersectRanges():<seq2seq4repair_space>Internal<seq2seq4repair_space>Error:<seq2seq4repair_space>[" + ( this . ranges [ src1 ] ) ) + "," ) + ( this . ranges [ ( src1 + 1 ) ] ) ) + "]<seq2seq4repair_space>&<seq2seq4repair_space>[" ) + ( tok . ranges [ src2 ] ) ) + "," ) + ( tok . ranges [ ( src2 + 1 ) ] ) ) + "]" ) ) ; } } while ( src1 < ( this . ranges . length ) ) { result [ ( wp ++ ) ] = this . ranges [ ( src1 ++ ) ] ; result [ ( wp ++ ) ] = this . ranges [ ( src1 ++ ) ] ; } this . ranges = new int [ wp ] ; System . arraycopy ( result , 0 , this . ranges , 0 , wp ) ; } static Token complementRanges ( Token token ) { } synchronized RangeToken getCaseInsensitiveToken ( ) { } void dumpRanges ( ) { } boolean match ( int ch ) { } private static final int MAPSIZE = 256 ; private void createMap ( ) { } public String toString ( int options ) { } private static String escapeCharInCharClass ( int ch ) { } }

Fix:
if ( ( src2begin <= src1begin ) && ( src1end <= src2end ) ) {
Buggy code:
public class Baseroom { private int roomxcor ; private int roomycor ; private int floor ; private Thing [ ] [ ] grid = new Thing [ 1366 ] [ 768 ] ; private ArrayList < Thing > things = new ArrayList < Thing > ( ) ; private Random rnd = new Random ( ) ; private EnviroType desk = EnviroType . DESK ; private EnviroType trash = EnviroType . TRASHCAN ; private int [ ] collisionpoint = new int [ 2 ] ; private int monsternum ; public Baseroom ( int f , int rx , int ry ) { } public boolean addThing ( Thing t , int x , int y ) { } public void clearGrid ( ) { } public void clearThingArrayList ( ) { } public ArrayList < Thing > getThingArrayList ( ) { } public boolean unitCollision ( Basechar movingChar ) { int [ ] ifMoved = movingChar . tryMove ( ) ; int xcoor = ifMoved [ 0 ] ; int ycoor = ifMoved [ 1 ] ; for ( int i = 0 ; i < ( things . size ( ) ) ; i ++ ) { int xcoor2 = things . get ( i ) . getPosInRoom ( ) [ 0 ] ; <START_BUG> int ycoor2 = things . get ( i ) . getPosInRooM ( ) [ 1 ] ; <END_BUG> if ( xcoor2 < xcoor ) { if ( ycoor2 < ycoor ) { return ( ( xcoor - xcoor2 ) < 50 ) && ( ( ycoor - ycoor2 ) < 50 ) ; } } } return false ; } public boolean outOfBoundary ( Basechar movingChar ) { } public boolean itemDrop ( Thing deadThing ) { } public void die ( Thing deadThing ) { } public int getRX ( ) { } public int getRY ( ) { } public int getFloor ( ) { } public Random getRandom ( ) { } public Thing [ ] [ ] getGrid ( ) { } public Thing getThingAt ( int x , int y ) { } public int [ ] getCollisionPoint ( ) { } public int getNumMonsters ( ) { } public boolean createSpawn ( ) { } public boolean createTreasure ( ) { } public boolean createMonsterEasy ( ) { } public boolean createMonsterMed ( ) { } public boolean createMonsterHard ( ) { } }

Fix:
int ycoor2 = things . get ( i ) . getPosInRoom ( ) [ 1 ] ;
Buggy code:
@ ManagedBean ( name = "LoginBean" ) @ ViewScoped public class LoginBean { private String login ; private String passwd ; private SessionBean sb ; private String redirect ; public LoginBean ( ) { } @ PostConstruct public void init ( ) { this . sb = ( ( SessionBean ) ( BeanHelper . getSessionBean ( SessionBean . class ) ) ) ; if ( ! ( "" . equals ( sb . getSpaceId ( ) ) ) ) { sb . logoutFromSpot ( ) ; Navigation nav = ( ( Navigation ) ( BeanHelper . getApplicationBean ( Navigation . class ) ) ) ; try { javax . faces . context . FacesContext . getCurrentInstance ( ) . getExternalContext ( ) . redirect ( nav . getHomeUrl ( ) ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } try { if ( UrlHelper . getParameterBoolean ( "logout" ) ) { logout ( ) ; } if ( ( UrlHelper . getParameterValue ( "redirect" ) ) != null ) this . redirect = URLDecoder . decode ( UrlHelper . getParameterValue ( "redirect" ) , "UTF-8" ) ; } catch ( Exception e ) { <START_BUG> new RuntimeException ( e ) ; <END_BUG> } } public void setLogin ( String login ) { } public String getLogin ( ) { } public void setPasswd ( String passwd ) { } public String getPasswd ( ) { } public void loginClick ( ) { } public void doLogin ( ) throws Exception { } public boolean loginWithEscidocAccount ( ) { } public boolean loginWithImejiAccount ( ) { } public void logout ( ) throws IOException { } }

Fix:
throw new RuntimeException ( e ) ;
Buggy code:
public class Resolver { public static final int PORT = 53 ; InetAddress addr ; int port = Resolver . PORT ; boolean useTCP ; boolean ignoreTruncation ; int EDNSlevel = - 1 ; TSIG tsig ; int timeoutValue = 60 * 1000 ; static String defaultResolver = "localhost" ; public Resolver ( String hostname ) throws UnknownHostException { } public Resolver ( ) throws UnknownHostException { } public static void setDefaultResolver ( String hostname ) { } public void setPort ( int port ) { } public void setTCP ( boolean flag ) { } public void setIgnoreTruncation ( boolean flag ) { } public void setEDNS ( int level ) { } public void setTSIGKey ( String name , String key ) { } public void setTSIGKey ( String key ) { } Message sendTCP ( Message query , byte [ ] out ) throws IOException { byte [ ] in ; Socket s ; int inLength ; DataInputStream dataIn ; try { s = new Socket ( addr , port ) ; } catch ( SocketException e ) { System . out . println ( e ) ; return null ; } new DataOutputStream ( s . getOutputStream ( ) ) . writeShort ( out . length ) ; s . getOutputStream ( ) . write ( out ) ; s . setSoTimeout ( timeoutValue ) ; try { dataIn = new DataInputStream ( s . getInputStream ( ) ) ; inLength = dataIn . readUnsignedShort ( ) ; in = new byte [ inLength ] ; dataIn . readFully ( in ) ; } catch ( InterruptedIOException e ) { s . close ( ) ; System . out . println ( ";;<seq2seq4repair_space>No<seq2seq4repair_space>response" ) ; return null ; } s . close ( ) ; Message response = new Message ( in ) ; if ( ( tsig ) != null ) { boolean ok = tsig . verify ( response , in , query . getTSIG ( ) ) ; <START_BUG> System . out . println ( ( "TSIG<seq2seq4repair_space>verify:<seq2seq4repair_space>" + ok ) ) ; <END_BUG> } return response ; } public Message send ( Message query ) throws IOException { } public Message sendAXFR ( Message query ) throws IOException { } }

Fix:
System . out . println ( ( ";;<seq2seq4repair_space>TSIG<seq2seq4repair_space>verify:<seq2seq4repair_space>" + ok ) ) ;
Buggy code:
public class ASBuilder implements DOMErrorHandler { protected static final String NAMESPACES_FEATURE_ID = "http:////xml.org//sax//features//namespaces" ; protected static final String VALIDATION_FEATURE_ID = "http:////xml.org//sax//features//validation" ; protected static final String SCHEMA_VALIDATION_FEATURE_ID = "http:////apache.org//xml//features//validation//schema" ; protected static final String SCHEMA_FULL_CHECKING_FEATURE_ID = "http:////apache.org//xml//features//validation//schema-full-checking" ; protected static final boolean DEFAULT_SCHEMA_FULL_CHECKING = false ; public static void main ( String [ ] argv ) { } private static void printUsage ( ) { System . err . println ( "usage:<seq2seq4repair_space>java<seq2seq4repair_space>dom.ASBuilder<seq2seq4repair_space>[-f|-F]<seq2seq4repair_space>-a<seq2seq4repair_space>uri<seq2seq4repair_space>...<seq2seq4repair_space>[-i<seq2seq4repair_space>uri<seq2seq4repair_space>...]" ) ; System . err . println ( ) ; System . err . println ( "options:" ) ; System . err . println ( "<seq2seq4repair_space>-f<seq2seq4repair_space>|<seq2seq4repair_space>-F<seq2seq4repair_space>Turn<seq2seq4repair_space>on//off<seq2seq4repair_space>Schema<seq2seq4repair_space>full<seq2seq4repair_space>checking." ) ; System . err . println ( "<seq2seq4repair_space>-a<seq2seq4repair_space>uri<seq2seq4repair_space>...<seq2seq4repair_space>Provide<seq2seq4repair_space>a<seq2seq4repair_space>list<seq2seq4repair_space>of<seq2seq4repair_space>schema<seq2seq4repair_space>documents." ) ; <START_BUG> System . err . println ( "<seq2seq4repair_space>-i<seq2seq4repair_space>uri<seq2seq4repair_space>...<seq2seq4repair_space>Provide<seq2seq4repair_space>a<seq2seq4repair_space>list<seq2seq4repair_space>of<seq2seq4repair_space>instalce<seq2seq4repair_space>documents<seq2seq4repair_space>to<seq2seq4repair_space>validate." ) ; <END_BUG> System . err . println ( ) ; System . err . println ( "default:" ) ; System . err . print ( "<seq2seq4repair_space>Schema<seq2seq4repair_space>full<seq2seq4repair_space>checking:<seq2seq4repair_space>" ) ; System . err . println ( ( ASBuilder . DEFAULT_SCHEMA_FULL_CHECKING ? "on" : "off" ) ) ; System . err . println ( ) ; System . err . println ( "notes:" ) ; System . err . println ( "DOM<seq2seq4repair_space>Level<seq2seq4repair_space>3<seq2seq4repair_space>APIs<seq2seq4repair_space>might<seq2seq4repair_space>change<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>future." ) ; } public boolean handleError ( DOMError error ) { } }

Fix:
System . err . println ( "<seq2seq4repair_space>-i<seq2seq4repair_space>uri<seq2seq4repair_space>...<seq2seq4repair_space>Provide<seq2seq4repair_space>a<seq2seq4repair_space>list<seq2seq4repair_space>of<seq2seq4repair_space>instance<seq2seq4repair_space>documents<seq2seq4repair_space>to<seq2seq4repair_space>validate." ) ;
Buggy code:
public class ClassLiteralAccess extends Expression { public TypeReference type ; public TypeBinding targetType ; FieldBinding syntheticField ; public ClassLiteralAccess ( int sourceEnd , TypeReference t ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public TypeBinding resolveType ( BlockScope scope ) { constant = NotAConstant ; if ( ( targetType = type . resolveType ( scope ) ) == null ) return null ; if ( ( targetType . isArrayType ( ) ) && ( ( ( ( ArrayBinding ) ( targetType ) ) . leafComponentType ) == ( VoidBinding ) ) ) { scope . problemReporter ( ) . cannotAllocateVoidArray ( this ) ; return null ; } <START_BUG> return scope . getJavaLangClass ( ) ; <END_BUG> } public String toStringExpression ( ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } }

Fix:
return this . expressionType = scope . getJavaLangClass ( ) ;
Buggy code:
public class GameMechanics { private static final int POW = 3 ; private static final double RANK_UP_FACTOR = 1.1 ; private static final double LEVEL_UP_BONUS = 0.1 ; private static final int MAX_RANK = 10 ; private static final int SIZE_MULT = 10 ; private static final int EP_BLOW_UP = 100 ; public static double getFightResult ( int ownArmyStrength , int enemyArmyStrength ) { } public static int factorial ( int n ) { } public static int binomial ( int n , int k ) { } public static int getLevelForRank ( int rank ) { } public static int getRankByLevel ( int level ) { } public static int getLevelForRankUp ( int level ) { } public static int getStrengthByLevel ( int level ) { } public static int getArmyStrength ( List < DbSoldier > soldiers ) { } public static int getMaxArmySize ( int playerLevel ) { } public static int getEpForPlayerLevelUp ( int playerLevel ) { <START_BUG> return ( ( int ) ( ( GameMechanics . EP_BLOW_UP ) * ( Math . pow ( ( playerLevel + 1 ) , 2.0 ) ) ) ) ; <END_BUG> } public static int getPlayerLevelForEp ( int ep ) { } public static int getEpBaseReward ( int enemyLevel ) { } public static double getPlayerLevelProgress ( int ep ) { } public static double randomMult ( ) { } public static int randomEncounterLevel ( int ownLevel ) { } }

Fix:
return ( ( int ) ( ( GameMechanics . EP_BLOW_UP ) * ( Math . pow ( playerLevel , 2.0 ) ) ) ) ;
Buggy code:
public interface Pointcut { <START_BUG> String getPointcutExpression ( ) ; <END_BUG> String getName ( ) { } int getModifiers ( ) { } Class < ? > [ ] getParameterTypes ( ) { } AjType getDeclaringType ( ) { } }

Fix:
PointcutExpression getPointcutExpression ( ) ;
Buggy code:
public class Body { public static final double DENSITY = 1 ; private double x ; private double y ; private double velX ; private double velY ; private double acelX = 0 ; private double acelY = 0 ; private double mass ; public Body ( double x , double y , double velX , double velY , double mass ) { } public void update ( long timeElapsed , long nanosPerSecond , double xForces , double yForces ) { double secondsElapsed = timeElapsed // nanosPerSecond ; x += ( velX ) * secondsElapsed ; y += ( velY ) * secondsElapsed ; velX += ( acelX ) * secondsElapsed ; velY += ( acelY ) * secondsElapsed ; acelX = xForces // ( mass ) ; <START_BUG> acelY = xForces // ( mass ) ; <END_BUG> } public int getIntX ( ) { } public double getX ( ) { } public void setX ( double x ) { } public double getY ( ) { } public int getIntY ( ) { } public void setY ( double y ) { } public double getVelX ( ) { } public void setVelX ( double velX ) { } public double getVelY ( ) { } public void setVelY ( double velY ) { } public double getAcelX ( ) { } public void setAcelX ( double acelX ) { } public double getAcelY ( ) { } public void setAcelY ( double acelY ) { } public double getMass ( ) { } public void setMass ( double mass ) { } public double getRadius ( ) { } public double distanceTo ( Body b ) { } @ Override public String toString ( ) { } }

Fix:
acelY = yForces // ( mass ) ;
Buggy code:
public class RestTemplateIntegrationTests extends AbstractJettyServerTestCase { private RestTemplate template ; @ Before public void createTemplate ( ) { } @ Test public void getString ( ) { } @ Test public void getEntity ( ) { } @ Test public void getNoResponse ( ) { } @ Test public void getNoContentTypeHeader ( ) throws UnsupportedEncodingException { } @ Test public void getNoContent ( ) { } @ Test public void getNotModified ( ) { } @ Test public void postForLocation ( ) throws URISyntaxException { } @ Test public void postForLocationEntity ( ) throws URISyntaxException { } @ Test public void postForObject ( ) throws URISyntaxException { } @ Test public void notFound ( ) { } @ Test public void serverError ( ) { } @ Test public void optionsForAllow ( ) throws URISyntaxException { } @ Test public void uri ( ) throws InterruptedException , URISyntaxException { } @ Test public void multipart ( ) throws UnsupportedEncodingException { } @ Test public void exchangeGet ( ) throws Exception { } @ Test public void exchangePost ( ) throws Exception { } @ Test public void jsonPostForObject ( ) throws URISyntaxException { } @ Test public void jsonPostForObjectWithJacksonView ( ) throws URISyntaxException { HttpHeaders entityHeaders = new HttpHeaders ( ) ; entityHeaders . setContentType ( new MediaType ( "application" , "json" , Charset . forName ( "UTF-8" ) ) ) ; RestTemplateIntegrationTests . MySampleBean bean = new RestTemplateIntegrationTests . MySampleBean ( "with" , "with" , "without" ) ; MappingJacksonValue jacksonValue = new MappingJacksonValue ( bean ) ; jacksonValue . setSerializationView ( RestTemplateIntegrationTests . MyJacksonView1 . class ) ; <START_BUG> HttpEntity < MappingJacksonValue > entity = new HttpEntity < MappingJacksonValue > ( jacksonValue ) ; <END_BUG> String s = template . postForObject ( ( ( baseUrl ) + "//jsonpost" ) , entity , String . class , "post" ) ; assertTrue ( s . contains ( "\"with1\":\"with\"" ) ) ; assertFalse ( s . contains ( "\"with2\":\"with\"" ) ) ; assertTrue ( s . contains ( "\"without\":\"without\"" ) ) ; } @ Test public void serverPort ( ) { } public interface MyJacksonView1 { } public interface MyJacksonView2 { } public static class MySampleBean { @ JsonView ( RestTemplateIntegrationTests . MyJacksonView1 . class ) private String with1 ; @ JsonView ( RestTemplateIntegrationTests . MyJacksonView2 . class ) private String with2 ; private String without ; private MySampleBean ( ) { } private MySampleBean ( String with1 , String with2 , String without ) { } public String getWith1 ( ) { } public void setWith1 ( String with1 ) { } public String getWith2 ( ) { } public void setWith2 ( String with2 ) { } public String getWithout ( ) { } public void setWithout ( String without ) { } } }

Fix:
HttpEntity < MappingJacksonValue > entity = new HttpEntity < MappingJacksonValue > ( jacksonValue , entityHeaders ) ;
Buggy code:
public class QuestionnaireGridPane extends GridPane { public QuestionnaireGridPane ( final List < RuntimeQuestion > allRuntimeQuestions , final List < RuntimeQuestion > runtimeQuestionsToShow ) { } public void showQuestions ( final List < RuntimeQuestion > allRuntimeQuestions , final List < RuntimeQuestion > runtimeQuestionsToShow ) { getChildren ( ) . clear ( ) ; int y = 1 ; for ( RuntimeQuestion runtimeQuestion : runtimeQuestionsToShow ) { Question question = runtimeQuestion . getQuestion ( ) ; DataType dataType = question . getDataType ( ) ; Label label = new Label ( question . getQuestionLabel ( ) ) ; add ( label , 0 , y ) ; Expression condition = runtimeQuestion . getCondition ( ) ; boolean visible = condition == null ; label . setVisible ( visible ) ; ControlGenerator controlGenerator = new ControlGenerator ( runtimeQuestion ) ; ControlPropertyChangeWrapper controlPropertyChangeWrapper = dataType . accept ( controlGenerator ) ; Control control = controlPropertyChangeWrapper . getControl ( ) ; control . setVisible ( visible ) ; if ( condition != null ) { addChangeListeners ( runtimeQuestionsToShow , runtimeQuestion , condition , ( evt ) -> { ExpressionEvaluator expressionEvaluator = new ExpressionEvaluator ( runtimeQuestionsToShow ) ; BooleanValue value = ( ( BooleanValue ) ( condition . accept ( expressionEvaluator ) ) ) ; Boolean visible1 = value . getValue ( ) ; control . setVisible ( visible1 ) ; label . setVisible ( visible1 ) ; } ) ; } Expression computed = question . getComputed ( ) ; if ( computed != null ) { runtimeQuestion . addPropertyChangeListener ( controlPropertyChangeWrapper ) ; control . setDisable ( true ) ; addChangeListeners ( allRuntimeQuestions , runtimeQuestion , computed , ( evt ) -> { <START_BUG> ExpressionEvaluator expressionEvaluator = new ExpressionEvaluator ( runtimeQuestionsToShow ) ; <END_BUG> Value value = computed . accept ( expressionEvaluator ) ; runtimeQuestion . setValue ( value ) ; } ) ; } add ( control , 1 , y ) ; y ++ ; } } private void addChangeListeners ( final List < RuntimeQuestion > allRuntimeQuestions , final RuntimeQuestion runtimeQuestion , final Expression expression , final PropertyChangeListener listener ) { } }

Fix:
ExpressionEvaluator expressionEvaluator = new ExpressionEvaluator ( allRuntimeQuestions ) ;
Buggy code:
public class UMLTextParrser { public static void main ( String [ ] args ) throws IOException { System . out . println ( ( "digraph<seq2seq4repair_space>G<seq2seq4repair_space>{\n\tfontname<seq2seq4repair_space>=<seq2seq4repair_space>\"Bitstream<seq2seq4repair_space>Vera<seq2seq4repair_space>Sans\"\n\tfontsize<seq2seq4repair_space>=<seq2seq4repair_space>8<seq2seq4repair_space>\n\n\t" + ( "node<seq2seq4repair_space>[\n\t\t<seq2seq4repair_space>fontname<seq2seq4repair_space>=<seq2seq4repair_space>\"Bitstream<seq2seq4repair_space>Vera<seq2seq4repair_space>Sans\"<seq2seq4repair_space>\n\t\t<seq2seq4repair_space>fontsize<seq2seq4repair_space>=<seq2seq4repair_space>8<seq2seq4repair_space>\n\t\t<seq2seq4repair_space>shape<seq2seq4repair_space>=<seq2seq4repair_space>\"record\"<seq2seq4repair_space>\n\t]<seq2seq4repair_space>" + "\n\n\tedge<seq2seq4repair_space>[\n\t\t<seq2seq4repair_space>fontname<seq2seq4repair_space>=<seq2seq4repair_space>\"Bitstream<seq2seq4repair_space>Vera<seq2seq4repair_space>Sans\"\n\t\t<seq2seq4repair_space>fontsize<seq2seq4repair_space>=<seq2seq4repair_space>8<seq2seq4repair_space>\n\t]" ) ) ) ; for ( String className : args ) { ClassReader reader = new ClassReader ( className ) ; ClassVisitor declVisitor = new ClassDeclarationVisitor ( Opcodes . ASM5 ) ; reader . accept ( declVisitor , ClassReader . EXPAND_FRAMES ) ; ClassVisitor fieldVisitor = new ClassFieldVisitor ( Opcodes . ASM5 ) ; reader . accept ( fieldVisitor , ClassReader . EXPAND_FRAMES ) ; System . out . print ( "|" ) ; <START_BUG> ClassVisitor methodVisitor = new ClassMethodVisitor ( Opcodes . ASM5 , fieldVisitor ) ; <END_BUG> reader . accept ( methodVisitor , ClassReader . EXPAND_FRAMES ) ; System . out . println ( "}\"\n\t]" ) ; } System . out . print ( "\n\n\tedge<seq2seq4repair_space>[\n\t\tarrowhead<seq2seq4repair_space>=<seq2seq4repair_space>\"empty\"\n\t]\n\n" ) ; for ( String className : args ) { ClassReader reader = new ClassReader ( className ) ; ClassVisitor classExtVisitor = new ClassExtendsVisitor ( Opcodes . ASM5 ) ; reader . accept ( classExtVisitor , ClassReader . EXPAND_FRAMES ) ; } System . out . print ( "\n\n\tedge<seq2seq4repair_space>[\n\t\tstyle<seq2seq4repair_space>=<seq2seq4repair_space>\"dashed\"\n\t\tarrowhead<seq2seq4repair_space>=<seq2seq4repair_space>\"normal\"\n\t]\n\n" ) ; for ( String className : args ) { ClassReader reader = new ClassReader ( className ) ; ClassVisitor classImplVisitor = new ClassImplementsVisitor ( Opcodes . ASM5 ) ; reader . accept ( classImplVisitor , ClassReader . EXPAND_FRAMES ) ; } System . out . println ( "}" ) ; } }

Fix:
ClassVisitor methodVisitor = new ClassMethodVisitor ( Opcodes . ASM5 ) ;
Buggy code:
public final class RemotingSubsystemAdd extends AbstractSubsystemAdd < RemotingSubsystemElement > { private static final long serialVersionUID = - 3368184946165491737L ; private final String threadPoolName ; protected RemotingSubsystemAdd ( final String threadPoolName ) { } protected < P > void applyUpdate ( final UpdateContext updateContext , final UpdateResultHandler < ? super Void , P > resultHandler , final P param ) { final EndpointService endpointService = new EndpointService ( ) ; endpointService . setOptionMap ( EMPTY ) ; final Injector < Executor > executorInjector = endpointService . getExecutorInjector ( ) ; <START_BUG> updateContext . getBatchBuilder ( ) . addService ( ENDPOINT , endpointService ) . addDependency ( ThreadsServices . executorName ( threadPoolName ) , new org . jboss . msc . inject . CastingInjector < Executor > ( executorInjector , Executor . class ) ) . setInitialMode ( ACTIVE ) . install ( ) ; <END_BUG> } protected RemotingSubsystemElement createSubsystemElement ( ) { } }

Fix:
updateContext . getServiceTarget ( ) . addService ( ENDPOINT , endpointService ) . addDependency ( ThreadsServices . executorName ( threadPoolName ) , new org . jboss . msc . inject . CastingInjector < Executor > ( executorInjector , Executor . class ) ) . setInitialMode ( ACTIVE ) . install ( ) ;
Buggy code:
public class ZSSPlayerSongs { private final EntityPlayer player ; private final Set < AbstractZeldaSong > knownSongs = new HashSet < AbstractZeldaSong > ( ) ; private final Map < Integer , WarpPoint > warpPoints = new HashMap < Integer , WarpPoint > ( ) ; @ SideOnly ( Side . CLIENT ) public AbstractZeldaSong songToLearn ; private final List < SongNote > scarecrowNotes = new ArrayList < SongNote > ( ) ; private long scarecrowTime ; private long nextSongHealTime ; private UUID horseUUID = null ; private int horseId = - 1 ; private int horseChunkX ; private int horseChunkZ ; private final Set < String > curedNpcs = new HashSet < String > ( ) ; public ZSSPlayerSongs ( EntityPlayer player ) { } public static ZSSPlayerSongs get ( EntityPlayer player ) { } public boolean isSongKnown ( AbstractZeldaSong song ) { } public boolean learnSong ( AbstractZeldaSong song , List < SongNote > notes ) { } public boolean removeSong ( AbstractZeldaSong song ) { } public void resetKnownSongs ( ) { } public AbstractZeldaSong getKnownSongFromNotes ( List < SongNote > notesPlayed ) { } public void onActivatedWarpStone ( int x , int y , int z , int meta ) { } public WarpPoint getWarpPoint ( AbstractZeldaSong song ) { } public boolean canOpenScarecrowGui ( boolean addChat ) { } public boolean canHealFromSong ( ) { } public void setNextHealTime ( ) { } public List < SongNote > getScarecrowNotes ( ) { } public EntityHorse getLastHorseRidden ( ) { Entity entity = ( ( horseId ) < 0 ) ? null : player . worldObj . getEntityByID ( horseId ) ; if ( ( entity == null ) && ( ( horseUUID ) != null ) ) { entity = getHorseByUUID ( ) ; } if ( entity == null ) { entity = getHorseFromChunk ( horseChunkX , horseChunkZ ) ; int n = 1 ; for ( int i = - n ; ( entity == null ) && ( i <= n ) ; ++ i ) { for ( int k = - n ; ( entity == null ) && ( k <= n ) ; ++ k ) { <START_BUG> if ( ( i != 0 ) && ( k != 0 ) ) { <END_BUG> entity = getHorseFromChunk ( ( ( horseChunkX ) + i ) , ( ( horseChunkZ ) + k ) ) ; } } } } if ( ( entity instanceof EntityHorse ) && ( entity . isEntityAlive ( ) ) ) { return ( ( EntityHorse ) ( entity ) ) ; } return null ; } private Entity getHorseByUUID ( ) { } private Entity getHorseFromChunk ( int chunkX , int chunkZ ) { } public void setHorseRidden ( EntityHorse horse ) { } private void setHorseCoordinates ( EntityHorse horse ) { } public boolean hasCuredNpc ( String name ) { } public boolean onCuredNpc ( String name ) { } public void saveNBTData ( NBTTagCompound compound ) { } public void loadNBTData ( NBTTagCompound compound ) { } }

Fix:
if ( ( i != 0 ) || ( k != 0 ) ) {
Buggy code:
public class MethodReference extends SpelNodeImpl { private final String name ; private final boolean nullSafe ; private volatile MethodReference . CachedMethodExecutor cachedExecutor ; public MethodReference ( boolean nullSafe , String methodName , int pos , SpelNodeImpl ... arguments ) { } public final String getName ( ) { } @ Override protected ValueRef getValueRef ( ExpressionState state ) throws EvaluationException { } @ Override public TypedValue getValueInternal ( ExpressionState state ) throws EvaluationException { } private TypedValue getValueInternal ( EvaluationContext evaluationContext , Object value , TypeDescriptor targetType , Object [ ] arguments ) { } private void throwIfNotNullSafe ( List < TypeDescriptor > argumentTypes ) { } private Object [ ] getArguments ( ExpressionState state ) { } private List < TypeDescriptor > getArgumentTypes ( Object ... arguments ) { } private MethodExecutor getCachedExecutor ( EvaluationContext evaluationContext , Object value , TypeDescriptor target , List < TypeDescriptor > argumentTypes ) { } private MethodExecutor findAccessorForMethod ( String name , List < TypeDescriptor > argumentTypes , Object targetObject , EvaluationContext evaluationContext ) throws SpelEvaluationException { } private void throwSimpleExceptionIfPossible ( Object value , AccessException ae ) { } private void updateExitTypeDescriptor ( ) { MethodReference . CachedMethodExecutor executorToCheck = this . cachedExecutor ; <START_BUG> if ( ( executorToCheck . get ( ) ) instanceof ReflectiveMethodExecutor ) { <END_BUG> Method method = ( ( ReflectiveMethodExecutor ) ( executorToCheck . get ( ) ) ) . getMethod ( ) ; this . exitTypeDescriptor = CodeFlow . toDescriptor ( method . getReturnType ( ) ) ; } } @ Override public String toStringAST ( ) { } @ Override public boolean isCompilable ( ) { } @ Override public void generateCode ( MethodVisitor mv , CodeFlow codeflow ) { } private class MethodValueRef implements ValueRef { private final EvaluationContext evaluationContext ; private final Object value ; private final TypeDescriptor targetType ; private final Object [ ] arguments ; public MethodValueRef ( ExpressionState state , Object [ ] arguments ) { } @ Override public TypedValue getValue ( ) { } @ Override public void setValue ( Object newValue ) { } @ Override public boolean isWritable ( ) { } } private static class CachedMethodExecutor { private final MethodExecutor methodExecutor ; private final Class < ? > staticClass ; private final TypeDescriptor target ; private final List < TypeDescriptor > argumentTypes ; public CachedMethodExecutor ( MethodExecutor methodExecutor , Class < ? > staticClass , TypeDescriptor target , List < TypeDescriptor > argumentTypes ) { } public boolean isSuitable ( Object value , TypeDescriptor target , List < TypeDescriptor > argumentTypes ) { } public MethodExecutor get ( ) { } } }

Fix:
if ( ( executorToCheck != null ) && ( ( executorToCheck . get ( ) ) instanceof ReflectiveMethodExecutor ) ) {
Buggy code:
public class MonitorAccumModel implements Serializable , Clearable { private HashMap MAP ; private MonitorModel CURRENT ; private List listeners ; private int DEFAULT_BUFFER = 800 ; public MonitorAccumModel ( ) { } public int getBufferSize ( ) { } public void setBufferSize ( int buffer ) { } public MonitorModel getLastSample ( ) { } public void addSample ( MonitorModel model ) { } private List updateArray ( MonitorModel model , List list ) { } public List getAllSamples ( String url ) { } public MonitorModel getSample ( String url ) { } public void addSample ( SampleResult sample ) { URL surl = null ; if ( sample instanceof HTTPSampleResult ) { surl = ( ( HTTPSampleResult ) ( sample ) ) . getURL ( ) ; if ( ( sample . isResponseCodeOK ( ) ) && ( ( ( HTTPSampleResult ) ( sample ) ) . isMonitor ( ) ) ) { ObjectFactory of = ObjectFactory . getInstance ( ) ; Status st = of . parseBytes ( sample . getResponseData ( ) ) ; <START_BUG> if ( st != null ) { <END_BUG> MonitorStats stat = new MonitorStats ( Stats . calculateStatus ( st ) , Stats . calculateLoad ( st ) , 0 , Stats . calculateMemoryLoad ( st ) , Stats . calculateThreadLoad ( st ) , surl . getHost ( ) , String . valueOf ( surl . getPort ( ) ) , surl . getProtocol ( ) , System . currentTimeMillis ( ) ) ; MonitorModel mo = new MonitorModel ( stat ) ; this . addSample ( mo ) ; notifyListeners ( mo ) ; } else { noResponse ( surl ) ; } } else if ( ( ( HTTPSampleResult ) ( sample ) ) . isMonitor ( ) ) { noResponse ( surl ) ; } } } public void noResponse ( URL url ) { } public MonitorModel createNewMonitorModel ( URL url ) { } public void clearData ( ) { } public void notifyListeners ( MonitorModel model ) { } public void addListener ( MonitorListener listener ) { } }

Fix:
if ( ( st != null ) && ( surl != null ) ) {
Buggy code:
public class SwitchStatement extends Statement { public Expression testExpression ; public Statement [ ] statements ; public BlockScope scope ; public int explicitDeclarations ; public Label breakLabel ; public Case [ ] cases ; public DefaultCase defaultCase ; public int caseCount = 0 ; int preSwitchInitStateIndex = - 1 ; int mergedInitStateIndex = - 1 ; public SwitchStatement ( ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public void resetStateForCodeGeneration ( ) { } public void resolve ( BlockScope upperScope ) { TypeBinding testType = testExpression . resolveType ( upperScope ) ; if ( testType == null ) return ; testExpression . implicitWidening ( testType , testType ) ; if ( ! ( testExpression . isConstantValueOfTypeAssignableToType ( testType , IntBinding ) ) ) { <START_BUG> if ( ! ( upperScope . areTypesCompatible ( testType , IntBinding ) ) ) { <END_BUG> upperScope . problemReporter ( ) . incorrectSwitchType ( testExpression , testType ) ; return ; } } if ( ( statements ) != null ) { scope = ( ( explicitDeclarations ) == 0 ) ? upperScope : new BlockScope ( upperScope ) ; int length ; cases = new Case [ length = statements . length ] ; int [ ] casesValues = new int [ length ] ; int counter = 0 ; for ( int i = 0 ; i < length ; i ++ ) { Constant cst ; if ( ( cst = statements [ i ] . resolveCase ( scope , testType , this ) ) != null ) { if ( cst != ( NotAConstant ) ) { int key = cst . intValue ( ) ; for ( int j = 0 ; j < counter ; j ++ ) { if ( ( casesValues [ j ] ) == key ) { scope . problemReporter ( ) . duplicateCase ( ( ( Case ) ( statements [ i ] ) ) , cst ) ; } } casesValues [ ( counter ++ ) ] = key ; } } } } } public String toString ( int tab ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } public void branchChainTo ( Label label ) { } }

Fix:
if ( ! ( Scope . areTypesCompatible ( testType , IntBinding ) ) ) {
Buggy code:
public class Manager { BestellingDAO bestelling ; public Manager ( ) { } public void sendOrder ( Order o ) { <START_BUG> send . addSimpleOrder ( o ) ; <END_BUG> } }

Fix:
bestelling . addSimpleOrder ( o ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class ManagedBeanTestCase { @ ArquillianResource private InitialContext context ; @ Deployment public static EnterpriseArchive createDeployment ( ) throws Exception { } @ Test public void testManagedBean ( ) throws Exception { BeanWithSimpleInjected bean = ( ( BeanWithSimpleInjected ) ( context . lookup ( ( "java:module//" + ( BeanWithSimpleInjected . class . getSimpleName ( ) ) ) ) ) ) ; Assert . assertNotNull ( bean . getSimple ( ) ) ; Assert . assertNotNull ( bean . getSimple2 ( ) ) ; String s = bean . echo ( "Hello" ) ; <START_BUG> Assert . assertEquals ( "#InterceptorFromParent##InterceptorBean##OtherInterceptorBean##BeanParent##BeanWithSimpleInjected#Hello#CDIBean#CDIBean" , s ) ; <END_BUG> Assert . assertEquals ( 100 , bean . getNumber ( ) ) ; Assert . assertEquals ( "value" , bean . getValue ( ) ) ; Assert . assertEquals ( "value" , bean . getValue2 ( ) ) ; } }

Fix:
Assert . assertEquals ( "#InterceptorFromParent##InterceptorBean##OtherInterceptorBean##CDIInterceptor##BeanParent##BeanWithSimpleInjected#Hello#CDIBean#CDIBean" , s ) ;
Buggy code:
public class SSDKWebViewClient extends WebViewClient { private ShareSDKUtils shareSDK ; private WebViewClient wbClient ; public SSDKWebViewClient ( ShareSDKUtils shareSDK ) { } public void setWebViewClient ( WebViewClient wbClient ) { } public boolean shouldOverrideUrlLoading ( WebView view , String url ) { if ( url . startsWith ( "sharesdk:////init" ) ) { shareSDK . onInit ( ) ; return true ; } <START_BUG> return ( wbClient ) == null ? wbClient . shouldOverrideUrlLoading ( view , url ) : false ; <END_BUG> } public void onPageStarted ( WebView view , String url , Bitmap favicon ) { } public void onPageFinished ( WebView view , String url ) { } public void onLoadResource ( WebView view , String url ) { } public void onTooManyRedirects ( WebView view , Message cancelMsg , Message continueMsg ) { } public static final int ERROR_UNKNOWN = - 1 ; public static final int ERROR_HOST_LOOKUP = - 2 ; public static final int ERROR_UNSUPPORTED_AUTH_SCHEME = - 3 ; public static final int ERROR_AUTHENTICATION = - 4 ; public static final int ERROR_PROXY_AUTHENTICATION = - 5 ; public static final int ERROR_CONNECT = - 6 ; public static final int ERROR_IO = - 7 ; public static final int ERROR_TIMEOUT = - 8 ; public static final int ERROR_REDIRECT_LOOP = - 9 ; public static final int ERROR_UNSUPPORTED_SCHEME = - 10 ; public static final int ERROR_FAILED_SSL_HANDSHAKE = - 11 ; public static final int ERROR_BAD_URL = - 12 ; public static final int ERROR_FILE = - 13 ; public static final int ERROR_FILE_NOT_FOUND = - 14 ; public static final int ERROR_TOO_MANY_REQUESTS = - 15 ; public void onReceivedError ( WebView view , int errorCode , String description , String failingUrl ) { } public void onFormResubmission ( WebView view , Message dontResend , Message resend ) { } public void doUpdateVisitedHistory ( WebView view , String url , boolean isReload ) { } public void onReceivedSslError ( WebView view , SslErrorHandler handler , SslError error ) { } public void onReceivedHttpAuthRequest ( WebView view , HttpAuthHandler handler , String host , String realm ) { } public boolean shouldOverrideKeyEvent ( WebView view , KeyEvent event ) { } public void onUnhandledKeyEvent ( WebView view , KeyEvent event ) { } public void onScaleChanged ( WebView view , float oldScale , float newScale ) { } }

Fix:
return ( wbClient ) != null ? wbClient . shouldOverrideUrlLoading ( view , url ) : false ;
Buggy code:
public class TestSearchForDuplicates extends LuceneTestCase { static final String PRIORITY_FIELD = "priority" ; static final String ID_FIELD = "id" ; static final String HIGH_PRIORITY = "high" ; static final String MED_PRIORITY = "medium" ; static final String LOW_PRIORITY = "low" ; public void testRun ( ) throws Exception { } private void doTest ( Random random , PrintWriter out , boolean useCompoundFiles , int MAX_DOCS ) throws Exception { Directory directory = newDirectory ( ) ; Analyzer analyzer = new MockAnalyzer ( random ) ; IndexWriterConfig conf = newIndexWriterConfig ( TEST_VERSION_CURRENT , analyzer ) ; final MergePolicy mp = conf . getMergePolicy ( ) ; mp . setNoCFSRatio ( ( useCompoundFiles ? 1.0 : 0.0 ) ) ; IndexWriter writer = new IndexWriter ( directory , conf ) ; if ( VERBOSE ) { System . out . println ( ( "TEST:<seq2seq4repair_space>now<seq2seq4repair_space>build<seq2seq4repair_space>index<seq2seq4repair_space>MAX_DOCS=" + MAX_DOCS ) ) ; } for ( int j = 0 ; j < MAX_DOCS ; j ++ ) { Document d = new Document ( ) ; d . add ( newTextField ( TestSearchForDuplicates . PRIORITY_FIELD , TestSearchForDuplicates . HIGH_PRIORITY , YES ) ) ; d . add ( new IntField ( TestSearchForDuplicates . ID_FIELD , j , Store . YES ) ) ; writer . addDocument ( d ) ; } <START_BUG> writer . close ( ) ; <END_BUG> IndexReader reader = DirectoryReader . open ( directory ) ; IndexSearcher searcher = newSearcher ( reader ) ; Query query = new TermQuery ( new Term ( TestSearchForDuplicates . PRIORITY_FIELD , TestSearchForDuplicates . HIGH_PRIORITY ) ) ; out . println ( ( "Query:<seq2seq4repair_space>" + ( query . toString ( TestSearchForDuplicates . PRIORITY_FIELD ) ) ) ) ; if ( VERBOSE ) { System . out . println ( ( "TEST:<seq2seq4repair_space>search<seq2seq4repair_space>query=" + query ) ) ; } final Sort sort = new Sort ( SortField . FIELD_SCORE , new SortField ( TestSearchForDuplicates . ID_FIELD , Type . INT ) ) ; ScoreDoc [ ] hits = searcher . search ( query , null , MAX_DOCS , sort ) . scoreDocs ; printHits ( out , hits , searcher ) ; checkHits ( hits , MAX_DOCS , searcher ) ; searcher = newSearcher ( reader ) ; hits = null ; BooleanQuery booleanQuery = new BooleanQuery ( ) ; booleanQuery . add ( new TermQuery ( new Term ( TestSearchForDuplicates . PRIORITY_FIELD , TestSearchForDuplicates . HIGH_PRIORITY ) ) , SHOULD ) ; booleanQuery . add ( new TermQuery ( new Term ( TestSearchForDuplicates . PRIORITY_FIELD , TestSearchForDuplicates . MED_PRIORITY ) ) , SHOULD ) ; out . println ( ( "Query:<seq2seq4repair_space>" + ( booleanQuery . toString ( TestSearchForDuplicates . PRIORITY_FIELD ) ) ) ) ; hits = searcher . search ( booleanQuery , null , MAX_DOCS , sort ) . scoreDocs ; printHits ( out , hits , searcher ) ; checkHits ( hits , MAX_DOCS , searcher ) ; reader . close ( ) ; directory . close ( ) ; } private void printHits ( PrintWriter out , ScoreDoc [ ] hits , IndexSearcher searcher ) throws IOException { } private void checkHits ( ScoreDoc [ ] hits , int expectedCount , IndexSearcher searcher ) throws IOException { } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public final class TimeTest extends TestCase { public void test ( ) throws ParseException { <START_BUG> final Time start = Time . now ( ) ; <END_BUG> final Time birthday = Time . parseDate ( "1966.06.01" ) ; Assert . assertEquals ( 1966 , birthday . getYear ( ) ) ; Assert . assertEquals ( Calendar . JUNE , birthday . getMonth ( ) ) ; Assert . assertEquals ( 1 , birthday . getDayOfMonth ( ) ) ; final String y2k = "2000.01.01-12.00am" ; Assert . assertEquals ( y2k , Time . valueOf ( y2k ) . toString ( ) ) ; } }

Fix:
Time . now ( ) ;
Buggy code:
public class NavigatorLabel extends Label { private static final long serialVersionUID = 1L ; public NavigatorLabel ( final String id , final IPageableItems pageable ) { } private static class LabelModelObject implements IClusterable { private static final long serialVersionUID = 1L ; private final IPageableItems pageable ; public LabelModelObject ( final IPageableItems table ) { } public int getOf ( ) { } public int getFrom ( ) { if ( ( getOf ( ) ) == 0 ) { return 0 ; } <START_BUG> return ( pageable . getCurrentPage ( ) ) * ( pageable . getItemsPerPage ( ) ) ; <END_BUG> } public int getTo ( ) { } } }

Fix:
return ( ( pageable . getCurrentPage ( ) ) * ( pageable . getItemsPerPage ( ) ) ) + 1 ;