nus-yam/ex-repair huggingface dataset:
Buggy code:
public class InventoryAdapter extends CursorAdapter { public InventoryAdapter ( Context context , Cursor c , int flags ) { } @ Override public View newView ( Context context , Cursor cursor , ViewGroup parent ) { } @ Override public void bindView ( View view , Context context , Cursor cursor ) { TextView nameTxt = ( ( TextView ) ( view . findViewById ( list_item_inventory ) ) ) ; TextView dateTxt = ( ( TextView ) ( view . findViewById ( list_item_inventory_exp_date ) ) ) ; String name = cursor . getString ( COL_NAME ) ; String qty = Integer . toString ( cursor . getInt ( COL_QTY ) ) ; nameTxt . setText ( ( ( name + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + qty ) ) ; long date = cursor . getLong ( COL_DATE ) ; String dateString = context . getString ( none ) ; <START_BUG> if ( date != 0 ) { <END_BUG> dateString = Utility . getFormattedDate ( date ) ; } String expDateString = context . getString ( format_exp_date_inventory_list_item , dateString ) ; dateTxt . setText ( expDateString ) ; } }

Fix:
if ( date > 0 ) {
Buggy code:
public class XSAttributeDecl implements XSAttributeDeclaration { public static final short SCOPE_ABSENT = 0 ; public static final short SCOPE_GLOBAL = 1 ; public static final short SCOPE_LOCAL = 2 ; String fName = null ; String fTargetNamespace = null ; XSSimpleType fType = null ; short fConstraintType = XSConstants . VC_NONE ; short fScope = XSConstants . SCOPE_ABSENT ; XSComplexTypeDecl fEnclosingCT = null ; ValidatedInfo fDefault = null ; public void setValues ( String name , String targetNamespace , XSSimpleType simpleType , short constraintType , short scope , ValidatedInfo valInfo , XSComplexTypeDecl enclosingCT ) { } public void reset ( ) { } public short getType ( ) { } public String getName ( ) { } public String getNamespace ( ) { } public XSSimpleTypeDefinition getTypeDefinition ( ) { } public short getScope ( ) { } public XSComplexTypeDefinition getEnclosingCTDefinition ( ) { } public short getConstraintType ( ) { } public String getConstraintValue ( ) { <START_BUG> return ( getConstraintType ( ) ) == ( XSConstants . VC_NONE ) ? null : fDefault . actualValue . toString ( ) ; <END_BUG> } public XSAnnotation getAnnotation ( ) { } public ValidatedInfo getValInfo ( ) { } public XSNamespaceItem getNamespaceItem ( ) { } }

Fix:
return ( getConstraintType ( ) ) == ( XSConstants . VC_NONE ) ? null : fDefault . stringValue ( ) ;
Buggy code:
public class PasswordResetTokenService { private final String ENCRYPT_SEPARATOR = ":" ; private final String host ; private final TextEncryptor textEncryptor ; private final PasswordResetTokenGenerator tokenGenerator ; private final ServerPasswordResetTokenRepository tokenRepository ; private final SystemNotificationService notificationService ; public PasswordResetTokenService ( String host , TextEncryptor textEncryptor , PasswordResetTokenGenerator tokenGenerator , ServerPasswordResetTokenRepository tokenRepository , SystemNotificationService notificationService ) { } public String generateAndSend ( String player ) { String token = tokenGenerator . generate ( ) ; ServerPasswordResetToken serverToken = new ServerPasswordResetToken ( player , token ) ; tokenRepository . save ( serverToken ) ; String encryptedToken = textEncryptor . encrypt ( ( ( token + ( ENCRYPT_SEPARATOR ) ) + player ) ) ; <START_BUG> String resetUrl = ( ( ( ( host ) + "#//registration//reset//" ) + player ) + "//" ) + encryptedToken ; <END_BUG> notificationService . send ( new SystemEmailSendRequestEvent ( player , "restore_password" , ImmutableMap . of ( "url" , resetUrl ) ) ) ; return encryptedToken ; } public String verify ( String encryptedToken ) { } }

Fix:
String resetUrl = ( ( host ) + "#registration//reset//" ) + encryptedToken ;
Buggy code:
public class ListViewTest extends TestCase { private static MockWebApplication application ; protected void setUp ( ) throws Exception { } private ListView createListView ( final int modelListSize ) { } private WebRequestCycle createRequestCycle ( ) throws IOException { ListViewTest . application . setupRequestAndResponse ( ) ; WebRequestCycle cycle = new WebRequestCycle ( ListViewTest . application , ListViewTest . application . getWicketSession ( ) , ListViewTest . application . getWicketRequest ( ) , ListViewTest . application . getWicketResponse ( ) ) ; MockPage page = new MockPage ( null ) ; <START_BUG> cycle . setPage ( page ) ; <END_BUG> return cycle ; } public void testListView ( ) { } public void testListViewNewItem ( ) throws IOException { } public void testEmptyListView ( ) throws IOException { } }

Fix:
cycle . setResponsePage ( page ) ;
Buggy code:
public class JakartaRegexpMatcher implements RegexpMatcher { private String pattern ; public void setPattern ( String pattern ) { } public ArrayList getGroups ( String argument ) throws TaskException { } public ArrayList getGroups ( String input , int options ) throws TaskException { } public String getPattern ( ) { } public boolean matches ( String argument ) throws TaskException { } public boolean matches ( String input , int options ) throws TaskException { } protected RE getCompiledPattern ( int options ) throws TaskException { int cOptions = getCompilerOptions ( options ) ; try { RE reg = new RE ( pattern ) ; reg . setMatchFlags ( cOptions ) ; return reg ; } catch ( RESyntaxException e ) { <START_BUG> throw new TaskException ( e ) ; <END_BUG> } } protected int getCompilerOptions ( int options ) { } private boolean matches ( String input , RE reg ) { } }

Fix:
throw new TaskException ( e . toString ( ) , e ) ;
Buggy code:
@ Repository public class CyclePEEvaluatorAllocationDaoImpl extends AbstractBaseDaoImpl < CyclePEEvaluatorAllocation > implements CyclePEEvaluatorAllocationDao { @ Override public void deleteCyclePEEvaluatorAllocation ( final Long cycleId ) { } @ Override public List < GdeUser > findAllPEInCycle ( final Long cycleId ) throws UserRoleException { try { DetachedCriteria c = criteria ( ) ; c . createAlias ( "cycleMasterData" , "cycleMasterData" ) ; c . add ( Restrictions . eq ( "cycleMasterData.id" , cycleId ) ) ; <START_BUG> c . add ( Restrictions . eq ( "cycleMasterData.active" , true ) ) ; <END_BUG> ProjectionList columns = Projections . projectionList ( ) . add ( Projections . property ( "user" ) ) ; c . setProjection ( columns ) ; return find ( c ) ; } catch ( Exception e ) { logger . error ( ( "Error<seq2seq4repair_space>while<seq2seq4repair_space>retriving<seq2seq4repair_space>PE<seq2seq4repair_space>users<seq2seq4repair_space>in<seq2seq4repair_space>cycle<seq2seq4repair_space>" + cycleId ) , e ) ; throw new UserRoleException ( ( "Error<seq2seq4repair_space>while<seq2seq4repair_space>retriving<seq2seq4repair_space>PE<seq2seq4repair_space>users<seq2seq4repair_space>in<seq2seq4repair_space>cycle<seq2seq4repair_space>" + cycleId ) , e ) ; } } }

Fix:
c . add ( Restrictions . eq ( "active" , true ) ) ;
Buggy code:
public class BaseDependencyCheckMojoTest extends BaseTest { public boolean canRun ( ) { String version = System . getProperty ( "java.version" ) ; int length = version . indexOf ( "." , ( ( version . indexOf ( "." ) ) + 1 ) ) ; version = version . substring ( 0 , length ) ; double v = Double . parseDouble ( version ) ; <START_BUG> return v < 1.8 ; <END_BUG> } @ Test public void testScanArtifacts ( ) throws DatabaseException , InvalidSettingException { } public class BaseDependencyCheckMojoImpl extends BaseDependencyCheckMojo { @ Override public void runCheck ( ) throws MojoExecutionException , MojoFailureException { } @ Override public String getName ( Locale locale ) { } @ Override public String getDescription ( Locale locale ) { } @ Override public boolean canGenerateReport ( ) { } } }

Fix:
return v == 1.7 ;
Buggy code:
public class TestInputProductValidator { @ Test public void TestNotSentinel1Product ( ) throws Exception { final File inputFile = TestData . inputASAR_WSM ; if ( ! ( inputFile . exists ( ) ) ) { TestUtils . skipTest ( this , ( inputFile + "<seq2seq4repair_space>not<seq2seq4repair_space>found" ) ) ; return ; } final Product sourceProduct = TestUtils . readSourceProduct ( inputFile ) ; final InputProductValidator validator = new InputProductValidator ( sourceProduct ) ; try { validator . checkIfSentinel1Product ( ) ; } catch ( OperatorException e ) { TestCase . assertEquals ( e . getMessage ( ) , "Input<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>Sentinel-1<seq2seq4repair_space>product." ) ; } try { validator . checkProductType ( new String [ ] { "GRD" } ) ; } catch ( OperatorException e ) { assertTrue ( e . getMessage ( ) . contains ( "is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>product<seq2seq4repair_space>type" ) ) ; } try { validator . checkIfMapProjected ( ) ; } catch ( OperatorException e ) { TestCase . assertEquals ( e . getMessage ( ) , "Source<seq2seq4repair_space>product<seq2seq4repair_space>should<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>map<seq2seq4repair_space>projected" ) ; } try { validator . checkIfTOPSARBurstProduct ( true ) ; } catch ( OperatorException e ) { TestCase . assertEquals ( e . getMessage ( ) , "Source<seq2seq4repair_space>product<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>an<seq2seq4repair_space>SLC<seq2seq4repair_space>burst<seq2seq4repair_space>product" ) ; } try { validator . checkAcquisitionMode ( new String [ ] { "IW" , "EW" } ) ; } catch ( OperatorException e ) { <START_BUG> assertTrue ( e . getMessage ( ) . contains ( "is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>product<seq2seq4repair_space>type" ) ) ; <END_BUG> } } @ Test public void TestSentinel1GRDProduct ( ) throws Exception { } @ Test public void TestSentinel1SLCProduct ( ) throws Exception { } }

Fix:
assertTrue ( e . getMessage ( ) . contains ( "is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>acquisition<seq2seq4repair_space>mode" ) ) ;
Buggy code:
public class PhoneticStringSimilarity { public Pattern remove_duplicate_chars ; public Matcher remove ; public PhoneticStringSimilarity ( ) { } public String refinedSoundex ( String s ) { char [ ] ca = s . toCharArray ( ) ; for ( int i = 1 ; i < ( ca . length ) ; i ++ ) { ca [ i ] = rSTable ( ca [ i ] ) ; } s = new String ( ca ) ; s = remove . reset ( s ) . replaceAll ( "$1" ) ; s = s . replace ( "0" , "" ) ; if ( ( s . length ( ) ) >= 4 ) { s = s . substring ( 0 , 4 ) ; } else { for ( int i = s . length ( ) ; i < 4 ; i ++ ) { <START_BUG> s . concat ( "0" ) ; <END_BUG> } } return s ; } private char rSTable ( char c ) { } }

Fix:
s = s . concat ( "0" ) ;
Buggy code:
public class BehaviorsUtil { public static < M extends IBehavior > List < IBehavior > getBehaviors ( Component component , Class < M > type ) { <START_BUG> List < IBehavior > behaviors = component . getBehaviors ( ) ; <END_BUG> if ( behaviors == null ) { return Collections . emptyList ( ) ; } List < IBehavior > subset = new ArrayList < IBehavior > ( behaviors . size ( ) ) ; for ( IBehavior behavior : behaviors ) { if ( behavior != null ) { if ( type == null ) { subset . add ( behavior ) ; } else if ( type . isAssignableFrom ( behavior . getClass ( ) ) ) { subset . add ( type . cast ( behavior ) ) ; } } } return Collections . unmodifiableList ( subset ) ; } }

Fix:
List < ? extends IBehavior > behaviors = component . getBehaviors ( ) ;
Buggy code:
public abstract class AppenderSkeleton implements Appender , OptionHandler { private Logger logger ; protected Layout layout ; protected String name ; protected Level threshold ; protected ErrorHandler errorHandler = new OnlyOnceErrorHandler ( ) ; protected Filter headFilter ; protected Filter tailFilter ; protected boolean closed = false ; private boolean guard = false ; private LoggerRepository repository ; public void activateOptions ( ) { } public void addFilter ( Filter newFilter ) { } protected abstract void append ( LoggingEvent event ) { } public void clearFilters ( ) { } public void finalize ( ) { } public ErrorHandler getErrorHandler ( ) { } public Filter getFilter ( ) { } public final Filter getFirstFilter ( ) { } public Layout getLayout ( ) { } public final String getName ( ) { } public Level getThreshold ( ) { } public boolean isAsSevereAsThreshold ( Level level ) { } public synchronized void doAppend ( LoggingEvent event ) { } public synchronized void setErrorHandler ( ErrorHandler eh ) { } public void setLayout ( Layout layout ) { } public void setName ( String name ) { } public void setThreshold ( Level threshold ) { } protected Logger getLogger ( ) { } protected LoggerRepository getLoggerRepository ( ) { } public void setLoggerRepository ( LoggerRepository repository ) throws IllegalStateException { if ( repository == null ) { throw new IllegalArgumentException ( "repository<seq2seq4repair_space>argument<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; } <START_BUG> if ( ( this . repository ) != null ) { <END_BUG> this . repository = repository ; } else { throw new IllegalStateException ( "Repository<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>already<seq2seq4repair_space>set" ) ; } } }

Fix:
if ( ( this . repository ) == null ) {
Buggy code:
public class Import extends AbstractTask { private String libraryId = null ; private String name = null ; private String ref = null ; private String alias = null ; public void setLibraryId ( String libraryId ) { } public void setName ( String name ) { } public void setRef ( String ref ) { } public void setAlias ( String alias ) { } public void validateComponent ( ) throws ExecutionException { } public void execute ( ) throws ExecutionException { <START_BUG> AntContext context = getContext ( ) ; <END_BUG> ComponentService componentService = ( ( ComponentService ) ( context . getCoreService ( ComponentService . class ) ) ) ; if ( ( ref ) != null ) { componentService . importFrameComponent ( ref , alias ) ; } else if ( ( name ) == null ) { componentService . importLibrary ( libraryId ) ; } else { componentService . importComponent ( libraryId , name , alias ) ; } } }

Fix:
AntContext context = getAntContext ( ) ;
Buggy code:
public class ProblemPackageBinding extends PackageBinding { private int problemId ; ProblemPackageBinding ( char [ ] [ ] compoundName , int problemId ) { } ProblemPackageBinding ( char [ ] name , int problemId ) { } public final int problemId ( ) { <START_BUG> return problemId ; <END_BUG> } }

Fix:
return this . problemId ;
Buggy code:
public class Register extends AppCompatActivity implements View . OnClickListener { Button registerButton ; EditText editName ; EditText editNickName ; EditText editAge ; EditText editSurname ; EditText editEmail ; EditText editPassword ; EditText editConfPassword ; CheckBox agreeCheckBox ; UserLocalStore userLocalStore ; TextView backToLoginLink ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public void onClick ( View v ) { } public final boolean isValidEmail ( CharSequence target ) { } private void showErrorMessage ( String message ) { } private void registerUser ( User user ) { ServerRequests serverRequest = new ServerRequests ( this ) ; serverRequest . storeUserDataToServer ( user , new GetUserCallBack ( ) { @ Override public void done ( User returnedUser ) { if ( returnedUser == null ) { <START_BUG> showErrorMessage ( "Error<seq2seq4repair_space>registering<seq2seq4repair_space>your<seq2seq4repair_space>profile" ) ; <END_BUG> } else { startActivity ( new Intent ( Register . this , Login . class ) ) ; } } } ) ; } }

Fix:
showErrorMessage ( "Error<seq2seq4repair_space>registering<seq2seq4repair_space>your<seq2seq4repair_space>profile.<seq2seq4repair_space>Username<seq2seq4repair_space>might<seq2seq4repair_space>be<seq2seq4repair_space>taken" ) ;
Buggy code:
class ProxyTask implements Callable < ModelNode > { private final NewProxyController proxyController ; private final String host ; private final ModelNode operation ; private final NewOperationContext context ; private final AtomicReference < Boolean > transactionAction = new AtomicReference < Boolean > ( ) ; private final AtomicReference < ModelNode > uncommittedResultRef = new AtomicReference < ModelNode > ( ) ; private boolean cancelRemoteTransaction ; public ProxyTask ( String host , ModelNode operation , NewOperationContext context , NewProxyController proxyController ) { } @ Override public ModelNode call ( ) throws Exception { } ModelNode getUncommittedResult ( ) throws InterruptedException { } void finalizeTransaction ( boolean commit ) { } void cancel ( ) { } private static class DelegatingMessageHandler implements OperationMessageHandler { private final NewOperationContext context ; DelegatingMessageHandler ( final NewOperationContext context ) { } @ Override public void handleReport ( MessageSeverity severity , String message ) { } } private static class DelegatingOperationAttachments implements OperationAttachments { private final NewOperationContext context ; private DelegatingOperationAttachments ( final NewOperationContext context ) { } @ Override public List < InputStream > getInputStreams ( ) { int count = context . getAttachmentStreamCount ( ) ; List < InputStream > result = new ArrayList < InputStream > ( count ) ; for ( int i = 0 ; i < count ; i ++ ) { <START_BUG> result . add ( context . getAttachmentStream ( count ) ) ; <END_BUG> } return result ; } } }

Fix:
result . add ( context . getAttachmentStream ( i ) ) ;
Buggy code:
public class LocalNotification extends CordovaPlugin { private static CordovaWebView webView = null ; private static Boolean deviceready = false ; protected static Boolean isInBackground = true ; private static ArrayList < String > eventQueue = new ArrayList < String > ( ) ; @ Override public void initialize ( CordovaInterface cordova , CordovaWebView webView ) { } @ Override public void onPause ( boolean multitasking ) { } @ Override public void onResume ( boolean multitasking ) { } @ Override public void onDestroy ( ) { } @ Override public boolean execute ( final String action , final JSONArray args , final CallbackContext command ) throws JSONException { } private void schedule ( JSONArray notifications ) { } private void update ( JSONArray updates ) { } private void cancel ( JSONArray ids ) { } private void cancelAll ( ) { } private void clear ( JSONArray ids ) { } private void clearAll ( ) { } private void isPresent ( int id , CallbackContext command ) { } private void isScheduled ( int id , CallbackContext command ) { } private void isTriggered ( int id , CallbackContext command ) { } private void getAllIds ( CallbackContext command ) { } private void getScheduledIds ( CallbackContext command ) { } private void getTriggeredIds ( CallbackContext command ) { } private void getSingle ( JSONArray ids , CallbackContext command ) { } private void getSingleScheduled ( JSONArray ids , CallbackContext command ) { } private void getSingleTriggered ( JSONArray ids , CallbackContext command ) { } private void getAll ( JSONArray ids , CallbackContext command ) { } private void getScheduled ( JSONArray ids , CallbackContext command ) { } private void getTriggered ( JSONArray ids , CallbackContext command ) { } private void getOptions ( String id , Notification . Type type , CallbackContext command ) { } private void getOptions ( JSONArray ids , Notification . Type type , CallbackContext command ) { } private static synchronized void deviceready ( ) { } private void fireEvent ( String event ) { } static void fireEvent ( String event , Notification notification ) { } private static synchronized void sendJavascript ( final String js ) { if ( ! ( LocalNotification . deviceready ) ) { LocalNotification . eventQueue . add ( js ) ; return ; } <START_BUG> LocalNotification . webView . post ( new Runnable ( ) { <END_BUG> public void run ( ) { if ( ( VERSION . SDK_INT ) >= ( VERSION_CODES . KITKAT ) ) { LocalNotification . webView . evaluateJavascript ( js , null ) ; } else { LocalNotification . webView . loadUrl ( ( "javascript:" + js ) ) ; } } } ) ; } private List < Integer > toList ( JSONArray ary ) { } static String getApplicationState ( ) { } private Manager getNotificationMgr ( ) { } }

Fix:
LocalNotification . webView . getView ( ) . post ( new Runnable ( ) {
Buggy code:
public class InsertAssistant extends ContentAssistant { public IAction [ ] getActions ( VexWidget vexWidget ) { } public String getTitle ( VexWidget vexWidget ) { <START_BUG> return Messages . getString ( "InsertAssistant.title" ) ; <END_BUG> } }

Fix:
return Messages . getString ( "dialog.addElement.title" ) ;
Buggy code:
public final class EndpointRegistryService implements Service < EndpointRegistry > { private static final ServiceName MBEAN_SERVER_NAME = JBOSS . append ( "mbean" , "server" ) ; private static final EndpointRegistryService INSTANCE = new EndpointRegistryService ( ) ; private final InjectedValue < MBeanServer > injectedMBeanServer = new InjectedValue < MBeanServer > ( ) ; private volatile EndpointRegistry registry ; private EndpointRegistryService ( ) { } @ Override public EndpointRegistry getValue ( ) { } @ Override public void start ( final StartContext context ) throws StartException { } @ Override public void stop ( final StopContext context ) { } private InjectedValue < MBeanServer > getMBeanServerInjector ( ) { } public static ServiceController < ? > install ( final ServiceTarget serviceTarget , final ServiceListener < Object > listener ) { final ServiceBuilder < EndpointRegistry > builder = serviceTarget . addService ( REGISTRY_SERVICE , EndpointRegistryService . INSTANCE ) ; <START_BUG> builder . addDependency ( REQUIRED , EndpointRegistryService . MBEAN_SERVER_NAME , MBeanServer . class , EndpointRegistryService . INSTANCE . getMBeanServerInjector ( ) ) ; <END_BUG> builder . addListener ( listener ) ; builder . setInitialMode ( ACTIVE ) ; return builder . install ( ) ; } }

Fix:
builder . addDependency ( OPTIONAL , EndpointRegistryService . MBEAN_SERVER_NAME , MBeanServer . class , EndpointRegistryService . INSTANCE . getMBeanServerInjector ( ) ) ;
Buggy code:
public final class XMLSerializer extends BaseMarkupSerializer { public XMLSerializer ( ) { } public XMLSerializer ( OutputFormat format ) { } public XMLSerializer ( Writer writer , OutputFormat format ) { } public XMLSerializer ( OutputStream output , OutputFormat format ) { } public void setOutputFormat ( OutputFormat format ) { } public void startElement ( String namespaceURI , String localName , String rawName , Attributes attrs ) { int i ; boolean preserveSpace ; ElementState state ; String name ; String value ; boolean addNSAttr = false ; if ( ( _printer ) == null ) throw new IllegalStateException ( "SER002<seq2seq4repair_space>No<seq2seq4repair_space>writer<seq2seq4repair_space>supplied<seq2seq4repair_space>for<seq2seq4repair_space>serializer" ) ; state = getElementState ( ) ; if ( isDocumentState ( ) ) { if ( ! ( _started ) ) startDocument ( ( localName == null ? rawName : localName ) ) ; } else { if ( state . empty ) _printer . printText ( '>' ) ; if ( ( ( _indenting ) && ( ! ( state . preserveSpace ) ) ) && ( ( state . empty ) || ( state . afterElement ) ) ) _printer . breakLine ( ) ; } preserveSpace = state . preserveSpace ; if ( rawName == null ) { rawName = localName ; if ( namespaceURI != null ) { String prefix ; prefix = getPrefix ( namespaceURI ) ; if ( ( prefix . length ( ) ) > 0 ) rawName = ( prefix + ":" ) + localName ; } addNSAttr = true ; } _printer . printText ( '<' ) ; _printer . printText ( rawName ) ; _printer . indent ( ) ; if ( attrs != null ) { for ( i = 0 ; i < ( attrs . getLength ( ) ) ; ++ i ) { _printer . printSpace ( ) ; <START_BUG> name = attrs . getRawName ( i ) ; <END_BUG> if ( name == null ) { String prefix ; String attrURI ; name = attrs . getLocalName ( i ) ; attrURI = attrs . getURI ( i ) ; if ( ( attrURI != null ) && ( ( namespaceURI == null ) || ( ! ( attrURI . equals ( namespaceURI ) ) ) ) ) { prefix = getPrefix ( attrURI ) ; if ( ( prefix != null ) && ( ( prefix . length ( ) ) > 0 ) ) name = ( prefix + ":" ) + name ; } } value = attrs . getValue ( i ) ; if ( value == null ) value = "" ; _printer . printText ( name ) ; _printer . printText ( "=\"" ) ; printEscaped ( value ) ; _printer . printText ( '"' ) ; if ( name . equals ( "xml:space" ) ) { if ( value . equals ( "preserve" ) ) preserveSpace = true ; else preserveSpace = _format . getPreserveSpace ( ) ; } } } ( Enumeration ) ++ ; } public void endElement ( String namespaceURI , String localName , String rawName ) { } public void startDocument ( ) { } public void startElement ( String tagName , AttributeList attrs ) { } public void endElement ( String tagName ) { } protected void startDocument ( String rootTagName ) { } protected void serializeElement ( Element elem ) { } protected String getEntityRef ( char ch ) { } }

Fix:
name = attrs . getQName ( i ) ;
Buggy code:
public class TestBooleanOr extends LuceneTestCase { private static String FIELD_T = "T" ; private static String FIELD_C = "C" ; private TermQuery t1 = new TermQuery ( new Term ( TestBooleanOr . FIELD_T , "files" ) ) ; private TermQuery t2 = new TermQuery ( new Term ( TestBooleanOr . FIELD_T , "deleting" ) ) ; private TermQuery c1 = new TermQuery ( new Term ( TestBooleanOr . FIELD_C , "production" ) ) ; private TermQuery c2 = new TermQuery ( new Term ( TestBooleanOr . FIELD_C , "optimize" ) ) ; private IndexSearcher searcher = null ; private int search ( Query q ) throws IOException { } public void testElements ( ) throws IOException { } public void testFlat ( ) throws IOException { } public void testParenthesisMust ( ) throws IOException { } public void testParenthesisMust2 ( ) throws IOException { } public void testParenthesisShould ( ) throws IOException { } protected void setUp ( ) throws Exception { super . setUp ( ) ; super . setUp ( ) ; RAMDirectory rd = new RAMDirectory ( ) ; IndexWriter writer = new IndexWriter ( rd , new StandardAnalyzer ( ) , true , MaxFieldLength . LIMITED ) ; Document d = new Document ( ) ; d . add ( new org . apache . lucene . document . Field ( TestBooleanOr . FIELD_T , "Optimize<seq2seq4repair_space>not<seq2seq4repair_space>deleting<seq2seq4repair_space>all<seq2seq4repair_space>files" , Store . YES , Index . ANALYZED ) ) ; d . add ( new org . apache . lucene . document . Field ( TestBooleanOr . FIELD_C , "Deleted<seq2seq4repair_space>When<seq2seq4repair_space>I<seq2seq4repair_space>run<seq2seq4repair_space>an<seq2seq4repair_space>optimize<seq2seq4repair_space>in<seq2seq4repair_space>our<seq2seq4repair_space>production<seq2seq4repair_space>environment." , Store . YES , Index . ANALYZED ) ) ; writer . addDocument ( d ) ; writer . close ( ) ; <START_BUG> searcher = new IndexSearcher ( rd ) ; <END_BUG> } }

Fix:
searcher = new IndexSearcher ( rd , true ) ;
Buggy code:
public class TCPSyslogSocketHandler implements Runnable { private static final Logger LOGGER = Logger . getLogger ( TCPSyslogSocketHandler . class ) ; protected SyslogServerIF server = null ; protected Socket socket = null ; protected Set < Socket > sockets = null ; public TCPSyslogSocketHandler ( Set < Socket > sockets , SyslogServerIF server , Socket socket ) { } public void run ( ) { try { final BufferedInputStream bis = new BufferedInputStream ( socket . getInputStream ( ) ) ; int b = - 1 ; final ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; boolean firstByte = true ; boolean octetCounting = false ; StringBuilder octetLenStr = new StringBuilder ( ) ; do { b = bis . read ( ) ; if ( ( firstByte && ( b >= '1' ) ) && ( b <= '9' ) ) { octetCounting = true ; } firstByte = false ; if ( octetCounting ) { if ( b != '<seq2seq4repair_space>' ) { octetLenStr . append ( ( ( char ) ( b ) ) ) ; } else { int len = Integer . parseInt ( octetLenStr . toString ( ) ) ; handleSyslogMessage ( IOUtils . toByteArray ( bis , len ) ) ; octetLenStr = new StringBuilder ( ) ; firstByte = true ; octetCounting = false ; } } else { switch ( b ) { case - 1 : case '\r' : case '\n' : if ( ( baos . size ( ) ) > 0 ) { handleSyslogMessage ( baos . toByteArray ( ) ) ; baos . reset ( ) ; firstByte = true ; } break ; default : baos . write ( b ) ; break ; } } } while ( b != ( - 1 ) ) ; } catch ( IOException e ) { <START_BUG> TCPSyslogSocketHandler . LOGGER . warn ( "IOException<seq2seq4repair_space>occurred" , e ) ; <END_BUG> } finally { IOUtils . closeQuietly ( socket ) ; sockets . remove ( socket ) ; } } private void handleSyslogMessage ( final byte [ ] rawMsg ) { } }

Fix:
TCPSyslogSocketHandler . LOGGER . warn ( "IOException<seq2seq4repair_space>occured" , e ) ;
Buggy code:
public final class Column implements IColumn { private static ColumnSerializer serializer_ = new ColumnSerializer ( ) ; static ColumnSerializer serializer ( ) { } private final String name ; private final byte [ ] value ; private final long timestamp ; private final boolean isMarkedForDelete ; Column ( String name ) { } Column ( String name , byte [ ] value ) { } Column ( String name , byte [ ] value , long timestamp ) { } Column ( String name , byte [ ] value , long timestamp , boolean isDeleted ) { } public String name ( ) { } public IColumn getSubColumn ( String columnName ) { } public byte [ ] value ( ) { } public byte [ ] value ( String key ) { } public Collection < IColumn > getSubColumns ( ) { } public int getObjectCount ( ) { } public long timestamp ( ) { } public long timestamp ( String key ) { } public boolean isMarkedForDelete ( ) { } public long getMarkedForDeleteAt ( ) { } public int size ( ) { } public int serializedSize ( ) { } <START_BUG> public void addColumn ( String name , IColumn column ) { <END_BUG> throw new UnsupportedOperationException ( "This<seq2seq4repair_space>operation<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>supported<seq2seq4repair_space>for<seq2seq4repair_space>simple<seq2seq4repair_space>columns." ) ; } public IColumn diff ( IColumn column ) { } public String toString ( ) { } public byte [ ] digest ( ) { } public int getLocalDeletionTime ( ) { } public long comparePriority ( Column o ) { } }

Fix:
public void addColumn ( IColumn column ) {
Buggy code:
@ SuppressWarnings ( "serial" ) public class TransferSelectorPanel extends JPanel implements ActionListener , ItemListener { protected Store _store ; protected JComboBox transferChooser ; protected TransferRunner runner ; protected JCheckBox enabledBox ; protected Scene scene ; protected TransferTrace cur_transfers = null ; public TransferSelectorPanel ( TransferRunner transferRunner , Scene sc ) { } public void setStore ( Store store ) { } public void load ( Collection < Trace < ? > > traces ) { } @ Override public void actionPerformed ( ActionEvent e ) { } @ Override public void itemStateChanged ( ItemEvent arg0 ) { } private void updateLinkTrace ( ) { String name = "null" ; try { cur_transfers = null ; if ( enabledBox . isSelected ( ) ) { name = ( ( String ) ( transferChooser . getSelectedItem ( ) ) ) ; cur_transfers = ( ( TransferTrace ) ( _store . getTrace ( name ) ) ) ; } runner . setTransferTrace ( cur_transfers ) ; } catch ( Exception ioe ) { <START_BUG> JOptionPane . showMessageDialog ( this , ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>links<seq2seq4repair_space>file<seq2seq4repair_space>'" + name ) + "'" ) , "Warning" , JOptionPane . ERROR_MESSAGE ) ; <END_BUG> } scene . repaint ( ) ; } }

Fix:
JOptionPane . showMessageDialog ( this , ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>transfers<seq2seq4repair_space>file<seq2seq4repair_space>'" + name ) + "'" ) , "Warning" , JOptionPane . ERROR_MESSAGE ) ;
Buggy code:
public class ElementImpl extends ParentNode implements Element { static final long serialVersionUID = 3717253516652722278L ; protected String name ; protected AttributeMap attributes ; public ElementImpl ( CoreDocumentImpl ownerDoc , String name ) { } protected ElementImpl ( ) { } public short getNodeType ( ) { } public String getNodeName ( ) { } public NamedNodeMap getAttributes ( ) { } public Node cloneNode ( boolean deep ) { } public String getBaseURI ( ) { } void setOwnerDocument ( CoreDocumentImpl doc ) { } public String getAttribute ( String name ) { } public Attr getAttributeNode ( String name ) { } public NodeList getElementsByTagName ( String tagname ) { } public String getTagName ( ) { } public void normalize ( ) { } public void removeAttribute ( String name ) { } public Attr removeAttributeNode ( Attr oldAttr ) throws DOMException { if ( ( ownerDocument . errorChecking ) && ( isReadOnly ( ) ) ) { throw new DOMException ( DOMException . NO_MODIFICATION_ALLOWED_ERR , "DOM001<seq2seq4repair_space>Modification<seq2seq4repair_space>not<seq2seq4repair_space>allowed" ) ; } if ( needsSyncData ( ) ) { synchronizeData ( ) ; } if ( ( attributes ) == null ) { throw new DOMException ( DOMException . NOT_FOUND_ERR , "DOM008<seq2seq4repair_space>Not<seq2seq4repair_space>found" ) ; } <START_BUG> return ( ( Attr ) ( attributes . removeItem ( oldAttr ) ) ) ; <END_BUG> } public void setAttribute ( String name , String value ) { } public Attr setAttributeNode ( Attr newAttr ) throws DOMException { } public String getAttributeNS ( String namespaceURI , String localName ) { } public void setAttributeNS ( String namespaceURI , String qualifiedName , String value ) { } public void removeAttributeNS ( String namespaceURI , String localName ) { } public Attr getAttributeNodeNS ( String namespaceURI , String localName ) { } public Attr setAttributeNodeNS ( Attr newAttr ) throws DOMException { } protected int setXercesAttributeNode ( Attr attr ) { } public boolean hasAttributes ( ) { } public boolean hasAttribute ( String name ) { } public boolean hasAttributeNS ( String namespaceURI , String localName ) { } public NodeList getElementsByTagNameNS ( String namespaceURI , String localName ) { } public boolean isEqualNode ( Node arg ) { } public void setReadOnly ( boolean readOnly , boolean deep ) { } public void setIdAttributeNode ( Attr at ) { } protected void synchronizeData ( ) { } protected void setupDefaultAttributes ( ) { } protected void reconcileDefaultAttributes ( ) { } protected NamedNodeMapImpl getDefaultAttributes ( ) { } }

Fix:
return ( ( Attr ) ( attributes . removeItem ( oldAttr , true ) ) ) ;
Buggy code:
public class Settings extends ActionBarActivity { private ArrayAdapter adapter ; private ArrayAdapter read_adapter ; private EditText customServer ; private CheckBox autoSyncCheck ; private CheckBox dropboxCheck ; private CheckBox customCheck ; private Spinner readSpinner ; private Button saveButton ; Resources resources ; SharedPreferences prefs ; private boolean viewIsDirty = false ; private Settings . CheckListener checkListener ; private Settings . OnSpinnerSelected spinnerListener ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_settings ) ; <START_BUG> this . prefs = getPreferences ( MODE_PRIVATE ) ; <END_BUG> this . LoadSettingData ( ) ; } private void LoadSettingData ( ) { } private void setPref ( String pref_name , Boolean val ) { } private void setPref ( String pref_name , int val ) { } private void setPref ( String pref_name , String val ) { } private void SavePrefs ( ) { } private class CheckListener implements OnCheckedChangeListener { private Settings settingsActivity ; public CheckListener ( Settings settings ) { } public void onCheckedChanged ( CompoundButton buttonView , boolean isChecked ) { } } class OnSpinnerSelected implements AdapterView . OnItemSelectedListener { private Settings settingsActivity ; public OnSpinnerSelected ( Settings settings ) { } @ Override public void onItemSelected ( AdapterView < ? > parentView , View selectedItemView , int position , long id ) { } @ Override public void onNothingSelected ( AdapterView < ? > parentView ) { } } public void MakeDirty ( ) { } public void CleanView ( ) { } public void saveSettingsClick ( View v ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
this . prefs = getSharedPreferences ( "pulse_prefs" , MODE_PRIVATE ) ;
Buggy code:
final class CollectionToCollectionConverter implements ConditionalGenericConverter { private final ConversionService conversionService ; public CollectionToCollectionConverter ( ConversionService conversionService ) { } public Set < ConvertiblePair > getConvertibleTypes ( ) { } public boolean matches ( TypeDescriptor sourceType , TypeDescriptor targetType ) { } public Object convert ( Object source , TypeDescriptor sourceType , TypeDescriptor targetType ) { if ( source == null ) { return null ; } Collection < ? > sourceCollection = ( ( Collection < ? > ) ( source ) ) ; if ( sourceCollection . isEmpty ( ) ) { return sourceCollection ; } Collection target = CollectionFactory . createCollection ( targetType . getType ( ) , sourceCollection . size ( ) ) ; for ( Object sourceElement : sourceCollection ) { <START_BUG> Object targetElement = this . conversionService . convert ( sourceElement , sourceType . getElementTypeDescriptor ( ) , targetType . getElementTypeDescriptor ( ) ) ; <END_BUG> target . add ( targetElement ) ; } return target ; } }

Fix:
Object targetElement = this . conversionService . convert ( sourceElement , sourceType . getElementTypeDescriptor ( ) . applyIndexedObject ( sourceElement ) , targetType . getElementTypeDescriptor ( ) ) ;
Buggy code:
public class StandaloneXml extends CommonXml { public StandaloneXml ( final ModuleLoader loader ) { } @ Override public void readElement ( final XMLExtendedStreamReader reader , final List < ModelNode > operationList ) throws XMLStreamException { } private void readServerElement ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list ) throws XMLStreamException { } private void parseSocketBindingGroup ( final XMLExtendedStreamReader reader , final Set < String > interfaces , final ModelNode address , final List < ModelNode > updates ) throws XMLStreamException { } private void parseServerDeployments ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list ) throws XMLStreamException { } private void parseServerProfile ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list ) throws XMLStreamException { } private void setServerName ( final ModelNode address , final List < ModelNode > operationList , final String value ) { } @ Override public void writeContent ( final XMLExtendedStreamWriter writer , final ModelMarshallingContext context ) throws XMLStreamException { } private void writeServerManagement ( final XMLExtendedStreamWriter writer , final ModelNode serverManagement ) throws XMLStreamException { } private void writeServerDeployments ( final XMLExtendedStreamWriter writer , final ModelNode modelNode ) throws XMLStreamException { } private void writeServerProfile ( final XMLExtendedStreamWriter writer , final ModelMarshallingContext context ) throws XMLStreamException { ModelNode profileNode = context . getModelNode ( ) ; writer . writeStartElement ( PROFILE . getLocalName ( ) ) ; <START_BUG> writer . writeAttribute ( Attribute . PROFILE . getLocalName ( ) , profileNode . get ( PROFILE_NAME ) . asString ( ) ) ; <END_BUG> Set < String > subsystemNames = profileNode . get ( SUBSYSTEM ) . keys ( ) ; if ( ( subsystemNames . size ( ) ) > 0 ) { String defaultNamespace = writer . getNamespaceContext ( ) . getNamespaceURI ( XMLConstants . DEFAULT_NS_PREFIX ) ; for ( String subsystemName : subsystemNames ) { try { ModelNode subsystem = profileNode . get ( SUBSYSTEM , subsystemName ) ; XMLElementWriter < SubsystemMarshallingContext > subsystemWriter = context . getSubsystemWriter ( subsystemName ) ; if ( subsystemWriter != null ) { subsystemWriter . writeContent ( writer , new SubsystemMarshallingContext ( subsystem , writer ) ) ; } } finally { writer . setDefaultNamespace ( defaultNamespace ) ; } } } writer . writeEndElement ( ) ; } }

Fix:
writer . writeAttribute ( NAME . getLocalName ( ) , profileNode . get ( PROFILE_NAME ) . asString ( ) ) ;
Buggy code:
public class AllTests extends TestCase { public static final boolean skipSupportModules = false ; public static TestSuite suite ( ) { TestSuite suite = new TestSuite ( AllTests . class . getName ( ) ) ; suite . addTest ( AjbrowserModuleTests . suite ( ) ) ; suite . addTest ( AjdeModuleTests . suite ( ) ) ; suite . addTest ( AjdocModuleTests . suite ( ) ) ; suite . addTest ( AsmModuleTests . suite ( ) ) ; suite . addTest ( BridgeModuleTests . suite ( ) ) ; suite . addTest ( LoadtimeModuleTests . suite ( ) ) ; suite . addTest ( EajcModuleTests . suite ( ) ) ; suite . addTest ( RuntimeModuleTests . suite ( ) ) ; suite . addTest ( TaskdefsModuleTests . suite ( ) ) ; if ( ! ( AllTests . skipSupportModules ) ) { suite . addTest ( BuildModuleTests . suite ( ) ) ; suite . addTest ( TestingModuleTests . suite ( ) ) ; suite . addTest ( TestingClientModuleTests . suite ( ) ) ; suite . addTest ( TestingDriversModuleTests . suite ( ) ) ; suite . addTest ( TestingUtilModuleTests . suite ( ) ) ; } suite . addTest ( UtilModuleTests . suite ( ) ) ; suite . addTest ( BcweaverModuleTests . suite ( ) ) ; if ( LangUtil . is15VMOrGreater ( ) ) { TestUtil . loadTestsReflectively ( suite , "Aspectj5rtModuleTests" , false ) ; <START_BUG> TestUtil . loadTestsReflectively ( suite , "Loadtime5ModuleTests" , false ) ; <END_BUG> } else { suite . addTest ( TestUtil . skipTest ( "for<seq2seq4repair_space>1.5" ) ) ; } return suite ; } public AllTests ( String name ) { } }

Fix:
TestUtil . loadTestsReflectively ( suite , "Loadtime515ModuleTests" , false ) ;
Buggy code:
@ NotThreadSafe public class MMapFileBackedBitArray implements BitArray { protected final RandomAccessFile backingFile ; protected final int maxElements ; protected final int numBytes ; protected final MappedByteBuffer buffer ; public MMapFileBackedBitArray ( File backingFile , int maxElements ) throws IOException { } @ Override public boolean getBit ( int index ) { } @ Override public boolean setBit ( int index ) { } @ Override public void clear ( ) { } @ Override public void clearBit ( int index ) { } @ Override public boolean setBitIfUnset ( int index ) { <START_BUG> if ( this . getBit ( index ) ) { <END_BUG> return this . setBit ( index ) ; } return false ; } @ Override public void or ( BitArray bitArray ) { } @ Override public void and ( BitArray bitArray ) { } @ Override public int bitSize ( ) { } protected void extendFile ( final long newLength ) throws IOException { } @ Override public void close ( ) throws IOException { } protected void closeDirectBuffer ( ByteBuffer byteBuffer ) { } @ Override public int numBytes ( ) { } @ Override public byte [ ] toByteArray ( ) { } @ Override public int getHighestBitSet ( ) { } @ Override public int getLowestBitSet ( ) { } }

Fix:
if ( ! ( this . getBit ( index ) ) ) {
Buggy code:
public class TestPersist extends AbstractTestCase { public String getDialect ( ) { } private Map createId ( String idno , String type ) { } private Map buildCreateData ( ) { } private Map buildUpdateData ( ) { } private Map getFinder ( ) { } public void ztestCreate ( ) throws Exception { } public void ztestUpdate ( ) throws Exception { } public void testRead ( ) throws Exception { } public void ztestGroupBy ( ) throws Exception { exec ( new ExecHandler ( ) { public void execute ( ) throws Exception { em . select ( "maxname:{MAX(lastname)},<seq2seq4repair_space>entityno" ) ; <START_BUG> List list = em . find ( getFinder ( ) ) . sort ( "firstname<seq2seq4repair_space>DESC,lastname,<seq2seq4repair_space>entityno" ) . groupBy ( "entityno,<seq2seq4repair_space>address.barangay.objid,<seq2seq4repair_space>yr:{<seq2seq4repair_space>YEAR(dtcreated)<seq2seq4repair_space>}" ) . list ( ) ; <END_BUG> printList ( list ) ; } } ) ; } public void ztestSelect ( ) throws Exception { } public void ztestSelectSession ( ) throws Exception { } }

Fix:
List list = em . find ( getFinder ( ) ) . orderBy ( "firstname<seq2seq4repair_space>DESC,lastname,<seq2seq4repair_space>entityno" ) . groupBy ( "entityno,<seq2seq4repair_space>address.barangay.objid,<seq2seq4repair_space>yr:{<seq2seq4repair_space>YEAR(dtcreated)<seq2seq4repair_space>}" ) . list ( ) ;
Buggy code:
public class Clans extends JavaPlugin { public static HashMap < String , TeamPlayer > Users = new HashMap < String , TeamPlayer > ( ) ; public static HashMap < String , Team > Teams = new HashMap < String , Team > ( ) ; public static HashMap < String , TeamArea > TeamAreas = new HashMap < String , TeamArea > ( ) ; private File TeamsFile ; private File PlayersFile ; private Logger log = Logger . getLogger ( "Minecraft" ) ; private final ClansPlayerListener playerListener = new ClansPlayerListener ( this ) ; public void onEnable ( ) { } public void onDisable ( ) { } public boolean onCommand ( CommandSender sender , Command cmd , String commandLabel , String [ ] args ) { } private void loadData ( ) { } private void saveTeams ( ) { try { FileWriter fstream = new FileWriter ( TeamsFile , false ) ; BufferedWriter out = new BufferedWriter ( fstream ) ; out . write ( "" ) ; for ( String key : Clans . Teams . keySet ( ) ) { <START_BUG> out . write ( ( key + ":\n" ) ) ; <END_BUG> out . write ( Clans . Teams . get ( key ) . getSaveString ( ) ) ; } out . close ( ) ; fstream . close ( ) ; } catch ( Exception e ) { System . err . println ( ( "Error:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } } private void savePlayers ( ) { } private TeamRank getRank ( String PlayerName ) { } public TeamPlayer getTeamPlayer ( String PlayerName ) { } public Team getTeam ( String PlayerName ) { } private void teamAdd ( String PlayerName ) { } private void teamRemove ( String PlayerName ) { } private boolean isInteger ( String input ) { } public boolean hasUser ( String PlayerName ) { } public void makeUser ( String PlayerName ) { } public void updateUserDate ( String PlayerName ) { } No newline ; at end ; of file ; }

Fix:
out . write ( ( ( "\'" + key ) + "\':\n" ) ) ;