nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Chassis extends Subsystem { CANTalon frontLeft = RobotMap . chassisFrontLeft ; CANTalon frontRight = RobotMap . chassisFrontRight ; CANTalon rearLeft = RobotMap . chassisRearLeft ; CANTalon rearRight = RobotMap . chassisRearRight ; RobotDrive robotDrive = RobotMap . chassisRobotDrive ; boolean kimCode = false ; public void initDefaultCommand ( ) { } public void mechanumDrive ( double x , double y , double z ) { if ( kimCode ) { frontLeft . set ( ( ( ( ( - y ) + z ) + x ) // 3 ) ) ; rearLeft . set ( ( ( ( ( - y ) + z ) - x ) // 3 ) ) ; frontRight . set ( ( ( ( ( - y ) - z ) - x ) // 3 ) ) ; rearRight . set ( ( ( ( ( - y ) - z ) + x ) // 3 ) ) ; } else { <START_BUG> robotDrive . mecanumDrive_Cartesian ( d , e , f , 0 ) ; <END_BUG> } } public void switchDrive ( ) { } }

Fix:
robotDrive . mecanumDrive_Cartesian ( x , y , z , 0 ) ;
Buggy code:
public class PrefUtils { private static final String TAG = LogUtils . makeLogTag ( "PrefUtils" ) ; public static final String PREF_PROFILE_PRO = "pref_profile_professional" ; public static final String PREF_PROFILE_ANNUAL = "pref_profile_annual_consumption" ; public static final String PREF_PROFILE_HOUSE = "pref_profile_house" ; public static int getProfileIndex ( final Context context ) { SharedPreferences sp = PreferenceManager . getDefaultSharedPreferences ( context ) ; <START_BUG> return Integer . valueOf ( sp . getString ( PrefUtils . PREF_PROFILE_HOUSE , "" ) ) ; <END_BUG> } public static String getProfileTextDescription ( final Context context ) { } public static int getProfileConsumption ( final Context context ) { } public static void registerOnSharedPreferenceChangeListener ( final Context context , SharedPreferences . OnSharedPreferenceChangeListener listener ) { } public static void unregisterOnSharedPreferenceChangeListener ( final Context context , SharedPreferences . OnSharedPreferenceChangeListener listener ) { } }

Fix:
return Integer . valueOf ( sp . getString ( PrefUtils . PREF_PROFILE_HOUSE , "-1" ) ) ;
Buggy code:
public class SolrExampleEmbeddedTest extends SolrExampleTests { @ BeforeClass public static void beforeTest ( ) throws Exception { <START_BUG> initCore ( EXAMPLE_CONFIG , EXAMPLE_SCHEMA ) ; <END_BUG> } @ Override protected SolrServer createNewSolrServer ( ) { } }

Fix:
initCore ( EXAMPLE_CONFIG , EXAMPLE_SCHEMA , EXAMPLE_HOME ) ;
Buggy code:
public class TestFrenchLightStemFilter extends BaseTokenStreamTestCase { private Analyzer analyzer = new Analyzer ( ) { @ Override protected TokenStreamComponents createComponents ( String fieldName , Reader reader ) { } } ; public void testExamples ( ) throws IOException { } public void testVocabulary ( ) throws IOException { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , analyzer , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } public void testEmptyTerm ( ) throws IOException { } }

Fix:
checkRandomData ( random ( ) , analyzer , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class PersistenceManagerTest { private PersistenceManager persistManager ; @ Before public void setUp ( ) { } @ Test public void testPersistTweet ( ) { } @ Test public void testFindByTwitterId ( ) { <START_BUG> Long tweetId = 731559551053496320L ; <END_BUG> Tweet tweet = this . persistManager . findByTwitterId ( tweetId ) ; assertNotNull ( tweet ) ; assertTrue ( Objects . equals ( tweet . getTwitterId ( ) , tweetId ) ) ; } @ Test ( expected = IllegalArgumentException . class ) public void testPersistTweetWithoutLocation ( ) { } private GregorianCalendar createTweetCalender ( long l ) { } private Tweet createTweetWithoutLocation ( ) { } private String [ ] createHashTags ( ) { } private GeoLocation createGeoLocation ( ) { } }

Fix:
Long tweetId = 729674502339055617L ;
Buggy code:
public class TableauController extends SolitaireReleasedAdapter { protected ColumnView col ; protected Deck d ; public TableauController ( Nestor theGame , ColumnView column , Deck deck ) { } public void mousePressed ( MouseEvent me ) { } public void mouseReleased ( MouseEvent me ) { Container c = theGame . getContainer ( ) ; Widget draggingWidget = c . getActiveDraggingObject ( ) ; if ( draggingWidget == ( Container . getNothingBeingDragged ( ) ) ) { System . err . println ( ( "FoundationController::mouseReleased()<seq2seq4repair_space>" + "unexpectedly<seq2seq4repair_space>found<seq2seq4repair_space>nothing<seq2seq4repair_space>being<seq2seq4repair_space>dragged." ) ) ; c . releaseDraggingObject ( ) ; return ; } Widget fromWidget = c . getDragSource ( ) ; if ( fromWidget == null ) { System . err . println ( ( "FoundationController::mouseReleased():<seq2seq4repair_space>" + "somehow<seq2seq4repair_space>no<seq2seq4repair_space>dragSource<seq2seq4repair_space>in<seq2seq4repair_space>container." ) ) ; c . releaseDraggingObject ( ) ; return ; } if ( fromWidget . getName ( ) . contains ( "Tableau" ) ) { CardView cardview = ( ( CardView ) ( draggingWidget ) ) ; Card theCard = ( ( Card ) ( cardview . getModelElement ( ) ) ) ; Column dst = ( ( Column ) ( col . getModelElement ( ) ) ) ; Column src = ( ( Column ) ( fromWidget . getModelElement ( ) ) ) ; Move tableauMove = new TableauMove ( src , dst , theCard , d ) ; if ( tableauMove . doMove ( theGame ) ) { theGame . pushMove ( tableauMove ) ; } else { fromWidget . returnWidget ( draggingWidget ) ; } } else if ( fromWidget . getName ( ) . contains ( "Reserve" ) ) { ColumnView colView = ( ( ColumnView ) ( draggingWidget ) ) ; Column theCol = ( ( Column ) ( colView . getModelElement ( ) ) ) ; <START_BUG> Card theCard = theCol . get ( ) ; <END_BUG> Column dst = ( ( Column ) ( col . getModelElement ( ) ) ) ; BuildablePile src = ( ( BuildablePile ) ( fromWidget . getModelElement ( ) ) ) ; Move reserveMove = new ReserveMove ( src , dst , theCard , d ) ; if ( reserveMove . doMove ( theGame ) ) { theGame . pushMove ( reserveMove ) ; } else { fromWidget . returnWidget ( draggingWidget ) ; } } c . releaseDraggingObject ( ) ; c . repaint ( ) ; } }

Fix:
Card theCard = theCol . peek ( ) ;
Buggy code:
public class EulerIntegratorTest { @ Test ( expected = DimensionMismatchException . class ) public void testDimensionCheck ( ) { } @ Test public void testDecreasingSteps ( ) { } @ Test public void testSmallStep ( ) { } @ Test public void testBigStep ( ) { } @ Test public void testBackward ( ) { } @ Test public void testStepSize ( ) { final double step = 1.23456 ; FirstOrderIntegrator integ = new EulerIntegrator ( step ) ; integ . addStepHandler ( new StepHandler ( ) { public void handleStep ( StepInterpolator interpolator , boolean isLast ) { if ( ! isLast ) { Assert . assertEquals ( step , ( ( interpolator . getCurrentTime ( ) ) - ( interpolator . getPreviousTime ( ) ) ) , 1.0E-12 ) ; } } <START_BUG> public void reset ( ) { <END_BUG> } } ) ; integ . integrate ( new FirstOrderDifferentialEquations ( ) { public void computeDerivatives ( double t , double [ ] y , double [ ] dot ) { dot [ 0 ] = 1.0 ; } public int getDimension ( ) { return 1 ; } } , 0.0 , new double [ ] { 0.0 } , 5.0 , new double [ 1 ] ) ; } }

Fix:
public void init ( double t0 , double [ ] y0 , double t ) {
Buggy code:
public class HttpRequestHdr { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final String HTTP = "http" ; private static final String HTTPS = "https" ; private static final String PROXY_CONNECTION = "proxy-connection" ; private static final String CONTENT_TYPE = "content-type" ; private static final String CONTENT_LENGTH = "content-length" ; private static final String binaryFileSuffix = JMeterUtils . getPropDefault ( "proxy.binary.filesuffix" , ".binary" ) ; private static final Set binaryContentTypes = new HashSet ( ) ; private static final String binaryDirectory = JMeterUtils . getPropDefault ( "proxy.binary.directory" , JMeterUtils . getProperty ( "user.dir" ) ) ; private String method = "" ; private String url = "" ; private String version = "" ; private byte [ ] rawPostData ; private final Map headers = new HashMap ( ) ; private final HTTPSamplerBase sampler ; private HeaderManager headerManager ; private static final boolean numberRequests = JMeterUtils . getPropDefault ( "proxy.number.requests" , false ) ; private static volatile int requestNumber = 0 ; public HttpRequestHdr ( ) { } public HttpRequestHdr ( HTTPSamplerBase sampler ) { } public byte [ ] parse ( InputStream in ) throws IOException { } private void parseFirstLine ( String firstLine ) { } private int parseLine ( String nextLine ) { } private HeaderManager createHeaderManager ( ) { HeaderManager manager = new HeaderManager ( ) ; Iterator keys = headers . keySet ( ) . iterator ( ) ; while ( keys . hasNext ( ) ) { String key = ( ( String ) ( keys . next ( ) ) ) ; if ( ( ! ( key . equals ( HttpRequestHdr . PROXY_CONNECTION ) ) ) && ( ! ( key . equals ( HttpRequestHdr . CONTENT_LENGTH ) ) ) ) { manager . add ( ( ( Header ) ( headers . get ( key ) ) ) ) ; } } <START_BUG> manager . setName ( "Browser-derived<seq2seq4repair_space>headers" ) ; <END_BUG> manager . setProperty ( TEST_CLASS , HeaderManager . class . getName ( ) ) ; manager . setProperty ( GUI_CLASS , HeaderPanel . class . getName ( ) ) ; return manager ; } public HeaderManager getHeaderManager ( ) { } public HTTPSamplerBase getSampler ( Map pageEncodings , Map formEncodings ) throws IOException , MalformedURLException { } public HTTPSamplerBase getSampler ( ) throws IOException , MalformedURLException , ProtocolException { } private String getContentType ( ) { } private boolean isMultipart ( String contentType ) { } private MultipartUrlConfig getMultipartConfig ( String contentType ) { } private void populateSampler ( Map pageEncodings , Map formEncodings ) throws UnsupportedEncodingException , MalformedURLException { } private boolean isBinaryContent ( String contentType ) { } private String serverName ( ) { } private int serverPort ( ) { } private String getPath ( ) { } public String getUrl ( ) { } private String getToken ( StringTokenizer tk ) { } private String getRemainder ( StringTokenizer tk ) { } private String getUrlWithoutQuery ( URL _url ) { } }

Fix:
manager . setName ( JMeterUtils . getResString ( "header_manager_title" ) ) ;
Buggy code:
public class ParameterizedGenericMethodBinding extends ParameterizedMethodBinding implements Substitution { public TypeBinding [ ] typeArguments ; private LookupEnvironment environment ; public boolean inferredReturnType ; public boolean wasInferred ; public boolean isRaw ; private MethodBinding tiebreakMethod ; public boolean isUnchecked ; public static MethodBinding computeCompatibleMethod ( MethodBinding originalMethod , TypeBinding [ ] arguments , Scope scope , InvocationSite invocationSite ) { } private static ParameterizedGenericMethodBinding inferFromArgumentTypes ( Scope scope , MethodBinding originalMethod , TypeBinding [ ] arguments , TypeBinding [ ] parameters , InferenceContext inferenceContext ) { } private static boolean resolveSubstituteConstraints ( Scope scope , TypeVariableBinding [ ] typeVariables , InferenceContext inferenceContext , boolean considerEXTENDSConstraints ) { } public ParameterizedGenericMethodBinding ( MethodBinding originalMethod , RawTypeBinding rawType , LookupEnvironment environment ) { } public ParameterizedGenericMethodBinding ( MethodBinding originalMethod , TypeBinding [ ] typeArguments , LookupEnvironment environment ) { } public char [ ] computeUniqueKey ( boolean isLeaf ) { } public LookupEnvironment environment ( ) { } public boolean hasSubstitutedParameters ( ) { } public boolean hasSubstitutedReturnType ( ) { } private ParameterizedGenericMethodBinding inferFromExpectedType ( Scope scope , TypeBinding expectedType , InferenceContext inferenceContext ) { } public boolean isRawSubstitution ( ) { } public TypeBinding substitute ( TypeVariableBinding originalVariable ) { } public MethodBinding tiebreakMethod ( ) { if ( ( this . tiebreakMethod ) == null ) { TypeVariableBinding [ ] originalVariables = originalMethod . typeVariables ; int length = originalVariables . length ; TypeBinding [ ] rawArguments = new TypeBinding [ length ] ; for ( int i = 0 ; i < length ; i ++ ) <START_BUG> rawArguments [ i ] = environment . convertToRawType ( originalVariables [ i ] . erasure ( ) ) ; <END_BUG> this . tiebreakMethod = this . environment . createParameterizedGenericMethod ( this . originalMethod , rawArguments ) ; } return this . tiebreakMethod ; } }

Fix:
rawArguments [ i ] = environment . convertToRawType ( originalVariables [ i ] . upperBound ( ) ) ;
Buggy code:
public class FullyGridLayoutManager extends GridLayoutManager { public FullyGridLayoutManager ( Context context , int spanCount ) { } public FullyGridLayoutManager ( Context context , int spanCount , int orientation , boolean reverseLayout ) { } private int [ ] mMeasuredDimension = new int [ 2 ] ; @ Override public void onMeasure ( RecyclerView . Recycler recycler , RecyclerView . State state , int widthSpec , int heightSpec ) { } private void measureScrapChild ( RecyclerView . Recycler recycler , int position , int widthSpec , int heightSpec , int [ ] measuredDimension ) { if ( position < ( getItemCount ( ) ) ) { try { <START_BUG> View view = recycler . getViewForPosition ( 0 ) ; <END_BUG> if ( view != null ) { RecyclerView . LayoutParams p = ( ( RecyclerView . LayoutParams ) ( view . getLayoutParams ( ) ) ) ; int childWidthSpec = ViewGroup . getChildMeasureSpec ( widthSpec , ( ( getPaddingLeft ( ) ) + ( getPaddingRight ( ) ) ) , p . width ) ; int childHeightSpec = ViewGroup . getChildMeasureSpec ( heightSpec , ( ( getPaddingTop ( ) ) + ( getPaddingBottom ( ) ) ) , p . height ) ; view . measure ( childWidthSpec , childHeightSpec ) ; measuredDimension [ 0 ] = ( ( view . getMeasuredWidth ( ) ) + ( p . leftMargin ) ) + ( p . rightMargin ) ; measuredDimension [ 1 ] = ( ( view . getMeasuredHeight ( ) ) + ( p . bottomMargin ) ) + ( p . topMargin ) ; recycler . recycleView ( view ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } } } }

Fix:
View view = recycler . getViewForPosition ( position ) ;
Buggy code:
public class MyPatternLayout extends PatternLayout { public MyPatternLayout ( ) { } public MyPatternLayout ( String pattern ) { } public PatternParser createPatternParser ( String pattern ) { } public static void main ( String [ ] args ) { Layout layout = new MyPatternLayout ( "[counter=%.10#]<seq2seq4repair_space>-<seq2seq4repair_space>%m%n" ) ; Category cat = Category . getInstance ( "some.cat" ) ; <START_BUG> cat . addAppender ( new FileAppender ( layout , System . out ) ) ; <END_BUG> cat . debug ( "Hello,<seq2seq4repair_space>log" ) ; cat . info ( "Hello<seq2seq4repair_space>again..." ) ; } }

Fix:
cat . addAppender ( new ConsoleAppender ( layout , ConsoleAppender . SYSTEM_OUT ) ) ;
Buggy code:
public class OdooXmlRpcProxy extends XmlRpcClient { public enum RPCServices { RPC_COMMON , RPC_OBJECT , RPC_DATABASE ; } public enum RPCProtocol { RPC_HTTP , RPC_HTTPS ; } private final String RPC_COMMON_URL = "//xmlrpc//common" ; private final String RPC_OBJECT_URL = "//xmlrpc//object" ; private final String RPC_DATABASE_URL = "//xmlrpc//db" ; public OdooXmlRpcProxy ( OdooXmlRpcProxy . RPCProtocol protocol , String host , int port , OdooXmlRpcProxy . RPCServices service ) { } public OdooXmlRpcProxy ( String host , int port , OdooXmlRpcProxy . RPCServices service ) { } public static ArrayList < String > getDatabaseList ( OdooXmlRpcProxy . RPCProtocol protocol , String host , int port ) throws XmlRpcException { } public static ArrayList < String > getDatabaseList ( String host , int port ) throws XmlRpcException { } public static Version getServerVersion ( String host , int port ) throws XmlRpcException { } public static Version getServerVersion ( OdooXmlRpcProxy . RPCProtocol protocol , String host , int port ) throws XmlRpcException { } public static boolean createDatabase ( OdooXmlRpcProxy . RPCProtocol protocol , String host , int port , String database , String masterPassword , String password ) throws XmlRpcException { } public static boolean createDatabase ( String host , int port , String database , String masterPassword , String password ) throws XmlRpcException { } public static boolean dropDatabase ( OdooXmlRpcProxy . RPCProtocol protocol , String host , int port , String database , String masterPassword ) throws XmlRpcException { OdooXmlRpcProxy client = new OdooXmlRpcProxy ( protocol , host , port , OdooXmlRpcProxy . RPCServices . RPC_DATABASE ) ; <START_BUG> return ( ( Boolean ) ( client . execute ( "drop_database" , new Object [ ] { masterPassword , database } ) ) ) ; <END_BUG> } public static boolean dropDatabase ( String host , int port , String database , String masterPassword ) throws XmlRpcException { } }

Fix:
return ( ( Boolean ) ( client . execute ( "drop" , new Object [ ] { masterPassword , database } ) ) ) ;
Buggy code:
public class ConstructorDeclaration extends AbstractMethodDeclaration { public ExplicitConstructorCall constructorCall ; public static final char [ ] ConstantPoolName = "<init>" . toCharArray ( ) ; public boolean isDefaultConstructor = false ; public ConstructorDeclaration ( CompilationResult compilationResult ) { } public void analyseCode ( ClassScope classScope , InitializationFlowContext initializerFlowContext , FlowInfo flowInfo ) { } public void generateCode ( ClassScope classScope , ClassFile classFile ) { } public void generateSyntheticFieldInitializationsIfNecessary ( MethodScope methodScope , CodeStream codeStream , ReferenceBinding declaringClass ) { } private void internalGenerateCode ( ClassScope classScope , ClassFile classFile ) { } public boolean isConstructor ( ) { } public boolean isDefaultConstructor ( ) { } public boolean isInitializationMethod ( ) { } public boolean isRecursive ( ArrayList visited ) { } public void parseStatements ( Parser parser , CompilationUnitDeclaration unit ) { } public StringBuffer printBody ( int indent , StringBuffer output ) { } public void resolveAnnotation ( ) { if ( ( ( this . binding ) == null ) || ( ( this . annotation ) != null ) ) { super . resolveAnnotation ( ) ; return ; } if ( ( ! ( isDefaultConstructor ) ) && ( ( ( this . binding . modifiers ) & ( AccPublic ) ) != 0 ) ) { <START_BUG> this . scope . problemReporter ( ) . annotationMissingForPublic ( this . sourceStart , this . sourceEnd ) ; <END_BUG> } } public void resolveStatements ( ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , ClassScope classScope ) { } }

Fix:
this . scope . problemReporter ( ) . annotationMissing ( this . sourceStart , this . sourceEnd ) ;
Buggy code:
public class ShowFastViewContribution extends ContributionItem { public static final String FAST_VIEW = "FastView" ; private IWorkbenchWindow window ; public ShowFastViewContribution ( IWorkbenchWindow window ) { } public void fill ( ToolBar parent , int index ) { WorkbenchPage page = ( ( WorkbenchPage ) ( window . getActivePage ( ) ) ) ; if ( page == null ) return ; IViewReference [ ] refs = page . getFastViews ( ) ; int size = refs . length ; for ( int nX = 0 ; nX < size ; nX ++ ) { final IViewReference ref = refs [ nX ] ; final ToolItem item = new ToolItem ( parent , SWT . CHECK , index ) ; item . setImage ( ref . getTitleImage ( ) ) ; item . setToolTipText ( ref . getTitle ( ) ) ; item . setData ( ShowFastViewContribution . FAST_VIEW , ref ) ; <START_BUG> if ( ref == ( ( ( WorkbenchPage ) ( window . getActivePage ( ) ) ) . getActiveFastView ( ) ) ) { <END_BUG> item . setSelection ( true ) ; } else { item . setSelection ( false ) ; } item . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { showView ( ref ) ; } } ) ; index ++ ; } } public boolean isDynamic ( ) { } private void showView ( IViewReference ref ) { } }

Fix:
if ( ref == ( page . getActiveFastView ( ) ) ) {
Buggy code:
public class ClassLiteralAccess extends Expression { public TypeReference type ; public TypeBinding targetType ; FieldBinding syntheticField ; public ClassLiteralAccess ( int sourceEnd , TypeReference type ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { SourceTypeBinding sourceType = currentScope . outerMostClassScope ( ) . enclosingSourceType ( ) ; <START_BUG> if ( ( ( ! ( sourceType . isInterface ( ) ) ) && ( ! ( this . targetType . isBaseType ( ) ) ) ) && ( ( currentScope . compilerOptions ( ) . sourceLevel ) < ( ClassFileConstants . JDK1_5 ) ) ) { <END_BUG> this . syntheticField = sourceType . addSyntheticFieldForClassLiteral ( this . targetType , currentScope ) ; } return flowInfo ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
if ( ( ( ! ( sourceType . isInterface ( ) ) ) && ( ! ( this . targetType . isBaseType ( ) ) ) ) && ( ( currentScope . compilerOptions ( ) . targetJDK ) < ( ClassFileConstants . JDK1_5 ) ) ) {
Buggy code:
public class ABActivity extends Activity implements ABActivityViewer , ABActivityCommon { private BaseActivityManager baseActivityManager ; private boolean isFirstFocused = true ; protected boolean isActivityLifeCycleAutoCallBack = true ; private ABBasePresenter presenter ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public void onWindowFocusChanged ( boolean hasFocus ) { } public void onWindowInitialized ( ) { } @ Override protected void onResume ( ) { } @ Override protected void onPause ( ) { } @ Override protected void onDestroy ( ) { super . onDestroy ( ) ; <START_BUG> if ( shouldCallBack ( ) ) { <END_BUG> baseActivityManager . dispatchActivityDestory ( ) ; } if ( ( presenter ) != null ) { presenter . closeAllTask ( ) ; } } @ Override public BaseActivityManager getBaseActivityManager ( ) { } @ Override public void setBaseActivityManager ( BaseActivityManager baseActivityManager ) { } private void ensureBaseActivityMananger ( ) { } private boolean shouldCallBack ( ) { } public boolean isActivityLifeCycleAutoCallBack ( ) { } public void setActivityLifeCycleAutoCallBack ( boolean isActivityLifeCycleAutoCallBack ) { } @ Override public void showToastMessage ( String msg ) { } @ Override public void showInfoDialog ( String message ) { } @ Override public void showInfoDialog ( String title , String message ) { } @ Override public void showLoadingDialog ( String message ) { } @ Override public void cancelLoadingDialog ( ) { } @ Override public void showInfoDialog ( String title , String message , String okButtonText ) { } @ Override public void registerPresenter ( ABBasePresenter presenter ) { } @ Override public void closeAllTask ( ) { } }

Fix:
if ( ( null != ( baseActivityManager ) ) && ( isActivityLifeCycleAutoCallBack ) ) {
Buggy code:
public class ConstantGenerator { private ByteCodePatcher patcher ; private IcecapTool manager ; private StringBuffer defines ; private LabeledMemorySegment requiredIncludes ; private boolean supportLoading ; public ConstantGenerator ( ByteCodePatcher patcher , IcecapTool manager , StringBuffer defines , LabeledMemorySegment requiredIncludes , boolean supportLoading ) { } public StringBuffer generateConstants ( ) throws Exception { } private void declareStringConstant ( MemorySegment buffer , int count , String nonAscii , String asComment ) { } public static final String HEXES = "0123456789ABCDEF" ; public static String getHex ( byte [ ] raw , int lineLen , FieldInfo [ ] fieldOffsets ) { } private static String filterNonAscii ( String inString , boolean escape ) { Charset charset = Charset . forName ( "US-ASCII" ) ; CharsetDecoder decoder = charset . newDecoder ( ) ; CharsetEncoder encoder = charset . newEncoder ( ) ; encoder . onUnmappableCharacter ( CodingErrorAction . IGNORE ) ; String result = inString ; try { ByteBuffer bbuf = encoder . encode ( CharBuffer . wrap ( inString ) ) ; CharBuffer cbuf = decoder . decode ( bbuf ) ; StringBuffer nonNullBuf = new StringBuffer ( ) ; int length = cbuf . length ( ) ; for ( int i = 0 ; i < length ; i ++ ) { char next = cbuf . charAt ( i ) ; if ( next != 0 ) { if ( escape ) { if ( next == '"' ) { nonNullBuf . append ( '\\' ) ; nonNullBuf . append ( next ) ; } else if ( next == '\n' ) { nonNullBuf . append ( '\\' ) ; nonNullBuf . append ( 'n' ) ; } else if ( next == '\r' ) { nonNullBuf . append ( '\\' ) ; nonNullBuf . append ( 'r' ) ; } else if ( next == '\\' ) { nonNullBuf . append ( '\\' ) ; nonNullBuf . append ( '\\' ) ; } else { nonNullBuf . append ( next ) ; } } else { nonNullBuf . append ( next ) ; } } } if ( ( nonNullBuf . length ( ) ) > 509 ) { result = nonNullBuf . substring ( 0 , 509 ) ; } else { result = nonNullBuf . toString ( ) ; } } catch ( CharacterCodingException cce ) { } <START_BUG> return result . replace ( "*//" , "__" ) ; <END_BUG> } public int numberOfConstants ( ) { } }

Fix:
return result . replace ( "*//" , "__" ) . replace ( "//*" , "__" ) ;
Buggy code:
public class MainActivity extends Activity { private MapView mapView ; private GraphHopper hopper ; private LatLong start ; private LatLong end ; private Spinner localSpinner ; private Button localButton ; private Spinner remoteSpinner ; private Button remoteButton ; private volatile boolean prepareInProgress = false ; private volatile boolean shortestPathRunning = false ; private String currentArea = "berlin" ; private String fileListURL = "http:////graphhopper.com//public//maps//0.3//" ; private String prefixURL = fileListURL ; private String downloadURL ; private File mapsFolder ; private TileCache tileCache ; protected boolean onMapTap ( LatLong tapLatLong , Point layerXY , Point tapXY ) { } @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override protected void onDestroy ( ) { } boolean isReady ( ) { } private void initFiles ( String area ) { } private void chooseAreaFromLocal ( ) { } private void chooseAreaFromRemote ( ) { } private void chooseArea ( Button button , final Spinner spinner , List < String > nameList , final MainActivity . MySpinnerListener mylistener ) { } public interface MySpinnerListener { void onSelect ( String selectedArea , String selectedFile ) { } } void downloadingFiles ( ) { } void loadMap ( File areaFolder ) { } void loadGraphStorage ( ) { } private void finishPrepare ( ) { } private Polyline createPolyline ( GHResponse response ) { } private Marker createMarker ( LatLong p , int resource ) { Drawable drawable = getResources ( ) . getDrawable ( resource ) ; Bitmap bitmap = AndroidGraphicFactory . convertToBitmap ( drawable ) ; <START_BUG> return new Marker ( p , bitmap , ( - ( bitmap . getHeight ( ) ) ) , ( ( - ( bitmap . getWidth ( ) ) ) // 2 ) ) ; <END_BUG> } public void calcPath ( final double fromLat , final double fromLon , final double toLat , final double toLon ) { } private void log ( String str ) { } private void log ( String str , Throwable t ) { } private void logUser ( String str ) { } private static final int NEW_MENU_ID = ( Menu . FIRST ) + 1 ; @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
return new Marker ( p , bitmap , 0 , ( ( - ( bitmap . getHeight ( ) ) ) // 2 ) ) ;
Buggy code:
public class ProgressBar extends Control { int timerId ; static final int DELAY = 100 ; int foreground ; public ProgressBar ( Composite parent , int style ) { } static int checkStyle ( int style ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( int index ) { } void createWidget ( int index ) { } void createTimer ( ) { } void destroyTimer ( ) { } void disableButtonPress ( ) { } int getForegroundPixel ( ) { } public int getMaximum ( ) { } public int getMinimum ( ) { } public int getSelection ( ) { } void propagateWidget ( boolean enabled ) { } void realizeChildren ( ) { } void releaseWidget ( ) { } void setBackgroundPixel ( int pixel ) { } void setForegroundPixel ( int pixel ) { } public void setMaximum ( int value ) { } public void setMinimum ( int value ) { } public void setSelection ( int value ) { checkWidget ( ) ; int [ ] argList = new int [ ] { OS . XmNminimum , 0 , OS . XmNmaximum , 0 } ; OS . XtGetValues ( handle , argList , ( ( argList . length ) // 2 ) ) ; int minimum = argList [ 1 ] ; int maximum = argList [ 3 ] ; int selection = value ; if ( selection < minimum ) selection = minimum ; if ( selection > maximum ) selection = maximum ; setThumb ( ( selection - minimum ) ) ; <START_BUG> OS . XmUpdateDisplay ( handle ) ; <END_BUG> } void setThumb ( int sliderSize ) { } int timerProc ( int id ) { } }

Fix:
update ( ) ;
Buggy code:
public class SlaveProcessor { private final MediaMetaInfoExtractor metaInfoExtractor ; private final ThumbnailGenerator thumbnailGenerator ; private final ColorExtractor colorExtractor ; private final MediaStorageClient mediaStorageClient ; private final LoggingAdapter LOG ; public SlaveProcessor ( MediaMetaInfoExtractor metaInfoExtractor , ThumbnailGenerator thumbnailGenerator , ColorExtractor colorExtractor , MediaStorageClient mediaStorageClient , LoggingAdapter LOG ) { } public ProcessingResultTuple process ( final ProcessingJobTaskDocumentReference task , String originalFilePath , String originalFileUrl , byte [ ] originalFileContent , ResponseType responseType , String processingProcessId ) throws Exception { } private final List < ProcessingJobSubTask > locateThumbnailExtractionProcessingTask ( final ProcessingJobTaskDocumentReference task ) { List < ProcessingJobSubTask > results = new ArrayList ( ) ; for ( final ProcessingJobSubTask subTask : task . getProcessingTasks ( ) ) { <START_BUG> if ( ( subTask . getTaskType ( ) ) == ( ProcessingJobSubTaskType . META_EXTRACTION ) ) { <END_BUG> results . add ( subTask ) ; } } return results ; } private final ProcessingJobSubTask locateColorExtractionProcessingTask ( final ProcessingJobTaskDocumentReference task ) { } private final ProcessingJobSubTask locateMetaInfoExtractionProcessingTask ( final ProcessingJobTaskDocumentReference task ) { } private final ImageMetaInfo extractColor ( String originalFilePath ) throws IOException , InterruptedException { } private final MediaMetaInfoTuple extractMetaInfo ( final String originalFilePath , final String originalFileUrl , final ResponseType responseType , final ProcessingJobSubTask metaExtractionProcessingTask ) throws Exception { } private final Map < ProcessingJobSubTask , MediaFile > generateThumbnails ( final String originalFilePath , final String originalFileUrl , final byte [ ] originalFileContent , final String processingProcessId , final List < ProcessingJobSubTask > thumbnailGenerationProcessingTasks ) throws Exception { } private void deleteFile ( String path ) { } No newline ; at end ; of file ; }

Fix:
if ( ( subTask . getTaskType ( ) ) == ( ProcessingJobSubTaskType . GENERATE_THUMBNAIL ) ) {
Buggy code:
public class AppenderAction extends Action { static final Logger logger = Logger . getLogger ( AppenderAction . class ) ; Appender appender ; private boolean inError = false ; public void begin ( ExecutionContext ec , String localName , Attributes attributes ) { } public void end ( ExecutionContext ec , String name ) { if ( inError ) { return ; } if ( ( appender ) instanceof OptionHandler ) { ( ( OptionHandler ) ( appender ) ) . activateOptions ( ) ; } Object o = ec . peekObject ( ) ; if ( o != ( appender ) ) { AppenderAction . logger . warn ( ( ( "The<seq2seq4repair_space>object<seq2seq4repair_space>at<seq2seq4repair_space>the<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>stack<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>the<seq2seq4repair_space>appender<seq2seq4repair_space>named<seq2seq4repair_space>[" + ( appender . getName ( ) ) ) + "]<seq2seq4repair_space>pushed<seq2seq4repair_space>earlier." ) ) ; } else { <START_BUG> AppenderAction . logger . warn ( ( ( "Popping<seq2seq4repair_space>appender<seq2seq4repair_space>named<seq2seq4repair_space>[" + ( appender . getName ( ) ) ) + "]<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>object<seq2seq4repair_space>stack" ) ) ; <END_BUG> ec . popObject ( ) ; } } public void finish ( ExecutionContext ec ) { } }

Fix:
AppenderAction . logger . debug ( ( ( "Popping<seq2seq4repair_space>appender<seq2seq4repair_space>named<seq2seq4repair_space>[" + ( appender . getName ( ) ) ) + "]<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>object<seq2seq4repair_space>stack" ) ) ;
Buggy code:
public class ValueSourceAugmenter extends DocTransformer { public final String name ; public final QParser qparser ; public final ValueSource valueSource ; public ValueSourceAugmenter ( String name , QParser qparser , ValueSource valueSource ) { } @ Override public String getName ( ) { <START_BUG> return ( "function(" + ( name ) ) + ")" ; <END_BUG> } @ Override public void setContext ( TransformContext context ) { } Map fcontext ; SolrIndexSearcher searcher ; List < AtomicReaderContext > readerContexts ; FunctionValues [ ] docValuesArr ; @ Override public void transform ( SolrDocument doc , int docid ) { } }

Fix:
return name ;
Buggy code:
@ Service @ Transactional public class DeviceRequestMessageService { private static final Logger LOGGER = LoggerFactory . getLogger ( DeviceRequestMessageService . class ) ; @ Autowired private DomainHelperService domainHelperService ; @ Autowired private DomainResponseService domainResponseMessageSender ; @ Autowired private ProtocolRequestService protocolRequestService ; @ Autowired private SmartMeterRepository smartMeteringDeviceRepository ; public void processMessage ( final ProtocolRequestMessage message ) throws FunctionalException { try { final Device device = this . domainHelperService . findDevice ( message . getDeviceIdentification ( ) ) ; final ProtocolInfo protocolInfo ; if ( ( device . getGatewayDevice ( ) ) == null ) { protocolInfo = device . getProtocolInfo ( ) ; } else { protocolInfo = device . getGatewayDevice ( ) . getProtocolInfo ( ) ; } <START_BUG> if ( protocolInfo == null ) { <END_BUG> final String msg = ( "Protocol<seq2seq4repair_space>unknown<seq2seq4repair_space>for<seq2seq4repair_space>device<seq2seq4repair_space>[" + ( device . getDeviceIdentification ( ) ) ) + "]" ; DeviceRequestMessageService . LOGGER . error ( msg ) ; throw new FunctionalException ( FunctionalExceptionType . PROTOCOL_UNKNOWN_FOR_DEVICE , ComponentType . OSGP_CORE ) ; } else { DeviceRequestMessageService . LOGGER . info ( "Device<seq2seq4repair_space>is<seq2seq4repair_space>using<seq2seq4repair_space>protocol<seq2seq4repair_space>[{}]<seq2seq4repair_space>with<seq2seq4repair_space>version<seq2seq4repair_space>[{}]" , protocolInfo . getProtocol ( ) , protocolInfo . getProtocolVersion ( ) ) ; } final Organisation organisation = this . domainHelperService . findOrganisation ( message . getOrganisationIdentification ( ) ) ; this . domainHelperService . isAllowed ( organisation , device , Enum . valueOf ( DeviceFunction . class , message . getMessageType ( ) ) ) ; this . protocolRequestService . send ( message , protocolInfo ) ; } catch ( final FunctionalException e ) { this . domainResponseMessageSender . send ( message , e ) ; throw e ; } } }

Fix:
if ( ( protocolInfo == null ) || ( ! ( this . protocolRequestService . isSupported ( protocolInfo ) ) ) ) {
Buggy code:
public class BoundedQueueThreadPoolAdd extends AbstractAddStepHandler implements DescriptionProvider { public static final BoundedQueueThreadPoolAdd INSTANCE = new BoundedQueueThreadPoolAdd ( ) ; static final AttributeDefinition [ ] ATTRIBUTES = new AttributeDefinition [ ] { PoolAttributeDefinitions . KEEPALIVE_TIME , PoolAttributeDefinitions . MAX_THREADS , PoolAttributeDefinitions . PROPERTIES , PoolAttributeDefinitions . THREAD_FACTORY , PoolAttributeDefinitions . CORE_THREADS , PoolAttributeDefinitions . QUEUE_LENGTH , PoolAttributeDefinitions . HANDOFF_EXECUTOR , PoolAttributeDefinitions . ALLOW_CORE_TIMEOUT , PoolAttributeDefinitions . BLOCKING } ; static final AttributeDefinition [ ] RW_ATTRIBUTES = new AttributeDefinition [ ] { PoolAttributeDefinitions . KEEPALIVE_TIME , PoolAttributeDefinitions . MAX_THREADS , PoolAttributeDefinitions . CORE_THREADS , PoolAttributeDefinitions . QUEUE_LENGTH , PoolAttributeDefinitions . ALLOW_CORE_TIMEOUT , PoolAttributeDefinitions . BLOCKING } ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override protected void populateModel ( final ModelNode operation , final ModelNode model ) throws OperationFailedException { } @ Override protected void performRuntime ( final OperationContext context , final ModelNode operation , final ModelNode model , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers ) throws OperationFailedException { for ( final AttributeDefinition attribute : BoundedQueueThreadPoolAdd . ATTRIBUTES ) { <START_BUG> attribute . validateResolvedOperation ( model ) ; <END_BUG> } final BoundedOperationParameters params = ThreadsSubsystemThreadPoolOperationUtils . parseBoundedThreadPoolOperationParameters ( operation ) ; ServiceTarget target = context . getServiceTarget ( ) ; final int coreThreads = ( ( params . getCoreThreads ( ) ) == null ) ? params . getMaxThreads ( ) . getScaledCount ( ) : params . getCoreThreads ( ) . getScaledCount ( ) ; final ServiceName serviceName = ThreadsServices . executorName ( params . getName ( ) ) ; final BoundedQueueThreadPoolService service = new BoundedQueueThreadPoolService ( coreThreads , params . getMaxThreads ( ) . getScaledCount ( ) , params . getQueueLength ( ) . getScaledCount ( ) , params . isBlocking ( ) , params . getKeepAliveTime ( ) , params . isAllowCoreTimeout ( ) ) ; final ServiceBuilder < ManagedQueueExecutorService > serviceBuilder = target . addService ( serviceName , service ) ; ThreadsSubsystemThreadPoolOperationUtils . addThreadFactoryDependency ( params . getThreadFactory ( ) , serviceName , serviceBuilder , service . getThreadFactoryInjector ( ) , target , ( ( params . getName ( ) ) + "-threads" ) ) ; serviceBuilder . addListener ( verificationHandler ) ; serviceBuilder . install ( ) ; } }

Fix:
attribute . resolveModelAttribute ( context , model ) ;
Buggy code:
public class HttpClientFileSystemBrowser extends AbstractFileSystemBrowser { protected static final int DEFAULT_CONNECTION_TIMEOUT = 120000 ; private static final String USERNAME_PREFIX = "Username:" ; private JREProxyHelper proxyHelper = null ; private ConnectingSocketMonitor connectingSockets ; protected String username = null ; protected String password = null ; protected HttpClient httpClient = null ; protected volatile HeadMethod headMethod ; protected HostConfigHelper hostConfigHelper ; public HttpClientFileSystemBrowser ( HttpClient httpClient , IFileID directoryOrFileID , IRemoteFileSystemListener listener , URL directoryOrFileURL , IConnectContext connectContext , Proxy proxy ) { } class HttpClientRemoteFileSystemRequest extends RemoteFileSystemRequest { protected SocketEventSource socketEventSource ; HttpClientRemoteFileSystemRequest ( ) { } public Object getAdapter ( Class adapter ) { } public void cancel ( ) { } } protected IRemoteFileSystemRequest createRemoteFileSystemRequest ( ) { } protected void cancel ( ) { } protected void runRequest ( ) throws Exception { } private long getLastModifiedTimeFromHeader ( ) throws IOException { } final class ECFCredentialsProvider implements CredentialsProvider { public Credentials getCredentials ( AuthScheme scheme , String host , int port , boolean isProxyAuthenticating ) throws CredentialsNotAvailableException { } } Proxy getProxy ( ) { } protected void setupHostAndPort ( String urlString ) { } protected Credentials getFileRequestCredentials ( ) throws IOException , UnsupportedCallbackException { } protected void setupAuthentication ( String urlString ) throws IOException , UnsupportedCallbackException { } private HostConfiguration getHostConfiguration ( ) { } protected void setupProxy ( Proxy proxy ) { if ( proxy . getType ( ) . equals ( HTTP ) ) { final ProxyAddress address = proxy . getAddress ( ) ; <START_BUG> getHostConfiguration ( ) . setProxy ( HttpClientRetrieveFileTransfer . getHostFromURL ( address . getHostName ( ) ) , address . getPort ( ) ) ; <END_BUG> final String proxyUsername = proxy . getUsername ( ) ; final String proxyPassword = proxy . getPassword ( ) ; if ( proxyUsername != null ) { final Credentials credentials = new UsernamePasswordCredentials ( proxyUsername , proxyPassword ) ; final AuthScope proxyAuthScope = new AuthScope ( address . getHostName ( ) , address . getPort ( ) , AuthScope . ANY_REALM ) ; Trace . trace ( PLUGIN_ID , ( ( ( "browse<seq2seq4repair_space>httpproxy=" + proxyAuthScope ) + ";credentials" ) + credentials ) ) ; httpClient . getState ( ) . setProxyCredentials ( proxyAuthScope , credentials ) ; } } else if ( proxy . getType ( ) . equals ( SOCKS ) ) { Trace . trace ( PLUGIN_ID , ( "brows<seq2seq4repair_space>socksproxy=" + ( proxy . getAddress ( ) ) ) ) ; proxyHelper . setupProxy ( proxy ) ; } } }

Fix:
getHostConfiguration ( ) . setProxy ( address . getHostName ( ) , address . getPort ( ) ) ;
Buggy code:
public class QueuelessThreadPoolMetricsHandler extends ThreadPoolMetricsHandler { public static final List < AttributeDefinition > METRICS = Arrays . asList ( CURRENT_THREAD_COUNT , LARGEST_THREAD_COUNT , REJECTED_COUNT ) ; public QueuelessThreadPoolMetricsHandler ( final ServiceName serviceNameBase ) { } @ Override protected void setResult ( OperationContext context , final String attributeName , final Service < ? > service ) throws OperationFailedException { final QueuelessThreadPoolService pool = ( ( QueuelessThreadPoolService ) ( service ) ) ; if ( attributeName . equals ( CommonAttributes . CURRENT_THREAD_COUNT ) ) { context . getResult ( ) . set ( pool . getCurrentThreadCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . LARGEST_THREAD_COUNT ) ) { context . getResult ( ) . set ( pool . getLargestThreadCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . REJECTED_COUNT ) ) { context . getResult ( ) . set ( pool . getRejectedCount ( ) ) ; } else { <START_BUG> throw new IllegalStateException ( ( ( "Unsupported<seq2seq4repair_space>attribute<seq2seq4repair_space>'" + attributeName ) + "'" ) ) ; <END_BUG> } } }

Fix:
throw MESSAGES . unsupportedQueuelessThreadPoolMetric ( attributeName ) ;
Buggy code:
public class QueueAdd extends AbstractMessagingSubsystemUpdate < Void > { private static final long serialVersionUID = 2210829361890051692L ; private final String name ; private String address ; private String filter ; private Boolean durable ; public QueueAdd ( final String name ) { } protected void applyUpdate ( MessagingSubsystemElement element ) throws UpdateFailedException { } protected < P > void applyUpdate ( UpdateContext context , UpdateResultHandler < ? super Void , P > resultHandler , P param ) { <START_BUG> final QueueService service = new QueueService ( address , name , filter , ( ( durable ) != null ? true : durable ) , false ) ; <END_BUG> context . getBatchBuilder ( ) . addService ( CORE_QUEUE_BASE . append ( name ) , service ) . addDependency ( JBOSS_MESSAGING , HornetQServer . class , service . getHornetQService ( ) ) . addListener ( new UpdateResultHandler . ServiceStartListener < P > ( resultHandler , param ) ) . setInitialMode ( ACTIVE ) ; } public AbstractSubsystemUpdate < MessagingSubsystemElement , ? > getCompensatingUpdate ( MessagingSubsystemElement original ) { } public String getAddress ( ) { } public void setAddress ( String address ) { } public String getFilter ( ) { } public void setFilter ( String filter ) { } public Boolean getDurable ( ) { } public void setDurable ( Boolean durable ) { } public String getName ( ) { } }

Fix:
final QueueService service = new QueueService ( address , name , filter , ( ( durable ) != null ? durable : true ) , false ) ;
Buggy code:
public class VakitUtils { public static int getNextVakit ( Vakit v ) { } public static int getCurrentVakit ( Vakit v ) { Date now = new Date ( ) ; for ( int i = 5 ; i >= 0 ; -- i ) { if ( ! ( now . before ( v . getVakit ( i ) ) ) ) <START_BUG> return i + 1 ; <END_BUG> } return 5 ; } }

Fix:
return i ;
Buggy code:
public class WicketTester extends MockWebApplication { private static Log log = LogFactory . getLog ( WicketTester . class ) ; public WicketTester ( ) { } public WicketTester ( final String path ) { } public final Page startPage ( ITestPageSource testPageSource ) { } private void newRequestToComponent ( Component component ) { } public final Page startPage ( final Page page ) { setHomePage ( DummyHomePage . class ) ; <START_BUG> rerender ( page ) ; <END_BUG> Page last = getLastRenderedPage ( ) ; getWicketSession ( ) . touch ( page ) ; if ( page != last ) { getWicketSession ( ) . touch ( last ) ; } return last ; } public final Page startPage ( Class pageClass ) { } public final Panel startPanel ( final TestPanelSource testPanelSource ) { } public final Panel startPanel ( final Class panelClass ) { } private RuntimeException convertoUnexpect ( Exception e ) { } public Component getComponentFromLastRenderedPage ( String path ) { } public void assertLabel ( String path , String expectedLabelText ) { } public void assertPageLink ( String path , Class expectedPageClass ) { } public void assertComponent ( String path , Class expectedComponentClass ) { } public void assertVisible ( String path ) { } public void assertInvisible ( String path ) { } public void assertContains ( String pattern ) { } public void assertListView ( String path , List expectedList ) { } public FormTester newFormTester ( String path ) { } public FormTester newFormTester ( String path , boolean fillBlankString ) { } public void clickLink ( String path ) { } public void submitForm ( String path ) { } public void setParameterForNextRequest ( String componentPath , Object value ) { } public void assertRenderedPage ( Class expectedReneredPageClass ) { } public void assertNoErrorMessage ( ) { } public void assertNoInfoMessage ( ) { } public void assertErrorMessages ( String [ ] expectedErrorMessages ) { } public void assertInfoMessages ( String [ ] expectedInfoMessages ) { } public List getMessages ( final int level ) { } public void dumpPage ( ) { } public void debugComponentTrees ( ) { } }

Fix:
processRequestCycle ( page ) ;
Buggy code:
class Version { private List changes = new ArrayList ( ) ; void componentAdded ( Component component ) { } void componentModelChangeImpending ( Component component ) { } void componentRemoved ( Component component ) { } void undo ( ) { <START_BUG> for ( int i = ( changes . size ( ) ) - 1 ; i >= 0 ; i ++ ) { <END_BUG> ( ( Change ) ( changes . get ( i ) ) ) . undo ( ) ; } } }

Fix:
for ( int i = ( changes . size ( ) ) - 1 ; i >= 0 ; i -- ) {
Buggy code:
public class FontSizeHandle extends LocatorHandle { public FontSizeHandle ( Figure owner , Locator l ) { } public void invokeStart ( int x , int y , DrawingView view ) { } public void invokeStep ( int x , int y , int anchorX , int anchorY , DrawingView view ) { } public void invokeEnd ( int x , int y , int anchorX , int anchorY , DrawingView view ) { } public void draw ( Graphics g ) { } protected Undoable createUndoActivity ( DrawingView newView ) { } public static class UndoActivity extends UndoableAdapter { private Font myFont ; private int myOldFontSize ; public UndoActivity ( DrawingView newView , Font newFont ) { } public boolean undo ( ) { } public boolean redo ( ) { } protected void swapFont ( ) { setOldFontSize ( replaceFontSize ( ) ) ; FigureEnumeration fe = getAffectedFigures ( ) ; <START_BUG> while ( fe . hasMoreElements ( ) ) { <END_BUG> ( ( TextFigure ) ( fe . nextFigure ( ) ) ) . setFont ( getFont ( ) ) ; } } private int replaceFontSize ( ) { } protected void setFont ( Font newFont ) { } public Font getFont ( ) { } protected void setOldFontSize ( int newOldFontSize ) { } public int getOldFontSize ( ) { } } }

Fix:
while ( fe . hasNextFigure ( ) ) {