nus-yam/ex-repair huggingface dataset:
Buggy code:
public class SMTPServer { protected SMTPProtocol smtpProtocol ; protected AccountItem accountItem ; protected IdentityItem identityItem ; protected String fromAddress ; protected Object observer ; public SMTPServer ( AccountItem accountItem ) { } public boolean openConnection ( ) { } public void closeConnection ( ) { } protected void pop3Authentification ( ) throws Exception { String password = new String ( "" ) ; String method = new String ( "" ) ; boolean save = false ; boolean login = false ; boolean cancel = false ; PopItem item = accountItem . getPopItem ( ) ; PasswordDialog dialog = null ; while ( ( ! login ) && ( ! cancel ) ) { if ( ( item . get ( "password" ) . length ( ) ) == 0 ) { dialog = new PasswordDialog ( ) ; dialog . showDialog ( accountItem . getPopItem ( ) . get ( "user" ) , accountItem . getPopItem ( ) . get ( "host" ) , password , accountItem . getPopItem ( ) . getBoolean ( "save_password" ) ) ; char [ ] name ; if ( dialog . success ( ) ) { name = dialog . getPassword ( ) ; password = new String ( name ) ; save = dialog . getSave ( ) ; cancel = false ; } else { cancel = true ; } } else { password = item . get ( "password" ) ; save = item . getBoolean ( "save_password" ) ; } if ( ! cancel ) { <START_BUG> POP3Protocol pop3Connection = new POP3Protocol ( ) ; <END_BUG> pop3Connection . openPort ( ) ; pop3Connection . setLoginMethod ( method ) ; login = pop3Connection . login ( item . get ( "user" ) , password ) ; if ( ! login ) { NotifyDialog d = new NotifyDialog ( ) ; d . showDialog ( "Authentification<seq2seq4repair_space>failed" ) ; item . set ( "password" , "" ) ; } } } if ( login ) { item . set ( "save_password" , save ) ; item . set ( "login_method" , method ) ; if ( save ) { item . set ( "password" , password ) ; } } } public void sendMessage ( SendableMessage message , WorkerStatusController workerStatusController ) throws Exception { } public StatusObservable getObservable ( ) { } public void setObservable ( ProgressObserver observable ) { } }

Fix:
POP3Protocol pop3Connection = new POP3Protocol ( accountItem . getPopItem ( ) . get ( "host" ) , accountItem . getPopItem ( ) . getInteger ( "port" ) ) ;
Buggy code:
public class ClusterConnectionAdd extends AbstractAddStepHandler { public static final ClusterConnectionAdd INSTANCE = new ClusterConnectionAdd ( ) ; private ClusterConnectionAdd ( ) { } @ Override protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { model . setEmptyObject ( ) ; <START_BUG> AlternativeAttributeCheckHandler . checkAlternatives ( operation , ClusterConnectionDefinition . CONNECTOR_REFS . getName ( ) , ClusterConnectionDefinition . DISCOVERY_GROUP_NAME . getName ( ) ) ; <END_BUG> for ( final AttributeDefinition attributeDefinition : ClusterConnectionDefinition . ATTRIBUTES ) { attributeDefinition . validateAndSet ( operation , model ) ; } } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { } static void addClusterConnectionConfigs ( final OperationContext context , final Configuration configuration , final ModelNode model ) throws OperationFailedException { } static ClusterConnectionConfiguration createClusterConnectionConfiguration ( final OperationContext context , final String name , final ModelNode model ) throws OperationFailedException { } private static List < String > getStaticConnectors ( ModelNode model ) { } }

Fix:
AlternativeAttributeCheckHandler . checkAlternatives ( operation , ClusterConnectionDefinition . CONNECTOR_REFS . getName ( ) , ClusterConnectionDefinition . DISCOVERY_GROUP_NAME . getName ( ) , true ) ;
Buggy code:
public class AccountWizardLauncher { public AccountWizardLauncher ( ) { } public void launchWizard ( ) { DataModel data = new DataModel ( ) ; Step [ ] steps ; if ( ( MailConfig . getAccountList ( ) . count ( ) ) == 0 ) { steps = new Step [ ] { new WelcomeStep ( ) , new IdentityStep ( data ) , new IncomingServerStep ( data ) , new OutgoingServerStep ( data , false ) , new FinishStep ( ) } ; } else { steps = new Step [ ] { new IdentityStep ( data ) , new IncomingServerStep ( data ) , new OutgoingServerStep ( data , true ) } ; } WizardModel model = new net . javaprog . ui . wizard . DefaultWizardModel ( steps ) ; model . addWizardModelListener ( new AccountCreator ( data ) ) ; <START_BUG> Wizard wizard = new Wizard ( model , MailResourceLoader . getString ( "dialog" , "accountwizard" , "title" ) , ImageLoader . getSmallImageIcon ( "stock_preferences.png" ) ) ; <END_BUG> CSH . setHelpIDString ( wizard , "getting_started_1" ) ; JavaHelpSupport . enableHelp ( wizard , HelpManager . getHelpBroker ( ) ) ; wizard . pack ( ) ; wizard . setLocationRelativeTo ( null ) ; wizard . setVisible ( true ) ; } }

Fix:
Wizard wizard = new Wizard ( model , MailResourceLoader . getString ( "dialog" , "accountwizard" , "title" ) , ImageLoader . getSmallImageIcon ( "stock_preferences-32.png" ) ) ;
Buggy code:
public class SensorData implements Data { DataModel model ; private float playbackSpeed = 1.0F ; private long offset = 0 ; DataSet [ ] data ; String source = "" ; SensorDataVisualization vis ; public SensorData ( DataModel model , int length , String src ) { } public void setDataAt ( int pos , DataSet s ) { } public void setOffset ( long o ) { } public void setPlaybackSpeed ( float p ) { } public long getOffset ( ) { } public float getPlaybackSpeed ( ) { } public float getTimeAt ( int pos ) { <START_BUG> return data [ pos ] . time ; <END_BUG> } public int getValueAt ( int dimension , int position ) { } public int getNValues ( ) { } public long getLength ( ) { } public Visualization getVisualization ( ) { } public String getSource ( ) { } public void remove ( ) { } public int getDataDimension ( ) { } public static boolean canOpenFile ( String extension ) { } @ Override public DataModel getModel ( ) { } @ Override public void setSource ( String filename ) { } }

