nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ClearAllReceiver extends BroadcastReceiver { public enum ClearType { SCREEN , NOTIFY ; } @ Override public void onReceive ( Context context , Intent intent ) { } public static synchronized void clearAll ( Context context ) { } public static synchronized void setCancel ( Context context , int timeout , ClearAllReceiver . ClearType type ) { } private static synchronized void removeCancel ( Context context , ClearAllReceiver . ClearType type ) { } private static void doCancel ( Context context , ClearAllReceiver . ClearType type ) { } private static PendingIntent getPendingIntent ( Context context , ClearAllReceiver . ClearType type ) { Intent intent = ClearAllReceiver . getClearIntent ( context , type ) ; <START_BUG> return PendingIntent . getBroadcast ( context , 0 , intent , FLAG_CANCEL_CURRENT ) ; <END_BUG> } public static Intent getClearIntent ( Context context , ClearAllReceiver . ClearType type ) { } }

Fix:
return PendingIntent . getBroadcast ( context , 0 , intent , FLAG_UPDATE_CURRENT ) ;
Buggy code:
public class ReadMasterDomainModelHandler implements OperationStepHandler , DescriptionProvider { public static final String OPERATION_NAME = "read-master-domain-model" ; private final Transformers transformers ; public ReadMasterDomainModelHandler ( final Transformers transformers ) { } private Resource transformResource ( final OperationContext context , Resource root ) throws OperationFailedException { } public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { context . acquireControllerLock ( ) ; final Resource untransformedRoot = context . readResource ( EMPTY_ADDRESS , true ) ; final Resource root = transformResource ( context , untransformedRoot ) ; context . getResult ( ) . set ( ReadMasterDomainModelHandler . describeAsNodeList ( root ) ) ; <START_BUG> context . completeStep ( ) ; <END_BUG> } private static List < ModelNode > describeAsNodeList ( final Resource resource ) { } private static void describe ( final PathAddress base , final Resource resource , List < ModelNode > nodes ) { } public ModelNode getModelDescription ( Locale locale ) { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class XorRawEncoder extends AbstractRawErasureEncoder { public XorRawEncoder ( int dataSize , int chunkSize ) { } @ Override protected void doEncode ( ByteBuffer [ ] inputs , ByteBuffer [ ] outputs ) { int bufSize = inputs [ 0 ] . remaining ( ) ; for ( int j = 0 ; j < bufSize ; j ++ ) { outputs [ 0 ] . put ( j , inputs [ 0 ] . get ( j ) ) ; } for ( int i = 1 ; i < ( inputs . length ) ; i ++ ) { for ( int j = 0 ; j < bufSize ; j ++ ) { <START_BUG> outputs [ 0 ] . put ( j , ( ( byte ) ( ( outputs [ 0 ] . get ( j ) ) ^ ( inputs [ 0 ] . get ( j ) ) ) ) ) ; <END_BUG> } } } @ Override protected void doEncode ( byte [ ] [ ] inputs , byte [ ] [ ] outputs ) { } @ Override protected void doEncode ( ECChunk [ ] inputs , ECChunk [ ] outputs ) { } }

Fix:
outputs [ 0 ] . put ( j , ( ( byte ) ( ( outputs [ 0 ] . get ( j ) ) ^ ( inputs [ i ] . get ( j ) ) ) ) ) ;
Buggy code:
public class DevicesListView extends ListActivity { private static final int DEVICE_VIEW = 0 ; private List < JSONItem > items ; private static DevicesListView instance ; private DevicesListView . DataReceiver receiver ; private TextView lastRefresh ; public List < JSONItem > getItems ( ) { } public void setItems ( List < JSONItem > arrayList ) { } public static DevicesListView getInstance ( ) { } @ Override protected void onCreate ( final Bundle savedState ) { } @ Override protected void onListItemClick ( final ListView listView , final View view , final int position , final long idVal ) { } protected void getData ( ) { } @ Override protected void onPause ( ) { } @ Override protected void onResume ( ) { } protected void updateList ( ) { JSONParsingResults results = new JSONParser ( ) . returnParsedData ( "//devices.json" ) ; setItems ( results . getItem ( ) ) ; setListAdapter ( new android . widget . ArrayAdapter < String > ( this , layout . simple_list_item_1 , results . getNames ( ) ) ) ; <START_BUG> lastRefresh . setText ( ( "Refreshed<seq2seq4repair_space>on:<seq2seq4repair_space>" + ( new Date ( new File ( ( ( getFilesDir ( ) . toString ( ) ) + "//devices.xml" ) ) . lastModified ( ) ) . toString ( ) ) ) ) ; <END_BUG> } class DataReceiver extends BroadcastReceiver { @ Override public void onReceive ( Context arg0 , Intent arg1 ) { } } No newline ; at end ; of file ; }

Fix:
lastRefresh . setText ( ( "Refreshed<seq2seq4repair_space>on:<seq2seq4repair_space>" + ( new Date ( new File ( ( ( getFilesDir ( ) . toString ( ) ) + "//devices.json" ) ) . lastModified ( ) ) . toString ( ) ) ) ) ;
Buggy code:
public abstract class Application { private static Log log = LogFactory . getLog ( Application . class ) ; private List componentResolvers = new ArrayList ( ) ; private IConverterFactory converterFactory = new ConverterFactory ( ) ; private final Localizer localizer ; private final MarkupCache markupCache ; private final String name ; private final Map nameToResourceFactory = new HashMap ( ) ; private final ApplicationPages pages = new ApplicationPages ( ) ; private ResourceStreamLocator resourceStreamLocator ; private ModificationWatcher resourceWatcher ; private ApplicationSettings settings ; private final SharedResources sharedResources ; private ICrypt crypt ; private static ThreadLocal applicationObjects = new ThreadLocal ( ) ; public static Application get ( ) { } public static void set ( Application application ) { } public Application ( ) { } public final void addResourceFactory ( final String name , final IResourceFactory resourceFactory ) { } public final List getComponentResolvers ( ) { } public IConverterFactory getConverterFactory ( ) { } public Localizer getLocalizer ( ) { } public final MarkupCache getMarkupCache ( ) { } public final String getName ( ) { } public final ApplicationPages getPages ( ) { } public final Iterator getPageSets ( final Page page ) { } public final IResourceFactory getResourceFactory ( final String name ) { } public ResourceStreamLocator getResourceStreamLocator ( ) { } public final ModificationWatcher getResourceWatcher ( ) { } public ApplicationSettings getSettings ( ) { } public ApplicationSettings createApplicationSettings ( ) { } public final SharedResources getSharedResources ( ) { } public synchronized ICrypt newCrypt ( ) { } public MarkupParser newMarkupParser ( final MarkupContainer container ) { } protected abstract ISessionFactory getSessionFactory ( ) { } protected void init ( ) { } protected void internalInit ( ) { } final void resourceFinderChanged ( ) { } private final void initializeComponents ( ) { } private void initializeComponents ( final Properties properties ) { } private void initialize ( final String className ) { if ( ! ( Strings . isEmpty ( className ) ) ) { try { <START_BUG> Class c = Class . forName ( className ) ; <END_BUG> ( ( IInitializer ) ( c . newInstance ( ) ) ) . init ( this ) ; } catch ( ClassCastException e ) { throw new WicketRuntimeException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>initialize<seq2seq4repair_space>" + className ) , e ) ; } catch ( ClassNotFoundException e ) { throw new WicketRuntimeException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>initialize<seq2seq4repair_space>" + className ) , e ) ; } catch ( InstantiationException e ) { throw new WicketRuntimeException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>initialize<seq2seq4repair_space>" + className ) , e ) ; } catch ( IllegalAccessException e ) { throw new WicketRuntimeException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>initialize<seq2seq4repair_space>" + className ) , e ) ; } } } }

