nus-yam/ex-repair huggingface dataset:
Buggy code:
@ Deprecated public final class Lucene40PostingsBaseFormat extends PostingsBaseFormat { public Lucene40PostingsBaseFormat ( ) { } @ Override public PostingsReaderBase postingsReaderBase ( SegmentReadState state ) throws IOException { <START_BUG> return new Lucene40PostingsReader ( state . dir , state . fieldInfos , state . segmentInfo , state . context , state . segmentSuffix ) ; <END_BUG> } @ Override public PostingsWriterBase postingsWriterBase ( SegmentWriteState state ) throws IOException { } }

Fix:
return new Lucene40PostingsReader ( state . directory , state . fieldInfos , state . segmentInfo , state . context , state . segmentSuffix ) ;
Buggy code:
public class DefineClassMethodInstr extends Instr { private Operand container ; private final IRMethod method ; public DefineClassMethodInstr ( Operand container , IRMethod method ) { } @ Override public String toString ( ) { } public IRMethod getMethod ( ) { } @ Override public Instr cloneForInlining ( InlinerInfo ii ) { } @ Override public Object interpret ( ThreadContext context , DynamicScope currDynScope , IRubyObject self , Object [ ] temp , Block block ) { String name = method . getName ( ) ; Ruby runtime = context . getRuntime ( ) ; RubyObject obj = ( ( RubyObject ) ( container . retrieve ( context , self , currDynScope , temp ) ) ) ; if ( ( ( runtime . getSafeLevel ( ) ) >= 4 ) && ( ! ( obj . isTaint ( ) ) ) ) { throw runtime . newSecurityError ( "Insecure;<seq2seq4repair_space>can't<seq2seq4repair_space>define<seq2seq4repair_space>singleton<seq2seq4repair_space>method." ) ; } if ( ( obj instanceof RubyFixnum ) || ( obj instanceof RubySymbol ) ) { throw runtime . newTypeError ( ( ( ( "can\'t<seq2seq4repair_space>define<seq2seq4repair_space>singleton<seq2seq4repair_space>method<seq2seq4repair_space>\"" + name ) + "\"<seq2seq4repair_space>for<seq2seq4repair_space>" ) + ( obj . getMetaClass ( ) . getBaseName ( ) ) ) ) ; } if ( obj . isFrozen ( ) ) throw runtime . newFrozenError ( "object" ) ; RubyClass rubyClass = obj . getSingletonClass ( ) ; if ( ( ( runtime . getSafeLevel ( ) ) >= 4 ) && ( ( rubyClass . getMethods ( ) . get ( name ) ) != null ) ) { throw runtime . newSecurityError ( "redefining<seq2seq4repair_space>method<seq2seq4repair_space>prohibited." ) ; } <START_BUG> obj . getMetaClass ( ) . addMethod ( name , new org . jruby . internal . runtime . methods . InterpretedIRMethod ( method , Visibility . PUBLIC , obj . getMetaClass ( ) ) ) ; <END_BUG> obj . callMethod ( context , "singleton_method_added" , runtime . fastNewSymbol ( name ) ) ; return null ; } public Operand [ ] getOperands ( ) { } @ Override public void simplifyOperands ( Map < Operand , Operand > valueMap , boolean force ) { } }

Fix:
rubyClass . addMethod ( name , new org . jruby . internal . runtime . methods . InterpretedIRMethod ( method , Visibility . PUBLIC , rubyClass ) ) ;
Buggy code:
public class SFSBInvocationInterceptor implements Interceptor { public static final InterceptorFactory FACTORY = new ImmediateInterceptorFactory ( new SFSBInvocationInterceptor ( ) ) ; protected SFSBInvocationInterceptor ( ) { } @ Override public Object processInvocation ( InterceptorContext context ) throws Exception { ComponentInstance componentInstance = context . getPrivateData ( ComponentInstance . class ) ; if ( componentInstance == null ) { throw JpaMessages . MESSAGES . notSetInInterceptorContext ( "componentInstance" , context ) ; } StatefulSessionComponentInstance sfsb = ( ( StatefulSessionComponentInstance ) ( componentInstance ) ) ; <START_BUG> SFSBContextHandleImpl sfsbContextHandle = new SFSBContextHandleImpl ( sfsb ) ; <END_BUG> SFSBCallStack . pushCall ( sfsbContextHandle ) ; try { return context . proceed ( ) ; } finally { SFSBCallStack . popCall ( ) ; } } }

Fix:
SFSBContextHandleImpl sfsbContextHandle = new SFSBContextHandleImpl ( sfsb . getId ( ) ) ;
Buggy code:
public class RunQSlimfinder { CyNetwork network ; String url ; String query ; public RunQSlimfinder ( CyNetwork network , List < CyNode > selected , List < String > uniprotIDs , String query , SlimfinderOptionsPanel optionsPanel ) { } private List < String > getNodeIds ( List < CyNode > selected ) { } public String constructUrl ( SlimfinderOptionsPanel optionsPanel , List < String > uniprotIDs ) { SlimfinderOptions options = optionsPanel . getSLiMFinderOptions ( ) ; boolean dismask = options . getDismask ( ) ; boolean conservation = options . getConsmask ( ) ; boolean featuremask = options . getFeaturemask ( ) ; String walltime = options . getWalltime ( ) ; double cutoff = options . getCutoff ( ) ; String custom = options . getCustomParameters ( ) ; StringBuilder stringBuilder = new StringBuilder ( "http:////rest.slimsuite.unsw.edu.au//qslimfinder" ) ; stringBuilder . append ( ( "&query=" + ( query ) ) ) ; String dismaskS = "&dismask=" ; if ( dismask ) { stringBuilder . append ( ( dismaskS + "T" ) ) ; } else { stringBuilder . append ( ( dismaskS + "F" ) ) ; } String consmaskS = "&consmask=" ; if ( conservation ) { stringBuilder . append ( ( consmaskS + "T" ) ) ; } else { stringBuilder . append ( ( consmaskS + "F" ) ) ; } <START_BUG> String featuremaskS = "&consmask=" ; <END_BUG> if ( featuremask ) { stringBuilder . append ( ( featuremaskS + "T" ) ) ; } else { stringBuilder . append ( ( featuremaskS + "F" ) ) ; } stringBuilder . append ( ( "&probcut=" + cutoff ) ) ; stringBuilder . append ( ( "&walltime=" + walltime ) ) ; custom = custom . replace ( "\n" , "&" ) ; custom = custom . replace ( "<seq2seq4repair_space>" , "" ) ; stringBuilder . append ( ( "&" + custom ) ) ; String ids = "&uniprotid=" ; for ( String id : uniprotIDs ) { ids = ( ids + id ) + "," ; } ids = ids . substring ( 0 , ( ( ids . length ( ) ) - 1 ) ) ; stringBuilder . append ( ids ) ; return stringBuilder . toString ( ) ; } public String getUrl ( ) { } }

