nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Util { public static List < VarDecl > getVarDecls ( Node node ) { } public static Map < String , Type > getTypeMap ( Node node ) { } public static List < String > getIds ( List < VarDecl > decls ) { } public static Map < String , Node > getNodeTable ( List < Node > nodes ) { } public static String getName ( Type type ) { } public static Value parseValue ( String type , String value ) { switch ( type ) { case "bool" : if ( ( value . equals ( "0" ) ) || ( value . equals ( "false" ) ) ) { return BooleanValue . FALSE ; } else if ( ( value . equals ( "1" ) ) || ( value . equals ( "true" ) ) ) { return BooleanValue . TRUE ; } break ; case "int" : return new IntegerValue ( new BigInteger ( value ) ) ; case "real" : String [ ] strs = value . split ( "//" ) ; if ( ( strs . length ) <= 2 ) { BigInteger num = new BigInteger ( strs [ 0 ] ) ; BigInteger denom = ( ( strs . length ) > 1 ) ? new BigInteger ( strs [ 1 ] ) : BigInteger . ONE ; return new jkind . lustre . values . RealValue ( new BigFraction ( num , denom ) ) ; } break ; default : <START_BUG> if ( Character . isAlphabetic ( value . charAt ( 0 ) ) ) { <END_BUG> return new EnumValue ( value ) ; } else { throw new IllegalArgumentException ( ( "Invalid<seq2seq4repair_space>enumeration<seq2seq4repair_space>value:<seq2seq4repair_space>" + value ) ) ; } } throw new JKindException ( ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>" + value ) + "<seq2seq4repair_space>as<seq2seq4repair_space>" ) + type ) ) ; } public static Value parseValue ( Type type , String value ) { } public static Type resolveType ( Type type , Map < String , Type > map ) { } public static Map < String , Type > createResolvedTypeTable ( List < TypeDef > defs ) { } private static Map < String , Type > createUnresolvedTypeTable ( List < TypeDef > defs ) { } public static void writeToFile ( String content , File file ) throws IOException { } public static boolean isWindows ( ) { } public static boolean isArbitrary ( Value value ) { } public static < T , S > List < S > castList ( List < T > list , Class < S > klass ) { } public static BigInteger smtDivide ( BigInteger a , BigInteger b ) { } public static < T > List < T > safeList ( List < ? extends T > original ) { } public static < T > SortedMap < String , T > safeStringSortedMap ( Map < String , T > original ) { } public static List < EnumType > getEnumTypes ( List < TypeDef > types ) { } }

Fix:
if ( ( value . isEmpty ( ) ) || ( Character . isAlphabetic ( value . charAt ( 0 ) ) ) ) {
Buggy code:
public class BootStrapperTest { @ Test public void testGuessToken ( ) throws IOException { StorageService ss = StorageService . instance ; generateFakeEndpoints ( 3 ) ; InetAddress one = InetAddress . getByName ( "127.0.0.2" ) ; InetAddress two = InetAddress . getByName ( "127.0.0.3" ) ; InetAddress three = InetAddress . getByName ( "127.0.0.4" ) ; Map < InetAddress , Double > load = new HashMap < InetAddress , Double > ( ) ; load . put ( one , 1.0 ) ; load . put ( two , 2.0 ) ; load . put ( three , 3.0 ) ; TokenMetadata tmd = ss . getTokenMetadata ( ) ; InetAddress source = BootStrapper . getBootstrapSource ( tmd , load ) ; assert three . equals ( source ) ; InetAddress myEndpoint = InetAddress . getByName ( "127.0.0.1" ) ; <START_BUG> Range range3 = ss . getPrimaryRangeForEndPoint ( three ) ; <END_BUG> Token fakeToken = ( ( IPartitioner ) ( StorageService . getPartitioner ( ) ) ) . midpoint ( range3 . left , range3 . right ) ; assert range3 . contains ( fakeToken ) ; ss . onChange ( myEndpoint , MOVE_STATE , new org . apache . cassandra . gms . ApplicationState ( ( ( ( StorageService . STATE_BOOTSTRAPPING ) + ( StorageService . Delimiter ) ) + ( ss . getPartitioner ( ) . getTokenFactory ( ) . toString ( fakeToken ) ) ) ) ) ; tmd = ss . getTokenMetadata ( ) ; InetAddress source2 = BootStrapper . getBootstrapSource ( tmd , load ) ; assert two . equals ( source2 ) : source2 ; } @ Test public void testSourceTargetComputation ( ) throws UnknownHostException { } private void testSourceTargetComputation ( String table , int numOldNodes , int replicationFactor ) throws UnknownHostException { } private void generateFakeEndpoints ( int numOldNodes ) throws UnknownHostException { } }

Fix:
Range range3 = ss . getPrimaryRangeForEndpoint ( three ) ;
Buggy code:
public class DatePanel extends JPanel { public LocalDate startdate ; public LocalDate enddate ; Vector < ActionListener > changelisteners = new Vector < > ( ) ; public void addChangeListener ( ActionListener changelistener ) { } private void statechangedevent ( ) { } public DatePanel ( ) { } private void update_spinners ( ) { } @ SuppressWarnings ( "unchecked" ) private void initComponents ( ) { } private void start_day_spinnerStateChanged ( ChangeEvent evt ) { } private void start_month_spinnerStateChanged ( ChangeEvent evt ) { } private void start_year_spinnerStateChanged ( ChangeEvent evt ) { } private void end_day_spinnerStateChanged ( ChangeEvent evt ) { } private void end_month_spinnerStateChanged ( ChangeEvent evt ) { } private void end_year_spinnerStateChanged ( ChangeEvent evt ) { } private void jButton1ActionPerformed ( ActionEvent evt ) { } private void jButton2ActionPerformed ( ActionEvent evt ) { } private void jButton3ActionPerformed ( ActionEvent evt ) { } private void jButton4ActionPerformed ( ActionEvent evt ) { } private void jButton5ActionPerformed ( ActionEvent evt ) { } private void jButton6ActionPerformed ( ActionEvent evt ) { startdate = startdate . plusYears ( ( - 1 ) ) ; <START_BUG> enddate = enddate . plusYears ( 1 ) ; <END_BUG> statechangedevent ( ) ; } private JSpinner end_day_spinner ; private JSpinner end_month_spinner ; private JSpinner end_year_spinner ; private JButton jButton1 ; private JButton jButton2 ; private JButton jButton3 ; private JButton jButton4 ; private JButton jButton5 ; private JButton jButton6 ; private JLabel jLabel1 ; private JLabel jLabel2 ; private JLabel jLabel3 ; private JLabel jLabel4 ; private JLabel jLabel5 ; private JPanel jPanel1 ; private JPanel jPanel2 ; private JPanel jPanel3 ; private JPanel jPanel4 ; private JSpinner start_day_spinner ; private JSpinner start_month_spinner ; private JSpinner start_year_spinner ; }

Fix:
enddate = enddate . plusYears ( ( - 1 ) ) ;
Buggy code:
public class MultidimensionalCounterTest { @ Test public void testPreconditions ( ) { } @ Test public void testIteratorPreconditions ( ) { } @ Test public void testMulti2UniConversion ( ) { } @ Test public void testAccessors ( ) { } @ Test public void testIterationConsistency ( ) { final MultidimensionalCounter c = new MultidimensionalCounter ( 2 , 3 , 4 ) ; final int [ ] [ ] expected = new int [ ] [ ] { new int [ ] { 0 , 0 , 0 } , new int [ ] { 0 , 0 , 1 } , new int [ ] { 0 , 0 , 2 } , new int [ ] { 0 , 0 , 3 } , new int [ ] { 0 , 1 , 0 } , new int [ ] { 0 , 1 , 1 } , new int [ ] { 0 , 1 , 2 } , new int [ ] { 0 , 1 , 3 } , new int [ ] { 0 , 2 , 0 } , new int [ ] { 0 , 2 , 1 } , new int [ ] { 0 , 2 , 2 } , new int [ ] { 0 , 2 , 3 } , new int [ ] { 1 , 0 , 0 } , new int [ ] { 1 , 0 , 1 } , new int [ ] { 1 , 0 , 2 } , new int [ ] { 1 , 0 , 3 } , new int [ ] { 1 , 1 , 0 } , new int [ ] { 1 , 1 , 1 } , new int [ ] { 1 , 1 , 2 } , new int [ ] { 1 , 1 , 3 } , new int [ ] { 1 , 2 , 0 } , new int [ ] { 1 , 2 , 1 } , new int [ ] { 1 , 2 , 2 } , new int [ ] { 1 , 2 , 3 } } ; final int totalSize = c . getSize ( ) ; final int nDim = c . getDimension ( ) ; final MultidimensionalCounter . Iterator iter = c . iterator ( ) ; for ( int i = 0 ; i < totalSize ; i ++ ) { if ( ! ( iter . hasNext ( ) ) ) { Assert . fail ( "Too<seq2seq4repair_space>short" ) ; } <START_BUG> final int uniDimIndex = iter . next ( ) ; <END_BUG> Assert . assertEquals ( ( "Wrong<seq2seq4repair_space>iteration<seq2seq4repair_space>at<seq2seq4repair_space>" + i ) , i , uniDimIndex ) ; for ( int dimIndex = 0 ; dimIndex < nDim ; dimIndex ++ ) { Assert . assertEquals ( ( ( ( ( "Wrong<seq2seq4repair_space>multidimensional<seq2seq4repair_space>index<seq2seq4repair_space>for<seq2seq4repair_space>[" + i ) + "][" ) + dimIndex ) + "]" ) , expected [ i ] [ dimIndex ] , iter . getCount ( dimIndex ) ) ; } Assert . assertEquals ( ( ( "Wrong<seq2seq4repair_space>unidimensional<seq2seq4repair_space>index<seq2seq4repair_space>for<seq2seq4repair_space>[" + i ) + "]" ) , c . getCount ( expected [ i ] ) , uniDimIndex ) ; final int [ ] indices = c . getCounts ( uniDimIndex ) ; for ( int dimIndex = 0 ; dimIndex < nDim ; dimIndex ++ ) { Assert . assertEquals ( ( ( ( ( "Wrong<seq2seq4repair_space>multidimensional<seq2seq4repair_space>index<seq2seq4repair_space>for<seq2seq4repair_space>[" + i ) + "][" ) + dimIndex ) + "]" ) , expected [ i ] [ dimIndex ] , indices [ dimIndex ] ) ; } } if ( iter . hasNext ( ) ) { Assert . fail ( "Too<seq2seq4repair_space>long" ) ; } } }

Fix:
final int uniDimIndex = iter . next ( ) . intValue ( ) ;
Buggy code:
public class WebPage extends Page implements INewBrowserWindowListener { private static final long serialVersionUID = 1L ; private BodyContainer bodyContainer ; protected WebPage ( ) { } protected WebPage ( final IModel model ) { } protected WebPage ( final PageMap pageMap ) { } protected WebPage ( final PageMap pageMap , final IModel model ) { } protected WebPage ( final PageParameters parameters ) { } public BodyContainer getBodyContainer ( ) { } public String getMarkupType ( ) { } protected void configureResponse ( ) { } protected final WebRequestCycle getWebRequestCycle ( ) { } protected final BookmarkablePageLink homePageLink ( final String id ) { } private void commonInit ( ) { } protected void onDetach ( ) { } public void onNewBrowserWindow ( ) { ArrayListStack accessStack = getPageMap ( ) . getAccessStack ( ) ; if ( ( accessStack . size ( ) ) > 1 ) { Access access = ( ( Access ) ( accessStack . get ( 0 ) ) ) ; if ( ! ( ( ( access . getId ( ) ) == ( getNumericId ( ) ) ) && ( ( access . getVersion ( ) ) == ( getCurrentVersionNumber ( ) ) ) ) ) { WebPage clonedPage = ( ( WebPage ) ( Objects . cloneObject ( this ) ) ) ; <START_BUG> PageMap map = PageMap . forName ( Long . toString ( System . currentTimeMillis ( ) ) ) ; <END_BUG> clonedPage . moveToPageMap ( map ) ; setResponsePage ( clonedPage ) ; } } } private class PageMapChecker extends AbstractBehavior implements IHeaderContributor { private static final long serialVersionUID = 1L ; public void renderHead ( Response response ) { } } }

Fix:
PageMap map = getSession ( ) . createAutoPageMap ( ) ;
Buggy code:
public class FragmentMap extends Fragment implements OnMapReadyCallback { public static final String [ ] availableTypes = new String [ ] { "Wifi" , "Cell" } ; public static int typeIndex = - 1 ; public static View view ; public SupportMapFragment mMapFragment ; public GoogleMap map ; public TileProvider tileProvider ; public FloatingActionButton fabTwo ; public FloatingActionButton fabOne ; public boolean permissions = false ; LocationManager locationManager ; FragmentMap . UpdateLocationListener locationListener ; TouchWrapper touchWrapper ; boolean checkLocationPermission ( ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } public void onLeave ( ) { } public void initializeFABs ( FloatingActionButton fabOne , FloatingActionButton fabTwo ) { this . fabOne = fabOne ; this . fabTwo = fabTwo ; <START_BUG> if ( checkLocationPermission ( ) ) <END_BUG> locationManager . requestLocationUpdates ( 1 , 5 , new Criteria ( ) , locationListener , Looper . myLooper ( ) ) ; fabOne . show ( ) ; fabOne . setImageResource ( ic_gps_fixed_black_24dp ) ; fabOne . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { if ( checkLocationPermission ( ) ) { locationListener . moveToMyPosition ( ) ; } } } ) ; fabTwo . show ( ) ; fabTwo . setImageDrawable ( ContextCompat . getDrawable ( getContext ( ) , ic_network_cell_24dp ) ) ; fabTwo . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { changeMapOverlay ( ( ( ( FragmentMap . typeIndex ) + 1 ) == ( FragmentMap . availableTypes . length ) ? 0 : ( FragmentMap . typeIndex ) + 1 ) ) ; } } ) ; changeMapOverlay ( FragmentMap . typeIndex ) ; } TileOverlay activeOverlay ; private void changeMapOverlay ( int index ) { } @ Override public void onMapReady ( GoogleMap map ) { } Circle userRadius ; Circle userCenter ; void DrawUserPosition ( LatLng latlng , float accuracy ) { } public class UpdateLocationListener implements LocationListener { LatLng position ; boolean followMyPosition = false ; public final OnCameraChangeListener cameraChangeListener = new GoogleMap . OnCameraChangeListener ( ) { @ Override public void onCameraChange ( CameraPosition cameraPosition ) { } } ; @ Override public void onLocationChanged ( Location location ) { } public void moveToMyPosition ( ) { } public void moveTo ( @ NonNull LatLng latlng ) { } public void moveTo ( @ NonNull LatLng latlng , float zoom ) { } @ Override public void onStatusChanged ( String provider , int status , Bundle extras ) { } @ Override public void onProviderEnabled ( String provider ) { } @ Override public void onProviderDisabled ( String provider ) { } public void cleanup ( ) { } } }

