nus-yam/ex-repair huggingface dataset:
Buggy code:
public class FastDateFormatTest extends TestCase { public FastDateFormatTest ( String name ) { } public void test_getInstance ( ) { } public void test_getInstance_String ( ) { } public void test_getInstance_String_TimeZone ( ) { } public void test_getInstance_String_Locale ( ) { Locale realDefaultLocale = Locale . getDefault ( ) ; try { Locale . setDefault ( Locale . US ) ; FastDateFormat format1 = FastDateFormat . getInstance ( "MM//DD//yyyy" , Locale . GERMANY ) ; FastDateFormat format2 = FastDateFormat . getInstance ( "MM//DD//yyyy" ) ; FastDateFormat format3 = FastDateFormat . getInstance ( "MM//DD//yyyy" , Locale . GERMANY ) ; assertTrue ( ( format1 != format2 ) ) ; assertSame ( format1 , format3 ) ; <START_BUG> assertSame ( Locale . GERMANY , format1 . getLocale ( ) ) ; <END_BUG> } finally { Locale . setDefault ( realDefaultLocale ) ; } } public void test_changeDefault_Locale_DateInstance ( ) { } public void test_changeDefault_Locale_DateTimeInstance ( ) { } public void test_getInstance_String_TimeZone_Locale ( ) { } public void testFormat ( ) { } public void testShortDateStyleWithLocales ( ) { } public void testLowYearPadding ( ) { } public void testMilleniumBug ( ) { } public void testSimpleDate ( ) { } public void testLang303 ( ) { } public void testLang538 ( ) { } public void testLang645 ( ) { } }

