nus-yam/ex-repair huggingface dataset:
Buggy code:
public class XMLErrorReporter implements XMLComponent { public static final short SEVERITY_WARNING = 0 ; public static final short SEVERITY_ERROR = 1 ; public static final short SEVERITY_FATAL_ERROR = 2 ; protected static final String CONTINUE_AFTER_FATAL_ERROR = ( Constants . XERCES_FEATURE_PREFIX ) + ( Constants . CONTINUE_AFTER_FATAL_ERROR_FEATURE ) ; protected static final String ERROR_HANDLER = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . ERROR_HANDLER_PROPERTY ) ; private static final String [ ] RECOGNIZED_FEATURES = new String [ ] { XMLErrorReporter . CONTINUE_AFTER_FATAL_ERROR } ; private static final Boolean [ ] FEATURE_DEFAULTS = new Boolean [ ] { null } ; private static final String [ ] RECOGNIZED_PROPERTIES = new String [ ] { XMLErrorReporter . ERROR_HANDLER } ; private static final Object [ ] PROPERTY_DEFAULTS = new Object [ ] { null } ; protected Locale fLocale ; protected Hashtable fMessageFormatters ; protected XMLErrorHandler fErrorHandler ; protected XMLLocator fLocator ; protected boolean fContinueAfterFatalError ; protected XMLErrorHandler fDefaultErrorHandler ; private ErrorHandler fSaxProxy = null ; public XMLErrorReporter ( ) { } public void setLocale ( Locale locale ) { } public Locale getLocale ( ) { } public void setDocumentLocator ( XMLLocator locator ) { } public void putMessageFormatter ( String domain , MessageFormatter messageFormatter ) { } public MessageFormatter getMessageFormatter ( String domain ) { } public MessageFormatter removeMessageFormatter ( String domain ) { } public void reportError ( String domain , String key , Object [ ] arguments , short severity ) throws XNIException { } public void reportError ( String domain , String key , Object [ ] arguments , short severity , Exception exception ) throws XNIException { } public void reportError ( XMLLocator location , String domain , String key , Object [ ] arguments , short severity ) throws XNIException { <START_BUG> reportError ( fLocator , domain , key , arguments , severity , null ) ; <END_BUG> } public void reportError ( XMLLocator location , String domain , String key , Object [ ] arguments , short severity , Exception exception ) throws XNIException { } public void reset ( XMLComponentManager componentManager ) throws XNIException { } public String [ ] getRecognizedFeatures ( ) { } public void setFeature ( String featureId , boolean state ) throws XMLConfigurationException { } public boolean getFeature ( String featureId ) throws XMLConfigurationException { } public String [ ] getRecognizedProperties ( ) { } public void setProperty ( String propertyId , Object value ) throws XMLConfigurationException { } public Boolean getFeatureDefault ( String featureId ) { } public Object getPropertyDefault ( String propertyId ) { } public XMLErrorHandler getErrorHandler ( ) { } public ErrorHandler getSAXErrorHandler ( ) { } }

Fix:
reportError ( location , domain , key , arguments , severity , null ) ;
Buggy code:
public class TestApplication extends Application { private String title = "Test<seq2seq4repair_space>Application" ; private Stage stage ; private Scene mainScene ; public static void main ( String [ ] args ) throws InterruptedException { } @ Override public void start ( final Stage initStage ) throws Exception { this . stage = initStage ; this . stage . setTitle ( title ) ; List < String > items = Arrays . asList ( "foo" , "bar" , "baz" , "meh" ) ; GridPane root = new GridPane ( ) ; <START_BUG> ListViewWithSearchPanel < String > tester = new ListViewWithSearchPanel ( FXCollections . observableArrayList ( items ) , null , "TestList" ) ; <END_BUG> root . add ( tester , 0 , 0 ) ; this . mainScene = new Scene ( root , 1440 , 900 , Color . LIGHTSLATEGREY ) ; this . stage . setScene ( this . mainScene ) ; this . stage . show ( ) ; } }

Fix:
ListViewWithSearchPanel < String > tester = new ListViewWithSearchPanel ( FXCollections . observableArrayList ( items ) , "TestList" , null ) ;
Buggy code:
public class DefaultUserDestinationResolverTests { public static final String SESSION_ID = "123" ; private DefaultUserDestinationResolver resolver ; private UserSessionRegistry registry ; private TestPrincipal user ; @ Before public void setup ( ) { } @ Test public void handleSubscribe ( ) { } @ Test public void handleSubscribeOneUserMultipleSessions ( ) { } @ Test public void handleUnsubscribe ( ) { } @ Test public void handleMessage ( ) { } @ Test public void handleMessageEncodedUserName ( ) { String userName = "http:////joe.openid.example.org//" ; this . registry . registerSessionId ( userName , "openid123" ) ; String destination = ( "//user//" + ( StringUtils . replace ( userName , "//" , "%2F" ) ) ) + "//queue//foo" ; <START_BUG> Message < ? > message = createMessage ( MESSAGE , this . user , DefaultUserDestinationResolverTests . SESSION_ID , destination ) ; <END_BUG> UserDestinationResult actual = this . resolver . resolveDestination ( message ) ; assertEquals ( 1 , actual . getTargetDestinations ( ) . size ( ) ) ; assertEquals ( "//queue//foo-useropenid123" , actual . getTargetDestinations ( ) . iterator ( ) . next ( ) ) ; } @ Test public void ignoreMessage ( ) { } private Message < ? > createMessage ( SimpMessageType messageType , TestPrincipal user , String sessionId , String destination ) { } }

