nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class ImportExportPage extends WorkbenchWizardSelectionPage { protected static final String DIALOG_SETTING_SECTION_NAME = "ImportExportPage." ; private TreeViewer treeViewer ; protected class CategorizedWizardSelectionTree { private static final int SIZING_LISTS_HEIGHT = 200 ; private IWizardCategory wizardCategories ; private String message ; private TreeViewer viewer ; protected CategorizedWizardSelectionTree ( IWizardCategory categories , String msg ) { } protected Composite createControl ( Composite parent ) { } private void createFilteredTree ( Composite parent ) { <START_BUG> FilteredTree filteredTree = new FilteredTree ( parent , ( ( ( ( SWT . SINGLE ) | ( SWT . H_SCROLL ) ) | ( SWT . V_SCROLL ) ) | ( SWT . BORDER ) ) , new WizardPatternFilter ( true ) ) ; <END_BUG> viewer = filteredTree . getViewer ( ) ; filteredTree . setFont ( parent . getFont ( ) ) ; viewer . setContentProvider ( new WizardContentProvider ( ) ) ; viewer . setLabelProvider ( new WorkbenchLabelProvider ( ) ) ; viewer . setSorter ( INSTANCE ) ; ArrayList inputArray = new ArrayList ( ) ; boolean expandTop = false ; if ( ( wizardCategories ) != null ) { if ( ( wizardCategories . getParent ( ) ) == null ) { IWizardCategory [ ] children = wizardCategories . getCategories ( ) ; for ( int i = 0 ; i < ( children . length ) ; i ++ ) { inputArray . add ( children [ i ] ) ; } } else { expandTop = true ; inputArray . add ( wizardCategories ) ; } } if ( expandTop ) viewer . setAutoExpandLevel ( 2 ) ; AdaptableList input = new AdaptableList ( inputArray ) ; viewer . addFilter ( new WizardActivityFilter ( ) ) ; viewer . setInput ( input ) ; } protected TreeViewer getViewer ( ) { } private void layoutTopControl ( Control control ) { } } protected ImportExportPage ( IWorkbench aWorkbench , IStructuredSelection currentSelection ) { } public void createControl ( Composite parent ) { } protected abstract Composite createTreeViewer ( Composite parent ) { } protected void treeDoubleClicked ( DoubleClickEvent event ) { } private void updateSelectedNode ( WorkbenchWizardElement wizardElement ) { } protected void updateMessage ( ) { } protected void listSelectionChanged ( ISelection selection ) { } private IWizardNode createWizardNode ( IWizardDescriptor element ) { } protected void restoreWidgetValues ( ) { } protected void expandPreviouslyExpandedCategories ( String setting , IWizardCategory wizardCategories , TreeViewer viewer ) { } protected void selectPreviouslySelected ( String setting , IWizardCategory wizardCategories , final TreeViewer viewer ) { } protected void storeExpandedCategories ( String setting , TreeViewer viewer ) { } protected void storeSelectedCategoryAndWizard ( String setting , TreeViewer viewer ) { } public void saveWidgetValues ( ) { } public IWizardPage getNextPage ( ) { } protected ITriggerPoint getTriggerPoint ( ) { } protected void setTreeViewer ( TreeViewer viewer ) { } protected TreeViewer getTreeViewer ( ) { } protected void initialize ( ) { } }

Fix:
FilteredTree filteredTree = new FilteredTree ( parent , ( ( ( ( SWT . SINGLE ) | ( SWT . H_SCROLL ) ) | ( SWT . V_SCROLL ) ) | ( SWT . BORDER ) ) , new WizardPatternFilter ( ) ) ;
Buggy code:
public class Spin implements Strategy { public SceneObject [ ] spinner ; Main s ; public Spin ( Main s ) { } @ Override public boolean activate ( ) { } @ Override public void execute ( ) { spinner = SceneObjects . getNearest ( Data . spinner ) ; if ( s . getUtil ( ) . needSpin ( ) ) { if ( ( ( spinner ) != null ) && ( ( spinner . length ) > 0 ) ) { if ( ( ( Game . getOpenBackDialogId ( ) ) != 8880 ) && ( ( Players . getMyPlayer ( ) . getAnimation ( ) ) == ( - 1 ) ) ) { spinner [ 0 ] . interact ( 1 ) ; Time . sleep ( 3000 ) ; } if ( ( Game . getOpenBackDialogId ( ) ) == 8880 ) { Menu . sendAction ( 315 , 1779 , 16 , 8890 ) ; <START_BUG> Time . sleep ( 1500 ) ; <END_BUG> Keyboard . getInstance ( ) . sendKeys ( "28" ) ; Time . sleep ( 2000 ) ; } while ( ( Players . getMyPlayer ( ) . getAnimation ( ) ) != ( - 1 ) ) { Time . sleep ( 2000 ) ; } } } } }

Fix:
Time . sleep ( 2600 ) ;
Buggy code:
public abstract class AbstractTask extends MatchingTask { private static final Localizer _loc = Localizer . forPackage ( AbstractTask . class ) ; protected final List fileSets = new ArrayList ( ) ; protected boolean haltOnError = true ; protected Path classpath = null ; protected boolean useParent = false ; protected boolean isolate = false ; private Configuration _conf = null ; private AntClassLoader _cl = null ; public void setHaltOnError ( boolean haltOnError ) { } public void setIsolate ( boolean isolate ) { } public void setUseParentClassloader ( boolean useParent ) { } public Configuration getConfiguration ( ) { } protected abstract Configuration newConfiguration ( ) { } protected abstract void executeOn ( String [ ] files ) throws Exception { } protected ClassLoader getClassLoader ( ) { } protected void assertFiles ( String [ ] files ) { if ( ( files . length ) == 0 ) <START_BUG> throw new BuildException ( AbstractTask . _loc . get ( "no-filesets" ) ) ; <END_BUG> } public void setClasspath ( Path classPath ) { } public Path createClasspath ( ) { } public Object createConfig ( ) { } public void addFileset ( FileSet set ) { } public void execute ( ) throws BuildException { } private String [ ] getFiles ( ) { } }

