nus-yam/ex-repair huggingface dataset:
Buggy code:
public class SolrRequestParserTest extends SolrTestCaseJ4 { @ BeforeClass public static void beforeClass ( ) throws Exception { <START_BUG> initCore ( "solrConfig.xml" , "schema.xml" ) ; <END_BUG> SolrRequestParserTest . parser = new SolrRequestParsers ( h . getCore ( ) . getSolrConfig ( ) ) ; } static SolrRequestParsers parser ; @ AfterClass public static void afterClass ( ) throws Exception { } @ Test public void testStreamBody ( ) throws Exception { } @ Test public void testStreamURL ( ) throws Exception { } @ Test public void testUrlParamParsing ( ) { } @ Test public void testStandardParseParamsAndFillStreams ( ) throws Exception { } }

Fix:
initCore ( "solrconfig.xml" , "schema.xml" ) ;
Buggy code:
public class JMeterUtils { private static Logger log = Hierarchy . getDefaultHierarchy ( ) . getLoggerFor ( "jmeter.util" ) ; private static LoggingManager logManager ; private static String LOG_FILE = "log_file" ; private static String LOG_PRIORITY = "log_level" ; private static final SAXParserFactory xmlFactory ; private static Properties appProperties ; public static ResourceBundle RESOURCES = ResourceBundle . getBundle ( "org.apache.jmeter.resources.messages" ) ; public static Properties getProperties ( String file ) { } private static void setLoggingLevels ( ) { } public static void reinitializeLocale ( Locale loc ) { } public static String getResString ( String key ) { } public static Properties getJMeterProperties ( ) { } public static ImageIcon getImage ( String name ) { } public static String getResourceFileAsText ( String name ) { } public static Vector getTimers ( Properties properties ) { } public static Vector getVisualizers ( Properties properties ) { } public static Vector getControllers ( Properties properties ) { } public static String [ ] getTestSamples ( Properties properties , String name ) { } public static XMLReader getXMLParser ( Properties properties ) { } public static XMLReader getXMLParser ( ) { } public static Hashtable getAlias ( Properties properties ) { } public static Vector getVector ( Properties properties , String name ) { } public static Hashtable getHashtable ( Properties properties , String name ) { } public static int getPropDefault ( String propName , int defaultVal ) { } public static boolean getPropDefault ( String propName , boolean defaultVal ) { } public static long getPropDefault ( String propName , long defaultVal ) { } public static String getPropDefault ( String propName , String defaultVal ) { } public static void selJComboBoxItem ( Properties properties , JComboBox combo , Vector namVec , String name ) { } public static Object instantiate ( String className , String impls ) { } public static Vector instantiate ( Vector v , String className ) { } public static Vector tokenize ( String string , String separator ) { } public static JButton createButton ( String name , ActionListener listener ) { } public static JButton createSimpleButton ( String name , ActionListener listener ) { } public static String [ ] split ( String splittee , String splitChar ) { } public static String [ ] split ( String splittee , String splitChar , String def ) { } public static void reportErrorToUser ( String errorMsg ) { } public static int findInArray ( String [ ] array , String value ) { } public static String unsplit ( Object [ ] splittee , Object splitChar ) { } public static String unsplit ( Object [ ] splittee , Object splitChar , String def ) { } public static String getJMeterHome ( ) { } public static void setJMeterHome ( String home ) { } private static String jmDir ; public static String getJMeterVersion ( ) { <START_BUG> return "@VERSION@" ; <END_BUG> } }

