nus-yam/ex-repair huggingface dataset:
Buggy code:
public class RowRepairResolver extends AbstractRowResolver { protected int maxLiveColumns = 0 ; public List < IAsyncResult > repairResults = Collections . emptyList ( ) ; public RowRepairResolver ( String table , ByteBuffer key ) { } public Row resolve ( ) throws IOException , DigestMismatchException { if ( logger . isDebugEnabled ( ) ) logger . debug ( ( ( "resolving<seq2seq4repair_space>" + ( replies . size ( ) ) ) + "<seq2seq4repair_space>responses" ) ) ; long startTime = System . currentTimeMillis ( ) ; ColumnFamily resolved ; if ( ( replies . size ( ) ) > 1 ) { List < ColumnFamily > versions = new ArrayList < ColumnFamily > ( replies . size ( ) ) ; List < InetAddress > endpoints = new ArrayList < InetAddress > ( replies . size ( ) ) ; for ( Map . Entry < Message , ReadResponse > entry : replies . entrySet ( ) ) { Message message = entry . getKey ( ) ; ReadResponse response = entry . getValue ( ) ; ColumnFamily cf = response . row ( ) . cf ; assert ! ( response . isDigestQuery ( ) ) : "Received<seq2seq4repair_space>digest<seq2seq4repair_space>response<seq2seq4repair_space>to<seq2seq4repair_space>repair<seq2seq4repair_space>read<seq2seq4repair_space>from<seq2seq4repair_space>" + ( entry . getKey ( ) . getFrom ( ) ) ; versions . add ( cf ) ; endpoints . add ( message . getFrom ( ) ) ; <START_BUG> int liveColumns = cf . getLiveColumnCount ( ) ; <END_BUG> if ( liveColumns > ( maxLiveColumns ) ) maxLiveColumns = liveColumns ; } resolved = RowRepairResolver . resolveSuperset ( versions ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "versions<seq2seq4repair_space>merged" ) ; if ( resolved != null ) repairResults = RowRepairResolver . scheduleRepairs ( resolved , table , key , versions , endpoints ) ; } else { resolved = replies . values ( ) . iterator ( ) . next ( ) . row ( ) . cf ; } if ( logger . isDebugEnabled ( ) ) logger . debug ( ( ( "resolve:<seq2seq4repair_space>" + ( ( System . currentTimeMillis ( ) ) - startTime ) ) + "<seq2seq4repair_space>ms." ) ) ; return new Row ( key , resolved ) ; } public static List < IAsyncResult > scheduleRepairs ( ColumnFamily resolved , String table , DecoratedKey < ? > key , List < ColumnFamily > versions , List < InetAddress > endpoints ) { } static ColumnFamily resolveSuperset ( Iterable < ColumnFamily > versions ) { } public Row getData ( ) throws IOException { } public boolean isDataPresent ( ) { } public int getMaxLiveColumns ( ) { } }

Fix:
int liveColumns = ( cf == null ) ? 0 : cf . getLiveColumnCount ( ) ;
Buggy code:
public class Email { public static boolean sendEmail ( TemplateContext context , ModuleEntity module , Object fromUser , List toUsers , List ccUsers , String subject , String template ) throws Exception { boolean success = true ; TemplateEmail te = new TemplateEmail ( ) ; if ( context == null ) { context = new DefaultTemplateContext ( ) ; } te . setContext ( context ) ; if ( fromUser instanceof ScarabUser ) { ScarabUser u = ( ( ScarabUser ) ( fromUser ) ) ; <START_BUG> te . setFrom ( ( ( u . getFirstName ( ) ) + ( u . getLastName ( ) ) ) , u . getEmail ( ) ) ; <END_BUG> } else { String key = ( ( String ) ( fromUser ) ) ; if ( fromUser == null ) { key = "scarab.email.default" ; } te . setFrom ( Turbine . getConfiguration ( ) . getString ( ( key + ".fromName" ) , "Scarab<seq2seq4repair_space>System" ) , Turbine . getConfiguration ( ) . getString ( ( key + ".fromAddress" ) , "help@scarab.tigris.org" ) ) ; } if ( subject == null ) { te . setSubject ( Turbine . getConfiguration ( ) . getString ( "scarab.email.default.subject" ) ) ; } else { te . setSubject ( subject ) ; } if ( template == null ) { te . setTemplate ( Turbine . getConfiguration ( ) . getString ( "scarab.email.default.template" ) ) ; } else { te . setTemplate ( template ) ; } Iterator iter = toUsers . iterator ( ) ; while ( iter . hasNext ( ) ) { ScarabUser toUser = ( ( ScarabUser ) ( iter . next ( ) ) ) ; te . addTo ( toUser . getEmail ( ) , ( ( ( toUser . getFirstName ( ) ) + "<seq2seq4repair_space>" ) + ( toUser . getLastName ( ) ) ) ) ; } if ( ccUsers != null ) { iter = ccUsers . iterator ( ) ; while ( iter . hasNext ( ) ) { ScarabUser ccUser = ( ( ScarabUser ) ( iter . next ( ) ) ) ; te . addCc ( ccUser . getEmail ( ) , ( ( ( ccUser . getFirstName ( ) ) + "<seq2seq4repair_space>" ) + ( ccUser . getLastName ( ) ) ) ) ; } } String archiveEmail = module . getArchiveEmail ( ) ; if ( ( archiveEmail != null ) && ( ( archiveEmail . trim ( ) . length ( ) ) > 0 ) ) { te . addCc ( archiveEmail , null ) ; } try { te . sendMultiple ( ) ; } catch ( SendFailedException e ) { success = false ; } return success ; } public static boolean sendEmail ( TemplateContext context , ModuleEntity module , Object fromUser , ScarabUser toUser , String subject , String template ) throws Exception { } }

Fix:
te . setFrom ( u . getName ( ) , u . getEmail ( ) ) ;
Buggy code:
class Packer { private static final String [ ] nonTextSuffices = new String [ ] { "png" , "jpg" , "jpeg" , "gif" , "giff" , "tiff" , "svg" , "otf" } ; private static final String LINE_BREAK = "\n" ; private static final String UTF8 = "UTF-8" ; private File resultFile ; private final String path ; private final String watermark ; private final String filename ; Packer ( String path , String watermark , String filename ) { } File pack ( ) throws IOException { Logger . getLogger ( Packer . class . getName ( ) ) . log ( Level . INFO , "Zippar<seq2seq4repair_space>resultatet<seq2seq4repair_space>till<seq2seq4repair_space>ny<seq2seq4repair_space>temporär<seq2seq4repair_space>epub" ) ; <START_BUG> resultFile = new File ( ( ( ( ( ( path ) + ( File . separator ) ) + ( watermark ) ) + "-" ) + ( new Date ( ) . getTime ( ) ) ) ) ; <END_BUG> if ( ! ( resultFile . exists ( ) ) ) { resultFile . mkdirs ( ) ; } resultFile = new File ( ( ( ( ( resultFile . getAbsolutePath ( ) ) + ( File . separator ) ) + ( filename ) ) + ".epub" ) ) ; Writer writer ; ZipOutputStream out ; writer = new OutputStreamWriter ( ( out = new ZipOutputStream ( new FileOutputStream ( resultFile ) ) ) , Packer . UTF8 ) ; zipFileTreeLoop ( new File ( path ) , out , writer ) ; writer . close ( ) ; return resultFile ; } private void zipFileTreeLoop ( File dir , ZipOutputStream out , Writer writer ) throws IOException { } private byte [ ] inputStreamToByteArray ( InputStream stream ) throws IOException { } private boolean isNotText ( File file ) { } }

