nus-yam/ex-repair huggingface dataset:
Buggy code:
@ RunWith ( Parameterized . class ) public class InfinispanSubsystemTestCase extends ClusteringSubsystemTest { String xmlFile = null ; int operations = 0 ; public InfinispanSubsystemTestCase ( String xmlFile , int operations ) { } @ Parameters public static Collection < Object [ ] > data ( ) { <START_BUG> Object [ ] [ ] data = new Object [ ] [ ] { new Object [ ] { "subsystem-infinispan_1_0.xml" , 33 } , new Object [ ] { "subsystem-infinispan_1_1.xml" , 33 } , new Object [ ] { "subsystem-infinispan_1_2.xml" , 37 } , new Object [ ] { "subsystem-infinispan_1_3.xml" , 37 } , new Object [ ] { "subsystem-infinispan_1_4.xml" , 75 } , new Object [ ] { "subsystem-infinispan_1_5.xml" , 78 } } ; <END_BUG> return Arrays . asList ( data ) ; } @ Override protected ValidationConfiguration getModelValidationConfiguration ( ) { } @ Test public void testParseSubsystem ( ) throws Exception { } @ Test public void testInstallIntoController ( ) throws Exception { } @ Test public void testParseAndMarshalModel ( ) throws Exception { } @ Test public void testDescribeHandler ( ) throws Exception { } }

Fix:
Object [ ] [ ] data = new Object [ ] [ ] { new Object [ ] { "subsystem-infinispan_1_0.xml" , 33 } , new Object [ ] { "subsystem-infinispan_1_1.xml" , 33 } , new Object [ ] { "subsystem-infinispan_1_2.xml" , 37 } , new Object [ ] { "subsystem-infinispan_1_3.xml" , 37 } , new Object [ ] { "subsystem-infinispan_1_4.xml" , 75 } , new Object [ ] { "subsystem-infinispan_2_0.xml" , 78 } } ;
Buggy code:
public abstract class Classifier extends GeneralizableElementImpl { public Vector _behavioralFeature ; public Vector _structuralFeature ; public Vector _specification ; public Vector _realization ; public Vector _associationEnd ; public Vector _participant ; public Classifier ( ) { } public Classifier ( Name name ) { } public Classifier ( String nameStr ) { } public Vector getBehavioralFeature ( ) { } public void setBehavioralFeature ( Vector x ) { } public void addBehavioralFeature ( Feature x ) { } public void removeBehavioralFeature ( Feature x ) { } public Vector getStructuralFeature ( ) { } public void setStructuralFeature ( Vector x ) { } public void addStructuralFeature ( StructuralFeature x ) { } public void removeStructuralFeature ( StructuralFeature x ) { } public Vector getSpecification ( ) { } public void setSpecification ( Vector x ) { } public void addSpecification ( Classifier x ) { } public void removeSpecification ( Classifier x ) { } public Vector getRealization ( ) { } public void setRealization ( Vector x ) { } public void addRealization ( Classifier x ) { } public void removeRealization ( Classifier x ) { } public Vector getAssociationEnd ( ) { } public void setAssociationEnd ( Vector x ) { } public void addAssociationEnd ( AssociationEnd x ) { } public void removeAssociationEnd ( AssociationEnd x ) { } public Vector getParticipant ( ) { } public void setParticipant ( Vector x ) { } public void addParticipant ( AssociationEnd x ) { } public void removeParticipant ( AssociationEnd x ) { } public void addFeature ( Feature f ) { } public String dbgString ( ) { String s = "" ; Vector v ; ( util . Enumeration ) ++ ; <START_BUG> s += ( ( ( getOCLTypeStr ( ) ) + "(" ) + ( getName ( ) . toString ( ) ) ) + ")[" ; <END_BUG> String stereos = dbgStereotypes ( ) ; if ( stereos != "" ) s += "\n" + stereos ; String tags = dbgTaggedValues ( ) ; if ( tags != "" ) s += "\n" + tags ; s += "\n<seq2seq4repair_space>attributes:" ; } }

Fix:
s += ( ( ( getOCLTypeStr ( ) ) + "(" ) + ( getName ( ) . getBody ( ) . toString ( ) ) ) + ")[" ;
Buggy code:
public class Version { private Version ( ) { } public static String id ( ) { <START_BUG> return "4.4-snapshot-20070629-0646" ; <END_BUG> } public static void main ( String [ ] args ) { } }

Fix:
return "4.4-snapshot-20070709-1651" ;
Buggy code:
public class Time1Test { public static void main ( String [ ] args ) { } private static void displayTime ( String header , Time1 t ) { <START_BUG> System . out . printf ( "%s%nUniversal<seq2seq4repair_space>time:<seq2seq4repair_space>%s%nStandard<seq2seq4repair_space>time:<seq2seq4repair_space>%s%n" , header , t . toUniversalString ( ) ) ; <END_BUG> } }

Fix:
System . out . printf ( "%s%nUniversal<seq2seq4repair_space>time:<seq2seq4repair_space>%s%nStandard<seq2seq4repair_space>time:<seq2seq4repair_space>%s%n" , header , t . toUniversalString ( ) , t . toString ( ) ) ;
Buggy code:
public class JDBCMySQLCreateCommand extends JDBCIdentityColumnCreateCommand { private String className ; private String methodName ; private Method method ; private Method getUnderlyingStatement ; public void init ( JDBCStoreManager manager ) { super . init ( manager ) ; ClassLoader loader = GetTCLAction . getContextClassLoader ( ) ; try { Class psClass = loader . loadClass ( className ) ; method = psClass . getMethod ( methodName ) ; } catch ( ClassNotFoundException e ) { throw CmpMessages . MESSAGES . failedToLoadDriverClass ( className , e ) ; } catch ( NoSuchMethodException e ) { throw CmpMessages . MESSAGES . driverDoesNotHaveMethod ( className , methodName ) ; } try { <START_BUG> Class wrapperClass = loader . loadClass ( "org.jboss.resource.adapter.jdbc.StatementAccess" ) ; <END_BUG> getUnderlyingStatement = wrapperClass . getMethod ( "getUnderlyingStatement" ) ; } catch ( ClassNotFoundException e ) { throw CmpMessages . MESSAGES . couldNotLoadStatementAccess ( e ) ; } catch ( NoSuchMethodException e ) { throw CmpMessages . MESSAGES . getUnderlyingStatementNotFound ( e ) ; } } protected void initEntityCommand ( JDBCEntityCommandMetaData entityCommand ) { } protected int executeInsert ( int paramIndex , PreparedStatement ps , CmpEntityBeanContext ctx ) throws SQLException { } }

