nus-yam/ex-repair huggingface dataset:
Buggy code:
public class SimpleSelection extends AbstractSelection { private final TextRange range ; private Position from ; private Position to ; public SimpleSelection ( Position selectionStartCaretPos , Position selectionEndCaretPos , TextRange range ) { } public SimpleSelection ( CursorService cursorService , boolean isIncusive , TextRange range ) { } public SimpleSelection ( TextRange range ) { } @ Override public String getModeName ( ) { } public ContentType getContentType ( Configuration configuration ) { } public TextRange getRegion ( EditorAdaptor editorMode , int count ) throws CommandExecutionException { } public int getCount ( ) { } public TextObject withCount ( int count ) { } public Position getEnd ( ) { } public Position getLeftBound ( ) { } public int getModelLength ( ) { } public Position getRightBound ( ) { } public Position getStart ( ) { } public int getViewLength ( ) { } public boolean isReversed ( ) { } public Position getFrom ( ) { } public Position getTo ( ) { } @ Override public Position getStartMark ( EditorAdaptor defaultEditorAdaptor ) { } @ Override public Position getEndMark ( EditorAdaptor defaultEditorAdaptor ) { } public String toString ( ) { String caretInfo = "" ; if ( ( ( ( range ) != null ) && ( ( to ) != null ) ) && ( ( range . getEnd ( ) ) != ( to ) ) ) { <START_BUG> caretInfo = ( ( ( "<seq2seq4repair_space>@<seq2seq4repair_space>M" + ( to . getModelOffset ( ) ) ) + "//" ) + ( to . getModelOffset ( ) ) ) + "V" ; <END_BUG> } return ( ( "SimpleSelection(<seq2seq4repair_space>" + ( String . valueOf ( range ) ) ) + caretInfo ) + "<seq2seq4repair_space>)" ; } @ Override public Selection doReset ( EditorAdaptor adaptor , Position from , Position to ) { } }

Fix:
caretInfo = ( ( ( "<seq2seq4repair_space>@<seq2seq4repair_space>M" + ( to . getModelOffset ( ) ) ) + "//" ) + ( to . getViewOffset ( ) ) ) + "V" ;
Buggy code:
public class RemoteServiceContainerFactory implements IContainerInstantiator { <START_BUG> public IContainer createInstance ( ContainerTypeDescription description , Class [ ] argTypes , Object [ ] args ) throws ContainerCreateException { <END_BUG> try { final ID newID = IDFactory . getDefault ( ) . createGUID ( ) ; return new RemoteServiceContainer ( new ISharedObjectContainerConfig ( ) { public Object getAdapter ( Class clazz ) { return null ; } public Map getProperties ( ) { return new HashMap ( ) ; } public ID getID ( ) { return newID ; } } ) ; } catch ( Exception e ) { throw new ContainerCreateException ( "Exception<seq2seq4repair_space>creating<seq2seq4repair_space>GenericRemoteServiceContainer" , e ) ; } } }

Fix:
public IContainer createInstance ( ContainerTypeDescription description , Object [ ] args ) throws ContainerCreateException {
Buggy code:
public class EditProfileActivity extends ActionBarActivity { @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_edit_profile ) ; getSupportActionBar ( ) . setDisplayHomeAsUpEnabled ( true ) ; if ( savedInstanceState == null ) { EditProfileFragment fragment = new EditProfileFragment ( ) ; getSupportFragmentManager ( ) . beginTransaction ( ) . add ( container , fragment ) . commit ( ) ; } ActionBar actionBar = getSupportActionBar ( ) ; <START_BUG> BitmapDrawable background = new BitmapDrawable ( BitmapFactory . decodeResource ( getResources ( ) , topbg ) ) ; <END_BUG> background . setTileModeX ( REPEAT ) ; actionBar . setBackgroundDrawable ( background ) ; actionBar . setLogo ( ic_vikler ) ; actionBar . setDisplayShowHomeEnabled ( true ) ; actionBar . setDisplayUseLogoEnabled ( true ) ; } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } No newline ; at end ; of file ; }

Fix:
BitmapDrawable background = ( ( BitmapDrawable ) ( getResources ( ) . getDrawable ( topbg ) ) ) ;
Buggy code:
public interface ModelController { <START_BUG> Cancellable execute ( ModelNode operation , ResultHandler handler ) ; <END_BUG> ModelNode execute ( ModelNode operation ) throws CancellationException , OperationFailedException { } }

Fix:
OperationResult execute ( ModelNode operation , ResultHandler handler ) ;
Buggy code:
public class UnameManager { public static final String TAG = UnameManager . class . getSimpleName ( ) ; private final Activity context ; private EditText unameText ; private Button unameButton ; public UnameManager ( Activity context ) { } public void setup ( ) { } public void setUname ( final String uname ) { Assert . assertNotNull ( uname ) ; Assert . assertTrue ( UserId . valid ( uname ) ) ; SugarTransactionHelper . doInTansaction ( new SugarTransactionHelper . Callback ( ) { @ Override public void manipulateInTransaction ( ) { PrivateKey myKey = getKey ( ) ; if ( ( myKey == null ) || ( ! ( myKey . uid . uname . equals ( uname ) ) ) ) { if ( myKey != null ) { deleteKey ( myKey ) ; } UserId uid = getUid ( uname ) ; <START_BUG> byte [ ] [ ] ps06Key = Signer . generateKey ( uname ) ; <END_BUG> new PrivateKey ( uid , ps06Key ) . save ( ) ; info ( UnameManager . TAG , ( "new<seq2seq4repair_space>uname:<seq2seq4repair_space>" + uname ) ) ; setButtonEnabled ( unameText . getText ( ) . toString ( ) ) ; } } } ) ; } private PrivateKey getKey ( ) { } private void deleteKey ( PrivateKey key ) { } private UserId getUid ( String uname ) { } private void setButtonEnabled ( String newUname ) { } }