Fix:
resultFile = new File ( ( ( ( ( ( new File ( path ) . getParent ( ) ) + ( File . separator ) ) + ( watermark ) ) + "-" ) + ( new Date ( ) . getTime ( ) ) ) ) ;
Buggy code:
public abstract class AbstractPluginHandler implements PluginHandler { private static final Logger LOG = Logger . getLogger ( "org.columba.core.plugin" ) ; private static final String RESOURCE_PATH = "org.columba.core.i18n.dialog" ; protected String id ; protected XmlElement parentNode ; protected PluginListConfig pluginListConfig ; protected PluginManager pluginManager ; protected Hashtable transformationTable ; protected Map pluginMap ; protected List externalPlugins ; public AbstractPluginHandler ( String id , String config ) { } protected PluginListConfig getConfig ( ) { } public String getId ( ) { } public Object getPlugin ( String name , Object [ ] args ) throws PluginLoadingFailedException { } protected void handlePluginError ( String plugin ) { } protected Object getPlugin ( String name , String className , Object [ ] args ) throws Exception { } protected String getPluginClassName ( String name , String id ) { } public String getAttribute ( String name , String attribute ) { } public String [ ] getPluginIdList ( ) { int count = parentNode . count ( ) ; List list = new Vector ( ) ; for ( int i = 0 ; i < count ; i ++ ) { XmlElement action = parentNode . getElement ( i ) ; String s = action . getAttribute ( "name" ) ; <START_BUG> XmlElement element = MainInterface . pluginManager . getPluginElement ( s ) ; <END_BUG> if ( element == null ) { list . add ( s ) ; continue ; } String enabled = element . getAttribute ( "enabled" ) ; if ( enabled == null ) { enabled = "true" ; } boolean e = Boolean . valueOf ( enabled ) . booleanValue ( ) ; if ( e ) { list . add ( s ) ; } } String [ ] strs = new String [ list . size ( ) ] ; for ( int i = 0 ; i < ( list . size ( ) ) ; i ++ ) { strs [ i ] = ( ( String ) ( list . get ( i ) ) ) ; } return strs ; } public boolean exists ( String id ) { } public ListIterator getExternalPlugins ( ) { } public PluginManager getPluginManager ( ) { } protected Object loadPlugin ( String className , Object [ ] args ) throws Exception { } public void setPluginManager ( PluginManager pluginManager ) { } public String getUserVisibleName ( String id ) { } public void addExtension ( String id , XmlElement extension ) { } public XmlElement getParent ( ) { } }

Fix:
XmlElement element = PluginManager . getInstance ( ) . getPluginElement ( s ) ;
Buggy code:
public class IgnoreComponentsPanel extends ListPanel { public IgnoreComponentsPanel ( JDialog parent ) { } boolean isTraversalNeeded ( ) { } public boolean isAddArchivesNeeded ( ) { } public boolean isAddClassesNeeded ( ) { } public boolean isAddFoldersNeeded ( ) { } public String getPropertyKey ( ) { } public String getName ( ) { } public Icon getIcon ( ) { } public boolean isValidInput ( ) { } protected String getClassPath ( ) { } public void setProperties ( Properties props ) { } class InputDialog extends EscapeDialog { private static final long serialVersionUID = 1L ; private JTextField className = new JTextField ( 30 ) ; private JCheckBox ignoreChildren = new JCheckBox ( "Ignore<seq2seq4repair_space>Children" , false ) ; private JButton okButton = UIUtils . createOKButton ( ) ; private JButton cancelButton = UIUtils . createCancelButton ( ) ; public InputDialog ( String title , boolean modal ) { } private JPanel getClassNamePanel ( ) { } public String getClassName ( ) { return className . getText ( ) ; } public boolean getIgnoreChildren ( ) { } @ Override public JButton getOKButton ( ) { } @ Override public JButton getCloseButton ( ) { } } public String getClassName ( ) { <START_BUG> IgnoreComponentsPanel . InputDialog dialog = new IgnoreComponentsPanel . InputDialog ( "Class<seq2seq4repair_space>Name" , true ) ; <END_BUG> dialog . setVisible ( true ) ; String className = dialog . getClassName ( ) ; if ( className . equals ( "" ) ) return null ; return ( ( className + "(ignorechildren:" ) + ( dialog . getIgnoreChildren ( ) ) ) + ")" ; } }

Fix:
IgnoreComponentsPanel . InputDialog dialog = new IgnoreComponentsPanel . InputDialog ( "Ignore<seq2seq4repair_space>Component<seq2seq4repair_space>Details" , true ) ;
Buggy code:
public class MarkupComponentBorder extends AbstractBehavior { private static final long serialVersionUID = 1L ; private transient MarkupStream markupStream ; @ Override public void beforeRender ( final Component component ) { } @ Override public void onRendered ( final Component component ) { } private MarkupStream getMarkupStream ( final Component component ) { } private MarkupStream findMarkupStream ( final Component owner ) { final String markupType = getMarkupType ( owner ) ; final IResourceStreamLocator locator = Application . get ( ) . getResourceSettings ( ) . getResourceStreamLocator ( ) ; final String style = owner . getStyle ( ) ; <START_BUG> final String variation = ( owner == null ) ? null : owner . getVariation ( ) ; <END_BUG> final Locale locale = owner . getLocale ( ) ; MarkupResourceStream markupResourceStream = null ; Class < ? > containerClass = getClass ( ) ; while ( ! ( containerClass . equals ( MarkupComponentBorder . class ) ) ) { String path = containerClass . getName ( ) . replace ( '.' , '//' ) ; IResourceStream resourceStream = locator . locate ( containerClass , path , style , variation , locale , markupType ) ; if ( resourceStream != null ) { ContainerInfo ci = new ContainerInfo ( containerClass , locale , style , variation , markupType ) ; markupResourceStream = new MarkupResourceStream ( resourceStream , ci , containerClass ) ; break ; } containerClass = containerClass . getSuperclass ( ) ; } if ( markupResourceStream == null ) { throw new WicketRuntimeException ( ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>markup<seq2seq4repair_space>for<seq2seq4repair_space>component<seq2seq4repair_space>border<seq2seq4repair_space>`" + ( getClass ( ) . getName ( ) ) ) + "`" ) ) ; } try { IMarkupFragment markup = MarkupFactory . get ( ) . newMarkupParser ( markupResourceStream ) . parse ( ) ; return new MarkupStream ( markup ) ; } catch ( Exception e ) { throw new WicketRuntimeException ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>parse<seq2seq4repair_space>markup<seq2seq4repair_space>from<seq2seq4repair_space>markup<seq2seq4repair_space>resource<seq2seq4repair_space>stream:<seq2seq4repair_space>" + ( markupResourceStream . toString ( ) ) ) ) ; } finally { try { markupResourceStream . close ( ) ; } catch ( IOException e ) { throw new WicketRuntimeException ( ( "Cannot<seq2seq4repair_space>close<seq2seq4repair_space>markup<seq2seq4repair_space>resource<seq2seq4repair_space>stream:<seq2seq4repair_space>" + markupResourceStream ) , e ) ; } } } private String getMarkupType ( Component component ) { } }