Fix:
assertEquals ( Locale . GERMANY , format1 . getLocale ( ) ) ;
Buggy code:
public class EventDetailsActivity extends AppCompatActivity implements View . OnClickListener { String eventId ; FloatingActionButton addItemButton ; Button enterEventButton ; ItemListFragment itemListFragment ; ItemFormFragment itemFormFragment ; private boolean mShowingBack = false ; Bundle bundle ; Banner banner ; TextView errorMessageHolder ; Event event ; private boolean isPlanner ; String eventName ; private static int RESULT_LOAD_IMAGE = 1 ; private static int IMAGE_CAPTURE = 3401 ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void initializeFragmentObjects ( ) { } private void checkForConnectivity ( Bundle savedInstanceState ) { } private void init ( Bundle savedInstanceState ) { } private void checkBidderAccess ( ) { } private void flipCard ( ) { } public void setViewText ( TextView textView , Event event , String fieldName ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void set ( final String eventId , final Bundle savedInstanceState ) { } private void setData ( final FrameLayout loader_frame , final ProgressView loader ) { } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { super . onActivityResult ( requestCode , resultCode , data ) ; try { if ( ( ( ( requestCode == ( EventDetailsActivity . RESULT_LOAD_IMAGE ) ) || ( requestCode == ( EventDetailsActivity . IMAGE_CAPTURE ) ) ) && ( resultCode == ( RESULT_OK ) ) ) && ( data != null ) ) { <START_BUG> new ItemImage ( ) . set ( this , GetImageFromCamera . getUri ( this , data ) ) ; <END_BUG> } } catch ( Exception e ) { e . printStackTrace ( ) ; Toast . makeText ( this , "Please<seq2seq4repair_space>select<seq2seq4repair_space>an<seq2seq4repair_space>image!" , LENGTH_LONG ) . show ( ) ; } } @ Override public void onClick ( View v ) { } public void startPaymentActivity ( View v ) { } }

Fix:
new ItemImage ( ) . set ( this , GetImageFromCamera . getUri ( this , data , requestCode ) ) ;
Buggy code:
public class CmdReload extends PlotCommand { public CmdReload ( PlotMe_Core instance ) { } public boolean exec ( ICommandSender sender ) { if ( sender . hasPermission ( "plotme.admin.reload" ) ) { serverBridge . getEventFactory ( ) . callPlotReloadEvent ( ) ; plugin . reload ( ) ; <START_BUG> serverBridge . getLogger ( ) . info ( C ( "MsgReloadedSuccess" ) ) ; <END_BUG> return true ; } else { return false ; } } }

Fix:
sender . sendMessage ( C ( "MsgReloadedSuccess" ) ) ;
Buggy code:
public class FigInterface extends FigNodeModelElement { protected FigGroup _operVec ; protected FigRect _operBigPort ; protected FigRect _stereoLineBlinder ; public MElementResidence resident = UmlFactory . getFactory ( ) . getCore ( ) . createElementResidence ( ) ; protected CompartmentFigText highlightedFigText = null ; public FigInterface ( ) { } public FigInterface ( GraphModel gm , Object node ) { } public String placeString ( ) { } public Object clone ( ) { } public Selection makeSelection ( ) { } public Vector getPopUpActions ( MouseEvent me ) { } public FigGroup getOperationsFig ( ) { } public boolean isOperationVisible ( ) { } public void setOperationVisible ( boolean isVisible ) { } public Dimension getMinimumSize ( ) { } public void setFillColor ( Color lColor ) { } public void setLineColor ( Color lColor ) { } public void translate ( int dx , int dy ) { } public void mousePressed ( MouseEvent me ) { } public void mouseExited ( MouseEvent me ) { } public void keyPressed ( KeyEvent ke ) { } public void setEnclosingFig ( Fig encloser ) { super . setEnclosingFig ( encloser ) ; if ( ! ( ( getOwner ( ) ) instanceof MModelElement ) ) return ; MModelElement me = ( ( MModelElement ) ( getOwner ( ) ) ) ; MNamespace m = null ; ProjectBrowser pb = ProjectBrowser . TheInstance ; if ( ( me . getNamespace ( ) ) == null ) { if ( ( ( encloser == null ) && ( ( me . getNamespace ( ) ) == null ) ) || ( ( encloser != null ) && ( ( encloser . getOwner ( ) ) instanceof MPackage ) ) ) { if ( encloser != null ) { m = ( ( MNamespace ) ( encloser . getOwner ( ) ) ) ; } else if ( ( pb . getTarget ( ) ) instanceof UMLDiagram ) { m = ( ( MNamespace ) ( ( ( UMLDiagram ) ( pb . getTarget ( ) ) ) . getNamespace ( ) ) ) ; } try { me . setNamespace ( m ) ; } catch ( Exception e ) { log . error ( "could<seq2seq4repair_space>not<seq2seq4repair_space>set<seq2seq4repair_space>package" , e ) ; } } } <START_BUG> if ( ( encloser != null ) && ( ( encloser . getOwner ( ) ) instanceof MComponentImpl ) ) { <END_BUG> MComponent component = ( ( MComponent ) ( encloser . getOwner ( ) ) ) ; MInterface in = ( ( MInterface ) ( getOwner ( ) ) ) ; resident . setImplementationLocation ( component ) ; resident . setResident ( in ) ; } else { resident . setImplementationLocation ( null ) ; resident . setResident ( null ) ; } } protected void textEdited ( FigText ft ) throws PropertyVetoException { } protected FigText getPreviousVisibleFeature ( FigText ft , int i ) { } protected FigText getNextVisibleFeature ( FigText ft , int i ) { } protected void createFeatureIn ( FigGroup fg , InputEvent ie ) { } protected CompartmentFigText unhighlight ( ) { } protected void modelChanged ( ) { } public void renderingChanged ( ) { } public void setBounds ( int x , int y , int w , int h ) { } }

Fix:
if ( ( encloser != null ) && ( ( encloser . getOwner ( ) ) instanceof MComponent ) ) {
Buggy code:
public class TestBlockingBuffer extends AbstractTestObject { public TestBlockingBuffer ( String testName ) { } public static Test suite ( ) { } public static void main ( String [ ] args ) { } public Object makeObject ( ) { } public boolean isEqualsCheckable ( ) { } public void testGetWithAdd ( ) { } public void testGetWithAddTimeout ( ) { } public void testGetWithAddAll ( ) { } public void testGetWithAddAllTimeout ( ) { } public void testRemoveWithAdd ( ) { } public void testRemoveWithAddTimeout ( ) { } public void testRemoveWithAddAll ( ) { } public void testRemoveWithAddAllTimeout ( ) { } public void testBlockedGetWithAdd ( ) { } public void testBlockedGetWithAddAll ( ) { } public void testInterruptedGet ( ) { } public void testBlockedRemoveWithAdd ( ) { } public void testBlockedRemoveWithAddAll1 ( ) { } public void testBlockedRemoveWithAddAll2 ( ) { } public void testInterruptedRemove ( ) { } public void testTimeoutGet ( ) { } public void testTimeoutRemove ( ) { } protected static class DelayedAdd extends Thread { Buffer buffer ; Object obj ; long delay = 1000 ; public DelayedAdd ( Buffer buffer , Object obj , long delay ) { } DelayedAdd ( Buffer buffer , Object obj ) { } public void run ( ) { } } protected static class DelayedAddAll extends Thread { Buffer buffer ; Object obj ; long delay = 100 ; public DelayedAddAll ( Buffer buffer , Object obj , long delay ) { } DelayedAddAll ( Buffer buffer , Object obj ) { } public void run ( ) { } } protected static class ReadThread extends Thread { Buffer buffer ; Object obj ; ArrayList exceptionList = null ; String action = "get" ; Set objs ; ReadThread ( Buffer buffer , Object obj ) { } ReadThread ( Buffer buffer , Object obj , ArrayList exceptionList ) { } ReadThread ( Buffer buffer , Object obj , ArrayList exceptionList , String action ) { } ReadThread ( Buffer buffer , Set objs , String action ) { } public void run ( ) { } } protected static class MyBuffer extends LinkedList implements Buffer { public Object get ( ) { } public Object remove ( ) { } } private void delay ( ) { try { <START_BUG> Thread . sleep ( 100 ) ; <END_BUG> } catch ( InterruptedException e ) { } } public String getCompatibilityVersion ( ) { } }

Fix:
Thread . sleep ( 200 ) ;
Buggy code:
public class ColorSwatchComponent extends JPanel implements PropertyChangeListener { boolean doAlpha = false ; Color color ; JButton clearBtn ; JButton setBtn ; String label ; private XmlObjectStore store ; public ColorSwatchComponent ( XmlObjectStore store , Color c , String dialogLabel ) { } public ColorSwatchComponent ( XmlObjectStore store , Color c , String dialogLabel , boolean alphaOk ) { } public static Color colorChooserDialog ( XmlObjectStore store , Component c , String label , Color color ) { List < Color > savedColors = ( ( List < Color > ) ( store . get ( PROP_RECENT_COLORS ) ) ) ; if ( color == null ) { if ( ( savedColors != null ) && ( ! ( savedColors . isEmpty ( ) ) ) ) { color = savedColors . get ( 0 ) ; } else { color = Color . WHITE ; } } ColorSwatchComponent comp = new ColorSwatchComponent ( store , color , label ) ; JColorChooser chooser = new JColorChooser ( comp . getBackground ( ) ) ; List < AbstractColorChooserPanel > choosers = new ArrayList < > ( Arrays . asList ( chooser . getChooserPanels ( ) ) ) ; choosers . remove ( 0 ) ; PersistableSwatchChooserPanel swatch = new PersistableSwatchChooserPanel ( ) ; PersistableSwatchChooserPanel . ColorTracker tracker = new PersistableSwatchChooserPanel . ColorTracker ( ) ; tracker . addPropertyChangeListener ( "colors" , comp ) ; if ( savedColors != null ) { tracker . setColors ( savedColors ) ; } swatch . setColorTracker ( tracker ) ; choosers . add ( 0 , swatch ) ; chooser . setChooserPanels ( choosers . toArray ( new AbstractColorChooserPanel [ 0 ] ) ) ; swatch . updateRecentSwatchPanel ( ) ; if ( GuiUtils . showOkCancelDialog ( null , label , chooser , null ) ) { comp . userSelectedNewColor ( chooser . getColor ( ) ) ; } <START_BUG> return tracker . getMostRecentColor ( ) ; <END_BUG> } private void showColorChooser ( ) { } private JColorChooser createChooser ( PersistableSwatchChooserPanel . ColorTracker tracker ) { } @ Override public void propertyChange ( PropertyChangeEvent evt ) { } private void setColorFromChooser ( ) { } public JButton getSetButton ( ) { } public JButton getClearButton ( ) { } public Color getSwatchColor ( ) { } public void userSelectedNewColor ( Color c ) { } @ Override public void setBackground ( Color c ) { } @ Override public void paint ( Graphics g ) { } public JComponent getPanel ( ) { } public Color getColor ( ) { } public JComponent getSetPanel ( ) { } public void popupNameMenu ( JButton popupBtn ) { } public void setColorName ( String name ) { } }

Fix:
return comp . getBackground ( ) ;
Buggy code:
public class Zip extends MatchingTask { private File zipFile ; private File baseDir ; private boolean doCompress = true ; protected String archiveType = "zip" ; public void setZipfile ( String zipFilename ) { } public void setBasedir ( String baseDirname ) { } public void setCompress ( String compress ) { } public void execute ( ) throws BuildException { if ( ( baseDir ) == null ) { throw new BuildException ( "basedir<seq2seq4repair_space>attribute<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>set!" ) ; } if ( ! ( baseDir . exists ( ) ) ) { throw new BuildException ( "basedir<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist!" ) ; } DirectoryScanner ds = super . getDirectoryScanner ( baseDir ) ; String [ ] files = ds . getIncludedFiles ( ) ; String [ ] dirs = ds . getIncludedDirectories ( ) ; boolean upToDate = true ; for ( int i = 0 ; ( i < ( files . length ) ) && upToDate ; i ++ ) if ( ( new File ( baseDir , files [ i ] ) . lastModified ( ) ) > ( zipFile . lastModified ( ) ) ) upToDate = false ; if ( upToDate ) return ; <START_BUG> project . log ( ( ( ( "Building<seq2seq4repair_space>" + ( archiveType ) ) + ":<seq2seq4repair_space>" ) + ( zipFile . getAbsolutePath ( ) ) ) ) ; <END_BUG> try { ZipOutputStream zOut = new ZipOutputStream ( new FileOutputStream ( zipFile ) ) ; if ( doCompress ) { zOut . setMethod ( ZipOutputStream . DEFLATED ) ; } else { zOut . setMethod ( ZipOutputStream . STORED ) ; } initZipOutputStream ( zOut ) ; for ( int i = 0 ; i < ( dirs . length ) ; i ++ ) { File f = new File ( baseDir , dirs [ i ] ) ; String name = ( dirs [ i ] . replace ( File . separatorChar , '//' ) ) + "//" ; zipDir ( f , zOut , name ) ; } for ( int i = 0 ; i < ( files . length ) ; i ++ ) { File f = new File ( baseDir , files [ i ] ) ; String name = files [ i ] . replace ( File . separatorChar , '//' ) ; zipFile ( f , zOut , name ) ; } zOut . close ( ) ; } catch ( IOException ioe ) { String msg = ( ( "Problem<seq2seq4repair_space>creating<seq2seq4repair_space>" + ( archiveType ) ) + "<seq2seq4repair_space>" ) + ( ioe . getMessage ( ) ) ; throw new BuildException ( msg ) ; } } protected void initZipOutputStream ( ZipOutputStream zOut ) throws IOException , BuildException { } protected void zipDir ( File dir , ZipOutputStream zOut , String vPath ) throws IOException { } protected void zipFile ( InputStream in , ZipOutputStream zOut , String vPath , long lastModified ) throws IOException { } protected void zipFile ( File file , ZipOutputStream zOut , String vPath ) throws IOException { } }

Fix:
log ( ( ( ( "Building<seq2seq4repair_space>" + ( archiveType ) ) + ":<seq2seq4repair_space>" ) + ( zipFile . getAbsolutePath ( ) ) ) ) ;
Buggy code:
public class RemoveCardAction extends DefaultTableAction implements TreeSelectionListener { public RemoveCardAction ( IFrameMediator frameController ) { } public void actionPerformed ( ActionEvent evt ) { AddressbookFrameMediator mediator = ( ( AddressbookFrameMediator ) ( frameMediator ) ) ; FocusOwner focusOwner = FocusManager . getInstance ( ) . getCurrentOwner ( ) ; TableController table = ( ( AddressbookFrameMediator ) ( frameMediator ) ) . getTable ( ) ; boolean tableHasFocus = false ; if ( table . equals ( focusOwner ) ) tableHasFocus = true ; if ( tableHasFocus ) { Object [ ] uids = mediator . getTable ( ) . getUids ( ) ; AbstractFolder folder = ( ( AbstractFolder ) ( mediator . getTree ( ) . getSelectedFolder ( ) ) ) ; for ( int i = 0 ; i < ( uids . length ) ; i ++ ) { try { folder . remove ( uids [ i ] ) ; } catch ( Exception e ) { if ( Logging . DEBUG ) e . printStackTrace ( ) ; <START_BUG> new ErrorDialog ( e . getMessage ( ) , e ) ; <END_BUG> } } if ( folder instanceof IGroupFolder ) mediator . getTree ( ) . setSelectedFolder ( folder ) ; } else { AbstractFolder folder = ( ( AbstractFolder ) ( mediator . getTree ( ) . getSelectedFolder ( ) ) ) ; AddressbookTreeNode parent = ( ( AddressbookTreeNode ) ( folder . getParent ( ) ) ) ; mediator . getTree ( ) . setSelectedFolder ( ( ( AbstractFolder ) ( parent ) ) ) ; folder . removeFromParent ( ) ; AddressbookTreeModel . getInstance ( ) . nodeStructureChanged ( parent ) ; } } public void valueChanged ( ListSelectionEvent event ) { } public void valueChanged ( TreeSelectionEvent e ) { } }

Fix:
ErrorDialog . createDialog ( e . getMessage ( ) , e ) ;
Buggy code:
public class ChangeSetPerformer { private final Set changes ; public ChangeSetPerformer ( final ChangeSet changeSet ) { } public ChangeSetResults perform ( ArchiveInputStream in , ArchiveOutputStream out ) throws IOException { ChangeSetResults results = new ChangeSetResults ( ) ; Set workingSet = new LinkedHashSet ( changes ) ; for ( Iterator it = workingSet . iterator ( ) ; it . hasNext ( ) ; ) { Change change = ( ( Change ) ( it . next ( ) ) ) ; if ( ( change . type ( ) ) == ( Change . TYPE_ADD ) ) { copyStream ( change . getInput ( ) , out , change . getEntry ( ) ) ; it . remove ( ) ; results . addedFromChangeSet ( change . getEntry ( ) . getName ( ) ) ; } } ArchiveEntry entry = null ; while ( ( entry = in . getNextEntry ( ) ) != null ) { boolean copy = true ; for ( Iterator it = workingSet . iterator ( ) ; it . hasNext ( ) ; ) { Change change = ( ( Change ) ( it . next ( ) ) ) ; final int type = change . type ( ) ; final String name = entry . getName ( ) ; if ( ( type == ( Change . TYPE_DELETE ) ) && ( name != null ) ) { if ( name . equals ( change . targetFile ( ) ) ) { copy = false ; it . remove ( ) ; results . deleted ( name ) ; break ; } } else if ( ( type == ( Change . TYPE_DELETE_DIR ) ) && ( name != null ) ) { if ( name . startsWith ( ( ( change . targetFile ( ) ) + "//" ) ) ) { copy = false ; results . deleted ( name ) ; break ; } } } if ( copy ) { <START_BUG> if ( ! ( isDeletedLater ( workingSet , entry ) ) ) { <END_BUG> copyStream ( in , out , entry ) ; results . addedFromStream ( entry . getName ( ) ) ; } } } return results ; } private boolean isDeletedLater ( Set workingSet , ArchiveEntry entry ) { } private void copyStream ( InputStream in , ArchiveOutputStream out , ArchiveEntry entry ) throws IOException { } }

Fix:
if ( ( ! ( isDeletedLater ( workingSet , entry ) ) ) && ( ! ( results . hasBeenAdded ( entry . getName ( ) ) ) ) ) {
Buggy code:
public class SmsContentLoader extends SimpleBaseLoader < List < SmsContentObject > > { private String mAddress ; public SmsContentLoader ( Context context , String address ) { } @ Override public List < SmsContentObject > loadInBackground ( ) { Uri uri = Uri . parse ( "content:////sms//" ) ; String [ ] reqCols = new String [ ] { "_id" , "body" , "date" , "type" } ; final List < SmsContentObject > results = new ArrayList < > ( ) ; String address = mAddress ; if ( address == null ) return null ; String selection ; try { address = String . valueOf ( Long . parseLong ( address ) ) ; <START_BUG> if ( PhoneNumberConverterFactory . getConverter ( new Locale ( "vn" , Country . VIETNAM ) ) . isValidPersonalNumber ( address ) ) { <END_BUG> throw new NumberFormatException ( ) ; } selection = ( "address<seq2seq4repair_space>like<seq2seq4repair_space>'%" + address ) + "'" ; } catch ( NumberFormatException ex ) { selection = ( "address='" + address ) + "'" ; } Cursor c = getContext ( ) . getContentResolver ( ) . query ( uri , reqCols , selection , null , "date<seq2seq4repair_space>ASC" ) ; while ( c . moveToNext ( ) ) { SmsContentObject sms = new SmsContentObject ( ) ; sms . Type = c . getInt ( c . getColumnIndex ( "type" ) ) ; sms . Id = c . getInt ( c . getColumnIndex ( "_id" ) ) ; if ( ( ( sms . Type ) != ( SmsContentObject . TYPE_INBOX ) ) && ( ( sms . Type ) != ( SmsContentObject . TYPE_SENT ) ) ) { Global . log ( ( "Ignore<seq2seq4repair_space>sms<seq2seq4repair_space>type:<seq2seq4repair_space>" + ( sms . Type ) ) ) ; continue ; } try { Date date = new Date ( Long . parseLong ( c . getString ( c . getColumnIndex ( "date" ) ) ) ) ; sms . Date = DateFormat . getInstance ( ) . format ( date ) ; String content = c . getString ( c . getColumnIndex ( "body" ) ) ; if ( content . startsWith ( MESSAGE_PREFIX ) ) { content = content . replace ( MESSAGE_PREFIX , "" ) ; content = AESHelper . decryptFromBase64 ( DEFAULT_PASSWORD , content ) ; if ( content == null ) continue ; } sms . Content = content ; results . add ( sms ) ; } catch ( NumberFormatException ignored ) { } } c . close ( ) ; return results ; } }

Fix:
if ( ! ( PhoneNumberConverterFactory . getConverter ( new Locale ( "vn" , Country . VIETNAM ) ) . isValidPersonalNumber ( address ) ) ) {
Buggy code:
public class ThreadManager extends Thread { private In in ; private Database db ; private Terminal terminal ; private long pollinterval ; public ThreadManager ( In in , Terminal terminal , long pollinterval ) { } @ Override public void run ( ) { while ( true ) { try { String s = in . getBuffer ( ) ; <START_BUG> if ( ( ( s != null ) && ( s != "" ) ) && ( s != "<seq2seq4repair_space>" ) ) { <END_BUG> System . out . println ( ( "test:" + s ) ) ; if ( db . checkBlockedPass ( s ) ) { terminal . printString ( s , false ) ; if ( db . checkoutControl ( s ) ) { db . updatePass ( s ) ; } else { db . insertPass ( s ) ; } } else { terminal . printString ( s , true ) ; } } Thread . sleep ( pollinterval ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } } }

Fix:
if ( ( s != null ) && ( ! ( s . isEmpty ( ) ) ) ) {
Buggy code:
public class WicketLinkResolver implements IComponentResolver { private static final long serialVersionUID = 1L ; public boolean resolve ( final MarkupContainer container , final MarkupStream markupStream , final ComponentTag tag ) { if ( tag instanceof WicketTag ) { WicketTag wtag = ( ( WicketTag ) ( tag ) ) ; if ( ( wtag . isLinkTag ( ) ) && ( ( wtag . getNamespace ( ) ) != null ) ) { final String id = "_link_" + ( container . getPage ( ) . getAutoIndex ( ) ) ; final Component component = new WebMarkupContainer ( id ) { private static final long serialVersionUID = 1L ; public boolean isTransparentResolver ( ) { return true ; } } ; <START_BUG> container . autoAdd ( component ) ; <END_BUG> return true ; } } return false ; } }

Fix:
container . autoAdd ( component , markupStream ) ;
Buggy code:
public class ZoneResponse { static final byte NXDOMAIN = 0 ; static final byte NODATA = 1 ; static final byte PARTIAL = 2 ; static final byte SUCCESSFUL = 3 ; private byte type ; private Object data ; private Vector backtrace ; private ZoneResponse ( ) { } ZoneResponse ( byte _type , Object _data ) { } ZoneResponse ( byte _type ) { } void set ( byte _type , Object _data ) { } void addRRset ( RRset rrset ) { } void addCNAME ( CNAMERecord cname ) { if ( ( backtrace ) == null ) backtrace = new Vector ( ) ; <START_BUG> backtrace . addElement ( cname ) ; <END_BUG> } public boolean isNXDOMAIN ( ) { } public boolean isNODATA ( ) { } public boolean isPartial ( ) { } public boolean isSuccessful ( ) { } public RRset [ ] answers ( ) { } public CNAMERecord partial ( ) { } public Vector backtrace ( ) { } public String toString ( ) { } }

Fix:
backtrace . insertElementAt ( cname , 0 ) ;
Buggy code:
final class KeySequenceBindingMachine { private String [ ] activeActivityIds ; private String [ ] activeKeyConfigurationIds ; private String [ ] activeLocales ; private String [ ] activePlatforms ; private List [ ] keySequenceBindings ; private Map keySequenceBindingsByCommandId ; private Map matchesByKeySequence ; private boolean solved ; private SortedMap tree ; KeySequenceBindingMachine ( ) { } String [ ] getActiveActivityIds ( ) { } String [ ] getActiveKeyConfigurationIds ( ) { } String [ ] getActiveLocales ( ) { } String [ ] getActivePlatforms ( ) { } List getKeySequenceBindings0 ( ) { } List getKeySequenceBindings1 ( ) { } Map getKeySequenceBindingsByCommandId ( ) { } Map getMatchesByKeySequence ( ) { } private void invalidateSolution ( ) { } private void invalidateTree ( ) { } boolean setActiveActivityIds ( String [ ] activeActivityIds ) { } boolean setActiveKeyConfigurationIds ( String [ ] activeKeyConfigurationIds ) { } boolean setActiveLocales ( String [ ] activeLocales ) { } boolean setActivePlatforms ( String [ ] activePlatforms ) { } boolean setKeySequenceBindings0 ( List keySequenceBindings0 ) { } boolean setKeySequenceBindings1 ( List keySequenceBindings1 ) { } private void validateSolution ( ) { } private void validateTree ( ) { if ( ( tree ) == null ) { tree = new TreeMap ( ) ; for ( int i = 0 ; i < ( keySequenceBindings . length ) ; i ++ ) { Iterator iterator = keySequenceBindings [ i ] . iterator ( ) ; while ( iterator . hasNext ( ) ) { IKeySequenceBindingDefinition keySequenceBindingDefinition = ( ( IKeySequenceBindingDefinition ) ( iterator . next ( ) ) ) ; <START_BUG> KeySequenceBindingNode . add ( tree , keySequenceBindingDefinition . getKeySequence ( ) , keySequenceBindingDefinition . getActivityId ( ) , keySequenceBindingDefinition . getKeyConfigurationId ( ) , i , keySequenceBindingDefinition . getPlatform ( ) , keySequenceBindingDefinition . getLocale ( ) , keySequenceBindingDefinition . getCommandId ( ) ) ; <END_BUG> } } } } }

Fix:
KeySequenceBindingNode . add ( tree , keySequenceBindingDefinition . getKeySequence ( ) , keySequenceBindingDefinition . getContextId ( ) , keySequenceBindingDefinition . getKeyConfigurationId ( ) , i , keySequenceBindingDefinition . getPlatform ( ) , keySequenceBindingDefinition . getLocale ( ) , keySequenceBindingDefinition . getCommandId ( ) ) ;
Buggy code:
public class AboutDialog extends EnhancedDialog { public AboutDialog ( View view ) { } public void ok ( ) { } public void cancel ( ) { } private JButton close ; class ActionHandler implements ActionListener { public void actionPerformed ( ActionEvent evt ) { } } static class AboutPanel extends JComponent { ImageIcon image ; Vector text ; int scrollPosition ; AboutDialog . AboutPanel . AnimationThread thread ; AboutPanel ( ) { } public void paintComponent ( Graphics _g ) { } public Dimension getPreferredSize ( ) { } public void addNotify ( ) { } public void removeNotify ( ) { } class AnimationThread extends Thread { AnimationThread ( ) { } public void run ( ) { for ( ; ; ) { long start = System . currentTimeMillis ( ) ; ( scrollPosition ) ++ ; FontMetrics fm = getFontMetrics ( getFont ( ) ) ; int max = ( text . size ( ) ) * ( fm . getHeight ( ) ) ; if ( ( scrollPosition ) > max ) scrollPosition = - 300 ; try { <START_BUG> Thread . sleep ( Math . max ( 0 , ( 50 - ( ( System . currentTimeMillis ( ) ) - start ) ) ) ) ; <END_BUG> } catch ( InterruptedException ie ) { } repaint ( ) ; } } } } }

Fix:
Thread . sleep ( Math . max ( 0 , ( 25 - ( ( System . currentTimeMillis ( ) ) - start ) ) ) ) ;
Buggy code:
public class TestFlushBeforeDetach extends SQLListenerTestCase { private int _id ; public void setUp ( ) { <START_BUG> setUp ( Item . class , "openjpa.Compatibility" , "default(flushBeforeDetach=false)" ) ; <END_BUG> persistSampleEntity ( ) ; } private void persistSampleEntity ( ) { } public void testClear ( ) { } public void testDetach ( ) { } public void testDetachAll ( ) { } public void testDetachAllCollection ( ) { } public void testSerialize ( ) throws Exception { } private Object serializeObject ( Object orig ) throws Exception { } }

Fix:
setUp ( Item . class , "openjpa.Compatibility" , "default(flushBeforeDetach=false,copyOnDetach=true)" ) ;
Buggy code:
public class ShowInMenu extends ContributionItem implements IWorkbenchContribution { private static final String SHOW_IN_PARM_ID = "org.eclipse.ui.navigate.showIn.targetId" ; private static final String NO_TARGETS_MSG = WorkbenchMessages . Workbench_showInNoTargets ; private IWorkbenchWindow window ; private Map actions = new HashMap ( 21 ) ; private boolean dirty = true ; private IMenuListener menuListener = new IMenuListener ( ) { public void menuAboutToShow ( IMenuManager manager ) { } } ; private IServiceLocator locator ; private MenuManager currentManager ; public ShowInMenu ( ) { } public ShowInMenu ( IWorkbenchWindow window , String id ) { } public boolean isDirty ( ) { } public boolean isDynamic ( ) { } public void fill ( Menu menu , int index ) { } private void fillMenu ( IMenuManager innerMgr ) { } private IContributionItem getContributionItem ( IViewDescriptor viewDescriptor ) { <START_BUG> CommandContributionItemParameter parm = new CommandContributionItemParameter ( locator , viewDescriptor . getId ( ) , IWorkbenchCommandConstants . NAVIGATE_SHOWIN , CommandContributionItem . STYLE_PUSH ) ; <END_BUG> HashMap targetId = new HashMap ( ) ; targetId . put ( ShowInMenu . SHOW_IN_PARM_ID , viewDescriptor . getId ( ) ) ; parm . parameters = targetId ; parm . label = viewDescriptor . getLabel ( ) ; parm . icon = viewDescriptor . getImageDescriptor ( ) ; return new CommandContributionItem ( parm ) ; } private ArrayList getShowInPartIds ( IWorkbenchPart sourcePart ) { } private IWorkbenchPart getSourcePart ( ) { } private IShowInSource getShowInSource ( IWorkbenchPart sourcePart ) { } private IShowInTargetList getShowInTargetList ( IWorkbenchPart sourcePart ) { } private ShowInContext getContext ( IWorkbenchPart sourcePart ) { } private IViewDescriptor [ ] getViewDescriptors ( IWorkbenchPart sourcePart ) { } public void initialize ( IServiceLocator serviceLocator ) { } protected IWorkbenchWindow getWindow ( ) { } public void dispose ( ) { } }

Fix:
CommandContributionItemParameter parm = new CommandContributionItemParameter ( locator , viewDescriptor . getId ( ) , IWorkbenchCommandConstants . NAVIGATE_SHOW_IN , CommandContributionItem . STYLE_PUSH ) ;
Buggy code:
public class NonBlockingClient extends AbstractClient { private static final Logger log = Logger . getLogger ( NonBlockingClient . class ) ; private NonBlockingSocketTrunk trunk ; private SocketChannel socket ; private ServerAddress serverAddress ; private SelectorManager selectorManager ; public void connect ( ServerAddress serverAddress , ThreadGroup threadGroup ) throws IOException { this . serverAddress = serverAddress ; boolean tracing = NonBlockingClient . log . isTraceEnabled ( ) ; if ( tracing ) NonBlockingClient . log . trace ( ( "Connecting<seq2seq4repair_space>to<seq2seq4repair_space>:<seq2seq4repair_space>" + serverAddress ) ) ; selectorManager = SelectorManager . getInstance ( oiThreadGroup ) ; socket = SocketChannel . open ( ) ; socket . configureBlocking ( true ) ; socket . connect ( new InetSocketAddress ( serverAddress . address , serverAddress . port ) ) ; socket . configureBlocking ( false ) ; socket . socket ( ) . setTcpNoDelay ( serverAddress . enableTcpNoDelay ) ; trunk = new NonBlockingSocketTrunk ( socket , selectorManager . getSelector ( ) ) ; CommTrunkRamp ramp = new CommTrunkRamp ( trunk , workManager ) ; trunk . setCommTrunkRamp ( ramp ) ; <START_BUG> ramp . setTrunkListner ( this ) ; <END_BUG> if ( tracing ) NonBlockingClient . log . trace ( "Connection<seq2seq4repair_space>established." ) ; } public ServerAddress getServerAddress ( ) { } public ICommTrunk getCommTrunk ( ) { } public void start ( ) { } public void stop ( ) { } }

Fix:
ramp . setTrunkListener ( this ) ;
Buggy code:
public class CustomerType extends CustomerType_Base { protected CustomerType ( ) { } protected CustomerType ( final String code , final LocalizedString name ) { } private void checkRules ( ) { } @ Atomic public void edit ( final String code , final LocalizedString name ) { } public boolean isDeletable ( ) { <START_BUG> return true ; <END_BUG> } @ Atomic public void delete ( ) { } public static Stream < CustomerType > findAll ( ) { } public static Stream < CustomerType > findByCode ( final String code ) { } public static Stream < CustomerType > findByName ( final String name ) { } @ Atomic public static CustomerType create ( final String code , final LocalizedString name ) { } @ Atomic public static void initializeCustomerType ( ) { } }

Fix:
return getCustomersSet ( ) . isEmpty ( ) ;
Buggy code:
public class AssertStatement extends Statement { public Expression assertExpression ; public Expression exceptionArgument ; int preAssertInitStateIndex = - 1 ; private FieldBinding assertionSyntheticFieldBinding ; public AssertStatement ( Expression exceptionArgument , Expression assertExpression , int startPosition ) { } public AssertStatement ( Expression assertExpression , int startPosition ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public void resolve ( BlockScope scope ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { if ( ! ( flowInfo . isReachable ( ) ) ) return ; SourceTypeBinding outerMostClass = currentScope . enclosingSourceType ( ) ; while ( outerMostClass . isLocalType ( ) ) { ReferenceBinding enclosing = outerMostClass . enclosingType ( ) ; if ( ( enclosing == null ) || ( enclosing . isInterface ( ) ) ) break ; outerMostClass = ( ( SourceTypeBinding ) ( enclosing ) ) ; } <START_BUG> this . assertionSyntheticFieldBinding = outerMostClass . addSyntheticField ( this , currentScope ) ; <END_BUG> TypeDeclaration typeDeclaration = outerMostClass . scope . referenceType ( ) ; AbstractMethodDeclaration [ ] methods = typeDeclaration . methods ; for ( int i = 0 , max = methods . length ; i < max ; i ++ ) { AbstractMethodDeclaration method = methods [ i ] ; if ( method . isClinit ( ) ) { ( ( Clinit ) ( method ) ) . setAssertionSupport ( assertionSyntheticFieldBinding , ( ( currentScope . environment ( ) . options . sourceLevel ) < ( ClassFileConstants . JDK1_5 ) ) ) ; break ; } } } public StringBuffer printStatement ( int tab , StringBuffer output ) { } }

Fix:
this . assertionSyntheticFieldBinding = outerMostClass . addSyntheticFieldForAssert ( currentScope ) ;
Buggy code:
public class EventShield { @ SubscribeEvent public void onPlayerAttacked ( LivingHurtEvent event ) { if ( ( event . entity ) instanceof EntityPlayer ) { EntityPlayer player = ( ( EntityPlayer ) ( event . entity ) ) ; if ( ( ShieldHandler . getShieldAmount ( player ) ) > 0.0F ) { float dam = ( event . ammount ) - ( ShieldHandler . getShieldAmount ( player ) ) ; <START_BUG> float cur = Math . abs ( dam ) ; <END_BUG> event . ammount = Math . max ( 0 , dam ) ; ShieldHandler . setShieldAmount ( Math . max ( 0 , cur ) , player ) ; } } } @ SubscribeEvent public void onPlayerRender ( RenderPlayerEvent . Specials . Post event ) { } @ SideOnly ( Side . CLIENT ) public void renderShield ( RenderPlayerEvent event , RenderType type ) { } @ SubscribeEvent public void onEntityConstructing ( EntityConstructing event ) { } }

Fix:
float cur = ( ShieldHandler . getShieldAmount ( player ) ) - ( event . ammount ) ;
Buggy code:
public class SQLExceptionFactory40 extends SQLExceptionFactory { private static final String DRDA_CONVERSATION_TERMINATED = "58009" ; private static final String DRDA_COMMAND_NOT_SUPPORTED = "58014" ; private static final String DRDA_OBJECT_NOT_SUPPORTED = "58015" ; private static final String DRDA_PARAM_NOT_SUPPORTED = "58016" ; private static final String DRDA_VALUE_NOT_SUPPORTED = "58017" ; private static final String DRDA_SQLTYPE_NOT_SUPPORTED = "56084" ; private static final String DRDA_CONVERSION_NOT_SUPPORTED = "57017" ; private static final String DRDA_REPLY_MSG_NOT_SUPPORTED = "58018" ; public SQLException getSQLException ( String message , String sqlState , int errCode ) { SQLException ex = null ; if ( sqlState == null ) { ex = new SQLException ( message , sqlState , errCode ) ; } else if ( ( sqlState . startsWith ( CONNECTIVITY_PREFIX ) ) || ( errCode >= ( ExceptionSeverity . SESSION_SEVERITY ) ) ) { ex = new SQLTransientConnectionException ( message , sqlState , errCode ) ; } else if ( sqlState . startsWith ( SQL_DATA_PREFIX ) ) { ex = new SQLDataException ( message , sqlState , errCode ) ; } else if ( sqlState . startsWith ( INTEGRITY_VIOLATION_PREFIX ) ) { ex = new SQLIntegrityConstraintViolationException ( message , sqlState , errCode ) ; } else <START_BUG> if ( sqlState . startsWith ( AUTHORIZATION_PREFIX ) ) { <END_BUG> ex = new SQLInvalidAuthorizationSpecException ( message , sqlState , errCode ) ; } else if ( ( sqlState . startsWith ( TRANSACTION_PREFIX ) ) || ( errCode >= ( ExceptionSeverity . TRANSACTION_SEVERITY ) ) ) { ex = new SQLTransactionRollbackException ( message , sqlState , errCode ) ; } else if ( sqlState . startsWith ( LSE_COMPILATION_PREFIX ) ) { ex = new SQLSyntaxErrorException ( message , sqlState , errCode ) ; } else if ( ( ( ( ( ( ( sqlState . startsWith ( UNSUPPORTED_PREFIX ) ) || ( sqlState . equals ( SQLExceptionFactory40 . DRDA_COMMAND_NOT_SUPPORTED ) ) ) || ( sqlState . equals ( SQLExceptionFactory40 . DRDA_OBJECT_NOT_SUPPORTED ) ) ) || ( sqlState . equals ( SQLExceptionFactory40 . DRDA_PARAM_NOT_SUPPORTED ) ) ) || ( sqlState . equals ( SQLExceptionFactory40 . DRDA_VALUE_NOT_SUPPORTED ) ) ) || ( sqlState . equals ( SQLExceptionFactory40 . DRDA_SQLTYPE_NOT_SUPPORTED ) ) ) || ( sqlState . equals ( SQLExceptionFactory40 . DRDA_REPLY_MSG_NOT_SUPPORTED ) ) ) { ex = new SQLFeatureNotSupportedException ( message , sqlState , errCode ) ; } else { ex = new SQLException ( message , sqlState , errCode ) ; } return ex ; } }

Fix:
if ( sqlState . startsWith ( AUTHORIZATION_SPEC_PREFIX ) ) {
Buggy code:
public class YearMonthDV extends AbstractDateTimeDV { public Object getActualValue ( String content , ValidationContext context ) throws InvalidDatatypeValueException { try { <START_BUG> return parse ( content ) ; <END_BUG> } catch ( Exception ex ) { throw new InvalidDatatypeValueException ( "cvc-datatype-valid.1.2.1" , new Object [ ] { content , "gYearMonth" } ) ; } } protected int [ ] parse ( String str ) throws SchemaDateTimeException { } }

Fix:
return new DateTimeData ( parse ( content ) , this ) ;
Buggy code:
public interface ModelRemoveOperationHandler extends ModelUpdateOperationHandler { <START_BUG> Cancellable execute ( NewOperationContext context , ModelNode operation , ResultHandler resultHandler ) ; <END_BUG> }

Fix:
Cancellable execute ( OperationContext context , ModelNode operation , ResultHandler resultHandler ) ;
Buggy code:
public class ValueReplacer { private static transient Logger log = Hierarchy . getDefaultHierarchy ( ) . getLoggerFor ( ENGINE ) ; CompoundVariable masterFunction = new CompoundVariable ( ) ; Map variables = new HashMap ( ) ; TestPlan tp ; public ValueReplacer ( ) { } public ValueReplacer ( TestPlan tp ) { } public void setUserDefinedVariables ( Map variables ) { } public void replaceValues ( TestElement el ) throws InvalidVariableException { } private JMeterProperty getNewValue ( StringProperty prop ) throws InvalidVariableException { } public void addVariable ( String name , String value ) { } public void replaceValues ( CollectionProperty values ) throws InvalidVariableException { } private void replaceValues ( MapProperty values ) throws InvalidVariableException { } public void reverseReplace ( CollectionProperty prop ) { } private void reverseReplace ( MapProperty prop ) { } private void undoReverseReplace ( MapProperty prop ) { } public void undoReverseReplace ( CollectionProperty prop ) { Collection newColl = null ; try { <START_BUG> newColl = ( ( Collection ) ( prop . getClass ( ) . newInstance ( ) ) ) ; <END_BUG> } catch ( Exception e ) { ValueReplacer . log . error ( "" , e ) ; return ; } PropertyIterator iter = prop . iterator ( ) ; while ( iter . hasNext ( ) ) { JMeterProperty val = iter . next ( ) ; if ( val instanceof TestElementProperty ) { undoReverseReplace ( ( ( TestElement ) ( val . getObjectValue ( ) ) ) ) ; } else if ( val instanceof StringProperty ) { val = substituteReferences ( ( ( StringProperty ) ( val ) ) ) ; } else if ( val instanceof CollectionProperty ) { undoReverseReplace ( ( ( CollectionProperty ) ( val ) ) ) ; } else if ( val instanceof MapProperty ) { undoReverseReplace ( ( ( MapProperty ) ( val ) ) ) ; } newColl . add ( val ) ; } prop . setCollection ( newColl ) ; } public void undoReverseReplace ( TestElement el ) { } public void reverseReplace ( TestElement el ) { } private StringProperty substituteValues ( StringProperty prop ) { } private StringProperty substituteReferences ( StringProperty prop ) { } public static class Test extends TestCase { TestPlan variables ; public Test ( String name ) { } public void setUp ( ) { } public void testReverseReplacement ( ) throws Exception { } public void testReplace ( ) throws Exception { } } }

Fix:
newColl = ( ( Collection ) ( prop . getObjectValue ( ) . getClass ( ) . newInstance ( ) ) ) ;
Buggy code:
public class EigenSolverTest extends TestCase { private double [ ] refValues ; private RealMatrix matrix ; public EigenSolverTest ( String name ) { } public void testNonInvertible ( ) { } public void testInvertible ( ) { } public void testSolveDimensionErrors ( ) { } public void testSolve ( ) { RealMatrix m = MatrixUtils . createRealMatrix ( new double [ ] [ ] { new double [ ] { 91 , 5 , 29 , 32 , 40 , 14 } , new double [ ] { 5 , 34 , - 1 , 0 , 2 , - 1 } , new double [ ] { 29 , - 1 , 12 , 9 , 21 , 8 } , new double [ ] { 32 , 0 , 9 , 14 , 9 , 0 } , new double [ ] { 40 , 2 , 21 , 9 , 51 , 19 } , new double [ ] { 14 , - 1 , 8 , 0 , 19 , 14 } } ) ; DecompositionSolver es = new EigenDecompositionImpl ( m , org . apache . commons . math . util . MathUtils . SAFE_MIN ) . getSolver ( ) ; RealMatrix b = MatrixUtils . createRealMatrix ( new double [ ] [ ] { new double [ ] { 1561 , 269 , 188 } , new double [ ] { 69 , - 21 , 70 } , new double [ ] { 739 , 108 , 63 } , new double [ ] { 324 , 86 , 59 } , new double [ ] { 1624 , 194 , 107 } , new double [ ] { 796 , 69 , 36 } } ) ; RealMatrix xRef = MatrixUtils . createRealMatrix ( new double [ ] [ ] { new double [ ] { 1 , 2 , 1 } , new double [ ] { 2 , - 1 , 2 } , new double [ ] { 4 , 2 , 3 } , new double [ ] { 8 , - 1 , 0 } , new double [ ] { 16 , 2 , 0 } , new double [ ] { 32 , - 1 , 0 } } ) ; RealMatrix solution = es . solve ( b ) ; <START_BUG> assertEquals ( 0 , es . solve ( b ) . subtract ( xRef ) . getNorm ( ) , 2.5E-12 ) ; <END_BUG> for ( int i = 0 ; i < ( b . getColumnDimension ( ) ) ; ++ i ) { assertEquals ( 0 , new ArrayRealVector ( es . solve ( b . getColumn ( i ) ) ) . subtract ( xRef . getColumnVector ( i ) ) . getNorm ( ) , 2.0E-11 ) ; } for ( int i = 0 ; i < ( b . getColumnDimension ( ) ) ; ++ i ) { assertEquals ( 0 , es . solve ( b . getColumnVector ( i ) ) . subtract ( xRef . getColumnVector ( i ) ) . getNorm ( ) , 2.0E-11 ) ; } for ( int i = 0 ; i < ( b . getColumnDimension ( ) ) ; ++ i ) { ArrayRealVectorTest . RealVectorTestImpl v = new ArrayRealVectorTest . RealVectorTestImpl ( b . getColumn ( i ) ) ; assertEquals ( 0 , es . solve ( v ) . subtract ( xRef . getColumnVector ( i ) ) . getNorm ( ) , 2.0E-11 ) ; } } @ Override public void setUp ( ) { } @ Override public void tearDown ( ) { } }

Fix:
assertEquals ( 0 , solution . subtract ( xRef ) . getNorm ( ) , 2.5E-12 ) ;
Buggy code:
public class HashFactory { private HashFactory ( ) { } public enum HashType { LINEAR , POLYNOMIAL , MURMUR ; } public static HashFunction [ ] createHashFunctions ( HashFactory . HashType type , int numFunctions ) { HashFunction [ ] hashFunction = new HashFunction [ numFunctions ] ; <START_BUG> Random seed = new Random ( 11 ) ; <END_BUG> switch ( type ) { case LINEAR : for ( int i = 0 ; i < numFunctions ; i ++ ) { hashFunction [ i ] = new HashFactory . LinearHash ( seed . nextInt ( ) , seed . nextInt ( ) ) ; } break ; case POLYNOMIAL : for ( int i = 0 ; i < numFunctions ; i ++ ) { hashFunction [ i ] = new HashFactory . PolynomialHash ( seed . nextInt ( ) , seed . nextInt ( ) , seed . nextInt ( ) ) ; } break ; case MURMUR : for ( int i = 0 ; i < numFunctions ; i ++ ) { hashFunction [ i ] = new HashFactory . MurmurHashWrapper ( seed . nextInt ( ) ) ; } break ; } return hashFunction ; } static class LinearHash implements HashFunction { private final int seedA ; private final int seedB ; LinearHash ( int seedA , int seedB ) { } @ Override public int hash ( byte [ ] bytes ) { } } static class PolynomialHash implements HashFunction { private final int seedA ; private final int seedB ; private final int seedC ; PolynomialHash ( int seedA , int seedB , int seedC ) { } @ Override public int hash ( byte [ ] bytes ) { } } static class MurmurHashWrapper implements HashFunction { private final int seed ; MurmurHashWrapper ( int seed ) { } @ Override public int hash ( byte [ ] bytes ) { } } }

Fix:
Random seed = RandomUtils . getRandom ( 11 ) ;
Buggy code:
public class OpAnd extends Operator { public OpAnd ( int pos , SpelNodeImpl ... operands ) { } @ Override public TypedValue getValueInternal ( ExpressionState state ) throws EvaluationException { } private void assertTypedValueNotNull ( TypedValue typedValue ) { <START_BUG> if ( NULL_TYPED_VALUE . equals ( typedValue ) ) { <END_BUG> throw new org . springframework . expression . spel . SpelEvaluationException ( SpelMessage . TYPE_CONVERSION_ERROR , "null" , "boolean" ) ; } } }

Fix:
if ( NULL . equals ( typedValue ) ) {
Buggy code:
public class OverseerTest extends SolrTestCaseJ4 { static final int TIMEOUT = 10000 ; private static final boolean DEBUG = false ; @ BeforeClass public static void beforeClass ( ) throws Exception { } @ Test public void testShardAssignment ( ) throws Exception { } @ Test public void testShardAssignmentBigger ( ) throws Exception { } private void waitForSliceCount ( ZkStateReader stateReader , String collection , int i ) throws InterruptedException , KeeperException { } private void waitForCollections ( ZkStateReader stateReader , String ... collections ) throws InterruptedException , KeeperException { } @ Test public void testStateChange ( ) throws Exception { } private void verifyStatus ( ZkStateReader reader , String expectedState ) throws InterruptedException { } @ Test public void testOverseerFailure ( ) throws Exception { } private SolrZkClient electNewOverseer ( String address ) throws IOException , InterruptedException , TimeoutException , KeeperException { SolrZkClient zkClient = new SolrZkClient ( address , OverseerTest . TIMEOUT ) ; ZkStateReader reader = new ZkStateReader ( zkClient ) ; LeaderElector overseerElector = new LeaderElector ( zkClient ) ; <START_BUG> ElectionContext ec = new OverseerElectionContext ( address , zkClient , reader ) ; <END_BUG> overseerElector . setup ( ec ) ; overseerElector . joinElection ( ec ) ; return zkClient ; } }

Fix:
ElectionContext ec = new OverseerElectionContext ( address . replaceAll ( "//" , "_" ) , zkClient , reader ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class DeployedXmlJMSManagementTestCase { private static ModelControllerClient client ; private static ServerDeploymentManager manager ; public static final String TEST_JMS_XML = "test-jms.xml" ; @ Deployment public static Archive < ? > deploy ( ) { <START_BUG> return ShrinkWrap . create ( JavaArchive . class , "testJMSXmlDeployment.jar" ) . addPackage ( DeployedXmlJMSManagementTestCase . class . getPackage ( ) ) . addAsManifestResource ( DeployedXmlJMSManagementTestCase . class . getPackage ( ) , "MANIFEST.MF" , "MANIFEST.MF" ) ; <END_BUG> } @ BeforeClass public static void deployDatasource ( ) throws Throwable { } @ AfterClass public static void undeployDatasource ( ) throws IOException { } @ Test public void testDeployedQueueInManagementModel ( ) throws IOException { } @ Test public void testDeployedTopicInManagementModel ( ) throws IOException { } }

Fix:
return ShrinkWrap . create ( JavaArchive . class , "testJMSXmlDeployment.jar" ) . addClass ( DeployedXmlJMSManagementTestCase . class ) . addAsManifestResource ( DeployedXmlJMSManagementTestCase . class . getPackage ( ) , "MANIFEST.MF" , "MANIFEST.MF" ) ;
Buggy code:
@ RunWith ( MockitoJUnitRunner . class ) public class WeaponListTest { MainGame mg ; GameState gs ; Weapon w ; WeaponList wl ; Image img ; @ Before public void setUp ( ) throws Exception { mg = new MainGame ( "TestGame" ) ; gs = new GameState ( mg ) ; mg = mock ( MainGame . class ) ; w = new Weapon ( 1 , 2 , 3 , 4 ) ; <START_BUG> wl = new WeaponList ( w , mg , gs ) ; <END_BUG> wl . add ( w ) ; Player player = mock ( Player . class ) ; PlayerList pl = new PlayerList ( player , mg , gs ) ; pl . add ( player ) ; when ( mg . getPlayerList ( ) ) . thenReturn ( pl ) ; when ( player . isShot ( ) ) . thenReturn ( true ) ; img = mock ( Image . class ) ; wl . setLaserbeamimage ( img ) ; wl . setLasertipimage ( img ) ; } @ Test public void testConstructor ( ) { } @ Test public void testIntersectWeaponsWithCircle1 ( ) { } @ Test public void testIntersectWeaponsWithCircle2 ( ) { } @ Test public void testDrawWeapons ( ) { } }

Fix:
wl = new WeaponList ( w , mg , gs , true ) ;