nus-yam/ex-repair huggingface dataset:
Buggy code:
public class DemoActivity extends Activity { public static final String EXTRA_MESSAGE = "message" ; public static final String PROPERTY_REG_ID = "registration_id" ; private static final String PROPERTY_APP_VERSION = "appVersion" ; private static final int PLAY_SERVICES_RESOLUTION_REQUEST = 9000 ; String SENDER_ID = "616597027379" ; static final String TAG = "GCM" ; GoogleCloudMessaging gcm ; AtomicInteger msgId = new AtomicInteger ( ) ; Context context ; String regid ; @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override protected void onResume ( ) { } private boolean checkPlayServices ( ) { } private void storeRegistrationId ( Context context , String regId ) { } private String getRegistrationId ( Context context ) { } private void registerInBackground ( ) { } @ Override protected void onDestroy ( ) { } private static int getAppVersion ( Context context ) { } private SharedPreferences getGcmPreferences ( Context context ) { } private void sendRegistrationIdToBackend ( ) { JsonObject jsonObject = new JsonObject ( ) ; jsonObject . addProperty ( "regId" , regid ) ; <START_BUG> Ion . with ( context ) . load ( "http:////192.168.1.7:8080//ChatUp//Register" ) . setJsonObjectBody ( jsonObject ) . asJsonObject ( ) . setCallback ( new com . koushikdutta . async . future . FutureCallback < JsonObject > ( ) { <END_BUG> @ Override public void onCompleted ( Exception e , JsonObject jsonObject ) { if ( ( jsonObject == null ) || ( ! ( jsonObject . get ( "response" ) . getAsString ( ) . equals ( "OK" ) ) ) ) { } } } ) ; } No newline ; at end ; of file ; }

