nus-yam/ex-repair huggingface dataset:
Buggy code:
public class TypeDeclarationPattern extends SearchPattern { private char [ ] qualification ; private char [ ] [ ] enclosingTypeNames ; private char [ ] simpleName ; private char classOrInterface ; private char [ ] decodedQualification ; private char [ ] decodedSimpleName ; private char [ ] [ ] decodedEnclosingTypeNames ; private char decodedClassOrInterface ; public TypeDeclarationPattern ( char [ ] qualification , char [ ] [ ] enclosingTypeNames , char [ ] simpleName , char classOrInterface , int matchMode , boolean isCaseSensitive ) { } public void decodeIndexEntry ( IEntryResult entryResult ) { } public void feedIndexRequestor ( IIndexSearchRequestor requestor , int detailLevel , int [ ] references , IndexInput input , IJavaSearchScope scope ) throws IOException { } public char [ ] indexEntryPrefix ( ) { } protected int matchContainer ( ) { } public boolean matchesBinary ( Object binaryInfo , Object enclosingBinaryInfo ) { } protected boolean matchesType ( char [ ] simpleNamePattern , char [ ] qualificationPattern , char [ ] enclosingNamePattern , char [ ] fullyQualifiedTypeName ) { } protected boolean matchIndexEntry ( ) { } public String toString ( ) { } public int matchLevel ( AstNode node , boolean resolve ) { if ( ! ( node instanceof TypeDeclaration ) ) return IMPOSSIBLE_MATCH ; TypeDeclaration type = ( ( TypeDeclaration ) ( node ) ) ; if ( resolve ) { return this . matchLevel ( type . binding ) ; } else { if ( ( ( this . simpleName ) != null ) && ( ! ( this . matchesName ( this . simpleName , type . name ) ) ) ) return IMPOSSIBLE_MATCH ; else <START_BUG> return POSSIBLE_MATCH ; <END_BUG> } } public int matchLevel ( Binding binding ) { } protected int matchLevelForType ( char [ ] simpleNamePattern , char [ ] qualificationPattern , char [ ] enclosingNamePattern , TypeBinding type ) { } }

Fix:
return this . needsResolve ? POSSIBLE_MATCH : ACCURATE_MATCH ;
Buggy code:
public class JokeController extends AbstractControllerConfiguration { @ Inject private JokeService service ; @ Override protected void configure ( ) { setGlobalPath ( "jokes" ) ; post ( ( Request request , Response response , Joke joke ) -> { Joke savedJoke = service . save ( joke ) ; response . entity ( savedJoke ) . status ( HttpStatus . CREATED ) . header ( HeaderName . LOCATION , getEntityLocation ( savedJoke . getId ( ) , request . getPath ( ) ) ) ; } ) . consumes ( JSON ) . produces ( JSON ) ; get ( ( request , response ) -> { List < Joke > jokes = service . getAll ( ) ; response . entity ( jokes ) ; } ) . produces ( JSON , XML ) ; get ( ":id" , ( request , response ) -> { <START_BUG> Joke joke = service . get ( request . getPathParam ( "id" ) ) ; <END_BUG> response . entity ( joke ) ; } ) . produces ( JSON , XML ) ; } private String getEntityLocation ( String entityId , String path ) { } }

Fix:
Joke joke = service . get ( request . getPathParam ( "id" ) . get ( ) ) ;
Buggy code:
public class MVPInitializerTest { @ Test public void testErrorViewResolver ( ) { } private class MockView implements MvpView { @ Override public String getName ( ) { } @ Override public String getMenuLabel ( ) { } @ Override public void enter ( ViewChangeListener . ViewChangeEvent event ) { } } private class MockMVPInitializer extends MVPInitializer { public MockMVPInitializer ( Presenter mainPresenter ) { } public ViewProvider getErrorProvider ( ) { <START_BUG> return this . errorProvider ; <END_BUG> } @ Override protected void initializeNavigator ( ) { } @ Override protected void setDefaultErrorHandler ( ) { } } }

Fix:
return this . viewProvider ;
Buggy code:
public class PropertyPlaceholderHelper { private static final Log logger = LogFactory . getLog ( PropertyPlaceholderHelper . class ) ; private static final Map < String , String > wellKnownSimplePrefixes = new HashMap < String , String > ( 4 ) ; private final String placeholderPrefix ; private final String placeholderSuffix ; private final String simplePrefix ; private final String valueSeparator ; private final boolean ignoreUnresolvablePlaceholders ; public PropertyPlaceholderHelper ( String placeholderPrefix , String placeholderSuffix ) { } public PropertyPlaceholderHelper ( String placeholderPrefix , String placeholderSuffix , String valueSeparator , boolean ignoreUnresolvablePlaceholders ) { } public String replacePlaceholders ( String value , final Properties properties ) { } public String replacePlaceholders ( String value , PropertyPlaceholderHelper . PlaceholderResolver placeholderResolver ) { } protected String parseStringValue ( String strVal , PropertyPlaceholderHelper . PlaceholderResolver placeholderResolver , Set < String > visitedPlaceholders ) { } private int findPlaceholderEndIndex ( CharSequence buf , int startIndex ) { int index = startIndex + ( this . placeholderPrefix . length ( ) ) ; int withinNestedPlaceholder = 0 ; while ( index < ( buf . length ( ) ) ) { if ( StringUtils . substringMatch ( buf , index , this . placeholderSuffix ) ) { if ( withinNestedPlaceholder > 0 ) { withinNestedPlaceholder -- ; <START_BUG> index = ( index + ( this . placeholderPrefix . length ( ) ) ) - 1 ; <END_BUG> } else { return index ; } } else if ( StringUtils . substringMatch ( buf , index , this . simplePrefix ) ) { withinNestedPlaceholder ++ ; index = index + ( this . simplePrefix . length ( ) ) ; } else { index ++ ; } } return - 1 ; } public static interface PlaceholderResolver { String resolvePlaceholder ( String placeholderName ) { } } }

Fix:
index = index + ( this . placeholderSuffix . length ( ) ) ;
Buggy code:
public class CommandLineUtils { private static final Logger log = LoggerFactory . getLogger ( CommandLineUtils . class ) ; public static boolean isProcessRunning ( int pid , int timeout , TimeUnit timeunit ) throws IOException { } public static int killProcess ( int pid , int timeout , TimeUnit timeunit ) throws IOException { String line ; if ( SystemUtils . IS_OS_WINDOWS ) { <START_BUG> line = "cmd<seq2seq4repair_space>//c<seq2seq4repair_space>\"taskkill<seq2seq4repair_space>//F<seq2seq4repair_space>//PID<seq2seq4repair_space>" + pid ; <END_BUG> } else { line = "sudo<seq2seq4repair_space>kill<seq2seq4repair_space>-9<seq2seq4repair_space>" + pid ; } int exitValue = CommandLineUtils . executeCommandLine ( line , timeout , timeunit ) ; System . out . println ( ( ( ( "executing<seq2seq4repair_space>command:<seq2seq4repair_space>" + line ) + "<seq2seq4repair_space>returned<seq2seq4repair_space>exitValue:<seq2seq4repair_space>" ) + exitValue ) ) ; return exitValue ; } public static int executeCommandLine ( String command , int timeout , TimeUnit timeunit ) throws IOException { } public static int getExecPID ( Process p ) { } }