Fix:
Class c = getClass ( ) . getClassLoader ( ) . loadClass ( className ) ;
Buggy code:
public class SyncJudgeDataHandler extends EventHandler { public SyncJudgeDataHandler ( EventHandler nextHandler ) { } @ Override public void handle ( JSONObject msg ) { try { if ( msg . getString ( "msg_type" ) . equals ( "syncjudgedata" ) ) { ProblemManager problemManager = new ProblemManager ( ) ; String problemID = msg . getString ( "problem_id" ) ; String status = msg . getString ( "status" ) ; if ( status . equals ( "OK" ) ) { <START_BUG> JSONObject content = new JSONObject ( msg . get ( "content" ) ) ; <END_BUG> String input = content . getString ( "input" ) ; String output = content . getString ( "output" ) ; String judgeMethod = content . getString ( "judge_method" ) ; int timeLimit = Integer . valueOf ( content . getString ( "time_limit" ) ) ; int memoryLimit = Integer . valueOf ( content . getString ( "memory_limit" ) ) ; int testDataTimeStamp = Integer . valueOf ( content . getString ( "testdata_time_stamp" ) ) ; problemManager . updateTestData ( problemID , testDataTimeStamp , input , output , judgeMethod ) ; } } else doNext ( msg ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } } }

Fix:
JSONObject content = msg . getJSONObject ( "content" ) ;
Buggy code:
public class Bitcoind { private static final BigDecimal TX_FEE = BigDecimal . valueOf ( 1.0E-4 ) ; public static class Pair < T , U > { public final T t ; public final U u ; public Pair ( T t , U u ) { } } public static String getNewAddress ( String user ) { } public static Bitcoind . Pair < String , Long > sweepFunds ( Integer id , String target ) { BitcoindInterface btcdInterface = BitcoindClusters . getClusterInterface ( id ) ; if ( btcdInterface == null ) return new Bitcoind . Pair < String , Long > ( "Cannot<seq2seq4repair_space>find<seq2seq4repair_space>cluster" , ( - 1L ) ) ; BigDecimal clusterBalance = btcdInterface . getbalance ( ) ; if ( clusterBalance == null ) return new Bitcoind . Pair < String , Long > ( "Cannot<seq2seq4repair_space>fetch<seq2seq4repair_space>cluster<seq2seq4repair_space>balance" , ( - 1L ) ) ; String txHash = btcdInterface . sendtoaddress ( target , clusterBalance . subtract ( Bitcoind . TX_FEE ) ) ; <START_BUG> return new Bitcoind . Pair < String , Long > ( txHash , clusterBalance . multiply ( BigDecimal . valueOf ( ( 10 ^ 8 ) ) ) . longValueExact ( ) ) ; <END_BUG> } public static Info getInfo ( Integer clusterId ) { } public static List < String > getAddresses ( String user ) { } private static final ObjectMapper mapper = new ObjectMapper ( ) ; public static List < ObjectNode > getTransactions ( String user , int page ) { } }

Fix:
return new Bitcoind . Pair < String , Long > ( txHash , clusterBalance . multiply ( BigDecimal . valueOf ( ( 10 ^ 8 ) ) ) . longValue ( ) ) ;
Buggy code:
public class UrlCompressingWebCodingStrategy extends WebRequestCodingStrategy { protected CharSequence encode ( RequestCycle requestCycle , IListenerInterfaceRequestTarget requestTarget ) { final RequestListenerInterface rli = requestTarget . getRequestListenerInterface ( ) ; final AppendingStringBuffer url = new AppendingStringBuffer ( 64 ) ; url . append ( '?' ) ; url . append ( INTERFACE_PARAMETER_NAME ) ; url . append ( '=' ) ; final Component component = requestTarget . getTarget ( ) ; final Page page = component . getPage ( ) ; final IPageMap pageMap = page . getPageMap ( ) ; if ( ! ( pageMap . isDefault ( ) ) ) { url . append ( pageMap . getName ( ) ) ; } url . append ( PATH_SEPARATOR ) ; String listenerName = rli . getName ( ) ; if ( ( page instanceof WebPage ) && ( ! ( "IResourceListener" . equals ( listenerName ) ) ) ) { url . append ( page . getId ( ) ) ; url . append ( PATH_SEPARATOR ) ; url . append ( ( ( WebPage ) ( page ) ) . getUrlCompressor ( ) . getUIDForComponentAndInterface ( component , listenerName ) ) ; listenerName = null ; } else { url . append ( component . getPath ( ) ) ; } url . append ( PATH_SEPARATOR ) ; final int versionNumber = component . getPage ( ) . getCurrentVersionNumber ( ) ; if ( ! ( rli . getRecordsPageVersion ( ) ) ) { url . append ( LATEST_VERSION ) ; } else if ( versionNumber > 0 ) { url . append ( versionNumber ) ; } url . append ( PATH_SEPARATOR ) ; if ( ( listenerName != null ) && ( ! ( INTERFACE . getName ( ) . equals ( listenerName ) ) ) ) { url . append ( listenerName ) ; } url . append ( PATH_SEPARATOR ) ; RequestParameters params = requestTarget . getRequestParameters ( ) ; if ( ( params != null ) && ( ( params . getBehaviorId ( ) ) != null ) ) { url . append ( params . getBehaviorId ( ) ) ; } url . append ( PATH_SEPARATOR ) ; if ( ( params != null ) && ( ( params . getUrlDepth ( ) ) != 0 ) ) { url . append ( params . getUrlDepth ( ) ) ; } <START_BUG> if ( IActivePageBehaviorListener . INTERFACE . getName ( ) . equals ( listenerName ) ) { <END_BUG> url . append ( ( ( url . indexOf ( "?" ) ) > ( - 1 ) ? "&amp;" : "?" ) ) . append ( IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME ) . append ( "=true" ) ; } return requestCycle . getOriginalResponse ( ) . encodeURL ( url ) ; } }

Fix:
if ( IActivePageBehaviorListener . INTERFACE . getName ( ) . equals ( rli . getName ( ) ) ) {
Buggy code:
public interface DistributableSessionIdentifierCodecBuilder { <START_BUG> ServiceBuilder < SessionIdentifierCodec > build ( ServiceTarget target , ServiceName name , String deploymentName ) ; <END_BUG> ServiceBuilder < ? > buildServerDependency ( ServiceTarget target ) { } }

Fix:
ServiceBuilder < SessionIdentifierCodec > build ( ServiceTarget target , ServiceName name , ServiceName deploymentServiceName ) ;
Buggy code:
public class PageRequestTarget implements IPageRequestTarget , IAccessChecker { private final Page page ; public PageRequestTarget ( Page page ) { } public void respond ( RequestCycle requestCycle ) { if ( requestCycle . getRedirect ( ) ) { requestCycle . redirectTo ( page ) ; } else { <START_BUG> requestCycle . setUpdateCluster ( true ) ; <END_BUG> page . doRender ( ) ; } } public final Page getPage ( ) { } public void cleanUp ( RequestCycle requestCycle ) { } public boolean synchronizeOnSession ( RequestCycle requestCycle ) { } public boolean checkAccess ( RequestCycle requestCycle ) { } public boolean equals ( Object obj ) { } public int hashCode ( ) { } public String toString ( ) { } }

Fix:
requestCycle . setUpdateSession ( true ) ;
Buggy code:
class MethodBinding implements IMethodBinding { private static final int VALID_MODIFIERS = ( ( ( ( ( ( ( ( Modifier . PUBLIC ) | ( Modifier . PROTECTED ) ) | ( Modifier . PRIVATE ) ) | ( Modifier . ABSTRACT ) ) | ( Modifier . STATIC ) ) | ( Modifier . FINAL ) ) | ( Modifier . SYNCHRONIZED ) ) | ( Modifier . NATIVE ) ) | ( Modifier . STRICTFP ) ; private static final ITypeBinding [ ] NO_TYPE_BINDINGS = new ITypeBinding [ 0 ] ; private org . eclipse . jdt . internal . compiler . lookup . MethodBinding binding ; private BindingResolver resolver ; private ITypeBinding [ ] parameterTypes ; private ITypeBinding [ ] exceptionTypes ; private String name ; private ITypeBinding declaringClass ; private ITypeBinding returnType ; private String key ; private ITypeBinding [ ] typeParameters ; private ITypeBinding [ ] typeArguments ; MethodBinding ( BindingResolver resolver , org . eclipse . jdt . internal . compiler . lookup . MethodBinding binding ) { } public boolean isConstructor ( ) { } public boolean isDefaultConstructor ( ) { } public String getName ( ) { } public ITypeBinding getDeclaringClass ( ) { } public ITypeBinding [ ] getParameterTypes ( ) { } public ITypeBinding getReturnType ( ) { } private String getSignature ( Type type ) { } private void getFullyQualifiedName ( Type type , StringBuffer buffer ) { } public ITypeBinding [ ] getExceptionTypes ( ) { } public IJavaElement getJavaElement ( ) { } public int getKind ( ) { } public int getModifiers ( ) { } public boolean isDeprecated ( ) { } public boolean isSynthetic ( ) { } public boolean isVarargs ( ) { } public String getKey ( ) { } public boolean isEqualTo ( IBinding other ) { } public ITypeBinding [ ] getTypeParameters ( ) { } public boolean isGenericMethod ( ) { } public ITypeBinding [ ] getTypeArguments ( ) { } public boolean isParameterizedMethod ( ) { } public boolean isRawMethod ( ) { <START_BUG> return ! ( ( this . binding ) instanceof ParameterizedGenericMethodBinding ) ; <END_BUG> } public IMethodBinding getErasure ( ) { } public String toString ( ) { } }

Fix:
return ( ! ( isParameterizedMethod ( ) ) ) && ( ! ( isGenericMethod ( ) ) ) ;
Buggy code:
class SourceMethod extends NamedMember implements IMethod { protected String [ ] fParameterTypes ; protected SourceMethod ( JavaElement parent , String name , String [ ] parameterTypes ) { } protected void closing ( Object info ) throws JavaModelException { } public boolean equals ( Object o ) { } protected boolean equalsDOMNode ( IDOMNode node ) { } public int getElementType ( ) { } public String [ ] getExceptionTypes ( ) throws JavaModelException { } protected void getHandleMemento ( StringBuffer buff ) { } protected char getHandleMementoDelimiter ( ) { } public int getNumberOfParameters ( ) { } public String [ ] getParameterNames ( ) throws JavaModelException { } public String [ ] getParameterTypes ( ) { } public ITypeParameter getTypeParameter ( String typeParameterName ) { } public ITypeParameter [ ] getTypeParameters ( ) throws JavaModelException { } public String [ ] getTypeParameterSignatures ( ) throws JavaModelException { } public IJavaElement getPrimaryElement ( boolean checkOwner ) { } public String getReturnType ( ) throws JavaModelException { } public String getSignature ( ) throws JavaModelException { } public int hashCode ( ) { } public boolean isConstructor ( ) throws JavaModelException { } public boolean isMainMethod ( ) throws JavaModelException { } public boolean isSimilar ( IMethod method ) { <START_BUG> return this . areSimilarMethods ( this . getElementName ( ) , this . getParameterTypes ( ) , method . getElementName ( ) , method . getParameterTypes ( ) , null ) ; <END_BUG> } public String readableName ( ) { } protected boolean signatureEquals ( IDOMMethod method ) { } protected void toStringInfo ( int tab , StringBuffer buffer , Object info ) { } protected void toStringName ( StringBuffer buffer ) { } protected void toStringName ( StringBuffer buffer , int flags ) { } }

Fix:
return Member . areSimilarMethods ( this . getElementName ( ) , this . getParameterTypes ( ) , method . getElementName ( ) , method . getParameterTypes ( ) , null ) ;
Buggy code:
public abstract class Node implements Comparable < Node > { public static final byte LEAF_BYTE = '+' ; private byte [ ] bytes ; private int b_off ; private int b_len ; private String token ; protected SpatialRelation shapeRel ; private SpatialPrefixTree spatialPrefixTree ; protected Node ( SpatialPrefixTree spatialPrefixTree , String token ) { } protected Node ( SpatialPrefixTree spatialPrefixTree , byte [ ] bytes , int off , int len ) { } public void reset ( byte [ ] bytes , int off , int len ) { } private void b_fixLeaf ( ) { } public SpatialRelation getShapeRel ( ) { } public boolean isLeaf ( ) { } public void setLeaf ( ) { } public String getTokenString ( ) { } public byte [ ] getTokenBytes ( ) { } public int getLevel ( ) { } public Collection < Node > getSubCells ( Shape shapeFilter ) { if ( shapeFilter instanceof Point ) { return Collections . singleton ( getSubCell ( ( ( Point ) ( shapeFilter ) ) ) ) ; } Collection < Node > cells = getSubCells ( ) ; if ( shapeFilter == null ) { return cells ; } List < Node > copy = new ArrayList < Node > ( cells . size ( ) ) ; for ( Node cell : cells ) { <START_BUG> SpatialRelation rel = cell . getShape ( ) . relate ( shapeFilter , spatialPrefixTree . ctx ) ; <END_BUG> if ( rel == ( SpatialRelation . DISJOINT ) ) continue ; cell . shapeRel = rel ; copy . add ( cell ) ; } cells = copy ; return cells ; } public abstract Node getSubCell ( Point p ) { } protected abstract Collection < Node > getSubCells ( ) { } public abstract int getSubCellsSize ( ) { } public abstract Shape getShape ( ) { } public Point getCenter ( ) { } @ Override public int compareTo ( Node o ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } }

Fix:
SpatialRelation rel = cell . getShape ( ) . relate ( shapeFilter ) ;
Buggy code:
public class PartOfSpeechFilterTest { PreprocessComponent < PartOfSpeechFilterTest . Term , TestEdge > mockGraph ; Graph < PartOfSpeechFilterTest . Term , TestEdge > graph = new edu . uci . ics . jung . graph . UndirectedSparseGraph ( ) ; HashMap < PartOfSpeechFilterTest . Term , String > content = new HashMap < > ( ) ; PartOfSpeechFilter < PartOfSpeechFilterTest . Term , TestEdge > p ; @ Before public void setUp ( ) throws Exception { } @ Test public void testExecute ( ) { String text1 = "Peter<seq2seq4repair_space>have<seq2seq4repair_space>a<seq2seq4repair_space>Beautiful<seq2seq4repair_space>bear" ; PartOfSpeechFilterTest . Term key1 = new PartOfSpeechFilterTest . Term ( ) ; graph . addVertex ( key1 ) ; this . content . put ( key1 , text1 ) ; String text2 = "COMPUTER<seq2seq4repair_space>TERMINAL<seq2seq4repair_space>SYSTEMS" ; PartOfSpeechFilterTest . Term key2 = new PartOfSpeechFilterTest . Term ( ) ; graph . addVertex ( key2 ) ; content . put ( key2 , text2 ) ; p = new PartOfSpeechFilter ( mockGraph , content ) ; p . execute ( createMock ( File . class ) ) ; <START_BUG> assertSame ( "should<seq2seq4repair_space>have<seq2seq4repair_space>5<seq2seq4repair_space>words" , 5 , p . vertexTerms . size ( ) ) ; <END_BUG> } private class Term { } }

Fix:
assertSame ( "should<seq2seq4repair_space>have<seq2seq4repair_space>5<seq2seq4repair_space>words" , 5 , p . vertexResultsTerms . size ( ) ) ;
Buggy code:
public class NewsListViewFragment extends Fragment { private NewsAdapter adapter ; private Future < List < DataAccessNews > > loading ; private SwipeRefreshLayout swipeRefreshLayout ; public NewsListViewFragment ( ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { View view = inflater . inflate ( fragment_news_list , container , false ) ; swipeRefreshLayout = ( ( SwipeRefreshLayout ) ( view . findViewById ( newsSwipeContainer ) ) ) ; swipeRefreshLayout . setOnRefreshListener ( new SwipeRefreshLayout . OnRefreshListener ( ) { @ Override public void onRefresh ( ) { swipeRefreshLayout . setRefreshing ( true ) ; swipeRefreshLayout . postDelayed ( new Runnable ( ) { @ Override public void run ( ) { swipeRefreshLayout . setRefreshing ( false ) ; } <START_BUG> } , 4500 ) ; <END_BUG> } } ) ; swipeRefreshLayout . setColorSchemeResources ( kit_cyan_blau , kit_darker_green ) ; adapter = new NewsAdapter ( getActivity ( ) , 0 ) ; final ListView listView = ( ( ListView ) ( view . findViewById ( newsListView ) ) ) ; listView . setAdapter ( adapter ) ; listView . setOnScrollListener ( new AbsListView . OnScrollListener ( ) { @ Override public void onScrollStateChanged ( AbsListView view , int scrollState ) { } @ Override public void onScroll ( AbsListView view , int firstVisibleItem , int visibleItemCount , int totalItemCount ) { boolean enable = false ; if ( ( listView != null ) && ( ( listView . getChildCount ( ) ) > 0 ) ) { boolean firstItemVisible = ( listView . getFirstVisiblePosition ( ) ) == 0 ; boolean topOfFirstItemVisible = ( listView . getChildAt ( 0 ) . getTop ( ) ) == 0 ; enable = firstItemVisible && topOfFirstItemVisible ; } swipeRefreshLayout . setEnabled ( enable ) ; } } ) ; adapter . loadLatest ( ) ; return view ; } @ Override public void onAttach ( Activity activity ) { } @ Override public void onDetach ( ) { } }

Fix:
} , 3500 ) ;
Buggy code:
public final class ContributedAction extends CommandAction { private IEvaluationContext appContext ; private IHandler partHandler ; private boolean localHandler = false ; private IPartListener partListener ; public ContributedAction ( IServiceLocator locator , IConfigurationElement element ) throws CommandNotMappedException { } private void updateSiteAssociations ( IWorkbenchPartSite site , String commandId , String actionId , IConfigurationElement element ) { } public void runWithEvent ( Event event ) { <START_BUG> if ( ( partHandler ) != null ) { <END_BUG> IHandler oldHandler = getParameterizedCommand ( ) . getCommand ( ) . getHandler ( ) ; try { getParameterizedCommand ( ) . getCommand ( ) . setHandler ( partHandler ) ; getParameterizedCommand ( ) . executeWithChecks ( event , appContext ) ; } catch ( ExecutionException e ) { } catch ( NotDefinedException e ) { } catch ( NotEnabledException e ) { } catch ( NotHandledException e ) { } finally { getParameterizedCommand ( ) . getCommand ( ) . setHandler ( oldHandler ) ; } } else { super . runWithEvent ( event ) ; } } public boolean isEnabled ( ) { } private IPartListener getPartListener ( ) { } private void disposeAction ( ) { } }

Fix:
if ( ( ( partHandler ) != null ) && ( ( getParameterizedCommand ( ) ) != null ) ) {
Buggy code:
public class DatashareContainer extends TCPClientSOContainer implements IChannelContainer { protected static final int DEFAULT_CONTAINER_KEEP_ALIVE = 30000 ; protected static final int DEFAULT_TRANSACTION_WAIT = 30000 ; public DatashareContainer ( ISharedObjectContainerConfig config ) { } public IChannel createChannel ( final ID newID , final IChannelListener listener , final Map properties ) throws ECFException { } protected SharedObjectDescription getDefaultChannelDescription ( ) throws IDInstantiationException { } protected ISharedObject createSharedObject ( SharedObjectTypeDescription typeDescription , ISharedObjectTransactionConfig transactionConfig , IChannelListener listener ) throws SharedObjectCreateException { } public IChannel createChannel ( IChannelConfig newChannelConfig ) throws ECFException { SharedObjectDescription sodesc = newChannelConfig . getHostDescription ( ) ; if ( sodesc == null ) sodesc = getDefaultChannelDescription ( ) ; SharedObjectTypeDescription sotypedesc = sodesc . getTypeDescription ( ) ; IChannelListener listener = newChannelConfig . getListener ( ) ; ISharedObjectTransactionConfig transactionConfig = newChannelConfig . getTransactionConfig ( ) ; ISharedObject so = null ; <START_BUG> if ( ( sotypedesc . getDescription ( ) ) != null ) { <END_BUG> so = org . eclipse . ecf . core . SharedObjectFactory . getDefault ( ) . createSharedObject ( sotypedesc , new String [ ] { ISharedObjectTransactionConfig . class . getName ( ) , IChannelListener . class . getName ( ) } , new Object [ ] { transactionConfig , listener } ) ; } else { so = createSharedObject ( sotypedesc , transactionConfig , listener ) ; } IChannel channel = ( ( IChannel ) ( so . getAdapter ( IChannel . class ) ) ) ; if ( channel == null ) throw new SharedObjectCreateException ( ( ( "Cannot<seq2seq4repair_space>coerce<seq2seq4repair_space>object<seq2seq4repair_space>" + channel ) + "<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>IChannel" ) ) ; ID newID = sodesc . getID ( ) ; if ( newID == null ) newID = IDFactory . getDefault ( ) . createGUID ( ) ; Map properties = sodesc . getProperties ( ) ; if ( properties == null ) properties = new HashMap ( ) ; getSharedObjectManager ( ) . addSharedObject ( newID , so , properties ) ; return channel ; } public IChannel getChannel ( ID channelID ) { } public boolean removeChannel ( ID channelID ) { } public Namespace getChannelNamespace ( ) { } }

Fix:
if ( ( sotypedesc . getName ( ) ) != null ) {
Buggy code:
public class OPTRecord extends Record { private static OPTRecord member = new OPTRecord ( ) ; private Map options ; private OPTRecord ( ) { } private OPTRecord ( Name name , short dclass , int ttl ) { } static OPTRecord getMember ( ) { } public OPTRecord ( short payloadSize , byte xrcode , byte version , int flags ) { } public OPTRecord ( short payloadSize , byte xrcode , byte version ) { } Record rrFromWire ( Name name , short type , short dclass , int ttl , int length , DataByteInputStream in ) throws IOException { } Record rdataFromString ( Name name , short dclass , int ttl , Tokenizer st , Name origin ) throws IOException { <START_BUG> throw new TextParseException ( "no<seq2seq4repair_space>text<seq2seq4repair_space>format<seq2seq4repair_space>defined<seq2seq4repair_space>for<seq2seq4repair_space>OPT" ) ; <END_BUG> } public String rdataToString ( ) { } public short getPayloadSize ( ) { } public short getExtendedRcode ( ) { } public short getVersion ( ) { } public int getFlags ( ) { } void rrToWire ( DataByteOutputStream out , Compression c , boolean canonical ) { } }

Fix:
throw st . exception ( "no<seq2seq4repair_space>text<seq2seq4repair_space>format<seq2seq4repair_space>defined<seq2seq4repair_space>for<seq2seq4repair_space>OPT" ) ;
Buggy code:
@ Entity public class GPSTraceItem extends PlaceBookItem { @ JsonIgnore @ Lob private String trace ; private String hash ; GPSTraceItem ( ) { } public GPSTraceItem ( final GPSTraceItem g ) { } public GPSTraceItem ( final User owner ) { } public GPSTraceItem ( final User owner , final URL sourceURL , final String trace ) { } @ Override public void appendConfiguration ( final Document config , final Element root ) { try { <START_BUG> final String path = ( ( PropertiesSingleton . get ( this . getClass ( ) . getClassLoader ( ) ) . getProperty ( IDEN_PKG , "" ) ) + "//" ) + ( getPlaceBook ( ) . getKey ( ) ) ; <END_BUG> if ( ( new File ( path ) . exists ( ) ) || ( new File ( path ) . mkdirs ( ) ) ) { final StringReader reader = new StringReader ( trace ) ; final InputSource isource = new InputSource ( reader ) ; final DocumentBuilder builder = DocumentBuilderFactory . newInstance ( ) . newDocumentBuilder ( ) ; final Document document = builder . parse ( isource ) ; reader . close ( ) ; final String gpxPath = ( ( path + "//" ) + ( getKey ( ) ) ) + ".gpx" ; final File gpxFile = new File ( gpxPath ) ; final Source source = new DOMSource ( document ) ; final Result result = new StreamResult ( gpxFile ) ; final Transformer t = TransformerFactory . newInstance ( ) . newTransformer ( ) ; t . transform ( source , result ) ; final Element item = getConfigurationHeader ( config ) ; final Element filename = config . createElement ( "filename" ) ; filename . appendChild ( config . createTextNode ( gpxFile . getName ( ) ) ) ; item . appendChild ( filename ) ; root . appendChild ( item ) ; } } catch ( final Throwable e ) { log . info ( e . getMessage ( ) , e ) ; } } @ Override public GPSTraceItem deepCopy ( ) { } @ Override public void deleteItemData ( ) { } @ Override public String getEntityName ( ) { } public String getHash ( ) { } public String getTrace ( ) { } public void readTrace ( final InputStream is ) throws Exception { } @ SuppressWarnings ( "unchecked" ) private void setTrace ( final String trace ) { } @ Override public void updateItem ( IUpdateableExternal updateItem ) { } }

Fix:
final String path = ( ( ( ( PropertiesSingleton . get ( this . getClass ( ) . getClassLoader ( ) ) . getProperty ( IDEN_PKG , "" ) ) + "//" ) + ( getPlaceBook ( ) . getPlaceBookBinder ( ) . getKey ( ) ) ) + "//" ) + ( getPlaceBook ( ) . getKey ( ) ) ;
Buggy code:
public abstract class BaseAbstractDaoImpl < Tdao , Tid > { public static final Logger _logger = LoggerFactory . getLogger ( BaseAbstractDaoImpl . class ) ; private Dao < Tdao , Tid > dao ; @ SuppressWarnings ( "unchecked" ) public BaseAbstractDaoImpl ( ConnectionSource connectionSource , Class < Tdao > entity ) throws SQLException { } public Dao < Tdao , Tid > getDao ( ) { } public QueryResponse getQueryResponse ( Query query , String idColumn , String isAlterdTotalCountKey ) throws SQLException { } public QueryResponse getQueryResponse ( Query query , String idColumn ) throws SQLException { } public void create ( Tdao tdao ) { } public void createOrUpdate ( Tdao tdao ) { } public void delete ( Tdao tdao ) { } public void update ( Tdao tdao ) { } public List < Tdao > getAll ( ) { } public Tdao getById ( Tid id ) { } public void deleteByIds ( List < Tid > ids ) { } public void deleteById ( Tid id ) { } public List < Tdao > getAll ( String key , List < Tid > ids ) { try { <START_BUG> return this . getDao ( ) . queryForEq ( key , ids ) ; <END_BUG> } catch ( SQLException ex ) { BaseAbstractDaoImpl . _logger . error ( "unable<seq2seq4repair_space>to<seq2seq4repair_space>get<seq2seq4repair_space>all<seq2seq4repair_space>alarms<seq2seq4repair_space>ids:{}" , ids , ex ) ; return null ; } } public Long countOf ( ) { } }

Fix:
return this . getDao ( ) . queryBuilder ( ) . where ( ) . in ( key , ids ) . query ( ) ;
Buggy code:
public class TestMapServiceFactory { private ServiceFactory factory ; private TestMapServiceFactory . TestedObject o1 ; private TestMapServiceFactory . TestedObject o2 ; private class TestedObject { @ Inject private List injectedList ; @ Inject private Set injectedSet ; @ Inject ( fresh = true ) private Object freshInjectedObject ; @ Inject ( fresh = true , parameters = { "injectedSet" } ) private List freshInjectedListWithParams ; } @ BeforeMethod public void beforeMethod ( ) { <START_BUG> factory = new MapCDIFactory ( ) ; <END_BUG> factory . addService ( List . class , ArrayList . class ) ; factory . addService ( Set . class , new HashSet < Object > ( Arrays . asList ( new Object [ ] { new Object ( ) } ) ) ) ; factory . addService ( Object . class , Object . class ) ; factory . addService ( null , null ) ; o1 = new TestMapServiceFactory . TestedObject ( ) ; o2 = new TestMapServiceFactory . TestedObject ( ) ; } @ Test public void testInjectFields ( ) { } @ Test public void testIjectFreshFields ( ) { } @ Test public void testInjectFreshFieldsWithParams ( ) { } No newline ; at end ; of file ; }

Fix:
factory = new MapServiceFactory ( ) ;
Buggy code:
public class PathMatchingResourcePatternResolver implements ResourcePatternResolver { private static final Log logger = LogFactory . getLog ( PathMatchingResourcePatternResolver . class ) ; private static Method equinoxResolveMethod ; private final ResourceLoader resourceLoader ; private PathMatcher pathMatcher = new AntPathMatcher ( ) ; public PathMatchingResourcePatternResolver ( ) { } public PathMatchingResourcePatternResolver ( ClassLoader classLoader ) { } public PathMatchingResourcePatternResolver ( ResourceLoader resourceLoader ) { } public ResourceLoader getResourceLoader ( ) { } public ClassLoader getClassLoader ( ) { } public void setPathMatcher ( PathMatcher pathMatcher ) { } public PathMatcher getPathMatcher ( ) { } public Resource getResource ( String location ) { } public Resource [ ] getResources ( String locationPattern ) throws IOException { } protected Resource [ ] findAllClassPathResources ( String location ) throws IOException { } protected Resource convertClassLoaderURL ( URL url ) { } protected Resource [ ] findPathMatchingResources ( String locationPattern ) throws IOException { } protected String determineRootDir ( String location ) { } protected Resource resolveRootDirResource ( Resource original ) throws IOException { if ( ( PathMatchingResourcePatternResolver . equinoxResolveMethod ) != null ) { URL url = original . getURL ( ) ; if ( url . getProtocol ( ) . startsWith ( "bundle" ) ) { <START_BUG> return new UrlResource ( ( ( URL ) ( ReflectionUtils . invokeMethod ( PathMatchingResourcePatternResolver . equinoxResolveMethod , null , new Object [ ] { url } ) ) ) ) ; <END_BUG> } } return original ; } protected boolean isJarResource ( Resource resource ) throws IOException { } protected Set < Resource > doFindPathMatchingJarResources ( Resource rootDirResource , String subPattern ) throws IOException { } protected JarFile getJarFile ( String jarFileUrl ) throws IOException { } protected Set < Resource > doFindPathMatchingFileResources ( Resource rootDirResource , String subPattern ) throws IOException { } protected Set < Resource > doFindMatchingFileSystemResources ( File rootDir , String subPattern ) throws IOException { } protected Set < File > retrieveMatchingFiles ( File rootDir , String pattern ) throws IOException { } protected void doRetrieveMatchingFiles ( String fullPattern , File dir , Set < File > result ) throws IOException { } }

Fix:
return new UrlResource ( ( ( URL ) ( ReflectionUtils . invokeMethod ( PathMatchingResourcePatternResolver . equinoxResolveMethod , null , url ) ) ) ) ;
Buggy code:
public abstract class MSVSS extends Task { private static final String SS_EXE = "ss" ; public static final String PROJECT_PREFIX = "$" ; public static final String COMMAND_GET = "Get" ; public static final String COMMAND_CHECKOUT = "Checkout" ; public static final String COMMAND_CHECKIN = "Checkin" ; public static final String COMMAND_LABEL = "Label" ; public static final String COMMAND_HISTORY = "History" ; public static final String FLAG_LOGIN = "-Y" ; public static final String FLAG_OVERRIDE_WORKING_DIR = "-GL" ; public static final String FLAG_AUTORESPONSE_DEF = "-I-" ; public static final String FLAG_AUTORESPONSE_YES = "-I-Y" ; public static final String FLAG_AUTORESPONSE_NO = "-I-N" ; public static final String FLAG_RECURSION = "-R" ; public static final String FLAG_VERSION = "-V" ; public static final String FLAG_VERSION_DATE = "-Vd" ; public static final String FLAG_VERSION_LABEL = "-VL" ; public static final String FLAG_WRITABLE = "-W" ; public static final String VALUE_NO = "-N" ; public static final String VALUE_YES = "-Y" ; public static final String FLAG_QUIET = "-O-" ; private String m_SSDir = "" ; private String m_vssLogin = null ; private String m_vssPath = null ; private String m_serverPath = null ; public final void setLogin ( String login ) { } public final void setServerpath ( String serverPath ) { } public final void setSsdir ( String dir ) { } public final void setVsspath ( String vssPath ) { } public final String getSSCommand ( ) { } public void getLoginCommand ( Commandline cmd ) { } public String getVsspath ( ) { } protected int run ( Commandline cmd ) throws TaskException { try { Execute exe = new Execute ( new org . apache . tools . ant . taskdefs . LogStreamHandler ( this , Project . MSG_INFO , Project . MSG_WARN ) ) ; if ( ( m_serverPath ) != null ) { String [ ] env = exe . getEnvironment ( ) ; if ( env == null ) { env = new String [ 0 ] ; } String [ ] newEnv = new String [ ( env . length ) + 1 ] ; for ( int i = 0 ; i < ( env . length ) ; i ++ ) { newEnv [ i ] = env [ i ] ; } newEnv [ env . length ] = "SSDIR=" + ( m_serverPath ) ; exe . setEnvironment ( newEnv ) ; } exe . setAntRun ( project ) ; <START_BUG> exe . setWorkingDirectory ( project . getBaseDir ( ) ) ; <END_BUG> exe . setCommandline ( cmd . getCommandline ( ) ) ; return exe . execute ( ) ; } catch ( IOException e ) { throw new TaskException ( "Error" , e ) ; } } }

Fix:
exe . setWorkingDirectory ( getBaseDirectory ( ) ) ;
Buggy code:
public class SchemaMatcher extends Matcher { private Map < String , SubNodeDataSet > schema = null ; private Map < String , ArrayList < ArrayList < String > > > table = null ; private Generator generator = null ; private TableBuilder builder = null ; public SchemaMatcher ( Map < String , SubNodeDataSet > schema ) { } private void initTable ( ) { } public Map < String , ArrayList < ArrayList < String > > > getTable ( ) { } public Set < String > getSchema ( String tablename ) { } private String escapeData ( String data ) { } private void appendNonTermnialData ( WrapperObject node , int index , StringBuilder buffer ) { } private void appendNonTerminalListData ( WrapperObject node , StringBuilder buffer ) { } private void getListData ( WrapperObject node , StringBuilder buffer ) { } private void getSiblListData ( WrapperObject node , StringBuilder buffer ) { } private void getSiblData ( WrapperObject node , StringBuilder buffer ) { } private void travaseSubTree ( WrapperObject node , StringBuilder buffer ) { } private void checkingSubNodeType ( WrapperObject node , StringBuilder buffer ) { } private void matchingSubNode ( WrapperObject node , StringBuilder buffer ) { } private String getColumnString ( StringBuilder buffer ) { } private void checkMatchingSubNode ( WrapperObject node , String column , StringBuilder buffer ) { } @ Override public String getColumnData ( WrapperObject subnode , WrapperObject tablenode , String column ) { } private void getFieldData ( String column , ArrayList < String > columndata , WrapperObject subnode , WrapperObject tablenode ) { } @ Override public void getTupleData ( WrapperObject subnode , WrapperObject tablenode , String tablename , SubNodeDataSet columns ) { } @ Override public void getTupleListData ( WrapperObject subnode , WrapperObject tablenode , String tablename , SubNodeDataSet columns ) { } @ Override public boolean isTableName ( String value ) { } private void checkTreeType ( WrapperObject parent , WrapperObject child ) { } @ Override public void matching ( WrapperObject root ) { final Queue < WrapperObject > queue = new LinkedList < WrapperObject > ( ) ; queue . offer ( root ) ; while ( ! ( queue . isEmpty ( ) ) ) { final WrapperObject parent = queue . poll ( ) ; if ( parent . isTerminal ( ) ) { continue ; } final WrapperObject child = parent . get ( 0 ) ; if ( ( child . isTerminal ( ) ) && ( this . isTableName ( child . getText ( ) ) ) ) { final WrapperObject secondchild = parent . get ( 1 ) ; <START_BUG> if ( ! ( this . isTableName ( secondchild . get ( 0 ) . getText ( ) ) ) ) { <END_BUG> this . checkTreeType ( parent , child ) ; continue ; } } for ( int index = 0 ; index < ( parent . size ( ) ) ; index ++ ) { queue . offer ( parent . get ( index ) ) ; } } } @ Override public void match ( WrapperObject root ) { } }

Fix:
if ( ( ! ( secondchild . isTerminal ( ) ) ) && ( ! ( this . isTableName ( secondchild . get ( 0 ) . getText ( ) ) ) ) ) {
Buggy code:
class AnnotationBinding implements IAnnotationBinding { static final AnnotationBinding [ ] NoAnnotations = new AnnotationBinding [ 0 ] ; private org . eclipse . jdt . internal . compiler . lookup . AnnotationBinding binding ; private BindingResolver bindingResolver ; private String key ; AnnotationBinding ( org . eclipse . jdt . internal . compiler . lookup . AnnotationBinding annotation , BindingResolver resolver ) { } public IAnnotationBinding [ ] getAnnotations ( ) { } public ITypeBinding getAnnotationType ( ) { ITypeBinding typeBinding = this . bindingResolver . getTypeBinding ( this . binding . getAnnotationType ( ) ) ; <START_BUG> if ( ( typeBinding == null ) || ( ! ( typeBinding . isAnnotation ( ) ) ) ) <END_BUG> return null ; return typeBinding ; } public IMemberValuePairBinding [ ] getDeclaredMemberValuePairs ( ) { } public IMemberValuePairBinding [ ] getAllMemberValuePairs ( ) { } public IJavaElement getJavaElement ( ) { } public String getKey ( ) { } private String getRecipientKey ( ) { } public int getKind ( ) { } public int getModifiers ( ) { } public String getName ( ) { } public boolean isDeprecated ( ) { } public boolean isEqualTo ( IBinding otherBinding ) { } public boolean isRecovered ( ) { } public boolean isSynthetic ( ) { } public String toString ( ) { } }

Fix:
if ( typeBinding == null )
Buggy code:
public class MainTest extends AjcTestCase { public void testMainbare ( ) { } public void testDashX ( ) { String xoptionText = ResourceBundle . getBundle ( "org.aspectj.ajdt.ajc.messages" ) . getString ( "xoption.usage" ) ; xoptionText = xoptionText . substring ( "{compiler.name}" . length ( ) ) ; CompilationResult result = ajc ( null , new String [ ] { "-X" } ) ; <START_BUG> assertMessages ( result , "Expecting<seq2seq4repair_space>xoptions<seq2seq4repair_space>usage<seq2seq4repair_space>message" , new MessageSpec ( null , null , null , newMessageList ( new Message ( xoptionText ) ) ) ) ; <END_BUG> } }

Fix:
assertMessages ( result , "Expecting<seq2seq4repair_space>xoptions<seq2seq4repair_space>usage<seq2seq4repair_space>message" , new MessageSpec ( null , null , null , newMessageList ( new Message ( xoptionText ) ) , null ) ) ;
Buggy code:
public class BlobAccessorWithMemcache implements BlobAccessor { private static final Logger logger = Logger . getLogger ( BlobAccessorWithMemcache . class . getName ( ) ) ; private static final String PREFIX = "BlobEntry-" ; private static final String PREFIX_LIST = "BlobEntryNameList-" ; private static final int SEGMENT_SIZE = 1000 * 1024 ; private final BlobAccessor blobAccessor ; private final Memcache memcache ; public BlobAccessorWithMemcache ( BlobAccessor blobAccessor , Memcache memcache ) { } private BlobEntry memcacheGet ( String fileName ) { } private void memcachePut ( BlobEntry blobEntry ) { } @ Override public BlobEntry newBlob ( String fileName ) { } @ Override public BlobEntry newBlob ( String fileName , byte [ ] data , String mimeType ) { } @ Override public List < String > getNameList ( String prefix ) throws IOException { } @ Override public BlobEntry getBlob ( String fileName ) throws UnexpectedServerException { <START_BUG> BlobEntry blobEntry = memcacheGet ( ( ( BlobAccessorWithMemcache . PREFIX ) + fileName ) ) ; <END_BUG> if ( blobEntry == null ) { blobEntry = blobAccessor . getBlob ( fileName ) ; memcachePut ( blobEntry ) ; } return blobEntry ; } @ Override public void createOrUpdateBlob ( BlobEntry blobEntry ) throws UnexpectedServerException { } @ Override public void deleteBlob ( BlobEntry blobEntry ) throws UnexpectedServerException { } No newline ; at end ; of file ; }

Fix:
BlobEntry blobEntry = memcacheGet ( fileName ) ;
Buggy code:
@ Component public class PumpSolver { private final PumpProperties pumpProperties ; private IModel model ; private List < Double > lambda ; private double [ ] plasmaCoefficients = new double [ 4 ] ; private double [ ] effectSiteCoefficients = new double [ 4 ] ; private double l1 ; private double l2 ; private double l3 ; private double l4 ; @ Autowired public PumpSolver ( PumpProperties pumpProperties ) { } public void setModel ( final IModel model ) { } public CalculationResponse solve ( final CalculationRequest request ) { Preconditions . checkNotNull ( request ) ; List < InfusionResponse > infusions = new ArrayList < > ( ) ; PumpStatus pumpStatus = new PumpStatus ( request . getMaximumTime ( ) ) ; int time = 0 ; CalculationResponse response = new CalculationResponse ( ) ; try { for ( InfusionRequest infusionRequest : request . getInfusionRequestList ( ) ) { int maxDelta = ( infusionRequest . getEndTime ( ) ) - ( infusionRequest . getStartTime ( ) ) ; boolean isInfusionForPumping = request . isInfusionForPumping ( infusionRequest ) ; <START_BUG> int delta = ( isInfusionForPumping ) ? maxDelta : request . getDeltaTime ( ) ; <END_BUG> for ( int currentDelta = 0 ; currentDelta < maxDelta ; currentDelta += delta ) { double infusion = findNeededInfusion ( infusionRequest , delta , pumpStatus ) ; calculateEffectSiteConcentration ( infusion , delta , pumpStatus ) ; calculatePlasmaConcentration ( infusion , delta , pumpStatus ) ; infusions . add ( new InfusionResponse ( time , ( ( infusion * 3.6 ) // 10 ) ) ) ; time += delta ; } } response . setInfusionList ( infusions ) ; response . setPlasmaConcentrationsData ( pumpStatus . getPlasmaUdf ( ) ) ; response . setSiteConcentrationsData ( pumpStatus . getEffectSiteUdf ( ) ) ; } catch ( InfusionException ie ) { response . setErrorCode ( UNREACHABLE_INFUSION ) ; response . setInfusionList ( Collections . singletonList ( new InfusionResponse ( ie . getRequest ( ) . getStartTime ( ) , ie . getRequest ( ) . getConcentration ( ) ) ) ) ; } return response ; } private double findNeededInfusion ( final InfusionRequest request , final int deltaTime , final PumpStatus oldPumpStatus ) throws InfusionException { } private void calculatePlasmaConcentration ( final double infusion , int deltaTime , final PumpStatus pumpStatus ) { } private void calculateEffectSiteConcentration ( final double infusion , final int deltaTime , final PumpStatus pumpStatus ) { } }

Fix:
int delta = ( isInfusionForPumping ) ? maxDelta : Math . min ( request . getDeltaTime ( ) , maxDelta ) ;