Fix:
return ( ( data [ pos ] . time ) * ( playbackSpeed ) ) + ( offset ) ;
Buggy code:
public class PeekingIterator < E > implements Iterator < E > { private final Iterator < ? extends E > iterator ; private boolean exhausted = false ; private boolean slotFilled = false ; private E slot ; public static < E > PeekingIterator < E > peekingIterator ( final Iterator < ? extends E > iterator ) { } public PeekingIterator ( final Iterator < ? extends E > iterator ) { } private void fill ( ) { } public boolean hasNext ( ) { } public E peek ( ) { } public E element ( ) { } public E next ( ) { } public void remove ( ) { if ( slotFilled ) { <START_BUG> throw new IllegalStateException ( ) ; <END_BUG> } iterator . remove ( ) ; } }

Fix:
throw new IllegalStateException ( "peek()<seq2seq4repair_space>or<seq2seq4repair_space>element()<seq2seq4repair_space>called<seq2seq4repair_space>before<seq2seq4repair_space>remove()" ) ;
Buggy code:
public class ModuleDependencyProcessor implements DeploymentUnitProcessor { public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final Manifest manifest = phaseContext . getAttachment ( MANIFEST ) ; if ( manifest == null ) return ; final String dependencyString = manifest . getMainAttributes ( ) . getValue ( "Dependencies" ) ; if ( dependencyString == null ) return ; final String [ ] dependencyDefs = dependencyString . split ( "," ) ; for ( String dependencyDef : dependencyDefs ) { final String [ ] dependencyParts = dependencyDef . split ( "<seq2seq4repair_space>" ) ; final int dependencyPartsLength = dependencyParts . length ; if ( dependencyPartsLength == 0 ) throw new RuntimeException ( ( "Invalid<seq2seq4repair_space>dependency:<seq2seq4repair_space>" + dependencyString ) ) ; final ModuleIdentifier dependencyId = ModuleIdentifier . fromString ( dependencyParts [ 0 ] ) ; boolean export = parseOptionalExportParams ( dependencyParts , "export" ) ; boolean optional = parseOptionalExportParams ( dependencyParts , "optional" ) ; <START_BUG> ModuleDependency dependency = new ModuleDependency ( null , dependencyId , optional , export ) ; <END_BUG> phaseContext . addToAttachmentList ( MODULE_DEPENDENCIES , dependency ) ; } } public void undeploy ( final DeploymentUnit context ) { } private boolean parseOptionalExportParams ( final String [ ] parts , final String expected ) { } }

Fix:
ModuleDependency dependency = new ModuleDependency ( null , dependencyId , optional , export , false ) ;
Buggy code:
public class MainActivity extends AppCompatActivity { public boolean PreviousSession = false ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void MPS ( View view ) { if ( ! ( PreviousSession ) ) { <START_BUG> Intent OpenMPS = new Intent ( this , MathProblemSelector . class ) ; <END_BUG> startActivity ( OpenMPS ) ; } else { System . out . println ( "Something<seq2seq4repair_space>when<seq2seq4repair_space>terribly<seq2seq4repair_space>wrong<seq2seq4repair_space>at<seq2seq4repair_space>line:<seq2seq4repair_space>45" ) ; } } public void NotWorking ( View view ) { } }