Fix:
line = ( "cmd<seq2seq4repair_space>//c<seq2seq4repair_space>\"taskkill<seq2seq4repair_space>//F<seq2seq4repair_space>//PID<seq2seq4repair_space>" + pid ) + "\"" ;
Buggy code:
class ClasspathDirectory extends ClasspathLocation { String binaryPath ; SimpleLookupTable missingPackages ; SimpleLookupTable directoryCache ; ClasspathDirectory ( String binaryPath ) { } void cleanup ( ) { } String [ ] directoryList ( String pathPrefix , char [ ] [ ] compoundName , char [ ] packageName ) { } public boolean equals ( Object o ) { if ( ( this ) == o ) return true ; if ( ! ( o instanceof ClasspathDirectory ) ) return false ; <START_BUG> return binaryPath . equalsIgnoreCase ( ( ( ClasspathDirectory ) ( o ) ) . binaryPath ) ; <END_BUG> } boolean exists ( String pathPrefix , String filename , char [ ] [ ] packageName ) { } NameEnvironmentAnswer findClass ( char [ ] className , char [ ] [ ] packageName ) { } boolean isPackage ( char [ ] [ ] compoundName , char [ ] packageName ) { } void reset ( ) { } public String toString ( ) { } }

Fix:
return binaryPath . equals ( ( ( ClasspathDirectory ) ( o ) ) . binaryPath ) ;
Buggy code:
public class UniquePathsTD { public long uniquePathsTD ( int m , int n ) { <START_BUG> final long [ ] [ ] memo = new long [ m + 1 ] [ n + 1 ] ; <END_BUG> return paths ( 0 , 0 , m , n , memo ) ; } private long paths ( int i , int j , int m , int n , long [ ] [ ] memo ) { } }

Fix:
final long [ ] [ ] memo = new long [ m ] [ n ] ;
Buggy code:
public class ContainerFeedbackMessageFilter implements IFeedbackMessageFilter { private static final long serialVersionUID = 1L ; private final MarkupContainer container ; public ContainerFeedbackMessageFilter ( MarkupContainer container ) { } public boolean accept ( FeedbackMessage message ) { <START_BUG> return container . getParent ( ) . contains ( message . getReporter ( ) , false ) ; <END_BUG> } }

Fix:
return container . contains ( message . getReporter ( ) , true ) ;
Buggy code:
public class CheckingAccount extends AbstractAccount implements Serializable { private float overdraft = 0 ; public CheckingAccount ( float overdraft , float balance ) { } public CheckingAccount ( float overdraft , float balance , Integer id ) { } public void parseFeed ( Map < String , String > feed ) { } public void setOverdraft ( float overdraft ) { } public float getOverdraft ( ) { } public CheckingAccount ( ) { } @ Override public void withdraw ( float x ) throws OverDraftLimitExceededException { if ( x > ( getBalance ( ) ) ) { overdraft = ( overdraft ) - ( x - ( getBalance ( ) ) ) ; if ( ( overdraft ) < 0 ) { <START_BUG> throw new OverDraftLimitExceededException ( x ) ; <END_BUG> } } else if ( ( ( getBalance ( ) ) + ( getOverdraft ( ) ) ) >= x ) { float newBalance = ( getBalance ( ) ) - x ; setBalance ( newBalance ) ; } } @ Override public float decimalValue ( ) { } @ Override public void printReport ( ) { } @ Override public String toString ( ) { } No newline ; at end ; of file ; }

Fix:
throw new OverDraftLimitExceededException ( x , this ) ;
Buggy code:
public class DietaChild { private RelativeLayout child ; private FrameLayout defaultLayout ; public FrameLayout getDefaultLayout ( ) { } public void setDefaultLayout ( FrameLayout defaultLayout ) { } private CheckBox checkBox ; private DTO_Componente componente ; public CheckBox getCheckBox ( ) { } public DTO_Componente getDTO_Componente ( ) { } public void setCheckBox ( CheckBox checkBox ) { } public RelativeLayout getChild ( ) { } public void setChild ( RelativeLayout child ) { } public DietaChild ( Context context , String title , List < DTO_Componente > content , String time , boolean activo ) { } public DietaChild ( Context context ) { } private void genDefaultLayout ( Context context ) { defaultLayout = new FrameLayout ( context ) ; defaultLayout . setLayoutParams ( new FrameLayout . LayoutParams ( LayoutParams . MATCH_PARENT , LayoutParams . WRAP_CONTENT ) ) ; TextView text = new TextView ( context ) ; text . setTextSize ( 35 ) ; text . setTextColor ( BLACK ) ; <START_BUG> text . setText ( "No<seq2seq4repair_space>hay<seq2seq4repair_space>datos<seq2seq4repair_space>para<seq2seq4repair_space>este<seq2seq4repair_space>día" ) ; <END_BUG> text . setGravity ( ( ( Gravity . CENTER_VERTICAL ) | ( Gravity . CENTER_HORIZONTAL ) ) ) ; defaultLayout . addView ( text ) ; } }

Fix:
text . setText ( "No<seq2seq4repair_space>hay<seq2seq4repair_space>datos<seq2seq4repair_space>para<seq2seq4repair_space>este<seq2seq4repair_space>día." ) ;
Buggy code:
public class AspectJBuildManagerTest extends AjdeTestCase { public AspectJBuildManagerTest ( String name ) { } public static TestSuite suite ( ) { } public void testInit ( ) { } public void testCompileNonExistingConfig ( ) { } public void testCompileEmptyConfig ( ) { } public void testCompileSuccess ( ) { } public void testCompileOutput ( ) { } public void testSymbolFileGenerated ( ) { <START_BUG> File file = createFile ( "..//examples//figures-coverage//all.ajsym" ) ; <END_BUG> if ( file . exists ( ) ) { file . delete ( ) ; } else { assertTrue ( ( "expected<seq2seq4repair_space>.ajsym" + file ) , false ) ; } } protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } }

Fix:
File file = openFile ( "..//examples//figures-coverage//all.ajsym" ) ;
Buggy code:
@ Service @ Transactional public class IscsiTargetService { static final Logger logger = LoggerFactory . getLogger ( IscsiTargetService . class ) ; private UniqueIscsiTargetRepository uniqueIscsiTargetRepository ; private StorageAgentClientFactory storageAgentClientFactory ; private DtoValidator dtoValidator ; @ Autowired public IscsiTargetService ( UniqueIscsiTargetRepository uniqueIscsiTargetRepository , StorageAgentClientFactory storageAgentClientFactory , DtoValidator dtoValidator ) { } public UniqueIscsiTarget createUniqueIscsiTarget ( IscsiTarget iscsiTarget ) throws DuplicateTargetNameException , ConstraintViolationException { } public UniqueIscsiTarget getUniqueIscsiTarget ( String uuid ) throws IscsiTargetNotFoundException { } public List < UniqueIscsiTarget > getAllUniqueIscsiTargets ( ) { } public void deleteIscsiUniqueTarget ( String uuid ) throws IscsiTargetNotFoundException { UniqueIscsiTargetEntity uniqueIscsiTargetEntity = uniqueIscsiTargetRepository . findByUuid ( uuid ) ; if ( uniqueIscsiTargetEntity == null ) { throw new IscsiTargetNotFoundException ( uuid ) ; } uniqueIscsiTargetRepository . delete ( uniqueIscsiTargetEntity . getUuid ( ) ) ; <START_BUG> StorageAgentClient storageAgentClient = storageAgentClientFactory . getStorageClientUsedInCreating ( uniqueIscsiTargetEntity ) ; <END_BUG> storageAgentClient . deleteIscsiTarget ( uniqueIscsiTargetEntity . getTargetName ( ) ) ; } private UniqueIscsiTargetEntity convertToUniqueIscsiTargetEntity ( AccessibleIscsiTarget accessibleIscsiTarget , StorageAgentClient storageAgentClient ) { } private UniqueIscsiTarget convertToUniqueIscsiTarget ( UniqueIscsiTargetEntity uniqueIscsiTargetEntity ) { } private IscsiTarget convertToIscsiTarget ( UniqueIscsiTargetEntity uniqueIscsiTargetEntity ) { } }

Fix:
StorageAgentClient storageAgentClient = storageAgentClientFactory . getBestStorageAgent ( convertToIscsiTarget ( uniqueIscsiTargetEntity ) ) ;
Buggy code:
@ Service public class AlleleService { @ Autowired private KitRepository kitRepository ; @ Autowired private AlleleRepository alleleRepository ; public List < Allele > getAlleles ( long kitId ) { } public Allele getAllele ( long kitId , long alleleId ) { } public void addAllele ( long kitId , String alleleName ) { } public void removeAllele ( long kitId , long alleleId ) { KitEntity kitEntity = kitRepository . findOne ( kitId ) ; if ( kitEntity == null ) { throw new me . zeph . relations . exception . KitNotFoundException ( String . format ( KIT_NOT_FOUND , kitId ) ) ; } else { AlleleEntity allele = alleleRepository . findOne ( alleleId ) ; <START_BUG> if ( allele == null ) { <END_BUG> throw new me . zeph . relations . exception . AlleleNotFoundException ( String . format ( ALLELE_NOT_FOUND_IN_KIT , alleleId , kitId ) ) ; } else { kitEntity . removeAllele ( allele ) ; kitRepository . saveAndFlush ( kitEntity ) ; } } } private Allele findAlleleById ( long kitId , long alleleId , KitEntity kitEntity ) { } private List < Allele > translateAlleles ( List < AlleleEntity > alleleEntities ) { } private Allele translateAllele ( AlleleEntity alleleEntity ) { } }