Fix:
Class wrapperClass = loader . loadClass ( "org.jboss.jca.adapters.jdbc.StatementAccess" ) ;
Buggy code:
public class JMDNSPlugin implements BundleActivator { private static final String NAME = "ecf.discovery.jmdns" ; private static JMDNSPlugin plugin ; private BundleContext context = null ; public static final String PLUGIN_ID = "org.eclipse.ecf.provider.jmdns" ; protected static InetAddress LOCALHOST = null ; public JMDNSPlugin ( ) { } private ServiceTracker adapterManagerTracker = null ; private ServiceRegistration serviceRegistration ; private ServiceTracker logServiceTracker = null ; private LogService logService = null ; public IAdapterManager getAdapterManager ( ) { } public void start ( final BundleContext ctxt ) throws Exception { this . context = ctxt ; JMDNSPlugin . LOCALHOST = InetAddress . getLocalHost ( ) ; final Properties props = new Properties ( ) ; props . put ( CONTAINER_ID , IDFactory . getDefault ( ) . createStringID ( "org.eclipse.ecf.provider.jmdns.container.JMDNSDiscoveryContainer" ) ) ; props . put ( CONTAINER_NAME , JMDNSPlugin . NAME ) ; <START_BUG> props . put ( Constants . SERVICE_RANKING , Integer . toString ( 750 ) ) ; <END_BUG> String [ ] clazzes = new String [ ] { IDiscoveryService . class . getName ( ) , IDiscoveryLocator . class . getName ( ) , IDiscoveryAdvertiser . class . getName ( ) } ; context . registerService ( clazzes , new ServiceFactory ( ) { private volatile JMDNSDiscoveryContainer jdc ; public Object getService ( final Bundle bundle , final ServiceRegistration registration ) { if ( ( jdc ) == null ) { try { jdc = new JMDNSDiscoveryContainer ( JMDNSPlugin . LOCALHOST ) ; jdc . connect ( null , null ) ; } catch ( final IDCreateException e ) { Trace . catching ( JMDNSPlugin . PLUGIN_ID , ( ( JMDNSPlugin . PLUGIN_ID ) + "//debug//methods//catching" ) , this . getClass ( ) , "getService(Bundle,<seq2seq4repair_space>ServiceRegistration)" , e ) ; } catch ( final ContainerConnectException e ) { Trace . catching ( JMDNSPlugin . PLUGIN_ID , ( ( JMDNSPlugin . PLUGIN_ID ) + "//debug//methods//catching" ) , this . getClass ( ) , "getService(Bundle,<seq2seq4repair_space>ServiceRegistration)" , e ) ; jdc = null ; } } return jdc ; } public void ungetService ( final Bundle bundle , final ServiceRegistration registration , final Object service ) { } } , props ) ; } protected Bundle getBundle ( ) { } public void stop ( final BundleContext ctxt ) throws Exception { } public static synchronized JMDNSPlugin getDefault ( ) { } public void logException ( final String string , final Throwable t ) { } protected LogService getLogService ( ) { } public void logError ( final String errorString ) { } }

Fix:
props . put ( Constants . SERVICE_RANKING , new Integer ( 750 ) ) ;
Buggy code:
public abstract class AbstractJDBCSeq implements JDBCSeq { protected int type = TYPE_DEFAULT ; protected Object current = null ; public void setType ( int type ) { } public Object next ( StoreContext ctx , ClassMetaData meta ) { } public Object current ( StoreContext ctx , ClassMetaData meta ) { } public void allocate ( int additional , StoreContext ctx , ClassMetaData meta ) { } public void addSchema ( ClassMapping mapping , SchemaGroup group ) { } public void close ( ) { } protected abstract Object nextInternal ( JDBCStore store , ClassMapping mapping ) throws Exception { } protected Object currentInternal ( JDBCStore store , ClassMapping mapping ) throws Exception { } protected void allocateInternal ( int additional , JDBCStore store , ClassMapping mapping ) throws Exception { } private JDBCStore getStore ( StoreContext ctx ) { } protected Connection getConnection ( JDBCStore store ) throws SQLException { } protected void closeConnection ( Connection conn ) { if ( conn == null ) return ; try { <START_BUG> if ( ( ( type ) == ( TYPE_TRANSACTIONAL ) ) || ( ( type ) == ( TYPE_CONTIGUOUS ) ) ) <END_BUG> conn . commit ( ) ; } catch ( SQLException se ) { throw SQLExceptions . getStore ( se ) ; } finally { try { conn . close ( ) ; } catch ( SQLException se ) { } } } }

Fix:
if ( ( ( type ) != ( TYPE_TRANSACTIONAL ) ) && ( ( type ) != ( TYPE_CONTIGUOUS ) ) )
Buggy code:
public class TestFailIfUnreferencedFiles extends WithNestedTests { public TestFailIfUnreferencedFiles ( ) { } public static class Nested1 extends WithNestedTests . AbstractNestedTest { public void testDummy ( ) throws Exception { MockDirectoryWrapper dir = newMockDirectory ( ) ; dir . setAssertNoUnrefencedFilesOnClose ( true ) ; IndexWriter iw = new IndexWriter ( dir , new org . apache . lucene . index . IndexWriterConfig ( TEST_VERSION_CURRENT , null ) ) ; iw . addDocument ( new Document ( ) ) ; <START_BUG> iw . close ( ) ; <END_BUG> IndexOutput output = dir . createOutput ( "_hello.world" , DEFAULT ) ; output . writeString ( "i<seq2seq4repair_space>am<seq2seq4repair_space>unreferenced!" ) ; output . close ( ) ; dir . sync ( Collections . singleton ( "_hello.world" ) ) ; dir . close ( ) ; } } @ Test public void testFailIfUnreferencedFiles ( ) { } }

Fix:
iw . shutdown ( ) ;
Buggy code:
public class Jdk11Compat { public static String getJavaVersion ( ) { } public static boolean isJava2 ( ) { } public ClassLoader newClassLoaderInstance ( URL [ ] urls , ClassLoader parent ) { } public Object doPrivileged ( Action action ) throws Exception { } public void setContextClassLoader ( ClassLoader cl ) { } public ClassLoader getContextClassLoader ( ) { } public URL [ ] getURLs ( ClassLoader cl ) { } public URL [ ] getParentURLs ( ClassLoader cl ) { SimpleClassLoader scl = ( ( SimpleClassLoader ) ( cl ) ) ; <START_BUG> return ( ( SimpleClassLoader ) ( cl . getParent ( ) ) ) . getURLs ( ) ; <END_BUG> } public static Jdk11Compat getJdkCompat ( ) { } public static final String JAVA_1_0 = "1.0" ; public static final String JAVA_1_1 = "1.1" ; public static final String JAVA_1_2 = "1.2" ; public static final String JAVA_1_3 = "1.3" ; static String javaVersion ; static boolean java2 = false ; static Jdk11Compat compat ; static final String JAVA2_SUPPORT = "org.apache.tomcat.util.compat.Jdk12Support" ; private static void init ( ) { } }