Fix:
Ion . with ( context ) . load ( "http:////192.168.1.6:8080//ChatUp//Register" ) . setJsonObjectBody ( jsonObject ) . asJsonObject ( ) . setCallback ( new com . koushikdutta . async . future . FutureCallback < JsonObject > ( ) {
Buggy code:
public class CloudServiceStep extends WizardStep < CreateVMWizardModel > { private Project project ; private CreateVMWizardModel model ; private JPanel rootPanel ; private JList createVmStepsList ; private JEditorPane imageDescriptionTextPane ; private JComboBox cloudServiceComboBox ; private JComboBox storageComboBox ; private JCheckBox availabilitySetCheckBox ; private JComboBox availabilityComboBox ; private List < StorageAccount > storageAccounts ; private List < CloudService > cloudServices ; public CloudServiceStep ( CreateVMWizardModel mModel , final Project project ) { } @ Override public JComponent prepare ( WizardNavigationState wizardNavigationState ) { } @ Override public WizardStep onNext ( CreateVMWizardModel model ) { } private void fillCloudServices ( ) { } private void fillStorage ( ) { Object item = cloudServiceComboBox . getSelectedItem ( ) ; <START_BUG> if ( ( ( item == null ) && ( ( cloudServices ) != null ) ) && ( ( cloudServices . size ( ) ) > 0 ) ) { <END_BUG> item = cloudServices . get ( 0 ) ; } Vector < StorageAccount > accounts = new Vector < StorageAccount > ( ) ; if ( ( ( item != null ) && ( ( storageAccounts ) != null ) ) && ( item instanceof CloudService ) ) { CloudService selectedItem = ( ( CloudService ) ( item ) ) ; for ( StorageAccount storageAccount : storageAccounts ) { if ( storageAccount . getLocation ( ) . equals ( selectedItem . getLocation ( ) ) ) { accounts . add ( storageAccount ) ; } } } storageComboBox . setModel ( new DefaultComboBoxModel ( accounts ) { @ Override public void setSelectedItem ( Object o ) { if ( o instanceof String ) { if ( ( o . toString ( ) . trim ( ) . length ( ) ) > 0 ) { showNewStorageForm ( ) ; } } else { super . setSelectedItem ( o ) ; } } } ) ; storageComboBox . insertItemAt ( "<<<seq2seq4repair_space>Create<seq2seq4repair_space>new<seq2seq4repair_space>storage<seq2seq4repair_space>account<seq2seq4repair_space>>>" , 0 ) ; model . getCurrentNavigationState ( ) . NEXT . setEnabled ( ( ( accounts . size ( ) ) > 0 ) ) ; } private void fillAvailabilitySets ( ) { } private void showNewCloudServiceForm ( ) { } private void showNewStorageForm ( ) { } }

Fix:
if ( ( ( ! ( item instanceof CloudService ) ) && ( ( cloudServices ) != null ) ) && ( ( cloudServices . size ( ) ) > 0 ) ) {
Buggy code:
public class HBaseLookupBolt extends AbstractHBaseBolt { private static final Logger LOG = LoggerFactory . getLogger ( HBaseLookupBolt . class ) ; private HBaseValueMapper rowToTupleMapper ; private HBaseProjectionCriteria projectionCriteria ; public HBaseLookupBolt ( String tableName , HBaseMapper mapper , HBaseValueMapper rowToTupleMapper ) { } public HBaseLookupBolt withConfigKey ( String configKey ) { } public HBaseLookupBolt withProjectionCriteria ( HBaseProjectionCriteria projectionCriteria ) { } @ Override public void execute ( Tuple tuple ) { byte [ ] rowKey = this . mapper . rowKey ( tuple ) ; Get get = hBaseClient . constructGetRequests ( rowKey , projectionCriteria ) ; try { Result result = hBaseClient . batchGet ( Lists . newArrayList ( get ) ) [ 0 ] ; <START_BUG> for ( Values values : rowToTupleMapper . toValues ( tuple , result ) ) { <END_BUG> this . collector . emit ( values ) ; } this . collector . ack ( tuple ) ; } catch ( Exception e ) { HBaseLookupBolt . LOG . warn ( ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>perform<seq2seq4repair_space>Lookup<seq2seq4repair_space>for<seq2seq4repair_space>rowKey<seq2seq4repair_space>=" + rowKey ) + "<seq2seq4repair_space>from<seq2seq4repair_space>Hbase." ) , e ) ; this . collector . fail ( tuple ) ; } } @ Override public void declareOutputFields ( OutputFieldsDeclarer outputFieldsDeclarer ) { } }

Fix:
for ( Values values : rowToTupleMapper . toValues ( result ) ) {
Buggy code:
public abstract class AdviceModeImportSelector < A extends Annotation > implements ImportSelector { public static final String DEFAULT_ADVICE_MODE_ATTRIBUTE_NAME = "mode" ; protected String getAdviceModeAttributeName ( ) { } @ Override public final String [ ] selectImports ( AnnotationMetadata importingClassMetadata ) { <START_BUG> Class < ? > annoType = GenericTypeResolver . resolveTypeArgument ( this . getClass ( ) , AdviceModeImportSelector . class ) ; <END_BUG> AnnotationAttributes attributes = AnnotationConfigUtils . attributesFor ( importingClassMetadata , annoType ) ; Assert . notNull ( attributes , String . format ( "@%s<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>present<seq2seq4repair_space>on<seq2seq4repair_space>importing<seq2seq4repair_space>class<seq2seq4repair_space>'%s'<seq2seq4repair_space>as<seq2seq4repair_space>expected" , annoType . getSimpleName ( ) , importingClassMetadata . getClassName ( ) ) ) ; AdviceMode adviceMode = attributes . getEnum ( this . getAdviceModeAttributeName ( ) ) ; String [ ] imports = selectImports ( adviceMode ) ; Assert . notNull ( imports , String . format ( "Unknown<seq2seq4repair_space>AdviceMode:<seq2seq4repair_space>'%s'" , adviceMode ) ) ; return imports ; } protected abstract String [ ] selectImports ( AdviceMode adviceMode ) { } }

Fix:
Class < ? > annoType = GenericTypeResolver . resolveTypeArgument ( getClass ( ) , AdviceModeImportSelector . class ) ;
Buggy code:
@ EnableScheduling public class InMemoryDirectoryService implements DirectoryNodeService { private final Logger logger = LoggerFactory . getLogger ( getClass ( ) ) ; private static final int CHAIN_LENGTH = 3 ; private List < ChainNodeInfo > chainNodeInfos = Collections . synchronizedList ( new ArrayList < ChainNodeInfo > ( ) ) ; private RestTemplate restTemplate = new RestTemplate ( ) ; private Object lock = new Object ( ) ; private LoadBalancingChainCalculator loadBalancingChainCalculator = new LoadBalancingChainCalculator ( ) ; public InMemoryDirectoryService ( ) { } @ Override public String registerChainNode ( final ChainNodeInfo chainNodeInfo ) { } @ Override public void unregisterChainNode ( String id ) { } @ Override public String getIPAddress ( ) { } private ChainNodeInfo findChainNodeInfo ( String id ) { } @ Override public ChainNodeInfo getChainNode ( final String id ) { } @ Override public Collection < ChainNodeInfo > getAllChainNodes ( ) { } @ Override public List < ChainNodeInfo > getChain ( ) { } private void updateSentMessages ( ChainNodeInfo chainNodeInfo ) { } @ Scheduled ( fixedDelay = 5000 ) public void LifeCheck ( ) { int countAlive = 0 ; Collection < ChainNodeInfo > myChainNodes = this . getAllChainNodes ( ) ; for ( ChainNodeInfo node : myChainNodes ) { try { ChainNodeRoutingStats stats = restTemplate . getForObject ( ( ( node . getUri ( ) . toString ( ) ) + "//ping" ) , ChainNodeRoutingStats . class ) ; this . loadBalancingChainCalculator . updateStats ( stats , node ) ; node . setLastLifeCheck ( new Date ( ) ) ; } catch ( Exception e ) { logger . debug ( ( "caught<seq2seq4repair_space>exception<seq2seq4repair_space>while<seq2seq4repair_space>trying<seq2seq4repair_space>to<seq2seq4repair_space>ping<seq2seq4repair_space>node<seq2seq4repair_space>" + ( node . getId ( ) ) ) , e ) ; <START_BUG> logger . info ( "could<seq2seq4repair_space>not<seq2seq4repair_space>ping<seq2seq4repair_space>node<seq2seq4repair_space>%s,<seq2seq4repair_space>unregistering<seq2seq4repair_space>it" , node . getId ( ) ) ; <END_BUG> this . unregisterChainNode ( node . getId ( ) ) ; } } } }

Fix:
logger . info ( "could<seq2seq4repair_space>not<seq2seq4repair_space>ping<seq2seq4repair_space>node<seq2seq4repair_space>{},<seq2seq4repair_space>unregistering<seq2seq4repair_space>it" , node . getId ( ) ) ;
Buggy code:
public class Contact { private Document doc ; private Element root ; private Object uid ; public Contact ( Document doc , Object uid ) throws WrongFileFormatException { } public Contact ( ) { } public Element getRootElement ( ) { } public void formatSet ( String key , String value ) { } public void formatSet ( String key , String prefix , String value ) { } public void set ( String key , String value ) { } public void set ( String key , String prefix , String value ) { } public String get ( String key ) { } public String formatGet ( String key ) { } public String get ( String key , String prefix ) { } public Document getDocument ( ) { } public Object getUid ( ) { } public void fillFullName ( String fullName ) { String [ ] names = Contact . tryBreakName ( fullName ) ; set ( N_GIVEN , names [ 0 ] ) ; <START_BUG> set ( N_MIDDLE , names [ 1 ] ) ; <END_BUG> set ( N_FAMILY , names [ 2 ] ) ; } private static String [ ] tryBreakName ( String displayName ) { } }

Fix:
set ( N_ADDITIONALNAMES , names [ 1 ] ) ;
Buggy code:
public abstract class MapCalculable extends Calculable { private boolean calculatingMapped ; public MapCalculable ( String name , Set < String > groups , Set < Permission > permissions , String world ) { } private Map < String , Boolean > permissions = new HashMap < String , Boolean > ( ) ; public Map < String , Boolean > getMappedPermissions ( ) { <START_BUG> if ( isDirty ( ) ) { <END_BUG> try { calculateMappedPermissions ( ) ; } catch ( RecursiveGroupException e ) { e . printStackTrace ( ) ; } } else if ( ( permissions . size ( ) ) == 0 ) { try { setDirty ( true ) ; calculateMappedPermissions ( ) ; } catch ( RecursiveGroupException e ) { e . printStackTrace ( ) ; } } return permissions ; } public void calculateMappedPermissions ( ) throws RecursiveGroupException { } @ Override public void clear ( ) { } }

Fix:
if ( ( isDirty ( ) ) && ( ! ( isCalculatingPermissions ( ) ) ) ) {
Buggy code:
public class NewSecurityExtension implements NewExtension { public static final String SUBSYSTEM_NAME = "security" ; private static final NewSecurityExtension . SecuritySubsystemParser PARSER = new NewSecurityExtension . SecuritySubsystemParser ( ) ; @ Override public void initialize ( NewExtensionContext context ) { } @ Override public void initializeParsers ( ExtensionParsingContext context ) { } static class SecuritySubsystemParser implements XMLStreamConstants , XMLElementReader < List < ModelNode > > , XMLElementWriter < SubsystemMarshallingContext > { @ Override public void readElement ( XMLExtendedStreamReader reader , List < ModelNode > list ) throws XMLStreamException { } @ Override public void writeContent ( XMLExtendedStreamWriter writer , SubsystemMarshallingContext context ) throws XMLStreamException { } private boolean has ( ModelNode node , String name ) { <START_BUG> return ( node . has ( name ) ) && ( ( node . get ( name ) ) != null ) ; <END_BUG> } private void writeAttribute ( final XMLExtendedStreamWriter writer , final Attribute attr , final ModelNode value ) throws XMLStreamException { } } }

Fix:
return ( node . has ( name ) ) && ( node . get ( name ) . isDefined ( ) ) ;
Buggy code:
public class MonitorMain implements MonitorControl { public MonitorMain ( URL codeBase , boolean fastMode ) { } public void init ( URL codeBase , boolean fastMode ) { } public void stopExperiment ( ) { } public void startExperiment ( ) { } public void stopPeriod ( ) { } public void startPeriod ( ) { } public boolean isManualControl ( ) { } public void setManualControl ( boolean manual ) { } public void querySessions ( ) { } public static void main ( String [ ] args ) { try { args = new String [ 1 ] ; <START_BUG> args [ 0 ] = "http:////83.212.127.176:8080//jMarkets2Neu//" ; <END_BUG> if ( ( ( args . length ) < 1 ) || ( ( args [ 0 ] ) == null ) ) { System . out . println ( "You<seq2seq4repair_space>must<seq2seq4repair_space>specify<seq2seq4repair_space>a<seq2seq4repair_space>host<seq2seq4repair_space>name<seq2seq4repair_space>with<seq2seq4repair_space>-Dhost=<some<seq2seq4repair_space>host>" ) ; return ; } if ( ! ( args [ 0 ] . endsWith ( "//" ) ) ) args [ 0 ] += "//" ; URL codeBase = new URL ( args [ 0 ] ) ; boolean fastMode = ( ( ( args . length ) > 1 ) && ( ( args [ 1 ] ) != null ) ) && ( args [ 1 ] . equalsIgnoreCase ( "true" ) ) ; MonitorMain main = new MonitorMain ( codeBase , fastMode ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } private int sessionId ; private MonitorUI ui ; private SessionSelectorDialog sessionSelector ; private HTTPMonitorTransmitter transmitter ; private boolean fastMode ; }

Fix:
args [ 0 ] = "http:////localhost:8080//jMarkets2Neu//" ;
Buggy code:
public class ArquillianDeploymentProcessor implements DeploymentUnitProcessor { private static final ServiceName SERVICE_NAME_BASE = JBOSS . append ( "arquillian" , "deployment" , "tracker" ) ; @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { ArquillianConfig arqConfig = phaseContext . getDeploymentUnit ( ) . getAttachment ( KEY ) ; if ( arqConfig == null ) return ; ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; ArquillianDeploymentProcessor . DeploymentTrackerService tracker = new ArquillianDeploymentProcessor . DeploymentTrackerService ( arqConfig ) ; ServiceBuilder < Object > serviceBuilder = serviceTarget . addService ( ArquillianDeploymentProcessor . SERVICE_NAME_BASE . append ( phaseContext . getDeploymentUnit ( ) . getName ( ) ) , tracker ) ; serviceBuilder . addDependency ( SERVICE_NAME , ArquillianService . class , tracker . injectedArquillianService ) ; <START_BUG> Deployment osgiDeployment = OSGiDeploymentAttachment . getAttachment ( phaseContext . getDeploymentUnit ( ) ) ; <END_BUG> if ( osgiDeployment != null ) { ServiceName serviceName = OSGiDeploymentService . getServiceName ( phaseContext . getDeploymentUnit ( ) . getName ( ) ) ; serviceBuilder . addDependency ( serviceName ) ; osgiDeployment . setAutoStart ( false ) ; } serviceBuilder . install ( ) ; } public void undeploy ( final DeploymentUnit context ) { } private class DeploymentTrackerService implements Service < Object > { private final ArquillianConfig arqConfig ; private final InjectedValue < ArquillianService > injectedArquillianService = new InjectedValue < ArquillianService > ( ) ; public DeploymentTrackerService ( ArquillianConfig arqConfig ) { } @ Override public void start ( StartContext context ) throws StartException { } @ Override public void stop ( StopContext context ) { } @ Override public Object getValue ( ) throws IllegalStateException { } } }

Fix:
Deployment osgiDeployment = OSGiDeploymentAttachment . getDeployment ( phaseContext . getDeploymentUnit ( ) ) ;
Buggy code:
public class RemoteServiceRegistrationImpl implements Serializable , IRemoteServiceRegistration { private static final long serialVersionUID = - 3206899332723536545L ; transient Object service ; protected String [ ] clazzes ; protected RemoteServiceRegistrationImpl . Properties properties ; protected int serviceranking ; protected transient Object registrationLock = new Object ( ) ; protected int state = RemoteServiceRegistrationImpl . REGISTERED ; public static final int REGISTERED = 0 ; public static final int UNREGISTERING = 1 ; public static final int UNREGISTERED = 2 ; protected transient RemoteServiceReferenceImpl reference = null ; protected transient RegistrySharedObject sharedObject = null ; protected IRemoteServiceID remoteServiceID ; public RemoteServiceRegistrationImpl ( ) { } public boolean equals ( Object o ) { } public int hashCode ( ) { } public void publish ( RegistrySharedObject sharedObject1 , RemoteServiceRegistryImpl registry , Object svc , String [ ] clzzes , Dictionary props ) { } public Object getService ( ) { } public ID getContainerID ( ) { } protected String [ ] getClasses ( ) { } public IRemoteServiceReference getReference ( ) { } public void setProperties ( Dictionary properties ) { } public void unregister ( ) { } protected RemoteServiceRegistrationImpl . Properties createProperties ( Dictionary props ) { final RemoteServiceRegistrationImpl . Properties resultProps = new RemoteServiceRegistrationImpl . Properties ( props ) ; resultProps . setProperty ( REMOTEOBJECTCLASS , clazzes ) ; resultProps . setProperty ( REMOTESERVICE_ID , new Long ( getID ( ) . getContainerRelativeID ( ) ) ) ; <START_BUG> final Object ranking = props . get ( REMOTESERVICE_RANKING ) ; <END_BUG> serviceranking = ( ranking instanceof Integer ) ? ( ( Integer ) ( ranking ) ) . intValue ( ) : 0 ; return resultProps ; } static class Properties extends Hashtable { private static final long serialVersionUID = - 3684607010228779249L ; private Properties ( int size , Dictionary props ) { } protected Properties ( Dictionary props ) { } protected Object getProperty ( String key ) { } protected synchronized String [ ] getPropertyKeys ( ) { } protected synchronized Object setProperty ( String key , Object value ) { } protected static Object cloneValue ( Object value ) { } public synchronized String toString ( ) { } } public Object getProperty ( String key ) { } public String [ ] getPropertyKeys ( ) { } public long getServiceId ( ) { } public Object callService ( RemoteCallImpl call ) throws Exception { } public String toString ( ) { } public IRemoteServiceID getID ( ) { } }

Fix:
final Object ranking = ( props == null ) ? null : props . get ( REMOTESERVICE_RANKING ) ;
Buggy code:
public class PermanentlyUnavailable extends HttpServlet { public void init ( ServletConfig conf ) throws ServletException { <START_BUG> throw new UnavailableException ( "Permanently<seq2seq4repair_space>Unavailable" , ( - 1 ) ) ; <END_BUG> } public void service ( HttpServletRequest req , HttpServletResponse res ) throws IOException { } }

Fix:
throw new UnavailableException ( "Permanently<seq2seq4repair_space>Unavailable" ) ;
Buggy code:
public class TTCCLayout extends DateLayout { private boolean threadPrinting = true ; private boolean categoryPrefixing = true ; private boolean contextPrinting = true ; protected final StringBuffer buf = new StringBuffer ( 256 ) ; public TTCCLayout ( ) { } public TTCCLayout ( String dateFormatType ) { } public void setThreadPrinting ( boolean threadPrinting ) { } public boolean getThreadPrinting ( ) { } public void setCategoryPrefixing ( boolean categoryPrefixing ) { } public boolean getCategoryPrefixing ( ) { } public void setContextPrinting ( boolean contextPrinting ) { } public boolean getContextPrinting ( ) { } public String format ( LoggingEvent event ) { buf . setLength ( 0 ) ; dateFormat ( buf , event ) ; if ( this . threadPrinting ) { buf . append ( '[' ) ; buf . append ( event . getThreadName ( ) ) ; buf . append ( "]<seq2seq4repair_space>" ) ; } buf . append ( event . level . toString ( ) ) ; buf . append ( '<seq2seq4repair_space>' ) ; if ( this . categoryPrefixing ) { <START_BUG> buf . append ( event . loggerName ) ; <END_BUG> buf . append ( '<seq2seq4repair_space>' ) ; } if ( this . contextPrinting ) { String ndc = event . getNDC ( ) ; if ( ndc != null ) { buf . append ( ndc ) ; buf . append ( '<seq2seq4repair_space>' ) ; } } buf . append ( "-<seq2seq4repair_space>" ) ; buf . append ( event . getRenderedMessage ( ) ) ; buf . append ( Layout . LINE_SEP ) ; return buf . toString ( ) ; } public boolean ignoresThrowable ( ) { } }

Fix:
buf . append ( event . categoryName ) ;
Buggy code:
public class FirstTimeActivity extends Activity { private EditText nameEditText ; private EditText heightEditText ; private EditText weightEditText ; private Button createButton ; private String name ; private String height ; private String weight ; private SharedPreferences settings ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private void alertName ( ) { } private void alertWeightWrong ( ) { } private void alertHeightWrong ( ) { } private void alertEmptyHeightWeight ( final String name , final String heightText , final String weightText ) { } private void alertProfile ( ) { } protected boolean checkHeightFormat ( String height ) { } protected boolean checkWeightFormat ( String weight ) { } public void onSaveClick ( View view ) { } private void saveUserInput ( String name , String height , String weight ) { SharedPreferences . Editor editor = settings . edit ( ) ; editor . putString ( "name" , name ) ; editor . putString ( "height" , height . replaceAll ( "\\s" , "" ) ) ; editor . putString ( "weight" , weight ) ; editor . putString ( "units" , "imperial" ) ; <START_BUG> editor . putString ( "greeting" , ( "Hello,<seq2seq4repair_space>" + name ) ) ; <END_BUG> editor . commit ( ) ; } private void goToHomeActivity ( ) { } }

Fix:
editor . putString ( "greeting" , ( "Hi,<seq2seq4repair_space>" + name ) ) ;
Buggy code:
public class ExampleRunner { public static void main ( String [ ] args ) throws Exception { } static void createTestConnector ( final ModelControllerClient client ) throws IOException , OperationFailedException { final List < ModelNode > updates = new ArrayList < ModelNode > ( ) ; ModelNode op = new ModelNode ( ) ; op . get ( "operation" ) . set ( "add" ) ; op . get ( "address" ) . add ( "socket-binding-group" , "standard-sockets" ) ; op . get ( "address" ) . add ( "socket-binding" , "http-test" ) ; op . get ( "interface" ) . set ( "default" ) ; op . get ( "port" ) . set ( 8380 ) ; updates . add ( op ) ; op = new ModelNode ( ) ; op . get ( "operation" ) . set ( "add" ) ; op . get ( "address" ) . add ( "subsystem" , "web" ) ; op . get ( "address" ) . add ( "connector" , "testConnector" ) ; op . get ( "socket-binding" ) . set ( "http-test" ) ; op . get ( "enabled" ) . set ( true ) ; <START_BUG> op . get ( "protocol" ) . set ( "http" ) ; <END_BUG> op . get ( "scheme" ) . set ( "http" ) ; updates . add ( op ) ; ExampleRunner . applyUpdates ( updates , client ) ; } static void removeTestConnector ( final ModelControllerClient client ) throws IOException , OperationFailedException { } static void applyUpdates ( final List < ModelNode > updates , final ModelControllerClient client ) throws IOException , OperationFailedException { } static void applyUpdate ( ModelNode update , final ModelControllerClient client ) throws IOException , OperationFailedException { } }

Fix:
op . get ( "protocol" ) . set ( "HTTP//1.1" ) ;
Buggy code:
public class TypeVariableBinding extends ReferenceBinding { public Binding declaringElement ; public int rank ; public TypeBinding firstBound ; public ReferenceBinding superclass ; public ReferenceBinding [ ] superInterfaces ; public char [ ] genericTypeSignature ; public TypeVariableBinding ( char [ ] sourceName , Binding declaringElement , int rank ) { } public int kind ( ) { } public int boundCheck ( Substitution substitution , TypeBinding argumentType ) { } public boolean canBeInstantiated ( ) { } public void collectSubstitutes ( Scope scope , TypeBinding actualType , InferenceContext inferenceContext , int constraint ) { } public char [ ] constantPoolName ( ) { } public char [ ] computeUniqueKey ( boolean isLeaf ) { } public String debugName ( ) { } public TypeBinding erasure ( ) { } public char [ ] genericSignature ( ) { } public char [ ] genericTypeSignature ( ) { } public int boundsCount ( ) { } public boolean isErasureBoundTo ( TypeBinding type ) { } public boolean isInterchangeableWith ( TypeVariableBinding otherVariable , Substitution substitute ) { } public boolean isTypeVariable ( ) { } public char [ ] readableName ( ) { } ReferenceBinding resolve ( LookupEnvironment environment ) { } public char [ ] shortReadableName ( ) { <START_BUG> return this . readableName ( ) ; <END_BUG> } public ReferenceBinding superclass ( ) { } public ReferenceBinding [ ] superInterfaces ( ) { } public String toString ( ) { } public TypeBinding upperBound ( ) { } public TypeBinding [ ] otherUpperBounds ( ) { } }

Fix:
return readableName ( ) ;
Buggy code:
public class ActionImportFromSources extends UMLAction { public static ActionImportFromSources SINGLETON = new ActionImportFromSources ( ) ; public static final String separator = "//" ; protected ActionImportFromSources ( ) { } public void actionPerformed ( ActionEvent event ) { ProjectBrowser pb = ProjectBrowser . TheInstance ; Project p = pb . getProject ( ) ; try { String directory = Globals . getLastDirectory ( ) ; JFileChooser chooser = OsUtil . getFileChooser ( directory ) ; if ( chooser == null ) <START_BUG> chooser = new JFileChooser ( ) ; <END_BUG> chooser . setFileSelectionMode ( JFileChooser . FILES_AND_DIRECTORIES ) ; chooser . setDialogTitle ( "Import<seq2seq4repair_space>sources" ) ; chooser . setAccessory ( Import . getConfigPanel ( ) ) ; int retval = chooser . showOpenDialog ( pb ) ; if ( retval == 0 ) { File theFile = chooser . getSelectedFile ( ) ; if ( theFile != null ) { String path = chooser . getSelectedFile ( ) . getParent ( ) ; String filename = chooser . getSelectedFile ( ) . getName ( ) ; filename = ( path + ( ActionImportFromSources . separator ) ) + filename ; Globals . setLastDirectory ( path ) ; if ( filename != null ) { pb . showStatus ( ( ( ( "Parsing<seq2seq4repair_space>" + path ) + filename ) + "..." ) ) ; Import . doFile ( p , theFile ) ; p . postLoad ( ) ; if ( Import . needsSave ( ) ) { p . setNeedsSave ( true ) ; } pb . setProject ( p ) ; pb . showStatus ( ( "Parsed<seq2seq4repair_space>" + filename ) ) ; return ; } } } } catch ( Exception exception ) { System . out . println ( "got<seq2seq4repair_space>an<seq2seq4repair_space>Exception<seq2seq4repair_space>in<seq2seq4repair_space>ActionImportFromSources" ) ; exception . printStackTrace ( ) ; } } }

Fix:
chooser = OsUtil . getFileChooser ( ) ;
Buggy code:
public class WebServiceSEIPresentNoWebMethodRule extends AbstractAnnotationProcessor { public WebServiceSEIPresentNoWebMethodRule ( ) { } @ Override public void process ( ) { } private void checkWebMethods ( Messager messager ) { AnnotationTypeDeclaration webMethodDeclaration = ( ( AnnotationTypeDeclaration ) ( environment . getTypeDeclaration ( "javax.jws.WebMethod" ) ) ) ; Collection < Declaration > webMethodAnnotatedTypes = environment . getDeclarationsAnnotatedWith ( webMethodDeclaration ) ; for ( Declaration declaration : webMethodAnnotatedTypes ) { Collection < AnnotationMirror > annotationMirrors = declaration . getAnnotationMirrors ( ) ; for ( AnnotationMirror mirror : annotationMirrors ) { if ( mirror . getAnnotationType ( ) . toString ( ) . equals ( webMethodDeclaration . getQualifiedName ( ) ) ) { <START_BUG> messager . printError ( mirror . getPosition ( ) , WEBSERVICE_ANNOTATION_PROCESSOR_WEBSERVICE_ENPOINTINTERFACE_NO_WEBMETHOS_ERROR_MESSAGE ) ; <END_BUG> } } } } }

Fix:
messager . printError ( mirror . getPosition ( ) , WEBSERVICE_ENPOINTINTERFACE_NO_WEBMETHOS_ERROR_MESSAGE ) ;
Buggy code:
public abstract class MSVSS extends Task { private String m_SSDir = "" ; private String m_vssLogin = null ; private String m_vssPath = null ; private String m_serverPath = null ; public final void setSsdir ( String dir ) { } public final String getSSCommand ( ) { } public final void setLogin ( String login ) { } public void getLoginCommand ( Commandline cmd ) { } public final void setVsspath ( String vssPath ) { String projectPath ; if ( vssPath . startsWith ( "vss:////" ) ) { projectPath = vssPath . substring ( 5 ) ; } else { projectPath = vssPath ; } <START_BUG> if ( ( projectPath . charAt ( 0 ) ) == '$' ) { <END_BUG> m_vssPath = projectPath ; } else { m_vssPath = ( MSVSS . PROJECT_PREFIX ) + projectPath ; } } public String getVsspath ( ) { } public final void setServerpath ( String serverPath ) { } protected int run ( Commandline cmd ) { } private static final String SS_EXE = "ss" ; public static final String PROJECT_PREFIX = "$" ; public static final String COMMAND_CP = "CP" ; public static final String COMMAND_ADD = "Add" ; public static final String COMMAND_GET = "Get" ; public static final String COMMAND_CHECKOUT = "Checkout" ; public static final String COMMAND_CHECKIN = "Checkin" ; public static final String COMMAND_LABEL = "Label" ; public static final String COMMAND_HISTORY = "History" ; public static final String COMMAND_CREATE = "Create" ; public static final String FLAG_LOGIN = "-Y" ; public static final String FLAG_OVERRIDE_WORKING_DIR = "-GL" ; public static final String FLAG_AUTORESPONSE_DEF = "-I-" ; public static final String FLAG_AUTORESPONSE_YES = "-I-Y" ; public static final String FLAG_AUTORESPONSE_NO = "-I-N" ; public static final String FLAG_RECURSION = "-R" ; public static final String FLAG_VERSION = "-V" ; public static final String FLAG_VERSION_DATE = "-Vd" ; public static final String FLAG_VERSION_LABEL = "-VL" ; public static final String FLAG_WRITABLE = "-W" ; public static final String VALUE_NO = "-N" ; public static final String VALUE_YES = "-Y" ; public static final String FLAG_QUIET = "-O-" ; }

Fix:
if ( projectPath . startsWith ( MSVSS . PROJECT_PREFIX ) ) {
Buggy code:
public abstract class AutoCompleteBehavior < T > extends AbstractAutoCompleteBehavior { private static final long serialVersionUID = 1L ; private final IAutoCompleteRenderer < T > renderer ; public AutoCompleteBehavior ( IAutoCompleteRenderer < T > renderer ) { } public AutoCompleteBehavior ( IAutoCompleteRenderer < T > renderer , boolean preselect ) { } public AutoCompleteBehavior ( IAutoCompleteRenderer < T > renderer , AutoCompleteSettings settings ) { } @ Override protected final void onRequest ( final String val , RequestCycle requestCycle ) { IRequestHandler target = new IRequestHandler ( ) { public void respond ( IRequestCycle requestCycle ) { WebResponse r = ( ( WebResponse ) ( requestCycle . getResponse ( ) ) ) ; final String encoding = Application . get ( ) . getRequestCycleSettings ( ) . getResponseRequestEncoding ( ) ; r . setContentType ( ( "text//xml;<seq2seq4repair_space>charset=" + encoding ) ) ; <START_BUG> RequestUtils . disableCaching ( r ) ; <END_BUG> Iterator < T > comps = getChoices ( val ) ; renderer . renderHeader ( r ) ; while ( comps . hasNext ( ) ) { final T comp = comps . next ( ) ; renderer . render ( comp , r , val ) ; } renderer . renderFooter ( r ) ; } public void detach ( IRequestCycle requestCycle ) { } } ; requestCycle . scheduleRequestHandlerAfterCurrent ( target ) ; } protected abstract Iterator < T > getChoices ( String input ) { } }

Fix:
r . disableCaching ( ) ;
Buggy code:
public class TryStatement extends Statement { public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor ( TryStatement . class , "body" , Block . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; public static final ChildListPropertyDescriptor CATCH_CLAUSES_PROPERTY = new ChildListPropertyDescriptor ( TryStatement . class , "catchClauses" , CatchClause . class , ASTNode . CYCLE_RISK ) ; public static final ChildPropertyDescriptor FINALLY_PROPERTY = new ChildPropertyDescriptor ( TryStatement . class , "finally" , Block . class , ASTNode . OPTIONAL , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private Block body = null ; private ASTNode . NodeList catchClauses = new ASTNode . NodeList ( TryStatement . CATCH_CLAUSES_PROPERTY ) ; private Block optionalFinallyBody = null ; TryStatement ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final List internalGetChildListProperty ( ChildListPropertyDescriptor property ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Block getBody ( ) { if ( ( this . body ) == null ) { <START_BUG> synchronized ( this . ast ) { <END_BUG> if ( ( this . body ) == null ) { preLazyInit ( ) ; this . body = new Block ( this . ast ) ; postLazyInit ( this . body , TryStatement . BODY_PROPERTY ) ; } } } return this . body ; } public void setBody ( Block body ) { } public List catchClauses ( ) { } public Block getFinally ( ) { } public void setFinally ( Block block ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
synchronized ( this ) {
Buggy code:
public class ComponentResolvingPage extends WebPage implements IComponentResolver { private static final long serialVersionUID = 1L ; public boolean onDetachWasCalledOnAutoAddedComponent = false ; public ComponentResolvingPage ( ) { } public boolean resolve ( final MarkupContainer container , final MarkupStream markupStream , final ComponentTag tag ) { if ( "test" . equals ( tag . getId ( ) ) ) { autoAdd ( new Label ( "test" , "TEST" ) { private static final long serialVersionUID = 1L ; protected void onDetach ( ) { onDetachWasCalledOnAutoAddedComponent = true ; super . onDetach ( ) ; } <START_BUG> } ) ; <END_BUG> return true ; } return false ; } }

Fix:
} , markupStream ) ;
Buggy code:
public class Main { public static void main ( String [ ] args ) { final GLProfile profile = GLProfile . get ( GL2 ) ; GLCapabilities capabilities = new GLCapabilities ( profile ) ; GLCanvas canvas = new GLCanvas ( capabilities ) ; canvas . setSize ( 800 , 600 ) ; CubeNNNRenderer renderer = new CubeNNNRenderer ( 3 ) ; canvas . addGLEventListener ( renderer ) ; <START_BUG> FPSAnimator animator = new FPSAnimator ( canvas , 80 , false ) ; <END_BUG> animator . start ( ) ; CubeNNNController controller = new CubeNNNController ( renderer , animator ) ; canvas . addKeyListener ( controller ) ; controller . start ( ) ; Frame mainFrame = new Frame ( "Virtual<seq2seq4repair_space>Cube" ) ; mainFrame . setLayout ( new BorderLayout ( ) ) ; mainFrame . add ( canvas , BorderLayout . CENTER ) ; mainFrame . pack ( ) ; mainFrame . setLocationRelativeTo ( null ) ; mainFrame . addWindowListener ( new WindowAdapter ( ) { @ Override public void windowClosing ( WindowEvent e ) { controller . interrupt ( ) ; animator . stop ( ) ; mainFrame . dispose ( ) ; } } ) ; mainFrame . addKeyListener ( controller ) ; mainFrame . setVisible ( true ) ; } }

Fix:
FPSAnimator animator = new FPSAnimator ( canvas , 80 , true ) ;
Buggy code:
public class SingleTypeReference extends TypeReference { public char [ ] token ; public SingleTypeReference ( char [ ] source , long pos ) { } public TypeReference copyDims ( int dim ) { } protected TypeBinding getTypeBinding ( Scope scope ) { } public char [ ] [ ] getTypeName ( ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveTypeEnclosing ( BlockScope scope , ReferenceBinding enclosingType ) { ReferenceBinding memberType = scope . getMemberType ( token , enclosingType ) ; if ( ! ( memberType . isValidBinding ( ) ) ) { this . resolvedType = memberType ; scope . problemReporter ( ) . invalidEnclosingType ( this , memberType , enclosingType ) ; return null ; } if ( isTypeUseDeprecated ( memberType , scope ) ) scope . problemReporter ( ) . deprecatedType ( memberType , this ) ; <START_BUG> return this . resolvedType = scope . convertToRawType ( memberType ) ; <END_BUG> } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } public void traverse ( ASTVisitor visitor , ClassScope scope ) { } }

Fix:
return this . resolvedType = scope . environment ( ) . convertToRawType ( memberType ) ;
Buggy code:
@ ManagedBean ( name = "spottingActivityBean" ) @ ViewScoped public class SpottingActivityBean implements Serializable { private ActivityVo activity ; private Integer idSequence ; private DocumentTexte text ; private String mainReferent ; private final String MAIN_REF = "r1" ; private String elemToFind ; private String typeToFind ; private String subTypeToFind ; private final String [ ] colorRef = new String [ ] { "black" , "red" , "darkblue" , "green" , "purple" , "deeppink" , "goldenrod" } ; private final String [ ] colorCoRef = new String [ ] { "black" , "orange" , "blue" , "greenyellow" , "orchid" , "hotpink" , "gold" } ; private List < ElementXML > selectedElements ; private List < ElementXML > elementsToDrag ; public void preRenderView ( ) throws Exception { } private void initElements ( ) { } public List < ElementXML > getTitleElems ( ) { List < ElementXML > elems = new ArrayList < ElementXML > ( ) ; <START_BUG> if ( ( text ) != null ) { <END_BUG> List < Phrase > phrases = text . getContenu ( ) . getTitre ( ) . getPhrase ( ) ; for ( Phrase phrase : phrases ) { addPhraseElems ( phrase , elems ) ; } } return elems ; } private void addPhraseElems ( Phrase phrase , List < ElementXML > elems ) { } private List < ElementXML > getPropElems ( ElementXML prop ) { } public List < ElementXML > getSubtitleElems ( ElementXML subtitle ) { } public List < ElementXML > getParagraphElems ( ElementXML paragraph ) { } public String getElementsFromReferent ( ElementXML element ) { } public String getRefColor ( String idn ) { } public String getCoRefColor ( String ref , String idn ) { } public ActivityVo getActivity ( ) { } public void setActivity ( ActivityVo activity ) { } public Integer getIdSequence ( ) { } public void setIdSequence ( Integer idSequence ) { } public DocumentTexte getText ( ) { } public void setText ( DocumentTexte text ) { } public String getMainReferent ( ) { } public void setMainReferent ( String mainReferent ) { } public List < ElementXML > getSelectedElements ( ) { } public void setSelectedElements ( List < ElementXML > selectedElements ) { } public List < ElementXML > getElementsToDrag ( ) { } public void setElementsToDrag ( List < ElementXML > elementsToDrag ) { } public String getMAIN_REF ( ) { } public String getElemToFind ( ) { } public void setElemToFind ( String elemToFInd ) { } public String getTypeToFind ( ) { } public void setTypeToFind ( String typeToFind ) { } public String getSubTypeToFind ( ) { } public void setSubTypeToFind ( String subTypeToFind ) { } }

Fix:
if ( ( ( text ) != null ) && ( ( text . getContenu ( ) . getTitre ( ) ) != null ) ) {
Buggy code:
public class TooltipCandidate { private double value ; private int line ; private String text ; private Peak peak ; public TooltipCandidate ( double value , int line , String text , Peak peak ) { } public boolean isValid ( double x , int line , double scale ) { <START_BUG> return ( ( Math . abs ( ( x - ( value ) ) ) ) <= ( 5 // scale ) ) && ( line == ( this . line ) ) ; <END_BUG> } public String getText ( ) { } public Peak getPeak ( ) { } }

Fix:
return ( ( Math . abs ( ( ( x // scale ) - ( value ) ) ) ) <= ( 5 // scale ) ) && ( line == ( this . line ) ) ;
Buggy code:
public class RestartResponseAtInterceptPageException extends AbstractRestartResponseException { private static final long serialVersionUID = 1L ; public RestartResponseAtInterceptPageException ( final Page interceptPage ) { } public RestartResponseAtInterceptPageException ( final Class interceptPageClass ) { } private void redirectToInterceptPage ( final Page interceptPage ) { <START_BUG> Page p = RequestCycle . get ( ) . getRequest ( ) . getPage ( ) ; <END_BUG> final PageMap pageMap ; if ( p == null ) { pageMap = p . getPageMap ( ) ; } else { pageMap = interceptPage . getPageMap ( ) ; } pageMap . redirectToInterceptPage ( interceptPage ) ; } }

Fix:
final Page p = RequestCycle . get ( ) . getRequest ( ) . getPage ( ) ;
Buggy code:
public class MyCourseJsonUtils { private List < MyCourseJsonTools > list ; private MyCourseJsonTools tools ; public List < MyCourseJsonTools > PutData ( String str ) { list = new ArrayList < MyCourseJsonTools > ( ) ; JSONObject obj ; try { obj = new JSONObject ( str ) ; <START_BUG> JSONArray arr = obj . getJSONArray ( "data" ) ; <END_BUG> for ( int i = 0 ; i < ( arr . length ( ) ) ; i ++ ) { tools = new MyCourseJsonTools ( ) ; JSONObject json = arr . getJSONObject ( i ) ; if ( ( json . getString ( "course" ) ) != "null" ) { tools . setStart_weekday ( json . getJSONObject ( "course" ) . getString ( "startWeekDay" ) ) ; tools . setStart_minute ( json . getJSONObject ( "course" ) . getString ( "startMinute" ) ) ; tools . setStart_hour ( json . getJSONObject ( "course" ) . getString ( "startHour" ) ) ; tools . setStart_time ( json . getJSONObject ( "course" ) . getString ( "startTime" ) ) ; tools . setEnd_time ( json . getJSONObject ( "course" ) . getString ( "endTime" ) ) ; tools . setName ( json . getJSONObject ( "course" ) . getString ( "name" ) ) ; tools . setBranch_name ( json . getJSONObject ( "course" ) . getString ( "branchName" ) ) ; tools . setDuration_minute ( json . getJSONObject ( "course" ) . getString ( "durationMinute" ) ) ; tools . setCourse_no ( json . getJSONObject ( "course" ) . getString ( "no" ) ) ; tools . setCreate_time ( json . getJSONObject ( "course" ) . getString ( "createTime" ) ) ; JSONArray order = json . getJSONArray ( "orders" ) ; int paidCount = 0 ; int gongFangCount = 0 ; int huoDongCount = 0 ; int specCount = 0 ; int paidUsedCount = 0 ; int gongFangUsedCount = 0 ; int huoDongUsedCount = 0 ; int specUsedCount = 0 ; JSONObject order_json ; for ( int j = 0 ; j < ( order . length ( ) ) ; j ++ ) { order_json = order . getJSONObject ( j ) ; paidCount += order_json . getInt ( "paiedCount" ) ; gongFangCount += order_json . getInt ( "gongfangCount" ) ; huoDongCount += order_json . getInt ( "huodongCount" ) ; specCount += order_json . getInt ( "specialCourseCount" ) ; paidUsedCount += order_json . getInt ( "usedCount" ) ; gongFangUsedCount += order_json . getInt ( "usedGongFangCount" ) ; huoDongUsedCount += order_json . getInt ( "usedHuodongCount" ) ; specUsedCount += order_json . getInt ( "usedSpecialCourseCount" ) ; tools . setLevel ( order . getJSONObject ( 0 ) . getInt ( "level" ) ) ; } tools . setPaid_count ( paidCount ) ; tools . setGongfang_count ( gongFangCount ) ; tools . setHuodong_count ( huoDongCount ) ; tools . setSpec_count ( specCount ) ; tools . setUsed_count ( paidUsedCount ) ; tools . setUsed_gongfang_count ( gongFangUsedCount ) ; tools . setUsed_huodong_count ( huoDongUsedCount ) ; tools . setUsed_spec_count ( specUsedCount ) ; list . add ( tools ) ; } } } catch ( JSONException e ) { e . printStackTrace ( ) ; } return list ; } }

Fix:
JSONArray arr = obj . getJSONArray ( "records" ) ;
Buggy code:
public class Polling extends Thread { static HashMap < String , Long > pollLatency ; static boolean polling ; public Polling ( ) { } @ Override public void run ( ) { while ( Polling . polling ) { try { <START_BUG> Thread . sleep ( 1000 ) ; <END_BUG> if ( ( neighbors . size ( ) ) > 0 ) { JoinPacket jp = new JoinPacket ( ) ; Message < JoinPacket > m = new Message < JoinPacket > ( 100 , jp ) ; for ( String neighbor : neighbors . keySet ( ) ) { Polling . pollLatency . put ( Peer . getIP ( neighbor ) , System . currentTimeMillis ( ) ) ; Peer . sendMessageX ( neighbor , m ) ; } } } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } } } }

Fix:
Thread . sleep ( 5000 ) ;
Buggy code:
public class PagingTypeBootstrapFullNumbersFeature extends AbstractExtension { public static final String FEATURE_NAME = "pagingTypeBootstrapFullNumbers" ; @ Override public String getExtensionName ( ) { } @ Override public void setup ( HtmlTable table ) { <START_BUG> addBundle ( DDL_DT_PAGING_BOOTSTRAP_FULLNUMBERS ) ; <END_BUG> addParameter ( DT_PAGINGTYPE , BOOTSTRAP_FULL_NUMBERS . toString ( ) ) ; } }

Fix:
addBundle ( DDL_DT_PAGING_BOOTSTRAP_FULL_NUMBERS ) ;
Buggy code:
public class MDSUpgrader extends AbstractUpgrader { private static final Logger LOG = LoggerFactory . getLogger ( MDSUpgrader . class ) ; private final Transactional < MDSUpgrader . AppMDS , MetadataStoreDataset > appMDS ; private final CConfiguration cConf ; private final Store store ; private final Set < String > appStreams ; private static final Gson GSON ; @ Inject private MDSUpgrader ( LocationFactory locationFactory , TransactionExecutorFactory executorFactory , @ Named ( "dsFramework" ) final DatasetFramework dsFramework , CConfiguration cConf , @ Named ( "defaultStore" ) final Store store ) { } @ Override public void upgrade ( ) throws Exception { } private void handleAppSpec ( String appId , ApplicationSpecification appSpec ) { } private void handlePrograms ( String appId , Set < String > programIds , ProgramType programType ) { } private void handleProgramArgs ( final String appId , final String programId , final ProgramType programType ) { } private void handleRunRecordStarted ( final String appId , final String programId , final ProgramType programType ) { } private void handleRunRecordCompleted ( final String appId , final String programId , final ProgramType programType ) { } private void writeTempRunRecordStart ( String appId , ProgramType programType , String programId , String pId , long startTs ) { <START_BUG> store . setStart ( Program . from ( Application . from ( DEFAULT_NAMESPACE , appId ) , programType , programId ) , pId , ( ( Long . MAX_VALUE ) - startTs ) ) ; <END_BUG> } private void upgradeAppMeta ( ApplicationMeta appMeta ) throws IOException , URISyntaxException { } private Location updateAppArchiveLocation ( String appId , URI archiveLocation ) throws IOException { } private static final class AppMDS implements Iterable < MetadataStoreDataset > { private final MetadataStoreDataset mds ; private AppMDS ( MetadataStoreDataset metaTable ) { } @ Override public Iterator < MetadataStoreDataset > iterator ( ) { } } private static class AppMetadataStoreDataset extends MetadataStoreDataset { public AppMetadataStoreDataset ( Table table ) { } @ Override protected < T > T deserialize ( byte [ ] serialized , Class < T > classOfT ) { } } }

Fix:
store . setStart ( Program . from ( Application . from ( DEFAULT_NAMESPACE , appId ) , programType , programId ) , pId , startTs ) ;
Buggy code:
public class CredentialsInterceptor extends BaseInterceptor { int userNote ; int passwordNote ; public static final String USER_NOTE = "credentials.user" ; public static final String PASSWORD_NOTE = "credentials.password" ; public CredentialsInterceptor ( ) { } public void engineInit ( ContextManager cm ) throws TomcatException { } public int authenticate ( Request req , Response res ) { Context ctx = req . getContext ( ) ; String login_type = ctx . getAuthMethod ( ) ; if ( "BASIC" . equals ( login_type ) ) { basicCredentials ( req ) ; } if ( "FORM" . equals ( login_type ) ) { formCredentials ( req ) ; } <START_BUG> return 0 ; <END_BUG> } private void basicCredentials ( Request req ) { } private void formCredentials ( Request req ) { } }

Fix:
return DECLINED ;
Buggy code:
class InitializerSignatureImpl extends CodeSignatureImpl implements InitializerSignature { InitializerSignatureImpl ( int modifiers , Class declaringType ) { } InitializerSignatureImpl ( String stringRep ) { } public String getName ( ) { } String toString ( StringMaker sm ) { StringBuffer buf = new StringBuffer ( ) ; buf . append ( sm . makeModifiersString ( getModifiers ( ) ) ) ; <START_BUG> buf . append ( sm . makePrimaryTypeName ( getDeclaringType ( ) ) ) ; <END_BUG> buf . append ( "." ) ; buf . append ( getName ( ) ) ; return buf . toString ( ) ; } }

Fix:
buf . append ( sm . makePrimaryTypeName ( getDeclaringType ( ) , getDeclaringTypeName ( ) ) ) ;