Fix:
final String variation = owner . getVariation ( ) ;
Buggy code:
public class PriceDAO extends AbstractDAO { Logger logger = Logger . getLogger ( PriceDAO . class ) ; public boolean updateStockPrice ( Map < String , Double > stockPrices ) throws DAOException { boolean result = true ; <START_BUG> SimpleDateFormat sdf = new SimpleDateFormat ( "yyyy-MM-dd" ) ; <END_BUG> Timestamp ts = new Timestamp ( new Date ( ) . getTime ( ) ) ; try { if ( ( stockPrices != null ) && ( ( stockPrices . size ( ) ) > 0 ) ) { String sql = "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>TB_PRICE(symbol,price,lastupdate)<seq2seq4repair_space>VALUES(?,?,?)" ; ps = conn . prepareStatement ( sql ) ; Iterator < Map . Entry < String , Double > > stockPriceIterator = stockPrices . entrySet ( ) . iterator ( ) ; while ( stockPriceIterator . hasNext ( ) ) { Map . Entry < String , Double > stockPriceEntry = stockPriceIterator . next ( ) ; String symbol = stockPriceEntry . getKey ( ) ; Double price = stockPriceEntry . getValue ( ) ; logger . debug ( ( "symbol<seq2seq4repair_space>=<seq2seq4repair_space>" + symbol ) ) ; ps . setString ( 1 , symbol ) ; ps . setDouble ( 2 , price ) ; ps . setString ( 3 , sdf . format ( ts ) ) ; ps . addBatch ( ) ; } int [ ] rows = ps . executeBatch ( ) ; for ( int row : rows ) { if ( row <= 0 ) { result = false ; } } } } catch ( SQLException sqle ) { logger . error ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>update<seq2seq4repair_space>stock<seq2seq4repair_space>price" + "<seq2seq4repair_space>in<seq2seq4repair_space>updateStockPrice<seq2seq4repair_space>method<seq2seq4repair_space>in<seq2seq4repair_space>PriceDAO." ) , sqle ) ; throw new DAOException ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>update<seq2seq4repair_space>stock<seq2seq4repair_space>price.<seq2seq4repair_space>" , sqle ) ; } finally { cleanUp ( ) ; } return result ; } }

Fix:
SimpleDateFormat sdf = new SimpleDateFormat ( "yyyy-MM-dd<seq2seq4repair_space>HH:mm:ss" ) ;
Buggy code:
public class CoverageTestCase extends TestCase { public void testCoverage ( ) { File file1 = new File ( "testdata//coverage//foo//ClassA.java" ) ; <START_BUG> File aspect1 = new File ( "testdata//coverage//foo//UseThisAspectForLinkCheck.java" ) ; <END_BUG> File file2 = new File ( "testdata//coverage//foo//InterfaceI.java" ) ; File file3 = new File ( "testdata//coverage//foo//PlainJava.java" ) ; File file4 = new File ( "testdata//coverage//foo//ModelCoverage.java" ) ; File file5 = new File ( "testdata//coverage//fluffy//Fluffy.java" ) ; File file6 = new File ( "testdata//coverage//fluffy//bunny//Bunny.java" ) ; File file7 = new File ( "testdata//coverage//fluffy//bunny//rocks//Rocks.java" ) ; File file8 = new File ( "testdata//coverage//fluffy//bunny//rocks//UseThisAspectForLinkCheckToo.java" ) ; File outdir = new File ( "testdata//coverage//doc" ) ; String [ ] args = new String [ ] { "-source" , "1.4" , "-private" , "-d" , outdir . getAbsolutePath ( ) , aspect1 . getAbsolutePath ( ) , file1 . getAbsolutePath ( ) , file2 . getAbsolutePath ( ) , file3 . getAbsolutePath ( ) , file4 . getAbsolutePath ( ) , file5 . getAbsolutePath ( ) , file6 . getAbsolutePath ( ) , file7 . getAbsolutePath ( ) , file8 . getAbsolutePath ( ) } ; org . aspectj . tools . ajdoc . Main . main ( args ) ; } protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } }

Fix:
File aspect1 = new File ( "testdata//coverage//foo//UseThisAspectForLinkCheck.aj" ) ;
Buggy code:
public class ForCycle extends FunBlock { public ForCycle ( Block [ ] body , String line ) { } @ Override public void paint ( Coords Coord , Graphics2D g2d , boolean nextlinedraw ) { Coord . incinvestedCol ( ) ; int lenh = 25 ; int lenv = 0 ; int lenhn = 50 ; int lenvn = 25 ; g2d . drawLine ( ( ( Coord . getX ( ) ) - lenh ) , ( ( Coord . getY ( ) ) - lenvn ) , ( ( Coord . getX ( ) ) + lenh ) , ( ( Coord . getY ( ) ) - lenvn ) ) ; g2d . drawLine ( ( ( Coord . getX ( ) ) - lenhn ) , ( ( Coord . getY ( ) ) - lenv ) , ( ( Coord . getX ( ) ) - lenh ) , ( ( Coord . getY ( ) ) - lenvn ) ) ; g2d . drawLine ( ( ( Coord . getX ( ) ) + lenh ) , ( ( Coord . getY ( ) ) - lenvn ) , ( ( Coord . getX ( ) ) + lenhn ) , ( ( Coord . getY ( ) ) - lenv ) ) ; g2d . drawLine ( ( ( Coord . getX ( ) ) - lenhn ) , ( ( Coord . getY ( ) ) + lenv ) , ( ( Coord . getX ( ) ) - lenh ) , ( ( Coord . getY ( ) ) + lenvn ) ) ; g2d . drawLine ( ( ( Coord . getX ( ) ) + lenh ) , ( ( Coord . getY ( ) ) + lenvn ) , ( ( Coord . getX ( ) ) + lenhn ) , ( ( Coord . getY ( ) ) + lenv ) ) ; g2d . drawLine ( ( ( Coord . getX ( ) ) - lenh ) , ( ( Coord . getY ( ) ) + lenvn ) , ( ( Coord . getX ( ) ) + lenh ) , ( ( Coord . getY ( ) ) + lenvn ) ) ; <START_BUG> drawCenteredString ( g2d , line , Coord . getX ( ) , Coord . getY ( ) ) ; <END_BUG> nextArrow ( Coord , g2d ) ; Coords retCoord = new Coords ( Coord . getX ( ) , Coord . getY ( ) ) ; retCoord . setextremeLX ( ( ( retCoord . getX ( ) ) - 50 ) ) ; retCoord . setextremeRX ( ( ( retCoord . getX ( ) ) + 50 ) ) ; Coord . setY ( ( ( ( Coord . getY ( ) ) + 50 ) + 20 ) ) ; Coord . setextremeDY ( ( ( ( Coord . getextremeDY ( ) ) + 50 ) + 20 ) ) ; drawbody ( Coord , g2d ) ; returning ( Coord , retCoord , g2d ) ; Coord . decinvestedCol ( ) ; if ( ( Coord . getinvestedCol ( ) ) == 0 ) { Coord . setextremeRX ( ( ( Coord . getX ( ) ) + 50 ) ) ; Coord . setextremeLX ( ( ( Coord . getX ( ) ) - 50 ) ) ; } } private void returning ( Coords Coord , Coords retCoord , Graphics2D g2d ) { } @ Override public int getwidth ( ) { } No newline ; at end ; of file ; }