Fix:
return ( ( SimpleClassLoader ) ( scl . getParent ( ) ) ) . getURLs ( ) ;
Buggy code:
public class EJBRemoteTransactionsRepository implements Service < EJBRemoteTransactionsRepository > { private static final Logger logger = Logger . getLogger ( EJBRemoteTransactionsRepository . class ) ; public static final ServiceName SERVICE_NAME = JBOSS . append ( "ejb" ) . append ( "remote-transactions-repository" ) ; private final InjectedValue < TransactionManager > transactionManagerInjectedValue = new InjectedValue < TransactionManager > ( ) ; private final InjectedValue < UserTransaction > userTransactionInjectedValue = new InjectedValue < UserTransaction > ( ) ; private final InjectedValue < RecoveryManagerService > recoveryManagerService = new InjectedValue ( ) ; private final Map < UserTransactionID , Uid > userTransactions = Collections . synchronizedMap ( new HashMap < UserTransactionID , Uid > ( ) ) ; @ Override public void start ( StartContext context ) throws StartException { recoveryManagerService . getValue ( ) . addSerializableXAResourceDeserializer ( INSTANCE ) ; <START_BUG> EJBRemoteTransactionsRepository . logger . debugf ( "Registered<seq2seq4repair_space>EJB<seq2seq4repair_space>XA<seq2seq4repair_space>resource<seq2seq4repair_space>deserializer<seq2seq4repair_space>%s" , INSTANCE ) ; <END_BUG> } @ Override public void stop ( StopContext context ) { } @ Override public EJBRemoteTransactionsRepository getValue ( ) throws IllegalArgumentException , IllegalStateException { } public TransactionManager getTransactionManager ( ) { } public Transaction removeUserTransaction ( final UserTransactionID userTransactionID ) { } public Transaction getUserTransaction ( final UserTransactionID userTransactionID ) { } Transaction beginUserTransaction ( final UserTransactionID userTransactionID ) throws NotSupportedException , SystemException { } public SubordinateTransaction getImportedTransaction ( final XidTransactionID xidTransactionID ) throws XAException { } Transaction importTransaction ( final XidTransactionID xidTransactionID , final int txTimeout ) throws XAException { } public Xid [ ] getXidsToRecoverForParentNode ( final String parentNodeName , int recoveryFlags ) throws XAException { } public UserTransaction getUserTransaction ( ) { } public Injector < TransactionManager > getTransactionManagerInjector ( ) { } public Injector < UserTransaction > getUserTransactionInjector ( ) { } public Injector < RecoveryManagerService > getRecoveryManagerInjector ( ) { } }

Fix:
EJBRemoteTransactionsRepository . logger . debug ( ( "Registered<seq2seq4repair_space>EJB<seq2seq4repair_space>XA<seq2seq4repair_space>resource<seq2seq4repair_space>deserializer<seq2seq4repair_space>" + ( EJBXAResourceDeserializer . INSTANCE ) ) ) ;
Buggy code:
public class MysqlConnection { private boolean initialized ; private Connection connection ; public boolean initConnection ( ) { } public void closeConnection ( ) { } public void makeDatabase ( ) { } public int executeUpdate ( String query ) { } public ResultSet executeQuery ( String query ) { } public boolean check ( String table , String field , String str ) { } public Integer getWeapon ( Player player , int slot ) { } public boolean isAble ( Player player , int weaponId ) { } public int getMUNI ( Player player , int i , AmmoState typ ) { } public boolean exist ( Player player ) { } public void create ( Player player ) { } public void setMUNI ( Player player , Integer weaponId , int muni , AmmoState typ ) { } public void setWeapon ( Player player , int weaponId , boolean bool ) { } public void setSelected ( Player player , int weaponId , boolean bool ) { } public boolean getSelected ( Player player , int weaponId ) { } public int getWeaponPrice ( int weaponId ) { } public int getAmmoPrice ( int weaponId ) { } public void resetWeapon ( Player player , int weaponId ) { } public int [ ] getSlotWeapons ( int slot ) { if ( slot == 0 ) { int [ ] weapons = new int [ ] { 0 , 1 } ; return weapons ; } else if ( slot == 1 ) { int [ ] weapons = new int [ ] { 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } ; return weapons ; } else if ( slot == 2 ) { int [ ] weapons = new int [ ] { 22 , 23 , 24 } ; return weapons ; } else if ( slot == 3 ) { int [ ] weapons = new int [ ] { 25 , 26 , 27 } ; return weapons ; } else if ( slot == 4 ) { int [ ] weapons = new int [ ] { 28 , 29 } ; return weapons ; } else if ( slot == 5 ) { int [ ] weapons = new int [ ] { 30 , 31 } ; return weapons ; } else if ( slot == 6 ) { int [ ] weapons = new int [ ] { 33 , 34 } ; return weapons ; } else if ( slot == 7 ) { int [ ] weapons = new int [ ] { 35 , 36 , 37 , 38 } ; return weapons ; } else if ( slot == 8 ) { <START_BUG> int [ ] weapons = new int [ ] { 39 } ; <END_BUG> return weapons ; } else if ( slot == 9 ) { int [ ] weapons = new int [ ] { 41 , 42 , 43 } ; return weapons ; } else if ( slot == 10 ) { int [ ] weapons = new int [ ] { 10 , 11 , 12 , 13 , 14 , 15 } ; return weapons ; } else if ( slot == 11 ) { int [ ] weapons = new int [ ] { 44 , 45 , 46 } ; return weapons ; } else { int [ ] weapons = new int [ ] { 40 } ; return weapons ; } } private int getNormalWeaponPrice ( int weaponId ) { } private int getNormalAmmoPrice ( int weaponId ) { } }

Fix:
int [ ] weapons = new int [ ] { 16 , 17 , 18 , 39 } ;
Buggy code:
public class StringPopupListener implements MouseListener { public StringPopupListener ( GUImain main , String text ) { } private final GUImain main ; private final String text ; @ Override public void mouseClicked ( MouseEvent e ) { JTextArea ta = new JTextArea ( text ) ; ta . setEditable ( false ) ; <START_BUG> ComponentPopup . createPopUp ( main , ta , e . getX ( ) , e . getY ( ) , 60 , 70 , SOUTH ) ; <END_BUG> } @ Override public void mouseEntered ( MouseEvent e ) { } @ Override public void mouseExited ( MouseEvent e ) { } @ Override public void mousePressed ( MouseEvent e ) { } @ Override public void mouseReleased ( MouseEvent e ) { } }

