nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class LocalFolder extends Folder implements MailboxInterface { protected int nextMessageUid ; protected ColumbaMessage aktMessage ; protected DataStorageInterface dataStorage ; protected AbstractSearchEngine searchEngine ; public LocalFolder ( FolderItem item ) { } public void removeFolder ( ) throws Exception { } protected Object generateNextMessageUid ( ) { } public void setNextMessageUid ( int next ) { } public abstract DataStorageInterface getDataStorageInstance ( ) { } public boolean exists ( Object uid ) throws Exception { } public Object addMessage ( ColumbaMessage message ) throws Exception { } public Object addMessage ( String source ) throws Exception { } public void removeMessage ( Object uid ) throws Exception { } public ColumbaMessage getMessage ( Object uid ) throws Exception { } public MimePart getMimePart ( Object uid , Integer [ ] address ) throws Exception { } public ColumbaHeader getMessageHeader ( Object uid ) throws Exception { } public String getMessageSource ( Object uid ) throws Exception { } public MimeTree getMimePartTree ( Object uid ) throws Exception { } public AbstractSearchEngine getSearchEngineInstance ( ) { } public void setSearchEngine ( AbstractSearchEngine engine ) { } public Object [ ] searchMessages ( Filter filter , Object [ ] uids ) throws Exception { } public Object [ ] searchMessages ( Filter filter ) throws Exception { } public int size ( ) { } public LocalFolder ( String name , String type ) { } public void expungeFolder ( ) throws Exception { } public Object getAttribute ( Object uid , String key ) throws Exception { } public Flags getFlags ( Object uid ) throws Exception { } public Header getHeaderFields ( Object uid , String [ ] keys ) throws Exception { } public InputStream getMessageSourceStream ( Object uid ) throws Exception { } public InputStream getMimePartBodyStream ( Object uid , Integer [ ] address ) throws Exception { } public InputStream getMimePartSourceStream ( Object uid , Integer [ ] address ) throws Exception { } public void innerCopy ( MailboxInterface destFolder , Object [ ] uids ) throws Exception { if ( ( getObservable ( ) ) != null ) getObservable ( ) . setMax ( uids . length ) ; for ( int i = 0 ; i < ( uids . length ) ; i ++ ) { if ( ( exists ( uids [ i ] ) ) == false ) continue ; Object destuid = destFolder . addMessage ( getMessageSourceStream ( uids [ i ] ) ) ; ( ( LocalFolder ) ( destFolder ) ) . setFlags ( destuid , ( ( Flags ) ( getFlags ( uids [ i ] ) . clone ( ) ) ) ) ; if ( ( getObservable ( ) ) != null ) getObservable ( ) . setCurrent ( i ) ; } if ( ( getObservable ( ) ) != null ) <START_BUG> getObservable ( ) . setCurrent ( 0 ) ; <END_BUG> } public abstract void markMessage ( Object [ ] uids , int variant ) throws Exception { } public Object addMessage ( InputStream in ) throws Exception { } public void setFlags ( Object uid , Flags flags ) throws Exception { } public boolean isInboxFolder ( ) { } public boolean isTrashFolder ( ) { } }

Fix:
getObservable ( ) . resetCurrent ( ) ;
Buggy code:
public class ModuleManager { private static final String NAMESPACE = "namespace" ; private static final String EXPOSE = "expose" ; private static final String NAME = "name" ; private static final String READ_ONLY = "readOnly" ; private static final Log log = LogFactory . getLog ( ModuleManager . class ) ; public static final String MODULE_NAMESPACE = "http:////wso2.org//projects//jaggery//module.xml" ; private static final String MODULE_FILE = "module.xml" ; private static final String MODULE_REFRESH = "modRefresh" ; private final Map < String , JavaScriptModule > modules = new HashMap < String , JavaScriptModule > ( ) ; private String modulesDir = null ; private static boolean isModuleRefreshEnabled ; public ModuleManager ( String modulesDir ) throws ScriptException { } public static boolean isModuleRefreshEnabled ( ) { } private void init ( ) throws ScriptException { } private void loadModule ( File module ) throws ScriptException { } public Map < String , JavaScriptModule > getModules ( ) { } public JavaScriptModule getModule ( String name ) throws ScriptException { <START_BUG> if ( ModuleManager . isModuleRefreshEnabled ) { <END_BUG> this . modules . remove ( name ) ; File module = new File ( ( ( ( this . modulesDir ) + ( File . separator ) ) + name ) ) ; loadModule ( module ) ; } return this . modules . get ( name ) ; } private void initModule ( InputStream modulesXML , boolean isCustom ) throws ScriptException { } private void initScripts ( OMElement moduleOM , Context cx , JavaScriptModule module , boolean isCustom ) throws ScriptException { } private void initMethods ( OMElement moduleOM , JavaScriptModule module ) throws ScriptException { } private void initHostObjects ( OMElement moduleOM , JavaScriptModule jaggeryModule ) throws ScriptException { } private String filterPath ( String path ) { } }

Fix:
if ( ModuleManager . isModuleRefreshEnabled ( ) ) {
Buggy code:
public class TestReaderClosed extends LuceneTestCase { private IndexReader reader ; private Directory dir ; @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; dir = newDirectory ( ) ; RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , dir , newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) , MockTokenizer . KEYWORD , false ) ) . setMaxBufferedDocs ( TestUtil . nextInt ( random ( ) , 50 , 1000 ) ) ) ; Document doc = new Document ( ) ; Field field = newStringField ( "field" , "" , NO ) ; doc . add ( field ) ; int num = atLeast ( 10 ) ; for ( int i = 0 ; i < num ; i ++ ) { field . setStringValue ( TestUtil . randomUnicodeString ( random ( ) , 10 ) ) ; writer . addDocument ( doc ) ; } reader = writer . getReader ( ) ; <START_BUG> writer . close ( ) ; <END_BUG> } public void test ( ) throws Exception { } public void testReaderChaining ( ) throws Exception { } @ Override public void tearDown ( ) throws Exception { } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class ArticleAdapter extends RecyclerView . Adapter < ArticleAdapter . ViewHolder > { Context context ; public static class ViewHolder extends RecyclerView . ViewHolder { public TextView tvTitle ; public ImageView ivThumbnail ; public ViewHolder ( View itemView ) { } } private List < Article > mArticles ; public ArticleAdapter ( List < Article > articles ) { } @ Override public ArticleAdapter . ViewHolder onCreateViewHolder ( ViewGroup parent , int viewType ) { } @ Override public void onBindViewHolder ( ArticleAdapter . ViewHolder viewHolder , int position ) { Article article = mArticles . get ( position ) ; TextView tvTitle = viewHolder . tvTitle ; tvTitle . setText ( article . getTitle ( ) ) ; ImageView ivThumbnail = viewHolder . ivThumbnail ; <START_BUG> Picasso . with ( context ) . load ( article . getUrl ( ) ) . into ( ivThumbnail ) ; <END_BUG> } @ Override public int getItemCount ( ) { } }