Fix:
Message < ? > message = createMessage ( MESSAGE , this . user , null , destination ) ;
Buggy code:
public class IntMap { public static final IntMap EMPTY = new IntMap ( 0 ) { public boolean directlyInAdvice ( ) { } public ShadowMunger getEnclosingAdvice ( ) { } } ; private ResolvedTypeX concreteAspect ; private ShadowMunger enclosingAdvice ; private List enclosingDefinition = new ArrayList ( ) ; public void pushEnclosingDefinition ( ResolvedPointcutDefinition def ) { } public void popEnclosingDefinitition ( ) { } public ResolvedPointcutDefinition peekEnclosingDefinitition ( ) { } public boolean directlyInAdvice ( ) { } public ShadowMunger getEnclosingAdvice ( ) { } public void setEnclosingAdvice ( ShadowMunger advice ) { } public Member getAdviceSignature ( ) { if ( ( enclosingAdvice ) instanceof Advice ) <START_BUG> return ( ( Advice ) ( enclosingAdvice ) ) . signature ; <END_BUG> else return null ; } public ResolvedTypeX getConcreteAspect ( ) { } public void setConcreteAspect ( ResolvedTypeX concreteAspect ) { } public void copyContext ( IntMap bindings ) { } private static final int MISSING = - 1 ; private int [ ] map ; private IntMap ( int [ ] map ) { } public IntMap ( ) { } public IntMap ( int initialCapacity ) { } public void put ( int key , int val ) { } public int get ( int key ) { } public boolean hasKey ( int key ) { } public static IntMap idMap ( int size ) { } public String toString ( ) { } }

Fix:
return ( ( Advice ) ( enclosingAdvice ) ) . getSignature ( ) ;
Buggy code:
public class MethodLocator extends PatternLocator { protected MethodPattern pattern ; protected boolean isDeclarationOfReferencedMethodsPattern ; public MethodLocator ( MethodPattern pattern ) { } protected boolean isVirtualInvoke ( MethodBinding method , MessageSend messageSend ) { } public int match ( MethodDeclaration node , MatchingNodeSet nodeSet ) { } public int match ( MessageSend node , MatchingNodeSet nodeSet ) { } protected int matchContainer ( ) { } protected int matchMethod ( MethodBinding method ) { } protected void matchReportReference ( AstNode reference , IJavaElement element , int accuracy , MatchLocator locator ) throws CoreException { if ( this . isDeclarationOfReferencedMethodsPattern ) { if ( accuracy != ( IJavaSearchResultCollector . EXACT_MATCH ) ) return ; DeclarationOfReferencedMethodsPattern declPattern = ( ( DeclarationOfReferencedMethodsPattern ) ( this . pattern ) ) ; while ( ( element != null ) && ( ! ( declPattern . enclosingElement . equals ( element ) ) ) ) element = element . getParent ( ) ; if ( element != null ) reportDeclaration ( ( ( MessageSend ) ( reference ) ) . binding , locator , declPattern . knownMethods ) ; } else if ( ( this . pattern . findReferences ) && ( reference instanceof MessageSend ) ) { <START_BUG> locator . report ( ( ( int ) ( ( ( ( MessageSend ) ( reference ) ) . nameSourcePosition ) > > 32 ) ) , reference . sourceEnd , element , accuracy ) ; <END_BUG> } else { super . matchReportReference ( reference , element , accuracy , locator ) ; } } protected void reportDeclaration ( MethodBinding methodBinding , MatchLocator locator , SimpleSet knownMethods ) throws CoreException { } public int resolveLevel ( AstNode possibleMatchingNode ) { } public int resolveLevel ( Binding binding ) { } protected int resolveLevel ( MessageSend messageSend ) { } protected int resolveLevelAsSubtype ( char [ ] qualifiedPattern , ReferenceBinding type ) { } public String toString ( ) { } }

Fix:
locator . report ( ( ( int ) ( ( ( ( MessageSend ) ( reference ) ) . nameSourcePosition ) > > > 32 ) ) , reference . sourceEnd , element , accuracy ) ;
Buggy code:
public final class ASHelper { public static final String CONTAINER_NAME = "org.jboss.wsf.spi.invocation.ContainerName" ; private static final Logger LOGGER = Logger . getLogger ( ASHelper . class ) ; public static final DotName WEB_SERVICE_ANNOTATION = DotName . createSimple ( WebService . class . getName ( ) ) ; public static final DotName WEB_SERVICE_PROVIDER_ANNOTATION = DotName . createSimple ( WebServiceProvider . class . getName ( ) ) ; private static final String SERVLET_CLASS_NAME = Servlet . class . getName ( ) ; private ASHelper ( ) { } public static boolean isWebServiceDeployment ( final DeploymentUnit unit ) { <START_BUG> return ( ASHelper . getOptionalAttachment ( unit , DEPLOYMENT_TYPE_KEY ) ) != null ; <END_BUG> } public static List < ServletMetaData > getJaxwsServlets ( final DeploymentUnit unit ) { } public static List < ServletMetaData > getJaxrpcServlets ( final DeploymentUnit unit ) { } public static List < WebServiceDeclaration > getJaxwsEjbs ( final DeploymentUnit unit ) { } public static String getEndpointName ( final ServletMetaData servletMD ) { } public static ServletMetaData getServletForName ( final JBossWebMetaData jbossWebMD , final String servletName ) { } public static < A > A getRequiredAttachment ( final DeploymentUnit unit , final AttachmentKey < A > key ) { } public static < A > A getOptionalAttachment ( final DeploymentUnit unit , final AttachmentKey < A > key ) { } public static boolean hasAttachment ( final DeploymentUnit unit , final AttachmentKey < ? > key ) { } public static WebserviceDescriptionMetaData getWebserviceDescriptionMetaData ( final WebserviceDescriptionsMetaData wsDescriptionsMD ) { } private static List < ServletMetaData > getWebServiceServlets ( final DeploymentUnit unit , final boolean jaxws ) { } private static < T extends ServletMetaData > List < ServletMetaData > selectWebServiceServlets ( final DeploymentUnit unit , final Collection < T > smd , final boolean jaxws ) { } private static boolean isWebserviceEndpoint ( final ServletMetaData servletMD , final CompositeIndex index , boolean jaxws ) { } private static boolean isWebserviceEndpoint ( final ServletMetaData servletMD , final ClassLoader loader , boolean jaxws ) { } private static Class < ? > getEndpointClass ( final String endpointClassName , final ClassLoader loader ) { } private static boolean isJSP ( final String endpointClassName ) { } protected static boolean isServlet ( final ClassInfo info , CompositeIndex index ) { } private static boolean isServlet ( final ClassInfo info , CompositeIndex index , Set < DotName > interfaces ) { } private static boolean extendsServlet ( DotName current , CompositeIndex index , Set < DotName > interfacesToProcess , Set < DotName > processedInterfaces ) { } public static JBossWebMetaData getJBossWebMetaData ( final DeploymentUnit unit ) { } public static List < AnnotationInstance > getAnnotations ( final DeploymentUnit unit , final DotName annotation ) { } }