Fix:
ComponentPopup . createPopUp ( main , ta , main . getGlassPane ( ) . getMousePosition ( ) . x , main . getGlassPane ( ) . getMousePosition ( ) . y , 200 , 120 , SOUTH ) ;
Buggy code:
public class ResourceAddRemoveTestBase { @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) protected OperationContext mockOperationContext ( SubsystemState stateService , final List < OperationStepHandler > addedSteps , ResultAction stepResult ) { ServiceRegistry serviceRegistry = Mockito . mock ( ServiceRegistry . class ) ; ServiceController serviceController = Mockito . mock ( ServiceController . class ) ; Mockito . when ( serviceController . getValue ( ) ) . thenReturn ( stateService ) ; <START_BUG> Mockito . when ( serviceRegistry . getRequiredService ( SERVICE_NAME ) ) . thenReturn ( serviceController ) ; <END_BUG> ModelNode result = new ModelNode ( ) ; OperationContext context = Mockito . mock ( OperationContext . class ) ; Resource resource = Mockito . mock ( Resource . class ) ; Mockito . when ( resource . getModel ( ) ) . thenReturn ( result ) ; Mockito . when ( context . getServiceRegistry ( true ) ) . thenReturn ( serviceRegistry ) ; Mockito . when ( context . completeStep ( ) ) . thenReturn ( stepResult ) ; Mockito . when ( context . createResource ( EMPTY_ADDRESS ) ) . thenReturn ( resource ) ; Mockito . when ( context . getType ( ) ) . thenReturn ( SERVER ) ; Mockito . doAnswer ( new org . mockito . stubbing . Answer < Void > ( ) { @ Override public Void answer ( InvocationOnMock invocation ) throws Throwable { addedSteps . add ( ( ( OperationStepHandler ) ( invocation . getArguments ( ) [ 0 ] ) ) ) ; return null ; } } ) . when ( context ) . addStep ( ( ( OperationStepHandler ) ( Mockito . anyObject ( ) ) ) , Mockito . eq ( RUNTIME ) ) ; return context ; } }

Fix:
Mockito . when ( serviceRegistry . getService ( SERVICE_NAME ) ) . thenReturn ( serviceController ) ;
Buggy code:
public class TicTacToeGame { private String [ ] [ ] board ; private int size ; private int current_player ; public TicTacToeGame ( int size ) { } public void setCell ( int i , int j ) { <START_BUG> if ( ( board [ i ] [ j ] ) != null ) { <END_BUG> return ; } board [ i ] [ j ] = ( ( ( current_player ) % 2 ) == 0 ) ? "X" : "O" ; ( current_player ) ++ ; } public void displayBoard ( ) { } public boolean isGameOver ( ) { } public String [ ] [ ] getBoard ( ) { } public void setBoard ( String [ ] [ ] board ) { } }