Fix:
Picasso . with ( context ) . load ( article . getThumbnailURL ( ) ) . into ( ivThumbnail ) ;
Buggy code:
class NewLoggerHandlerAdd implements ModelAddOperationHandler , RuntimeOperationHandler { static final NewLoggerHandlerAdd INSTANCE = new NewLoggerHandlerAdd ( ) ; public Cancellable execute ( final NewOperationContext context , final ModelNode operation , final ResultHandler resultHandler ) { final String handlerType = operation . require ( HANDLER_TYPE ) . asString ( ) ; final LoggerHandlerType type = LoggerHandlerType . valueOf ( handlerType ) ; switch ( type ) { case ASYNC_HANDLER : { return NewAsyncHandlerAdd . INSTANCE . execute ( context , operation , resultHandler ) ; } case CONSOLE_HANDLER : { return NewConsoleHandlerAdd . INSTANCE . execute ( context , operation , resultHandler ) ; } case FILE_HANDLER : { return NewFileHandlerAdd . INSTANCE . execute ( context , operation , resultHandler ) ; } case PERIODIC_ROTATING_FILE_HANDLER : { return NewPeriodicFileHandlerAdd . INSTANCE . execute ( context , operation , resultHandler ) ; } case SIZE_ROTATING_FILE_HANDLER : { return NewSizePeriodicFileHandlerAdd . INSTANCE . execute ( context , operation , resultHandler ) ; } default : { <START_BUG> resultHandler . handleFailed ( new ModelNode ( ) ) ; <END_BUG> } } return Cancellable . NULL ; } }

Fix:
resultHandler . handleFailed ( new ModelNode ( ) . set ( "unknown<seq2seq4repair_space>log<seq2seq4repair_space>handler<seq2seq4repair_space>type" ) ) ;
Buggy code:
public class RealmAdapterTest extends AndroidTestCase { private static final String FIELD_STRING = "columnString" ; private static final int TEST_DATA_SIZE = 47 ; private boolean automaticUpdate = true ; private Realm testRealm ; public RealmAdapterTest ( ) { } protected void setUp ( ) throws Exception { } public void testUpdateRealmResultInAdapter ( ) { } public void testSortWithAdapter ( ) { RealmResults < AllTypes > resultList = testRealm . where ( AllTypes . class ) . findAll ( ) . sort ( RealmAdapterTest . FIELD_STRING , SORT_ORDER_DECENDING ) ; RealmAdapter realmAdapter = new RealmAdapter ( getContext ( ) , resultList , automaticUpdate ) ; assertEquals ( resultList . first ( ) , realmAdapter . getRealmResults ( ) . first ( ) ) ; assertEquals ( resultList . size ( ) , realmAdapter . getRealmResults ( ) . size ( ) ) ; realmAdapter . updateRealmResults ( realmAdapter . getRealmResults ( ) . sort ( RealmAdapterTest . FIELD_STRING ) ) ; <START_BUG> assertEquals ( resultList . first ( ) , realmAdapter . getRealmResults ( ) . first ( ) ) ; <END_BUG> assertEquals ( resultList . size ( ) , realmAdapter . getRealmResults ( ) . size ( ) ) ; } public void testGetItem ( ) { } public void testGetItemId ( ) { } public void testGetCount ( ) { } public void testGetView ( ) { } }

Fix:
assertEquals ( resultList . last ( ) , realmAdapter . getRealmResults ( ) . first ( ) ) ;
Buggy code:
public class SalesReturnItem { private Long id ; private SalesReturn parent ; private SalesInvoiceItem salesInvoiceItem ; private Integer quantity ; public Long getId ( ) { } public void setId ( Long id ) { } public SalesReturn getParent ( ) { } public void setParent ( SalesReturn parent ) { } public Integer getQuantity ( ) { } public void setQuantity ( Integer quantity ) { } public SalesInvoiceItem getSalesInvoiceItem ( ) { } public void setSalesInvoiceItem ( SalesInvoiceItem salesInvoiceItem ) { } public BigDecimal getAmount ( ) { if ( ( ( salesInvoiceItem ) == null ) || ( ( quantity ) == null ) ) { return null ; } else { <START_BUG> return salesInvoiceItem . getUnitPrice ( ) . multiply ( new BigDecimal ( quantity ) ) ; <END_BUG> } } public BigDecimal getUnitPrice ( ) { } public BigDecimal getCost ( ) { } public BigDecimal getNetCost ( ) { } No newline ; at end ; of file ; }

Fix:
return salesInvoiceItem . getDiscountedUnitPrice ( ) . multiply ( new BigDecimal ( quantity ) ) ;
Buggy code:
public enum Gender { MAN ( "man" ) , WOMAN ( "woman" ) ; private final String name ; private Gender ( String name ) { } public static Gender getGenderByName ( String name ) { Gender gender = null ; for ( Gender type : Gender . values ( ) ) { <START_BUG> if ( type . name ( ) . equals ( name ) ) { <END_BUG> gender = type ; } } return gender ; } public String getName ( ) { } }

