nus-yam/ex-repair huggingface dataset:
Buggy code:
public class BubbleDetector { private static final int NOT_A_BUBBLE = 0 ; private static final int BUBBLE_DETECTED = 1 ; private static final int FOUND_MORE_GENOMES = 2 ; private static final int REACHED_FINAL_DESTINATION = 3 ; private boolean [ ] visited ; private NodeCollection collection ; private List < Bubble > bubbleBoundaries ; private int lastId ; private int reachedLevel = 1 ; public BubbleDetector ( NodeCollection collection ) { } public void findMultiLevelBubbles ( ) { Map < Integer , List < Bubble > > levelBubbles = new HashMap < > ( ) ; Node destination = collection . get ( collection . size ( ) ) ; levelBubbles . put ( 1 , findLevelBubbles ( this . collection . get ( 1 ) , destination ) ) ; ( this . reachedLevel ) ++ ; for ( int i = 0 ; i < 4 ; i ++ ) { initVisited ( collection ) ; List < Bubble > currLevelList = new ArrayList < > ( ) ; for ( Bubble bubble : levelBubbles . get ( ( ( reachedLevel ) - 1 ) ) ) { if ( ( ( bubble . getStartNode ( ) . getLinks ( ) . size ( ) ) == 1 ) || ( ( bubble . getStartNode ( ) ) == ( bubble . getEndNode ( ) ) ) ) { continue ; } for ( Node node : bubble . getStartNode ( ) . getLinks ( ) ) { List < Bubble > newBubbles = findLevelBubbles ( node , bubble . getEndNode ( ) ) ; currLevelList . addAll ( newBubbles ) ; } } levelBubbles . put ( reachedLevel , currLevelList ) ; ( reachedLevel ) ++ ; } System . out . println ( levelBubbles . size ( ) ) ; this . bubbleBoundaries = new ArrayList ( levelBubbles . get ( 1 ) ) ; <START_BUG> for ( int i = 1 ; i < ( ( levelBubbles . size ( ) ) + 1 ) ; i ++ ) { <END_BUG> this . bubbleBoundaries . addAll ( levelBubbles . get ( i ) ) ; } } public List < Bubble > findLevelBubbles ( Node startNode , Node destination ) { } public Map . Entry < Integer , Node > searchBubble ( Node curr , Collection genomes , Node destination ) { } private int checkGenomeMatch ( Collection initGenomes , Node secondNode , Node destination ) { } private boolean isLargerSet ( Collection genomes , Set < String > secondSet ) { } private void handleDetectedBubble ( Node starting , Node value , List < Bubble > levelCollection ) { } private void initVisited ( NodeCollection collection ) { } public List < Bubble > getBubbleBoundaries ( ) { } }

