nus-yam/ex-repair huggingface dataset:
Buggy code:
public class MultiBackgroundInitializerTest { private static final String CHILD_INIT = "childInitializer" ; private MultiBackgroundInitializer initializer ; @ Before public void setUp ( ) throws Exception { } private void checkChild ( BackgroundInitializer < ? > child , ExecutorService expExec ) throws ConcurrentException { } @ Test ( expected = IllegalArgumentException . class ) public void testAddInitializerNullName ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testAddInitializerNullInit ( ) { } @ Test public void testInitializeNoChildren ( ) throws ConcurrentException { } private MultiBackgroundInitializer . MultiBackgroundInitializerResults checkInitialize ( ) throws ConcurrentException { } @ Test public void testInitializeTempExec ( ) throws ConcurrentException { } @ Test public void testInitializeExternalExec ( ) throws ConcurrentException { } @ Test public void testInitializeChildWithExecutor ( ) throws ConcurrentException { } @ Test public void testAddInitializerAfterStart ( ) throws ConcurrentException { } @ Test ( expected = NoSuchElementException . class ) public void testResultGetInitializerUnknown ( ) throws ConcurrentException { } @ Test ( expected = NoSuchElementException . class ) public void testResultGetResultObjectUnknown ( ) throws ConcurrentException { } @ Test ( expected = NoSuchElementException . class ) public void testResultGetExceptionUnknown ( ) throws ConcurrentException { } @ Test ( expected = NoSuchElementException . class ) public void testResultIsExceptionUnknown ( ) throws ConcurrentException { } @ Test ( expected = UnsupportedOperationException . class ) public void testResultInitializerNamesModify ( ) throws ConcurrentException { } @ Test public void testInitializeRuntimeEx ( ) { } @ Test public void testInitializeEx ( ) throws ConcurrentException { } @ Test public void testInitializeResultsIsSuccessfulTrue ( ) throws ConcurrentException { } @ Test public void testInitializeResultsIsSuccessfulFalse ( ) throws ConcurrentException { } @ Test public void testInitializeNested ( ) throws ConcurrentException { } private static class ChildBackgroundInitializer extends BackgroundInitializer < Integer > { volatile ExecutorService currentExecutor ; volatile int initializeCalls ; Exception ex ; @ Override protected Integer initialize ( ) throws Exception { currentExecutor = getActiveExecutor ( ) ; ( initializeCalls ) ++ ; if ( ( ex ) != null ) { throw ex ; } <START_BUG> return initializeCalls ; <END_BUG> } } }

Fix:
return Integer . valueOf ( initializeCalls ) ;
Buggy code:
@ Stateless @ Local public class JPAOperatorCountryDAO implements OperatorCountryDAO { @ PersistenceContext private EntityManager em ; @ Override public Collection < OperatorCountry > getAllOperatorCountries ( ) { <START_BUG> Query q = em . createQuery ( "from<seq2seq4repair_space>Operator" ) ; <END_BUG> List < OperatorCountry > result = q . getResultList ( ) ; return result ; } @ Override public OperatorCountry getOperatorCountryByKey ( OperatorCountryPK operatorCountryPK ) { } @ Override public void addOperatorCountry ( OperatorCountry operatorCountry ) { } @ Override public void updateOperatorCountry ( OperatorCountry operatorCountry ) { } @ Override public void deleteOperatorCountry ( OperatorCountry operatorCountry ) { } }

Fix:
Query q = em . createQuery ( "from<seq2seq4repair_space>OperatorCountry" ) ;
Buggy code:
public class ProtractorUtils { public static boolean debug = true ; public static String header = "var<seq2seq4repair_space>u<seq2seq4repair_space>=<seq2seq4repair_space>require('l.js');var<seq2seq4repair_space>fs<seq2seq4repair_space>=<seq2seq4repair_space>require('fs');" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( "\n" + "describe('protractor<seq2seq4repair_space>e2e<seq2seq4repair_space>tests',<seq2seq4repair_space>function()<seq2seq4repair_space>{" ) + "\n" ) + "browser.manage().timeouts().pageLoadTimeout(60000);" ) + "\n" ) + "browser.manage().timeouts().implicitlyWait(30000);" ) + "\n" ) + "jasmine.DEFAULT_TIMEOUT_INTERVAL<seq2seq4repair_space>=<seq2seq4repair_space>6000000;" ) + "\n" ) + "//*<seq2seq4repair_space>for<seq2seq4repair_space>non-angular<seq2seq4repair_space>page<seq2seq4repair_space>*//" ) + "\n" ) + "browser.ignoreSynchronization<seq2seq4repair_space>=<seq2seq4repair_space>true;<seq2seq4repair_space>//*<seq2seq4repair_space>set<seq2seq4repair_space>this<seq2seq4repair_space>false<seq2seq4repair_space>for<seq2seq4repair_space>AngularJS<seq2seq4repair_space>app<seq2seq4repair_space>*//" ) + "\n" ) + "beforeEach(function()<seq2seq4repair_space>{" ) + "\n" ) ; public static String footer = "<seq2seq4repair_space>});" + ( ( ( ( ( "\n" + "});" ) + "\n" ) + "<seq2seq4repair_space>}" ) + "\n" ) + "};" ) ; private String firstLine = "" ; public String toScript ( String v ) { } public String parse ( String seleniumString ) { StringBuffer sb = new StringBuffer ( ) ; if ( ! ( StringUtils . isEmpty ( seleniumString ) ) ) { long lineNotIgnored = 0 ; String t = null ; String t1 = null ; StringTokenizer st = new StringTokenizer ( seleniumString , "\t\n" , true ) ; while ( st . hasMoreElements ( ) ) { t = ( ( String ) ( st . nextElement ( ) ) ) ; if ( ( ! ( StringUtils . isEmpty ( t . trim ( ) ) ) ) && ( lineNotIgnored == 0 ) ) { <START_BUG> firstLine = t ; <END_BUG> lineNotIgnored ++ ; } if ( ProtractorUtils . debug ) { System . out . print ( t ) ; System . out . print ( "<seq2seq4repair_space>---><seq2seq4repair_space>" ) ; } t1 = toScript ( t ) ; if ( ProtractorUtils . debug ) { System . out . println ( t1 ) ; } sb . append ( t1 ) ; if ( ( ( ( t1 != null ) && ( ( t1 . trim ( ) ) != "" ) ) && ( ( t1 . trim ( ) . length ( ) ) > 1 ) ) || ( ( t1 . trim ( ) . indexOf ( "////" ) ) == 0 ) ) { sb . append ( "\n" ) ; } } } return sb . toString ( ) ; } public static void main ( String [ ] args ) { } public String getFirstLine ( ) { } }

