nus-yam/ex-repair huggingface dataset:
Buggy code:
public class IronJacamarDeploymentParsingProcessor implements DeploymentUnitProcessor { public IronJacamarDeploymentParsingProcessor ( ) { } @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { <START_BUG> final ResourceRoot resourceRoot = phaseContext . getAttachment ( DEPLOYMENT_ROOT ) ; <END_BUG> final VirtualFile deploymentRoot = resourceRoot . getRoot ( ) ; if ( ( deploymentRoot == null ) || ( ! ( deploymentRoot . exists ( ) ) ) ) return ; final String deploymentRootName = deploymentRoot . getName ( ) ; VirtualFile serviceXmlFile = null ; if ( deploymentRootName . endsWith ( ".rar" ) ) { serviceXmlFile = deploymentRoot . getChild ( "//META-INF//ironjacamar.xml" ) ; } if ( ( serviceXmlFile == null ) || ( ! ( serviceXmlFile . exists ( ) ) ) ) return ; InputStream xmlStream = null ; IronJacamar result = null ; try { xmlStream = serviceXmlFile . openStream ( ) ; result = new IronJacamarParser ( ) . parse ( xmlStream ) ; if ( result != null ) { IronJacamarXmlDescriptor xmlDescriptor = new IronJacamarXmlDescriptor ( result ) ; phaseContext . putAttachment ( ATTACHMENT_KEY , xmlDescriptor ) ; } else throw new DeploymentUnitProcessingException ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>service<seq2seq4repair_space>xml<seq2seq4repair_space>[" + serviceXmlFile ) + "]" ) ) ; } catch ( Exception e ) { throw new DeploymentUnitProcessingException ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>service<seq2seq4repair_space>xml<seq2seq4repair_space>[" + serviceXmlFile ) + "]" ) , e ) ; } finally { VFSUtils . safeClose ( xmlStream ) ; } } public void undeploy ( final DeploymentUnit context ) { } }

Fix:
final ResourceRoot resourceRoot = phaseContext . getDeploymentUnit ( ) . getAttachment ( DEPLOYMENT_ROOT ) ;
Buggy code:
public class QueueReadAttributeHandler extends AbstractRuntimeOnlyHandler { public static final QueueReadAttributeHandler INSTANCE = new QueueReadAttributeHandler ( ) ; private ParametersValidator validator = new ParametersValidator ( ) ; private QueueReadAttributeHandler ( ) { } @ Override public void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { validator . validate ( operation ) ; final String attributeName = operation . require ( NAME ) . asString ( ) ; String queueName = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) . getLastElement ( ) . getValue ( ) ; final ServiceName hqServiceName = MessagingServices . getHornetQServiceName ( PathAddress . pathAddress ( operation . get ( OP_ADDR ) ) ) ; ServiceController < ? > hqService = context . getServiceRegistry ( false ) . getService ( hqServiceName ) ; HornetQServer hqServer = HornetQServer . class . cast ( hqService . getValue ( ) ) ; QueueControl control = QueueControl . class . cast ( hqServer . getManagementService ( ) . getResource ( ( ( ResourceNames . CORE_QUEUE ) + queueName ) ) ) ; if ( CommonAttributes . MESSAGE_COUNT . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getMessageCount ( ) ) ; } else if ( CommonAttributes . SCHEDULED_COUNT . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getScheduledCount ( ) ) ; } else if ( CommonAttributes . CONSUMER_COUNT . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getConsumerCount ( ) ) ; } else if ( CommonAttributes . DELIVERING_COUNT . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getDeliveringCount ( ) ) ; } else if ( CommonAttributes . MESSAGES_ADDED . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getMessagesAdded ( ) ) ; } else if ( QueueDefinition . ID . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getID ( ) ) ; } else if ( CommonAttributes . PAUSED . getName ( ) . equals ( attributeName ) ) { try { context . getResult ( ) . set ( control . isPaused ( ) ) ; } catch ( RuntimeException e ) { throw e ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } else if ( CommonAttributes . TEMPORARY . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . isTemporary ( ) ) ; } else { throw MessagingMessages . MESSAGES . unsupportedAttribute ( attributeName ) ; } <START_BUG> context . completeStep ( ) ; <END_BUG> } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class Root extends FolderTreeNode { FolderItem item ; public Root ( XmlElement node ) { } <START_BUG> public Class getDefaultChild ( ) { <END_BUG> return null ; } public void createChildren ( WorkerStatusController c ) { } }

