nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ModuleLoadingResourceDefinition extends SimpleResourceDefinition { private static final AttributeDefinition MODULE_NAME = new org . jboss . as . controller . SimpleAttributeDefinitionBuilder ( MODULE , org . jboss . dmr . ModelType . STRING ) . build ( ) ; private final List < AccessConstraintDefinition > accessConstraints ; public ModuleLoadingResourceDefinition ( ) { } @ Override public void registerAttributes ( ManagementResourceRegistration resourceRegistration ) { } @ Override public void registerOperations ( ManagementResourceRegistration resourceRegistration ) { } @ Override public List < AccessConstraintDefinition > getAccessConstraints ( ) { } private static class ListModuleRootsHandler extends AbstractRuntimeOnlyHandler { @ Override protected boolean resourceMustExist ( OperationContext context , ModelNode operation ) { } @ Override protected void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { } private static void storeRepoRoots ( final ModelNode list ) throws IllegalAccessException , NoSuchFieldException { } } private static final class ModuleLocationHandler implements OperationStepHandler { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } } private static List < String > findResourcePaths ( String moduleName ) throws IllegalAccessException , NoSuchFieldException , ModuleLoadException { List < String > result = new ArrayList < String > ( ) ; <START_BUG> Module module = Module . getModuleFromCallerModuleLoader ( ModuleIdentifier . create ( moduleName ) ) ; <END_BUG> ModuleClassLoader mcl = module . getClassLoader ( ) ; Field pathsField = ModuleClassLoader . class . getDeclaredField ( "paths" ) ; Field sourceListField = null ; Field resourceLoaderField = null ; pathsField . setAccessible ( true ) ; try { Object paths = pathsField . get ( mcl ) ; sourceListField = paths . getClass ( ) . getDeclaredField ( "sourceList" ) ; sourceListField . setAccessible ( true ) ; Object [ ] resourceLoaderSpecs = ( ( Object [ ] ) ( sourceListField . get ( paths ) ) ) ; resourceLoaderField = ResourceLoaderSpec . class . getDeclaredField ( "resourceLoader" ) ; resourceLoaderField . setAccessible ( true ) ; for ( Object resourceLoaderSpec : resourceLoaderSpecs ) { ResourceLoader resourceLoader = ( ( ResourceLoader ) ( resourceLoaderField . get ( resourceLoaderSpec ) ) ) ; String path = ModuleLoadingResourceDefinition . getResourceLoaderPath ( resourceLoader ) ; if ( path != null ) { result . add ( path ) ; } } return result ; } finally { pathsField . setAccessible ( false ) ; if ( sourceListField != null ) { sourceListField . setAccessible ( false ) ; } if ( resourceLoaderField != null ) { resourceLoaderField . setAccessible ( false ) ; } } } private static String getResourceLoaderPath ( ResourceLoader resourceLoader ) throws IllegalAccessException , NoSuchFieldException { } private static boolean isInstanceOf ( Object obj , String className ) { } }

Fix:
Module module = Module . getModuleFromCallerModuleLoader ( ModuleIdentifier . fromString ( moduleName ) ) ;
Buggy code:
public class StopTomcat { static final String DEFAULT_CONFIG = "conf//server.xml" ; private static StringManager sm = StringManager . getManager ( "org.apache.tomcat.resources" ) ; String tomcatHome = null ; String host = null ; int port = - 1 ; String secret ; boolean commandLineParams = false ; String secretFile = null ; String [ ] args ; boolean help = false ; public StopTomcat ( ) { } public void setSecretFile ( String s ) { } public void setAjpid ( String s ) { } public void setH ( String s ) { } public void setHome ( String s ) { } public void setHost ( String h ) { } public void setPort ( int port ) { } public void setPass ( String s ) { } public void setSecret ( String s ) { } public void setHelp ( boolean b ) { } public void setAttribute ( String s , Object o ) { } public void setProperty ( String name , String v ) { } public void setArgs ( String [ ] args ) { } public void execute ( ) throws Exception { } void stopTomcat ( ) throws Exception { String tchome = getTomcatHome ( ) ; try { if ( ( secretFile ) == null ) secretFile = tchome + "//conf//ajp12.id" ; BufferedReader rd = new BufferedReader ( new FileReader ( secretFile ) ) ; String line = rd . readLine ( ) ; if ( ( port ) < 0 ) { try { port = Integer . parseInt ( line ) ; } catch ( NumberFormatException ex ) { ex . printStackTrace ( ) ; } } line = rd . readLine ( ) ; if ( ( host ) == null ) host = line ; line = rd . readLine ( ) ; if ( ( secret ) == null ) secret = line ; } catch ( IOException ex ) { System . out . println ( ( "Can't<seq2seq4repair_space>read<seq2seq4repair_space>" + ( secretFile ) ) ) ; if ( ! ( commandLineParams ) ) return ; } if ( "" . equals ( secret ) ) secret = null ; <START_BUG> System . out . println ( ( ( ( ( ( "Stoping<seq2seq4repair_space>tomcat<seq2seq4repair_space>on<seq2seq4repair_space>" + ( host ) ) + ":" ) + ( port ) ) + "<seq2seq4repair_space>" ) + ( secret ) ) ) ; <END_BUG> InetAddress address = null ; if ( ( ( host ) != null ) && ( ! ( "" . equals ( host ) ) ) ) { try { address = InetAddress . getByName ( host ) ; } catch ( UnknownHostException ex ) { ex . printStackTrace ( ) ; } } stopTomcat ( address , port , secret ) ; } public String getTomcatHome ( ) { } public void stopTomcat ( InetAddress address , int portInt , String secret ) throws IOException { } public void sendAjp12Stop ( OutputStream os , String secret ) throws IOException { } public void sendAjp12String ( OutputStream os , String s ) throws IOException { } public boolean processArgs ( String [ ] args ) { } static String [ ] options1 = new String [ ] { "help" , "stop" } ; static Hashtable optionAliases = new Hashtable ( ) ; static Hashtable optionDescription = new Hashtable ( ) ; public String [ ] getOptions1 ( ) { } public Hashtable getOptionAliases ( ) { } public static void printUsage ( ) { } public static void main ( String [ ] args ) { } }

