nus-yam/ex-repair huggingface dataset:
Buggy code:
public class WorkbenchWizardElement extends WorkbenchAdapter implements IAdaptable , IPluginContribution , IWizardDescriptor { private String id ; private ImageDescriptor imageDescriptor ; private SelectionEnabler selectionEnabler ; private IConfigurationElement configurationElement ; private ImageDescriptor descriptionImage ; private WizardCollectionElement parentCategory ; public static final String TAG_PROJECT = "project" ; private static final String [ ] EMPTY_TAGS = new String [ 0 ] ; private static final String [ ] PROJECT_TAGS = new String [ ] { WorkbenchWizardElement . TAG_PROJECT } ; public WorkbenchWizardElement ( IConfigurationElement configurationElement ) { } public boolean canHandleSelection ( IStructuredSelection selection ) { } public IStructuredSelection adaptedSelection ( IStructuredSelection selection ) { } public Object createExecutableExtension ( ) throws CoreException { } public Object getAdapter ( Class adapter ) { } public IConfigurationElement getConfigurationElement ( ) { } public String getDescription ( ) { } public ImageDescriptor getImageDescriptor ( ) { } public ImageDescriptor getImageDescriptor ( Object element ) { } public String getLabel ( Object element ) { } protected SelectionEnabler getSelectionEnabler ( ) { } private IStructuredSelection convertToResources ( IStructuredSelection originalSelection ) { } public String getLocalId ( ) { } public String getPluginId ( ) { <START_BUG> return ( configurationElement ) != null ? configurationElement . getDeclaringExtension ( ) . getNamespace ( ) : null ; <END_BUG> } public ImageDescriptor getDescriptionImage ( ) { } public String getHelpHref ( ) { } public IWorkbenchWizard createWizard ( ) throws CoreException { } public String getId ( ) { } public String getLabel ( ) { } public IWizardCategory getCategory ( ) { } public WizardCollectionElement getCollectionElement ( ) { } public String [ ] getTags ( ) { } public Object getParent ( Object object ) { } public void setParent ( WizardCollectionElement parent ) { } }