Fix:
String ps06Key = Signer . generateKey ( uname ) ;
Buggy code:
public class JavaSampler extends AbstractSampler implements TestListener { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final long serialVersionUID = 232L ; public static final String CLASSNAME = "classname" ; public static final String ARGUMENTS = "arguments" ; private transient JavaSamplerClient javaClient = null ; private transient JavaSamplerContext context = null ; private static final Set < JavaSampler > allSamplers = new HashSet < JavaSampler > ( ) ; public JavaSampler ( ) { } public void setArguments ( Arguments args ) { } public Arguments getArguments ( ) { } private void releaseJavaClient ( ) { } public void setClassname ( String classname ) { } public String getClassname ( ) { } public SampleResult sample ( Entry entry ) { } private JavaSamplerClient createJavaClient ( ) { } private String whoAmI ( ) { } public void testStarted ( ) { } public void testStarted ( String host ) { } public void testEnded ( ) { } public void testEnded ( String host ) { } public void testIterationStart ( LoopIterationEvent event ) { } class ErrorSamplerClient extends AbstractJavaSamplerClient { public SampleResult runTest ( JavaSamplerContext p_context ) { JavaSampler . log . debug ( ( ( whoAmI ( ) ) + "\trunTest" ) ) ; Thread . yield ( ) ; SampleResult results = new SampleResult ( ) ; results . setSuccessful ( false ) ; <START_BUG> results . setResponseData ( ( "Class<seq2seq4repair_space>not<seq2seq4repair_space>found:<seq2seq4repair_space>" + ( getClassname ( ) ) ) . getBytes ( ) ) ; <END_BUG> results . setSampleLabel ( ( "ERROR:<seq2seq4repair_space>" + ( getClassname ( ) ) ) ) ; return results ; } } }

Fix:
results . setResponseData ( ( "Class<seq2seq4repair_space>not<seq2seq4repair_space>found:<seq2seq4repair_space>" + ( getClassname ( ) ) ) , null ) ;
Buggy code:
public class JNIGeneratorApp { JNIClass mainClass ; JNIClass [ ] classes ; ProgressMonitor progress ; String mainClassName ; String outputDir ; String classpath ; MetaData metaData ; static final boolean USE_AST = true ; public JNIGeneratorApp ( ) { } public String getClasspath ( ) { } public JNIClass getMainClass ( ) { } public String getMainClassName ( ) { } public MetaData getMetaData ( ) { } String getMetaDataDir ( ) { } public String getOutputDir ( ) { } public void generateAll ( ) { } void generateSTATS_C ( JNIClass [ ] classes ) { } void generateSTATS_H ( JNIClass [ ] classes ) { } void generateSTRUCTS_H ( JNIClass [ ] classes ) { } void generateSTRUCTS_C ( JNIClass [ ] classes ) { } void generateSWT_C ( JNIClass [ ] classes ) { } void generateMetaData ( JNIClass [ ] classes ) { } public void generate ( ) { } public void generate ( ProgressMonitor progress ) { } boolean compare ( InputStream is1 , InputStream is2 ) throws IOException { } void output ( byte [ ] bytes , String fileName ) throws IOException { } String getPackageName ( String className ) { } String [ ] getClassNames ( String mainClassName ) { } public JNIClass [ ] getClasses ( ) { } public JNIClass [ ] getASTClasses ( ) { if ( ( classes ) != null ) return classes ; if ( ( mainClassName ) == null ) return new JNIClass [ 0 ] ; String root = new File ( outputDir ) . getParent ( ) ; <START_BUG> String mainPath = ( ( root + "//" ) + ( mainClassName . replace ( '.' , '//' ) ) ) + ".java" ; <END_BUG> ArrayList classes = new ArrayList ( ) ; String packageName = getPackageName ( mainClassName ) ; File dir = new File ( ( ( root + "//" ) + ( packageName . replace ( '.' , '//' ) ) ) ) ; File [ ] files = dir . listFiles ( ) ; for ( int i = 0 ; i < ( files . length ) ; i ++ ) { File file = files [ i ] ; try { String path = file . getAbsolutePath ( ) . replace ( '\\' , '//' ) ; if ( path . endsWith ( ".java" ) ) { if ( mainPath . equals ( path ) ) { classes . add ( mainClass ) ; } else { classes . add ( new ASTClass ( path , metaData ) ) ; } } } catch ( Exception e ) { e . printStackTrace ( ) ; } } return ( ( JNIClass [ ] ) ( classes . toArray ( new JNIClass [ classes . size ( ) ] ) ) ) ; } public JNIClass [ ] getNativesClasses ( JNIClass [ ] classes ) { } public JNIClass [ ] getStructureClasses ( JNIClass [ ] classes ) { } public void setClasspath ( String classpath ) { } public void setMainClass ( JNIClass mainClass ) { } public void setMetaData ( MetaData data ) { } public void setClasses ( JNIClass [ ] classes ) { } public void setMainClassName ( String str ) { } public void setMainClassName ( String str , String outputDir ) { } public void setOutputDir ( String str ) { } public static String getDefaultMainClass ( ) { } public static String getDefaultPlatform ( ) { } public static void main ( String [ ] args ) { } }

Fix:
String mainPath = new File ( ( ( ( root + "//" ) + ( mainClassName . replace ( '.' , '//' ) ) ) + ".java" ) ) . getAbsolutePath ( ) ;
Buggy code:
public class BooleanArray { private static int ADDRESS_BITS = 6 ; private static int BITS = 1 << ( BooleanArray . ADDRESS_BITS ) ; private static int MASK = ( BooleanArray . BITS ) - 1 ; public final int length ; private long [ ] data ; public BooleanArray ( int size ) { } public void setTrue ( int index ) { } public void setFalse ( int index ) { } public void set ( int index , boolean value ) { } public boolean get ( int index ) { <START_BUG> return ( ( data [ ( index > > > ( BooleanArray . ADDRESS_BITS ) ) ] ) & ( 1L << ( index & ( BooleanArray . MASK ) ) ) ) > 0 ; <END_BUG> } No newline ; at end ; of file ; }

Fix:
return ( ( data [ ( index > > > ( BooleanArray . ADDRESS_BITS ) ) ] ) & ( 1L << ( index & ( BooleanArray . MASK ) ) ) ) != 0 ;
Buggy code:
public final class CalendarResultHandler extends ResultHandler { private static final DateFormat DATE_FORMAT = new SimpleDateFormat ( "yyyyMMdd" ) ; private static final DateFormat DATE_TIME_FORMAT = new SimpleDateFormat ( "yyyyMMdd'T'HHmmss" ) ; private static final int [ ] buttons = new int [ ] { string . button_add_calendar } ; public CalendarResultHandler ( Activity activity , ParsedResult result ) { } @ Override public int getButtonCount ( ) { } @ Override public int getButtonText ( int index ) { } @ Override public void handleButtonPress ( int index ) { } @ Override public CharSequence getDisplayContents ( ) { CalendarParsedResult calResult = ( ( CalendarParsedResult ) ( getResult ( ) ) ) ; <START_BUG> StringBuffer result = new StringBuffer ( ) ; <END_BUG> ParsedResult . maybeAppend ( calResult . getSummary ( ) , result ) ; CalendarResultHandler . appendTime ( calResult . getStart ( ) , result ) ; String endString = calResult . getEnd ( ) ; if ( endString == null ) { endString = calResult . getStart ( ) ; } CalendarResultHandler . appendTime ( endString , result ) ; ParsedResult . maybeAppend ( calResult . getLocation ( ) , result ) ; ParsedResult . maybeAppend ( calResult . getAttendee ( ) , result ) ; ParsedResult . maybeAppend ( calResult . getDescription ( ) , result ) ; return result . toString ( ) ; } private static void appendTime ( String when , StringBuffer result ) { } @ Override public int getDisplayTitle ( ) { } }