Fix:
if ( ( checkLocationPermission ( ) ) && ( ( locationManager ) != null ) )
Buggy code:
public class ImgurUploader implements ImageUploader { private int progress = 0 ; private int insProgress = 100 ; public ImgurUploader ( ) { } @ Override public ImgurImage uploadFile ( BufferedImage imag ) { } public ImgurImage uploadFile ( BufferedImage imag , String ext ) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; ImageIO . write ( imag , ext , baos ) ; progress += 25 ; try { <START_BUG> String data = ( ( URLEncoder . encode ( "key" , "UTF-8" ) ) + "=" ) + ( URLEncoder . encode ( "5a8683c13e5ba0e388b89dafc652d1cd" , "UTF-8" ) ) ; <END_BUG> data += ( ( "&" + ( URLEncoder . encode ( "image" , "UTF-8" ) ) ) + "=" ) + ( URLEncoder . encode ( Base64 . encode ( baos . toByteArray ( ) ) , "UTF-8" ) ) ; URL url = new URL ( "http:////api.imgur.com//2//upload" ) ; URLConnection conn = url . openConnection ( ) ; conn . setDoOutput ( true ) ; OutputStreamWriter wr = new OutputStreamWriter ( conn . getOutputStream ( ) ) ; wr . write ( data ) ; wr . flush ( ) ; wr . close ( ) ; progress += 25 ; try { Document document = parse ( conn . getInputStream ( ) ) ; Element rootElement = document . getRootElement ( ) ; progress += 25 ; ImgurImage imgInfo = new ImgurImage ( ) ; parseXML ( rootElement , imgInfo ) ; progress = 100 ; return imgInfo ; } catch ( IOException ex ) { ex . printStackTrace ( ) ; progress = - 1 ; } } catch ( Exception e ) { e . printStackTrace ( ) ; progress = - 1 ; } } catch ( IOException ex ) { Logger . getLogger ( ImgurUploader . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; progress = - 1 ; } return null ; } @ Override public ImgurImage uploadFile ( File f ) { } protected Document parse ( InputStream in ) throws Exception { } private void parseXML ( Element n , ImgurImage img ) throws Exception { } private void addToEngine ( Element n , ImgurImage img ) throws Exception { } @ Override public int getProgress ( ) { } public int getInsProgress ( ) { } }