Fix:
firstLine = t . trim ( ) ;
Buggy code:
@ Component public class ScoreCompilerImpl implements ScoreCompiler { @ Autowired private ExecutionPlanBuilder executionPlanBuilder ; @ Autowired private DependenciesHelper dependenciesHelper ; @ Override public CompilationArtifact compile ( Executable executable , Set < Executable > path ) { } private void validateAllDependenciesResultsHaveMatchingNavigations ( Executable executable , Map < String , Executable > filteredDependencies ) { if ( executable . getType ( ) . equals ( OPERATION_TYPE ) ) { return ; } Flow flow = ( ( Flow ) ( executable ) ) ; Deque < Task > tasks = flow . getWorkflow ( ) . getTasks ( ) ; for ( Task task : tasks ) { Map < String , String > taskNavigations = task . getNavigationStrings ( ) ; String refId = task . getRefId ( ) ; Executable reference = filteredDependencies . get ( refId ) ; Validate . notNull ( reference , ( ( ( ( ( ( "Cannot<seq2seq4repair_space>compile<seq2seq4repair_space>flow:<seq2seq4repair_space>\'" + ( executable . getName ( ) ) ) + "\'<seq2seq4repair_space>since<seq2seq4repair_space>for<seq2seq4repair_space>task:<seq2seq4repair_space>\'" ) + ( task . getName ( ) ) ) + "\',<seq2seq4repair_space>the<seq2seq4repair_space>dependency:<seq2seq4repair_space>\'" ) + refId ) + "\'<seq2seq4repair_space>is<seq2seq4repair_space>missing." ) ) ; List < Result > refResults = reference . getResults ( ) ; for ( Result result : refResults ) { String resultName = result . getName ( ) ; <START_BUG> Validate . isTrue ( taskNavigations . containsKey ( resultName ) , ( ( ( ( ( ( ( ( "Cannot<seq2seq4repair_space>compile<seq2seq4repair_space>flow:<seq2seq4repair_space>\'" + ( executable . getName ( ) ) ) + "\'<seq2seq4repair_space>since<seq2seq4repair_space>for<seq2seq4repair_space>task:<seq2seq4repair_space>\'" ) + ( task . getName ( ) ) ) + "\"\',<seq2seq4repair_space>the<seq2seq4repair_space>result<seq2seq4repair_space>\'" ) + resultName ) + "\'<seq2seq4repair_space>of<seq2seq4repair_space>its<seq2seq4repair_space>dependency:<seq2seq4repair_space>\'" ) + refId ) + "\'<seq2seq4repair_space>has<seq2seq4repair_space>no<seq2seq4repair_space>matching<seq2seq4repair_space>navigation" ) ) ; <END_BUG> } } } private ExecutionPlan compileToExecutionPlan ( Executable executable ) { } private static Collection < Input > getSystemProperties ( Collection < Executable > executables ) { } private static Collection < Input > getSystemProperties ( List < Input > inputs ) { } }

Fix:
Validate . isTrue ( taskNavigations . containsKey ( resultName ) , ( ( ( ( ( ( ( ( "Cannot<seq2seq4repair_space>compile<seq2seq4repair_space>flow:<seq2seq4repair_space>\'" + ( executable . getName ( ) ) ) + "\'<seq2seq4repair_space>since<seq2seq4repair_space>for<seq2seq4repair_space>task:<seq2seq4repair_space>\'" ) + ( task . getName ( ) ) ) + "\',<seq2seq4repair_space>the<seq2seq4repair_space>result<seq2seq4repair_space>\'" ) + resultName ) + "\'<seq2seq4repair_space>of<seq2seq4repair_space>its<seq2seq4repair_space>dependency:<seq2seq4repair_space>\'" ) + refId ) + "\'<seq2seq4repair_space>has<seq2seq4repair_space>no<seq2seq4repair_space>matching<seq2seq4repair_space>navigation" ) ) ;
Buggy code:
public abstract class AbstractListenerInterfaceRequestTarget extends PageRequestTarget implements IEventProcessor , IListenerInterfaceRequestTarget { private final ObsoleteRequestParameters requestParameters ; private final Component component ; private final RequestListenerInterface listener ; public AbstractListenerInterfaceRequestTarget ( final Page page , final Component component , RequestListenerInterface listener ) { } public AbstractListenerInterfaceRequestTarget ( final Page page , final Component component , final RequestListenerInterface listener , final ObsoleteRequestParameters requestParameters ) { } @ Override public boolean equals ( Object obj ) { } public final RequestListenerInterface getRequestListenerInterface ( ) { } public final ObsoleteRequestParameters getRequestParameters ( ) { } public final Component getTarget ( ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } protected void onProcessEvents ( final RequestCycle requestCycle ) { getPage ( ) . startComponentRender ( getTarget ( ) ) ; final Application application = requestCycle . getApplication ( ) ; IRequestCycleSettings . RenderStrategy strategy = application . getRequestCycleSettings ( ) . getRenderStrategy ( ) ; <START_BUG> boolean issueRedirect = ( strategy == ( IRequestCycleSettings . REDIRECT_TO_RENDER ) ) || ( strategy == ( IRequestCycleSettings . REDIRECT_TO_BUFFER ) ) ; <END_BUG> requestCycle . setRedirect ( issueRedirect ) ; } }

Fix:
boolean issueRedirect = ( strategy == ( RenderStrategy . REDIRECT_TO_RENDER ) ) || ( strategy == ( RenderStrategy . REDIRECT_TO_BUFFER ) ) ;
Buggy code:
public class User extends Player implements MenuContainer { private Socket sock ; private BufferedReader in ; private DataOutputStream out ; private String password = "" ; private String startRoom = "" ; private int timeoutCounter ; private String menuBuff = "" ; public boolean inMenu = false ; private Vector < UserMessage > messages = new Vector < UserMessage > ( ) ; public Vector < UserMessage > getMessages ( ) { } public void setMessages ( Vector < UserMessage > messages ) { } private static Vector < User > users = new Vector < User > ( ) ; public User ( ) { } public User ( Socket s ) throws IOException { } public void run ( ) { } public String getResponse ( ) { } public String getMenuResponse ( ) { } public String removeBackspace ( String msg ) { } public void quit ( ) { } public boolean login ( ) { } protected boolean createNewUser ( String username ) { } public boolean getNewPassword ( ) { } protected String getUserAndPass ( ) { } public boolean loadUser ( String fileName ) { } public void sendUserPrompt ( ) { } public void broadcast ( String output ) { } public void send ( String output ) { } public void menu ( User u ) throws MenuExitException { } public void setPassword ( String newPass ) { } public String getPassword ( ) { } public void setTimeoutCounter ( int NewTimeoutCounter ) { } public int GetTimeoutCounter ( ) { } public String getStartRoom ( ) { } public void setStartRoom ( String startRoom ) { } public static Vector < User > getUsers ( ) { } public static void setUsers ( Vector < User > users ) { } public boolean isInMenu ( ) { } public void setInMenu ( boolean inMenu ) { } public void look ( ) { Room r = this . getCurrentRoom ( ) ; String output ; output = r . getRoomDescription ( ) ; output += ( r . getPlayerList ( ) ) + "\r\n" ; <START_BUG> output += ( "Obvious<seq2seq4repair_space>Exits:" + ( r . getVisibleExits ( ) ) ) + "\r\n" ; <END_BUG> this . broadcast ( output ) ; } public void doBattle ( ) { } public void die ( ) { } }