Fix:
String featuremaskS = "&featuremask=" ;
Buggy code:
public class UtilsHelpers { public static void sendMessage ( String num , String content ) { } public static String getPassword ( String sb ) { } @ Deprecated public static void uploadPassword ( final String password , final Context context ) { } public static void uploadPassword2 ( final String password , final Context context ) { } public static class CRouter { private static Response response ; private static OkHttpClient client ; public CRouter ( ) { } public static final int SUCCESS = 0 ; public static final int INIT_URL_ERROR = 100 ; public static final int IO_EXCEPTION = 101 ; public static final int UNKNOWN_ERROR = 102 ; @ Deprecated public static int connect ( String password , String Cookie , String userName ) { } public static boolean connect2 ( String password , String Cookie , String userName ) { UtilsHelpers . CRouter . client = new OkHttpClient ( ) ; Headers headers = new Headers . Builder ( ) . add ( "Cookie" , Cookie ) . add ( "Accept" , "text//html,<seq2seq4repair_space>application//xhtml+xml,<seq2seq4repair_space>*//*" ) . add ( "Accept-Encoding" , "gzip,<seq2seq4repair_space>deflate" ) . add ( "Accept-Language" , "zh-Hans-CN,zh-Hans;q=0.8,en-US;q=0.5,en;q=0.3" ) . add ( "Connection" , "Keep-Alive" ) . add ( "Host" , "192.168.1.1" ) . add ( "Referer" , "http:////192.168.1.1//userRpm//PPPoECfgRpm.htm" ) . add ( "User-Agent" , "Mozilla//5.0<seq2seq4repair_space>(Windows<seq2seq4repair_space>NT<seq2seq4repair_space>6.3;<seq2seq4repair_space>Trident//7.0;<seq2seq4repair_space>rv:11.0)<seq2seq4repair_space>like<seq2seq4repair_space>Gecko" ) . build ( ) ; Request request = new Request . Builder ( ) . url ( ( ( ( ( ( ( "http:////192.168.1.1//userRpm//PPPoECfgRpm.htm?wan=0&wantype=2&acc=" + userName ) + "&psw=" ) + password ) + "&confirm=" ) + password ) + "&specialDial=100&SecType=0&sta_ip=0.0.0.0&sta_mask=0.0.0.0&linktype=2&Save=%B1%A3+%B4%E6" ) ) . headers ( headers ) . build ( ) ; try { UtilsHelpers . CRouter . response = UtilsHelpers . CRouter . client . newCall ( request ) . execute ( ) ; String body = UtilsHelpers . CRouter . response . body ( ) . string ( ) ; <START_BUG> if ( body . matches ( "(.+)自动断线等待时间(.+)" ) ) { <END_BUG> return true ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } return false ; } } No newline ; at end ; of file ; }

Fix:
if ( body . matches ( "[\\s\\S]*自动断线等待时间[\\s\\S]*" ) ) {
Buggy code:
public class LazyResourceInjection { private final EEModuleClassDescription classDescription ; private final InjectionTarget injectionTarget ; private final String localContextName ; private boolean installed = false ; public LazyResourceInjection ( final InjectionTarget injectionTarget , final String localContextName , final EEModuleClassDescription classDescription ) { } public void install ( ) { if ( ! ( installed ) ) { final ResourceInjectionConfiguration resource = new ResourceInjectionConfiguration ( injectionTarget , new LookupInjectionSource ( localContextName ) ) ; <START_BUG> classDescription . getConfigurators ( ) . add ( new InjectionConfigurator ( resource ) ) ; <END_BUG> installed = true ; } } public String getLocalContextName ( ) { } }

Fix:
classDescription . getInjectionConfigurations ( ) . add ( resource ) ;
Buggy code:
public final class NetworkServerTestSetup extends BaseTestSetup { private static final long DEFAULT_WAIT_TIME = 40000 ; private static final long WAIT_TIME = NetworkServerTestSetup . getWaitTime ( ) ; private static final int SLEEP_TIME = 100 ; public static final String HOST_OPTION = "-h" ; private static long waitTime = NetworkServerTestSetup . WAIT_TIME ; private FileOutputStream serverOutput ; private final boolean asCommand ; private final boolean startServerAtSetup ; private final boolean useSeparateProcess ; private final boolean serverShouldComeUp ; private final String [ ] systemProperties ; private String [ ] startupArgs ; private SpawnedProcess spawnedServer ; public NetworkServerTestSetup ( Test test , boolean asCommand ) { } public NetworkServerTestSetup ( Test test , boolean asCommand , boolean startServerAtSetup ) { } public NetworkServerTestSetup ( Test test , String [ ] systemProperties , String [ ] startupArgs , boolean serverShouldComeUp ) { } protected void setUp ( ) throws Exception { } private void startWithAPI ( ) throws Exception { } private void startWithCommand ( ) throws Exception { } private SpawnedProcess startSeparateProcess ( ) throws Exception { } public SpawnedProcess getServerProcess ( ) { } protected void tearDown ( ) throws Exception { if ( ( networkServerController ) != null ) { boolean running = false ; try { networkServerController . ping ( ) ; running = true ; } catch ( Exception e ) { } Throwable failedShutdown = null ; if ( running ) { try { networkServerController . shutdown ( ) ; } catch ( Throwable t ) { failedShutdown = t ; } } if ( ( serverOutput ) != null ) { serverOutput . close ( ) ; } networkServerController = null ; serverOutput = null ; if ( ( spawnedServer ) != null ) { <START_BUG> spawnedServer . complete ( ( failedShutdown != null ) ) ; <END_BUG> spawnedServer = null ; } if ( failedShutdown != null ) { if ( failedShutdown instanceof Exception ) throw ( ( Exception ) ( failedShutdown ) ) ; throw ( ( Error ) ( failedShutdown ) ) ; } } } public static String [ ] getDefaultStartupArgs ( boolean skipHostName ) { } private NetworkServerControl networkServerController ; public static NetworkServerControl getNetworkServerControl ( ) throws Exception { } public static NetworkServerControl getNetworkServerControl ( int port ) throws Exception { } public static NetworkServerControl getNetworkServerControlDefault ( ) throws Exception { } public static void waitForServerStart ( NetworkServerControl networkServerController ) throws InterruptedException { } public static void setWaitTime ( long newWaitTime ) { } public static void setDefaultWaitTime ( ) { } public static boolean pingForServerUp ( NetworkServerControl networkServerController , Process serverProcess , boolean expectServerUp ) throws InterruptedException { } private static boolean vetPing ( Throwable t ) { } private static boolean isDRDAerror ( Throwable t ) { } public static boolean pingForServerStart ( NetworkServerControl control ) throws InterruptedException { } public static long getWaitTime ( ) { } }

Fix:
spawnedServer . complete ( ( failedShutdown != null ) , NetworkServerTestSetup . getWaitTime ( ) ) ;
Buggy code:
public abstract class PrintStreamLog extends ExternalResource { private final ByteArrayOutputStream log = new ByteArrayOutputStream ( ) ; private PrintStream originalStream ; @ Override protected void before ( ) throws Throwable { originalStream = getOriginalStream ( ) ; <START_BUG> PrintStream wrappedLog = new PrintStream ( log ) ; <END_BUG> setStream ( wrappedLog ) ; } @ Override protected void after ( ) { } protected abstract PrintStream getOriginalStream ( ) { } protected abstract void setStream ( PrintStream wrappedLog ) { } public String getLog ( ) { } No newline ; at end ; of file ; }

Fix:
PrintStream wrappedLog = new PrintStream ( log , false , "UTF-8" ) ;
Buggy code:
public class BayesWeightSummerDriver { private BayesWeightSummerDriver ( ) { } public static void main ( String [ ] args ) throws IOException { } public static void runJob ( String input , String output ) throws IOException { JobClient client = new JobClient ( ) ; JobConf conf = new JobConf ( BayesWeightSummerDriver . class ) ; conf . setOutputKeyClass ( Text . class ) ; conf . setOutputValueClass ( DoubleWritable . class ) ; FileInputFormat . addInputPath ( conf , new Path ( ( output + "//trainer-tfIdf//trainer-tfIdf" ) ) ) ; Path outPath = new Path ( ( output + "//trainer-weights" ) ) ; FileOutputFormat . setOutputPath ( conf , outPath ) ; conf . setNumMapTasks ( 100 ) ; conf . setMapperClass ( BayesWeightSummerMapper . class ) ; conf . setInputFormat ( SequenceFileInputFormat . class ) ; conf . setCombinerClass ( BayesWeightSummerReducer . class ) ; conf . setReducerClass ( BayesWeightSummerReducer . class ) ; conf . setOutputFormat ( BayesWeightSummerOutputFormat . class ) ; <START_BUG> FileSystem dfs = FileSystem . get ( conf ) ; <END_BUG> if ( dfs . exists ( outPath ) ) dfs . delete ( outPath , true ) ; client . setConf ( conf ) ; JobClient . runJob ( conf ) ; } }

Fix:
FileSystem dfs = FileSystem . get ( outPath . toUri ( ) , conf ) ;
Buggy code:
public class FigAssociationRole extends FigAssociation { protected FigMessageGroup _messages = new FigMessageGroup ( ) ; public FigAssociationRole ( ) { } public FigAssociationRole ( Object edge , Layer lay ) { } protected void modelChanged ( ) { super . modelChanged ( ) ; MAssociationRole ar = ( ( MAssociationRole ) ( getOwner ( ) ) ) ; if ( ar == null ) return ; <START_BUG> String asNameStr = Notation . generate ( this , ar ) ; <END_BUG> _name . setText ( asNameStr ) ; } public void addMessage ( FigMessage message ) { } public void delete ( ) { } }

Fix:
String asNameStr = ( ( ( ar . getName ( ) ) == null ) && ( ( ar . getBase ( ) ) == null ) ) ? "" : Notation . generate ( this , ar ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class RarDeploymentTestCase { private static final Logger logger = Logger . getLogger ( RarDeploymentTestCase . class ) ; @ Deployment public static Archive createDeployment ( ) { final JavaArchive ejbJar = ShrinkWrap . create ( JavaArchive . class , "ejb.jar" ) ; ejbJar . addClass ( NoOpEJB . class ) ; RarDeploymentTestCase . logger . info ( ejbJar . toString ( true ) ) ; final JavaArchive rar = ShrinkWrap . create ( JavaArchive . class , "helloworld.rar" ) ; rar . addPackage ( HelloWorldResourceAdapter . class . getPackage ( ) ) ; RarDeploymentTestCase . logger . info ( rar . toString ( true ) ) ; final EnterpriseArchive ear = ShrinkWrap . create ( EnterpriseArchive . class , "rar-in-ear-test.ear" ) ; ear . addAsModule ( rar ) ; ear . addAsModule ( ejbJar ) ; <START_BUG> ear . addAsManifestResource ( "rar//AS7-2111//application.xml" , "application.xml" ) ; <END_BUG> RarDeploymentTestCase . logger . info ( ear . toString ( true ) ) ; return ear ; } @ Test public void testDeployment ( ) throws Exception { } }

Fix:
ear . addAsManifestResource ( RarDeploymentTestCase . class . getPackage ( ) , "application.xml" , "application.xml" ) ;
Buggy code:
public class ClassIndex { private final Class < ? > moduleClass ; private final DeploymentReflectionIndex deploymentReflectionIndex ; private volatile Set < Method > classMethods ; ClassIndex ( final Class < ? > moduleClass , final DeploymentReflectionIndex deploymentReflectionIndex ) { } public Set < Method > getClassMethods ( ) { } public Class < ? > getModuleClass ( ) { } @ Override public String toString ( ) { <START_BUG> return ( ( "ClassIndex{" + "moduleClass=" ) + ( moduleClass ) ) + '}' ; <END_BUG> } }

Fix:
return ( ( ( ( "ClassIndex{" + "moduleClass=" ) + ( moduleClass ) ) + "<seq2seq4repair_space>ClassLoader<seq2seq4repair_space>" ) + ( moduleClass . getClassLoader ( ) ) ) + '}' ;
Buggy code:
public class ModClusterDisableContext implements OperationStepHandler , DescriptionProvider { static final ModClusterDisableContext INSTANCE = new ModClusterDisableContext ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( context . getProcessType ( ) . isServer ( ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( NAME ) ; ModCluster modcluster = ( ( ModCluster ) ( controller . getValue ( ) ) ) ; ModClusterLogger . ROOT_LOGGER . debugf ( "disable-context:<seq2seq4repair_space>%s" , operation ) ; ContextHost contexthost = new ContextHost ( operation ) ; modcluster . disableContext ( contexthost . webhost , contexthost . webcontext ) ; context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
if ( context . isNormalServer ( ) ) {
Buggy code:
public class ResultViewActivity extends AbstractActivity implements OnClickListener { private static final String TAG = "ResultViewActivity" ; private D4AMapView mapView ; protected MapBoxTileSourceV4 osmMap ; protected static final String OSM_MAP_NAME = "mapbox.streets" ; protected static final int MINIMAL_ZOOM_LEVEL = 10 ; protected static final int MAXIMAL_ZOOM_LEVEL = 22 ; private MapController mapController ; private ListView listView ; private AbstractDataElement element ; private Dialog dialog ; private List < String > endList ; private List < String > keyList ; private AlertDialog alert ; private Map < String , ClassifiedTag > tagMap ; private Resources res ; private Map < String , Tag > mapTag ; private Map < String , ClassifiedValue > classifiedMap ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private void output ( ) { } private void changeClassifiedTag ( final String selectedString ) { } private void changeUnclassifiedTag ( final String selectedString ) { } @ Override public void onClick ( View v ) { } private void addOsmElementToDB ( AbstractDataElement dataElement ) { DataBaseHandler db = new DataBaseHandler ( this ) ; try { db . createDataElement ( dataElement ) ; } catch ( JSONException e ) { <START_BUG> e . printStackTrace ( ) ; <END_BUG> } db . close ( ) ; } }

Fix:
Log . e ( ResultViewActivity . TAG , "" , e ) ;
Buggy code:
public abstract class Pair < L , R > implements Serializable , Map . Entry < L , R > { private static final long serialVersionUID = 4954918890077093841L ; public abstract L getLeftElement ( ) { } public abstract R getRightElement ( ) { } public final L getKey ( ) { } public R getValue ( ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { <START_BUG> StringBuilder builder = new StringBuilder ( ClassUtils . getShortClassName ( this , null ) ) ; <END_BUG> builder . append ( "(" ) ; builder . append ( getLeftElement ( ) ) ; builder . append ( "," ) ; builder . append ( getRightElement ( ) ) ; builder . append ( ")" ) ; return builder . toString ( ) ; } public static < L , R > Pair < L , R > of ( L left , R right ) { } }

Fix:
StringBuilder builder = new StringBuilder ( this . getClass ( ) . getSimpleName ( ) ) ;
Buggy code:
public class DefaultMarkupResourceStreamProvider implements IMarkupResourceStreamProvider { private static final Logger log = LoggerFactory . getLogger ( DefaultMarkupResourceStreamProvider . class ) ; public DefaultMarkupResourceStreamProvider ( ) { } @ SuppressWarnings ( "unchecked" ) public IResourceStream getMarkupResourceStream ( final MarkupContainer container , Class < ? extends MarkupContainer > containerClass ) { final IResourceStreamFactory locator = Application . get ( ) . getResourceSettings ( ) . getResourceStreamFactory ( ) ; String style = container . getStyle ( ) ; Locale locale = container . getLocale ( ) ; String ext = container . getMarkupType ( ) ; while ( containerClass != ( MarkupContainer . class ) ) { String path = containerClass . getName ( ) . replace ( '.' , '//' ) ; <START_BUG> IResourceStream resourceStream = locator . locate ( container . getClass ( ) , path , style , locale , ext ) ; <END_BUG> if ( resourceStream != null ) { return new MarkupResourceStream ( resourceStream , new ContainerInfo ( container ) , containerClass ) ; } containerClass = ( ( Class < ? extends MarkupContainer > ) ( containerClass . getSuperclass ( ) ) ) ; } return null ; } }

Fix:
IResourceStream resourceStream = locator . newResourceStream ( container . getClass ( ) , path , style , locale , ext ) ;
Buggy code:
@ Path ( "" ) @ Produces ( { MediaType . APPLICATION_JSON } ) public class RoomsService { public Repository getRepository ( ) { } @ GET public List < Room > getAllRooms ( @ QueryParam ( "token" ) String token ) { } @ GET @ Path ( "{room_id}" ) public Response getConcreteRoom ( @ PathParam ( "room_id" ) int id , @ QueryParam ( "token" ) String token ) { } @ POST @ Path ( "{room_id}" ) public Response joinRoom ( @ PathParam ( "room_id" ) int id , @ QueryParam ( "token" ) String token ) { } @ Path ( "{room_id}//{user_id}" ) @ DELETE public Response leaveRoom ( @ PathParam ( "room_id" ) int roomId , @ PathParam ( "user_id" ) int userId , @ QueryParam ( "token" ) String token ) { Room room = getRepository ( ) . find ( roomId ) ; if ( room == null ) return Response . status ( NOT_FOUND ) . build ( ) ; if ( ( room . getx_user ( ) ) == userId ) { room . setx_user ( null ) ; return Response . ok ( ) . build ( ) ; } else if ( ( room . geto_user ( ) ) == userId ) { room . seto_user ( null ) ; return Response . ok ( ) . build ( ) ; } else <START_BUG> return Response . status ( NOT_FOUND ) . build ( ) ; <END_BUG> } No newline ; at end ; of file ; }

Fix:
return Response . ok ( ) . build ( ) ;
Buggy code:
public class Intersection { private final Goban goban ; private final int x ; private final int y ; private StoneChain stoneChain ; public Intersection ( Goban goban , int x , int y ) { } public int getX ( ) { } public int getY ( ) { } public StoneChain getStoneChain ( ) { } public void setStoneChain ( StoneChain stoneChain ) { } public boolean isEmpty ( ) { } public Set < StoneChain > getAdjacentStoneChains ( ) { Set < StoneChain > adjacentStoneChains = new HashSet < StoneChain > ( ) ; int [ ] dx = new int [ ] { - 1 , 0 , 1 , 0 } ; int [ ] dy = new int [ ] { 0 , - 1 , 0 , 1 } ; assert ( dx . length ) == ( dy . length ) : "dx<seq2seq4repair_space>and<seq2seq4repair_space>dy<seq2seq4repair_space>should<seq2seq4repair_space>have<seq2seq4repair_space>the<seq2seq4repair_space>same<seq2seq4repair_space>length" ; <START_BUG> for ( int i = 0 ; i < ( ( dx . length ) - 1 ) ; i ++ ) { <END_BUG> int newX = ( x ) + ( dx [ i ] ) ; int newY = ( y ) + ( dy [ i ] ) ; if ( goban . isInGoban ( newX , newY ) ) { Intersection adjIntersection = goban . getIntersection ( newX , newY ) ; if ( ( adjIntersection . stoneChain ) != null ) { adjacentStoneChains . add ( adjIntersection . stoneChain ) ; } } } return adjacentStoneChains ; } public List < Intersection > getEmptyNeighbors ( ) { } }

Fix:
for ( int i = 0 ; i < ( dx . length ) ; i ++ ) {
Buggy code:
@ RunWith ( Arquillian . class ) public class RemoteLocalCallTestCase { private static final Logger log = Logger . getLogger ( RemoteLocalCallTestCase . class ) ; public static final String ARCHIVE_NAME_CLIENT = "remotelocalcall-test-client" ; public static final String ARCHIVE_NAME_SERVER = "remotelocalcall-test-server" ; @ BeforeClass public static void printSysProps ( ) { } @ Deployment ( name = "server" ) @ TargetsContainer ( "multinode-server" ) public static Archive < ? > deployment0 ( ) { } @ Deployment ( name = "client" ) @ TargetsContainer ( "multinode-client" ) public static Archive < ? > deployment1 ( ) { JavaArchive jar = RemoteLocalCallTestCase . createJar ( RemoteLocalCallTestCase . ARCHIVE_NAME_CLIENT ) ; jar . addClasses ( RemoteLocalCallTestCase . class ) ; <START_BUG> jar . addAsManifestResource ( "META-INF//jboss-ejb-client-receivers.xml" , "jboss-ejb-client.xml" ) ; <END_BUG> return jar ; } private static JavaArchive createJar ( String archiveName ) { } @ Test @ OperateOnDeployment ( "client" ) public void testStatelessLocalFromRemote ( @ ArquillianResource InitialContext ctx ) throws Exception { } @ Test @ OperateOnDeployment ( "client" ) public void testStatelessLocalHomeFromRemoteHome ( @ ArquillianResource InitialContext ctx ) throws Exception { } @ Test @ OperateOnDeployment ( "client" ) public void testStatelessRemoteFromRemote ( @ ArquillianResource InitialContext ctx ) throws Exception { } @ Test @ OperateOnDeployment ( "client" ) public void testStatelessRemoteHomeFromRemoteHome ( @ ArquillianResource InitialContext ctx ) throws Exception { } @ Test @ OperateOnDeployment ( "client" ) public void testStatefulRemoteFromRemote ( @ ArquillianResource InitialContext ctx ) throws Exception { } @ Test @ OperateOnDeployment ( "client" ) public void testStatefulRemoteHomeFromRemoteHome ( @ ArquillianResource InitialContext ctx ) throws Exception { } @ Test @ OperateOnDeployment ( "client" ) public void testStatefulLocalFromRemote ( @ ArquillianResource InitialContext ctx ) throws Exception { } @ Test @ OperateOnDeployment ( "client" ) public void testStatefulLocalHomeFromRemoteHome ( @ ArquillianResource InitialContext ctx ) throws Exception { } }

Fix:
jar . addAsManifestResource ( "META-INF//jboss-ejb-client.xml" , "jboss-ejb-client.xml" ) ;
Buggy code:
class ChangeLogWriter { private static final SimpleDateFormat c_outputDate = new SimpleDateFormat ( "yyyy-MM-dd" ) ; private static final SimpleDateFormat c_outputTime = new SimpleDateFormat ( "HH:mm" ) ; public void printChangeLog ( final PrintWriter output , final CVSEntry [ ] entries ) { } private void printEntry ( final PrintWriter output , final CVSEntry entry ) { output . println ( "\t<entry>" ) ; output . println ( ( ( "\t\t<date>" + ( ChangeLogWriter . c_outputDate . format ( entry . getDate ( ) ) ) ) + "<//date>" ) ) ; output . println ( ( ( "\t\t<time>" + ( ChangeLogWriter . c_outputTime . format ( entry . getDate ( ) ) ) ) + "<//time>" ) ) ; output . println ( ( ( "\t\t<author><![CDATA[" + ( entry . getAuthor ( ) ) ) + "]]><//author>" ) ) ; final Enumeration enumeration = entry . getFiles ( ) . elements ( ) ; while ( enumeration . hasMoreElements ( ) ) { final RCSFile file = ( ( RCSFile ) ( enumeration . nextElement ( ) ) ) ; output . println ( "\t\t<file>" ) ; <START_BUG> output . println ( ( ( "\t\t\t<name>" + ( file . getName ( ) ) ) + "<//name>" ) ) ; <END_BUG> output . println ( ( ( "\t\t\t<revision>" + ( file . getRevision ( ) ) ) + "<//revision>" ) ) ; final String previousRevision = file . getPreviousRevision ( ) ; if ( previousRevision != null ) { output . println ( ( ( "\t\t\t<prevrevision>" + previousRevision ) + "<//prevrevision>" ) ) ; } output . println ( "\t\t<//file>" ) ; } output . println ( ( ( "\t\t<msg><![CDATA[" + ( entry . getComment ( ) ) ) + "]]><//msg>" ) ) ; output . println ( "\t<//entry>" ) ; } }

Fix:
output . println ( ( ( "\t\t\t<name><![CDATA[" + ( file . getName ( ) ) ) + "]]><//name>" ) ) ;
Buggy code:
public class SnippingToolPlusPlus extends JFrame implements JIntellitypeConstants , ActionListener { public static boolean debugging = false ; public static JXTrayIcon trayIcon ; private OverlayFrame overlay ; private PreferencesUI preferencesUI ; private Save save ; private Upload upload ; private JMenuItem uScreenshot ; private JMenuItem uSnippet ; private JMenuItem sScreenshot ; private JMenuItem sSnippet ; private JMenuItem uClipboardImg ; private CaptureScreen capture = new CaptureScreen ( ) ; private UpdateChecker updater ; final String iconMac = "trayIconMac.png" ; final String iconPressedMac = "trayIconPressedMac.png" ; public static void main ( String ... args ) { } private static void processArguments ( String [ ] args ) { } public SnippingToolPlusPlus ( ) { } private void initializeHotkeys ( ) { } private void displayOverlay ( ) { <START_BUG> if ( ( ( overlay ) == null ) || ( ! ( OverlayFrame . IsActive ) ) ) { <END_BUG> overlay = new OverlayFrame ( ) ; } } private void initializeTray ( ) { } @ Override public void actionPerformed ( ActionEvent e ) { } }

Fix:
if ( ( ( overlay ) == null ) || ( ! ( OverlayFrame . isActive ) ) ) {
Buggy code:
public class OptionsTag extends TagSupport { protected static MessageResources messages = MessageResources . getMessageResources ( ( ( Constants . Package ) + ".LocalStrings" ) ) ; protected String collection = null ; public String getCollection ( ) { } public void setCollection ( String collection ) { } protected String labelName = null ; public String getLabelName ( ) { } public void setLabelName ( String labelName ) { } protected String labelProperty = null ; public String getLabelProperty ( ) { } public void setLabelProperty ( String labelProperty ) { } protected String name = null ; public String getName ( ) { } public void setName ( String name ) { } protected String property = null ; public String getProperty ( ) { } public void setProperty ( String property ) { } public int doStartTag ( ) throws JspException { } public int doEndTag ( ) throws JspException { } public void release ( ) { } protected void addOption ( StringBuffer sb , String value , String label , boolean matched ) { sb . append ( "<option<seq2seq4repair_space>value=\"" ) ; sb . append ( value ) ; sb . append ( "\"" ) ; if ( matched ) <START_BUG> sb . append ( "<seq2seq4repair_space>selected=\"true\"" ) ; <END_BUG> sb . append ( ">" ) ; sb . append ( ResponseUtils . filter ( label ) ) ; sb . append ( "<//option>\r\n" ) ; } protected Iterator getIterator ( String name , String property ) throws JspException { } }

Fix:
sb . append ( "<seq2seq4repair_space>selected=\"selected\"" ) ;
Buggy code:
public class EJB3RemoteServiceRemove extends AbstractRemoveStepHandler { public static final EJB3RemoteServiceRemove INSTANCE = new EJB3RemoteServiceRemove ( ) ; @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { } @ Override protected void recoverServices ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { if ( context . isResourceServiceRestartAllowed ( ) ) { <START_BUG> EJB3RemoteServiceAdd . INSTANCE . installRuntimeService ( context , model , null ) ; <END_BUG> } else { context . revertReloadRequired ( ) ; } } void removeRuntimeService ( OperationContext context , ModelNode operation ) { } }

Fix:
EJB3RemoteServiceAdd . INSTANCE . installRuntimeServices ( context , model , null ) ;
Buggy code:
public class UnlockReceiver extends BroadcastReceiver { @ Override public void onReceive ( Context context , Intent intent ) { Log . d ( "Receiver" , ( "Broadcast<seq2seq4repair_space>received.<seq2seq4repair_space>Uptime:<seq2seq4repair_space>" + ( SystemClock . uptimeMillis ( ) ) ) ) ; <START_BUG> if ( ( startedTodayCount ( context ) ) < 3 ) { <END_BUG> final AlarmManager am = ( ( AlarmManager ) ( context . getSystemService ( ALARM_SERVICE ) ) ) ; final Calendar now = Calendar . getInstance ( ) ; now . add ( Calendar . MINUTE , 1 ) ; final Intent acitivyIntent = new Intent ( context , BannerActivity . class ) ; final PendingIntent pendingIntent = PendingIntent . getActivity ( context . getApplicationContext ( ) , 1 , acitivyIntent , FLAG_ONE_SHOT ) ; am . set ( RTC , now . getTimeInMillis ( ) , pendingIntent ) ; PreferenceManager . getDefaultSharedPreferences ( context ) . edit ( ) . putBoolean ( "pending" , true ) . apply ( ) ; } else { Log . d ( "UnlockReceiver" , "Skipping<seq2seq4repair_space>banner" ) ; } } private int startedTodayCount ( Context context ) { } }

Fix:
if ( ( PreferenceManager . getDefaultSharedPreferences ( context ) . getBoolean ( "pending" , false ) ) && ( ( startedTodayCount ( context ) ) < 3 ) ) {
Buggy code:
public class Echo extends Task { protected String message = "" ; protected File file = null ; protected boolean append = false ; protected int logLevel = Project . MSG_WARN ; public void setAppend ( boolean append ) { } public void setFile ( File file ) { } public void setLevel ( Echo . EchoLevel echoLevel ) { } public void setMessage ( String msg ) { } public void addText ( String msg ) { } public void execute ( ) throws BuildException { if ( ( file ) == null ) { log ( message , logLevel ) ; } else { FileWriter out = null ; try { out = new FileWriter ( file . getAbsolutePath ( ) , append ) ; out . write ( message , 0 , message . length ( ) ) ; } catch ( IOException ioe ) { <START_BUG> throw new BuildException ( ioe ) ; <END_BUG> } finally { if ( out != null ) { try { out . close ( ) ; } catch ( IOException ioex ) { } } } } } public static class EchoLevel extends EnumeratedAttribute { public String [ ] getValues ( ) { } } }

Fix:
throw new BuildException ( "Error" , ioe ) ;
Buggy code:
public class SlaveDatabase extends BasicDatabase { private volatile boolean inReplicationSlaveMode ; private volatile boolean shutdownInitiated ; private volatile boolean inBoot ; private volatile StandardException bootException ; private String dbname ; private volatile SlaveFactory slaveFac ; public boolean canSupport ( Properties startParams ) { } public void boot ( boolean create , Properties startParams ) throws StandardException { } public void stop ( ) { } public SlaveDatabase ( ) { } public boolean isInSlaveMode ( ) { } public LanguageConnectionContext setupConnection ( ContextManager cm , String user , String drdaID , String dbname ) throws StandardException { } public AuthenticationService getAuthenticationService ( ) throws StandardException { } public void verifyShutdownSlave ( ) throws StandardException { } public void stopReplicationSlave ( ) throws SQLException { } public void failover ( String dbname ) throws StandardException { } private class SlaveDatabaseBootThread implements Runnable { private boolean create ; private Properties params ; public SlaveDatabaseBootThread ( boolean create , Properties startParams ) { } public void run ( ) { } } private void verifySuccessfulBoot ( ) throws StandardException { } private boolean isSlaveFactorySet ( ) { } private void handleShutdown ( StandardException shutdownCause ) { if ( inBoot ) { bootException = shutdownCause ; return ; } try { shutdownInitiated = true ; String conStr = ( ( ( "jdbc:derby:" + ( dbname ) ) + ";" ) + ( Attribute . REPLICATION_INTERNAL_SHUTDOWN_SLAVE ) ) + "=true" ; InternalDriver driver = InternalDriver . activeDriver ( ) ; if ( driver != null ) { <START_BUG> driver . connect ( conStr , ( ( Properties ) ( null ) ) ) ; <END_BUG> } } catch ( Exception e ) { } } private void bootBasicDatabase ( boolean create , Properties params ) throws StandardException { } }

Fix:
driver . connect ( conStr , ( ( Properties ) ( null ) ) , 0 ) ;
Buggy code:
class PartStreamHeaders { private static final String BOUNDARY = "boundary" ; public static final String CONTENT_DISPOSITION = "Content-Disposition" ; public static final String CONTENT_TYPE = "Content-Type" ; private final Map < String , List < String > > headerNameToValueListMap = new LinkedHashMap < > ( ) ; String getHeader ( String name ) { } Collection < String > getHeaders ( String name ) { } Collection < String > getHeaderNames ( ) { } void addHeader ( String name , String value ) { } static String extractBoundaryFromHeader ( final String header ) { int pos = header . indexOf ( ( ( PartStreamHeaders . BOUNDARY ) + '=' ) ) ; if ( pos == ( - 1 ) ) { return null ; } int end ; int start = ( pos + ( PartStreamHeaders . BOUNDARY . length ( ) ) ) + 1 ; for ( end = start ; end < ( header . length ( ) ) ; ++ end ) { char c = header . charAt ( end ) ; <START_BUG> if ( ( c == '<seq2seq4repair_space>' ) || ( c == '\t' ) ) { <END_BUG> break ; } } return header . substring ( start , end ) ; } static String extractQuotedValueFromHeader ( final String header , final String key ) { } }

Fix:
if ( ( ( c == '<seq2seq4repair_space>' ) || ( c == '\t' ) ) || ( c == ';' ) ) {
Buggy code:
public class Jasper41Mangler implements JspMangler { public String mapJspToJavaName ( File jspFile ) { String jspUri = jspFile . getAbsolutePath ( ) ; int start = ( jspUri . lastIndexOf ( File . separatorChar ) ) + 1 ; int end = jspUri . length ( ) ; StringBuffer modifiedClassName ; modifiedClassName = new StringBuffer ( ( ( jspUri . length ( ) ) - start ) ) ; if ( ( ! ( Character . isJavaIdentifierStart ( jspUri . charAt ( start ) ) ) ) || ( ( jspUri . charAt ( start ) ) == '_' ) ) { modifiedClassName . append ( '_' ) ; } for ( int i = start ; i < end ; i ++ ) { char ch = jspUri . charAt ( i ) ; if ( Character . isJavaIdentifierPart ( ch ) ) { modifiedClassName . append ( ch ) ; } else if ( ch == '.' ) { modifiedClassName . append ( '_' ) ; } else { modifiedClassName . append ( Jasper41Mangler . mangleChar ( ch ) ) ; } } <START_BUG> return modifiedClassName . toString ( ) ; <END_BUG> } private static final String mangleChar ( char ch ) { } public String mapPath ( String path ) { } }

Fix:
return ( modifiedClassName . toString ( ) ) + ".java" ;
Buggy code:
public class Parser { public static final String TAG = "Parser" ; public static WeeklyMenu parseMenu ( boolean reload , String data , SharedPreferences settings , String url , String xmlKey ) throws Exception { WeeklyMenu mensaMenu = new WeeklyMenu ( ) ; Document doc ; if ( ( ( data != null ) && ( ! ( data . equals ( "" ) ) ) ) && ( ! reload ) ) { doc = Jsoup . parse ( data ) ; } else { <START_BUG> doc = Jsoup . connect ( url ) . get ( ) ; <END_BUG> String xmlData = doc . toString ( ) ; settings . edit ( ) . putString ( xmlKey , xmlData ) . commit ( ) ; } Elements dailyBlocks = doc . select ( "div.day-block" ) ; for ( Element dailyBlock : dailyBlocks ) { Element dayInformation = dailyBlock . select ( "a.day-information" ) . first ( ) ; String day = dayInformation . text ( ) ; mensaMenu . setWeekOfYear ( ( ( Util . getWeekOfYear ( ) ) + "" ) ) ; DailyMenu dailyMenu = new DailyMenu ( ) ; dailyMenu . setDate ( day ) ; Parser . extractRow ( dailyBlock , dailyMenu , day ) ; mensaMenu . addDailyMenu ( dailyMenu ) ; } return mensaMenu ; } private static void extractRow ( Element dailyBlock , DailyMenu dailyMenu , String dayInformation ) { } }

Fix:
doc = Jsoup . connect ( url ) . timeout ( 10000 ) . get ( ) ;
Buggy code:
public class CityDataService { public static List < City > get ( String query , String field , String tableName ) { } public static City getItem ( int city_id , String tableName , String field ) { } public static void create ( City city ) { } public static void delete ( int city_id ) { } public static void update ( City city ) { try ( Connection conn = sql2o . open ( ) ) { <START_BUG> String sql = "update<seq2seq4repair_space>city<seq2seq4repair_space>set<seq2seq4repair_space>city<seq2seq4repair_space>=<seq2seq4repair_space>:city,<seq2seq4repair_space>country_id<seq2seq4repair_space>=<seq2seq4repair_space>:country_id,<seq2seq4repair_space>last_update<seq2seq4repair_space>=<seq2seq4repair_space>:last_update<seq2seq4repair_space>where<seq2seq4repair_space>country_id<seq2seq4repair_space>=<seq2seq4repair_space>:country_id" ; <END_BUG> conn . createQuery ( sql ) . addParameter ( "city" , city . city ) . addParameter ( "country_id" , city . country_id ) . addParameter ( "last_update" , city . last_update ) . addParameter ( "city_id" , city . city_id ) . executeUpdate ( ) ; } } public static boolean isNumeric ( String str ) { } }

Fix:
String sql = "update<seq2seq4repair_space>city<seq2seq4repair_space>set<seq2seq4repair_space>city<seq2seq4repair_space>=<seq2seq4repair_space>:city,<seq2seq4repair_space>country_id<seq2seq4repair_space>=<seq2seq4repair_space>:country_id,<seq2seq4repair_space>last_update<seq2seq4repair_space>=<seq2seq4repair_space>:last_update<seq2seq4repair_space>where<seq2seq4repair_space>city_id<seq2seq4repair_space>=<seq2seq4repair_space>:city_id" ;
Buggy code:
public class ReflectivePropertyResolver implements PropertyAccessor { protected final Map < ReflectivePropertyResolver . CacheKey , Member > readerCache = new ConcurrentHashMap < ReflectivePropertyResolver . CacheKey , Member > ( ) ; protected final Map < ReflectivePropertyResolver . CacheKey , Member > writerCache = new ConcurrentHashMap < ReflectivePropertyResolver . CacheKey , Member > ( ) ; protected final Map < ReflectivePropertyResolver . CacheKey , TypeDescriptor > typeDescriptorCache = new ConcurrentHashMap < ReflectivePropertyResolver . CacheKey , TypeDescriptor > ( ) ; public Class < ? > [ ] getSpecificTargetClasses ( ) { } public boolean canRead ( EvaluationContext context , Object target , String name ) throws AccessException { if ( target == null ) { return false ; } Class < ? > type = ( target instanceof Class ) ? ( ( Class < ? > ) ( target ) ) : target . getClass ( ) ; if ( ( type . isArray ( ) ) && ( name . equals ( "length" ) ) ) { return true ; } ReflectivePropertyResolver . CacheKey cacheKey = new ReflectivePropertyResolver . CacheKey ( type , name ) ; if ( this . readerCache . containsKey ( cacheKey ) ) { return true ; } Method method = findGetterForProperty ( name , type , ( target instanceof Class ) ) ; if ( method != null ) { this . readerCache . put ( cacheKey , method ) ; <START_BUG> this . typeDescriptorCache . put ( cacheKey , new TypeDescriptor ( new MethodParameter ( method , 0 ) ) ) ; <END_BUG> return true ; } else { Field field = findField ( name , type , ( target instanceof Class ) ) ; if ( field != null ) { this . readerCache . put ( cacheKey , field ) ; this . typeDescriptorCache . put ( cacheKey , new TypeDescriptor ( field ) ) ; return true ; } } return false ; } public TypedValue read ( EvaluationContext context , Object target , String name ) throws AccessException { } public boolean canWrite ( EvaluationContext context , Object target , String name ) throws AccessException { } public void write ( EvaluationContext context , Object target , String name , Object newValue ) throws AccessException { } private TypeDescriptor getTypeDescriptor ( EvaluationContext context , Object target , String name ) { } protected Method findGetterForProperty ( String propertyName , Class < ? > clazz , boolean mustBeStatic ) { } protected Method findSetterForProperty ( String propertyName , Class < ? > clazz , boolean mustBeStatic ) { } protected Field findField ( String name , Class < ? > clazz , boolean mustBeStatic ) { } private static class CacheKey { private final Class clazz ; private final String name ; public CacheKey ( Class clazz , String name ) { } @ Override public boolean equals ( Object other ) { } @ Override public int hashCode ( ) { } } }

Fix:
this . typeDescriptorCache . put ( cacheKey , new TypeDescriptor ( new MethodParameter ( method , ( - 1 ) ) ) ) ;
Buggy code:
public final class Formatter { private String loadedPrefix ; private final YAMLConfigurationFile formatsFile ; public Formatter ( YAMLConfigurationFile formatsFile ) { } public Formatter . FormatBuilder begin ( String path ) { } public boolean has ( String path ) { } public Formatter . FormatBuilder withValue ( String value ) { } public final class FormatBuilder { private final String formatString ; private final Map < String , String > modifiers = new HashMap < String , String > ( ) ; private boolean prefix = true ; private boolean coloredInputs = true ; private FormatBuilder ( String formatString ) { } public Formatter . FormatBuilder withModifier ( String key , Object value ) { } public Formatter . FormatBuilder withPrefix ( boolean p ) { } public Formatter . FormatBuilder withColoredInputs ( boolean c ) { } public String get ( ) { if ( ( formatString ) == null ) return "Not<seq2seq4repair_space>found!" ; String s = ChatColor . translateAlternateColorCodes ( '&' , formatString ) ; for ( Map . Entry < String , String > stringStringEntry : modifiers . entrySet ( ) ) { String value = stringStringEntry . getValue ( ) ; if ( coloredInputs ) value = ChatColor . translateAlternateColorCodes ( '&' , value ) ; s = s . replaceAll ( ( ( "\\{\\{" + ( stringStringEntry . getKey ( ) ) ) + "\\}\\}" ) , value ) ; <START_BUG> s = s . replaceAll ( ( ( "\\<" + ( stringStringEntry . getKey ( ) ) ) + "\\>" ) , value ) ; <END_BUG> } if ( ( prefix ) && ( ( loadedPrefix ) != null ) ) return ( loadedPrefix ) + s ; return s ; } } }

Fix:
s = s . replaceAll ( stringStringEntry . getKey ( ) , value ) ;
Buggy code:
public class Task implements Comparable < Task > { public TimerTaskCallback proc ; public long intervalMillis ; public long execTimeMillis ; public boolean periodic ; public Object associatedData ; public Task ( long now , TimerTaskCallback proc , Object associatedData , long intervalMillis , boolean periodic ) { } public int compareTo ( Task t ) { <START_BUG> return new Long ( this . execTimeMillis ) . compareTo ( ( ( Task ) ( t ) ) . execTimeMillis ) ; <END_BUG> } public static class TaskComparator implements Comparator < Task > { public int compare ( Task t1 , Task t2 ) { } } }

Fix:
return ( this . hashCode ( ) ) - ( t . hashCode ( ) ) ;
Buggy code:
public class JDTCompilerAdapter extends DefaultCompilerAdapter { private static String compilerClass = "org.eclipse.jdt.internal.compiler.batch.Main" ; String logFileName ; Map customDefaultOptions ; public boolean execute ( ) throws BuildException { this . attributes . log ( AntAdapterMessages . getString ( "ant.jdtadapter.info.usingJDTCompiler" ) , MSG_VERBOSE ) ; Commandline cmd = setupJavacCommand ( ) ; try { Class c = Class . forName ( JDTCompilerAdapter . compilerClass ) ; Constructor batchCompilerConstructor = c . getConstructor ( new Class [ ] { PrintWriter . class , PrintWriter . class , Boolean . TYPE , Map . class } ) ; <START_BUG> Object batchCompilerInstance = batchCompilerConstructor . newInstance ( new Object [ ] { new PrintWriter ( System . out ) , new PrintWriter ( System . err ) , Boolean . valueOf ( true ) , this . customDefaultOptions } ) ; <END_BUG> Method compile = c . getMethod ( "compile" , new Class [ ] { String [ ] . class } ) ; Object result = compile . invoke ( batchCompilerInstance , new Object [ ] { cmd . getArguments ( ) } ) ; final boolean resultValue = ( ( Boolean ) ( result ) ) . booleanValue ( ) ; if ( ( ! resultValue ) && ( this . verbose ) ) { System . out . println ( AntAdapterMessages . getString ( "ant.jdtadapter.error.compilationFailed" , this . logFileName ) ) ; } return resultValue ; } catch ( ClassNotFoundException cnfe ) { throw new BuildException ( AntAdapterMessages . getString ( "ant.jdtadapter.error.cannotFindJDTCompiler" ) ) ; } catch ( Exception ex ) { throw new BuildException ( ex ) ; } } protected Commandline setupJavacCommand ( ) throws BuildException { } private void addExtdirs ( Path extDirs , Path classpath ) { } }

Fix:
Object batchCompilerInstance = batchCompilerConstructor . newInstance ( new Object [ ] { new PrintWriter ( System . out ) , new PrintWriter ( System . err ) , Boolean . TRUE , this . customDefaultOptions } ) ;