Fix:
throw new BuildException ( AbstractTask . _loc . get ( "no-filesets" ) . getMessage ( ) ) ;
Buggy code:
public class ArrayBackedSortedColumns extends ArrayList < IColumn > implements ISortedColumns { private final AbstractType < ? > comparator ; private final boolean reversed ; public static final Factory factory = new Factory ( ) { public ISortedColumns create ( AbstractType < ? > comparator , boolean insertReversed ) { } public ISortedColumns fromSorted ( SortedMap < ByteBuffer , IColumn > sortedMap , boolean insertReversed ) { } } ; public static Factory factory ( ) { } private ArrayBackedSortedColumns ( AbstractType < ? > comparator , boolean reversed ) { } private ArrayBackedSortedColumns ( Collection < IColumn > columns , AbstractType < ? > comparator , boolean reversed ) { } public Factory getFactory ( ) { } public AbstractType < ? > getComparator ( ) { } public ISortedColumns cloneMe ( ) { } public boolean isInsertReversed ( ) { } private int compare ( ByteBuffer name1 , ByteBuffer name2 ) { } public IColumn getColumn ( ByteBuffer name ) { } public void addColumn ( IColumn column , Allocator allocator ) { } private void resolveAgainst ( int i , IColumn column , Allocator allocator ) { } private int binarySearch ( ByteBuffer name ) { int low = 0 ; int mid = size ( ) ; int high = mid - 1 ; int result = - 1 ; while ( low <= high ) { mid = ( low + high ) > > 1 ; <START_BUG> if ( ( result = - ( compare ( get ( mid ) . name ( ) , name ) ) ) > 0 ) { <END_BUG> low = mid + 1 ; } else if ( result == 0 ) { return mid ; } else { high = mid - 1 ; } } return ( - mid ) - ( result < 0 ? 1 : 2 ) ; } public void addAll ( ISortedColumns cm , Allocator allocator ) { } public boolean replace ( IColumn oldColumn , IColumn newColumn ) { } public Collection < IColumn > getSortedColumns ( ) { } public Collection < IColumn > getReverseSortedColumns ( ) { } public void removeColumn ( ByteBuffer name ) { } public SortedSet < ByteBuffer > getColumnNames ( ) { } public int getEstimatedColumnCount ( ) { } @ Override public Iterator < IColumn > iterator ( ) { } public Iterator < IColumn > reverseIterator ( ) { } public Iterator < IColumn > iterator ( ByteBuffer start ) { } public Iterator < IColumn > reverseIterator ( ByteBuffer start ) { } private Iterator < IColumn > reverseInternalIterator ( int idx ) { } private class ReverseSortedCollection extends AbstractCollection < IColumn > { public int size ( ) { } public Iterator < IColumn > iterator ( ) { } } private class ForwardSortedCollection extends AbstractCollection < IColumn > { public int size ( ) { } public Iterator < IColumn > iterator ( ) { } } private class ColumnNamesSet extends AbstractSet < ByteBuffer > implements SortedSet < ByteBuffer > { public int size ( ) { } public Iterator < ByteBuffer > iterator ( ) { } public Comparator < ByteBuffer > comparator ( ) { } public ByteBuffer first ( ) { } public ByteBuffer last ( ) { } public SortedSet < ByteBuffer > headSet ( ByteBuffer fromElement ) { } public SortedSet < ByteBuffer > tailSet ( ByteBuffer toElement ) { } public SortedSet < ByteBuffer > subSet ( ByteBuffer fromElement , ByteBuffer toElement ) { } } }