Fix:
return ( configurationElement ) != null ? configurationElement . getNamespace ( ) : null ;
Buggy code:
public class Island { private int minX ; private int minZ ; private int minProtectedX ; private int minProtectedZ ; private int protectionRange ; private int y ; private Location center ; private World world ; private UUID owner ; private long createdDate ; private long updatedDate ; private String password ; private int votes ; private int islandDistance ; private boolean locked = false ; private boolean isSpawn = false ; private HashMap < EntityType , Integer > entities = new HashMap < EntityType , Integer > ( ) ; public Island ( String serial ) { } public Island ( int x , int z ) { } public Island ( int x , int z , UUID owner ) { } public Island ( int x , int z , int protectionRange , Location center , UUID owner , long createdDate , long updatedDate , String password , int votes ) { } public boolean onIsland ( Location target ) { if ( ( world ) != null ) { <START_BUG> if ( ( target . getWorld ( ) . equals ( world ) ) || ( ( Settings . newNether ) && ( target . getWorld ( ) . equals ( ASkyBlock . getNetherWorld ( ) ) ) ) ) { <END_BUG> if ( ( ( ( ( target . getX ( ) ) >= ( ( center . getBlockX ( ) ) - ( ( protectionRange ) // 2 ) ) ) && ( ( target . getX ( ) ) < ( ( center . getBlockX ( ) ) + ( ( protectionRange ) // 2 ) ) ) ) && ( ( target . getZ ( ) ) >= ( ( center . getBlockZ ( ) ) - ( ( protectionRange ) // 2 ) ) ) ) && ( ( target . getZ ( ) ) < ( ( center . getBlockZ ( ) ) + ( ( protectionRange ) // 2 ) ) ) ) { return true ; } } } return false ; } public boolean inIslandSpace ( Location target ) { } public boolean inIslandSpace ( int x , int z ) { } public int getMinX ( ) { } public void setMinX ( int minX ) { } public int getMinZ ( ) { } public void setMinZ ( int minZ ) { } public int getMinProtectedX ( ) { } public int getMinProtectedZ ( ) { } public int getProtectionSize ( ) { } public void setProtectionSize ( int protectionSize ) { } public int getIslandDistance ( ) { } public void setIslandDistance ( int islandDistance ) { } public Location getCenter ( ) { } public void setCenter ( Location center ) { } public UUID getOwner ( ) { } public void setOwner ( UUID owner ) { } public long getCreatedDate ( ) { } public void setCreatedDate ( long createdDate ) { } public long getUpdatedDate ( ) { } public void setUpdatedDate ( long updatedDate ) { } public String getPassword ( ) { } public void setPassword ( String password ) { } public int getVotes ( ) { } public void setVotes ( int votes ) { } public boolean isLocked ( ) { } public void setLocked ( boolean locked ) { } public String serialize ( ) { } public List < UUID > getMembers ( ) { } public boolean isSpawn ( ) { } public void setSpawn ( boolean isSpawn ) { } public void addEntity ( EntityType type ) { } public int getEntity ( EntityType type ) { } public HashMap < EntityType , Integer > getEntities ( ) { } public void clearStats ( ) { } }

Fix:
if ( ( target . getWorld ( ) . equals ( world ) ) || ( ( ( Settings . createNether ) && ( Settings . newNether ) ) && ( target . getWorld ( ) . equals ( ASkyBlock . getNetherWorld ( ) ) ) ) ) {
Buggy code:
@ RunWith ( JUnit4TestRunner . class ) public class BlueprintContainerBTCustomizerTest extends AbstractIntegrationTest { @ Test public void test ( ) throws Exception { ConfigurationAdmin ca = getOsgiService ( ConfigurationAdmin . class ) ; Configuration cf = ca . getConfiguration ( "blueprint-sample-placeholder" , null ) ; Hashtable props = new Hashtable ( ) ; props . put ( "key.b" , "10" ) ; cf . update ( props ) ; ServiceReference sr = bundleContext . getServiceReference ( "org.osgi.service.framework.CompositeBundleFactory" ) ; if ( sr != null ) { CompositeBundleFactory cbf = ( ( CompositeBundleFactory ) ( bundleContext . getService ( sr ) ) ) ; Map < String , String > frameworkConfig = new HashMap < String , String > ( ) ; Map < String , String > compositeManifest = new HashMap < String , String > ( ) ; compositeManifest . put ( Constants . BUNDLE_SYMBOLICNAME , "test-composite" ) ; compositeManifest . put ( Constants . BUNDLE_VERSION , "1.0.0" ) ; compositeManifest . put ( Constants . IMPORT_PACKAGE , "org.osgi.service.blueprint;version=\"[1.0.0,2.0.0)\",<seq2seq4repair_space>org.osgi.service.blueprint.container;version=1.0" ) ; compositeManifest . put ( Constants . EXPORT_PACKAGE , "org.apache.aries.blueprint.sample" ) ; CompositeBundle cb = cbf . installCompositeBundle ( frameworkConfig , "test-composite" , compositeManifest ) ; BundleContext compositeBundleContext = cb . getCompositeFramework ( ) . getBundleContext ( ) ; <START_BUG> MavenArtifactProvisionOption mapo = CoreOptions . mavenBundle ( ) . groupId ( "org.apache.aries.blueprint" ) . artifactId ( "org.apache.aries.blueprint.sample" ) . version ( "0.1-incubating-SNAPSHOT" ) ; <END_BUG> InputStream is = new URL ( mapo . getURL ( ) ) . openStream ( ) ; Bundle bundle = compositeBundleContext . installBundle ( mapo . getURL ( ) , is ) ; assertNotNull ( bundle ) ; cb . start ( ) ; bundle . start ( ) ; testBlueprintContainer ( compositeBundleContext , bundle ) ; bundleContext . ungetService ( sr ) ; } } @ org . ops4j . pax . exam . junit . Configuration public static Option [ ] configuration ( ) { } }

Fix:
MavenArtifactProvisionOption mapo = mavenBundleInTest ( "org.apache.aries.blueprint" , "org.apache.aries.blueprint.sample" ) ;
Buggy code:
public class JavadocArgumentExpression extends Expression { public char [ ] token ; public Argument argument ; public JavadocArgumentExpression ( char [ ] name , int startPos , int endPos , TypeReference typeRef ) { } private TypeBinding internalResolveType ( Scope scope ) { this . constant = NotAConstant ; if ( ( this . resolvedType ) != null ) return this . resolvedType . isValidBinding ( ) ? this . resolvedType : null ; if ( ( this . argument ) != null ) { TypeReference typeRef = this . argument . type ; if ( typeRef != null ) { this . resolvedType = typeRef . getTypeBinding ( scope ) ; typeRef . resolvedType = this . resolvedType ; if ( ! ( this . resolvedType . isValidBinding ( ) ) ) { scope . problemReporter ( ) . javadocInvalidType ( typeRef , this . resolvedType , scope . getDeclarationModifiers ( ) ) ; return null ; } if ( isTypeUseDeprecated ( this . resolvedType , scope ) ) { scope . problemReporter ( ) . javadocDeprecatedType ( this . resolvedType , typeRef , scope . getDeclarationModifiers ( ) ) ; return null ; } <START_BUG> return this . resolvedType = scope . convertToRawType ( this . resolvedType ) ; <END_BUG> } } return null ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public void resolve ( BlockScope scope ) { } public TypeBinding resolveType ( BlockScope scope ) { } public TypeBinding resolveType ( ClassScope scope ) { } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
return this . resolvedType = scope . environment ( ) . convertToRawType ( this . resolvedType ) ;
Buggy code:
public class Upload extends HttpServlet { protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { boolean isMultipart = ServletFileUpload . isMultipartContent ( request ) ; if ( isMultipart ) { FileItemFactory factory = new DiskFileItemFactory ( ) ; ServletFileUpload upload = new ServletFileUpload ( factory ) ; String to = null ; InputStream fileStream = null ; try { upload . setFileSizeMax ( ( ( 50 * 1024 ) * 1024 ) ) ; List items = upload . parseRequest ( request ) ; Iterator iterator = items . iterator ( ) ; while ( iterator . hasNext ( ) ) { FileItem item = ( ( FileItem ) ( iterator . next ( ) ) ) ; String name = item . getFieldName ( ) ; InputStream stream = item . getInputStream ( ) ; if ( item . isFormField ( ) ) { if ( name . equals ( "to" ) ) { to = Streams . asString ( stream ) ; } } else if ( name . equals ( "file" ) ) { fileStream = stream ; } } if ( ( to == null ) || ( fileStream == null ) ) { throw new RuntimeException ( "Params<seq2seq4repair_space>Error" ) ; } File file = new File ( to ) ; if ( file . isDirectory ( ) ) { throw new IllegalArgumentException ( ( ( "Can't<seq2seq4repair_space>upload<seq2seq4repair_space>to<seq2seq4repair_space>a<seq2seq4repair_space>folder<seq2seq4repair_space>`" + to ) + "`" ) ) ; } if ( file . exists ( ) ) { if ( ( ! ( file . delete ( ) ) ) || ( ! ( file . createNewFile ( ) ) ) ) { throw new Exception ( "Permission<seq2seq4repair_space>denied" ) ; } } else <START_BUG> if ( ( ! ( file . getParentFile ( ) . mkdirs ( ) ) ) || ( ! ( file . createNewFile ( ) ) ) ) { <END_BUG> throw new Exception ( "Permission<seq2seq4repair_space>denied" ) ; } if ( ! ( file . canWrite ( ) ) ) { throw new Exception ( "Permission<seq2seq4repair_space>denied." ) ; } OutputStream dst = new FileOutputStream ( file ) ; Streams . copy ( fileStream , dst , true ) ; response . getWriter ( ) . write ( "0" ) ; } catch ( Exception e ) { System . out . print ( e . getMessage ( ) ) ; response . getWriter ( ) . write ( "1" ) ; throw new ServletException ( e . getMessage ( ) , e ) ; } } } protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } }

Fix:
if ( ( ( ! ( file . getParentFile ( ) . exists ( ) ) ) && ( ! ( file . getParentFile ( ) . mkdirs ( ) ) ) ) || ( ! ( file . createNewFile ( ) ) ) ) {
Buggy code:
public class Snippet97 { public static void main ( String [ ] args ) { final Display display = new Display ( ) ; Shell shell = new Shell ( display ) ; final Tree tree = new Tree ( shell , ( ( SWT . BORDER ) | ( SWT . MULTI ) ) ) ; final Menu menu = new Menu ( shell , SWT . POP_UP ) ; tree . setMenu ( menu ) ; for ( int i = 0 ; i < 12 ; i ++ ) { <START_BUG> TreeItem item = new TreeItem ( tree , SWT . NULL ) ; <END_BUG> item . setText ( ( "Item<seq2seq4repair_space>" + i ) ) ; } menu . addListener ( Show , new Listener ( ) { public void handleEvent ( Event event ) { MenuItem [ ] menuItems = menu . getItems ( ) ; for ( int i = 0 ; i < ( menuItems . length ) ; i ++ ) { menuItems [ i ] . dispose ( ) ; } TreeItem [ ] treeItems = tree . getSelection ( ) ; for ( int i = 0 ; i < ( treeItems . length ) ; i ++ ) { MenuItem menuItem = new MenuItem ( menu , SWT . PUSH ) ; menuItem . setText ( treeItems [ i ] . getText ( ) ) ; } } } ) ; tree . setSize ( 200 , 200 ) ; shell . setSize ( 300 , 300 ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
TreeItem item = new TreeItem ( tree , SWT . NONE ) ;
Buggy code:
public class SimpleLayout extends Layout { StringBuffer sbuf = new StringBuffer ( 128 ) ; public SimpleLayout ( ) { } public void activateOptions ( ) { } public String format ( LoggingEvent event ) { sbuf . setLength ( 0 ) ; sbuf . append ( event . priority . toString ( ) ) ; sbuf . append ( "<seq2seq4repair_space>-<seq2seq4repair_space>" ) ; <START_BUG> sbuf . append ( event . message ) ; <END_BUG> sbuf . append ( Layout . LINE_SEP ) ; return sbuf . toString ( ) ; } public String [ ] getOptionStrings ( ) { } public boolean ignoresThrowable ( ) { } public void setOption ( String option , String value ) { } }

Fix:
sbuf . append ( event . getRenderedMessage ( ) ) ;
Buggy code:
public class RenewServlet extends HttpServlet { private static final long serialVersionUID = - 330119396067396L ; @ Override public void doGet ( HttpServletRequest req , HttpServletResponse resp ) throws IOException { resp . setContentType ( "text//plain" ) ; String card_filter = req . getParameter ( "card_number" ) ; String email = req . getParameter ( "email" ) ; UserService userService = UserServiceFactory . getUserService ( ) ; User user = null ; List < LibraryCard > cards = null ; <START_BUG> if ( ( userService . isUserAdmin ( ) ) && ( email != null ) ) { <END_BUG> user = User . find ( email ) ; } else if ( userService . isUserLoggedIn ( ) ) { email = userService . getCurrentUser ( ) . getEmail ( ) . toLowerCase ( ) ; user = User . find ( email ) ; if ( user == null ) { System . err . printf ( "email<seq2seq4repair_space>\'%s\'<seq2seq4repair_space>not<seq2seq4repair_space>found;<seq2seq4repair_space>aborting\n" , email ) ; return ; } System . out . printf ( "Renewing<seq2seq4repair_space>items<seq2seq4repair_space>for<seq2seq4repair_space>user<seq2seq4repair_space>\'%s\'\n" , user . email ) ; } if ( card_filter != null ) { if ( user != null ) { cards = new ArrayList < LibraryCard > ( 1 ) ; LibraryCard card = user . getLibraryCard ( card_filter ) ; if ( card == null ) { System . err . printf ( "card<seq2seq4repair_space>\'%s\'<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>for<seq2seq4repair_space>user<seq2seq4repair_space>\'%s\';<seq2seq4repair_space>aborting\n" , card_filter , user . email ) ; return ; } cards . add ( card ) ; } else { System . err . println ( "card_filter<seq2seq4repair_space>is<seq2seq4repair_space>only<seq2seq4repair_space>supported<seq2seq4repair_space>when<seq2seq4repair_space>logged<seq2seq4repair_space>in." ) ; return ; } } else { if ( user != null ) { cards = user . getLibraryCards ( ) ; } else { cards = LibraryCard . getAll ( ) ; } } if ( ( cards == null ) || ( cards . isEmpty ( ) ) ) { resp . getWriter ( ) . printf ( "No<seq2seq4repair_space>library<seq2seq4repair_space>cards<seq2seq4repair_space>have<seq2seq4repair_space>been<seq2seq4repair_space>added.\n" ) ; } else { for ( LibraryCard card : cards ) { System . out . printf ( "Renewing<seq2seq4repair_space>items<seq2seq4repair_space>for<seq2seq4repair_space>%s<seq2seq4repair_space>(%s)\n" , card . user . get ( ) . email , card . card_number ) ; resp . getWriter ( ) . printf ( "Renewing<seq2seq4repair_space>items<seq2seq4repair_space>for<seq2seq4repair_space>%s<seq2seq4repair_space>(%s)\n" , card . user . get ( ) . email , card . card_number ) ; LibraryRenewer . renew ( card , false , resp ) ; } } } }

Fix:
if ( ( ( userService . isUserLoggedIn ( ) ) && ( userService . isUserAdmin ( ) ) ) && ( email != null ) ) {
Buggy code:
public class NavigationDrawerFragment extends Fragment { private static final String STATE_SELECTED_POSITION = "selected_navigation_drawer_position" ; private static final String PREF_USER_LEARNED_DRAWER = "navigation_drawer_learned" ; private NavigationDrawerFragment . NavigationDrawerCallbacks mCallbacks ; private ActionBarDrawerToggle mDrawerToggle ; private DrawerLayout mDrawerLayout ; private ListView mDrawerListView ; private View mFragmentContainerView ; private int mCurrentSelectedPosition = 0 ; private boolean mFromSavedInstanceState ; private boolean mUserLearnedDrawer ; public NavigationDrawerFragment ( ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public void onActivityCreated ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { mDrawerListView = ( ( ListView ) ( inflater . inflate ( fragment_navigation_drawer , container , false ) ) ) ; mDrawerListView . setOnItemClickListener ( new AdapterView . OnItemClickListener ( ) { @ Override public void onItemClick ( AdapterView < ? > parent , View view , int position , long id ) { selectItem ( position ) ; } } ) ; <START_BUG> mDrawerListView . setAdapter ( new android . widget . ArrayAdapter ( getActionBar ( ) . getThemedContext ( ) , layout . simple_list_item_activated_1 , id . text1 , new String [ ] { getString ( title_section1 ) , getString ( title_section2 ) , getString ( title_section3 ) , getString ( title_section4 ) , getString ( title_section5 ) } ) ) ; <END_BUG> mDrawerListView . setItemChecked ( mCurrentSelectedPosition , true ) ; return mDrawerListView ; } public boolean isDrawerOpen ( ) { } public void setUp ( int fragmentId , DrawerLayout drawerLayout ) { } private void selectItem ( int position ) { } @ Override public void onAttach ( Activity activity ) { } @ Override public void onDetach ( ) { } @ Override public void onSaveInstanceState ( Bundle outState ) { } @ Override public void onConfigurationChanged ( Configuration newConfig ) { } @ Override public void onCreateOptionsMenu ( Menu menu , MenuInflater inflater ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private void showGlobalContextActionBar ( ) { } private ActionBar getActionBar ( ) { } public static interface NavigationDrawerCallbacks { void onNavigationDrawerItemSelected ( int position ) { } } }

Fix:
mDrawerListView . setAdapter ( new android . widget . ArrayAdapter ( getActionBar ( ) . getThemedContext ( ) , layout . simple_list_item_1 , id . text1 , new String [ ] { getString ( title_section1 ) , getString ( title_section2 ) , getString ( title_section3 ) , getString ( title_section4 ) , getString ( title_section5 ) } ) ) ;
Buggy code:
public abstract class ChartData < T extends DataSet < ? extends Entry > > { protected float mYMax = 0.0F ; protected float mYMin = 0.0F ; private float mYValueSum = 0.0F ; private int mYValCount = 0 ; private float mXValAverageLength = 0 ; protected ArrayList < String > mXVals ; protected ArrayList < T > mDataSets ; public ChartData ( ArrayList < String > xVals ) { } public ChartData ( String [ ] xVals ) { } public ChartData ( ArrayList < String > xVals , ArrayList < T > sets ) { } public ChartData ( String [ ] xVals , ArrayList < T > sets ) { } private ArrayList < String > arrayToArrayList ( String [ ] array ) { } private void init ( ) { } private void calcXValAverageLength ( ) { } private void isLegal ( ArrayList < T > dataSets ) { } public void notifyDataChanged ( ) { } protected void calcMinMax ( ArrayList < T > dataSets ) { } protected void calcYValueSum ( ArrayList < T > dataSets ) { } protected void calcYValueCount ( ArrayList < T > dataSets ) { } public int getDataSetCount ( ) { } public float getYMin ( ) { } public float getYMax ( ) { } public float getXValAverageLength ( ) { } public float getYValueSum ( ) { } public int getYValCount ( ) { } public ArrayList < String > getXVals ( ) { } public ArrayList < T > getDataSets ( ) { } protected int getDataSetIndexByLabel ( ArrayList < T > dataSets , String label , boolean ignorecase ) { } public int getXValCount ( ) { } protected String [ ] getDataSetLabels ( ) { } public Entry getEntryForHighlight ( Highlight highlight ) { } public T getDataSetByLabel ( String label , boolean ignorecase ) { int index = getDataSetIndexByLabel ( mDataSets , label , ignorecase ) ; <START_BUG> if ( ( index <= 0 ) || ( index >= ( mDataSets . size ( ) ) ) ) <END_BUG> return null ; else return mDataSets . get ( index ) ; } public T getDataSetByIndex ( int index ) { } public void addDataSet ( T d ) { } public boolean removeDataSet ( T d ) { } public boolean removeDataSet ( int index ) { } public void addEntry ( Entry e , int dataSetIndex ) { } public boolean removeEntry ( Entry e , int dataSetIndex ) { } public boolean removeEntry ( int xIndex , int dataSetIndex ) { } public T getDataSetForEntry ( Entry e ) { } public int [ ] getColors ( ) { } public static ArrayList < String > generateXVals ( int from , int to ) { } }

Fix:
if ( ( index < 0 ) || ( index >= ( mDataSets . size ( ) ) ) )
Buggy code:
public class DisplayModel extends ActionBarActivity { TextView modeltext ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_display_model ) ; modeltext = ( ( TextView ) ( findViewById ( R . id . modeltext ) ) ) ; String out = "" ; try { BufferedReader reader = new BufferedReader ( new FileReader ( "//sdcard//finalmodel.txt" ) ) ; try { String line ; while ( ( line = reader . readLine ( ) ) != null ) { out = ( out + line ) + "\n" ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } } catch ( FileNotFoundException e ) { <START_BUG> out = "Model<seq2seq4repair_space>has<seq2seq4repair_space>not<seq2seq4repair_space>been<seq2seq4repair_space>generated<seq2seq4repair_space>yet" ; <END_BUG> e . printStackTrace ( ) ; } modeltext . setText ( out ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
out = "Model<seq2seq4repair_space>has<seq2seq4repair_space>not<seq2seq4repair_space>been<seq2seq4repair_space>generated<seq2seq4repair_space>yet." ;
Buggy code:
public class ImgWrapper { public static void loadImages ( String folderDir ) { } public static ImageInfo getImage ( String imgName ) { ImageDao imgDao = ImageDao . getInstance ( ) ; <START_BUG> return imgDao . load ( imgName ) ; <END_BUG> } @ Test public void testBatchIntoDB ( ) { } @ Test public void testQueryImage ( ) throws IOException { } }

Fix:
return imgDao . findOne ( imgName ) ;
Buggy code:
@ SuppressLint ( "DefaultLocale" ) public class ServiceHelper extends Service implements Callback { @ Override public IBinder onBind ( Intent intent ) { } public static final int BEGIN_WORK = 100 ; public static final int BEGIN_WORK_REVENUE = 1001 ; public static final int HAS_DONE = 101 ; public static final int HAS_DONE_REVENUE = 1010 ; private Messenger mClientMessenger ; private Handler targetHandler1 = new Handler ( ) { public void handleMessage ( Message msg ) { } } ; private Handler targetHandler = new Handler ( this ) ; private Messenger mServiceMessenger = new Messenger ( targetHandler ) ; private ConsumeDaoImpl dao ; private RevenueDaoImpl daoRevenue ; private List < Consume > list ; private List < Revenue > listRevenue ; private double totalMoney ; private double totalMoney_revenue ; private int INSERT_SUCCESS ; private int INSERT_SUCCESS_REVENUE ; private boolean is_consume ; private boolean is_revenue ; public class Task extends AsyncTask < Void , Void , Void > { public int taskProgress ; public Task ( int taskProgress ) { } public Task ( ) { } @ Override protected void onPreExecute ( ) { } @ Override protected Void doInBackground ( Void ... params ) { Log . e ( "debug" , "---background<seq2seq4repair_space>--->" ) ; switch ( taskProgress ) { case 0 : if ( is_consume ) { list = dao . findAll ( ) ; } if ( is_revenue ) { listRevenue = daoRevenue . findAll ( ) ; } break ; case 1 : totalMoney = 0 ; totalMoney_revenue = 0 ; INSERT_SUCCESS = 0 ; INSERT_SUCCESS_REVENUE = 0 ; if ( is_consume ) { for ( int i = 0 ; i < ( list . size ( ) ) ; i ++ ) { Consume consume = list . get ( i ) ; double total = consume . getAmount ( ) ; totalMoney += total ; } Log . e ( "debug" , "============================+++++++++++++++" ) ; Log . e ( "debug" , ( "totalMoney=" + ( totalMoney ) ) ) ; Log . e ( "debug" , "============================+++++++++++++++" ) ; INSERT_SUCCESS = dao . insert ( totalMoney , ( ( list . size ( ) ) - 1 ) ) ; } if ( is_revenue ) { listRevenue = daoRevenue . findAll ( ) ; for ( int i = 0 ; i < ( listRevenue . size ( ) ) ; i ++ ) { Revenue consume = listRevenue . get ( i ) ; double total = consume . getAmount ( ) ; totalMoney_revenue += total ; } Log . e ( "debug" , "REVENUE============================+++++++++++++++" ) ; Log . e ( "debug" , ( "REVENUETOTALMONEY=" + ( totalMoney_revenue ) ) ) ; Log . e ( "debug" , "REVENUE============================+++++++++++++++" ) ; <START_BUG> INSERT_SUCCESS_REVENUE = daoRevenue . insert ( totalMoney_revenue , ( ( listRevenue . size ( ) ) - 1 ) ) ; <END_BUG> } break ; case - 1 : if ( is_consume ) { list = dao . findAll ( ) ; } if ( is_revenue ) { listRevenue = daoRevenue . findAll ( ) ; } break ; } return null ; } @ Override protected void onPostExecute ( Void result ) { } } @ SuppressLint ( "DefaultLocale" ) @ Override public boolean handleMessage ( Message msg ) { } }

Fix:
INSERT_SUCCESS_REVENUE = daoRevenue . insert ( totalMoney_revenue , listRevenue . size ( ) ) ;
Buggy code:
public class Checker extends ShadowMunger { private String msg ; private boolean isError ; public Checker ( DeclareErrorOrWarning deow ) { } public ShadowMunger concretize ( ResolvedTypeX fromType , World world , PerClause clause ) { } public void specializeOn ( Shadow shadow ) { } public void implementOn ( Shadow shadow ) { } public boolean match ( Shadow shadow , World world ) { if ( super . match ( shadow , world ) ) { IMessage message = new Message ( msg , shadow . toString ( ) , ( isError ? IMessage . ERROR : IMessage . WARNING ) , shadow . getSourceLocation ( ) ) ; world . getMessageHandler ( ) . handleMessage ( message ) ; <START_BUG> AsmAdapter . checkerMunger ( world . getModel ( ) , shadow ) ; <END_BUG> } return false ; } public int compareTo ( Object other ) { } public Collection getThrownExceptions ( ) { } }

Fix:
AsmAdviceRelationshipProvider . checkerMunger ( world . getModel ( ) , shadow ) ;
Buggy code:
public class StandardDrawing extends CompositeFigure implements Drawing { private transient List fListeners ; private transient Thread fDrawingLockHolder = null ; private String myTitle ; private static final long serialVersionUID = - 2602151437447962046L ; private int drawingSerializedDataVersion = 1 ; public StandardDrawing ( ) { } public void addDrawingChangeListener ( DrawingChangeListener listener ) { } public void removeDrawingChangeListener ( DrawingChangeListener listener ) { } public Iterator drawingChangeListeners ( ) { } public synchronized Figure orphan ( Figure figure ) { } public synchronized Figure add ( Figure figure ) { } public void figureInvalidated ( FigureChangeEvent e ) { } public void figureRequestUpdate ( FigureChangeEvent e ) { } public HandleEnumeration handles ( ) { } public Rectangle displayBox ( ) { } public void basicDisplayBox ( Point p1 , Point p2 ) { } public synchronized void lock ( ) { } public synchronized void unlock ( ) { if ( ( fDrawingLockHolder ) != null ) { fDrawingLockHolder = null ; <START_BUG> notifyAll ( ) ; <END_BUG> } } private void readObject ( ObjectInputStream s ) throws IOException , ClassNotFoundException { } public String getTitle ( ) { } public void setTitle ( String newTitle ) { } }

Fix:
notify ( ) ;
Buggy code:
public class XADataSourceAutoConfigurationTests { @ Test public void wrapExistingXaDataSource ( ) throws Exception { } @ Test public void createFromUrl ( ) throws Exception { } @ Test public void createFromClass ( ) throws Exception { <START_BUG> ApplicationContext context = createContext ( XADataSourceAutoConfigurationTests . FromProperties . class , "spring.datasource.xa.data-source-class:org.hsqldb.jdbc.pool.JDBCXADataSource" , "spring.datasource.xa.properties.database-name:test" ) ; <END_BUG> context . getBean ( DataSource . class ) ; XADataSourceAutoConfigurationTests . MockXADataSourceWrapper wrapper = context . getBean ( XADataSourceAutoConfigurationTests . MockXADataSourceWrapper . class ) ; JDBCXADataSource dataSource = ( ( JDBCXADataSource ) ( wrapper . getXaDataSource ( ) ) ) ; assertNotNull ( dataSource ) ; assertThat ( dataSource . getDatabaseName ( ) , equalTo ( "test" ) ) ; } private ApplicationContext createContext ( Class < ? > configuration , String ... env ) { } @ Configuration static class WrapExisting { @ Bean public XADataSourceAutoConfigurationTests . MockXADataSourceWrapper wrapper ( ) { } @ Bean public XADataSource xaDataSource ( ) { } } @ Configuration static class FromProperties { @ Bean public XADataSourceAutoConfigurationTests . MockXADataSourceWrapper wrapper ( ) { } } private static class MockXADataSourceWrapper implements XADataSourceWrapper { private XADataSource dataSource ; @ Override public DataSource wrapDataSource ( XADataSource dataSource ) { } public XADataSource getXaDataSource ( ) { } } }

Fix:
ApplicationContext context = createContext ( XADataSourceAutoConfigurationTests . FromProperties . class , "spring.datasource.xa.data-source-class-name:org.hsqldb.jdbc.pool.JDBCXADataSource" , "spring.datasource.xa.properties.database-name:test" ) ;
Buggy code:
public class SkipTest { private SkipTest ( ) { } public static boolean skipIt ( String listFileName , String testName ) throws Exception { boolean answer = false ; InputStream is = RunTest . loadTestResource ( ( ( "suites" + '//' ) + listFileName ) ) ; if ( is == null ) { System . out . println ( ( "File<seq2seq4repair_space>not<seq2seq4repair_space>found:<seq2seq4repair_space>" + listFileName ) ) ; answer = false ; return answer ; } <START_BUG> BufferedReader listFile = new BufferedReader ( new InputStreamReader ( is ) ) ; <END_BUG> String str = "" ; while ( ( str = listFile . readLine ( ) ) != null ) { if ( testName . equals ( str ) ) answer = true ; } return answer ; } }

Fix:
BufferedReader listFile = new BufferedReader ( new InputStreamReader ( is , "UTF-8" ) ) ;
Buggy code:
public class Choice extends Sequence { private BerNode currentChoice ; public Choice ( ) { } public Choice ( String name ) { } public void encode ( BerOutputStream out ) throws IOException { } public void decode ( BerInputStream in ) throws IOException { } @ Override public void readElement ( int tag , BerInputStream in ) throws IOException { } public void decode ( BerParser parser , BerInputStream in ) throws IOException { } public BerNode getCurrentChoice ( ) throws AsnFatalException { currentChoice = getChosenElementWhenThisIsChoice ( ) ; <START_BUG> if ( ( currentChoice ) == null ) <END_BUG> throw new AsnFatalException ( ( "\n<seq2seq4repair_space>>><seq2seq4repair_space>You<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>set<seq2seq4repair_space>one<seq2seq4repair_space>element<seq2seq4repair_space>of<seq2seq4repair_space>your<seq2seq4repair_space>choice<seq2seq4repair_space>object<seq2seq4repair_space>(Or<seq2seq4repair_space>you<seq2seq4repair_space>have<seq2seq4repair_space>set<seq2seq4repair_space>more<seq2seq4repair_space>than<seq2seq4repair_space>one<seq2seq4repair_space>element).<seq2seq4repair_space>(if<seq2seq4repair_space>exists)name<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>problemeatic<seq2seq4repair_space>choice<seq2seq4repair_space>object<seq2seq4repair_space>is:<seq2seq4repair_space>" + ( getName ( ) ) ) ) ; return currentChoice ; } public BerNode getNodeIfExists ( int tagNumber ) { } private void setAllElementsAsOptional ( ) { } public String toString ( ) { } }

Fix:
if ( ( ( currentChoice ) == null ) && ( ( isOptional ) == false ) )
Buggy code:
public class WebSession extends Session { private static final long serialVersionUID = 1L ; private static final Logger logger = LoggerFactory . getLogger ( WebSession . class ) ; public static WebSession get ( ) { } private static final IFeedbackMessageFilter MESSAGES_FOR_COMPONENTS = new IFeedbackMessageFilter ( ) { private static final long serialVersionUID = 1L ; public boolean accept ( FeedbackMessage message ) { } } ; private static final IFeedbackMessageFilter RENDERED_SESSION_SCOPED_MESSAGES = new IFeedbackMessageFilter ( ) { private static final long serialVersionUID = 1L ; public boolean accept ( FeedbackMessage message ) { } } ; private static final MetaDataKey < Boolean > BROWSER_WAS_POLLED_KEY = new MetaDataKey < Boolean > ( ) { private static final long serialVersionUID = 1L ; } ; public WebSession ( Request request ) { } @ Override public void cleanupFeedbackMessages ( ) { } protected void cleanupComponentFeedbackMessages ( ) { } @ Override public void invalidate ( ) { } public boolean authenticate ( final String username , final String password ) { } @ Override public WebClientInfo getClientInfo ( ) { if ( ( clientInfo ) == null ) { RequestCycle requestCycle = RequestCycle . get ( ) ; if ( getApplication ( ) . getRequestCycleSettings ( ) . getGatherExtendedBrowserInfo ( ) ) { if ( ( getMetaData ( WebSession . BROWSER_WAS_POLLED_KEY ) ) == null ) { setMetaData ( WebSession . BROWSER_WAS_POLLED_KEY , Boolean . TRUE ) ; Request request = requestCycle . getRequest ( ) ; IRequestHandler activeRequestHandler = requestCycle . getActiveRequestHandler ( ) ; String url = requestCycle . urlFor ( activeRequestHandler ) . toString ( ) ; <START_BUG> String relativeUrl = requestCycle . getUrlRenderer ( ) . renderContextPathRelativeUrl ( url , request ) ; <END_BUG> Page browserInfoPage = newBrowserInfoPage ( relativeUrl ) ; throw new org . apache . wicket . RestartResponseException ( browserInfoPage ) ; } setMetaData ( WebSession . BROWSER_WAS_POLLED_KEY , null ) ; } clientInfo = new WebClientInfo ( requestCycle ) ; } return ( ( WebClientInfo ) ( clientInfo ) ) ; } protected WebPage newBrowserInfoPage ( String url ) { } }

Fix:
String relativeUrl = requestCycle . getUrlRenderer ( ) . renderContextPathRelativeUrl ( url ) ;
Buggy code:
public class UsuarioControl { private int loggedInUser ; public UsuarioControl ( ) { } public void cadastrarUsuario ( String nome , String endereco , Integer CPF , int telefone , String username , String senha ) throws BusinessException { } public void trocarSenha ( int uid , String senhaNova ) throws BusinessException { } public void fazerLogin ( String username , String senha ) throws BusinessException { HashMap < String , String > filters = new HashMap < String , String > ( ) ; filters . put ( "username" , username ) ; filters . put ( "senha" , senha ) ; ArrayList < Usuario > userlist = ( ( ArrayList < Usuario > ) ( ( ArrayList < ? > ) ( manager . fetch ( filters ) ) ) ) ; <START_BUG> if ( userlist != null ) { <END_BUG> int id = userlist . get ( 0 ) . getId ( ) ; setLoggedUserID ( id ) ; } else { String msg = "Falha<seq2seq4repair_space>no<seq2seq4repair_space>login:<seq2seq4repair_space>\n" ; if ( userlist == null ) { msg += "Usuario<seq2seq4repair_space>ou<seq2seq4repair_space>Senha<seq2seq4repair_space>incorretos\n" ; } throw new BusinessException ( msg ) ; } } public void fazerLogout ( ) { } public Usuario getUserFromID ( int id ) { } public void darPontucao ( int aid , int p ) throws BusinessException { } public int getLoggedUserID ( ) { } private void setLoggedUserID ( int id ) { } public boolean mediadorLogado ( ) { } }

Fix:
if ( ! ( userlist . isEmpty ( ) ) ) {
Buggy code:
class MatchesExpression implements Exp { private final Val _val ; private final Const _const ; private final String _single ; private final String _multi ; private final String _escape ; public MatchesExpression ( Val val , Const con , String single , String multi , String escape ) { } public ExpState initialize ( Select sel , ExpContext ctx , Map contains ) { } public void appendTo ( Select sel , ExpContext ctx , ExpState state , SQLBuffer buf ) { } private static String replaceEscape ( String str , String from , String to , String escape ) { String [ ] parts = Strings . split ( str , from , Integer . MAX_VALUE ) ; <START_BUG> StringBuffer repbuf = new StringBuffer ( ) ; <END_BUG> for ( int i = 0 ; i < ( parts . length ) ; i ++ ) { if ( i > 0 ) { if ( ( ! ( from . equals ( to ) ) ) && ( parts [ ( i - 1 ) ] . endsWith ( escape ) ) ) { repbuf . setLength ( ( ( repbuf . length ( ) ) - 1 ) ) ; repbuf . append ( from ) ; } else repbuf . append ( to ) ; } repbuf . append ( parts [ i ] ) ; } return repbuf . toString ( ) ; } public void selectColumns ( Select sel , ExpContext ctx , ExpState state , boolean pks ) { } public void acceptVisit ( ExpressionVisitor visitor ) { } }

Fix:
StringBuilder repbuf = new StringBuilder ( ) ;
Buggy code:
public class Enclosure extends WebMarkupContainer { private static final long serialVersionUID = 1L ; private static final Logger log = LoggerFactory . getLogger ( Enclosure . class ) ; private Component childComponent ; private final CharSequence childId ; public Enclosure ( final String id , final CharSequence childId ) { } public boolean isTransparentResolver ( ) { } private Component getChildComponent ( final CharSequence childId ) { } protected void onComponentTagBody ( MarkupStream markupStream , ComponentTag openTag ) { if ( ( childComponent ) == null ) { childComponent = getChildComponent ( childId ) ; } if ( ( childComponent ) == ( this ) ) { throw new WicketRuntimeException ( "Programming<seq2seq4repair_space>error:<seq2seq4repair_space>childComponent<seq2seq4repair_space>==<seq2seq4repair_space>enclose<seq2seq4repair_space>component;<seq2seq4repair_space>endless<seq2seq4repair_space>loop" ) ; } else if ( ( childComponent ) != null ) { <START_BUG> setVisible ( childComponent . isVisible ( ) ) ; <END_BUG> } if ( ( isVisible ( ) ) == true ) { super . onComponentTagBody ( markupStream , openTag ) ; } else { Response response = getResponse ( ) ; getRequestCycle ( ) . setResponse ( NullResponse . getInstance ( ) ) ; try { super . onComponentTagBody ( markupStream , openTag ) ; } finally { getRequestCycle ( ) . setResponse ( response ) ; } } } }

Fix:
setVisible ( ( ( childComponent . isVisible ( ) ) && ( childComponent . isRenderAllowed ( ) ) ) ) ;
Buggy code:
public final class DeferredAttrImpl extends AttrImpl implements DeferredNode { static final long serialVersionUID = 6903232312469148636L ; protected transient int fNodeIndex ; DeferredAttrImpl ( DeferredDocumentImpl ownerDocument , int nodeIndex ) { } public int getNodeIndex ( ) { } protected void synchronizeData ( ) { } protected void synchronizeChildren ( ) { syncChildren = false ; DeferredDocumentImpl ownerDocument = ( ( DeferredDocumentImpl ) ( this . ownerDocument ) ) ; NodeImpl last = null ; for ( int index = ownerDocument . getFirstChild ( fNodeIndex ) ; index != ( - 1 ) ; index = ownerDocument . getNextSibling ( index ) ) { NodeImpl node = ( ( NodeImpl ) ( ownerDocument . getNodeObject ( index ) ) ) ; if ( last == null ) { firstChild = node ; } else { last . nextSibling = node ; } <START_BUG> node . parentNode = this ; <END_BUG> node . previousSibling = last ; last = node ; } if ( last != null ) { lastChild = last ; } } }

Fix:
node . ownerNode = this ;
Buggy code:
public class ModuleController extends GenericController implements ReplaceableController { private static final String NODE_PATH = "ModuleController.node_path" ; private JMeterTreeNode selectedNode = null ; public ModuleController ( ) { } public Object clone ( ) { } public TestElement getReplacement ( ) { } public void setSelectedNode ( JMeterTreeNode tn ) { } public JMeterTreeNode getSelectedNode ( ) { } private void setNodePath ( ) { } private Vector getNodePath ( ) { } private void restoreSelected ( ) { if ( ( selectedNode ) == null ) { Vector nodePath = getNodePath ( ) ; <START_BUG> if ( nodePath != null ) { <END_BUG> GuiPackage gp = GuiPackage . getInstance ( ) ; if ( gp != null ) { JMeterTreeNode root = ( ( JMeterTreeNode ) ( gp . getTreeModel ( ) . getRoot ( ) ) ) ; nodePath . remove ( 0 ) ; traverse ( root , nodePath ) ; } } } } private void traverse ( JMeterTreeNode node , Vector nodePath ) { } public void replace ( HashTree tree ) { } private void createSubTree ( HashTree tree , JMeterTreeNode node ) { } private static JMeterTreeNode cloneTreeNode ( JMeterTreeNode node ) { } private static void cloneChildren ( JMeterTreeNode to , JMeterTreeNode from ) { } }

Fix:
if ( ( nodePath != null ) && ( ( nodePath . size ( ) ) > 0 ) ) {
Buggy code:
public class MatDefEditorController { private MaterialDef matDef ; private MatDefEditorWindow editor ; private SwingGui gui ; private DragHandler dragHandler = new DragHandler ( ) ; private SelectionModel sceneSelection ; private MatDefEditorController . SceneSelectionChangeListener sceneSelectionChangeListener = new MatDefEditorController . SceneSelectionChangeListener ( ) ; private List < TechniqueDef > techniques = new ArrayList < > ( ) ; private DiagramUiHandler diagramUiHandler ; private SelectionHandler selectionHandler = new SelectionHandler ( ) ; private DataHandler dataHandler = new DataHandler ( ) ; private MaterialPreviewRenderer previewRenderer ; public MatDefEditorController ( SwingGui gui , MatDefEditorWindow editor ) { } public void cleanup ( ) { } public MatDefEditorWindow getEditor ( ) { } public DragHandler getDragHandler ( ) { } private class SceneSelectionChangeListener implements PropertyChangeListener { @ Override public void propertyChange ( PropertyChangeEvent evt ) { } } void initTechnique ( TechniqueDef technique , MaterialDef matDef ) { } public void preview ( PreviewRequest request ) { } public Connection connect ( Dot start , Dot end ) { } public void removeConnection ( Connection conn ) { } public void removeNode ( String key ) { } public NodePanel addShaderNode ( ShaderNode sn ) { } public NodePanel addOutPanel ( Shader . ShaderType type , ShaderNodeVariable var ) { } public NodePanel addOutPanel ( Shader . ShaderType type , ShaderNodeVariable var , Point point ) { } public void displayAddFragmentOutputDialog ( Point clickPosition ) { } public void displayAddAttibuteDialog ( Point clickPosition ) { } public void addAttribute ( String name , String type , Point point ) { } public void displayAddMatParamDialog ( Point clickPosition ) { } public void addMatParam ( String name , String type , Point point ) { String fixedType = type ; if ( type . equals ( "Color" ) ) { fixedType = "Vector4" ; } fixedType = VarType . valueOf ( fixedType ) . getGlslType ( ) ; ShaderNodeVariable param = new ShaderNodeVariable ( fixedType , "MatParam" , name ) ; NodePanel node = diagramUiHandler . addInputPanel ( this , param ) ; node . setLocation ( point ) ; diagramUiHandler . refreshDiagram ( ) ; <START_BUG> dataHandler . addMatParam ( param , VarType . valueOf ( type ) ) ; <END_BUG> } public void displayAddWorldParamDialog ( Point clickPosition ) { } public void addWorldParam ( UniformBinding binding , Point point ) { } public void displayAddNodeDialog ( Point clickPosition ) { } public void addNodesFromDefs ( List < ShaderNodeDefinition > defList , String path , Point point ) { } private String fixNodeName ( String name ) { } public void multiMove ( DraggablePanel movedPanel , int xOffset , int yOffset ) { } public void multiStartDrag ( DraggablePanel movedPanel ) { } public void select ( Selectable selectable , boolean multi ) { } public void findSelection ( MouseEvent me , boolean multi ) { } public void removeSelected ( ) { } public void dispatchEventToDiagram ( MouseEvent e , Component source ) { } public void onNodeMoved ( NodePanel node ) { } }

Fix:
dataHandler . addMatParam ( param , type ) ;
Buggy code:
public final class ArithmeticLogicUnit { public static String add ( String bitStr1 , String bitStr2 ) { } public static String subtract ( String bitStr1 , String bitStr2 ) { String difference = "" ; boolean borrow = false ; String bits1 = ArithmeticLogicUnit . padZeros ( bitStr1 ) ; String bits2 = ArithmeticLogicUnit . padZeros ( bitStr2 ) ; if ( ( Integer . parseInt ( bits1 ) ) == ( Integer . parseInt ( bits2 ) ) ) { <START_BUG> return BitWord . DEFAULT_VALUE ; <END_BUG> } if ( ( Integer . parseInt ( bits2 ) ) == 0 ) { return bits1 ; } for ( int k = 15 ; k >= 0 ; k -- ) { int a = Integer . parseInt ( bits1 . substring ( k , ( k + 1 ) ) ) ; int b = Integer . parseInt ( bits2 . substring ( k , ( k + 1 ) ) ) ; if ( borrow == true ) { if ( a == 1 ) { a = 0 ; borrow = false ; } else { a = 1 ; } } if ( a >= b ) { difference = ( a - b ) + difference ; } else { difference = "1" + difference ; borrow = true ; } } return difference ; } public static String padZeros ( String value ) { } }

Fix:
return BitWord . VALUE_ZERO ;
Buggy code:
public class Field extends CompositeField { protected String value ; private static final Field DUMMY_FIELD = new Field ( ) ; private static final WeakHashMap < String , WeakReference < Field > > FLYWEIGHT = new WeakHashMap < String , WeakReference < Field > > ( ) ; public static final Field create ( String value ) { } private Field ( ) { } private Field ( String value ) { } public Field ( Field orig ) { } @ Override public String getValue ( ) { } @ Override public void setFieldValue ( int position , String value ) { } @ Override public String [ ] getValues ( ) { } @ Override public boolean isComposite ( ) { } @ Override public CompositeField addField ( Field field ) { } @ Override public Field copy ( ) { <START_BUG> return new Field ( this ) ; <END_BUG> } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { } }

Fix:
return Field . create ( this . value ) ;
Buggy code:
public class OperationSlaveStepHandler { private final LocalHostControllerInfo localHostControllerInfo ; private final Map < String , ProxyController > serverProxies ; private final IgnoredDomainResourceRegistry ignoredDomainResourceRegistry ; OperationSlaveStepHandler ( final LocalHostControllerInfo localHostControllerInfo , Map < String , ProxyController > serverProxies , IgnoredDomainResourceRegistry ignoredDomainResourceRegistry ) { } void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } void addSteps ( final OperationContext context , final ModelNode operation , final ModelNode response , final boolean recordResponse ) throws OperationFailedException { } private void addBasicStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { } private static class LazyDomainModelProvider implements HostControllerExecutionSupport . DomainModelProvider { private final OperationContext context ; private ModelNode domainModel ; private LazyDomainModelProvider ( OperationContext context ) { } public ModelNode getDomainModel ( ) { if ( ( domainModel ) == null ) { <START_BUG> domainModel = Tools . readModel ( context . getRootResource ( ) ) ; <END_BUG> } return domainModel ; } } }

Fix:
domainModel = Tools . readModel ( context . readResourceFromRoot ( EMPTY_ADDRESS , true ) ) ;
Buggy code:
@ RunWith ( Parameterized . class ) public class FailureClassValidatorTest { private boolean result ; private Integer failureClass ; @ Parameters public static List < Object [ ] > params ( ) { <START_BUG> Object [ ] [ ] vals = new Object [ ] [ ] { new Object [ ] { false , - 5 } , new Object [ ] { true , 0 } , new Object [ ] { true , 4 } , new Object [ ] { false , 8 } } ; <END_BUG> return Arrays . asList ( vals ) ; } public FailureClassValidatorTest ( boolean result , Integer failureClass ) { } @ Test public void validateFailureClass ( ) { } }

Fix:
Object [ ] [ ] vals = new Object [ ] [ ] { new Object [ ] { false , - 5 } , new Object [ ] { true , 0 } , new Object [ ] { true , 4 } , new Object [ ] { false , 8 } , new Object [ ] { false , null } } ;