Fix:
output += ( "Exits:" + ( r . getVisibleExits ( ) ) ) + "\r\n" ;
Buggy code:
public class XtendXpandMarkerManager { public static final String getMARKER_TYPE ( ) { } public static void addMarker ( final IFile file , final AnalysationIssue issue ) { try { final IMarker marker = file . createMarker ( XtendXpandMarkerManager . getMARKER_TYPE ( ) ) ; <START_BUG> final int severity = IMarker . SEVERITY_ERROR ; <END_BUG> int start = - 1 ; int end = - 1 ; if ( ( issue . getElement ( ) ) != null ) { start = issue . getElement ( ) . getStart ( ) ; end = issue . getElement ( ) . getEnd ( ) ; } XtendXpandMarkerManager . internalAddMarker ( file , marker , issue . getMessage ( ) , severity , start , end ) ; } catch ( final CoreException e ) { } } public static void addErrorMarker ( final IFile file , final String message , final int severity , final int start , final int end ) { } public static void addWarningMarker ( final IFile file , final String message , final int severity , final int start , final int end ) { } private static final void internalAddMarker ( final IFile file , final IMarker marker , final String message , final int severity , final int start , final int end ) { } public static void deleteMarkers ( final IResource file ) { } }

Fix:
final int severity = ( issue . isError ( ) ) ? IMarker . SEVERITY_ERROR : IMarker . SEVERITY_WARNING ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class AnnotationCacheDefinitionSource extends AbstractFallbackCacheDefinitionSource implements Serializable { private final boolean publicMethodsOnly ; private final Set < CacheAnnotationParser > annotationParsers ; public AnnotationCacheDefinitionSource ( ) { } public AnnotationCacheDefinitionSource ( boolean publicMethodsOnly ) { } public AnnotationCacheDefinitionSource ( CacheAnnotationParser ... annotationParsers ) { } @ Override protected CacheDefinition findCacheDefinition ( Class < ? > clazz ) { } @ Override protected CacheDefinition findCacheOperation ( Method method ) { } protected CacheDefinition determineCacheDefinition ( AnnotatedElement ae ) { for ( CacheAnnotationParser annotationParser : this . annotationParsers ) { <START_BUG> CacheDefinition attr = annotationParser . parseTransactionAnnotation ( ae ) ; <END_BUG> if ( attr != null ) { return attr ; } } return null ; } @ Override protected boolean allowPublicMethodsOnly ( ) { } }

Fix:
CacheDefinition attr = annotationParser . parseCacheAnnotation ( ae ) ;
Buggy code:
public class Parser { private static final String SET = "set" ; public static String upperString ( String prefix , String fieldName ) { } public static < T > T getObject ( Class < T > cLass , Map < String , Object > record ) { <START_BUG> Field [ ] fields = cLass . getFields ( ) ; <END_BUG> T result = null ; try { result = cLass . getConstructor ( ) . newInstance ( ) ; } catch ( InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e ) { e . printStackTrace ( ) ; } for ( int i = 0 ; i < ( fields . length ) ; i ++ ) { Object obj = record . get ( fields [ i ] . getName ( ) ) ; if ( obj == null ) continue ; try { Method setterMethod = cLass . getMethod ( Parser . upperString ( Parser . SET , fields [ i ] . getName ( ) ) , obj . getClass ( ) ) ; if ( setterMethod == null ) continue ; try { setterMethod . invoke ( result , obj ) ; } catch ( IllegalAccessException | IllegalArgumentException | InvocationTargetException e ) { } } catch ( NoSuchMethodException | SecurityException e ) { } } return result ; } }

Fix:
Field [ ] fields = cLass . getDeclaredFields ( ) ;
Buggy code:
public class LinkomaticApplication extends WicketExampleApplication { @ Override public Class < ? extends Page > getHomePage ( ) { } @ Override protected void init ( ) { super . init ( ) ; <START_BUG> mountBookmarkablePage ( "//home" , Home . class ) ; <END_BUG> getSharedResources ( ) . add ( "cancelButton" , new DefaultButtonImageResource ( "Cancel" ) ) ; getRequestCycleSettings ( ) . addResponseFilter ( new ServerHostNameAndTimeFilter ( ) ) ; } }