Fix:
return ( ASHelper . getOptionalAttachment ( unit , DEPLOYMENT_KEY ) ) != null ;
Buggy code:
public final class CompositeOperationHandler implements OperationStepHandler { @ Deprecated public static final OperationContext . AttachmentKey < Boolean > DOMAIN_EXECUTION_KEY = AttachmentKey . create ( Boolean . class ) ; public static final CompositeOperationHandler INSTANCE = new CompositeOperationHandler ( ) ; public static final String NAME = ModelDescriptionConstants . COMPOSITE ; private static final AttributeDefinition STEPS = new PrimitiveListAttributeDefinition . Builder ( ModelDescriptionConstants . STEPS , org . jboss . dmr . ModelType . OBJECT ) . build ( ) ; public static final OperationDefinition DEFINITION = new CompositeOperationHandler . WFLY1316HackOperationDefinitionBuilder ( CompositeOperationHandler . NAME , org . jboss . as . controller . descriptions . common . ControllerResolver . getResolver ( "root" ) ) . addParameter ( CompositeOperationHandler . STEPS ) . setReplyType ( ModelType . OBJECT ) . setPrivateEntry ( ) . build ( ) ; private CompositeOperationHandler ( ) { } public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { } private static class WFLY1316HackOperationDefinitionBuilder extends SimpleOperationDefinitionBuilder { public WFLY1316HackOperationDefinitionBuilder ( String name , ResourceDescriptionResolver resolver ) { } @ Override protected SimpleOperationDefinition internalBuild ( final ResourceDescriptionResolver resolver , final ResourceDescriptionResolver attributeResolver ) { if ( ( entryType ) != ( EntryType . PRIVATE ) ) { return super . internalBuild ( resolver , attributeResolver ) ; } return new SimpleOperationDefinition ( name , resolver , attributeResolver , entryType , flags , replyType , replyValueType , replyAllowNull , deprecationData , replyParameters , parameters ) { @ Override public DescriptionProvider getDescriptionProvider ( ) { return new DescriptionProvider ( ) { @ Override public ModelNode getModelDescription ( Locale locale ) { <START_BUG> return new org . jboss . as . controller . descriptions . DefaultOperationDescriptionProvider ( getName ( ) , resolver , attributeResolver , replyType , replyValueType , deprecationData , replyParameters , parameters ) . getModelDescription ( locale ) ; <END_BUG> } } ; } } ; } } }

Fix:
return new org . jboss . as . controller . descriptions . DefaultOperationDescriptionProvider ( getName ( ) , resolver , attributeResolver , replyType , replyValueType , replyAllowNull , deprecationData , replyParameters , parameters , accessConstraints ) . getModelDescription ( locale ) ;
Buggy code:
public class TestMultiMMap extends LuceneTestCase { File workDir ; @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; <START_BUG> workDir = new File ( TEMP_DIR , "TestMultiMMap" ) ; <END_BUG> workDir . mkdirs ( ) ; } public void testRandomChunkSizes ( ) throws Exception { } private void assertChunking ( Random random , int chunkSize ) throws Exception { } }