Fix:
String data = ( ( URLEncoder . encode ( "key" , "UTF-8" ) ) + "=" ) + ( URLEncoder . encode ( new String ( Base64 . decode ( "NWE4NjgzYzEzZTViYTBlMzg4Yjg5ZGFmYzY1MmQxY2Q=" ) ) , "UTF-8" ) ) ;
Buggy code:
public class FirstAttempt { public static void main ( String [ ] args ) { final List < MetaModel > mms = new ArrayList < MetaModel > ( ) ; mms . add ( new JavaBeansMetaModel ( ) ) ; final CompositeTypesystem ts = BackendTypesystemFactory . createWithoutUml ( ) ; { final XpandBackendContributor xp = new XpandBackendContributor ( "org::eclipse::xtend::middleend::old::first::aTemplate" , mms , ts , new ArrayList < org . eclipse . xpand2 . output . Outlet > ( ) ) ; final ExecutionContext ctx = BackendFacade . createExecutionContext ( xp . getFunctionDefContext ( ) , ts ) ; <START_BUG> System . err . println ( BackendFacade . invoke ( ctx , "greeting" , Arrays . asList ( "Arno" ) ) ) ; <END_BUG> } { final XtendBackendContributor bc = new XtendBackendContributor ( "org::eclipse::xtend::middleend::old::first::first" , mms , ts ) ; final ExecutionContext ctx = BackendFacade . createExecutionContext ( bc . getFunctionDefContext ( ) , ts ) ; System . err . println ( BackendFacade . invoke ( ctx , "test" , Arrays . asList ( "Arno" ) ) ) ; System . err . println ( BackendFacade . invoke ( ctx , "testColl" , Arrays . asList ( Arrays . asList ( 1L , "Hallo" ) ) ) ) ; System . err . println ( BackendFacade . invoke ( ctx , "reexp" , Arrays . asList ( 2L ) ) ) ; final Person p = new Person ( ) ; p . setFirstName ( "Testa" ) ; p . setName ( "Testarossa" ) ; System . err . println ( BackendFacade . invoke ( ctx , "testPerson" , Arrays . asList ( p ) ) ) ; } } }

Fix:
System . err . println ( BackendFacade . invoke ( ctx , "org//eclipse//xtend//middleend//old//first//aTemplate//greeting" , Arrays . asList ( "Arno" ) ) ) ;
Buggy code:
public class PersistenceCompleteInstallProcessor implements DeploymentUnitProcessor { private final Platform platform ; public PersistenceCompleteInstallProcessor ( Platform platform ) { } @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } @ Override public void undeploy ( DeploymentUnit context ) { } private static boolean deploymentHasPersistenceProvider ( DeploymentUnit deploymentUnit ) { deploymentUnit = DeploymentUtils . getTopDeploymentUnit ( deploymentUnit ) ; PersistenceProviderDeploymentHolder persistenceProviderDeploymentHolder = deploymentUnit . getAttachment ( DEPLOYED_PERSISTENCE_PROVIDER ) ; <START_BUG> return ( persistenceProviderDeploymentHolder != null ) && ( ( persistenceProviderDeploymentHolder . getProviders ( ) ) != null ) ? ( persistenceProviderDeploymentHolder . getProviders ( ) . size ( ) ) > 0 : false ; <END_BUG> } }