Fix:
return "1.7.3" ;
Buggy code:
public class FileUserRepository extends LifecycleAdapter implements UserRepository { private final Path authFile ; private final Map < String , User > usersByName = new ConcurrentHashMap < > ( ) ; private final Log log ; private volatile List < User > users = new ArrayList < > ( ) ; private final UserSerialization serialization = new UserSerialization ( ) ; public FileUserRepository ( Path file , LogProvider logProvider ) { } @ Override public User findByName ( String name ) { } @ Override public void start ( ) throws Throwable { } @ Override public void create ( User user ) throws IOException , IllegalCredentialsException { } @ Override public void update ( User existingUser , User updatedUser ) throws IOException , ConcurrentModificationException { } @ Override public boolean delete ( User user ) throws IOException { } @ Override public int numberOfUsers ( ) { } @ Override public boolean isValidName ( String name ) { } private void saveUsersToFile ( ) throws IOException { } private void loadUsersFromFile ( ) throws IOException { byte [ ] fileBytes = Files . readAllBytes ( authFile ) ; List < User > loadedUsers ; try { loadedUsers = serialization . deserializeUsers ( fileBytes ) ; } catch ( UserSerialization e ) { <START_BUG> log . error ( "Ignoring<seq2seq4repair_space>authorization<seq2seq4repair_space>file<seq2seq4repair_space>\"%s\"<seq2seq4repair_space>(%s)" , authFile . toAbsolutePath ( ) , e . getMessage ( ) ) ; <END_BUG> throw new IllegalStateException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>read<seq2seq4repair_space>authentication<seq2seq4repair_space>file:<seq2seq4repair_space>" + ( authFile ) ) ) ; } users = loadedUsers ; for ( User user : users ) { usersByName . put ( user . name ( ) , user ) ; } } }

Fix:
log . error ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>read<seq2seq4repair_space>authentication<seq2seq4repair_space>file<seq2seq4repair_space>\"%s\"<seq2seq4repair_space>(%s)" , authFile . toAbsolutePath ( ) , e . getMessage ( ) ) ;
Buggy code:
public final class User { private String name ; private String password ; private boolean hasAccess ; public User ( String name , String password , boolean hasAccess ) { } public String getName ( ) { } public void setName ( String name ) { } public String getPassword ( ) { } public void setPassword ( String password ) { } public boolean getHasAccess ( ) { } public void setHasAccess ( boolean hasAccess ) { } public static void logIn ( ) throws Exception { System . out . println ( "<seq2seq4repair_space>" ) ; System . out . println ( "Please<seq2seq4repair_space>use<seq2seq4repair_space>our<seq2seq4repair_space>sophisticated<seq2seq4repair_space>and<seq2seq4repair_space>secure<seq2seq4repair_space>log<seq2seq4repair_space>in<seq2seq4repair_space>system<seq2seq4repair_space>to<seq2seq4repair_space>access<seq2seq4repair_space>inventory" ) ; System . out . println ( "You<seq2seq4repair_space>may<seq2seq4repair_space>type<seq2seq4repair_space>\"exit\"<seq2seq4repair_space>at<seq2seq4repair_space>any<seq2seq4repair_space>time<seq2seq4repair_space>to<seq2seq4repair_space>exit" ) ; System . out . printf ( "User<seq2seq4repair_space>Name:<seq2seq4repair_space>\t\n" ) ; String userName = InventoryFunctions . nextLine ( ) ; System . out . printf ( "User<seq2seq4repair_space>Password:<seq2seq4repair_space>\t\n" ) ; String userPass = InventoryFunctions . nextLine ( ) ; if ( SYSTEM_USERS . containsKey ( userName ) ) { if ( SYSTEM_USERS . get ( userName ) . getPassword ( ) . equals ( userPass ) ) { if ( SYSTEM_USERS . get ( userName ) . getHasAccess ( ) ) { while ( true ) { <START_BUG> System . out . printf ( "Greetings,<seq2seq4repair_space>%s\t" , SYSTEM_USERS . get ( userName ) . getName ( ) ) ; <END_BUG> InventoryFunctions . displayInventory ( ) ; } } else { System . out . printf ( "Come<seq2seq4repair_space>on<seq2seq4repair_space>%s,<seq2seq4repair_space>how<seq2seq4repair_space>are<seq2seq4repair_space>you<seq2seq4repair_space>not<seq2seq4repair_space>in<seq2seq4repair_space>jail?\t" , SYSTEM_USERS . get ( userName ) . getName ( ) ) ; User . logIn ( ) ; } } else { System . out . println ( "Invalid<seq2seq4repair_space>name<seq2seq4repair_space>or<seq2seq4repair_space>password.<seq2seq4repair_space>Try<seq2seq4repair_space>again" ) ; User . logIn ( ) ; } } else { System . out . println ( "You<seq2seq4repair_space>are<seq2seq4repair_space>not<seq2seq4repair_space>in<seq2seq4repair_space>our<seq2seq4repair_space>system.<seq2seq4repair_space>Please<seq2seq4repair_space>contact<seq2seq4repair_space>Branden.<seq2seq4repair_space>But<seq2seq4repair_space>not<seq2seq4repair_space>at<seq2seq4repair_space>home.<seq2seq4repair_space>Or<seq2seq4repair_space>during<seq2seq4repair_space>office<seq2seq4repair_space>hours.<seq2seq4repair_space>Definitely<seq2seq4repair_space>not<seq2seq4repair_space>on<seq2seq4repair_space>weekends.<seq2seq4repair_space>Actually,<seq2seq4repair_space>call<seq2seq4repair_space>Doug." ) ; User . logIn ( ) ; } } }

Fix:
System . out . printf ( "Logged<seq2seq4repair_space>in<seq2seq4repair_space>as,<seq2seq4repair_space>%s\t\n" , SYSTEM_USERS . get ( userName ) . getName ( ) ) ;
Buggy code:
public class YeomanHelpParser { public static List < String > getAvailableYoGenerators ( ) { List < String > availableYoGenerators = new ArrayList < String > ( ) ; File userdir = new File ( System . getProperty ( "netbeans.user" ) ) ; ExternalProcessBuilder processBuilder = new ExternalProcessBuilder ( "C:\\Users\\gwieleng\\AppData\\Roaming\\npm\\yo.cmd" ) . addArgument ( "--help" ) . workingDirectory ( userdir ) ; final YeomanHelpParser . HelpLineProcessor lineProcessor = new YeomanHelpParser . HelpLineProcessor ( ) ; ExecutionDescriptor descriptor = new ExecutionDescriptor ( ) . outProcessorFactory ( new ExecutionDescriptor . InputProcessorFactory ( ) { @ Override public InputProcessor newInputProcessor ( InputProcessor defaultProcessor ) { return InputProcessors . bridge ( lineProcessor ) ; } } ) ; <START_BUG> ExecutionService service = ExecutionService . newService ( processBuilder , descriptor , "Yo" ) ; <END_BUG> Future < Integer > task = service . run ( ) ; try { if ( ( task . get ( ) ) == 0 ) { for ( String command : lineProcessor . getCommands ( ) ) { availableYoGenerators . add ( command ) ; } } } catch ( InterruptedException ex ) { Thread . currentThread ( ) . interrupt ( ) ; } catch ( ExecutionException ex ) { } return availableYoGenerators ; } private static class HelpLineProcessor implements LineProcessor { private final List < String > commands = Collections . synchronizedList ( new ArrayList < String > ( ) ) ; @ Override public void processLine ( String line ) { } public List < String > getCommands ( ) { } @ Override public void close ( ) { } @ Override public void reset ( ) { } } }

Fix:
ExecutionService service = ExecutionService . newService ( processBuilder , descriptor , "Yeoman" ) ;
Buggy code:
public class DesktopDataFilesLite implements IDataFiles { @ Override public String getJsonFiles ( ) { } @ Override public String getCatalogFiles ( ) { <START_BUG> return "data//daycatalogs//hygxyz-20150821.bin" ; <END_BUG> } @ Override public String getConstellationFiles ( ) { } @ Override public String getBoundaryFiles ( ) { } }

Fix:
return "data//daycatalogs//hygxyz-20150824.bin" ;
Buggy code:
public class TestPhraseQuery extends LuceneTestCase { public static final float SCORE_COMP_THRESH = 1.0E-6F ; private static IndexSearcher searcher ; private static IndexReader reader ; private PhraseQuery query ; private static Directory directory ; @ BeforeClass public static void beforeClass ( ) throws Exception { } @ Override public void setUp ( ) throws Exception { } @ AfterClass public static void afterClass ( ) throws Exception { } public void testNotCloseEnough ( ) throws Exception { } public void testBarelyCloseEnough ( ) throws Exception { } public void testExact ( ) throws Exception { } public void testSlop1 ( ) throws Exception { } public void testOrderDoesntMatter ( ) throws Exception { } public void testMulipleTerms ( ) throws Exception { } public void testPhraseQueryWithStopAnalyzer ( ) throws Exception { Directory directory = newDirectory ( ) ; Analyzer stopAnalyzer = new MockAnalyzer ( random ( ) , MockTokenizer . SIMPLE , true , MockTokenFilter . ENGLISH_STOPSET ) ; <START_BUG> RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , directory , newIndexWriterConfig ( LUCENE_40 , stopAnalyzer ) ) ; <END_BUG> Document doc = new Document ( ) ; doc . add ( newTextField ( "field" , "the<seq2seq4repair_space>stop<seq2seq4repair_space>words<seq2seq4repair_space>are<seq2seq4repair_space>here" , YES ) ) ; writer . addDocument ( doc ) ; IndexReader reader = writer . getReader ( ) ; writer . close ( ) ; IndexSearcher searcher = newSearcher ( reader ) ; PhraseQuery query = new PhraseQuery ( ) ; query . add ( new Term ( "field" , "stop" ) ) ; query . add ( new Term ( "field" , "words" ) ) ; ScoreDoc [ ] hits = searcher . search ( query , null , 1000 ) . scoreDocs ; assertEquals ( 1 , hits . length ) ; QueryUtils . check ( random ( ) , query , searcher ) ; reader . close ( ) ; directory . close ( ) ; } public void testPhraseQueryInConjunctionScorer ( ) throws Exception { } public void testSlopScoring ( ) throws IOException { } public void testToString ( ) throws Exception { } public void testWrappedPhrase ( ) throws IOException { } public void testNonExistingPhrase ( ) throws IOException { } public void testPalyndrome2 ( ) throws Exception { } public void testPalyndrome3 ( ) throws Exception { } public void testEmptyPhraseQuery ( ) throws Throwable { } public void testRewrite ( ) throws IOException { } public void testRandomPhrases ( ) throws Exception { } }

Fix:
RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , directory , newIndexWriterConfig ( TEST_VERSION_CURRENT , stopAnalyzer ) ) ;
Buggy code:
public class ReportPeer extends org . tigris . scarab . om . BaseReportPeer { private static final String REPORT_PEER = "ReportPeer" ; private static final String RETRIEVE_BY_PK = "retrieveByPK" ; public static boolean exists ( String name ) throws Exception { } public static Report retrieveByName ( String name ) throws Exception { Report report = null ; Criteria crit = new Criteria ( ) . add ( NAME , name ) . add ( DELETED , false ) ; List reports = doSelect ( crit ) ; if ( ( reports . size ( ) ) == 1 ) { report = ( ( Report ) ( reports . get ( 0 ) ) ) ; } else if ( ( reports . size ( ) ) > 1 ) { <START_BUG> throw ScarabException . create ( ExceptionMultipleReports , name ) ; <END_BUG> } return report ; } public static Report retrieveByPK ( ObjectKey pk ) throws TorqueException { } }

