nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class CreateElementInCUOperation extends JavaModelOperation { protected CompilationUnit cuAST ; protected static final int INSERT_LAST = 1 ; protected static final int INSERT_AFTER = 2 ; protected static final int INSERT_BEFORE = 3 ; protected int insertionPolicy = CreateElementInCUOperation . INSERT_LAST ; protected IJavaElement anchorElement = null ; protected boolean creationOccurred = true ; public CreateElementInCUOperation ( IJavaElement parentElement ) { } protected void apply ( ASTRewrite rewriter , IDocument document , Map options ) throws JavaModelException { } protected void checkCanceled ( ) { } public void createAfter ( IJavaElement sibling ) { } public void createBefore ( IJavaElement sibling ) { } protected void executeOperation ( ) throws JavaModelException { try { beginTask ( getMainTaskName ( ) , getMainAmountOfWork ( ) ) ; JavaElementDelta delta = newJavaElementDelta ( ) ; ICompilationUnit unit = getCompilationUnit ( ) ; generateNewCompilationUnitAST ( unit ) ; if ( this . creationOccurred ) { unit . save ( null , false ) ; boolean isWorkingCopy = unit . isWorkingCopy ( ) ; if ( ! isWorkingCopy ) <START_BUG> this . setAttribute ( JavaModelOperation . HAS_MODIFIED_RESOURCE_ATTR , JavaModelOperation . TRUE ) ; <END_BUG> worked ( 1 ) ; resultElements = generateResultHandles ( ) ; if ( ( ( ! isWorkingCopy ) && ( ! ( Util . isExcluded ( unit ) ) ) ) && ( unit . getParent ( ) . exists ( ) ) ) { for ( int i = 0 ; i < ( resultElements . length ) ; i ++ ) { delta . added ( resultElements [ i ] ) ; } addDelta ( delta ) ; } } } finally { done ( ) ; } } protected abstract StructuralPropertyDescriptor getChildPropertyDescriptor ( ASTNode parent ) { } protected abstract ASTNode generateElementAST ( ASTRewrite rewriter , IDocument document , ICompilationUnit cu ) throws JavaModelException { } protected void generateNewCompilationUnitAST ( ICompilationUnit cu ) throws JavaModelException { } protected abstract IJavaElement generateResultHandle ( ) { } protected IJavaElement [ ] generateResultHandles ( ) { } protected ICompilationUnit getCompilationUnit ( ) { } protected int getMainAmountOfWork ( ) { } public abstract String getMainTaskName ( ) { } protected ISchedulingRule getSchedulingRule ( ) { } protected void initializeDefaultPosition ( ) { } protected void insertASTNode ( ASTRewrite rewriter , ASTNode parent , ASTNode child ) throws JavaModelException { } protected CompilationUnit parse ( ICompilationUnit cu ) throws JavaModelException { } protected void setAlteredName ( String newName ) { } protected void setRelativePosition ( IJavaElement sibling , int policy ) throws IllegalArgumentException { } public IJavaModelStatus verify ( ) { } }

Fix:
JavaModelOperation . setAttribute ( JavaModelOperation . HAS_MODIFIED_RESOURCE_ATTR , JavaModelOperation . TRUE ) ;
Buggy code:
final class FilterProcessor implements Processor { private static final long serialVersionUID = - 1685875718300564885L ; private static final Logger logger = LoggerFactory . getLogger ( FilterProcessor . class ) ; private int processorId ; private final Instances dataset ; private InstancesHeader modelContext ; private Stream outputStream ; private FilterProcessor ( FilterProcessor . Builder builder ) { } private int waitingInstances = 0 ; private int delay = 0 ; private int batchSize = 200 ; private List < InstanceContentEvent > contentEventList = new LinkedList < InstanceContentEvent > ( ) ; @ Override public boolean process ( ContentEvent event ) { if ( event instanceof InstanceContentEvent ) { InstanceContentEvent instanceContentEvent = ( ( InstanceContentEvent ) ( event ) ) ; this . contentEventList . add ( instanceContentEvent ) ; ( this . waitingInstances ) ++ ; <START_BUG> if ( ( this . waitingInstances ) == ( this . batchSize ) ) { <END_BUG> InstancesContentEvent outputEvent = new InstancesContentEvent ( instanceContentEvent ) ; boolean isLastEvent = false ; while ( ( this . contentEventList . isEmpty ( ) ) == false ) { InstanceContentEvent ice = this . contentEventList . remove ( 0 ) ; Instance inst = ice . getInstance ( ) ; outputEvent . add ( inst ) ; if ( isLastEvent == false ) { isLastEvent = ice . isLastEvent ( ) ; } } outputEvent . setLast ( isLastEvent ) ; this . waitingInstances = 0 ; this . outputStream . put ( outputEvent ) ; if ( ( this . delay ) > 0 ) { try { Thread . sleep ( this . delay ) ; } catch ( InterruptedException ex ) { Thread . currentThread ( ) . interrupt ( ) ; } } } } return false ; } @ Override public void onCreate ( int id ) { } @ Override public Processor newProcessor ( Processor p ) { } @ Override public String toString ( ) { } void setOutputStream ( Stream outputStream ) { } private ResultContentEvent newResultContentEvent ( double [ ] prediction , InstanceContentEvent inEvent ) { } static class Builder { private final Instances dataset ; private int delay = 0 ; private int batchSize = 200 ; Builder ( Instances dataset ) { } Builder ( FilterProcessor oldProcessor ) { } public FilterProcessor . Builder delay ( int delay ) { } public FilterProcessor . Builder batchSize ( int val ) { } FilterProcessor build ( ) { } } }