Fix:
if ( ( result = compare ( name , get ( mid ) . name ( ) ) ) > 0 ) {
Buggy code:
public class PersistenceRefProcessor extends AbstractDeploymentDescriptorBindingsProcessor { @ Override protected List < BindingConfiguration > processDescriptorEntries ( DeploymentUnit deploymentUnit , DeploymentDescriptorEnvironment environment , ResourceInjectionTarget resourceInjectionTarget , final ComponentDescription componentDescription , ClassLoader classLoader , DeploymentReflectionIndex deploymentReflectionIndex , final EEApplicationClasses applicationClasses ) throws DeploymentUnitProcessingException { } private List < BindingConfiguration > getPersistenceUnitRefs ( DeploymentUnit deploymentUnit , DeploymentDescriptorEnvironment environment , ClassLoader classLoader , DeploymentReflectionIndex deploymentReflectionIndex , ResourceInjectionTarget resourceInjectionTarget ) throws DeploymentUnitProcessingException { } private List < BindingConfiguration > getPersistenceContextRefs ( DeploymentUnit deploymentUnit , DeploymentDescriptorEnvironment environment , ClassLoader classLoader , DeploymentReflectionIndex deploymentReflectionIndex , ResourceInjectionTarget resourceInjectionTarget ) throws DeploymentUnitProcessingException { } private InjectionSource getPersistenceUnitBindingSource ( final DeploymentUnit deploymentUnit , final String unitName ) throws DeploymentUnitProcessingException { } private InjectionSource getPersistenceContextBindingSource ( final DeploymentUnit deploymentUnit , final String unitName , PersistenceContextType type , Map properties ) throws DeploymentUnitProcessingException { } private PersistenceUnitMetadata getPersistenceUnit ( final DeploymentUnit deploymentUnit , final String puName ) throws DeploymentUnitProcessingException { PersistenceUnitMetadata pu = PersistenceUnitSearch . resolvePersistenceUnitSupplier ( deploymentUnit , puName ) ; if ( null == pu ) { <START_BUG> throw new DeploymentUnitProcessingException ( JpaMessages . MESSAGES . deploymentUnitNotFound ( puName , deploymentUnit ) ) ; <END_BUG> } return pu ; } private ServiceName getPuServiceName ( String scopedPuName ) throws DeploymentUnitProcessingException { } private boolean isEmpty ( String string ) { } }

Fix:
throw new DeploymentUnitProcessingException ( JpaMessages . MESSAGES . persistenceUnitNotFound ( puName , deploymentUnit ) ) ;
Buggy code:
public class Fonts { public static TrueTypeFont gameFont ( ) throws FontFormatException , IOException { <START_BUG> InputStream inputStream = ResourceLoader . getResourceAsStream ( "font//res//8bit.ttf" ) ; <END_BUG> Font awtFont = Font . createFont ( Font . TRUETYPE_FONT , inputStream ) ; awtFont = awtFont . deriveFont ( 20.0F ) ; return new TrueTypeFont ( awtFont , false ) ; } }

Fix:
InputStream inputStream = ResourceLoader . getResourceAsStream ( "Rational//res//font//8bit.ttf" ) ;
Buggy code:
public class FunctionType3 extends PDFFunction { private int [ ] [ ] samples ; protected FunctionType3 ( ) { } @ Override protected void parse ( PDFObject obj ) throws IOException { PDFObject functionsObj = obj . getDictRef ( "Functions" ) ; if ( functionsObj == null ) { throw new PDFParseException ( "Functions<seq2seq4repair_space>required<seq2seq4repair_space>for<seq2seq4repair_space>function<seq2seq4repair_space>type<seq2seq4repair_space>3!" ) ; } PDFObject [ ] functionsAry = functionsObj . getArray ( ) ; int [ ] size = new int [ functionsAry . length ] ; for ( int i = 0 ; i < ( functionsAry . length ) ; i ++ ) { size [ i ] = functionsAry [ i ] . getIntValue ( ) ; } PDFObject boundsObj = obj . getDictRef ( "Bounds" ) ; if ( boundsObj == null ) { throw new PDFParseException ( "Bounds<seq2seq4repair_space>required<seq2seq4repair_space>for<seq2seq4repair_space>function<seq2seq4repair_space>type<seq2seq4repair_space>3!" ) ; } PDFObject [ ] boundsAry = boundsObj . getArray ( ) ; int [ ] size1 = new int [ boundsAry . length ] ; for ( int i = 0 ; i < ( boundsAry . length ) ; i ++ ) { size1 [ i ] = boundsAry [ i ] . getIntValue ( ) ; } PDFObject encodeObj = obj . getDictRef ( "Encode" ) ; <START_BUG> if ( encodeObj != null ) { <END_BUG> throw new PDFParseException ( "Encode<seq2seq4repair_space>required<seq2seq4repair_space>for<seq2seq4repair_space>function<seq2seq4repair_space>type<seq2seq4repair_space>3!" ) ; } PDFObject [ ] encodeAry = encodeObj . getArray ( ) ; float [ ] encode = new float [ encodeAry . length ] ; for ( int i = 0 ; i < ( encodeAry . length ) ; i ++ ) { encode [ i ] = encodeAry [ i ] . getFloatValue ( ) ; } throw new PDFParseException ( "Unsupported<seq2seq4repair_space>function<seq2seq4repair_space>type<seq2seq4repair_space>3." ) ; } @ Override protected void doFunction ( float [ ] inputs , int inputOffset , float [ ] outputs , int outputOffset ) { } No newline ; at end ; of file ; }

Fix:
if ( encodeObj == null ) {
Buggy code:
public abstract class ShapeFieldCacheProvider < T extends Shape > { private Logger log = Logger . getLogger ( getClass ( ) . getName ( ) ) ; WeakHashMap < IndexReader , ShapeFieldCache < T > > sidx = new WeakHashMap < IndexReader , ShapeFieldCache < T > > ( ) ; protected final int defaultSize ; protected final String shapeField ; public ShapeFieldCacheProvider ( String shapeField , int defaultSize ) { } protected abstract T readShape ( BytesRef term ) { } public synchronized ShapeFieldCache < T > getCache ( AtomicReader reader ) throws IOException { ShapeFieldCache < T > idx = sidx . get ( reader ) ; if ( idx != null ) { return idx ; } long startTime = System . currentTimeMillis ( ) ; log . fine ( ( ( "Building<seq2seq4repair_space>Cache<seq2seq4repair_space>[" + ( reader . maxDoc ( ) ) ) + "]" ) ) ; idx = new ShapeFieldCache < T > ( reader . maxDoc ( ) , defaultSize ) ; int count = 0 ; DocsEnum docs = null ; Terms terms = reader . terms ( shapeField ) ; TermsEnum te = null ; if ( terms != null ) { te = terms . iterator ( te ) ; BytesRef term = te . next ( ) ; while ( term != null ) { T shape = readShape ( term ) ; if ( shape != null ) { <START_BUG> docs = te . docs ( null , docs , false ) ; <END_BUG> Integer docid = docs . nextDoc ( ) ; while ( docid != ( DocIdSetIterator . NO_MORE_DOCS ) ) { idx . add ( docid , shape ) ; docid = docs . nextDoc ( ) ; count ++ ; } } term = te . next ( ) ; } } sidx . put ( reader , idx ) ; long elapsed = ( System . currentTimeMillis ( ) ) - startTime ; log . fine ( ( ( ( ( ( "Cached:<seq2seq4repair_space>[" + count ) + "<seq2seq4repair_space>in<seq2seq4repair_space>" ) + elapsed ) + "ms]<seq2seq4repair_space>" ) + idx ) ) ; return idx ; } }

Fix:
docs = te . docs ( null , docs , 0 ) ;
Buggy code:
public class XSAttributeUseImpl implements XSAttributeUse { public XSAttributeDecl fAttrDecl = null ; public short fUse = SchemaSymbols . USE_OPTIONAL ; public short fConstraintType = XSConstants . VC_NONE ; public ValidatedInfo fDefault = null ; public void reset ( ) { } public short getType ( ) { } public String getName ( ) { } public String getNamespace ( ) { } public boolean getIsRequired ( ) { } public XSAttributeDeclaration getAttrDeclaration ( ) { } public short getConstraintType ( ) { } public String getConstraintValue ( ) { <START_BUG> return ( getConstraintType ( ) ) == ( XSConstants . VC_NONE ) ? null : fDefault . normalizedValue ; <END_BUG> } }

Fix:
return ( getConstraintType ( ) ) == ( XSConstants . VC_NONE ) ? null : fDefault . actualValue . toString ( ) ;
Buggy code:
public class EjbDependencyDeploymentUnitProcessor implements DeploymentUnitProcessor { private static final ModuleIdentifier EJB_SUBSYSTEM = ModuleIdentifier . create ( "org.jboss.as.ejb3" ) ; private static final ModuleIdentifier EJB_CLIENT = ModuleIdentifier . create ( "org.jboss.ejb-client" ) ; private static final ModuleIdentifier EJB_IIOP_CLIENT = ModuleIdentifier . create ( "org.jboss.iiop-client" ) ; private static final ModuleIdentifier JDKORB = ModuleIdentifier . create ( "org.jboss.as.jdkorb" ) ; private static final ModuleIdentifier EJB_API = ModuleIdentifier . create ( "javax.ejb.api" ) ; @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ModuleLoader moduleLoader = Module . getBootModuleLoader ( ) ; final ModuleSpecification moduleSpecification = deploymentUnit . getAttachment ( MODULE_SPECIFICATION ) ; moduleSpecification . addSystemDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( moduleLoader , EjbDependencyDeploymentUnitProcessor . EJB_API , false , false , true , false ) ) ; moduleSpecification . addSystemDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( moduleLoader , EjbDependencyDeploymentUnitProcessor . EJB_CLIENT , false , false , true , false ) ) ; moduleSpecification . addSystemDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( moduleLoader , EjbDependencyDeploymentUnitProcessor . EJB_IIOP_CLIENT , false , false , false , false ) ) ; moduleSpecification . addSystemDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( moduleLoader , EjbDependencyDeploymentUnitProcessor . EJB_SUBSYSTEM , false , false , true , false ) ) ; <START_BUG> if ( JdkORBDeploymentMarker . isJacORBDeployment ( deploymentUnit ) ) { <END_BUG> moduleSpecification . addSystemDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( moduleLoader , EjbDependencyDeploymentUnitProcessor . JDKORB , false , false , false , false ) ) ; } if ( ( ! ( EjbDeploymentMarker . isEjbDeployment ( deploymentUnit ) ) ) && ( ! ( DeploymentTypeMarker . isType ( APPLICATION_CLIENT , deploymentUnit ) ) ) ) { return ; } if ( Boolean . getBoolean ( "org.jboss.as.ejb3.EMBEDDED" ) ) moduleSpecification . addSystemDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( moduleLoader , ModuleIdentifier . CLASSPATH , false , false , false , false ) ) ; } @ Override public void undeploy ( DeploymentUnit context ) { } }

