nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ShapeView < O > extends FGELayeredView < O > { private static final Logger logger = Logger . getLogger ( ShapeView . class . getPackage ( ) . getName ( ) ) ; private ShapeGraphicalRepresentation < O > graphicalRepresentation ; private ShapeViewMouseListener mouseListener ; private DrawingController _controller ; private LabelView < O > _labelView ; public ShapeView ( ShapeGraphicalRepresentation < O > aGraphicalRepresentation , DrawingController < ? > controller ) { } public void disableFGEViewMouseListener ( ) { } public void enableFGEViewMouseListener ( ) { } private boolean isDeleted = false ; @ Override public boolean isDeleted ( ) { } @ Override public void delete ( ) { } @ Override public O getModel ( ) { } public O getDrawable ( ) { } @ Override public DrawingView < ? > getDrawingView ( ) { } @ Override public FGELayeredView getParent ( ) { } public FGELayeredView getParentView ( ) { } @ Override public ShapeGraphicalRepresentation < O > getGraphicalRepresentation ( ) { } public DrawingGraphicalRepresentation < ? > getDrawingGraphicalRepresentation ( ) { } @ Override public double getScale ( ) { } public void rescale ( ) { } private void relocateAndResizeView ( ) { } private void relocateView ( ) { } private void resizeView ( ) { } private void updateLayer ( ) { } private void updateVisibility ( ) { } private void updateLabelView ( ) { if ( ( ! ( getGraphicalRepresentation ( ) . getHasText ( ) ) ) && ( ( _labelView ) != null ) ) { _labelView . delete ( ) ; _labelView = null ; } else if ( ( getGraphicalRepresentation ( ) . getHasText ( ) ) && ( ( _labelView ) == null ) ) { _labelView = new LabelView < O > ( getGraphicalRepresentation ( ) , getController ( ) , this ) ; if ( ( getParentView ( ) ) != null ) { <START_BUG> getParentView ( ) . add ( getLabelView ( ) ) ; <END_BUG> } } } public Integer getLayer ( ) { } @ Override public void paint ( Graphics g ) { } private void doPaint ( Graphics g ) { } protected ShapeViewMouseListener makeShapeViewMouseListener ( ) { } @ Override public DrawingController < ? > getController ( ) { } @ Override public void update ( Observable o , Object aNotification ) { } public LabelView < O > getLabelView ( ) { } @ Override public void registerPalette ( DrawingPalette aPalette ) { } @ Override public FGEPaintManager getPaintManager ( ) { } @ Override public String getToolTipText ( MouseEvent event ) { } private BufferedImage screenshot ; public BufferedImage getScreenshot ( ) { } private void captureScreenshot ( ) { } }

Fix:
getParentView ( ) . add ( getLabelView ( ) , getLayer ( ) , ( - 1 ) ) ;
Buggy code:
public class EvoSimDriver { public static void main ( String [ ] args ) { } private static void getOption ( ) { try { MonoCreature mc1 = new MonoCreature ( "Q" , "Q" ) ; MonoCreature mc2 = new MonoCreature ( "q" , "q" ) ; <START_BUG> MonoHybrid m = new MonoHybrid ( 5 ) ; <END_BUG> m . seedParents ( mc1 , mc2 ) ; } catch ( IllegalArgumentException e ) { System . out . println ( "Wrong<seq2seq4repair_space>genotype<seq2seq4repair_space>entered!" ) ; } finally { System . out . println ( "\n\nEnd<seq2seq4repair_space>of<seq2seq4repair_space>program" ) ; } } }

Fix:
MonoHybrid m = new MonoHybrid ( 2 ) ;
Buggy code:
public class FunctionHelper extends JDialog implements ActionListener , ChangeListener { private static final long serialVersionUID = 240L ; private JLabeledChoice functionList ; private ArgumentsPanel parameterPanel ; private JLabeledTextField cutPasteFunction ; private final Map < String , Class < ? > > functionMap = new HashMap < String , Class < ? > > ( ) ; private JButton generateButton ; public FunctionHelper ( ) { } private void init ( ) { <START_BUG> parameterPanel = new ArgumentsPanel ( JMeterUtils . getResString ( "function_params" ) ) ; <END_BUG> initializeFunctionList ( ) ; this . getContentPane ( ) . setLayout ( new BorderLayout ( 10 , 10 ) ) ; JPanel comboPanel = new JPanel ( new FlowLayout ( FlowLayout . CENTER ) ) ; comboPanel . add ( functionList ) ; JButton helpButton = new JButton ( JMeterUtils . getResString ( "help" ) ) ; helpButton . addActionListener ( new FunctionHelper . HelpListener ( ) ) ; comboPanel . add ( helpButton ) ; this . getContentPane ( ) . add ( comboPanel , BorderLayout . NORTH ) ; this . getContentPane ( ) . add ( parameterPanel , BorderLayout . CENTER ) ; JPanel resultsPanel = new JPanel ( new FlowLayout ( FlowLayout . CENTER ) ) ; cutPasteFunction = new JLabeledTextField ( JMeterUtils . getResString ( "cut_paste_function" ) , 35 ) ; resultsPanel . add ( cutPasteFunction ) ; generateButton = new JButton ( JMeterUtils . getResString ( "generate" ) ) ; generateButton . addActionListener ( this ) ; resultsPanel . add ( generateButton ) ; this . getContentPane ( ) . add ( resultsPanel , BorderLayout . SOUTH ) ; this . pack ( ) ; ComponentUtil . centerComponentInWindow ( this ) ; } private void initializeFunctionList ( ) { } public void stateChanged ( ChangeEvent event ) { } public void actionPerformed ( ActionEvent e ) { } private class HelpListener implements ActionListener { public void actionPerformed ( ActionEvent e ) { } } }