Fix:
public String getDefaultChild ( ) {
Buggy code:
public class ThreadPoolFlexoTaskManager extends FlexoServiceImpl implements FlexoTaskManager { private static final int DEFAULT_THREAD_POOL_SIZE = 5 ; private final FlexoThreadFactory threadFactory ; private final ExecutorService executor ; private final List < FlexoTask > scheduledTasks ; private final PropertyChangeSupport pcSupport ; public static ThreadPoolFlexoTaskManager createInstance ( int threadPoolSize ) { } public static ThreadPoolFlexoTaskManager createInstance ( ) { } private ThreadPoolFlexoTaskManager ( int threadPoolSize ) { } @ Override public void initialize ( ) { } @ Override public PropertyChangeSupport getPropertyChangeSupport ( ) { } @ Override public String getDeletedProperty ( ) { } @ Override public synchronized void scheduleExecution ( FlexoTask ... tasks ) { } private synchronized void launchReadyToExecuteTasks ( FlexoTask ... ignoredTasks ) { <START_BUG> for ( FlexoTask task : getScheduledTasks ( ) ) { <END_BUG> if ( task . isReadyToExecute ( ) ) { boolean ignored = false ; if ( ( ignoredTasks . length ) > 0 ) { for ( int i = 0 ; i < ( ignoredTasks . length ) ; i ++ ) { FlexoTask ignoredTask = ignoredTasks [ i ] ; if ( task == ( ignoredTasks [ i ] ) ) { logger . fine ( ( "Ignoring<seq2seq4repair_space>" + task ) ) ; ignored = true ; } } } if ( ! ignored ) { logger . fine ( ( ( "Task<seq2seq4repair_space>" + task ) + "<seq2seq4repair_space>is<seq2seq4repair_space>ready<seq2seq4repair_space>to<seq2seq4repair_space>execute" ) ) ; task . executionScheduled ( ) ; executor . execute ( task ) ; } else { logger . fine ( ( ( "Task<seq2seq4repair_space>" + task ) + "<seq2seq4repair_space>is<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>ignored" ) ) ; } } else { logger . fine ( ( ( "Task<seq2seq4repair_space>" + task ) + "<seq2seq4repair_space>is<seq2seq4repair_space>NOT<seq2seq4repair_space>ready<seq2seq4repair_space>to<seq2seq4repair_space>execute" ) ) ; } } } @ Override public void stopExecution ( FlexoTask task ) { } @ Override @ Deprecated public void forceStopExecution ( FlexoTask task ) { } @ Override public boolean isTerminated ( ) { } @ Override public void shutdownAndWait ( ) { } @ Override public void shutdown ( ) { } @ Override public void shutdownAndExecute ( final Runnable r ) { } @ Override public synchronized List < FlexoTask > getScheduledTasks ( ) { } @ Override public void receiveNotification ( FlexoService caller , ServiceNotification notification ) { } @ Override public void waitTask ( FlexoTask task ) { } }

Fix:
for ( FlexoTask task : new ArrayList < FlexoTask > ( getScheduledTasks ( ) ) ) {
Buggy code:
public class InstPicture { private int m_width = 0 ; private Bitmap m_bitmap = null ; private ArrayList < String > m_tags = null ; private int m_height = 0 ; private String m_strJpegFileName = null ; private String m_strTagsFileName = null ; private boolean m_locked = false ; public InstPicture ( Bitmap bitmap , ArrayList < String > tags ) { } public InstPicture ( int width , int height , String strJpegFileName , String strTagsFileName ) { } public Bitmap getBitmap ( ) { } private void calcHeightAndWidth ( ) { } public int getHeight ( ) { } public ArrayList < String > getTags ( ) { } public boolean isDataLoaded ( ) { } public void loadData ( ) { } public void draw ( Canvas canvasOut , RectF outRect , DisplayMetrics metrics ) { int x_size = getBitmap ( ) . getWidth ( ) ; int y_size = getBitmap ( ) . getHeight ( ) ; int currentHeight = 0 ; Bitmap bitmap = Bitmap . createBitmap ( metrics , getWidth ( ) , getHeight ( ) , ARGB_8888 ) ; Canvas newCanvas = new Canvas ( bitmap ) ; Paint paint = new Paint ( ) ; newCanvas . drawBitmap ( getBitmap ( ) , 0 , 0 , paint ) ; currentHeight += y_size + ( Constants . HGAP ) ; <START_BUG> for ( int j = ( getTags ( ) . size ( ) ) - 1 ; j != 0 ; j -- ) { <END_BUG> Rect bounds = new Rect ( ) ; paint . getTextBounds ( getTags ( ) . get ( j ) , 0 , getTags ( ) . get ( j ) . length ( ) , bounds ) ; currentHeight += ( bounds . height ( ) ) + ( Constants . HGAP ) ; newCanvas . drawText ( getTags ( ) . get ( j ) , 0 , currentHeight , paint ) ; } Matrix matrix = new Matrix ( ) ; RectF curRect = new RectF ( 0 , 0 , bitmap . getWidth ( ) , bitmap . getHeight ( ) ) ; matrix . setRectToRect ( curRect , outRect , START ) ; canvasOut . drawBitmap ( bitmap , matrix , paint ) ; } public int getWidth ( ) { } public synchronized void setLock ( ) { } public synchronized boolean isLock ( ) { } public synchronized void freeLock ( ) { } public void freeData ( ) { } No newline ; at end ; of file ; }

Fix:
for ( int j = 0 ; j < ( getTags ( ) . size ( ) ) ; j ++ ) {
Buggy code:
public class JettyWebSocketClientTests { private JettyWebSocketClient client ; private JettyWebSocketClientTests . TestJettyWebSocketServer server ; private String wsUrl ; private WebSocketSession wsSession ; @ Before public void setup ( ) throws Exception { } @ After public void teardown ( ) throws Exception { } @ Test public void doHandshake ( ) throws Exception { HttpHeaders headers = new HttpHeaders ( ) ; headers . setSecWebSocketProtocol ( Arrays . asList ( "echo" ) ) ; <START_BUG> this . wsSession = this . client . doHandshake ( new TextWebSocketHandlerAdapter ( ) , headers , new URI ( this . wsUrl ) ) ; <END_BUG> assertEquals ( this . wsUrl , this . wsSession . getUri ( ) . toString ( ) ) ; assertEquals ( "echo" , this . wsSession . getAcceptedProtocol ( ) ) ; } private static class TestJettyWebSocketServer { private final Server server ; public TestJettyWebSocketServer ( int port , final WebSocketHandler webSocketHandler ) { } public void start ( ) throws Exception { } public void stop ( ) throws Exception { } } }

Fix:
this . wsSession = this . client . doHandshake ( new TextWebSocketHandlerAdapter ( ) , headers , new URI ( this . wsUrl ) ) . get ( ) ;
Buggy code:
public class TestElementProperty extends AbstractProperty { TestElement value ; TestElement savedValue = null ; public TestElementProperty ( String name , TestElement value ) { } public TestElementProperty ( ) { } public boolean equals ( Object o ) { if ( o instanceof TestElementProperty ) { if ( ( value ) != null ) { <START_BUG> return value . equals ( ( ( TestElementProperty ) ( o ) ) . getObjectValue ( ) ) ; <END_BUG> } } return false ; } public String getStringValue ( ) { } public void setObjectValue ( Object v ) { } public Object getObjectValue ( ) { } public TestElement getElement ( ) { } public void setElement ( TestElement el ) { } public Object clone ( ) { } public void mergeIn ( JMeterProperty prop ) { } public void recoverRunningVersion ( TestElement owner ) { } public void setRunningVersion ( boolean runningVersion ) { } public void setTemporary ( boolean temporary , TestElement owner ) { } }

Fix:
return value . equals ( ( ( JMeterProperty ) ( o ) ) . getObjectValue ( ) ) ;
Buggy code:
public class ReorderBuffer { private class ROBEntry { Instruction inst ; boolean hasValue ; Integer intValue ; Float floatValue ; boolean flushFlag ; public ROBEntry ( Instruction inst ) { } } private int NR ; private int NC ; private int head ; private int writtenThisCycle ; private ReorderBuffer . ROBEntry [ ] ROB ; private RegisterFile < Integer > intRegisters ; private RegisterFile < Float > floatRegisters ; private ReservationStations resStations ; private Scoreboard scoreboard ; private ArrayList < Integer > intIndexWriteQueue ; private ArrayList < Integer > floatIndexWriteQueue ; private ArrayList < Integer > intValueWriteQueue ; private ArrayList < Float > floatValueWriteQueue ; private ArrayList < Integer > indexCommitQueue ; private ArrayList < ReorderBuffer . ROBEntry > entryCommitQueue ; public ReorderBuffer ( int NR , int NC , RegisterFile < Integer > intRegisters , RegisterFile < Float > floatRegisters , ReservationStations resStations , Scoreboard scoreboard , Map < Integer , Float > memory ) { } public void cycle ( ) { } public void commit ( ) { } private void commit ( int robSlot , ReorderBuffer . ROBEntry entry ) { } <START_BUG> public void flush ( Inst branch ) { <END_BUG> int current = previous ( ) ; ReorderBuffer . ROBEntry entry = ROB [ current ] ; while ( true ) { if ( ( entry . inst ) == branch ) { int flushIndex = next ( current ) ; while ( flushIndex != ( head ) ) { ROB [ flushIndex ] . flushFlag = true ; flushIndex = next ( flushIndex ) ; } break ; } } } public boolean hasSlot ( ) { } public int reserveSlot ( Instruction instruction ) { } public boolean write ( int index , Integer val ) { } public boolean write ( int index , Float val ) { } public boolean isBefore ( Instruction i , Instruction j ) { } private int next ( ) { } private int next ( int index ) { } private int previous ( ) { } private int previous ( int index ) { } }

Fix:
public void flush ( Instruction branch ) {
Buggy code:
public class JWTAuthenticationFilter extends GenericFilterBean { private JWTUserConverter userConverter ; public JWTAuthenticationFilter ( JWTUserConverter userConverter ) { } @ Override public void doFilter ( ServletRequest req , ServletResponse res , FilterChain chain ) throws IOException , ServletException { HttpServletRequest request = ( ( HttpServletRequest ) ( req ) ) ; String jwt = request . getHeader ( "Bearer" ) ; if ( jwt == null ) { chain . doFilter ( req , res ) ; SecurityContextHolder . getContext ( ) . setAuthentication ( null ) ; } else { User authenticatedUser ; try { authenticatedUser = userConverter . getAuthenticatedUser ( jwt ) ; SecurityContextHolder . getContext ( ) . setAuthentication ( authenticatedUser ) ; chain . doFilter ( req , res ) ; SecurityContextHolder . getContext ( ) . setAuthentication ( null ) ; } catch ( JWTValidationException e ) { <START_BUG> throw new ServletException ( e ) ; <END_BUG> } } } }

Fix:
throw new ServletException ( e . getMessage ( ) ) ;
Buggy code:
public class ApplyFilterAction extends FrameAction implements SelectionListener { public ApplyFilterAction ( AbstractFrameController frameController ) { } public void actionPerformed ( ActionEvent evt ) { <START_BUG> FolderCommandReference [ ] r = ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( getFrameController ( ) ) ) . getTreeSelection ( ) ; <END_BUG> processor . addOp ( new org . columba . mail . folder . command . ApplyFilterCommand ( r ) ) ; } public void selectionChanged ( SelectionChangedEvent e ) { } }

Fix:
FolderCommandReference [ ] r = ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( getFrameMediator ( ) ) ) . getTreeSelection ( ) ;
Buggy code:
public class MainActivity extends BaseActivity implements TweetAdapter . OnFeedItemClickListener , View . OnClickListener { private static final int ANIM_DURATION_TOOLBAR = 300 ; private static final int ANIM_DURATION_FAB = 400 ; private ObservableRecyclerView mRecyclerView ; private TweetAdapter mTweetAdapter ; private MenuItem profileMenuItem ; private ImageView mLogo ; private FloatingActionButton fab ; private CircleImageView mCivAvatar ; boolean pendingIntroAnimation ; private ResideMenu mResideMenu ; private RainbowProgressbar mRainbowProgressBar ; private ImageView mIvHeader ; private GestureDetector mGestureDetector ; private int mLastTweetId = - 1 ; private Handler mHandler = new Handler ( ) ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void loadData ( ) { AVQuery < Tweet > query = AVObject . getQuery ( Tweet . class ) ; query . include ( "images" ) ; <START_BUG> query . orderByDescending ( "updatedAt" ) ; <END_BUG> query . include ( POSTER ) ; query . whereGreaterThan ( "tweetId" , mLastTweetId ) ; query . setLimit ( 20 ) ; query . findInBackground ( new FindCallback < Tweet > ( ) { @ Override public void done ( final List < Tweet > tweets , AVException e ) { mRainbowProgressBar . setRefresh ( false ) ; mRainbowProgressBar . postDelayed ( new Runnable ( ) { @ Override public void run ( ) { if ( ( tweets == null ) || ( ( tweets . size ( ) ) <= 0 ) ) return ; if ( ( tweets . size ( ) ) > 20 ) { mTweetAdapter . getTweets ( ) . clear ( ) ; } final List < String > tweetIds = new ArrayList < String > ( tweets . size ( ) ) ; for ( Tweet tweet : tweets ) { tweetIds . add ( tweet . getObjectId ( ) ) ; } try { Account account = AccountUtils . getDefaultAccount ( ) ; AVRelation < Tweet > relation = account . getRelation ( "likes" ) ; relation . getQuery ( ) . whereContainedIn ( "objectId" , tweetIds ) . findInBackground ( new FindCallback < Tweet > ( ) { @ Override public void done ( List < Tweet > list , AVException e ) { if ( list != null ) { for ( Tweet post : list ) { for ( Tweet tweet : tweets ) { if ( post . getObjectId ( ) . equals ( tweet . getObjectId ( ) ) ) { tweet . setLike ( true ) ; } } } } mTweetAdapter . getTweets ( ) . addAll ( tweets ) ; mTweetAdapter . updateItems ( ) ; mLastTweetId = mTweetAdapter . getTweets ( ) . get ( 0 ) . getTweetId ( ) ; } } ) ; } catch ( Exception ignored ) { Log . e ( "LOAD_DATA" , ignored . getMessage ( ) ) ; } } } , 110 ) ; } } ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } private void startIntroAnimation ( ) { } private void startContentAnimation ( ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } @ Override public void onImageClick ( List < String > imageUrls , int pos ) { } @ Override public void onCommentsClick ( View v , int position ) { } @ Override public void onClick ( View v ) { } }

Fix:
query . orderByDescending ( "post_time" ) ;
Buggy code:
public class Tile extends Sprite { private float scaleAmount ; private boolean active ; private float tilePositionX ; private float tilePositionY ; private ColorEffects colorChanger ; public Tile ( float size , float locationX , float locationY , Texture texture ) { } public boolean isActive ( ) { } public void fadeBack ( ) { active = false ; <START_BUG> if ( ( MainScreen . GAME_MODE ) == ( REGULAR_MODE ) ) { <END_BUG> colorChanger = new ColorEffects ( Colors . ACTIVE_CIRCLE , Colors . DISABLED_CIRCLE , 0.5F ) ; } else { } } public void update ( float delta ) { } }

Fix:
if ( ( MainScreen . GAME_MODE ) == ( MainScreen . REGULAR_MODE ) ) {
Buggy code:
public class Run { public static void main ( String [ ] args ) { XMLDecoder d ; Properties properties = new Properties ( ) ; UserInterface ui = null ; try { d = new XMLDecoder ( new BufferedInputStream ( new FileInputStream ( "Properties.xml" ) ) ) ; properties = ( ( Properties ) ( d . readObject ( ) ) ) ; d . close ( ) ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; return ; } if ( properties . getUi ( ) . equals ( "CLI" ) ) ui = new CLI ( new BufferedReader ( new InputStreamReader ( System . in ) ) , new PrintWriter ( System . out ) ) ; else if ( properties . getUi ( ) . equals ( "GUI" ) ) <START_BUG> ui = new GUI ( "Maze<seq2seq4repair_space>3D<seq2seq4repair_space>GAME" , 800 , 400 ) ; <END_BUG> MyModel model = new MyModel ( properties ) ; MyView view = new MyView ( ui ) ; Presenter presenter = new Presenter ( model , view ) ; model . addObserver ( presenter ) ; view . addObserver ( presenter ) ; view . start ( ) ; } }

Fix:
ui = new GUI ( "Maze<seq2seq4repair_space>3D<seq2seq4repair_space>GAME" , 1200 , 700 ) ;
Buggy code:
public class CameraPreview extends CordovaPlugin implements CameraActivity . CameraPreviewListener { private final String TAG = "CameraPreview" ; private final String setOnPictureTakenHandlerAction = "setOnPictureTakenHandler" ; private final String setColorEffectAction = "setColorEffect" ; private final String startCameraAction = "startCamera" ; private final String stopCameraAction = "stopCamera" ; private final String switchCameraAction = "switchCamera" ; private final String takePictureAction = "takePicture" ; private final String showCameraAction = "showCamera" ; private final String hideCameraAction = "hideCamera" ; private CameraActivity fragment ; private CallbackContext takePictureCallbackContext ; private CallbackContext wLogCallbackContext ; private int containerViewId = 1 ; public CameraPreview ( ) { } @ Override public boolean execute ( String action , JSONArray args , CallbackContext callbackContext ) throws JSONException { } private boolean startCamera ( final JSONArray args , CallbackContext callbackContext ) { } private String invertCamera ( String originalCamera ) { } private boolean takePicture ( final JSONArray args , CallbackContext callbackContext ) { } public void onPictureTaken ( String originalPicture ) { JSONArray data = new JSONArray ( ) ; <START_BUG> data . put ( originalPicturePath ) ; <END_BUG> PluginResult pluginResult = new PluginResult ( Status . OK , data ) ; pluginResult . setKeepCallback ( true ) ; takePictureCallbackContext . sendPluginResult ( pluginResult ) ; } private boolean setColorEffect ( final JSONArray args , CallbackContext callbackContext ) { } private boolean stopCamera ( final JSONArray args , CallbackContext callbackContext ) { } private boolean showCamera ( final JSONArray args , CallbackContext callbackContext ) { } private boolean hideCamera ( final JSONArray args , CallbackContext callbackContext ) { } private boolean switchCamera ( final JSONArray args , CallbackContext callbackContext ) { } private boolean setOnPictureTakenHandler ( JSONArray args , CallbackContext callbackContext ) { } }

Fix:
data . put ( originalPicture ) ;
Buggy code:
public class BinaryReader2D { public static short [ ] [ ] readRowRange ( String fname , Range rows , int globalColCount , ByteOrder endianness , boolean divideByShortMax , TransformationFunction function ) { try ( FileChannel fc = ( ( FileChannel ) ( Files . newByteChannel ( Paths . get ( fname ) , StandardOpenOption . READ ) ) ) ) { int dataTypeSize = Short . BYTES ; long pos = ( ( ( long ) ( rows . getStartIndex ( ) ) ) * globalColCount ) * dataTypeSize ; final long extent = ( ( rows . getLength ( ) ) * globalColCount ) * dataTypeSize ; int maps = ( ( int ) ( extent // ( Integer . MAX_VALUE ) ) ) ; <START_BUG> if ( ( extent % ( Integer . MAX_VALUE ) ) > 0 ) <END_BUG> ++ maps ; MappedByteBuffer [ ] mappedByteBuffers = new MappedByteBuffer [ maps ] ; for ( int i = 0 ; i < ( maps - 1 ) ; ++ i ) { mappedByteBuffers [ i ] = fc . map ( FileChannel . MapMode . READ_ONLY , ( pos + ( ( ( long ) ( i ) ) * ( Integer . MAX_VALUE ) ) ) , Integer . MAX_VALUE ) ; mappedByteBuffers [ i ] . order ( endianness ) ; } mappedByteBuffers [ ( maps - 1 ) ] = fc . map ( FileChannel . MapMode . READ_ONLY , ( pos + ( ( ( long ) ( maps - 1 ) ) * ( Integer . MAX_VALUE ) ) ) , ( extent - ( ( maps - 1 ) * ( ( long ) ( Integer . MAX_VALUE ) ) ) ) ) ; mappedByteBuffers [ ( maps - 1 ) ] . order ( endianness ) ; int rowCount = rows . getLength ( ) ; short [ ] [ ] rowBlock = new short [ rowCount ] [ ] ; double tmp ; for ( int i = 0 ; i < rowCount ; ++ i ) { short [ ] rowBlockRow = rowBlock [ i ] = new short [ globalColCount ] ; for ( int j = 0 ; j < globalColCount ; ++ j ) { long procLocalPnum = ( ( ( long ) ( i ) ) * globalColCount ) + j ; long procLocalBytePosition = procLocalPnum * dataTypeSize ; int bufferIdx = ( ( int ) ( procLocalBytePosition // ( Integer . MAX_VALUE ) ) ) ; int bufferLocalBytePosition = ( ( int ) ( procLocalBytePosition % ( Integer . MAX_VALUE ) ) ) ; tmp = ( mappedByteBuffers [ bufferIdx ] . getShort ( bufferLocalBytePosition ) ) * ( divideByShortMax ? 1.0 // ( Short . MAX_VALUE ) : 1.0 ) ; assert ( tmp == ( - 1.0 ) ) || ( ( tmp >= 0.0 ) && ( tmp <= 1.0 ) ) ; if ( function != null ) { tmp = function . transform ( tmp ) ; } rowBlockRow [ j ] = ( ( short ) ( tmp * ( Short . MAX_VALUE ) ) ) ; } } return rowBlock ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return null ; } public static short [ ] [ ] readConstant ( Range rows , int globalColCount , double w ) { } }

Fix:
if ( ( extent % ( Integer . MAX_VALUE ) ) >= 0 )
Buggy code:
public class CompoundPropertyModel extends AbstractPropertyModel { private static final long serialVersionUID = - 3136339624173288385L ; public CompoundPropertyModel ( final Object model ) { } protected String ognlExpression ( final Component component ) { <START_BUG> return component . getName ( ) ; <END_BUG> } protected Class propertyType ( final Component component ) { } }

Fix:
return component . getId ( ) ;
Buggy code:
public class GaussNewtonOptimizer extends AbstractLeastSquaresOptimizer { private final boolean useLU ; public GaussNewtonOptimizer ( final boolean useLU ) { } @ Override public VectorialPointValuePair doOptimize ( ) throws IllegalArgumentException , FunctionEvaluationException , OptimizationException { VectorialPointValuePair current = null ; for ( boolean converged = false ; ! converged ; ) { incrementIterationsCounter ( ) ; VectorialPointValuePair previous = current ; updateResidualsAndCost ( ) ; updateJacobian ( ) ; current = new VectorialPointValuePair ( point , objective ) ; final double [ ] b = new double [ cols ] ; final double [ ] [ ] a = new double [ cols ] [ cols ] ; for ( int i = 0 ; i < ( rows ) ; ++ i ) { <START_BUG> final double [ ] grad = jacobian [ i ] ; <END_BUG> final double weight = residualsWeights [ i ] ; final double residual = ( objective [ i ] ) - ( targetValues [ i ] ) ; final double wr = weight * residual ; for ( int j = 0 ; j < ( cols ) ; ++ j ) { b [ j ] += wr * ( grad [ j ] ) ; } for ( int k = 0 ; k < ( cols ) ; ++ k ) { double [ ] ak = a [ k ] ; double wgk = weight * ( grad [ k ] ) ; for ( int l = 0 ; l < ( cols ) ; ++ l ) { ak [ l ] += wgk * ( grad [ l ] ) ; } } } try { RealMatrix mA = new BlockRealMatrix ( a ) ; DecompositionSolver solver = ( useLU ) ? new org . apache . commons . math . linear . LUDecompositionImpl ( mA ) . getSolver ( ) : new org . apache . commons . math . linear . QRDecompositionImpl ( mA ) . getSolver ( ) ; final double [ ] dX = solver . solve ( b ) ; for ( int i = 0 ; i < ( cols ) ; ++ i ) { point [ i ] += dX [ i ] ; } } catch ( InvalidMatrixException e ) { throw new OptimizationException ( LocalizedFormats . UNABLE_TO_SOLVE_SINGULAR_PROBLEM ) ; } if ( previous != null ) { converged = checker . converged ( getIterations ( ) , previous , current ) ; } } return current ; } }

Fix:
final double [ ] grad = weightedResidualJacobian [ i ] ;
Buggy code:
public class RecoveryManager2Test extends CleanupHelper { @ Test public void testWithFlush ( ) throws IOException , InterruptedException , ExecutionException { } private void insertRow ( String key ) throws IOException { <START_BUG> RowMutation rm = new RowMutation ( "Keyspace1" , key ) ; <END_BUG> ColumnFamily cf = ColumnFamily . create ( "Keyspace1" , "Standard1" ) ; cf . addColumn ( Util . column ( "col1" , "val1" , 1L ) ) ; rm . add ( cf ) ; rm . apply ( ) ; } }

Fix:
RowMutation rm = new RowMutation ( "Keyspace1" , key . getBytes ( ) ) ;
Buggy code:
public class SelectionOnQualifiedAllocationExpression extends QualifiedAllocationExpression { public SelectionOnQualifiedAllocationExpression ( ) { } public SelectionOnQualifiedAllocationExpression ( TypeDeclaration anonymous ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { super . resolveType ( scope ) ; if ( ( ( binding ) == null ) || ( ! ( ( binding . isValidBinding ( ) ) || ( ( binding . problemId ( ) ) == ( ProblemReasons . NotVisible ) ) ) ) ) throw new SelectionNodeFound ( ) ; if ( ( anonymousType ) == null ) throw new SelectionNodeFound ( binding ) ; if ( ( anonymousType . binding . superInterfaces ) == ( NoSuperInterfaces ) ) { <START_BUG> ConstructorDeclaration constructor = ( ( ConstructorDeclaration ) ( anonymousType . declarationOf ( binding ) ) ) ; <END_BUG> throw new SelectionNodeFound ( constructor . constructorCall . binding ) ; } else { throw new SelectionNodeFound ( anonymousType . binding . superInterfaces [ 0 ] ) ; } } }

Fix:
ConstructorDeclaration constructor = ( ( ConstructorDeclaration ) ( anonymousType . declarationOf ( binding . original ( ) ) ) ) ;
Buggy code:
public class LocalVariable extends SourceRefElement implements ILocalVariable { String name ; public int declarationSourceStart ; public int declarationSourceEnd ; public int nameStart ; public int nameEnd ; String typeSignature ; public IAnnotation [ ] annotations ; public LocalVariable ( JavaElement parent , String name , int declarationSourceStart , int declarationSourceEnd , int nameStart , int nameEnd , String typeSignature , Annotation [ ] astAnnotations ) { } protected void closing ( Object info ) { } protected Object createElementInfo ( ) { } public boolean equals ( Object o ) { } public boolean exists ( ) { } protected void generateInfos ( Object info , HashMap newElements , IProgressMonitor pm ) { } public IAnnotation getAnnotation ( String annotationName ) { } public IAnnotation [ ] getAnnotations ( ) throws JavaModelException { } private IAnnotation [ ] getAnnotations ( Annotation [ ] astAnnotations ) { } private IAnnotation getAnnotation ( final Annotation annotation , JavaElement parentElement ) { } private Object getAnnotationMemberValue ( MemberValuePair memberValuePair , Expression expression , JavaElement parentElement ) { } public IJavaElement getHandleFromMemento ( String token , MementoTokenizer memento , WorkingCopyOwner owner ) { } protected void getHandleMemento ( StringBuffer buff ) { ( ( JavaElement ) ( getParent ( ) ) ) . getHandleMemento ( buff ) ; buff . append ( getHandleMementoDelimiter ( ) ) ; buff . append ( this . name ) ; buff . append ( JavaElement . JEM_COUNT ) ; buff . append ( this . declarationSourceStart ) ; buff . append ( JavaElement . JEM_COUNT ) ; buff . append ( this . declarationSourceEnd ) ; buff . append ( JavaElement . JEM_COUNT ) ; buff . append ( this . nameStart ) ; buff . append ( JavaElement . JEM_COUNT ) ; buff . append ( this . nameEnd ) ; buff . append ( JavaElement . JEM_COUNT ) ; <START_BUG> buff . append ( this . typeSignature ) ; <END_BUG> if ( ( this . occurrenceCount ) > 1 ) { buff . append ( JavaElement . JEM_COUNT ) ; buff . append ( this . occurrenceCount ) ; } } protected char getHandleMementoDelimiter ( ) { } public IResource getCorrespondingResource ( ) { } public String getElementName ( ) { } public int getElementType ( ) { } public ISourceRange getNameRange ( ) { } public IPath getPath ( ) { } public IResource resource ( ) { } public String getSource ( ) throws JavaModelException { } public ISourceRange getSourceRange ( ) { } public String getTypeSignature ( ) { } public IResource getUnderlyingResource ( ) throws JavaModelException { } public int hashCode ( ) { } public boolean isStructureKnown ( ) throws JavaModelException { } protected void toStringInfo ( int tab , StringBuffer buffer , Object info , boolean showResolvedInfo ) { } }

Fix:
escapeMementoName ( buff , this . typeSignature ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class SarTestCase { @ Deployment ( testable = false ) public static JavaArchive createDeployment ( ) throws Exception { } @ Test public void testMBean ( ) throws Exception { ModelControllerClient client = Factory . create ( InetAddress . getByName ( "127.0.0.1" ) , 9999 , getCallbackHandler ( ) ) ; try { <START_BUG> MBeanServerConnection mbeanServer = JMXConnectorFactory . connect ( new JMXServiceURL ( "service:jmx:remote:////127.0.0.1:9999" ) ) . getMBeanServerConnection ( ) ; <END_BUG> ObjectName objectName = new ObjectName ( "jboss:name=test,type=config" ) ; PollingUtils . retryWithTimeout ( 10000 , new PollingUtils . WaitForMBeanTask ( mbeanServer , objectName ) ) ; mbeanServer . getAttribute ( objectName , "IntervalSeconds" ) ; mbeanServer . setAttribute ( objectName , new Attribute ( "IntervalSeconds" , 2 ) ) ; } finally { if ( client != null ) try { client . close ( ) ; } catch ( IOException e ) { } } } }

Fix:
MBeanServerConnection mbeanServer = JMXConnectorFactory . connect ( new JMXServiceURL ( "service:jmx:remoting-jmx:////127.0.0.1:9999" ) ) . getMBeanServerConnection ( ) ;
Buggy code:
public class ODLManagerMultiImpl implements DataChangeListenerRegistrationHolder , ODLManager { protected static final Logger LOG = LoggerFactory . getLogger ( ODLManagerMultiImpl . class ) ; private NotificationService notificationService ; private PacketProcessingService packetProcessingService ; private DataBroker data ; private Registration packetInRegistration ; private ListenerRegistration < DataChangeListener > dataChangeListenerRegistration ; BackendChannel channel ; @ Override public void setNotificationService ( NotificationService notificationService ) { } @ Override public void setPacketProcessingService ( PacketProcessingService packetProcessingService ) { } public PacketProcessingService getPacketProcessingService ( ) { } @ Override public void setDataBroker ( DataBroker data ) { } @ Override public void start ( ) { ODLManagerMultiImpl . LOG . debug ( "start()<seq2seq4repair_space>-->" ) ; System . out . println ( "ODL<seq2seq4repair_space>multi<seq2seq4repair_space>manager<seq2seq4repair_space>starting" ) ; FlowCommitWrapper dataStoreAccessor = new FlowCommitWrapperImpl ( data ) ; PacketInDispatcherImpl packetInDispatcher = new PacketInDispatcherImpl ( ) ; packetInDispatcher . setMultiManager ( this ) ; MultipleODLHandlerFacadeImpl odlHandler = new MultipleODLHandlerFacadeImpl ( ) ; odlHandler . setRegistrationPublisher ( this ) ; odlHandler . setDataStoreAccessor ( dataStoreAccessor ) ; odlHandler . setPacketProcessingService ( packetProcessingService ) ; odlHandler . setPacketInDispatcher ( packetInDispatcher ) ; odlHandler . setBackendChannel ( channel ) ; packetInRegistration = notificationService . registerNotificationListener ( packetInDispatcher ) ; channel . setHandler ( odlHandler ) ; WakeupOnNode wakeupListener = new WakeupOnNode ( ) ; wakeupListener . setODLHandler ( odlHandler ) ; wakeupListener . setPacketInDispatcher ( packetInDispatcher ) ; <START_BUG> dataChangeListenerRegistration = data . registerDataChangeListener ( OPERATIONAL , InstanceIdentifier . builder ( Nodes . class ) . child ( Node . class ) . augmentation ( FlowCapableNode . class ) . child ( Table . class ) . toInstance ( ) , wakeupListener , SUBTREE ) ; <END_BUG> NodeConnectorListener nodeListener = new NodeConnectorListener ( this . data ) ; nodeListener . setBackendChannel ( channel ) ; ODLManagerMultiImpl . LOG . debug ( "start()<seq2seq4repair_space><--" ) ; } @ Override public void stop ( ) { } @ Override public ListenerRegistration < DataChangeListener > getDataChangeListenerRegistration ( ) { } @ Override public void setBackendChannel ( BackendChannel channel ) { } }

Fix:
dataChangeListenerRegistration = data . registerDataChangeListener ( OPERATIONAL , InstanceIdentifier . builder ( Nodes . class ) . child ( Node . class ) . augmentation ( FlowCapableNode . class ) . child ( Table . class ) . build ( ) , wakeupListener , SUBTREE ) ;
Buggy code:
public class NewInstance extends AbstractVisitable implements SelectItem , Visitable { private final Class _cls ; private List < SelectItem > _args ; NewInstance ( Class cls , SelectItem ... args ) { } public OrderByItem asc ( ) { } public OrderByItem desc ( ) { } public String asProjection ( AliasContext ctx ) { <START_BUG> StringBuffer tmp = new StringBuffer ( "NEW<seq2seq4repair_space>" ) . append ( _cls . getName ( ) ) . append ( "(" ) ; <END_BUG> if ( ( ( _args ) == null ) || ( _args . isEmpty ( ) ) ) return tmp . append ( ")" ) . toString ( ) ; int i = 0 ; int N = _args . size ( ) ; for ( SelectItem arg : _args ) { i ++ ; tmp . append ( ( ( Visitable ) ( arg ) ) . asProjection ( ctx ) ) . append ( ( i == N ? ")" : "," ) ) ; } return tmp . toString ( ) ; } }

Fix:
StringBuilder tmp = new StringBuilder ( "NEW<seq2seq4repair_space>" ) . append ( _cls . getName ( ) ) . append ( "(" ) ;
Buggy code:
public class ChatRoomManagerUI implements IChatRoomCommandListener { public static final String ROOM_DELIMITER = "," ; protected IContainer container ; protected IChatRoomManager manager ; private boolean isContainerConnected = false ; private boolean viewAlreadyActive = false ; protected IExceptionHandler exceptionHandler = null ; protected ChatRoomManagerView chatroomview = null ; protected ID targetID = null ; protected String [ ] channels = null ; public ChatRoomManagerUI ( IContainer container , IChatRoomManager manager ) { } public ChatRoomManagerUI ( IContainer container , IChatRoomManager manager , IExceptionHandler exceptionHandler ) { } public ID getTargetID ( ) { } public String handleCommand ( IChatRoomContainer chatRoomContainer , String inputLine ) { } protected IChatRoomViewCloseListener createChatRoomViewCloseListener ( ) { return new IChatRoomViewCloseListener ( ) { public void chatRoomViewClosing ( ) { <START_BUG> container . dispose ( ) ; <END_BUG> } } ; } private void setupNewView ( ) throws Exception { } protected IMessageRenderer getDefaultMessageRenderer ( ) { } protected String getPasswordForChatRoomConnect ( IChatRoomInfo info ) { } public void showForTarget ( final ID targetID ) { } public boolean isContainerConnected ( ) { } protected String getSecondaryViewID ( ID targetID ) { } protected ChatRoomManagerView getChatRoomManagerView ( ) throws PartInitException { } protected String modifyRoomNameForTarget ( String roomName ) { } protected String [ ] getRoomsForTarget ( ) { } }

Fix:
container . disconnect ( ) ;
Buggy code:
public class Diff { int sizex = 0 ; int sizey = 0 ; int [ ] [ ] net ; int [ ] [ ] way ; int INSERT ; int DELETE ; int REPLACE ; int NOOP ; public Diff ( ) { } public Diff ( int ins , int del , int rep , int noop ) { } public static void apply ( StringBuilder dest , CharSequence diff ) { } public synchronized String exec ( String a , String b ) { if ( ( a == null ) || ( b == null ) ) { return null ; } int x ; int y ; int maxx ; int maxy ; int [ ] go = new int [ 4 ] ; final int X = 1 ; final int Y = 2 ; final int R = 3 ; final int D = 0 ; maxx = ( a . length ( ) ) + 1 ; maxy = ( b . length ( ) ) + 1 ; if ( ( maxx >= ( sizex ) ) || ( maxy >= ( sizey ) ) ) { sizex = maxx + 8 ; sizey = maxy + 8 ; net = new int [ sizex ] [ sizey ] ; way = new int [ sizex ] [ sizey ] ; } for ( x = 0 ; x < maxx ; x ++ ) { for ( y = 0 ; y < maxy ; y ++ ) { net [ x ] [ y ] = 0 ; } } for ( x = 1 ; x < maxx ; x ++ ) { net [ x ] [ 0 ] = x ; way [ x ] [ 0 ] = X ; } for ( y = 1 ; y < maxy ; y ++ ) { net [ 0 ] [ y ] = y ; way [ 0 ] [ y ] = Y ; } for ( x = 1 ; x < maxx ; x ++ ) { for ( y = 1 ; y < maxy ; y ++ ) { go [ X ] = ( net [ ( x - 1 ) ] [ y ] ) + ( DELETE ) ; go [ Y ] = ( net [ x ] [ ( y - 1 ) ] ) + ( INSERT ) ; go [ R ] = ( net [ ( x - 1 ) ] [ ( y - 1 ) ] ) + ( REPLACE ) ; go [ D ] = ( net [ ( x - 1 ) ] [ ( y - 1 ) ] ) + ( ( a . charAt ( ( x - 1 ) ) ) == ( b . charAt ( ( y - 1 ) ) ) ? NOOP : 100 ) ; short min = D ; if ( ( go [ min ] ) >= ( go [ X ] ) ) { min = X ; } if ( ( go [ min ] ) > ( go [ Y ] ) ) { min = Y ; } if ( ( go [ min ] ) > ( go [ R ] ) ) { min = R ; } way [ x ] [ y ] = min ; net [ x ] [ y ] = ( ( short ) ( go [ min ] ) ) ; } } <START_BUG> StringBuffer result = new StringBuffer ( ) ; <END_BUG> final char base = 'a' - 1 ; char deletes = base ; char equals = base ; for ( x = maxx - 1 , y = maxy - 1 ; ( x + y ) != 0 ; ) { switch ( way [ x ] [ y ] ) { case X : if ( equals != base ) { result . append ( ( "-" + equals ) ) ; equals = base ; } deletes ++ ; x -- ; break ; case Y : if ( deletes != base ) { result . append ( ( "D" + deletes ) ) ; deletes = base ; } if ( equals != base ) { result . append ( ( "-" + equals ) ) ; equals = base ; } result . append ( 'I' ) ; result . append ( b . charAt ( ( -- y ) ) ) ; break ; case R : if ( deletes != base ) { result . append ( ( "D" + deletes ) ) ; deletes = base ; } if ( equals != base ) { result . append ( ( "-" + equals ) ) ; equals = base ; } result . append ( 'R' ) ; result . append ( b . charAt ( ( -- y ) ) ) ; x -- ; break ; case D : if ( deletes != base ) { result . append ( ( "D" + deletes ) ) ; deletes = base ; } equals ++ ; x -- ; y -- ; break ; } } if ( deletes != base ) { result . append ( ( "D" + deletes ) ) ; deletes = base ; } return result . toString ( ) ; } }

Fix:
StringBuilder result = new StringBuilder ( ) ;
Buggy code:
public class MinerPathfinder extends BasicPathfinder { private RobotMiner robot ; private int currentHeight ; private int blockIterator ; private int stairIterator ; private Location previus ; public MinerPathfinder ( RobotMiner robot ) { } @ Override public boolean shouldStart ( ) { } @ Override public void onStart ( ) { } @ Override public void updateTask ( ) { if ( robot . onDelay ( ) ) return ; if ( ( blockIterator ) == 0 ) { ( currentHeight ) -- ; ( stairIterator ) ++ ; } if ( ( stairIterator ) == 9 ) stairIterator = 1 ; if ( ( currentHeight ) == 1 ) { robot . setMining ( false ) ; } ( blockIterator ) ++ ; Location mine = robot . getStartBlock ( ) . clone ( ) ; mine . setY ( currentHeight ) ; Location check = mine . clone ( ) ; try { robot . setTargetLocation ( previus ) ; } catch ( Exception e ) { robot . setMining ( false ) ; } switch ( blockIterator ) { case 1 : if ( ( stairIterator ) != 1 ) mine . add ( 0 , 0 , 0 ) ; break ; case 2 : if ( ( stairIterator ) != 2 ) mine . add ( 1 , 0 , 0 ) ; break ; case 3 : if ( ( stairIterator ) != 3 ) mine . add ( 2 , 0 , 0 ) ; break ; case 4 : if ( ( stairIterator ) != 8 ) mine . add ( 0 , 0 , 1 ) ; break ; case 5 : mine . add ( 1 , 0 , 1 ) ; break ; case 6 : if ( ( stairIterator ) != 4 ) mine . add ( 2 , 0 , 1 ) ; break ; case 7 : if ( ( stairIterator ) != 7 ) mine . add ( 0 , 0 , 2 ) ; break ; case 8 : if ( ( stairIterator ) != 6 ) mine . add ( 1 , 0 , 2 ) ; break ; case 9 : if ( ( stairIterator ) != 5 ) mine . add ( 2 , 0 , 2 ) ; blockIterator = 0 ; break ; } if ( ( mine . getBlock ( ) . getType ( ) ) == ( Material . BEDROCK ) ) { robot . setMining ( false ) ; return ; } previus = mine ; if ( ( ( ( ( mine . getBlockX ( ) ) == ( check . getBlockX ( ) ) ) && ( ( mine . getBlockY ( ) ) == ( check . getBlockY ( ) ) ) ) && ( ( mine . getBlockZ ( ) ) == ( check . getBlockZ ( ) ) ) ) && ( ( stairIterator ) == 1 ) ) return ; <START_BUG> robot . mineBlock ( mine ) ; <END_BUG> } }

Fix:
robot . mineBlock ( mine , robot . isEasterEgg ( ) ) ;
Buggy code:
public class Group extends Composite { int clientHandle ; int labelHandle ; String text = "" ; public Group ( Composite parent , int style ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } int clientHandle ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } void createHandle ( int index ) { } void deregister ( ) { } void enableWidget ( boolean enabled ) { } int eventHandle ( ) { } String getNameText ( ) { } public String getText ( ) { } void hookEvents ( ) { } boolean mnemonicHit ( char key ) { } boolean mnemonicMatch ( char key ) { } int parentingHandle ( ) { } void register ( ) { } void releaseHandle ( ) { } void releaseWidget ( ) { } void setBackgroundColor ( GdkColor color ) { } void setFontDescription ( int font ) { } void setForegroundColor ( GdkColor color ) { super . setForegroundColor ( color ) ; <START_BUG> OS . gtk_widget_modify_fg ( labelHandle , GTK_STATE_NORMAL , color ) ; <END_BUG> } void setOrientation ( ) { } public void setText ( String string ) { } void showWidget ( ) { } }

Fix:
setForegroundColor ( labelHandle , color ) ;
Buggy code:
public class ReplyKeyboardMarkup implements JSONString { public String [ ] [ ] keyboard ; public boolean resizeKeyboard ; public boolean oneTimeKeyboard ; public boolean selective ; public ReplyKeyboardMarkup ( String [ ] [ ] keyboard , boolean resizeKeyboard , boolean oneTimeKeyboard , boolean selective ) { } public ReplyKeyboardMarkup ( String [ ] [ ] keyboard ) { } @ Override public String toJSONString ( ) { JSONArray keyboard = new JSONArray ( this . keyboard ) ; JSONObject object = new JSONObject ( ) ; <START_BUG> object . append ( "keyboard" , keyboard ) ; <END_BUG> if ( resizeKeyboard ) { object . put ( "resize_keyboard" , true ) ; } if ( oneTimeKeyboard ) { object . put ( "one_time_keyboard" , true ) ; } if ( selective ) { object . put ( "selective" , true ) ; } return object . toString ( ) ; } }

Fix:
object . put ( "keyboard" , keyboard ) ;
Buggy code:
public class SnapShooter { private static final Logger LOG = LoggerFactory . getLogger ( SnapShooter . class . getName ( ) ) ; private String snapDir = null ; private SolrCore solrCore ; private SimpleFSLockFactory lockFactory ; public SnapShooter ( SolrCore core , String location ) throws IOException { } void createSnapAsync ( final IndexCommit indexCommit , final ReplicationHandler replicationHandler ) { } void createSnapAsync ( final IndexCommit indexCommit , final int numberToKeep , final ReplicationHandler replicationHandler ) { } void createSnapshot ( final IndexCommit indexCommit , int numberToKeep , ReplicationHandler replicationHandler ) { } private void deleteOldBackups ( int numberToKeep ) { File [ ] files = new File ( snapDir ) . listFiles ( ) ; List < SnapShooter . OldBackupDirectory > dirs = new ArrayList < SnapShooter . OldBackupDirectory > ( ) ; for ( File f : files ) { SnapShooter . OldBackupDirectory obd = new SnapShooter . OldBackupDirectory ( f ) ; if ( ( obd . dir ) != null ) { dirs . add ( obd ) ; } } Collections . sort ( dirs ) ; int i = 1 ; for ( SnapShooter . OldBackupDirectory dir : dirs ) { <START_BUG> if ( i > ( numberToKeep - 1 ) ) { <END_BUG> SnapPuller . delTree ( dir . dir ) ; } } } private class OldBackupDirectory implements Comparable < SnapShooter . OldBackupDirectory > { File dir ; Date timestamp ; final Pattern dirNamePattern = Pattern . compile ( "^snapshot[.](.*)$" ) ; OldBackupDirectory ( File dir ) { } public int compareTo ( SnapShooter . OldBackupDirectory that ) { } } public static final String SNAP_DIR = "snapDir" ; public static final String DATE_FMT = "yyyyMMddHHmmss" ; private class FileCopier { private static final int DEFAULT_BUFFER_SIZE = 32768 ; private byte [ ] buffer = new byte [ SnapShooter . FileCopier . DEFAULT_BUFFER_SIZE ] ; private IndexCommit indexCommit ; private IndexDeletionPolicyWrapper delPolicy ; public FileCopier ( IndexDeletionPolicyWrapper delPolicy , IndexCommit commit ) { } public void copyFiles ( Collection < String > files , File destDir ) throws IOException { } public void copyFile ( File source , File destination , boolean preserveFileDate ) throws IOException { } } }

Fix:
if ( ( i ++ ) > ( numberToKeep - 1 ) ) {
Buggy code:
public class Tray extends Widget { int itemCount ; TrayItem [ ] items = new TrayItem [ 4 ] ; Tray ( Display display , int style ) { } void createItem ( TrayItem item , int index ) { } void destroyItem ( TrayItem item ) { } public TrayItem getItem ( int index ) { } public int getItemCount ( ) { } public TrayItem [ ] getItems ( ) { } void releaseChildren ( boolean destroy ) { if ( ( items ) != null ) { for ( int i = 0 ; i < ( items . length ) ; i ++ ) { TrayItem item = items [ i ] ; if ( ( item != null ) && ( ! ( item . isDisposed ( ) ) ) ) { <START_BUG> item . releaseChildren ( false ) ; <END_BUG> } } items = null ; } super . releaseChildren ( destroy ) ; } void releaseParent ( ) { } }

Fix:
item . release ( false ) ;