nus-yam/ex-repair huggingface dataset:
Buggy code:
public class TrackerService { private Context ctx ; private Activity activity ; private int historyEntriesLoaded = 0 ; private TrackerDbAdapter dbAdapter ; public TrackerService ( Activity activity , Context ctx ) { } public void perist ( Location location ) { dbAdapter . insert ( location ) ; <START_BUG> SimpleDateFormat sdf = new SimpleDateFormat ( "hh:MM:ss" ) ; <END_BUG> TextView headerText = ( ( TextView ) ( activity . findViewById ( header ) ) ) ; TextView lastLocation = ( ( TextView ) ( activity . findViewById ( lastLocation ) ) ) ; headerText . setText ( ( ( ( ( "Updated:<seq2seq4repair_space>" + ( sdf . format ( new Date ( System . currentTimeMillis ( ) ) ) ) ) + ",<seq2seq4repair_space>accur:<seq2seq4repair_space>" ) + ( location . getAccuracy ( ) ) ) + "<seq2seq4repair_space>m" ) ) ; lastLocation . setText ( ( ( ( "<seq2seq4repair_space>" + ( location . getLatitude ( ) ) ) + "<seq2seq4repair_space>//<seq2seq4repair_space>" ) + ( location . getLongitude ( ) ) ) ) ; } public List < TrackerEntry > load ( int i , boolean fromBeginning ) { } }

Fix:
SimpleDateFormat sdf = new SimpleDateFormat ( "HH:mm:ss" ) ;
Buggy code:
public class RandomQuestionSelector { private static RandomQuestionSelector randomQuestionSelectorInstance ; private LinkedHashMap < String , LinkedList < Question > > questions ; private LinkedList < Question > usedQuestion = new LinkedList < Question > ( ) ; private LinkedList < String > keys ; public static RandomQuestionSelector getInstance ( AssetManager am ) throws Exception { } public static RandomQuestionSelector getInstance ( ) { } private RandomQuestionSelector ( AssetManager am ) throws Exception { } public LinkedList < Question > getUsedQuestion ( ) { <START_BUG> return usedQuestion ; <END_BUG> } public void questionPickSystem ( ) throws IOException { } }

Fix:
return ( ( LinkedList < Question > ) ( usedQuestion . clone ( ) ) ) ;
Buggy code:
public class RecordComponentEditor extends AbstractChannelEditor { private static final long serialVersionUID = 1L ; private JCheckBox mAudioRecorder = new JCheckBox ( "Audio" ) ; private JCheckBox mBasebandRecorder = new JCheckBox ( "Baseband<seq2seq4repair_space>I//Q" ) ; private JCheckBox mTrafficBasebandRecorder = new JCheckBox ( "Traffic<seq2seq4repair_space>Channel<seq2seq4repair_space>Baseband<seq2seq4repair_space>I//Q" ) ; public RecordComponentEditor ( ChannelNode channelNode ) { } @ Override public void save ( ) { RecordConfiguration config = getChannelNode ( ) . getChannel ( ) . getRecordConfiguration ( ) ; config . clearRecorders ( ) ; if ( mAudioRecorder . isSelected ( ) ) { config . addRecorder ( AUDIO ) ; } if ( mBasebandRecorder . isSelected ( ) ) { config . addRecorder ( BASEBAND ) ; } if ( mTrafficBasebandRecorder . isSelected ( ) ) { <START_BUG> config . addRecorder ( BASEBAND ) ; <END_BUG> } } @ Override public void reset ( ) { } }

Fix:
config . addRecorder ( TRAFFIC_BASEBAND ) ;
Buggy code:
public class LocationUpdateApplication extends Application { public void init ( ) { Window mainWindow = new Window ( "Location<seq2seq4repair_space>update" ) ; VerticalLayout vl = new VerticalLayout ( ) ; vl . setWidth ( "500px" ) ; vl . setHeight ( "250px" ) ; vl . setMargin ( true ) ; final OpenStreetMapGeocoder geocoder = OpenStreetMapGeocoder . getInstance ( ) ; geocoder . setLimit ( 25 ) ; <START_BUG> final LocationTextField < GeocodedLocation > ltf = new LocationTextField < GeocodedLocation > ( geocoder , "Address:<seq2seq4repair_space>" ) ; <END_BUG> ltf . setWidth ( "100%" ) ; ltf . setEnterKeyFiresTextChange ( true ) ; vl . addComponent ( ltf ) ; final TextField lat = new TextField ( "Latitude:<seq2seq4repair_space>" ) ; final TextField lon = new TextField ( "Longitude:<seq2seq4repair_space>" ) ; vl . addComponent ( lat ) ; vl . addComponent ( lon ) ; ltf . addListener ( new Property . ValueChangeListener ( ) { public void valueChange ( Property . ValueChangeEvent event ) { GeocodedLocation loc = ltf . getValue ( ) ; if ( loc != null ) { lat . setValue ( ( "" + ( loc . getLat ( ) ) ) ) ; lon . setValue ( ( "" + ( loc . getLon ( ) ) ) ) ; } else { lat . setValue ( "" ) ; lon . setValue ( "" ) ; } } } ) ; Button b = new Button ( "Set<seq2seq4repair_space>Location<seq2seq4repair_space>to<seq2seq4repair_space>New<seq2seq4repair_space>York<seq2seq4repair_space>City,<seq2seq4repair_space>NY" ) ; b . addListener ( new Button . ClickListener ( ) { public void buttonClick ( Button . ClickEvent event ) { GeocodedLocation loc = new GeocodedLocation ( ) ; loc . setLon ( ( - 73.9381406004754 ) ) ; loc . setLat ( 40.6637996714713 ) ; loc . setOriginalAddress ( "NYC,<seq2seq4repair_space>New<seq2seq4repair_space>York,<seq2seq4repair_space>United<seq2seq4repair_space>States<seq2seq4repair_space>of<seq2seq4repair_space>America" ) ; loc . setGeocodedAddress ( "NYC,<seq2seq4repair_space>New<seq2seq4repair_space>York,<seq2seq4repair_space>United<seq2seq4repair_space>States<seq2seq4repair_space>of<seq2seq4repair_space>America" ) ; ltf . setLocation ( loc ) ; } } ) ; vl . addComponent ( b ) ; mainWindow . setContent ( vl ) ; setMainWindow ( mainWindow ) ; } }