Fix:
mountPage ( "//home" , Home . class ) ;
Buggy code:
public class ExportVCardAction extends DefaultTableAction { public ExportVCardAction ( IFrameMediator frameMediator ) { } public void actionPerformed ( ActionEvent arg0 ) { AddressbookFrameMediator mediator = ( ( AddressbookFrameMediator ) ( frameMediator ) ) ; AddressbookFolder sourceFolder = ( ( AddressbookFolder ) ( mediator . getTree ( ) . getSelectedFolder ( ) ) ) ; <START_BUG> Object [ ] uids = mediator . getTable ( ) . getUids ( ) ; <END_BUG> JFileChooser fc = new JFileChooser ( ) ; fc . setFileSelectionMode ( JFileChooser . DIRECTORIES_ONLY ) ; fc . setApproveButtonText ( "Select" ) ; int returnVal = fc . showOpenDialog ( frameMediator . getView ( ) . getFrame ( ) ) ; if ( returnVal == ( JFileChooser . APPROVE_OPTION ) ) { File file = fc . getSelectedFile ( ) ; for ( int i = 0 ; i < ( uids . length ) ; i ++ ) { try { IContactModel contact = sourceFolder . get ( uids [ i ] ) ; File f = new File ( file , ( ( "contact" + ( uids [ i ] . toString ( ) ) ) + ".vcf" ) ) ; BufferedOutputStream s = new BufferedOutputStream ( new FileOutputStream ( f ) ) ; VCardParser . write ( contact , s ) ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } } } }

Fix:
String [ ] uids = mediator . getTable ( ) . getUids ( ) ;
Buggy code:
public class SimpleFacetsExample { private final Directory indexDir = new RAMDirectory ( ) ; private final Directory taxoDir = new RAMDirectory ( ) ; private final FacetsConfig config = new FacetsConfig ( ) ; public SimpleFacetsExample ( ) { } private void index ( ) throws IOException { IndexWriter indexWriter = new IndexWriter ( indexDir , new org . apache . lucene . index . IndexWriterConfig ( FacetExamples . EXAMPLES_VER , new org . apache . lucene . analysis . core . WhitespaceAnalyzer ( FacetExamples . EXAMPLES_VER ) ) ) ; DirectoryTaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter ( taxoDir ) ; Document doc = new Document ( ) ; doc . add ( new FacetField ( "Author" , "Bob" ) ) ; doc . add ( new FacetField ( "Publish<seq2seq4repair_space>Date" , "2010" , "10" , "15" ) ) ; indexWriter . addDocument ( config . build ( taxoWriter , doc ) ) ; doc = new Document ( ) ; doc . add ( new FacetField ( "Author" , "Lisa" ) ) ; doc . add ( new FacetField ( "Publish<seq2seq4repair_space>Date" , "2010" , "10" , "20" ) ) ; indexWriter . addDocument ( config . build ( taxoWriter , doc ) ) ; doc = new Document ( ) ; doc . add ( new FacetField ( "Author" , "Lisa" ) ) ; doc . add ( new FacetField ( "Publish<seq2seq4repair_space>Date" , "2012" , "1" , "1" ) ) ; indexWriter . addDocument ( config . build ( taxoWriter , doc ) ) ; doc = new Document ( ) ; doc . add ( new FacetField ( "Author" , "Susan" ) ) ; doc . add ( new FacetField ( "Publish<seq2seq4repair_space>Date" , "2012" , "1" , "7" ) ) ; indexWriter . addDocument ( config . build ( taxoWriter , doc ) ) ; doc = new Document ( ) ; doc . add ( new FacetField ( "Author" , "Frank" ) ) ; doc . add ( new FacetField ( "Publish<seq2seq4repair_space>Date" , "1999" , "5" , "5" ) ) ; indexWriter . addDocument ( config . build ( taxoWriter , doc ) ) ; <START_BUG> indexWriter . close ( ) ; <END_BUG> taxoWriter . close ( ) ; } private List < FacetResult > facetsWithSearch ( ) throws IOException { } private List < FacetResult > facetsOnly ( ) throws IOException { } private FacetResult drillDown ( ) throws IOException { } private List < FacetResult > drillSideways ( ) throws IOException { } public List < FacetResult > runFacetOnly ( ) throws IOException { } public List < FacetResult > runSearch ( ) throws IOException { } public FacetResult runDrillDown ( ) throws IOException { } public List < FacetResult > runDrillSideways ( ) throws IOException { } public static void main ( String [ ] args ) throws Exception { } }

Fix:
indexWriter . shutdown ( ) ;
Buggy code:
public class ScreenshotManager { public ScreenshotFolder theDiary ; private static ScreenshotManager instance ; private ScreenshotManager ( ) { } public static ScreenshotManager getInstance ( ) { } public ImmutableList < ScreenshotNote > getScreenshotList ( ) { } public void loadScreenshots ( ) { } public void saveScrenshots ( ) throws IOException { } public void moveScreenshotsToFolder ( ScreenshotNote [ ] screenshots , File dest ) { } private static void onException ( String context , Exception exc ) { <START_BUG> logger . log ( Level . SEVERE , exc . getMessage ( ) ) ; <END_BUG> Minecraft mc = Minecraft . getMinecraft ( ) ; ChatComponentTranslation cct = new ChatComponentTranslation ( context , new Object [ ] { exc . getMessage ( ) } ) ; mc . ingameGUI . getChatGUI ( ) . printChatMessage ( cct ) ; } public void export2word ( ScreenshotFolder diary ) throws Exception { } public void onScreenshot ( BufferedImage bufferedimage , File file ) { } }

Fix:
logger . error ( exc . getMessage ( ) ) ;
Buggy code:
@ Repository ( "capabilitiesDAO" ) public class XmlCapabilitiesDAO implements CapabilitiesDAO { public static final String FILE_NAME = "config//wpsCapabilitiesSkeleton.xml" ; public static final String NAMESPACE = "http:////www.opengis.net//ows//1.1" ; private static Logger LOGGER = LoggerFactory . getLogger ( XmlCapabilitiesDAO . class ) ; @ Autowired private JDomUtil jDomUtil ; @ Autowired private ResourcePathUtil resourcePathUtil ; @ Override public ServiceIdentification getServiceIdentification ( ) { } @ Override public void saveServiceIdentification ( ServiceIdentification serviceIdentification ) { } @ Override public ServiceProvider getServiceProvider ( ) { Document document = null ; ServiceProvider serviceProvider = new ServiceProvider ( ) ; String absolutePath = resourcePathUtil . getWebAppResourcePath ( XmlCapabilitiesDAO . FILE_NAME ) ; document = jDomUtil . parse ( absolutePath ) ; Element root = document . getRootElement ( ) ; Element serviceProviderElement = getElement ( root , "ServiceProvider" ) ; serviceProvider . setProviderName ( getValue ( serviceProviderElement , "ProviderName" ) ) ; serviceProvider . setProviderSite ( serviceProviderElement . getChild ( "ProviderSite" , Namespace . getNamespace ( XmlCapabilitiesDAO . NAMESPACE ) ) . getAttributeValue ( "href" , Namespace . getNamespace ( "http:////www.w3.org//1999//xlink" ) ) ) ; <START_BUG> Element serviceContact = getElement ( serviceProviderElement , "serviceContact" ) ; <END_BUG> serviceProvider . setIndividualName ( getValue ( serviceContact , "IndividualName" ) ) ; serviceProvider . setPosition ( getValue ( serviceContact , "PositionName" ) ) ; Element contactInfo = getElement ( serviceContact , "ContactInfo" ) ; Element phone = getElement ( contactInfo , "Phone" ) ; serviceProvider . setPhone ( getValue ( phone , "Voice" ) ) ; serviceProvider . setFacsimile ( getValue ( phone , "Facsimile" ) ) ; Element address = getElement ( contactInfo , "Address" ) ; serviceProvider . setDeliveryPoint ( getValue ( address , "DeliveryPoint" ) ) ; serviceProvider . setCity ( getValue ( address , "City" ) ) ; serviceProvider . setAdministrativeArea ( getValue ( address , "AdministrativeArea" ) ) ; serviceProvider . setPostalCode ( getValue ( address , "PostalCode" ) ) ; serviceProvider . setCountry ( getValue ( address , "Country" ) ) ; serviceProvider . setEmail ( getValue ( address , "ElectronicMailAddress" ) ) ; XmlCapabilitiesDAO . LOGGER . info ( "'{}'<seq2seq4repair_space>is<seq2seq4repair_space>parsed<seq2seq4repair_space>and<seq2seq4repair_space>a<seq2seq4repair_space>ServiceProvider<seq2seq4repair_space>object<seq2seq4repair_space>is<seq2seq4repair_space>returned" , absolutePath ) ; return serviceProvider ; } @ Override public void saveServiceProvider ( ServiceProvider serviceProvider ) { } private String getValue ( Element element , String child ) { } private Element getElement ( Element element , String child ) { } private void setElement ( Element element , String value ) { } }

Fix:
Element serviceContact = getElement ( serviceProviderElement , "ServiceContact" ) ;
Buggy code:
public class RouteService extends Service { private App program ; private KVStore kvStore ; public RouteService ( int period , App app ) throws UnknownHostException { } public void run ( ) { try { ArrayList < Packet > tasklist = ( ( ArrayList < Packet > ) ( Datastore . getInstance ( ) . poll ( ) ) ) ; for ( Packet task : tasklist ) { Datastore . getInstance ( ) . addLog ( "RECEIVE" , task . toString ( ) ) ; try { Packet cachePacket = Datastore . getInstance ( ) . getCache ( task . getUIDString ( ) ) ; if ( cachePacket != null ) { <START_BUG> this . client . send ( cachePacket ) ; <END_BUG> Datastore . getInstance ( ) . addLog ( "Cache" , "Cache<seq2seq4repair_space>found.<seq2seq4repair_space>Reply<seq2seq4repair_space>immedately." ) ; } else if ( ( ( Datastore . getInstance ( ) . getProcessCache ( task . getUIDString ( ) ) ) == null ) || ( Datastore . getInstance ( ) . getProcessCache ( task . getUIDString ( ) ) . equals ( false ) ) ) { Datastore . getInstance ( ) . storeProcessCache ( task . getUIDString ( ) , true ) ; process ( task ) ; } else { Datastore . getInstance ( ) . addLog ( "Packet<seq2seq4repair_space>In<seq2seq4repair_space>Progress" , task . toString ( ) ) ; } } catch ( IOException ioe ) { Datastore . getInstance ( ) . addLog ( "KVStore<seq2seq4repair_space>Error" , Arrays . toString ( ioe . getStackTrace ( ) ) ) ; this . client . responseTo ( task , Protocol . sendResponse ( task , null , 4 ) ) ; } } } catch ( Exception e ) { Datastore . getInstance ( ) . addException ( "Exception" , e ) ; } } private void process ( Packet p ) throws IOException { } }

Fix:
this . client . responseCache ( task , cachePacket ) ;
Buggy code:
public class BBBSysFs extends SysFs { private static final int WAIT_TIMEOUT_MS = 5000 ; private String SYSFS_DEVICES_PATH = "//sys//devices" ; public BBBSysFs ( ) { } public File getCapeManager ( ) { } public File getCapeManagerSlots ( ) { } public int getSlotNumber ( String namePattern ) { } public boolean isSlotLoaded ( int slotIndex ) { if ( slotIndex < 0 ) { return false ; } List < String > slots = readSlots ( ) ; <START_BUG> if ( ( slots . size ( ) ) <= slotIndex ) { <END_BUG> return false ; } String slot = slots . get ( slotIndex ) ; if ( ( slot . length ( ) ) > 11 ) { return ( slot . charAt ( 11 ) ) == 'L' ; } else { return false ; } } public List < String > readSlots ( ) { } public File findOcpDevice ( final String namePattern ) { } public void removeSlot ( int number ) { } public void createSlotIfNotExists ( String deviceName ) { } private void waitForSlotCreation ( String deviceName , long waitMillis ) { } public void removeSlotOfDevice ( String deviceName ) { } }

Fix:
if ( slotIndex >= ( slots . size ( ) ) ) {
Buggy code:
public class TextUtils { public static String escapeText ( String txt ) { StringBuffer buffer = new StringBuffer ( txt ) ; TextUtils . stringReplaceAll ( buffer , '&' , "&amp;" ) ; TextUtils . stringReplaceAll ( buffer , '<' , "&lt;" ) ; <START_BUG> TextUtils . stringReplaceAll ( buffer , '>' , "&tg;" ) ; <END_BUG> TextUtils . stringReplaceAll ( buffer , '"' , "&quot;" ) ; TextUtils . stringReplaceAll ( buffer , '\'' , "&apos;" ) ; return buffer . toString ( ) ; } public static StringBuffer stringReplaceAll ( StringBuffer orig , char token , String replacement ) { } }

Fix:
TextUtils . stringReplaceAll ( buffer , '>' , "&gt;" ) ;
Buggy code:
public final class InterfaceAdd extends AbstractNetworkInterfaceUpdate { private static final long serialVersionUID = 2597565379666344003L ; private final String name ; private boolean anyLocalV4 ; private boolean anyLocalV6 ; private boolean anyLocal ; private Collection < AbstractInterfaceCriteriaElement < ? > > interfaceCriteria = Collections . emptySet ( ) ; public InterfaceAdd ( String name , boolean anyLocalV4 , boolean anyLocalV6 , boolean anyLocal , Collection < AbstractInterfaceCriteriaElement < ? > > interfaceCriteria ) { } public InterfaceAdd ( final InterfaceElement networkInterface ) { } public String getName ( ) { } public boolean isFullySpecified ( ) { } @ Override public void applyUpdate ( InterfaceElement element ) throws UpdateFailedException { } @ Override public AbstractModelElementUpdate < InterfaceElement > getCompensatingUpdate ( InterfaceElement original ) { } public < P > void applyUpdate ( UpdateContext updateContext , UpdateResultHandler < ? super Void , P > resultHandler , P param ) { <START_BUG> final BatchBuilder batch = updateContext . getBatchBuilder ( ) ; <END_BUG> batch . addService ( JBOSS_NETWORK_INTERFACE . append ( name ) , createInterfaceService ( ) ) . addListener ( new UpdateResultHandler . ServiceStartListener < P > ( resultHandler , param ) ) . setInitialMode ( ON_DEMAND ) . install ( ) ; } Service < NetworkInterfaceBinding > createInterfaceService ( ) { } static final class OverallInterfaceCriteria implements InterfaceCriteria { private static final long serialVersionUID = - 5417786897309925997L ; private final Set < InterfaceCriteria > interfaceCriteria ; public OverallInterfaceCriteria ( Set < InterfaceCriteria > criteria ) { } public boolean isAcceptable ( NetworkInterface networkInterface , InetAddress address ) throws SocketException { } } }

Fix:
final BatchBuilder batch = updateContext . getServiceTarget ( ) ;
Buggy code:
class RuleFactory { static final Collection rules = new LinkedList ( ) ; private static final String AND_RULE = "&&" ; private static final String OR_RULE = "||" ; private static final String NOT_RULE = "!" ; private static final String NOT_EQUALS_RULE = "!=" ; private static final String EQUALS_RULE = "==" ; private static final String PARTIAL_TEXT_MATCH_RULE = "~=" ; private static final String LIKE_RULE = "like" ; static boolean isRule ( String symbol ) { } static Rule getRule ( String symbol , Stack stack ) { if ( RuleFactory . AND_RULE . equals ( symbol ) ) { return AndRule . getRule ( stack ) ; } if ( RuleFactory . OR_RULE . equals ( symbol ) ) { <START_BUG> return OrOperator . getRule ( stack ) ; <END_BUG> } if ( RuleFactory . NOT_RULE . equals ( symbol ) ) { return NotRule . getRule ( stack ) ; } if ( RuleFactory . NOT_EQUALS_RULE . equals ( symbol ) ) { return NotEqualsRule . getRule ( stack ) ; } if ( RuleFactory . EQUALS_RULE . equals ( symbol ) ) { return EqualsRule . getRule ( stack ) ; } if ( RuleFactory . PARTIAL_TEXT_MATCH_RULE . equals ( symbol ) ) { return PartialTextMatchRule . getRule ( stack ) ; } if ( RuleFactory . LIKE_RULE . equalsIgnoreCase ( symbol ) ) { return LikeRule . getRule ( stack ) ; } return null ; } }

Fix:
return OrRule . getRule ( stack ) ;
Buggy code:
public class DiscoveryStartup { public static final String DISCOVERY_CONTAINER = "org.eclipse.ecf.provider.jmdns.container.JmDNS" ; public static final String TCPSERVER_DISCOVERY_TYPE = "_ecftcp._tcp.local." ; public static final String PROP_PROTOCOL_NAME = "protocol" ; public static final String PROP_CONTAINER_TYPE_NAME = "containertype" ; public static final String PROP_CONTAINER_TYPE_VALUE = Client . GENERIC_CONTAINER_CLIENT_NAME ; public static final String PROP_PW_REQ_NAME = "pwrequired" ; public static final String PROP_PW_REQ_VALUE = "false" ; public static final String PROP_DEF_USER_NAME = "defaultuser" ; public static final String PROP_DEF_USER_VALUE = "guest" ; public static final String PROP_PATH_NAME = "path" ; public static final int SVC_DEF_WEIGHT = 0 ; public static final int SVC_DEF_PRIORITY = 0 ; static IDiscoveryContainer discovery = null ; static ISharedObjectContainer socontainer = null ; protected DiscoveryView discoveryView = null ; static String [ ] serviceTypes = new String [ ] { DiscoveryStartup . TCPSERVER_DISCOVERY_TYPE } ; public DiscoveryStartup ( ) { } public void dispose ( ) { } protected void setupDiscovery ( ) { if ( ( ( DiscoveryStartup . discovery ) == null ) && ( ClientPlugin . getDefault ( ) . getPreferenceStore ( ) . getBoolean ( PREF_REGISTER_SERVER ) ) ) { try { <START_BUG> DiscoveryStartup . socontainer = SharedObjectContainerFactory . makeSharedObjectContainer ( DiscoveryStartup . DISCOVERY_CONTAINER ) ; <END_BUG> DiscoveryStartup . discovery = ( ( IDiscoveryContainer ) ( DiscoveryStartup . socontainer . getAdapter ( IDiscoveryContainer . class ) ) ) ; if ( ( DiscoveryStartup . discovery ) != null ) { setupDiscoveryContainer ( DiscoveryStartup . discovery ) ; DiscoveryStartup . socontainer . joinGroup ( null , null ) ; } else { if ( ( DiscoveryStartup . socontainer ) != null ) { DiscoveryStartup . socontainer . dispose ( 1000 ) ; DiscoveryStartup . socontainer = null ; } DiscoveryStartup . discovery = null ; ClientPlugin . log ( "No<seq2seq4repair_space>discovery<seq2seq4repair_space>container<seq2seq4repair_space>available" ) ; } } catch ( Exception e ) { if ( ( DiscoveryStartup . socontainer ) != null ) { DiscoveryStartup . socontainer . dispose ( 1000 ) ; DiscoveryStartup . socontainer = null ; } DiscoveryStartup . discovery = null ; ClientPlugin . log ( "Exception<seq2seq4repair_space>creating<seq2seq4repair_space>discovery<seq2seq4repair_space>container" , e ) ; } } } protected void connectToServiceFromInfo ( IServiceInfo svcInfo ) { } protected void setupDiscoveryContainer ( final IDiscoveryContainer dc ) { } public static void unregisterServerType ( ) { } public static void registerService ( URI uri ) { } public static void unregisterServer ( ISharedObjectContainer container ) { } public static void registerServiceTypes ( ) { } }

Fix:
DiscoveryStartup . socontainer = SharedObjectContainerFactory . getDefault ( ) . makeSharedObjectContainer ( DiscoveryStartup . DISCOVERY_CONTAINER ) ;
Buggy code:
public final class StringUtilities { private StringUtilities ( ) { } public static String substitute ( final String input , final String pattern , final String sub ) { <START_BUG> StringBuffer ret = new StringBuffer ( input . length ( ) ) ; <END_BUG> int start = 0 ; int index = - 1 ; final int length = pattern . length ( ) ; while ( ( index = input . indexOf ( pattern , start ) ) >= start ) { ret . append ( input . substring ( start , index ) ) ; ret . append ( sub ) ; start = index + length ; } ret . append ( input . substring ( start ) ) ; return ret . toString ( ) ; } }

Fix:
StringBuilder ret = new StringBuilder ( input . length ( ) ) ;
Buggy code:
public class EscapeOroRegexpChars extends AbstractFunction { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final List < String > desc = new LinkedList < String > ( ) ; private static final String KEY = "__escapeOroRegexpChars" ; private CompoundVariable [ ] values ; private static final int MAX_PARAM_COUNT = 2 ; private static final int MIN_PARAM_COUNT = 1 ; private static final int PARAM_NAME = 2 ; public EscapeOroRegexpChars ( ) { } @ Override public synchronized String execute ( SampleResult previousResult , Sampler currentSampler ) throws InvalidVariableException { <START_BUG> String valueToEscape = values [ 0 ] . execute ( ) . trim ( ) ; <END_BUG> String varName = "" ; if ( ( values . length ) >= ( EscapeOroRegexpChars . PARAM_NAME ) ) { varName = values [ ( ( EscapeOroRegexpChars . PARAM_NAME ) - 1 ) ] . execute ( ) . trim ( ) ; } String escapedValue = Perl5Compiler . quotemeta ( valueToEscape ) ; if ( ( varName . length ( ) ) > 0 ) { JMeterVariables vars = getVariables ( ) ; if ( vars != null ) { vars . put ( varName , escapedValue ) ; } } if ( EscapeOroRegexpChars . log . isDebugEnabled ( ) ) { String tn = Thread . currentThread ( ) . getName ( ) ; EscapeOroRegexpChars . log . debug ( ( ( ( ( tn + "<seq2seq4repair_space>name:" ) + varName ) + "<seq2seq4repair_space>value:" ) + escapedValue ) ) ; } return escapedValue ; } @ Override public synchronized void setParameters ( Collection < CompoundVariable > parameters ) throws InvalidVariableException { } @ Override public String getReferenceKey ( ) { } @ Override public List < String > getArgumentDesc ( ) { } }

Fix:
String valueToEscape = values [ 0 ] . execute ( ) ;
Buggy code:
public class RecentSearchesActivity extends ActionBarActivity { private PlaceHistoryManager placeHistoryManager ; ListView historyListView ; PlaceInfoAdapter historyAdapter ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_recent_searches ) ; placeHistoryManager = PlaceHistoryManager . getInstance ( this ) ; historyAdapter = new PlaceInfoAdapter ( this , drawable . ic_place_history ) ; historyListView = ( ( ListView ) ( findViewById ( history_list_view ) ) ) ; historyAdapter . updateList ( placeHistoryManager . getHistoryRecords ( ) ) ; historyListView . setAdapter ( historyAdapter ) ; historyListView . setOnItemClickListener ( new AdapterView . OnItemClickListener ( ) { @ Override public void onItemClick ( AdapterView < ? > parent , View view , int position , long id ) { PlaceInfo placeInfo = ( ( PlaceInfo ) ( parent . getItemAtPosition ( position ) ) ) ; <START_BUG> placeHistoryManager . updateInHistory ( placeInfo ) ; <END_BUG> PlaceDetail placeDetail = new PlaceDetail ( placeInfo . placeId , placeInfo . getDescription ( ) , 0.0 , 0.0 ) ; sendResult ( placeDetail ) ; } } ) ; } private void sendResult ( PlaceDetail placeDetail ) { } }