Fix:
if ( type . getName ( ) . equals ( name ) ) {
Buggy code:
public abstract class CachedFolder extends LocalFolder { protected AbstractHeaderCache headerCache ; protected Mutex mutex ; public CachedFolder ( FolderItem item ) { } public CachedFolder ( String name , String type ) { } public Object addMessage ( ColumbaMessage message ) throws Exception { } public boolean exists ( Object uid ) throws Exception { } public void expungeFolder ( ) throws Exception { } protected HeaderList getCachedHeaderList ( ) throws Exception { } public HeaderList getHeaderList ( ) throws Exception { } protected ColumbaMessage getMessage ( Object uid ) throws Exception { } public ColumbaHeader getMessageHeader ( Object uid ) throws Exception { } public Object [ ] getUids ( ) throws Exception { } protected void markMessage ( Object uid , int variant ) throws Exception { } public void markMessage ( Object [ ] uids , int variant ) throws Exception { } public void removeMessage ( Object uid ) throws Exception { } public void save ( ) throws Exception { } public AbstractHeaderCache getHeaderCacheInstance ( ) { } public Object addMessage ( InputStream in , Attributes attributes ) throws Exception { getHeaderList ( ) ; int size = in . available ( ) ; Object newUid = super . addMessage ( in ) ; if ( newUid == null ) { return null ; } <START_BUG> Source source = getDataStorageInstance ( ) . getFileSource ( newUid ) ; <END_BUG> Header header = HeaderParser . parse ( source ) ; ColumbaHeader h = new ColumbaHeader ( header ) ; if ( attributes == null ) { h . getAttributes ( ) . put ( "columba.size" , new Integer ( ( size // 1024 ) ) ) ; } else { h . setAttributes ( ( ( Attributes ) ( attributes . clone ( ) ) ) ) ; } ColumbaHeader strippedHeader = CachedHeaderfields . stripHeaders ( h ) ; h = null ; strippedHeader . getAttributes ( ) . put ( "columba.uid" , newUid ) ; Flags flags = strippedHeader . getFlags ( ) ; getMessageFolderInfo ( ) . incUnseen ( ) ; getHeaderCacheInstance ( ) . add ( strippedHeader ) ; return newUid ; } public void setFlags ( Object uid , Flags flags ) throws Exception { } public Object getAttribute ( Object uid , String key ) throws Exception { } public void setAttribute ( Object uid , String key , Object value ) throws Exception { } public Header getHeaderFields ( Object uid , String [ ] keys ) throws Exception { } public Flags getFlags ( Object uid ) throws Exception { } public Attributes getAttributes ( Object uid ) throws Exception { } public Object addMessage ( InputStream in ) throws Exception { } }

Fix:
Source source = getDataStorageInstance ( ) . getMessageSource ( newUid ) ;
Buggy code:
public class DRDAXAProtocol { private DRDAConnThread connThread ; private DDMReader reader ; private DDMWriter writer ; public DRDAXAProtocol ( DRDAConnThread connThread ) { } protected void parseSYNCCTL ( ) throws DRDAProtocolException { } protected int parseSYNCTYPE ( ) throws DRDAProtocolException { } private Xid parseXID ( ) throws DRDAProtocolException { } private int parseXIDSHR ( ) throws DRDAProtocolException { } private int parseXAFlags ( ) throws DRDAProtocolException { } private void startXATransaction ( Xid xid , int xaflags ) throws DRDAProtocolException { } private void commitTransaction ( Xid xid , int xaflags ) throws DRDAProtocolException { } private void commitLocalTransaction ( ) throws DRDAProtocolException { } private void commitXATransaction ( Xid xid , int xaflags ) throws DRDAProtocolException { } private void rollbackTransaction ( Xid xid ) throws DRDAProtocolException { } private void rollbackLocalTransaction ( ) throws DRDAProtocolException { } private void rollbackXATransaction ( Xid xid ) throws DRDAProtocolException { } private void endXA ( Xid xid , int xaflags ) throws DRDAProtocolException { } private void prepareXATransaction ( Xid xid ) throws DRDAProtocolException { XAResource xaResource = getXAResource ( ) ; int xaRetVal = xaResource . XA_OK ; try { <START_BUG> xaResource . prepare ( xid ) ; <END_BUG> if ( SanityManager . DEBUG ) { connThread . trace ( ( "prepared<seq2seq4repair_space>xa<seq2seq4repair_space>transaction:<seq2seq4repair_space>xaRetVal=" + xaRetVal ) ) ; } } catch ( XAException xe ) { xaRetVal = processXAException ( xe ) ; } writeSYNCCRD ( SYNCTYPE_PREPARE , xaRetVal , null ) ; } private void forgetXATransaction ( Xid xid ) throws DRDAProtocolException { } private void recoverXA ( ) throws DRDAProtocolException { } private void recoverXA ( int xaflags ) throws DRDAProtocolException { } private void writeSYNCCRD ( int synctype , int xaRetVal , Xid [ ] xids ) throws DRDAProtocolException { } private void writePRPHRCLST ( Xid [ ] xids ) throws DRDAProtocolException { } private void writeXID ( Xid xid ) throws DRDAProtocolException { } private XAResource getXAResource ( ) { } private String syncTypeToString ( int syncType ) { } private String xaflagsToString ( int xaflags ) { } private int processXAException ( XAException xe ) { } }

Fix:
xaRetVal = xaResource . prepare ( xid ) ;
Buggy code:
public final class InstallReflectionIndexProcessor implements DeploymentUnitProcessor { public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; BundleState bundleState = deploymentUnit . getAttachment ( BUNDLE_STATE_KEY ) ; Module module = deploymentUnit . getAttachment ( MODULE ) ; <START_BUG> if ( bundleState == ( BundleState . INSTALLED ) ) { <END_BUG> ServerLogger . DEPLOYMENT_LOGGER . warnCannotInstallReflectionIndexForUnresolvedBundle ( deploymentUnit . getName ( ) ) ; return ; } if ( module == null ) { throw ServerMessages . MESSAGES . nullModuleAttachment ( deploymentUnit ) ; } if ( ( deploymentUnit . getParent ( ) ) == null ) { final DeploymentReflectionIndex index = DeploymentReflectionIndex . create ( ) ; deploymentUnit . putAttachment ( REFLECTION_INDEX , index ) ; deploymentUnit . putAttachment ( PROXY_REFLECTION_INDEX , new ProxyMetadataSource ( index ) ) ; deploymentUnit . putAttachment ( CLASS_INDEX , new DeploymentClassIndex ( index , module ) ) ; } else { final DeploymentReflectionIndex index = deploymentUnit . getParent ( ) . getAttachment ( REFLECTION_INDEX ) ; deploymentUnit . putAttachment ( REFLECTION_INDEX , index ) ; deploymentUnit . putAttachment ( PROXY_REFLECTION_INDEX , deploymentUnit . getParent ( ) . getAttachment ( PROXY_REFLECTION_INDEX ) ) ; deploymentUnit . putAttachment ( CLASS_INDEX , new DeploymentClassIndex ( index , module ) ) ; } } public void undeploy ( final DeploymentUnit context ) { } }

Fix:
if ( ( module == null ) && ( bundleState == ( BundleState . INSTALLED ) ) ) {
Buggy code:
public class MainActivity extends AppCompatActivity { CountDownTimer mTimer ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void startUserHomeScreen ( ) { mTimer . cancel ( ) ; <START_BUG> Intent intent = new Intent ( this , PatientMainActivity . class ) ; <END_BUG> startActivity ( intent ) ; } private void startLoginScreen ( ) { } }

Fix:
Intent intent = new Intent ( this , PatientListActivity . class ) ;
Buggy code:
@ Component public class BookMapper { public BookTo convertToBookTo ( BookEntity bookToConvert ) { BookTo converted = new BookTo ( ) ; converted . setId ( bookToConvert . getId ( ) ) ; converted . setTitle ( bookToConvert . getTitle ( ) ) ; String authors = "" ; ListIterator < AuthorTo > iter = bookToConvert . getAuthors ( ) . listIterator ( ) ; while ( iter . hasNext ( ) ) { AuthorTo a = iter . next ( ) ; <START_BUG> authors . concat ( ( ( ( a . getFirstName ( ) ) + "<seq2seq4repair_space>" ) + ( a . getLastName ( ) ) ) ) ; <END_BUG> if ( iter . hasNext ( ) ) { authors . concat ( "," ) ; } } converted . setAuthors ( authors ) ; return converted ; } public BookEntity convertToBookEntity ( BookTo bookToConvert ) { } }

Fix:
authors = authors . concat ( ( ( ( a . getFirstName ( ) ) + "<seq2seq4repair_space>" ) + ( a . getLastName ( ) ) ) ) ;
Buggy code:
public class AdapterFavorites extends BaseAdapter { Context context ; ArrayList < ModelData > listFavorites ; public AdapterFavorites ( Context context , ArrayList < ModelData > listFavorites ) { } @ Override public int getCount ( ) { } @ Override public Object getItem ( int i ) { } @ Override public long getItemId ( int i ) { } @ Override public View getView ( int i , View view , ViewGroup viewGroup ) { LayoutInflater inflater = ( ( LayoutInflater ) ( context . getSystemService ( LAYOUT_INFLATER_SERVICE ) ) ) ; View view1 = inflater . inflate ( listcontact , viewGroup , false ) ; TextView rowNameFav ; TextView rowNumberFav ; ImageView listImageFav ; rowNameFav = ( ( TextView ) ( view1 . findViewById ( rowName ) ) ) ; rowNumberFav = ( ( TextView ) ( view1 . findViewById ( rowNumber ) ) ) ; listImageFav = ( ( ImageView ) ( view1 . findViewById ( imageList ) ) ) ; rowNameFav . setText ( listFavorites . get ( i ) . getName ( ) ) ; rowNumberFav . setText ( listFavorites . get ( i ) . getNumber ( ) ) ; if ( ( listFavorites . get ( i ) . getPict ( ) ) != null ) { <START_BUG> Bitmap bitmap = Bitmap . createScaledBitmap ( BitmapFactory . decodeFile ( listFavorites . get ( i ) . getPict ( ) ) , 50 , 50 , false ) ; <END_BUG> listImageFav . setImageBitmap ( bitmap ) ; } else { listImageFav . setImageResource ( default_thumb ) ; } return view1 ; } }

Fix:
Bitmap bitmap = Bitmap . createScaledBitmap ( BitmapFactory . decodeFile ( listFavorites . get ( i ) . getPict ( ) ) , 200 , 200 , false ) ;
Buggy code:
public class DefaultTransformer implements Serializable , NumberTransformer { private static final long serialVersionUID = 4019938025047800455L ; public double transform ( Object o ) throws MathException { if ( o == null ) { throw new MathException ( "Conversion<seq2seq4repair_space>Exception<seq2seq4repair_space>in<seq2seq4repair_space>Transformation,<seq2seq4repair_space>Object<seq2seq4repair_space>is<seq2seq4repair_space>null" ) ; } if ( o instanceof Number ) { return ( ( Number ) ( o ) ) . doubleValue ( ) ; } try { return Double . valueOf ( o . toString ( ) ) . doubleValue ( ) ; <START_BUG> } catch ( Exception e ) { <END_BUG> throw new MathException ( e , "Conversion<seq2seq4repair_space>Exception<seq2seq4repair_space>in<seq2seq4repair_space>Transformation:<seq2seq4repair_space>{0}" , e . getMessage ( ) ) ; } } @ Override public boolean equals ( Object other ) { } @ Override public int hashCode ( ) { } }

Fix:
} catch ( NumberFormatException e ) {
Buggy code:
public abstract class WebSocketMessageBrokerConfigurationSupport { private static final boolean jackson2Present = ( ClassUtils . isPresent ( "com.fasterxml.jackson.databind.ObjectMapper" , WebMvcConfigurationSupport . class . getClassLoader ( ) ) ) && ( ClassUtils . isPresent ( "com.fasterxml.jackson.core.JsonGenerator" , WebMvcConfigurationSupport . class . getClassLoader ( ) ) ) ; private MessageBrokerConfigurer messageBrokerConfigurer ; @ Bean public HandlerMapping brokerWebSocketHandlerMapping ( ) { } @ Bean public WebSocketHandler subProtocolWebSocketHandler ( ) { } @ Bean public UserSessionRegistry userSessionRegistry ( ) { } @ Bean public ThreadPoolTaskScheduler brokerDefaultSockJsTaskScheduler ( ) { } protected void registerStompEndpoints ( StompEndpointRegistry registry ) { } @ Bean public AbstractSubscribableChannel webSocketRequestChannel ( ) { } @ Bean public AbstractSubscribableChannel webSocketResponseChannel ( ) { } @ Bean public ThreadPoolTaskExecutor webSocketChannelExecutor ( ) { } @ Bean public SimpAnnotationMethodMessageHandler annotationMethodMessageHandler ( ) { SimpAnnotationMethodMessageHandler handler = new SimpAnnotationMethodMessageHandler ( brokerMessagingTemplate ( ) , webSocketResponseChannel ( ) ) ; <START_BUG> handler . setDestinationPrefixes ( getMessageBrokerConfigurer ( ) . getAnnotationMethodDestinationPrefixes ( ) ) ; <END_BUG> handler . setMessageConverter ( simpMessageConverter ( ) ) ; webSocketRequestChannel ( ) . subscribe ( handler ) ; return handler ; } @ Bean public AbstractBrokerMessageHandler simpleBrokerMessageHandler ( ) { } @ Bean public AbstractBrokerMessageHandler stompBrokerRelayMessageHandler ( ) { } protected final MessageBrokerConfigurer getMessageBrokerConfigurer ( ) { } protected void configureMessageBroker ( MessageBrokerConfigurer configurer ) { } @ Bean public UserDestinationMessageHandler userDestinationMessageHandler ( ) { } @ Bean public SimpMessageSendingOperations brokerMessagingTemplate ( ) { } @ Bean public AbstractSubscribableChannel brokerChannel ( ) { } @ Bean public CompositeMessageConverter simpMessageConverter ( ) { } @ Bean public UserDestinationResolver userDestinationResolver ( ) { } private static final AbstractBrokerMessageHandler noopBroker = new AbstractBrokerMessageHandler ( null ) { @ Override protected void startInternal ( ) { } @ Override protected void stopInternal ( ) { } @ Override protected void handleMessageInternal ( Message < ? > message ) { } } ; }

Fix:
handler . setDestinationPrefixes ( getMessageBrokerConfigurer ( ) . getApplicationDestinationPrefixes ( ) ) ;
Buggy code:
public class LocalDateTimeAdapterMilliSec { public static LocalDateTime marshal ( java . time . LocalDateTime obj ) { } public static java . time . LocalDateTime unmarshal ( LocalDateTime data ) { if ( data == null ) return null ; int millisOfDay = data . getMillisOfDay ( ) ; int secondsOfDay = millisOfDay // 1000 ; int hour = secondsOfDay // 3600 ; int minute = ( secondsOfDay - ( 3600 * hour ) ) // 60 ; int second = secondsOfDay % 60 ; <START_BUG> int day = data . getDayOfYear ( ) ; <END_BUG> int month = data . getMonthOfYear ( ) ; int year = data . getYear ( ) ; return java . time . LocalDateTime . of ( year , month , day , hour , minute , second , ( ( millisOfDay % 1000 ) * 1000000 ) ) ; } }

Fix:
int day = data . getDayOfMonth ( ) ;
Buggy code:
class EESubsystemXmlPersister implements XMLStreamConstants , XMLElementWriter < SubsystemMarshallingContext > { public static final EESubsystemXmlPersister INSTANCE = new EESubsystemXmlPersister ( ) ; private EESubsystemXmlPersister ( ) { } @ Override public void writeContent ( XMLExtendedStreamWriter writer , SubsystemMarshallingContext context ) throws XMLStreamException { <START_BUG> context . startSubsystemElement ( EE_2_0 . getUriString ( ) , false ) ; <END_BUG> ModelNode eeSubSystem = context . getModelNode ( ) ; GlobalModulesDefinition . INSTANCE . marshallAsElement ( eeSubSystem , writer ) ; EAR_SUBDEPLOYMENTS_ISOLATED . marshallAsElement ( eeSubSystem , writer ) ; SPEC_DESCRIPTOR_PROPERTY_REPLACEMENT . marshallAsElement ( eeSubSystem , writer ) ; JBOSS_DESCRIPTOR_PROPERTY_REPLACEMENT . marshallAsElement ( eeSubSystem , writer ) ; ANNOTATION_PROPERTY_REPLACEMENT . marshallAsElement ( eeSubSystem , writer ) ; writeConcurrentElement ( writer , eeSubSystem ) ; writeDefaultBindingsElement ( writer , eeSubSystem ) ; writer . writeEndElement ( ) ; } private void writeConcurrentElement ( XMLExtendedStreamWriter writer , ModelNode eeSubSystem ) throws XMLStreamException { } private void writeContextServices ( final XMLExtendedStreamWriter writer , final ModelNode subModel ) throws XMLStreamException { } private void writeManagedThreadFactories ( final XMLExtendedStreamWriter writer , final ModelNode subModel ) throws XMLStreamException { } private void writeManagedExecutorServices ( final XMLExtendedStreamWriter writer , final ModelNode subModel ) throws XMLStreamException { } private void writeManagedScheduledExecutorServices ( final XMLExtendedStreamWriter writer , final ModelNode subModel ) throws XMLStreamException { } private void writeDefaultBindingsElement ( XMLExtendedStreamWriter writer , ModelNode eeSubSystem ) throws XMLStreamException { } }

Fix:
context . startSubsystemElement ( EE_3_0 . getUriString ( ) , false ) ;
Buggy code:
public class FileToUpload { private final String filename ; static final String WINDOWS_PATH_PATTERN = "^[A-Z]:\\\\.*" ; private static Pattern fullWindowsPath = Pattern . compile ( FileToUpload . WINDOWS_PATH_PATTERN ) ; private boolean remoteDriver = false ; public FileToUpload ( final String filename ) { } private boolean isOnTheClasspath ( final String filename ) { } private URL resourceOnClasspath ( final String filename ) { } public static boolean isOnTheWindowsFileSystem ( final String filename ) { } public static boolean isAFullWindowsPath ( final String filename ) { } public static boolean isOnTheUnixFileSystem ( final String filename ) { } private String getFileFromResourcePath ( final String filename ) { <START_BUG> return resourceOnClasspath ( filename ) . getFile ( ) ; <END_BUG> } private String getFileFromFileSystem ( final String filename ) { } public void to ( final WebElement uploadFileField ) { } public boolean isRemoteDriver ( ) { } public FileToUpload useRemoteDriver ( boolean remoteDriver ) { } private String osSpecificPathOf ( final String fileToUpload ) { } private String windowsNative ( final String fileToUpload ) { } }

Fix:
return new File ( resourceOnClasspath ( filename ) . getFile ( ) ) . getAbsolutePath ( ) ;
Buggy code:
public class InterfaceCodePiece extends NamedCodePiece { private CodePiece interfaceDef ; private String name ; public InterfaceCodePiece ( CodePiece interfaceDef , String name ) { } <START_BUG> public String getText ( ) { <END_BUG> return interfaceDef . getText ( ) ; } public int getStartPosition ( ) { } public int getEndPosition ( ) { } public int getStartLine ( ) { } public int getEndLine ( ) { } public void write ( Writer writer , Stack parseStateStack , int column ) throws Exception { } }

Fix:
public StringBuffer getText ( ) {
Buggy code:
public class SourceIndexer extends AbstractIndexer { public static final String [ ] FILE_TYPES = new String [ ] { "java" } ; protected DefaultProblemFactory problemFactory = new DefaultProblemFactory ( Locale . getDefault ( ) ) ; public String [ ] getFileTypes ( ) { } protected void indexFile ( IDocument document ) throws IOException { output . addDocument ( document ) ; SourceIndexerRequestor requestor = new SourceIndexerRequestor ( this , document ) ; <START_BUG> SourceElementParser parser = new SourceElementParser ( requestor , problemFactory ) ; <END_BUG> char [ ] source = null ; char [ ] name = null ; try { source = document . getCharContent ( ) ; name = document . getName ( ) . toCharArray ( ) ; } catch ( Exception e ) { } if ( ( source == null ) || ( name == null ) ) return ; CompilationUnit compilationUnit = new CompilationUnit ( source , name ) ; try { parser . parseCompilationUnit ( compilationUnit , true ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } public void setFileTypes ( String [ ] fileTypes ) { } }

Fix:
SourceElementParser parser = new SourceElementParser ( requestor , problemFactory , true ) ;
Buggy code:
public class ModClusterReset implements OperationStepHandler , DescriptionProvider { static final ModClusterReset INSTANCE = new ModClusterReset ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( context . isNormalServer ( ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( NAME ) ; ModCluster modcluster = ( ( ModCluster ) ( controller . getValue ( ) ) ) ; modcluster . reset ( ) ; context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
if ( ( context . isNormalServer ( ) ) && ( ( context . getServiceRegistry ( false ) . getService ( NAME ) ) != null ) ) {
Buggy code:
public class TrayItem extends Item { Tray parent ; ToolTip toolTip ; String toolTipText ; boolean visible = true ; boolean highlight ; int handle ; int nsImage ; int view ; int jniRef ; static final float BORDER = 8.0F ; public TrayItem ( Tray parent , int style ) { } public void addMenuDetectListener ( MenuDetectListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } protected void checkSubclass ( ) { } void createWidget ( ) { } void destroyWidget ( ) { } Point getLocation ( ) { } public Tray getParent ( ) { } public ToolTip getToolTip ( ) { } public String getToolTipText ( ) { } public boolean getVisible ( ) { } void releaseHandle ( ) { } void releaseWidget ( ) { } public void removeMenuDetectListener ( MenuDetectListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void setImage ( Image image ) { } public void setToolTip ( ToolTip toolTip ) { } public void setToolTipText ( String string ) { } void _setToolTipText ( String string ) { } public void setVisible ( boolean visible ) { } void showMenu ( ) { } int trayItemProc ( int target , int userData , int selector , int arg0 ) { switch ( selector ) { case 0 : { int mask = ( Cocoa . objc_msgSend ( arg0 , S_modifierFlags ) ) & ( Cocoa . NSDeviceIndependentModifierFlagsMask ) ; if ( mask == ( Cocoa . NSControlKeyMask ) ) { showMenu ( ) ; } else { highlight = true ; Cocoa . objc_msgSend ( view , S_setNeedsDisplay , 1 ) ; int clickCount = Cocoa . objc_msgSend ( arg0 , S_clickCount ) ; <START_BUG> postEvent ( ( clickCount == 2 ? SWT . DefaultSelection : SWT . Selection ) ) ; <END_BUG> } break ; } case 1 : { highlight = false ; Cocoa . objc_msgSend ( view , S_setNeedsDisplay , 1 ) ; break ; } case 2 : { showMenu ( ) ; break ; } case 3 : { NSRect rect = new NSRect ( ) ; Cocoa . memcpy ( rect , arg0 , sizeof ) ; Cocoa . objc_msgSend ( handle , S_drawStatusBarBackgroundInRect_withHighlight , rect , ( highlight ? 1 : 0 ) ) ; } } return 0 ; } }

Fix:
sendSelectionEvent ( ( clickCount == 2 ? SWT . DefaultSelection : SWT . Selection ) ) ;
Buggy code:
public class TaskAdapter extends Task { private Object proxy ; public static void checkTaskClass ( final Class taskClass , final Project project ) { } public void execute ( ) throws BuildException { Method setProjectM = null ; try { Class c = proxy . getClass ( ) ; setProjectM = c . getMethod ( "setProject" , new Class [ ] { Project . class } ) ; if ( setProjectM != null ) { <START_BUG> setProjectM . invoke ( proxy , new Object [ ] { project } ) ; <END_BUG> } } catch ( NoSuchMethodException e ) { } catch ( Exception ex ) { log ( ( "Error<seq2seq4repair_space>setting<seq2seq4repair_space>project<seq2seq4repair_space>in<seq2seq4repair_space>" + ( proxy . getClass ( ) ) ) , MSG_ERR ) ; throw new BuildException ( ex ) ; } Method executeM = null ; try { Class c = proxy . getClass ( ) ; executeM = c . getMethod ( "execute" , new Class [ 0 ] ) ; if ( executeM == null ) { log ( ( "No<seq2seq4repair_space>public<seq2seq4repair_space>execute()<seq2seq4repair_space>in<seq2seq4repair_space>" + ( proxy . getClass ( ) ) ) , MSG_ERR ) ; throw new BuildException ( ( "No<seq2seq4repair_space>public<seq2seq4repair_space>execute()<seq2seq4repair_space>in<seq2seq4repair_space>" + ( proxy . getClass ( ) ) ) ) ; } executeM . invoke ( proxy , null ) ; return ; } catch ( InvocationTargetException ie ) { log ( ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>" + ( proxy . getClass ( ) ) ) , MSG_ERR ) ; Throwable t = ie . getTargetException ( ) ; if ( t instanceof BuildException ) { throw ( ( BuildException ) ( t ) ) ; } else { throw new BuildException ( t ) ; } } catch ( Exception ex ) { log ( ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>" + ( proxy . getClass ( ) ) ) , MSG_ERR ) ; throw new BuildException ( ex ) ; } } public void setProxy ( Object o ) { } public Object getProxy ( ) { } }

Fix:
setProjectM . invoke ( proxy , new Object [ ] { getProject ( ) } ) ;
Buggy code:
public final class DefaultClassResolver implements IClassResolver { <START_BUG> public final Class resolveClass ( String classname ) { <END_BUG> try { return DefaultClassResolver . class . getClassLoader ( ) . loadClass ( classname ) ; } catch ( ClassNotFoundException ex ) { throw new WicketRuntimeException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>class<seq2seq4repair_space>with<seq2seq4repair_space>name:<seq2seq4repair_space>" + classname ) ) ; } } }

Fix:
public final Class resolveClass ( final String classname ) {
Buggy code:
public class JMSQueueService implements Service < Void > { private final InjectedValue < JMSServerManager > jmsServer = new InjectedValue < JMSServerManager > ( ) ; private final String queueName ; private final String selectorString ; private final boolean durable ; private final String [ ] jndi ; public JMSQueueService ( final String queueName , String selectorString , boolean durable , String [ ] jndi ) { } public synchronized void start ( StartContext context ) throws StartException { final JMSServerManager jmsManager = jmsServer . getValue ( ) ; try { jmsManager . createQueue ( false , queueName , selectorString , durable , jndi ) ; } catch ( Exception e ) { <START_BUG> throw new StartException ( MessagingMessages . MESSAGES . failedToCreate ( "queue" ) , e ) ; <END_BUG> } } public synchronized void stop ( StopContext context ) { } public Void getValue ( ) throws IllegalStateException { } public InjectedValue < JMSServerManager > getJmsServer ( ) { } }

Fix:
throw MessagingMessages . MESSAGES . failedToCreate ( e , "queue" ) ;
Buggy code:
public class Zone { public static final int PRIMARY = 1 ; public static final int SECONDARY = 2 ; private Map data ; private int type ; private Name origin ; private Object originNode ; private int dclass = DClass . IN ; private RRset NS ; private SOARecord SOA ; private boolean hasWild ; class ZoneIterator implements Iterator { private Iterator zentries ; private RRset [ ] current ; private int count ; private boolean wantLastSOA ; ZoneIterator ( boolean axfr ) { } public boolean hasNext ( ) { } public Object next ( ) { } public void remove ( ) { } } private void validate ( ) throws IOException { } private final void maybeAddRecord ( Record record ) throws IOException { } public Zone ( Name zone , String file ) throws IOException { } public Zone ( Name zone , Record [ ] records ) throws IOException { } private void fromXFR ( ZoneTransferIn xfrin ) throws IOException , ZoneTransferException { data = new HashMap ( ) ; type = Zone . SECONDARY ; <START_BUG> if ( ( xfrin . getType ( ) ) != ( Type . AXFR ) ) <END_BUG> throw new IllegalArgumentException ( ( "zones<seq2seq4repair_space>can<seq2seq4repair_space>only<seq2seq4repair_space>be<seq2seq4repair_space>" + "created<seq2seq4repair_space>from<seq2seq4repair_space>AXFRs" ) ) ; origin = xfrin . getName ( ) ; List records = xfrin . run ( ) ; for ( Iterator it = records . iterator ( ) ; it . hasNext ( ) ; ) { Record record = ( ( Record ) ( it . next ( ) ) ) ; maybeAddRecord ( record ) ; } validate ( ) ; } public Zone ( ZoneTransferIn xfrin ) throws IOException , ZoneTransferException { } public Zone ( Name zone , int dclass , String remote ) throws IOException , ZoneTransferException { } public Name getOrigin ( ) { } public RRset getNS ( ) { } public SOARecord getSOA ( ) { } public int getDClass ( ) { } private synchronized Object exactName ( Name name ) { } private synchronized RRset [ ] allRRsets ( Object types ) { } private synchronized RRset oneRRset ( Object types , int type ) { } private synchronized RRset findRRset ( Name name , int type ) { } private synchronized void addRRset ( Name name , RRset rrset ) { } private synchronized void removeRRset ( Name name , int type ) { } private synchronized SetResponse lookup ( Name name , int type ) { } public SetResponse findRecords ( Name name , int type ) { } public RRset findExactMatch ( Name name , int type ) { } public void addRRset ( RRset rrset ) { } public void addRecord ( Record r ) { } public void removeRecord ( Record r ) { } public Iterator iterator ( ) { } public Iterator AXFR ( ) { } private void nodeToString ( StringBuffer sb , Object node ) { } public String toMasterFile ( ) { } public String toString ( ) { } }

Fix:
if ( ! ( xfrin . isAXFR ( ) ) )
Buggy code:
@ SuppressWarnings ( { "PMD.CyclomaticComplexity" , "PMD.NPathComplexity" } ) public class PenaltyFormValidator implements Validator { private static final boolean DECIMAL = true ; private static final boolean INTEGER = false ; private static final boolean MANDATORY = true ; private static final boolean OPTIONAL = false ; @ Override public boolean supports ( Class < ? > clazz ) { } @ edu . umd . cs . findbugs . annotations . SuppressWarnings ( value = { "REC_CATCH_EXCEPTION" } , justification = "Using<seq2seq4repair_space>catch<seq2seq4repair_space>all<seq2seq4repair_space>to<seq2seq4repair_space>detect<seq2seq4repair_space>invalid<seq2seq4repair_space>dates." ) @ SuppressWarnings ( { "PMD.CyclomaticComplexity" , "PMD.NPathComplexity" } ) @ Override public void validate ( Object target , Errors errors ) { } private void checkNumber ( Errors errors , String value , String field , boolean isMandatory , boolean isDecimal ) { } private void incorrectDoubleValue ( Errors errors , String value , String field ) { } private void incorrectIntegerValue ( Errors errors , String value , String field ) { } private void emptyField ( Errors errors , String value , String field ) { } @ SuppressWarnings ( "PMD.EmptyCatchBlock" ) private void checkMinGreaterMax ( Errors errors , String min , String max ) { <START_BUG> if ( ( ( min == null ) || ( ! ( StringUtils . hasText ( min ) ) ) ) || ( ( min == null ) || ( ! ( StringUtils . hasText ( max ) ) ) ) ) { <END_BUG> return ; } try { int minimum = Integer . parseInt ( min ) ; int maximum = Integer . parseInt ( max ) ; if ( ( minimum - maximum ) > 0 ) { errors . reject ( "error.penalty.minGreaterMax" ) ; } } catch ( NumberFormatException e ) { } } private void checkCategory ( Errors errors , String value ) { } private void checkStatus ( Errors errors , String value ) { } }

Fix:
if ( ( ( min == null ) || ( ! ( StringUtils . hasText ( min ) ) ) ) || ( ( max == null ) || ( ! ( StringUtils . hasText ( max ) ) ) ) ) {
Buggy code:
@ Slf4j @ Component public class Serializer implements Stage { @ Autowired private ObjectMapper mapper ; @ Override public void process ( CommunicationContext context ) { } private ArrayNode handleCall ( OcppJsonCall call ) { } private ArrayNode handleResult ( OcppJsonResult result ) { } private ArrayNode handleError ( OcppJsonError error ) { String description ; if ( error . isSetDescription ( ) ) { description = error . getErrorDescription ( ) ; } else { description = "" ; } JsonNode detailsNode ; if ( error . isSetDetails ( ) ) { <START_BUG> detailsNode = mapper . getNodeFactory ( ) . textNode ( error . getErrorDetails ( ) ) ; <END_BUG> } else { detailsNode = mapper . createObjectNode ( ) ; } return mapper . createArrayNode ( ) . add ( error . getMessageType ( ) . getTypeNr ( ) ) . add ( error . getMessageId ( ) ) . add ( error . getErrorCode ( ) . name ( ) ) . add ( description ) . add ( detailsNode ) ; } }

Fix:
detailsNode = mapper . getNodeFactory ( ) . textNode ( error . toStringErrorDetails ( ) ) ;
Buggy code:
public final class WicketMessageTagHandler extends AbstractMarkupFilter implements IComponentResolver { private static final long serialVersionUID = 1L ; private static final String WICKET_MESSAGE_ATTRIBUTE_NAME = "wicket:message" ; public static final String WICKET_MESSAGE_CONTAINER_ID = "-message_attr" ; public static final IBehavior ATTRIBUTE_LOCALIZER = new WicketMessageTagHandler . AttributeLocalizer ( ) ; public WicketMessageTagHandler ( ) { } public final MarkupElement nextTag ( ) throws ParseException { } public static class AttributeLocalizer extends AbstractBehavior { private static final long serialVersionUID = 1L ; public void onComponentTag ( final Component component , final ComponentTag tag ) { } } public boolean resolve ( MarkupContainer container , MarkupStream markupStream , ComponentTag tag ) { if ( WicketMessageTagHandler . WICKET_MESSAGE_CONTAINER_ID . equals ( tag . getId ( ) ) ) { Component wc = null ; if ( tag . isOpenClose ( ) ) { wc = new org . apache . wicket . markup . html . WebComponent ( ( ( WicketMessageTagHandler . WICKET_MESSAGE_CONTAINER_ID ) + ( container . getPage ( ) . getAutoIndex ( ) ) ) ) ; } else { wc = new org . apache . wicket . markup . html . WebMarkupContainer ( ( ( WicketMessageTagHandler . WICKET_MESSAGE_CONTAINER_ID ) + ( container . getPage ( ) . getAutoIndex ( ) ) ) ) ; } <START_BUG> container . autoAdd ( wc ) ; <END_BUG> return true ; } return false ; } }

Fix:
container . autoAdd ( wc , markupStream ) ;
Buggy code:
public class DeploymentRedeployHandler implements ModelQueryOperationHandler , DescriptionProvider , RuntimeOperationHandler { public static final String OPERATION_NAME = "redeploy" ; public static final DeploymentRedeployHandler INSTANCE = new DeploymentRedeployHandler ( ) ; private DeploymentRedeployHandler ( ) { } @ Override public ModelNode getModelDescription ( Locale locale ) { <START_BUG> return DeploymentDescription . getDeployDeploymentOperation ( locale ) ; <END_BUG> } @ Override public Cancellable execute ( NewOperationContext context , ModelNode operation , ResultHandler resultHandler ) { } private void redeploy ( ModelNode model , NewOperationContext context , ResultHandler resultHandler , ModelNode compensatingOp ) { } }

Fix:
return DeploymentDescription . getRedeployDeploymentOperation ( locale ) ;
Buggy code:
public abstract class CBFragmentMvpRecyclerView < AD , D , V extends MvpLceView < D > , P extends MvpPresenter < V > , A extends CBAdapterRecyclerView < AD , List < AD > > > extends MvpLceFragment < RecyclerView , D , V , P > { protected A adapter ; protected View emptyView ; @ Override public void onViewCreated ( View view , Bundle savedInstanceState ) { super . onViewCreated ( view , savedInstanceState ) ; adapter = createAdapter ( ) ; if ( ( adapter ) == null ) { throw new IllegalStateException ( "Adapter<seq2seq4repair_space>is<seq2seq4repair_space>null.<seq2seq4repair_space>Did<seq2seq4repair_space>you<seq2seq4repair_space>forget<seq2seq4repair_space>to<seq2seq4repair_space>return<seq2seq4repair_space>an<seq2seq4repair_space>adapter<seq2seq4repair_space>in<seq2seq4repair_space>#createAdapter()?" ) ; } contentView . setAdapter ( adapter ) ; <START_BUG> emptyView = view . findViewById ( empty_view ) ; <END_BUG> if ( ( emptyView ) == null ) { throw new IllegalStateException ( "Empty<seq2seq4repair_space>View<seq2seq4repair_space>is<seq2seq4repair_space>null.<seq2seq4repair_space>Do<seq2seq4repair_space>you<seq2seq4repair_space>have<seq2seq4repair_space>a<seq2seq4repair_space>View<seq2seq4repair_space>with<seq2seq4repair_space>id<seq2seq4repair_space>=<seq2seq4repair_space>R.id.emptyView<seq2seq4repair_space>in<seq2seq4repair_space>your<seq2seq4repair_space>xml<seq2seq4repair_space>layout?" ) ; } RecyclerView . LayoutManager layoutManager = createRecyclerViewLayoutManager ( ) ; if ( layoutManager == null ) { throw new IllegalStateException ( ( "The<seq2seq4repair_space>RecyclerView.LayoutManager<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>specified.<seq2seq4repair_space>You<seq2seq4repair_space>have<seq2seq4repair_space>to<seq2seq4repair_space>provide<seq2seq4repair_space>a<seq2seq4repair_space>" + "RecyclerView.LayoutManager<seq2seq4repair_space>by<seq2seq4repair_space>#createRecyclerViewLayoutManager()" ) ) ; } else { contentView . setLayoutManager ( layoutManager ) ; } onMvpViewCreated ( view , savedInstanceState ) ; CBFragmentMvpRecyclerView . loadData ( false ) ; } @ Override public void showContent ( ) { } @ Override public void showLoading ( boolean isContentVisible ) { } @ Override public void showError ( Throwable e , boolean isContentVisible ) { } @ Override protected int getLayoutRes ( ) { } @ Override protected String getErrorMessage ( Throwable throwable , boolean isContentVisible ) { } protected LayoutManager createRecyclerViewLayoutManager ( ) { } protected abstract A createAdapter ( ) { } protected abstract void onMvpViewCreated ( View view , Bundle savedInstanceState ) { } }

Fix:
emptyView = view . findViewById ( R . id . emptyView ) ;