Fix:
Intent OpenMPS = new Intent ( this , BasicsPractice . class ) ;
Buggy code:
public class SSQArrive implements Event < SingleServerQueue > { @ Override public final void invoke ( SingleServerQueue simulation ) { double time = simulation . getTime ( ) ; double newIATime = simulation . getRand ( ) ; simulation . schedule ( new SSQArrive ( ) , ( time + newIATime ) ) ; simulation . setLength ( ( ( simulation . getLength ( ) ) + 1 ) ) ; if ( ( simulation . getLength ( ) ) == 1 ) { simulation . schedule ( new SSQDepart ( ) , ( time + ( SingleServerQueue . SERVICETIME ) ) ) ; } <START_BUG> System . out . println ( ( ( ( "Arrival<seq2seq4repair_space>at:<seq2seq4repair_space>" + time ) + ",<seq2seq4repair_space>new<seq2seq4repair_space>population<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( simulation . getLength ( ) ) ) ) ; <END_BUG> } }

Fix:
System . out . println ( ( ( ( "Arrival<seq2seq4repair_space>at<seq2seq4repair_space>" + time ) + ",<seq2seq4repair_space>new<seq2seq4repair_space>population<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( simulation . getLength ( ) ) ) ) ;
Buggy code:
public class LoginViewOhmageImpl extends Composite implements LoginView { @ UiTemplate ( "LoginViewOhmage.ui.xml" ) interface LoginBoxViewUiBinder extends UiBinder < Widget , LoginViewOhmageImpl > { } private static LoginViewOhmageImpl . LoginBoxViewUiBinder uiBinder = GWT . create ( LoginViewOhmageImpl . LoginBoxViewUiBinder . class ) ; @ UiField TextBox userNameTextBox ; @ UiField PasswordTextBox passwordTextBox ; @ UiField Button loginButton ; @ UiField Image logo ; @ UiField UListElement linkList ; @ UiField HTMLPanel linkListDiv ; @ UiField HTMLPanel descriptionPanel ; private Presenter presenter ; public LoginViewOhmageImpl ( ) { } private void initEventHandlers ( ) { } private void submit ( ) { } public void setPresenter ( Presenter presenter ) { } @ Override public void setLoginFailed ( String msg ) { <START_BUG> ErrorDialog . show ( "Login<seq2seq4repair_space>failed." , msg ) ; <END_BUG> } @ Override public String getUsername ( ) { } @ Override public String getPassword ( ) { } @ Override public void disableLoginForm ( ) { } @ Override public void enableLoginForm ( ) { } @ Override public void showError ( String errorMsg ) { } }

Fix:
ErrorDialog . show ( "Invalid<seq2seq4repair_space>username<seq2seq4repair_space>or<seq2seq4repair_space>password" , msg ) ;
Buggy code:
public class SpriteSheet { private BufferedImage sheet ; private File file ; private Collection < SpriteClip > clips ; public SpriteSheet ( File src ) throws IOException { } public File getFile ( ) { } public int getWidth ( ) { } public int getHeight ( ) { } public void findClips ( SpriteClipFinder clipFinder , BackgroundFilter filter ) { } public void mergeClips ( Collection < SpriteClip > mergeClips ) { <START_BUG> if ( mergeClips == null ) { <END_BUG> return ; } if ( ( mergeClips . size ( ) ) == 1 ) { SpriteClip selectedClip = mergeClips . iterator ( ) . next ( ) ; Collection < SpriteClip > overlappingSprites = new HashSet ( ) ; overlappingSprites . add ( selectedClip ) ; for ( SpriteClip currentClip : clips ) { if ( ( selectedClip != currentClip ) && ( currentClip . getBoundingBox ( ) . intersects ( selectedClip . getBoundingBox ( ) ) ) ) { overlappingSprites . add ( currentClip ) ; } } if ( ( overlappingSprites . size ( ) ) >= 2 ) { clips . removeAll ( overlappingSprites ) ; SpriteClip newMergedClip = SpriteClip . makeMergedClip ( overlappingSprites ) ; clips . add ( newMergedClip ) ; } } else { clips . removeAll ( mergeClips ) ; SpriteClip newMergedClip = SpriteClip . makeMergedClip ( mergeClips ) ; clips . add ( newMergedClip ) ; } } public void expandBoxesOf ( Collection < SpriteClip > expandClips , SpriteClip . AnchorType rsAnchorType ) { } public Collection < SpriteClip > getClips ( ) { } public BufferedImage getImage ( ) { } }

Fix:
if ( ( mergeClips == null ) || ( ( mergeClips . size ( ) ) == 0 ) ) {
Buggy code:
public class ShengXianServiceAdapter extends BaseAdapter { private List < Product > mList ; private Context mContext ; public ShengXianServiceAdapter ( Context context , List < Product > list ) { } @ Override public int getCount ( ) { } @ Override public Object getItem ( int position ) { } @ Override public long getItemId ( int arg0 ) { } @ Override public View getView ( int position , View convertView , ViewGroup arg2 ) { ShengXianServiceAdapter . ViewHolder holder ; if ( ( mList . size ( ) ) == 0 ) { return convertView ; } if ( convertView == null ) { holder = new ShengXianServiceAdapter . ViewHolder ( ) ; convertView = LayoutInflater . from ( mContext ) . inflate ( item_service , null ) ; holder . imageView = ( ( ImageView ) ( convertView . findViewById ( service_img ) ) ) ; holder . personNum = ( ( TextView ) ( convertView . findViewById ( service_person ) ) ) ; holder . serviceName = ( ( TextView ) ( convertView . findViewById ( service_name ) ) ) ; holder . servicePrice = ( ( TextView ) ( convertView . findViewById ( service_price ) ) ) ; convertView . setTag ( holder ) ; } else { holder = ( ( ShengXianServiceAdapter . ViewHolder ) ( convertView . getTag ( ) ) ) ; } <START_BUG> ImageLoader . getInstance ( ) . displayImage ( mList . get ( position ) . getmImg ( ) , holder . imageView , mHallIconLoaderOptions ) ; <END_BUG> holder . personNum . setText ( ( ( mList . get ( position ) . getmSale ( ) ) + "人购买" ) ) ; holder . serviceName . setText ( mList . get ( position ) . getmName ( ) ) ; holder . servicePrice . setText ( ( "￥" + ( mList . get ( position ) . getmPrice ( ) ) ) ) ; return convertView ; } public List < Product > getmList ( ) { } public void setmList ( List < Product > mList ) { } class ViewHolder { private TextView serviceName ; private ImageView imageView ; private TextView personNum ; private TextView servicePrice ; } }

Fix:
ImageLoader . getInstance ( ) . displayImage ( mList . get ( position ) . getmImg ( ) , holder . imageView , mGridIconLoaderOptions ) ;
Buggy code:
public class ManagementModel extends JPanel { private JTextField cmdText ; private CommandExecutor executor ; public ManagementModel ( ) { } private JTree makeTree ( ) { <START_BUG> ManagementModelNode root = new ManagementModelNode ( "//" , false ) ; <END_BUG> root . explore ( ) ; JTree tree = new CommandBuilderTree ( new DefaultTreeModel ( root ) ) ; tree . getSelectionModel ( ) . setSelectionMode ( TreeSelectionModel . SINGLE_TREE_SELECTION ) ; tree . addTreeExpansionListener ( new ManagementModel . ManagementTreeExpansionListener ( ( ( DefaultTreeModel ) ( tree . getModel ( ) ) ) ) ) ; tree . addTreeSelectionListener ( new ManagementModel . ManagementTreeSelectionListener ( ) ) ; tree . addMouseListener ( new ManagementModel . ManagementTreeMouseListener ( tree ) ) ; return tree ; } private class ManagementTreeExpansionListener implements TreeExpansionListener { private DefaultTreeModel treeModel ; public ManagementTreeExpansionListener ( DefaultTreeModel treeModel ) { } public void treeCollapsed ( TreeExpansionEvent tee ) { } public void treeExpanded ( TreeExpansionEvent tee ) { } } private class ManagementTreeSelectionListener implements TreeSelectionListener { public void valueChanged ( TreeSelectionEvent tse ) { } } private class ManagementTreeMouseListener extends MouseAdapter { private JTree tree ; private OperationMenu popup ; public ManagementTreeMouseListener ( JTree tree ) { } @ Override public void mouseReleased ( MouseEvent e ) { } @ Override public void mousePressed ( MouseEvent e ) { } private void showPopup ( MouseEvent e ) { } } }

Fix:
ManagementModelNode root = new ManagementModelNode ( ) ;
Buggy code:
@ Stateless public class TokenDAO { @ PersistenceContext private EntityManager em ; public void store ( Token node ) { } public void delete ( Token node ) { } public Token findTokenById ( String id ) { try { <START_BUG> return ( ( Token ) ( em . createQuery ( "SELECT<seq2seq4repair_space>Token<seq2seq4repair_space>FROM<seq2seq4repair_space>Token<seq2seq4repair_space>token<seq2seq4repair_space>WHERE<seq2seq4repair_space>node.uuid<seq2seq4repair_space>=<seq2seq4repair_space>:id" ) . setParameter ( "id" , id ) . getSingleResult ( ) ) ) ; <END_BUG> } catch ( NoResultException e ) { return null ; } } }

Fix:
return ( ( Token ) ( em . createQuery ( "SELECT<seq2seq4repair_space>Token<seq2seq4repair_space>FROM<seq2seq4repair_space>Token<seq2seq4repair_space>token<seq2seq4repair_space>WHERE<seq2seq4repair_space>token.uuid<seq2seq4repair_space>=<seq2seq4repair_space>:id" ) . setParameter ( "id" , id ) . getSingleResult ( ) ) ) ;
Buggy code:
public class Game { private Player player1 ; private Player player2 ; private int currentPlayer = 1 ; private Game . Mark [ ] [ ] board ; private int w ; private int h ; private ArrayList < Move > moveList ; public enum Mark { CIRCLE , CROSS , EMPTY ; public static Game . Mark oppositeMark ( Game . Mark mark ) { } } public enum GameState { CIRCLE_WINNER , CROSS_WINNER , DRAW , ONGOING ; } public Game ( int w , int h ) { } public Player getPlayer1 ( ) { } public Player getPlayer2 ( ) { } public int getWidth ( ) { } public int getHeight ( ) { <START_BUG> return w ; <END_BUG> } public void setPlayers ( Player player1 , Player player2 ) { } public void play ( ) { } public boolean makeMove ( Move move ) { } public boolean undoMove ( Move move ) { } public Game . Mark getMark ( int x , int y ) { } public Game . GameState getCurrentGameState ( ) { } public Move getLastMove ( ) { } public Move getNextToLastMove ( ) { } public void printBoard ( ) { } private void printWinner ( ) { } public void printMoveListAsCode ( ) { } }

Fix:
return h ;
Buggy code:
@ JsonPropertyOrder ( { "webdavWorkDir" } ) public class Settings implements Serializable { private static final long serialVersionUID = 7609959894417878744L ; private static final Logger LOG = LoggerFactory . getLogger ( Settings . class ) ; private static final Path SETTINGS_DIR ; private static final String SETTINGS_FILE = "settings.json" ; private static final ObjectMapper JSON_OM = new ObjectMapper ( ) ; private static Settings INSTANCE = null ; private List < Directory > directories ; private String username ; private Settings ( ) { } public static synchronized Settings load ( ) { } public static synchronized void save ( ) { if ( ( Settings . INSTANCE ) != null ) { try { Files . createDirectories ( Settings . SETTINGS_DIR ) ; final Path settingsFile = Settings . SETTINGS_DIR . resolve ( Settings . SETTINGS_FILE ) ; <START_BUG> final OutputStream out = Files . newOutputStream ( settingsFile , StandardOpenOption . WRITE , StandardOpenOption . CREATE ) ; <END_BUG> Settings . JSON_OM . writeValue ( out , Settings . INSTANCE ) ; } catch ( IOException e ) { Settings . LOG . error ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>save<seq2seq4repair_space>settings." , e ) ; } } } private static Settings defaultSettings ( ) { } public List < Directory > getDirectories ( ) { } public void setDirectories ( List < Directory > directories ) { } public String getUsername ( ) { } public void setUsername ( String username ) { } }

Fix:
final OutputStream out = Files . newOutputStream ( settingsFile , StandardOpenOption . WRITE , StandardOpenOption . TRUNCATE_EXISTING , StandardOpenOption . CREATE ) ;
Buggy code:
@ Controller public class StockController { @ RequestMapping ( value = "//viewStock" , method = RequestMethod . GET ) public ModelAndView viewStockPage ( @ RequestParam ( value = "symbol" , required = true ) String symbol ) { ModelAndView model = new ModelAndView ( ) ; Quote quote = YqlHelper . getStockQuote ( symbol ) ; if ( ( quote != null ) && ( ( quote . getCents ( ) ) != 0 ) ) { model . addObject ( "tickerSymbol" , quote . getSymbol ( ) ) ; model . addObject ( "name" , quote . getName ( ) ) ; String total = String . valueOf ( quote . getCents ( ) ) ; String dollars = "0" ; String cents = "00" ; if ( ( quote . getCents ( ) ) >= 100 ) { <START_BUG> total . substring ( 0 , ( ( total . length ( ) ) - 2 ) ) ; <END_BUG> cents = total . substring ( ( ( total . length ( ) ) - 2 ) , total . length ( ) ) ; } else { cents = total ; } model . addObject ( "price" , ( ( dollars + "." ) + cents ) ) ; } model . setViewName ( "viewStock" ) ; return model ; } }

Fix:
dollars = total . substring ( 0 , ( ( total . length ( ) ) - 2 ) ) ;
Buggy code:
public class ManagedDMRContentAddHandler implements OperationStepHandler , DescriptionProvider { private final AttributeDefinition contentAttribute ; private final ResourceDescriptionResolver descriptionResolver ; public ManagedDMRContentAddHandler ( final AttributeDefinition contentAttribute , final ResourceDescriptionResolver descriptionResolver ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { PathElement pe = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) . getLastElement ( ) ; ModelNode model = new ModelNode ( ) ; contentAttribute . validateAndSet ( operation , model ) ; ManagedDMRContentResource resource = new ManagedDMRContentResource ( pe ) ; context . addResource ( EMPTY_ADDRESS , resource ) ; resource . writeModel ( model ) ; <START_BUG> context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; <END_BUG> } @ Override public ModelNode getModelDescription ( Locale locale ) { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class SessionBuilder { private static final String EXPIRES = "_expires" ; private static final Logger logger = Logger . getLogger ( SessionBuilder . class ) ; private final Sessions sessions ; private final Signer signer ; private final SessionCookieDescriptor sessionCookieDescriptor ; private final Session emptySession ; private final AuthenticateService authenticateService ; private final int expires ; public SessionBuilder ( int expires , int limit , int rememberDay , AuthenticateService authenticateService ) { } public SessionBuilder ( int expires , int limit , int rememberDay , AuthenticateService authenticateService , PasswordService passwordService ) { } public Session in ( HttpRequest request ) { } public void buildSessionMetadata ( HttpRequest request , Session session ) { } public boolean isChangeSessionMetadata ( Session session ) { } private void updateSessionMetadata ( HttpRequest request , Session session , Session newSession ) { } private void saveSessionMetadata ( HttpRequest request , Session session ) { } public Session out ( Session session , HttpResponse response ) { } private Map < String , String > prepareSessionMetadata ( HttpRequest req ) { } private Session build ( HttpRequest req ) { } private Map < String , String > readEntries ( String cookie ) { } private void updateSessionInClient ( HttpResponse resp , Session session ) { Map < String , String > cookiesMap = toCookiesMap ( session ) ; if ( cookiesMap . isEmpty ( ) ) { resp . clearCookie ( sessionCookieDescriptor . getCookieName ( ) ) ; resp . clearCookie ( sessionCookieDescriptor . getCookieSignatureName ( ) ) ; } else { for ( Map . Entry < String , String > cookie : cookiesMap . entrySet ( ) ) { <START_BUG> resp . addCookie ( cookie . getKey ( ) , cookie . getValue ( ) , ( ( int ) ( ( session . getExpires ( ) ) // 1000 ) ) ) ; <END_BUG> } } } private Map < String , String > toCookiesMap ( Session session ) { } public String toString ( ) { } }

Fix:
resp . addCookie ( cookie . getKey ( ) , cookie . getValue ( ) , ( ( session . getExpires ( ) ) > 0 ? ( ( int ) ( ( session . getExpires ( ) ) // 1000 ) ) : ( ( int ) ( session . getExpires ( ) ) ) ) ) ;
Buggy code:
public class BatchListHandler extends CommandHandlerWithHelp { public BatchListHandler ( ) { } @ Override public boolean isAvailable ( CommandContext ctx ) { } @ Override protected void doHandle ( CommandContext ctx ) { BatchManager batchManager = ctx . getBatchManager ( ) ; if ( ! ( batchManager . isBatchActive ( ) ) ) { <START_BUG> ctx . printLine ( "No<seq2seq4repair_space>active<seq2seq4repair_space>batch." ) ; <END_BUG> return ; } Batch activeBatch = batchManager . getActiveBatch ( ) ; List < BatchedCommand > commands = activeBatch . getCommands ( ) ; if ( ! ( commands . isEmpty ( ) ) ) { for ( int i = 0 ; i < ( commands . size ( ) ) ; ++ i ) { BatchedCommand cmd = commands . get ( i ) ; ctx . printLine ( ( ( ( "#" + ( i + 1 ) ) + '<seq2seq4repair_space>' ) + ( cmd . getCommand ( ) ) ) ) ; } } else { ctx . printLine ( "The<seq2seq4repair_space>batch<seq2seq4repair_space>is<seq2seq4repair_space>empty." ) ; } } }

Fix:
ctx . error ( "No<seq2seq4repair_space>active<seq2seq4repair_space>batch." ) ;
Buggy code:
public class SimpleWeatherInformation extends MyActivity implements OnTouchListener { private int index = 0 ; private int type = 0 ; private TextView information ; private TextView data ; private TextView city ; private TextView cityLeft ; private TextView cityRight ; private ImageView main ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void initView ( ) { } public void initData ( ) { if ( ( index ) > 0 ) { cityLeft . setVisibility ( VISIBLE ) ; cityLeft . setText ( getData ( ( ( index ) - 1 ) ) . getName ( ) ) ; } else { cityLeft . setVisibility ( INVISIBLE ) ; } if ( ( index ) < ( ( getBaseApplication ( ) . getListData ( ) . size ( ) ) - 1 ) ) { cityRight . setVisibility ( VISIBLE ) ; cityRight . setText ( getData ( ( ( index ) + 1 ) ) . getName ( ) ) ; } else { cityRight . setVisibility ( INVISIBLE ) ; } city . setText ( getData ( ) . getName ( ) ) ; if ( ( type ) == 0 ) { information . setText ( getBaseApplication ( ) . getType ( type ) ) ; main . setImageResource ( getData ( ) . getPicture ( ) ) ; <START_BUG> data . setText ( getData ( ) . getTemperature ( ) ) ; <END_BUG> } else if ( ( type ) == 1 ) { information . setText ( getBaseApplication ( ) . getType ( type ) ) ; main . setImageResource ( wind ) ; data . setText ( getData ( ) . getWind ( ) ) ; } } public Data getData ( ) { } public Data getData ( int index ) { } public void swipe ( ) { } public void increaseTypeData ( ) { } public void decreaseTypeData ( ) { } private void increaseData ( ) { } private void decreaseData ( ) { } private float startX ; private float startY ; private float min = 100 ; private SimpleWeatherInformation . Action action ; public enum Action { NO_SWIPE , SWIPE_UP_TO_DOWN , SWIPE_DOWN_TO_UP , SWIPE_RIGHT_TO_LEFT , SWIPE_LEFT_TO_RIGHT ; } @ Override public boolean onTouch ( View v , MotionEvent event ) { } }

Fix:
data . setText ( getData ( ) . getTemperature ( getBaseApplication ( ) . isFahrenheit ( ) ) ) ;
Buggy code:
public class Favourite { private static final Uri sBaseUri = Uri . parse ( ( "content:////" + ( DictionaryContentProvider . AUTHORITY ) ) ) ; public static final Uri CONTENT_URI = Favourite . sBaseUri . buildUpon ( ) . appendPath ( "favourite" ) . build ( ) ; private static final int NOT_SAVED = - 1 ; public int mId = Favourite . NOT_SAVED ; public String mWord ; public static final String TABLE_NAME = "favourite" ; public static interface COLUMNS { public static final String ID = "_id" ; public static final String WORD = "word" ; } private Favourite ( int id , String word ) { } public ContentValues toContentValues ( ) { } public Uri save ( Context context ) { } public boolean delete ( Context context ) { } public boolean isExists ( Context context ) { <START_BUG> Cursor cursor = context . getContentResolver ( ) . query ( Favourite . CONTENT_URI , new String [ ] { Favourite . COLUMNS . ID } , ( ( Favourite . COLUMNS . WORD ) + "=?" ) , new String [ ] { mWord } , null , null ) ; <END_BUG> try { return cursor . moveToFirst ( ) ; } finally { cursor . close ( ) ; } } public static Favourite fromWord ( Word word ) { } }

Fix:
Cursor cursor = context . getContentResolver ( ) . query ( Favourite . CONTENT_URI , new String [ ] { Favourite . COLUMNS . ID } , ( ( Favourite . COLUMNS . WORD ) + "=?" ) , new String [ ] { mWord } , null ) ;
Buggy code:
public class Door extends SimpleField { private EnumMap < Direction , Boolean > openSides = new EnumMap < Direction , Boolean > ( Direction . class ) ; private Direction orientation ; public Door ( Direction dir ) { } @ Override protected boolean solid ( Direction dir ) { } @ Override public ItemInterface getItem ( Direction dir ) { } @ Override public boolean placeOn ( Direction dir , ItemInterface item ) { } @ Override public boolean removeItem ( Direction dir ) { if ( this . openSides . get ( dir ) ) { <START_BUG> return super . removeItem ; <END_BUG> } return false ; } public void open ( ) { } public void close ( ) { } }

Fix:
return super . removeItem ( dir ) ;
Buggy code:
public class CurrentOfResultSet extends NoPutResultSetImpl implements CursorResultSet { private boolean next ; private RowLocation rowLocation ; private CursorResultSet cursor ; private CursorResultSet target ; private ExecRow sparseRow ; private final String cursorName ; private final String psName ; public CurrentOfResultSet ( String cursorName , Activation activation , int resultSetNumber , String psName ) { } public void openCore ( ) throws StandardException { } public ExecRow getNextRowCore ( ) throws StandardException { if ( isOpen ) { if ( ! ( next ) ) { next = true ; if ( SanityManager . DEBUG ) SanityManager . ASSERT ( ( ! ( cursor . isClosed ( ) ) ) , "cursor<seq2seq4repair_space>closed" ) ; ExecRow cursorRow = cursor . getCurrentRow ( ) ; if ( cursorRow == null ) { <START_BUG> throw StandardException . newException ( LANG_NO_CURRENT_ROW , cursorName ) ; <END_BUG> } rowLocation = cursor . getRowLocation ( ) ; currentRow = target . getCurrentRow ( ) ; if ( ( ( rowLocation ) == null ) || ( ( cursorRow != null ) && ( ( currentRow ) == null ) ) ) { activation . addWarning ( StandardException . newWarning ( CURSOR_OPERATION_CONFLICT ) ) ; return null ; } if ( ( target ) instanceof TableScanResultSet ) { TableScanResultSet scan = ( ( TableScanResultSet ) ( target ) ) ; if ( ( ( scan . indexCols ) != null ) && ( ( currentRow ) != null ) ) currentRow = getSparseRow ( currentRow , scan . indexCols ) ; } TableScanResultSet scan = ( ( TableScanResultSet ) ( activation . getForUpdateIndexScan ( ) ) ) ; if ( scan != null ) { if ( ( target ) instanceof IndexRowToBaseRowResultSet ) scan . compareToLastKey = ( ( IndexRowToBaseRowResultSet ) ( target ) ) . currentRowPrescanned ; else if ( ( target ) instanceof TableScanResultSet ) scan . compareToLastKey = ( ( TableScanResultSet ) ( target ) ) . currentRowPrescanned ; } } else { currentRow = null ; rowLocation = null ; } } else { currentRow = null ; rowLocation = null ; } setCurrentRow ( currentRow ) ; return currentRow ; } private ExecRow getSparseRow ( ExecRow row , int [ ] indexCols ) throws StandardException { } public void close ( ) throws StandardException { } public void finish ( ) throws StandardException { } public long getTimeSpent ( int type ) { } public RowLocation getRowLocation ( ) { } public ExecRow getCurrentRow ( ) { } private void getCursor ( ) throws StandardException { } public void updateRow ( ExecRow row ) throws StandardException { } public void markRowAsDeleted ( ) throws StandardException { } }

Fix:
throw StandardException . newException ( NO_CURRENT_ROW ) ;
Buggy code:
public class RaDeploymentParsingProcessor implements DeploymentUnitProcessor { public RaDeploymentParsingProcessor ( ) { } @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ResourceRoot deploymentRoot = deploymentUnit . getAttachment ( DEPLOYMENT_ROOT ) ; final boolean resolveProperties = Util . shouldResolveSpec ( deploymentUnit ) ; final VirtualFile file = deploymentRoot . getRoot ( ) ; if ( ( file == null ) || ( ! ( file . exists ( ) ) ) ) return ; final String deploymentRootName = file . getName ( ) . toLowerCase ( Locale . ENGLISH ) ; if ( ! ( deploymentRootName . endsWith ( ".rar" ) ) ) { return ; } final VirtualFile alternateDescriptor = deploymentRoot . getAttachment ( ALTERNATE_CONNECTOR_DEPLOYMENT_DESCRIPTOR ) ; String prefix = "" ; if ( ( deploymentUnit . getParent ( ) ) != null ) { prefix = ( deploymentUnit . getParent ( ) . getName ( ) ) + "#" ; } <START_BUG> String deploymentName = prefix + ( file . getName ( ) . substring ( 0 , file . getName ( ) . indexOf ( ".rar" ) ) ) ; <END_BUG> ConnectorXmlDescriptor xmlDescriptor = RaDeploymentParsingProcessor . process ( resolveProperties , file , alternateDescriptor , deploymentName ) ; phaseContext . getDeploymentUnit ( ) . putAttachment ( ATTACHMENT_KEY , xmlDescriptor ) ; } public static ConnectorXmlDescriptor process ( boolean resolveProperties , VirtualFile file , VirtualFile alternateDescriptor , String deploymentName ) throws DeploymentUnitProcessingException { } public void undeploy ( final DeploymentUnit context ) { } }

Fix:
String deploymentName = prefix + ( file . getName ( ) ) ;
Buggy code:
public class SaveIndex extends IndexRequest { public SaveIndex ( IPath containerPath , IndexManager manager ) { } public boolean execute ( IProgressMonitor progressMonitor ) { if ( ( this . isCancelled ) || ( ( progressMonitor != null ) && ( progressMonitor . isCanceled ( ) ) ) ) return true ; Index index = this . manager . getIndex ( this . containerPath , true , false ) ; if ( index == null ) return true ; <START_BUG> ReadWriteMonitor monitor = this . manager . getMonitorFor ( index ) ; <END_BUG> if ( monitor == null ) return true ; try { monitor . enterWrite ( ) ; this . manager . saveIndex ( index ) ; } catch ( IOException e ) { if ( JobManager . VERBOSE ) { JobManager . verbose ( ( ( "-><seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>save<seq2seq4repair_space>index<seq2seq4repair_space>" + ( this . containerPath ) ) + "<seq2seq4repair_space>because<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>following<seq2seq4repair_space>exception:" ) ) ; e . printStackTrace ( ) ; } return false ; } finally { monitor . exitWrite ( ) ; } return true ; } public String toString ( ) { } }

Fix:
ReadWriteMonitor monitor = index . monitor ;
Buggy code:
public class PatternSet extends DataType implements Cloneable { private Vector includeList = new Vector ( ) ; private Vector excludeList = new Vector ( ) ; private Vector includesFileList = new Vector ( ) ; private Vector excludesFileList = new Vector ( ) ; public class NameEntry { private String name ; private String ifCond ; private String unlessCond ; public void setName ( String name ) { } public void setIf ( String cond ) { } public void setUnless ( String cond ) { } public String getName ( ) { } public String evalName ( Project p ) { } private boolean valid ( Project p ) { } public String toString ( ) { <START_BUG> StringBuffer buf = new StringBuffer ( name ) ; <END_BUG> if ( ( ( ifCond ) != null ) || ( ( unlessCond ) != null ) ) { buf . append ( ":" ) ; String connector = "" ; if ( ( ifCond ) != null ) { buf . append ( "if->" ) ; buf . append ( ifCond ) ; connector = ";" ; } if ( ( unlessCond ) != null ) { buf . append ( connector ) ; buf . append ( "unless->" ) ; buf . append ( unlessCond ) ; } } return buf . toString ( ) ; } } public PatternSet ( ) { } public void setRefid ( Reference r ) throws BuildException { } public void addConfiguredPatternset ( PatternSet p ) { } public PatternSet . NameEntry createInclude ( ) { } public PatternSet . NameEntry createIncludesFile ( ) { } public PatternSet . NameEntry createExclude ( ) { } public PatternSet . NameEntry createExcludesFile ( ) { } public void setIncludes ( String includes ) { } public void setExcludes ( String excludes ) { } private PatternSet . NameEntry addPatternToList ( Vector list ) { } public void setIncludesfile ( File includesFile ) throws BuildException { } public void setExcludesfile ( File excludesFile ) throws BuildException { } private void readPatterns ( File patternfile , Vector patternlist , Project p ) throws BuildException { } public void append ( PatternSet other , Project p ) { } public String [ ] getIncludePatterns ( Project p ) { } public String [ ] getExcludePatterns ( Project p ) { } boolean hasPatterns ( Project p ) { } private PatternSet getRef ( Project p ) { } private String [ ] makeArray ( Vector list , Project p ) { } private void readFiles ( Project p ) { } public String toString ( ) { return ( ( ( "patternSet{<seq2seq4repair_space>includes:<seq2seq4repair_space>" + ( includeList ) ) + "<seq2seq4repair_space>excludes:<seq2seq4repair_space>" ) + ( excludeList ) ) + "<seq2seq4repair_space>}" ; } public Object clone ( ) { } }

Fix:
StringBuffer buf = new StringBuffer ( ( ( name ) != null ? name : "" ) ) ;
Buggy code:
public abstract class VendorServletSupport extends HttpServlet { private static final Logger log = Logger . getLogger ( VendorServletSupport . class . getName ( ) ) ; private static final String LANDING_JSP = "//WEB-INF//jsp//vendor//index.jsp" ; protected final TruckDAO truckDAO ; protected final Provider < Session > sessionProvider ; private final UserService userService ; protected VendorServletSupport ( TruckDAO dao , Provider < Session > sessionProvider , UserService userService ) { } @ Override protected final void doGet ( HttpServletRequest req , HttpServletResponse resp ) throws IOException , ServletException { } private String getLogoutUrl ( Principal userPrincipal ) { } @ Override protected final void doPost ( HttpServletRequest req , HttpServletResponse resp ) throws IOException , ServletException { Principal principal = getPrincipal ( req ) ; if ( principal == null ) { resp . setStatus ( 401 ) ; return ; } Set < Truck > trucks = associatedTrucks ( principal ) ; if ( trucks . isEmpty ( ) ) { VendorServletSupport . log . info ( "Sent<seq2seq4repair_space>401<seq2seq4repair_space>on<seq2seq4repair_space>post<seq2seq4repair_space>because<seq2seq4repair_space>user<seq2seq4repair_space>didn't<seq2seq4repair_space>belong<seq2seq4repair_space>to<seq2seq4repair_space>any<seq2seq4repair_space>trucks" ) ; resp . setStatus ( 401 ) ; } else if ( ( trucks . size ( ) ) == 1 ) { Truck truck = Iterables . getFirst ( trucks , null ) ; <START_BUG> req . setAttribute ( "truck" , truck ) ; <END_BUG> VendorServletSupport . log . log ( Level . INFO , "User<seq2seq4repair_space>{0}" , principal . getName ( ) ) ; dispatchPost ( req , resp , truck . getId ( ) ) ; } else { } } protected void dispatchPost ( HttpServletRequest req , HttpServletResponse resp , String truckId ) throws IOException { } private Set < Truck > associatedTrucks ( Principal principal ) { } private boolean isIdentifiedByEmail ( Principal principal ) { } protected abstract void dispatchGet ( HttpServletRequest req , HttpServletResponse resp , @ Nullable Truck truck ) throws IOException , ServletException { } private void vendorError ( String title , String message , HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ Nullable protected Principal getPrincipal ( HttpServletRequest request ) { } }

Fix:
req . setAttribute ( "truck" , truckDAO . findById ( truck . getId ( ) ) ) ;
Buggy code:
class Math extends AbstractVal implements Val { public static final String ADD = "+" ; public static final String SUBTRACT = "-" ; public static final String MULTIPLY = "*" ; public static final String DIVIDE = "//" ; public static final String MOD = "MOD" ; private final Val _val1 ; private final Val _val2 ; private final String _op ; private Joins _joins = null ; private ClassMetaData _meta = null ; private Class _cast = null ; public Math ( Val val1 , Val val2 , String op ) { } public ClassMetaData getMetaData ( ) { } public void setMetaData ( ClassMetaData meta ) { } public boolean isVariable ( ) { } public Class getType ( ) { } public void setImplicitType ( Class type ) { } public void initialize ( Select sel , JDBCStore store , boolean nullTest ) { } public Joins getJoins ( ) { } public Object toDataStoreValue ( Object val , JDBCStore store ) { } public void select ( Select sel , JDBCStore store , Object [ ] params , boolean pks , JDBCFetchConfiguration fetch ) { } public void selectColumns ( Select sel , JDBCStore store , Object [ ] params , boolean pks , JDBCFetchConfiguration fetch ) { } public void groupBy ( Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { <START_BUG> sel . groupBy ( newSQLBuffer ( sel , store , params , fetch ) , false ) ; <END_BUG> } public void orderBy ( Select sel , JDBCStore store , Object [ ] params , boolean asc , JDBCFetchConfiguration fetch ) { } private SQLBuffer newSQLBuffer ( Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { } public Object load ( Result res , JDBCStore store , JDBCFetchConfiguration fetch ) throws SQLException { } public boolean hasVariable ( Variable var ) { } public void calculateValue ( Select sel , JDBCStore store , Object [ ] params , Val other , JDBCFetchConfiguration fetch ) { } public void clearParameters ( ) { } public int length ( ) { } public void appendTo ( SQLBuffer sql , int index , Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { } }

Fix:
sel . groupBy ( newSQLBuffer ( sel , store , params , fetch ) ) ;
Buggy code:
public class FormDispatchEventTest extends WicketTestCase { private final class MyForm extends Form { private static final long serialVersionUID = 1L ; private MyForm ( MarkupContainer parent , String id ) { } @ Override protected void onSubmit ( ) { } public String getHiddenField ( String name ) { } } private boolean selection ; private boolean submit ; public FormDispatchEventTest ( String name ) { } public void testDropDownEvent ( ) throws Exception { MockPage page = new MockPage ( ) ; FormDispatchEventTest . MyForm form = new FormDispatchEventTest . MyForm ( page , "form" ) ; <START_BUG> DropDownChoice dropDown = new DropDownChoice ( form , "dropdown" , new Model ( ) , new ArrayList ( ) ) { <END_BUG> private static final long serialVersionUID = 1L ; @ Override protected void onSelectionChanged ( Object newSelection ) { selection = true ; } @ Override protected boolean wantOnSelectionChangedNotifications ( ) { return true ; } } ; application . setupRequestAndResponse ( ) ; RequestCycle cycle = application . createRequestCycle ( ) ; page . urlFor ( INTERFACE ) ; cycle . getSession ( ) . touch ( page ) ; cycle . getSession ( ) . update ( ) ; form . onFormSubmitted ( ) ; assertTrue ( "form<seq2seq4repair_space>should<seq2seq4repair_space>should<seq2seq4repair_space>set<seq2seq4repair_space>value<seq2seq4repair_space>" , submit ) ; application . getServletRequest ( ) . setParameter ( form . getHiddenField ( HIDDEN_FIELD_FAKE_SUBMIT ) , dropDown . urlFor ( IOnChangeListener . INTERFACE ) . toString ( ) ) ; form . onFormSubmitted ( ) ; assertTrue ( "Selection<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>called" , selection ) ; } }

Fix:
DropDownChoice < String > dropDown = new DropDownChoice < String > ( form , "dropdown" , new wicket . model . Model < String > ( ) , new ArrayList < String > ( ) ) {
Buggy code:
public class ComponentCreateTagTest extends TestCase { private static Log log = LogFactory . getLog ( ComponentCreateTagTest . class ) ; private MockWebApplication application ; public ComponentCreateTagTest ( String name ) { } public void testRenderHomePage_1 ( ) throws Exception { } public void testRenderHomePage_2 ( ) throws Exception { } public void testRenderHomePage_3 ( ) throws Exception { } public void testRenderHomePage_4 ( ) throws Exception { } public void testRenderHomePage_5 ( ) throws Exception { } public void testRenderHomePage_6 ( ) throws Exception { } public void executeTest ( final Class pageClass , final String filename ) throws Exception { application = new MockWebApplication ( null ) ; <START_BUG> application . getPages ( ) . setHomePage ( pageClass ) ; <END_BUG> application . getSettings ( ) . setStripWicketTags ( true ) ; application . setupRequestAndResponse ( ) ; application . processRequestCycle ( ) ; String document = application . getServletResponse ( ) . getDocument ( ) ; ComponentCreateTagTest . log . info ( document ) ; assertTrue ( DiffUtil . validatePage ( document , this . getClass ( ) , filename ) ) ; } }

Fix:
application . getRequiredPageSettings ( ) . setHomePage ( pageClass ) ;
Buggy code:
public class SubqueryList extends QueryTreeNodeVector { public void addSubqueryNode ( SubqueryNode subqueryNode ) throws StandardException { } public void preprocess ( int numTables , FromList outerFromList , SubqueryList outerSubqueryList , PredicateList outerPredicateList ) throws StandardException { } public void optimize ( DataDictionary dataDictionary , double outerRows ) throws StandardException { } public void modifyAccessPaths ( ) throws StandardException { } public boolean referencesTarget ( String name , boolean baseTable ) throws StandardException { } public boolean referencesSessionSchema ( ) throws StandardException { int size = size ( ) ; for ( int index = 0 ; index < size ; index ++ ) { SubqueryNode subqueryNode ; subqueryNode = ( ( SubqueryNode ) ( elementAt ( index ) ) ) ; <START_BUG> if ( subqueryNode . getResultSet ( ) . referencesSessionSchema ( ) ) { <END_BUG> return true ; } } return false ; } public void setPointOfAttachment ( int pointOfAttachment ) throws StandardException { } void decrementLevel ( int decrement ) { } public void markHavingSubqueries ( ) { } public void markWhereSubqueries ( ) { } }

Fix:
if ( subqueryNode . referencesSessionSchema ( ) ) {
Buggy code:
public class Tokens { private static Tokens sInstance ; private ArrayBlockingQueue < Token > mTokenBuffer ; private boolean mIsLexicalFinished ; public static synchronized Tokens getInstance ( ) { } private Tokens ( ) { } public boolean insertTokenInBuffer ( Token t ) { } public Token getTokenFromBuffer ( ) { } public synchronized void setLexicalFinished ( ) { } public synchronized boolean isLexicalFinishedWithouError ( ) { <START_BUG> return ( mIsLexicalFinished ) && ( ( mTokenBuffer . remainingCapacity ( ) ) == 0 ) ; <END_BUG> } private boolean checkClassPermission ( Class < ? > expectedClass ) { } }

Fix:
return ( mIsLexicalFinished ) && ( ( mTokenBuffer . size ( ) ) == 0 ) ;