Fix:
final LocationTextField < GeocodedLocation > ltf = new LocationTextField < GeocodedLocation > ( geocoder , GeocodedLocation . class , "Address:<seq2seq4repair_space>" ) ;
Buggy code:
public class ViewPane extends PartPane implements IPropertyListener { private PresentableViewPart presentableAdapter = new PresentableViewPart ( this ) ; private boolean busy = false ; private boolean fast = false ; private boolean showFocus = false ; private boolean locked = true ; ToolBar isvToolBar ; private ToolBarManager isvToolBarMgr = new ViewPane . PaneToolBarManager ( ( ( SWT . FLAT ) | ( SWT . WRAP ) ) ) ; private MenuManager isvMenuMgr ; boolean hasFocus ; private boolean hadViewMenu = false ; class PaneToolBarManager extends ToolBarManager { public PaneToolBarManager ( int style ) { } protected void relayout ( ToolBar toolBar , int oldCount , int newCount ) { } } class PaneMenuManager extends MenuManager { public PaneMenuManager ( ) { } protected void update ( boolean force , boolean recursive ) { } } public ViewPane ( IViewReference ref , WorkbenchPage page ) { } public void createControl ( Composite parent ) { } protected void createChildControl ( ) { } private void recreateToolbars ( ) { } protected IWorkbenchPart createErrorPart ( IWorkbenchPart oldPart ) { } protected void createTitleBar ( ) { } private void toolBarResized ( ToolBar toolBar , int newSize ) { } private void createToolBars ( ) { } public void dispose ( ) { } public void doHide ( ) { } private Rectangle getParentBounds ( ) { } public void doMakeFast ( ) { } public void doRemoveFast ( ) { } protected void doDock ( ) { } public Control getDragHandle ( ) { } public MenuManager getMenuManager ( ) { } public Control [ ] getTabList ( ) { } public ToolBarManager getToolBarManager ( ) { } public IViewReference getViewReference ( ) { } public void propertyChanged ( Object source , int propId ) { } public void setFast ( boolean b ) { } void shellActivated ( ) { } void shellDeactivated ( ) { } void setActive ( boolean active ) { } public void showFocus ( boolean inFocus ) { } private boolean isFastView ( ) { } boolean isMoveable ( ) { } public boolean hasViewMenu ( ) { } public void showViewMenu ( Point location ) { } public String toString ( ) { } public void updateActionBars ( ) { } public void updateTitles ( ) { } public void addSizeMenuItem ( Menu menu , int index ) { } protected void doZoom ( ) { } public void setContainer ( ILayoutContainer container ) { ILayoutContainer oldContainer = getContainer ( ) ; if ( hasFocus ) { if ( ( oldContainer != null ) && ( oldContainer instanceof PartStack ) ) { ( ( PartStack ) ( oldContainer ) ) . setActive ( AS_INACTIVE ) ; } <START_BUG> if ( ( container != null ) && ( container instanceof ViewStack ) ) { <END_BUG> ( ( PartStack ) ( container ) ) . setActive ( AS_ACTIVE_FOCUS ) ; } } super . setContainer ( container ) ; } public IPresentablePart getPresentablePart ( ) { } public void reparent ( Composite newParent ) { } public void moveAbove ( Control refControl ) { } public void setVisible ( boolean makeVisible ) { } public boolean toolbarIsVisible ( ) { } public void setBusy ( boolean isBusy ) { } public boolean isBusy ( ) { } public void showHighlight ( ) { } public String getPlaceHolderId ( ) { } }