Fix:
System . out . println ( ( ( ( ( ( "Stopping<seq2seq4repair_space>tomcat<seq2seq4repair_space>on<seq2seq4repair_space>" + ( host ) ) + ":" ) + ( port ) ) + "<seq2seq4repair_space>" ) + ( secret ) ) ) ;
Buggy code:
public class PascalDistributionTest extends IntegerDistributionAbstractTest { protected double defaultTolerance = NormalDistribution . DEFAULT_INVERSE_ABSOLUTE_ACCURACY ; @ Override public void setUp ( ) { } @ Override public IntegerDistribution makeDistribution ( ) { } @ Override public int [ ] makeDensityTestPoints ( ) { } @ Override public double [ ] makeDensityTestValues ( ) { } @ Override public int [ ] makeCumulativeTestPoints ( ) { } @ Override public double [ ] makeCumulativeTestValues ( ) { } @ Override public double [ ] makeInverseCumulativeTestPoints ( ) { } @ Override public int [ ] makeInverseCumulativeTestValues ( ) { } @ Test public void testDegenerate0 ( ) throws Exception { } @ Test public void testDegenerate1 ( ) throws Exception { } @ Test public void testMoments ( ) { final double tol = 1.0E-9 ; PascalDistribution dist ; dist = new PascalDistribution ( 10 , 0.5 ) ; Assert . assertEquals ( dist . getNumericalMean ( ) , ( ( 10.0 * 0.5 ) // 0.5 ) , tol ) ; Assert . assertEquals ( dist . getNumericalVariance ( ) , ( ( 10.0 * 0.5 ) // ( 0.5 * 0.5 ) ) , tol ) ; <START_BUG> dist = new PascalDistribution ( 25 , 0.3 ) ; <END_BUG> Assert . assertEquals ( dist . getNumericalMean ( ) , ( ( 25.0 * 0.3 ) // 0.7 ) , tol ) ; Assert . assertEquals ( dist . getNumericalVariance ( ) , ( ( 25.0 * 0.3 ) // ( 0.7 * 0.7 ) ) , tol ) ; } }

Fix:
dist = new PascalDistribution ( 25 , 0.7 ) ;
Buggy code:
public class PatternOverlayPlugin implements MMPlugin { public static String menuName = "Pattern<seq2seq4repair_space>Overlay" ; public static final String tooltipDescription = "Overlay<seq2seq4repair_space>pattern<seq2seq4repair_space>on<seq2seq4repair_space>viewer<seq2seq4repair_space>window" ; public static final Color borderColor = Color . gray ; private MMStudio gui_ ; private static PatternOverlayFrame myFrame_ ; @ Override public void setApp ( Studio app ) { gui_ = ( ( MMStudio ) ( app ) ) ; if ( ( PatternOverlayPlugin . myFrame_ ) != null ) { WindowEvent wev = new WindowEvent ( PatternOverlayPlugin . myFrame_ , WindowEvent . WINDOW_CLOSING ) ; PatternOverlayPlugin . myFrame_ . dispatchEvent ( wev ) ; PatternOverlayPlugin . myFrame_ = null ; } if ( ( PatternOverlayPlugin . myFrame_ ) == null ) { try { PatternOverlayPlugin . myFrame_ = new PatternOverlayFrame ( gui_ ) ; PatternOverlayPlugin . myFrame_ . setTitle ( PatternOverlayPlugin . menuName ) ; } catch ( Exception e ) { <START_BUG> gui_ . showError ( e ) ; <END_BUG> } } PatternOverlayPlugin . myFrame_ . setVisible ( true ) ; } @ Override public void dispose ( ) { } @ Override public void show ( ) { } @ Override public String getDescription ( ) { } @ Override public String getInfo ( ) { } @ Override public String getVersion ( ) { } @ Override public String getCopyright ( ) { } }

Fix:
gui_ . logs ( ) . showError ( e ) ;
Buggy code:
public class AddPropertyIfMissing extends Enhancer { private final Logger logger = LoggerFactory . getLogger ( AddPropertyIfMissing . class ) ; public static final Pattern LITERAL = Pattern . compile ( "\"(.*)\"@(\\w*)" ) ; private void addIfMissing ( URI rdfClass , URI prop , String value ) throws RepositoryException { logger . info ( "Add<seq2seq4repair_space>missing<seq2seq4repair_space>{}<seq2seq4repair_space>to<seq2seq4repair_space>{}" , prop . toString ( ) , rdfClass . toString ( ) ) ; URL url = null ; String str = "" ; String lang = "" ; try { url = new URL ( value ) ; } catch ( MalformedURLException ex ) { Matcher m = AddPropertyIfMissing . LITERAL . matcher ( value ) ; <START_BUG> if ( ( m . groupCount ( ) ) == 2 ) { <END_BUG> str = m . group ( 1 ) ; lang = m . group ( 2 ) ; } } Storage store = getStore ( ) ; List < URI > subjs = store . query ( rdfClass ) ; int added = 0 ; for ( URI subj : subjs ) { if ( ! ( store . has ( subj , prop ) ) ) { if ( url != null ) { store . add ( subj , prop , url ) ; } else { store . add ( subj , prop , str , lang ) ; } added ++ ; } } logger . info ( "Property<seq2seq4repair_space>added<seq2seq4repair_space>{}<seq2seq4repair_space>times" , Integer . toString ( added ) ) ; } @ Override public void enhance ( ) { } public AddPropertyIfMissing ( Storage store ) { } }

Fix:
if ( m . find ( ) ) {
Buggy code:
public class UUIDStringSeq implements Seq { private static final UUIDStringSeq _instance = new UUIDStringSeq ( ) ; private String _last = null ; public static UUIDStringSeq getInstance ( ) { } private UUIDStringSeq ( ) { } public void setType ( int type ) { } public synchronized Object next ( StoreContext ctx , ClassMetaData meta ) { <START_BUG> _last = UUIDGenerator . nextString ( ) ; <END_BUG> return _last ; } public synchronized Object current ( StoreContext ctx , ClassMetaData meta ) { } public void allocate ( int additional , StoreContext ctx , ClassMetaData meta ) { } public void close ( ) { } }

Fix:
_last = UUIDGenerator . nextString ( TYPE1 ) ;
Buggy code:
public class CssLinkResourceTransformer implements ResourceTransformer { private static final Log logger = LogFactory . getLog ( CssLinkResourceTransformer . class ) ; private static final Charset DEFAULT_CHARSET = Charset . forName ( "UTF-8" ) ; private final List < CssLinkResourceTransformer . CssLinkParser > linkParsers = new ArrayList < CssLinkResourceTransformer . CssLinkParser > ( ) ; public CssLinkResourceTransformer ( ) { } @ Override public Resource transform ( HttpServletRequest request , Resource resource , ResourceTransformerChain transformerChain ) throws IOException { } protected static interface CssLinkParser { void parseLink ( String content , Set < CssLinkResourceTransformer . CssLinkInfo > linkInfos ) { } } protected abstract static class AbstractCssLinkParser implements CssLinkResourceTransformer . CssLinkParser { protected abstract String getKeyword ( ) { } @ Override public void parseLink ( String content , Set < CssLinkResourceTransformer . CssLinkInfo > linkInfos ) { } private int skipWhitespace ( String content , int index ) { } protected int addLink ( int index , String endKey , String content , Set < CssLinkResourceTransformer . CssLinkInfo > linkInfos ) { } protected abstract int extractLink ( int index , String content , Set < CssLinkResourceTransformer . CssLinkInfo > linkInfos ) { } } private static class ImportStatementCssLinkParser extends CssLinkResourceTransformer . AbstractCssLinkParser { @ Override protected String getKeyword ( ) { } @ Override protected int extractLink ( int index , String content , Set < CssLinkResourceTransformer . CssLinkInfo > linkInfos ) { } } private static class UrlFunctionCssLinkParser extends CssLinkResourceTransformer . AbstractCssLinkParser { @ Override protected String getKeyword ( ) { } @ Override protected int extractLink ( int index , String content , Set < CssLinkResourceTransformer . CssLinkInfo > linkInfos ) { } } private static class CssLinkInfo implements Comparable < CssLinkResourceTransformer . CssLinkInfo > { private final int start ; private final int end ; private CssLinkInfo ( int start , int end ) { } public int getStart ( ) { } public int getEnd ( ) { } @ Override public int compareTo ( CssLinkResourceTransformer . CssLinkInfo other ) { <START_BUG> return Integer . compare ( this . start , other . start ) ; <END_BUG> } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } } }

Fix:
return ( this . start ) < ( other . start ) ? - 1 : ( this . start ) == ( other . start ) ? 0 : 1 ;
Buggy code:
public class PlanDetailActivity extends BaseActivity implements View . OnClickListener { private Context mContext ; private TextView tv_plan_title ; private TextView tv_plan_start_date ; private TextView tv_plan_end_date ; private EditText edt_plan_des ; private Button btn_confirm ; private Button btn_del ; private DataBaseHelper dbHelper ; private SQLiteDatabase db ; private int id ; private NockPlan plan ; @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override protected int getLayoutID ( ) { } private void initEvent ( ) { } private void initData ( ) { mContext = this ; <START_BUG> dbHelper = new DataBaseHelper ( mContext , null ) ; <END_BUG> db = dbHelper . getWritableDatabase ( ) ; Intent intent = getIntent ( ) ; id = intent . getIntExtra ( "planId" , ( - 1 ) ) ; if ( ( id ) >= 0 ) { plan = dbHelper . getPlan ( id ) ; tv_plan_title . setText ( plan . getTitle ( ) ) ; tv_plan_start_date . setText ( DateUtils . formatDate ( plan . getStartDate ( ) ) ) ; tv_plan_end_date . setText ( DateUtils . formatDate ( plan . getEndDate ( ) ) ) ; edt_plan_des . setText ( plan . getDescription ( ) ) ; } } private void initView ( ) { } @ Override public void onClick ( View v ) { } private void doSave ( ) { } private void doDelete ( ) { } }

Fix:
dbHelper = DataBaseHelper . GetInstance ( mContext , null ) ;
Buggy code:
public final class ConstraintParser { private ConstraintParser ( ) { } public static LC parseLayoutConstraint ( String s ) { } public static AC parseRowConstraints ( String s ) { } public static AC parseColumnConstraints ( String s ) { } private static AC parseAxisConstraint ( String s , boolean isCols ) { } private static DimConstraint parseDimConstraint ( String s , BoundSize gapBefore , BoundSize gapAfter , boolean isCols ) { } public static Map < ComponentWrapper , CC > parseComponentConstraints ( Map < ComponentWrapper , String > constrMap ) { } public static CC parseComponentConstraint ( String s ) { } public static UnitValue [ ] parseInsets ( String s , boolean acceptPanel ) { if ( ( ( ( s . length ( ) ) == 0 ) || ( s . equals ( "dialog" ) ) ) || ( s . equals ( "panel" ) ) ) { if ( acceptPanel == false ) <START_BUG> throw new IllegalAccessError ( ( ( "Insets<seq2seq4repair_space>now<seq2seq4repair_space>allowed:<seq2seq4repair_space>" + s ) + "\n" ) ) ; <END_BUG> boolean isPanel = s . startsWith ( "p" ) ; UnitValue [ ] ins = new UnitValue [ 4 ] ; for ( int j = 0 ; j < 4 ; j ++ ) ins [ j ] = ( isPanel ) ? PlatformDefaults . getPanelInsets ( j ) : PlatformDefaults . getDialogInsets ( j ) ; return ins ; } else { String [ ] insS = ConstraintParser . toTrimmedTokens ( s , '<seq2seq4repair_space>' ) ; UnitValue [ ] ins = new UnitValue [ 4 ] ; for ( int j = 0 ; j < 4 ; j ++ ) { UnitValue insSz = ConstraintParser . parseUnitValue ( insS [ ( j < ( insS . length ) ? j : ( insS . length ) - 1 ) ] , ZERO , ( ( j % 2 ) == 1 ) ) ; ins [ j ] = ( insSz != null ) ? insSz : PlatformDefaults . getPanelInsets ( j ) ; } return ins ; } } private static BoundSize [ ] parseGaps ( String s ) { } private static int parseSpan ( String s ) { } private static Float parseFloat ( String s , Float nullVal ) { } public static BoundSize parseBoundSize ( String s , boolean isGap , boolean isHor ) { } public static UnitValue parseUnitValueOrAlign ( String s , boolean isHor , UnitValue emptyReplacement ) { } public static UnitValue parseUnitValue ( String s , boolean isHor ) { } private static UnitValue parseUnitValue ( String s , UnitValue emptyReplacement , boolean isHor ) { } static UnitValue parseAlignKeywords ( String s , boolean isHor ) { } private static String [ ] getNumTextParts ( String s ) { } private static int getOper ( String s ) { } private static int startsWithLenient ( String s , String [ ] matches , int [ ] minChars , boolean acceptTrailing ) { } private static int startsWithLenient ( String s , String match , int minChars , boolean acceptTrailing ) { } private static String [ ] toTrimmedTokens ( String s , char sep ) { } private static ArrayList < String > getRowColAndGapsTrimmed ( String s ) { } public static String prepare ( String s ) { } }

Fix:
throw new IllegalArgumentException ( ( ( "Insets<seq2seq4repair_space>now<seq2seq4repair_space>allowed:<seq2seq4repair_space>" + s ) + "\n" ) ) ;
Buggy code:
public class SequenceFilesFromLuceneStorageDriverTest extends AbstractLuceneStorageTest { private SequenceFilesFromLuceneStorageDriver driver ; private LuceneStorageConfiguration lucene2SeqConf ; private String idField ; private List < String > fields ; private Path seqFilesOutputPath ; private Configuration conf ; @ Before public void before ( ) throws Exception { <START_BUG> conf = new Configuration ( ) ; <END_BUG> conf . set ( "io.serializations" , ( "org.apache.hadoop.io.serializer.JavaSerialization," + "org.apache.hadoop.io.serializer.WritableSerialization" ) ) ; seqFilesOutputPath = new Path ( getTestTempDirPath ( ) , "seqfiles" ) ; idField = "id" ; fields = Arrays . asList ( "field" ) ; driver = new SequenceFilesFromLuceneStorageDriver ( ) { @ Override public LuceneStorageConfiguration newLucene2SeqConfiguration ( Configuration configuration , List < Path > indexPaths , Path seqPath , String idField , List < String > fields ) { lucene2SeqConf = new LuceneStorageConfiguration ( configuration , indexPaths , seqPath , idField , fields ) ; return lucene2SeqConf ; } } ; commitDocuments ( getDirectory ( getIndexPath1AsFile ( ) ) , new SingleFieldDocument ( "1" , "Mahout<seq2seq4repair_space>is<seq2seq4repair_space>cool" ) ) ; commitDocuments ( getDirectory ( getIndexPath1AsFile ( ) ) , new SingleFieldDocument ( "2" , "Mahout<seq2seq4repair_space>is<seq2seq4repair_space>cool" ) ) ; } @ After public void after ( ) throws IOException { } @ Test public void testNewLucene2SeqConfiguration ( ) { } @ Test public void testRun ( ) throws Exception { } @ Test public void testRunOptionalArguments ( ) throws Exception { } @ Test public void testRunInvalidQuery ( ) throws Exception { } @ Test public void testHelp ( ) throws Exception { } }

Fix:
conf = getConfiguration ( ) ;
Buggy code:
public class BaseAdServiceTest { AdService adService = new AdService ( ) ; UserService userService = new UserService ( ) ; @ Test public void testGetCategory ( ) throws Exception { } @ Test public void testSaveAdByCat ( ) throws Exception { } @ Test public void testSaveAdWithUserAndGet ( ) throws Exception { } @ Test public void testGetAd ( ) throws Exception { } @ Test public void testGetAdModel ( ) throws Exception { Vehicle ad = new Vehicle ( ) ; <START_BUG> ad . setId ( "56310b651792c62cd39d4f03" ) ; <END_BUG> Vehicle fullAd = adService . getAd ( ad ) ; assertEquals ( "Vehicle" , fullAd . getCategory ( ) ) ; } @ Test public void testDeleteAd ( ) throws Exception { } @ Test public void testUpdateAd ( ) throws Exception { } No newline ; at end ; of file ; }

Fix:
ad . setId ( "56310b651792c62cd39d4f57" ) ;
Buggy code:
public class HealthBar { private int maxHealth ; private Image emptyHeart ; private Image halfHeart ; private Image wholeHeart ; private int startX = 150 ; private int startY = 60 ; private int widthX = 37 ; private Player player ; public HealthBar ( ) { } public HealthBar ( Player player , int health ) { } public void render ( GameContainer container , Graphics g ) throws SlickException { int currentX ; int i ; int drawHalfHeart = ( player . getCurrentHealth ( ) ) % 2 ; for ( i = 1 ; i < ( maxHealth ) ; i += 2 ) { currentX = ( ( widthX ) * i ) + ( startX ) ; if ( i < ( player . getCurrentHealth ( ) ) ) g . drawImage ( wholeHeart , currentX , startY ) ; else <START_BUG> if ( ( i >= ( player . getCurrentHealth ( ) ) ) && ( drawHalfHeart != 0 ) ) { <END_BUG> g . drawImage ( halfHeart , currentX , startY ) ; drawHalfHeart = 0 ; } else g . drawImage ( emptyHeart , currentX , startY ) ; } } }

Fix:
if ( ( ( ( player . getCurrentHealth ( ) ) > 0 ) && ( i >= ( player . getCurrentHealth ( ) ) ) ) && ( drawHalfHeart != 0 ) ) {
Buggy code:
public class HeaderPanel extends AbstractConfigGui implements ActionListener , FocusListener { private static transient Logger log = LoggingManager . getLoggerForClass ( ) ; private static final String ADD_COMMAND = "Add" ; private static final String DELETE_COMMAND = "Delete" ; private static final String LOAD_COMMAND = "Load" ; private static final String SAVE_COMMAND = "Save" ; private HeaderPanel . InnerTableModel tableModel ; private JTable headerTable ; private JButton addButton ; private JButton deleteButton ; private JButton loadButton ; private JButton saveButton ; public HeaderPanel ( ) { } public TestElement createTestElement ( ) { } public void modifyTestElement ( TestElement el ) { } public void configure ( TestElement el ) { tableModel . manager . clear ( ) ; super . configure ( el ) ; <START_BUG> tableModel . manager . addTestElement ( ( ( HeaderManager ) ( el ) ) ) ; <END_BUG> boolean hasRows = ( tableModel . getRowCount ( ) ) > 0 ; deleteButton . setEnabled ( hasRows ) ; saveButton . setEnabled ( hasRows ) ; } public String getLabelResource ( ) { } public void init ( ) { } public void actionPerformed ( ActionEvent e ) { } public JPanel createHeaderTablePanel ( ) { } private JButton createButton ( String resName , char mnemonic , String command , boolean enabled ) { } private JPanel createButtonPanel ( ) { } class HeaderUpdater implements ActionListener { JTextField nameField = new JTextField ( 20 ) ; JTextField valueField = new JTextField ( 20 ) ; JButton ok = new JButton ( "Ok" ) ; JButton cancel = new JButton ( "Cancel" ) ; int index ; JDialog updateDialog ; public HeaderUpdater ( ) { } public JPanel getPanel ( ) { } public void actionPerformed ( ActionEvent e ) { } } public void focusGained ( FocusEvent e ) { } public void focusLost ( FocusEvent e ) { } private class InnerTableModel extends AbstractTableModel { HeaderManager manager ; public InnerTableModel ( HeaderManager man ) { } public InnerTableModel ( ) { } public void removeRow ( int row ) { } public void addNewRow ( ) { } public boolean isCellEditable ( int row , int column ) { } public Class getColumnClass ( int column ) { } public int getRowCount ( ) { } public int getColumnCount ( ) { } public String getColumnName ( int column ) { } public Object getValueAt ( int row , int column ) { } public void setValueAt ( Object value , int row , int column ) { } } }

Fix:
tableModel . manager . addTestElement ( el ) ;
Buggy code:
public class TwitterAuthActivity extends Activity { Twitter twitter ; RequestToken requestToken = null ; AccessToken accessToken ; String oauth_url ; String oauth_verifier ; String profile_url ; Dialog auth_dialog ; WebView web ; SharedPreferences pref ; ProgressDialog progress ; Bitmap bitmap ; @ Override public void onCreate ( Bundle savedInstanceState ) { } private boolean isTwitterLoggedInAlready ( ) { } private class TokenGetTask extends AsyncTask < String , String , String > { @ Override protected String doInBackground ( String ... args ) { } @ Override protected void onPostExecute ( String oauth_url ) { if ( oauth_url != null ) { Log . e ( "URL" , oauth_url ) ; <START_BUG> auth_dialog = new Dialog ( getApplicationContext ( ) ) ; <END_BUG> auth_dialog . requestWindowFeature ( FEATURE_NO_TITLE ) ; auth_dialog . setContentView ( twitter_auth_dialog ) ; web = ( ( WebView ) ( auth_dialog . findViewById ( twitter_auth_view ) ) ) ; web . getSettings ( ) . setJavaScriptEnabled ( true ) ; web . loadUrl ( oauth_url ) ; web . setWebViewClient ( new WebViewClient ( ) { boolean authComplete = false ; @ Override public void onPageStarted ( WebView view , String url , Bitmap favicon ) { super . onPageStarted ( view , url , favicon ) ; } @ Override public void onPageFinished ( WebView view , String url ) { super . onPageFinished ( view , url ) ; if ( ( url . contains ( "oauth_verifier" ) ) && ( ( authComplete ) == false ) ) { authComplete = true ; Log . e ( "Url" , url ) ; Uri uri = Uri . parse ( url ) ; oauth_verifier = uri . getQueryParameter ( "oauth_verifier" ) ; auth_dialog . dismiss ( ) ; new TwitterAuthActivity . AccessTokenTask ( ) . execute ( ) ; } else if ( url . contains ( "denied" ) ) { auth_dialog . dismiss ( ) ; Toast . makeText ( getApplicationContext ( ) , "Sorry<seq2seq4repair_space>!,<seq2seq4repair_space>Permission<seq2seq4repair_space>Denied" , LENGTH_SHORT ) . show ( ) ; } } } ) ; auth_dialog . show ( ) ; auth_dialog . setCancelable ( true ) ; } else { Toast . makeText ( getApplicationContext ( ) , "Sorry<seq2seq4repair_space>!,<seq2seq4repair_space>Network<seq2seq4repair_space>Error<seq2seq4repair_space>or<seq2seq4repair_space>Invalid<seq2seq4repair_space>Credentials" , LENGTH_SHORT ) . show ( ) ; } } } private class AccessTokenTask extends AsyncTask < String , String , Boolean > { @ Override protected void onPreExecute ( ) { } @ Override protected Boolean doInBackground ( String ... args ) { } @ Override protected void onPostExecute ( Boolean response ) { } } }

Fix:
auth_dialog = new Dialog ( TwitterAuthActivity . this ) ;
Buggy code:
public class UnitNodeProperties implements UnitConstants , IPropertySource { private Map < String , String > properties = new LinkedHashMap < String , String > ( ) ; public boolean contains ( String propName ) { } public Set < String > getNames ( ) { } public String getProperty ( String name ) { } public Object getEditableValue ( ) { } public boolean isValidId ( String key ) { } public void addProperty ( String name , String value ) { } public void renameProperty ( String oldName , String newName ) { } public String removeProperty ( String name ) { <START_BUG> return properties . get ( name ) ; <END_BUG> } public IPropertyDescriptor [ ] getPropertyDescriptors ( ) { } public Object getPropertyValue ( Object id ) { } public boolean isPropertySet ( Object id ) { } public void resetPropertyValue ( Object id ) { } public void setPropertyValue ( Object id , Object value ) { } private class PropertyId { String name ; PropertyId ( String name ) { } } }

Fix:
return properties . remove ( name ) ;
Buggy code:
public class DialogProperties implements IDialog { private final Model model ; private final Controller controller ; private final PreferencesDialog dialog ; public DialogProperties ( final Shell parent , final Model model , final Controller controller ) { } public void open ( ) { } private void createTabInternals ( PreferencesDialog window ) { } private void createTabIOSettings ( PreferencesDialog window ) { } private void createTabProject ( PreferencesDialog window ) { } private void createTabRisk ( PreferencesDialog window ) { window . addCategory ( Resources . getMessage ( "PropertyDialog.40" ) , controller . getResources ( ) . getImage ( "settings-risk.png" ) ) ; window . addPreference ( new PreferenceInteger ( Resources . getMessage ( "PropertyDialog.41" ) , 1 , 100000 , 1000 ) { protected Integer getValue ( ) { return model . getRiskModel ( ) . getMaxIterations ( ) ; } protected void setValue ( Object t ) { model . getRiskModel ( ) . setMaxIterations ( ( ( Integer ) ( t ) ) ) ; } } ) ; window . addPreference ( new PreferenceDouble ( Resources . getMessage ( "PropertyDialog.42" ) , 1.0E-10 , 1.0 , 1.0E-6 ) { protected Double getValue ( ) { return model . getRiskModel ( ) . getAccuracy ( ) ; } protected void setValue ( Object t ) { model . getRiskModel ( ) . setAccuracy ( ( ( Double ) ( t ) ) ) ; } } ) ; window . addPreference ( new PreferenceInteger ( Resources . getMessage ( "PropertyDialog.43" ) , 1 , 10 , 10 ) { protected Integer getValue ( ) { return model . getRiskModel ( ) . getMaxQiSize ( ) ; } protected void setValue ( Object t ) { model . getRiskModel ( ) . setMaxQiSize ( ( ( Integer ) ( t ) ) ) ; } } ) ; <START_BUG> window . addPreference ( new PreferenceSelection ( Resources . getMessage ( "PropertyDialog.43" ) , getRiskModelsForAnalyses ( ) ) { <END_BUG> protected String getValue ( ) { return model . getRiskModel ( ) . getRiskModelForAttributes ( ) . name ( ) ; } protected void setValue ( Object arg0 ) { model . getRiskModel ( ) . setRiskModelForAttributes ( RiskModelForAttributes . valueOf ( ( ( String ) ( arg0 ) ) ) ) ; } } ) ; window . addPreference ( new PreferenceBoolean ( Resources . getMessage ( "PropertyDialog.44" ) ) { protected Boolean getValue ( ) { return model . getInputConfig ( ) . isHeuristicForSampleBasedCriteria ( ) ; } protected void setValue ( Object t ) { model . getInputConfig ( ) . setHeuristicForSampleBasedCriteria ( ( ( Boolean ) ( t ) ) ) ; } } ) ; } private void createTabTransformation ( PreferencesDialog window ) { } private void createTabVisualization ( PreferencesDialog window ) { } private String [ ] getLocales ( ) { } private String [ ] getRiskModelsForAnalyses ( ) { } }

Fix:
window . addPreference ( new PreferenceSelection ( Resources . getMessage ( "PropertyDialog.45" ) , getRiskModelsForAnalyses ( ) ) {
Buggy code:
public class OperationMenu extends JPopupMenu { private static final String [ ] genericOps = new String [ ] { "add" , "read-operation-description" , "read-resource-description" , "read-operation-names" } ; private static final List < String > genericOpList = Arrays . asList ( OperationMenu . genericOps ) ; private static final String [ ] leafOps = new String [ ] { "write-attribute" , "undefine-attribute" } ; private static final List < String > leafOpList = Arrays . asList ( OperationMenu . leafOps ) ; private CommandExecutor executor ; private JTree invoker ; public OperationMenu ( CommandExecutor executor , JTree invoker ) { } public void show ( ManagementModelNode node , int x , int y ) { } private ModelNode getResourceDescription ( String addressPath , String name ) { } private class OperationAction extends AbstractAction { private ManagementModelNode node ; private String opName ; private String addressPath ; private ModelNode opDescription ; private String strDescription ; public OperationAction ( ManagementModelNode node , String opName , ModelNode opDescription ) { } public void actionPerformed ( ActionEvent ae ) { JTextComponent cmdText = GuiMain . getCommandLine ( ) . getCmdText ( ) ; ModelNode requestProperties = opDescription . get ( "result" , "request-properties" ) ; if ( ( ( requestProperties == null ) || ( ! ( requestProperties . isDefined ( ) ) ) ) || ( requestProperties . asList ( ) . isEmpty ( ) ) ) { cmdText . setText ( ( ( ( addressPath ) + ":" ) + ( opName ) ) ) ; cmdText . requestFocus ( ) ; return ; } if ( ( node . isLeaf ( ) ) && ( opName . equals ( "undefine-attribute" ) ) ) { UserObject usrObj = ( ( UserObject ) ( node . getUserObject ( ) ) ) ; cmdText . setText ( ( ( ( ( ( ( addressPath ) + ":" ) + ( opName ) ) + "(name=" ) + ( usrObj . getName ( ) ) ) + ")" ) ) ; cmdText . requestFocus ( ) ; return ; } OperationDialog dialog = new OperationDialog ( node , opName , strDescription , requestProperties ) ; <START_BUG> dialog . setLocationRelativeTo ( GuiMain . getFrame ( ) ) ; <END_BUG> dialog . setVisible ( true ) ; } } }

Fix:
dialog . setLocationRelativeTo ( GuiMain . getMainWindow ( ) ) ;
Buggy code:
public class CoreCalc { private static final int GRAY = 4473924 ; private static final int TRANSPARENT = 0 ; private static int mAlpha = 255 ; private float [ ] originVerts = new float [ ( 6 * 51 ) * 2 ] ; private float [ ] meshVerts = new float [ ( 6 * 51 ) * 2 ] ; private Shader mShader ; private CoreCalc . Direction mDirection = CoreCalc . Direction . RIGHT ; public enum Direction { LEFT , RIGHT ; } public void setDirection ( CoreCalc . Direction direction ) { } public Shader getShader ( ) { } private int width ; private int height ; public CoreCalc ( int width , int height ) { } public float [ ] createOffsetVerts ( float offset , float pointerY ) { } private float [ ] applyCurveXEffect ( float offset ) { } private float [ ] applyScaleXEffect ( float offset , float pointerY ) { for ( int i = 0 ; i < 6 ; i ++ ) for ( int j = 0 ; j < 51 ; j ++ ) { float curveFactor = 0 ; if ( offset > 0.85 ) { curveFactor = ( ( float ) ( 1 + ( ( Math . pow ( ( ( offset - 0.85F ) // 0.3F ) , 3 ) ) * 100.0F ) ) ) ; } else { curveFactor = 1 ; } <START_BUG> int direction = ( ( mDirection ) == ( CoreCalc . Direction . LEFT ) ) ? - 1 : 1 ; <END_BUG> meshVerts [ ( ( i * 102 ) + ( 2 * j ) ) ] = ( meshVerts [ ( ( i * 102 ) + ( 2 * j ) ) ] ) * ( 0.6F + ( ( ( ( 0.4F * offset ) * offset ) * offset ) * offset ) ) ; meshVerts [ ( ( i * 102 ) + ( 2 * j ) ) ] = ( meshVerts [ ( ( i * 102 ) + ( 2 * j ) ) ] ) * ( 1 - ( ( ( ( ( direction * ( ( meshVerts [ ( ( ( i * 102 ) + ( 2 * j ) ) + 1 ) ] ) - pointerY ) ) * ( ( meshVerts [ ( ( ( i * 102 ) + ( 2 * j ) ) + 1 ) ] ) - pointerY ) ) // 10000 ) // ( width ) ) // curveFactor ) ) ; } return meshVerts ; } private Shader applyShadow ( float offset ) { } private float [ ] createOriginVerts ( ) { } public float [ ] getOriginVerts ( ) { } public void setOriginVerts ( float [ ] originVerts ) { } public float [ ] getMeshVerts ( ) { } public void setMeshVerts ( float [ ] meshVerts ) { } }

Fix:
int direction = ( ( mDirection ) == ( CoreCalc . Direction . RIGHT ) ) ? - 1 : 1 ;
Buggy code:
public class ThriftStructBuilder { ThriftFieldBuilder thriftFieldBuilder = new ThriftFieldBuilder ( ) ; public ThriftStruct buildThriftStruct ( Class < ? > clazz , List < ThriftStruct > structs , List < ThriftEnum > enums ) { } public void buildStrutsByGeneric ( List < ThriftStruct > structs , Generic generic , List < ThriftEnum > enums ) { } public ThriftEnum buildThriftEnum ( Class < ? > clazz ) { Field [ ] fields = clazz . getDeclaredFields ( ) ; ThriftEnum thriftEnum = new ThriftEnum ( ) ; thriftEnum . setName ( clazz . getSimpleName ( ) ) ; List < ThriftEnumField > nameValues = new ArrayList < ThriftEnumField > ( ) ; for ( int i = 0 ; i < ( fields . length ) ; i ++ ) { Field field = fields [ i ] ; <START_BUG> if ( ( field . getName ( ) . equals ( "ENUM$VALUES" ) ) || ( field . getName ( ) . equals ( "__PARANAMER_DATA" ) ) ) { <END_BUG> continue ; } ThriftEnumField nameValue = new ThriftEnumField ( field . getName ( ) , i ) ; nameValues . add ( nameValue ) ; } thriftEnum . setFields ( nameValues ) ; return thriftEnum ; } }

Fix:
if ( ( field . getName ( ) . equals ( "$VALUES" ) ) || ( field . getName ( ) . equals ( "__PARANAMER_DATA" ) ) ) {
Buggy code:
public class TeamPlayerListener extends PlayerListener { public Team team ; public TeamPlayerListener ( Team team ) { } public void onPlayerJoin ( final PlayerJoinEvent event ) { Player player = event . getPlayer ( ) ; Integer pID = team . th . playerGetID ( player . getName ( ) ) ; String tMOTD = "" ; if ( ! ( team . th . playerExists ( player . getName ( ) ) ) ) { try { team . th . playerCreate ( player . getName ( ) ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } } try { tMOTD = team . th . teamGetMotd ( team . th . playerGetTeam ( pID ) ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } <START_BUG> if ( ( tMOTD . length ( ) ) != 0 ) { <END_BUG> player . sendMessage ( tMOTD ) ; } } }

Fix:
if ( ( tMOTD != null ) && ( ( tMOTD . length ( ) ) != 0 ) ) {
Buggy code:
public class User { private Database db ; private int uid ; private String username ; private String email ; private double height ; private double weight ; public User ( Database db , int uid ) { } public static int login ( Database db , String email , String pwd ) { } public Database getDb ( ) { } public static int createUser ( Database db , String uname , String pwd , String email , double ht , double wt ) { if ( ( ( ( ( ( db == null ) || ( uname == null ) ) || ( pwd == null ) ) || ( email == null ) ) || ( ht == 0 ) ) || ( wt == 0 ) ) { return - 1 ; } uname = Algorithm . Clean ( uname ) ; pwd = Algorithm . MD5 ( Algorithm . Clean ( pwd ) ) ; email = Algorithm . Clean ( email ) ; <START_BUG> if ( ! ( User . accountExists ( db , email ) ) ) { <END_BUG> return - 4 ; } int success = db . update ( ( ( ( ( ( ( ( ( ( ( ( "insert<seq2seq4repair_space>into<seq2seq4repair_space>users<seq2seq4repair_space>(username,<seq2seq4repair_space>hpwd,<seq2seq4repair_space>email,<seq2seq4repair_space>" + "height,<seq2seq4repair_space>weight)<seq2seq4repair_space>values<seq2seq4repair_space>('" ) + uname ) + "',<seq2seq4repair_space>'" ) + pwd ) + "',<seq2seq4repair_space>'" ) + email ) + "',<seq2seq4repair_space>" ) + ht ) + ",<seq2seq4repair_space>" ) + wt ) + ");" ) ) ; if ( success != 1 ) { return - 2 ; } int uid = User . login ( db , email , pwd ) ; if ( uid < 1 ) { return - 3 ; } return uid ; } private static boolean accountExists ( Database db , String email ) { } public static boolean deleteUser ( Database db , int uid ) { } public boolean getAllInfo ( ) { } public String getUsername ( ) { } public String getEmail ( ) { } public int getUid ( ) { } public double getHeight ( ) { } public double getWeight ( ) { } public boolean updateAllInfo ( String username , String email , double ht , double wt ) { } public boolean updateUsername ( String uname ) { } public boolean updatePwd ( String pwd ) { } public boolean updateEmail ( String email ) { } public boolean updateHeight ( double height ) { } public boolean updateWeight ( double weight ) { } public boolean resetPassword ( String old , String pwd ) { } }

Fix:
if ( User . accountExists ( db , email ) ) {
Buggy code:
public class Main { public static void main ( String [ ] args ) throws IOException { } private static void handleEvaluator ( ConcernReader cccr , String method , String caseStudy ) { <START_BUG> boolean getMethod = ( method . equals ( "file" ) ) ? true : false ; <END_BUG> HashMap < String , Set < String > > cccs = cccr . getConcernList ( getMethod ) ; F1Calculator f1 = new F1Calculator ( cccs ) ; System . out . println ( cccs . size ( ) ) ; new FolderF1Calculator ( ( ( ( "out//" + method ) + "//" ) + caseStudy ) ) . calculate ( f1 ) ; } private static void handleRunRRW ( RRWExecuter ex ) throws IOException { } private static void printUsageRules ( ) { } }

Fix:
boolean getMethod = ( method . equals ( "file" ) ) ? false : true ;
Buggy code:
public final class Yank { private static final YankPoolManager YANK_POOL_MANAGER = YankPoolManager . INSTANCE ; private static Logger logger = LoggerFactory . getLogger ( Yank . class ) ; private static final String BEAN_EXCEPTION_MESSAGE = "Error<seq2seq4repair_space>converting<seq2seq4repair_space>row<seq2seq4repair_space>to<seq2seq4repair_space>bean!!<seq2seq4repair_space>Make<seq2seq4repair_space>sure<seq2seq4repair_space>you<seq2seq4repair_space>have<seq2seq4repair_space>a<seq2seq4repair_space>default<seq2seq4repair_space>no-args<seq2seq4repair_space>constructor!" ; private static final String QUERY_EXCEPTION_MESSAGE = "Error<seq2seq4repair_space>in<seq2seq4repair_space>SQL<seq2seq4repair_space>query!!!" ; private Yank ( ) { } public static Long insertSQLKey ( String sqlKey , Object [ ] params ) { } public static Long insert ( String sql , Object [ ] params ) { } public static int executeSQLKey ( String sqlKey , Object [ ] params ) { } public static int execute ( String sql , Object [ ] params ) { } public static < T > T queryScalarSQLKey ( String sqlKey , Class < T > scalarType , Object [ ] params ) { } public static < T > T queryScalar ( String sql , Class < T > scalarType , Object [ ] params ) { } public static < T > T queryBeanSQLKey ( String sqlKey , Class < T > beanType , Object [ ] params ) { } public static < T > T queryBean ( String sql , Class < T > beanType , Object [ ] params ) { } public static < T > List < T > queryBeanListSQLKey ( String sqlKey , Class < T > beanType , Object [ ] params ) { } public static < T > List < T > queryBeanList ( String sql , Class < T > beanType , Object [ ] params ) { } public static < T > List < T > queryColumnSQLKey ( String sqlKey , String columnName , Class < T > columnType , Object [ ] params ) { String sql = Yank . YANK_POOL_MANAGER . getMergedSqlProperties ( ) . getProperty ( sqlKey ) ; if ( ( sql == null ) || ( sql . equalsIgnoreCase ( "" ) ) ) { throw new SQLStatementNotFoundException ( ) ; } else { <START_BUG> return Yank . queryBeanList ( sql , columnType , params ) ; <END_BUG> } } public static < T > List < T > queryColumn ( String sql , String columnName , Class < T > columnType , Object [ ] params ) { } public static List < Object [ ] > queryObjectArraysSQLKey ( String sqlKey , Object [ ] params ) { } public static List < Object [ ] > queryObjectArrays ( String sql , Object [ ] params ) { } public static int [ ] executeBatchSQLKey ( String sqlKey , Object [ ] [ ] params ) { } public static int [ ] executeBatch ( String sql , Object [ ] [ ] params ) { } private static void handleSQLException ( SQLException e ) { } public static void setupDataSource ( Properties dataSourceProperties ) { } public static void addSQLStatements ( Properties sqlProperties ) { } public static synchronized void releaseDataSource ( ) { } public static HikariDataSource getDataSource ( ) { } }

Fix:
return Yank . queryColumn ( sql , columnName , columnType , params ) ;
Buggy code:
public class Ex3HashtagMining { private static String pathToFile = "data//reduced-tweets.json" ; public JavaRDD < Tweet > loadData ( ) { } public JavaRDD < String > hashtagMentionedOnTweet ( ) { JavaRDD < Tweet > tweets = loadData ( ) ; <START_BUG> JavaRDD < String > mentions = tweets . flatMap ( ( tweet ) -> Arrays . asList ( tweet . getText ( ) . split ( "<seq2seq4repair_space>" ) ) ) . filter ( ( word ) -> ( word . matches ( "#(\\w+)" ) ) && ( ( word . length ( ) ) > 1 ) ) ; <END_BUG> return mentions ; } public JavaPairRDD < String , Integer > countMentions ( ) { } public List < Tuple2 < Integer , String > > top10HashTags ( ) { } }

Fix:
JavaRDD < String > mentions = tweets . flatMap ( ( tweet ) -> Arrays . asList ( tweet . getText ( ) . split ( "<seq2seq4repair_space>" ) ) ) . filter ( ( word ) -> ( word . startsWith ( "#" ) ) && ( ( word . length ( ) ) > 1 ) ) ;
Buggy code:
public class Version { private Version ( ) { } public static String id ( ) { <START_BUG> return "4.5-SNAPSHOT-20080319-0812" ; <END_BUG> } public static void main ( String [ ] args ) { } }

Fix:
return "4.5-SNAPSHOT-20080506-1730" ;
Buggy code:
public class OutjarTest extends AjcTestCase { public static final String PROJECT_DIR = "OutjarTest" ; public static final String injarName = "child.jar" ; public static final String aspectjarName = "aspects.jar" ; public static final String outjarName = "outjar.jar" ; private File baseDir ; protected void setUp ( ) throws Exception { } public void testOutjarInInjars ( ) { } public void testOutjarInInpath ( ) { } public void testOutjarInAspectpath ( ) { } public void testOutjarDeletedOnError ( ) { String [ ] args = new String [ ] { "-aspectpath" , OutjarTest . aspectjarName , "-injars" , OutjarTest . injarName , "-outjar" , OutjarTest . outjarName } ; <START_BUG> Message error = new Message ( WeaverMessages . format ( CANT_FIND_TYPE , "jar1.Parent" ) ) ; <END_BUG> MessageSpec spec = new MessageSpec ( null , newMessageList ( error ) ) ; CompilationResult result = ajc ( baseDir , args ) ; assertMessages ( result , spec ) ; File outjar = new File ( ajc . getSandboxDirectory ( ) , OutjarTest . outjarName ) ; assertFalse ( ( ( "-outjar<seq2seq4repair_space>" + ( outjar . getPath ( ) ) ) + "<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>deleted" ) , outjar . exists ( ) ) ; } }

Fix:
Message error = new Message ( WeaverMessages . format ( CANT_FIND_TYPE_INTERFACES , "jar1.Parent" ) ) ;
Buggy code:
class NotEqualExpression extends CompareEqualExpression { public NotEqualExpression ( Val val1 , Val val2 ) { } public void appendTo ( Select sel , ExpContext ctx , BinaryOpExpState bstate , SQLBuffer buf , boolean val1Null , boolean val2Null ) { if ( val1Null && val2Null ) <START_BUG> buf . appendValue ( null ) . append ( "<seq2seq4repair_space>IS<seq2seq4repair_space>NOT<seq2seq4repair_space>" ) . appendValue ( null ) ; <END_BUG> else if ( val1Null || val2Null ) { Val val = ( val1Null ) ? getValue2 ( ) : getValue1 ( ) ; ExpState state = ( val1Null ) ? bstate . state2 : bstate . state1 ; if ( ! ( isDirectComparison ( ) ) ) { int len = val . length ( sel , ctx , state ) ; for ( int i = 0 ; i < len ; i ++ ) { if ( i > 0 ) buf . append ( "<seq2seq4repair_space>AND<seq2seq4repair_space>" ) ; val . appendTo ( sel , ctx , state , buf , i ) ; buf . append ( "<seq2seq4repair_space>IS<seq2seq4repair_space>NOT<seq2seq4repair_space>" ) . appendValue ( null ) ; } } else val . appendIsNotNull ( sel , ctx , state , buf ) ; } else { Val val1 = getValue1 ( ) ; Val val2 = getValue2 ( ) ; if ( ( ( val1 . length ( sel , ctx , bstate . state1 ) ) == 1 ) && ( ( val2 . length ( sel , ctx , bstate . state2 ) ) == 1 ) ) { ctx . store . getDBDictionary ( ) . comparison ( buf , "<>" , new FilterValueImpl ( sel , ctx , bstate . state1 , val1 ) , new FilterValueImpl ( sel , ctx , bstate . state2 , val2 ) ) ; } else { int len = Math . max ( val1 . length ( sel , ctx , bstate . state1 ) , val2 . length ( sel , ctx , bstate . state2 ) ) ; buf . append ( "(" ) ; for ( int i = 0 ; i < len ; i ++ ) { if ( i > 0 ) buf . append ( "<seq2seq4repair_space>OR<seq2seq4repair_space>" ) ; val1 . appendTo ( sel , ctx , bstate . state1 , buf , i ) ; buf . append ( "<seq2seq4repair_space><><seq2seq4repair_space>" ) ; val2 . appendTo ( sel , ctx , bstate . state2 , buf , i ) ; } buf . append ( ")" ) ; } } } }

Fix:
buf . append ( "1<seq2seq4repair_space><><seq2seq4repair_space>1" ) ;
Buggy code:
public class Snippet90 { public static void main ( String [ ] args ) { Display display = new Display ( ) ; Shell shell = new Shell ( display ) ; final Tree tree = new Tree ( shell , ( ( SWT . BORDER ) | ( SWT . MULTI ) ) ) ; for ( int i = 0 ; i < 12 ; i ++ ) { <START_BUG> TreeItem treeItem = new TreeItem ( tree , SWT . NULL ) ; <END_BUG> treeItem . setText ( ( "Item<seq2seq4repair_space>" + i ) ) ; } tree . addListener ( MouseDown , new Listener ( ) { public void handleEvent ( Event event ) { Point point = new Point ( event . x , event . y ) ; TreeItem item = tree . getItem ( point ) ; if ( item != null ) { System . out . println ( ( "Mouse<seq2seq4repair_space>down:<seq2seq4repair_space>" + item ) ) ; } } } ) ; tree . setSize ( 200 , 200 ) ; shell . setSize ( 300 , 300 ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
TreeItem treeItem = new TreeItem ( tree , SWT . NONE ) ;
Buggy code:
public class TransferDrainer { private HashMap < String , ArrayList < ArrayList < TaskMessage > > > bundles = new HashMap ( ) ; public void add ( HashMap < String , ArrayList < TaskMessage > > workerTupleSetMap ) { } public void send ( HashMap < String , IConnection > connections ) { for ( String hostPort : bundles . keySet ( ) ) { IConnection connection = connections . get ( hostPort ) ; if ( null != connection ) { ArrayList < ArrayList < TaskMessage > > bundle = bundles . get ( hostPort ) ; Iterator < TaskMessage > iter = getBundleIterator ( bundle ) ; <START_BUG> if ( null != iter ) { <END_BUG> connection . send ( iter ) ; } } } } private Iterator < TaskMessage > getBundleIterator ( final ArrayList < ArrayList < TaskMessage > > bundle ) { } public void clear ( ) { } }

Fix:
if ( ( null != iter ) && ( iter . hasNext ( ) ) ) {