Fix:
if ( ! ( kitEntity . getAlleles ( ) . contains ( allele ) ) ) {
Buggy code:
public class ClientModule extends AbstractGinModule { @ Override protected void configure ( ) { install ( new Builder ( ) . tokenFormatter ( RouteTokenFormatter . class ) . build ( ) ) ; install ( new ApplicationModule ( ) ) ; install ( new AnalyticsModule . Builder ( "UA-41550930-11" ) . autoCreate ( false ) . build ( ) ) ; bind ( ResourceLoader . class ) . asEagerSingleton ( ) ; bindConstant ( ) . annotatedWith ( DefaultPlace . class ) . to ( HOME ) ; <START_BUG> bindConstant ( ) . annotatedWith ( ErrorPlace . class ) . to ( NOTFOUND ) ; <END_BUG> bindConstant ( ) . annotatedWith ( UnauthorizedPlace . class ) . to ( HOME ) ; requestStaticInjection ( NameTokens . class ) ; } }

Fix:
bindConstant ( ) . annotatedWith ( ErrorPlace . class ) . to ( HOME ) ;
Buggy code:
public class Wereld extends Observable implements Serializable , ModelFacade { private ArrayList < Eiland > eilanden ; private ArrayList < Integer > oppervlakEiland1 ; private ArrayList < Integer > oppervlakEiland2 ; private ArrayList < Beest > zwemmers ; private static final Integer WERELD_BREEDTE = 160 ; private static final Integer WERELD_HOOGTE = 120 ; private final Integer WERELD_MARGIN_BREEDTE = ( Wereld . WERELD_BREEDTE ) // 20 ; private final Integer WERELD_MARGIN_HOOGTE = ( Wereld . WERELD_HOOGTE ) // 20 ; private final Integer EILAND_BREEDTE = ( ( Wereld . WERELD_BREEDTE ) // 2 ) - ( 2 * ( WERELD_MARGIN_BREEDTE ) ) ; private final Integer EILAND_HOOGTE = ( ( Wereld . WERELD_HOOGTE ) // 2 ) - ( 2 * ( WERELD_MARGIN_HOOGTE ) ) ; private ArrayList < Beest > opruimLijst ; public Wereld ( ) { } public ArrayList < Eiland > getEilanden ( ) { } @ Override public void step ( ) { for ( Eiland e : eilanden ) { e . stapDoorSimulatie ( ) ; } for ( Beest b : zwemmers ) { boolean erStaatEenObstakel = false ; int newX = this . nieuwePositie ( b ) . get ( 0 ) ; int newY = this . nieuwePositie ( b ) . get ( 1 ) ; for ( Object o : this . staatOpPositie ( newX , newY ) ) { if ( o instanceof Obstakel ) { erStaatEenObstakel = true ; } } if ( ! erStaatEenObstakel ) { b . beweeg ( newX , newY ) ; if ( ( b . getEnergie ( ) ) <= 0 ) { opruimLijst . add ( b ) ; } for ( Eiland el : eilanden ) { <START_BUG> for ( int i = 0 ; i < ( el . getEilandOppervlak ( ) . size ( ) ) ; i += 2 ) { <END_BUG> if ( ( el . getEilandOppervlak ( ) . get ( i ) . equals ( newX ) ) && ( el . getEilandOppervlak ( ) . get ( ( i + 1 ) ) . equals ( newY ) ) ) { el . getBeesten ( ) . add ( b ) ; opruimLijst . add ( b ) ; } } } } else { b . bots ( ) ; b . kiesAndereRichting ( ) ; } } zwemmers . removeAll ( opruimLijst ) ; opruimLijst . clear ( ) ; ArrayList < Object > lijstObjecten = new ArrayList < > ( ) ; for ( Eiland e : eilanden ) { lijstObjecten . addAll ( e . getBeesten ( ) ) ; lijstObjecten . addAll ( e . getPlanten ( ) ) ; lijstObjecten . addAll ( e . getObstakels ( ) ) ; } lijstObjecten . addAll ( zwemmers ) ; setChanged ( ) ; notifyObservers ( lijstObjecten ) ; } @ Override public ArrayList < Integer > getWereldSize ( ) { } public void voegZwemmersToe ( Beest b ) { } public ArrayList < Beest > getZwemmers ( ) { } public ArrayList < Integer > nieuwePositie ( Beest b ) { } public ArrayList < Object > staatOpPositie ( int x , int y ) { } }

Fix:
for ( int i = 0 ; i < ( el . getEilandOppervlak ( ) . size ( ) ) ; i = i + 2 ) {
Buggy code:
public class TablePickerTest extends TestBase { @ Mock Bigquery bigquery ; @ Mock GoogleJsonResponseException googleJsonResponseException ; @ Test public void pickerPicksTheRightName ( ) throws Exception { TablePicker picker = new TablePicker ( null , null ) ; String picked = picker . pick ( ) ; <START_BUG> String expected = "OBJSTATS_" + ( new SimpleDateFormat ( "YYYY_MM_dd" ) . format ( new Date ( ) ) ) ; <END_BUG> assertThat ( picked , equalTo ( expected ) ) ; } public void ensuringTablesWorksEvenIfTablesExist ( ) throws Exception { } }

Fix:
String expected = "OBJSTATS_" + ( new SimpleDateFormat ( "YYYYMMdd" ) . format ( new Date ( ) ) ) ;
Buggy code:
public class SearchMessageAction extends AbstractColumbaAction { public SearchMessageAction ( IFrameMediator controller ) { } public void actionPerformed ( ActionEvent evt ) { IMailbox searchFolder = ( ( IMailbox ) ( FolderTreeModel . getInstance ( ) . getFolder ( 106 ) ) ) ; <START_BUG> SearchFrame frame = new SearchFrame ( ( ( AbstractMailFrameController ) ( getFrameMediator ( ) ) ) , searchFolder ) ; <END_BUG> } }

Fix:
new org . columba . mail . gui . config . search . SearchFrame ( ( ( AbstractMailFrameController ) ( getFrameMediator ( ) ) ) , searchFolder ) ;
Buggy code:
public class TableEditor extends ControlEditor { Table table ; TableItem item ; int column = - 1 ; ControlListener columnListener ; public TableEditor ( Table table ) { } Rectangle computeBounds ( ) { } public void dispose ( ) { } public int getColumn ( ) { } public TableItem getItem ( ) { } public void setColumn ( int column ) { } public void setItem ( TableItem item ) { } public void setEditor ( Control editor , TableItem item , int column ) { } public void layout ( ) { <START_BUG> if ( table . isDisposed ( ) ) <END_BUG> return ; if ( ( ( item ) == null ) || ( item . isDisposed ( ) ) ) return ; int columnCount = table . getColumnCount ( ) ; if ( ( columnCount == 0 ) && ( ( column ) != 0 ) ) return ; if ( ( columnCount > 0 ) && ( ( ( column ) < 0 ) || ( ( column ) >= columnCount ) ) ) return ; super . layout ( ) ; } }

Fix:
if ( ( ( table ) == null ) || ( table . isDisposed ( ) ) )
Buggy code:
public class PKIndexSplitter { private final Filter docsInFirstIndex ; private final Directory input ; private final Directory dir1 ; private final Directory dir2 ; private final IndexWriterConfig config1 ; private final IndexWriterConfig config2 ; public PKIndexSplitter ( Version version , Directory input , Directory dir1 , Directory dir2 , Filter docsInFirstIndex ) { } private static IndexWriterConfig newDefaultConfig ( Version version ) { } public PKIndexSplitter ( Directory input , Directory dir1 , Directory dir2 , Filter docsInFirstIndex , IndexWriterConfig config1 , IndexWriterConfig config2 ) { } public PKIndexSplitter ( Version version , Directory input , Directory dir1 , Directory dir2 , Term midTerm ) { } public PKIndexSplitter ( Directory input , Directory dir1 , Directory dir2 , Term midTerm , IndexWriterConfig config1 , IndexWriterConfig config2 ) { } public void split ( ) throws IOException { } private void createIndex ( IndexWriterConfig config , Directory target , IndexReader reader , Filter preserveFilter , boolean negateFilter ) throws IOException { boolean success = false ; final IndexWriter w = new IndexWriter ( target , config ) ; try { <START_BUG> final List < AtomicReaderContext > leaves = reader . getTopReaderContext ( ) . leaves ( ) ; <END_BUG> final IndexReader [ ] subReaders = new IndexReader [ leaves . size ( ) ] ; int i = 0 ; for ( final AtomicReaderContext ctx : leaves ) { subReaders [ ( i ++ ) ] = new PKIndexSplitter . DocumentFilteredAtomicIndexReader ( ctx , preserveFilter , negateFilter ) ; } w . addIndexes ( subReaders ) ; success = true ; } finally { if ( success ) { IOUtils . close ( w ) ; } else { IOUtils . closeWhileHandlingException ( w ) ; } } } private static class DocumentFilteredAtomicIndexReader extends FilterAtomicReader { final Bits liveDocs ; final int numDocs ; public DocumentFilteredAtomicIndexReader ( AtomicReaderContext context , Filter preserveFilter , boolean negateFilter ) throws IOException { } @ Override public int numDocs ( ) { } @ Override public boolean hasDeletions ( ) { } @ Override public Bits getLiveDocs ( ) { } } }

Fix:
final List < AtomicReaderContext > leaves = reader . leaves ( ) ;
Buggy code:
public class MultiSelectListPreference extends DialogPreference { private CharSequence [ ] mEntries ; private CharSequence [ ] mEntryValues ; private Set < String > mValues = new HashSet < String > ( ) ; private Set < String > mNewValues = new HashSet < String > ( ) ; private boolean mPreferenceChanged ; public MultiSelectListPreference ( Context context , AttributeSet attrs , int defStyleAttr , int defStyleRes ) { } public MultiSelectListPreference ( Context context , AttributeSet attrs , int defStyleAttr ) { } public MultiSelectListPreference ( Context context , AttributeSet attrs ) { } public MultiSelectListPreference ( Context context ) { } public void setEntries ( CharSequence [ ] entries ) { } public void setEntries ( @ ArrayRes int entriesResId ) { } public CharSequence [ ] getEntries ( ) { } public void setEntryValues ( CharSequence [ ] entryValues ) { } public void setEntryValues ( @ ArrayRes int entryValuesResId ) { } public CharSequence [ ] getEntryValues ( ) { } public void setValues ( Set < String > values ) { } public Set < String > getValues ( ) { } public int findIndexOfValue ( String value ) { } @ Override protected void onPrepareDialogBuilder ( Builder builder ) { } private boolean [ ] getSelectedItems ( ) { } @ Override protected void onDialogClosed ( boolean positiveResult ) { } @ Override protected Object onGetDefaultValue ( TypedArray a , int index ) { final CharSequence [ ] defaultValues = a . getTextArray ( index ) ; <START_BUG> final int valueCount = defaultValues . length ; <END_BUG> final Set < String > result = new HashSet < String > ( ) ; for ( int i = 0 ; i < valueCount ; i ++ ) { result . add ( defaultValues [ i ] . toString ( ) ) ; } return result ; } @ Override protected void onSetInitialValue ( boolean restoreValue , Object defaultValue ) { } @ Override protected Parcelable onSaveInstanceState ( ) { } private static class SavedState extends BaseSavedState { Set < String > values ; public SavedState ( Parcel source ) { } public SavedState ( Parcelable superState ) { } @ Override public void writeToParcel ( Parcel dest , int flags ) { } public static final Parcelable . Creator < MultiSelectListPreference . SavedState > CREATOR = new Parcelable . Creator < MultiSelectListPreference . SavedState > ( ) { public android . preference . SavedState createFromParcel ( Parcel in ) { } public android . preference . SavedState [ ] newArray ( int size ) { } } ; } }

Fix:
final int valueCount = ( defaultValues != null ) ? defaultValues . length : 0 ;
Buggy code:
public class HTMLDOMImplementationImpl extends DOMImplementationImpl implements HTMLDOMImplementation { private static HTMLDOMImplementation _instance = new HTMLDOMImplementationImpl ( ) ; private HTMLDOMImplementationImpl ( ) { } public final HTMLDocument createHTMLDocument ( String title ) throws DOMException { HTMLDocument doc ; if ( title == null ) <START_BUG> throw new NullPointerException ( "Argument<seq2seq4repair_space>'title'<seq2seq4repair_space>is<seq2seq4repair_space>null." ) ; <END_BUG> doc = new HTMLDocumentImpl ( ) ; doc . setTitle ( title ) ; return doc ; } public static HTMLDOMImplementation getHTMLDOMImplementation ( ) { } }

Fix:
throw new NullPointerException ( "HTM014<seq2seq4repair_space>Argument<seq2seq4repair_space>'title'<seq2seq4repair_space>is<seq2seq4repair_space>null." ) ;
Buggy code:
@ RunWith ( SpringJUnit4ClassRunner . class ) @ ContextConfiguration ( locations = "//spring//ServiceTest-context.xml" ) @ Transactional public final class GroupsServiceTest { @ Resource Contract groupsService ; @ Resource IdPairsService . Contract idPairsService ; @ Test public void shouldSaveGroups ( ) { final ExtId . Group group1 = Group . newBuilder ( ) . setId ( 20 ) . setCode ( "alibaba" ) . build ( ) ; final ExtId . Group group2 = Group . newBuilder ( ) . setCode ( "7wonders" ) . build ( ) ; final List < Integer > ids = groupsService . saveGroups ( Arrays . asList ( group1 , group2 ) ) ; <START_BUG> assertEquals ( Arrays . asList ( 20 , 1500 ) , ids ) ; <END_BUG> } @ Test public void shouldDeleteGroup ( ) { } }

Fix:
assertEquals ( Arrays . asList ( 20 , 2000000 ) , ids ) ;
Buggy code:
public class CurrencyParser extends DataParser { @ Override public Object onParse ( Compiler . Mapping mapping , Object value , int direction ) { if ( direction == ( Binder . DIRECTION_OBJECT_TO_VIEWS ) ) { return String . format ( "%.02f<seq2seq4repair_space>€" , value ) ; } else { <START_BUG> String cleanValue = value . toString ( ) . replace ( '€' , '<seq2seq4repair_space>' ) . trim ( ) ; <END_BUG> return Float . parseFloat ( cleanValue ) ; } } }

Fix:
String cleanValue = value . toString ( ) . replace ( '€' , '<seq2seq4repair_space>' ) . replace ( ',' , '.' ) . trim ( ) ;
Buggy code:
public class ReconcileWorkingCopyOperation extends JavaModelOperation { boolean forceProblemDetection ; public ReconcileWorkingCopyOperation ( IJavaElement workingCopy , boolean forceProblemDetection ) { } protected void executeOperation ( ) throws JavaModelException { if ( ( fMonitor ) != null ) { if ( fMonitor . isCanceled ( ) ) return ; fMonitor . beginTask ( Util . bind ( "element.reconciling" ) , 10 ) ; } CompilationUnit workingCopy = getWorkingCopy ( ) ; boolean wasConsistent = workingCopy . isConsistent ( ) ; JavaElementDeltaBuilder deltaBuilder = null ; try { if ( ! wasConsistent ) { deltaBuilder = new JavaElementDeltaBuilder ( workingCopy ) ; workingCopy . makeConsistent ( fMonitor ) ; deltaBuilder . buildDeltas ( ) ; } if ( ( fMonitor ) != null ) fMonitor . worked ( 2 ) ; if ( ( forceProblemDetection ) && wasConsistent ) { if ( ( ( fMonitor ) != null ) && ( fMonitor . isCanceled ( ) ) ) return ; IProblemRequestor problemRequestor = workingCopy . getPerWorkingCopyInfo ( ) ; if ( ( problemRequestor != null ) && ( problemRequestor . isActive ( ) ) ) { problemRequestor . beginReporting ( ) ; CompilationUnitProblemFinder . process ( workingCopy , problemRequestor , fMonitor ) ; problemRequestor . endReporting ( ) ; } } if ( deltaBuilder != null ) { <START_BUG> if ( ( ( deltaBuilder . delta ) != null ) && ( ( deltaBuilder . delta . getAffectedChildren ( ) . length ) > 0 ) ) { <END_BUG> addReconcileDelta ( workingCopy , deltaBuilder . delta ) ; } } } finally { if ( ( fMonitor ) != null ) fMonitor . done ( ) ; } } protected CompilationUnit getWorkingCopy ( ) { } public boolean isReadOnly ( ) { } protected IJavaModelStatus verify ( ) { } }

Fix:
if ( ( deltaBuilder . delta ) != null ) {
Buggy code:
public class WebConnectorRemove implements ModelRemoveOperationHandler { static final WebConnectorRemove INSTANCE = new WebConnectorRemove ( ) ; private WebConnectorRemove ( ) { } @ Override public OperationResult execute ( final OperationContext context , final ModelNode operation , final ResultHandler resultHandler ) { ModelNode opAddr = operation . require ( OP_ADDR ) ; final PathAddress address = PathAddress . pathAddress ( opAddr ) ; final String name = address . getLastElement ( ) . getValue ( ) ; final ModelNode subModel = context . getSubModel ( ) ; final ModelNode compensatingOperation = WebConnectorAdd . getRecreateOperation ( opAddr , subModel ) ; if ( ( context . getRuntimeContext ( ) ) != null ) { context . getRuntimeContext ( ) . setRuntimeTask ( new RuntimeTask ( ) { public void execute ( RuntimeTaskContext context ) throws OperationFailedException { <START_BUG> final ServiceController < ? > service = context . getServiceRegistry ( ) . getService ( JBOSS_WEB_HOST . append ( name ) ) ; <END_BUG> if ( service != null ) { service . addListener ( new ResultHandler . ServiceRemoveListener ( resultHandler ) ) ; } else { resultHandler . handleResultComplete ( ) ; } } } ) ; } else { resultHandler . handleResultComplete ( ) ; } return new org . jboss . as . controller . BasicOperationResult ( compensatingOperation ) ; } }

Fix:
final ServiceController < ? > service = context . getServiceRegistry ( ) . getService ( JBOSS_WEB_CONNECTOR . append ( name ) ) ;
Buggy code:
@ Repository public class DbeExpendControlDaoImpl extends GenericDaoImpl < DbeExpendControl , DbeExpendLimitPK > implements DbeExpendControlDao { private static Logger logger = LoggerFactory . getLogger ( DbeExpendControlDaoImpl . class ) ; @ Override protected Class < DbeExpendControl > getDomainClass ( ) { } @ Override public List < DbeExpendControl > getExpendDataForUserAppProvCurrencyObCountry ( String urlEndUserId , BmService bmService , String appProviderId , BmCurrency bmCurrency , BmObCountry bmObCountry ) { } @ Override public void saveDbeExpendControl ( DbeExpendControl expendData ) { DbeExpendControlDaoImpl . logger . debug ( "Entering<seq2seq4repair_space>saveDbeExpendControl..." ) ; if ( ( ( ( ( ( ( ( expendData != null ) && ( ( expendData . getId ( ) ) != null ) ) && ( ( expendData . getId ( ) . getTxEndUserId ( ) ) != null ) ) && ( ( expendData . getId ( ) . getTxEndUserId ( ) . length ( ) ) > 0 ) ) && ( ( expendData . getId ( ) . getTxAppProviderId ( ) ) != null ) ) && ( ( expendData . getId ( ) . getTxAppProviderId ( ) . length ( ) ) > 0 ) ) && ( ( expendData . getId ( ) . getTxElType ( ) ) != null ) ) && ( ( expendData . getId ( ) . getTxElType ( ) . length ( ) ) > 0 ) ) { <START_BUG> this . getSession ( ) . saveOrUpdate ( expendData ) ; <END_BUG> } } }

Fix:
this . createOrUpdate ( expendData ) ;
Buggy code:
public class BukkitListener implements Listener { private TIntObjectHashMap < IrcAgent > bots ; private final IRCTransport plugin ; private Logger log ; public BukkitListener ( final IRCTransport instance ) { } @ EventHandler public void onPlayerChat ( final PlayerChatEvent event ) { } @ EventHandler public void onPlayerJoin ( final PlayerJoinEvent event ) { } @ EventHandler public void onPlayerQuit ( final PlayerQuitEvent event ) { } @ EventHandler public void onPlayerDeath ( final PlayerDeathEvent event ) { String deathMessage = event . getDeathMessage ( ) ; IrcAgent bot = this . bots . get ( event . getEntity ( ) . getEntityId ( ) ) ; <START_BUG> if ( ( ( bot . isConnected ( ) ) && ( deathMessage != null ) ) && ( deathMessage . equals ( "" ) ) ) { <END_BUG> String playerName = ( ( org . bukkit . entity . Player ) ( event . getEntity ( ) ) ) . getName ( ) ; if ( deathMessage . startsWith ( playerName ) ) { deathMessage = deathMessage . substring ( playerName . length ( ) ) ; } else { deathMessage = "died:<seq2seq4repair_space>" + deathMessage ; } bot . sendAction ( deathMessage . trim ( ) ) ; event . setDeathMessage ( null ) ; } } }

Fix:
if ( ( ( bot . isConnected ( ) ) && ( deathMessage != null ) ) && ( ! ( deathMessage . equals ( "" ) ) ) ) {
Buggy code:
public class RaStructureProcessor implements DeploymentUnitProcessor { private static final String RAR_EXTENSION = ".rar" ; private static final String JAR_EXTENSION = ".jar" ; private static final SuffixMatchFilter CHILD_ARCHIVE_FILTER = new SuffixMatchFilter ( RaStructureProcessor . JAR_EXTENSION , VisitorAttributes . RECURSE_LEAVES_ONLY ) ; private static Closeable NO_OP_CLOSEABLE = new Closeable ( ) { public void close ( ) throws IOException { } } ; public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ResourceRoot resourceRoot = deploymentUnit . getAttachment ( DEPLOYMENT_ROOT ) ; if ( resourceRoot == null ) { return ; } final VirtualFile deploymentRoot = resourceRoot . getRoot ( ) ; if ( ( deploymentRoot == null ) || ( ! ( deploymentRoot . exists ( ) ) ) ) { return ; } <START_BUG> final String deploymentRootName = deploymentRoot . getLowerCaseName ( ) ; <END_BUG> if ( ! ( deploymentRootName . endsWith ( RaStructureProcessor . RAR_EXTENSION ) ) ) { return ; } ModuleRootMarker . mark ( resourceRoot , true ) ; try { final List < VirtualFile > childArchives = deploymentRoot . getChildren ( RaStructureProcessor . CHILD_ARCHIVE_FILTER ) ; for ( final VirtualFile child : childArchives ) { final Closeable closable = ( child . isFile ( ) ) ? VFS . mountZip ( child , child , TempFileProviderService . provider ( ) ) : RaStructureProcessor . NO_OP_CLOSEABLE ; final MountHandle mountHandle = new MountHandle ( closable ) ; final ResourceRoot childResource = new ResourceRoot ( child , mountHandle ) ; ModuleRootMarker . mark ( childResource ) ; deploymentUnit . addToAttachmentList ( RESOURCE_ROOTS , childResource ) ; resourceRoot . addToAttachmentList ( INDEX_IGNORE_PATHS , child . getPathNameRelativeTo ( deploymentRoot ) ) ; } } catch ( IOException e ) { throw ConnectorMessages . MESSAGES . failedToProcessRaChild ( e , deploymentRoot ) ; } } public void undeploy ( DeploymentUnit context ) { } }

Fix:
final String deploymentRootName = deploymentRoot . getName ( ) . toLowerCase ( ) ;
Buggy code:
public class HeadersFragment extends Fragment { private static final String CATEGORY = "category" ; private static final String CATEGORY_POSITION = "category_position" ; private static final String ARTICLE_POSITION = "article_position" ; private int mCategoryPosition ; private Category mCategory ; private ListView mListView ; private Context mContext ; private TextView mCategoryTextView ; public static HeadersFragment newInstance ( int category ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { ViewGroup rootView = ( ( ViewGroup ) ( inflater . inflate ( fragment_headers , container , false ) ) ) ; mContext = getActivity ( ) ; mCategoryPosition = getArguments ( ) . getInt ( HeadersFragment . CATEGORY ) ; mListView = ( ( ListView ) ( rootView . findViewById ( headers_listView ) ) ) ; mListView . setOnItemClickListener ( new AdapterView . OnItemClickListener ( ) { @ Override public void onItemClick ( AdapterView < ? > parent , View view , int articlePosition , long id ) { Intent intent = new Intent ( mContext , ArticleActivity . class ) ; <START_BUG> intent . putExtra ( HeadersFragment . CATEGORY , mCategoryPosition ) ; <END_BUG> intent . putExtra ( HeadersFragment . ARTICLE_POSITION , articlePosition ) ; startActivity ( intent ) ; } } ) ; mCategoryTextView = ( ( TextView ) ( rootView . findViewById ( name_fragment_category ) ) ) ; mCategory = DataManager . getInstance ( getActivity ( ) ) . getCategories ( ) . get ( mCategoryPosition ) ; mCategoryTextView . setText ( mCategory . getCategoryName ( ) ) ; new HeadersFragment . LoadHeadersAsyncTask ( ) . execute ( mCategory ) ; return rootView ; } private class LoadHeadersAsyncTask extends AsyncTask < Category , Void , List < Header > > { @ Override protected List < Header > doInBackground ( Category ... params ) { } @ Override protected void onPostExecute ( List < Header > result ) { } } }

Fix:
intent . putExtra ( HeadersFragment . CATEGORY_POSITION , mCategoryPosition ) ;
Buggy code:
public class BooleanColumnTest { private final BooleanColumn column = BooleanColumn . create ( "Test" ) ; @ Before public void setup ( ) { } @ Test public void testGetElements ( ) throws Exception { } @ Test public void testAddCell ( ) throws Exception { } @ Test public void testGetType ( ) throws Exception { } @ Test public void testSummary ( ) throws Exception { } @ Test public void testCountUnique ( ) throws Exception { } @ Test public void testRoaringBitmapConstructor ( ) throws Exception { <START_BUG> BooleanColumn bc = new BooleanColumn ( "Is<seq2seq4repair_space>false" , column . isFalse ( ) ) ; <END_BUG> System . out . println ( bc ) ; } private boolean lastEntry ( ) { } }

Fix:
BooleanColumn bc = new BooleanColumn ( "Is<seq2seq4repair_space>false" , column . isFalse ( ) , column . size ( ) ) ;
Buggy code:
public final class StandardSessionInterceptor extends BaseInterceptor { int manager_note ; public StandardSessionInterceptor ( ) { } private StandardManager getManager ( Context ctx ) { } private void setManager ( Context ctx , StandardManager sm ) { } public void engineInit ( ContextManager cm ) throws TomcatException { } public int requestMap ( Request request ) { } public void reload ( Request req , Context ctx ) { <START_BUG> ClassLoader newLoader = ctx . getServletLoader ( ) . getClassLoader ( ) ; <END_BUG> StandardManager sM = getManager ( ctx ) ; sM . handleReload ( req , newLoader ) ; } public int newSessionRequest ( Request request , Response response ) { } public int postService ( Request rrequest , Response response ) { } public void contextInit ( Context ctx ) throws TomcatException { } public void contextShutdown ( Context ctx ) throws TomcatException { } }

Fix:
ClassLoader newLoader = ctx . getClassLoader ( ) ;
Buggy code:
public class AnnotationScopeMetadataResolver implements ScopeMetadataResolver { private final ScopedProxyMode defaultProxyMode ; protected Class < ? extends Annotation > scopeAnnotationType = Scope . class ; public AnnotationScopeMetadataResolver ( ) { } public AnnotationScopeMetadataResolver ( ScopedProxyMode defaultProxyMode ) { } public void setScopeAnnotationType ( Class < ? extends Annotation > scopeAnnotationType ) { } @ Override public ScopeMetadata resolveScopeMetadata ( BeanDefinition definition ) { ScopeMetadata metadata = new ScopeMetadata ( ) ; if ( definition instanceof AnnotatedBeanDefinition ) { AnnotatedBeanDefinition annDef = ( ( AnnotatedBeanDefinition ) ( definition ) ) ; <START_BUG> AnnotationAttributes attributes = MetadataUtils . attributesFor ( annDef . getMetadata ( ) , this . scopeAnnotationType ) ; <END_BUG> if ( attributes != null ) { metadata . setScopeName ( attributes . getString ( "value" ) ) ; ScopedProxyMode proxyMode = attributes . getEnum ( "proxyMode" ) ; if ( ( proxyMode == null ) || ( proxyMode == ( ScopedProxyMode . DEFAULT ) ) ) { proxyMode = this . defaultProxyMode ; } metadata . setScopedProxyMode ( proxyMode ) ; } } return metadata ; } }

Fix:
AnnotationAttributes attributes = AnnotationConfigUtils . attributesFor ( annDef . getMetadata ( ) , this . scopeAnnotationType ) ;
Buggy code:
public class InterfaceRequestTarget implements IComponentRequestTarget { private final Component component ; private final Method method ; public InterfaceRequestTarget ( final Component component , final Class myInterface ) { } public void respond ( final RequestCycle requestCycle ) { } public final Component getComponent ( ) { } public void cleanUp ( final RequestCycle requestCycle ) { } public Object getLock ( final RequestCycle requestCycle ) { } public boolean equals ( final Object obj ) { } public int hashCode ( ) { } public String toString ( ) { <START_BUG> return ( ( ( "InterfaceRequestTarget@" + ( hashCode ( ) ) ) + "{" ) + ( component ) ) + "}" ; <END_BUG> } }

Fix:
return ( ( ( "[InterfaceRequestTarget@" + ( hashCode ( ) ) ) + "<seq2seq4repair_space>" ) + ( component ) ) + "]" ;
Buggy code:
@ Path ( "subjects" ) public class SubjectsDataResource { private Datastore datastore ; private int availableSubjectId = 0 ; @ Context UriInfo uriInfo ; public SubjectsDataResource ( ) { } @ GET @ Produces ( { MediaType . APPLICATION_JSON , MediaType . APPLICATION_XML } ) public Response getAllSubjects ( ) { } @ GET @ Path ( "{subjectId}" ) @ Produces ( { MediaType . APPLICATION_JSON , MediaType . APPLICATION_XML } ) public Response getSubjects ( @ PathParam ( "subjectId" ) int subjectId ) { } @ GET @ Path ( "{subjectId}//grades" ) @ Produces ( { MediaType . APPLICATION_JSON , MediaType . APPLICATION_XML } ) public Response getGrades ( @ PathParam ( "subjectId" ) int subjectId ) { } @ GET @ Path ( "{subjectId}//grades//{studentId}" ) @ Produces ( { MediaType . APPLICATION_JSON , MediaType . APPLICATION_XML } ) public Response getStudentGrade ( @ PathParam ( "subjectId" ) int subjectId , @ PathParam ( "studentId" ) int studentId ) { } @ GET @ Path ( "getSubjectsByTeacher" ) @ Produces ( { MediaType . APPLICATION_JSON , MediaType . APPLICATION_XML } ) public Response getSubjectByTeacher ( @ DefaultValue ( "" ) @ QueryParam ( "teacher" ) String teacherName ) { } @ GET @ Path ( "getGrades" ) @ Produces ( { MediaType . APPLICATION_JSON , MediaType . APPLICATION_XML } ) public Response getGradesByValue ( @ DefaultValue ( "2.0" ) @ QueryParam ( "grade" ) double grade , @ DefaultValue ( "0" ) @ QueryParam ( "compare" ) int compare ) { ArrayList < Grade > result = new ArrayList < Grade > ( ) ; for ( Subject subject : datastore . find ( Subject . class ) . asList ( ) ) { for ( Grade g : subject . getGrades ( ) ) { if ( compareGrade ( g . getGrade ( ) , grade , compare ) ) { result . add ( g ) ; } } } <START_BUG> if ( result != null ) <END_BUG> return Response . ok ( result ) . build ( ) ; return Response . status ( NOT_FOUND ) . type ( "text//plain" ) . entity ( "Not<seq2seq4repair_space>found" ) . build ( ) ; } @ POST @ Consumes ( { MediaType . APPLICATION_JSON , MediaType . APPLICATION_XML } ) public Response addSubject ( Subject subject ) { } @ POST @ Path ( "{subjectId}//grades" ) @ Consumes ( { MediaType . APPLICATION_JSON , MediaType . APPLICATION_XML } ) public Response addGrade ( @ PathParam ( "subjectId" ) int subjectId , @ NotNull @ Valid Grade grade ) { } @ PUT @ Consumes ( { MediaType . APPLICATION_JSON , MediaType . APPLICATION_XML } ) public Response editSubject ( Subject subject ) { } @ PUT @ Path ( "{subjectId}//grades" ) @ Consumes ( { MediaType . APPLICATION_JSON , MediaType . APPLICATION_XML } ) public Response editGrade ( @ PathParam ( "subjectId" ) int subjectId , Grade grade ) { } @ DELETE @ Path ( "{subjectId}" ) public Response deleteSubject ( @ PathParam ( "subjectId" ) int subjectId ) { } @ DELETE @ Path ( "{subjectId}//grades//{studentId}" ) public Response deleteGrade ( @ PathParam ( "subjectId" ) int subjectId , @ PathParam ( "studentId" ) int studentId ) { } public int getAvailableSubjectId ( ) { } private boolean compareGrade ( double grade , double searchedGrade , int compare ) { } }

Fix:
if ( ( result . size ( ) ) > 0 )
Buggy code:
public class CarolDefaultValues { public static String CAROL_PREFIX = "carol" ; public static String JNDI_PREFIX = "jndi" ; public static String JVM_PREFIX = "jvm" ; public static String NS_PREFIX = "NameServiceClass" ; public static String PRO_PREFIX = "PortableRemoteObjectClass" ; public static String JNDI_FACTORY_PREFIX = "java.naming.factory.initial" ; public static String JNDI_URL_PREFIX = "java.naming.provider.url" ; public static String JNDI_PKGS_PREFIX = "java.naming.factory.url.pkgs" ; public static String URL_PREFIX = "url" ; public static String FACTORY_PREFIX = "context.factory" ; public static String START_NS_PREFIX = "start.ns" ; public static String START_NS_KEY = "carol.start.ns" ; public static String START_RMI_KEY = "carol.start.rmi" ; public static String START_JNDI_KEY = "carol.start.jndi" ; public static String DEFAULT_PROTOCOLS_KEY = "carol.protocols.default" ; public static String PROTOCOLS_KEY = "carol.protocols" ; public static String MULTI_RMI_PREFIX = "multi" ; public static String MULTI_PROD = "org.objectweb.carol.rmi.multi.MultiPRODelegate" ; public static String MULTI_JNDI = "org.objectweb.carol.jndi.spi.MultiOrbInitialContextFactory" ; public static String INTERCEPTOR_PKGS_PREFIX = "interceptor.pkgs" ; public static String INTERCEPTOR_VALUES_PREFIX = "interceptors" ; public static String PORT_NUMBER_PROPERTY = "rmi.server.port" ; public static Properties mapping = new Properties ( ) ; public static String getRMIProtocol ( String url ) { if ( url != null ) { <START_BUG> StringTokenizer st = new StringTokenizer ( url , ":" ) ; <END_BUG> String pref = st . nextToken ( ) . trim ( ) ; return CarolDefaultValues . mapping . getProperty ( pref , pref ) ; } else { return null ; } } }

Fix:
StringTokenizer st = new StringTokenizer ( url , ":////" ) ;
Buggy code:
public abstract class UMLCheckBox2 extends JCheckBox implements TargetChangedListener , MElementListener { private Object _target ; private String _propertySetName ; public UMLCheckBox2 ( String text , Action a , String propertySetName ) { } public void propertySet ( MElementEvent e ) { } public void roleAdded ( MElementEvent e ) { } public void roleRemoved ( MElementEvent e ) { } public void listRoleItemSet ( MElementEvent e ) { } public void removed ( MElementEvent e ) { } public void recovered ( MElementEvent e ) { } public Object getTarget ( ) { } public void setTarget ( Object target ) { } public abstract void buildModel ( ) { } public void targetChanged ( Object newTarget ) { <START_BUG> if ( ( ( ( _target ) != null ) && ( newTarget != null ) ) && ( newTarget . getClass ( ) . equals ( _target . getClass ( ) ) ) ) <END_BUG> setTarget ( newTarget ) ; } public void targetReasserted ( Object newTarget ) { } }

Fix:
if ( ( _target ) != newTarget )
Buggy code:
@ WebServlet ( name = "CheckIfExists" , urlPatterns = { "//CheckIfExists" } ) public class CheckIfExists extends HttpServlet { protected void processRequest ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { response . setContentType ( "text//html;charset=UTF-8" ) ; DatabaseConnection conn2 = DatabaseConnection . getConnection ( ) ; DatabaseController controller2 = new DatabaseController ( ) ; String title = request . getParameter ( "title" ) ; String author = request . getParameter ( "author" ) ; try ( PrintWriter out = response . getWriter ( ) ) { <START_BUG> out . println ( controller2 . isExistingBook ( author , title ) ) ; <END_BUG> } } @ Override protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ Override protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ Override public String getServletInfo ( ) { } }

Fix:
out . print ( controller2 . isExistingBook ( author , title ) ) ;