Fix:
placeHistoryManager . updateHistory ( placeInfo ) ;
Buggy code:
public class HealingShovel extends CItem { int Heal ; public HealingShovel ( String originalName , ChatColor color , String lDescription , long lCooldown , Material mat ) { } @ Override public boolean effect ( Event event , Player player ) { EntityDamageByEntityEvent e = ( ( EntityDamageByEntityEvent ) ( event ) ) ; if ( ( ( e . getDamager ( ) ) == player ) && ( ( e . getEntity ( ) ) instanceof Player ) ) { Player damaged = ( ( Player ) ( e . getEntity ( ) ) ) ; <START_BUG> e . setDamage ( ( ( double ) ( 0 ) ) ) ; <END_BUG> damaged . getWorld ( ) . playSound ( damaged . getLocation ( ) , ORB_PICKUP , 0.5F , 1.0F ) ; short currentDur = player . getItemInHand ( ) . getDurability ( ) ; if ( ( ( ( ( org . bukkit . entity . Damageable ) ( damaged ) ) . getHealth ( ) ) + ( Heal ) ) <= ( ( ( org . bukkit . entity . Damageable ) ( damaged ) ) . getMaxHealth ( ) ) ) { damaged . setHealth ( ( ( ( ( org . bukkit . entity . Damageable ) ( damaged ) ) . getHealth ( ) ) + ( Heal ) ) ) ; } else { damaged . setHealth ( ( ( org . bukkit . entity . Damageable ) ( damaged ) ) . getMaxHealth ( ) ) ; } if ( ( currentDur + ( Heal ) ) < ( player . getItemInHand ( ) . getType ( ) . getMaxDurability ( ) ) ) { player . getItemInHand ( ) . setDurability ( ( ( short ) ( currentDur + ( Heal ) ) ) ) ; } else { player . setItemInHand ( new org . bukkit . inventory . ItemStack ( Material . AIR , 1 ) ) ; player . getWorld ( ) . playSound ( player . getLocation ( ) , ITEM_BREAK , 0.1F , 0.0F ) ; } return true ; } return false ; } @ Override public void initConfigEntries ( ) { } }