Fix:
workDir = _TestUtil . getTempDir ( "TestMultiMMap" ) ;
Buggy code:
public class TypeParameter extends ASTNode { public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor ( TypeParameter . class , "name" , SimpleName . class , ASTNode . MANDATORY , ASTNode . NO_CYCLE_RISK ) ; public static final ChildListPropertyDescriptor TYPE_BOUNDS_PROPERTY = new ChildListPropertyDescriptor ( TypeParameter . class , "typeBounds" , Type . class , ASTNode . NO_CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private SimpleName typeVariableName = null ; private ASTNode . NodeList typeBounds = new ASTNode . NodeList ( TypeParameter . TYPE_BOUNDS_PROPERTY ) ; TypeParameter ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final List internalGetChildListProperty ( ChildListPropertyDescriptor property ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public SimpleName getName ( ) { } <START_BUG> public final IBinding resolveBinding ( ) { <END_BUG> return this . ast . getBindingResolver ( ) . resolveTypeParameter ( this ) ; } public void setName ( SimpleName typeName ) { } public List typeBounds ( ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
public final ITypeBinding resolveBinding ( ) {
Buggy code:
public class JBossWebParsingDeploymentProcessor implements DeploymentUnitProcessor { private static final String JBOSS_WEB_XML = "WEB-INF//jboss-web.xml" ; @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; if ( ! ( DeploymentTypeMarker . isType ( WAR , deploymentUnit ) ) ) { return ; } final VirtualFile deploymentRoot = deploymentUnit . getAttachment ( DEPLOYMENT_ROOT ) . getRoot ( ) ; final VirtualFile jbossWebXml = deploymentRoot . getChild ( JBossWebParsingDeploymentProcessor . JBOSS_WEB_XML ) ; WarMetaData warMetaData = deploymentUnit . getAttachment ( ATTACHMENT_KEY ) ; assert warMetaData != null ; if ( jbossWebXml . exists ( ) ) { InputStream is = null ; try { is = jbossWebXml . openStream ( ) ; final XMLInputFactory inputFactory = XMLInputFactory . newInstance ( ) ; inputFactory . setXMLResolver ( NoopXMLResolver . create ( ) ) ; XMLStreamReader xmlReader = inputFactory . createXMLStreamReader ( is ) ; warMetaData . setJbossWebMetaData ( JBossWebMetaDataParser . parse ( xmlReader ) ) ; } catch ( XMLStreamException e ) { <START_BUG> throw new DeploymentUnitProcessingException ( WebMessages . MESSAGES . failToParseXMLDescriptor ( jbossWebXml , e . getLocation ( ) . getLineNumber ( ) , e . getLocation ( ) . getColumnNumber ( ) ) ) ; <END_BUG> } catch ( IOException e ) { throw new DeploymentUnitProcessingException ( WebMessages . MESSAGES . failToParseXMLDescriptor ( jbossWebXml ) , e ) ; } finally { try { if ( is != null ) { is . close ( ) ; } } catch ( IOException e ) { } } } } @ Override public void undeploy ( DeploymentUnit context ) { } }

Fix:
throw new DeploymentUnitProcessingException ( WebMessages . MESSAGES . failToParseXMLDescriptor ( jbossWebXml , e . getLocation ( ) . getLineNumber ( ) , e . getLocation ( ) . getColumnNumber ( ) ) , e ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class ResourceRefTestCase { @ Deployment public static Archive < ? > deployment ( ) { WebArchive war = ShrinkWrap . create ( WebArchive . class , "multiple-bindings-superclass.war" ) ; <START_BUG> war . addAsWebResource ( ResourceRefTestCase . getWebXml ( ) , "web.xml" ) ; <END_BUG> war . addPackage ( ResourceRefTestCase . class . getPackage ( ) ) ; return war ; } @ Test public void testCorrectBinding ( ) throws NamingException { } @ Test public void testInjection ( ) throws NamingException { } private static StringAsset getWebXml ( ) { } }

Fix:
war . addAsWebInfResource ( ResourceRefTestCase . getWebXml ( ) , "web.xml" ) ;
Buggy code:
@ JsonIgnoreProperties ( { "pattern" } ) public class Filter { private static Logger log = Log . getLogger ( ) ; private String name ; private String attribute ; private String value ; private Pattern namePattern ; private Pattern valuePattern ; public Filter ( ) { } public Filter ( String name , String attribute , String value ) { } public String getName ( ) { } public void setName ( String name ) { } public String getAttribute ( ) { } public void setAttribute ( String attribute ) { } public void setValue ( String value ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } public boolean matches ( Event event ) { if ( ! ( namePattern . matcher ( event . getEventName ( ) ) . matches ( ) ) ) { Filter . log . trace ( "name<seq2seq4repair_space>doesn't<seq2seq4repair_space>match" ) ; return false ; } Object value = event . get ( attribute ) ; if ( value == null ) { Filter . log . trace ( ( "value<seq2seq4repair_space>is<seq2seq4repair_space>null<seq2seq4repair_space>for<seq2seq4repair_space>" + ( attribute ) ) ) ; return false ; } <START_BUG> return valuePattern . matcher ( ( ( String ) ( value ) ) ) . matches ( ) ; <END_BUG> } @ Override public String toString ( ) { } public void wellFormedCheck ( ) { } }

Fix:
return valuePattern . matcher ( String . valueOf ( value ) ) . matches ( ) ;
Buggy code:
public class CCMReconfigure extends Continuus { private String project = null ; private boolean recurse = false ; private boolean verbose = false ; public CCMReconfigure ( ) { } public void execute ( ) throws BuildException { Commandline commandLine = new Commandline ( ) ; Project aProj = getProject ( ) ; int result = 0 ; commandLine . setExecutable ( getCcmCommand ( ) ) ; commandLine . createArgument ( ) . setValue ( getCcmAction ( ) ) ; checkOptions ( commandLine ) ; result = run ( commandLine ) ; if ( result != 0 ) { String msg = "Failed<seq2seq4repair_space>executing:<seq2seq4repair_space>" + ( commandLine . toString ( ) ) ; <START_BUG> throw new BuildException ( msg , location ) ; <END_BUG> } } private void checkOptions ( Commandline cmd ) { } public String getCcmProject ( ) { } public void setCcmProject ( String v ) { } public boolean isRecurse ( ) { } public void setRecurse ( boolean v ) { } public boolean isVerbose ( ) { } public void setVerbose ( boolean v ) { } public static final String FLAG_RECURSE = "//recurse" ; public static final String FLAG_VERBOSE = "//verbose" ; public static final String FLAG_PROJECT = "//project" ; }

Fix:
throw new BuildException ( msg , getLocation ( ) ) ;
Buggy code:
public class TestIndexSplitter extends LuceneTestCase { public void test ( ) throws Exception { File dir = createTempDir ( LuceneTestCase . getTestClass ( ) . getSimpleName ( ) ) ; File destDir = createTempDir ( LuceneTestCase . getTestClass ( ) . getSimpleName ( ) ) ; Directory fsDir = newFSDirectory ( dir ) ; if ( fsDir instanceof MockDirectoryWrapper ) { ( ( MockDirectoryWrapper ) ( fsDir ) ) . setAssertNoUnrefencedFilesOnClose ( false ) ; } MergePolicy mergePolicy = new LogByteSizeMergePolicy ( ) ; mergePolicy . setNoCFSRatio ( 1.0 ) ; mergePolicy . setMaxCFSSegmentSizeMB ( Double . POSITIVE_INFINITY ) ; IndexWriter iw = new IndexWriter ( fsDir , new IndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) . setOpenMode ( CREATE ) . setMergePolicy ( mergePolicy ) ) ; for ( int x = 0 ; x < 100 ; x ++ ) { Document doc = DocHelper . createDocument ( x , "index" , 5 ) ; iw . addDocument ( doc ) ; } iw . commit ( ) ; for ( int x = 100 ; x < 150 ; x ++ ) { Document doc = DocHelper . createDocument ( x , "index2" , 5 ) ; iw . addDocument ( doc ) ; } iw . commit ( ) ; for ( int x = 150 ; x < 200 ; x ++ ) { Document doc = DocHelper . createDocument ( x , "index3" , 5 ) ; iw . addDocument ( doc ) ; } iw . commit ( ) ; DirectoryReader iwReader = iw . getReader ( ) ; assertEquals ( 3 , iwReader . leaves ( ) . size ( ) ) ; iwReader . close ( ) ; <START_BUG> iw . close ( ) ; <END_BUG> IndexSplitter is = new IndexSplitter ( dir ) ; String splitSegName = is . infos . info ( 1 ) . info . name ; is . split ( destDir , new String [ ] { splitSegName } ) ; Directory fsDirDest = newFSDirectory ( destDir ) ; DirectoryReader r = DirectoryReader . open ( fsDirDest ) ; assertEquals ( 50 , r . maxDoc ( ) ) ; r . close ( ) ; fsDirDest . close ( ) ; File destDir2 = createTempDir ( LuceneTestCase . getTestClass ( ) . getSimpleName ( ) ) ; IndexSplitter . main ( new String [ ] { dir . getAbsolutePath ( ) , destDir2 . getAbsolutePath ( ) , splitSegName } ) ; assertEquals ( 5 , destDir2 . listFiles ( ) . length ) ; Directory fsDirDest2 = newFSDirectory ( destDir2 ) ; r = DirectoryReader . open ( fsDirDest2 ) ; assertEquals ( 50 , r . maxDoc ( ) ) ; r . close ( ) ; fsDirDest2 . close ( ) ; IndexSplitter . main ( new String [ ] { dir . getAbsolutePath ( ) , "-d" , splitSegName } ) ; r = DirectoryReader . open ( fsDir ) ; assertEquals ( 2 , r . leaves ( ) . size ( ) ) ; r . close ( ) ; fsDir . close ( ) ; } }

Fix:
iw . shutdown ( ) ;
Buggy code:
public class StatusClient extends AbstractRestClient { private static LoadingCache < String , StatusClient > cache = CacheBuilder . newBuilder ( ) . maximumSize ( 20 ) . expireAfterAccess ( 30 , TimeUnit . MINUTES ) . build ( new jersey . repackaged . com . google . common . cache . CacheLoader < String , StatusClient > ( ) { @ Override public StatusClient load ( String url ) throws Exception { } } ) ; protected StatusClient ( String url ) { } public static StatusClient getClient ( String url ) throws ExecutionException { } public GroupServerStatus getGroupServerStatus ( Long groupId , Long slbId , String sip ) throws Exception { } public GroupStatus getGroupStatus ( Long groupId , Long slbId ) throws Exception { <START_BUG> String responseStr = getTarget ( ) . path ( "//api//status//group" ) . queryParam ( "groupId" , groupId ) . queryParam ( "slbId" , slbId ) . request ( APPLICATION_JSON ) . headers ( getDefaultHeaders ( ) ) . get ( String . class ) ; <END_BUG> return DefaultJsonParser . parse ( GroupStatus . class , responseStr ) ; } }

Fix:
String responseStr = getTarget ( ) . path ( ( ( ( "//api//status//group//" + groupId ) + "//slb//" ) + slbId ) ) . request ( APPLICATION_JSON ) . headers ( getDefaultHeaders ( ) ) . get ( String . class ) ;
Buggy code:
public interface UndeployDeploymentPlanBuilder extends DeploymentPlanBuilder { ServerGroupDeploymentPlanBuilder toServerGroup ( String serverGroupName ) { } <START_BUG> DeploymentPlanBuilder andRemoveUndeployed ( ) ; <END_BUG> }

Fix:
RemoveDeploymentPlanBuilder andRemoveUndeployed ( ) ;
Buggy code:
public class DefaultDeviceService implements DeviceService { private final DeviceRepository deviceRepository ; private final IdGenerator < Device > deviceIdGenerator ; private final EventsService eventsService ; private final Clock clock ; public DefaultDeviceService ( DeviceRepository deviceRepository , IdGenerator < Device > deviceIdGenerator , EventsService eventsService , Clock clock ) { } @ Override public Device get ( String deviceId ) { } @ Override public Device getByUidAndUserId ( String deviceUid , String userId , String domain ) { } @ Override public List < Device > getByUserId ( String userId ) { } @ Override public Device update ( Device device ) { } @ Override public void deleteByUidAndUserId ( String deviceUid , String userId , String domainId ) { String deviceId = UserDomainIdGenerator . generateDeviceId ( domainId , userId , deviceUid ) ; long result = deviceRepository . deleteById ( deviceId ) ; if ( result > 0 ) { <START_BUG> eventsService . sendDeviceDeleteEvent ( deviceId , userId , domainId ) ; <END_BUG> } } @ Override public List < Device > deleteByUserId ( User user ) { } }

Fix:
eventsService . sendDeviceDeleteEvent ( deviceUid , userId , domainId ) ;
Buggy code:
public class TestFieldMaskingSpanQuery extends LuceneTestCase { protected static Document doc ( Field [ ] fields ) { } protected Field field ( String name , String value ) { } protected IndexSearcher searcher ; protected Directory directory ; protected IndexReader reader ; @ Override public void setUp ( ) throws Exception { } @ Override public void tearDown ( ) throws Exception { } protected void check ( SpanQuery q , int [ ] docs ) throws Exception { <START_BUG> CheckHits . checkHitCollector ( q , null , searcher , docs ) ; <END_BUG> } public void testRewrite0 ( ) throws Exception { } public void testRewrite1 ( ) throws Exception { } public void testRewrite2 ( ) throws Exception { } public void testEquality1 ( ) { } public void testNoop0 ( ) throws Exception { } public void testNoop1 ( ) throws Exception { } public void testSimple1 ( ) throws Exception { } public void testSimple2 ( ) throws Exception { } public void testSpans0 ( ) throws Exception { } public void testSpans1 ( ) throws Exception { } public void testSpans2 ( ) throws Exception { } public String s ( Spans span ) { } public String s ( int doc , int start , int end ) { } }

Fix:
CheckHits . checkHitCollector ( random , q , null , searcher , docs ) ;
Buggy code:
public abstract class AbstractAjaxBehavior extends AbstractBehavior implements IBehaviorListener , IHeaderContributor { private Component component ; public AbstractAjaxBehavior ( ) { } public final void bind ( final Component hostComponent ) { } public CharSequence getCallbackUrl ( ) { } public final CharSequence getCallbackUrl ( final boolean onlyTargetActivePage ) { if ( ( getComponent ( ) ) == null ) { throw new IllegalArgumentException ( "Behavior<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>bound<seq2seq4repair_space>to<seq2seq4repair_space>a<seq2seq4repair_space>component<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>the<seq2seq4repair_space>URL" ) ; } final RequestListenerInterface rli ; rli = IBehaviorListener . INTERFACE ; AppendingStringBuffer url = new AppendingStringBuffer ( getComponent ( ) . urlFor ( this , rli ) ) ; if ( onlyTargetActivePage ) { <START_BUG> url . append ( "&" ) . append ( IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME ) . append ( "=true" ) ; <END_BUG> } return url ; } public final void onComponentTag ( final Component component , final ComponentTag tag ) { } public final void onRendered ( final Component hostComponent ) { } public void renderHead ( final IHeaderResponse response ) { } protected final Component getComponent ( ) { } protected void onComponentTag ( final ComponentTag tag ) { } protected void onBind ( ) { } protected void onComponentRendered ( ) { } public boolean getStatelessHint ( Component component ) { } protected final String getImplementationId ( ) { } protected final void onRenderHeadContribution ( final Response response ) { } protected final void onRenderHeadInitContribution ( final Response response ) { } }

Fix:
url . append ( "&amp;" ) . append ( IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME ) . append ( "=true" ) ;
Buggy code:
public class OLEExample { OleClientSite clientSite ; OleFrame oleFrame ; Button closeButton ; public static void main ( String [ ] args ) { } void addFileMenu ( OleFrame frame ) { } void disposeClient ( ) { } void fileOpen ( ) { } void newClientSite ( String progID ) { disposeClient ( ) ; try { clientSite = new OleClientSite ( oleFrame , SWT . NONE , progID ) ; } catch ( SWTException error ) { } if ( ( clientSite ) != null ) <START_BUG> clientSite . doVerb ( OLEIVERB_SHOW ) ; <END_BUG> } public void open ( Display display ) { } }

Fix:
clientSite . doVerb ( OLEIVERB_INPLACEACTIVATE ) ;
Buggy code:
public class ManagePanel extends JPanel { public ManagePanel ( PluginManager window ) { } public void update ( ) { pluginModel . update ( ) ; } private JTable table ; private ManagePanel . PluginTableModel pluginModel ; private JButton remove ; private JButton help ; private PluginManager window ; class ActionHandler implements ActionListener { public void actionPerformed ( ActionEvent evt ) { } } class Entry { static final String ERROR = "error" ; static final String LOADED = "loaded" ; String clazz ; String name ; String version ; String author ; String status ; String docs ; Vector jars ; boolean broken ; Entry ( String path , String clazz , boolean broken ) { } public String toString ( ) { } } class PluginTableModel extends AbstractTableModel { private ArrayList entries ; private int sortType = ManagePanel . EntryCompare . STATUS ; public PluginTableModel ( ) { } public int getColumnCount ( ) { } public String getColumnName ( int column ) { } public ManagePanel . Entry getEntry ( int rowIndex ) { } public int getRowCount ( ) { } public Object getValueAt ( int rowIndex , int columnIndex ) { } public void setSortType ( int type ) { } public void sort ( int type ) { } public void update ( ) { EditPlugin [ ] plugins = jEdit . getPlugins ( ) ; entries = new ArrayList ( ) ; for ( int i = 0 ; i < ( plugins . length ) ; i ++ ) { EditPlugin plugin = plugins [ i ] ; <START_BUG> String path = plugin . getJAR ( ) . getPath ( ) ; <END_BUG> if ( ! ( new File ( path ) . exists ( ) ) ) { continue ; } if ( plugin instanceof EditPlugin . Broken ) entries . add ( new ManagePanel . Entry ( path , plugin . getClassName ( ) , true ) ) ; else entries . add ( new ManagePanel . Entry ( path , plugin . getClassName ( ) , false ) ) ; } String [ ] newPlugins = jEdit . getNotLoadedPluginJARs ( ) ; for ( int i = 0 ; i < ( newPlugins . length ) ; i ++ ) { entries . add ( new ManagePanel . Entry ( newPlugins [ i ] , null , true ) ) ; } sort ( sortType ) ; fireTableChanged ( new TableModelEvent ( this ) ) ; } } class TextRenderer extends DefaultTableCellRenderer { private DefaultTableCellRenderer tcr ; public TextRenderer ( DefaultTableCellRenderer tcr ) { } public Component getTableCellRendererComponent ( JTable table , Object value , boolean isSelected , boolean hasFocus , int row , int column ) { } } class RemoveButton extends JButton implements ActionListener , ListSelectionListener { public RemoveButton ( ) { } public void actionPerformed ( ActionEvent evt ) { } public void valueChanged ( ListSelectionEvent e ) { } } class HelpButton extends JButton implements ActionListener , ListSelectionListener { private URL docURL ; public HelpButton ( ) { } public void actionPerformed ( ActionEvent evt ) { } public void valueChanged ( ListSelectionEvent e ) { } } static class EntryCompare implements Comparator { public static final int NAME = 0 ; public static final int STATUS = 1 ; private int type ; public EntryCompare ( int type ) { } public int compare ( Object o1 , Object o2 ) { } } class HeaderMouseHandler extends MouseAdapter { public void mouseClicked ( MouseEvent evt ) { } } }

Fix:
String path = plugin . getPluginJAR ( ) . getPath ( ) ;
Buggy code:
public class ApplyRemoteMasterDomainModelHandler implements OperationStepHandler , DescriptionProvider { public static final String OPERATION_NAME = "apply-remote-domain-model" ; private final Set < String > appliedExensions = new HashSet < String > ( ) ; private final FileRepository fileRepository ; private final ExtensionContext extensionContext ; private final LocalHostControllerInfo localHostInfo ; public ApplyRemoteMasterDomainModelHandler ( final ExtensionContext extensionContext , final FileRepository fileRepository , final LocalHostControllerInfo localHostInfo ) { } public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } private Map < String , ProxyController > getServerProxies ( OperationContext context ) { } protected void initializeExtension ( String module ) { try { for ( final Extension extension : Module . loadServiceFromCallerModuleLoader ( ModuleIdentifier . fromString ( module ) , Extension . class ) ) { ClassLoader oldTccl = SecurityActions . setThreadContextClassLoader ( extension . getClass ( ) ) ; try { <START_BUG> extension . initialize ( extensionContext . createWrapper ( module ) ) ; <END_BUG> } finally { SecurityActions . setThreadContextClassLoader ( oldTccl ) ; } } } catch ( ModuleLoadException e ) { throw new RuntimeException ( e ) ; } } private void clearDomain ( final Resource rootResource ) { } private Resource getResource ( PathAddress resourceAddress , Resource rootResource , OperationContext context ) { } private Collection < ServerIdentity > getServersAffectedByPath ( final String pathName , final ModelNode hostModel , final boolean forDomain ) { } private Collection < ServerIdentity > getServerAffectedBySystemProperty ( final String propName , final boolean isDomain , final ModelNode domain , final String affectedGroup , final ModelNode host ) { } private boolean hasSystemProperty ( final ModelNode resource , final String propName ) { } private Collection < ServerIdentity > getServerAffectedByProfile ( final String profileName , final ModelNode domain , final ModelNode host , final Map < String , ProxyController > serverProxies ) { } private Collection < ServerIdentity > getServersAffectedByInterface ( final String interfaceName , final ModelNode hostModel , final boolean forDomain ) { } private Collection < ServerIdentity > getServersAffectedBySocketBindingGroup ( final String bindingGroupName , final ModelNode domain , final ModelNode host , final Map < String , ProxyController > serverProxies ) { } private Set < String > getOurServerGroups ( OperationContext context ) { } public ModelNode getModelDescription ( Locale locale ) { } }

Fix:
extension . initialize ( extensionContext . createTracking ( module ) ) ;
Buggy code:
public class CategoryDocumentBuilder { protected final TaxonomyWriter taxonomyWriter ; protected final FacetIndexingParams indexingParams ; protected final ArrayList < Field > fieldList = new ArrayList < Field > ( ) ; protected Map < String , List < CategoryAttribute > > categoriesMap ; public CategoryDocumentBuilder ( TaxonomyWriter taxonomyWriter ) throws IOException { } public CategoryDocumentBuilder ( TaxonomyWriter taxonomyWriter , FacetIndexingParams params ) throws IOException { } public CategoryDocumentBuilder setCategoryPaths ( Iterable < CategoryPath > categoryPaths ) throws IOException { } public CategoryDocumentBuilder setCategories ( Iterable < CategoryAttribute > categories ) throws IOException { fieldList . clear ( ) ; if ( categories == null ) { return this ; } fillCategoriesMap ( categories ) ; for ( Map . Entry < String , List < CategoryAttribute > > e : categoriesMap . entrySet ( ) ) { CategoryAttributesStream categoryAttributesStream = new CategoryAttributesStream ( e . getValue ( ) ) ; CategoryParentsStream parentsStream = ( ( CategoryParentsStream ) ( getParentsStream ( categoryAttributesStream ) ) ) ; CategoryListTokenizer categoryListTokenizer = getCategoryListTokenizer ( parentsStream ) ; CategoryTokenizer stream = getCategoryTokenizer ( categoryListTokenizer ) ; <START_BUG> FieldType ft = new FieldType ( TextField . TYPE_UNSTORED ) ; <END_BUG> ft . setOmitNorms ( true ) ; fieldList . add ( new Field ( e . getKey ( ) , stream , ft ) ) ; } return this ; } protected TokenStream getParentsStream ( CategoryAttributesStream categoryAttributesStream ) { } protected void fillCategoriesMap ( Iterable < CategoryAttribute > categories ) throws IOException { } protected CategoryListTokenizer getCategoryListTokenizer ( TokenStream categoryStream ) { } protected CountingListTokenizer getCountingListTokenizer ( TokenStream categoryStream ) { } protected CategoryTokenizer getCategoryTokenizer ( TokenStream categoryStream ) throws IOException { } public Document build ( Document doc ) { } }

Fix:
FieldType ft = new FieldType ( TextField . TYPE_NOT_STORED ) ;
Buggy code:
class AddCompilationUnitToIndex extends IndexRequest { IFile resource ; IndexManager manager ; IPath indexedContainer ; char [ ] contents ; public AddCompilationUnitToIndex ( IFile resource , IndexManager manager , IPath indexedContainer ) { } public boolean belongsTo ( String jobFamily ) { } public boolean execute ( IProgressMonitor progressMonitor ) { } private char [ ] getContents ( ) { } public void initializeContents ( ) { if ( ! ( resource . isLocal ( IResource . DEPTH_ZERO ) ) ) { return ; } else { try { IPath location = resource . getLocation ( ) ; if ( location != null ) { <START_BUG> this . contents = Util . getFileCharContent ( location . toFile ( ) ) ; <END_BUG> } } catch ( IOException e ) { } } } public String toString ( ) { } }

Fix:
this . contents = Util . getFileCharContent ( location . toFile ( ) , null ) ;
Buggy code:
public class PatternSet extends DataType { private Vector includeList = new Vector ( ) ; private Vector excludeList = new Vector ( ) ; private Vector includesFileList = new Vector ( ) ; private Vector excludesFileList = new Vector ( ) ; public class NameEntry { private String name ; private String ifCond ; private String unlessCond ; public void setName ( String name ) { } public void setIf ( String cond ) { } public void setUnless ( String cond ) { } public String getName ( ) { } public String evalName ( Project p ) { } private boolean valid ( Project p ) { } public String toString ( ) { } } public PatternSet ( ) { } public void setRefid ( Reference r ) throws BuildException { } public PatternSet . NameEntry createInclude ( ) { } public PatternSet . NameEntry createIncludesFile ( ) { } public PatternSet . NameEntry createExclude ( ) { } public PatternSet . NameEntry createExcludesFile ( ) { } public void setIncludes ( String includes ) { } public void setExcludes ( String excludes ) { } private PatternSet . NameEntry addPatternToList ( Vector list ) { } public void setIncludesfile ( File includesFile ) throws BuildException { } public void setExcludesfile ( File excludesFile ) throws BuildException { } private void readPatterns ( File patternfile , Vector patternlist , Project p ) throws BuildException { } public void append ( PatternSet other , Project p ) { } public String [ ] getIncludePatterns ( Project p ) { } public String [ ] getExcludePatterns ( Project p ) { } boolean hasPatterns ( ) { } private PatternSet getRef ( Project p ) { } private String [ ] makeArray ( Vector list , Project p ) { } private void readFiles ( Project p ) { if ( ( includesFileList . size ( ) ) > 0 ) { Enumeration e = includesFileList . elements ( ) ; while ( e . hasMoreElements ( ) ) { PatternSet . NameEntry ne = ( ( PatternSet . NameEntry ) ( e . nextElement ( ) ) ) ; String fileName = ne . evalName ( p ) ; if ( fileName != null ) { File inclFile = p . resolveFile ( fileName ) ; if ( ! ( inclFile . exists ( ) ) ) throw new BuildException ( ( ( "Includesfile<seq2seq4repair_space>" + ( inclFile . getAbsolutePath ( ) ) ) + "<seq2seq4repair_space>not<seq2seq4repair_space>found." ) ) ; readPatterns ( inclFile , includeList , p ) ; } } includesFileList . removeAllElements ( ) ; } if ( ( excludesFileList . size ( ) ) > 0 ) { <START_BUG> Enumeration e = includesFileList . elements ( ) ; <END_BUG> while ( e . hasMoreElements ( ) ) { PatternSet . NameEntry ne = ( ( PatternSet . NameEntry ) ( e . nextElement ( ) ) ) ; String fileName = ne . evalName ( p ) ; if ( fileName != null ) { File exclFile = p . resolveFile ( fileName ) ; if ( ! ( exclFile . exists ( ) ) ) throw new BuildException ( ( ( "Excludesfile<seq2seq4repair_space>" + ( exclFile . getAbsolutePath ( ) ) ) + "<seq2seq4repair_space>not<seq2seq4repair_space>found." ) ) ; readPatterns ( exclFile , excludeList , p ) ; } } excludesFileList . removeAllElements ( ) ; } } public String toString ( ) { } }

Fix:
Enumeration e = excludesFileList . elements ( ) ;
Buggy code:
public abstract class AbstractTransformerBehavior extends AbstractBehavior implements ITransformer { private static final long serialVersionUID = 1L ; private Response webResponse ; public AbstractTransformerBehavior ( ) { } protected Response newResponse ( ) { } public void onComponentTag ( final Component component , final ComponentTag tag ) { <START_BUG> tag . put ( "xmlns:org.apache.wicket" , "http:////org.apache.wicket.sourceforge.net" ) ; <END_BUG> final RequestCycle requestCycle = RequestCycle . get ( ) ; this . webResponse = requestCycle . getResponse ( ) ; final Response response = newResponse ( ) ; if ( response == null ) { throw new IllegalStateException ( "newResponse()<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>return<seq2seq4repair_space>null" ) ; } requestCycle . setResponse ( response ) ; } public void onRendered ( final Component component ) { } public void cleanup ( ) { } public void onException ( Component component , RuntimeException exception ) { } public abstract CharSequence transform ( final Component component , final String output ) throws Exception { } }

Fix:
tag . put ( "xmlns:wicket" , "http:////wicket.apache.org" ) ;
Buggy code:
public final class Content { private final byte [ ] data ; private final String mimeType ; private final Charset encoding ; public static Content EMPTY = new Content ( new byte [ 0 ] , null ) ; public Content ( byte [ ] data , String mimeType ) { } private static Map < String , String > decodeMimeParameters ( String parameters ) { } public byte [ ] getData ( ) { } public String getMimeType ( ) { } public Charset getEncoding ( ) { } @ Override public String toString ( ) { if ( ( encoding ) == null ) <START_BUG> return null ; <END_BUG> else return new String ( data , encoding ) ; } }

Fix:
return "" ;
Buggy code:
public abstract class AbstractBrowseTestCase extends TestCase { protected IRemoteFileSystemBrowserContainerAdapter adapter = null ; protected Object lock = new Object ( ) ; protected boolean done = false ; protected IRemoteFileSystemRequest request = null ; protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } protected IRemoteFileSystemListener createRemoteFileSystemListener ( ) { } protected IFileID createFileID ( URL directoryOrFile ) throws Exception { } protected void testBrowse ( URL directoryOrFile ) throws Exception { } protected void handleUnknownEvent ( IRemoteFileSystemEvent event ) { } protected void handleFileSystemBrowseEvent ( IRemoteFileSystemBrowseEvent event ) { } protected void waitForDone ( int timeout ) throws Exception { final long start = System . currentTimeMillis ( ) ; synchronized ( lock ) { while ( ( ! ( done ) ) && ( ( ( System . currentTimeMillis ( ) ) - start ) < timeout ) ) { lock . wait ( ( timeout // 20 ) ) ; } if ( ! ( done ) ) <START_BUG> throw new TimeoutException ( new Status ( IStatus . ERROR , Activator . PLUGIN_ID , IStatus . ERROR , "timeout" , null ) , ( ( long ) ( timeout ) ) ) ; <END_BUG> } } protected void assertHasEvent ( Collection collection , Class eventType ) { } protected void assertHasEventCount ( Collection collection , Class eventType , int eventCount ) { } protected void assertHasMoreThanEventCount ( Collection collection , Class eventType , int eventCount ) { } protected void verifyRemoteFiles ( final IRemoteFile [ ] remoteFiles ) { } }

Fix:
throw new TimeoutException ( timeout ) ;
Buggy code:
public class MainActivity extends ActionBarActivity implements AIDifficultyFragment . OnDifficultyInteraction , GamePlayFragment . OnGamePlayInteractionListener , IntroFragment . OnIntroInteractionListener , MatchLengthFragment . OnMatchLengthInteraction , TutorialFragment . OnTutorialInteractionListener { public static final int PLAY_PRESSED = 0 ; public static final int TUTORIAL_PRESSED = 1 ; public static final int TWO_PLAY_PRESSED = 2 ; public static final int ONLINE_PLAY_PRESSED = 3 ; public static final int MATCH_SINGLE = 1 ; public static final int MATCH_STANDARD = 3 ; public static final int MATCH_EXTENDED = 7 ; public static final int MATCH_MARATHON = 15 ; public static final String ARG_MATCH_TYPE = "ARG_MATCH_TYPE" ; public static final String ARG_VERSUS_TYPE = "ARG_VERSUS_TYPE" ; public static final String ARG_AI_DIFFICULTY = "ARG_AI_DIFFICULTY" ; public static Typeface typefaceHeader ; private int MATCH_TYPE = 0 ; private int AI_DIFFICULTY = 0 ; private int VERSUS_TYPE = 0 ; private IntroFragment introFragment ; private GamePlayFragment gamePlayFragment ; private TutorialFragment tutorialFragment ; private MatchLengthFragment matchLengthFragment ; private AIDifficultyFragment aiDifficultyFragment ; private FragmentManager fragmentManager ; private FragmentTransaction fragmentTransaction ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_main ) ; introFragment = new IntroFragment ( ) ; <START_BUG> MainActivity . typefaceHeader = Typeface . createFromAsset ( getAssets ( ) , "NanumGothic-Regular.ttf" ) ; <END_BUG> getFragmentManager ( ) . beginTransaction ( ) . setTransition ( TRANSIT_FRAGMENT_CLOSE ) . add ( fragment_container , introFragment ) . addToBackStack ( null ) . commit ( ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public void onBackPressed ( ) { } @ Override public void onIntroInteraction ( int button ) { } @ Override public void done ( ) { } @ Override public void onTutorialInteraction ( Uri uri ) { } @ Override public void onMatchLengthInteraction ( int button ) { } @ Override public void onDifficultyInteraction ( int level ) { } }

Fix:
MainActivity . typefaceHeader = Typeface . createFromAsset ( getAssets ( ) , "fonts//nanumgothic.ttf" ) ;