nus-yam/ex-repair huggingface dataset:
Buggy code:
public final class HaarObjectDetectorParameters { public HaarObjectDetectorParameters ( String cascadeName ) { } public final String cascadeName ; public final HaarCascade cascade ; public int k = 16 ; public double minScale = 1.0 ; public double maxScale = 0.8 ; public double scaleStep = 1.0 ; public int threshold = 8 ; public boolean detectBiggest = true ; public double intersectionThreshold = 0.75 ; public boolean trace = false ; public static HaarObjectDetectorParameters createFaceDetectorParameters ( ) { <START_BUG> HaarObjectDetectorParameters params = new HaarObjectDetectorParameters ( "data//NewHaarCascade_Face.xml" ) ; <END_BUG> params . trace = true ; return params ; } public static HaarObjectDetectorParameters createFacePointsDetectorParameters ( String pointName ) { } }

Fix:
HaarObjectDetectorParameters params = new HaarObjectDetectorParameters ( "data//HaarCascade_Face.xml" ) ;
Buggy code:
public class FeedsFragment extends Fragment implements LoaderManager . LoaderCallbacks < Cursor > , FeedsAdapter . ItemSelectedListener { private static final int LINK_INIT_CURSOR_LOADER = 0 ; public static final String ARG_URI = "arg_uri" ; private static final int SWIPE_DURATION = 250 ; private static final int MOVE_DURATION = 150 ; private Uri mUri ; private RecyclerView mRecyclerView ; private FeedsFragment . CallBack mCallback ; private boolean mItemPressed = false ; private boolean mSwiping = false ; private BackgroundContainer mBackgroundContainer ; private FeedsAdapter mAdapter ; private OnTouchListener mTouchListener = new FeedsFragment . TouchListener ( ) ; public static final FeedsFragment newInstance ( Uri linkUri ) { } @ Override public void onAttach ( Activity activity ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onStop ( ) { } @ Override public void onStart ( ) { } @ Override public void onDestroy ( ) { } @ Override public Loader < Cursor > onCreateLoader ( int id , Bundle args ) { if ( ( mUri ) != null ) <START_BUG> return new android . support . v4 . content . CursorLoader ( getActivity ( ) , mUri , null , ( ( Link . COLUMN_READ ) + "=?<seq2seq4repair_space>" ) , new String [ ] { "0" } , Link . COLUMN_CREATED ) ; <END_BUG> else return new android . support . v4 . content . CursorLoader ( getActivity ( ) , Link . CONTENT_URI , null , ( ( Link . COLUMN_READ ) + "=?" ) , new String [ ] { "0" } , Link . COLUMN_CREATED ) ; } @ Override public void onLoadFinished ( Loader < Cursor > loader , Cursor data ) { } @ Override public void onLoaderReset ( Loader < Cursor > loader ) { } @ Override public void onLinkClicked ( long linkID ) { } @ Override public void saveLink ( long linkID ) { } private void setSavedHiddenLink ( int saved , int hidden , long linkID ) { } private void addLinkTag ( String tagName , long linkID ) { } private void removeLinkTag ( String tagName , long linkID ) { } private long getTagID ( String tagName ) { } @ Override public void onLinkHidden ( long linkID ) { } @ Override public void onActivityCreated ( @ Nullable Bundle savedInstanceState ) { } public Uri getUri ( ) { } public static interface CallBack { public void onItemSelected ( long postID ) { } } final class TouchListener implements View . OnTouchListener { float mDownX ; private int mSwipeSlop = - 1 ; @ Override public boolean onTouch ( final View v , MotionEvent event ) { } } }

Fix:
return new android . support . v4 . content . CursorLoader ( getActivity ( ) , mUri , new String [ ] { ( Link . TABLE_NAME ) + ".*" } , ( ( Link . COLUMN_READ ) + "=?<seq2seq4repair_space>" ) , new String [ ] { "0" } , Link . COLUMN_CREATED ) ;
Buggy code:
public class RandomPartitioner implements IPartitioner < BigIntegerToken > { public static final BigInteger ZERO = new BigInteger ( "0" ) ; public static final BigIntegerToken MINIMUM = new BigIntegerToken ( "-1" ) ; public static final BigInteger MAXIMUM = new BigInteger ( "2" ) . pow ( 127 ) ; private static final byte DELIMITER_BYTE = ":" . getBytes ( ) [ 0 ] ; public DecoratedKey < BigIntegerToken > decorateKey ( ByteBuffer key ) { } public DecoratedKey < BigIntegerToken > convertFromDiskFormat ( ByteBuffer fromdisk ) { } public Token midpoint ( Token ltoken , Token rtoken ) { } public BigIntegerToken getMinimumToken ( ) { } public BigIntegerToken getRandomToken ( ) { } private final Token . TokenFactory < BigInteger > tokenFactory = new Token . TokenFactory < BigInteger > ( ) { public ByteBuffer toByteArray ( Token < BigInteger > bigIntegerToken ) { } public Token < BigInteger > fromByteArray ( ByteBuffer bytes ) { } public String toString ( Token < BigInteger > bigIntegerToken ) { } public void validate ( String token ) throws ConfigurationException { } public Token < BigInteger > fromString ( String string ) { } } ; public Token . TokenFactory < BigInteger > getTokenFactory ( ) { } public boolean preservesOrder ( ) { } public BigIntegerToken getToken ( ByteBuffer key ) { } public Map < Token , Float > describeOwnership ( List < Token > sortedTokens ) { Map < Token , Float > ownerships = new HashMap < Token , Float > ( ) ; Iterator i = sortedTokens . iterator ( ) ; if ( ! ( i . hasNext ( ) ) ) { throw new RuntimeException ( "No<seq2seq4repair_space>nodes<seq2seq4repair_space>present<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>cluster.<seq2seq4repair_space>How<seq2seq4repair_space>did<seq2seq4repair_space>you<seq2seq4repair_space>call<seq2seq4repair_space>this?" ) ; } if ( ( sortedTokens . size ( ) ) == 1 ) { ownerships . put ( ( ( Token ) ( i . next ( ) ) ) , new Float ( 1.0 ) ) ; } else { <START_BUG> final BigInteger ri = MAXIMUM ( 127 ) ; <END_BUG> final BigDecimal r = new BigDecimal ( ri ) ; Token start = ( ( Token ) ( i . next ( ) ) ) ; BigInteger ti = ( ( BigIntegerToken ) ( start ) ) . token ; Token t ; BigInteger tim1 = ti ; while ( i . hasNext ( ) ) { t = ( ( Token ) ( i . next ( ) ) ) ; ti = ( ( BigIntegerToken ) ( t ) ) . token ; float x = new BigDecimal ( ti . subtract ( tim1 ) . add ( ri ) . mod ( ri ) ) . divide ( r ) . floatValue ( ) ; ownerships . put ( t , x ) ; tim1 = ti ; } float x = new BigDecimal ( ( ( BigIntegerToken ) ( start ) ) . token . subtract ( ti ) . add ( ri ) . mod ( ri ) ) . divide ( r ) . floatValue ( ) ; ownerships . put ( start , x ) ; } return ownerships ; } }

Fix:
final BigInteger ri = RandomPartitioner . MAXIMUM ;
Buggy code:
public class AdjacencyList implements Graph { private Map < Integer , Map < Integer , Integer > > list ; private int size ; private GraphType graphType ; private int numberOfEdges ; public AdjacencyList ( int size , GraphType graphType ) { } @ Override public void addEdge ( int i , int j ) { } @ Override public void addEdge ( int i , int j , Integer weight ) { } @ Override public Set < Integer > getNeighbours ( int vertex ) { Set < Integer > result = new HashSet < Integer > ( ) ; final Map < Integer , Integer > vertexObj = list . get ( vertex ) ; if ( null != vertexObj ) { for ( Integer e : vertexObj . keySet ( ) ) { <START_BUG> if ( e >= 0 ) { <END_BUG> result . add ( e ) ; } } } return result ; } @ Override public int getNumberOfEdges ( ) { } @ Override public int getSize ( ) { } @ Override public boolean isAdjacent ( int i , int j ) { } @ Override public void removeEdge ( int i , int j ) { } public Map < Integer , Map < Integer , Integer > > getList ( ) { } }

Fix:
if ( ( vertexObj . get ( e ) ) >= 0 ) {
Buggy code:
public class CoordinatorsPagerUiStrategy implements PagerStrategy { private GroupCoordinatorsModel model = GroupCoordinatorsModel . getInstance ( ) ; private PagerResponseEvent responseEvent = new PagerResponseEvent ( ) ; private HashSet < PersonModelView > coordinators ; private BasicPager pager = new BasicPager ( ) ; private TwoColumnPagedListRenderer twoColListRenderer = new TwoColumnPagedListRenderer ( ) ; private ModelViewRenderer itemRenderer = new ModelViewRenderer ( ) ; private String entityKey ; public CoordinatorsPagerUiStrategy ( ) { } public boolean hasNext ( ) { } public boolean hasPrev ( ) { } public void init ( ) { } public void next ( ) { } public void prev ( ) { } public String getKey ( ) { <START_BUG> return "following" ; <END_BUG> } public int getStartIndex ( ) { } public int getEndIndex ( ) { } public int getTotal ( ) { } }

Fix:
return "coordinators" ;
Buggy code:
public class ColumnListItem extends CustomListItem { protected TextField txtField ; protected ComboBox < String > comboBox ; protected ComboBox < String > secondBox ; protected CheckBox cbSort ; protected CheckBox use ; protected GroupListItem groupLI ; ColumnListItem ( ListView < ? extends CustomListItem > par , GroupListItem gli ) { } private void onChange ( ActionEvent event ) { } protected void addDateOptions ( String type ) { switch ( type ) { case "Date//Time" : setSecondBox ( new String [ ] { "dd-MM-yyyy<seq2seq4repair_space>HH:mm" , "dd-MM-yyyy<seq2seq4repair_space>HH:mm:ss" , "dd//MM//yyyy<seq2seq4repair_space>HH:mm" , "dd//MM//yyyy<seq2seq4repair_space>HH:mm:ss" , "Excel<seq2seq4repair_space>epoch" } ) ; break ; case "Date" : <START_BUG> setSecondBox ( new String [ ] { "dd//MM//yyyy" , "dd//MM//yy" , "dd-MM-yyyy" , "dd-MM-yy" , "yyMMdd" , "Excel<seq2seq4repair_space>epoch" } ) ; <END_BUG> break ; case "Time" : setSecondBox ( new String [ ] { "HH:mm" , "HHmm" } ) ; break ; default : break ; } } private void deleteExtraOptions ( ) { } private void setSecondBox ( String [ ] options ) { } @ Override public void select ( ) { } @ Override public void selectNext ( ) { } public void setupDragDrop ( Node n ) { } }

Fix:
setSecondBox ( new String [ ] { "dd//MM//yyyy" , "dd//MM//yy" , "dd-MM-yyyy" , "dd-MM-yy" , "yyMMdd" , "Excel<seq2seq4repair_space>epoch" , "d//M//yy" } ) ;
Buggy code:
public class StartupPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { private Table pluginsList ; private Workbench workbench ; protected Control createContents ( Composite parent ) { } protected Composite createComposite ( Composite parent ) { } protected void createEarlyStartupSelection ( Composite parent ) { } private void populatePluginsList ( ) { } public void init ( IWorkbench workbench ) { } protected void performDefaults ( ) { } public boolean performOk ( ) { StringBuffer preference = new StringBuffer ( ) ; TableItem [ ] items = pluginsList . getItems ( ) ; for ( int i = 0 ; i < ( items . length ) ; i ++ ) { if ( ! ( items [ i ] . getChecked ( ) ) ) { preference . append ( ( ( String ) ( items [ i ] . getData ( ) ) ) ) ; preference . append ( SEPARATOR ) ; } } String pref = preference . toString ( ) ; <START_BUG> IPreferenceStore store = workbench . getPreferenceStore ( ) ; <END_BUG> store . putValue ( PLUGINS_NOT_ACTIVATED_ON_STARTUP , pref ) ; PrefUtil . savePrefs ( ) ; return true ; } }

Fix:
IPreferenceStore store = PrefUtil . getInternalPreferenceStore ( ) ;
Buggy code:
public class Evaluator { private double lambda ; private int totalSpam ; private int totalHam ; private int spamToSpam ; private int spamToHam ; private int hamToSpam ; private int hamToHam ; private ArrayList < Classification > results ; public Evaluator ( double lambda , ArrayList < Classification > results ) { } public Evaluator ( double lambda , int totalSpam , int totalHam , int spamToSpam , int spamToHam , int hamToSpam , int hamToHam ) { } private void processResults ( ) { } private String getBestLabel ( Labeling labeling ) { } public int getTotalSpam ( ) { } public int getTotalHam ( ) { } public int getSpamToSpam ( ) { } public int getSpamToHam ( ) { } public int getHamToSpam ( ) { } public int getHamToHam ( ) { } public double getAccuracy ( ) { } public double getError ( ) { } public double getWeightedAccuracy ( ) { } public double getWeightedError ( ) { } public double getWeightedAccuracyBaseline ( ) { } public double getWeightedErrorBaseline ( ) { } public double getTotalCostRatio ( ) { } public double getSpamPrecision ( ) { } public double getSpamRecall ( ) { } public double getSpamF1 ( ) { } public double getHamPrecision ( ) { } public double getHamRecall ( ) { } public double getWeightedSpamPrecision ( ) { } public double getWeightedSpamF1 ( ) { } public String getRawStats ( ) { } public String getStats ( ) { } public ArrayList < DoubleDoublePair > getRoc ( ArrayList < Double > lambdas ) { ArrayList < DoubleDoublePair > roc = new ArrayList < DoubleDoublePair > ( ) ; double oldLambda = this . lambda ; for ( double lambda : lambdas ) { this . lambda = lambda ; processResults ( ) ; <START_BUG> roc . add ( new DoubleDoublePair ( getSpamRecall ( ) , getHamRecall ( ) ) ) ; <END_BUG> } this . lambda = oldLambda ; processResults ( ) ; return roc ; } }

Fix:
roc . add ( new DoubleDoublePair ( ( 1 - ( getHamRecall ( ) ) ) , getSpamRecall ( ) ) ) ;
Buggy code:
public class PathExistsMessageFilter extends BaseMessageFilter { private String xpath ; public PathExistsMessageFilter ( String path ) { } @ Override public boolean apply ( Object input ) { JXPathContext jxpath = JXPathContext . newContext ( input ) ; jxpath . setLenient ( true ) ; Pointer pointer = jxpath . getPointer ( xpath ) ; <START_BUG> return ( pointer != null ) && ( ! ( pointer instanceof NullPointer ) ) ; <END_BUG> } public String getXpath ( ) { } @ Override public String toString ( ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { } }

Fix:
return ( ( pointer != null ) && ( ! ( pointer instanceof NullPointer ) ) ) && ( ( pointer . getValue ( ) ) != null ) ;
Buggy code:
public class ServerPathRemove extends AbstractServerModelUpdate < Void > { private static final long serialVersionUID = 6683732173045719685L ; private final String name ; public ServerPathRemove ( String name ) { } @ Override protected void applyUpdate ( ServerModel element ) throws UpdateFailedException { } @ Override public AbstractServerModelUpdate < ? > getCompensatingUpdate ( ServerModel original ) { } @ Override public < P > void applyUpdate ( UpdateContext context , UpdateResultHandler < ? super Void , P > resultHandler , P param ) { <START_BUG> final ServiceController < ? > controller = context . getServiceContainer ( ) . getService ( AbstractPathService . pathNameOf ( name ) ) ; <END_BUG> if ( controller == null ) { resultHandler . handleSuccess ( null , param ) ; } else { controller . addListener ( new UpdateResultHandler . ServiceRemoveListener < P > ( resultHandler , param ) ) ; } } }

Fix:
final ServiceController < ? > controller = context . getServiceRegistry ( ) . getService ( AbstractPathService . pathNameOf ( name ) ) ;
Buggy code:
public class AsyncHandlerUpdateProperties extends HandlerUpdateProperties < AsyncHandler > { static final AsyncHandlerUpdateProperties INSTANCE = new AsyncHandlerUpdateProperties ( ) ; static final String OPERATION_NAME = HandlerUpdateProperties . OPERATION_NAME ; private AsyncHandlerUpdateProperties ( ) { } @ Override protected boolean applyUpdateToRuntime ( OperationContext context , final String handlerName , final ModelNode model , final ModelNode originalModel , final AsyncHandler handler ) throws OperationFailedException { boolean requireRestart = false ; final ModelNode overflowAction = CommonAttributes . OVERFLOW_ACTION . resolveModelAttribute ( context , model ) ; if ( overflowAction . isDefined ( ) ) { <START_BUG> handler . setOverflowAction ( OverflowAction . valueOf ( overflowAction . asString ( ) . toUpperCase ( Locale . US ) ) ) ; <END_BUG> } final ModelNode queueLength = CommonAttributes . QUEUE_LENGTH . resolveModelAttribute ( context , model ) ; if ( queueLength . isDefined ( ) ) { requireRestart = true ; } final ModelNode subhandlers = CommonAttributes . SUBHANDLERS . resolveModelAttribute ( context , model ) ; if ( subhandlers . isDefined ( ) ) { AsyncHandlerUnassignSubhandler . removeHandlers ( CommonAttributes . SUBHANDLERS , originalModel , context , handlerName ) ; AsyncHandlerAssignSubhandler . addHandlers ( CommonAttributes . SUBHANDLERS , model , context , handlerName ) ; } return requireRestart ; } @ Override protected void revertUpdateToRuntime ( final OperationContext context , final String handlerName , final ModelNode model , final ModelNode originalModel , final AsyncHandler handler ) throws OperationFailedException { } }

Fix:
handler . setOverflowAction ( ModelParser . parseOverflowAction ( overflowAction ) ) ;
Buggy code:
public class EmptyStatement extends Statement { public EmptyStatement ( int startPosition , int endPosition ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public boolean complainIfUnreachable ( FlowInfo flowInfo , BlockScope scope , boolean didAlreadyComplain ) { <START_BUG> if ( ( scope . environment ( ) . options . complianceLevel ) < ( ClassFileConstants . JDK1_4 ) ) { <END_BUG> return false ; } return super . complainIfUnreachable ( flowInfo , scope , didAlreadyComplain ) ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public StringBuffer printStatement ( int tab , StringBuffer output ) { } public void resolve ( BlockScope scope ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
if ( ( scope . compilerOptions ( ) . complianceLevel ) < ( ClassFileConstants . JDK1_4 ) ) {
Buggy code:
public class Application { private String message ; public Application ( ) { } public Application ( String message ) { } public String getMessage ( ) { } public int add ( int a , int b ) { <START_BUG> return a * b ; <END_BUG> } }

Fix:
return a + b ;
Buggy code:
public class BitIntegrityReportTaskProcessor implements TaskProcessor { private static Logger log = LoggerFactory . getLogger ( BitIntegrityReportTaskProcessor . class ) ; private BitIntegrityCheckReportTask task ; private BitLogStore bitLogStore ; private StorageProvider store ; private WorkmanConfigurationManager config ; private NotificationManager notificationManager ; public BitIntegrityReportTaskProcessor ( BitIntegrityCheckReportTask task , BitLogStore bitLogStore , StorageProvider store , WorkmanConfigurationManager config , NotificationManager notificationManager ) { } @ Override public void execute ( ) throws TaskExecutionFailedException { } private List < BitLogItem > writeLog ( File bitLog , String account , String storeId , String spaceId ) throws Exception { } private boolean isError ( BitLogItem item ) { } private File createNewLogFile ( String account , String storeId , String spaceId , File bitLogDir ) { DateFormat fileDateFormat = new SimpleDateFormat ( PLAIN_FORMAT . getPattern ( ) ) ; <START_BUG> File bitLog = new File ( bitLogDir , ( ( ( ( ( ( ( ( "bit-integrity_" + account ) + "_" ) + storeId ) + "_" ) + spaceId ) + "_" ) + ( fileDateFormat . format ( new Date ( ) ) ) ) + ".txt" ) ) ; <END_BUG> return bitLog ; } }

Fix:
File bitLog = new File ( bitLogDir , ( ( ( ( ( ( ( ( "bit-integrity_" + account ) + "_" ) + storeId ) + "_" ) + spaceId ) + "_" ) + ( fileDateFormat . format ( new Date ( ) ) ) ) + ".tsv" ) ) ;
Buggy code:
public class ItalicFormatAction extends CheckBoxAction implements ContainerListener , Observer { public ItalicFormatAction ( FrameMediator frameMediator ) { } public void update ( Observable arg0 , Object arg1 ) { } public void actionPerformed ( ActionEvent evt ) { } public void componentAdded ( ContainerEvent e ) { <START_BUG> log . debug ( "Re-registering<seq2seq4repair_space>as<seq2seq4repair_space>observer<seq2seq4repair_space>on<seq2seq4repair_space>editor<seq2seq4repair_space>controller" ) ; <END_BUG> ( ( org . columba . mail . gui . composer . ComposerController ) ( getFrameMediator ( ) ) ) . getEditorController ( ) . addObserver ( this ) ; } public void componentRemoved ( ContainerEvent e ) { } }

Fix:
log . info ( "Re-registering<seq2seq4repair_space>as<seq2seq4repair_space>observer<seq2seq4repair_space>on<seq2seq4repair_space>editor<seq2seq4repair_space>controller" ) ;
Buggy code:
public class Path extends Resource { public int handle ; PointF currentPoint = new PointF ( ) ; PointF startPoint = new PointF ( ) ; public Path ( Device device ) { } public Path ( Device device , Path path , float flatness ) { } public Path ( Device device , PathData data ) { } public void addArc ( float x , float y , float width , float height , float startAngle , float arcAngle ) { } public void addPath ( Path path ) { } public void addRectangle ( float x , float y , float width , float height ) { } public void addString ( String string , float x , float y , Font font ) { if ( isDisposed ( ) ) SWT . error ( ERROR_GRAPHIC_DISPOSED ) ; if ( font == null ) SWT . error ( ERROR_NULL_ARGUMENT ) ; if ( font . isDisposed ( ) ) SWT . error ( ERROR_INVALID_ARGUMENT ) ; int length = string . length ( ) ; char [ ] buffer = new char [ length ] ; string . getChars ( 0 , length , buffer , 0 ) ; int hDC = device . internal_new_GC ( null ) ; <START_BUG> int gdipFont = GC . createGdipFont ( hDC , font . handle ) ; <END_BUG> PointF point = new PointF ( ) ; point . X = x - ( ( Gdip . Font_GetSize ( gdipFont ) ) // 6 ) ; point . Y = y ; int family = Gdip . FontFamily_new ( ) ; Gdip . Font_GetFamily ( gdipFont , family ) ; int style = Gdip . Font_GetStyle ( gdipFont ) ; float size = Gdip . Font_GetSize ( gdipFont ) ; Gdip . GraphicsPath_AddString ( handle , buffer , length , family , style , size , point , 0 ) ; Gdip . GraphicsPath_GetLastPoint ( handle , currentPoint ) ; Gdip . FontFamily_delete ( family ) ; Gdip . Font_delete ( gdipFont ) ; device . internal_dispose_GC ( hDC , null ) ; } public void close ( ) { } public boolean contains ( float x , float y , GC gc , boolean outline ) { } public void cubicTo ( float cx1 , float cy1 , float cx2 , float cy2 , float x , float y ) { } void destroy ( ) { } public void getBounds ( float [ ] bounds ) { } public void getCurrentPoint ( float [ ] point ) { } public PathData getPathData ( ) { } public void lineTo ( float x , float y ) { } void init ( PathData data ) { } public boolean isDisposed ( ) { } public void moveTo ( float x , float y ) { } public void quadTo ( float cx , float cy , float x , float y ) { } public String toString ( ) { } }

Fix:
int gdipFont = GC . createGdipFont ( hDC , font . handle , 0 , null ) ;
Buggy code:
public class FlowContext implements TypeConstants { public AstNode associatedNode ; public FlowContext parent ; public static final FlowContext NotContinuableContext = new FlowContext ( null , null ) ; public FlowContext ( FlowContext parent , AstNode associatedNode ) { } public Label breakLabel ( ) { } public void checkExceptionHandlers ( TypeBinding [ ] raisedExceptions , AstNode location , FlowInfo flowInfo , BlockScope scope ) { } public void checkExceptionHandlers ( TypeBinding raisedException , AstNode location , FlowInfo flowInfo , BlockScope scope ) { } public Label continueLabel ( ) { } public FlowContext getTargetContextForBreakLabel ( char [ ] labelName ) { } public FlowContext getTargetContextForContinueLabel ( char [ ] labelName ) { } public FlowContext getTargetContextForDefaultBreak ( ) { } public FlowContext getTargetContextForDefaultContinue ( ) { } public String individualToString ( ) { } public FlowInfo initsOnBreak ( ) { <START_BUG> return DeadEnd ; <END_BUG> } public boolean isBreakable ( ) { } public boolean isContinuable ( ) { } public boolean isNonReturningContext ( ) { } public boolean isSubRoutine ( ) { } public char [ ] labelName ( ) { } public void recordBreakFrom ( FlowInfo flowInfo ) { } public void recordContinueFrom ( FlowInfo flowInfo ) { } boolean recordFinalAssignment ( VariableBinding variable , Reference finalReference ) { } public void recordReturnFrom ( UnconditionalFlowInfo flowInfo ) { } public void recordSettingFinal ( VariableBinding variable , Reference finalReference ) { } void removeFinalAssignmentIfAny ( Reference reference ) { } public AstNode subRoutine ( ) { } public String toString ( ) { } }

Fix:
return FlowInfo . DEAD_END ;
Buggy code:
@ RunWith ( Arquillian . class ) @ ServerSetup ( TwoModulesOfDifferentTypeTestCase . ModuleAcDeploymentTestCaseSetup . class ) public class TwoModulesOfDifferentTypeTestCase extends TwoModulesFlatTestCase { static class ModuleAcDeploymentTestCaseSetup extends AbstractModuleDeploymentTestCaseSetup { public static ModelNode address1 ; @ Override public void doSetup ( ManagementClient managementClient ) throws Exception { } @ Override public void tearDown ( ManagementClient managementClient , String containerId ) throws Exception { super . tearDown ( managementClient , containerId ) ; remove ( TwoModulesOfDifferentTypeTestCase . ModuleAcDeploymentTestCaseSetup . address1 ) ; <START_BUG> removeModule ( "org//jboss//ironjacamar//ra16out1" ) ; <END_BUG> } @ Override protected String getSlot ( ) { } } @ Test @ RunAsClient public void testConnection2 ( ) throws Exception { } @ Override protected ModelNode getAddress ( ) { } }

Fix:
removeModule ( "org//jboss//ironjacamar//ra16out1" , true ) ;
Buggy code:
public class DeferredResultTests { @ Test public void setResult ( ) { } @ Test public void setResultTwice ( ) { } @ Test public void setResultWithException ( ) { } @ Test public void isSetOrExpired ( ) { } @ Test public void setExpired ( ) { DeferredResult < String > result = new DeferredResult < String > ( ) ; assertFalse ( result . isSetOrExpired ( ) ) ; <START_BUG> result . setExpired ( ) ; <END_BUG> assertTrue ( result . isSetOrExpired ( ) ) ; assertFalse ( result . setResult ( "hello" ) ) ; } @ Test public void hasTimeout ( ) { } @ Test public void applyTimeoutResult ( ) { } }

Fix:
result . getAndSetExpired ( ) ;
Buggy code:
public class SearchBar extends JPanel { public SearchBar ( final View view , boolean temp ) { } public HistoryTextField getField ( ) { } public void setHyperSearch ( boolean hyperSearch ) { } public void update ( ) { } private View view ; private HistoryTextField find ; private JCheckBox ignoreCase ; private JCheckBox regexp ; private JCheckBox hyperSearch ; private Timer timer ; private RolloverButton close ; private int searchStart ; private boolean searchReverse ; private boolean temp ; private void find ( boolean reverse ) { } private boolean incrementalSearch ( int start , boolean reverse ) { SearchAndReplace . setSearchFileSet ( new CurrentBufferSet ( ) ) ; SearchAndReplace . setSearchString ( find . getText ( ) ) ; SearchAndReplace . setReverseSearch ( reverse ) ; try { <START_BUG> if ( SearchAndReplace . find ( view , view . getBuffer ( ) , start ) ) <END_BUG> return true ; } catch ( Exception e ) { Log . log ( DEBUG , this , e ) ; return true ; } return false ; } private void timerIncrementalSearch ( int start , boolean reverse ) { } class ActionHandler implements ActionListener { public void actionPerformed ( ActionEvent evt ) { } } class DocumentHandler implements DocumentListener { public void insertUpdate ( DocumentEvent evt ) { } public void removeUpdate ( DocumentEvent evt ) { } public void changedUpdate ( DocumentEvent evt ) { } } class KeyHandler extends KeyAdapter { public void keyPressed ( KeyEvent evt ) { } } }

Fix:
if ( SearchAndReplace . find ( view , view . getBuffer ( ) , start , false , reverse ) )
Buggy code:
@ ProjectServiceProvider ( service = TextureIO . class , projectType = "org-shaman-editor-module-project" ) public class TextureIOImpl extends TextureIO { public static final String TEXTURE_PREFIX = "Textures//" ; private static final boolean FLIP_RED_BLUE = false ; private Project project ; private ProjectAssetManager manager ; public TextureIOImpl ( Project project ) { } TextureIOImpl ( ) { } void setProject ( Project p ) { } private ProjectAssetManager getManager ( ) { } @ Override public BufferedImage readTexture ( String assetName , TextureSettings settings ) throws IOException { } @ Override public BufferedImage readTexture ( FileObject texture , TextureSettings settings ) throws IOException { } @ Override public String createTexture ( FileObject source , String folder , String name ) throws IOException { } private String createAssetName ( String folder , String name , FileFormat format ) { } @ Override public boolean deleteTexture ( String folder , String name , TextureSettings settings ) throws IOException { <START_BUG> String assetName = createAssetName ( folder , name , DDS ) ; <END_BUG> FileObject file = getManager ( ) . getAssetFileObject ( assetName ) ; if ( file != null ) { file . delete ( ) ; return true ; } return false ; } @ Override public String createTexture ( FileObject source , String folder , String name , TextureSettings settings ) throws IOException { } private void createTexture0 ( FileObject src , FileObject target , TextureSettings settings ) throws IOException { } @ Override public String createTexture ( BufferedImage source , String folder , String name , TextureSettings settings ) throws IOException { } private BufferedImage convertImg ( BufferedImage img , Compression compression ) { } private void saveDDS ( FileObject target , TextureMap tex , TextureSettings settings ) throws IOException { } private void createTexture0 ( BufferedImage img , FileObject target , TextureSettings settings ) throws IOException { } @ Override public String createTextureMipMaps ( BufferedImage [ ] layers , String folder , String name , TextureSettings settings ) throws IOException { } private static class RedBlueSwapFilter extends RGBImageFilter { private RedBlueSwapFilter ( ) { } @ Override public int filterRGB ( int x , int y , int rgb ) { } @ Override public Object clone ( ) { } } }

Fix:
String assetName = createAssetName ( folder , name , settings . fileFormat ) ;
Buggy code:
public class DeploymentAddHandler implements ModelAddOperationHandler , DescriptionProvider { public static final String OPERATION_NAME = ADD ; static final ModelNode getOperation ( ModelNode address , ModelNode state ) { ModelNode op = Util . getEmptyOperation ( DeploymentAddHandler . OPERATION_NAME , address ) ; op . get ( RUNTIME_NAME ) . set ( state . get ( RUNTIME_NAME ) ) ; <START_BUG> op . get ( HASH ) . set ( state . get ( HASH ) ) ; <END_BUG> return op ; } private static final List < String > CONTENT_ADDITION_PARAMETERS = Arrays . asList ( INPUT_STREAM_INDEX , BYTES , URL ) ; private final ContentRepository contentRepository ; private final boolean isMaster ; private final ParametersValidator validator = new ParametersValidator ( ) ; public DeploymentAddHandler ( final ContentRepository contentRepository , final boolean isMaster ) { } @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public OperationResult execute ( OperationContext context , ModelNode operation , ResultHandler resultHandler ) throws OperationFailedException { } private static InputStream getInputStream ( OperationContext context , ModelNode operation ) throws OperationFailedException { } private static boolean hasValidContentAdditionParameterDefined ( ModelNode operation ) { } private static OperationFailedException createFailureException ( String format , Object ... params ) { } private static OperationFailedException createFailureException ( Throwable cause , String format , Object ... params ) { } private static OperationFailedException createFailureException ( String msg ) { } private static OperationFailedException createFailureException ( Throwable cause , String msg ) { } private static void validateOnePieceOfContent ( final ModelNode content ) throws OperationFailedException { } }

Fix:
op . get ( CONTENT ) . set ( state . get ( CONTENT ) ) ;
Buggy code:
public class TransportAdd extends AbstractAddStepHandler { public static final TransportAdd INSTANCE = new TransportAdd ( ) ; static ModelNode createOperation ( ModelNode address , ModelNode existing ) throws OperationFailedException { } @ Override protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { } private static void populate ( ModelNode operation , ModelNode model ) throws OperationFailedException { <START_BUG> for ( AttributeDefinition attr : CommonAttributes . TRANSPORT_ATTRIBUTES ) { <END_BUG> attr . validateAndSet ( operation , model ) ; } } }

Fix:
for ( AttributeDefinition attr : TransportResource . TRANSPORT_ATTRIBUTES ) {
Buggy code:
public class ParseProperties implements ParseNextProperty { private final Project project ; private final GetProperty getProperty ; private final Collection expanders ; public ParseProperties ( Project project , Collection expanders , GetProperty getProperty ) { } public Project getProject ( ) { } public Object parseProperties ( String value ) { <START_BUG> if ( ( ( value == null ) || ( "" . equals ( value ) ) ) || ( ( value . indexOf ( '$' ) ) == ( - 1 ) ) ) { <END_BUG> return value ; } ParsePosition pos = new ParsePosition ( 0 ) ; Object o = parseNextProperty ( value , pos ) ; if ( ( o != null ) && ( ( pos . getIndex ( ) ) == ( value . length ( ) ) ) ) { return o ; } StringBuffer sb = new StringBuffer ( ( ( value . length ( ) ) * 2 ) ) ; if ( o == null ) { sb . append ( value . charAt ( pos . getIndex ( ) ) ) ; pos . setIndex ( ( ( pos . getIndex ( ) ) + 1 ) ) ; } else { sb . append ( o ) ; } while ( ( pos . getIndex ( ) ) < ( value . length ( ) ) ) { o = parseNextProperty ( value , pos ) ; if ( o == null ) { sb . append ( value . charAt ( pos . getIndex ( ) ) ) ; pos . setIndex ( ( ( pos . getIndex ( ) ) + 1 ) ) ; } else { sb . append ( o ) ; } } return sb . toString ( ) ; } public boolean containsProperties ( String value ) { } public Object parseNextProperty ( String value , ParsePosition pos ) { } private String parsePropertyName ( String value , ParsePosition pos ) { } private Object getProperty ( String propertyName ) { } }

Fix:
if ( ( value == null ) || ( "" . equals ( value ) ) ) {
Buggy code:
public class StringResourceModelTest extends TestCase { private MockWebApplication application ; private WebPage page ; private StringResourceModelTest . WeatherStation ws ; private Model wsModel ; public StringResourceModelTest ( String name ) { } protected void setUp ( ) throws Exception { super . setUp ( ) ; application = new MockWebApplication ( null ) ; <START_BUG> application . getSettings ( ) . addStringResourceLoader ( new BundleStringResourceLoader ( "wicket.model.StringResourceModelTest" ) ) ; <END_BUG> page = new MockPage ( null ) ; ws = new StringResourceModelTest . WeatherStation ( ) ; wsModel = new Model ( ws ) ; } public void testGetSimpleResource ( ) { } public void testNullResourceKey ( ) { } public void testGetSimpleResourceWithKeySubstitution ( ) { } public void testGetPropertySubstitutedResource ( ) { } public void testSubstitutionParametersResource ( ) { } public void testUninitialisedLocalizer ( ) { } public void testSetObject ( ) { } public void testDetachAttachNormalModel ( ) throws Exception { } public void testDetachAttachDetachableModel ( ) throws Exception { } public class WeatherStation implements Serializable { private static final long serialVersionUID = 1L ; private String currentStatus = "sunny" ; private double currentTemperature = 25.7 ; public String getCurrentStatus ( ) { } public void setCurrentStatus ( String currentStatus ) { } public double getCurrentTemperature ( ) { } public void setCurrentTemperature ( double currentTemperature ) { } public String getUnits ( ) { } } }

Fix:
application . getResourceSettings ( ) . addStringResourceLoader ( new BundleStringResourceLoader ( "wicket.model.StringResourceModelTest" ) ) ;
Buggy code:
public class MainActivity extends Activity { public static MyDBhelper dbhelper ; public void initView ( ) { } @ Override protected void onCreate ( Bundle savedInstanceState ) { } protected void onDestroy ( ) { } private void openDatabase ( ) { } private void closeDatabase ( ) { } private Cursor getCursor ( ) { } private void showInList ( ) { SQLiteDatabase dbRead = MainActivity . dbhelper . getReadableDatabase ( ) ; <START_BUG> Cursor cursor = dbRead . rawQuery ( ( ( "select<seq2seq4repair_space>NAME_COLUMN<seq2seq4repair_space>from<seq2seq4repair_space>" + ( MyDBhelper . TABLE_NAME ) ) + "<seq2seq4repair_space>ORDER<seq2seq4repair_space>BY<seq2seq4repair_space>COUNTTIME_COLUMN<seq2seq4repair_space>DESC" ) , null ) ; <END_BUG> String [ ] friendlist = new String [ cursor . getCount ( ) ] ; int row_count = cursor . getCount ( ) ; if ( row_count != 0 ) { cursor . moveToFirst ( ) ; for ( int i = 0 ; i < row_count ; i ++ ) { friendlist [ i ] = cursor . getString ( 0 ) ; } } ListView listViewfriends = ( ( ListView ) ( findViewById ( listViewFriends ) ) ) ; listViewfriends . setAdapter ( new android . widget . ArrayAdapter ( this , layout . simple_list_item_1 , friendlist ) ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } No newline ; at end ; of file ; }

Fix:
Cursor cursor = dbRead . rawQuery ( ( ( "select<seq2seq4repair_space>name<seq2seq4repair_space>from<seq2seq4repair_space>" + ( MyDBhelper . TABLE_NAME ) ) + "<seq2seq4repair_space>ORDER<seq2seq4repair_space>BY<seq2seq4repair_space>counttimer<seq2seq4repair_space>DESC" ) , null ) ;
Buggy code:
public class ExternalToolsWizardLauncher { ExternalToolsWizardModelListener listener ; DataModel data ; public void launchFirstTimeWizard ( String pluginID ) { final String id = pluginID ; final AbstractExternalToolsPlugin plugin ; ExternalToolsPluginHandler handler = null ; try { handler = ( ( ExternalToolsPluginHandler ) ( pluginManager . getHandler ( "org.columba.core.externaltools" ) ) ) ; } catch ( PluginHandlerNotFoundException e ) { e . printStackTrace ( ) ; } try { plugin = ( ( AbstractExternalToolsPlugin ) ( handler . getPlugin ( pluginID , null ) ) ) ; } catch ( Exception e1 ) { e1 . printStackTrace ( ) ; return ; } data = new DataModel ( ) ; data . registerDataLookup ( "id" , new DataLookup ( ) { public Object lookupData ( ) { return id ; } } ) ; data . registerDataLookup ( "Plugin" , new DataLookup ( ) { public Object lookupData ( ) { return plugin ; } } ) ; <START_BUG> WizardModel model = new net . javaprog . ui . wizard . DefaultWizardModel ( new Step [ ] { new InfoStep ( data ) , new DescriptionStep ( data ) , new LocationStep ( data ) } ) ; <END_BUG> listener = new ExternalToolsWizardModelListener ( data ) ; model . addWizardModelListener ( listener ) ; Wizard wizard = new Wizard ( model , "External<seq2seq4repair_space>Tools<seq2seq4repair_space>Configuration" , null ) ; wizard . pack ( ) ; wizard . setLocationRelativeTo ( null ) ; wizard . setVisible ( true ) ; } public void launchWizard ( String pluginID ) { } public boolean isFinished ( ) { } public DataModel getData ( ) { } }

Fix:
WizardModel model = new net . javaprog . ui . wizard . DefaultWizardModel ( new Step [ ] { new InfoStep ( ) , new DescriptionStep ( data ) , new LocationStep ( data ) } ) ;
Buggy code:
class ErrorContextHandler { private static final String INDEX_HTML = "index.html" ; private static final String INDEX_WIN_HTML = "index_win.html" ; private static final String ERROR_MODULE = "org.jboss.as.domain-http-error-context" ; static final String ERROR_CONTEXT = "//error" ; private static final String DEFAULT_RESOURCE ; private ErrorContextHandler ( ) { } public static HttpHandler createErrorContext ( final String slot ) throws ModuleLoadException { final ClassPathResourceManager cpresource = new ClassPathResourceManager ( ErrorContextHandler . getClassLoader ( Module . getCallerModuleLoader ( ) , ErrorContextHandler . ERROR_MODULE , slot ) , "" ) ; final ResourceHandler handler = new ResourceHandler ( ) . setAllowed ( Predicates . not ( Predicates . path ( "META-INF" ) ) ) . setResourceManager ( cpresource ) . setDirectoryListingEnabled ( false ) . setCachable ( Predicates . < HttpServerExchange > falsePredicate ( ) ) ; <START_BUG> PredicateHandler predicateHandler = new PredicateHandler ( Predicates . path ( "" ) , new RedirectHandler ( ( ( ErrorContextHandler . ERROR_CONTEXT ) + ( ErrorContextHandler . DEFAULT_RESOURCE ) ) ) , handler ) ; <END_BUG> return predicateHandler ; } private static ClassLoader getClassLoader ( final ModuleLoader moduleLoader , final String module , final String slot ) throws ModuleLoadException { } }

Fix:
PredicateHandler predicateHandler = new PredicateHandler ( Predicates . path ( "//" ) , new RedirectHandler ( ( ( ErrorContextHandler . ERROR_CONTEXT ) + ( ErrorContextHandler . DEFAULT_RESOURCE ) ) ) , handler ) ;
Buggy code:
public class ImageTransfer extends ByteArrayTransfer { private static ImageTransfer _instance = new ImageTransfer ( ) ; private static final String CF_DIB = "CF_DIB" ; private static final int CF_DIBID = COM . CF_DIB ; private ImageTransfer ( ) { } public static ImageTransfer getInstance ( ) { } public void javaToNative ( Object object , TransferData transferData ) { } public Object nativeToJava ( TransferData transferData ) { if ( ( ! ( isSupportedType ( transferData ) ) ) || ( ( transferData . pIDataObject ) == 0 ) ) return null ; IDataObject dataObject = new IDataObject ( transferData . pIDataObject ) ; dataObject . AddRef ( ) ; FORMATETC formatetc = new FORMATETC ( ) ; formatetc . cfFormat = COM . CF_DIB ; formatetc . ptd = 0 ; formatetc . dwAspect = COM . DVASPECT_CONTENT ; formatetc . lindex = - 1 ; formatetc . tymed = COM . TYMED_HGLOBAL ; STGMEDIUM stgmedium = new STGMEDIUM ( ) ; stgmedium . tymed = COM . TYMED_HGLOBAL ; <START_BUG> transferData . result = dataObject . GetData ( formatetc , stgmedium ) ; <END_BUG> if ( ( transferData . result ) != ( COM . S_OK ) ) return null ; int hMem = stgmedium . unionField ; dataObject . Release ( ) ; try { int ptr = OS . GlobalLock ( hMem ) ; if ( ptr == 0 ) return null ; try { BITMAPINFOHEADER bmiHeader = new BITMAPINFOHEADER ( ) ; OS . MoveMemory ( bmiHeader , ptr , sizeof ) ; int [ ] pBits = new int [ 1 ] ; int memDib = OS . CreateDIBSection ( 0 , ptr , DIB_RGB_COLORS , pBits , 0 , 0 ) ; if ( memDib == 0 ) SWT . error ( ERROR_NO_HANDLES ) ; int bits = ptr + ( bmiHeader . biSize ) ; if ( ( bmiHeader . biBitCount ) <= 8 ) { bits += ( 1 << ( bmiHeader . biBitCount ) ) * 4 ; } else if ( ( bmiHeader . biCompression ) == ( OS . BI_BITFIELDS ) ) { bits += 12 ; } if ( ( bmiHeader . biHeight ) < 0 ) { OS . MoveMemory ( pBits [ 0 ] , bits , bmiHeader . biSizeImage ) ; } else { DIBSECTION dib = new DIBSECTION ( ) ; OS . GetObject ( memDib , DIBSECTION . sizeof , dib ) ; int biHeight = dib . biHeight ; int scanline = ( dib . biSizeImage ) // biHeight ; int pDestBits = pBits [ 0 ] ; int pSourceBits = bits + ( scanline * ( biHeight - 1 ) ) ; for ( int i = 0 ; i < biHeight ; i ++ ) { OS . MoveMemory ( pDestBits , pSourceBits , scanline ) ; pDestBits += scanline ; pSourceBits -= scanline ; } } Image image = Image . win32_new ( null , BITMAP , memDib ) ; ImageData data = image . getImageData ( ) ; OS . DeleteObject ( memDib ) ; image . dispose ( ) ; return data ; } finally { OS . GlobalUnlock ( hMem ) ; } } finally { OS . GlobalFree ( hMem ) ; } } protected int [ ] getTypeIds ( ) { } protected String [ ] getTypeNames ( ) { } boolean checkImage ( Object object ) { } protected boolean validate ( Object object ) { } }

Fix:
transferData . result = getData ( dataObject , formatetc , stgmedium ) ;
Buggy code:
public class NBTHelper { public static final String MOD_NBT = "CandisPerUserDifficulty" ; public static final String DIFFICULTY_NBT = "difficulty" ; public static final String LAST_CHANGED_NBT = "last-changed" ; public static final String SAVED_INVENTORY_NBT = "saved-inventory" ; public static final String HOME_LOCATION_NBT = "home-location" ; public static final String BACK_LOCATION_NBT = "back-location" ; public static final String DIMENSION_NBT = "dim" ; public static final String X_NBT = "x" ; public static final String Y_NBT = "y" ; public static final String Z_NBT = "z" ; public static PlayerDifficulty getDifficultyLevel ( EntityPlayer player ) { } public static void setDifficultyLevel ( EntityPlayer player , PlayerDifficulty difficulty ) { } public static long getLastChanged ( EntityPlayer player ) { } private static void updateLastChanged ( EntityPlayer player ) { } public static void saveInventory ( EntityPlayer player , ArrayList < ItemStack > inventory ) { } public static ArrayList < ItemStack > getSavedInventory ( EntityPlayer player ) { } public static void eraseSavedInventory ( EntityPlayer player ) { } public static void setBackLocation ( EntityPlayer player , Location location ) { } public static Location getBackLocation ( EntityPlayer player ) { } public static void eraseBackLocation ( EntityPlayer player ) { <START_BUG> NBTHelper . getModNBT ( player ) . setTag ( NBTHelper . BACK_LOCATION_NBT , new NBTTagCompound ( ) ) ; <END_BUG> } public static void setHomeLocation ( EntityPlayer player , Location location ) { } public static Location getHomeLocation ( EntityPlayer player , int dimension ) { } private static NBTTagCompound getModNBT ( EntityPlayer player ) { } }

Fix:
NBTHelper . getModNBT ( player ) . removeTag ( NBTHelper . BACK_LOCATION_NBT ) ;
Buggy code:
public class AllTracing5Tests { public static Test suite ( ) { <START_BUG> TestSuite suite = new TestSuite ( "Test<seq2seq4repair_space>for<seq2seq4repair_space>org.aspectj.weaver" ) ; <END_BUG> suite . addTestSuite ( Jdk14TraceFactoryTest . class ) ; suite . addTestSuite ( Jdk14TraceTest . class ) ; return suite ; } }

Fix:
TestSuite suite = new TestSuite ( AllTracing5Tests . class . getName ( ) ) ;
Buggy code:
public interface Schedulable { <START_BUG> public void perform ( Date pTimeOfCall , int pRemainingRepetitions ) ; <END_BUG> }

Fix:
public void perform ( Date pTimeOfCall , long pRemainingRepetitions ) ;
Buggy code:
public class ThingListFragment extends Fragment { private View mView ; private Button mBackButton ; private Button mDeleteButton ; private List < Thing > mThings ; private RecyclerView mThingRecyclerView ; private ThingAdapter mAdapter ; private int selectedItemPosition ; private ThingListFragment . onBackPressedListener mCallBackToActivity ; public interface onBackPressedListener { void onBackPressed ( ) { } } @ Override public void onAttach ( Context context ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { mView = inflater . inflate ( fragment_list , container , false ) ; setButtons ( ) ; mThingRecyclerView = ( ( RecyclerView ) ( mView . findViewById ( thing_recycler_view ) ) ) ; mThingRecyclerView . setLayoutManager ( new android . support . v7 . widget . LinearLayoutManager ( getActivity ( ) ) ) ; mThingRecyclerView . setOnLongClickListener ( new View . OnLongClickListener ( ) { @ Override public boolean onLongClick ( View v ) { return false ; } } ) ; mThingRecyclerView . addOnItemTouchListener ( new RecyclerItemClickListener ( mThingRecyclerView . getContext ( ) , new RecyclerItemClickListener . OnItemClickListener ( ) { @ Override public void onItemClick ( View view , int position ) { <START_BUG> int itemPosition = mThingRecyclerView . getChildPosition ( view ) ; <END_BUG> Thing item = mThings . get ( itemPosition ) ; Toast . makeText ( mThingRecyclerView . getContext ( ) , item . getWhat ( ) , LENGTH_LONG ) . show ( ) ; mThings . remove ( position ) ; mAdapter . notifyItemRemoved ( position ) ; mAdapter . notifyItemRangeChanged ( position , mThings . size ( ) ) ; } } ) ) ; updateUI ( ) ; return mView ; } private void updateUI ( ) { } public void setThings ( List < Thing > crimes ) { } private void setButtons ( ) { } private void makeToast ( String string ) { } }

Fix:
int itemPosition = mThingRecyclerView . getChildAdapterPosition ( view ) ;
Buggy code:
public class JFiltrVyberIkon extends JVyberIkon0 { private static final long serialVersionUID = - 6496737194139718970L ; private KesBag kesBag ; private KesoidModel kesoidModel ; public JFiltrVyberIkon ( ) { } public void resetBag ( IkonBag bag , KesBag kesBag , Set < String > aJmenaVybranychAlel ) { } @ Override protected void zmenaVyberu ( Set < Alela > aAlely ) { System . out . println ( ( "Vyber<seq2seq4repair_space>alel,<seq2seq4repair_space>které<seq2seq4repair_space>se<seq2seq4repair_space>Filtrují<seq2seq4repair_space>pryč:<seq2seq4repair_space>" + aAlely ) ) ; <START_BUG> kesoidModel . setJmenaNechtenychlel ( Alela . alelyToNames ( aAlely ) ) ; <END_BUG> } @ Override protected boolean shouldRender ( Alela alela ) { } @ Override protected boolean shouldRender ( Gen gen ) { } @ Override protected boolean shouldEnable ( Alela alela ) { } public void inject ( KesoidModel kesoidModel ) { } }

Fix:
kesoidModel . setJmenaNechtenychAlel ( Alela . alelyToNames ( aAlely ) ) ;