Fix:
drawCenteredLines ( g2d , line , Coord . getX ( ) , Coord . getY ( ) ) ;
Buggy code:
public class FleetView extends View { private Paint redPaint ; private Paint blackPaint ; private float textX ; private float textY = 20 ; private int screenW ; private int screenH ; private float radius ; private Context myContext ; private static SoundPool sounds ; private int dropSound ; private MediaPlayer mp ; private final String [ ] list = null ; private ArrayList < Fleet > fleets ; private ArrayList < Bitmap > kings ; private Integer fleetnum = 0 ; private Bitmap leftArrow = BitmapFactory . decodeResource ( getResources ( ) , left_arrow ) ; private int leftArrowX ; private int leftArrowY ; private Bitmap rightArrow = BitmapFactory . decodeResource ( getResources ( ) , right_arrow ) ; private int rightArrowX ; private int rightArrowY ; private Bitmap selectFleet ; private Bitmap fleetKing ; private int fleetKingX ; private int fleetKingY ; private int selectFleetX ; private int selectFleetY ; private Options options = new BitmapFactory . Options ( ) ; private Bitmap selectFleetDown ; private boolean selectFleetPressed = false ; public FleetView ( Context context , ArrayList < Fleet > fleets ) { } @ Override protected void onSizeChanged ( int w , int h , int oldw , int oldh ) { } @ Override public void onWindowFocusChanged ( boolean hasWindowFocus ) { } @ TargetApi ( VERSION_CODES . KITKAT ) protected void onDraw ( Canvas canvas ) { } public boolean onTouchEvent ( MotionEvent event ) { int action = event . getAction ( ) ; int x = ( ( int ) ( event . getX ( ) ) ) ; int y = ( ( int ) ( event . getY ( ) ) ) ; switch ( action ) { case MotionEvent . ACTION_DOWN : if ( ( ( ( x > ( rightArrowX ) ) && ( x < ( ( rightArrowX ) + ( rightArrow . getWidth ( ) ) ) ) ) && ( y > ( rightArrowY ) ) ) && ( y < ( ( rightArrowY ) + ( rightArrow . getHeight ( ) ) ) ) ) { if ( ( ( fleetnum ) + 1 ) < ( fleets . size ( ) ) ) { ( fleetnum ) ++ ; } else { fleetnum = 0 ; } break ; } if ( ( ( ( x > ( leftArrowX ) ) && ( x < ( ( leftArrowX ) + ( leftArrow . getWidth ( ) ) ) ) ) && ( y > ( leftArrowY ) ) ) && ( y < ( ( leftArrowY ) + ( leftArrow . getHeight ( ) ) ) ) ) { <START_BUG> if ( ( ( fleetnum ) - 1 ) > 0 ) { <END_BUG> ( fleetnum ) -- ; } else { fleetnum = ( fleets . size ( ) ) - 1 ; } break ; } if ( ( ( ( x > ( selectFleetX ) ) && ( x < ( ( selectFleetX ) + ( selectFleet . getWidth ( ) ) ) ) ) && ( y > ( selectFleetY ) ) ) && ( y < ( ( selectFleetY ) + ( selectFleet . getHeight ( ) ) ) ) ) { selectFleetPressed = true ; } break ; case MotionEvent . ACTION_MOVE : break ; case MotionEvent . ACTION_UP : selectFleetPressed = false ; break ; } invalidate ( ) ; return true ; } }