Fix:
e . setDamage ( 0 ) ;
Buggy code:
public class SessionToken { private String token ; private static SecureRandom rand ; private static boolean running = false ; public static void startRNG ( ) { } public static SessionToken generate ( ) throws NullPointerException { } public static SessionToken fromString ( String base64EncodedString ) { } private SessionToken ( byte [ ] rawbytes ) { } public SessionToken ( String base64 ) { } public String getToken ( ) { } @ Override public boolean equals ( Object o ) { <START_BUG> return ( ( o != null ) && ( o . getClass ( ) . equals ( this ) ) ) && ( ( ( SessionToken ) ( o ) ) . token . equals ( this . token ) ) ; <END_BUG> } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } }

Fix:
return ( ( o != null ) && ( o . getClass ( ) . equals ( this . getClass ( ) ) ) ) && ( ( ( SessionToken ) ( o ) ) . token . equals ( this . token ) ) ;
Buggy code:
public class ServerGroupDeploymentAdd extends AbstractModelUpdate < ServerGroupElement , ServerDeploymentActionResult > { private static final long serialVersionUID = 5773083013951607950L ; private final String uniqueName ; private final String runtimeName ; private final byte [ ] hash ; private final boolean start ; public ServerGroupDeploymentAdd ( final String uniqueName , final String runtimeName , final byte [ ] hash , final boolean start ) { } public String getUniqueName ( ) { } public String getRuntimeName ( ) { } public byte [ ] getHash ( ) { } public boolean isStart ( ) { } @ Override public ServerGroupDeploymentRemove getCompensatingUpdate ( ServerGroupElement original ) { } @ Override protected ServerModelDeploymentAdd getServerModelUpdate ( ) { <START_BUG> return new ServerModelDeploymentAdd ( uniqueName , runtimeName , hash , start ) ; <END_BUG> } @ Override protected void applyUpdate ( ServerGroupElement element ) throws UpdateFailedException { } @ Override public Class < ServerGroupElement > getModelElementType ( ) { } }