Fix:
parameterPanel = new ArgumentsPanel ( JMeterUtils . getResString ( "function_params" ) , false ) ;
Buggy code:
public class LoadOnStartupInterceptor extends BaseInterceptor { private static StringManager sm = StringManager . getManager ( "org.apache.tomcat.resources" ) ; public LoadOnStartupInterceptor ( ) { } public void contextInit ( Context ctx ) { Hashtable loadableServlets = new Hashtable ( ) ; init ( ctx , loadableServlets ) ; Vector orderedKeys = new Vector ( ) ; Enumeration e = loadableServlets . keys ( ) ; while ( e . hasMoreElements ( ) ) { Integer key = ( ( Integer ) ( e . nextElement ( ) ) ) ; int slot = - 1 ; for ( int i = 0 ; i < ( orderedKeys . size ( ) ) ; i ++ ) { if ( ( key . intValue ( ) ) < ( ( ( Integer ) ( orderedKeys . elementAt ( i ) ) ) . intValue ( ) ) ) { slot = i ; break ; } } if ( slot > ( - 1 ) ) { orderedKeys . insertElementAt ( key , slot ) ; } else { orderedKeys . addElement ( key ) ; } } for ( int i = 0 ; i < ( orderedKeys . size ( ) ) ; i ++ ) { Integer key = ( ( Integer ) ( orderedKeys . elementAt ( i ) ) ) ; Enumeration sOnLevel = ( ( Vector ) ( loadableServlets . get ( key ) ) ) . elements ( ) ; while ( sOnLevel . hasMoreElements ( ) ) { String servletName = ( ( String ) ( sOnLevel . nextElement ( ) ) ) ; Handler result = ctx . getServletByName ( servletName ) ; if ( ( ctx . getDebug ( ) ) > 0 ) ctx . log ( ( ( ( "Loading<seq2seq4repair_space>" + key ) + "<seq2seq4repair_space>" ) + servletName ) ) ; if ( result == null ) log ( ( "Warning:<seq2seq4repair_space>we<seq2seq4repair_space>try<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>an<seq2seq4repair_space>undefined<seq2seq4repair_space>servlet<seq2seq4repair_space>" + servletName ) , WARNING ) ; else { try { if ( ( result instanceof ServletHandler ) && ( ( ( ( ServletHandler ) ( result ) ) . getServletInfo ( ) . getPath ( ) ) != null ) ) { loadJsp ( ctx , result ) ; } else { <START_BUG> result . init ( ) ; <END_BUG> } } catch ( Exception ee ) { String msg = LoadOnStartupInterceptor . sm . getString ( "context.loadServlet.e" , servletName ) ; log ( msg , ee ) ; } } } } } void loadJsp ( Context context , Handler result ) throws Exception { } void init ( Context ctx , Hashtable loadableServlets ) { } }

Fix:
( ( ServletHandler ) ( result ) ) . init ( ) ;
Buggy code:
public class StoryAnnotator implements Annotator { @ Override public void annotate ( @ NotNull PsiElement psiElement , @ NotNull AnnotationHolder annotationHolder ) { if ( ! ( psiElement instanceof LeafPsiElement ) ) { return ; } if ( ! ( ( ( ( LeafPsiElement ) ( psiElement ) ) . getElementType ( ) ) == ( StoryTokenType . STEP_TEXT ) ) ) { return ; } PsiElement parentElement = psiElement . getParent ( ) ; if ( ! ( parentElement instanceof StepPsiElement ) ) { return ; } StepPsiElement parentStepElement = ( ( StepPsiElement ) ( parentElement ) ) ; if ( ( parentStepElement . getReference ( ) . resolve ( ) ) == null ) { <START_BUG> annotationHolder . createErrorAnnotation ( psiElement , "No<seq2seq4repair_space>definition<seq2seq4repair_space>found<seq2seq4repair_space>for<seq2seq4repair_space>step" ) ; <END_BUG> } } }

Fix:
annotationHolder . createErrorAnnotation ( psiElement , "No<seq2seq4repair_space>definition<seq2seq4repair_space>found<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>step" ) ;
Buggy code:
public final class WidgetStatus { static boolean mediumWidget = false ; static boolean smallWidget = false ; private WidgetStatus ( ) { } public static void update ( Context context ) { SharedPreferences preferences = PrefSettings . getSharedPrefs ( context ) ; <START_BUG> if ( preferences . getBoolean ( "widgetEnabled" , false ) ) { <END_BUG> WidgetStatus . mediumWidget = true ; } else { WidgetStatus . mediumWidget = false ; } if ( preferences . getBoolean ( "widgetSmallEnabled" , false ) ) { WidgetStatus . smallWidget = true ; } else { WidgetStatus . smallWidget = false ; } if ( ( WidgetStatus . mediumWidget ) || ( WidgetStatus . smallWidget ) ) { Log . d ( TAG , "WidgetStatus.update():<seq2seq4repair_space>updating" ) ; AsyncTask < Context , Void , Context > updateDeckStatusAsyncTask = new WidgetStatus . UpdateDeckStatusAsyncTask ( ) ; updateDeckStatusAsyncTask . execute ( context ) ; } else { Log . d ( TAG , "WidgetStatus.update():<seq2seq4repair_space>not<seq2seq4repair_space>enabled" ) ; } } public static DeckStatus [ ] fetch ( Context context ) { } public static int [ ] fetchSmall ( Context context ) { } private static class UpdateDeckStatusAsyncTask extends AsyncTask < Context , Void , Context > { private static final DeckStatus [ ] EMPTY_DECK_STATUS = new DeckStatus [ 0 ] ; private static DeckStatus [ ] mDecks = WidgetStatus . UpdateDeckStatusAsyncTask . EMPTY_DECK_STATUS ; @ Override protected Context doInBackground ( Context ... params ) { } @ Override protected void onPostExecute ( Context context ) { } private static class ByDueComparator implements Comparator < DeckStatus > { @ Override public int compare ( DeckStatus deck1 , DeckStatus deck2 ) { } } private static final class AnkiFileFilter implements FileFilter { @ Override public boolean accept ( File pathname ) { } } } }