Fix:
for ( int i = 2 ; i < ( ( levelBubbles . size ( ) ) + 1 ) ; i ++ ) {
Buggy code:
public class AssistTypeParameter extends TypeParameter { private Map infoCache ; public AssistTypeParameter ( JavaElement parent , String name , Map infoCache ) { } public Object getElementInfo ( IProgressMonitor monitor ) throws JavaModelException { <START_BUG> return infoCache . get ( this ) ; <END_BUG> } }

Fix:
return this . infoCache . get ( this ) ;
Buggy code:
public class PagedTableTest extends TestCase { public PagedTableTest ( ) { } public PagedTableTest ( String name ) { } public void testPagedTable ( ) throws Exception { MockWebApplication application = new MockWebApplication ( null ) ; application . setHomePage ( PagedTablePage . class ) ; application . setupRequestAndResponse ( ) ; application . processRequestCycle ( ) ; PagedTablePage page = ( ( PagedTablePage ) ( application . getLastRenderedPage ( ) ) ) ; String document = application . getServletResponse ( ) . getDocument ( ) ; assertTrue ( validatePage1 ( document ) ) ; Link link = ( ( Link ) ( page . get ( "navigation:1:pageLink" ) ) ) ; application . setupRequestAndResponse ( ) ; application . getServletRequest ( ) . setRequestToComponent ( link ) ; application . processRequestCycle ( ) ; document = application . getServletResponse ( ) . getDocument ( ) ; <START_BUG> assertTrue ( validatePage2 ( document ) ) ; <END_BUG> } private boolean validatePage1 ( String document ) { } private boolean validatePage2 ( String document ) { } }

Fix:
assertTrue ( DiffUtil . validatePage ( document , this . getClass ( ) , "PagedTablePageExpectedResult.html" ) ) ;
Buggy code:
public class JmsCFAddHandler extends BatchModeCommandHandler { private final ArgumentWithValue name ; private final ArgumentWithValue entries ; private final ArgumentWithValue profile ; public JmsCFAddHandler ( ) { } @ Override public ModelNode buildRequest ( CommandContext ctx ) throws CommandFormatException { DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder ( ) ; ParsedArguments args = ctx . getParsedArguments ( ) ; if ( ctx . isDomainMode ( ) ) { String profile = this . profile . getValue ( args ) ; if ( profile == null ) { throw new OperationFormatException ( "--profile<seq2seq4repair_space>argument<seq2seq4repair_space>value<seq2seq4repair_space>is<seq2seq4repair_space>missing." ) ; } builder . addNode ( "profile" , profile ) ; } <START_BUG> builder . addNode ( "subsystem" , "jms" ) ; <END_BUG> builder . setOperationName ( "add" ) ; final String name = this . name . getValue ( args , true ) ; final String entriesStr = this . entries . getValue ( args ) ; builder . addNode ( "connection-factory" , name ) ; ModelNode entriesNode = builder . getModelNode ( ) . get ( "entries" ) ; if ( entriesStr == null ) { entriesNode . add ( name ) ; } else { String [ ] split = entriesStr . split ( "," ) ; for ( int i = 0 ; i < ( split . length ) ; ++ i ) { String entry = split [ i ] . trim ( ) ; if ( ! ( entry . isEmpty ( ) ) ) { entriesNode . add ( entry ) ; } } } return builder . buildRequest ( ) ; } }

Fix:
builder . addNode ( "subsystem" , "messaging" ) ;
Buggy code:
public class ResultSet implements Serializable { private static final long serialVersionUID = - 6723127825189535112L ; private static final Logger LOG = LoggerFactory . getLogger ( ResultSet . class ) ; public String id ; public Map < String , Histogram > histograms = new HashMap < String , Histogram > ( ) ; public ResultSet ( ) { } public ResultSet ( SampleSet samples , TimeSurface surface ) { } protected void buildHistograms ( int [ ] times , PointSet targets ) { } public long sum ( String ... categories ) { } public long sum ( Integer timeLimit , String ... categories ) { if ( ( categories . length ) == 0 ) <START_BUG> categories = ( ( String [ ] ) ( histograms . keySet ( ) . toArray ( ) ) ) ; <END_BUG> long value = 0L ; int maxMinutes ; if ( timeLimit != null ) maxMinutes = timeLimit // 60 ; else maxMinutes = Integer . MAX_VALUE ; for ( String k : categories ) { int minute = 0 ; for ( int v : histograms . get ( k ) . sums ) { if ( minute < maxMinutes ) value += v ; minute ++ ; } } return value ; } void toCsv ( ) { } public void writeJson ( OutputStream output ) { } public void writeJson ( OutputStream output , PointSet ps ) { } No newline ; at end ; of file ; }

Fix:
categories = histograms . keySet ( ) . toArray ( new String [ histograms . keySet ( ) . size ( ) ] ) ;
Buggy code:
public abstract class ColumnVersionStrategy extends AbstractVersionStrategy { private static final Localizer _loc = Localizer . forPackage ( ColumnVersionStrategy . class ) ; protected abstract int getJavaType ( ) { } protected abstract Object nextVersion ( Object version ) { } protected int compare ( Object v1 , Object v2 ) { } public void map ( boolean adapt ) { } public void insert ( OpenJPAStateManager sm , JDBCStore store , RowManager rm ) throws SQLException { } public void update ( OpenJPAStateManager sm , JDBCStore store , RowManager rm ) throws SQLException { Column [ ] cols = vers . getColumns ( ) ; if ( ( ( cols == null ) || ( ( cols . length ) == 0 ) ) || ( ( ! ( sm . isDirty ( ) ) ) && ( ! ( sm . isVersionUpdateRequired ( ) ) ) ) ) return ; Object curVersion = sm . getVersion ( ) ; Object nextVersion = nextVersion ( curVersion ) ; Row row = rm . getRow ( vers . getClassMapping ( ) . getTable ( ) , ACTION_UPDATE , sm , true ) ; row . setFailedObject ( sm . getManagedInstance ( ) ) ; for ( int i = 0 ; i < ( cols . length ) ; i ++ ) { <START_BUG> if ( curVersion != null ) <END_BUG> row . whereObject ( cols [ i ] , curVersion ) ; if ( vers . getColumnIO ( ) . isUpdatable ( i , ( nextVersion == null ) ) ) row . setObject ( cols [ i ] , nextVersion ) ; } if ( nextVersion != null ) sm . setNextVersion ( nextVersion ) ; } public void delete ( OpenJPAStateManager sm , JDBCStore store , RowManager rm ) throws SQLException { } public boolean select ( Select sel , ClassMapping mapping ) { } public void load ( OpenJPAStateManager sm , JDBCStore store , Result res ) throws SQLException { } public boolean checkVersion ( OpenJPAStateManager sm , JDBCStore store , boolean updateVersion ) throws SQLException { } public int compareVersion ( Object v1 , Object v2 ) { } }

Fix:
if ( ( curVersion != null ) && ( sm . isVersionCheckRequired ( ) ) )
Buggy code:
public class PackageResource extends AbstractResource { private static final Logger log = LoggerFactory . getLogger ( PackageResource . class ) ; private static final long serialVersionUID = 1L ; public static final class PackageResourceBlockedException extends WicketRuntimeException { private static final long serialVersionUID = 1L ; public PackageResourceBlockedException ( String message ) { } } private final String absolutePath ; private final Locale locale ; private final String path ; private final String scopeName ; private final String style ; private final String variation ; protected PackageResource ( final Class < ? > scope , final String name , final Locale locale , final String style , final String variation ) { } public final Class < ? > getScope ( ) { } public final String getStyle ( ) { } @ Override protected ResourceResponse newResourceResponse ( Attributes attributes ) { final ResourceResponse resourceResponse = new ResourceResponse ( ) ; if ( resourceResponse . dataNeedsToBeWritten ( attributes ) ) { final IResourceStream resourceStream = getResourceStream ( ) ; if ( resourceStream == null ) return sendResourceError ( resourceResponse , 404 , "Unable<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>resource" ) ; resourceResponse . setContentType ( resourceStream . getContentType ( ) ) ; final Time lastModified = resourceStream . lastModifiedTime ( ) ; if ( lastModified != null ) resourceResponse . setLastModified ( lastModified . toDate ( ) ) ; try { final byte [ ] bytes ; try { bytes = IOUtils . toByteArray ( resourceStream . getInputStream ( ) ) ; } finally { resourceStream . close ( ) ; } resourceResponse . setContentLength ( bytes . length ) ; resourceResponse . setWriteCallback ( new WriteCallback ( ) { @ Override public void writeData ( Attributes attributes ) { attributes . getResponse ( ) . write ( bytes ) ; } } ) ; } catch ( IOException e ) { PackageResource . log . debug ( e . getMessage ( ) , e ) ; return sendResourceError ( resourceResponse , 500 , "Unable<seq2seq4repair_space>to<seq2seq4repair_space>read<seq2seq4repair_space>resource<seq2seq4repair_space>stream" ) ; } catch ( ResourceStreamNotFoundException e ) { PackageResource . log . debug ( e . getMessage ( ) , e ) ; return sendResourceError ( resourceResponse , 500 , "Unable<seq2seq4repair_space>to<seq2seq4repair_space>open<seq2seq4repair_space>resource<seq2seq4repair_space>stream" ) ; } } if ( Application . get ( ) . getResourceSettings ( ) . getUseTimestampOnResources ( ) ) { <START_BUG> resourceResponse . setCacheDuration ( MAX_CACHE_DURATION ) ; <END_BUG> resourceResponse . setCachePublic ( true ) ; } return resourceResponse ; } private ResourceResponse sendResourceError ( ResourceResponse resourceResponse , int errorCode , String errorMessage ) { } private IResourceStream getResourceStream ( ) { } private boolean accept ( Class < ? > scope , String path ) { } public static boolean exists ( final Class < ? > scope , final String path , final Locale locale , final String style , final String variation ) { } }

Fix:
resourceResponse . setCacheDuration ( Integer . MAX_VALUE ) ;
Buggy code:
public class PlaneCommand implements Command { @ Override public String name ( ) { } @ Override public String description ( ) { } @ Override public String execute ( Map < String , Object > args , Context ctx ) { LocationStack ls = ( ( LocationStack ) ( Argument . getWithDefault ( args , "stack" , ctx . getPlugin ( ) . getStackFor ( ctx . getSender ( ) ) ) ) ) ; ObjectGen objectgen = ( ( ObjectGen ) ( args . get ( "with" ) ) ) ; List < Location > l = ls . getLast ( 3 ) ; if ( objectgen == null ) objectgen = new com . gmail . einsyui . objectgens . MaterialGen ( Material . AIR ) ; <START_BUG> Plane plane = new Plane ( l . get ( 0 ) , l . get ( 1 ) , l . get ( 2 ) , objectgen ) ; <END_BUG> ctx . getPlugin ( ) . generate ( plane ) ; return "" ; } @ Override public List < Argument > args ( ) { } }

Fix:
Plane plane = new Plane ( l . get ( 2 ) , l . get ( 1 ) , l . get ( 0 ) , objectgen ) ;
Buggy code:
public class VariableToken extends Token { private static final Type myTokenType = Token . Type . VARIABLE ; private static final Pattern myRegex = Pattern . compile ( "[A-z|0-9]+" ) ; private static String myType = "variable" ; private String myVariable ; public VariableToken ( String variableName ) { } @ Override public boolean isThisTypeOfToken ( String parseableString ) { Matcher variableMatcher = VariableToken . myRegex . matcher ( parseableString ) ; <START_BUG> return ( variableMatcher . lookingAt ( ) ) && ( VariableToken . isValidVariable ( parseableString ) ) ; <END_BUG> } @ Override public Token createThisTypeOfToken ( String parseableString ) { } public Type getTokenType ( ) { } public String getType ( ) { } public String getCharacterValue ( ) { } public Integer getIntegerValue ( ) { } public String getVariable ( ) { } private static boolean isValidVariable ( String parseableString ) { } private static boolean containsDigit ( String parseableString ) { } private static boolean containsLetter ( String parseableString ) { } private VariableToken ( ) { } public static TokenFactory getFactory ( ) { } }

Fix:
return ( variableMatcher . matches ( ) ) && ( VariableToken . isValidVariable ( parseableString ) ) ;
Buggy code:
public final class Registry { public static Registry instance ; public static Registry getInstance ( ) { } private SortedMap actionMap ; private Registry ( ) { } public SortedMap getActionMap ( ) { } void addAction ( Action action ) throws IllegalArgumentException { if ( action == null ) throw new IllegalArgumentException ( ) ; <START_BUG> actionMap . put ( action . getId ( ) , action ) ; <END_BUG> } }

Fix:
actionMap . put ( action . getLabel ( ) . getId ( ) , action ) ;
Buggy code:
public final class FastCosineTransformerTest { @ Test public void testAdHocData ( ) { FastCosineTransformer transformer = FastCosineTransformer . create ( ) ; double [ ] result ; double tolerance = 1.0E-12 ; double [ ] x = new double [ ] { 0.0 , 1.0 , 4.0 , 9.0 , 16.0 , 25.0 , 36.0 , 49.0 , 64.0 } ; double [ ] y = new double [ ] { 172.0 , - 105.096569476353 , 27.3137084989848 , - 12.9593152353742 , 8.0 , - 5.78585076868676 , 4.68629150101524 , - 4.15826451958632 , 4.0 } ; result = transformer . transform ( x ) ; for ( int i = 0 ; i < ( result . length ) ; i ++ ) { Assert . assertEquals ( y [ i ] , result [ i ] , tolerance ) ; } result = transformer . inverseTransform ( y ) ; for ( int i = 0 ; i < ( result . length ) ; i ++ ) { Assert . assertEquals ( x [ i ] , result [ i ] , tolerance ) ; } <START_BUG> FastFourierTransformer . scaleArray ( x , FastMath . sqrt ( ( 0.5 * ( ( x . length ) - 1 ) ) ) ) ; <END_BUG> transformer = FastCosineTransformer . createOrthogonal ( ) ; result = transformer . transform ( y ) ; for ( int i = 0 ; i < ( result . length ) ; i ++ ) { Assert . assertEquals ( x [ i ] , result [ i ] , tolerance ) ; } result = transformer . inverseTransform ( x ) ; for ( int i = 0 ; i < ( result . length ) ; i ++ ) { Assert . assertEquals ( y [ i ] , result [ i ] , tolerance ) ; } } @ Test public void testSinFunction ( ) { } @ Test public void testParameters ( ) throws Exception { } }

Fix:
TransformUtils . scaleArray ( x , FastMath . sqrt ( ( 0.5 * ( ( x . length ) - 1 ) ) ) ) ;
Buggy code:
public class LegendRenderer extends Renderer { protected Paint mLegendLabelPaint ; protected Paint mLegendFormPaint ; protected Legend mLegend ; public LegendRenderer ( ViewPortHandler viewPortHandler , Legend legend ) { } public Paint getLabelPaint ( ) { } public Paint getFormPaint ( ) { } public void computeLegend ( ChartData < ? > data ) { List < String > labels = new ArrayList < String > ( ) ; List < Integer > colors = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < ( data . getDataSetCount ( ) ) ; i ++ ) { DataSet < ? extends Entry > dataSet = data . getDataSetByIndex ( i ) ; List < Integer > clrs = dataSet . getColors ( ) ; int entryCount = dataSet . getEntryCount ( ) ; <START_BUG> if ( ( dataSet instanceof BarDataSet ) && ( ( ( ( BarDataSet ) ( dataSet ) ) . getStackSize ( ) ) > 1 ) ) { <END_BUG> BarDataSet bds = ( ( BarDataSet ) ( dataSet ) ) ; String [ ] sLabels = bds . getStackLabels ( ) ; for ( int j = 0 ; ( j < ( clrs . size ( ) ) ) && ( j < ( bds . getStackSize ( ) ) ) ; j ++ ) { labels . add ( sLabels [ ( j % ( sLabels . length ) ) ] ) ; colors . add ( clrs . get ( j ) ) ; } colors . add ( ( - 2 ) ) ; labels . add ( bds . getLabel ( ) ) ; } else if ( dataSet instanceof PieDataSet ) { List < String > xVals = data . getXVals ( ) ; PieDataSet pds = ( ( PieDataSet ) ( dataSet ) ) ; for ( int j = 0 ; ( ( j < ( clrs . size ( ) ) ) && ( j < entryCount ) ) && ( j < ( xVals . size ( ) ) ) ; j ++ ) { labels . add ( xVals . get ( j ) ) ; colors . add ( clrs . get ( j ) ) ; } colors . add ( ( - 2 ) ) ; labels . add ( pds . getLabel ( ) ) ; } else { for ( int j = 0 ; ( j < ( clrs . size ( ) ) ) && ( j < entryCount ) ; j ++ ) { if ( ( j < ( ( clrs . size ( ) ) - 1 ) ) && ( j < ( entryCount - 1 ) ) ) { labels . add ( null ) ; } else { String label = data . getDataSetByIndex ( i ) . getLabel ( ) ; labels . add ( label ) ; } colors . add ( clrs . get ( j ) ) ; } } } mLegend . setColors ( colors ) ; mLegend . setLabels ( labels ) ; Typeface tf = mLegend . getTypeface ( ) ; if ( tf != null ) mLegendLabelPaint . setTypeface ( tf ) ; mLegendLabelPaint . setTextSize ( mLegend . getTextSize ( ) ) ; mLegendLabelPaint . setColor ( mLegend . getTextColor ( ) ) ; mLegend . calculateDimensions ( mLegendLabelPaint ) ; } public void renderLegend ( Canvas c ) { } protected void drawForm ( Canvas c , float x , float y , int index , Legend legend ) { } protected void drawLabel ( Canvas c , float x , float y , String label ) { } }

Fix:
if ( ( dataSet instanceof BarDataSet ) && ( ( ( BarDataSet ) ( dataSet ) ) . isStacked ( ) ) ) {
Buggy code:
public class ShoppingCartComponentPanel extends JPanel { private final ShoppingItem shoppingItem ; private ShoppingCartPanel shoppingCartPanel ; private final IMatModel model ; public ShoppingCartComponentPanel ( ShoppingItem shoppingItem , ShoppingCartPanel shoppingCartPanel , IMatModel model ) { } @ SuppressWarnings ( "unchecked" ) private void initComponents ( ) { } private void nbrOfProductsTextfieldFocusGained ( FocusEvent evt ) { } private void nbrOfProductsTextfieldFocusLost ( FocusEvent evt ) { <START_BUG> this . shoppingItem . setAmount ( Integer . parseInt ( nbrOfProductsTextfield . getText ( ) ) ) ; <END_BUG> } private void nbrOfProductsTextfieldActionPerformed ( ActionEvent evt ) { } private void upButtonActionPerformed ( ActionEvent evt ) { } private void downButtonActionPerformed ( ActionEvent evt ) { } private void formMouseClicked ( MouseEvent evt ) { } private void deleteLabelMouseEntered ( MouseEvent evt ) { } private void deleteLabelMouseExited ( MouseEvent evt ) { } private void deleteLabelMouseClicked ( MouseEvent evt ) { } public ShoppingItem getShoppingItem ( ) { } private double getAmount ( ) { } private String getText ( ) { } private JLabel accualPriceLabel ; private JLabel accualProductLabel ; private JLabel accualTotalPriceLabel ; private JPanel cartPanel ; private JLabel deleteLabel ; private JButton downButton ; private JLabel jLabel1 ; private JPanel jPanel1 ; private JPanel jPanel2 ; private JPanel jPanel3 ; private JPanel jPanel4 ; private JPanel jPanel5 ; private JTextField nbrOfProductsTextfield ; private JLabel priceLabel ; private JLabel totalPriceLabel ; private JButton upButton ; }

Fix:
this . shoppingItem . setAmount ( getAmount ( ) ) ;
Buggy code:
public interface ModelChangedListener { <START_BUG> public void modelChanged ( String value ) ; <END_BUG> }

Fix:
public void modelChanged ( int value ) ;
Buggy code:
public class ThreadMXBeanFindMonitorDeadlockedThreadsHandler implements OperationStepHandler , DescriptionProvider { public static final ThreadMXBeanFindMonitorDeadlockedThreadsHandler INSTANCE = new ThreadMXBeanFindMonitorDeadlockedThreadsHandler ( ) ; private ThreadMXBeanFindMonitorDeadlockedThreadsHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { try { long [ ] ids = ManagementFactory . getThreadMXBean ( ) . findMonitorDeadlockedThreads ( ) ; final ModelNode result = context . getResult ( ) ; if ( ids != null ) { result . setEmptyList ( ) ; for ( long id : ids ) { result . add ( id ) ; } } } catch ( SecurityException e ) { throw new OperationFailedException ( new ModelNode ( ) . set ( e . toString ( ) ) ) ; } <START_BUG> context . completeStep ( ) ; <END_BUG> } @ Override public ModelNode getModelDescription ( Locale locale ) { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class SegmentCharSequence implements Serializable , CharSequence { public SegmentCharSequence ( Segment seg ) { } public SegmentCharSequence ( Segment seg , boolean reverse ) { } public SegmentCharSequence ( Segment seg , int off , int len ) { } public char charAt ( int index ) { if ( reverse ) <START_BUG> index = - index ; <END_BUG> return seg . array [ ( ( ( seg . offset ) + ( offset ) ) + index ) ] ; } public int length ( ) { } public CharSequence subSequence ( int start , int end ) { } public String toString ( ) { } private boolean reverse ; private int offset ; private int length ; private Segment seg ; }

Fix:
index = ( ( length ) - index ) - 1 ;
Buggy code:
public class StartUp { public static void main ( String [ ] args ) { } public static void assignTask ( final CrazyMonkeyBuild build , final AndroidSdk sdk , CompletionService < Task > cs , final Task task ) throws FileNotFoundException , IOException { System . out . print ( String . format ( ( ( "[" + ( new Date ( ) ) ) + "]<seq2seq4repair_space>-<seq2seq4repair_space>The<seq2seq4repair_space>%s<seq2seq4repair_space>task<seq2seq4repair_space>\'%s\'<seq2seq4repair_space>has<seq2seq4repair_space>started.<seq2seq4repair_space>\r\n" ) , task . getEmulator ( ) . getAvdName ( ) , task . getId ( ) ) ) ; task . setAssignTime ( new Date ( ) ) ; Callable < Task > runCallable = null ; <START_BUG> if ( build . getEmulatorType ( ) . equals ( "GENYMOTION" ) ) { <END_BUG> runCallable = new GenymotionRunner ( build , task , sdk , new StreamTaskListener ( StartUp . getLoggerForTask ( build , task ) ) ) ; } else { runCallable = new RunScripts ( build , task , sdk , new StreamTaskListener ( StartUp . getLoggerForTask ( build , task ) ) ) ; } final Future < Task > future = cs . submit ( runCallable ) ; ScheduledExecutorService canceller = Executors . newSingleThreadScheduledExecutor ( ) ; canceller . schedule ( new Callable < Void > ( ) { public Void call ( ) { if ( future . cancel ( true ) ) { System . out . println ( String . format ( ( ( "[" + ( new Date ( ) ) ) + "]<seq2seq4repair_space>-<seq2seq4repair_space>Cancelled<seq2seq4repair_space>the<seq2seq4repair_space>task<seq2seq4repair_space>'%s'<seq2seq4repair_space>since<seq2seq4repair_space>it's<seq2seq4repair_space>timeout<seq2seq4repair_space>in<seq2seq4repair_space>%d<seq2seq4repair_space>miniutes." ) , task . getId ( ) , build . getEmulatorTimeout ( ) ) ) ; } return null ; } } , build . getEmulatorTimeout ( ) , TimeUnit . MINUTES ) ; return ; } public static FileOutputStream getLoggerForTask ( final CrazyMonkeyBuild build , Task task ) throws FileNotFoundException , IOException { } }

Fix:
if ( build . getEmulatorType ( ) . equals ( "GENY_MOTION" ) ) {
Buggy code:
public class NetworkPresenter { public void sendByOkHttp ( ) { } public void sendByRetrofit ( ) { } public void sendByChoc ( ) { <START_BUG> BaseRequest request = new KeyValueRequest . Builder ( ) . setUrl ( "http:////http-caching-demo.herokuapp.com//?cache=true" ) . setMethod ( GET ) . build ( ) ; <END_BUG> ChocHttp chocHttp = new ChocHttp . Builder ( ) . build ( ) ; chocHttp . asyncRequest ( request , new IChocHttpCallback ( ) { @ Override public void onSuccess ( BaseResponse rawResponse , Object pojoResponse ) { Logger . println ( "========Headers=========" ) ; Logger . println ( rawResponse . getHeaders ( ) ) ; Logger . println ( "==========Body==========" ) ; Logger . println ( rawResponse . getResponseBody ( ) ) ; } public void onError ( int statusCode , String errorMessage ) { Logger . println ( ( ( statusCode + "\n" ) + errorMessage ) ) ; } public void onCanceled ( BaseRequest request ) { Logger . println ( ( ( ( "cancel<seq2seq4repair_space>" + ( request . getRawUrl ( ) ) ) + "<seq2seq4repair_space>" ) + ( request . getParams ( ) ) ) ) ; } } ) ; } public interface NetworkService { @ retrofit2 . http . GET ( "users//{user}//repos" ) Call < ResponseBody > listRepos ( @ Path ( "user" ) String user ) { } } public static interface NetworkCallback { void onSuccess ( String response ) { } void onError ( String error ) { } } }

Fix:
BaseRequest request = new KeyValueRequest . Builder ( ) . setUrl ( "http:////http-caching-demo.herokuapp.com//?etag=true" ) . setMethod ( GET ) . build ( ) ;
Buggy code:
public class OSGiDeploymentService implements Service < Deployment > { private static final Logger log = Logger . getLogger ( "org.jboss.as.osgi" ) ; private static final OSGiDeploymentService . OSGiDeploymentListener listener = new OSGiDeploymentService . OSGiDeploymentListener ( ) ; public static final ServiceName SERVICE_NAME_BASE = JBOSS . append ( "osgi" , "deployment" ) ; private final Deployment deployment ; private InjectedValue < BundleContext > injectedBundleContext = new InjectedValue < BundleContext > ( ) ; private InjectedValue < BundleManager > injectedBundleManager = new InjectedValue < BundleManager > ( ) ; private OSGiDeploymentService ( Deployment deployment ) { } public static void addService ( DeploymentPhaseContext phaseContext ) { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; <START_BUG> final Deployment deployment = OSGiDeploymentAttachment . getAttachment ( deploymentUnit ) ; <END_BUG> final String contextName = deploymentUnit . getName ( ) ; final OSGiDeploymentService service = new OSGiDeploymentService ( deployment ) ; ServiceBuilder < Deployment > serviceBuilder = serviceTarget . addService ( OSGiDeploymentService . getServiceName ( contextName ) , service ) ; serviceBuilder . addDependency ( SERVICE_NAME , BundleContext . class , service . injectedBundleContext ) ; serviceBuilder . addDependency ( BundleManagerService . SERVICE_NAME , BundleManager . class , service . injectedBundleManager ) ; serviceBuilder . addDependency ( JBOSS_DEPLOYMENT . append ( contextName ) ) ; serviceBuilder . addDependency ( PackageAdminService . SERVICE_NAME ) ; serviceBuilder . setInitialMode ( ACTIVE ) ; serviceBuilder . addListener ( OSGiDeploymentService . listener ) ; serviceBuilder . install ( ) ; } public static void removeService ( DeploymentUnit context ) { } public static ServiceName getServiceName ( String contextName ) { } public synchronized void start ( StartContext context ) throws StartException { } public synchronized void stop ( StopContext context ) { } @ Override public Deployment getValue ( ) throws IllegalStateException { } static class OSGiDeploymentListener extends AbstractServiceListener < Deployment > { private final Set < Deployment > startedDeployments = new CopyOnWriteArraySet < Deployment > ( ) ; private final Set < Deployment > pendingDeployments = new CopyOnWriteArraySet < Deployment > ( ) ; @ Override public void listenerAdded ( ServiceController < ? extends Deployment > controller ) { } @ Override public void serviceStarted ( ServiceController < ? extends Deployment > controller ) { } @ Override public void serviceFailed ( ServiceController < ? extends Deployment > controller , StartException reason ) { } private void processDeployment ( ServiceController < ? extends Deployment > controller ) { } } }

Fix:
final Deployment deployment = OSGiDeploymentAttachment . getDeployment ( deploymentUnit ) ;
Buggy code:
public class IndexSplitter { public SegmentInfos infos ; FSDirectory fsDir ; File dir ; public static void main ( String [ ] args ) throws Exception { } public IndexSplitter ( File dir ) throws IOException { } public void listSegments ( ) throws IOException { DecimalFormat formatter = new DecimalFormat ( "###,###.###" ) ; for ( int x = 0 ; x < ( infos . size ( ) ) ; x ++ ) { SegmentInfo info = infos . info ( x ) ; <START_BUG> String sizeStr = formatter . format ( info . sizeInBytes ( ) ) ; <END_BUG> System . out . println ( ( ( ( info . name ) + "<seq2seq4repair_space>" ) + sizeStr ) ) ; } } private int getIdx ( String name ) { } private SegmentInfo getInfo ( String name ) { } public void remove ( String [ ] segs ) throws IOException { } public void split ( File destDir , String [ ] segs ) throws IOException { } private static final byte [ ] copyBuffer = new byte [ 32 * 1024 ] ; private static void copyFile ( File src , File dst ) throws IOException { } }

Fix:
String sizeStr = formatter . format ( info . sizeInBytes ( true ) ) ;
Buggy code:
public class ServerLoginTest extends TestCase { IConnectionService connection ; ILoginService loginService ; public ServerLoginTest ( String name ) { } public static Test suite ( ) { } public void setUp ( ) { } public void testCreation ( ) { <START_BUG> assertTrue ( ( ( loginService . getClass ( ) ) == ( ILoginService . class ) ) ) ; <END_BUG> } public void testLoginAttempt_ConnectionClosed ( ) { } public void testLoginAttempt_IncorrectUser ( ) { } public void testLoginAttempt_IncorrectPassword ( ) { } public void testLoginAttempt_Succeeded ( ) { } public void tearDown ( ) { } }

Fix:
assertTrue ( ( ( loginService ) instanceof ILoginService ) ) ;
Buggy code:
public class Certificate extends Data { public Certificate ( ) { } public Certificate ( Data data ) throws DerDecodingException { } public final void encode ( ) throws DerDecodingException , DerEncodingException { } public void wireDecode ( Blob input , WireFormat wireFormat ) throws EncodingException { } public final void addSubjectDescription ( CertificateSubjectDescription description ) { } public final List getSubjectDescriptionList ( ) { } public final void addExtension ( CertificateExtension extension ) { } public final List getExtensionList ( ) { } public final void setNotBefore ( double notBefore ) { } public final double getNotBefore ( ) { } public final void setNotAfter ( double notAfter ) { } public final double getNotAfter ( ) { } public final void setPublicKeyInfo ( PublicKey key ) { } public final PublicKey getPublicKeyInfo ( ) { } public final boolean isTooEarly ( ) { } public final boolean isTooLate ( ) { } private DerSequence toDer ( ) throws DerDecodingException , DerEncodingException { DerSequence root = new DerSequence ( ) ; DerSequence validity = new DerSequence ( ) ; DerGeneralizedTime notBefore = new DerGeneralizedTime ( notBefore_ ) ; DerGeneralizedTime notAfter = new DerGeneralizedTime ( notAfter_ ) ; validity . addChild ( notBefore ) ; validity . addChild ( notAfter ) ; root . addChild ( validity ) ; DerSequence subjectList = new DerSequence ( ) ; for ( int i = 0 ; i < ( subjectDescriptionList_ . size ( ) ) ; ++ i ) subjectList . addChild ( ( ( CertificateSubjectDescription ) ( subjectDescriptionList_ . get ( i ) ) ) . toDer ( ) ) ; root . addChild ( subjectList ) ; root . addChild ( key_ . toDer ( ) ) ; if ( ( extensionList_ . size ( ) ) > 0 ) { DerSequence extensionList = new DerSequence ( ) ; for ( int i = 0 ; i < ( extensionList_ . size ( ) ) ; ++ i ) <START_BUG> subjectList . addChild ( ( ( CertificateExtension ) ( extensionList_ . get ( i ) ) ) . toDer ( ) ) ; <END_BUG> root . addChild ( extensionList ) ; } return root ; } private void decode ( ) throws DerDecodingException { } public String toString ( ) { } private final ArrayList subjectDescriptionList_ = new ArrayList ( ) ; private final ArrayList extensionList_ = new ArrayList ( ) ; private double notBefore_ = Double . MAX_VALUE ; private double notAfter_ = - ( Double . MAX_VALUE ) ; private PublicKey key_ = new PublicKey ( ) ; }

Fix:
extensionList . addChild ( ( ( CertificateExtension ) ( extensionList_ . get ( i ) ) ) . toDer ( ) ) ;
Buggy code:
public class AddUserTestCase extends PropertyTestHelper { @ Test public void testAddUser ( ) throws IOException , StartException { values . setRoles ( ROLES ) ; AddUser addUserState = new AddUser ( consoleMock , values ) ; <START_BUG> AssertConsoleBuilder consoleBuilder = new AssertConsoleBuilder ( ) . expectedDisplayText ( DomainManagementMessages . MESSAGES . addedUser ( values . getUserName ( ) , values . getPropertiesFiles ( ) . get ( 0 ) . getCanonicalPath ( ) ) ) . expectedDisplayText ( NEW_LINE ) . expectedDisplayText ( DomainManagementMessages . MESSAGES . addedRoles ( values . getUserName ( ) , values . getRoles ( ) , values . getRoleFiles ( ) . get ( 0 ) . getCanonicalPath ( ) ) ) . expectedDisplayText ( NEW_LINE ) ; <END_BUG> consoleMock . setResponses ( consoleBuilder ) ; addUserState . update ( values ) ; assertRolePropertyFile ( USER_NAME ) ; assertUserPropertyFile ( USER_NAME ) ; consoleBuilder . validate ( ) ; } }

Fix:
AssertConsoleBuilder consoleBuilder = new AssertConsoleBuilder ( ) . expectedDisplayText ( DomainManagementMessages . MESSAGES . addedUser ( values . getUserName ( ) , values . getUserFiles ( ) . get ( 0 ) . getCanonicalPath ( ) ) ) . expectedDisplayText ( NEW_LINE ) . expectedDisplayText ( DomainManagementMessages . MESSAGES . addedRoles ( values . getUserName ( ) , values . getRoles ( ) , values . getRoleFiles ( ) . get ( 0 ) . getCanonicalPath ( ) ) ) . expectedDisplayText ( NEW_LINE ) ;
Buggy code:
class Edge { private Node parent ; private Node child ; public Edge ( Node parent , Node child ) { } public String toString ( ) { <START_BUG> return ( ( parent . getId ( ) ) + "<seq2seq4repair_space>---<seq2seq4repair_space>" ) + ( child . getId ( ) ) ; <END_BUG> } public Node getParent ( ) { } public Node getChild ( ) { } No newline ; at end ; of file ; }

Fix:
return ( ( parent . toString ( ) ) + "---" ) + ( child . toString ( ) ) ;
Buggy code:
class OSGiNamespace10Parser implements XMLStreamConstants , Namespace10 , XMLElementReader < List < ModelNode > > { static XMLElementReader < List < ModelNode > > INSTANCE = new OSGiNamespace10Parser ( ) ; private OSGiNamespace10Parser ( ) { } @ Override public void readElement ( XMLExtendedStreamReader reader , List < ModelNode > operations ) throws XMLStreamException { } private ModelNode parseActivationAttribute ( XMLExtendedStreamReader reader , ModelNode address ) throws XMLStreamException { } private List < ModelNode > parseConfigurations ( XMLExtendedStreamReader reader , ModelNode address ) throws XMLStreamException { } private List < ModelNode > parseFrameworkProperties ( XMLExtendedStreamReader reader , ModelNode address , List < ModelNode > operations ) throws XMLStreamException { requireNoAttributes ( reader ) ; List < ModelNode > result = new ArrayList < ModelNode > ( ) ; while ( ( reader . hasNext ( ) ) && ( ( reader . nextTag ( ) ) != ( XMLStreamConstants . END_ELEMENT ) ) ) { switch ( Namespace . forUri ( reader . getNamespaceURI ( ) ) ) { case OSGI_1_0 : { final Element element = Element . forName ( reader . getLocalName ( ) ) ; if ( element == ( Element . PROPERTY ) ) { String name = null ; String value = null ; int count = reader . getAttributeCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { requireNoNamespaceAttribute ( reader , i ) ; final String attrValue = reader . getAttributeValue ( i ) ; final Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; switch ( attribute ) { case NAME : { name = attrValue ; break ; } default : throw unexpectedAttribute ( reader , i ) ; } } if ( name == null ) { throw missingRequired ( reader , Collections . singleton ( NAME ) ) ; } value = reader . getElementText ( ) . trim ( ) ; ModelNode propNode = new ModelNode ( ) ; propNode . get ( OP ) . set ( ADD ) ; <START_BUG> propNode . get ( OP_ADDR ) . set ( address ) . add ( FRAMEWORK_PROPERTY , name ) ; <END_BUG> propNode . get ( VALUE ) . set ( value ) ; result . add ( propNode ) ; break ; } else { throw unexpectedElement ( reader ) ; } } default : throw unexpectedElement ( reader ) ; } } return result ; } private List < ModelNode > parseModules ( XMLExtendedStreamReader reader , ModelNode address ) throws XMLStreamException { } }

Fix:
propNode . get ( OP_ADDR ) . set ( address ) . add ( PROPERTY , name ) ;
Buggy code:
public class EeWriteAttributeHandler extends AbstractWriteAttributeHandler < Void > { private final DefaultEarSubDeploymentsIsolationProcessor isolationProcessor ; private final GlobalModuleDependencyProcessor moduleDependencyProcessor ; private final DescriptorPropertyReplacementProcessor specDescriptorPropertyReplacementProcessor ; private final DescriptorPropertyReplacementProcessor jbossDescriptorPropertyReplacementProcessor ; private final AnnotationPropertyReplacementProcessor annotationPropertyReplacementProcessor ; public EeWriteAttributeHandler ( final DefaultEarSubDeploymentsIsolationProcessor isolationProcessor , final GlobalModuleDependencyProcessor moduleDependencyProcessor , final DescriptorPropertyReplacementProcessor specDescriptorPropertyReplacementProcessor , final DescriptorPropertyReplacementProcessor jbossDescriptorPropertyReplacementProcessor , final AnnotationPropertyReplacementProcessor annotationPropertyReplacementProcessor ) { } public void registerAttributes ( final ManagementResourceRegistration registry ) { } @ Override protected boolean applyUpdateToRuntime ( OperationContext context , ModelNode operation , String attributeName , ModelNode newValue , ModelNode currentValue , HandbackHolder < Void > handbackHolder ) throws OperationFailedException { } @ Override protected void revertUpdateToRuntime ( OperationContext context , ModelNode operation , String attributeName , ModelNode valueToRestore , ModelNode valueToRevert , Void handback ) throws OperationFailedException { } private void applyUpdateToDeploymentUnitProcessor ( final OperationContext context , ModelNode newValue , String attributeName ) throws OperationFailedException { if ( INSTANCE . getName ( ) . equals ( attributeName ) ) { moduleDependencyProcessor . setGlobalModules ( GlobalModulesDefinition . createModuleList ( context , newValue ) ) ; } else if ( EAR_SUBDEPLOYMENTS_ISOLATED . getName ( ) . equals ( attributeName ) ) { boolean isolate = newValue . asBoolean ( ) ; isolationProcessor . setEarSubDeploymentsIsolated ( isolate ) ; } else if ( SPEC_DESCRIPTOR_PROPERTY_REPLACEMENT . getName ( ) . equals ( attributeName ) ) { boolean enabled = newValue . asBoolean ( ) ; specDescriptorPropertyReplacementProcessor . setDescriptorPropertyReplacement ( enabled ) ; } else if ( JBOSS_DESCRIPTOR_PROPERTY_REPLACEMENT . getName ( ) . equals ( attributeName ) ) { boolean enabled = newValue . asBoolean ( ) ; jbossDescriptorPropertyReplacementProcessor . setDescriptorPropertyReplacement ( enabled ) ; } else <START_BUG> if ( ANNOTATION_PROPERTY_REPLACEMENT . getName ( ) . equals ( attributeName ) ) { <END_BUG> boolean enabled = newValue . asBoolean ( ) ; annotationPropertyReplacementProcessor . setDescriptorPropertyReplacement ( enabled ) ; } } }

Fix:
if ( EJB_ANNOTATION_PROPERTY_REPLACEMENT . getName ( ) . equals ( attributeName ) ) {
Buggy code:
public class PseudoRandomNumberGenerator { private byte [ ] initializationVector ; private BigInteger counter ; private byte [ ] key ; private byte [ ] cipherText ; private boolean iVSet ; private boolean counterSet ; private boolean encryptionKeySet ; private String keyFileName ; private String APIKey ; public PseudoRandomNumberGenerator ( ) { } public PseudoRandomNumberGenerator ( byte [ ] newInitializationVector , BigInteger newCounter , byte [ ] newKey ) { } public void setIV ( byte [ ] newInitializationVector ) { } public void setCounter ( byte [ ] newCounter ) { } public void setEncryptionKey ( byte [ ] newKey ) { } public void setAPIKeyFileName ( String newKeyFileName ) { } public void setAPIKey ( String newKey ) { } public byte [ ] generate ( ) throws Exception { } public BigInteger getPseudoRandomBigInteger ( ) throws Exception { } public BigInteger getPseudoRandomBigIntegerRange ( BigInteger low , BigInteger high ) throws Exception { <START_BUG> return new BigInteger ( generate ( ) ) . abs ( ) . mod ( low ) . add ( high ) ; <END_BUG> } public String getPseudoRandomHexString ( ) throws Exception { } public static String bytesToHex ( byte [ ] bites ) { } public static byte [ ] hexToBytes ( String hexValue ) { } public void getRandomDataFromWeb ( ) { } public void fetchAPIKeyFromFile ( ) { } public void fetchAPIKeyFromFile ( String tempKeyFileName ) { } private JsonObject fetchFromWeb ( JsonObject jsonRequest ) throws IOException , Exception , MalformedURLException , ProtocolException { } private void setDefaultInitValues ( ) { } private boolean fetchUsageFromWeb ( int numBits , String APIKey ) throws IOException , Exception , ProtocolException { } public void savePseudoRandomDataToFile ( String filename , long numGroups , boolean asHex ) throws Exception { } }

Fix:
return new BigInteger ( generate ( ) ) . abs ( ) . mod ( high . subtract ( low ) . add ( new BigInteger ( "1" ) ) ) . add ( low ) ;
Buggy code:
public class RelationshipMap extends HashMap implements IRelationshipMap { private IHierarchy hierarchy ; public RelationshipMap ( IHierarchy hierarchy ) { } public List get ( String handle ) { } public List get ( IProgramElement source ) { } public IRelationship get ( String source , IRelationship . Kind kind , String relationshipName ) { } public IRelationship get ( IProgramElement source , IRelationship . Kind kind , String relationshipName ) { } public void remove ( String source , IRelationship relationship ) { } public void removeAll ( String source ) { <START_BUG> List list = ( ( List ) ( super . remove ( source ) ) ) ; <END_BUG> } public void put ( String source , IRelationship relationship ) { } public void put ( IProgramElement source , IRelationship relationship ) { } public void clear ( ) { } }

Fix:
super . remove ( source ) ;
Buggy code:
public class DeferredTreeContentManager { ITreeContentProvider contentProvider ; AbstractTreeViewer treeViewer ; IWorkbenchSiteProgressService progressService ; class DeferredContentFamily { protected DeferredTreeContentManager manager ; protected Object element ; DeferredContentFamily ( DeferredTreeContentManager schedulingManager , Object object ) { } } public DeferredTreeContentManager ( ITreeContentProvider provider , AbstractTreeViewer viewer , IWorkbenchPartSite site ) { } public DeferredTreeContentManager ( ITreeContentProvider provider , AbstractTreeViewer viewer ) { } public boolean mayHaveChildren ( Object element ) { } public Object [ ] getChildren ( final Object parent ) { } protected PendingUpdateAdapter createPendingUpdateAdapter ( ) { } protected IDeferredWorkbenchAdapter getAdapter ( Object element ) { } protected void startFetchingDeferredChildren ( final Object parent , final IDeferredWorkbenchAdapter adapter , final PendingUpdateAdapter placeholder ) { } protected String getFetchJobName ( Object parent , IDeferredWorkbenchAdapter adapter ) { } protected void addChildren ( final Object parent , final Object [ ] children , IProgressMonitor monitor ) { WorkbenchJob updateJob = new WorkbenchJob ( ProgressMessages . DeferredTreeContentManager_AddingChildren ) { public IStatus runInUIThread ( IProgressMonitor updateMonitor ) { <START_BUG> if ( treeViewer . getControl ( ) . isDisposed ( ) ) { <END_BUG> return Status . CANCEL_STATUS ; } treeViewer . add ( parent , children ) ; return Status . OK_STATUS ; } } ; updateJob . setSystem ( true ) ; updateJob . schedule ( ) ; } public boolean isDeferredAdapter ( Object element ) { } protected void runClearPlaceholderJob ( final PendingUpdateAdapter placeholder ) { } public void cancel ( Object parent ) { } protected IElementCollector createElementCollector ( final Object parent , final PendingUpdateAdapter placeholder ) { } }

Fix:
if ( ( treeViewer . getControl ( ) . isDisposed ( ) ) || ( updateMonitor . isCanceled ( ) ) ) {
Buggy code:
public class BookListFragment extends Fragment implements LoaderManager . LoaderCallbacks < List < Book > > , OnBookSearchListener , BookListAdapter . FavoriteCheckedListener , BookListAdapter . OnItemClickListener { private View bookListLoadProgressView ; private RecyclerView mRecyclerView ; private BookDataSource dataSource ; private BookListAdapter bookListAdapter ; private static final String ARG_SEARCH_CATEGORY = "_arg_search_category" ; private static final String ARG_SEARCH_FILTER = "_arg_search_filter" ; public static BookListFragment newInstance ( SearchCriteria searchCriteria , SearchFilter searchFilter ) { } public BookListFragment ( ) { } public BookListAdapter getBookListAdapter ( ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onViewCreated ( View view , @ Nullable Bundle savedInstanceState ) { } @ Override public void onActivityCreated ( @ Nullable Bundle savedInstanceState ) { } @ Override public void onAttach ( Activity activity ) { super . onAttach ( activity ) ; <START_BUG> dataSource = BookDataSource . getInstance ( getActivity ( ) ) ; <END_BUG> dataSource . open ( ) ; } @ Override public void onDetach ( ) { } @ Override public Loader < List < Book > > onCreateLoader ( int id , Bundle data ) { } @ Override public void onLoadFinished ( Loader < List < Book > > loader , List < Book > books ) { } @ Override public void onLoaderReset ( Loader < List < Book > > loader ) { } @ Override public void onFavoriteCheckedChange ( Book book , boolean isFavorite ) { } @ Override public void onItemClick ( Book book ) { } @ Override public void searchForBooks ( SearchCriteria searchCriteria , SearchFilter searchFilter ) { } @ Override public Cursor getSearchSuggestions ( SearchCriteria searchCriteria , SearchFilter searchFilter ) { } }

Fix:
dataSource = new BookDataSource ( activity ) ;
Buggy code:
public class SignJar extends AbstractTask { private ArrayList m_filesets = new ArrayList ( ) ; private String m_alias ; private boolean m_internalsf ; private File m_jar ; private String m_keypass ; private File m_keystore ; private boolean m_lazy ; private boolean m_sectionsonly ; private File m_sigfile ; private File m_signedjar ; private String m_storepass ; private String m_storetype ; private boolean m_verbose ; public void setAlias ( final String alias ) { } public void setInternalsf ( final boolean internalsf ) { } public void setJar ( final File jar ) { } public void setKeypass ( final String keypass ) { } public void setKeystore ( final File keystore ) { } public void setLazy ( final boolean lazy ) { } public void setSectionsonly ( final boolean sectionsonly ) { } public void setSigfile ( final File sigfile ) { } public void setSignedjar ( final File signedjar ) { } public void setStorepass ( final String storepass ) { } public void setStoretype ( final String storetype ) { } public void setVerbose ( final boolean verbose ) { } public void addFileset ( final FileSet set ) { } public void execute ( ) throws TaskException { } private void validate ( ) throws TaskException { } private boolean isSigned ( final File file ) { } private boolean isUpToDate ( final File jarFile , final File signedjarFile ) { } private void doOneJar ( final File jarSource , final File jarTarget ) throws TaskException { if ( isUpToDate ( jarSource , jarTarget ) ) { return ; } final String message = "Signing<seq2seq4repair_space>Jar<seq2seq4repair_space>:<seq2seq4repair_space>" + ( jarSource . getAbsolutePath ( ) ) ; getLogger ( ) . info ( message ) ; final Commandline cmd = buildCommand ( jarTarget , jarSource ) ; final Execute2 exe = new Execute2 ( ) ; setupLogger ( exe ) ; <START_BUG> exe . setCommandline ( cmd . getCommandline ( ) ) ; <END_BUG> try { exe . execute ( ) ; } catch ( final IOException ioe ) { throw new TaskException ( ioe . getMessage ( ) , ioe ) ; } } private Commandline buildCommand ( final File jarTarget , final File jarSource ) { } }

Fix:
exe . setCommandline ( cmd ) ;