Fix:
StringBuffer result = new StringBuffer ( 100 ) ;
Buggy code:
public class Token { private String token ; public String getToken ( ) { } private void generateToken ( ) { } public boolean isWork ( String token ) { boolean flag = false ; <START_BUG> List < FileModel > files = dao . find ( ( "select<seq2seq4repair_space>count(*)<seq2seq4repair_space>as<seq2seq4repair_space>res<seq2seq4repair_space>from<seq2seq4repair_space>file<seq2seq4repair_space>where<seq2seq4repair_space>token<seq2seq4repair_space>=<seq2seq4repair_space>" + token ) ) ; <END_BUG> Number num = files . get ( 0 ) . get ( "res" ) ; if ( ( num . intValue ( ) ) == 0 ) { flag = true ; } return flag ; } }

Fix:
List < FileModel > files = dao . find ( "select<seq2seq4repair_space>count(*)<seq2seq4repair_space>as<seq2seq4repair_space>res<seq2seq4repair_space>from<seq2seq4repair_space>file<seq2seq4repair_space>where<seq2seq4repair_space>token<seq2seq4repair_space>=<seq2seq4repair_space>?" , token ) ;
Buggy code:
public class BookmarkablePageRequestTarget implements IBookmarkablePageRequestTarget , IAccessCheck { private Page page ; private final Class pageClass ; private final String pageMapName ; private final PageParameters pageParameters ; public BookmarkablePageRequestTarget ( Class pageClass ) { } public BookmarkablePageRequestTarget ( Class pageClass , PageParameters pageParameters ) { } public BookmarkablePageRequestTarget ( String pageMapName , Class pageClass ) { } public BookmarkablePageRequestTarget ( String pageMapName , Class pageClass , PageParameters pageParameters ) { } public boolean checkAccess ( RequestCycle requestCycle ) { } public void cleanUp ( RequestCycle requestCycle ) { } public boolean equals ( Object obj ) { } public final Class getPageClass ( ) { } public final String getPageMapName ( ) { } public final PageParameters getPageParameters ( ) { } public int hashCode ( ) { } public void respond ( RequestCycle requestCycle ) { } public Object getLock ( RequestCycle requestCycle ) { } public String toString ( ) { } protected Page newPage ( Class pageClass , RequestCycle requestCycle ) { PageParameters params = pageParameters ; <START_BUG> IPageFactory pageFactory = requestCycle . getApplication ( ) . getSettings ( ) . getDefaultPageFactory ( ) ; <END_BUG> return pageFactory . newPage ( pageClass , params ) ; } private final Page getPage ( RequestCycle requestCycle ) { } }

Fix:
IPageFactory pageFactory = requestCycle . getApplication ( ) . getSettings ( ) . getPageFactory ( ) ;
Buggy code:
public class ScreenshotFactory { private static int counter = 1 ; private static String directory = "screenshots//" ; public static void saveScreenshot ( ) { try { FileHandle fh ; do { fh = new FileHandle ( ( ( ( ( ScreenshotFactory . directory ) + "screenshot" ) + ( ( ScreenshotFactory . counter ) ++ ) ) + ".png" ) ) ; } while ( fh . exists ( ) ) ; <START_BUG> Pixmap pixmap = ScreenshotFactory . getScreenshot ( 0 , 0 , graphics . getWidth ( ) , graphics . getHeight ( ) , false ) ; <END_BUG> PixmapIO . writePNG ( fh , pixmap ) ; pixmap . dispose ( ) ; } catch ( Exception e ) { } } private static Pixmap getScreenshot ( int x , int y , int w , int h , boolean yDown ) { } }

Fix:
Pixmap pixmap = ScreenshotFactory . getScreenshot ( 0 , 0 , graphics . getWidth ( ) , graphics . getHeight ( ) , true ) ;
Buggy code:
public final class NativeUtils { private static final Logger LOGGER = Logger . getLogger ( NativeUtils . class ) ; private NativeUtils ( ) { } public static Integer getPIDorNull ( ) { } public static void kill ( int pid ) { } public static void execute ( String command ) { } private static Integer getPidFromManagementBean ( ) { String name = ManagementFactory . getRuntimeMXBean ( ) . getName ( ) ; <START_BUG> int indexOf = name . indexOf ( "@" ) ; <END_BUG> if ( indexOf == ( - 1 ) ) { return null ; } String pidString = name . substring ( 0 , indexOf ) ; try { return Integer . parseInt ( pidString ) ; } catch ( NumberFormatException e ) { NativeUtils . LOGGER . warn ( e ) ; return null ; } } private static Integer getPidViaReflection ( ) { } public static class BashStreamGobbler extends Thread { private final BufferedReader reader ; private final StringBuffer stringBuffer ; public BashStreamGobbler ( InputStream in , StringBuffer stringBuffer ) { } @ Override public void run ( ) { } } }

Fix:
int indexOf = name . indexOf ( '@' ) ;
Buggy code:
public class ArrayObsList < E > implements ObserverList < E > { protected static final int BUFFER_CAPACITY_INITIAL = 5 ; protected static final int BUFFER_CAPACITY_INCREMENT = 5 ; protected static final double BUFFER_CAPACITY_FACOTR = 1 ; private Object [ ] arr = null ; private long [ ] modTimeStamp = null ; private int size = 0 ; private int lastAdd = - 1 ; private long modCount = Long . MIN_VALUE ; private int msgCount = 0 ; public void add ( E obs ) { } private void add ( int index , E obs ) { } private void incrementModCount ( ) { } public void remove ( E obs ) { } private void remove ( int index ) { } public int getSize ( ) { } private void resize ( ) { } @ SuppressWarnings ( "unchecked" ) public void sendNotify ( Message < E > msg ) { } public Iterator < E > iterator ( ) { } private static class ArrayObsListIterator < E > implements Iterator < E > { private final ArrayObsList < E > obsList ; private final Object [ ] arr ; private final long [ ] modTimeStamp ; private final long timeStamp ; private int pos ; public ArrayObsListIterator ( ArrayObsList < E > list ) { } public boolean hasNext ( ) { } @ SuppressWarnings ( "unchecked" ) public E next ( ) { if ( ! ( hasNext ( ) ) ) { throw new NoSuchElementException ( ) ; } <START_BUG> E next = ( ( E ) ( arr [ pos ] ) ) ; <END_BUG> if ( ! ( hasNext ( ) ) ) { ( obsList . msgCount ) -- ; } return next ; } } No newline ; at end ; of file ; }