Fix:
throw new org . tigris . scarab . util . ScarabException ( L10NKeySet . ExceptionMultipleReports , name ) ;
Buggy code:
public class InlinePanelPage_5 extends WebPage { private static final long serialVersionUID = 1L ; public InlinePanelPage_5 ( ) { } public static class FragmentWithAssociatedMarkupStream extends Fragment { private static final long serialVersionUID = 1L ; public FragmentWithAssociatedMarkupStream ( final String id , final String markupId ) { } @ Override protected MarkupStream chooseMarkupStream ( MarkupStream markupStream ) { } @ Override public IMarkupFragment getMarkup ( Component child ) { IMarkupFragment markup = getAssociatedMarkup ( ) ; if ( markup == null ) { return null ; } if ( child == null ) { return markup ; } <START_BUG> return markup . find ( child . getId ( ) , 0 ) ; <END_BUG> } } }

Fix:
return markup . find ( child . getId ( ) ) ;
Buggy code:
public class CancelAction extends FrameAction implements WorkerListChangeListener { public CancelAction ( AbstractFrameController controller ) { } public void actionPerformed ( ActionEvent evt ) { <START_BUG> getFrameController ( ) . getStatusBar ( ) . cancelDisplayedWorker ( ) ; <END_BUG> } public void workerListChanged ( WorkerListChangedEvent e ) { } }

Fix:
getFrameMediator ( ) . getStatusBar ( ) . cancelDisplayedWorker ( ) ;
Buggy code:
public class ParkingLotAction { public static void updateAreaLightIntensity ( String serverURL , String sid , String version , String intensityLevel ) throws Exception { } public static void updateDigitalSignage1 ( String serverURL , String sid , String version , String label ) throws Exception { } public static void updateParkingMeterPrice ( String serverURL , String sid , String version , String price ) throws Exception { <START_BUG> String pJSON = ( ( ( ( ( ( ( "{" + ( ( "\"Model\":<seq2seq4repair_space>\"ParkingMeter\",<seq2seq4repair_space>" + "\"ParkingMeter\":<seq2seq4repair_space>{<seq2seq4repair_space>" ) + "\"sid\":<seq2seq4repair_space>\"" ) ) + sid ) + "\",<seq2seq4repair_space>" ) + "\"parkignMeterLabel\":<seq2seq4repair_space>{\"Version\":\"" ) + version ) + "\",<seq2seq4repair_space>\"Value\":\"" ) + price ) + "\"}}}" ; <END_BUG> System . out . println ( ( "Changing<seq2seq4repair_space>Price<seq2seq4repair_space>:" + price ) ) ; HttpRequestResponseHandler . sendPut ( serverURL , pJSON ) ; } public static void updateStallLightPowerState ( String serverURL , String sid , String version , String powerState ) throws Exception { } public static String getAreaLightBySpotId ( String serverURL , String spotId ) throws Exception { } public static String getAreaLightById ( String serverURL , String areaLightId ) throws Exception { } public static String getStallLightById ( String serverURL , String stallLightId ) throws Exception { } public static String getParkingFloorById ( String serverURL , String floorId ) throws Exception { } public static String getParkingMeterById ( String serverURL , String pmId ) throws Exception { } public static void actionOnAreaLight ( String areaLightId , String spotId , String newIntensity ) throws Exception { } public static void actionOnStallLight ( String stallLightId , String spotId , String powerState ) throws Exception { } public static void actionOnParkingMeter ( String pmeterId , String spotId , String newPrice ) throws Exception { } public static void actionOnDigitalSignage ( String floorId , String label ) throws Exception { } }