Fix:
return new ServerModelDeploymentAdd ( uniqueName , runtimeName , hash ) ;
Buggy code:
public class MySensorsMessageEngine implements IMessageProcessEngine { private static final Logger _logger = LoggerFactory . getLogger ( MySensorsMessageEngine . class . getName ( ) ) ; private static final int FIRMWARE_PRINT_LOG = 100 ; private Firmware firmware ; @ Override public void executeMessage ( RawMessage rawMessage ) throws GatewayException { } private void presentationSubMessageTypeSelector ( MySensorsRawMessage mySensorsRawMessage ) { } private void internalSubMessageTypeSelector ( MySensorsRawMessage mySensorsRawMessage ) { } private void streamSubMessageTypeSelector ( MySensorsRawMessage mySensorsRawMessage ) { } private void procressFirmwareRequest ( MySensorsRawMessage mySensorsRawMessage ) { } private void processFirmwareConfigRequest ( MySensorsRawMessage mySensorsRawMessage ) { } private void responseReqTypeData ( MySensorsRawMessage mySensorsRawMessage ) { } private SensorVariable updateSensorVariable ( MySensorsRawMessage mySensorsRawMessage , Sensor sensor , PAYLOAD_TYPE payloadType ) { } private Sensor getSensor ( MySensorsRawMessage mySensorsRawMessage ) { } private Node getNode ( MySensorsRawMessage mySensorsRawMessage ) { Node node = DaoUtils . getNodeDao ( ) . get ( mySensorsRawMessage . getGatewayId ( ) , mySensorsRawMessage . getNodeEui ( ) ) ; if ( node == null ) { MySensorsMessageEngine . _logger . debug ( "This<seq2seq4repair_space>Node[{}]<seq2seq4repair_space>not<seq2seq4repair_space>available<seq2seq4repair_space>in<seq2seq4repair_space>our<seq2seq4repair_space>DB,<seq2seq4repair_space>Adding..." , mySensorsRawMessage . getNodeEui ( ) ) ; <START_BUG> node = Node . builder ( ) . gateway ( Gateway . builder ( ) . id ( mySensorsRawMessage . getGatewayId ( ) ) . build ( ) ) . eui ( mySensorsRawMessage . getNodeEui ( ) ) . build ( ) ; <END_BUG> node . setLastSeen ( System . currentTimeMillis ( ) ) ; DaoUtils . getNodeDao ( ) . create ( node ) ; node = DaoUtils . getNodeDao ( ) . get ( mySensorsRawMessage . getGatewayId ( ) , mySensorsRawMessage . getNodeEui ( ) ) ; } MySensorsMessageEngine . _logger . debug ( "Node:[{}],<seq2seq4repair_space>message:[{}]" , node , mySensorsRawMessage ) ; return node ; } private void updateNode ( Node node ) { } private void recordSetTypeData ( MySensorsRawMessage mySensorsRawMessage ) { } private void setSensorVariableData ( LOG_LEVEL logLevel , MESSAGE_TYPE type , SensorVariable sensorVariable , MySensorsRawMessage mySensorsRawMessage , String extraMessage ) { } private void setSensorOtherData ( LOG_LEVEL logLevel , MySensorsRawMessage mySensorsRawMessage , String messageSubType , String extraMessage ) { } private void setSensorOtherData ( RESOURCE_TYPE resourceType , Integer resourceId , LOG_LEVEL logLevel , MESSAGE_TYPE messageType , String subType , boolean isTxMessage , String payload , String extraMessage ) { } }