Fix:
if ( ( ( fleetnum ) - 1 ) >= 0 ) {
Buggy code:
public class TalendDefaultJavaEditor extends CompilationUnitEditor { protected String fileType = TalendDefaultJavaEditor . FILE_TYPE_OTHERS ; protected static final String FILE_TYPE_TALEND_GENERATED_READONLY = "READONLY_GENERATED_BY_TALEND" ; protected static final String FILE_TYPE_TALEND_GENERATED_WRITEABLE = "WRITEABLE_GENERATED_BY_TALEND" ; protected static final String FILE_TYPE_OTHERS = "OTHERS_NOT_BY_TALEND" ; @ Override protected void doSetInput ( IEditorInput input ) throws CoreException { if ( input instanceof FileEditorInput ) { try { IRunProcessService runProcessService = ( ( IRunProcessService ) ( GlobalServiceRegister . getDefault ( ) . getService ( IRunProcessService . class ) ) ) ; ITalendProcessJavaProject talendJavaProject = runProcessService . getTalendProcessJavaProject ( ) ; final String pathSeperator = "//" ; String routinesFolderName = ROUTINES . getFolder ( ) . split ( pathSeperator ) [ 1 ] ; String talendSrcFolderPath = ( talendJavaProject . getSrcFolder ( ) . getLocation ( ) . toString ( ) ) + pathSeperator ; String routineFolderPath = ( talendSrcFolderPath + routinesFolderName ) + pathSeperator ; IFile openedFile = ( ( FileEditorInput ) ( input ) ) . getFile ( ) ; String openedFilePath = openedFile . getLocation ( ) . toString ( ) ; boolean isRoutine = openedFilePath . startsWith ( routineFolderPath ) ; boolean isTalendGeneratedFile = openedFilePath . startsWith ( talendSrcFolderPath ) ; String systemRoutineFolderName = "system" ; <START_BUG> String systemRoutineFolderPath = ( ( routineFolderPath + pathSeperator ) + systemRoutineFolderName ) + pathSeperator ; <END_BUG> boolean isSystemRoutine = openedFilePath . startsWith ( systemRoutineFolderPath ) ; if ( isSystemRoutine ) { fileType = TalendDefaultJavaEditor . FILE_TYPE_TALEND_GENERATED_READONLY ; } else if ( isRoutine ) { fileType = TalendDefaultJavaEditor . FILE_TYPE_TALEND_GENERATED_READONLY ; } else if ( isTalendGeneratedFile ) { fileType = TalendDefaultJavaEditor . FILE_TYPE_TALEND_GENERATED_READONLY ; } else { fileType = TalendDefaultJavaEditor . FILE_TYPE_OTHERS ; } } catch ( Throwable e ) { CommonExceptionHandler . process ( e , Priority . WARN ) ; fileType = TalendDefaultJavaEditor . FILE_TYPE_OTHERS ; } } super . doSetInput ( input ) ; } @ Override public boolean isEditable ( ) { } }

Fix:
String systemRoutineFolderPath = ( routineFolderPath + systemRoutineFolderName ) + pathSeperator ;
Buggy code:
public class SpellCheckCollator { private static final Logger LOG = LoggerFactory . getLogger ( SpellCheckCollator . class ) ; private int maxCollations = 1 ; private int maxCollationTries = 0 ; private int maxCollationEvaluations = 10000 ; private boolean suggestionsMayOverlap = false ; private int docCollectionLimit = 0 ; public List < SpellCheckCollation > collate ( SpellingResult result , String originalQuery , ResponseBuilder ultimateResponse ) { } private String getCollation ( String origQuery , List < SpellCheckCorrection > corrections ) { StringBuilder collation = new StringBuilder ( origQuery ) ; int offset = 0 ; String corr = "" ; for ( int i = 0 ; i < ( corrections . size ( ) ) ; i ++ ) { SpellCheckCorrection correction = corrections . get ( i ) ; Token tok = correction . getOriginal ( ) ; if ( ( tok . getPositionIncrement ( ) ) == 0 ) continue ; corr = correction . getCorrection ( ) ; boolean addParenthesis = false ; Character requiredOrProhibited = null ; int indexOfSpace = corr . indexOf ( '<seq2seq4repair_space>' ) ; StringBuilder corrSb = new StringBuilder ( corr ) ; int bump = 1 ; while ( ( indexOfSpace > ( - 1 ) ) && ( indexOfSpace < ( ( corr . length ( ) ) - 1 ) ) ) { addParenthesis = true ; <START_BUG> char previousChar = ( ( tok . startOffset ( ) ) > 0 ) ? collation . charAt ( ( ( tok . startOffset ( ) ) - 1 ) ) : '<seq2seq4repair_space>' ; <END_BUG> if ( ( previousChar == '-' ) || ( previousChar == '+' ) ) { corrSb . insert ( ( indexOfSpace + bump ) , previousChar ) ; if ( requiredOrProhibited == null ) { requiredOrProhibited = previousChar ; } bump ++ ; } else if ( ( ( tok . getFlags ( ) ) & ( QueryConverter . TERM_IN_BOOLEAN_QUERY_FLAG ) ) == ( QueryConverter . TERM_IN_BOOLEAN_QUERY_FLAG ) ) { corrSb . insert ( ( indexOfSpace + bump ) , "AND<seq2seq4repair_space>" ) ; bump += 4 ; } indexOfSpace = correction . getCorrection ( ) . indexOf ( '<seq2seq4repair_space>' , ( indexOfSpace + bump ) ) ; } int oneForReqOrProhib = 0 ; if ( addParenthesis ) { if ( requiredOrProhibited != null ) { corrSb . insert ( 0 , requiredOrProhibited ) ; oneForReqOrProhib ++ ; } corrSb . insert ( 0 , '(' ) ; corrSb . append ( ')' ) ; } corr = corrSb . toString ( ) ; int startIndex = ( ( tok . startOffset ( ) ) + offset ) - oneForReqOrProhib ; int endIndex = ( tok . endOffset ( ) ) + offset ; collation . replace ( startIndex , endIndex , corr ) ; offset += ( ( corr . length ( ) ) - oneForReqOrProhib ) - ( ( tok . endOffset ( ) ) - ( tok . startOffset ( ) ) ) ; } return collation . toString ( ) ; } public SpellCheckCollator setMaxCollations ( int maxCollations ) { } public SpellCheckCollator setMaxCollationTries ( int maxCollationTries ) { } public SpellCheckCollator setMaxCollationEvaluations ( int maxCollationEvaluations ) { } public SpellCheckCollator setSuggestionsMayOverlap ( boolean suggestionsMayOverlap ) { } public SpellCheckCollator setDocCollectionLimit ( int docCollectionLimit ) { } }

Fix:
char previousChar = ( ( tok . startOffset ( ) ) > 0 ) ? origQuery . charAt ( ( ( tok . startOffset ( ) ) - 1 ) ) : '<seq2seq4repair_space>' ;
Buggy code:
public class UserService { JsonDB jsonDB ; public UserService ( ) { } <START_BUG> public boolean saveOrUpdate ( User user ) { <END_BUG> return jsonDB . saveOrUpdate ( user , User . class ) ; } public User get ( int id ) { } }

Fix:
public int saveOrUpdate ( User user ) {
Buggy code:
class ProgressBarTab extends RangeTab { ProgressBar progressBar1 ; Group progressBarGroup ; Button smoothButton ; Button indeterminateButton ; ProgressBarTab ( ControlExample instance ) { } void createExampleGroup ( ) { super . createExampleGroup ( ) ; progressBarGroup = new Group ( exampleGroup , SWT . NONE ) ; progressBarGroup . setLayout ( new GridLayout ( ) ) ; <START_BUG> progressBarGroup . setLayoutData ( new GridData ( ( ( ( GridData . GRAB_HORIZONTAL ) | ( GridData . HORIZONTAL_ALIGN_FILL ) ) | ( GridData . VERTICAL_ALIGN_FILL ) ) ) ) ; <END_BUG> progressBarGroup . setText ( "ProgressBar" ) ; } void createExampleWidgets ( ) { } void createStyleGroup ( ) { } Control [ ] getExampleWidgets ( ) { } String [ ] getMethodNames ( ) { } String getTabText ( ) { } void setExampleWidgetState ( ) { } void setWidgetMaximum ( ) { } void setWidgetMinimum ( ) { } void setWidgetSelection ( ) { } void updateScales ( ) { } }

Fix:
progressBarGroup . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true ) ) ;
Buggy code:
public class OneNote extends Activity { private static final String TAG = "notepad" ; private TextView noteTitle ; private TextView createdAt ; private TextView noteContent ; private DBHelper dbhelper ; private SQLiteDatabase db ; private String title = "defaultTitle" ; private int id = 0 ; private String content = "defaultContent" ; private String date = "date" ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void setPadding ( ) { } @ Override protected void onResume ( ) { } @ Override protected void onPause ( ) { super . onPause ( ) ; <START_BUG> SimpleNotepadActivity . requestToShowArrow ( ) ; <END_BUG> } }