Fix:
String pJSON = ( ( ( ( ( ( ( "{" + ( ( "\"Model\":<seq2seq4repair_space>\"ParkingMeter\",<seq2seq4repair_space>" + "\"ParkingMeter\":<seq2seq4repair_space>{<seq2seq4repair_space>" ) + "\"sid\":<seq2seq4repair_space>\"" ) ) + sid ) + "\",<seq2seq4repair_space>" ) + "\"parkingMeterLabel\":<seq2seq4repair_space>{\"Version\":\"" ) + version ) + "\",<seq2seq4repair_space>\"Value\":\"" ) + price ) + "\"}}}" ;
Buggy code:
class OSGiSubsystemAdd extends AbstractBoottimeAddStepHandler { static final OSGiSubsystemAdd INSTANCE = new OSGiSubsystemAdd ( ) ; private OSGiRuntimeResource resource ; private OSGiSubsystemAdd ( ) { } public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { } protected void populateModel ( final ModelNode operation , final ModelNode subModel ) { } protected void performBoottime ( final OperationContext context , final ModelNode operation , final ModelNode model , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers ) { OSGiLogger . ROOT_LOGGER . activatingSubsystem ( ) ; context . addStep ( new OperationStepHandler ( ) { public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceTarget serviceTarget = context . getServiceTarget ( ) ; newControllers . add ( BundleStartTracker . addService ( serviceTarget ) ) ; newControllers . add ( BundleInstallProviderIntegration . addService ( serviceTarget ) ) ; <START_BUG> newControllers . addAll ( FrameworkBootstrapService . addService ( serviceTarget , verificationHandler ) ) ; <END_BUG> newControllers . add ( ConfigAdminServiceImpl . addService ( serviceTarget , verificationHandler ) ) ; context . completeStep ( ) ; } } , RUNTIME ) ; context . addStep ( new AbstractDeploymentChainStep ( ) { protected void execute ( DeploymentProcessorTarget processorTarget ) { new OSGiDeploymentActivator ( ) . activate ( processorTarget ) ; } } , RUNTIME ) ; ServiceTarget serviceTarget = context . getServiceTarget ( ) ; newControllers . add ( SubsystemState . addService ( serviceTarget , getActivationMode ( operation ) ) ) ; context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceBuilder < Void > builder = context . getServiceTarget ( ) . addService ( JBOSGI_BASE_NAME . append ( "OSGiSubsystem" ) . append ( "initialize" ) , new org . jboss . msc . service . AbstractService < Void > ( ) { @ SuppressWarnings ( "unchecked" ) @ Override public void start ( StartContext context ) throws StartException { try { ServiceContainer ctr = context . getController ( ) . getServiceContainer ( ) ; ServiceController < Bundle > sc = ( ( ServiceController < Bundle > ) ( ctr . getRequiredService ( SYSTEM_BUNDLE ) ) ) ; resource . setBundleContextServiceController ( sc ) ; } finally { context . getController ( ) . setMode ( REMOVE ) ; } } } ) ; builder . addDependency ( SYSTEM_BUNDLE ) ; builder . setInitialMode ( PASSIVE ) ; builder . install ( ) ; context . completeStep ( ) ; } } , RUNTIME ) ; OSGiLogger . ROOT_LOGGER . debugf ( "Activated<seq2seq4repair_space>OSGi<seq2seq4repair_space>Subsystem" ) ; } private Activation getActivationMode ( ModelNode operation ) { } static DescriptionProvider DESCRIPTION = new DescriptionProvider ( ) { @ Override public ModelNode getModelDescription ( Locale locale ) { } } ; }

Fix:
newControllers . add ( FrameworkBootstrapService . addService ( serviceTarget , verificationHandler ) ) ;
Buggy code:
public class UAX29URLEmailTokenizerFactory extends BaseTokenizerFactory { private int maxTokenLength ; @ Override public void init ( Map < String , String > args ) { } public UAX29URLEmailTokenizer create ( Reader input ) { <START_BUG> UAX29URLEmailTokenizer tokenizer = new UAX29URLEmailTokenizer ( input ) ; <END_BUG> tokenizer . setMaxTokenLength ( maxTokenLength ) ; return tokenizer ; } }

Fix:
UAX29URLEmailTokenizer tokenizer = new UAX29URLEmailTokenizer ( luceneMatchVersion , input ) ;
Buggy code:
public class CreateGamePhase extends ServerAwarePhase { private final class PlayerSlotComparator implements Comparator < PlayerSlot > { @ Override public int compare ( PlayerSlot o1 , PlayerSlot o2 ) { } } protected PlayerSlot [ ] slots ; protected Expansion [ ] [ ] slotSupportedExpansions = new Expansion [ PlayerSlot . COUNT ] [ ] ; public CreateGamePhase ( Game game , GameController controller ) { } public void setSlots ( PlayerSlot [ ] slots ) { } public PlayerSlot [ ] getPlayerSlots ( ) { } @ WsSubscribe public void handleSlotMessage ( SlotMessage msg ) { } private EnumSet < Expansion > mergeSupportedExpansions ( ) { } private Phase addPhase ( Phase next , Phase phase ) { } protected void preparePhases ( ) { } private void createPlayers ( ) { } protected Snapshot getSnapshot ( ) { } protected void initializePlayersMeeples ( ) { } protected void preparePlayers ( ) { } protected void prepareTilePack ( ) { } protected void preplaceTiles ( ) { } protected void prepareAiPlayers ( ) { } protected void prepareCapabilities ( ) { for ( Expansion exp : game . getExpansions ( ) ) { game . getCapabilityClasses ( ) . addAll ( Arrays . asList ( exp . getCapabilities ( ) ) ) ; } <START_BUG> DebugConfig debugConfig = getGameController ( ) . getConfig ( ) . getDebug ( ) ; <END_BUG> if ( ( debugConfig != null ) && ( ( debugConfig . getOff_capabilities ( ) ) != null ) ) { List < String > offNames = debugConfig . getOff_capabilities ( ) ; Set < Class < ? extends Capability > > off = new HashSet < > ( ) ; for ( String tok : offNames ) { tok = tok . trim ( ) ; try { String className = ( "com.jcloisterzone.game.capability." + tok ) + "Capability" ; @ SuppressWarnings ( "unchecked" ) Class < ? extends Capability > clazz = ( ( Class < ? extends Capability > ) ( Class . forName ( className ) ) ) ; off . add ( clazz ) ; } catch ( Exception e ) { logger . warn ( ( "Invalid<seq2seq4repair_space>capability<seq2seq4repair_space>name:<seq2seq4repair_space>" + tok ) , e ) ; } } game . getCapabilityClasses ( ) . removeAll ( off ) ; } } public void startGame ( ) { } No newline ; at end ; of file ; }

Fix:
DebugConfig debugConfig = getDebugConfig ( ) ;
Buggy code:
public class GenderClassificationTest { private IplImage image ; private GenderClassification genderClassification ; @ Before public void setUp ( ) { <START_BUG> URL url = Application . class . getClassLoader ( ) . getResource ( "TestImages//obama.jpg" ) ; <END_BUG> try { image = cvLoadImage ( new File ( url . toURI ( ) ) . getAbsolutePath ( ) ) ; } catch ( URISyntaxException e ) { e . printStackTrace ( ) ; } } @ Test public void loadImageTest ( ) { } }