Fix:
return ( persistenceProviderDeploymentHolder != null ) && ( ( persistenceProviderDeploymentHolder . getProvider ( ) ) != null ) ? ( persistenceProviderDeploymentHolder . getProvider ( ) . size ( ) ) > 0 : false ;
Buggy code:
public abstract class AbstractDecimalConverter extends AbstractNumberConverter { private static final long serialVersionUID = 1L ; private final Map < Locale , NumberFormat > numberFormats = new ConcurrentHashMap < Locale , NumberFormat > ( ) ; @ Override public NumberFormat getNumberFormat ( Locale locale ) { NumberFormat numberFormat = numberFormats . get ( locale ) ; if ( numberFormat == null ) { <START_BUG> numberFormat = NumberFormat . getInstance ( locale ) ; <END_BUG> if ( numberFormat instanceof DecimalFormat ) ( ( DecimalFormat ) ( numberFormat ) ) . setParseBigDecimal ( true ) ; numberFormats . put ( locale , numberFormat ) ; } return ( ( NumberFormat ) ( numberFormat . clone ( ) ) ) ; } protected NumberFormat newNumberFormat ( Locale locale ) { } public final void setNumberFormat ( final Locale locale , final NumberFormat numberFormat ) { } }

Fix:
numberFormat = newNumberFormat ( locale ) ;
Buggy code:
public class SecureOutgoingFileTransferTest extends ContainerAbstractTestCase { private static final String TESTSRCPATH = "test.src" ; private static final String TESTSRCFILE = ( SecureOutgoingFileTransferTest . TESTSRCPATH ) + "//test.txt" ; private static final String TESTTARGETPATH = "test.target" ; static final String XMPP_CONTAINER = "ecf.xmpps.smack" ; protected IOutgoingFileTransferContainerAdapter adapter0 ; protected IOutgoingFileTransferContainerAdapter adapter1 = null ; protected String getClientContainerName ( ) { } protected IOutgoingFileTransferContainerAdapter getOutgoingFileTransfer ( int client ) { } protected IFileTransferListener getFileTransferListener ( final String prefix ) { } protected IIncomingFileTransferRequestListener requestListener = new IIncomingFileTransferRequestListener ( ) { public void handleFileTransferRequest ( IFileTransferRequestEvent event ) { } } ; protected IFileTransferListener senderTransferListener = getFileTransferListener ( "sender" ) ; protected IFileTransferListener receiverTransferListener = getFileTransferListener ( "receiver" ) ; protected ID getServerConnectID ( int client ) { } public void testTwoClientsToSendAndReceive ( ) throws Exception { setClientCount ( 2 ) ; clients = createClients ( ) ; adapter0 = getOutgoingFileTransfer ( 0 ) ; adapter0 . addListener ( requestListener ) ; adapter1 = getOutgoingFileTransfer ( 1 ) ; for ( int i = 0 ; i < 2 ; i ++ ) { connectClient ( i ) ; } adapter1 . sendOutgoingRequest ( getServerConnectID ( 0 ) , new File ( SecureOutgoingFileTransferTest . TESTSRCFILE ) , senderTransferListener , null ) ; <START_BUG> sleep ( 20000 ) ; <END_BUG> disconnectClients ( ) ; } }

Fix:
sleep ( 10000 ) ;
Buggy code:
public class Dice extends LinearLayout { private static class Model { private Map < Integer , List < Integer > > mRolls = new HashMap < > ( ) ; private Random rand = new Random ( ) ; public void clear ( ) { } public int getNumberOfRolls ( ) { } public int getNumberOfRolls ( int sides ) { } public int getRoll ( int sides , int index ) { } public int getRollTotal ( int sides ) { } public void roll ( int sides ) { if ( ! ( mRolls . containsKey ( sides ) ) ) { mRolls . put ( sides , new ArrayList < Integer > ( ) ) ; } <START_BUG> mRolls . get ( sides ) . add ( ( ( rand . nextInt ( ( sides - 1 ) ) ) + 1 ) ) ; <END_BUG> } } private class DieClickListener implements OnClickListener { int mSides ; public DieClickListener ( int sides ) { } @ Override public void onClick ( View v ) { } } private static int [ ] SIDES = new int [ ] { 4 , 6 , 8 , 10 , 12 , 20 , 100 } ; Dice . Model mModel = new Dice . Model ( ) ; List < LinearLayout > mDisplayColumns = new ArrayList < > ( ) ; LinearLayout mControlColumn ; public Dice ( Context context ) { } public Dice ( Context context , AttributeSet attrs ) { } public Dice ( Context context , AttributeSet attrs , int defStyleAttr ) { } private void updateFromModel ( ) { } private void setColumnCount ( int columns ) { } private LinearLayout newDisplayColumn ( ) { } private void setText ( int row , int col , String text ) { } private void clearParent ( View child ) { } }

Fix:
mRolls . get ( sides ) . add ( ( ( rand . nextInt ( sides ) ) + 1 ) ) ;
Buggy code:
public class BoltListener implements Listener { private final BoltPlugin plugin ; public BoltListener ( BoltPlugin plugin ) { } @ EventHandler ( priority = EventPriority . LOWEST ) public void onInventoryMoveItem ( InventoryMoveItemEvent event ) { } @ EventHandler ( priority = EventPriority . LOWEST ) public void onBlockPlace ( BlockPlaceEvent event ) { } @ EventHandler ( priority = EventPriority . LOW ) public void onBlockBreakDoor ( BlockBreakEvent event ) { if ( event . isCancelled ( ) ) { return ; } <START_BUG> if ( ( ( event . getBlock ( ) . getType ( ) ) != ( Material . IRON_DOOR_BLOCK ) ) && ( ( event . getBlock ( ) . getType ( ) ) == ( Material . WOODEN_DOOR ) ) ) { <END_BUG> return ; } Block below = event . getBlock ( ) . getRelative ( 0 , ( - 2 ) , 0 ) ; if ( ( below . getType ( ) ) != ( Material . CHEST ) ) { below = event . getBlock ( ) . getRelative ( 0 , ( - 3 ) , 0 ) ; if ( ( below . getType ( ) ) != ( Material . CHEST ) ) { return ; } } InventoryHolder c = ( ( InventoryHolder ) ( below . getState ( ) ) ) ; if ( ! ( BoltAPI . isChestOwner ( c . getInventory ( ) , event . getPlayer ( ) . getName ( ) ) ) ) { event . setCancelled ( true ) ; } } @ EventHandler ( priority = EventPriority . LOWEST ) public void onBlockBreakChest ( BlockBreakEvent event ) { } @ EventHandler ( priority = EventPriority . LOWEST ) public void onInventoryOpen ( InventoryOpenEvent event ) { } @ EventHandler ( priority = EventPriority . LOWEST ) public void onInventoryClick ( InventoryClickEvent event ) { } @ EventHandler ( priority = EventPriority . LOWEST ) public void onItemSpawn ( ItemSpawnEvent event ) { } @ EventHandler ( priority = EventPriority . LOWEST ) public void onPlayerInteractEvent ( PlayerInteractEvent event ) { } }

