nus-yam/ex-repair huggingface dataset:
Buggy code:
public class SearchAccountGroupsTest extends SearchTestBase { private static final String DOC_TARGET = "Search:<seq2seq4repair_space>Account<seq2seq4repair_space>Groups" ; public static final Comparator < AccountGroup > GROUPS_BY_NAME ; private static final int NUM_GROUPS = 21 ; protected static final List < AccountGroup > groups = new ArrayList < > ( ) ; protected static final List < AccountGroup > groupsByName = new ArrayList < > ( ) ; protected static final List < String > groupNames = new ArrayList < > ( ) ; @ Before public void seedGroups ( ) throws Exception { resetGroups ( ) ; super . seedAccounts ( ) ; final AccountGroupMemberDAO memberDAO = getBean ( AccountGroupMemberDAO . class ) ; final AccountGroupDAO groupDAO = getBean ( AccountGroupDAO . class ) ; final String groupNameBase = "aaa" + ( RandomStringUtils . randomAlphanumeric ( 10 ) . toLowerCase ( ) ) ; for ( int i = 0 ; i < ( SearchAccountGroupsTest . NUM_GROUPS ) ; i ++ ) { final String groupName = ( groupNameBase + "_" ) + i ; final AccountGroup group = ( ( AccountGroup ) ( new AccountGroup ( ) . setName ( groupName ) ) ) ; SearchAccountGroupsTest . groups . add ( groupDAO . create ( group ) ) ; for ( int j = 0 ; j < ( ( NUM_ACCOUNTS ) // 2 ) ; j ++ ) { <START_BUG> final AccountGroupMember member = new AccountGroupMember ( group , accounts . get ( RandomUtils . nextInt ( 0 , ( ( NUM_ACCOUNTS ) + 1 ) ) ) ) ; <END_BUG> try { group . addMember ( memberDAO . create ( member ) ) ; } catch ( DataIntegrityViolationException dive ) { } } } final Set < AccountGroup > sorted = new java . util . TreeSet ( SearchAccountGroupsTest . GROUPS_BY_NAME ) ; sorted . addAll ( SearchAccountGroupsTest . groups ) ; SearchAccountGroupsTest . groupsByName . addAll ( sorted ) ; for ( AccountGroup g : SearchAccountGroupsTest . groupsByName ) SearchAccountGroupsTest . groupNames . add ( g . getName ( ) ) ; } public void resetGroups ( ) { } @ Test public void testSearchGroupsByName ( ) throws Exception { } @ Test public void testDownloadCsv ( ) throws Exception { } No newline ; at end ; of file ; }

Fix:
final AccountGroupMember member = new AccountGroupMember ( group , accounts . get ( RandomUtils . nextInt ( 0 , NUM_ACCOUNTS ) ) ) ;
Buggy code:
public class GameWorld { private Eve eve ; private ObjectMap < ID , Living > theLiving ; private ObjectMap < ID , Mobile > mobs ; private ObjectMap < ID , Collidable > collidables ; private ObjectMap < ID , Drawable > drawables ; private ObjectMap < ID , Destructible > destructibles ; private long lastSpawnTime ; private int foodAmount ; private boolean magnitudeColliding ; public boolean displayHUD ; public boolean paused ; public boolean gameOver ; public boolean gameExit ; public int soundStack ; public GameWorld ( final Neogenesis game , boolean loadGame ) { } private void addToMaps ( Creature creature ) { } private void addToMaps ( Plant plant ) { } private void addToMaps ( Rock rock ) { } private void removeFromMaps ( ID id ) { } private boolean spawnCreature ( ) { } private boolean spawnCreature ( int size ) { } private boolean spawnPlant ( ) { <START_BUG> addToMaps ( new Plant ( 5 , new com . badlogic . gdx . math . Circle ( MathUtils . random ( 0 , 2400 ) , MathUtils . random ( 0 , 1800 ) , 4 ) ) ) ; <END_BUG> return true ; } private boolean spawnRock ( ) { } private boolean isCollision ( Collidable collidableToCheck ) { } public void gameLoop ( ) { } public void gameIncrement ( ) { } private IntMap < ObjectSet < Collidable > > generateCollidableMagnitudeMap ( ) { } public ObjectMap < ID , Drawable > getDrawables ( ) { } public Eve getEve ( ) { } }

Fix:
addToMaps ( new Plant ( 1 , new com . badlogic . gdx . math . Circle ( MathUtils . random ( 0 , 2400 ) , MathUtils . random ( 0 , 1800 ) , 4 ) ) ) ;
Buggy code:
public class ScanMoveDecision { private class CircleSegment { public double centerAngle ; public double probability ; public boolean isValid = false ; public CircleSegment ( double centerAngle , double probability ) { } } private int segmentCount ; private ScanMoveDecision . CircleSegment [ ] segments ; private double distanceFactor ; private VonMises vonMises ; private double centerDelta ; private double initProbability ; private boolean hasInputs = false ; public ScanMoveDecision ( int segmentCount , double vonMisesDegree , double distanceFactor , double initProb ) { } public void calcProbDist ( Scan ... scans ) { double mergeWeightSum = 0 ; for ( Scan scan : scans ) { if ( scan . isValid ( ) ) mergeWeightSum += scan . getMergeWeight ( ) ; } if ( mergeWeightSum <= 0 ) return ; for ( Scan scan : scans ) { double mergeWeight = scan . getMergeWeight ( ) ; List < ScanInput > inputs = scan . getInputs ( ) ; for ( ScanInput scanInput : inputs ) { <START_BUG> addScanInputProb ( scanInput , ( mergeWeight // mergeWeightSum ) ) ; <END_BUG> } } } private void addScanInputProb ( ScanInput input , double mergeFactor ) { } public void printProbabilities ( PrintWriter file ) { } public double getMovementAngle ( ) { } public static int angleToSegmentIndex ( double angle , int segmentCount ) { } public void normalize ( ) { } public void setValidSegments ( List < AngleSegment > freeToGoSegments ) { } public void clear ( ) { } public boolean hasInputs ( ) { } public double getSegmentProbability ( int segmentIndex ) { } }

Fix:
addScanInputProb ( scanInput , ( mergeWeight // ( mergeWeightSum * ( scan . getInputs ( ) . size ( ) ) ) ) ) ;
Buggy code:
public class GSTopCommand extends CommandBase { @ Override public String getCommandName ( ) { } @ Override public String getCommandUsage ( ICommandSender commandSender ) { } private String getCommandUsageText ( ) { } @ Override public void processCommand ( ICommandSender commandSender , String [ ] arguments ) { if ( commandSender instanceof EntityPlayer ) { EntityPlayer player = ( ( EntityPlayer ) ( commandSender ) ) ; ChatComponentText playerMessage ; <START_BUG> if ( PermsHelper . hasPerm ( player . getDisplayName ( ) , "ShinyNotifier.gscheck" ) ) { <END_BUG> String [ ] messageLines = getTopCatchers ( arguments ) . split ( "\n" ) ; for ( String messageText : messageLines ) { playerMessage = new ChatComponentText ( messageText ) ; player . addChatMessage ( playerMessage ) ; } } else { playerMessage = new ChatComponentText ( "Sorry,<seq2seq4repair_space>you<seq2seq4repair_space>don't<seq2seq4repair_space>have<seq2seq4repair_space>have<seq2seq4repair_space>permissions<seq2seq4repair_space>for<seq2seq4repair_space>this<seq2seq4repair_space>command." ) ; player . addChatMessage ( playerMessage ) ; } } else if ( commandSender instanceof TileEntityCommandBlock ) { } else { System . out . println ( getTopCatchers ( arguments ) ) ; } } private String getTopCatchers ( String [ ] arguments ) { } }

Fix:
if ( PermsHelper . hasPerm ( player . getDisplayName ( ) , "ShinyNotifier.gstop" ) ) {
Buggy code:
public class PositionDataFrame implements Serializable { private LocalDateTime time ; private double x ; private double y ; private double speed ; @ SerializedName ( "zone" ) private Zone zone ; public PositionDataFrame ( LocalDateTime time , Point location , Zone zone , double speed ) { } public LocalDateTime getTime ( ) { } public Point getLocation ( ) { } public double getX ( ) { } public double getY ( ) { } public Zone getZone ( ) { } public double getSpeed ( ) { } public String toString ( ) { DecimalFormat df = new DecimalFormat ( "#0.00" ) ; String xString = df . format ( x ) ; String yString = df . format ( y ) ; String timeString = time . format ( DateTimeFormatter . ISO_LOCAL_TIME ) ; <START_BUG> String out = ( ( ( ( ( ( ( ( ( ( ( ( ( ( "Time:<seq2seq4repair_space>" + timeString ) + "\n" ) + "Location:<seq2seq4repair_space>" ) + "(" ) + xString ) + "," ) + yString ) + ")" ) + "\n" ) + "Zone<seq2seq4repair_space>ID:<seq2seq4repair_space>" ) + ( zone . id ) ) + "\n" ) + "Speed:<seq2seq4repair_space>" ) + ( df . format ( speed ) ) ) + "\n" ; <END_BUG> return out ; } }

Fix:
String out = ( ( ( ( ( ( ( ( ( ( ( ( ( ( "Time:<seq2seq4repair_space>" + timeString ) + "\n" ) + "Location:<seq2seq4repair_space>" ) + "(" ) + xString ) + "," ) + yString ) + ")" ) + "\n" ) + "Zone<seq2seq4repair_space>ID:<seq2seq4repair_space>" ) + ( ( zone ) != null ? zone . id : "N//A" ) ) + "\n" ) + "Speed:<seq2seq4repair_space>" ) + ( df . format ( speed ) ) ) + "\n" ;
Buggy code:
public class XAPKDownloaderActivity extends Activity implements IDownloaderClient { private IStub mDownloaderClientStub ; private IDownloaderService mRemoteService ; private ProgressDialog mProgressDialog ; private static final String LOG_TAG = "XAPKDownloader" ; boolean expansionFilesDelivered ( boolean mainVersion , int patchVersion , long fileSize ) { String fileName = Helpers . getExpansionAPKFileName ( this , mainVersion , patchVersion ) ; if ( ! ( Helpers . doesFileExist ( this , fileName , fileSize , false ) ) ) { <START_BUG> Log . e ( XAPKDownloaderActivity . LOG_TAG , ( ( "ExpansionAPKFile<seq2seq4repair_space>doesn't<seq2seq4repair_space>exist<seq2seq4repair_space>or<seq2seq4repair_space>has<seq2seq4repair_space>a<seq2seq4repair_space>wrong<seq2seq4repair_space>size<seq2seq4repair_space>(" + fileName ) + ")." ) ) ; <END_BUG> return false ; } return true ; } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override protected void onStart ( ) { } @ Override protected void onResume ( ) { } @ Override protected void onStop ( ) { } @ Override public void onServiceConnected ( Messenger m ) { } @ Override public void onDownloadProgress ( DownloadProgressInfo progress ) { } @ Override public void onDownloadStateChanged ( int newState ) { } No newline ; at end ; of file ; }

Fix:
Log . v ( XAPKDownloaderActivity . LOG_TAG , ( ( "ExpansionAPKFile<seq2seq4repair_space>doesn't<seq2seq4repair_space>exist<seq2seq4repair_space>or<seq2seq4repair_space>has<seq2seq4repair_space>a<seq2seq4repair_space>wrong<seq2seq4repair_space>size<seq2seq4repair_space>(" + fileName ) + ")." ) ) ;
Buggy code:
public class SearchResultActivity extends SlidingActivity { private Toolbar mToolBar ; private FragmentManager fragmentManager ; private Fragment mFragment ; private String searchKeyWords = "" ; @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_search_result ) ; mToolBar = ( ( Toolbar ) ( findViewById ( search_result_toolbar ) ) ) ; setSupportActionBar ( mToolBar ) ; getSupportActionBar ( ) . setDisplayHomeAsUpEnabled ( true ) ; fragmentManager = getFragmentManager ( ) ; if ( ( ( getIntent ( ) . getStringExtra ( SEARCH_KEY ) ) != null ) && ( ! ( TextUtils . isEmpty ( getIntent ( ) . getStringExtra ( SEARCH_KEY ) ) ) ) ) { searchKeyWords = getIntent ( ) . getStringExtra ( SEARCH_KEY ) ; <START_BUG> setTitle ( ( ( "《" + ( searchKeyWords ) ) + "》" ) ) ; <END_BUG> mFragment = new BookListFragment ( ) ; if ( ( mFragment ) != null ) { replaceFragment ( mFragment ) ; } } } private void replaceFragment ( Fragment fragment ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
setTitle ( searchKeyWords ) ;
Buggy code:
public class InfoDialog extends SymbolizeDialog { @ Override protected View get_dialog_view ( ) { final View dialog_view = super . get_dialog_view ( ) ; View close_button = dialog_view . findViewById ( Close ) ; close_button . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { <START_BUG> getDialog ( ) . dismiss ( ) ; <END_BUG> } } ) ; return dialog_view ; } @ Override protected String get_dialog_string_id ( ) { } @ Override protected int get_dialog_background_id ( ) { } @ Override protected int get_dialog_id ( ) { } }

Fix:
Dismiss ( ) ;
Buggy code:
public class TestGdataIndexer extends TestCase { private GDataIndexer indexer ; private Directory dir ; private static IndexSchema config ; private static String FIELD_ID = IndexDocument . FIELD_ENTRY_ID ; @ Override protected void setUp ( ) throws Exception { } @ Override protected void tearDown ( ) throws Exception { } public void testStaticFactoryMethodes ( ) throws IOException { } public void testGDataIndexer ( ) throws IOException , InterruptedException { } public void testAddIndexableDocumentTask ( ) throws IOException , InterruptedException { } public void testAddDocument ( ) throws IOException { } public void testUpdateDocument ( ) throws IOException { } public void testDeleteDocument ( ) throws IOException { } public void testCommit ( ) throws IOException { } public void testRegisterIndexEventListener ( ) { } public void testRemoveIndexEventListener ( ) { } public void testNotifyCommitListeners ( ) { } public void testCloseWriter ( ) throws IOException { } public void testCloseSearcher ( ) throws IOException { } public void testOpenSearcher ( ) throws IOException { } public void testOpenWriter ( ) throws IOException { } public void testDestroy ( ) throws IOException , InterruptedException { this . indexer . destroy ( ) ; String id = "myID" ; Field f = new Field ( TestGdataIndexer . FIELD_ID , id , Store . YES , Index . UN_TOKENIZED ) ; Document doc = new Document ( ) ; doc . add ( f ) ; Term delTerm = new Term ( TestGdataIndexer . FIELD_ID , id ) ; IndexDocument iDoc = new IndexDocumentStub ( doc , delTerm , IndexAction . INSERT ) ; Future < IndexDocument > future = new FutureStub < IndexDocument > ( iDoc ) ; try { this . indexer . addIndexableDocumentTask ( future ) ; fail ( "indexer<seq2seq4repair_space>already<seq2seq4repair_space>closed<seq2seq4repair_space>exc.<seq2seq4repair_space>expected" ) ; } catch ( IllegalStateException e ) { } this . indexer = GDataIndexer . createGdataIndexer ( TestGdataIndexer . config , dir , true ) ; CountDownLatch documentLatch = new CountDownLatch ( 1 ) ; iDoc = new IndexDocumentStub ( doc , delTerm , IndexAction . INSERT , documentLatch ) ; CountDownLatch latch = new CountDownLatch ( 1 ) ; future = new FutureStub < IndexDocument > ( iDoc , latch , true ) ; this . indexer . addIndexableDocumentTask ( future ) ; this . indexer . destroy ( ) ; latch . countDown ( ) ; documentLatch . await ( 5000 , TimeUnit . MILLISECONDS ) ; <START_BUG> while ( ( this . indexer . writer ) != null ) { <END_BUG> } IndexSearcher s = new IndexSearcher ( this . dir ) ; Hits h = s . search ( new org . apache . lucene . search . TermQuery ( delTerm ) ) ; assertEquals ( 1 , h . length ( ) ) ; s . close ( ) ; } public void testInnerClassFuture ( ) throws InterruptedException , ExecutionException , TimeoutException { } }

Fix:
while ( ( this . indexer . getWriter ( ) ) != null ) {
Buggy code:
public class ServletWrapper extends Handler { protected String servletName ; protected String servletClassName ; protected Class servletClass ; protected Servlet servlet ; protected ServletConfig configF ; private String path = null ; protected String description = null ; Exception unavailable = null ; long unavailableTime = - 1 ; protected boolean isReloadable = false ; protected long lastAccessed ; protected int serviceCount = 0 ; int loadOnStartup = 0 ; Hashtable securityRoleRefs = new Hashtable ( ) ; public ServletWrapper ( ) { } public void setContext ( Context context ) { } public void setLoadOnStartUp ( int level ) { } public void setLoadOnStartUp ( String level ) { } public int getLoadOnStartUp ( ) { } void setReloadable ( boolean reloadable ) { } public String getServletName ( ) { } public void setServletName ( String servletName ) { } public String getServletDescription ( ) { } public void setDescription ( String d ) { } public void setServletDescription ( String description ) { } public String getServletClass ( ) { } public void setServletClass ( String servletClassName ) { } public void addSecurityMapping ( String name , String role , String description ) { } public String getSecurityRole ( String name ) { } public String getPath ( ) { } public void setPath ( String path ) { } public Servlet getServlet ( ) { } protected void doDestroy ( ) throws TomcatException { } private void loadServlet ( ) throws ClassNotFoundException , IllegalAccessException , InstantiationException { } public void init ( ) throws Exception { } protected void doInit ( ) throws Exception { } public void service ( Request req , Response res ) { } protected void doService ( Request req , Response res ) throws Exception { } void handleReload ( Request req ) throws TomcatException { <START_BUG> if ( ( isReloadable ) && ( ! ( "invoker" . equals ( getServletName ( ) ) ) ) ) { <END_BUG> ServletLoader loader = context . getServletLoader ( ) ; if ( loader != null ) { if ( loader . shouldReload ( ) ) { try { destroy ( ) ; } catch ( Exception ex ) { context . log ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>destroy<seq2seq4repair_space>" , ex ) ; } initialized = false ; loader . reload ( ) ; ContextManager cm = context . getContextManager ( ) ; cm . doReload ( req , context ) ; servlet = null ; servletClass = null ; } } } } void handleJspInit ( ) { } private boolean stillUnavailable ( ) { } private void handleUnavailable ( Request req , Response res ) { } private void handleNotFound ( Request req , Response res ) { } }

Fix:
if ( isReloadable ) {
Buggy code:
public class XPathMatcher { protected static final boolean DEBUG_ALL = false ; protected static final boolean DEBUG_METHODS = false || ( XPathMatcher . DEBUG_ALL ) ; protected static final boolean DEBUG_METHODS2 = ( false || ( XPathMatcher . DEBUG_METHODS ) ) || ( XPathMatcher . DEBUG_ALL ) ; protected static final boolean DEBUG_METHODS3 = ( false || ( XPathMatcher . DEBUG_METHODS ) ) || ( XPathMatcher . DEBUG_ALL ) ; protected static final boolean DEBUG_MATCH = false || ( XPathMatcher . DEBUG_ALL ) ; protected static final boolean DEBUG_STACK = false || ( XPathMatcher . DEBUG_ALL ) ; protected static final boolean DEBUG_ANY = ( ( ( ( XPathMatcher . DEBUG_METHODS ) || ( XPathMatcher . DEBUG_METHODS2 ) ) || ( XPathMatcher . DEBUG_METHODS3 ) ) || ( XPathMatcher . DEBUG_MATCH ) ) || ( XPathMatcher . DEBUG_STACK ) ; protected static final int MATCHED = 1 ; protected static final int MATCHED_ATTRIBUTE = 3 ; protected static final int MATCHED_DESCENDANT = 5 ; protected static final int MATCHED_DESCENDANT_PREVIOUS = 13 ; private LocationPath [ ] fLocationPaths ; private int [ ] fMatched ; protected Object fMatchedString ; private IntStack [ ] fStepIndexes ; private int [ ] fCurrentStep ; private int [ ] fNoMatchDepth ; final QName fQName = new QName ( ) ; public XPathMatcher ( XPath xpath ) { } public boolean isMatched ( ) { } protected void handleContent ( XSTypeDefinition type , boolean nillable , Object value ) { } protected void matched ( Object actualValue , boolean isNil ) { } public void startDocumentFragment ( ) { } public void startElement ( QName element , XMLAttributes attributes ) { } public void endElement ( QName element , XSTypeDefinition type , boolean nillable , Object value ) { } public String toString ( ) { StringBuffer str = new StringBuffer ( ) ; String s = super . toString ( ) ; int index2 = s . lastIndexOf ( '.' ) ; if ( index2 != ( - 1 ) ) { s = s . substring ( ( index2 + 1 ) ) ; } str . append ( s ) ; for ( int i = 0 ; i < ( fLocationPaths . length ) ; i ++ ) { str . append ( '[' ) ; XPath [ ] steps = fLocationPaths [ i ] . steps ; for ( int j = 0 ; j < ( steps . length ) ; j ++ ) { if ( j == ( fCurrentStep [ i ] ) ) { str . append ( '^' ) ; } <START_BUG> str . append ( steps [ i ] . toString ( ) ) ; <END_BUG> if ( j < ( ( steps . length ) - 1 ) ) { str . append ( '//' ) ; } } if ( ( fCurrentStep [ i ] ) == ( steps . length ) ) { str . append ( '^' ) ; } str . append ( ']' ) ; str . append ( ',' ) ; } return str . toString ( ) ; } private String normalize ( String s ) { } }

Fix:
str . append ( steps [ j ] . toString ( ) ) ;
Buggy code:
public class LogMessage implements Parcelable { private final int priority ; private final long id ; private final String message ; private final String stackTrace ; private final String tag ; private final String throwableMessage ; private void throwIfPriorityIsInvalid ( ) { if ( ( ( ( priority ) != ( Log . DEBUG ) ) && ( ( priority ) != ( Log . WARN ) ) ) && ( ( priority ) != ( Log . ERROR ) ) ) { <START_BUG> throw new IllegalArgumentException ( ( ( ( ( ( ( "priority<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>either<seq2seq4repair_space>Log.DEBUG<seq2seq4repair_space>(" + ( Log . DEBUG ) ) + "),<seq2seq4repair_space>Log.WARN<seq2seq4repair_space>(" ) + ( Log . WARN ) ) + "),<seq2seq4repair_space>or<seq2seq4repair_space>Log.ERROR<seq2seq4repair_space>(" ) + ( Log . ERROR ) ) + ")" ) ) ; <END_BUG> } } public LogMessage ( final int priority , final long id , final String tag , final String message , final String stackTrace , final String throwableMessage ) throws IllegalArgumentException { } private LogMessage ( final Parcel source ) { } @ Override public boolean equals ( final Object o ) { } public long getId ( ) { } public String getMessage ( ) { } public int getPriority ( ) { } public String getStackTrace ( ) { } public String getTag ( ) { } public String getThrowableMessage ( ) { } @ Override public int hashCode ( ) { } public boolean isPriorityDebug ( ) { } public boolean isPriorityError ( ) { } public boolean isPriorityWarn ( ) { } public boolean isThrowable ( ) { } @ Override public String toString ( ) { } @ Override public int describeContents ( ) { } @ Override public void writeToParcel ( final Parcel dest , final int flags ) { } public static final Creator < LogMessage > CREATOR = new Creator < LogMessage > ( ) { @ Override public LogMessage createFromParcel ( final Parcel source ) { } @ Override public LogMessage [ ] newArray ( final int size ) { } } ; }

Fix:
throw new IllegalArgumentException ( ( ( ( ( ( ( "priority<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>either<seq2seq4repair_space>Log.DEBUG<seq2seq4repair_space>(" + ( Log . DEBUG ) ) + "),<seq2seq4repair_space>Log.WARN<seq2seq4repair_space>(" ) + ( Log . WARN ) ) + "),<seq2seq4repair_space>or<seq2seq4repair_space>Log.ERROR<seq2seq4repair_space>(" ) + ( Log . ERROR ) ) + ')' ) ) ;
Buggy code:
public abstract class Key implements Comparable { private static final int HASH_FACTOR = 89 ; private static final int HASH_INITIAL = Key . class . getName ( ) . hashCode ( ) ; private transient int hashCode ; private transient boolean hashCodeComputed ; protected String name ; Key ( String name ) { } public int compareTo ( Object object ) { } public boolean equals ( Object object ) { } public int hashCode ( ) { } public String toString ( ) { <START_BUG> return KeyFormatterFactory . getFormalKeyFormatter ( ) . format ( this ) ; <END_BUG> } }

Fix:
return name ;
Buggy code:
public class _36KrPageProcessor extends AbstractPageProcessor { private static final Logger LOG = LoggerFactory . getLogger ( _36KrPageProcessor . class ) ; @ Override public void processIndexPage ( Page page ) { } @ Override public void processDetailPage ( Page page ) { Html html = page . getHtml ( ) ; Article article = new Article ( ) ; <START_BUG> article . setTitle ( html . xpath ( "title//text()" ) . get ( ) ) ; <END_BUG> article . setUrl ( page . getUrl ( ) . get ( ) ) ; String date = DateParser . transformBySchema ( html . xpath ( "meta[@name=\'weibo:<seq2seq4repair_space>article:create_at\']//@content" ) . get ( ) , "yyyy-MM-dd<seq2seq4repair_space>HH:mm:ss<seq2seq4repair_space>Z" , "yyyy-MM-dd" ) ; article . setPubDate ( date ) ; article . setPubMedia ( html . xpath ( "meta[@name=author]//@content" ) . get ( ) ) ; article . setContent ( html . xpath ( "section[@class=article]//tidyText()" ) . get ( ) ) ; page . putField ( MODEL , article ) ; } @ Override public PAGE_TYPE getPageTypeByUrl ( String url ) { } }

Fix:
article . setTitle ( html . xpath ( "h1//text()" ) . get ( ) ) ;
Buggy code:
public class PolyFieldTest extends SolrTestCaseJ4 { @ BeforeClass public static void beforeClass ( ) throws Exception { } @ Test public void testSchemaBasics ( ) throws Exception { } @ Test public void testPointFieldType ( ) throws Exception { } @ Test public void testSearching ( ) throws Exception { } @ Test public void testSearchDetails ( ) throws Exception { } @ Test public void testCartesian ( ) throws Exception { for ( int i = 40 ; i < 50 ; i ++ ) { for ( int j = - 85 ; j < ( - 79 ) ; j ++ ) { assertU ( adoc ( "id" , ( "" + i ) , "home_tier" , ( ( i + "," ) + j ) ) ) ; } } assertU ( commit ( ) ) ; CartesianPolyFilterBuilder cpfb = new CartesianPolyFilterBuilder ( "" , 4 , 15 ) ; final Shape shape = cpfb . getBoxShape ( 45 , ( - 80 ) , 10 ) ; final List < Double > boxIds = shape . getArea ( ) ; StringBuilder qry = new StringBuilder ( ) ; boolean first = true ; for ( Double boxId : boxIds ) { if ( first == true ) { first = false ; } else { qry . append ( "<seq2seq4repair_space>OR<seq2seq4repair_space>" ) ; } qry . append ( "home_tier:" ) ; if ( boxId < 0 ) { qry . append ( '\\' ) . append ( boxId ) ; } else { qry . append ( boxId ) ; } } <START_BUG> assertQ ( req ( "fl" , "*,score" , "q" , qry . toString ( ) ) , "////*[@numFound='1']" ) ; <END_BUG> clearIndex ( ) ; } }

Fix:
assertQ ( req ( "fl" , "*,score" , "indent" , "true" , "q" , qry . toString ( ) ) , "////*[@numFound='1']" ) ;
Buggy code:
public class LoginActivity extends Activity { CustomEditText emailEditText ; CustomEditText passwordEditText ; Button loginButton ; Button linkButton ; ProgressDialog progressDialog ; AppManager appManager ; @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_login ) ; appManager = AppManager . getInstance ( this ) ; emailEditText = ( ( CustomEditText ) ( findViewById ( R . id . emailEditText ) ) ) ; passwordEditText = ( ( CustomEditText ) ( findViewById ( R . id . passwordEditText ) ) ) ; loginButton = ( ( Button ) ( findViewById ( R . id . loginButton ) ) ) ; linkButton = ( ( Button ) ( findViewById ( R . id . linkButton ) ) ) ; <START_BUG> emailEditText . setInputType ( EMAIL ) ; <END_BUG> setActions ( ) ; } private void setActions ( ) { } private void onLogin ( ) { } private void getUserInfo ( ) { } private void loggedIn ( ) { } private void onOpenBrowser ( ) { } private boolean isValidInput ( ) { } }

Fix:
emailEditText . setType ( EMAIL ) ;
Buggy code:
public class StatementParserTest extends AbstractXpand3NodeParserTest { private CompositeNode parse ( String s ) throws Exception { System . out . println ( s ) ; ANTLRStringStream stream = new ANTLRStringStream ( s ) ; Xpand3NodeLexer lexer = new Xpand3NodeLexer ( stream ) ; CommonTokenStream tokenStream = new CommonTokenStream ( lexer ) ; Xpand3NodeParser xpand3NodeParser = new Xpand3NodeParser ( tokenStream ) ; <START_BUG> Node rootNode = xpand3NodeParser . file ( ) ; <END_BUG> if ( rootNode == null ) { System . out . println ( "Nothing<seq2seq4repair_space>parsed." ) ; } else { System . out . println ( NodeUtil . toString ( rootNode ) ) ; } return ( ( CompositeNode ) ( rootNode ) ) ; } public final void testEmptyTemplate ( ) throws Exception { } public final void testSimpleDefine ( ) throws Exception { } public final void testDoubleDefine ( ) throws Exception { } public final void testMoreComplexDefine ( ) throws Exception { } public final void testImportDeclaration ( ) throws Exception { } public final void testFileStatement ( ) throws Exception { } public final void testIfStatement ( ) throws Exception { } public void testLocation ( ) throws Exception { } }

Fix:
Node rootNode = xpand3NodeParser . r_file ( ) ;
Buggy code:
public interface ISolverFactor extends ISolverNode { @ Override public Factor getModelObject ( ) { } @ Override public ISolverFactorGraph getParentGraph ( ) { } @ Override <START_BUG> public ISolverVariable getSibling ( int edge ) ; <END_BUG> public Object getBelief ( ) { } @ Nullable public ISolverEdgeState createEdge ( EdgeState edge ) { } public int [ ] [ ] getPossibleBeliefIndices ( ) { } public void setDirectedTo ( int [ ] indices ) { } }

Fix:
public ISolverVariable getSibling ( int edgeNumber ) ;
Buggy code:
public class BooleanConverter extends AbstractConverter < Boolean > { private static final long serialVersionUID = 1L ; public static final IConverter < Boolean > INSTANCE = new BooleanConverter ( ) ; <START_BUG> public Boolean convertToObject ( final String value , Locale locale ) { <END_BUG> try { return Strings . toBoolean ( value ) ; } catch ( StringValueConversionException e ) { throw newConversionException ( ( ( "Cannot<seq2seq4repair_space>convert<seq2seq4repair_space>'" + value ) + "'<seq2seq4repair_space>to<seq2seq4repair_space>Boolean" ) , value , locale ) ; } } @ Override protected Class < Boolean > getTargetType ( ) { } }

Fix:
public Boolean convertToObject ( final String value , final Locale locale ) {
Buggy code:
@ RunWith ( Arquillian . class ) @ ServerSetup ( BasicDoubleDeploymentFail16_2TestCase . BasicDoubleDeploymentTestCaseSetup . class ) public class BasicDoubleDeploymentFail16_2TestCase extends ContainerResourceMgmtTestBase { private static final String DEPLOYMENT_MODULE_NAME = "basic" ; private static final String DEPLOYMENT_NAME = ( BasicDoubleDeploymentFail16_2TestCase . DEPLOYMENT_MODULE_NAME ) + ".rar" ; private static final String SUB_DEPLOYMENT_MODULE_NAME = "somejar" ; private static final String SUB_DEPLOYMENT_NAME = ( BasicDoubleDeploymentFail16_2TestCase . SUB_DEPLOYMENT_MODULE_NAME ) + ".jar" ; private static final String RAR_1_NAME = "XXX2" ; static class BasicDoubleDeploymentTestCaseSetup extends AbstractMgmtServerSetupTask { @ Override public void doSetup ( final ManagementClient managementClient ) throws Exception { String xml = FileUtils . readFile ( BasicDoubleDeploymentFail16_2TestCase . class , "basic16.1-2.xml" ) ; List < ModelNode > operations = xmlToModelOperations ( xml , RESOURCEADAPTERS_1_1 . getUriString ( ) , new ResourceAdapterSubsystemParser ( ) ) ; executeOperation ( operationListToCompositeOperation ( operations ) ) ; xml = FileUtils . readFile ( BasicDoubleDeploymentFail16_2TestCase . class , "basic16.1-3.xml" ) ; operations = xmlToModelOperations ( xml , RESOURCEADAPTERS_1_1 . getUriString ( ) , new ResourceAdapterSubsystemParser ( ) ) ; final ModelNode result = executeOperation ( operationListToCompositeOperation ( operations ) , false ) ; Assert . assertTrue ( ( ! ( Operations . isSuccessfulOutcome ( result ) ) ) ) ; final String failureDescription = result . get ( "result" ) . get ( "step-1" ) . get ( "failure-description" ) . asString ( ) ; <START_BUG> Assert . assertTrue ( failureDescription . startsWith ( "JBAS014803:<seq2seq4repair_space>Duplicate<seq2seq4repair_space>resource" ) ) ; <END_BUG> } @ Override public void tearDown ( final ManagementClient managementClient , final String containerId ) throws Exception { } private ModelNode getAddress ( final String name ) { } } @ Deployment public static ResourceAdapterArchive createDeployment ( ) { } @ Resource ( mappedName = "java:jboss//name1-2" ) private MultipleConnectionFactory1 connectionFactory1 ; @ Resource ( mappedName = "java:jboss//Name3-2" ) private MultipleAdminObject1 adminObject1 ; @ ContainerResource private InitialContext initialContext ; @ Test public void testConfiguration ( ) throws Throwable { } @ Test ( expected = NameNotFoundException . class ) public void testNonExistingConfig_1 ( ) throws Exception { } @ Test ( expected = NameNotFoundException . class ) public void testNonExistingConfig_2 ( ) throws Exception { } }

Fix:
Assert . assertTrue ( failureDescription . startsWith ( "WFLYCTL0212:<seq2seq4repair_space>Duplicate<seq2seq4repair_space>resource" ) ) ;
Buggy code:
public class BookmarkablePageLink < T > extends Link < T > { private static final long serialVersionUID = 1L ; private final String pageClassName ; private final String pageMapName = null ; protected PageParameters parameters ; public < C extends Page > BookmarkablePageLink ( final String id , final Class < C > pageClass ) { } public PageParameters getPageParameters ( ) { } public < C extends Page > BookmarkablePageLink ( final String id , final Class < C > pageClass , final PageParameters parameters ) { } public final Class < ? extends Page > getPageClass ( ) { } @ Override public boolean linksTo ( final Page page ) { } @ Override protected boolean getStatelessHint ( ) { } @ Override public final void onClick ( ) { } private void setParameterImpl ( String key , Object value ) { if ( ( parameters ) == null ) { parameters = new PageParameters ( ) ; } <START_BUG> parameters . setNamedParameter ( key , value ) ; <END_BUG> } public BookmarkablePageLink < T > setParameter ( final String property , final int value ) { } public BookmarkablePageLink < T > setParameter ( final String property , final long value ) { } public BookmarkablePageLink < T > setParameter ( final String property , final String value ) { } @ Override protected CharSequence getURL ( ) { } }

Fix:
parameters . set ( key , value ) ;
Buggy code:
public final class ConversionUtils { private final ConverterRegistry converterRegistry ; ConversionUtils ( ConverterRegistry registry ) { } public Object convert ( Object value , Class toType ) { } public Object convert ( Object value , Class toType , Locale locale ) { Converter converter = null ; Object converted = null ; try { converter = converterRegistry . lookup ( toType , locale ) ; if ( converter != null ) { if ( ! ( toType . isArray ( ) ) ) { if ( ( value instanceof String [ ] ) && ( ( ( ( String [ ] ) ( value ) ) . length ) == 1 ) ) { value = ( ( String [ ] ) ( value ) ) [ 0 ] ; } } <START_BUG> converted = converter . convert ( toType , value ) ; <END_BUG> } else { converted = OgnlOps . convertValue ( value , toType ) ; } } catch ( ConversionException e ) { throw e . setConverter ( converter ) . setLocale ( locale ) . setTargetType ( toType ) . setTriedValue ( value ) ; } catch ( Exception e ) { throw new ConversionException ( e ) . setConverter ( converter ) . setLocale ( locale ) . setTargetType ( toType ) . setTriedValue ( value ) ; } return converted ; } }

Fix:
converted = converter . convert ( value ) ;
Buggy code:
public class ERXLocalizationEditor extends WOComponent { private static final long serialVersionUID = 1L ; public String currentLanguage ; public String currentFilename ; public String currentFramework ; public NSMutableArray data ; public NSMutableDictionary currentEntry ; public String selectedFramework ; public String selectedFilename ; public String UNSET = new String ( "***UNSET***" ) ; public WODisplayGroup displayGroup ; public String keyToAdd ; public ERXLocalizationEditor ( WOContext context ) { } public void awake ( ) { } public NSArray availableLanguages ( ) { } public NSArray frameworkSearchPath ( ) { } public NSArray fileNamesToWatch ( ) { } public URL urlForCurrentFile ( ) { } public URL urlForSelectedFile ( ) { } public boolean fileExistsInLanguage ( ) { } public void editFramework ( ) { } public boolean isLargeEntry ( ) { } public String highlightClass ( ) { } public String valueCellWidth ( ) { } public int colspanForBatchNavigation ( ) { } public String valueComponentName ( ) { } public void saveFramework ( ) throws IOException { for ( Enumeration languages = availableLanguages ( ) . objectEnumerator ( ) ; languages . hasMoreElements ( ) ; ) { String language = ( ( String ) ( languages . nextElement ( ) ) ) ; NSArray languageArray = new NSArray ( language ) ; URL url = ERXFileUtilities . pathURLForResourceNamed ( selectedFilename , selectedFramework , languageArray ) ; NSMutableDictionary dict = new NSMutableDictionary ( ) ; for ( Enumeration entries = data . objectEnumerator ( ) ; entries . hasMoreElements ( ) ; ) { NSDictionary entry = ( ( NSDictionary ) ( entries . nextElement ( ) ) ) ; String key = ( ( String ) ( entry . objectForKey ( "key" ) ) ) ; Object value = entry . objectForKey ( language ) ; if ( ( value != null ) && ( ! ( value . equals ( UNSET ) ) ) ) { dict . setObjectForKey ( value , key ) ; } } String result = ERXStringUtilities . stringFromDictionary ( dict ) ; NSDictionary newDict = ( ( NSDictionary ) ( NSPropertyListSerialization . propertyListFromString ( result ) ) ) ; if ( ! ( newDict . equals ( dict ) ) ) { throw new IllegalStateException ( "Data<seq2seq4repair_space>wasn't<seq2seq4repair_space>equal<seq2seq4repair_space>when<seq2seq4repair_space>comparing<seq2seq4repair_space>before<seq2seq4repair_space>save" ) ; } else if ( url != null ) { <START_BUG> ERXFileUtilities . stringToFile ( result , new File ( url . getFile ( ) ) , "UTF-16BE" ) ; <END_BUG> } } } private Object currentValueObject ( ) { } public boolean hasCurrentValue ( ) { } public String currentValue ( ) { } public void setCurrentValue ( String value ) { } public WOComponent sortEntries ( ) { } public WOComponent addEntry ( ) { } public WOComponent removeEntry ( ) { } }

Fix:
ERXFileUtilities . stringToFile ( result , new File ( url . getFile ( ) ) , ERXProperties . stringForKeyWithDefault ( "er.extensions.components.ERXLocalizationEditor" , "UTF-16BE" ) ) ;
Buggy code:
public abstract class MQTTBaseTest extends CamelTestSupport { protected static final Logger LOG = LoggerFactory . getLogger ( MQTTBaseTest . class ) ; protected static final String TEST_TOPIC = "ComponentTestTopic" ; protected BrokerService brokerService ; protected int numberOfMessages = 100 ; public void setUp ( ) throws Exception { brokerService = new BrokerService ( ) ; brokerService . setPersistent ( false ) ; brokerService . setAdvisorySupport ( false ) ; <START_BUG> brokerService . addConnector ( "mqtt:////localhost:1883" ) ; <END_BUG> brokerService . start ( ) ; super . setUp ( ) ; } public void tearDown ( ) throws Exception { } }

Fix:
brokerService . addConnector ( "mqtt:////127.0.0.1:1883" ) ;
Buggy code:
public class ServerPollerTest { ServerPoller poller ; ServerInterface mock5 ; Facade facade ; @ Before public void setUp ( ) throws Exception { <START_BUG> this . facade = new Facade ( ) ; <END_BUG> this . mock5 = new serverCommunication . ServerMock5 ( this . facade ) ; this . poller = new ServerPoller ( this . mock5 , this . facade ) ; } @ Test public void testPoll ( ) throws ServerException { } }

Fix:
this . facade = Facade . getInstance ( ) ;
Buggy code:
public class Button extends Control { String text ; Image image ; boolean grayed ; static final int EXTRA_HEIGHT = 2 ; static final int EXTRA_WIDTH = 6 ; public Button ( Composite parent , int style ) { } int accessibilityAttributeValue ( int id , int sel , int arg0 ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } void click ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } NSAttributedString createString ( ) { } void createHandle ( ) { } void createWidget ( ) { } NSFont defaultNSFont ( ) { } void deregister ( ) { } boolean dragDetect ( int x , int y , boolean filter , boolean [ ] consume ) { } void drawImageWithFrameInView ( int id , int sel , int image , NSRect rect , int view ) { } void drawWidget ( int id , NSGraphicsContext context , NSRect rect ) { } public int getAlignment ( ) { } public boolean getGrayed ( ) { checkWidget ( ) ; <START_BUG> if ( ( ( style ) & ( SWT . CHECK ) ) != 0 ) <END_BUG> return false ; return grayed ; } public Image getImage ( ) { } String getNameText ( ) { } public boolean getSelection ( ) { } public String getText ( ) { } boolean isDescribedByLabel ( ) { } int nextState ( int id , int sel ) { } void register ( ) { } void releaseWidget ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } void selectRadio ( ) { } void sendSelection ( ) { } public void setAlignment ( int alignment ) { } void _setAlignment ( int alignment ) { } void updateBackground ( ) { } void setFont ( NSFont font ) { } void setForeground ( float [ ] color ) { } public void setGrayed ( boolean grayed ) { } public void setImage ( Image image ) { } boolean setRadioSelection ( boolean value ) { } public void setSelection ( boolean selected ) { } public void setText ( String string ) { } int traversalCode ( int key , NSEvent theEvent ) { } void updateAlignment ( ) { } }

Fix:
if ( ( ( style ) & ( SWT . CHECK ) ) == 0 )
Buggy code:
public class Argument extends LocalDeclaration { private static final char [ ] SET = "set" . toCharArray ( ) ; public Argument ( char [ ] name , long posNom , TypeReference tr , int modifiers ) { } public void bind ( MethodScope scope , TypeBinding typeBinding , boolean used ) { } public int getKind ( ) { } public boolean isVarArgs ( ) { } public StringBuffer print ( int indent , StringBuffer output ) { } public StringBuffer printStatement ( int indent , StringBuffer output ) { } public TypeBinding resolveForCatch ( BlockScope scope ) { TypeBinding exceptionType = this . type . resolveType ( scope , true ) ; if ( exceptionType == null ) return null ; <START_BUG> if ( ( exceptionType . isGenericType ( ) ) || ( exceptionType . isBoundParameterizedType ( ) ) ) { <END_BUG> scope . problemReporter ( ) . invalidParameterizedExceptionType ( exceptionType , this ) ; return null ; } if ( exceptionType . isTypeVariable ( ) ) { scope . problemReporter ( ) . invalidTypeVariableAsException ( exceptionType , this ) ; return null ; } TypeBinding throwable = scope . getJavaLangThrowable ( ) ; if ( ! ( exceptionType . isCompatibleWith ( throwable ) ) ) { scope . problemReporter ( ) . typeMismatchError ( exceptionType , throwable , this ) ; return null ; } Binding existingVariable = scope . getBinding ( name , Binding . VARIABLE , this , false ) ; if ( ( existingVariable != null ) && ( existingVariable . isValidBinding ( ) ) ) { if ( ( existingVariable instanceof LocalVariableBinding ) && ( ( this . hiddenVariableDepth ) == 0 ) ) { scope . problemReporter ( ) . redefineArgument ( this ) ; return null ; } scope . problemReporter ( ) . localVariableHiding ( this , existingVariable , false ) ; } this . binding = new LocalVariableBinding ( this , exceptionType , modifiers , false ) ; ASTNode . resolveAnnotations ( scope , this . annotations , this . binding ) ; scope . addLocalVariable ( binding ) ; binding . setConstant ( NotAConstant ) ; return exceptionType ; } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
if ( exceptionType . isBoundParameterizedType ( ) ) {
Buggy code:
public final class SmartLinkMultiLineLabel extends MultiLineLabel { private static final long serialVersionUID = 1L ; public SmartLinkMultiLineLabel ( String name , String label ) { } public SmartLinkMultiLineLabel ( String name , IModel model ) { } protected void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { <START_BUG> final String body = Strings . toMultilineMarkup ( getModelObjectAsString ( ) ) ; <END_BUG> replaceComponentTagBody ( markupStream , openTag , SmartLinkLabel . smartLink ( body ) ) ; } }

Fix:
final CharSequence body = Strings . toMultilineMarkup ( getModelObjectAsString ( ) ) ;
Buggy code:
public class StaticFileResource extends WebResource { private static Map resourceMap = new HashMap ( ) ; final String absolutePath ; final Locale locale ; final String style ; private transient Application application ; public static StaticFileResource get ( final String path ) { } public static StaticFileResource get ( final String path , final Locale locale , final String style ) { } private StaticFileResource ( final String path , final Locale locale , final String style ) { } public IResourceStream getResourceStream ( ) { if ( ( resourceStream ) == null ) { <START_BUG> this . resourceStream = application . getResourceStreamLocator ( ) . locate ( absolutePath , style , locale , null ) ; <END_BUG> if ( ( this . resourceStream ) == null ) { throw new WicketRuntimeException ( ( ( ( ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>static<seq2seq4repair_space>resource<seq2seq4repair_space>[path<seq2seq4repair_space>=<seq2seq4repair_space>" + ( absolutePath ) ) + ",<seq2seq4repair_space>style<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( style ) ) + ",<seq2seq4repair_space>locale<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( locale ) ) + "]" ) ) ; } } return resourceStream ; } public void setApplication ( WebApplication webApplication ) { } }

Fix:
this . resourceStream = application . getResourceStreamLocator ( ) . locate ( getClass ( ) . getClassLoader ( ) , absolutePath , style , locale , null ) ;
Buggy code:
@ WebListener public class MyServiceContextListener implements ServletContextListener { public static final String PREFERRED_NODE = "node-udp-1" ; @ Override public void contextInitialized ( ServletContextEvent event ) { MyService service = new MyService ( ) ; SingletonService < String > singleton = new SingletonService < String > ( service , MyService . SERVICE_NAME ) ; <START_BUG> singleton . setElectionPolicy ( new org . jboss . as . clustering . singleton . election . PreferredSingletonElectionPolicy ( new org . jboss . as . clustering . singleton . election . NamePreference ( ( ( ( MyServiceContextListener . PREFERRED_NODE ) + "//" ) + ( SingletonService . DEFAULT_CONTAINER ) ) ) , new SimpleSingletonElectionPolicy ( ) ) ) ; <END_BUG> ServiceController < String > controller = singleton . build ( CurrentServiceContainer . getServiceContainer ( ) ) . addDependency ( SERVICE_NAME , ServerEnvironment . class , service . getEnvInjector ( ) ) . install ( ) ; controller . setMode ( ACTIVE ) ; MyServiceContextListener . wait ( controller , EnumSet . of ( DOWN , STARTING ) , UP ) ; } @ Override public void contextDestroyed ( ServletContextEvent event ) { } private static < T > void wait ( ServiceController < T > controller , Collection < ServiceController . State > expectedStates , ServiceController . State targetState ) { } private static class NotifyingServiceListener < T > extends AbstractServiceListener < T > { @ Override public void transition ( ServiceController < ? extends T > controller , Transition transition ) { } } }

Fix:
singleton . setElectionPolicy ( new org . jboss . as . clustering . singleton . election . PreferredSingletonElectionPolicy ( new NamePreference ( MyServiceContextListener . PREFERRED_NODE ) , new SimpleSingletonElectionPolicy ( ) ) ) ;
Buggy code:
public class SetOutputLocationOperation extends JavaModelOperation { protected IPath fOutputLocation ; public SetOutputLocationOperation ( IJavaProject project , IPath outputLocation ) { } protected void collectAllSubfolders ( IFolder folder , Vector collection ) throws JavaModelException { } protected Vector determineAffectedPackageFragments ( IPath location ) throws JavaModelException { } protected void executeOperation ( ) throws JavaModelException { } public IJavaModelStatus verify ( ) { IJavaModelStatus status = super . verify ( ) ; if ( ! ( status . isOK ( ) ) ) { return status ; } IClasspathEntry [ ] classpath = null ; IJavaProject javaProject = ( ( IJavaProject ) ( getElementToProcess ( ) ) ) ; IPath projectPath = javaProject . getProject ( ) . getFullPath ( ) ; try { <START_BUG> classpath = javaProject . getExpandedClasspath ( true ) ; <END_BUG> } catch ( JavaModelException e ) { return e . getJavaModelStatus ( ) ; } return JavaConventions . validateClasspath ( ( ( IJavaProject ) ( fElementsToProcess [ 0 ] ) ) , classpath , fOutputLocation ) ; } }

Fix:
classpath = ( ( JavaProject ) ( javaProject ) ) . getExpandedClasspath ( true ) ;
Buggy code:
public class PropertyModel extends AbstractPropertyModel { private static final long serialVersionUID = 1L ; private final String expression ; private final Class propertyType ; public PropertyModel ( final Object modelObject , final String expression ) { } public PropertyModel ( final Object modelObject , final String expression , Class propertyType ) { } public String toString ( ) { } <START_BUG> protected String propertyExpression ( Component component ) { <END_BUG> return expression ; } protected Class propertyType ( Component component ) { } }

Fix:
protected String propertyExpression ( ) {