Fix:
URL url = GenderClassification . class . getClassLoader ( ) . getResource ( "TestImages//obama.jpg" ) ;
Buggy code:
public class SelectAddressbookFolderDialog extends JDialog implements ActionListener , TreeSelectionListener , ISelectFolderDialog { private boolean bool = false ; private JTree tree ; private JButton [ ] buttons ; private IFolder selectedFolder ; private TreeModel model ; public SelectAddressbookFolderDialog ( TreeModel model ) { } private void layoutComponents ( ) { } private void initComponents ( ) { buttons = new JButton [ 3 ] ; buttons [ 0 ] = new org . columba . core . gui . base . ButtonWithMnemonic ( AddressbookResourceLoader . getString ( "global" , "cancel" ) ) ; buttons [ 0 ] . setActionCommand ( "CANCEL" ) ; buttons [ 0 ] . setDefaultCapable ( true ) ; buttons [ 1 ] = new org . columba . core . gui . base . ButtonWithMnemonic ( AddressbookResourceLoader . getString ( "global" , "ok" ) ) ; buttons [ 1 ] . setEnabled ( true ) ; buttons [ 1 ] . setActionCommand ( "OK" ) ; buttons [ 2 ] = new JButton ( AddressbookResourceLoader . getString ( "tree" , "folderdialog" , "new_subFolder" ) ) ; buttons [ 2 ] . setActionCommand ( "NEW" ) ; buttons [ 2 ] . setEnabled ( false ) ; getRootPane ( ) . setDefaultButton ( buttons [ 1 ] ) ; tree = new JTree ( model ) ; tree . expandRow ( 0 ) ; tree . expandRow ( 1 ) ; tree . putClientProperty ( "JTree.lineStyle" , "Angled" ) ; tree . setShowsRootHandles ( true ) ; tree . setRootVisible ( false ) ; tree . addTreeSelectionListener ( this ) ; tree . setCellRenderer ( new AddressbookTreeCellRenderer ( true ) ) ; for ( int i = 0 ; i < 3 ; i ++ ) { buttons [ i ] . addActionListener ( this ) ; } <START_BUG> tree . setSelectionPath ( new TreePath ( AddressbookTreeModel . getInstance ( ) . getFolder ( 101 ) . getPath ( ) ) ) ; <END_BUG> } public boolean success ( ) { } public IFolder getSelectedFolder ( ) { } public int getUid ( ) { } public void actionPerformed ( ActionEvent e ) { } public void valueChanged ( TreeSelectionEvent e ) { } }

Fix:
tree . setSelectionPath ( new TreePath ( AddressbookTreeModel . getInstance ( ) . getFolder ( "101" ) . getPath ( ) ) ) ;
Buggy code:
public final class NestedList extends Panel { public NestedList ( MarkupContainer parent , final String id , List list ) { } private static class Rows < T > extends ListView < T > { public Rows ( MarkupContainer parent , String name , List list ) { } @ Override protected void populateItem ( ListItem < T > listItem ) { T modelObject = listItem . getModelObject ( ) ; if ( modelObject instanceof List ) { <START_BUG> NestedList nested = new NestedList ( listItem , "nested" , ( ( List ) ( modelObject ) ) ) ; <END_BUG> WebMarkupContainer row = new WebMarkupContainer ( listItem , "row" ) ; row . setVisible ( false ) ; new WebMarkupContainer ( row , "label" ) ; } else { NestedList nested = new NestedList ( listItem , "nested" , null ) ; nested . setVisible ( false ) ; WebMarkupContainer row = new WebMarkupContainer ( listItem , "row" ) ; new wicket . markup . html . basic . Label ( row , "label" , modelObject . toString ( ) ) ; } } } }

Fix:
new NestedList ( listItem , "nested" , ( ( List ) ( modelObject ) ) ) ;
Buggy code:
public class TypeConverter { public static TypeDeclaration buildTypeDeclaration ( IType type , CompilationUnitDeclaration compilationUnit , CompilationResult compilationResult , ProblemReporter problemReporter ) throws JavaModelException { } private static FieldDeclaration convert ( IField field , IType type ) throws JavaModelException { } private static AbstractMethodDeclaration convert ( IMethod method , IType type , CompilationResult compilationResult ) throws JavaModelException { } private static TypeDeclaration convert ( IType type , IType alreadyComputedMember , MemberTypeDeclaration alreadyComputedMemberDeclaration , CompilationResult compilationResult ) throws JavaModelException { } private static TypeReference createTypeReference ( char [ ] type , IType contextType ) { try { String [ ] [ ] resolvedName = contextType . resolveType ( new String ( type ) ) ; if ( ( resolvedName != null ) && ( ( resolvedName . length ) == 1 ) ) { type = CharOperation . concat ( resolvedName [ 0 ] [ 0 ] . toCharArray ( ) , resolvedName [ 0 ] [ 1 ] . toCharArray ( ) , '.' ) ; } } catch ( JavaModelException e ) { } int max = type . length ; int dimStart = max ; int dim = 0 ; int identCount = 1 ; for ( int i = 0 ; i < max ; i ++ ) { switch ( type [ i ] ) { case '[' : if ( dim == 0 ) dimStart = i ; dim ++ ; break ; case '.' : identCount ++ ; break ; } } if ( identCount == 1 ) { if ( dim == 0 ) { return new SingleTypeReference ( type , 0 ) ; } else { char [ ] identifier = new char [ dimStart ] ; System . arraycopy ( type , 0 , identifier , 0 , dimStart ) ; return new ArrayTypeReference ( identifier , dim , 0 ) ; } } else { <START_BUG> char [ ] [ ] identifiers = CharOperation . splitOn ( '.' , type , 0 , ( dimStart - 1 ) ) ; <END_BUG> if ( dim == 0 ) { return new QualifiedTypeReference ( identifiers , new long [ ] { 0 } ) ; } else { return new ArrayQualifiedTypeReference ( identifiers , dim , new long [ ] { 0 } ) ; } } } }

Fix:
char [ ] [ ] identifiers = CharOperation . splitOn ( '.' , type , 0 , dimStart ) ;
Buggy code:
public class CreateHadoopClusterAction extends AbstractMetadataCreationAction { public CreateHadoopClusterAction ( RepositoryNode node ) { } @ Override protected IWizard createWizard ( ) { } @ Override protected String getActionLabel ( ) { } @ Override protected ImageDescriptor getActionImage ( ) { <START_BUG> return ImageLib . getImageDescriptor ( NEW_CONNECTION ) ; <END_BUG> } }