Fix:
SimpleNotepadActivity . requestToShowArrow ( this ) ;
Buggy code:
public class CSVPrinterTest { public static String printable ( final String s ) { } String recordSeparator = DEFAULT . getRecordSeparator ( ) ; public void doOneRandom ( final CSVFormat format ) throws Exception { final Random r = new Random ( ) ; final int nLines = ( r . nextInt ( 4 ) ) + 1 ; final int nCol = ( r . nextInt ( 3 ) ) + 1 ; final String [ ] [ ] lines = new String [ nLines ] [ ] ; for ( int i = 0 ; i < nLines ; i ++ ) { final String [ ] line = new String [ nCol ] ; lines [ i ] = line ; for ( int j = 0 ; j < nCol ; j ++ ) { line [ j ] = randStr ( ) ; } } final StringWriter sw = new StringWriter ( ) ; final CSVPrinter printer = new CSVPrinter ( sw , format ) ; for ( int i = 0 ; i < nLines ; i ++ ) { <START_BUG> printer . printRecord ( lines [ i ] ) ; <END_BUG> } printer . flush ( ) ; printer . close ( ) ; final String result = sw . toString ( ) ; final CSVParser parser = new CSVParser ( result , format ) ; final List < CSVRecord > parseResult = parser . getRecords ( ) ; Utils . compare ( ( "Printer<seq2seq4repair_space>output<seq2seq4repair_space>:" + ( CSVPrinterTest . printable ( result ) ) ) , lines , parseResult ) ; } public void doRandom ( final CSVFormat format , final int iter ) throws Exception { } public String randStr ( ) { } @ Test public void testDisabledComment ( ) throws IOException { } @ Test public void testExcelPrintAllArrayOfArrays ( ) throws IOException { } @ Test public void testExcelPrintAllArrayOfLists ( ) throws IOException { } @ Test public void testExcelPrintAllIterableOfArrays ( ) throws IOException { } @ Test public void testExcelPrintAllIterableOfLists ( ) throws IOException { } @ Test public void testExcelPrinter1 ( ) throws IOException { } @ Test public void testExcelPrinter2 ( ) throws IOException { } @ Test public void testJdbcPrinter ( ) throws IOException , ClassNotFoundException , SQLException { } @ Test public void testMultiLineComment ( ) throws IOException { } @ Test public void testPrinter1 ( ) throws IOException { } @ Test public void testPrinter2 ( ) throws IOException { } @ Test public void testPrinter3 ( ) throws IOException { } @ Test public void testPrinter4 ( ) throws IOException { } @ Test public void testPrinter5 ( ) throws IOException { } @ Test public void testPrinter6 ( ) throws IOException { } @ Test public void testPrinter7 ( ) throws IOException { } @ Test public void testPrintNullValues ( ) throws IOException { } @ Test public void testQuoteAll ( ) throws IOException { } @ Test public void testQuoteNonNumeric ( ) throws IOException { } @ Test public void testRandom ( ) throws Exception { } @ Test public void testSingleLineComment ( ) throws IOException { } }

Fix:
printer . printRecord ( ( ( Object [ ] ) ( lines [ i ] ) ) ) ;
Buggy code:
public class AuditTestHelper { public static AuditTask createTestAuditTask ( ) { AuditTask task = new AuditTask ( ) ; task . setAccount ( "account" ) ; task . setStoreId ( "1" ) ; task . setStoreType ( "type" ) ; task . setSpaceId ( "spaceId" ) ; task . setContentId ( "contentId" ) ; task . setAction ( DELETE_CONTENT . name ( ) ) ; task . setContentSize ( "1000" ) ; <START_BUG> task . setDateTime ( DateUtil . convertToString ( System . currentTimeMillis ( ) ) ) ; <END_BUG> task . setContentChecksum ( "12341243214234" ) ; task . setUserId ( "user" ) ; task . setContentMimetype ( "application//text" ) ; Map < String , String > map = new HashMap < > ( ) ; map . put ( "key" , "value" ) ; task . setContentProperties ( map ) ; task . setSpaceACLs ( "acls" ) ; return task ; } }