Fix:
E next = ( ( E ) ( arr [ ( ( pos ) ++ ) ] ) ) ;
Buggy code:
public class TestCompressingStoredFieldsFormat extends LuceneTestCase { private Directory dir ; IndexWriterConfig iwConf ; private RandomIndexWriter iw ; public void setUp ( ) throws Exception { } public void tearDown ( ) throws Exception { } private byte [ ] randomByteArray ( int length , int max ) { } public void testWriteReadMerge ( ) throws IOException { } public void testReadSkip ( ) throws IOException { } public void testEmptyDocs ( ) throws IOException { } public void testConcurrentReads ( ) throws Exception { } @ Nightly public void testBigDocuments ( ) throws IOException { if ( ( dir ) instanceof MockDirectoryWrapper ) { ( ( MockDirectoryWrapper ) ( dir ) ) . setThrottling ( NEVER ) ; } final Document emptyDoc = new Document ( ) ; final Document bigDoc1 = new Document ( ) ; final Document bigDoc2 = new Document ( ) ; final Field idField = new StringField ( "id" , "" , Store . NO ) ; emptyDoc . add ( idField ) ; bigDoc1 . add ( idField ) ; bigDoc2 . add ( idField ) ; final FieldType onlyStored = new FieldType ( StringField . TYPE_STORED ) ; onlyStored . setIndexed ( false ) ; final Field smallField = new Field ( "fld" , randomByteArray ( random ( ) . nextInt ( 10 ) , 256 ) , onlyStored ) ; <START_BUG> final int numFields = atLeast ( 1000000 ) ; <END_BUG> for ( int i = 0 ; i < numFields ; ++ i ) { bigDoc1 . add ( smallField ) ; } final Field bigField = new Field ( "fld" , randomByteArray ( RandomInts . randomIntBetween ( random ( ) , 1000000 , 5000000 ) , 2 ) , onlyStored ) ; bigDoc2 . add ( bigField ) ; final int numDocs = atLeast ( 5 ) ; final Document [ ] docs = new Document [ numDocs ] ; for ( int i = 0 ; i < numDocs ; ++ i ) { docs [ i ] = RandomPicks . randomFrom ( random ( ) , Arrays . asList ( emptyDoc , bigDoc1 , bigDoc2 ) ) ; } for ( int i = 0 ; i < numDocs ; ++ i ) { idField . setStringValue ( ( "" + i ) ) ; iw . addDocument ( docs [ i ] ) ; if ( ( random ( ) . nextInt ( numDocs ) ) == 0 ) { iw . commit ( ) ; } } iw . commit ( ) ; iw . forceMerge ( 1 ) ; final DirectoryReader rd = DirectoryReader . open ( dir ) ; final IndexSearcher searcher = new IndexSearcher ( rd ) ; for ( int i = 0 ; i < numDocs ; ++ i ) { final Query query = new org . apache . lucene . search . TermQuery ( new Term ( "id" , ( "" + i ) ) ) ; final TopDocs topDocs = searcher . search ( query , 1 ) ; assertEquals ( ( "" + i ) , 1 , topDocs . totalHits ) ; final StoredDocument doc = rd . document ( topDocs . scoreDocs [ 0 ] . doc ) ; assertNotNull ( doc ) ; final StorableField [ ] fieldValues = doc . getFields ( "fld" ) ; assertEquals ( docs [ i ] . getFields ( "fld" ) . length , fieldValues . length ) ; if ( ( fieldValues . length ) > 0 ) { assertEquals ( docs [ i ] . getFields ( "fld" ) [ 0 ] . binaryValue ( ) , fieldValues [ 0 ] . binaryValue ( ) ) ; } } rd . close ( ) ; } }

Fix:
final int numFields = RandomInts . randomIntBetween ( random ( ) , 500000 , 1000000 ) ;
Buggy code:
public abstract class JsonMeasurementCollector implements MeasurementCollector { private ExerciseData exerciseData = null ; private Vector accelerometer = null ; private Vector gyroscope = null ; @ Override public void startCollecting ( String exerciseName ) throws MeasurementException { accelerometer = null ; gyroscope = null ; <START_BUG> exerciseData = new ExerciseData ( "Exercise<seq2seq4repair_space>Data" ) ; <END_BUG> } @ Override public void stopCollecting ( double time ) throws MeasurementException { } @ Override public void collectMeasurement ( Sensor sensor , double time , float [ ] values , int accuracy , double interval ) throws MeasurementException { } public abstract void collectionComplete ( ExerciseData data ) { } }

Fix:
exerciseData = new ExerciseData ( exerciseName ) ;
Buggy code:
public class AttributeGroup extends org . tigris . scarab . om . BaseAttributeGroup implements Persistent { public static final String GET_ATTRIBUTES = "getAttributes" ; private static final String GET_R_ATTRIBUTE_ATTRGROUP = "getRAttributeAttributeGroup" ; public boolean isGlobal ( ) throws TorqueException { } public ScarabModule getScarabModule ( ) { } public void setScarabModule ( ScarabModule module ) { } public void setModule ( Module me ) throws TorqueException { } public Module getModule ( ) throws TorqueException { Module module = null ; <START_BUG> ObjectKey id = getPrimaryKey ( ) ; <END_BUG> if ( id != null ) { module = ModuleManager . getInstance ( id ) ; } return module ; } private static MethodResultCache getMethodResult ( ) { } public boolean hasAnyOptionAttributes ( ) throws Exception { } public List getAttributes ( ) throws Exception { } public int getHighestOrderedAttribute ( ) throws Exception { } public RAttributeAttributeGroup getRAttributeAttributeGroup ( Attribute attribute ) throws Exception { } public void delete ( ScarabUser user , Module module ) throws Exception { } public void addAttribute ( Attribute attribute ) throws Exception { } public void deleteAttribute ( Attribute attribute , ScarabUser user , Module module ) throws Exception { } private RAttributeAttributeGroup addRAttributeAttributeGroup ( Attribute attribute ) throws Exception { } public AttributeGroup copyGroup ( ) throws Exception { } }