Fix:
if ( ( ( this . waitingInstances ) == ( this . batchSize ) ) || ( instanceContentEvent . isLastEvent ( ) ) ) {
Buggy code:
public class Tesseract1 extends TessAPI1 implements ITesseract { private String language = "eng" ; private String datapath = ".//" ; private RenderedFormat renderedFormat = RenderedFormat . TEXT ; private int psm = - 1 ; private int ocrEngineMode = TessOcrEngineMode . OEM_DEFAULT ; private final Properties prop = new Properties ( ) ; private final List < String > configList = new ArrayList < String > ( ) ; private TessBaseAPI handle ; private static final Logger logger = Logger . getLogger ( Tesseract1 . class . getName ( ) ) ; protected TessBaseAPI getHandle ( ) { } @ Override public void setDatapath ( String datapath ) { } @ Override public void setLanguage ( String language ) { } @ Override public void setOcrEngineMode ( int ocrEngineMode ) { } @ Override public void setPageSegMode ( int mode ) { } public void setHocr ( boolean hocr ) { } @ Override public void setTessVariable ( String key , String value ) { } @ Override public void setConfigs ( List < String > configs ) { } @ Override public String doOCR ( BufferedImage bi ) throws TesseractException { } @ Override public String doOCR ( BufferedImage bi , Rectangle rect ) throws TesseractException { } @ Override public String doOCR ( List < BufferedImage > imageList , Rectangle rect ) throws TesseractException { } @ Override public String doOCR ( List < BufferedImage > imageList , String filename , Rectangle rect ) throws TesseractException { } @ Override public String doOCR ( int xsize , int ysize , ByteBuffer buf , Rectangle rect , int bpp ) throws TesseractException { } @ Override public String doOCR ( int xsize , int ysize , ByteBuffer buf , String filename , Rectangle rect , int bpp ) throws TesseractException { } protected void init ( ) { } protected void setTessVariables ( ) { } protected void setImage ( BufferedImage buf , Rectangle rect ) { <START_BUG> setImage ( buf . getWidth ( ) , buf . getHeight ( ) , ImageIOHelper . convertImageData ( buf ) , rect , buf . getSampleModel ( ) . getSampleSize ( 0 ) ) ; <END_BUG> } protected void setImage ( int xsize , int ysize , ByteBuffer buf , Rectangle rect , int bpp ) { } protected String getOCRText ( String filename , int pageNum ) { } private TessResultRenderer createRenderers ( String outputbase , List < RenderedFormat > formats ) { } protected void dispose ( ) { } }

Fix:
setImage ( buf . getWidth ( ) , buf . getHeight ( ) , ImageIOHelper . convertImageData ( buf ) , rect , buf . getColorModel ( ) . getPixelSize ( ) ) ;
Buggy code:
public abstract class AbstractSalesforceProvider extends OAuthServiceProvider { private static final long serialVersionUID = - 6252791802295055242L ; private static final String API_VERSION = "31.0" ; private static final String USER_FIELDS = "Id,Username,LastName,FirstName,Name,CompanyName,Division,Department," + ( ( ( "Title,Street,City,State,PostalCode,Country,Latitude,Longitude," + "Email,SenderEmail,SenderName,Signature,Phone,Fax,MobilePhone,Alias," ) + "CommunityNickname,IsActive,TimeZoneSidKey,LocaleSidKey,EmailEncodingKey," ) + "UserType,LanguageLocaleKey,EmployeeNumber,DelegatedApproverId,ManagerId,AboutMe" ) ; private static final String ORGANIZATION_FIELDS = "Id,Name,Division,Street,City,State,PostalCode,Country," + "PrimaryContact,DefaultLocaleSidKey,LanguageLocaleKey,FiscalYearStartMonth" ; public AbstractSalesforceProvider ( ) { } @ Override public Token requestToken ( BasicTokenRequest basicTokenRequest ) throws OAuthException { } @ Override public Token requestToken ( VerifyTokenRequest verifyTokenRequest ) throws OAuthException { } @ Override public Identity getIdentity ( IdentityRequest identityRequest ) throws OAuthException { } @ Override public void revokeToken ( RevokeTokenRequest revokeTokenRequest ) throws OAuthException { } @ Override public Token refreshToken ( RefreshTokenRequest refreshTokenRequest ) throws OAuthException { } public UserInfo getUserInfo ( Token token , Identity identity ) throws OAuthException { } public OrganizationInfo getOrganizationInfo ( Token token , Identity identity ) throws OAuthException { } public abstract String getTokenEndpoint ( ) { } public abstract String getRevokeEndpoint ( ) { } private String getUserInfoUrl ( Identity identity ) { } private String getOrganizationInfoUrl ( Identity identity ) { } private String getSObjectUrl ( Identity identity ) { } private Token requestToken ( HttpRequest request ) throws OAuthException { HttpResponse < Token > response = null ; try { response = request . post ( Token . class ) ; } catch ( HttpException e ) { <START_BUG> throw new OAuthException ( e ) ; <END_BUG> } finally { request . clear ( ) ; } return response . getEntity ( ) ; } private Identity requestIdentity ( HttpRequest request ) throws OAuthException { } private OrganizationInfo requestOrganizationInfo ( HttpRequest request ) throws OAuthException { } private UserInfo requestUserInfo ( HttpRequest request ) throws OAuthException { } No newline ; at end ; of file ; }

Fix:
throw new OAuthException ( e . getMessage ( ) ) ;
Buggy code:
public class DefaultMasterConverter extends AbstractLogEnabled implements Composable , MasterConverter { private static final Resources REZ = ResourceManager . getPackageResources ( DefaultMasterConverter . class ) ; private static final boolean DEBUG = false ; private ConverterRegistry m_registry ; private TypeFactory m_factory ; public void compose ( final ComponentManager componentManager ) throws ComponentException { } public Object convert ( final Class destination , final Object original , final Context context ) throws ConverterException { } private String getConverterName ( final Class originalClass , final Class destination ) throws ConverterException { Class clazz = destination ; final Class terminator = Object . class ; while ( terminator != clazz ) { final String name = m_registry . getConverterName ( originalClass . getName ( ) , clazz . getName ( ) ) ; if ( name != null ) { return name ; } clazz = clazz . getSuperclass ( ) ; } <START_BUG> final String message = DefaultMasterConverter . REZ . getString ( "no-converter.notice" , originalClass . getName ( ) , destination . getName ( ) ) ; <END_BUG> throw new ConverterException ( message ) ; } }

Fix:
final String message = DefaultMasterConverter . REZ . getString ( "no-converter.error" , originalClass . getName ( ) , destination . getName ( ) ) ;
Buggy code:
public class BlockShadow extends BlockContainer { private IIcon [ ] iconArray ; public BlockShadow ( ) { } @ Override public int getRenderBlockPass ( ) { } public boolean isBeaconBase ( World worldObj , int x , int y , int z , int beaconX , int beaconY , int beaconZ ) { } @ Override public boolean isOpaqueCube ( ) { } @ Override public boolean renderAsNormalBlock ( ) { } public boolean isBlockSolidOnSide ( World world , int x , int y , int z , ForgeDirection side ) { } public static boolean isNormalCube ( int par0 ) { } @ Override public TileEntity createNewTileEntity ( World world , int var2 ) { } @ Override public void registerBlockIcons ( IIconRegister par1IconRegister ) { } @ Override public AxisAlignedBB getCollisionBoundingBoxFromPool ( World world , int x , int y , int z ) { } @ Override public void setBlockBoundsBasedOnState ( IBlockAccess par1IBlockAccess , int par2 , int par3 , int par4 ) { } @ Override public boolean shouldSideBeRendered ( IBlockAccess p_149646_1_ , int p_149646_2_ , int p_149646_3_ , int p_149646_4_ , int p_149646_5_ ) { } @ Override public boolean hasComparatorInputOverride ( ) { } @ Override public int getComparatorInputOverride ( World world , int x , int y , int z , int meta ) { } @ Override @ SideOnly ( Side . CLIENT ) public IIcon getIcon ( int side , int meta ) { <START_BUG> return iconArray [ meta ] ; <END_BUG> } }

Fix:
return meta < 16 ? iconArray [ meta ] : iconArray [ 0 ] ;
Buggy code:
public class EditorProvider extends AbstractProvider { private AbstractElement [ ] cachedElements ; private Map idToElement = new HashMap ( ) ; public AbstractElement getElementForId ( String id ) { } public AbstractElement [ ] getElements ( ) { if ( ( cachedElements ) == null ) { IWorkbenchPage activePage = PlatformUI . getWorkbench ( ) . getActiveWorkbenchWindow ( ) . getActivePage ( ) ; IEditorReference [ ] editors = activePage . getEditorReferences ( ) ; cachedElements = new AbstractElement [ editors . length ] ; for ( int i = 0 ; i < ( editors . length ) ; i ++ ) { <START_BUG> EditorElement editorElement = new EditorElement ( editors [ i ] ) ; <END_BUG> cachedElements [ i ] = editorElement ; idToElement . put ( editorElement . getId ( ) , editorElement ) ; } } return cachedElements ; } public String getId ( ) { } public ImageDescriptor getImageDescriptor ( ) { } public String getName ( ) { } }

Fix:
EditorElement editorElement = new EditorElement ( editors [ i ] , this ) ;
Buggy code:
public class ThreadsExecutor extends AbstractExecutor { public ThreadsExecutor ( ) { } protected String createThreadName ( IProgressRunnable runnable ) { } protected Runnable createRunnable ( final ISafeProgressRunner sof , final IProgressRunnable progressRunnable ) { return new Runnable ( ) { public void run ( ) { preSafeRun ( ) ; <START_BUG> sof . safeRun ( progressRunnable ) ; <END_BUG> postSafeRun ( ) ; } } ; } public void configureThreadForExecution ( Thread t ) { } protected AbstractFuture createFuture ( IProgressMonitor monitor ) { } public synchronized IFuture execute ( IProgressRunnable runnable , IProgressMonitor monitor ) throws IllegalThreadStateException { } }

Fix:
sof . runWithProgress ( progressRunnable ) ;
Buggy code:
public class ScheduleDataSource { private SQLiteDatabase database ; private ScheduleSQLite dbHelper ; private String [ ] scheduleColumns = new String [ ] { ScheduleSQLite . COLUMN_PK_SCHE_ID , ScheduleSQLite . COLUMN_SCHE_TYPE , ScheduleSQLite . COLUMN_SCHE_VEHICLE_NUMBER , ScheduleSQLite . COLUMN_SCHE_STATION_NUMBER , ScheduleSQLite . COLUMN_SCHE_DATA , ScheduleSQLite . COLUMN_SCHE_TIMESTAMP } ; private static final String EMPTY_COLUMN = "-" ; public ScheduleDataSource ( Activity context ) { } public void open ( ) throws SQLException { } public void close ( ) { } public boolean createVehicleScheduleCache ( VehicleTypeEnum dataType , String dataNumber , Object data ) { } public boolean createStationScheduleCache ( VehicleTypeEnum vehicleType , String vehicleNumber , String stationNumber , Object data ) { } public boolean updateVehicleScheduleCache ( VehicleTypeEnum vehicleType , String vehicleNumber , Object data ) { } public boolean updateStationScheduleCache ( VehicleTypeEnum vehicleType , String vehicleNumber , String stationNumber , Object data ) { } public ScheduleCacheEntity getVehicleScheduleCache ( VehicleTypeEnum dataType , String dataNumber ) { } public ScheduleCacheEntity getStationScheduleCache ( VehicleTypeEnum vehicleType , String vehicleNumber , String stationNumber ) { } public boolean deleteScheduleCache ( int numberOfDays ) { } public boolean isVehiclesScheduleCacheAvailable ( VehicleTypeEnum vehicleType , String vehicleNumber ) { boolean isScheduleAvailable = false ; StringBuilder query = new StringBuilder ( ) ; query . append ( "<seq2seq4repair_space>SELECT<seq2seq4repair_space>COUNT(*)\t\t\t\t\t\t\t\t\t\t\t\n" ) ; query . append ( ( ( "<seq2seq4repair_space>FROM<seq2seq4repair_space>" + ( ScheduleSQLite . TABLE_SOF_SCHE ) ) + "\t\t\t\t\n" ) ) ; query . append ( "<seq2seq4repair_space>WHERE<seq2seq4repair_space>\t\t\t\t\t\t\t\t\t\t\t\t\t\n" ) ; query . append ( ( ( "<seq2seq4repair_space>" + ( ScheduleSQLite . COLUMN_SCHE_TYPE ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>\'%s\'<seq2seq4repair_space>AND\t\t\n" ) ) ; <START_BUG> query . append ( ( ( "<seq2seq4repair_space>" + ( ScheduleSQLite . COLUMN_SCHE_VEHICLE_NUMBER ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>%s\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n" ) ) ; <END_BUG> Cursor cursor = database . rawQuery ( String . format ( query . toString ( ) , vehicleType , vehicleNumber ) , null ) ; if ( ( cursor . getCount ( ) ) > 0 ) { cursor . moveToFirst ( ) ; isScheduleAvailable = ( cursor . getInt ( 0 ) ) > 0 ; } cursor . close ( ) ; return isScheduleAvailable ; } public boolean deleteVehiclesScheduleCache ( VehicleTypeEnum vehicleType , String vehicleNumber ) { } public boolean isAnyScheduleCacheAvailable ( ) { } public boolean deleteAllScheduleCache ( ) { } No newline ; at end ; of file ; }

Fix:
query . append ( ( ( "<seq2seq4repair_space>" + ( ScheduleSQLite . COLUMN_SCHE_VEHICLE_NUMBER ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>\'%s\'\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n" ) ) ;
Buggy code:
public class ResolvedPointcutDefinition extends ResolvedMemberImpl { private Pointcut pointcut ; public ResolvedPointcutDefinition ( UnresolvedType declaringType , int modifiers , String name , UnresolvedType [ ] parameterTypes , Pointcut pointcut ) { } public ResolvedPointcutDefinition ( UnresolvedType declaringType , int modifiers , String name , UnresolvedType [ ] parameterTypes , UnresolvedType returnType , Pointcut pointcut ) { } public void write ( DataOutputStream s ) throws IOException { } public static ResolvedPointcutDefinition read ( VersionedDataInputStream s , ISourceContext context ) throws IOException { } public String toString ( ) { } public Pointcut getPointcut ( ) { } public boolean isAjSynthetic ( ) { } public ResolvedMemberImpl parameterizedWith ( UnresolvedType [ ] typeParameters , ResolvedType newDeclaringType , boolean isParameterized ) { <START_BUG> TypeVariable [ ] typeVariables = getDeclaringType ( ) . getTypeVariables ( ) ; <END_BUG> if ( isParameterized && ( ( typeVariables . length ) != ( typeParameters . length ) ) ) { throw new IllegalStateException ( "Wrong<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>parameters<seq2seq4repair_space>supplied" ) ; } Map typeMap = new HashMap ( ) ; boolean typeParametersSupplied = ( typeParameters != null ) && ( ( typeParameters . length ) > 0 ) ; if ( typeVariables != null ) { for ( int i = 0 ; i < ( typeVariables . length ) ; i ++ ) { UnresolvedType ut = ( ! typeParametersSupplied ) ? typeVariables [ i ] . getFirstBound ( ) : typeParameters [ i ] ; typeMap . put ( typeVariables [ i ] . getName ( ) , ut ) ; } } UnresolvedType parameterizedReturnType = parameterize ( getGenericReturnType ( ) , typeMap , isParameterized ) ; UnresolvedType [ ] parameterizedParameterTypes = new UnresolvedType [ getGenericParameterTypes ( ) . length ] ; for ( int i = 0 ; i < ( parameterizedParameterTypes . length ) ; i ++ ) { parameterizedParameterTypes [ i ] = parameterize ( getGenericParameterTypes ( ) [ i ] , typeMap , isParameterized ) ; } ResolvedPointcutDefinition ret = new ResolvedPointcutDefinition ( newDeclaringType , getModifiers ( ) , getName ( ) , parameterizedParameterTypes , parameterizedReturnType , pointcut . parameterizeWith ( typeMap ) ) ; ret . setTypeVariables ( getTypeVariables ( ) ) ; ret . setSourceContext ( getSourceContext ( ) ) ; ret . setPosition ( getStart ( ) , getEnd ( ) ) ; ret . setParameterNames ( getParameterNames ( ) ) ; return ret ; } public static final ResolvedPointcutDefinition DUMMY = new ResolvedPointcutDefinition ( UnresolvedType . OBJECT , 0 , "missing" , UnresolvedType . NONE , Pointcut . makeMatchesNothing ( RESOLVED ) ) ; public void setPointcut ( Pointcut pointcut ) { } }

Fix:
TypeVariable [ ] typeVariables = getDeclaringType ( ) . resolve ( newDeclaringType . getWorld ( ) ) . getTypeVariables ( ) ;
Buggy code:
public class DateField extends FormComponentPanel { private static final long serialVersionUID = 1L ; private MutableDateTime date ; private DateTextField dateField ; public DateField ( String id ) { } public DateField ( String id , IModel model ) { } public Date getDate ( ) { } public void setDate ( Date date ) { } public void updateModel ( ) { } private void init ( ) { setType ( Date . class ) ; add ( ( dateField = DateTextField . forShortStyle ( "date" , new PropertyModel ( this , "date" ) ) ) ) ; <START_BUG> add ( new CalendarPopup ( "picker" , dateField ) ) ; <END_BUG> } protected void onAttach ( ) { } }

Fix:
dateField . add ( new DatePicker ( ) ) ;
Buggy code:
public class FilmsFragment extends Fragment implements OnBackPressedListener , AnnouncementFilmsListFragment . AnnouncementFilmSelectedListener , CalendarFragment . OnDateSelectedListener , FilmsListFragment . FilmSelectedListener , FilmsListFragment . ShowCalendarListener { private long shownFilmsDate ; private final Calendar calendar = Calendar . getInstance ( ) ; private FrameLayout calendarContainer ; private Animation showCalendarAnimation ; private Animation hideCalendarAnimation ; public static FilmsFragment getInstance ( ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onDestroy ( ) { if ( ( VERSION . SDK_INT ) < ( VERSION_CODES . JELLY_BEAN_MR1 ) ) { if ( ! ( getActivity ( ) . isFinishing ( ) ) ) { Fragment subfragment = getFragmentManager ( ) . findFragmentById ( subfragment_container ) ; if ( subfragment != null ) { FragmentTransaction transaction = getFragmentManager ( ) . beginTransaction ( ) ; try { <START_BUG> transaction . detach ( subfragment ) ; <END_BUG> } finally { transaction . commitAllowingStateLoss ( ) ; } } } } super . onDestroy ( ) ; } private void init ( View view ) { } @ Override public boolean onBackPressed ( ) { } private FragmentManager getNestedFragmentManager ( ) { } private void showFilmsByDate ( long date ) { } private void replaceFragment ( Fragment fragment ) { } @ Override public void onShowCalendar ( ) { } private void showCalendar ( long selectedDate ) { } private void switchToTimetable ( ) { } private void switchToCinemas ( ) { } private void switchToAnnouncements ( ) { } private void hideCalendar ( ) { } private boolean isCalendarShown ( ) { } @ Override public void onDateSelected ( int day , int month , int year ) { } @ Override public void onFilmSelected ( long filmId ) { } @ Override public void onAnnouncementFilmSelected ( long filmId ) { } }

Fix:
transaction . remove ( subfragment ) ;
Buggy code:
public class Script extends AbstractTask { private String script = "" ; private Hashtable beans = new Hashtable ( ) ; private String language ; public void setLanguage ( String language ) { } public void setSrc ( String fileName ) { } public void addContent ( String text ) { } public void execute ( ) throws TaskException { try { <START_BUG> addBeans ( getContext ( ) . getPropertys ( ) ) ; <END_BUG> beans . put ( "context" , getContext ( ) ) ; beans . put ( "self" , this ) ; BSFManager manager = new BSFManager ( ) ; for ( Iterator e = beans . keys ( ) ; e . hasNext ( ) ; ) { String key = ( ( String ) ( e . next ( ) ) ) ; Object value = beans . get ( key ) ; manager . declareBean ( key , value , value . getClass ( ) ) ; } manager . exec ( language , "<ANT>" , 0 , 0 , script ) ; } catch ( BSFException be ) { Throwable t = be ; Throwable te = be . getTargetException ( ) ; if ( te != null ) { if ( te instanceof TaskException ) { throw ( ( TaskException ) ( te ) ) ; } else { t = te ; } } throw new TaskException ( "Error" , t ) ; } } private void addBeans ( Hashtable dictionary ) { } }

Fix:
addBeans ( getContext ( ) . getProperties ( ) ) ;
Buggy code:
public class Clinit extends AbstractMethodDeclaration { private FieldBinding assertionSyntheticFieldBinding = null ; private FieldBinding classLiteralSyntheticField = null ; public Clinit ( CompilationResult compilationResult ) { } public void analyseCode ( ClassScope classScope , InitializationFlowContext staticInitializerFlowContext , FlowInfo flowInfo ) { } public void generateCode ( ClassScope classScope , ClassFile classFile ) { int clinitOffset = 0 ; if ( this . ignoreFurtherInvestigation ) { return ; } try { clinitOffset = classFile . contentsOffset ; this . generateCode ( classScope , classFile , clinitOffset ) ; } catch ( org . eclipse . jdt . internal . compiler . problem . AbortMethod e ) { if ( ( e . compilationResult ) == ( CodeStream . RESTART_IN_WIDE_MODE ) ) { try { classFile . contentsOffset = clinitOffset ; ( classFile . methodCount ) -- ; <START_BUG> classFile . codeStream . wideMode = true ; <END_BUG> this . generateCode ( classScope , classFile , clinitOffset ) ; } catch ( org . eclipse . jdt . internal . compiler . problem . AbortMethod e2 ) { classFile . contentsOffset = clinitOffset ; ( classFile . methodCount ) -- ; } } else { classFile . contentsOffset = clinitOffset ; ( classFile . methodCount ) -- ; } } } private void generateCode ( ClassScope classScope , ClassFile classFile , int clinitOffset ) { } public boolean isClinit ( ) { } public boolean isInitializationMethod ( ) { } public boolean isStatic ( ) { } public void parseStatements ( Parser parser , CompilationUnitDeclaration unit ) { } public StringBuffer print ( int tab , StringBuffer output ) { } public void resolve ( ClassScope classScope ) { } public void traverse ( ASTVisitor visitor , ClassScope classScope ) { } public void setAssertionSupport ( FieldBinding assertionSyntheticFieldBinding , boolean needClassLiteralField ) { } }

Fix:
classFile . codeStream . resetInWideMode ( ) ;
Buggy code:
public class Player { @ Getter private Server server ; @ Getter private NetworkAdapter adapter ; @ Getter private SocketAddress address ; public Player ( Server server , NetworkAdapter adapter , SocketAddress address ) { } public void sendMessage ( Message message ) { <START_BUG> adapter . sendMessage ( message ) ; <END_BUG> } public void handleMessage ( Message message ) { } }

Fix:
adapter . sendMessage ( message , address ) ;
Buggy code:
public class SaveAsDraftAction extends FrameAction { public SaveAsDraftAction ( AbstractFrameController frameController ) { } public void actionPerformed ( ActionEvent evt ) { <START_BUG> final ComposerController composerController = ( ( ComposerController ) ( getFrameController ( ) ) ) ; <END_BUG> if ( composerController . checkState ( ) ) return ; AccountItem item = ( ( org . columba . mail . gui . composer . ComposerModel ) ( composerController . getModel ( ) ) ) . getAccountItem ( ) ; SpecialFoldersItem folderItem = item . getSpecialFoldersItem ( ) ; String str = folderItem . get ( "drafts" ) ; int destUid = Integer . parseInt ( str ) ; Folder destFolder = ( ( Folder ) ( treeModel . getFolder ( destUid ) ) ) ; ComposerCommandReference [ ] r = new ComposerCommandReference [ 1 ] ; r [ 0 ] = new ComposerCommandReference ( composerController , destFolder ) ; SaveMessageCommand c = new SaveMessageCommand ( r ) ; processor . addOp ( c ) ; } }

Fix:
final ComposerController composerController = ( ( ComposerController ) ( getFrameMediator ( ) ) ) ;
Buggy code:
public class MainService extends Service { private AlarmManager am ; private String msg ; private PendingIntent aInt ; @ Override public IBinder onBind ( Intent p1 ) { } @ Override public void onCreate ( ) { } @ Override public int onStartCommand ( Intent intent , int flags , int startId ) { PowerManager pm = ( ( PowerManager ) ( getSystemService ( POWER_SERVICE ) ) ) ; boolean isScreenOn = V . isScreenOn ( pm ) ; try { isScreenOn = intent . getBooleanExtra ( "screen" , pm . isScreenOn ( ) ) ; } catch ( Exception e ) { } if ( isScreenOn ) { try { am . cancel ( aInt ) ; } catch ( Exception e ) { } if ( ( msg ) != "" ) <START_BUG> Toast . makeText ( this , msg , LENGTH_LONG ) ; <END_BUG> return START_STICKY ; } else { msg = "" ; if ( V . getPower ( this ) ) { return START_STICKY ; } AudioManager aud = ( ( AudioManager ) ( getSystemService ( AUDIO_SERVICE ) ) ) ; if ( aud . isMusicActive ( ) ) { waitFiveMins ( 0 ) ; return START_STICKY ; } TelephonyManager tl = ( ( TelephonyManager ) ( getSystemService ( TELEPHONY_SERVICE ) ) ) ; Boolean inCall = ( ( Integer ) ( tl . getCallState ( ) ) ) > 0 ; if ( inCall ) { return START_STICKY ; } if ( getCurrents ( ) ) { waitFiveMins ( 0 ) ; return START_STICKY ; } int waitFor = 0 ; long offTime = - 1 ; try { waitFor = intent . getIntExtra ( "waitFor" , 0 ) ; offTime = intent . getLongExtra ( "offTime" , ( - 1 ) ) ; } catch ( Exception e ) { } if ( waitFor == 2 ) { if ( offTime > ( - 1 ) ) { if ( ( wakelockDetected ( offTime ) ) && ( V . get ( this , "alarm" , alarm ) ) ) { setWakelockAlarm ( ) ; } } else { notifyError ( waitFor ) ; } } else if ( waitFor == 1 ) { if ( offTime > ( - 1 ) ) { if ( wakelockDetected ( offTime ) ) { if ( V . get ( this , "alarm" , alarm ) ) { waitFiveMins ( 2 ) ; } notifyWakelock ( ) ; } } else { notifyError ( waitFor ) ; } } else if ( waitFor == 0 ) { waitFiveMins ( 1 ) ; } else { notifyError ( waitFor ) ; } } return START_STICKY ; } private void notifyError ( Integer iError ) { } private void notifyWakelock ( ) { } private void waitFiveMins ( int waitStatus ) { } private void setWakelockAlarm ( ) { } private boolean wakelockDetected ( long diff ) { } private boolean getCurrents ( ) { } }

Fix:
Toast . makeText ( this , msg , LENGTH_LONG ) . show ( ) ;
Buggy code:
public class TestKStemmer extends BaseTokenStreamTestCase { Analyzer a = new Analyzer ( ) { @ Override protected TokenStreamComponents createComponents ( String fieldName , Reader reader ) { } } ; public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , a , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } public void testVocabulary ( ) throws Exception { } public void testEmptyTerm ( ) throws IOException { } }

Fix:
checkRandomData ( random ( ) , a , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public final class JDBCFindByPrimaryKeyQuery extends JDBCAbstractQueryCommand { private JDBCStoreManager manager ; private boolean rowLocking ; public JDBCFindByPrimaryKeyQuery ( JDBCStoreManager manager , JDBCQueryMetaData q ) { } public Collection execute ( Method finderMethod , Object [ ] args , CmpEntityBeanContext ctx , EntityProxyFactory factory ) throws FinderException { if ( ( manager . getReadAheadCache ( ) . getPreloadDataMap ( args [ 0 ] , false ) ) != null ) { Object pk = null ; JDBCFieldBridge [ ] pkFields = manager . getEntityBridge ( ) . getPrimaryKeyFields ( ) ; for ( int i = 0 ; i < ( pkFields . length ) ; ++ i ) { JDBCAbstractCMPFieldBridge pkField = ( ( JDBCAbstractCMPFieldBridge ) ( pkFields [ i ] ) ) ; Object fieldValue = pkField . getPrimaryKeyValue ( args [ 0 ] ) ; pk = pkField . setPrimaryKeyValue ( pk , fieldValue ) ; } <START_BUG> return Collections . singletonList ( factory . getEntityObject ( pk ) ) ; <END_BUG> } return super . execute ( finderMethod , args , ctx , factory ) ; } }

Fix:
return Collections . singletonList ( ( pk != null ? factory . getEntityObject ( pk ) : null ) ) ;
Buggy code:
public class CommentsActivity extends AppCompatActivity implements CommentAPI . GetCommentsForIdeaListener { public static final String IDEA_ID_TAG = "idea_id" ; private CommentsAdapter adapter ; private IdeaGETGson mIdea ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void showOrHideComments ( boolean show , boolean hasComments ) { } public void addComment ( View v ) { if ( ! ( User . isUserLoggedIn ( ) ) ) { <START_BUG> LoginUtil . showLoginDialog ( this , login_necessary_comments ) ; <END_BUG> return ; } EditText commentBox = ( ( EditText ) ( findViewById ( comment_text_box ) ) ) ; String commentText = commentBox . getText ( ) . toString ( ) ; if ( ( commentText . length ( ) ) > 0 ) { CommentAPI . addComment ( User . getCurrentUser ( ) . getID ( ) , mIdea . getId ( ) , commentText ) ; adapter . insert ( new Comment ( ( - 1 ) , User . getCurrentUser ( ) . getID ( ) , mIdea . getId ( ) , User . getCurrentUser ( ) . getName ( ) , commentText , new Timestamp ( System . currentTimeMillis ( ) ) ) , 0 ) ; commentBox . setText ( "" ) ; showOrHideComments ( true , true ) ; } } @ Override public void onGetCommentsSuccess ( List < Comment > comments ) { } @ Override public void onGetCommentsFailure ( ) { } }

Fix:
LoginUtil . showLoginDialog ( this , login_necessary_comments , null ) ;
Buggy code:
public class PointType extends CoordinateFieldType implements SpatialQueryable { @ Override protected void init ( IndexSchema schema , Map < String , String > args ) { } @ Override public boolean isPolyField ( ) { } @ Override public Fieldable [ ] createFields ( SchemaField field , String externalVal , float boost ) { } @ Override public ValueSource getValueSource ( SchemaField field , QParser parser ) { } @ Override public Field createField ( SchemaField field , String externalVal , float boost ) { } @ Override public void write ( XMLWriter xmlWriter , String name , Fieldable f ) throws IOException { } @ Override public void write ( TextResponseWriter writer , String name , Fieldable f ) throws IOException { } @ Override public SortField getSortField ( SchemaField field , boolean top ) { <START_BUG> throw new org . apache . solr . common . SolrException ( ErrorCode . BAD_REQUEST , ( "Sorting<seq2seq4repair_space>not<seq2seq4repair_space>suported<seq2seq4repair_space>on<seq2seq4repair_space>PointType<seq2seq4repair_space>" + ( field . getName ( ) ) ) ) ; <END_BUG> } @ Override public Query getRangeQuery ( QParser parser , SchemaField field , String part1 , String part2 , boolean minInclusive , boolean maxInclusive ) { } @ Override public Query getFieldQuery ( QParser parser , SchemaField field , String externalVal ) { } public Query createSpatialQuery ( QParser parser , SpatialOptions options ) { } }

Fix:
throw new org . apache . solr . common . SolrException ( ErrorCode . BAD_REQUEST , ( "Sorting<seq2seq4repair_space>not<seq2seq4repair_space>supported<seq2seq4repair_space>on<seq2seq4repair_space>PointType<seq2seq4repair_space>" + ( field . getName ( ) ) ) ) ;
Buggy code:
public abstract class Unpack extends AbstractTask { private File m_dest ; private File m_src ; public void setDest ( final File dest ) { } public void setSrc ( final File src ) { } public void execute ( ) throws TaskException { validate ( ) ; final File src = getSrc ( ) ; final File dest = getDest ( ) ; if ( ( src . lastModified ( ) ) > ( dest . lastModified ( ) ) ) { final String message = ( ( "Expanding<seq2seq4repair_space>" + ( src . getAbsolutePath ( ) ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( dest . getAbsolutePath ( ) ) ; <START_BUG> getContext ( ) . info ( message ) ; <END_BUG> extract ( ) ; } } protected abstract String getDefaultExtension ( ) { } protected abstract InputStream getUnpackingStream ( InputStream input ) throws IOException , TaskException { } private void extract ( ) throws TaskException { } private File createDestFile ( ) { } private void validate ( ) throws TaskException { } protected final File getDest ( ) { } protected final File getSrc ( ) { } }

Fix:
getContext ( ) . verbose ( message ) ;
Buggy code:
public class TierList { private TeamRank Rank ; private HashSet < String > RankMembers ; public TierList ( TeamRank r ) { } public TierList ( TeamRank r , HashSet < String > list ) { } public HashSet < String > getRankMembers ( ) { } public void clearRankMembers ( ) { } public void add ( String PlayerName ) { } public void remove ( String PlayerName ) { } public boolean containsMember ( String PlayerName ) { } public boolean isEmpty ( ) { } public TeamRank getRank ( ) { } public void setRank ( TeamRank rank ) { } public int getTierSize ( ) { } public String getSaveString ( ) { String save = Rank . getSaveString ( ) ; save += "<seq2seq4repair_space>Members:\n" ; for ( String player : RankMembers ) { <START_BUG> save += ( "<seq2seq4repair_space>-<seq2seq4repair_space>" + player ) + "\n" ; <END_BUG> } return save ; } public String membersToString ( ) { } }

Fix:
save += ( "<seq2seq4repair_space>-<seq2seq4repair_space>\'" + player ) + "\'\n" ;
Buggy code:
public class IfStmt extends Stmt { private Expr condition ; private List < Stmt > body ; public IfStmt ( Expr cond , List < Stmt > b , int lineNum , int colNum ) { } public Expr getCond ( ) { } public List < Stmt > getBody ( ) { } public Type typecheck ( SymTab s ) { SymTab newScope = new SymTab ( s ) ; <START_BUG> if ( ( condition . typecheck ( newScope ) . getType ( ) ) != "bool" ) <END_BUG> throw new Error ( ( ( ( ( ( line ) + ":" ) + ( column ) ) + "<seq2seq4repair_space>error:<seq2seq4repair_space>" ) + "not<seq2seq4repair_space>boolean<seq2seq4repair_space>in<seq2seq4repair_space>if<seq2seq4repair_space>condition" ) ) ; if ( ( body . size ( ) ) == 0 ) return new Type ( "unit" ) ; for ( int a = 0 ; a < ( body . size ( ) ) ; a ++ ) { if ( a == ( ( body . size ( ) ) - 1 ) ) { Type t = body . get ( a ) . typecheck ( newScope ) ; if ( ( ( t . getType ( ) ) != "unit" ) && ( ( t . getType ( ) ) != "void" ) ) { throw new Error ( ( ( ( ( ( line ) + ":" ) + ( column ) ) + "<seq2seq4repair_space>error:<seq2seq4repair_space>" ) + "last<seq2seq4repair_space>stmt<seq2seq4repair_space>in<seq2seq4repair_space>if<seq2seq4repair_space>block<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>typecheck" ) ) ; } else return new Type ( "unit" ) ; } else if ( ( body . get ( a ) . typecheck ( newScope ) . getType ( ) ) != "unit" ) throw new Error ( ( ( ( ( ( line ) + ":" ) + ( column ) ) + "<seq2seq4repair_space>error:<seq2seq4repair_space>" ) + "stmt<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>unit<seq2seq4repair_space>type" ) ) ; } throw new Error ( ( ( ( ( ( line ) + ":" ) + ( column ) ) + "<seq2seq4repair_space>error:<seq2seq4repair_space>" ) + "shouldn't<seq2seq4repair_space>get<seq2seq4repair_space>here<seq2seq4repair_space>in<seq2seq4repair_space>ifblock<seq2seq4repair_space>typecheck" ) ) ; } public String toString ( ) { } @ Override public IRStmt buildIRStmt ( ) { } }

Fix:
if ( ! ( condition . typecheck ( newScope ) . equals ( new Type ( "bool" ) ) ) )
Buggy code:
public class RemoveSuperColumnTest { @ Test public void testRemoveSuperColumn ( ) throws IOException , InterruptedException , ExecutionException { } @ Test public void testRemoveDeletedSubColumn ( ) throws IOException , InterruptedException , ExecutionException { } private void validateRemoveSubColumn ( ) throws IOException { } private void validateRemoveTwoSources ( ) throws IOException { } private void validateRemoveCompacted ( ) throws IOException { } @ Test public void testRemoveSuperColumnWithNewData ( ) throws IOException , InterruptedException , ExecutionException { } private void validateRemoveWithNewData ( ) throws IOException { ColumnFamilyStore store = Table . open ( "Keyspace1" ) . getColumnFamilyStore ( "Super2" ) ; <START_BUG> ColumnFamily resolved = store . getColumnFamily ( new org . apache . cassandra . db . filter . NamesQueryFilter ( "key1" , new QueryPath ( "Super2" , "SC1" . getBytes ( ) ) , Util . getBytes ( 2 ) ) ) ; <END_BUG> Collection < IColumn > subColumns = resolved . getSortedColumns ( ) . iterator ( ) . next ( ) . getSubColumns ( ) ; assert ( subColumns . size ( ) ) == 1 ; assert ( subColumns . iterator ( ) . next ( ) . timestamp ( ) ) == 2 ; } }

Fix:
ColumnFamily resolved = store . getColumnFamily ( new org . apache . cassandra . db . filter . NamesQueryFilter ( "key1" , new QueryPath ( "Super2" , "SC1" . getBytes ( ) ) , Util . getBytes ( 2 ) ) , Integer . MAX_VALUE ) ;
Buggy code:
public class Theories extends JUnit4ClassRunner { public Theories ( Class < ? > klass ) throws InitializationError { } @ Override protected void collectInitializationErrors ( List < Throwable > errors ) { } @ Override protected List < FrameworkMethod > computeTestMethods ( ) { } @ Override public Statement childBlock ( final FrameworkMethod method ) { } public class TheoryAnchor extends Statement { private int successes = 0 ; private FrameworkMethod fTestMethod ; private List < AssumptionViolatedException > fInvalidParameters = new ArrayList < AssumptionViolatedException > ( ) ; public TheoryAnchor ( FrameworkMethod method ) { } @ Override public void evaluate ( ) throws Throwable { } protected void runWithAssignment ( Assignments parameterAssignment ) throws Throwable { } protected void runWithIncompleteAssignment ( Assignments incomplete ) throws IllegalAccessException , InstantiationException , Throwable { } protected void runWithCompleteAssignment ( final Assignments complete ) throws IllegalAccessException , InstantiationException , NoSuchMethodException , Throwable , InvocationTargetException { new JUnit4ClassRunner ( getTestClass ( ) ) { @ Override protected void collectInitializationErrors ( List < Throwable > errors ) { } @ Override public Statement childBlock ( FrameworkMethod method ) { final Statement statement = super . childBlock ( method ) ; return new Statement ( ) { @ Override public void evaluate ( ) throws Throwable { try { statement . evaluate ( ) ; handleDataPointSuccess ( ) ; } catch ( AssumptionViolatedException e ) { handleAssumptionViolation ( e ) ; } catch ( Throwable e ) { <START_BUG> reportParameterizedError ( e , complete . getAllArguments ( nullsOk ( ) ) ) ; <END_BUG> } } } ; } @ Override protected Statement invoke ( FrameworkMethod method , Object test ) { return methodCompletesWithParameters ( method , complete , test ) ; } @ Override public Object createTest ( ) throws Exception { return getTestClass ( ) . getConstructor ( ) . newInstance ( complete . getConstructorArguments ( nullsOk ( ) ) ) ; } } . childBlock ( fTestMethod ) . evaluate ( ) ; } private Statement methodCompletesWithParameters ( final FrameworkMethod method , final Assignments complete , final Object freshInstance ) { } protected void handleAssumptionViolation ( AssumptionViolatedException e ) { } protected void reportParameterizedError ( Throwable e , Object ... params ) throws Throwable { } private boolean nullsOk ( ) { } protected void handleDataPointSuccess ( ) { } } }

Fix:
reportParameterizedError ( e , complete . getArgumentStrings ( nullsOk ( ) ) ) ;
Buggy code:
class Count extends AggregateVal { public Count ( Val val ) { } protected Class getType ( Class c ) { } protected Object operate ( Collection os , Class c ) { long count = 0 ; for ( Iterator itr = os . iterator ( ) ; itr . hasNext ( ) ; ) if ( ( itr . next ( ) ) != null ) count ++ ; <START_BUG> return Numbers . valueOf ( count ) ; <END_BUG> } }

Fix:
return count ;
Buggy code:
final class BinaryEndpoint extends AbstractEndpoint < Boolean > { BinaryEndpoint ( Register reg , EndpointDefinition epDef ) { } @ Override public Type getType ( ) { } @ Override public Boolean getValue ( ) throws NetworkException { byte [ ] val = reg . getValue ( ) ; int byteIdx = epDef . getPosition ( ) . getBytePos ( ) ; int bitIdx = epDef . getPosition ( ) . getBitPos ( ) ; <START_BUG> return ( ( val [ byteIdx ] ) & ( ~ ( 1 << bitIdx ) ) ) != 0 ; <END_BUG> } @ Override public void setValue ( Boolean value ) throws NetworkException { } @ Override protected Boolean transformIn ( Boolean value , Unit unit ) { } @ Override protected Boolean transformOut ( Boolean value , Unit unit ) { } }

Fix:
return ( ( val [ byteIdx ] ) & ( 1 << bitIdx ) ) != 0 ;
Buggy code:
public final class ActionHandler extends AbstractHandler { private static final String ATTRIBUTE_CHECKED = "checked" ; private static final String ATTRIBUTE_ENABLED = "enabled" ; private static final String ATTRIBUTE_HANDLED = IHandlerAttributes . ATTRIBUTE_HANDLED ; private static final String ATTRIBUTE_ID = "id" ; private static final String ATTRIBUTE_STYLE = "style" ; private final IAction action ; private Map attributeValuesByName ; private IPropertyChangeListener propertyChangeListener ; public ActionHandler ( IAction action ) { } public void addHandlerListener ( IHandlerListener handlerListener ) { } private final void attachListener ( ) { if ( ( propertyChangeListener ) == null ) { attributeValuesByName = getAttributeValuesByNameFromAction ( ) ; propertyChangeListener = new IPropertyChangeListener ( ) { public void propertyChange ( PropertyChangeEvent propertyChangeEvent ) { String property = propertyChangeEvent . getProperty ( ) ; <START_BUG> if ( ( ( ENABLED . equals ( property ) ) || ( CHECKED . equals ( property ) ) ) || ( HANDLER . equals ( property ) ) ) { <END_BUG> Map previousAttributeValuesByName = attributeValuesByName ; attributeValuesByName = getAttributeValuesByNameFromAction ( ) ; if ( ! ( attributeValuesByName . equals ( previousAttributeValuesByName ) ) ) fireHandlerChanged ( new HandlerEvent ( ActionHandler . this , true , previousAttributeValuesByName ) ) ; } } } ; } this . action . addPropertyChangeListener ( propertyChangeListener ) ; } private final void detachListener ( ) { } public void dispose ( ) { } public Object execute ( Map parameterValuesByName ) throws ExecutionException { } public IAction getAction ( ) { } public Map getAttributeValuesByName ( ) { } private Map getAttributeValuesByNameFromAction ( ) { } public void removeHandlerListener ( IHandlerListener handlerListener ) { } public final String toString ( ) { } }

Fix:
if ( ( ( ENABLED . equals ( property ) ) || ( CHECKED . equals ( property ) ) ) || ( IHandlerAttributes . ATTRIBUTE_HANDLED . equals ( property ) ) ) {
Buggy code:
public class RedirectRequestHandler implements IRequestHandler { private final String redirectUrl ; private final int status ; public RedirectRequestHandler ( final String redirectUrl ) { } public RedirectRequestHandler ( final String redirectUrl , final int status ) { } public void detach ( final IRequestCycle requestCycle ) { } public void respond ( final IRequestCycle requestCycle ) { final String location ; if ( redirectUrl . startsWith ( "//" ) ) { <START_BUG> location = requestCycle . getUrlRenderer ( ) . renderContextPathRelativeUrl ( redirectUrl ) ; <END_BUG> } else { location = redirectUrl ; } WebResponse response = ( ( WebResponse ) ( requestCycle . getResponse ( ) ) ) ; if ( ( status ) == ( HttpServletResponse . SC_MOVED_TEMPORARILY ) ) { response . sendRedirect ( location ) ; } else { response . setStatus ( SC_MOVED_PERMANENTLY ) ; response . setHeader ( "Location" , location ) ; } } }

Fix:
location = requestCycle . getUrlRenderer ( ) . renderContextRelativeUrl ( redirectUrl ) ;
Buggy code:
public class HttpTestSampleGui extends AbstractSamplerGui { private UrlConfigGui urlConfigGui ; private JCheckBox getImages ; private JCheckBox isMon ; public HttpTestSampleGui ( ) { } public void configure ( TestElement element ) { } public TestElement createTestElement ( ) { <START_BUG> HTTPSamplerBase sampler = HTTPSamplerFactory . newInstance ( HTTP_SAMPLER_JAVA ) ; <END_BUG> modifyTestElement ( sampler ) ; return sampler ; } public void modifyTestElement ( TestElement sampler ) { } public String getLabelResource ( ) { } protected void init ( ) { } private JPanel createOptionalTasksPanel ( ) { } public Dimension getPreferredSize ( ) { } public void clear ( ) { } }

Fix:
HTTPSamplerBase sampler = HTTPSamplerFactory . newInstance ( ) ;