Fix:
return ImageLib . getImageDescriptor ( HADOOP_CLUSTER ) ;
Buggy code:
public class TimerSelectionDialog implements ActionListener , WindowClosingIf { private final JButton ok = new JButton ( ) ; private final JButton cancel = new JButton ( ) ; private final DefaultListModel < Program > model = new DefaultListModel < Program > ( ) ; private final ProgramList list = new ProgramList ( model ) ; private int selectedIndex = - 1 ; private Program selectedProgram = null ; private final LazyBones control ; private JDialog dialog ; private final Program [ ] programs ; private final Program originalProgram ; private final LazyBonesTimer timerOptions ; public TimerSelectionDialog ( Program [ ] programs , LazyBonesTimer timerOptions , Program prog ) { } private void initGUI ( ) { } @ Override public void actionPerformed ( ActionEvent e ) { } private Calendar getStartTime ( Program prog ) { } private Calendar getEndTime ( Program prog ) { } private Calendar getCalendarForDate ( Program prog ) { Calendar cal = GregorianCalendar . getInstance ( ) ; cal . set ( Calendar . MILLISECOND , 0 ) ; cal . set ( Calendar . SECOND , 0 ) ; cal . set ( Calendar . DAY_OF_MONTH , prog . getDate ( ) . getDayOfMonth ( ) ) ; <START_BUG> cal . set ( Calendar . MONTH , prog . getDate ( ) . getMonth ( ) ) ; <END_BUG> cal . set ( Calendar . YEAR , prog . getDate ( ) . getYear ( ) ) ; return cal ; } @ Override public void close ( ) { } @ Override public JRootPane getRootPane ( ) { } }

Fix:
cal . set ( Calendar . MONTH , ( ( prog . getDate ( ) . getMonth ( ) ) - 1 ) ) ;
Buggy code:
public class IntroductoryPanel extends JPanel { private static final long serialVersionUID = 2168617534333064174L ; public static final Logger LOGGER = Logger . getLogger ( IntroductoryPanel . class ) ; private InconsistentOntologyPlugin selectedPlugin ; public IntroductoryPanel ( OWLEditorKit owlEditorKit , InconsistentOntologyPlugin lastSelectedPlugin ) throws IOException { } private JPanel createCenterPanel ( OWLEditorKit owlEditorKit , InconsistentOntologyPlugin lastSelectedPlugin ) throws IOException { JPanel center = new JPanel ( ) ; center . setLayout ( new BoxLayout ( center , BoxLayout . PAGE_AXIS ) ) ; JTextPane tp = new JTextPane ( ) ; tp . setEditable ( false ) ; <START_BUG> URL help = getClass ( ) . getResource ( "InconsistentOntologyHelp.html" ) ; <END_BUG> tp . setPage ( help ) ; Font font = UIManager . getFont ( "TextArea.font" ) ; if ( font != null ) { String bodyRule = ( ( ( ( "body<seq2seq4repair_space>{<seq2seq4repair_space>font-family:<seq2seq4repair_space>" + ( font . getFamily ( ) ) ) + ";<seq2seq4repair_space>" ) + "font-size:<seq2seq4repair_space>" ) + ( font . getSize ( ) ) ) + "pt;<seq2seq4repair_space>}" ; ( ( HTMLDocument ) ( tp . getDocument ( ) ) ) . getStyleSheet ( ) . addRule ( bodyRule ) ; } JScrollPane scrollPane = new JScrollPane ( ) ; scrollPane . getViewport ( ) . add ( tp ) ; scrollPane . setPreferredSize ( new Dimension ( 480 , 300 ) ) ; center . add ( scrollPane ) ; InconsistentOntologyPluginLoader loader = new InconsistentOntologyPluginLoader ( owlEditorKit ) ; Set < InconsistentOntologyPlugin > plugins = loader . getPlugins ( ) ; if ( ( plugins . size ( ) ) > 1 ) { Box optBox = new Box ( BoxLayout . Y_AXIS ) ; optBox . setAlignmentX ( 0.0F ) ; optBox . setBorder ( ComponentFactory . createTitledBorder ( "Explanation<seq2seq4repair_space>Plugins" ) ) ; ButtonGroup group = new ButtonGroup ( ) ; boolean selectedOne = false ; for ( final InconsistentOntologyPlugin plugin : plugins ) { JRadioButton button = new JRadioButton ( plugin . getName ( ) ) ; if ( ! selectedOne ) { button . setSelected ( true ) ; selectedOne = true ; selectedPlugin = plugin ; } if ( ( lastSelectedPlugin != null ) && ( plugin . getName ( ) . equals ( lastSelectedPlugin . getName ( ) ) ) ) { button . setSelected ( true ) ; selectedPlugin = plugin ; } group . add ( button ) ; button . addActionListener ( new ActionListener ( ) { public void actionPerformed ( ActionEvent e ) { selectedPlugin = plugin ; } } ) ; optBox . add ( button ) ; } center . add ( optBox ) ; } else { selectedPlugin = plugins . iterator ( ) . next ( ) ; } return center ; } public InconsistentOntologyPlugin getSelectedPlugin ( ) { } }

Fix:
URL help = getClass ( ) . getResource ( "//InconsistentOntologyHelp.html" ) ;
Buggy code:
public class QualifiedSuperReference extends QualifiedThisReference { public QualifiedSuperReference ( TypeReference name , int pos , int sourceEnd ) { } public boolean isSuper ( ) { } public boolean isThis ( ) { } public TypeBinding resolveType ( BlockScope scope ) { super . resolveType ( scope ) ; if ( ( currentCompatibleType ) == null ) return null ; if ( scope . isJavaLangObject ( currentCompatibleType ) ) { scope . problemReporter ( ) . cannotUseSuperInJavaLangObject ( this ) ; return null ; } <START_BUG> return this . expressionType = currentCompatibleType . superclass ( ) ; <END_BUG> } public String toStringExpression ( ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } }

Fix:
return this . resolvedType = currentCompatibleType . superclass ( ) ;
Buggy code:
class AnnotationBinding implements IAnnotationBinding { static final AnnotationBinding [ ] NoAnnotations = new AnnotationBinding [ 0 ] ; private org . eclipse . jdt . internal . compiler . lookup . AnnotationBinding internalAnnotation ; private BindingResolver bindingResolver ; AnnotationBinding ( org . eclipse . jdt . internal . compiler . lookup . AnnotationBinding annotation , BindingResolver resolver ) { } public IAnnotationBinding [ ] getAnnotations ( ) { } public ITypeBinding getAnnotationType ( ) { } public IMemberValuePairBinding [ ] getDeclaredMemberValuePairs ( ) { } public IMemberValuePairBinding [ ] getAllMemberValuePairs ( ) { IMemberValuePairBinding [ ] pairs = getDeclaredMemberValuePairs ( ) ; ReferenceBinding typeBinding = this . internalAnnotation . getAnnotationType ( ) ; if ( typeBinding == null ) return pairs ; <START_BUG> MethodBinding [ ] methods = typeBinding . methods ( ) ; <END_BUG> int methodLength = ( methods == null ) ? 0 : methods . length ; if ( methodLength == 0 ) return pairs ; int declaredLength = pairs . length ; if ( declaredLength == methodLength ) return pairs ; HashtableOfObject table = new HashtableOfObject ( declaredLength ) ; for ( int i = 0 ; i < declaredLength ; i ++ ) table . put ( ( ( MemberValuePairBinding ) ( pairs [ i ] ) ) . internalName ( ) , pairs [ i ] ) ; IMemberValuePairBinding [ ] allPairs = new IMemberValuePairBinding [ methodLength ] ; for ( int i = 0 ; i < methodLength ; i ++ ) { Object pair = table . get ( methods [ i ] . selector ) ; allPairs [ i ] = ( pair == null ) ? new DefaultValuePairBinding ( methods [ i ] , this . bindingResolver ) : ( ( IMemberValuePairBinding ) ( pair ) ) ; } return allPairs ; } public IJavaElement getJavaElement ( ) { } public String getKey ( ) { } public int getKind ( ) { } public int getModifiers ( ) { } public String getName ( ) { } public boolean isDeprecated ( ) { } public boolean isEqualTo ( IBinding binding ) { } public boolean isRecovered ( ) { } public boolean isSynthetic ( ) { } public String toString ( ) { } }

Fix:
MethodBinding [ ] methods = typeBinding . availableMethods ( ) ;
Buggy code:
public interface NetworkTrafficGenerator { <START_BUG> public int generate ( int previous , double max ) ; <END_BUG> }

Fix:
public int generate ( int previous , int max ) ;
Buggy code:
public class HttpListenerService extends ListenerService < HttpListenerService > { private volatile AcceptingChannel < StreamConnection > server ; private final ChannelUpgradeHandler httpUpgradeHandler = new ChannelUpgradeHandler ( ) ; protected final InjectedValue < ListenerRegistry > httpListenerRegistry = new InjectedValue ( ) ; static final ServiceName HTTP_UPGRADE_REGISTRY = JBOSS . append ( "http-upgrade-registry" ) ; static final String PROTOCOL = "http" ; private final String serverName ; public HttpListenerService ( String name , final String serverName , OptionMap listenerOptions , OptionMap socketOptions , boolean certificateForwarding , boolean proxyAddressForwarding ) { } @ Override protected OpenListener createOpenListener ( ) { <START_BUG> return new io . undertow . server . protocol . http . HttpOpenListener ( getBufferPool ( ) . getValue ( ) , OptionMap . builder ( ) . addAll ( commonOptions ) . addAll ( listenerOptions ) . set ( ENABLE_CONNECTOR_STATISTICS , getUndertowService ( ) . isStatisticsEnabled ( ) ) . getMap ( ) , getBufferSize ( ) ) ; <END_BUG> } @ Override public boolean isSecure ( ) { } @ Override protected void preStart ( final StartContext context ) { } protected void startListening ( XnioWorker worker , InetSocketAddress socketAddress , ChannelListener < AcceptingChannel < StreamConnection > > acceptListener ) throws IOException { } @ Override protected void stopListening ( ) { } @ Override public HttpListenerService getValue ( ) throws IllegalArgumentException , IllegalStateException { } public InjectedValue < ListenerRegistry > getHttpListenerRegistry ( ) { } @ Override protected String getProtocol ( ) { } }

