nus-yam/ex-repair huggingface dataset:
Buggy code:
public class JGroupsSubsystemTest extends AbstractSubsystemBaseTest { public JGroupsSubsystemTest ( ) { } @ Override protected String getSubsystemXml ( ) throws IOException { } @ Override protected Set < PathAddress > getIgnoredChildResourcesForRemovalTest ( ) { } @ Test public void testProtocolOrdering ( ) throws Exception { } @ Override protected AdditionalInitialization createAdditionalInitialization ( ) { } @ Test public void testLegacyOperations ( ) throws Exception { List < ModelNode > ops = new LinkedList < ModelNode > ( ) ; PathAddress subsystemAddress = EMPTY_ADDRESS . append ( SUBSYSTEM , getMainSubsystemName ( ) ) ; PathAddress udpAddress = subsystemAddress . append ( "stack" , "udp" ) ; PathAddress tcpAddress = subsystemAddress . append ( "stack" , "tcp" ) ; ModelNode op = Util . createAddOperation ( subsystemAddress ) ; op . get ( "default-stack" ) . set ( "udp" ) ; ops . add ( op ) ; op = Util . createAddOperation ( udpAddress ) ; ModelNode transport = new ModelNode ( ) ; transport . get ( "type" ) . set ( "UDP" ) ; transport . get ( "socket-binding" ) . set ( "jgroups-udp" ) ; ModelNode protocols = new ModelNode ( ) ; String [ ] protocolList = new String [ ] { "PING" , "MERGE3" , "FD_SOCK" , "FD" , "VERIFY_SUSPECT" , "BARRIER" , "pbcast.NAKACK2" , "UNICAST2" , "pbcast.STABLE" , "pbcast.GMS" , "UFC" , "MFC" , "FRAG2" , "RSVP" } ; for ( int i = 0 ; i < ( protocolList . length ) ; i ++ ) { ModelNode protocol = new ModelNode ( ) ; protocol . get ( TYPE ) . set ( protocolList [ i ] ) ; protocol . get ( "socket-binding" ) . set ( "jgroups-udp" ) ; <START_BUG> System . out . println ( ( "adding<seq2seq4repair_space>protovcol<seq2seq4repair_space>=<seq2seq4repair_space>" + ( protocol . toString ( ) ) ) ) ; <END_BUG> protocols . add ( protocol ) ; } op . get ( "transport" ) . set ( transport ) ; op . get ( "protocols" ) . set ( protocols ) ; ops . add ( op ) ; ops . add ( Util . getWriteAttributeOperation ( udpAddress . append ( "protocol" , "FD_SOCK" ) , "socket-binding" , new ModelNode ( "jgroups-udp-fd" ) ) ) ; KernelServices servicesA = createKernelServicesBuilder ( createAdditionalInitialization ( ) ) . setBootOperations ( ops ) . build ( ) ; Assert . assertTrue ( "Subsystem<seq2seq4repair_space>boot<seq2seq4repair_space>failed!" , servicesA . isSuccessfulBoot ( ) ) ; final ModelNode modelA = servicesA . readWholeModel ( ) ; validateModel ( modelA ) ; ModelNode protos = modelA . get ( SUBSYSTEM , getMainSubsystemName ( ) , "stack" , "udp" , "protocols" ) ; Assert . assertEquals ( "we<seq2seq4repair_space>should<seq2seq4repair_space>get<seq2seq4repair_space>back<seq2seq4repair_space>same<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>protocols<seq2seq4repair_space>that<seq2seq4repair_space>we<seq2seq4repair_space>send" , 14 , protos . asList ( ) . size ( ) ) ; servicesA . shutdown ( ) ; } }

Fix:
System . out . println ( ( "adding<seq2seq4repair_space>protocol<seq2seq4repair_space>=<seq2seq4repair_space>" + ( protocol . toString ( ) ) ) ) ;
Buggy code:
public class AutocompleteTextFieldSupport extends TextField implements IHeaderContributor { public AutocompleteTextFieldSupport ( String id ) { } protected void onComponentTag ( ComponentTag tag ) { } public void renderHead ( HtmlHeaderContainer container ) { } private void addCssReference ( final HtmlHeaderContainer container , final Class clazz , final String name ) { PackageResourceReference ref = new PackageResourceReference ( Application . get ( ) , clazz , name ) ; <START_BUG> write ( container , ( ( "\t<link<seq2seq4repair_space>rel=\'stylesheet\'<seq2seq4repair_space>type=\'text//css\'<seq2seq4repair_space>href=\'" + ( getPage ( ) . urlFor ( ref . getPath ( ) ) ) ) + "\'//>\n" ) ) ; <END_BUG> } protected void write ( MarkupContainer container , String s ) { } protected void onRender ( MarkupStream markupStream ) { } protected final String getAutocompleteId ( ) { } public String getBodyOnLoad ( ) { } }