Fix:
if ( ( ( event . getBlock ( ) . getType ( ) ) != ( Material . IRON_DOOR_BLOCK ) ) && ( ( event . getBlock ( ) . getType ( ) ) != ( Material . WOODEN_DOOR ) ) ) {
Buggy code:
public class QualifiedSuperReference extends QualifiedThisReference { public QualifiedSuperReference ( TypeReference name , int pos , int sourceEnd ) { } public boolean isSuper ( ) { } public boolean isThis ( ) { } public TypeBinding resolveType ( BlockScope scope ) { super . resolveType ( scope ) ; if ( ( currentCompatibleType ) == null ) return null ; if ( scope . isJavaLangObject ( currentCompatibleType ) ) { scope . problemReporter ( ) . cannotUseSuperInJavaLangObject ( this ) ; return null ; } <START_BUG> return currentCompatibleType . superclass ( ) ; <END_BUG> } public String toStringExpression ( ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } }

Fix:
return this . expressionType = currentCompatibleType . superclass ( ) ;
Buggy code:
public class EditorAreaHelper { private WorkbenchPage page ; private ArrayList editorTable = new ArrayList ( 4 ) ; private EditorSashContainer editorArea ; private HandlerSubmission openEditorDropDownHandlerSubmission ; public EditorAreaHelper ( WorkbenchPage page ) { } public void displayEditorList ( ) { } public void closeAllEditors ( ) { } public void closeEditor ( IEditorReference ref ) { } public void closeEditor ( IEditorPart part ) { } private void closeEditor ( EditorPane pane ) { } public static void derefPart ( LayoutPart part ) { } public void dispose ( ) { } public String getActiveEditorWorkbookID ( ) { } public IEditorReference [ ] getEditors ( ) { } public LayoutPart getLayoutPart ( ) { } public IEditorReference getVisibleEditor ( ) { } public void fixVisibleEditor ( ) { } public void moveEditor ( IEditorPart part , int position ) { } public void openEditor ( IEditorReference ref , IEditorReference [ ] innerEditors , boolean setVisible ) { } public void openEditor ( IEditorReference ref , boolean setVisible ) { EditorPane pane = new EditorPane ( ref , page , editorArea . getActiveWorkbook ( ) ) ; initPane ( pane , ref ) ; editorArea . addEditor ( pane ) ; if ( setVisible ) <START_BUG> setVisibleEditor ( ref , true ) ; <END_BUG> } private EditorPane initPane ( EditorPane pane , IEditorReference ref ) { } public IStatus restoreState ( IMemento memento ) { } public IStatus saveState ( IMemento memento ) { } public void setActiveEditorWorkbookFromID ( String id ) { } public void showVisibleEditor ( ) { } public boolean setVisibleEditor ( IEditorReference ref , boolean setFocus ) { } public ArrayList getWorkbooks ( ) { } }

Fix:
setVisibleEditor ( ref , false ) ;
Buggy code:
public class LikeThisQueryBuilder implements QueryBuilder { private Analyzer analyzer ; String [ ] defaultFieldNames ; int defaultMaxQueryTerms = 20 ; int defaultMinTermFrequency = 1 ; float defaultPercentTermsToMatch = 30 ; public LikeThisQueryBuilder ( Analyzer analyzer , String [ ] defaultFieldNames ) { } public Query getQuery ( Element e ) throws ParserException { String fieldsList = e . getAttribute ( "fieldNames" ) ; String [ ] fields = defaultFieldNames ; if ( ( fieldsList != null ) && ( ( fieldsList . trim ( ) . length ( ) ) > 0 ) ) { fields = fieldsList . trim ( ) . split ( "," ) ; for ( int i = 0 ; i < ( fields . length ) ; i ++ ) { fields [ i ] = fields [ i ] . trim ( ) ; } } String stopWords = e . getAttribute ( "stopWords" ) ; Set < String > stopWordsSet = null ; if ( ( stopWords != null ) && ( fields != null ) ) { stopWordsSet = new HashSet < String > ( ) ; for ( int i = 0 ; i < ( fields . length ) ; i ++ ) { try { TokenStream ts = analyzer . reusableTokenStream ( fields [ i ] , new StringReader ( stopWords ) ) ; CharTermAttribute termAtt = ts . addAttribute ( CharTermAttribute . class ) ; ts . reset ( ) ; while ( ts . incrementToken ( ) ) { stopWordsSet . add ( termAtt . toString ( ) ) ; } ts . end ( ) ; ts . close ( ) ; } catch ( IOException ioe ) { throw new ParserException ( ( ( ( "IoException<seq2seq4repair_space>parsing<seq2seq4repair_space>stop<seq2seq4repair_space>words<seq2seq4repair_space>list<seq2seq4repair_space>in<seq2seq4repair_space>" + ( getClass ( ) . getName ( ) ) ) + ":" ) + ( ioe . getLocalizedMessage ( ) ) ) ) ; } } } <START_BUG> MoreLikeThisQuery mlt = new MoreLikeThisQuery ( DOMUtils . getText ( e ) , fields , analyzer ) ; <END_BUG> mlt . setMaxQueryTerms ( DOMUtils . getAttribute ( e , "maxQueryTerms" , defaultMaxQueryTerms ) ) ; mlt . setMinTermFrequency ( DOMUtils . getAttribute ( e , "minTermFrequency" , defaultMinTermFrequency ) ) ; mlt . setPercentTermsToMatch ( ( ( DOMUtils . getAttribute ( e , "percentTermsToMatch" , defaultPercentTermsToMatch ) ) // 100 ) ) ; mlt . setStopWords ( stopWordsSet ) ; int minDocFreq = DOMUtils . getAttribute ( e , "minDocFreq" , ( - 1 ) ) ; if ( minDocFreq >= 0 ) { mlt . setMinDocFreq ( minDocFreq ) ; } mlt . setBoost ( DOMUtils . getAttribute ( e , "boost" , 1.0F ) ) ; return mlt ; } }

Fix:
MoreLikeThisQuery mlt = new MoreLikeThisQuery ( DOMUtils . getText ( e ) , fields , analyzer , fields [ 0 ] ) ;
Buggy code:
public class MixSeekerTest extends CommentIntensitySeekerTest { private MixSeeker mixseeker ; @ Before public void setUp ( ) throws Exception { } protected static List < Integer > asList ( final int ... numbers ) { } public void setSeeker ( final MixSeeker seeker ) { } @ Override public MixSeeker getSeeker ( ) { } @ Test public void testGetStartTimes ( ) { } @ Test public void testGetStartTimesWrongOrder ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testSetStartTimesEmpty ( ) { } @ Test public void testGetEndOfSong ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testgetNextPieceStarttimeNegativeTime ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testgetNextPieceStarttimeUnderFirstBound ( ) { } @ Test public void testgetNextPieceStarttimeOnFirstBound ( ) { } @ Test public void testgetNextPieceStarttime ( ) { } @ Test public void testgetNextPieceStarttimeLastValue ( ) { } @ Test public void testgetNextPieceStarttimeOnLastBound ( ) { } @ Test public void testgetNextPieceStarttimeOverLastBound ( ) { } @ Test public void testIsInRangeWhenInOtherPart ( ) { } @ Test public void testGetSnippet ( ) { } @ Test public void testGetSnippets ( ) { Track track = new Track ( ) ; track . setDuration ( 20 ) ; track . setTrackid ( 1024425 ) ; MixSeeker mixseeker = new MixSeeker ( MixSeekerTest . asList ( 0 , 30 , 70 ) , track ) { @ Override public ScoreStorage calculateScores ( final int duration ) { final ScoreStorage scores = new ScoreMap ( ) ; scores . add ( 10 , 20 ) ; scores . add ( 20 , 10 ) ; <START_BUG> scores . add ( 30 , 280 ) ; <END_BUG> scores . add ( 40 , 200 ) ; scores . add ( 50 , 102 ) ; scores . add ( 60 , ( - 40 ) ) ; scores . add ( 70 , 20 ) ; scores . add ( 80 , 201 ) ; scores . add ( 90 , 157 ) ; scores . add ( 100 , 92 ) ; return scores ; } } ; final List < TimedSnippet > selected = mixseeker . getSnippets ( 10 ) ; final List < TimedSnippet > expected = new ArrayList < TimedSnippet > ( ) ; expected . add ( new TimedSnippet ( 30 , 10 ) ) ; expected . add ( new TimedSnippet ( 40 , 10 ) ) ; expected . add ( new TimedSnippet ( 80 , 10 ) ) ; assertEquals ( expected , selected ) ; } @ Test public void testGetSnippetsDoubleValue ( ) { } @ Test ( expected = IllegalStateException . class ) public void testGetSnippetNoValues ( ) { } @ Test public void testGetSnippetWhole ( ) { } @ Test public void testGetSnippetWholeOverkill ( ) { } @ Test public void testGetSnippetWholeEqualBounds ( ) { } }

Fix:
scores . add ( 30 , 28 ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class Field implements Serializable { private static final Field [ ] NO_FIELDS = new Field [ 0 ] ; private final String name ; private final FieldType type ; private final Field [ ] properties ; public Field ( String name , FieldType type ) { } public Field ( String name , FieldType type , Collection < Field > properties ) { } Field ( String name , FieldType type , Field [ ] properties ) { } public Field [ ] properties ( ) { } public FieldType type ( ) { } public String name ( ) { } public static Field parseField ( Map < String , Object > content ) { } public Field skipHeaders ( ) { } private static Field skipHeaders ( Field field ) { Field [ ] props = field . properties ( ) ; <START_BUG> if ( ( ( ( props [ 0 ] ) != null ) && ( "mappings" . equals ( props [ 0 ] . name ( ) ) ) ) && ( OBJECT . equals ( props [ 0 ] . type ( ) ) ) ) { <END_BUG> return props [ 0 ] . properties ( ) [ 0 ] ; } return field ; } public static Map < String , FieldType > toLookupMap ( Field field ) { } static void add ( Map < String , FieldType > fields , Field field , String parentName ) { } @ SuppressWarnings ( "unchecked" ) private static Field parseField ( Map . Entry < String , Object > entry , String previousKey ) { } public String toString ( ) { } No newline ; at end ; of file ; }

Fix:
if ( ( ( ( ( props . length ) > 0 ) && ( ( props [ 0 ] ) != null ) ) && ( "mappings" . equals ( props [ 0 ] . name ( ) ) ) ) && ( OBJECT . equals ( props [ 0 ] . type ( ) ) ) ) {
Buggy code:
final class TransactionsSubsystemElement extends AbstractSubsystemElement < TransactionsSubsystemElement > { private static final long serialVersionUID = 4097067542390229861L ; private final RecoveryEnvironmentElement recoveryEnvironmentElement = new RecoveryEnvironmentElement ( ) ; private final CoreEnvironmentElement coreEnvironmentElement = new CoreEnvironmentElement ( ) ; private final CoordinatorEnvironmentElement coordinatorEnvironmentElement = new CoordinatorEnvironmentElement ( ) ; private final ObjectStoreEnvironmentElement objectStoreEnvironmentElement = new ObjectStoreEnvironmentElement ( ) ; public TransactionsSubsystemElement ( ) { } @ Override protected Class < TransactionsSubsystemElement > getElementClass ( ) { } @ Override public void writeContent ( final XMLExtendedStreamWriter streamWriter ) throws XMLStreamException { } public RecoveryEnvironmentElement getRecoveryEnvironmentElement ( ) { } public CoreEnvironmentElement getCoreEnvironmentElement ( ) { } public CoordinatorEnvironmentElement getCoordinatorEnvironmentElement ( ) { } public void setCoordinatorEnableStatistics ( final boolean enable ) { } public void setCoordinatorDefaultTimeout ( final int timeout ) { } public ObjectStoreEnvironmentElement getObjectStoreEnvironmentElement ( ) { } @ Override protected void getUpdates ( List < ? super AbstractSubsystemUpdate < TransactionsSubsystemElement , ? > > list ) { } @ Override protected boolean isEmpty ( ) { } @ Override protected TransactionSubsystemAdd getAdd ( ) { } @ Override protected < P > void applyRemove ( final UpdateContext updateContext , final UpdateResultHandler < ? super Void , P > resultHandler , final P param ) { final ServiceRegistry serviceRegistry = updateContext . getServiceRegistry ( ) ; <START_BUG> final ServiceController < ? > tmController = serviceRegistry . getService ( JBOSS_TXN_TRANSACTION_MANAGER ) ; <END_BUG> tmController . setMode ( REMOVE ) ; final ServiceController < ? > xaController = serviceRegistry . getService ( JBOSS_TXN_XA_TERMINATOR ) ; xaController . setMode ( REMOVE ) ; } }

Fix:
final ServiceController < ? > tmController = serviceRegistry . getService ( JBOSS_TXN_ARJUNA_TRANSACTION_MANAGER ) ;
Buggy code:
public class CombatTest { @ Test public void canDoCombat ( ) { } @ Test public void canResolveMissedHit ( ) { } @ Test public void canResolveHitDueToTiming ( ) { final BoardModel boardModel = new BoardModel ( ) ; ChitBuilder . placeChits ( boardModel ) ; final Player attacker = new Player ( ) ; attacker . setCharacter ( CharacterFactory . createCharacter ( AMAZON ) ) ; boardModel . getStartingLocation ( ) . addEntity ( attacker . getCharacter ( ) ) ; final Player defender = new Player ( ) ; defender . setCharacter ( CharacterFactory . createCharacter ( CAPTAIN ) ) ; boardModel . getStartingLocation ( ) . addEntity ( defender . getCharacter ( ) ) ; boardModel . createNewMeleeSheet ( attacker ) ; final MeleeSheet attackerSheet = boardModel . getMeleeSheet ( attacker ) ; attackerSheet . setAttackWeapon ( new ThrustingSword ( ) ) ; attackerSheet . setAttackChit ( new ca . carleton . magicrealm . game . combat . chit . ActionChit . ActionChitBuilder ( ca . carleton . magicrealm . game . combat . chit . ActionType . FIGHT ) . withFatigueAsterisks ( 2 ) . withStrength ( MEDIUM ) . withTime ( 2 ) . build ( ) ) ; attackerSheet . setAttackDirection ( THRUST ) ; boardModel . createNewMeleeSheet ( defender ) ; final MeleeSheet defenderSheet = boardModel . getMeleeSheet ( defender ) ; defenderSheet . setManeuver ( DODGE ) ; defenderSheet . setManeuverChit ( new ca . carleton . magicrealm . game . combat . chit . ActionChit . ActionChitBuilder ( ca . carleton . magicrealm . game . combat . chit . ActionType . MOVE ) . withFatigueAsterisks ( 2 ) . withStrength ( MEDIUM ) . withTime ( 3 ) . build ( ) ) ; defenderSheet . setArmor ( new SuitOfArmor ( ) ) ; Combat . doCombat ( boardModel , attacker , defender ) ; <START_BUG> assertThat ( defender . getCharacter ( ) . isWounded ( ) , is ( true ) ) ; <END_BUG> assertThat ( defender . getCharacter ( ) . isDead ( ) , is ( false ) ) ; assertThat ( defenderSheet . getArmor ( ) . isDamaged ( ) , is ( false ) ) ; } @ Test public void canDamageArmor ( ) { } No newline ; at end ; of file ; }

Fix:
assertThat ( defender . getCharacter ( ) . isWounded ( ) , is ( false ) ) ;
Buggy code:
public class BcelAdvice extends Advice { private Test pointcutTest ; private ExposedState exposedState ; private boolean hasMatchedAtLeastOnce = false ; public BcelAdvice ( AjAttribute . AdviceAttribute attribute , Pointcut pointcut , Member signature , ResolvedType concreteAspect ) { } public BcelAdvice ( AdviceKind kind , Pointcut pointcut , Member signature , int extraArgumentFlags , int start , int end , ISourceContext sourceContext , ResolvedType concreteAspect ) { } public ShadowMunger concretize ( ResolvedType fromType , World world , PerClause clause ) { } public ShadowMunger parameterizeWith ( ResolvedType declaringType , Map typeVariableMap ) { Pointcut pc = getPointcut ( ) . parameterizeWith ( typeVariableMap ) ; BcelAdvice ret = null ; Member adviceSignature = signature ; <START_BUG> if ( ( signature ) instanceof ResolvedMember ) { <END_BUG> adviceSignature = ( ( ResolvedMember ) ( signature ) ) . parameterizedWith ( declaringType . getTypeParameters ( ) , declaringType , declaringType . isParameterizedType ( ) ) ; } ret = new BcelAdvice ( this . attribute , pc , adviceSignature , this . concreteAspect ) ; return ret ; } public boolean match ( Shadow shadow , World world ) { } public void specializeOn ( Shadow shadow ) { } private boolean canInline ( Shadow s ) { } public void implementOn ( Shadow s ) { } private Collection collectCheckedExceptions ( UnresolvedType [ ] excs ) { } private Collection thrownExceptions = null ; public Collection getThrownExceptions ( ) { } public boolean mustCheckExceptions ( ) { } public boolean hasDynamicTests ( ) { } InstructionList getAdviceInstructions ( BcelShadow s , BcelVar extraArgVar , InstructionHandle ifNoAdvice ) { } public InstructionList getAdviceArgSetup ( BcelShadow shadow , BcelVar extraVar , InstructionList closureInstantiation ) { } public InstructionList getNonTestAdviceInstructions ( BcelShadow shadow ) { } public Member getOriginalSignature ( ) { } public InstructionList getTestInstructions ( BcelShadow shadow , InstructionHandle sk , InstructionHandle fk , InstructionHandle next ) { } public int compareTo ( Object other ) { } public BcelVar [ ] getExposedStateAsBcelVars ( ) { } public boolean hasMatchedSomething ( ) { } protected void suppressLintWarnings ( World inWorld ) { } protected void clearLintSuppressions ( World inWorld ) { } }

Fix:
if ( ( ( signature ) instanceof ResolvedMember ) && ( signature . getDeclaringType ( ) . isGenericType ( ) ) ) {
Buggy code:
@ Controller public class BahmniDrugOrderController extends BaseRestController { private final String baseUrl = ( "//rest//" + ( RestConstants . VERSION_1 ) ) + "//bahmnicore//drugOrders" ; @ Autowired private BahmniDrugOrderService drugOrderService ; @ Autowired private BahmniObsService bahmniObsService ; @ Autowired private ConceptService conceptService ; private static Logger logger = Logger . getLogger ( BahmniDrugOrderController . class ) ; private OrderAttributesMapper orderAttributesMapper ; public BahmniDrugOrderController ( BahmniDrugOrderService drugOrderService ) { } public BahmniDrugOrderController ( ) { } @ RequestMapping ( value = ( baseUrl ) + "//active" , method = RequestMethod . GET ) @ ResponseBody public List < BahmniDrugOrder > getActiveDrugOrders ( @ RequestParam ( "patientUuid" ) String patientUuid ) { } @ RequestMapping ( value = ( baseUrl ) + "//prescribedAndActive" , method = RequestMethod . GET ) @ ResponseBody public Map < String , Collection < BahmniDrugOrder > > getVisitWisePrescribedAndOtherActiveOrders ( @ RequestParam ( "patientUuid" ) String patientUuid , @ RequestParam ( value = "numberOfVisits" , required = false ) Integer numberOfVisits , @ RequestParam ( value = "getOtherActive" , required = false ) Boolean getOtherActive ) { Map < String , Collection < BahmniDrugOrder > > visitWiseOrders = new HashMap < > ( ) ; List < BahmniDrugOrder > prescribedOrders = getPrescribedOrders ( patientUuid , true , numberOfVisits ) ; for ( BahmniDrugOrder prescribedOrder : prescribedOrders ) { String visitDateTime = prescribedOrder . getVisit ( ) . getStartDateTime ( ) . toString ( ) ; if ( ( visitWiseOrders . get ( visitDateTime ) ) == null ) { visitWiseOrders . put ( visitDateTime , new TreeSet < BahmniDrugOrder > ( ) ) ; } visitWiseOrders . get ( visitDateTime ) . add ( prescribedOrder ) ; } <START_BUG> if ( getOtherActive == true ) { <END_BUG> List < BahmniDrugOrder > activeDrugOrders = getActiveOrders ( patientUuid ) ; activeDrugOrders . removeAll ( prescribedOrders ) ; visitWiseOrders . put ( "Other<seq2seq4repair_space>Active<seq2seq4repair_space>DrugOrders" , activeDrugOrders ) ; } return visitWiseOrders ; } @ RequestMapping ( value = baseUrl , method = RequestMethod . GET ) @ ResponseBody public List < BahmniDrugOrder > getPrescribedDrugOrders ( @ RequestParam ( "patientUuid" ) String patientUuid , @ RequestParam ( value = "includeActiveVisit" , required = false ) Boolean includeActiveVisit , @ RequestParam ( value = "numberOfVisits" , required = false ) Integer numberOfVisits ) { } @ RequestMapping ( method = RequestMethod . GET , value = ( baseUrl ) + "//config" ) @ ResponseBody public DrugOrderConfigResponse getConfig ( ) { } private Collection < Concept > getOrdAttributeConcepts ( ) { } private OrderAttributesMapper getOrderAttributesMapper ( ) { } private List < BahmniDrugOrder > getActiveOrders ( String patientUuid ) { } private List < BahmniDrugOrder > getPrescribedOrders ( String patientUuid , Boolean includeActiveVisit , Integer numberOfVisits ) { } }

Fix:
if ( Boolean . TRUE . equals ( getOtherActive ) ) {
Buggy code:
public class LRecursionDel extends LCompoundInteractionNodeDel { @ Override public LRecursion leaveReachabilityCheck ( ModelNode parent , ModelNode child , ReachabilityChecker checker , ModelNode visited ) throws ScribbleException { } @ Override public void enterFsmConstruction ( ModelNode parent , ModelNode child , FsmConstructor conv ) { super . enterFsmConstruction ( parent , child , conv ) ; LRecursion lr = ( ( LRecursion ) ( child ) ) ; RecVar rv = lr . recvar . toName ( ) ; <START_BUG> Set < String > labs = new HashSet < > ( ) ; <END_BUG> labs . add ( rv . toString ( ) ) ; ProtocolState s = conv . builder . newState ( labs ) ; conv . builder . setEntry ( s ) ; conv . builder . setRecursionEntry ( rv ) ; } @ Override public LRecursion leaveFsmConstruction ( ModelNode parent , ModelNode child , FsmConstructor conv , ModelNode visited ) { } }

Fix:
Set < String > labs = new java . util . HashSet ( conv . builder . getEntry ( ) . getLabels ( ) ) ;
Buggy code:
public abstract class AbstractCalendar extends WebComponent { public static final DateFormat FORMAT_DATE = new SimpleDateFormat ( "MM//dd//yyyy" ) ; public static final DateFormat FORMAT_PAGEDATE = new SimpleDateFormat ( "MM//yyyy" ) ; private static final long serialVersionUID = 1L ; public AbstractCalendar ( String id ) { } public AbstractCalendar ( String id , boolean contributeDependencies ) { } public final String getJavascriptId ( ) { } public final String getJavascriptWidgetId ( ) { <START_BUG> return "YAHOO.wicket." + ( getJavascriptId ( ) ) ; <END_BUG> } private void contributeDependencies ( ) { } protected void appendToInit ( String markupId , String javascriptId , String javascriptWidgetId , StringBuffer b ) { } protected void configureWidgetProperties ( Map widgetProperties ) { } }

Fix:
return "YAHOO.org.apache.wicket." + ( getJavascriptId ( ) ) ;
Buggy code:
class BreakEliminator implements StatementVisitor { private Map < BlockStatement , List < Statement > > blockSuccessors = new HashMap < > ( ) ; private Set < IdentifiedStatement > outerStatements = new HashSet < > ( ) ; private List < Statement > currentSequence ; private boolean sequenceEscapes ; private int currentIndex ; private AllBlocksCountVisitor usageCounter ; public void eliminate ( Statement statement ) { } private void processSequence ( List < Statement > statements ) { } @ Override public void visit ( AssignmentStatement statement ) { } @ Override public void visit ( SequentialStatement statement ) { } @ Override public void visit ( ConditionalStatement statement ) { } @ Override public void visit ( SwitchStatement statement ) { } @ Override public void visit ( WhileStatement statement ) { } @ Override public void visit ( BlockStatement statement ) { } @ Override public void visit ( BreakStatement statement ) { } @ Override public void visit ( ContinueStatement statement ) { } @ Override public void visit ( ReturnStatement statement ) { } @ Override public void visit ( ThrowStatement statement ) { } @ Override public void visit ( InitClassStatement statement ) { } @ Override public void visit ( TryCatchStatement statement ) { } @ Override public void visit ( GotoPartStatement statement ) { } @ Override public void visit ( MonitorEnterStatement statement ) { } @ Override public void visit ( MonitorExitStatement statement ) { } private boolean escapes ( List < Statement > statements ) { <START_BUG> return new EscapingStatementFinder ( outerStatements ) . check ( statements ) ; <END_BUG> } }

Fix:
return new EscapingStatementFinder ( ) . check ( statements ) ;
Buggy code:
@ WebService public class ProviderWS { @ WebMethod ( operationName = "pingpong" ) public String pingpong ( @ WebParam ( name = "ping" ) String txt ) { <START_BUG> if ( txt . equals ( "ping" ) ) { <END_BUG> return "pong" ; } else return "error" ; } }

Fix:
if ( ( txt != null ) && ( txt . equals ( "ping" ) ) ) {
Buggy code:
public class CsvView extends BaseExportView { public CsvView ( final List tableModel , final boolean exportFullList , final boolean includeHeader , final boolean decorateValues ) { } @ Override protected String getRowStart ( ) { } @ Override protected String getRowEnd ( ) { } @ Override protected String getCellStart ( ) { } @ Override protected String getCellEnd ( ) { } @ Override protected String getDocumentStart ( ) { } @ Override protected String getDocumentEnd ( ) { } @ Override protected boolean getAlwaysAppendCellEnd ( ) { } @ Override protected boolean getAlwaysAppendRowEnd ( ) { } @ Override public String getMimeType ( ) { } @ Override <START_BUG> protected Object escapeColumnValue ( Object value ) { <END_BUG> if ( value != null ) { String stringValue = StringUtils . trim ( value . toString ( ) ) ; if ( ! ( StringUtils . containsNone ( stringValue , new char [ ] { '\n' , ',' } ) ) ) { return ( "\"" + ( StringUtils . replace ( stringValue , "\"" , "\\\"" ) ) ) + "\"" ; } return stringValue ; } return null ; } }

Fix:
protected Object escapeColumnValue ( final Object value ) {