Fix:
Integer id = getModuleId ( ) ;
Buggy code:
public class FolderTreeCellRenderer extends DefaultTreeCellRenderer { private static Icon expandedFolderIcon ; private static Icon collapsedFolderIcon ; private static Icon virtualFolderIcon ; private static Icon localRootFolderIcon ; private static Icon imapRootFolderIcon ; private static Icon inboxIcon ; private static Icon outboxIcon ; private static Icon trashIcon ; private Font plainFont ; private Font boldFont ; private Font italicFont ; public FolderTreeCellRenderer ( ) { } public Component getTreeCellRendererComponent ( JTree tree , Object value , boolean isSelected , boolean expanded , boolean leaf , int row , boolean hasFocusVar ) { } private String createLabelText ( MailboxInfo info , IFolderItem item ) { String name = item . getString ( "property" , "name" ) ; boolean selectable = ( item . getBooleanWithDefault ( "selectable" , true ) ) == false ; StringBuffer buf ; buf = new StringBuffer ( "<html><body>" ) ; if ( selectable ) <START_BUG> buf . append ( "<i><font<seq2seq4repair_space>color='lightgray'>" ) ; <END_BUG> if ( ( info . getUnseen ( ) ) > 0 ) { buf . append ( "<b>" ) ; name = ( ( name + "<seq2seq4repair_space>(" ) + ( info . getUnseen ( ) ) ) + ")" ; buf . append ( name ) ; buf . append ( "<//b>" ) ; } else buf . append ( name ) ; if ( selectable ) buf . append ( "<//i>" ) ; if ( ( info . getRecent ( ) ) > 0 ) { buf . append ( "<font<seq2seq4repair_space>color='blue'><seq2seq4repair_space>(" ) ; buf . append ( info . getRecent ( ) ) ; buf . append ( ")" ) ; } buf . append ( "<//body><//html>" ) ; return buf . toString ( ) ; } private String createTooltipText ( MailboxInfo info ) { } public static Icon getFolderIcon ( IMailFolder node , boolean expanded ) { } }