Fix:
return new io . undertow . server . protocol . http . HttpOpenListener ( getBufferPool ( ) . getValue ( ) , OptionMap . builder ( ) . addAll ( commonOptions ) . addAll ( listenerOptions ) . set ( ENABLE_CONNECTOR_STATISTICS , getUndertowService ( ) . isStatisticsEnabled ( ) ) . getMap ( ) ) ;
Buggy code:
public class Complex implements Serializable , FieldElement < Complex > { public static final Complex I = new Complex ( 0.0 , 1.0 ) ; public static final Complex NaN = new Complex ( Double . NaN , Double . NaN ) ; public static final Complex INF = new Complex ( Double . POSITIVE_INFINITY , Double . POSITIVE_INFINITY ) ; public static final Complex ONE = new Complex ( 1.0 , 0.0 ) ; public static final Complex ZERO = new Complex ( 0.0 , 0.0 ) ; private static final long serialVersionUID = - 6195664516687396620L ; private final double imaginary ; private final double real ; private transient final boolean isNaN ; private transient final boolean isInfinite ; public Complex ( double real ) { } public Complex ( double real , double imaginary ) { } public double abs ( ) { } public Complex add ( Complex addend ) throws NullArgumentException { } public Complex add ( double addend ) { } public Complex conjugate ( ) { } public Complex divide ( Complex divisor ) throws NullArgumentException { } public Complex divide ( double divisor ) { } public Complex reciprocal ( ) { if ( isNaN ) { return Complex . NaN ; } if ( ( ( real ) == 0.0 ) && ( ( imaginary ) == 0.0 ) ) { <START_BUG> return Complex . NaN ; <END_BUG> } if ( isInfinite ) { return Complex . ZERO ; } if ( ( FastMath . abs ( real ) ) < ( FastMath . abs ( imaginary ) ) ) { double q = ( real ) // ( imaginary ) ; double scale = 1.0 // ( ( ( real ) * q ) + ( imaginary ) ) ; return createComplex ( ( scale * q ) , ( - scale ) ) ; } else { double q = ( imaginary ) // ( real ) ; double scale = 1.0 // ( ( ( imaginary ) * q ) + ( real ) ) ; return createComplex ( scale , ( ( - scale ) * q ) ) ; } } @ Override public boolean equals ( Object other ) { } @ Override public int hashCode ( ) { } public double getImaginary ( ) { } public double getReal ( ) { } public boolean isNaN ( ) { } public boolean isInfinite ( ) { } public Complex multiply ( Complex factor ) throws NullArgumentException { } public Complex multiply ( final int factor ) { } public Complex multiply ( double factor ) { } public Complex negate ( ) { } public Complex subtract ( Complex subtrahend ) throws NullArgumentException { } public Complex subtract ( double subtrahend ) { } public Complex acos ( ) { } public Complex asin ( ) { } public Complex atan ( ) { } public Complex cos ( ) { } public Complex cosh ( ) { } public Complex exp ( ) { } public Complex log ( ) { } public Complex pow ( Complex x ) throws NullArgumentException { } public Complex pow ( double x ) { } public Complex sin ( ) { } public Complex sinh ( ) { } public Complex sqrt ( ) { } public Complex sqrt1z ( ) { } public Complex tan ( ) { } public Complex tanh ( ) { } public double getArgument ( ) { } public List < Complex > nthRoot ( int n ) throws NotPositiveException { } protected Complex createComplex ( double realPart , double imaginaryPart ) { } public static Complex valueOf ( double realPart , double imaginaryPart ) { } public static Complex valueOf ( double realPart ) { } protected final Object readResolve ( ) { } public ComplexField getField ( ) { } @ Override public String toString ( ) { } }

Fix:
return Complex . INF ;
Buggy code:
public class ImportWizardLauncher { public ImportWizardLauncher ( ) { } public void launchWizard ( ) { final ImportPluginHandler pluginHandler ; try { pluginHandler = ( ( ImportPluginHandler ) ( pluginManager . getHandler ( "org.columba.addressbook.import" ) ) ) ; } catch ( PluginHandlerNotFoundException ex ) { NotifyDialog d = new NotifyDialog ( ) ; d . showDialog ( ex ) ; return ; } DataModel data = new DataModel ( ) ; data . registerDataLookup ( "Plugin.handler" , new DataLookup ( ) { public Object lookupData ( ) { return pluginHandler ; } } ) ; WizardModel model = new net . javaprog . ui . wizard . DefaultWizardModel ( new Step [ ] { new PluginStep ( data ) , new LocationStep ( data ) } ) ; model . addWizardModelListener ( new AddressbookImporter ( data ) ) ; Wizard wizard = new Wizard ( model , AddressbookResourceLoader . getString ( "dialog" , "addressbookimport" , "title" ) , ImageLoader . getSmallImageIcon ( "stock_convert.png" ) ) ; <START_BUG> wizard . setSize ( 500 , 400 ) ; <END_BUG> wizard . setLocationRelativeTo ( null ) ; wizard . setVisible ( true ) ; } }

Fix:
wizard . pack ( ) ;
Buggy code:
@ SuppressWarnings ( { "unused" , "AutoBoxing" } ) public final class Broadcast { public static final byte broadcastID = ( ( byte ) ( 42 ) ) ; public static final byte broadcastResponseID = ( ( byte ) ( 57 ) ) ; private static final Logger logger = org . slf4j . LoggerFactory . getLogger ( "Broadcast<seq2seq4repair_space>Host<seq2seq4repair_space>Discovery" ) ; public static String getVersion ( ) { <START_BUG> return "1.6" ; <END_BUG> } public static String discoverHost ( int udpPort , int discoverTimeoutMillis ) { } public static InetAddress discoverHostAddress ( int udpPort , int discoverTimeoutMillis ) { } public static List < InetAddress > discoverHosts ( int udpPort , int discoverTimeoutMillis ) { } private static List < InetAddress > discoverHost0 ( int udpPort , int discoverTimeoutMillis , boolean fetchAllServers ) { } private Broadcast ( ) { } }

Fix:
return "1.8" ;
Buggy code:
public class PacketParserUtils { private static final String PROPERTIES_NAMESPACE = "http:////www.jivesoftware.com//xmlns//xmpp//properties" ; public static Packet parseMessage ( XmlPullParser parser ) throws Exception { } public static Presence parsePresence ( XmlPullParser parser ) throws Exception { } public static Map parseProperties ( XmlPullParser parser ) throws Exception { } public static XMPPError parseError ( XmlPullParser parser ) throws Exception { } public static PacketExtension parsePacketExtension ( String elementName , String namespace , XmlPullParser parser ) throws Exception { <START_BUG> Object provider = ProviderManager . getDefault ( ) . getExtensionProvider ( elementName , namespace ) ; <END_BUG> if ( provider != null ) { if ( provider instanceof PacketExtensionProvider ) { return ( ( PacketExtensionProvider ) ( provider ) ) . parseExtension ( parser ) ; } else if ( provider instanceof Class ) { return ( ( PacketExtension ) ( PacketParserUtils . parseWithIntrospection ( elementName , ( ( Class ) ( provider ) ) , parser ) ) ) ; } } DefaultPacketExtension extension = new DefaultPacketExtension ( elementName , namespace ) ; boolean done = false ; while ( ! done ) { int eventType = parser . next ( ) ; if ( eventType == ( XmlPullParser . START_TAG ) ) { String name = parser . getName ( ) ; if ( parser . isEmptyElementTag ( ) ) { extension . setValue ( name , "" ) ; } else { eventType = parser . next ( ) ; if ( eventType == ( XmlPullParser . TEXT ) ) { String value = parser . getText ( ) ; extension . setValue ( name , value ) ; } } } else if ( eventType == ( XmlPullParser . END_TAG ) ) { if ( parser . getName ( ) . equals ( elementName ) ) { done = true ; } } } return extension ; } public static Object parseWithIntrospection ( String elementName , Class objectClass , XmlPullParser parser ) throws Exception { } private static Object decode ( Class type , String value ) throws Exception { } }

Fix:
Object provider = ProviderManager . getExtensionProvider ( elementName , namespace ) ;
Buggy code:
public class MenuItem extends Item { Menu parent ; Menu menu ; int groupHandle ; int accelerator ; public MenuItem ( Menu parent , int style ) { } public MenuItem ( Menu parent , int style , int index ) { } void addAccelerator ( int accelGroup ) { } void addAccelerators ( int accelGroup ) { } public void addArmListener ( ArmListener listener ) { } public void addHelpListener ( HelpListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } void createHandle ( int index ) { } void fixMenus ( Decorations newParent ) { } public int getAccelerator ( ) { } int getAccelGroup ( ) { } public boolean getEnabled ( ) { } public Menu getMenu ( ) { } public Menu getParent ( ) { } public boolean getSelection ( ) { } int gtk_activate ( int widget ) { } int gtk_select ( int item ) { parent . selectedItem = this ; <START_BUG> postEvent ( Arm ) ; <END_BUG> return 0 ; } int gtk_show_help ( int widget , int helpType ) { } void hookEvents ( ) { } public boolean isEnabled ( ) { } void releaseChild ( ) { } void releaseWidget ( ) { } void removeAccelerator ( int accelGroup ) { } void removeAccelerators ( int accelGroup ) { } public void removeArmListener ( ArmListener listener ) { } public void removeHelpListener ( HelpListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } void selectRadio ( ) { } public void setAccelerator ( int accelerator ) { } public void setEnabled ( boolean enabled ) { } public void setImage ( Image image ) { } public void setMenu ( Menu menu ) { } boolean setRadioSelection ( boolean value ) { } public void setSelection ( boolean selected ) { } public void setText ( String string ) { } void updateAccelerator ( int accelGroup , boolean add ) { } }

Fix:
sendEvent ( Arm ) ;