Fix:
if ( ( container != null ) && ( container instanceof PartStack ) ) {
Buggy code:
public class FznSettings implements Settings { public boolean printConstraint ( ) { <START_BUG> return true ; <END_BUG> } public boolean enableClause ( ) { } @ Override public boolean enableTableSubstitution ( ) { } public boolean adhocReification ( ) { } @ Override public int getMaxTupleSizeForSubstitution ( ) { } public boolean enableDecompositionOfLinearCombination ( ) { } }

Fix:
return false ;
Buggy code:
public class T140Panel implements T140EventHandler { private StringBuffer send_buffer ; private StringBuffer receive_buffer ; private String call_id ; private Writer out ; private Writer log_out ; private String lineSeparator = System . getProperty ( "line.separator" ) ; private T140EventHandler outHandler ; public T140Panel ( T140EventHandler outHandler , String call_id , Writer out , Writer log_out ) { } public void newEvent ( T140Event event ) { } private void processNewLine ( ) { } private void processText ( String inText ) { try { System . out . println ( ( ( ( "Receiving<seq2seq4repair_space>[" + ( ( int ) ( inText . charAt ( 0 ) ) ) ) + "]:<seq2seq4repair_space>" ) + inText ) ) ; <START_BUG> out . write ( inText ) ; <END_BUG> out . flush ( ) ; receive_buffer . append ( inText ) ; } catch ( Exception e ) { System . out . println ( ( ( ( "processText<seq2seq4repair_space>error<seq2seq4repair_space>[" + inText ) + "]:<seq2seq4repair_space>" ) + ( e . getMessage ( ) ) ) ) ; } } private void processBS ( ) { } public void keyTyped ( char input ) { } }

Fix:
out . write ( ( ( int ) ( inText . charAt ( 0 ) ) ) ) ;
Buggy code:
public abstract class AbstractFileResolvingResource extends AbstractResource { @ Override public File getFile ( ) throws IOException { } @ Override protected File getFileForLastModifiedCheck ( ) throws IOException { } protected File getFile ( URI uri ) throws IOException { } @ Override public boolean exists ( ) { } @ Override public boolean isReadable ( ) { } @ Override public long contentLength ( ) throws IOException { URL url = getURL ( ) ; if ( ResourceUtils . isFileURL ( url ) ) { <START_BUG> return super . contentLength ( ) ; <END_BUG> } else { URLConnection con = url . openConnection ( ) ; con . setUseCaches ( false ) ; if ( con instanceof HttpURLConnection ) { ( ( HttpURLConnection ) ( con ) ) . setRequestMethod ( "HEAD" ) ; } return con . getContentLength ( ) ; } } @ Override public long lastModified ( ) throws IOException { } private static class VfsResourceDelegate { public static Resource getResource ( URL url ) throws IOException { } public static Resource getResource ( URI uri ) throws IOException { } } }

Fix:
return getFile ( ) . length ( ) ;
Buggy code:
public class Addjoin extends Activity { private SeekBar seekBartimer = null ; private EditText editroomName = null ; @ Override protected void onCreate ( Bundle saveinstancestate ) { super . onCreate ( saveinstancestate ) ; setContentView ( addjoin ) ; Button buttonj2c = ( ( Button ) ( findViewById ( buttonjoin2chat ) ) ) ; Button buttonj2m = ( ( Button ) ( findViewById ( buttonjoin2main ) ) ) ; Button buttonCreate = ( ( Button ) ( findViewById ( buttonCreateroom ) ) ) ; editroomName = ( ( EditText ) ( findViewById ( editTextroomname ) ) ) ; buttonj2c . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { Intent intent = new Intent ( ) ; intent . setClass ( Addjoin . this , Chatroom . class ) ; startActivity ( intent ) ; finish ( ) ; } } ) ; buttonj2m . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { Intent intent = new Intent ( ) ; intent . setClass ( Addjoin . this , MainActivity . class ) ; startActivity ( intent ) ; finish ( ) ; } } ) ; buttonCreate . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { <START_BUG> if ( ( editroomName ) != null ) { <END_BUG> add ( ) ; } else { Toast . makeText ( Addjoin . this , "請輸入房間名稱" , LENGTH_SHORT ) . show ( ) ; } } } ) ; seekBartimer = ( ( SeekBar ) ( findViewById ( R . id . seekBartimer ) ) ) ; final TextView textViewtimer = ( ( TextView ) ( findViewById ( textViewtimebar ) ) ) ; seekBartimer . setOnSeekBarChangeListener ( new SeekBar . OnSeekBarChangeListener ( ) { @ Override public void onProgressChanged ( SeekBar seekBar , int progress , boolean fromUser ) { textViewtimer . setText ( ( ( seekBartimer . getProgress ( ) ) + "Hours" ) ) ; } @ Override public void onStartTrackingTouch ( SeekBar seekBar ) { } @ Override public void onStopTrackingTouch ( SeekBar seekBar ) { if ( ( seekBartimer . getProgress ( ) ) <= 24 ) { Toast . makeText ( Addjoin . this , ( ( seekBartimer . getProgress ( ) ) + "<seq2seq4repair_space>Hours" ) , LENGTH_SHORT ) . show ( ) ; } else if ( ( seekBartimer . getProgress ( ) ) > 24 ) { int time = seekBartimer . getProgress ( ) ; int days = time // 24 ; int hours = time % 24 ; Toast . makeText ( Addjoin . this , ( ( ( days + "<seq2seq4repair_space>Days<seq2seq4repair_space>and<seq2seq4repair_space>" ) + hours ) + "<seq2seq4repair_space>Hours" ) , LENGTH_SHORT ) . show ( ) ; } else if ( ( seekBartimer . getProgress ( ) ) > 720 ) { int time = seekBartimer . getProgress ( ) ; int days = ( time % 720 ) // 24 ; int hours = ( time % 720 ) % 24 ; int month = time // 720 ; Toast . makeText ( Addjoin . this , ( ( ( ( ( month + "<seq2seq4repair_space>Months,<seq2seq4repair_space>" ) + days ) + "<seq2seq4repair_space>Days,<seq2seq4repair_space>" ) + hours ) + "<seq2seq4repair_space>Hours" ) , LENGTH_SHORT ) . show ( ) ; } } } ) ; } private void add ( ) { } private void cleanEditText ( ) { } }

Fix:
if ( ( editroomName . getText ( ) . toString ( ) ) != null ) {
Buggy code:
public class LogicalServerRoom extends LogicalRoom { private LogicalLoginRoom loginRoom ; public LogicalServerRoom ( LogicRoomController controller ) { } public void setClient ( String ip , int port ) { } @ Override public void actionPerformed ( ActionEvent ae ) { if ( ( ae . getSource ( ) ) == ( ( ( GraphicalServerRoom ) ( this . graphicalRoom ) ) . getGoButton ( ) ) ) { <START_BUG> if ( ( ( ( ! ( ( ( GraphicalServerRoom ) ( this . graphicalRoom ) ) . getIPTextField ( ) . getText ( ) . equals ( IP_ADRESS ) ) ) && ( ! ( ( ( GraphicalServerRoom ) ( this . graphicalRoom ) ) . getIPTextField ( ) . getText ( ) . equals ( "" ) ) ) ) && ( ! ( ( ( GraphicalServerRoom ) ( this . graphicalRoom ) ) . getPortTextField ( ) . getText ( ) . equals ( PORT ) ) ) ) && ( ! ( ( ( GraphicalServerRoom ) ( this . graphicalRoom ) ) . getPortTextField ( ) . getText ( ) . equals ( "" ) ) ) ) { <END_BUG> String ip = ( ( GraphicalServerRoom ) ( this . graphicalRoom ) ) . getIPTextField ( ) . getText ( ) ; int port = Integer . parseInt ( ( ( GraphicalServerRoom ) ( this . graphicalRoom ) ) . getPortTextField ( ) . getText ( ) ) ; System . out . println ( "ServerAction" ) ; this . controller . changeRoom ( loginRoom ) ; } } } public void serverAccess ( ) { } }

Fix:
if ( ( ( ! ( ( ( GraphicalServerRoom ) ( this . graphicalRoom ) ) . getIPTextField ( ) . getText ( ) . equals ( IP_ADRESS ) ) ) && ( ! ( ( ( GraphicalServerRoom ) ( this . graphicalRoom ) ) . getIPTextField ( ) . getText ( ) . equals ( "" ) ) ) ) && ( ! ( ( ( GraphicalServerRoom ) ( this . graphicalRoom ) ) . getPortTextField ( ) . getText ( ) . equals ( "" ) ) ) ) {
Buggy code:
public abstract class Engine implements ITypeRequestor { public LookupEnvironment lookupEnvironment ; protected CompilationUnitScope unitScope ; public SearchableEnvironment nameEnvironment ; public AssistOptions options ; public CompilerOptions compilerOptions ; public boolean forbiddenReferenceIsError ; public boolean discouragedReferenceIsError ; public boolean importCachesInitialized = false ; public char [ ] [ ] [ ] importsCache ; public ImportBinding [ ] onDemandImportsCache ; public int importCacheCount = 0 ; public int onDemandImportCacheCount = 0 ; public char [ ] currentPackageName = null ; public Engine ( Map settings ) { } public void accept ( IBinaryType binaryType , PackageBinding packageBinding , AccessRestriction accessRestriction ) { } public void accept ( ICompilationUnit sourceUnit , AccessRestriction accessRestriction ) { } public void accept ( ISourceType [ ] sourceTypes , PackageBinding packageBinding , AccessRestriction accessRestriction ) { } public abstract AssistParser getParser ( ) { } public void initializeImportCaches ( ) { } public void initializePackageCache ( ) { } protected boolean mustQualifyType ( char [ ] packageName , char [ ] typeName , char [ ] enclosingTypeNames , int modifiers ) { } protected ASTNode parseBlockStatements ( CompilationUnitDeclaration unit , int position ) { } private ASTNode parseBlockStatements ( TypeDeclaration type , CompilationUnitDeclaration unit , int position ) { TypeDeclaration [ ] memberTypes = type . memberTypes ; if ( memberTypes != null ) { int length = memberTypes . length ; for ( int i = 0 ; i < length ; i ++ ) { TypeDeclaration memberType = memberTypes [ i ] ; if ( ( memberType . bodyStart ) > position ) continue ; if ( ( memberType . declarationSourceEnd ) >= position ) { return parseBlockStatements ( memberType , unit , position ) ; } } } AbstractMethodDeclaration [ ] methods = type . methods ; if ( methods != null ) { int length = methods . length ; for ( int i = 0 ; i < length ; i ++ ) { AbstractMethodDeclaration method = methods [ i ] ; <START_BUG> if ( ( method . bodyStart ) > position ) <END_BUG> continue ; if ( method . isDefaultConstructor ( ) ) continue ; if ( ( method . declarationSourceEnd ) >= position ) { getParser ( ) . parseBlockStatements ( method , unit ) ; return method ; } } } FieldDeclaration [ ] fields = type . fields ; if ( fields != null ) { int length = fields . length ; for ( int i = 0 ; i < length ; i ++ ) { FieldDeclaration field = fields [ i ] ; if ( ( field . sourceStart ) > position ) continue ; if ( ( field . declarationSourceEnd ) >= position ) { if ( field instanceof Initializer ) { getParser ( ) . parseBlockStatements ( ( ( Initializer ) ( field ) ) , type , unit ) ; } return field ; } } } return null ; } protected void reset ( boolean resetLookupEnvironment ) { } public static char [ ] getTypeSignature ( TypeBinding typeBinding ) { } public static char [ ] getSignature ( MethodBinding methodBinding ) { } public static char [ ] getSignature ( TypeBinding typeBinding ) { } }

Fix:
if ( ( method . bodyStart ) > ( position + 1 ) )
Buggy code:
public class EJBRemoteServiceAdd extends AbstractBoottimeAddStepHandler { static final EJBRemoteServiceAdd INSTANCE = new EJBRemoteServiceAdd ( ) ; private EJBRemoteServiceAdd ( ) { } static ModelNode create ( final String connectorName ) { } @ Override protected void performBoottime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { final String connectorName = model . require ( EJB3SubsystemModel . CONNECTOR_REF ) . asString ( ) ; final ServiceTarget serviceTarget = context . getServiceTarget ( ) ; <START_BUG> final EJBRemoteConnectorService service = new EJBRemoteConnectorService ( ( ( byte ) ( 0 ) ) , new String [ ] { "river" } ) ; <END_BUG> newControllers . add ( serviceTarget . addService ( SERVICE_NAME , service ) . addDependency ( ENDPOINT , Endpoint . class , service . getEndpointInjector ( ) ) . setInitialMode ( ACTIVE ) . install ( ) ) ; } @ Override protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { } }

Fix:
final EJBRemoteConnectorService service = new EJBRemoteConnectorService ( ( ( byte ) ( 1 ) ) , new String [ ] { "river" } ) ;
Buggy code:
public class OperatorsTest { @ Test public void traditionalOperatorsExplored ( ) { } @ Test public void assignmentOperatorsExplored ( ) { String ab = "ab" ; assertEquals ( "ab" , ab ) ; int num = 10 ; assertEquals ( 10 , num ) ; num += 2 ; assertEquals ( "+=<seq2seq4repair_space>increments<seq2seq4repair_space>by" , 12 , num ) ; num -= 4 ; assertEquals ( "-=<seq2seq4repair_space>decrements<seq2seq4repair_space>by" , 8 , num ) ; num *= 2 ; assertEquals ( "*=<seq2seq4repair_space>multiplies<seq2seq4repair_space>by" , 16 , num ) ; num //= 4 ; <START_BUG> assertEquals ( "*=<seq2seq4repair_space>multiplies<seq2seq4repair_space>by" , 4 , num ) ; <END_BUG> num %= 3 ; assertEquals ( "%=<seq2seq4repair_space>modulus<seq2seq4repair_space>of" , 1 , num ) ; } @ Test public void incrementDecrementOperatorsExplored ( ) { } @ Test public void booleanOperatorsExplored ( ) { } @ Test public void conditionalOperatorsExplored ( ) { } @ Test public void ternaryOperatorsExplored ( ) { } @ Test public void bitwiseOperatorsExplored ( ) { } @ Test public void bitwiseAssignmentOperatorsExplored ( ) { } @ Test public void bitwiseShiftOperatorsExplored ( ) { } @ Test public void operatorPrecedence ( ) { } No newline ; at end ; of file ; }

Fix:
assertEquals ( "//=<seq2seq4repair_space>divides<seq2seq4repair_space>by" , 4 , num ) ;
Buggy code:
public class CriteriaExpressionBuilder { public QueryExpressions getQueryExpressions ( ExpressionFactory factory , CriteriaQueryImpl < ? > q ) { } protected void evalAccessPaths ( QueryExpressions exps , ExpressionFactory factory , CriteriaQueryImpl < ? > q ) { } protected void evalOrderingAndProjection ( QueryExpressions exps , ExpressionFactory factory , CriteriaQueryImpl < ? > q ) { } protected Map < Expression < ? > , Value > evalOrdering ( QueryExpressions exps , ExpressionFactory factory , CriteriaQueryImpl < ? > q ) { List < Order > orders = q . getOrderList ( ) ; MetamodelImpl model = q . getMetamodel ( ) ; int ordercount = ( orders == null ) ? 0 : orders . size ( ) ; Map < Expression < ? > , Value > exp2Vals = new HashMap < Expression < ? > , Value > ( ) ; exps . ordering = new Value [ ordercount ] ; exps . orderingClauses = new String [ ordercount ] ; exps . orderingAliases = new String [ ordercount ] ; exps . ascending = new boolean [ ordercount ] ; for ( int i = 0 ; i < ordercount ; i ++ ) { OrderImpl order = ( ( OrderImpl ) ( orders . get ( i ) ) ) ; <START_BUG> Expression < ? > expr = order . getExpression5 ( ) ; <END_BUG> Value val = Expressions . toValue ( ( ( ExpressionImpl < ? > ) ( expr ) ) , factory , model , q ) ; exps . ordering [ i ] = val ; String alias = expr . getAlias ( ) ; exps . orderingAliases [ i ] = alias ; exps . orderingClauses [ i ] = "" ; val . setAlias ( alias ) ; exps . ascending [ i ] = order . isAscending ( ) ; exp2Vals . put ( expr , val ) ; } return exp2Vals ; } protected void evalGrouping ( QueryExpressions exps , ExpressionFactory factory , CriteriaQueryImpl < ? > q ) { } protected void evalDistinct ( QueryExpressions exps , ExpressionFactory factory , CriteriaQueryImpl < ? > q ) { } protected void evalCrossJoinRoots ( QueryExpressions exps , ExpressionFactory factory , CriteriaQueryImpl < ? > q ) { } protected void evalFilter ( QueryExpressions exps , ExpressionFactory factory , CriteriaQueryImpl < ? > q ) { } protected void evalProjections ( QueryExpressions exps , ExpressionFactory factory , CriteriaQueryImpl < ? > q , Map < Expression < ? > , Value > exp2Vals ) { } private void getProjections ( QueryExpressions exps , List < Selection < ? > > selections , List < Value > projections , List < String > aliases , List < String > clauses , ExpressionFactory factory , CriteriaQueryImpl < ? > q , MetamodelImpl model , Map < Expression < ? > , Value > exp2Vals ) { } protected boolean isDefaultProjection ( List < Selection < ? > > selections , CriteriaQueryImpl < ? > q ) { } protected void evalFetchJoin ( QueryExpressions exps , ExpressionFactory factory , CriteriaQueryImpl < ? > q ) { } protected static Expression and ( ExpressionFactory factory , org . apache . openjpa . kernel . exps . Expression e1 , org . apache . openjpa . kernel . exps . Expression e2 ) { } }

Fix:
Expression < ? > expr = order . getExpression ( ) ;
Buggy code:
public class MarshallingView extends AbstractView { public static final String DEFAULT_CONTENT_TYPE = "application//xml" ; private Marshaller marshaller ; private String modelKey ; public MarshallingView ( ) { } public MarshallingView ( Marshaller marshaller ) { } public void setMarshaller ( Marshaller marshaller ) { } public void setModelKey ( String modelKey ) { } @ Override protected void initApplicationContext ( ) throws BeansException { } @ Override protected void renderMergedOutputModel ( Map model , HttpServletRequest request , HttpServletResponse response ) throws Exception { } protected Object locateToBeMarshalled ( Map model ) throws ServletException { if ( ( this . modelKey ) != null ) { Object o = model . get ( this . modelKey ) ; if ( o == null ) { throw new ServletException ( ( ( "Model<seq2seq4repair_space>contains<seq2seq4repair_space>no<seq2seq4repair_space>object<seq2seq4repair_space>with<seq2seq4repair_space>key<seq2seq4repair_space>[" + ( modelKey ) ) + "]" ) ) ; } if ( ! ( this . marshaller . supports ( o . getClass ( ) ) ) ) { throw new ServletException ( ( ( ( ( "Model<seq2seq4repair_space>object<seq2seq4repair_space>[" + o ) + "]<seq2seq4repair_space>retrieved<seq2seq4repair_space>via<seq2seq4repair_space>key<seq2seq4repair_space>[" ) + ( modelKey ) ) + "]<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>supported<seq2seq4repair_space>by<seq2seq4repair_space>the<seq2seq4repair_space>Marshaller" ) ) ; } return o ; } for ( Object o : model . values ( ) ) { <START_BUG> if ( this . marshaller . supports ( o . getClass ( ) ) ) { <END_BUG> return o ; } } return null ; } }

Fix:
if ( ( o != null ) && ( this . marshaller . supports ( o . getClass ( ) ) ) ) {
Buggy code:
public class TestCheckIndex extends LuceneTestCase { public void testDeletedDocs ( ) throws IOException { } public void testBogusTermVectors ( ) throws IOException { } public void testLuceneConstantVersion ( ) throws IOException { String version = System . getProperty ( "lucene.version" ) ; assertNotNull ( "null<seq2seq4repair_space>version" , version ) ; version = version . replaceAll ( "-.*$" , "" ) ; final String constantVersion ; String [ ] parts = LUCENE_MAIN_VERSION . split ( "\\." ) ; if ( ( parts . length ) == 4 ) { assert parts [ 2 ] . equals ( "0" ) ; constantVersion = ( ( parts [ 0 ] ) + "." ) + ( parts [ 1 ] ) ; } else { constantVersion = Constants . LUCENE_MAIN_VERSION ; } <START_BUG> assertTrue ( ( "Invalid<seq2seq4repair_space>version:<seq2seq4repair_space>" + version ) , version . equals ( constantVersion ) ) ; <END_BUG> assertTrue ( ( ( ( Constants . LUCENE_VERSION ) + "<seq2seq4repair_space>should<seq2seq4repair_space>start<seq2seq4repair_space>with:<seq2seq4repair_space>" ) + version ) , LUCENE_VERSION . startsWith ( version ) ) ; } }

Fix:
assertTrue ( ( ( ( "Invalid<seq2seq4repair_space>version:<seq2seq4repair_space>" + version ) + "<seq2seq4repair_space>vs<seq2seq4repair_space>" ) + constantVersion ) , version . equals ( constantVersion ) ) ;
Buggy code:
public class PartService implements IPartService { private static Point ZERO = new Point ( 0 , 0 ) ; private PartListenerList listeners = new PartListenerList ( ) ; private PartListenerList2 listeners2 = new PartListenerList2 ( ) ; private IWorkbenchPartReference activePart = null ; private String debugListenersKey ; private String debugListeners2Key ; public PartService ( String debugListenersKey , String debugListeners2Key ) { } public void addPartListener ( IPartListener l ) { } public void addPartListener ( IPartListener2 l ) { } public void removePartListener ( IPartListener l ) { } public void removePartListener ( IPartListener2 l ) { } private abstract class PartListener implements Listener { IWorkbenchPartReference ref ; public PartListener ( IWorkbenchPartReference ref ) { } public void handleEvent ( Event event ) { if ( ( ( ( event . type ) == ( SWT . Resize ) ) || ( ( event . type ) == ( SWT . Show ) ) ) || ( ( event . type ) == ( SWT . Activate ) ) ) { Control control = ( ( Control ) ( event . widget ) ) ; <START_BUG> if ( ( ( ! ( control . isDisposed ( ) ) ) && ( ! ( control . equals ( PartService . ZERO ) ) ) ) && ( control . isVisible ( ) ) ) { <END_BUG> removeMe ( event ) ; fire ( ) ; } } else if ( ( event . type ) == ( SWT . Dispose ) ) { removeMe ( event ) ; } } private void removeMe ( Event event ) { } abstract void fire ( ) { } } private class PartActivated extends PartService . PartListener { public PartActivated ( IWorkbenchPartReference ref ) { } void fire ( ) { } } private class PartVisible extends PartService . PartListener { public PartVisible ( IWorkbenchPartReference ref ) { } void fire ( ) { } } private class PartTop extends PartService . PartListener { public PartTop ( IWorkbenchPartReference ref ) { } void fire ( ) { } } private Control deferControl ( IWorkbenchPartReference ref ) { } private void firePartActivated ( IWorkbenchPartReference ref ) { } private void addControlListener ( Control control , PartService . PartListener listener ) { } public void firePartBroughtToTop ( IWorkbenchPartReference ref ) { } public void firePartClosed ( IWorkbenchPartReference ref ) { } private void firePartDeactivated ( IWorkbenchPartReference ref ) { } public void firePartVisible ( IWorkbenchPartReference ref ) { } public void firePartHidden ( IWorkbenchPartReference ref ) { } public void firePartInputChanged ( IWorkbenchPartReference ref ) { } public void firePartOpened ( IWorkbenchPartReference ref ) { } public IWorkbenchPart getActivePart ( ) { } public IWorkbenchPartReference getActivePartReference ( ) { } public void setActivePart ( IWorkbenchPartReference ref ) { } }

Fix:
if ( ( ( ! ( control . isDisposed ( ) ) ) && ( ! ( control . getSize ( ) . equals ( PartService . ZERO ) ) ) ) && ( control . isVisible ( ) ) ) {
Buggy code:
public class LookupWordCount { private static final String WORD_SPOUT = "WORD_SPOUT" ; private static final String LOOKUP_BOLT = "LOOKUP_BOLT" ; private static final String TOTAL_COUNT_BOLT = "TOTAL_COUNT_BOLT" ; public static void main ( String [ ] args ) throws Exception { Config config = new Config ( ) ; Map < String , Object > hbConf = new HashMap < String , Object > ( ) ; if ( ( args . length ) > 0 ) { hbConf . put ( "hbase.rootdir" , args [ 0 ] ) ; } config . put ( "hbase.conf" , hbConf ) ; WordSpout spout = new WordSpout ( ) ; TotalWordCounter totalBolt = new TotalWordCounter ( ) ; SimpleHBaseMapper mapper = new SimpleHBaseMapper ( ) . withRowKeyField ( "word" ) ; HBaseProjectionCriteria projectionCriteria = new HBaseProjectionCriteria ( ) ; projectionCriteria . addColumn ( new HBaseProjectionCriteria . ColumnMetaData ( "cf" , "count" ) ) ; <START_BUG> WordCountRowToStormValueMapper rowToTupleMapper = new WordCountRowToStormValueMapper ( ) ; <END_BUG> HBaseLookupBolt hBaseLookupBolt = new HBaseLookupBolt ( "WordCount" , mapper , rowToTupleMapper ) . withConfigKey ( "hbase.conf" ) . withProjectionCriteria ( projectionCriteria ) ; TopologyBuilder builder = new TopologyBuilder ( ) ; builder . setSpout ( LookupWordCount . WORD_SPOUT , spout , 1 ) ; builder . setBolt ( LookupWordCount . LOOKUP_BOLT , hBaseLookupBolt , 1 ) . shuffleGrouping ( LookupWordCount . WORD_SPOUT ) ; builder . setBolt ( LookupWordCount . TOTAL_COUNT_BOLT , totalBolt , 1 ) . fieldsGrouping ( LookupWordCount . LOOKUP_BOLT , new Fields ( "columnName" ) ) ; if ( ( args . length ) == 1 ) { LocalCluster cluster = new LocalCluster ( ) ; cluster . submitTopology ( "test" , config , builder . createTopology ( ) ) ; Thread . sleep ( 30000 ) ; cluster . killTopology ( "test" ) ; cluster . shutdown ( ) ; System . exit ( 0 ) ; } else if ( ( args . length ) == 2 ) { StormSubmitter . submitTopology ( args [ 1 ] , config , builder . createTopology ( ) ) ; } else { System . out . println ( "Usage:<seq2seq4repair_space>LookupWordCount<seq2seq4repair_space><hbase.rootdir>" ) ; } } }

Fix:
WordCountValueMapper rowToTupleMapper = new WordCountValueMapper ( ) ;
Buggy code:
public class ProgressManagerUtil { public static long SHORT_OPERATION_TIME = 250 ; static final QualifiedName KEEP_PROPERTY = IProgressConstants . KEEP_PROPERTY ; static final QualifiedName KEEPONE_PROPERTY = IProgressConstants . KEEPONE_PROPERTY ; static final Object [ ] EMPTY_OBJECT_ARRAY = new Object [ 0 ] ; static final QualifiedName INFRASTRUCTURE_PROPERTY = new QualifiedName ( WorkbenchPlugin . PI_WORKBENCH , "INFRASTRUCTURE_PROPERTY" ) ; private static String ellipsis = ProgressMessages . ProgressFloatingWindow_EllipsisValue ; static IStatus exceptionStatus ( Throwable exception ) { } static void logException ( Throwable exception ) { } static ViewerComparator getProgressViewerComparator ( ) { } static void openProgressView ( WorkbenchWindow window ) { } static String shortenText ( String textValue , Control control ) { } private static int findSecondWhitespace ( String textValue , GC gc , int maxWidth ) { } public static boolean rescheduleIfModalShellOpen ( Job openJob ) { } public static boolean safeToOpen ( ProgressMonitorJobsDialog dialog , Shell excludedShell ) { } public static Shell getModalShellExcluding ( Shell shell ) { IWorkbench workbench = PlatformUI . getWorkbench ( ) ; Shell [ ] shells = workbench . getDisplay ( ) . getShells ( ) ; int modal = ( ( SWT . APPLICATION_MODAL ) | ( SWT . SYSTEM_MODAL ) ) | ( SWT . PRIMARY_MODAL ) ; for ( int i = 0 ; i < ( shells . length ) ; i ++ ) { if ( shells [ i ] . equals ( shell ) ) { <START_BUG> break ; <END_BUG> } if ( shells [ i ] . isVisible ( ) ) { int style = shells [ i ] . getStyle ( ) ; if ( ( style & modal ) != 0 ) { return shells [ i ] ; } } } return null ; } public static Shell getDefaultParent ( ) { } public static Shell getNonModalShell ( ) { } public static void animateDown ( Rectangle startPosition ) { } public static void animateUp ( Rectangle endPosition ) { } static IShellProvider getShellProvider ( ) { } public static URL getIconsRoot ( ) { } public static URL getProgressSpinnerLocation ( ) { } }

Fix:
continue ;
Buggy code:
public class TimesDbHelper extends SQLiteOpenHelper { public static final String TAG = "TimesDbHelper" ; public static final int DATABASE_VERSION = 1 ; public static final String DATABASE_NAME = "Times.db" ; private static TimesDbHelper mDbHelper ; private static SQLiteDatabase mDb ; private TimesDbHelper ( Context context ) { } public void onCreate ( SQLiteDatabase db ) { } public void onUpgrade ( SQLiteDatabase db , int oldVersion , int newVersion ) { } public void onDowngrade ( SQLiteDatabase db , int oldVersion , int newVersion ) { } public static SQLiteDatabase getInstance ( Context context ) { } public static boolean dropDatabase ( ) { } public static boolean exportDb ( ) { File backupedDbDirectory = Environment . getExternalStoragePublicDirectory ( DIRECTORY_DOWNLOADS ) ; if ( backupedDbDirectory . canWrite ( ) ) { TimesDbHelper . mDb = null ; TimesDbHelper . mDbHelper . close ( ) ; FileChannel src ; FileChannel dst ; try { src = new FileInputStream ( TimesDbHelper . getDbSystemPath ( ) ) . getChannel ( ) ; <START_BUG> dst = new FileOutputStream ( ( backupedDbDirectory + ( TimesDbHelper . DATABASE_NAME ) ) ) . getChannel ( ) ; <END_BUG> dst . transferFrom ( src , 0 , src . size ( ) ) ; src . close ( ) ; dst . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; return false ; } finally { TimesDbHelper . mDb = TimesDbHelper . mDbHelper . getWritableDatabase ( ) ; } return true ; } return false ; } public static boolean importDb ( ) { } private static String getDbSystemPath ( ) { } }

Fix:
dst = new FileOutputStream ( ( ( backupedDbDirectory + "////" ) + ( TimesDbHelper . DATABASE_NAME ) ) ) . getChannel ( ) ;
Buggy code:
public class dnsSOARecord extends dnsRecord { dnsName host ; dnsName admin ; int serial ; int refresh ; int retry ; int expire ; int minimum ; public dnsSOARecord ( dnsName _name , short _dclass , int _ttl , dnsName _host , dnsName _admin , int _serial , int _refresh , int _retry , int _expire , int _minimum ) throws IOException { } public dnsSOARecord ( dnsName _name , short _dclass , int _ttl , int length , CountedDataInputStream in , dnsCompression c ) throws IOException { } public dnsSOARecord ( dnsName _name , short _dclass , int _ttl , MyStringTokenizer st , dnsName origin ) throws IOException { } public String toString ( ) { StringBuffer sb = toStringNoData ( ) ; if ( ( host ) != null ) { sb . append ( host ) ; sb . append ( "<seq2seq4repair_space>" ) ; sb . append ( admin ) ; sb . append ( "<seq2seq4repair_space>(\n\t\t\t\t\t" ) ; sb . append ( serial ) ; sb . append ( "\t;<seq2seq4repair_space>serial\n\t\t\t\t\t" ) ; sb . append ( refresh ) ; sb . append ( "\t;<seq2seq4repair_space>refresh\n\t\t\t\t\t" ) ; sb . append ( retry ) ; sb . append ( "\t;<seq2seq4repair_space>retry\n\t\t\t\t\t" ) ; sb . append ( expire ) ; <START_BUG> sb . append ( "\t;<seq2seq4repair_space>refresh\n\t\t\t\t\t" ) ; <END_BUG> sb . append ( minimum ) ; sb . append ( ")\t;<seq2seq4repair_space>minimum" ) ; } return sb . toString ( ) ; } byte [ ] rrToWire ( dnsCompression c ) throws IOException { } }

Fix:
sb . append ( "\t;<seq2seq4repair_space>expire\n\t\t\t\t\t" ) ;
Buggy code:
public class CodeSnippetSkeleton implements IBinaryType , EvaluationConstants { IBinaryMethod [ ] methods = new IBinaryMethod [ ] { new CodeSnippetSkeleton . BinaryMethodSkeleton ( "<init>" . toCharArray ( ) , "()V" . toCharArray ( ) , new char [ ] [ ] { } , true ) , new CodeSnippetSkeleton . BinaryMethodSkeleton ( "run" . toCharArray ( ) , "()V" . toCharArray ( ) , new char [ ] [ ] { "java//lang//Throwable" . toCharArray ( ) } , false ) , new CodeSnippetSkeleton . BinaryMethodSkeleton ( "setResult" . toCharArray ( ) , "(Ljava//lang//Object;Ljava//lang//Class;)V" . toCharArray ( ) , new char [ ] [ ] { } , false ) } ; public class BinaryMethodSkeleton implements IBinaryMethod { char [ ] [ ] exceptionTypeNames ; char [ ] methodDescriptor ; char [ ] selector ; boolean isConstructor ; public BinaryMethodSkeleton ( char [ ] selector , char [ ] methodDescriptor , char [ ] [ ] exceptionTypeNames , boolean isConstructor ) { } public char [ ] [ ] getExceptionTypeNames ( ) { } public char [ ] getMethodDescriptor ( ) { } public int getModifiers ( ) { } public char [ ] getSelector ( ) { } public boolean isClinit ( ) { } public boolean isConstructor ( ) { } public char [ ] [ ] getArgumentNames ( ) { } public char [ ] getGenericSignature ( ) { } } public CodeSnippetSkeleton ( ) { } public char [ ] getEnclosingTypeName ( ) { } public IBinaryField [ ] getFields ( ) { } public char [ ] getFileName ( ) { } public char [ ] getGenericSignature ( ) { } public char [ ] [ ] getInterfaceNames ( ) { } public IBinaryNestedType [ ] getMemberTypes ( ) { } public IBinaryMethod [ ] getMethods ( ) { } public int getModifiers ( ) { } public char [ ] getName ( ) { } public char [ ] getSuperclassName ( ) { } public boolean isAnonymous ( ) { } public boolean isBinaryType ( ) { } public int getKind ( ) { <START_BUG> return CLASS ; <END_BUG> } public boolean isLocal ( ) { } public boolean isMember ( ) { } public char [ ] sourceFileName ( ) { } }

Fix:
return CLASS_DECL ;
Buggy code:
public class CompoundAssignment extends Assignment implements OperatorIds { public int operator ; public int assignmentImplicitConversion ; public CompoundAssignment ( Expression lhs , Expression expression , int operator , int sourceEnd ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public String operatorToString ( ) { } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { constant = NotAConstant ; if ( ( ! ( ( this . lhs ) instanceof Reference ) ) || ( this . lhs . isThis ( ) ) ) { scope . problemReporter ( ) . expressionShouldBeAVariable ( this . lhs ) ; return null ; } TypeBinding lhsType = lhs . resolveType ( scope ) ; TypeBinding expressionType = expression . resolveType ( scope ) ; if ( ( lhsType == null ) || ( expressionType == null ) ) return null ; int lhsId = lhsType . id ; int expressionId = expressionType . id ; if ( ( restrainUsageToNumericTypes ( ) ) && ( ! ( lhsType . isNumericType ( ) ) ) ) { scope . problemReporter ( ) . operatorOnlyValidOnNumericType ( this , lhsType , expressionType ) ; return null ; } if ( ( lhsId > 15 ) || ( expressionId > 15 ) ) { if ( lhsId != ( T_String ) ) { scope . problemReporter ( ) . invalidOperator ( this , lhsType , expressionType ) ; return null ; } expressionId = T_Object ; } <START_BUG> int result = ResolveTypeTables [ operator ] [ ( ( lhsId << 4 ) + expressionId ) ] ; <END_BUG> if ( result == ( TypeIds . T_undefined ) ) { scope . problemReporter ( ) . invalidOperator ( this , lhsType , expressionType ) ; return null ; } if ( ( operator ) == ( OperatorIds . PLUS ) ) { if ( lhsId == ( TypeIds . T_JavaLangObject ) ) { scope . problemReporter ( ) . invalidOperator ( this , lhsType , expressionType ) ; return null ; } else { if ( ( ( lhsType . isNumericType ( ) ) || ( lhsId == ( TypeIds . T_boolean ) ) ) && ( ! ( expressionType . isNumericType ( ) ) ) ) { scope . problemReporter ( ) . invalidOperator ( this , lhsType , expressionType ) ; return null ; } } } lhs . implicitConversion = result > > > 12 ; expression . implicitConversion = ( result > > > 4 ) & 255 ; assignmentImplicitConversion = ( lhsId << 4 ) + ( result & 15 ) ; return this . resolvedType = lhsType ; } public boolean restrainUsageToNumericTypes ( ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope scope ) { } }

Fix:
int result = OperatorExpression . OperatorSignatures [ operator ] [ ( ( lhsId << 4 ) + expressionId ) ] ;
Buggy code:
class AuthenticationValidatingHandler implements OperationStepHandler { static final AuthenticationValidatingHandler INSTANCE = new AuthenticationValidatingHandler ( ) ; static ModelNode createOperation ( final ModelNode operationToValidate ) { PathAddress pa = PathAddress . pathAddress ( operationToValidate . require ( OP_ADDR ) ) ; PathAddress realmPA = null ; <START_BUG> for ( int i = ( pa . size ( ) ) - 1 ; i > 0 ; i ++ ) { <END_BUG> PathElement pe = pa . getElement ( i ) ; if ( SECURITY_REALM . equals ( pe . getKey ( ) ) ) { realmPA = pa . subAddress ( 0 , ( i + 1 ) ) ; break ; } } assert realmPA != null : "operationToValidate<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>an<seq2seq4repair_space>address<seq2seq4repair_space>that<seq2seq4repair_space>included<seq2seq4repair_space>a<seq2seq4repair_space>" + ( ModelDescriptionConstants . SECURITY_REALM ) ; return Util . getEmptyOperation ( "validate-authentication" , realmPA . toModelNode ( ) ) ; } private AuthenticationValidatingHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } }

Fix:
for ( int i = ( pa . size ( ) ) - 1 ; i > 0 ; i -- ) {
Buggy code:
public class TCPClientSOContainer extends ClientSOContainer { int keepAlive = 0 ; public static final String DEFAULT_COMM_NAME = Client . class . getName ( ) ; public TCPClientSOContainer ( ISharedObjectContainerConfig config ) { } public TCPClientSOContainer ( ISharedObjectContainerConfig config , int ka ) { } protected ISynchAsynchConnection makeConnection ( ID remoteSpace , Object data ) throws ConnectionInstantiationException { } public static final void main ( String [ ] args ) throws Exception { ISharedObjectContainerConfig config = new SOContainerConfig ( IDFactory . getDefault ( ) . makeGUID ( ) ) ; TCPClientSOContainer container = new TCPClientSOContainer ( config ) ; ID serverID = IDFactory . getDefault ( ) . makeStringID ( TCPServerSOContainer . getDefaultServerURL ( ) ) ; <START_BUG> container . joinGroup ( serverID , null ) ; <END_BUG> Thread . sleep ( 200000 ) ; } }

Fix:
container . connect ( serverID , null ) ;
Buggy code:
public class RunShellBuilder extends CommandLineBuilder { public RunShellBuilder ( String script , List < String > args ) { } public String [ ] buildCommandLine ( ) { List < String > cmds = new ArrayList < String > ( ) ; cmds . add ( "//bin//sh" ) ; <START_BUG> cmds . add ( "//xe" ) ; <END_BUG> cmds . add ( script ) ; cmds . addAll ( args ) ; return cmds . toArray ( new String [ ] { } ) ; } }

Fix:
cmds . add ( "-xe" ) ;
Buggy code:
public class AdminHome { private ArrayList < User > users ; private ArrayList < School > schools ; private DataBaseHome database ; public AdminHome ( User user ) { } public ArrayList < School > getSchools ( ) { } public ArrayList < User > getUsers ( ) { } public School editSchool ( String school , String state , String location , String control , int numStudents , double percentFemale , double satVerbal , double satMath , double expenses , double percentFinAid , int numApplicants , double percentAdmitted , double percentEnrolled , int academicScale , int socialScale , int qualOflife , String [ ] emphasis ) { } public School addNewSchool ( String school , String state , String location , String control , int numStudents , double percentFemale , double satVerbal , double satMath , double expenses , double percentFinAid , int numApplicants , double percentAdmitted , double percentEnrolled , int academicScale , int socialScale , int qualOflife , String [ ] emphasis ) { } public User addNewUser ( String firstName , String lastName , String username , String password , char type ) { } public User editUser ( String firstName , String lastName , String username , String password , char type , char status ) { } public void save ( ) { } public User getUser ( int ID ) { if ( ( ( this . users . size ( ) ) == ID ) || ( ID < 0 ) ) throw new IllegalArgumentException ( ) ; <START_BUG> return this . users . get ( ID ) ; <END_BUG> } }

Fix:
return this . database . getUsers ( ) . get ( ID ) ;
Buggy code:
public class RoseAndroidAppActivity extends Activity implements OnClickListener { @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } public void onClick ( View v ) { Intent myIntent = null ; switch ( v . getId ( ) ) { case id . feedback_button : myIntent = new Intent ( this , InAppFeedback . class ) ; startActivity ( myIntent ) ; break ; case id . student_lookup_button : myIntent = new Intent ( this , StudentLookupActivity . class ) ; startActivity ( myIntent ) ; break ; case id . ara_menu_button : Intent araIntent = new Intent ( this , Ara . class ) ; startActivity ( araIntent ) ; break ; case id . help_button : <START_BUG> Intent helpIntent = new Intent ( this , Ara . class ) ; <END_BUG> startActivity ( helpIntent ) ; break ; case id . schedule_lookup_button : myIntent = new Intent ( this , ScheduleLookupActivity . class ) ; startActivity ( myIntent ) ; break ; } } No newline ; at end ; of file ; }

Fix:
Intent helpIntent = new Intent ( this , Help . class ) ;
Buggy code:
public class JSwerveServlet extends HttpServlet { private Website website ; @ Override public void init ( ) throws ServletException { } private void spiderWar ( ServletContext ctx , String start , Set < Class < ? > > classes ) { } @ Override protected void service ( HttpServletRequest req , HttpServletResponse resp ) throws IOException , ServletException { HttpMethod method = HttpMethod . valueOf ( req . getMethod ( ) ) ; URI uri = extractUri ( req ) ; Headers headers = translateHeaders ( req ) ; Content content = new Content ( IOUtils . toByteArray ( req . getInputStream ( ) ) , req . getContentType ( ) ) ; Request request = new Request ( method , uri , headers , content ) ; try { Response response = website . service ( request ) ; resp . setStatus ( response . getStatus ( ) . getCode ( ) ) ; for ( Map . Entry < String , String > header : response . getHeaders ( ) ) resp . setHeader ( header . getKey ( ) , header . getValue ( ) ) ; <START_BUG> resp . getOutputStream ( ) . write ( response . getContent ( ) . getData ( ) ) ; <END_BUG> } catch ( StatusCodeException ex ) { resp . setStatus ( ex . getStatusCode ( ) . getCode ( ) ) ; ex . printStackTrace ( resp . getWriter ( ) ) ; } } private URI extractUri ( HttpServletRequest req ) throws ServletException { } private Headers translateHeaders ( HttpServletRequest req ) { } }

Fix:
resp . getOutputStream ( ) . write ( response . getBody ( ) . getData ( ) ) ;