Fix:
task . setDateTime ( ( ( System . currentTimeMillis ( ) ) + "" ) ) ;
Buggy code:
public class InitialConditions { private static double phi ; public static Simulation initRandomParticles ( int count , double radius ) { Settings stt = new Settings ( ) ; <START_BUG> stt . setTimeStep ( 1 ) ; <END_BUG> stt . setSpeedOfLight ( ( ( stt . getCellWidth ( ) ) // ( stt . getTimeStep ( ) ) ) ) ; stt . setSimulationWidth ( 100 ) ; stt . setSimulationHeight ( 100 ) ; stt . addForce ( new ConstantForce ( ) ) ; stt . setParticleList ( InitialConditions . createRandomParticles ( stt . getSimulationWidth ( ) , stt . getSimulationHeight ( ) , ( ( stt . getSpeedOfLight ( ) ) // 3 ) , count , radius ) ) ; stt . setBoundary ( Hardwall ) ; stt . setParticleSolver ( new org . openpixi . pixi . physics . solver . relativistic . LeapFrogRelativistic ( stt . getSpeedOfLight ( ) ) ) ; Simulation simulation = new Simulation ( stt ) ; return simulation ; } public static Simulation initGravity ( int count , double radius ) { } public static Simulation initElectric ( int count , double radius ) { } public static Simulation initMagnetic ( int count , double radius ) { } public static Simulation initSpring ( int count , double radius ) { } public static ArrayList < Particle > createRandomParticles ( double width , double height , double maxspeed , int count , double radius ) { } public static Simulation initPair ( double charge , double radius ) { } public static Simulation initTwoStream ( double charge , double radius , int numpart ) { } public static Simulation initOneTest ( double charge , double radius ) { } public static Simulation initWeibel ( double charge , double radius , int numpart , int numstripes , double speed ) { } public static Simulation initWaveTest ( double kx ) { } }

Fix:
stt . setTimeStep ( 0.1 ) ;
Buggy code:
public class Test_org_eclipse_swt_graphics_ImageLoader extends SwtTestCase { public Test_org_eclipse_swt_graphics_ImageLoader ( String name ) { } public static void main ( String [ ] args ) { } protected void setUp ( ) { } protected void tearDown ( ) { } public void test_Constructor ( ) { } public void test_addImageLoaderListenerLorg_eclipse_swt_graphics_ImageLoaderListener ( ) { } public void test_hasListeners ( ) { } public void test_loadLjava_io_InputStream ( ) { } public void test_loadLjava_lang_String ( ) { } public void test_notifyListenersLorg_eclipse_swt_graphics_ImageLoaderEvent ( ) { } public void test_removeImageLoaderListenerLorg_eclipse_swt_graphics_ImageLoaderListener ( ) { } public void test_saveLjava_io_OutputStreamI ( ) { ImageLoader loader = new ImageLoader ( ) ; ByteArrayOutputStream outStream = null ; InputStream inStream = null ; try { try { loader . save ( outStream , 0 ) ; fail ( "No<seq2seq4repair_space>exception<seq2seq4repair_space>thrown<seq2seq4repair_space>for<seq2seq4repair_space>save<seq2seq4repair_space>outputStream<seq2seq4repair_space>==<seq2seq4repair_space>null" ) ; } catch ( IllegalArgumentException e ) { } outStream = new ByteArrayOutputStream ( ) ; try { loader . save ( outStream , ( - 1 ) ) ; fail ( "No<seq2seq4repair_space>exception<seq2seq4repair_space>thrown<seq2seq4repair_space>for<seq2seq4repair_space>save<seq2seq4repair_space>to<seq2seq4repair_space>invalid<seq2seq4repair_space>outputStream<seq2seq4repair_space>format" ) ; <START_BUG> } catch ( IllegalArgumentException e ) { <END_BUG> } boolean jpgSupported = false ; for ( int i = 0 ; i < ( imageFormats . length ) ; i ++ ) { if ( imageFormats [ i ] . equals ( "jpg" ) ) { jpgSupported = true ; break ; } } if ( jpgSupported ) { String filename = SwtTestCase . imageFilenames [ 0 ] ; String filetype = "jpg" ; inStream = SwtTestCase . class . getResourceAsStream ( ( ( filename + "." ) + filetype ) ) ; loader . load ( inStream ) ; try { inStream . close ( ) ; } catch ( IOException e ) { } for ( int i = 0 ; i < ( imageFormats . length ) ; i ++ ) { if ( imageFormats [ i ] . equals ( filetype ) ) { loader . save ( outStream , i ) ; break ; } } } } finally { try { outStream . close ( ) ; } catch ( Exception e ) { } } } public void test_saveLjava_lang_StringI ( ) { } public static Test suite ( ) { } public static Vector methodNames ( ) { } protected void runTest ( ) throws Throwable { } boolean loaderListenerCalled ; }

Fix:
} catch ( SWTException e ) {
Buggy code:
public class TimelineFragment extends BaseFragment { @ Inject EventBus eventBus ; @ Inject MiddlewareServiceImpl middlewareService ; private TimelineType type ; private Long id ; private int requestCount = 10 ; private int totalCount = 0 ; private Boolean isStopped = false ; private List < TimelineDto > timelineDtoList ; private TimelineListAdapter timelineListAdapter ; private View header ; private Boolean headerAdded = false ; private Boolean footerAdded = false ; private Boolean dataDownloadStarted = false ; private Button showMore ; private RelativeLayout tlRelativeLayout ; private ListView tlList ; public TimelineFragment ( ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public void onDestroy ( ) { } @ Override public void onPause ( ) { } @ Override public void onResume ( ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } public void setTypeAndId ( TimelineType type , Long id ) { this . type = type ; this . id = id ; <START_BUG> if ( ( getActivity ( ) ) != null ) { <END_BUG> middlewareService . loadTimeline ( getActivity ( ) , type , id , totalCount , requestCount ) ; dataDownloadStarted = true ; } } public void onEventMainThread ( GetTimelineEvent event ) { } public void setHeader ( View view ) { } public void setFooter ( View view ) { } public void removeHeader ( View view ) { } }

Fix:
if ( ( ( getActivity ( ) ) != null ) && ( ! ( dataDownloadStarted ) ) ) {
Buggy code:
public class EventLoopProgressMonitor extends ProgressMonitorWrapper implements IProgressMonitorWithBlocking { private static int T_THRESH = 100 ; private static int T_MAX = 50 ; private BlockedJobsDialog dialog ; private long lastTime = System . currentTimeMillis ( ) ; public EventLoopProgressMonitor ( IProgressMonitor monitor ) { } public void beginTask ( String name , int totalWork ) { } public void clearBlocked ( ) { } public void done ( ) { } public void internalWorked ( double work ) { } public boolean isCanceled ( ) { } private void runEventLoop ( ) { } public void setBlocked ( IStatus reason ) { <START_BUG> dialog = new BlockedJobsDialog ( null , this ) ; <END_BUG> dialog . setBlockOnOpen ( false ) ; WorkbenchJob dialogJob = new WorkbenchJob ( WorkbenchMessages . getString ( "EventLoopProgressMonitor.OpenDialogJobName" ) ) { public IStatus runInUIThread ( IProgressMonitor monitor ) { if ( ( dialog ) == null ) return Status . CANCEL_STATUS ; dialog . open ( ) ; return Status . OK_STATUS ; } } ; dialogJob . setSystem ( true ) ; dialogJob . schedule ( 3000 ) ; } public void setCanceled ( boolean b ) { } public void setTaskName ( String name ) { } public void subTask ( String name ) { } public void worked ( int work ) { } }

Fix:
dialog = new BlockedJobsDialog ( null , this , reason ) ;
Buggy code:
public class ArgumentWriter { DataOutputStream output ; IMAPProtocol protocol ; public ArgumentWriter ( IMAPProtocol protocol ) { } public void write ( Arguments args ) throws Exception { } protected void writeString ( byte [ ] data ) throws Exception { } protected void writeBytes ( byte [ ] data ) throws Exception { output . write ( '{' ) ; output . writeBytes ( Integer . toString ( data . length ) ) ; output . writeBytes ( "}\r\n" ) ; output . flush ( ) ; for ( ; ; ) { <START_BUG> IMAPResponse r = protocol . getResponse ( ) ; <END_BUG> if ( r . isCONTINUATION ( ) ) break ; } output . write ( data ) ; } }

Fix:
IMAPResponse r = protocol . getResponse ( null ) ;
Buggy code:
public class ModuleDeploymentTestCaseSetup extends JcaMgmtServerSetupTask { protected File testModuleRoot ; protected File slot ; public static ModelNode address ; protected final String defaultPath = "org//jboss//ironjacamar//ra16out" ; public void addModule ( final String moduleName ) throws Exception { } public void addModule ( final String moduleName , String moduleXml ) throws Exception { } public void removeModule ( final String moduleName ) throws Exception { } private void deleteRecursively ( File file ) { } private void createTestModule ( String moduleXml ) throws IOException { } protected void copyFile ( File target , InputStream src ) throws IOException { } private File getModulePath ( ) { String modulePath = System . getProperty ( "module.path" , null ) ; if ( modulePath == null ) { String jbossHome = System . getProperty ( "jboss.home" , null ) ; if ( jbossHome == null ) { throw new IllegalStateException ( "Neither<seq2seq4repair_space>-Dmodule.path<seq2seq4repair_space>nor<seq2seq4repair_space>-Djboss.home<seq2seq4repair_space>were<seq2seq4repair_space>set" ) ; } modulePath = ( jbossHome + ( File . separatorChar ) ) + "modules" ; } else { <START_BUG> modulePath = modulePath . split ( File . pathSeparator ) [ 0 ] ; <END_BUG> } File moduleDir = new File ( modulePath ) ; if ( ! ( moduleDir . exists ( ) ) ) { throw new IllegalStateException ( "Determined<seq2seq4repair_space>module<seq2seq4repair_space>path<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist" ) ; } if ( ! ( moduleDir . isDirectory ( ) ) ) { throw new IllegalStateException ( "Determined<seq2seq4repair_space>module<seq2seq4repair_space>path<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>dir" ) ; } return moduleDir ; } @ Override public void tearDown ( ManagementClient managementClient , String containerId ) throws Exception { } @ Override protected void doSetup ( ManagementClient managementClient ) throws Exception { } protected void setConfiguration ( String fileName ) throws Exception { } protected void fillModuleWithFlatClasses ( String raFile ) throws Exception { } protected void fillModuleWithJar ( String raFile ) throws Exception { } public static ModelNode getAddress ( ) { } }

Fix:
modulePath = modulePath . split ( File . pathSeparator ) [ 1 ] ;
Buggy code:
public class PagedTableTest extends WicketTestCase { public void testPagedTable ( ) throws Exception { tester . startPage ( PagedTablePage . class ) ; PagedTablePage page = ( ( PagedTablePage ) ( tester . getLastRenderedPage ( ) ) ) ; String document = tester . getLastResponseAsString ( ) ; <START_BUG> assertTrue ( validatePage1 ( document ) ) ; <END_BUG> Link < ? > link = ( ( Link < ? > ) ( page . get ( "navigation:1:pageLink" ) ) ) ; tester . clickLink ( link . getPageRelativePath ( ) ) ; document = tester . getLastResponseAsString ( ) ; DiffUtil . validatePage ( document , this . getClass ( ) , "PagedTablePageExpectedResult.html" , true ) ; } private boolean validatePage1 ( String document ) { } }

Fix:
assertTrue ( document , validatePage1 ( document ) ) ;
Buggy code:
public class JdkORBExtension implements Extension { private static final JdkORBSubsystemParser PARSER = JdkORBSubsystemParser . INSTANCE ; public static final String SUBSYSTEM_NAME = "jdkorb" ; private static final String RESOURCE_NAME = ( JdkORBExtension . class . getPackage ( ) . getName ( ) ) + ".LocalDescriptions" ; private static final int MANAGEMENT_API_MAJOR_VERSION = 1 ; private static final int MANAGEMENT_API_MINOR_VERSION = 0 ; private static final int MANAGEMENT_API_MICRO_VERSION = 0 ; static ResourceDescriptionResolver getResourceDescriptionResolver ( final String ... keyPrefix ) { StringBuilder prefix = new StringBuilder ( JdkORBExtension . SUBSYSTEM_NAME ) ; for ( String kp : keyPrefix ) { <START_BUG> prefix . append ( kp ) ; <END_BUG> } return new StandardResourceDescriptionResolver ( prefix . toString ( ) , JdkORBExtension . RESOURCE_NAME , JdkORBExtension . class . getClassLoader ( ) , true , false ) ; } @ Override public void initialize ( ExtensionContext context ) { } @ Override public void initializeParsers ( ExtensionParsingContext context ) { } }

Fix:
prefix . append ( "." ) . append ( kp ) ;
Buggy code:
public class EconXPCommands implements CommandExecutor { private boolean meanAdmins ; private Server server ; private EconXP plugin ; public EconXPCommands ( EconXP aPlugin ) { } public boolean onCommand ( CommandSender sender , Command command , String label , String [ ] args ) { } private Node getBaseCommand ( String base ) { } private OfflinePlayer validatePlayer ( CommandSender sender , String player ) { if ( player . isEmpty ( ) ) { EconXP . sendMsg ( sender , PLAYER_NOT_GIVEN . get ( ) ) ; return null ; } Player target = plugin . getOnlinePlayer ( player ) ; if ( target != null ) { return target ; } OfflinePlayer offTarget = plugin . getOfflinePlayer ( player ) ; <START_BUG> if ( offTarget != null ) { <END_BUG> return offTarget ; } EconXP . sendMsg ( sender , PLAYER_NOT_EXISTS . get ( player ) ) ; return null ; } private int validateAmount ( CommandSender sender , String value ) { } private float validateFloatAmount ( CommandSender sender , String value ) { } private boolean contains ( String str , String command ) { } }

Fix:
if ( ( offTarget != null ) && ( offTarget . hasPlayedBefore ( ) ) ) {
Buggy code:
public final class Main { public static void usage ( ) { <START_BUG> CommandLineArgument . printUsage ( System . out ) ; <END_BUG> } private Main ( ) { } public static void main ( String [ ] args ) { } private static void abort ( Throwable t ) { } public static Main . ParsedOptions determineEnvironment ( String [ ] args , Properties systemProperties , Map < String , String > systemEnvironment , ServerEnvironment . LaunchType launchType ) { } private static String parseValue ( final String arg , final String key ) { } private static boolean processProperties ( final String arg , final String urlSpec ) { } private static URL makeURL ( String urlspec ) throws MalformedURLException { } private static final class ParsedOptions { ServerEnvironment environment ; List < String > clientArguments ; String hostUrl = "remote:////localhost:4447" ; String propertiesFile ; } }

Fix:
CommandLineArgumentUsageImpl . printUsage ( System . out ) ;
Buggy code:
public class Contractor { public String ID ; public String name ; public int inprogressWorks ; public int completedWorks ; public int totalWorks ; public String linkToPersonalWebpage ; public String address ; public String emailID ; public String phoneNumber ; public int totalContractAmount ; public static List < Contractor > contractors ; public Contractor ( String newID , String newName ) { } public Contractor ( ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { <START_BUG> return ID . hashCode ( ) ; <END_BUG> } public static void createContractors ( ) { } public static String getTop50ContractorsNames ( ) { } public static String getTop50ContractorsAmount ( ) { } public static String getTop50ContractorsTotalWorks ( ) { } public static String getTop50ContractorsInprogressWorks ( ) { } public static String getTop50ContractorsCompletedWorks ( ) { } public static Comparator < Contractor > compareContractorByAmount ; No newline ; at end ; of file ; }

Fix:
return this . ID . hashCode ( ) ;