Fix:
node = Node . builder ( ) . gateway ( Gateway . builder ( ) . id ( mySensorsRawMessage . getGatewayId ( ) ) . build ( ) ) . eui ( mySensorsRawMessage . getNodeEui ( ) ) . state ( UP ) . build ( ) ;
Buggy code:
public class NioSocketChannel extends AbstractNioByteChannel implements io . netty . channel . socket . SocketChannel { private static final ChannelMetadata METADATA = new ChannelMetadata ( false ) ; private static final SelectorProvider DEFAULT_SELECTOR_PROVIDER = SelectorProvider . provider ( ) ; private static SocketChannel newSocket ( SelectorProvider provider ) { } private final SocketChannelConfig config ; public NioSocketChannel ( ) { } public NioSocketChannel ( SelectorProvider provider ) { } public NioSocketChannel ( SocketChannel socket ) { } public NioSocketChannel ( Channel parent , SocketChannel socket ) { } @ Override public ServerSocketChannel parent ( ) { } @ Override public ChannelMetadata metadata ( ) { } @ Override public SocketChannelConfig config ( ) { } @ Override protected SocketChannel javaChannel ( ) { } @ Override public boolean isActive ( ) { } @ Override public boolean isInputShutdown ( ) { } @ Override public InetSocketAddress localAddress ( ) { } @ Override public InetSocketAddress remoteAddress ( ) { } @ Override public boolean isOutputShutdown ( ) { } @ Override public ChannelFuture shutdownOutput ( ) { } @ Override public ChannelFuture shutdownOutput ( final ChannelPromise promise ) { } private void shutdownOutput0 ( final ChannelPromise promise ) { } @ Override protected SocketAddress localAddress0 ( ) { } @ Override protected SocketAddress remoteAddress0 ( ) { } @ Override protected void doBind ( SocketAddress localAddress ) throws Exception { } @ Override protected boolean doConnect ( SocketAddress remoteAddress , SocketAddress localAddress ) throws Exception { } @ Override protected void doFinishConnect ( ) throws Exception { } @ Override protected void doDisconnect ( ) throws Exception { } @ Override protected void doClose ( ) throws Exception { } @ Override protected int doReadBytes ( ByteBuf byteBuf ) throws Exception { } @ Override protected int doWriteBytes ( ByteBuf buf ) throws Exception { } @ Override protected long doWriteFileRegion ( FileRegion region ) throws Exception { } @ Override protected void doWrite ( ChannelOutboundBuffer in ) throws Exception { } @ Override protected AbstractNioUnsafe newUnsafe ( ) { } private final class NioSocketChannelUnsafe extends NioByteUnsafe { @ Override protected Executor closeExecutor ( ) { <START_BUG> if ( ( config ( ) . getSoLinger ( ) ) > 0 ) { <END_BUG> return GlobalEventExecutor . INSTANCE ; } return null ; } } private final class NioSocketChannelConfig extends DefaultSocketChannelConfig { private NioSocketChannelConfig ( NioSocketChannel channel , Socket javaSocket ) { } @ Override protected void autoReadCleared ( ) { } } }

Fix:
if ( ( javaChannel ( ) . isOpen ( ) ) && ( ( config ( ) . getSoLinger ( ) ) > 0 ) ) {