Fix:
if ( ( ( i >= ( size ) ) || ( j >= ( size ) ) ) || ( ( board [ i ] [ j ] ) != null ) ) {
Buggy code:
class ManagementRootConsoleRedirectHandler implements HttpHandler { private static HttpString HTTP_GET = new HttpString ( "GET" ) ; private final ResourceHandlerDefinition consoleHandler ; ManagementRootConsoleRedirectHandler ( ResourceHandlerDefinition consoleHandler ) { } @ Override public void handleRequest ( HttpServerExchange exchange ) throws Exception { if ( ! ( exchange . getRequestMethod ( ) . equals ( ManagementRootConsoleRedirectHandler . HTTP_GET ) ) ) { Common . METHOD_NOT_ALLOWED_HANDLER . handleRequest ( exchange ) ; return ; } String requestUrl = exchange . getRequestURL ( ) ; <START_BUG> if ( ( ( consoleHandler ) != null ) && ( "//" . equals ( exchange . getCanonicalPath ( ) ) ) ) { <END_BUG> StringBuilder redirect = new StringBuilder ( requestUrl ) ; redirect . append ( consoleHandler . getContext ( ) ) . append ( consoleHandler . getDefaultPath ( ) ) ; exchange . getResponseHeaders ( ) . add ( LOCATION , redirect . toString ( ) ) ; Common . MOVED_PERMANENTLY . handleRequest ( exchange ) ; return ; } Common . NOT_FOUND . handleRequest ( exchange ) ; } }

Fix:
if ( ( ( consoleHandler ) != null ) && ( "//" . equals ( exchange . getRequestPath ( ) ) ) ) {
Buggy code:
public class TypedComponentSelector implements ComponentSelector { private final TypedComponentSelector m_parent ; private final HashMap m_factorys = new HashMap ( ) ; private final Class m_type ; public TypedComponentSelector ( final Class type ) { } public TypedComponentSelector ( final TypedComponentSelector parent ) { } public Component select ( Object hint ) throws ComponentException { if ( ! ( hint instanceof String ) ) { throw new ComponentException ( ( "Invalid<seq2seq4repair_space>hint,<seq2seq4repair_space>expected<seq2seq4repair_space>a<seq2seq4repair_space>string<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>" + ( hint . getClass ( ) . getName ( ) ) ) ) ; } final String name = ( ( String ) ( hint ) ) ; final Component component = createComponent ( name ) ; if ( null != component ) { <START_BUG> if ( m_type . isInstance ( component ) ) { <END_BUG> throw new ComponentException ( ( ( ( ( ( "Implementation<seq2seq4repair_space>of<seq2seq4repair_space>" + name ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>of<seq2seq4repair_space>" ) + "correct<seq2seq4repair_space>type<seq2seq4repair_space>(" ) + ( m_type . getClass ( ) . getName ( ) ) ) + ")" ) ) ; } return component ; } else { throw new ComponentException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>provide<seq2seq4repair_space>implementation<seq2seq4repair_space>for<seq2seq4repair_space>" + name ) ) ; } } public void release ( final Component component ) { } public void register ( final String name , final ComponentFactory factory ) { } protected final Class getType ( ) { } private Component createComponent ( final String name ) throws ComponentException { } }

Fix:
if ( ! ( m_type . isInstance ( component ) ) ) {
Buggy code:
public class ImportController extends SubController { @ FXML private ListView < GroupListItem > groupListView ; @ FXML private ListView < ColumnListItem > columnListView ; @ FXML private ListView < FileListItem > fileListView ; @ FXML private TextArea filePreview ; @ FXML private ComboBox < String > keyBox ; private ObservableList < String > keyListItems = FXCollections . observableArrayList ( ) ; private ObservableList < GroupListItem > groupList = FXCollections . observableArrayList ( ) ; private ObservableList < String > delimiterStringList = FXCollections . observableArrayList ( ) ; public ImportController ( ) { } @ Override protected void initialize ( ) { } private void selectGroup ( GroupListItem gli ) { } @ FXML public void addGroupListItem ( ) { } @ FXML public void addColumnListItem ( ) { } @ FXML private void selectFiles ( ) { } public void addFiles ( List < File > files ) { } public ArrayList < Group > getGroups ( ) { ArrayList < Group > res = new ArrayList < Group > ( ) ; for ( GroupListItem gli : groupList ) { Column [ ] colNames = gli . columnList . stream ( ) . map ( ( x ) -> new Column ( x . txtField . getText ( ) . toString ( ) , ColumnType . STRING ) ) . collect ( Collectors . toList ( ) ) . toArray ( new Column [ gli . columnList . size ( ) ] ) ; int i = 0 ; for ( ColumnListItem item : gli . columnList ) { switch ( item . comboBox . getValue ( ) ) { case "Time" : colNames [ i ] = new model . DateColumn ( colNames [ i ] . getName ( ) , ColumnType . TIME , item . secondBox . getValue ( ) , item . cbSort . isSelected ( ) ) ; break ; case "Date" : colNames [ i ] = new model . DateColumn ( colNames [ i ] . getName ( ) , ColumnType . DATE , item . secondBox . getValue ( ) , item . cbSort . isSelected ( ) ) ; break ; case "Date//Time" : colNames [ i ] = new model . DateColumn ( colNames [ i ] . getName ( ) , ColumnType . DATEandTIME , item . secondBox . getValue ( ) , item . cbSort . isSelected ( ) ) ; break ; default : break ; } colNames [ i ] . setType ( ColumnType . getTypeOf ( item . comboBox . getValue ( ) ) ) ; i ++ ; } String [ ] delims = new String [ ] { "," , "\t" , "<seq2seq4repair_space>" , ";" , ":" , "?" } ; String dlmtr = delims [ gli . box . getSelectionModel ( ) . getSelectedIndex ( ) ] ; String primaryKey = null ; <START_BUG> if ( gli . primKey . equals ( "File<seq2seq4repair_space>name" ) ) { <END_BUG> primaryKey = gli . primKey ; } Group g = new Group ( gli . txtField . getText ( ) , dlmtr , colNames , primaryKey ) ; for ( FileListItem fli : gli . fileList ) { try { g . addFile ( fli . path ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } res . add ( g ) ; } return res ; } @ Override public boolean validateInput ( boolean showPopup ) { } @ FXML public void saveConfiguration ( ) { } @ FXML public void openConfiguration ( ) { } private void addGroupFromXML ( Group group ) { } @ Override public Object getData ( ) { } @ Override public void setData ( Object o ) { } }

Fix:
if ( ! ( gli . primKey . equals ( "File<seq2seq4repair_space>name" ) ) ) {
Buggy code:
public class SCC_B_Master extends DefaultMasterCompute { public static final IntWritable TRANSPOSE_GRAPH_FORMATION = new IntWritable ( 0 ) ; public static final IntWritable TRIMMING_1 = new IntWritable ( 1 ) ; public static final IntWritable TRIMMING_2 = new IntWritable ( 2 ) ; public static final IntWritable TRAVERSAL_SELECTION_1 = new IntWritable ( 3 ) ; public static final IntWritable TRAVERSAL_SELECTION_2 = new IntWritable ( 4 ) ; public static final IntWritable TRAVERSAL_MAIN = new IntWritable ( 5 ) ; public static final String PHASE_AGGREGATOR = "SCC_PHASE_AGGREGATOR" ; public static final String TRAVERSAL_AGGREGATOR = "SCC_TRAVERSAL_AGGREGATOR" ; public static final String PROP_AGGREGATOR = "SCC_PROP_AGGREGATOR" ; public static final String INACTIVE_COUNT_AGGREGATOR = "SCC_INACTIVE_AGGREGATOR" ; public static final IntConfOption K = new IntConfOption ( "SCC_B.K" , 20 ) ; @ Override public void compute ( ) { if ( ( getSuperstep ( ) ) == 2 ) { setAggregatedValue ( SCC_B_Master . PHASE_AGGREGATOR , SCC_B_Master . TRIMMING_1 ) ; } else if ( getAggregatedValue ( SCC_B_Master . PHASE_AGGREGATOR ) . equals ( SCC_B_Master . TRIMMING_1 ) ) { setAggregatedValue ( SCC_B_Master . PHASE_AGGREGATOR , SCC_B_Master . TRIMMING_2 ) ; } else if ( getAggregatedValue ( SCC_B_Master . PHASE_AGGREGATOR ) . equals ( SCC_B_Master . TRIMMING_2 ) ) { setAggregatedValue ( SCC_B_Master . PHASE_AGGREGATOR , SCC_B_Master . TRAVERSAL_SELECTION_1 ) ; } else if ( getAggregatedValue ( SCC_B_Master . PHASE_AGGREGATOR ) . equals ( SCC_B_Master . TRAVERSAL_SELECTION_1 ) ) { setAggregatedValue ( SCC_B_Master . PHASE_AGGREGATOR , SCC_B_Master . TRAVERSAL_SELECTION_2 ) ; } else if ( getAggregatedValue ( SCC_B_Master . PHASE_AGGREGATOR ) . equals ( SCC_B_Master . TRAVERSAL_SELECTION_2 ) ) { setAggregatedValue ( SCC_B_Master . PROP_AGGREGATOR , new IntArrayWritable ( ) ) ; setAggregatedValue ( SCC_B_Master . PHASE_AGGREGATOR , SCC_B_Master . TRAVERSAL_MAIN ) ; } else if ( ( getAggregatedValue ( SCC_B_Master . PHASE_AGGREGATOR ) . equals ( SCC_B_Master . TRAVERSAL_MAIN ) ) && ( getAggregatedValue ( SCC_B_Master . TRAVERSAL_AGGREGATOR ) . equals ( new BooleanWritable ( false ) ) ) ) { <START_BUG> setAggregatedValue ( SCC_B_Master . PHASE_AGGREGATOR , SCC_B_Master . TRAVERSAL_SELECTION_1 ) ; <END_BUG> } } @ Override public void initialize ( ) throws IllegalAccessException , InstantiationException { } No newline ; at end ; of file ; }

Fix:
setAggregatedValue ( SCC_B_Master . PHASE_AGGREGATOR , SCC_B_Master . TRIMMING_1 ) ;
Buggy code:
public class SpatiotemporalModeStates extends SpatiotemporalMode { public SpatiotemporalModeStates ( ) { } public SpatiotemporalModeStates ( final OcelotlCore ocelotlCore ) { } @ SuppressWarnings ( "unchecked" ) protected void computeProportions ( EventProducerNode node ) { } public MainEvent getMainEvent ( EventProducerNode epn , int start , int end ) { double max = 0.0 ; MainEvent maj = new MainEvent ( Void , max ) ; <START_BUG> for ( String state : getEvents ( ) ) { <END_BUG> double amp = 0.0 ; for ( int i = start ; i < end ; i ++ ) amp += proportions . get ( epn ) . get ( i ) . get ( state ) ; amp //= end - start ; if ( amp > max ) { maj = new MainEvent ( state , amp ) ; max = amp ; } } return maj ; } }

Fix:
for ( String state : getAllEvents ( ) ) {
Buggy code:
public class Form extends WebMarkupContainer implements IFormSubmitListener { private static Log log = LogFactory . getLog ( Form . class ) ; private Bytes maxSize = Bytes . MAX ; private boolean multiPart = false ; public Form ( final String id ) { } public Form ( final String id , IModel model ) { } public Bytes getMaxSize ( ) { } public final void loadPersistentFormComponentValues ( ) { } public final void onFormSubmitted ( ) { } public void removePersistentFormComponentValues ( final boolean disablePersistence ) { } public void setMaxSize ( final Bytes maxSize ) { } public void setMultiPart ( boolean multiPart ) { } public Component setVersioned ( final boolean isVersioned ) { } public final void visitFormComponents ( final FormComponent . IVisitor visitor ) { } protected void beforeUpdateFormComponentModels ( ) { } protected void delegateSubmit ( Button submittingButton ) { } protected final Button findSubmittingButton ( ) { return ( ( Button ) ( visitChildren ( Button . class , new IVisitor ( ) { public Object component ( final Component component ) { final Button button = ( ( Button ) ( component ) ) ; <START_BUG> if ( ( ! ( Strings . isEmpty ( button . getInput ( ) ) ) ) || ( ! ( Strings . isEmpty ( getRequest ( ) . getParameter ( ( ( button . getPath ( ) ) + ".x" ) ) ) ) ) ) { <END_BUG> return button ; } return CONTINUE_TRAVERSAL ; } } ) ) ) ; } protected IValuePersister getValuePersister ( ) { } protected final boolean hasError ( ) { } protected void internalOnModelChanged ( ) { } protected final void markFormComponentsInvalid ( ) { } protected void onComponentTag ( final ComponentTag tag ) { } protected void onError ( ) { } protected void onRender ( ) { } protected void onSubmit ( ) { } protected boolean process ( ) { } protected final void updateFormComponentModels ( ) { } protected void validate ( ) { } private boolean anyFormComponentError ( ) { } private final boolean handleMultiPart ( ) { } private void persistFormComponentData ( ) { } }

Fix:
if ( ( ! ( Strings . isEmpty ( button . getInput ( ) ) ) ) || ( ! ( Strings . isEmpty ( getRequest ( ) . getParameter ( ( ( button . getInputName ( ) ) + ".x" ) ) ) ) ) ) {
Buggy code:
public final class DoubleConverter extends AbstractDecimalConverter { public static final ITypeConverter INSTANCE = new DoubleConverter ( ) ; public Object convert ( final Object value , Locale locale ) { <START_BUG> final Number number = ( value instanceof Number ) ? ( ( Number ) ( value ) ) : parse ( value , ( ( Double . MAX_VALUE ) * ( - 1 ) ) , Double . MAX_VALUE , locale ) ; <END_BUG> if ( number == null ) { return null ; } return new Double ( number . doubleValue ( ) ) ; } protected Class getTargetType ( ) { } }

Fix:
final Number number = ( value instanceof Number ) ? ( ( Number ) ( value ) ) : parse ( value , ( - ( Double . MAX_VALUE ) ) , Double . MAX_VALUE , locale ) ;
Buggy code:
public class Question implements IKLQItem { private final Id id ; private final Type type ; private final OptionSet options ; private final Text text ; private final List < AExpression > dependencies ; private AExpression result ; private Store store ; public Question ( Id id , Type type , OptionSet options , Text text ) { } public Question ( Id id , Type type , OptionSet options , Text text , AExpression result ) { } public Id getId ( ) { } public Type getType ( ) { } public OptionSet getOptions ( ) { } public Text getText ( ) { } public List < AExpression > getDependencies ( ) { } public void addDependency ( AExpression dependency ) { } public boolean updateDependency ( AExpression oldExpr , AExpression newExpr ) { } public boolean dependenciesResolved ( ) { } public void setResult ( AExpression result ) { this . result = result ; <START_BUG> store . update ( getId ( ) ) ; <END_BUG> } public AExpression getResult ( ) { } public void setStore ( Store store ) throws Exception { } public static AExpression createTerminalFromString ( Question question , String result ) { } }

Fix:
store . update ( ) ;
Buggy code:
@ PathPrefix ( "//movies" ) public final class WsMovie implements RestfulService { @ Inject private MovieServices movieServices ; @ GET ( "//{id}" ) @ AnonymousAccessAllowed public Movie getMovie ( @ PathParam ( "id" ) final long movId ) { } @ POST ( "" ) @ AnonymousAccessAllowed public Movie saveMovie ( final Movie movie ) { } <START_BUG> @ PUT ( "//movies//{id}" ) <END_BUG> @ AnonymousAccessAllowed public Movie updateMovie ( @ PathParam ( "id" ) final long movId , final Movie movie ) { if ( movId != ( movie . getMovId ( ) ) ) { } return movieServices . saveMovie ( movie ) ; } @ GET ( "//{id}//actors" ) @ AnonymousAccessAllowed public DtList < People > getActors ( @ PathParam ( "id" ) final Long movId ) { } @ GET ( "//{id}//producers" ) @ AnonymousAccessAllowed public DtList < People > getProducers ( @ PathParam ( "id" ) final Long movId ) { } @ GET ( "//{id}//directors" ) @ AnonymousAccessAllowed public DtList < People > getDirectors ( @ PathParam ( "id" ) final Long movId ) { } @ GET ( "//{id}//details" ) @ AnonymousAccessAllowed public MovieView getMovieDetails ( @ PathParam ( "id" ) final long movId ) { } @ GET ( "//{id}//castings" ) @ AnonymousAccessAllowed public DtList < MovieCasting > getMovieCastings ( @ PathParam ( "id" ) final long movId ) { } }

Fix:
@ PUT ( "//{id}" )
Buggy code:
public class ModuleTaskTestCase extends AbstractTaskTestCase { @ Test public void testAddModule ( ) throws Exception { PatchInfo info = new org . jboss . as . patching . LocalPatchInfo ( TestUtils . randomString ( ) , PatchInfo . BASE , Collections . < String > emptyList ( ) , env ) ; String patchID = TestUtils . randomString ( ) ; File patchDir = TestUtils . mkdir ( tempDir , patchID ) ; String moduleName = TestUtils . randomString ( ) ; File moduleDir = TestUtils . createModule ( patchDir , moduleName ) ; byte [ ] newHash = PatchUtils . calculateHash ( moduleDir ) ; <START_BUG> ContentModification moduleAdded = new ContentModification ( new org . jboss . as . patching . metadata . ModuleItem ( moduleName , PatchingTask . NO_CONTENT ) , newHash , ADD ) ; <END_BUG> Patch patch = PatchBuilder . create ( ) . setPatchId ( patchID ) . setDescription ( TestUtils . randomString ( ) ) . setPatchType ( ONE_OFF ) . addAppliesTo ( info . getVersion ( ) ) . addContentModification ( moduleAdded ) . build ( ) ; TestUtils . createPatchXMLFile ( patchDir , patch ) ; File zippedPatch = TestUtils . createZippedPatchFile ( patchDir , patchID ) ; PatchingTaskRunner runner = new PatchingTaskRunner ( info , env ) ; PatchingResult result = runner . executeDirect ( new FileInputStream ( zippedPatch ) , STRICT ) ; PatchingAssert . assertPatchHasBeenApplied ( result , patch ) ; File modulesPatchDir = env . getModulePatchDirectory ( patchID ) ; PatchingAssert . assertDirExists ( modulesPatchDir ) ; PatchingAssert . assertContains ( modulesPatchDir , result . getPatchInfo ( ) . getModulePath ( ) ) ; PatchingAssert . assertDefinedModule ( result . getPatchInfo ( ) . getModulePath ( ) , moduleName , newHash ) ; } @ Test public void testRemoveModule ( ) throws Exception { } @ Test public void testUpdateModule ( ) throws Exception { } }

Fix:
ContentModification moduleAdded = new ContentModification ( new ModuleItem ( moduleName , newHash ) , PatchingTask . NO_CONTENT , ADD ) ;
Buggy code:
public class AlgorithmOptimizationTask extends AbstractTaskImplementation { @ Override public Map < String , Object > execute ( Map < String , Object > inputs , Map < String , String > parameters , IProgressMonitor monitor , String nodeName , Workflow workflow ) throws WorkflowException { SDFGraph graph = ( ( SDFGraph ) ( inputs . get ( KEY_SDF_GRAPH ) ) ) ; JoinForkCleaner cleaner = new JoinForkCleaner ( ) ; try { <START_BUG> cleaner . cleanJoinForkPairsFrom ( graph ) ; <END_BUG> } catch ( InvalidExpressionException e ) { System . err . println ( ( ( "SDFGraph<seq2seq4repair_space>" + ( graph . getName ( ) ) ) + "<seq2seq4repair_space>contains<seq2seq4repair_space>invalid<seq2seq4repair_space>expressions." ) ) ; e . printStackTrace ( ) ; } Map < String , Object > outputs = new HashMap < String , Object > ( ) ; outputs . put ( KEY_SDF_GRAPH , graph ) ; return outputs ; } @ Override public Map < String , String > getDefaultParameters ( ) { } @ Override public String monitorMessage ( ) { } }

Fix:
while ( cleaner . cleanJoinForkPairsFrom ( graph ) ) ;
Buggy code:
public class DashclockService extends DashClockExtension { private FullCycleWrapper cycle ; private DateTimeHelper dth ; private StorageCache cache ; @ Override protected void onInitialize ( boolean isReconnect ) { } @ Override protected void onUpdateData ( int reason ) { int num ; boolean summary = false ; if ( dth . hasBells ( ) ) { } else { publishUpdate ( new ExtensionData ( ) . visible ( false ) ) ; return ; } Day t = null ; if ( cycle . ready ( ) ) { t = cycle . getToday ( ) ; } if ( ! ( cycle . hasRealTimeInfo ( ) ) ) { ApiWrapper . requestToday ( this ) ; } <START_BUG> if ( ( this . dth . getNextPeriod ( ) ) == null ) <END_BUG> summary = true ; ExtensionData res = new ExtensionData ( ) . icon ( ic_notification_icon ) . clickIntent ( new Intent ( this , TimetableActivity . class ) ) ; if ( ( t != null ) && ( ! summary ) ) { Belltimes . Bell next = dth . getNextPeriod ( ) ; num = next . getPeriodNumber ( ) ; publishUpdate ( res . status ( ( ( ( t . getPeriod ( num ) . getShortName ( ) ) + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( t . getPeriod ( num ) . getRoom ( ) ) ) ) . expandedTitle ( t . getPeriod ( num ) . getSubject ( ) ) . expandedBody ( ( ( ( "in<seq2seq4repair_space>" + ( t . getPeriod ( num ) . getRoom ( ) ) ) + "<seq2seq4repair_space>with<seq2seq4repair_space>" ) + ( t . getPeriod ( num ) . getTeacher ( ) ) ) ) . visible ( true ) ) ; } else if ( summary && ( t != null ) ) { String subjects = "" ; for ( int i : new int [ ] { 1 , 2 , 3 , 4 , 5 } ) { Lesson p = t . getPeriod ( i ) ; if ( i == 5 ) { if ( p != null ) { subjects += "and<seq2seq4repair_space>" + ( p . getSubject ( ) . replace ( "<seq2seq4repair_space>Period" , "" ) ) ; } else { subjects += "and<seq2seq4repair_space>free!" ; } continue ; } if ( p != null ) { subjects += ( p . getSubject ( ) . replace ( "<seq2seq4repair_space>Period" , "" ) ) + ",<seq2seq4repair_space>" ; } else { subjects += "Free,<seq2seq4repair_space>" ; } } if ( ! ( cycle . ready ( ) ) ) { subjects = "I<seq2seq4repair_space>need<seq2seq4repair_space>to<seq2seq4repair_space>reload!" ; ApiWrapper . requestToday ( this ) ; ApiWrapper . requestTimetable ( this ) ; } String shortTitle ; String day = new DateTimeFormatterBuilder ( ) . appendDayOfWeekText ( ) . toFormatter ( ) . print ( dth . getNextSchoolDay ( ) ) ; if ( ( day . length ( ) ) > 3 ) { shortTitle = day . substring ( 0 , 3 ) ; if ( cycle . getToday ( ) . getWeek ( ) . isEmpty ( ) ) { shortTitle += "<seq2seq4repair_space>" + ( cache . loadWeek ( ) ) ; } else { shortTitle += "<seq2seq4repair_space>" + ( cycle . getToday ( ) . getWeek ( ) ) ; } } else { shortTitle = "TMR" ; } publishUpdate ( res . status ( shortTitle ) . expandedTitle ( day ) . expandedBody ( subjects ) . visible ( true ) ) ; } } }

Fix:
if ( ( ( this . dth . getNextPeriod ( ) ) == null ) || ( this . dth . getNextBell ( ) . getBellName ( ) . startsWith ( "Roll" ) ) )
Buggy code:
public class BlueThemeFactory implements IThemeFactory { @ Override public IBackgroundColor getBackgroundColor ( ) { <START_BUG> return new BackgroundBuleColor ( ) ; <END_BUG> } @ Override public IItemBackgroundColor getItemBackgroundColor ( ) { } @ Override public ITextColor getTextColor ( ) { } }

Fix:
return new BackgroundBlueColor ( ) ;
Buggy code:
public class TestIndexWriterMergePolicy extends LuceneTestCase { public void testNormalCase ( ) throws IOException { } public void testNoOverMerge ( ) throws IOException { } public void testForceFlush ( ) throws IOException { } public void testMergeFactorChange ( ) throws IOException { } public void testMaxBufferedDocsChange ( ) throws IOException { } public void testMergeDocCount0 ( ) throws IOException { Directory dir = new RAMDirectory ( ) ; IndexWriter writer = new IndexWriter ( dir , true , new WhitespaceAnalyzer ( ) , true ) ; writer . setMergePolicy ( new LogDocMergePolicy ( writer ) ) ; writer . setMaxBufferedDocs ( 10 ) ; writer . setMergeFactor ( 100 ) ; for ( int i = 0 ; i < 250 ; i ++ ) { addDoc ( writer ) ; checkInvariants ( writer ) ; } writer . close ( ) ; <START_BUG> IndexReader reader = IndexReader . open ( dir ) ; <END_BUG> reader . deleteDocuments ( new Term ( "content" , "aaa" ) ) ; reader . close ( ) ; writer = new IndexWriter ( dir , true , new WhitespaceAnalyzer ( ) , false ) ; writer . setMergePolicy ( new LogDocMergePolicy ( writer ) ) ; writer . setMaxBufferedDocs ( 10 ) ; writer . setMergeFactor ( 5 ) ; for ( int i = 0 ; i < 10 ; i ++ ) { addDoc ( writer ) ; } checkInvariants ( writer ) ; assertEquals ( 10 , writer . docCount ( ) ) ; writer . close ( ) ; } private void addDoc ( IndexWriter writer ) throws IOException { } private void checkInvariants ( IndexWriter writer ) throws IOException { } }

Fix:
IndexReader reader = IndexReader . open ( dir , false ) ;
Buggy code:
final class CollectionToMapConverter implements ConditionalGenericConverter { private final GenericConversionService conversionService ; public CollectionToMapConverter ( GenericConversionService conversionService ) { } public Set < ConvertiblePair > getConvertibleTypes ( ) { } public boolean matches ( TypeDescriptor sourceType , TypeDescriptor targetType ) { } @ SuppressWarnings ( "unchecked" ) public Object convert ( Object source , TypeDescriptor sourceType , TypeDescriptor targetType ) { if ( source == null ) { return this . conversionService . convertNullSource ( sourceType , targetType ) ; } Collection < ? > sourceCollection = ( ( Collection < ? > ) ( source ) ) ; TypeDescriptor sourceElementType = sourceType . getElementTypeDescriptor ( ) ; if ( sourceElementType == ( TypeDescriptor . NULL ) ) { sourceElementType = ConversionUtils . getElementType ( sourceCollection ) ; } TypeDescriptor targetKeyType = targetType . getMapKeyTypeDescriptor ( ) ; TypeDescriptor targetValueType = targetType . getMapValueTypeDescriptor ( ) ; boolean keysCompatible = false ; if ( ( sourceElementType != ( TypeDescriptor . NULL ) ) && ( sourceElementType . isAssignableTo ( targetKeyType ) ) ) { keysCompatible = true ; } boolean valuesCompatible = false ; if ( ( sourceElementType != ( TypeDescriptor . NULL ) ) && ( sourceElementType . isAssignableTo ( targetValueType ) ) ) { valuesCompatible = true ; } if ( keysCompatible && valuesCompatible ) { Map target = CollectionFactory . createMap ( targetType . getType ( ) , sourceCollection . size ( ) ) ; if ( String . class . equals ( sourceElementType . getType ( ) ) ) { for ( Object element : sourceCollection ) { String [ ] property = parseProperty ( ( ( String ) ( element ) ) ) ; target . put ( property [ 0 ] , property [ 1 ] ) ; } } else { for ( Object element : sourceCollection ) { target . put ( element , element ) ; } } return target ; } else { Map target = CollectionFactory . createMap ( targetType . getType ( ) , sourceCollection . size ( ) ) ; <START_BUG> MapEntryConverter converter = new MapEntryConverter ( sourceElementType , sourceElementType , targetKeyType , targetValueType , keysCompatible , valuesCompatible , conversionService ) ; <END_BUG> if ( String . class . equals ( sourceElementType . getType ( ) ) ) { for ( Object element : sourceCollection ) { String [ ] property = parseProperty ( ( ( String ) ( element ) ) ) ; Object targetKey = converter . convertKey ( property [ 0 ] ) ; Object targetValue = converter . convertValue ( property [ 1 ] ) ; target . put ( targetKey , targetValue ) ; } } else { for ( Object element : sourceCollection ) { Object targetKey = converter . convertKey ( element ) ; Object targetValue = converter . convertValue ( element ) ; target . put ( targetKey , targetValue ) ; } } return target ; } } private String [ ] parseProperty ( String string ) { } }

Fix:
MapEntryConverter converter = new MapEntryConverter ( sourceElementType , sourceElementType , targetKeyType , targetValueType , keysCompatible , valuesCompatible , this . conversionService ) ;
Buggy code:
public class DropboxChooserPlugin extends CordovaPlugin { private static final String TAG = "DropboxChooserPlugin" ; private static final int DBX_CHOOSER_REQUEST = 1 ; private DbxChooser mChooser ; private CallbackContext mCallback ; @ Override public boolean execute ( String action , JSONArray args , CallbackContext callback ) throws JSONException { } private boolean initialiseChooser ( JSONArray args , CallbackContext callback ) { } private boolean launchChooser ( JSONArray args , CallbackContext callback ) { } @ Override public void onActivityResult ( int requestCode , int resultCode , Intent intent ) { } private void handleChooserResult ( int resultCode , Intent intent ) { if ( ( mCallback ) == null ) { LOG . w ( DropboxChooserPlugin . TAG , "No<seq2seq4repair_space>callback<seq2seq4repair_space>for<seq2seq4repair_space>chooser<seq2seq4repair_space>result" ) ; return ; } if ( resultCode == ( Activity . RESULT_OK ) ) { DbxChooser . Result result = new DbxChooser . Result ( intent ) ; JSONObject file = new JSONObject ( ) ; file . put ( "name" , result . getName ( ) ) ; file . put ( "link" , result . getLink ( ) . toString ( ) ) ; file . put ( "bytes" , result . getSize ( ) ) ; file . put ( "icon" , result . getIcon ( ) . toString ( ) ) ; Map < String , Uri > thumbnailMap = result . getThumbnails ( ) ; JSONObject thumbnail = new JSONObject ( ) ; if ( thumbnailMap != null ) { <START_BUG> for ( Entry < String , Uri > entry : result . getThumbnails ( ) . entrySet ( ) ) { <END_BUG> thumbnail . put ( entry . getKey ( ) , entry . getValue ( ) . toString ( ) ) ; } } file . put ( "thumbnail" , thumbnail ) ; JSONArray files = new JSONArray ( ) ; files . put ( file ) ; callback . success ( files ) ; } else { callback . error ( ) ; } } }

Fix:
for ( Entry < String , Uri > entry : thumbnailMap . entrySet ( ) ) {
Buggy code:
public class AboutUsActivity extends ActionBarActivity { @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public Intent getSupportParentActivityIntent ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { <START_BUG> getMenuInflater ( ) . inflate ( menu_faq , menu ) ; <END_BUG> return true ; } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
getMenuInflater ( ) . inflate ( menu_about_us , menu ) ;