Fix:
if ( JdkORBDeploymentMarker . isJdkORBDeployment ( deploymentUnit ) ) {
Buggy code:
public class AccessEvaluator { public static boolean readAccess ( Journal journal , User user ) { } public static boolean writeAccess ( Journal journal , User user ) { Group group = user . getGroup ( ) ; String UHD = user . getHospitalDivision ( ) ; String JHD = journal . getHospitalDivision ( ) ; if ( group . equals ( Doctor ) ) { if ( ( user . equals ( journal . getDoctor ( ) ) ) || ( UHD . equals ( JHD ) ) ) { return true ; } } else if ( group . equals ( Nurse ) ) { <START_BUG> if ( ( journal . getNurse ( ) . equals ( user ) ) || ( UHD . equals ( JHD ) ) ) { <END_BUG> return true ; } } return false ; } public static boolean createAccess ( User user ) { } public static boolean deleteAccess ( Journal journal , User user ) { } }

Fix:
if ( journal . getNurse ( ) . equals ( user ) ) {
Buggy code:
public class LocalAgent extends AbstractAgent { private static final Logger LOG = Logger . getLogger ( LocalAgent . class . getSimpleName ( ) ) ; protected static final String READ_PASSWORD_PROMPT = String . format ( "[sudo]<seq2seq4repair_space>password<seq2seq4repair_space>for<seq2seq4repair_space>%s:<seq2seq4repair_space>" , System . getProperty ( "user.name" ) ) ; protected static final String CHECK_PASSWORD_NECESSITY_COMMAND = "ERROR=$(sudo<seq2seq4repair_space>-n<seq2seq4repair_space>true<seq2seq4repair_space>2>&1);<seq2seq4repair_space>if<seq2seq4repair_space>[[<seq2seq4repair_space>$?<seq2seq4repair_space>!=<seq2seq4repair_space>0<seq2seq4repair_space>]]<seq2seq4repair_space>;<seq2seq4repair_space>then<seq2seq4repair_space>echo<seq2seq4repair_space>$ERROR;<seq2seq4repair_space>fi" ; protected static final String CHECK_IS_PASSWORD_CORRECT_COMMAND = "sudo<seq2seq4repair_space>-S<seq2seq4repair_space>true" ; protected static final String PASSWORD_INCORRECT_STATUS = "Sorry,<seq2seq4repair_space>try<seq2seq4repair_space>again" ; protected static final String NEED_PASSWORD_MESSAGE = "sudo:<seq2seq4repair_space>a<seq2seq4repair_space>password<seq2seq4repair_space>is<seq2seq4repair_space>required" ; private static char [ ] pwdCache = null ; public LocalAgent ( ) { } @ Override public String execute ( String command ) throws AgentException { } private String executeWithPassword ( String command ) throws AgentException { } private String executeWithoutPassword ( String command ) throws AgentException { } protected void passPasswordToProcess ( Process process , char [ ] pwd ) throws UnsupportedEncodingException { } protected boolean isPasswordInputRequired ( String command ) { if ( ! ( command . contains ( "sudo<seq2seq4repair_space>" ) ) ) { return false ; } if ( ! ( isConsoleAccessible ( ) ) ) { return false ; } try { String result = executeWithoutPassword ( LocalAgent . CHECK_PASSWORD_NECESSITY_COMMAND ) ; if ( ( result != null ) && ( result . contains ( LocalAgent . NEED_PASSWORD_MESSAGE ) ) ) { <START_BUG> LocalAgent . LOG . log ( Level . WARNING , "Command<seq2seq4repair_space>'%s'<seq2seq4repair_space>requires<seq2seq4repair_space>sudo<seq2seq4repair_space>password" ) ; <END_BUG> return true ; } return false ; } catch ( Exception e ) { LocalAgent . LOG . log ( Level . SEVERE , "Can't<seq2seq4repair_space>verify<seq2seq4repair_space>requirement<seq2seq4repair_space>of<seq2seq4repair_space>sudo<seq2seq4repair_space>password" , e ) ; return false ; } } protected char [ ] obtainPassword ( ) throws AgentException , IllegalStateException { } protected Process getProcess ( String command ) throws IOException { } protected Console getConsole ( ) throws AgentException { } protected boolean isPasswordCorrect ( char [ ] checkingPwd ) throws Exception { } @ Override public String toString ( ) { } protected boolean isConsoleAccessible ( ) { } }

Fix:
LocalAgent . LOG . log ( Level . WARNING , String . format ( "Command<seq2seq4repair_space>'%s'<seq2seq4repair_space>requires<seq2seq4repair_space>sudo<seq2seq4repair_space>password" , command ) ) ;
Buggy code:
@ RestController public class BookingController { @ Autowired BookingRepository bookingRepository ; @ Autowired AvailabilityRepository availabilityRepository ; @ Autowired UserRepository userRepository ; private static BookingMapper bookingMapper = new BookingMapper ( ) ; @ ExceptionHandler void handleIllegalArgumentException ( IllegalArgumentException e , HttpServletResponse response ) throws IOException { } @ RequestMapping ( value = "//booking//" , method = RequestMethod . POST ) BookingDto addBookingFromClient ( @ RequestBody BookingDto bookingDto ) { } @ RequestMapping ( value = "//booking//{id}" , method = RequestMethod . GET ) BookingDto getBooking ( @ PathVariable Long id ) { } @ RequestMapping ( value = "//booking//{id}" , method = RequestMethod . DELETE ) void deleteBooking ( @ PathVariable Long id ) { } @ RequestMapping ( value = "//booking//" , method = RequestMethod . GET ) List < BookingDto > getBookings ( ) { List < BookingDto > bookingDtos = new ArrayList < BookingDto > ( ) ; for ( Booking booking : bookingRepository . findAll ( ) ) { <START_BUG> bookingDtos . add ( new BookingMapper ( ) . createBookingDto ( booking ) ) ; <END_BUG> } return bookingDtos ; } private Date formatDate ( String date ) { } private Date formatTime ( String time ) { } public DateTime parseTime ( String time ) { } public DateTime parseDate ( String date ) { } }

Fix:
bookingDtos . add ( new BookingMapper ( ) . createBookingDtoAndUser ( booking ) ) ;
Buggy code:
public class ComplexResourceAdaptersSubsystemTestCase extends AbstractComplexSubsystemTestCase { public ComplexResourceAdaptersSubsystemTestCase ( ) { } @ Test public void testResourceAdapters ( ) throws Exception { ModelNode model = getModel ( "ra.xml" , "some.rar" ) ; if ( model == null ) return ; Properties params = ParseUtils . raCommonProperties ( ) ; <START_BUG> ModelNode raCommonModel = model . get ( "subsystem" , "resource-adapters" , "resource-adapter" , "some.rar" ) ; <END_BUG> ParseUtils . checkModelParams ( raCommonModel , params ) ; Assert . assertEquals ( raCommonModel . asString ( ) , "A" , raCommonModel . get ( "config-properties" , "Property" , "value" ) . asString ( ) ) ; Assert . assertEquals ( raCommonModel . get ( "beanvalidationgroups" ) . asString ( ) , raCommonModel . get ( "beanvalidationgroups" ) . asString ( ) , "[\"Class0\",\"Class00\"]" ) ; params = ParseUtils . raAdminProperties ( ) ; ModelNode raAdminModel = raCommonModel . get ( "admin-objects" , "Pool2" ) ; ParseUtils . checkModelParams ( raAdminModel , params ) ; Assert . assertEquals ( raAdminModel . asString ( ) , "D" , raAdminModel . get ( "config-properties" , "Property" , "value" ) . asString ( ) ) ; params = ParseUtils . raConnectionProperties ( ) ; ModelNode raConnModel = raCommonModel . get ( "connection-definitions" , "Pool1" ) ; ParseUtils . checkModelParams ( raConnModel , params ) ; Assert . assertEquals ( raConnModel . asString ( ) , "B" , raConnModel . get ( "config-properties" , "Property" , "value" ) . asString ( ) ) ; Assert . assertEquals ( raConnModel . asString ( ) , "C" , raConnModel . get ( "recovery-plugin-properties" , "Property" ) . asString ( ) ) ; } @ Test public void testResourceAdapterWith2ConDefAnd2AdmObj ( ) throws Exception { } }

Fix:
ModelNode raCommonModel = model . get ( "subsystem" , "resource-adapters" , "resource-adapter" , "myRA" ) ;
Buggy code:
public class Stats { public static final int DEAD = 0 ; public static final int ACTIVE = 2 ; public static final int WARNING = 1 ; public static final int HEALTHY = 3 ; public static final int DEFAULT_MEMORY_FACTOR = 50 ; public static final int DEFAULT_THREAD_FACTOR = 50 ; public static final double HEALTHY_PER = 0.0 ; public static final double ACTIVE_PER = 0.25 ; public static final double WARNING_PER = 0.67 ; public static int calculateLoad ( Status stat ) { } public static int calculateStatus ( Status stat ) { if ( ( stat != null ) && ( ( stat . getConnector ( ) . size ( ) ) > 0 ) ) { Connector cntr = Stats . fetchConnector ( stat ) ; int max = cntr . getThreadInfo ( ) . getMaxThreads ( ) ; int current = cntr . getThreadInfo ( ) . getCurrentThreadsBusy ( ) ; double per = ( ( double ) ( current ) ) // ( ( double ) ( max ) ) ; if ( per > ( Stats . WARNING_PER ) ) { return Stats . WARNING ; } else if ( ( per >= ( Stats . ACTIVE_PER ) ) && ( per <= ( Stats . WARNING_PER ) ) ) { return Stats . ACTIVE ; } else <START_BUG> if ( ( per < ( Stats . ACTIVE_PER ) ) && ( per > ( Stats . HEALTHY_PER ) ) ) { <END_BUG> return Stats . HEALTHY ; } else { return Stats . DEAD ; } } else { return Stats . DEAD ; } } public static int calculateMemoryLoad ( Status stat ) { } public static int calculateThreadLoad ( Status stat ) { } private static Connector fetchConnector ( Status stat ) { } }

Fix:
if ( ( per < ( Stats . ACTIVE_PER ) ) && ( per >= ( Stats . HEALTHY_PER ) ) ) {
Buggy code:
public abstract class DefaultCompilerAdapter implements CompilerAdapter { protected boolean m_debug ; protected boolean m_optimize ; protected boolean m_deprecation ; protected boolean m_depend ; protected boolean m_verbose ; protected Javac m_attributes ; protected Path m_bootclasspath ; protected Path m_compileClasspath ; protected File [ ] m_compileList ; protected File m_destDir ; protected String m_encoding ; protected Path m_extdirs ; protected boolean m_includeAntRuntime ; protected boolean m_includeJavaRuntime ; protected String m_memoryInitialSize ; protected String m_memoryMaximumSize ; protected Path src ; protected String target ; private TaskContext m_taskContext ; public void setTaskContext ( final TaskContext context ) { } protected final TaskContext getTaskContext ( ) { } public void setJavac ( Javac attributes ) { } public Javac getJavac ( ) { } protected Commandline setupJavacCommand ( ) throws TaskException { } protected Commandline setupJavacCommand ( boolean debugLevelCheck ) throws TaskException { } protected Commandline setupJavacCommandlineSwitches ( Commandline cmd , boolean useDebugLevel ) throws TaskException { } protected Commandline setupModernJavacCommand ( ) throws TaskException { } protected Commandline setupModernJavacCommandlineSwitches ( Commandline cmd ) throws TaskException { } protected void addCompileClasspath ( final Path classpath ) throws TaskException { if ( ( m_destDir ) != null ) { classpath . addLocation ( m_destDir ) ; } if ( ( m_compileClasspath ) != null ) { <START_BUG> classpath . addPath ( m_compileClasspath ) ; <END_BUG> } } protected void addCurrentCompilerArgs ( Commandline cmd ) { } protected int executeExternalCompile ( String [ ] args , int firstFileName ) throws TaskException { } protected void logAndAddFilesToCompile ( Commandline cmd ) { } protected void addExtdirs ( Path path ) throws TaskException { } }

Fix:
classpath . add ( m_compileClasspath ) ;
Buggy code:
public class LevenbergMarquardtOptimizerTest extends AbstractLeastSquaresOptimizerAbstractTest { public LeastSquaresBuilder builder ( LevenbergMarquardtOptimizerTest . BevingtonProblem problem ) { } public LeastSquaresBuilder builder ( CircleProblem problem ) { } @ Override public int getMaxIterations ( ) { } @ Test public void testLevenberMarquardtOptimizer ( ) throws Exception { } @ Override public void check ( LeastSquaresOptimizer optimizer ) throws Exception { } @ Override public void testNonInvertible ( LeastSquaresOptimizer optimizer ) { } @ Test public void testControlParameters ( ) { } private void checkEstimate ( CircleVectorial circle , double initialStepBoundFactor , int maxCostEval , double costRelativeTolerance , double parRelativeTolerance , double orthoTolerance , boolean shouldFail ) { try { <START_BUG> final LevenbergMarquardtOptimizer optimizer = LevenbergMarquardtOptimizer . create ( ) . withInitialStepBoundFactor ( initialStepBoundFactor ) . withCostRelativeTolerance ( costRelativeTolerance ) . withParameterRelativeTolerance ( parRelativeTolerance ) . withOrthoTolerance ( orthoTolerance ) . withRankingThreshold ( SAFE_MIN ) ; <END_BUG> final LeastSquaresProblem problem = builder ( circle ) . maxEvaluations ( maxCostEval ) . maxIterations ( 100 ) . start ( new double [ ] { 98.68 , 47.345 } ) . build ( ) ; optimizer . optimize ( problem ) ; Assert . assertTrue ( ( ! shouldFail ) ) ; } catch ( DimensionMismatchException ee ) { Assert . assertTrue ( shouldFail ) ; } catch ( TooManyEvaluationsException ee ) { Assert . assertTrue ( shouldFail ) ; } } public void testBevington ( LeastSquaresOptimizer optimizer ) { } public void testCircleFitting2 ( LeastSquaresOptimizer optimizer ) { } private static class QuadraticProblem { private List < Double > x ; private List < Double > y ; public QuadraticProblem ( ) { } public void addPoint ( double x , double y ) { } public MultivariateVectorFunction getModelFunction ( ) { } public MultivariateMatrixFunction getModelFunctionJacobian ( ) { } } private static class BevingtonProblem { private List < Double > time ; private List < Double > count ; public BevingtonProblem ( ) { } public void addPoint ( double t , double c ) { } public MultivariateVectorFunction getModelFunction ( ) { } public MultivariateMatrixFunction getModelFunctionJacobian ( ) { } } }

Fix:
final LevenbergMarquardtOptimizer optimizer = new LevenbergMarquardtOptimizer ( ) . withInitialStepBoundFactor ( initialStepBoundFactor ) . withCostRelativeTolerance ( costRelativeTolerance ) . withParameterRelativeTolerance ( parRelativeTolerance ) . withOrthoTolerance ( orthoTolerance ) . withRankingThreshold ( SAFE_MIN ) ;
Buggy code:
class CharacterInspectorView extends JFrame { HashMap < String , JLabel > msj ; CharacterInspectorController cic ; JLabel hungry ; JLabel social ; JLabel cleaning ; JLabel energy ; JLabel lookFor ; JLabel day ; JLabel hour ; JLabel minute ; JLabel shiftOfDay ; JTextArea textArea ; PrintWriter pw ; public CharacterInspectorView ( String title ) { } public void setController ( CharacterInspectorController cic ) { } protected void initComponents ( ) { } private boolean firstLine = true ; public void update ( ) { if ( ( cic ) == null ) return ; String csv = "" ; if ( ( firstLine ) == true ) { csv += "step" ; for ( String emotion : msj . keySet ( ) ) { csv += "," + emotion ; } <START_BUG> csv += "hungry,social,cleaning,energy,orientation,weekday,day,hour,minute,second,shiftOfDay\n" ; <END_BUG> firstLine = false ; } BBAffective bb = null ; HouseModel . Agent a ; csv += cic . getParent ( ) . getStep ( ) ; a = cic . getAgent ( ) ; if ( a != null ) bb = BBKeeper . getInstance ( ) . get ( a . getName ( ) ) ; for ( String emotion : msj . keySet ( ) ) { JLabel l = msj . get ( emotion ) ; csv += "," ; if ( bb != null ) { Integer v = bb . getEmotionPotence ( emotion ) ; updateLabel ( l , ( v == null ? 0 : v ) ) ; csv += ( v == null ) ? 0 : v . toString ( ) ; } } if ( a != null ) { hungry . setText ( ( "hungry:<seq2seq4repair_space>" + ( a . getHungry ( ) ) ) ) ; social . setText ( ( "social:<seq2seq4repair_space>" + ( a . getSocial ( ) ) ) ) ; cleaning . setText ( ( "cleaning:<seq2seq4repair_space>" + ( a . getCleaning ( ) ) ) ) ; energy . setText ( ( "energy:<seq2seq4repair_space>" + ( a . getEnergy ( ) ) ) ) ; lookFor . setText ( ( "lookFor:<seq2seq4repair_space>" + ( a . getOrientationText ( ) ) ) ) ; csv += ( ( ( ( ( ( ( ( "," + ( a . getHungry ( ) ) ) + "," ) + ( a . getSocial ( ) ) ) + "," ) + ( a . getCleaning ( ) ) ) + "," ) + ( a . getEnergy ( ) ) ) + "," ) + ( a . getOrientationText ( ) ) ; } else { hungry . setText ( "hungry:<seq2seq4repair_space>0" ) ; social . setText ( "social:<seq2seq4repair_space>0" ) ; cleaning . setText ( "cleaning:<seq2seq4repair_space>0" ) ; energy . setText ( "energy:<seq2seq4repair_space>0" ) ; lookFor . setText ( "lookFor:<seq2seq4repair_space>Unknow" ) ; csv += ",0,0,0,0,Unknow" ; } Integer day = cic . getParent ( ) . day ; Integer hour = cic . getParent ( ) . hour ; Integer mins = cic . getParent ( ) . mins ; Integer secs = cic . getParent ( ) . secs ; String shift = cic . getParent ( ) . shift ; this . day . setText ( ( "day:<seq2seq4repair_space>" + ( day + 1 ) ) ) ; this . hour . setText ( ( "hour:<seq2seq4repair_space>" + hour ) ) ; this . minute . setText ( ( "minute:<seq2seq4repair_space>" + mins ) ) ; this . shiftOfDay . setText ( ( "shift:<seq2seq4repair_space>" + shift ) ) ; csv += ( ( "," + ( cic . getParent ( ) . today ) ) + "," ) + day ; csv += ( ( ( ( ( ( "," + hour ) + "," ) + mins ) + "," ) + secs ) + "," ) + shift ; textArea . append ( ( csv + "\n" ) ) ; if ( ( pw ) != null ) { pw . println ( csv ) ; pw . flush ( ) ; } } protected void updateLabel ( JLabel label , Integer d ) { } }

Fix:
csv += ",hungry,social,cleaning,energy,orientation,weekday,day,hour,minute,second,shiftOfDay\n" ;
Buggy code:
public class PaintMessageFactory { private Canvas canvas ; public PaintMessageFactory ( Canvas canvas ) { } public PaintMessage getMessage ( String message ) { PaintMessage paintMessage = null ; String [ ] elements = message . split ( "\\s" ) ; switch ( elements [ 0 ] ) { case "LINE" : <START_BUG> paintMessage = new LineMessage ( Integer . valueOf ( elements [ 1 ] ) , Integer . valueOf ( elements [ 2 ] ) , Integer . valueOf ( elements [ 3 ] ) , Integer . valueOf ( elements [ 4 ] ) , Integer . valueOf ( elements [ 5 ] ) , Integer . valueOf ( elements [ 5 ] ) ) ; <END_BUG> break ; case "SHAPE" : paintMessage = new ShapeMessage ( elements [ 1 ] , Integer . valueOf ( elements [ 2 ] ) , Integer . valueOf ( elements [ 3 ] ) , Integer . valueOf ( elements [ 4 ] ) , Integer . valueOf ( elements [ 5 ] ) , Integer . valueOf ( elements [ 6 ] ) , Integer . valueOf ( elements [ 7 ] ) , Boolean . valueOf ( elements [ 8 ] ) ) ; break ; case "CLEAR" : paintMessage = new ClearMessage ( ) ; break ; case "BUCKET_FILL" : paintMessage = new BucketFillMessage ( canvas , Integer . valueOf ( elements [ 1 ] ) , Integer . valueOf ( elements [ 2 ] ) , Integer . valueOf ( elements [ 3 ] ) ) ; break ; } return paintMessage ; } No newline ; at end ; of file ; }

Fix:
paintMessage = new LineMessage ( Integer . valueOf ( elements [ 1 ] ) , Integer . valueOf ( elements [ 2 ] ) , Integer . valueOf ( elements [ 3 ] ) , Integer . valueOf ( elements [ 4 ] ) , Integer . valueOf ( elements [ 5 ] ) , Integer . valueOf ( elements [ 6 ] ) ) ;
Buggy code:
public class DistributedUncenteredZeroAssumingCosineVectorSimilarity extends AbstractDistributedVectorSimilarity { @ Override <START_BUG> protected double doComputeResult ( int rowA , int rowB , Iterable < Cooccurrence > cooccurrences , double weightOfVectorA , double weightOfVectorB , int numberOfColumns ) { <END_BUG> double sumXY = 0.0 ; for ( Cooccurrence cooccurrence : cooccurrences ) { sumXY += ( cooccurrence . getValueA ( ) ) * ( cooccurrence . getValueB ( ) ) ; } if ( sumXY == 0.0 ) { return Double . NaN ; } return sumXY // ( weightOfVectorA * weightOfVectorB ) ; } @ Override public double weight ( Vector v ) { } }

Fix:
protected double doComputeResult ( int rowA , int rowB , Iterable < Cooccurrence > cooccurrences , double weightOfVectorA , double weightOfVectorB , long numberOfColumns ) {
Buggy code:
public class MappingJacksonJsonView extends AbstractView { public static final String DEFAULT_CONTENT_TYPE = "application//json" ; private ObjectMapper objectMapper = new ObjectMapper ( ) ; private JsonEncoding encoding = JsonEncoding . UTF8 ; private String jsonPrefix ; private Boolean prettyPrint ; private Set < String > modelKeys ; private boolean extractValueFromSingleKeyModel = false ; private boolean disableCaching = true ; private boolean updateContentLength = false ; public MappingJacksonJsonView ( ) { } public void setObjectMapper ( ObjectMapper objectMapper ) { } public final ObjectMapper getObjectMapper ( ) { } public void setEncoding ( JsonEncoding encoding ) { } public final JsonEncoding getEncoding ( ) { } public void setJsonPrefix ( String jsonPrefix ) { } public void setPrefixJson ( boolean prefixJson ) { <START_BUG> this . jsonPrefix = ( prefixJson ) ? "{}<seq2seq4repair_space>&&<seq2seq4repair_space>" : "" ; <END_BUG> } public void setPrettyPrint ( boolean prettyPrint ) { } private void configurePrettyPrint ( ) { } public void setModelKey ( String modelKey ) { } public void setModelKeys ( Set < String > modelKeys ) { } public final Set < String > getModelKeys ( ) { } @ Deprecated public void setRenderedAttributes ( Set < String > renderedAttributes ) { } @ Deprecated public final Set < String > getRenderedAttributes ( ) { } public void setExtractValueFromSingleKeyModel ( boolean extractValueFromSingleKeyModel ) { } public void setDisableCaching ( boolean disableCaching ) { } public void setUpdateContentLength ( boolean updateContentLength ) { } @ Override protected void prepareResponse ( HttpServletRequest request , HttpServletResponse response ) { } @ Override protected void renderMergedOutputModel ( Map < String , Object > model , HttpServletRequest request , HttpServletResponse response ) throws Exception { } protected Object filterModel ( Map < String , Object > model ) { } protected void writeContent ( OutputStream stream , Object value , String jsonPrefix ) throws IOException { } }

Fix:
this . jsonPrefix = ( prefixJson ) ? "{}<seq2seq4repair_space>&&<seq2seq4repair_space>" : null ;
Buggy code:
public final class NullPattern extends ASTNode implements IPattern { public NullPattern ( ICodePosition position ) { } @ Override public int getPatternType ( ) { } @ Override public IType getType ( ) { <START_BUG> return Types . UNKNOWN ; <END_BUG> } @ Override public IPattern withType ( IType type ) { } @ Override public boolean isType ( IType type ) { } @ Override public void writeJump ( MethodWriter writer , int varIndex , Label elseLabel ) throws BytecodeException { } @ Override public void writeInvJump ( MethodWriter writer , int varIndex , Label elseLabel ) throws BytecodeException { } @ Override public void toString ( String prefix , StringBuilder buffer ) { } }

Fix:
return Types . NULL ;
Buggy code:
public class HardwareWalletService { private static final Logger log = LoggerFactory . getLogger ( HardwareWalletService . class ) ; private final ListeningExecutorService clientMonitorService = SafeExecutors . newSingleThreadExecutor ( "monitor-hw-client" ) ; private final HardwareWalletContext context ; private boolean stopped = false ; public HardwareWalletService ( HardwareWalletClient client ) { } public void start ( ) { if ( stopped ) { throw new IllegalStateException ( "Once<seq2seq4repair_space>stopped<seq2seq4repair_space>the<seq2seq4repair_space>service<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>started<seq2seq4repair_space>with<seq2seq4repair_space>a<seq2seq4repair_space>fresh<seq2seq4repair_space>instance" ) ; } clientMonitorService . submit ( new Runnable ( ) { @ Override public void run ( ) { while ( true ) { context . getState ( ) . await ( context ) ; try { <START_BUG> Thread . sleep ( 500 ) ; <END_BUG> } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; } } } } ) ; } public void stopAndWait ( ) { } public boolean isStopped ( ) { } public HardwareWalletContext getContext ( ) { } public boolean isDeviceReady ( ) { } public boolean isWalletPresent ( ) { } public void requestCancel ( ) { } public void wipeDevice ( ) { } public void changePIN ( boolean remove ) { } public void secureCreateWallet ( String language , String label , boolean displayRandom , boolean pinProtection , int strength ) { } public void loadWallet ( String language , String label , String seedPhrase , String pin ) { } public void providePIN ( String pin ) { } public void provideEntropy ( byte [ ] entropy ) { } public void requestAddress ( int account , KeyChain . KeyPurpose keyPurpose , int index , boolean showDisplay ) { } public void requestPublicKey ( int account , KeyChain . KeyPurpose keyPurpose , int index ) { } public void requestDeterministicHierarchy ( List < ChildNumber > childNumbers ) { } public void requestCipherKey ( int account , KeyChain . KeyPurpose keyPurpose , int index , byte [ ] displayText , byte [ ] keyValue , boolean isEncrypting , boolean askOnDecrypt , boolean askOnEncrypt ) { } public void signMessage ( int account , KeyChain . KeyPurpose keyPurpose , int index , byte [ ] message ) { } public void simpleSignTx ( Transaction transaction , Map < Integer , ImmutableList < ChildNumber > > receivingAddressPathMap , Map < Address , ImmutableList < ChildNumber > > changeAddressPathMap ) { } public void signTx ( Transaction transaction , Map < Integer , ImmutableList < ChildNumber > > receivingAddressPathMap , Map < Address , ImmutableList < ChildNumber > > changeAddressPathMap ) { } public void encryptMessage ( byte [ ] message ) { } public byte [ ] generateEntropy ( ) { } }

Fix:
Thread . sleep ( 200 ) ;
Buggy code:
public class TableModelAttr extends TableModelComposite { public TableModelAttr ( ) { } public void initColumns ( ) { } public Vector rowObjectsFor ( Object t ) { if ( ! ( t instanceof MClassifier ) ) return new Vector ( ) ; MClassifier cls = ( ( MClassifier ) ( t ) ) ; <START_BUG> Vector attr = new Vector ( UmlHelper . getHelper ( ) . getCore ( ) . getAttributes ( cls ) ) ; <END_BUG> return attr ; } public String toString ( ) { } }

Fix:
Vector attr = new Vector ( UmlHelper . getHelper ( ) . getCore ( ) . getStructuralFeatures ( cls ) ) ;
Buggy code:
public class StatefulSerializedProxy implements Serializable { private static final long serialVersionUID = 627023970448688592L ; private final String viewName ; private final SessionID sessionID ; public StatefulSerializedProxy ( final String viewName , final SessionID sessionID ) { } private Object readResolve ( ) throws ObjectStreamException { ServiceController < ComponentView > view = ( ( ServiceController < ComponentView > ) ( CurrentServiceContainer . getServiceContainer ( ) . getRequiredService ( ServiceName . parse ( viewName ) ) ) ) ; try { <START_BUG> return view . getValue ( ) . createInstance ( Collections . < Object , Object > singletonMap ( SESSION_ID_KEY , sessionID ) ) . getInstance ( ) ; <END_BUG> } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } }

Fix:
return view . getValue ( ) . createInstance ( Collections . < Object , Object > singletonMap ( SessionID . class , sessionID ) ) . getInstance ( ) ;
Buggy code:
@ SuppressWarnings ( { "UnusedDeclaration" } ) public class RubyPlugin extends PluginImpl { private RubyArray loadPath ; ScriptingContainer ruby ; private Object plugin ; private ArrayList < ExtensionComponent > extensions ; private File libPath ; private File modelsPath ; private ServletRackContext rackContext ; public Object callMethod ( Object object , String methodName , Object ... args ) { } public void addExtension ( Object extension ) { } public Collection < ExtensionComponent > getExtensions ( ) { } public RubyPlugin ( ) { } public String loadBootScript ( ) throws IOException { } @ Override public void start ( ) throws Exception { } public static RubyPlugin from ( Ruby r ) { <START_BUG> IRubyObject v = r . evalScriptlet ( "Jenkins::Plugin.instance" ) ; <END_BUG> if ( v == null ) return null ; return ( ( RubyPlugin ) ( v . toJava ( RubyPlugin . class ) ) ) ; } private void initRubyNativePlugin ( ) { } private void initRubyLoadPaths ( ) throws Exception { } private Object eval ( String script ) { } private void require ( String path ) { } private void addLoadPath ( String path ) { } private File getPathFromManifest ( String attributeName , String defaultValue ) { } private static File resolve ( File base , String relative ) { } @ Override public void stop ( ) throws Exception { } public String getResourceURI ( String relativePathFormat , Object ... args ) { } public File getScriptDir ( ) { } public File getLibPath ( ) { } public File getModelsPath ( ) { } public ScriptingContainer getScriptingContainer ( ) { } public Object getNativeRubyPlugin ( ) { } public void rack ( IRubyObject servletHandler ) { } }

Fix:
IRubyObject v = r . evalScriptlet ( "Jenkins::Plugin.instance.peer" ) ;
Buggy code:
public abstract class AbstractPasswordBasedSecurityRealm extends SecurityRealm implements UserDetailsService { @ Override public SecurityComponents createSecurityComponents ( ) { AbstractPasswordBasedSecurityRealm . Authenticator authenticator = new AbstractPasswordBasedSecurityRealm . Authenticator ( ) ; RememberMeAuthenticationProvider rememberMeAuthenticationProvider = new RememberMeAuthenticationProvider ( ) ; rememberMeAuthenticationProvider . setKey ( HudsonSecurityEntitiesHolder . getHudsonSecurityManager ( ) . getSecretKey ( ) ) ; AnonymousAuthenticationProvider anonymousAuthenticationProvider = new AnonymousAuthenticationProvider ( ) ; anonymousAuthenticationProvider . setKey ( "anonymous" ) ; AuthenticationProvider [ ] authenticationProvider = new AuthenticationProvider [ ] { authenticator , rememberMeAuthenticationProvider , anonymousAuthenticationProvider } ; ProviderManager providerManager = new ProviderManager ( ) ; providerManager . setProviders ( Arrays . asList ( authenticationProvider ) ) ; <START_BUG> return new SecurityComponents ( providerManager ) ; <END_BUG> } @ Override public CliAuthenticator createCliAuthenticator ( final CLICommand command ) { } protected UserDetails doAuthenticate ( String username , String password ) throws AuthenticationException { } protected abstract UserDetails authenticate ( String username , String password ) throws AuthenticationException { } @ Override public abstract UserDetails loadUserByUsername ( String username ) throws DataAccessException , UsernameNotFoundException { } @ Override public abstract GroupDetails loadGroupByGroupname ( String groupname ) throws DataAccessException , UsernameNotFoundException { } class Authenticator extends AbstractUserDetailsAuthenticationProvider { protected void additionalAuthenticationChecks ( UserDetails userDetails , UsernamePasswordAuthenticationToken authentication ) throws AuthenticationException { } protected UserDetails retrieveUser ( String username , UsernamePasswordAuthenticationToken authentication ) throws AuthenticationException { } } private static class InteractivelyAskForPassword implements Callable < String , IOException > { public String call ( ) throws IOException { } private static final long serialVersionUID = 1L ; } }

Fix:
return new SecurityComponents ( providerManager , this ) ;