Fix:
write ( container , ( ( "\t<link<seq2seq4repair_space>rel=\'stylesheet\'<seq2seq4repair_space>type=\'text//css\'<seq2seq4repair_space>href=\'" + ( urlFor ( ref . getPath ( ) ) ) ) + "\'//>\n" ) ) ;
Buggy code:
public class SimpleInfluxDBClient { private String influxDBHost ; private int influxDBPort ; HttpClient client ; public SimpleInfluxDBClient ( String influxDBHost , Integer influxDBPort ) { } public void sendMetric ( String key , int value ) { } public void sendMetric ( final String key , final int value , long timeStamp ) { try { PostMethod method = new PostMethod ( ( ( ( ( "http:////" + ( influxDBHost ) ) + ":" ) + ( influxDBPort ) ) + "//db//graphite//series" ) ) ; method . setQueryString ( "u=root&p=root" ) ; <START_BUG> method . setRequestBody ( ( ( ( ( ( ( "[{\"name\":\"" + key ) + "\",\"columns\":[\"time\",\"value\"],\"points\":[[" ) + value ) + "," ) + timeStamp ) + "]]}]" ) ) ; <END_BUG> client . executeMethod ( method ) ; if ( ( method . getStatusCode ( ) ) != 200 ) { throw new Exception ( "Error<seq2seq4repair_space>response<seq2seq4repair_space>code<seq2seq4repair_space>from<seq2seq4repair_space>InfluxDB" ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } } public long getCurrentTimestamp ( ) { } }

Fix:
method . setRequestBody ( ( ( ( ( ( ( "[{\"name\":\"" + key ) + "\",\"columns\":[\"value\",\"time\"],\"points\":[[" ) + value ) + "," ) + timeStamp ) + "]]}]" ) ) ;
Buggy code:
public class GetAccumulateLatencyTest extends OnesidedTestBase { private int size ; private int i ; int disp ; double tStart ; double tEnd ; private Win win ; private byte [ ] sbuf = new byte [ MAX_SIZE ] ; private byte [ ] rbuf = new byte [ MAX_SIZE ] ; @ Override protected void initialize ( String [ ] args ) { super . initialize ( args ) ; <START_BUG> getReporter ( ) . setColumnNames ( new String [ ] { "Size<seq2seq4repair_space>(bytes)" , "Latency<seq2seq4repair_space>(µs)" } ) ; <END_BUG> } private double collectResult ( int size , double tStart , double tEnd ) { } private double collectResult ( int size , double tStart , double tEnd , double multiplier ) { } @ Override protected void runTestWithFlush ( ) { } @ Override protected void runTestWithFlushLocal ( ) { } @ Override protected void runTestWithLockAll ( ) { } @ Override protected void runTestWithFence ( ) { } @ Override protected void runTestWithPscw ( ) { } @ Override protected void runTestWithLock ( ) { } }

Fix:
getReporter ( ) . setColumnNames ( new String [ ] { "Size<seq2seq4repair_space>(bytes)" , "Latency<seq2seq4repair_space>(us)" } ) ;
Buggy code:
public class FileSearchQuery implements ISearchQuery { private static final class TextSearchResultCollector extends TextSearchRequestor { private final AbstractTextSearchResult fResult ; private final boolean fIsFileSearchOnly ; private final boolean fSearchInBinaries ; private final boolean fIsLightweightAutoRefresh ; private Map fCachedMatches ; private Object fLock = new Object ( ) ; private TextSearchResultCollector ( AbstractTextSearchResult result , boolean isFileSearchOnly , boolean searchInBinaries ) { } public boolean canRunInParallel ( ) { } public boolean acceptFile ( IFile file ) throws CoreException { } public boolean reportBinaryFile ( IFile file ) { } public boolean acceptPatternMatch ( TextSearchMatchAccess matchRequestor ) throws CoreException { } private LineElement getLineElement ( int offset , TextSearchMatchAccess matchRequestor , ArrayList matches ) { } private static String getContents ( TextSearchMatchAccess matchRequestor , int start , int end ) { } public void beginReporting ( ) { } public void endReporting ( ) { } private void flushMatches ( ) { } } private final FileTextSearchScope fScope ; private final String fSearchText ; private final boolean fIsRegEx ; private final boolean fIsCaseSensitive ; private final boolean fIsWholeWord ; private FileSearchResult fResult ; public FileSearchQuery ( String searchText , boolean isRegEx , boolean isCaseSensitive , FileTextSearchScope scope ) { } public FileSearchQuery ( String searchText , boolean isRegEx , boolean isCaseSensitive , boolean isWholeWord , FileTextSearchScope scope ) { } public FileTextSearchScope getSearchScope ( ) { } public boolean canRunInBackground ( ) { } public IStatus run ( final IProgressMonitor monitor ) { AbstractTextSearchResult textResult = ( ( AbstractTextSearchResult ) ( getSearchResult ( ) ) ) ; textResult . removeAll ( ) ; Pattern searchPattern = getSearchPattern ( ) ; <START_BUG> boolean searchInBinaries = ! ( isScopeAllFileTypes ( ) ) ; <END_BUG> FileSearchQuery . TextSearchResultCollector collector = new FileSearchQuery . TextSearchResultCollector ( textResult , isFileNameSearch ( ) , searchInBinaries ) ; return TextSearchEngine . create ( ) . search ( fScope , collector , searchPattern , monitor ) ; } private boolean isScopeAllFileTypes ( ) { } public String getLabel ( ) { } public String getSearchString ( ) { } public String getResultLabel ( int nMatches ) { } public IStatus searchInFile ( final AbstractTextSearchResult result , final IProgressMonitor monitor , IFile file ) { } protected Pattern getSearchPattern ( ) { } public boolean isFileNameSearch ( ) { } public boolean isRegexSearch ( ) { } public boolean isCaseSensitive ( ) { } public boolean isWholeWord ( ) { } public boolean canRerun ( ) { } public ISearchResult getSearchResult ( ) { } }

Fix:
boolean searchInBinaries = true ;
Buggy code:
public class AssetController implements HestiaController { private HestiaDB < ? , ? > db ; private VelocityRenderer renderer ; public AssetController ( HestiaDB < ? , ? > db , VelocityRenderer renderer ) throws IOException { } @ Override public HttpResponse controll ( HttpRequest req , String matchPath ) throws Exception { } private String assetMain ( HttpRequest req , HashMap < String , Object > valueMap ) throws Exception { } private String assetDetail ( HttpRequest req , HashMap < String , Object > valueMap ) throws Exception { RequestPath path = ( ( RequestPath ) ( req . getAttribute ( "path" ) ) ) ; <START_BUG> int assetId = path . getInt ( 1 , Integer . MIN_VALUE ) ; <END_BUG> if ( ! ( db . retrieveAssetList ( ( a ) -> ( a . id ( ) ) == assetId ) . isEmpty ( ) ) ) { return assetHistory ( req , valueMap , ( a ) -> ( a . id ( ) ) == assetId ) ; } notFound ( req ) ; return null ; } private String assetHistory ( HttpRequest req , HashMap < String , Object > valueMap , Predicate < Asset > assetPredicate ) throws Exception { } }

Fix:
int assetId = path . getInt ( 0 , Integer . MIN_VALUE ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class JMSMessageDrivenBeanTestCase { @ Deployment public static Archive < ? > deployment ( ) { } @ Test public void testSendMessage ( ) throws JMSException , NamingException { final InitialContext ctx = new InitialContext ( ) ; final QueueConnectionFactory factory = ( ( QueueConnectionFactory ) ( ctx . lookup ( "java://JmsXA" ) ) ) ; final QueueConnection connection = factory . createQueueConnection ( ) ; connection . start ( ) ; try { final QueueSession session = connection . createQueueSession ( false , AUTO_ACKNOWLEDGE ) ; final Queue replyDestination = session . createTemporaryQueue ( ) ; final QueueReceiver receiver = session . createReceiver ( replyDestination ) ; final Message message = session . createTextMessage ( "Test" ) ; message . setJMSReplyTo ( replyDestination ) ; <START_BUG> final Destination destination = ( ( Destination ) ( ctx . lookup ( "queue//test" ) ) ) ; <END_BUG> final MessageProducer producer = session . createProducer ( destination ) ; producer . send ( message ) ; producer . close ( ) ; final Message reply = receiver . receive ( 1000 ) ; assertNotNull ( reply ) ; final String result = ( ( javax . jms . TextMessage ) ( reply ) ) . getText ( ) ; assertEquals ( "replying<seq2seq4repair_space>Test" , result ) ; } finally { } } }

Fix:
final Destination destination = ( ( Destination ) ( ctx . lookup ( "java:jboss//queue//test" ) ) ) ;
Buggy code:
public class BroadcastGroupAdd extends AbstractAddStepHandler implements DescriptionProvider { public static ModelNode getAddOperation ( final ModelNode address , ModelNode subModel ) { } public static final BroadcastGroupAdd INSTANCE = new BroadcastGroupAdd ( ) ; private BroadcastGroupAdd ( ) { } @ Override protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { } @ Override public ModelNode getModelDescription ( Locale locale ) { } static void addBroadcastGroupConfigs ( final Configuration configuration , final ModelNode model ) throws OperationFailedException { } static BroadcastGroupConfiguration createBroadcastGroupConfiguration ( final String name , final ModelNode model ) throws OperationFailedException { final ModelNode localAddrNode = LOCAL_BIND_ADDRESS . validateResolvedOperation ( model ) ; final String localAddress = ( localAddrNode . isDefined ( ) ) ? localAddrNode . asString ( ) : null ; <START_BUG> final int localPort = LOCAL_BIND_ADDRESS . validateResolvedOperation ( model ) . asInt ( ) ; <END_BUG> final String groupAddress = GROUP_ADDRESS . validateResolvedOperation ( model ) . asString ( ) ; final int groupPort = GROUP_ADDRESS . validateResolvedOperation ( model ) . asInt ( ) ; final long broadcastPeriod = BROADCAST_PERIOD . validateResolvedOperation ( model ) . asLong ( ) ; final List < String > connectorRefs = new ArrayList < String > ( ) ; if ( model . hasDefined ( CONNECTORS ) ) { for ( ModelNode ref : model . get ( CONNECTORS ) . asList ( ) ) { connectorRefs . add ( ref . asString ( ) ) ; } } return new BroadcastGroupConfiguration ( name , localAddress , localPort , groupAddress , groupPort , broadcastPeriod , connectorRefs ) ; } }

Fix:
final int localPort = LOCAL_BIND_PORT . validateResolvedOperation ( model ) . asInt ( ) ;
Buggy code:
public final class ExceptionPredicate < T > implements Serializable , Predicate < T > { private static final long serialVersionUID = 7179106032121985545L ; public static final Predicate < Object > INSTANCE = new ExceptionPredicate < Object > ( ) ; @ SuppressWarnings ( "unchecked" ) public static < T > Predicate < T > exceptionPredicate ( ) { } private ExceptionPredicate ( ) { } <START_BUG> public boolean evaluate ( T object ) { <END_BUG> throw new FunctorException ( "ExceptionPredicate<seq2seq4repair_space>invoked" ) ; } private Object readResolve ( ) { } }

Fix:
public boolean evaluate ( final T object ) {
Buggy code:
public interface SymbolResolver { public SymbolResolver getParent ( ) { } public void setParent ( SymbolResolver parent ) { } public default SymbolResolver getRoot ( ) { } Optional < PropertyDefinition > findDefinition ( PropertyReference propertyReference ) { } default TypeDefinition getTypeDefinitionIn ( String typeName , Node context , SymbolResolver resolver ) { <START_BUG> Optional < TypeDefinition > result = findTypeDefinitionIn ( typeName , context , resolver ) ; <END_BUG> if ( result . isPresent ( ) ) { return result . get ( ) ; } else { throw new me . tomassetti . turin . parser . analysis . UnsolvedSymbolException ( context , typeName ) ; } } Optional < TypeDefinition > findTypeDefinitionIn ( String typeName , Node context , SymbolResolver resolver ) { } Optional < TypeUsage > findTypeUsageIn ( String typeName , Node context , SymbolResolver resolver ) { } Optional < JvmMethodDefinition > findJvmDefinition ( FunctionCall functionCall ) { } Optional < Node > findSymbol ( String name , Node context ) { } }

Fix:
Optional < TypeDefinition > result = findTypeDefinitionIn ( typeName , context , resolver . getRoot ( ) ) ;
Buggy code:
public abstract class MongoSpoutBase implements IRichSpout { static Logger LOG = Logger . getLogger ( MongoSpoutBase . class ) ; protected static MongoObjectGrabber wholeDocumentMapper = null ; private String dbName ; private DBObject query ; protected MongoObjectGrabber mapper ; protected Map < String , MongoObjectGrabber > fields ; protected Map conf ; protected TopologyContext context ; protected SpoutOutputCollector collector ; protected ConcurrentLinkedQueue < DBObject > queue = new ConcurrentLinkedQueue < DBObject > ( ) ; private String url ; private MongoTask task ; private ExecutorService threadExecutor ; private String [ ] collectionNames ; public MongoSpoutBase ( String url , String dbName , String [ ] collectionNames , DBObject query , MongoObjectGrabber mapper ) { } @ Override public boolean isDistributed ( ) { } @ Override public void declareOutputFields ( OutputFieldsDeclarer declarer ) { } @ Override public void open ( Map conf , TopologyContext context , SpoutOutputCollector collector ) { this . conf = conf ; this . context = context ; this . collector = collector ; Mongo mongo = null ; DB db = null ; try { MongoURI uri = new MongoURI ( this . url ) ; mongo = new Mongo ( ) ; <START_BUG> db = mongo . getDB ( this . dbName ) ; <END_BUG> if ( ( uri . getUsername ( ) ) != null ) { db . authenticate ( uri . getUsername ( ) , uri . getPassword ( ) ) ; } } catch ( UnknownHostException e ) { MongoSpoutBase . LOG . error ( "Unknown<seq2seq4repair_space>host<seq2seq4repair_space>for<seq2seq4repair_space>Mongo<seq2seq4repair_space>DB" , e ) ; throw new RuntimeException ( e ) ; } this . task = new MongoTask ( this . queue , mongo , db , this . collectionNames , this . query ) ; Thread thread = new Thread ( this . task ) ; thread . start ( ) ; } @ Override public void close ( ) { } protected abstract void processNextTuple ( ) { } @ Override public void nextTuple ( ) { } @ Override public void ack ( Object msgId ) { } @ Override public void fail ( Object msgId ) { } }

Fix:
db = mongo . getDB ( ( ( this . dbName ) == null ? uri . getDatabase ( ) : this . dbName ) ) ;
Buggy code:
public class TestWeatherContract extends AndroidTestCase { private static final String TEST_WEATHER_LOCATION = "//North<seq2seq4repair_space>Pole" ; private static final long TEST_WEATHER_DATE = 1419033600L ; public void testBuildWeatherLocation ( ) { Uri locationUri = WeatherEntry . buildWeatherLocation ( TestWeatherContract . TEST_WEATHER_LOCATION ) ; assertNotNull ( ( "Error:<seq2seq4repair_space>Null<seq2seq4repair_space>Uri<seq2seq4repair_space>returned.<seq2seq4repair_space>You<seq2seq4repair_space>must<seq2seq4repair_space>fill-in<seq2seq4repair_space>buildWeatherLocation<seq2seq4repair_space>in<seq2seq4repair_space>" + "WeatherContract." ) , locationUri ) ; assertEquals ( "Error:<seq2seq4repair_space>Weather<seq2seq4repair_space>location<seq2seq4repair_space>not<seq2seq4repair_space>properly<seq2seq4repair_space>appended<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>end<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>Uri" , TestWeatherContract . TEST_WEATHER_LOCATION , locationUri . getLastPathSegment ( ) ) ; <START_BUG> assertEquals ( "Error:<seq2seq4repair_space>Weather<seq2seq4repair_space>location<seq2seq4repair_space>Uri<seq2seq4repair_space>doesn't<seq2seq4repair_space>match<seq2seq4repair_space>our<seq2seq4repair_space>expected<seq2seq4repair_space>result" , locationUri . toString ( ) , "content:////com.example.android.sunshine.app//weather//%2FNorth%20Pole" ) ; <END_BUG> } }

Fix:
assertEquals ( "Error:<seq2seq4repair_space>Weather<seq2seq4repair_space>location<seq2seq4repair_space>Uri<seq2seq4repair_space>doesn't<seq2seq4repair_space>match<seq2seq4repair_space>our<seq2seq4repair_space>expected<seq2seq4repair_space>result" , locationUri . toString ( ) , "content:////com.example.hiltonwesley.sunshine.app//weather//%2FNorth%20Pole" ) ;
Buggy code:
public class GenericContainerInstantiator implements IContainerInstantiator { public static final String TCPCLIENT_NAME = "ecf.generic.client" ; public static final String TCPSERVER_NAME = "ecf.generic.server" ; private static final int CREATE_INSTANCE_ERROR_CODE = 4441 ; public GenericContainerInstantiator ( ) { } protected ID getIDFromArg ( Object arg ) throws IDCreateException { if ( arg == null ) <START_BUG> throw new IDCreateException ( "id<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; <END_BUG> if ( arg instanceof ID ) return ( ( ID ) ( arg ) ) ; if ( arg instanceof String ) { String val = ( ( String ) ( arg ) ) ; if ( val . equals ( "" ) ) { return IDFactory . getDefault ( ) . createGUID ( ) ; } else return IDFactory . getDefault ( ) . createStringID ( val ) ; } else if ( arg instanceof Integer ) { return IDFactory . getDefault ( ) . createGUID ( ( ( Integer ) ( arg ) ) . intValue ( ) ) ; } else return IDFactory . getDefault ( ) . createGUID ( ) ; } protected Integer getIntegerFromArg ( Object arg ) { } protected class GenericContainerArgs { ID id ; Integer keepAlive ; public GenericContainerArgs ( ID id , Integer keepAlive ) { } public ID getID ( ) { } public Integer getKeepAlive ( ) { } } protected GenericContainerInstantiator . GenericContainerArgs getClientArgs ( String [ ] argDefaults , Object [ ] args ) throws IDCreateException { } protected boolean isClient ( ContainerTypeDescription description ) { } protected GenericContainerInstantiator . GenericContainerArgs getServerArgs ( String [ ] argDefaults , Object [ ] args ) throws IDCreateException { } public IContainer createInstance ( ContainerTypeDescription description , Object [ ] args ) throws ContainerCreateException { } protected Set getAdaptersForClass ( Class clazz ) { } protected Set getInterfacesForClass ( Set s , Class clazz ) { } protected Set getInterfacesForClass ( Class clazz ) { } protected String [ ] getInterfacesAndAdaptersForClass ( Class clazz ) { } public String [ ] getSupportedAdapterTypes ( ContainerTypeDescription description ) { } public Class [ ] [ ] getSupportedParameterTypes ( ContainerTypeDescription description ) { } }

Fix:
throw new IDCreateException ( Messages . getString ( "GenericContainerInstantiator.ID_Cannot_Be_Null" ) ) ;
Buggy code:
public class MainActivity extends AppCompatActivity { protected static final int REQUEST_ENABLE_BT = 5598 ; protected boolean triedEnableBluetooth ; public MainActivity ( ) { } @ Override protected void onCreate ( Bundle savedInstanceState ) { } protected void onResume ( Bundle savedInstanceState ) { } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } protected boolean isBluetoothSupported ( ) { } protected boolean isBluetoothEnabled ( ) { } protected void promptUserEnableBluetooth ( ) { Intent enableBtIntent = new Intent ( BluetoothAdapter . ACTION_REQUEST_ENABLE ) ; <START_BUG> startActivityForResult ( enableBtIntent , REQ ) ; <END_BUG> } }

Fix:
startActivityForResult ( enableBtIntent , MainActivity . REQUEST_ENABLE_BT ) ;
Buggy code:
public class DownloadThread extends Thread { private String songTitle ; private String youtubeReference ; public DownloadThread ( String songTitle , String youtubeReference ) { } @ Override public void run ( ) { String userName = System . getProperty ( "user.name" ) ; String tmpDir = System . getProperty ( "java.io.tmpdir" ) ; File path = new File ( ( tmpDir + "//SongDownloader" ) ) ; if ( ( path . exists ( ) ) && ( path . isDirectory ( ) ) ) { try { Runtime . getRuntime ( ) . exec ( new String [ ] { "rm" , "-rf" , tmpDir + "//SongDownloader" } ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } try { Process ytd = null ; ytd = Runtime . getRuntime ( ) . exec ( new String [ ] { "//usr//local//bin//youtube-dl" , "--audio-quality" , "0" , "--output" , tmpDir + "//SongDownloader//temp.mp4" , "https:////www.youtube.com//watch?v=" + ( youtubeReference ) } ) ; ytd . waitFor ( ) ; Process ffmp = null ; ffmp = Runtime . getRuntime ( ) . exec ( new String [ ] { "//usr//local//bin//ffmpeg" , "-i" , tmpDir + "//SongDownloader//temp.mp4" , "-vn" , "-acodec" , "libmp3lame" , "-ac" , "2" , "-qscale:a" , "4" , "-ar" , "48000" , tmpDir + "//SongDownloader//temp.mp3" } ) ; ffmp . waitFor ( ) ; Process ffca = null ; <START_BUG> ffca = Runtime . getRuntime ( ) . exec ( new String [ ] { "//usr//local//bin//ffmpeg" , "-i" , tmpDir + "//SongDownloader//temp.mp3" , "-i" , googleImgURLResults . get ( 0 ) , "-metadata" , "title=" + ( FXController . songTitle ) , "-metadata" , "artist=" + ( FXController . bandArtist ) , "-metadata" , "album=" + ( FXController . albumTitle ) , "-metadata" , "date=" + ( FXController . albumYear ) , "-map" , "0:0" , "-map" , "1:0" , "-c" , "copy" , "-id3v2_version" , "3" , ( ( ( "//Users//" + userName ) + "//Desktop//" ) + ( songTitle ) ) + ".mp3" } ) ; <END_BUG> ffca . waitFor ( ) ; Runtime . getRuntime ( ) . exec ( new String [ ] { "rm" , "-rf" , tmpDir + "//SongDownloader" } ) ; } catch ( IOException | InterruptedException e ) { e . printStackTrace ( ) ; } } }

Fix:
ffca = Runtime . getRuntime ( ) . exec ( new String [ ] { "//usr//local//bin//ffmpeg" , "-i" , tmpDir + "//SongDownloader//temp.mp3" , "-i" , googleImgURLResults . get ( imageIndex ) , "-metadata" , "title=" + ( FXController . songTitle ) , "-metadata" , "artist=" + ( FXController . bandArtist ) , "-metadata" , "album=" + ( FXController . albumTitle ) , "-metadata" , "date=" + ( FXController . albumYear ) , "-map" , "0:0" , "-map" , "1:0" , "-c" , "copy" , "-id3v2_version" , "3" , ( ( ( "//Users//" + userName ) + "//Desktop//" ) + ( songTitle ) ) + ".mp3" } ) ;
Buggy code:
public class DeclareParents extends Declare { private TypePattern child ; private TypePatternList parents ; public DeclareParents ( TypePattern child , List parents ) { } private DeclareParents ( TypePattern child , TypePatternList parents ) { } public boolean match ( ResolvedTypeX typeX ) { } public String toString ( ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public void write ( DataOutputStream s ) throws IOException { } public static Declare read ( DataInputStream s , ISourceContext context ) throws IOException { } public void resolve ( IScope scope ) { } public TypePatternList getParents ( ) { } public TypePattern getChild ( ) { } public boolean isAdviceLike ( ) { } private ResolvedTypeX maybeGetNewParent ( ResolvedTypeX targetType , TypePattern typePattern , World world ) { if ( typePattern == ( TypePattern . NO ) ) return null ; TypeX iType = typePattern . getExactType ( ) ; ResolvedTypeX parentType = iType . resolve ( world ) ; <START_BUG> if ( targetType . equals ( world . resolve ( OBJECT ) ) ) { <END_BUG> world . showMessage ( ERROR , WeaverMessages . format ( DECP_OBJECT ) , this . getSourceLocation ( ) , null ) ; return null ; } if ( parentType . isAssignableFrom ( targetType ) ) return null ; if ( targetType . isAssignableFrom ( parentType ) ) { world . showMessage ( ERROR , WeaverMessages . format ( CANT_EXTEND_SELF , targetType . getName ( ) ) , this . getSourceLocation ( ) , null ) ; return null ; } if ( parentType . isClass ( ) ) { if ( targetType . isInterface ( ) ) { world . showMessage ( ERROR , WeaverMessages . format ( INTERFACE_CANT_EXTEND_CLASS ) , this . getSourceLocation ( ) , null ) ; return null ; } if ( ! ( targetType . getSuperclass ( ) . isAssignableFrom ( parentType ) ) ) { world . showMessage ( ERROR , WeaverMessages . format ( DECP_HIERARCHY_ERROR , iType . getName ( ) , targetType . getSuperclass ( ) . getName ( ) ) , this . getSourceLocation ( ) , null ) ; return null ; } else { return parentType ; } } else { return parentType ; } } public List findMatchingNewParents ( ResolvedTypeX onType ) { } }

Fix:
if ( targetType . equals ( world . getCoreType ( OBJECT ) ) ) {
Buggy code:
@ RunWith ( AndroidJUnit4 . class ) @ LargeTest public class SampleTest { @ Rule public ActivityTestRule < MainActivity > mActivityRule = new ActivityTestRule ( MainActivity . class ) ; @ Test public void test_scrolling_test ( ) throws Exception { Espresso . onView ( new org . hamcrest . Matcher < View > ( ) { @ Override public boolean matches ( Object item ) { return ( item instanceof ListView ) || ( item instanceof RecyclerView ) ; } @ Override public void describeMismatch ( Object item , Description mismatchDescription ) { mismatchDescription . appendText ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>a:<seq2seq4repair_space>" + ( item . toString ( ) ) ) ) ; } @ Override public void _dont_implement_Matcher___instead_extend_BaseMatcher_ ( ) { } @ Override public void describeTo ( Description description ) { } <START_BUG> } ) . perform ( new bskyb . com . espresso . viewactions . ScrollingAction ( 40 , ViewActions . click ( ) ) ) ; <END_BUG> } }

Fix:
} ) . perform ( new bskyb . com . espresso . viewactions . ScrollingAction ( 35 , ViewActions . click ( ) ) ) ;
Buggy code:
public abstract class AbstractASTTransformation implements ASTTransformation , Opcodes { private static final ClassNode APPLICATION_HOLDER_TYPE = ClassHelper . makeWithoutCaching ( ApplicationHolder . class ) ; private static final ClassNode COLLECTIONS_CLASS = ClassHelper . makeWithoutCaching ( Collections . class ) ; public void addError ( String msg , ASTNode expr , SourceUnit source ) { } protected void checkNodesForAnnotationAndType ( ASTNode node1 , ASTNode node2 ) { } public static Expression emptyMap ( ) { } public static Expression applicationInstance ( ) { } protected static ClassNode newClass ( ClassNode classNode ) { <START_BUG> return new ClassNode ( classNode . getTypeClass ( ) ) ; <END_BUG> } }

Fix:
return classNode . getPlainNodeReference ( ) ;
Buggy code:
public class TestPerSegmentDeletes extends LuceneTestCase { public void testDeletes1 ( ) throws Exception { } void part2 ( IndexWriter writer , TestPerSegmentDeletes . RangeMergePolicy fsmp ) throws Exception { } boolean segThere ( SegmentInfoPerCommit info , SegmentInfos infos ) { } public static void printDelDocs ( Bits bits ) { } public int [ ] toDocsArray ( Term term , Bits bits , IndexReader reader ) throws IOException { Fields fields = MultiFields . getFields ( reader ) ; Terms cterms = fields . terms ( term . field ) ; TermsEnum ctermsEnum = cterms . iterator ( null ) ; if ( ctermsEnum . seekExact ( new org . apache . lucene . util . BytesRef ( term . text ( ) ) , false ) ) { <START_BUG> DocsEnum docsEnum = _TestUtil . docs ( random ( ) , ctermsEnum , bits , null , 0 ) ; <END_BUG> return TestPerSegmentDeletes . toArray ( docsEnum ) ; } return null ; } public static int [ ] toArray ( DocsEnum docsEnum ) throws IOException { } public class RangeMergePolicy extends MergePolicy { boolean doMerge = false ; int start ; int length ; private final boolean useCompoundFile ; private RangeMergePolicy ( boolean useCompoundFile ) { } @ Override public void close ( ) { } @ Override public MergeSpecification findMerges ( SegmentInfos segmentInfos ) throws IOException { } @ Override public MergeSpecification findForcedMerges ( SegmentInfos segmentInfos , int maxSegmentCount , Map < SegmentInfoPerCommit , Boolean > segmentsToMerge ) throws IOException { } @ Override public MergeSpecification findForcedDeletesMerges ( SegmentInfos segmentInfos ) throws IOException { } @ Override public boolean useCompoundFile ( SegmentInfos segments , SegmentInfoPerCommit newSegment ) { } } }

Fix:
DocsEnum docsEnum = _TestUtil . docs ( random ( ) , ctermsEnum , bits , null , false ) ;
Buggy code:
public class nsIWindowCreator extends nsISupports { static final int LAST_METHOD_ID = ( nsISupports . LAST_METHOD_ID ) + 1 ; public static final String NS_IWINDOWCREATOR_IID_STRING = "30465632-A777-44cc-90F9-8145475EF999" ; public static final nsID NS_IWINDOWCREATOR_IID = new nsID ( nsIWindowCreator . NS_IWINDOWCREATOR_IID_STRING ) ; public nsIWindowCreator ( int address ) { } public int CreateChromeWindow ( int parent , int chromeFlags , int [ ] _retval ) { <START_BUG> return XPCOM . VtblCall ( ( ( super . LAST_METHOD_ID ) + 1 ) , getAddress ( ) , parent , chromeFlags , _retval ) ; <END_BUG> } }

Fix:
return XPCOM . VtblCall ( ( ( nsISupports . LAST_METHOD_ID ) + 1 ) , getAddress ( ) , parent , chromeFlags , _retval ) ;
Buggy code:
abstract class Room { protected ArrayList < DataStruct > data ; public String roomName ; public BufferedImage picture ; abstract void openInfoWindow ( ) { } public Room ( ) { } public int getDataSize ( ) { } public int getInfo ( int index ) { } public String getName ( int index ) { } public int getInfo ( String name ) { } public void setInfo ( int index , int value ) { } public void setInfo ( String name , int value ) { } public void newLamp ( int num ) { } public void newAlarm ( ) { } public void newTemperature ( ) { <START_BUG> DataStruct tmp = new DataStruct ( 28 , "Sensor<seq2seq4repair_space>de<seq2seq4repair_space>Temperatura" ) ; <END_BUG> data . add ( tmp ) ; } public void newBath ( ) { } public void newWaterIO ( ) { } }

Fix:
DataStruct tmp = new DataStruct ( 28 , "Temperatura<seq2seq4repair_space>ambiente" ) ;
Buggy code:
class GenericOutboundConnectionAdd extends AbstractOutboundConnectionAddHandler { static final GenericOutboundConnectionAdd INSTANCE = new GenericOutboundConnectionAdd ( ) ; static ModelNode getAddOperation ( final String connectionName , final String uri , PathAddress address ) { } private GenericOutboundConnectionAdd ( ) { } @ Override protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { } ServiceController installRuntimeService ( final OperationContext context , final ModelNode operation , final ModelNode fullModel , ServiceVerificationHandler verificationHandler ) throws OperationFailedException { final PathAddress pathAddress = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; final String connectionName = pathAddress . getLastElement ( ) . getValue ( ) ; <START_BUG> final OptionMap connectionCreationOptions = ConnectorUtils . getOptions ( context , fullModel . get ( PROPERTY ) ) ; <END_BUG> final URI uri = getDestinationURI ( context , operation ) ; final GenericOutboundConnectionService outboundRemotingConnectionService = new GenericOutboundConnectionService ( connectionName , uri , connectionCreationOptions ) ; final ServiceName serviceName = OUTBOUND_CONNECTION_BASE_SERVICE_NAME . append ( connectionName ) ; final ServiceName aliasServiceName = GENERIC_OUTBOUND_CONNECTION_BASE_SERVICE_NAME . append ( connectionName ) ; final ServiceBuilder < GenericOutboundConnectionService > svcBuilder = context . getServiceTarget ( ) . addService ( serviceName , outboundRemotingConnectionService ) . addAliases ( aliasServiceName ) . addDependency ( SUBSYSTEM_ENDPOINT , Endpoint . class , outboundRemotingConnectionService . getEndpointInjector ( ) ) ; if ( verificationHandler != null ) { svcBuilder . addListener ( verificationHandler ) ; } return svcBuilder . install ( ) ; } URI getDestinationURI ( final OperationContext context , final ModelNode outboundConnection ) throws OperationFailedException { } }

Fix:
final OptionMap connectionCreationOptions = ConnectorResource . getOptions ( context , fullModel . get ( PROPERTY ) ) ;
Buggy code:
public class HomeActivity extends FeedsActivity { private Firebase firebaseRef ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; ListView list = ( ( ListView ) ( findViewById ( listView ) ) ) ; firebaseRef = new Firebase ( ( ( ( Constants . FIREBASE_URL ) + "//" ) + ( Constants . FIREBASE_LOCATION_ITEMS ) ) ) ; <START_BUG> Query queryRef = firebaseRef . orderByChild ( "timeCreated" ) ; <END_BUG> FirebaseListAdapter < Item > adapter = new FirebaseListAdapter < Item > ( this , Item . class , layout . post_layout , queryRef ) { @ Override protected void populateView ( View v , Item item , int i ) { TextView title = ( ( TextView ) ( v . findViewById ( title ) ) ) ; title . setText ( item . getItemDescription ( ) . getTitle ( ) ) ; TextView category = ( ( TextView ) ( v . findViewById ( category ) ) ) ; category . setText ( item . getItemDescription ( ) . getCategory ( ) ) ; TextView description = ( ( TextView ) ( v . findViewById ( description ) ) ) ; description . setText ( item . getItemDescription ( ) . getDescription ( ) ) ; TextView price = ( ( TextView ) ( v . findViewById ( price ) ) ) ; price . setText ( item . getItemDescription ( ) . priceToString ( ) ) ; TextView asking_price = ( ( TextView ) ( v . findViewById ( asking_price ) ) ) ; asking_price . setText ( "Asking<seq2seq4repair_space>Price:" ) ; TextView highestBidText = ( ( TextView ) ( v . findViewById ( highestBidText ) ) ) ; highestBidText . setText ( "Highest<seq2seq4repair_space>Bid:" ) ; if ( ( item . getItemDescription ( ) . getHighestBid ( ) ) == null ) { TextView highestBid = ( ( TextView ) ( v . findViewById ( highestBid ) ) ) ; highestBid . setText ( "$0.00" ) ; } else { TextView highestBid = ( ( TextView ) ( v . findViewById ( highestBid ) ) ) ; highestBid . setText ( item . getItemDescription ( ) . getHighestBid ( ) . toString ( ) ) ; } TextView saleStatus = ( ( TextView ) ( v . findViewById ( saleStatus ) ) ) ; saleStatus . setText ( item . getSaleStatus ( ) ) ; } } ; list . setAdapter ( adapter ) ; } No newline ; at end ; of file ; }

Fix:
Query queryRef = firebaseRef . orderByChild ( "priority" ) ;
Buggy code:
@ WebServlet ( name = "RoutesTableLoader" , urlPatterns = { "//RoutesTableLoader" } ) public class RoutesTableLoader extends HttpServlet { protected void processRequest ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { TrackPersistanceDAO dao = new TrackPersistanceDAO ( ) ; List < Route > routeList ; String data = "{<seq2seq4repair_space>\"routes\":[" ; boolean fst = true ; response . setContentType ( "text//html;charset=UTF-8" ) ; PrintWriter out = response . getWriter ( ) ; try { if ( ( request . getParameter ( "mine" ) ) == null ) routeList = dao . getAllRoutes ( ) ; else { Authentication auth = SecurityContextHolder . getContext ( ) . getAuthentication ( ) ; String name = auth . getName ( ) ; UserPersistanceDAO userDao = new UserPersistanceDAO ( ) ; User user ; user = userDao . retrieveByUserUsername ( name ) ; routeList = dao . getRoutesByUsername ( user ) ; } for ( Route route : routeList ) { if ( ! fst ) { data += "," ; } <START_BUG> data += ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "[\"" + ( route . getRefRoute ( ) ) ) + "\",<seq2seq4repair_space>\"" ) + ( route . getRouteName ( ) ) ) + "\",<seq2seq4repair_space>\"" ) + ( route . getDescription ( ) ) ) + "\",<seq2seq4repair_space>\"" ) + ( ( Math . round ( ( ( route . getTrackDistance ( ) ) * 100 ) ) ) // 100 ) ) + "\",<seq2seq4repair_space>\"" ) + ( route . getTotalAscend ( ) ) ) + "\",<seq2seq4repair_space>\"" ) + ( route . getTotalDescend ( ) ) ) + "\",<seq2seq4repair_space>\"" ) + ( route . getMinHeight ( ) ) ) + "\",<seq2seq4repair_space>\"" ) + ( route . getMaxHeight ( ) ) ) + "\"]" ; <END_BUG> fst = false ; } data += "]}" ; System . out . println ( ( "Respuesta<seq2seq4repair_space>=<seq2seq4repair_space>" + data ) ) ; out . write ( data ) ; } finally { out . close ( ) ; } } @ Override protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ Override protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ Override public String getServletInfo ( ) { } }

Fix:
data += ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "[\"" + ( route . getRefRoute ( ) ) ) + "\",<seq2seq4repair_space>\"" ) + ( route . getRouteName ( ) ) ) + "\",<seq2seq4repair_space>\"" ) + ( route . getDescription ( ) ) ) + "\",<seq2seq4repair_space>\"" ) + ( ( Math . round ( ( ( route . getTrackDistance ( ) ) * 100 ) ) ) // 100 ) ) + "\",<seq2seq4repair_space>\"" ) + ( route . getTotalAscend ( ) ) ) + "\",<seq2seq4repair_space>\"" ) + ( route . getTotalDescend ( ) ) ) + "\",<seq2seq4repair_space>\"" ) + ( route . getMinHeight ( ) ) ) + "\",<seq2seq4repair_space>\"" ) + ( route . getMaxHeight ( ) ) ) + "\",<seq2seq4repair_space>\"" ) + ( route . getUser ( ) . getUsername ( ) ) ) + "\"]" ;
Buggy code:
public class SourceFileWriter extends ASTScanner implements Pass { public final NativeCodeEmitter emitter ; public SourceFileWriter ( NativeCodeEmitter emitter ) { } public void runOn ( SourceFile sourceFile ) throws ACCError { } protected FunctionDecl currentFunction ; public void visitSourceFile ( SourceFile node ) throws ACCError { } public void visitFunctionDecl ( FunctionDecl node ) throws ACCError { } public void visitIncludeDecl ( IncludeDecl node ) { } public void visitDataDecl ( DataDecl node ) throws ACCError { if ( ( node . label ) != null ) emitter . emitLabel ( node . label ) ; if ( ( node . stringConstant ) != null ) { emitter . emitStringConstant ( node . stringConstant ) ; if ( node . isTerminatedString ) { emitter . emitStringTerminator ( ) ; } } else if ( ( node . expr ) instanceof NumericConstant ) { NumericConstant nc = ( ( NumericConstant ) ( node . expr ) ) ; emitter . emitAsData ( nc ) ; } else if ( ( node . expr ) instanceof Identifier ) { Identifier id = ( ( Identifier ) ( node . expr ) ) ; emitter . emitAsData ( id ) ; } else { <START_BUG> throw new ACCInternalError ( "invalid<seq2seq4repair_space>data<seq2seq4repair_space>for<seq2seq4repair_space>" , node ) ; <END_BUG> } } public void visitVarDecl ( VarDecl node ) throws ACCError { } }

Fix:
throw new ACCInternalError ( ( "invalid<seq2seq4repair_space>data<seq2seq4repair_space>for<seq2seq4repair_space>" + node ) , node ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ ServerSetup ( { RunAsMDBUnitTestCase . JmsQueueSetup . class } ) @ Category ( CommonCriteria . class ) public class RunAsMDBUnitTestCase { private static final Logger log = Logger . getLogger ( RunAsMDBUnitTestCase . class . getName ( ) ) ; private static final String queueName = "queue//mdbtest" ; static class JmsQueueSetup implements ServerSetupTask { private JMSOperations jmsAdminOperations ; @ Override public void setup ( ManagementClient managementClient , String containerId ) throws Exception { } @ Override public void tearDown ( ManagementClient managementClient , String containerId ) throws Exception { } } @ ArquillianResource InitialContext ctx ; @ Deployment public static Archive < ? > deploy ( ) { } protected < T > T lookup ( String name , Class < T > cls ) throws Exception { } @ Test public void testSendMessage ( ) throws Exception { ConnectionFactory connFactory = lookup ( "ConnectionFactory" , ConnectionFactory . class ) ; Connection conn = connFactory . createConnection ( ) ; conn . start ( ) ; Session session = conn . createSession ( false , AUTO_ACKNOWLEDGE ) ; TemporaryQueue replyQueue = session . createTemporaryQueue ( ) ; TextMessage msg = session . createTextMessage ( "Hello<seq2seq4repair_space>world" ) ; msg . setJMSDeliveryMode ( NON_PERSISTENT ) ; msg . setJMSReplyTo ( replyQueue ) ; Queue queue = lookup ( ( "java:jboss//" + ( RunAsMDBUnitTestCase . queueName ) ) , Queue . class ) ; MessageProducer producer = session . createProducer ( queue ) ; producer . send ( msg ) ; MessageConsumer consumer = session . createConsumer ( replyQueue ) ; Message replyMsg = consumer . receive ( 5000 ) ; Assert . assertNotNull ( replyMsg ) ; if ( replyMsg instanceof ObjectMessage ) { Exception e = ( ( Exception ) ( ( ( ObjectMessage ) ( replyMsg ) ) . getObject ( ) ) ) ; throw e ; } Assert . assertTrue ( ( replyMsg instanceof TextMessage ) ) ; String actual = ( ( TextMessage ) ( replyMsg ) ) . getText ( ) ; Assert . assertEquals ( "SUCCESS" , actual ) ; consumer . close ( ) ; producer . close ( ) ; session . close ( ) ; <START_BUG> conn . stop ( ) ; <END_BUG> } }

Fix:
conn . close ( ) ;
Buggy code:
@ Path ( "//hello-world" ) @ Produces ( MediaType . APPLICATION_JSON ) public class HelloWorldResource { final String ALREADY_EXISTS_ERROR = "X0Y32" ; private final String template ; private final String defaultName ; private final AtomicLong counter ; private final HttpClient httpClient ; private final MyDAO dao ; private final IDBI jdbi ; public HelloWorldResource ( String template , String defaultName , HttpClient httpClient , IDBI jdbi , MyDAO dao ) { } @ GET @ Timed public Saying sayHello ( @ QueryParam ( "name" ) Optional < String > name , @ QueryParam ( "sleep" ) Optional < Integer > sleepParameter ) throws SuspendExecution , InterruptedException { } @ GET @ Path ( "//http" ) @ Timed public String sayGoodye ( @ QueryParam ( "name" ) Optional < String > name ) throws SuspendExecution , InterruptedException { } @ GET @ Path ( "//db//create" ) @ Timed public String createdb ( @ QueryParam ( "name" ) Optional < String > name ) throws SuspendExecution , InterruptedException { } @ GET @ Path ( "//db//insert" ) @ Timed public String insertdb ( @ QueryParam ( "name" ) Optional < String > name ) throws SuspendExecution , InterruptedException { } @ GET @ Path ( "//db//query" ) @ Timed public String query ( @ QueryParam ( "id" ) Optional < Integer > id ) throws SuspendExecution , InterruptedException { try ( Handle h = jdbi . open ( ) ) { <START_BUG> String first = h . createQuery ( "select<seq2seq4repair_space>name<seq2seq4repair_space>from<seq2seq4repair_space>something<seq2seq4repair_space>where<seq2seq4repair_space>id<seq2seq4repair_space>=<seq2seq4repair_space>:id" ) . bind ( "id" , id ) . map ( FIRST ) . first ( ) ; <END_BUG> return first != null ? first : null ; } } @ GET @ Path ( "//db//dao" ) @ Timed public String daoQuery ( @ QueryParam ( "id" ) Optional < Integer > id ) throws SuspendExecution , InterruptedException { } }

Fix:
String first = h . createQuery ( "select<seq2seq4repair_space>name<seq2seq4repair_space>from<seq2seq4repair_space>something<seq2seq4repair_space>where<seq2seq4repair_space>id<seq2seq4repair_space>=<seq2seq4repair_space>:id" ) . bind ( "id" , id . or ( 1 ) ) . map ( FIRST ) . first ( ) ;
Buggy code:
public class XSModelGroupImpl implements XSModelGroup { public static final short MODELGROUP_CHOICE = 101 ; public static final short MODELGROUP_SEQUENCE = 102 ; public static final short MODELGROUP_ALL = 103 ; public short fCompositor ; public XSParticleDecl [ ] fParticles = null ; public int fParticleCount = 0 ; public XSAnnotationImpl fAnnotation ; public boolean isEmpty ( ) { } public int minEffectiveTotalRange ( ) { } private int minEffectiveTotalRangeAllSeq ( ) { } private int minEffectiveTotalRangeChoice ( ) { } public int maxEffectiveTotalRange ( ) { } private int maxEffectiveTotalRangeAllSeq ( ) { } private int maxEffectiveTotalRangeChoice ( ) { int max = 0 ; int one ; if ( ( fParticleCount ) > 0 ) { <START_BUG> max = fParticles [ 0 ] . minEffectiveTotalRange ( ) ; <END_BUG> if ( max == ( SchemaSymbols . OCCURRENCE_UNBOUNDED ) ) return SchemaSymbols . OCCURRENCE_UNBOUNDED ; } for ( int i = 1 ; i < ( fParticleCount ) ; i ++ ) { one = fParticles [ i ] . maxEffectiveTotalRange ( ) ; if ( one == ( SchemaSymbols . OCCURRENCE_UNBOUNDED ) ) return SchemaSymbols . OCCURRENCE_UNBOUNDED ; if ( one > max ) max = one ; } return max ; } private String fDescription = null ; public String toString ( ) { } public void reset ( ) { } public short getType ( ) { } public String getName ( ) { } public String getNamespace ( ) { } public short getCompositor ( ) { } public XSObjectList getParticles ( ) { } public XSAnnotation getAnnotation ( ) { } public XSNamespaceItem getNamespaceItem ( ) { } }

Fix:
max = fParticles [ 0 ] . maxEffectiveTotalRange ( ) ;