Fix:
if ( preferences . getBoolean ( "widgetMediumEnabled" , false ) ) {
Buggy code:
public class DiffusiveRandomMovementController extends MovementController { private static Random random = new Random ( ) ; public DiffusiveRandomMovementController ( CollisionHandler collHandle , MolComSim sim , Molecule mol ) { } protected Position decideNextPosition ( ) { Position currentPosition = getMolecule ( ) . getPosition ( ) ; int currentX = currentPosition . getX ( ) ; int currentY = currentPosition . getY ( ) ; int currentZ = currentPosition . getZ ( ) ; int maxXDelta = getSimulation ( ) . getSimParams ( ) . getMolRandMoveX ( ) ; int maxYDelta = getSimulation ( ) . getSimParams ( ) . getMolRandMoveY ( ) ; int maxZDelta = getSimulation ( ) . getSimParams ( ) . getMolRandMoveZ ( ) ; int nextX = ( currentX + ( DiffusiveRandomMovementController . random . nextInt ( ( 1 + ( 2 * maxXDelta ) ) ) ) ) - maxXDelta ; int nextY = ( currentY + ( DiffusiveRandomMovementController . random . nextInt ( ( 1 + ( 2 * maxYDelta ) ) ) ) ) - maxYDelta ; int nextZ = ( currentZ + ( DiffusiveRandomMovementController . random . nextInt ( ( 1 + ( 2 * maxZDelta ) ) ) ) ) - maxZDelta ; Position nextPosition = new Position ( nextX , nextY , nextZ ) ; if ( ( getMolecule ( ) . getMoleculeMovementType ( ) ) == ( MoleculeMovementType . ACTIVE ) ) { for ( Microtubule mt : getSimulation ( ) . getMicrotubules ( ) ) { <START_BUG> if ( mt . isNearby ( getMolecule ( ) . getPosition ( ) , getMolecule ( ) . getRadius ( ) ) ) { <END_BUG> CollisionHandler collH = ( simulation . isUsingCollisions ( ) ) ? simulation . decomposing ( ) ? new OnTubuleCollisionHandler ( new DecomposingCollisionHandler ( new SimpleCollisionHandler ( ) ) ) : new OnTubuleCollisionHandler ( new SimpleCollisionHandler ( ) ) : new NullCollisionHandler ( new SimpleCollisionHandler ( ) ) ; new OnMicrotubuleMovementController ( collH , getSimulation ( ) , getMolecule ( ) , mt ) ; break ; } } } return nextPosition ; } }

Fix:
if ( mt . isNearby ( getMolecule ( ) . getPosition ( ) ) ) {
Buggy code:
public class PrivacySettingsPep { private final UserProfile profile ; public PrivacySettingsPep ( UserProfile profile ) { } public boolean isAllowedToUpdateProfileActiveStatus ( ) { if ( ( profile ) == null ) { return false ; } if ( ! ( profile . getPrivacySettings ( ) . isProfileActive ( ) ) ) { return true ; } else { <START_BUG> return profile . isOwnerOfAtLeastOneProject ( ) ; <END_BUG> } } }

Fix:
return ! ( profile . isOwnerOfAtLeastOneProject ( ) ) ;
Buggy code:
public class CheckTestNamesTest extends SimpleBaseTest { @ Test public void checkWithChildSuites ( ) { } @ Test public void checkWithoutChildSuites ( ) { } private void runSuite ( String suitePath ) { } @ Test public void checkNoError ( ) { } @ Test public void checkNoErrorWtihChildSuites ( ) { TestListenerAdapter tla = new TestListenerAdapter ( ) ; TestNG tng = create ( ) ; String testngXmlPath = getPathToResource ( "sanitycheck//test-b.xml" ) ; tng . setTestSuites ( Arrays . asList ( testngXmlPath ) ) ; tng . addListener ( tla ) ; tng . run ( ) ; <START_BUG> Assert . assertEquals ( tla . getPassedTests ( ) . size ( ) , 4 ) ; <END_BUG> } @ Test public void checkTestNamesForProgrammaticSuites ( ) { } }

Fix:
Assert . assertEquals ( tla . getPassedTests ( ) . size ( ) , 6 ) ;
Buggy code:
public class ProposalChain { private Design proposalDesign ; private List < Design > versions ; private String owner ; private List < String > participants ; public ProposalChain ( Design rootProposalDesign ) { } public void addVersion ( Design versionDesign ) { <START_BUG> if ( ! ( versionDesign . isClassification ( PROPOSAL ) ) ) { <END_BUG> throw new IllegalArgumentException ( "Version<seq2seq4repair_space>designs<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>classified<seq2seq4repair_space>as<seq2seq4repair_space>a<seq2seq4repair_space>version" ) ; } else { versions . add ( versionDesign ) ; } } public Design getProposalRoot ( ) { } public List < Design > getAllVersions ( ) { } }

Fix:
if ( ! ( versionDesign . isClassification ( VERSION ) ) ) {
Buggy code:
public class DefaultTreeState implements IClusterable , ITreeState { private static final long serialVersionUID = 1L ; private boolean allowSelectMultiple = false ; private final List listeners = new ArrayList ( 1 ) ; private final Set nodes = new HashSet ( ) ; private boolean nodesCollapsed = false ; private final Set selectedNodes = new HashSet ( ) ; public void addTreeStateListener ( ITreeStateListener l ) { } public void collapseAll ( ) { } public void collapseNode ( TreeNode node ) { } public void expandAll ( ) { if ( ( nodes . isEmpty ( ) ) && ( ( nodesCollapsed ) == true ) ) { } else { nodes . clear ( ) ; nodesCollapsed = true ; Object [ ] listenersCopy = listeners . toArray ( ) ; for ( int i = 0 ; i < ( listenersCopy . length ) ; i ++ ) { ITreeStateListener l = ( ( ITreeStateListener ) ( listenersCopy [ i ] ) ) ; <START_BUG> l . allNodesCollapsed ( ) ; <END_BUG> } } } public void expandNode ( TreeNode node ) { } public Collection getSelectedNodes ( ) { } public boolean isAllowSelectMultiple ( ) { } public boolean isNodeExpanded ( TreeNode node ) { } public boolean isNodeSelected ( TreeNode node ) { } public void removeTreeStateListener ( ITreeStateListener l ) { } public void selectNode ( TreeNode node , boolean selected ) { } public void setAllowSelectMultiple ( boolean value ) { } }

Fix:
l . allNodesExpanded ( ) ;
Buggy code:
public class DocletInfo { private ArrayList m_params = new ArrayList ( ) ; private String m_name ; private Path m_path ; public void setName ( final String name ) { } public void setPath ( final Path path ) throws TaskException { if ( ( m_path ) == null ) { m_path = path ; } else { <START_BUG> m_path . append ( path ) ; <END_BUG> } } public String getName ( ) { } public Iterator getParams ( ) { } public Path getPath ( ) { } public DocletParam createParam ( ) { } public Path createPath ( ) throws TaskException { } }

Fix:
m_path . addPath ( path ) ;
Buggy code:
public class AnimatedEnemy extends AnimatedSprite { boolean isDead = false ; public AnimatedEnemy ( int xPos , int yPos , Animation animation ) { } @ Override public void update ( ) { } @ Override public void doCollision ( Sprite otherSprite ) { System . out . println ( "Let<seq2seq4repair_space>the<seq2seq4repair_space>bodies..." ) ; if ( ( getVelocityUpDown ( ) ) > 100 ) { <START_BUG> Animation animation = new Animation ( 1 , 1 , 69 , 67 , "boom" , 5 , 2 ) ; <END_BUG> setAnimation ( animation ) ; isDead = true ; } } }

Fix:
Animation animation = new Animation ( 1 , 1 , 69 , 67 , "boom" , 10 , 2 ) ;
Buggy code:
public class IfStatement extends Statement { public Expression condition ; public Statement thenStatement ; public Statement elseStatement ; boolean thenExit ; int thenInitStateIndex = - 1 ; int elseInitStateIndex = - 1 ; int mergedInitStateIndex = - 1 ; public IfStatement ( Expression condition , Statement thenStatement , int sourceStart , int sourceEnd ) { } public IfStatement ( Expression condition , Statement thenStatement , Statement elseStatement , int sourceStart , int sourceEnd ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { flowInfo = condition . analyseCode ( currentScope , flowContext , flowInfo ) ; Constant cst = this . condition . optimizedBooleanConstant ( ) ; boolean isConditionOptimizedTrue = ( cst != ( NotAConstant ) ) && ( ( cst . booleanValue ( ) ) == true ) ; boolean isConditionOptimizedFalse = ( cst != ( NotAConstant ) ) && ( ( cst . booleanValue ( ) ) == false ) ; FlowInfo thenFlowInfo = flowInfo . initsWhenTrue ( ) . copy ( ) ; if ( isConditionOptimizedFalse ) { thenFlowInfo . setReachMode ( FlowInfo . UNREACHABLE ) ; } FlowInfo elseFlowInfo = flowInfo . initsWhenFalse ( ) . copy ( ) ; if ( isConditionOptimizedTrue ) { elseFlowInfo . setReachMode ( FlowInfo . UNREACHABLE ) ; } <START_BUG> this . condition . checkNullComparison ( currentScope , flowInfo , thenFlowInfo , elseFlowInfo ) ; <END_BUG> if ( ( this . thenStatement ) != null ) { thenInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( thenFlowInfo ) ; if ( ! ( thenStatement . complainIfUnreachable ( thenFlowInfo , currentScope , false ) ) ) { thenFlowInfo = thenStatement . analyseCode ( currentScope , flowContext , thenFlowInfo ) ; } } this . thenExit = ! ( thenFlowInfo . isReachable ( ) ) ; if ( ( this . elseStatement ) != null ) { if ( ( ( thenFlowInfo == ( FlowInfo . DEAD_END ) ) && ( ( ( this . bits ) & ( ASTNode . IsElseIfStatement ) ) == 0 ) ) && ( ! ( ( this . elseStatement ) instanceof IfStatement ) ) ) { currentScope . problemReporter ( ) . unnecessaryElse ( this . elseStatement ) ; } elseInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( elseFlowInfo ) ; if ( ! ( elseStatement . complainIfUnreachable ( elseFlowInfo , currentScope , false ) ) ) { elseFlowInfo = elseStatement . analyseCode ( currentScope , flowContext , elseFlowInfo ) ; } } FlowInfo mergedInfo = FlowInfo . mergedOptimizedBranches ( thenFlowInfo , isConditionOptimizedTrue , elseFlowInfo , isConditionOptimizedFalse , true ) ; mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( mergedInfo ) ; return mergedInfo ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public StringBuffer printStatement ( int indent , StringBuffer output ) { } public void resolve ( BlockScope scope ) { } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
this . condition . checkNullComparison ( currentScope , flowContext , flowInfo , thenFlowInfo , elseFlowInfo ) ;
Buggy code:
public interface TypeManager extends Component , ComponentManager { String ROLE = "org.apache.myrmidon.components.type.TypeManager" ; <START_BUG> void registerType ( String role , String shorthandName , ComponentFactory factory ) throws Exception ; <END_BUG> }

Fix:
void registerType ( String role , String shorthandName , TypeFactory factory ) throws Exception ;
Buggy code:
public class ConcatFilterTest extends BuildFileTest { private static FileUtils fu = FileUtils . newFileUtils ( ) ; private static final String lSep = ( Os . isFamily ( "mac" ) ) ? "\r" : System . getProperty ( "line.separator" ) ; private static final String FILE_PREPEND_WITH = ( ( ( ( ( ( ( ( "this-should-be-the-first-line" + ( ConcatFilterTest . lSep ) ) + "Line<seq2seq4repair_space>1" ) + ( ConcatFilterTest . lSep ) ) + "Line<seq2seq4repair_space>2" ) + ( ConcatFilterTest . lSep ) ) + "Line<seq2seq4repair_space>3" ) + ( ConcatFilterTest . lSep ) ) + "Line<seq2seq4repair_space>4" ) + ( ConcatFilterTest . lSep ) ; private static final String FILE_PREPEND = ( ( ( ( ( ( ( ( "Line<seq2seq4repair_space>1" + ( ConcatFilterTest . lSep ) ) + "Line<seq2seq4repair_space>2" ) + ( ConcatFilterTest . lSep ) ) + "Line<seq2seq4repair_space>3" ) + ( ConcatFilterTest . lSep ) ) + "Line<seq2seq4repair_space>4" ) + ( ConcatFilterTest . lSep ) ) + "Line<seq2seq4repair_space>5" ) + ( ConcatFilterTest . lSep ) ; private static final String FILE_APPEND_WITH = ( ( ( ( ( ( ( ( "Line<seq2seq4repair_space>57" + ( ConcatFilterTest . lSep ) ) + "Line<seq2seq4repair_space>58" ) + ( ConcatFilterTest . lSep ) ) + "Line<seq2seq4repair_space>59" ) + ( ConcatFilterTest . lSep ) ) + "Line<seq2seq4repair_space>60" ) + ( ConcatFilterTest . lSep ) ) + "this-should-be-the-last-line" ) + ( ConcatFilterTest . lSep ) ; private static final String FILE_APPEND = ( ( ( ( ( ( ( ( "Line<seq2seq4repair_space>56" + ( ConcatFilterTest . lSep ) ) + "Line<seq2seq4repair_space>57" ) + ( ConcatFilterTest . lSep ) ) + "Line<seq2seq4repair_space>58" ) + ( ConcatFilterTest . lSep ) ) + "Line<seq2seq4repair_space>59" ) + ( ConcatFilterTest . lSep ) ) + "Line<seq2seq4repair_space>60" ) + ( ConcatFilterTest . lSep ) ; public ConcatFilterTest ( String name ) { } public void setUp ( ) { } public void tearDown ( ) { } public void testFilterReaderNoArgs ( ) throws IOException { } public void testFilterReaderBefore ( ) { } public void testFilterReaderAfter ( ) { } public void testFilterReaderBeforeAfter ( ) { } public void testConcatFilter ( ) { } public void testConcatFilterBefore ( ) { } public void testConcatFilterAfter ( ) { } public void testConcatFilterBeforeAfter ( ) { } protected void doTest ( String target , String expectedStart , String expectedEnd ) { } protected String read ( String filename ) { String content = null ; try { File file = getProject ( ) . resolveFile ( filename ) ; FileReader rdr = new FileReader ( file ) ; <START_BUG> content = ConcatFilterTest . fu . readFully ( rdr ) ; <END_BUG> rdr . close ( ) ; rdr = null ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return content ; } }

Fix:
content = FileUtils . readFully ( rdr ) ;
Buggy code:
public class TCCLSetterVisitor extends ClassAdapter implements ClassVisitor , Opcodes { private static final String GENERATED_METHOD_NAME = "$$FCCL$$" ; private static final String UTIL_CLASS = Util . class . getName ( ) . replace ( '.' , '//' ) ; private static final String VOID_RETURN_TYPE = "()V" ; private final String targetClass ; private final WeavingData [ ] weavingData ; private boolean additionalImportRequired = false ; public TCCLSetterVisitor ( ClassVisitor cv , String className , WeavingData [ ] weavingData ) { } @ Override public MethodVisitor visitMethod ( int access , String name , String desc , String signature , String [ ] exceptions ) { } @ Override public void visitEnd ( ) { } private String getGeneratedMethodName ( WeavingData wd ) { } private class TCCLSetterMethodVisitor extends MethodAdapter implements MethodVisitor { Type lastLDCType ; public TCCLSetterMethodVisitor ( MethodVisitor mv ) { } @ Override public void visitLdcInsn ( Object cst ) { } @ Override public void visitMethodInsn ( int opcode , String owner , String name , String desc ) { System . out . println ( ( ( ( ( ( ( ( "###<seq2seq4repair_space>" + opcode ) + ":<seq2seq4repair_space>" ) + owner ) + "#" ) + name ) + "#" ) + desc ) ) ; WeavingData wd = findWeavingData ( owner , name , desc ) ; if ( ( opcode == ( INVOKESTATIC ) ) && ( wd != null ) ) { System . out . println ( "+++<seq2seq4repair_space>Gotcha!" ) ; additionalImportRequired = true ; mv . visitMethodInsn ( INVOKESTATIC , TCCLSetterVisitor . UTIL_CLASS , "storeContextClassloader" , TCCLSetterVisitor . VOID_RETURN_TYPE ) ; <START_BUG> if ( ( ( ServiceLoader . class . getName ( ) . equals ( wd . getClassName ( ) ) ) && ( "load" . equals ( wd . getMethodName ( ) ) ) ) && ( Arrays . equals ( new String [ ] { Class . class . getName ( ) } , wd . getArgClasses ( ) ) ) ) { <END_BUG> mv . visitLdcInsn ( lastLDCType ) ; } else { Type type = Type . getObjectType ( owner ) ; mv . visitLdcInsn ( type ) ; } mv . visitMethodInsn ( INVOKESTATIC , targetClass , getGeneratedMethodName ( wd ) , "(Ljava//lang//Class;)V" ) ; super . visitMethodInsn ( opcode , owner , name , desc ) ; mv . visitMethodInsn ( INVOKESTATIC , TCCLSetterVisitor . UTIL_CLASS , "restoreContextClassloader" , TCCLSetterVisitor . VOID_RETURN_TYPE ) ; } else { super . visitMethodInsn ( opcode , owner , name , desc ) ; } } private WeavingData findWeavingData ( String owner , String methodName , String methodDesc ) { } } public boolean additionalImportRequired ( ) { } }

Fix:
if ( ( ( ServiceLoader . class . getName ( ) . equals ( wd . getClassName ( ) ) ) && ( "load" . equals ( wd . getMethodName ( ) ) ) ) && ( ( ( wd . getArgClasses ( ) ) == null ) || ( Arrays . equals ( new String [ ] { Class . class . getName ( ) } , wd . getArgClasses ( ) ) ) ) ) {
Buggy code:
public class RenameFolderAction extends AbstractColumbaAction implements SelectionListener { public RenameFolderAction ( FrameMediator frameMediator ) { } public void actionPerformed ( ActionEvent evt ) { } public void selectionChanged ( SelectionChangedEvent evt ) { if ( ( ( ( org . columba . mail . gui . tree . selection . TreeSelectionChangedEvent ) ( evt ) ) . getSelected ( ) . length ) > 0 ) { AbstractFolder folder = ( ( org . columba . mail . gui . tree . selection . TreeSelectionChangedEvent ) ( evt ) ) . getSelected ( ) [ 0 ] ; if ( ( folder != null ) && ( folder instanceof MessageFolder ) ) { <START_BUG> FolderItem item = folder . getFolderItem ( ) ; <END_BUG> if ( item . get ( "property" , "accessrights" ) . equals ( "user" ) ) { setEnabled ( true ) ; } else { setEnabled ( false ) ; } } } else { setEnabled ( false ) ; } } }

Fix:
FolderItem item = folder . getConfiguration ( ) ;
Buggy code:
public abstract class WorkbenchWizardListSelectionPage extends WorkbenchWizardSelectionPage implements IDoubleClickListener , ISelectionChangedListener { private String message ; private static final String STORE_SELECTED_WIZARD_ID = "WizardListSelectionPage.STORE_SELECTED_WIZARD_ID" ; private static final int SIZING_LISTS_HEIGHT = 200 ; private static final int SIZING_LISTS_WIDTH = 150 ; protected WorkbenchWizardListSelectionPage ( IWorkbench aWorkbench , IStructuredSelection currentSelection , AdaptableList wizardElements , String message ) { } public void createControl ( Composite parent ) { Font font = parent . getFont ( ) ; Composite outerContainer = new Composite ( parent , SWT . NONE ) ; outerContainer . setLayout ( new GridLayout ( ) ) ; outerContainer . setLayoutData ( new GridData ( ( ( GridData . VERTICAL_ALIGN_FILL ) | ( GridData . HORIZONTAL_ALIGN_FILL ) ) ) ) ; outerContainer . setFont ( font ) ; Label messageLabel = new Label ( outerContainer , SWT . NONE ) ; messageLabel . setText ( message ) ; messageLabel . setFont ( font ) ; Table table = new Table ( outerContainer , SWT . BORDER ) ; GridData data = new GridData ( GridData . FILL_BOTH ) ; <START_BUG> int availableRows = Dialog . availableRows ( parent ) ; <END_BUG> if ( availableRows > 50 ) { data . heightHint = WorkbenchWizardListSelectionPage . SIZING_LISTS_HEIGHT ; } else { data . heightHint = availableRows * 3 ; } table . setLayoutData ( data ) ; table . setFont ( font ) ; wizardSelectionViewer = new TableViewer ( table ) ; wizardSelectionViewer . setContentProvider ( new WorkbenchContentProvider ( ) ) ; wizardSelectionViewer . setLabelProvider ( new WorkbenchLabelProvider ( ) ) ; wizardSelectionViewer . setSorter ( new WorkbenchViewerSorter ( ) ) ; wizardSelectionViewer . addSelectionChangedListener ( this ) ; wizardSelectionViewer . addDoubleClickListener ( this ) ; wizardSelectionViewer . setInput ( wizardElements ) ; restoreWidgetValues ( ) ; setControl ( outerContainer ) ; } protected abstract IWizardNode createWizardNode ( WorkbenchWizardElement element ) { } public void doubleClick ( DoubleClickEvent event ) { } private void restoreWidgetValues ( ) { } public void saveWidgetValues ( ) { } public void selectionChanged ( SelectionChangedEvent event ) { } }

Fix:
int availableRows = DialogUtil . availableRows ( parent ) ;
Buggy code:
public class ExampleRunner { public static void main ( String [ ] args ) throws Exception { DeploymentUtils utils = null ; try { utils = new DeploymentUtils ( ) ; <START_BUG> utils . addWarDeployment ( "jaxrs-example.war" , HelloWorldResource . class . getPackage ( ) , true ) ; <END_BUG> utils . deploy ( ) ; ExampleRunner . performCall ( ) ; } finally { utils . undeploy ( ) ; safeClose ( utils ) ; } } private static void performCall ( ) throws Exception { } }

Fix:
utils . addWarDeployment ( "jaxrs-example.war" , true , HelloWorldResource . class . getPackage ( ) ) ;
Buggy code:
public class BGMCSat { private int numSamples = 0 ; private ArrayList < ArrayList < Integer > > sampleCounts ; private ArrayList < ArrayList < Clause > > clusters ; private void sweep ( ) { for ( int clusterId = 0 ; clusterId < ( clusters . size ( ) ) ; clusterId ++ ) { MCSat mcsat = new MCSat ( clusterId , clusters . get ( clusterId ) ) ; <START_BUG> mcsat . sample ( ) ; <END_BUG> } } private void collectSample ( ) { } public void run ( int numSweeps , int collectSampleFrequency ) { } public BGMCSat ( ArrayList < ArrayList < Clause > > clusters ) { } }

Fix:
mcsat . sample ( 0 ) ;
Buggy code:
public class HostMgmtPresenter extends Presenter < HostMgmtPresenter . MyView , HostMgmtPresenter . MyProxy > implements HostSelectionEvent . HostSelectionListener { private final PlaceManager placeManager ; private HostInformationStore hostInfoStore ; private CurrentHostSelection hostSelection ; private boolean hasBeenRevealed ; @ ContentSlot public static final GwtEvent . Type < RevealContentHandler < ? > > TYPE_MainContent = new GwtEvent . Type < RevealContentHandler < ? > > ( ) ; private BootstrapContext bootstrap ; private String lastSubPlace ; @ ProxyCodeSplit @ NameToken ( NameTokens . HostMgmtPresenter ) public interface MyProxy extends Place , Proxy < HostMgmtPresenter > { } public interface MyView extends View { void setPresenter ( HostMgmtPresenter presenter ) { } void updateHosts ( List < Host > hosts ) { } } @ Inject public HostMgmtPresenter ( EventBus eventBus , HostMgmtPresenter . MyView view , HostMgmtPresenter . MyProxy proxy , PlaceManager placeManager , HostInformationStore hostInfoStore , CurrentHostSelection hostSelection , BootstrapContext bootstrap ) { } @ Override protected void onBind ( ) { } @ Override protected void onReset ( ) { super . onReset ( ) ; if ( ( bootstrap . getInitialPlace ( ) ) != null ) { Scheduler . get ( ) . scheduleDeferred ( new Scheduler . ScheduledCommand ( ) { @ Override public void execute ( ) { MODULES . getEventBus ( ) . fireEvent ( new org . jboss . ballroom . client . layout . LHSHighlightEvent ( bootstrap . getInitialPlace ( ) ) ) ; bootstrap . setInitialPlace ( null ) ; } } ) ; } MODULES . getHeader ( ) . highlight ( NameTokens . HostMgmtPresenter ) ; String currentToken = placeManager . getCurrentPlaceRequest ( ) . getNameToken ( ) ; if ( ! ( currentToken . equals ( getProxy ( ) . getNameToken ( ) ) ) ) { lastSubPlace = currentToken ; } else if ( ( lastSubPlace ) != null ) { placeManager . revealPlace ( new PlaceRequest ( lastSubPlace ) ) ; } if ( ( ! ( hasBeenRevealed ) ) && ( NameTokens . HostMgmtPresenter . equals ( placeManager . getCurrentPlaceRequest ( ) . getNameToken ( ) ) ) ) { <START_BUG> placeManager . revealRelativePlace ( new PlaceRequest ( NameTokens . ServerPresenter ) ) ; <END_BUG> hasBeenRevealed = true ; Scheduler . get ( ) . scheduleDeferred ( new Scheduler . ScheduledCommand ( ) { @ Override public void execute ( ) { getEventBus ( ) . fireEvent ( new org . jboss . ballroom . client . layout . LHSHighlightEvent ( null , CONSTANTS . common_label_serverConfigs ( ) , "hosts" ) ) ; } } ) ; } hostInfoStore . getHosts ( new org . jboss . as . console . client . domain . model . SimpleCallback < List < Host > > ( ) { @ Override public void onSuccess ( List < Host > hosts ) { if ( ! ( hostSelection . isSet ( ) ) ) selectDefaultHost ( hosts ) ; getView ( ) . updateHosts ( hosts ) ; } } ) ; } private void selectDefaultHost ( List < Host > hosts ) { } @ Override protected void revealInParent ( ) { } @ Override public void onHostSelection ( String hostName ) { } }

Fix:
placeManager . revealPlace ( new PlaceRequest ( NameTokens . ServerPresenter ) ) ;
Buggy code:
public class IncludesVisitorTest extends BaseTest { private File schema ; private File include0 ; @ Before public void setUp ( ) { } @ Test public void validate ( ) { } @ Test public void testUnmarshalling ( ) throws Throwable { LemsParser parser = new LemsParser ( include0 , schema ) ; parser . processIncludes ( ) ; <START_BUG> assertEquals ( parser . getLems ( ) . getConstant ( ) . size ( ) , 2 ) ; <END_BUG> } }

Fix:
assertEquals ( parser . getLems ( ) . getConstant ( ) . size ( ) , 3 ) ;
Buggy code:
final class CollectionToObjectConverter implements ConditionalGenericConverter { private final ConversionService conversionService ; public CollectionToObjectConverter ( ConversionService conversionService ) { } public Set < ConvertiblePair > getConvertibleTypes ( ) { } public boolean matches ( TypeDescriptor sourceType , TypeDescriptor targetType ) { } public Object convert ( Object source , TypeDescriptor sourceType , TypeDescriptor targetType ) { if ( source == null ) { return null ; } Collection < ? > sourceCollection = ( ( Collection < ? > ) ( source ) ) ; if ( ( sourceCollection . size ( ) ) == 0 ) { return null ; } Object firstElement = sourceCollection . iterator ( ) . next ( ) ; <START_BUG> return this . conversionService . convert ( firstElement , sourceType . getElementTypeDescriptor ( ) . applyIndexedObject ( firstElement ) , targetType ) ; <END_BUG> } }

Fix:
return this . conversionService . convert ( firstElement , sourceType . getElementTypeDescriptor ( ) , targetType ) ;
Buggy code:
public class DropDownChoice < T > extends AbstractSingleSelectChoice < T > implements IOnChangeListener { private static final long serialVersionUID = 1L ; public DropDownChoice ( final String id ) { } public DropDownChoice ( final String id , final List < ? extends T > choices ) { } public DropDownChoice ( final String id , final List < ? extends T > choices , final IChoiceRenderer < ? super T > renderer ) { } public DropDownChoice ( final String id , IModel < T > model , final List < ? extends T > choices ) { } public DropDownChoice ( final String id , IModel < T > model , final List < ? extends T > choices , final IChoiceRenderer < ? super T > renderer ) { } public DropDownChoice ( String id , IModel < ? extends List < ? extends T > > choices ) { } public DropDownChoice ( String id , IModel < T > model , IModel < ? extends List < ? extends T > > choices ) { } public DropDownChoice ( String id , IModel < ? extends List < ? extends T > > choices , IChoiceRenderer < ? super T > renderer ) { } public DropDownChoice ( String id , IModel < T > model , IModel < ? extends List < ? extends T > > choices , IChoiceRenderer < ? super T > renderer ) { } public final void onSelectionChanged ( ) { } @ Override protected void onComponentTag ( final ComponentTag tag ) { checkComponentTag ( tag , "select" ) ; if ( wantOnSelectionChangedNotifications ( ) ) { CharSequence url = DropDownChoice . urlFor ( new org . apache . wicket . request . handler . ListenerInterfaceRequestHandler ( new org . apache . wicket . request . handler . PageAndComponentProvider ( DropDownChoice . getPage ( ) , this ) , IOnChangeListener . INTERFACE ) ) ; Form < ? > form = DropDownChoice . findParent ( Form . class ) ; if ( form != null ) { tag . put ( "onchange" , form . getJsForInterfaceUrl ( url . toString ( ) ) ) ; } else { <START_BUG> tag . put ( "onchange" , ( ( ( ( "window.location.href='" + url ) + ( ( url . toString ( ) . indexOf ( '?' ) ) > ( - 1 ) ? "&amp;" : "?" ) ) + ( DropDownChoice . getInputName ( ) ) ) + "='<seq2seq4repair_space>+<seq2seq4repair_space>this.options[this.selectedIndex].value;" ) ) ; <END_BUG> } } super . onComponentTag ( tag ) ; } protected void onSelectionChanged ( final T newSelection ) { } protected boolean wantOnSelectionChangedNotifications ( ) { } @ Override protected boolean getStatelessHint ( ) { } }

Fix:
tag . put ( "onchange" , ( ( ( ( "window.location.href='" + url ) + ( ( url . toString ( ) . indexOf ( '?' ) ) > ( - 1 ) ? "&" : "?" ) ) + ( DropDownChoice . getInputName ( ) ) ) + "='<seq2seq4repair_space>+<seq2seq4repair_space>this.options[this.selectedIndex].value;" ) ) ;
Buggy code:
public class Query implements Assignable { private Set < Projection > projections = new LinkedHashSet < Projection > ( ) ; private boolean selectAll = false ; private Target target = Target . DEFAULT ; private Map < String , Assignable > letMap = Maps . newLinkedHashMap ( ) ; private Set < Clause > clauses = Sets . newLinkedHashSet ( ) ; private Set < Ordering > orderBy = Sets . newLinkedHashSet ( ) ; private Optional < Projection > groupBy = Optional . absent ( ) ; private Optional < String > limit = Optional . absent ( ) ; private Set < String > fetchPlan = Sets . newLinkedHashSet ( ) ; private int skipValue = 0 ; private String skipVariable = "" ; private Optional < Long > timeoutInMS = Optional . absent ( ) ; private Optional < TimeoutStrategy > timeoutStrategy = Optional . absent ( ) ; private Optional < LockingStrategy > lock = Optional . absent ( ) ; private boolean isParallel = false ; public Query select ( Projection s ) { } public Query select ( String s ) { } public Query select ( Projection ... projections ) { } public Query select ( String ... projections ) { } public Query from ( Target target ) { } public Query from ( String target ) { } public Query where ( Clause clause ) { } public Query orderBy ( String field ) { } public Query orderBy ( Projection projection ) { } public Query orderByDesc ( String field ) { } public Query orderByDesc ( Projection projection ) { } public Query limit ( int l ) { } public Query limit ( String variable ) { } public Query fetchPlan ( FetchingStrategy strategy ) { } public Query skip ( int toSkip ) { } public Query skip ( String variable ) { } public Query groupBy ( String field ) { } public Query groupBy ( Projection projection ) { } public Query let ( String variable , Assignable assignment ) { <START_BUG> letMap . put ( variable , assignment ) ; <END_BUG> return this ; } public Query timeout ( long timeoutInMS , TimeoutStrategy strategy ) { } public Query timeout ( long timeoutInMS ) { } public Query lockRecord ( ) { } public Query lockReset ( ) { } public Query lock ( LockingStrategy strategy ) { } public Query parallel ( ) { } public Query parallel ( boolean isParallel ) { } public String toString ( ) { } private String joinProjections ( ) { } private String joinLet ( ) { } private String joinWhere ( ) { } private String generateGroupBy ( ) { } private String joinOrderBy ( ) { } private String generateSkip ( ) { } private String generateLimit ( ) { } private String generateFetchPlan ( ) { } private String generateTimeout ( ) { } private String generateLock ( ) { } private String generateParallel ( ) { } @ Override public String getAssignment ( ) { } No newline ; at end ; of file ; }

Fix:
letMap . put ( ( "$" + variable ) , assignment ) ;
Buggy code:
public class PlanExecutor { private ServerSkeleton alfieServer ; private static final int DRIBBLE_SPEED = 30 ; private static final boolean VERBOSE = false ; public PlanExecutor ( ServerSkeleton alfieServer ) { } public void execute ( ComplexCommand currentCommand ) { } private void executeReachDestinationCommand ( ReachDestinationCommand currentCommand ) { Point2D target = currentCommand . getTarget ( ) ; Point2D Alfie = currentCommand . getOrigin ( ) ; double facing = currentCommand . getFacing ( ) ; int actualDistance = getDistance ( target , Alfie ) ; int distance = actualDistance ; if ( PlanExecutor . VERBOSE ) { System . out . print ( ( ( "the<seq2seq4repair_space>distance<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>ball<seq2seq4repair_space>is<seq2seq4repair_space>:<seq2seq4repair_space>" + distance ) + "\n" ) ) ; } int angleToTurn = ( ( int ) ( getAngleToTarget ( target , Alfie , facing ) ) ) ; if ( angleToTurn > 180 ) { angleToTurn = 360 - angleToTurn ; if ( PlanExecutor . VERBOSE ) { System . out . print ( ( ( "Alie<seq2seq4repair_space>must<seq2seq4repair_space>turn<seq2seq4repair_space>Right<seq2seq4repair_space>at<seq2seq4repair_space>angle<seq2seq4repair_space>of<seq2seq4repair_space>:<seq2seq4repair_space>" + angleToTurn ) + "\n" ) ) ; } alfieServer . sendSpinRight ( 512 , angleToTurn ) ; } else { alfieServer . sendSpinLeft ( 512 , angleToTurn ) ; if ( PlanExecutor . VERBOSE ) { System . out . print ( ( ( "Alie<seq2seq4repair_space>must<seq2seq4repair_space>turn<seq2seq4repair_space>left<seq2seq4repair_space>at<seq2seq4repair_space>angle<seq2seq4repair_space>of<seq2seq4repair_space>:<seq2seq4repair_space>" + angleToTurn ) + "\n" ) ) ; } } <START_BUG> alfieServer . sendGoForward ( 512 , distance ) ; <END_BUG> } private void executeDribbleCommand ( DribbleCommand currentCommand ) { } private void executeKickCommand ( KickCommand currentCommand ) { } private double getAngleToTarget ( Point2D target , Point2D alfie , double facing ) { } public int getDistance ( Point2D ball , Point2D alfie ) { } }

Fix:
alfieServer . sendGoForward ( 512 , 0 ) ;
Buggy code:
public class AndroidDeviceSelector { private static Logger log = Logger . getLogger ( AndroidDeviceSelector . class . getName ( ) ) ; @ Inject @ SuiteScoped private InstanceProducer < AndroidDevice > androidDevice ; @ Inject private Event < AndroidVirtualDeviceCreated > avdCreated ; @ Inject private Event < AndroidVirtualDeviceAvailable > avdAvailable ; @ Inject private Event < AndroidDeviceReady > androidDeviceReady ; @ SuppressWarnings ( "serial" ) public void getOrCreateAndroidDevice ( @ Observes AndroidBridgeInitialized event , ProcessExecutor executor , AndroidExtensionConfiguration configuration , AndroidSdk sdk ) throws IOException , AndroidConfigurationException { } private AndroidDevice checkIfRealDeviceIsConnected ( AndroidBridge bridge , String serialId ) { <START_BUG> if ( ( serialId == null ) || ( ( serialId . length ( ) ) > 0 ) ) { <END_BUG> return null ; } for ( AndroidDevice device : bridge . getDevices ( ) ) { if ( serialId . equals ( device . getSerialNumber ( ) ) ) { return device ; } } AndroidDeviceSelector . log . warning ( ( ( "SerialId<seq2seq4repair_space>" + serialId ) + "<seq2seq4repair_space>was<seq2seq4repair_space>specified,<seq2seq4repair_space>however<seq2seq4repair_space>no<seq2seq4repair_space>such<seq2seq4repair_space>device<seq2seq4repair_space>was<seq2seq4repair_space>connected.<seq2seq4repair_space>Trying<seq2seq4repair_space>to<seq2seq4repair_space>connect<seq2seq4repair_space>to<seq2seq4repair_space>an<seq2seq4repair_space>emulator<seq2seq4repair_space>instead." ) ) ; return null ; } private Set < String > getAvdDeviceNames ( ProcessExecutor executor , AndroidSdk sdk ) throws IOException { } }

Fix:
if ( ( serialId == null ) || ( serialId . trim ( ) . isEmpty ( ) ) ) {
Buggy code:
public class CookieTest extends TestCase { private MockHttpApplication application ; private SignInPanel panel ; private Form form ; private Cookie cookieUsername ; private Cookie cookiePassword ; private Cookie [ ] cookies ; private HtmlPage page ; private HttpRequestCycle cycle ; public CookieTest ( String name ) { } protected void setUp ( ) throws Exception { super . setUp ( ) ; application = new MockHttpApplication ( null ) ; final ApplicationSettings settings = application . getSettings ( ) ; <START_BUG> settings . setHomePage ( MockPage . class ) ; <END_BUG> application . setupRequestAndResponse ( ) ; this . panel = new SignInPanel ( "panel" ) { public String signIn ( final String username , final String password ) { return null ; } } ; this . panel . setPersistent ( true ) ; this . form = ( ( Form ) ( panel . get ( "signInForm" ) ) ) ; final ICrypt crypt = settings . getCryptInstance ( ) ; final String encryptedPassword = crypt . encryptString ( "test" ) ; assertNotNull ( encryptedPassword ) ; this . cookieUsername = new Cookie ( "panel.signInForm.username" , "juergen" ) ; this . cookiePassword = new Cookie ( "panel.signInForm.password" , encryptedPassword ) ; this . cookies = new Cookie [ ] { cookieUsername , cookiePassword } ; application . getServletRequest ( ) . setCookies ( cookies ) ; cycle = new HttpRequestCycle ( application , application . getWicketSession ( ) , application . getWicketRequest ( ) , application . getWicketResponse ( ) ) ; this . page = new MockPage ( null ) ; page . add ( this . panel ) ; HttpRequestCycle cycle = new HttpRequestCycle ( application , application . getWicketSession ( ) , application . getWicketRequest ( ) , application . getWicketResponse ( ) ) ; application . getWicketSession ( ) . setRequestCycle ( cycle ) ; } public void testSetCookieOnForm ( ) throws IOException , ServletException { } public void testSetCookieOnPage ( ) throws IOException , ServletException { } public void testPersistCookieWithPersistenceDisabled ( ) throws IOException , ServletException { } public void testPersistCookie ( ) throws IOException , ServletException { } public void testRemoveFromPage ( ) throws IOException , ServletException { } }

Fix:
application . getPages ( ) . setHomePage ( MockPage . class ) ;
Buggy code:
public class ConsoleMock implements ConsoleWrapper { private AssertConsoleBuilder responses ; public ConsoleMock ( ) { } public void setResponses ( AssertConsoleBuilder responses ) { } @ Override public Object format ( String fmt , Object ... args ) throws IllegalFormatException { } @ Override public void printf ( String format , Object ... args ) throws IllegalFormatException { } @ Override public String readLine ( String fmt , Object ... args ) throws IOError { } @ Override public char [ ] readPassword ( String fmt , Object ... args ) throws IOError , IllegalFormatException { } @ Override public Object getConsole ( ) { <START_BUG> return null ; <END_BUG> } }

Fix:
return this ;