Fix:
buf . append ( "<i><font<seq2seq4repair_space>color='#333333'>" ) ;
Buggy code:
public class ShopService { private final CustomerRepository cR ; private final ProductRepository pR ; private final OrderRepository oR ; private final AtomicInteger productIDGenerator ; private final AtomicInteger orderIDGenerator ; public ShopService ( CustomerRepository cR , ProductRepository pR , OrderRepository oR ) { } public void addProduct ( ProductParameters product ) { } public void addProductToCustomer ( int productId , String customerUsername ) { } public void addProductToCustomer ( int productId , String customerUsername , int amount ) { } public Product getProductWithId ( int productId ) { } public HashMap < Integer , Product > getProducts ( ) { } public void removeProduct ( int productId ) { try { for ( Customer c : cR . getCustomers ( ) . values ( ) ) { <START_BUG> c . removeAllProductsWithIdFromShoppingCart ( productId ) ; <END_BUG> } pR . removeProduct ( productId ) ; } catch ( RepositoryException | ModelException e ) { throw new ShopServiceException ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>remove<seq2seq4repair_space>product." , e ) ; } } public void updateProduct ( int productId , Product product ) { } public void addCustomer ( Customer customer ) { } public Customer getCustomer ( String customerUsername ) { } public void updateCustomer ( Customer customer ) { } public void removeCustomer ( String customerUsername ) { } public void createOrder ( String customerUsername ) { } public Order getOrder ( int orderId ) { } public HashMap < Integer , Order > getOrders ( ) { } private int getNextProductId ( ) { } private int getNextOrderId ( ) { } No newline ; at end ; of file ; }

Fix:
c . removeProductsWithIdFromShoppingCart ( productId ) ;
Buggy code:
public class ArticleSpecificationFactory { public static ArticleSpecification getFindArticleAllSpecification ( Article article ) { } public static ArticleSpecification getFindArticleByCategorySpecification ( Article article ) { } public static ArticleSpecification getFindArticleByFilterSpecification ( Article article ) { } <START_BUG> public static ArticleSpecification getFindArticleByIdSpecification ( Article article ) { <END_BUG> return new FindArticleByIdSpecification ( article ) ; } public static ArticleSpecification getFindArticleBySearchSpecification ( Article article ) { } public static ArticleSpecification getDeleteArticleAllSpecification ( Article article ) { } public static ArticleSpecification getDeleteArticleByCategorySpecification ( Article article ) { } }

Fix:
public static FindArticleByIdSpecification getFindArticleByIdSpecification ( Article article ) {
Buggy code:
public class RecoveredMethod extends RecoveredElement implements BaseTypes , CompilerModifiers , TerminalTokens { public AbstractMethodDeclaration methodDeclaration ; public RecoveredType [ ] localTypes ; public int localTypeCount ; public RecoveredBlock methodBody ; public boolean discardBody = true ; public RecoveredMethod ( AbstractMethodDeclaration methodDeclaration , RecoveredElement parent , int bracketBalance , Parser parser ) { } public RecoveredElement add ( Block nestedBlockDeclaration , int bracketBalanceValue ) { } public RecoveredElement add ( FieldDeclaration fieldDeclaration , int bracketBalanceValue ) { } public RecoveredElement add ( LocalDeclaration localDeclaration , int bracketBalanceValue ) { } public RecoveredElement add ( Statement statement , int bracketBalanceValue ) { } public RecoveredElement add ( TypeDeclaration typeDeclaration , int bracketBalanceValue ) { } public boolean bodyStartsAtHeaderEnd ( ) { } public AstNode parseTree ( ) { } public int sourceEnd ( ) { } public String toString ( int tab ) { StringBuffer result = new StringBuffer ( tabString ( tab ) ) ; result . append ( "Recovered<seq2seq4repair_space>method:\n" ) ; <START_BUG> result . append ( this . methodDeclaration . toString ( ( tab + 1 ) ) ) ; <END_BUG> if ( ( this . localTypes ) != null ) { for ( int i = 0 ; i < ( this . localTypeCount ) ; i ++ ) { result . append ( "\n" ) ; result . append ( this . localTypes [ i ] . toString ( ( tab + 1 ) ) ) ; } } if ( ( this . methodBody ) != null ) { result . append ( "\n" ) ; result . append ( this . methodBody . toString ( ( tab + 1 ) ) ) ; } return result . toString ( ) ; } public void updateBodyStart ( int bodyStart ) { } public AbstractMethodDeclaration updatedMethodDeclaration ( ) { } public void updateFromParserState ( ) { } public RecoveredElement updateOnOpeningBrace ( int braceEnd ) { } public void updateParseTree ( ) { } public void updateSourceEndIfNecessary ( int sourceEnd ) { } }

Fix:
result . append ( this . methodDeclaration . print ( ( tab + 1 ) , result ) ) ;
Buggy code:
public class CommandLineArgumentUsageImpl extends CommandLineArgumentUsage { public static void init ( ) { addArguments ( ADMIN_ONLY ) ; instructions . add ( ServerMessages . MESSAGES . argAdminOnly ( ) ) ; addArguments ( ( ( CommandLineConstants . PUBLIC_BIND_ADDRESS ) + "<seq2seq4repair_space><value>" ) , ( ( CommandLineConstants . PUBLIC_BIND_ADDRESS ) + "=<value>" ) ) ; instructions . add ( ServerMessages . MESSAGES . argPublicBindAddress ( ) ) ; addArguments ( ( ( CommandLineConstants . PUBLIC_BIND_ADDRESS ) + "<interface>=<value>" ) ) ; instructions . add ( ServerMessages . MESSAGES . argInterfaceBindAddress ( ) ) ; addArguments ( ( ( CommandLineConstants . SHORT_SERVER_CONFIG ) + "<seq2seq4repair_space><config>" ) , ( ( CommandLineConstants . SHORT_SERVER_CONFIG ) + "=<config>" ) ) ; <START_BUG> instructions . add ( ServerMessages . MESSAGES . argServerConfig ( ) ) ; <END_BUG> addArguments ( ( ( CommandLineConstants . SYS_PROP ) + "<name>[=<value>]" ) ) ; instructions . add ( ServerMessages . MESSAGES . argSystem ( ) ) ; addArguments ( SHORT_HELP , HELP ) ; instructions . add ( ServerMessages . MESSAGES . argHelp ( ) ) ; addArguments ( ( ( CommandLineConstants . READ_ONLY_SERVER_CONFIG ) + "=<config>" ) ) ; instructions . add ( ServerMessages . MESSAGES . argReadOnlyServerConfig ( ) ) ; addArguments ( ( ( CommandLineConstants . SHORT_PROPERTIES ) + "<seq2seq4repair_space><url>" ) , ( ( CommandLineConstants . SHORT_PROPERTIES ) + "=<url>" ) , ( ( CommandLineConstants . PROPERTIES ) + "=<url>" ) ) ; instructions . add ( ServerMessages . MESSAGES . argProperties ( ) ) ; addArguments ( ( ( CommandLineConstants . SECURITY_PROP ) + "<name>[=<value>]" ) ) ; instructions . add ( ServerMessages . MESSAGES . argSecurityProperty ( ) ) ; addArguments ( ( ( CommandLineConstants . SERVER_CONFIG ) + "=<config>" ) ) ; instructions . add ( ServerMessages . MESSAGES . argServerConfig ( ) ) ; addArguments ( ( ( CommandLineConstants . DEFAULT_MULTICAST_ADDRESS ) + "<seq2seq4repair_space><value>" ) , ( ( CommandLineConstants . DEFAULT_MULTICAST_ADDRESS ) + "=<value>" ) ) ; instructions . add ( ServerMessages . MESSAGES . argDefaultMulticastAddress ( ) ) ; addArguments ( SHORT_VERSION , OLD_SHORT_VERSION , VERSION ) ; instructions . add ( ServerMessages . MESSAGES . argVersion ( ) ) ; } public static void printUsage ( final PrintStream out ) { } }

Fix:
instructions . add ( ServerMessages . MESSAGES . argShortServerConfig ( ) ) ;
Buggy code:
public class BoundEvent implements Comparable < BoundEvent > { private final String eventName ; private final String id ; private final String priority ; private final Map < String , Construct > prefilter ; private final String eventObjName ; private final Env env ; private final GenericTreeNode < Construct > tree ; private final Type driver ; private static int EventID = 0 ; private static int GetUniqueID ( ) { } public enum Priority { LOWEST ( 5 ) , LOW ( 4 ) , NORMAL ( 3 ) , HIGH ( 2 ) , HIGHEST ( 1 ) , MONITOR ( 1000 ) ; private final int id ; private Priority ( int i ) { } public int getId ( ) { } } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } public BoundEvent ( String name , CArray options , CArray prefilter , String eventObjName , Env env , GenericTreeNode < Construct > tree ) throws EventException { } public String getEventName ( ) { } public String getEventObjName ( ) { } public Type getDriver ( ) { } public String getId ( ) { } public Map < String , Construct > getPrefilter ( ) { } public BoundEvent . Priority getPriority ( ) { } public Env getEnv ( ) { } public int compareTo ( BoundEvent o ) { } public void trigger ( Object originalEvent , Map < String , Construct > event ) throws EventException { } public void manual_trigger ( CArray event ) throws EventException { } private void execute ( ) throws EventException { GenericTreeNode < Construct > superRoot = new GenericTreeNode < Construct > ( null ) ; superRoot . addChild ( tree ) ; <START_BUG> Script s = Script . GenerateScript ( superRoot , env ) ; <END_BUG> Event myDriver = EventList . getEvent ( this . getDriver ( ) , this . getEventName ( ) ) ; myDriver . execute ( s , this ) ; } public class ActiveEvent { private Object underlyingEvent ; private Map < String , Construct > parsedEvent ; private BoundEvent boundEvent ; private boolean cancelled ; public ActiveEvent ( Object underlyingEvent , Map < String , Construct > parsedEvent , BoundEvent boundEvent ) { } public Map < String , Construct > getParsedEvent ( ) { } public Object getUnderlyingEvent ( ) { } public BoundEvent getBoundEvent ( ) { } public boolean isCancelled ( ) { } public void setCancelled ( boolean cancelled ) { } } }

Fix:
Script s = Script . GenerateScript ( superRoot , env . GetLabel ( ) ) ;
Buggy code:
public class Clear implements Command { private static transient Logger log = LoggingManager . getLoggerForClass ( ) ; public static final String CLEAR = "action.clear" ; public static final String CLEAR_ALL = "action.clear_all" ; private static Set commands = new HashSet ( ) ; public Clear ( ) { } public Set getActionNames ( ) { } public void doAction ( ActionEvent e ) { GuiPackage guiPackage = GuiPackage . getInstance ( ) ; if ( e . getActionCommand ( ) . equals ( Clear . CLEAR ) ) { JMeterGUIComponent model = guiPackage . getCurrentGui ( ) ; try { ( ( Clearable ) ( model ) ) . clear ( ) ; } catch ( Throwable ex ) { Clear . log . error ( "" , ex ) ; } } else { Iterator iter = guiPackage . getTreeModel ( ) . getNodesOfType ( Clearable . class ) . iterator ( ) ; while ( iter . hasNext ( ) ) { try { <START_BUG> Clearable item = ( ( Clearable ) ( guiPackage . getGui ( ( ( org . apache . jmeter . gui . tree . JMeterTreeNode ) ( iter . next ( ) ) ) . createTestElement ( ) ) ) ) ; <END_BUG> item . clear ( ) ; } catch ( Exception ex ) { Clear . log . error ( "" , ex ) ; } } } } }

Fix:
Clearable item = ( ( Clearable ) ( guiPackage . getGui ( ( ( org . apache . jmeter . gui . tree . JMeterTreeNode ) ( iter . next ( ) ) ) . getTestElement ( ) ) ) ) ;
Buggy code:
public class PublisherSampler extends BaseJMSSampler implements TestListener { private static final long serialVersionUID = 233L ; private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final String INPUT_FILE = "jms.input_file" ; private static final String RANDOM_PATH = "jms.random_path" ; private static final String TEXT_MSG = "jms.text_message" ; private static final String CONFIG_CHOICE = "jms.config_choice" ; private static final String MESSAGE_CHOICE = "jms.config_msg_type" ; private transient Publisher PUB = null ; private StringBuffer BUFFER = new StringBuffer ( ) ; private static final FileServer FSERVER = FileServer . getFileServer ( ) ; private String file_contents = null ; public PublisherSampler ( ) { } public void testStarted ( String test ) { } public void testEnded ( String test ) { } public void testEnded ( ) { } public void testStarted ( ) { } public void testIterationStart ( LoopIterationEvent event ) { } public synchronized void initClient ( ) { <START_BUG> this . PUB = new Publisher ( this . getUseJNDIPropertiesAsBoolean ( ) , this . getJNDIInitialContextFactory ( ) , this . getProviderUrl ( ) , this . getConnectionFactory ( ) , this . getTopic ( ) , this . getUseAuth ( ) , this . getUsername ( ) , this . getPassword ( ) ) ; <END_BUG> ClientPool . addClient ( this . PUB ) ; PublisherSampler . log . info ( "PublisherSampler.initClient<seq2seq4repair_space>called" ) ; } public SampleResult sample ( Entry e ) { } public SampleResult sample ( ) { } public String getMessageContent ( ) { } public String getFileContent ( String path ) { } public void setConfigChoice ( String choice ) { } public String getConfigChoice ( ) { } public void setMessageChoice ( String choice ) { } public String getMessageChoice ( ) { } public void setInputFile ( String file ) { } public String getInputFile ( ) { } public void setRandomPath ( String path ) { } public String getRandomPath ( ) { } public void setTextMessage ( String message ) { } public String getTextMessage ( ) { } }

Fix:
this . PUB = new Publisher ( this . getUseJNDIPropertiesAsBoolean ( ) , this . getJNDIInitialContextFactory ( ) , this . getProviderUrl ( ) , this . getConnectionFactory ( ) , this . getTopic ( ) , this . isUseAuth ( ) , this . getUsername ( ) , this . getPassword ( ) ) ;
Buggy code:
public class ExecutionWindows2 extends AbstractCatalogBulkResources < ExecutionWindowRestRep > implements TenantResources < ExecutionWindowRestRep > { public ExecutionWindows2 ( ViPRCatalogClient2 parent , RestClient client ) { } @ Override public List < NamedRelatedResourceRep > listByUserTenant ( ) { } @ Override public List < ExecutionWindowRestRep > getByUserTenant ( ) { } @ Override public List < ExecutionWindowRestRep > getByUserTenant ( ResourceFilter < ExecutionWindowRestRep > filter ) { } @ Override public List < NamedRelatedResourceRep > listByTenant ( URI tenantId ) { } @ Override public List < ExecutionWindowRestRep > getByTenant ( URI tenantId ) { } @ Override public List < ExecutionWindowRestRep > getByTenant ( URI tenantId , ResourceFilter < ExecutionWindowRestRep > filter ) { } @ Override protected List < ExecutionWindowRestRep > getBulkResources ( BulkIdParam input ) { } public ExecutionWindowRestRep create ( ExecutionWindowCreateParam input ) { } public ExecutionWindowRestRep update ( URI id , ExecutionWindowUpdateParam input ) { } public void deactivate ( URI id ) { } public List < NamedRelatedResourceRep > getCatalogServices ( URI executionWindowId ) { <START_BUG> CatalogServiceList response = client . get ( CatalogServiceList . class , CATALOG_SUB_SERVICES_URL , executionWindowId ) ; <END_BUG> return defaultList ( response . getCatalogServices ( ) ) ; } }

Fix:
CatalogServiceList response = client . get ( CatalogServiceList . class , EXECUTION_WINDOWS2_SERVICE_URL , executionWindowId ) ;
Buggy code:
public class CompressTest { public static void main ( String [ ] args ) throws Exception { <START_BUG> CompressService compressor = Compressors . newDictLZW ( "LaserTower.bmp" ) ; <END_BUG> compressor . compress ( ) ; compressor . decompress ( ) ; return ; } }

Fix:
CompressService compressor = Compressors . newArithCoder ( "LaserTower.bmp" ) ;
Buggy code:
public class RemoveAnnotationFromMethodParameterTest extends AbstractAnnotationTest { @ Override public String getPackageName ( ) { } @ Override public String getClassName ( ) { } @ Override public String getClassContents ( ) { } @ Override public Annotation getAnnotation ( ) { } public void testRemoveAnnotationFromMethodParameter ( ) { try { assertNotNull ( annotation ) ; assertEquals ( WebParam . class . getSimpleName ( ) , AnnotationUtils . getAnnotationName ( annotation ) ) ; IMethod method = source . findPrimaryType ( ) . getMethod ( "add" , new String [ ] { "I" , "I" } ) ; assertNotNull ( method ) ; ILocalVariable localVariable = AnnotationUtils . getLocalVariable ( method , "i" ) ; assertTrue ( AnnotationUtils . isAnnotationPresent ( localVariable , annotation ) ) ; assertNotNull ( source . getImport ( WebParam . class . getCanonicalName ( ) ) ) ; textFileChange . addEdit ( AnnotationUtils . createRemoveAnnotationTextEdit ( localVariable , annotation ) ) ; <START_BUG> textFileChange . addEdit ( AnnotationUtils . createRemoveImportTextEdit ( localVariable , WebParam . class ) ) ; <END_BUG> assertTrue ( executeChange ( new NullProgressMonitor ( ) , textFileChange ) ) ; assertFalse ( AnnotationUtils . isAnnotationPresent ( localVariable , annotation ) ) ; assertFalse ( source . getImport ( WebParam . class . getCanonicalName ( ) ) . exists ( ) ) ; } catch ( CoreException ce ) { fail ( ce . getLocalizedMessage ( ) ) ; } } }

Fix:
textFileChange . addEdit ( AnnotationUtils . createRemoveImportTextEdit ( localVariable , WebParam . class . getCanonicalName ( ) ) ) ;
Buggy code:
public class StandardEvaluationContext implements EvaluationContext { private TypedValue rootObject ; private List < ConstructorResolver > constructorResolvers ; private List < MethodResolver > methodResolvers ; private List < PropertyAccessor > propertyAccessors ; private TypeLocator typeLocator ; private TypeConverter typeConverter ; private TypeComparator typeComparator = new StandardTypeComparator ( ) ; private OperatorOverloader operatorOverloader = new StandardOperatorOverloader ( ) ; private final Map < String , Object > variables = new HashMap < String , Object > ( ) ; public StandardEvaluationContext ( ) { } public StandardEvaluationContext ( Object rootObject ) { } public void setRootObject ( Object rootObject ) { if ( ( this . rootObject ) == null ) { <START_BUG> this . rootObject = TypedValue . NULL_TYPED_VALUE ; <END_BUG> } else { this . rootObject = new TypedValue ( rootObject ) ; } } public void setRootObject ( Object rootObject , TypeDescriptor typeDescriptor ) { } public TypedValue getRootObject ( ) { } public void addConstructorResolver ( ConstructorResolver resolver ) { } public List < ConstructorResolver > getConstructorResolvers ( ) { } private void ensureConstructorResolversInitialized ( ) { } public void addMethodResolver ( MethodResolver resolver ) { } public List < MethodResolver > getMethodResolvers ( ) { } private void ensureMethodResolversInitialized ( ) { } public void addPropertyAccessor ( PropertyAccessor accessor ) { } public List < PropertyAccessor > getPropertyAccessors ( ) { } private void ensurePropertyAccessorsInitialized ( ) { } public void setTypeLocator ( TypeLocator typeLocator ) { } public TypeLocator getTypeLocator ( ) { } public void setTypeConverter ( TypeConverter typeConverter ) { } public TypeConverter getTypeConverter ( ) { } public void setTypeComparator ( TypeComparator typeComparator ) { } public TypeComparator getTypeComparator ( ) { } public void setOperatorOverloader ( OperatorOverloader operatorOverloader ) { } public OperatorOverloader getOperatorOverloader ( ) { } public void setVariable ( String name , Object value ) { } public void setVariables ( Map < String , Object > variables ) { } public void registerFunction ( String name , Method method ) { } public Object lookupVariable ( String name ) { } }

Fix:
this . rootObject = TypedValue . NULL ;
Buggy code:
public class AchievementManager { public static HashMap < String , HashSet < String > > playerHasCache = new HashMap < String , HashSet < String > > ( ) ; public static HashMap < Achievement , HashSet < String > > playerCheckCache = new HashMap < Achievement , HashSet < String > > ( ) ; public static IDataSource database = null ; private static List < Achievement > achievements = new LinkedList < Achievement > ( ) ; public static void loadAchievements ( ) { } public static void clearAchievements ( ) { } public static List < Achievement > getAchievementsList ( ) { } public static Achievement getAchievement ( String name ) { } public static void addAchievement ( Achievement ach ) { } public static void loadPlayersAchievements ( String player ) { } private static void buildPlayerCheckCache ( String player ) { } public static void checkPlayers ( ) { } public static List < Achievement > getAchievements ( String player ) { } public static Achievement getAchievement ( int i ) { <START_BUG> if ( ( i > 0 ) && ( i < ( AchievementManager . achievements . size ( ) ) ) ) { <END_BUG> return AchievementManager . achievements . get ( ( i - 1 ) ) ; } return null ; } }

Fix:
if ( ( i > 0 ) && ( i <= ( AchievementManager . achievements . size ( ) ) ) ) {
Buggy code:
@ Entity @ Table ( name = "user_roles" , uniqueConstraints = @ UniqueConstraint ( columnNames = { "role" , "username" } ) ) public class UserRole { private Integer userRoleId ; private User user ; private String role ; public UserRole ( ) { } public UserRole ( User user , String role ) { } @ Id @ GeneratedValue ( strategy = IDENTITY ) <START_BUG> @ Column ( name = "user_roleid" , unique = true , nullable = false ) <END_BUG> public Integer getUserRoleId ( ) { return this . userRoleId ; } public void setUserRoleId ( Integer userRoleId ) { } @ ManyToOne ( fetch = FetchType . LAZY ) @ JoinColumn ( name = "username" , nullable = false ) public User getUser ( ) { } public void setUser ( User user ) { } @ Column ( name = "role" , nullable = false , length = 45 ) public String getRole ( ) { } public void setRole ( String role ) { } No newline ; at end ; of file ; }

Fix:
@ Column ( name = "user_role_id" , unique = true , nullable = false )
Buggy code:
public class ShowPartPaneMenuAction extends PartEventAction implements ActionFactory . IWorkbenchAction { private IWorkbenchWindow workbenchWindow ; private int accelerator ; public ShowPartPaneMenuAction ( IWorkbenchWindow window ) { } protected void initText ( ) { } protected void showMenu ( PartPane pane ) { <START_BUG> pane . showPaneMenu ( ) ; <END_BUG> } protected void updateState ( ) { } public void runWithEvent ( Event e ) { } public void partOpened ( IWorkbenchPart part ) { } public void partClosed ( IWorkbenchPart part ) { } public void partActivated ( IWorkbenchPart part ) { } public void partDeactivated ( IWorkbenchPart part ) { } public int getAccelerator ( ) { } public void dispose ( ) { } }

Fix:
pane . showSystemMenu ( ) ;
Buggy code:
class SegGraph { private Map < Integer , ArrayList < SegToken > > tokenListTable = new HashMap < Integer , ArrayList < SegToken > > ( ) ; private int maxStart = - 1 ; public boolean isStartExist ( int s ) { } public List < SegToken > getStartList ( int s ) { } public int getMaxStart ( ) { } public List < SegToken > makeIndex ( ) { List < SegToken > result = new ArrayList < SegToken > ( ) ; int s = - 1 ; int count = 0 ; int size = tokenListTable . size ( ) ; List < SegToken > tokenList ; <START_BUG> short index = 0 ; <END_BUG> while ( count < size ) { if ( isStartExist ( s ) ) { tokenList = tokenListTable . get ( s ) ; for ( SegToken st : tokenList ) { st . index = index ; result . add ( st ) ; index ++ ; } count ++ ; } s ++ ; } return result ; } public void addToken ( SegToken token ) { } public List < SegToken > toTokenList ( ) { } @ Override public String toString ( ) { } }

Fix:
int index = 0 ;
Buggy code:
public final class ItemIDIndexMapper extends MapReduceBase implements Mapper < LongWritable , Text , IntWritable , LongWritable > { private static final Pattern COMMA = Pattern . compile ( "," ) ; @ Override public void map ( LongWritable key , Text value , OutputCollector < IntWritable , LongWritable > output , Reporter reporter ) throws IOException { } static int idToIndex ( long itemID ) { <START_BUG> return ( 2147483647 & ( ( int ) ( itemID ) ) ) ^ ( ( int ) ( itemID > > > 32 ) ) ; <END_BUG> } }

Fix:
return 2147483647 & ( ( ( int ) ( itemID ) ) ^ ( ( int ) ( itemID > > > 32 ) ) ) ;