nus-yam/ex-repair huggingface dataset:
Buggy code:
public class InstaCountMainActivity extends ActionBarActivity implements NavigationDrawerFragment . NavigationDrawerCallbacks { private NavigationDrawerFragment mNavigationDrawerFragment ; private CharSequence mTitle ; private LoadFromGalleryFragment loadFromGalleryFragment = LoadFromGalleryFragment . newInstance ( 1 ) ; private LoadFromCameraFragment loadFromCameraFragment = LoadFromCameraFragment . newInstance ( 1 ) ; private SettingsFragment settingsFragment = SettingsFragment . newInstance ( 1 ) ; public static final int VERSION_1 = 1 ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public void onNavigationDrawerItemSelected ( int position ) { FragmentManager fragmentManager = getSupportFragmentManager ( ) ; switch ( position ) { case 0 : mTitle = getString ( title_section1 ) ; fragmentManager . beginTransaction ( ) . replace ( container , loadFromGalleryFragment ) . commit ( ) ; break ; case 1 : mTitle = getString ( title_section2 ) ; fragmentManager . beginTransaction ( ) . replace ( container , loadFromCameraFragment ) . commit ( ) ; break ; case 2 : mTitle = getString ( title_section3 ) ; <START_BUG> Intent myIntent = new Intent ( this , CameraRTDetectFragment . class ) ; <END_BUG> this . startActivity ( myIntent ) ; break ; case 3 : mTitle = getString ( title_section4 ) ; fragmentManager . beginTransaction ( ) . replace ( container , settingsFragment ) . commit ( ) ; break ; } } public void restoreActionBar ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override protected void onPause ( ) { } @ Override protected void onResume ( ) { } No newline ; at end ; of file ; }

Fix:
Intent myIntent = new Intent ( this , CameraRTDetectActivity . class ) ;
Buggy code:
public class ConfigListFragment extends ListFragment { public ArrayAdapter customAdapter ; ArrayList array_list = new ArrayList ( ) ; DBHelper mydb ; SendSPA OurSender ; private static final String STATE_ACTIVATED_POSITION = "activated_position" ; private int mActivatedPosition = ListView . INVALID_POSITION ; public interface Callbacks { void onItemSelected ( String id ) { } } private ConfigListFragment . Callbacks sDummyCallbacks = new ConfigListFragment . Callbacks ( ) { @ Override public void onItemSelected ( String id ) { } } ; protected void onNewIntent ( Intent intent ) { } private ConfigListFragment . Callbacks mCallbacks = sDummyCallbacks ; public ConfigListFragment ( ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public void onViewCreated ( View view , Bundle savedInstanceState ) { } @ Override public void onActivityCreated ( Bundle savedInstanceState ) { } @ Override public void onCreateContextMenu ( ContextMenu menu , View v , ContextMenu . ContextMenuInfo menuInfo ) { } @ Override public boolean onContextItemSelected ( MenuItem item ) { } public void onUpdate ( ) { } @ Override public void onAttach ( Activity activity ) { } @ Override public void onDestroy ( ) { super . onDestroy ( ) ; <START_BUG> if ( ! ( ( OurSender . client ) == null ) ) { <END_BUG> OurSender . client . stop ( getActivity ( ) ) ; } } @ Override public void onDetach ( ) { } @ Override public void onListItemClick ( ListView listView , View view , int position , long id ) { } @ Override public void onSaveInstanceState ( Bundle outState ) { } public void setActivateOnItemClick ( boolean activateOnItemClick ) { } private void setActivatedPosition ( int position ) { } }

Fix:
if ( OurSender . isConnected ) {
Buggy code:
public class CpioArchiveInputStream extends ArchiveInputStream implements CpioConstants { private boolean closed = false ; private CpioArchiveEntry entry ; private long entryBytesRead = 0 ; private boolean entryEOF = false ; private final byte [ ] singleByteBuf = new byte [ 1 ] ; private final byte [ ] tmpbuf = new byte [ 4096 ] ; private long crc = 0 ; private final InputStream in ; public CpioArchiveInputStream ( final InputStream in ) { } public int available ( ) throws IOException { } public void close ( ) throws IOException { if ( ! ( this . closed ) ) { <START_BUG> super . close ( ) ; <END_BUG> this . closed = true ; } } public void closeEntry ( ) throws IOException { } private void ensureOpen ( ) throws IOException { } public CpioArchiveEntry getNextCPIOEntry ( ) throws IOException { } private void skip ( int bytes ) throws IOException { } public int read ( ) throws IOException { } public int read ( final byte [ ] b , final int off , final int len ) throws IOException { } private final int readFully ( final byte [ ] b , final int off , final int len ) throws IOException { } private long readBinaryLong ( final int length , final boolean swapHalfWord ) throws IOException { } private long readAsciiLong ( final int length , final int radix ) throws IOException { } private CpioArchiveEntry readNewEntry ( final boolean hasCrc ) throws IOException { } private CpioArchiveEntry readOldAsciiEntry ( ) throws IOException { } private CpioArchiveEntry readOldBinaryEntry ( final boolean swapHalfWord ) throws IOException { } private String readCString ( final int length ) throws IOException { } public long skip ( final long n ) throws IOException { } public ArchiveEntry getNextEntry ( ) throws IOException { } public static boolean matches ( byte [ ] signature , int length ) { } }

Fix:
in . close ( ) ;
Buggy code:
public class QueuelessThreadPoolAdd implements ModelAddOperationHandler { static final OperationHandler INSTANCE = new QueuelessThreadPoolAdd ( ) ; @ Override public OperationResult execute ( final OperationContext context , final ModelNode operation , final ResultHandler resultHandler ) { final QueuelessOperationParameters params = ThreadsSubsystemThreadPoolOperationUtils . parseQueuelessThreadPoolOperationParameters ( operation ) ; final ModelNode model = context . getSubModel ( ) ; model . get ( NAME ) . set ( params . getName ( ) ) ; if ( ( params . getThreadFactory ( ) ) != null ) { model . get ( CommonAttributes . THREAD_FACTORY ) . set ( params . getThreadFactory ( ) ) ; } if ( ( ( params . getProperties ( ) ) != null ) && ( ( params . getProperties ( ) . asList ( ) . size ( ) ) > 0 ) ) { model . get ( CommonAttributes . PROPERTIES ) . set ( params . getProperties ( ) ) ; } if ( ( params . getMaxThreads ( ) ) != null ) { model . get ( CommonAttributes . MAX_THREADS ) . set ( operation . get ( CommonAttributes . MAX_THREADS ) ) ; } if ( ( params . getKeepAliveTime ( ) ) != null ) { model . get ( CommonAttributes . KEEPALIVE_TIME ) . set ( operation . get ( CommonAttributes . KEEPALIVE_TIME ) ) ; } model . get ( CommonAttributes . BLOCKING ) . set ( params . isBlocking ( ) ) ; if ( ( params . getHandoffExecutor ( ) ) != null ) { model . get ( CommonAttributes . HANDOFF_EXECUTOR ) . set ( params . getHandoffExecutor ( ) ) ; } if ( ( context . getRuntimeContext ( ) ) != null ) { context . getRuntimeContext ( ) . setRuntimeTask ( new RuntimeTask ( ) { public void execute ( RuntimeTaskContext context ) throws OperationFailedException { ServiceTarget target = context . getServiceTarget ( ) ; final ServiceName serviceName = ThreadsServices . executorName ( params . getName ( ) ) ; final QueuelessThreadPoolService service = new QueuelessThreadPoolService ( params . getMaxThreads ( ) . getScaledCount ( ) , params . isBlocking ( ) , params . getKeepAliveTime ( ) ) ; final ServiceBuilder < ExecutorService > serviceBuilder = target . addService ( serviceName , service ) ; <START_BUG> ThreadsSubsystemThreadPoolOperationUtils . addThreadFactoryDependency ( params . getThreadFactory ( ) , serviceName , serviceBuilder , service . getThreadFactoryInjector ( ) , target ) ; <END_BUG> serviceBuilder . addListener ( new ResultHandler . ServiceStartListener ( resultHandler ) ) ; serviceBuilder . install ( ) ; } } ) ; } else { resultHandler . handleResultComplete ( ) ; } final ModelNode compensating = Util . getResourceRemoveOperation ( params . getAddress ( ) ) ; return new org . jboss . as . controller . BasicOperationResult ( compensating ) ; } }

Fix:
ThreadsSubsystemThreadPoolOperationUtils . addThreadFactoryDependency ( params . getThreadFactory ( ) , serviceName , serviceBuilder , service . getThreadFactoryInjector ( ) , target , ( ( params . getName ( ) ) + "-threads" ) ) ;
Buggy code:
public class Initializer extends FieldDeclaration { public Block block ; public int lastFieldID ; public int bodyStart ; public Initializer ( Block block , int modifiers ) { } public FlowInfo analyseCode ( MethodScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { if ( ( ( bits ) & ( IsReachableMASK ) ) == 0 ) { return ; } int pc = codeStream . position ; block . generateCode ( currentScope , codeStream ) ; <START_BUG> codeStream . recordPositionsFrom ( pc , this ) ; <END_BUG> } public boolean isField ( ) { } public boolean isStatic ( ) { } public void parseStatements ( Parser parser , TypeDeclaration type , CompilationUnitDeclaration unit ) { } public void resolve ( MethodScope scope ) { } public String toString ( int tab ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , MethodScope scope ) { } }

Fix:
codeStream . recordPositionsFrom ( pc , this . sourceStart ) ;
Buggy code:
public class Shop implements Listener { private static int shopCount = 0 ; private int id ; protected String name ; protected ItemStack [ ] items ; protected ClickHandler handler ; private boolean unregistered = false ; private CannonFighter viewer ; public Shop ( String name , ClickHandler handler , int rows ) { } public Shop ( String name , ClickHandler handler , ItemStack [ ] items ) { } public void unregister ( ) { } public boolean isUnregistered ( ) { } public void set ( int i , ItemStack item ) { } public void fill ( ItemStack item ) { } public void openInventory ( CannonFighter c ) { } @ EventHandler public void onInventoryClick ( final InventoryClickEvent event ) { } @ EventHandler public void onInventoryClose ( InventoryCloseEvent event ) { <START_BUG> if ( ( ! ( event . getInventory ( ) . getName ( ) . equals ( name ) ) ) && ( ( CannonFighter . get ( ( ( OfflinePlayer ) ( event . getPlayer ( ) ) ) ) ) == ( viewer ) ) ) <END_BUG> return ; unregister ( ) ; } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { } }

Fix:
if ( ( ! ( event . getInventory ( ) . getName ( ) . equals ( name ) ) ) && ( ( CannonFighter . get ( ( ( OfflinePlayer ) ( event . getPlayer ( ) ) ) ) ) != ( viewer ) ) )
Buggy code:
public class SplashScreen extends Canvas { public SplashScreen ( ) { } public void dispose ( ) { } public synchronized void advance ( ) { } public void update ( Graphics g ) { } public synchronized void paint ( Graphics g ) { Dimension size = getSize ( ) ; if ( ( offscreenImg ) == null ) { offscreenImg = createImage ( size . width , size . height ) ; offscreenGfx = offscreenImg . getGraphics ( ) ; offscreenGfx . setFont ( getFont ( ) ) ; } offscreenGfx . setColor ( Color . gray ) ; offscreenGfx . drawRect ( 0 , 0 , ( ( size . width ) - 1 ) , ( ( size . height ) - 1 ) ) ; offscreenGfx . drawImage ( image , 1 , 1 , this ) ; offscreenGfx . setColor ( new Color ( 168 , 173 , 189 ) ) ; <START_BUG> offscreenGfx . fillRect ( 1 , ( ( image . getHeight ( this ) ) + 1 ) , ( ( ( ( win . getWidth ( ) ) - 2 ) * ( progress ) ) // 7 ) , SplashScreen . PROGRESS_HEIGHT ) ; <END_BUG> offscreenGfx . setColor ( Color . gray ) ; String str = "Version<seq2seq4repair_space>" + ( jEdit . getVersion ( ) ) ; offscreenGfx . drawString ( str , ( ( ( getWidth ( ) ) - ( fm . stringWidth ( str ) ) ) // 2 ) , ( ( ( ( image . getHeight ( this ) ) + 1 ) - ( fm . getDescent ( ) ) ) - 10 ) ) ; g . drawImage ( offscreenImg , 0 , 0 , this ) ; notify ( ) ; } private FontMetrics fm ; private Window win ; private Image image ; private Image offscreenImg ; private Graphics offscreenGfx ; private int progress ; private static final int PROGRESS_HEIGHT = 20 ; }

Fix:
offscreenGfx . fillRect ( 1 , ( ( image . getHeight ( this ) ) + 1 ) , ( ( ( ( win . getWidth ( ) ) - 2 ) * ( progress ) ) // 6 ) , SplashScreen . PROGRESS_HEIGHT ) ;
Buggy code:
public class Teleop extends Command { public Teleop ( ) { } protected void initialize ( ) { } protected void execute ( ) { <START_BUG> driveSubsystem . drive ( controller . getRawAxis ( 1 ) , controller . getRawAxis ( 2 ) , controller . getRawAxis ( 2 ) ) ; <END_BUG> } protected boolean isFinished ( ) { } protected void end ( ) { } protected void interrupted ( ) { } }

Fix:
driveSubsystem . drive ( controller . getRawAxis ( 0 ) , controller . getRawAxis ( 1 ) , controller . getRawAxis ( 2 ) ) ;
Buggy code:
public class ResourceDatabasePopulator implements DatabasePopulator { private static String DEFAULT_COMMENT_PREFIX = "--" ; private static final Log logger = LogFactory . getLog ( ResourceDatabasePopulator . class ) ; private List < Resource > scripts = new ArrayList < Resource > ( ) ; private String sqlScriptEncoding ; private String commentPrefix = ResourceDatabasePopulator . DEFAULT_COMMENT_PREFIX ; private boolean continueOnError = false ; private boolean ignoreFailedDrops = false ; public void addScript ( Resource script ) { } public void setScripts ( Resource [ ] scripts ) { } public void setSqlScriptEncoding ( String sqlScriptEncoding ) { } public void setCommentPrefix ( String commentPrefix ) { } public void setContinueOnError ( boolean continueOnError ) { } public void setIgnoreFailedDrops ( boolean ignoreFailedDrops ) { } public void populate ( Connection connection ) throws SQLException { } private EncodedResource applyEncodingIfNecessary ( Resource script ) { } private void executeSqlScript ( Connection connection , EncodedResource resource , boolean continueOnError , boolean ignoreFailedDrops ) throws SQLException { } private String readScript ( EncodedResource resource ) throws IOException { } private boolean containsSqlScriptDelimiters ( String script , char delim ) { } private void splitSqlScript ( String script , char delim , List < String > statements ) { StringBuilder sb = new StringBuilder ( ) ; boolean inLiteral = false ; char [ ] content = script . toCharArray ( ) ; for ( int i = 0 ; i < ( script . length ( ) ) ; i ++ ) { char c = content [ i ] ; if ( c == '\'' ) { inLiteral = ! inLiteral ; } if ( ! inLiteral ) { if ( c == delim ) { if ( ( sb . length ( ) ) > 0 ) { statements . add ( sb . toString ( ) ) ; sb = new StringBuilder ( ) ; } continue ; } else if ( ( c == '\n' ) || ( c == '\t' ) ) { <START_BUG> continue ; <END_BUG> } } sb . append ( c ) ; } if ( StringUtils . hasText ( sb ) ) { statements . add ( sb . toString ( ) ) ; } } }

Fix:
c = '<seq2seq4repair_space>' ;
Buggy code:
public class CreationToolMetadata { public CreationToolMetadata ( ) { } public static void main ( String [ ] args ) { try { XMLGregorianCalendar now = DatatypeFactory . newInstance ( ) . newXMLGregorianCalendar ( new GregorianCalendar ( TimeZone . getTimeZone ( "UTC" ) ) ) ; STIXHeaderType header = new STIXHeaderType ( ) . withDescriptions ( new StructuredTextType ( ) . withValue ( "Example" ) ) . withInformationSource ( new InformationSourceType ( ) . withTools ( new ToolsInformationType ( ) . withTools ( new ToolInformationType ( ) . withName ( "org.mitre.stix.examples.CreationToolMetadata" ) . withVendor ( "The<seq2seq4repair_space>MITRE<seq2seq4repair_space>Corporation" ) ) ) ) ; <START_BUG> STIXPackage stixPackage = new STIXPackage ( ) . withSTIXHeader ( header ) . withVersion ( "1.2.0" ) . withTimestamp ( now ) . withId ( new QName ( "http:////example.com//" , ( "package-" + ( UUID . randomUUID ( ) . toString ( ) ) ) , "example" ) ) ; <END_BUG> System . out . println ( stixPackage . toXMLString ( true ) ) ; System . out . println ( StringUtils . repeat ( "-" , 120 ) ) ; System . out . println ( ( "Validates:<seq2seq4repair_space>" + ( stixPackage . validate ( ) ) ) ) ; } catch ( DatatypeConfigurationException e ) { throw new RuntimeException ( e ) ; } } }

Fix:
STIXPackage stixPackage = new STIXPackage ( ) . withSTIXHeader ( header ) . withVersion ( "1.2" ) . withTimestamp ( now ) . withId ( new QName ( "http:////example.com//" , ( "package-" + ( UUID . randomUUID ( ) . toString ( ) ) ) , "example" ) ) ;
Buggy code:
public class AsciiType extends AbstractType < String > { public static final AsciiType instance = new AsciiType ( ) ; AsciiType ( ) { } @ Override public String getString ( ByteBuffer bytes ) { } public int compare ( ByteBuffer o1 , ByteBuffer o2 ) { } public String compose ( ByteBuffer bytes ) { } public ByteBuffer fromString ( String source ) { <START_BUG> return ByteBuffer . wrap ( source . getBytes ( Charsets . US_ASCII ) ) ; <END_BUG> } public void validate ( ByteBuffer bytes ) throws MarshalException { } public Class < String > getType ( ) { } }

Fix:
return ByteBufferUtil . bytes ( source , Charsets . US_ASCII ) ;
Buggy code:
public class AuthServlet extends HttpServlet { public void service ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { Request req = ( ( HttpServletRequestFacade ) ( request ) ) . getRealRequest ( ) ; Context ctx = req . getContext ( ) ; String realm = ctx . getRealmName ( ) ; <START_BUG> if ( "FORM" . equals ( ctx . getAuthMethod ( ) ) ) { <END_BUG> String page = ctx . getFormLoginPage ( ) ; if ( page != null ) { HttpSession session = request . getSession ( true ) ; session . setAttribute ( "tomcat.auth.originalLocation" , req . getRequestURI ( ) ) ; if ( ( ctx . getDebug ( ) ) > 0 ) ctx . log ( ( "Setting<seq2seq4repair_space>orig<seq2seq4repair_space>location<seq2seq4repair_space>" + ( req . getRequestURI ( ) ) ) ) ; if ( ! ( page . startsWith ( "//" ) ) ) page = "//" + page ; response . sendRedirect ( ( ( ctx . getPath ( ) ) + page ) ) ; return ; } } if ( realm == null ) realm = "default" ; response . setHeader ( "WWW-Authenticate" , ( ( "Basic<seq2seq4repair_space>realm=\"" + realm ) + "\"" ) ) ; response . sendError ( SC_UNAUTHORIZED ) ; } }

Fix:
if ( "EXPERIMENTAL_FORM" . equals ( ctx . getAuthMethod ( ) ) ) {
Buggy code:
public class HistoryScreen extends Activity { List < WorkoutDataEntity > workoutHistory ; @ Override public void onCreate ( Bundle savedInstanceState ) { } private class HistoryListAdapter extends BaseAdapter { List < WorkoutDataEntity > data ; public HistoryListAdapter ( List < WorkoutDataEntity > data ) { } @ Override public int getCount ( ) { <START_BUG> return data . size ( ) ; <END_BUG> } @ Override public WorkoutDataEntity getItem ( int i ) { } @ Override public long getItemId ( int i ) { } @ Override public View getView ( int i , View view , ViewGroup viewGroup ) { } } }

Fix:
return ( data ) != null ? data . size ( ) : 0 ;
Buggy code:
public class MethodLocator extends PatternLocator { protected MethodPattern pattern ; protected boolean isDeclarationOfReferencedMethodsPattern ; public char [ ] [ ] [ ] allSuperDeclaringTypeNames ; public MethodLocator ( MethodPattern pattern ) { } public void initializePolymorphicSearch ( MatchLocator locator ) { } protected boolean isVirtualInvoke ( MethodBinding method , MessageSend messageSend ) { } public int match ( ASTNode node , MatchingNodeSet nodeSet ) { } public int match ( MethodDeclaration node , MatchingNodeSet nodeSet ) { } public int match ( MessageSend node , MatchingNodeSet nodeSet ) { if ( ! ( this . pattern . findReferences ) ) return PatternLocator . IMPOSSIBLE_MATCH ; if ( ! ( matchesName ( this . pattern . selector , node . selector ) ) ) return PatternLocator . IMPOSSIBLE_MATCH ; <START_BUG> if ( ( ( this . pattern . parameterSimpleNames ) != null ) && ( this . pattern . shouldCountParameter ( ) ) ) { <END_BUG> int length = this . pattern . parameterSimpleNames . length ; ASTNode [ ] args = node . arguments ; int argsLength = ( args == null ) ? 0 : args . length ; if ( length != argsLength ) return PatternLocator . IMPOSSIBLE_MATCH ; } return nodeSet . addMatch ( node , ( ( ( InternalSearchPattern ) ( this . pattern ) ) . mustResolve ? PatternLocator . POSSIBLE_MATCH : PatternLocator . ACCURATE_MATCH ) ) ; } protected int matchContainer ( ) { } protected void matchLevelAndReportImportRef ( ImportReference importRef , Binding binding , MatchLocator locator ) throws CoreException { } protected int matchMethod ( MethodBinding method ) { } protected void matchReportReference ( ASTNode reference , IJavaElement element , int accuracy , MatchLocator locator ) throws CoreException { } void matchReportReference ( MessageSend messageSend , MatchLocator locator , MethodBinding methodBinding ) throws CoreException { } protected int referenceType ( ) { } protected void reportDeclaration ( MethodBinding methodBinding , MatchLocator locator , SimpleSet knownMethods ) throws CoreException { } public int resolveLevel ( ASTNode possibleMatchingNode ) { } public int resolveLevel ( Binding binding ) { } protected int resolveLevel ( MessageSend messageSend ) { } protected int resolveLevelAsSubtype ( char [ ] qualifiedPattern , ReferenceBinding type ) { } public String toString ( ) { } }

Fix:
if ( ( ( this . pattern . parameterSimpleNames ) != null ) && ( ( this . pattern . shouldCountParameter ( ) ) || ( ( ( node . bits ) & ( ASTNode . InsideJavadoc ) ) != 0 ) ) ) {
Buggy code:
public abstract class LogConverter extends AbstractUnitConverter { protected final double _base ; protected final double _logOfBase ; protected LogConverter ( double base ) { } public double getBase ( ) { } @ Override public boolean isLinear ( ) { } public static final class Log extends LogConverter { public Log ( double base ) { } public UnitConverter inverse ( ) { } public double convert ( double value ) { return ( Math . log ( value ) ) // ( _logOfBase ) ; } } public static final class Exp extends LogConverter { public Exp ( double base ) { } public UnitConverter inverse ( ) { } public double convert ( double value ) { <START_BUG> return ( Math . log ( value ) ) // ( _logOfBase ) ; <END_BUG> } } }

Fix:
return Math . exp ( ( value * ( _logOfBase ) ) ) ;
Buggy code:
public final class Servlet22Interceptor extends BaseInterceptor { public static final String SERVLET_STAMP = "<seq2seq4repair_space>(<seq2seq4repair_space>JSP<seq2seq4repair_space>1.1;<seq2seq4repair_space>Servlet<seq2seq4repair_space>2.2<seq2seq4repair_space>)" ; public Servlet22Interceptor ( ) { } public Servlet22Interceptor ( Context ctx ) { } private void setEngineHeader ( Context ctx ) { } public void contextShutdown ( Context ctx ) throws TomcatException { } public void addContext ( ContextManager cm , Context ctx ) throws TomcatException { } public void addContainer ( Container ct ) throws TomcatException { } public int sessionState ( Request req , ServerSession sess , int newState ) { if ( ( newState == ( ServerSession . STATE_SUSPEND ) ) || ( newState == ( ServerSession . STATE_EXPIRED ) ) ) { HttpSession httpSess = ( ( HttpSession ) ( sess . getFacade ( ) ) ) ; Vector removed = null ; Enumeration e = sess . getAttributeNames ( ) ; while ( e . hasMoreElements ( ) ) { String key = ( ( String ) ( e . nextElement ( ) ) ) ; Object value = sess . getAttribute ( key ) ; if ( value instanceof HttpSessionBindingListener ) { ( ( HttpSessionBindingListener ) ( value ) ) . valueUnbound ( new HttpSessionBindingEvent ( httpSess , key ) ) ; <START_BUG> if ( removed = null ) <END_BUG> removed = new Vector ( ) ; removed . addElement ( key ) ; } } if ( removed != null ) { e = removed . elements ( ) ; while ( e . hasMoreElements ( ) ) { String key = ( ( String ) ( e . nextElement ( ) ) ) ; sess . removeAttribute ( key ) ; } } } return 0 ; } public int postRequest ( Request rreq , Response rres ) { } }

Fix:
if ( removed == null )
Buggy code:
public class ClientWorldLoadedTickHandler extends WorldLoadedTickHandler { @ SubscribeEvent <START_BUG> public void onClientTick ( TickEvent . ServerTickEvent event ) { <END_BUG> GuiScreen guiscreen = Minecraft . getMinecraft ( ) . currentScreen ; World world = Minecraft . getMinecraft ( ) . theWorld ; World [ ] worlds ; if ( world != null ) { worlds = new World [ ] { Minecraft . getMinecraft ( ) . theWorld } ; } else { worlds = new World [ 0 ] ; } if ( guiscreen != null ) { onTickInGUI ( worlds , CLIENT ) ; } else { onTickInGame ( worlds , CLIENT ) ; } } }

Fix:
public void onClientTick ( TickEvent . ClientTickEvent event ) {
Buggy code:
public class main { public static void main ( String [ ] args ) { Machine machine = new Machine ( ) ; boolean result = machine . init ( ) ; if ( result == false ) { System . out . println ( "Error<seq2seq4repair_space>:<seq2seq4repair_space>init" ) ; return ; } <START_BUG> result = machine . loadGame ( "PONG" ) ; <END_BUG> if ( result == false ) { System . out . println ( "Error<seq2seq4repair_space>:<seq2seq4repair_space>loadGame" ) ; return ; } boolean debug = false ; if ( debug ) { machine . debug ( ) ; } machine . run ( ) ; System . out . println ( result ) ; System . out . println ( "done" ) ; } No newline ; at end ; of file ; }

Fix:
result = machine . loadGame ( "PONG2" ) ;
Buggy code:
final class HandlerChainAdd extends AbstractAddStepHandler { static final HandlerChainAdd INSTANCE = new HandlerChainAdd ( ) ; private HandlerChainAdd ( ) { } @ Override protected void performRuntime ( final OperationContext context , final ModelNode operation , final ModelNode model , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers ) throws OperationFailedException { final ServerConfig config = PackageUtils . getServerConfig ( context ) ; if ( config != null ) { final String protocolBindings = HandlerChainAdd . getAttributeValue ( operation , Constants . PROTOCOL_BINDINGS ) ; final PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; final PathElement confElem = address . getElement ( ( ( address . size ( ) ) - 2 ) ) ; final String configType = confElem . getKey ( ) ; final String configName = confElem . getValue ( ) ; final String handlerChainType = address . getElement ( ( ( address . size ( ) ) - 1 ) ) . getKey ( ) ; final String handlerChainId = address . getElement ( ( ( address . size ( ) ) - 1 ) ) . getValue ( ) ; for ( final CommonConfig commonConfig : PackageUtils . getConfigs ( config , configType ) ) { if ( configName . equals ( commonConfig . getConfigName ( ) ) ) { List < UnifiedHandlerChainMetaData > handlerChains ; if ( Constants . PRE_HANDLER_CHAIN . equals ( handlerChainType ) ) { handlerChains = commonConfig . getPreHandlerChains ( ) ; if ( handlerChains == null ) { handlerChains = new LinkedList < UnifiedHandlerChainMetaData > ( ) ; commonConfig . setPreHandlerChains ( handlerChains ) ; } } else if ( Constants . POST_HANDLER_CHAIN . equals ( handlerChainType ) ) { handlerChains = commonConfig . getPostHandlerChains ( ) ; if ( handlerChains == null ) { handlerChains = new LinkedList < UnifiedHandlerChainMetaData > ( ) ; commonConfig . setPostHandlerChains ( handlerChains ) ; } } else { throw WSMessages . MESSAGES . wrongHandlerChainType ( handlerChainType , Constants . PRE_HANDLER_CHAIN , Constants . POST_HANDLER_CHAIN ) ; } UnifiedHandlerChainMetaData handlerChain = HandlerChainAdd . getChain ( handlerChains , handlerChainId ) ; if ( handlerChain != null ) { throw WSMessages . MESSAGES . multipleHandlerChainsWithSameId ( handlerChainType , handlerChainId , configName ) ; } handlerChain = new UnifiedHandlerChainMetaData ( ) ; handlerChain . setId ( handlerChainId ) ; handlerChain . setProtocolBindings ( protocolBindings ) ; handlerChains . add ( handlerChain ) ; if ( ! ( context . isBooting ( ) ) ) { <START_BUG> context . restartRequired ( ) ; <END_BUG> } return ; } } throw WSMessages . MESSAGES . missingConfig ( configName ) ; } } private static UnifiedHandlerChainMetaData getChain ( final List < UnifiedHandlerChainMetaData > handlerChains , final String handlerChainId ) { } private static String getAttributeValue ( final ModelNode node , final String propertyName ) { } @ Override protected void populateModel ( final ModelNode operation , final ModelNode model ) throws OperationFailedException { } }

Fix:
context . reloadRequired ( ) ;
Buggy code:
public final class TopItems { private static final long [ ] NO_IDS = new long [ 0 ] ; private TopItems ( ) { } public static List < RecommendedItem > getTopItems ( int howMany , LongPrimitiveIterator possibleItemIDs , IDRescorer rescorer , TopItems . Estimator < Long > estimator ) throws TasteException { } public static long [ ] getTopUsers ( int howMany , LongPrimitiveIterator allUserIDs , IDRescorer rescorer , TopItems . Estimator < Long > estimator ) throws TasteException { Queue < SimilarUser > topUsers = new PriorityQueue < SimilarUser > ( ( howMany + 1 ) , Collections . reverseOrder ( ) ) ; boolean full = false ; double lowestTopValue = Double . NEGATIVE_INFINITY ; while ( allUserIDs . hasNext ( ) ) { long userID = allUserIDs . next ( ) ; if ( ( rescorer != null ) && ( rescorer . isFiltered ( userID ) ) ) { continue ; } double similarity ; try { similarity = estimator . estimate ( userID ) ; } catch ( NoSuchUserException nsue ) { continue ; } double rescoredSimilarity = ( rescorer == null ) ? similarity : rescorer . rescore ( userID , similarity ) ; if ( ( ! ( Double . isNaN ( rescoredSimilarity ) ) ) && ( ( ! full ) || ( rescoredSimilarity > lowestTopValue ) ) ) { <START_BUG> topUsers . add ( new SimilarUser ( userID , similarity ) ) ; <END_BUG> if ( full ) { topUsers . poll ( ) ; } else if ( ( topUsers . size ( ) ) > howMany ) { full = true ; topUsers . poll ( ) ; } lowestTopValue = topUsers . peek ( ) . getSimilarity ( ) ; } } int size = topUsers . size ( ) ; if ( size == 0 ) { return TopItems . NO_IDS ; } List < SimilarUser > sorted = Lists . newArrayListWithCapacity ( size ) ; sorted . addAll ( topUsers ) ; Collections . sort ( sorted ) ; long [ ] result = new long [ size ] ; int i = 0 ; for ( SimilarUser similarUser : sorted ) { result [ ( i ++ ) ] = similarUser . getUserID ( ) ; } return result ; } public static List < GenericItemSimilarity . ItemItemSimilarity > getTopItemItemSimilarities ( int howMany , Iterator < GenericItemSimilarity . ItemItemSimilarity > allSimilarities ) { } public static List < GenericUserSimilarity . UserUserSimilarity > getTopUserUserSimilarities ( int howMany , Iterator < GenericUserSimilarity . UserUserSimilarity > allSimilarities ) { } public interface Estimator < T > { double estimate ( T thing ) throws TasteException { } } }

Fix:
topUsers . add ( new SimilarUser ( userID , rescoredSimilarity ) ) ;
Buggy code:
public class ConstructorDeclarationPattern extends MethodDeclarationPattern { private char [ ] decodedTypeName ; public ConstructorDeclarationPattern ( char [ ] declaringSimpleName , int matchMode , boolean isCaseSensitive , char [ ] declaringQualification , char [ ] [ ] parameterQualifications , char [ ] [ ] parameterSimpleNames ) { } public void decodeIndexEntry ( IEntryResult entryResult ) { } public void feedIndexRequestor ( IIndexSearchRequestor requestor , int detailLevel , int [ ] references , IndexInput input , IJavaSearchScope scope ) throws IOException { } public char [ ] indexEntryPrefix ( ) { } public boolean matchesBinary ( Object binaryInfo , Object enclosingBinaryInfo ) { } protected boolean matchIndexEntry ( ) { } public String toString ( ) { } public int matchLevel ( AstNode node , boolean resolve ) { if ( ! ( node instanceof ConstructorDeclaration ) ) return IMPOSSIBLE_MATCH ; ConstructorDeclaration constructor = ( ( ConstructorDeclaration ) ( node ) ) ; if ( resolve ) { return this . matchLevel ( constructor . binding ) ; } else { if ( ( ( this . declaringSimpleName ) != null ) && ( ! ( this . matchesName ( this . declaringSimpleName , constructor . selector ) ) ) ) return IMPOSSIBLE_MATCH ; int parameterCount = ( ( this . parameterSimpleNames ) == null ) ? - 1 : this . parameterSimpleNames . length ; if ( parameterCount > ( - 1 ) ) { int argumentCount = ( ( constructor . arguments ) == null ) ? 0 : constructor . arguments . length ; if ( parameterCount != argumentCount ) return IMPOSSIBLE_MATCH ; } <START_BUG> return POSSIBLE_MATCH ; <END_BUG> } } public int matchLevel ( Binding binding ) { } }

Fix:
return this . needsResolve ? POSSIBLE_MATCH : ACCURATE_MATCH ;
Buggy code:
public class LOBTest { public static final String driver = "org.apache.derby.jdbc.EmbeddedDriver" ; public static final String protocol = "jdbc:derby:" ; public static Connection connectAndCreate ( String dbname ) throws Exception { } public static void disconnect ( Connection conn ) throws Exception { } public static void printSQLError ( SQLException e ) { } public static void largeTest ( String [ ] args ) throws Exception { System . out . println ( "connecting" ) ; Connection conn = LOBTest . connectAndCreate ( "LOBdb" ) ; Statement s = conn . createStatement ( ) ; try { System . out . println ( "dropping" ) ; s . executeUpdate ( "DROP<seq2seq4repair_space>TABLE<seq2seq4repair_space>atable" ) ; } catch ( Exception e ) { } System . out . println ( "creating" ) ; s . executeUpdate ( "CREATE<seq2seq4repair_space>TABLE<seq2seq4repair_space>atable<seq2seq4repair_space>(a<seq2seq4repair_space>INT,<seq2seq4repair_space>b<seq2seq4repair_space>LONG<seq2seq4repair_space>VARCHAR<seq2seq4repair_space>FOR<seq2seq4repair_space>BIT<seq2seq4repair_space>DATA)" ) ; conn . commit ( ) ; <START_BUG> File file = new File ( "short.txt" ) ; <END_BUG> int fileLength = ( ( int ) ( file . length ( ) ) ) ; InputStream fin = new FileInputStream ( file ) ; PreparedStatement ps = conn . prepareStatement ( "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>atable<seq2seq4repair_space>VALUES<seq2seq4repair_space>(?,<seq2seq4repair_space>?)" ) ; ps . setInt ( 1 , 1 ) ; ps . setBinaryStream ( 2 , fin , ( - 1 ) ) ; System . out . println ( "inserting" ) ; ps . execute ( ) ; conn . commit ( ) ; System . out . println ( "reading" ) ; ResultSet rs = s . executeQuery ( "SELECT<seq2seq4repair_space>b,<seq2seq4repair_space>octet_length(b)<seq2seq4repair_space>FROM<seq2seq4repair_space>atable<seq2seq4repair_space>WHERE<seq2seq4repair_space>a<seq2seq4repair_space>=<seq2seq4repair_space>1" ) ; while ( rs . next ( ) ) { Clob aclob = rs . getClob ( 1 ) ; InputStream ip = rs . getAsciiStream ( 1 ) ; System . out . println ( ( "octet_length<seq2seq4repair_space>=<seq2seq4repair_space>" + ( rs . getInt ( 2 ) ) ) ) ; } System . out . println ( "disconnecting" ) ; LOBTest . disconnect ( conn ) ; } public static void typeTest ( String [ ] args ) throws Exception { } public static void main ( String [ ] args ) { } public static void printException ( Throwable e ) { } }

Fix:
File file = new File ( "short.utf" ) ;
Buggy code:
public class PresentableViewPart implements IPresentablePart { private final List listeners = new ArrayList ( ) ; private ViewPane pane ; private IPartMenu viewMenu = new IPartMenu ( ) { public void showMenu ( Point location ) { } } ; private final IPropertyListener propertyListenerProxy = new IPropertyListener ( ) { public void propertyChanged ( Object source , int propId ) { } } ; public PresentableViewPart ( ViewPane pane ) { } public void firePropertyChange ( int propertyId ) { } public void addPropertyListener ( final IPropertyListener listener ) { } public String getName ( ) { } public String getTitle ( ) { } public Image getTitleImage ( ) { } public String getTitleToolTip ( ) { } private IViewReference getViewReference ( ) { } public boolean isDirty ( ) { } public void removePropertyListener ( final IPropertyListener listener ) { } public void setBounds ( Rectangle bounds ) { } public void setFocus ( ) { } public void setVisible ( boolean isVisible ) { } public boolean isBusy ( ) { } public Control getToolBar ( ) { } public IPartMenu getMenu ( ) { } public Control getControl ( ) { } public String getTitleStatus ( ) { String title = getTitle ( ) ; String name = getName ( ) ; if ( title . equals ( name ) ) { <START_BUG> return new String ( ) ; <END_BUG> } if ( title . startsWith ( name ) ) { String substr = title . substring ( name . length ( ) , title . length ( ) ) ; substr = substr . trim ( ) ; if ( substr . startsWith ( "(" ) ) { int end = substr . indexOf ( ")" , 1 ) ; if ( end != ( - 1 ) ) { return substr . substring ( 1 , end ) ; } } } return title ; } }

Fix:
return Util . ZERO_LENGTH_STRING ;
Buggy code:
public abstract class AttributeDefinition { private final String name ; private final String xmlName ; private final ModelType type ; private final boolean allowNull ; private final boolean allowExpression ; private final ModelNode defaultValue ; private final MeasurementUnit measurementUnit ; private final String [ ] alternatives ; private final String [ ] requires ; private final ParameterValidator validator ; private final EnumSet < AttributeAccess . Flag > flags ; protected AttributeDefinition ( String name , String xmlName , final ModelNode defaultValue , final ModelType type , final boolean allowNull , final boolean allowExpression , final MeasurementUnit measurementUnit , final ParameterValidator validator , final String [ ] alternatives , final String [ ] requires , final AttributeAccess ... flags ) { } public String getName ( ) { } public String getXmlName ( ) { } public ModelType getType ( ) { } public boolean isAllowNull ( ) { } public boolean isAllowExpression ( ) { } public ModelNode getDefaultValue ( ) { } public MeasurementUnit getMeasurementUnit ( ) { } public ParameterValidator getValidator ( ) { } public String [ ] getAlternatives ( ) { } public String [ ] getRequires ( ) { <START_BUG> return alternatives ; <END_BUG> } public EnumSet < AttributeAccess . Flag > getFlags ( ) { } public boolean isMarshallable ( final ModelNode resourceModel ) { } public boolean isMarshallable ( final ModelNode resourceModel , final boolean marshallDefault ) { } public ModelNode validateOperation ( final ModelNode operationObject ) throws OperationFailedException { } public final void validateAndSet ( final ModelNode operationObject , final ModelNode model ) throws OperationFailedException { } public ModelNode validateResolvedOperation ( final ModelNode operationObject ) throws OperationFailedException { } public boolean isAllowed ( final ModelNode operationObject ) { } public boolean isRequired ( final ModelNode operationObject ) { } public boolean hasAlternative ( final ModelNode operationObject ) { } public abstract void marshallAsElement ( final ModelNode resourceModel , final XMLStreamWriter writer ) throws XMLStreamException { } public ModelNode addResourceAttributeDescription ( final ResourceBundle bundle , final String prefix , final ModelNode resourceDescription ) { } public ModelNode addResourceAttributeDescription ( final ModelNode resourceDescription , final ResourceDescriptionResolver resolver , final Locale locale , final ResourceBundle bundle ) { } public ModelNode addOperationParameterDescription ( final ResourceBundle bundle , final String prefix , final ModelNode operationDescription ) { } public ModelNode addOperationParameterDescription ( final ModelNode resourceDescription , final String operationName , final ResourceDescriptionResolver resolver , final Locale locale , final ResourceBundle bundle ) { } public String getAttributeTextDescription ( final ResourceBundle bundle , final String prefix ) { } private ModelNode getNoTextDescription ( boolean forOperation ) { } }

Fix:
return requires ;
Buggy code:
public class ScheduledThreadPoolMetricsHandler extends ThreadPoolMetricsHandler { public static final List < AttributeDefinition > METRICS = Arrays . asList ( ACTIVE_COUNT , COMPLETED_TASK_COUNT , CURRENT_THREAD_COUNT , LARGEST_THREAD_COUNT , TASK_COUNT ) ; public ScheduledThreadPoolMetricsHandler ( final ServiceName serviceNameBase ) { } @ Override protected void setResult ( OperationContext context , final String attributeName , final Service < ? > service ) throws OperationFailedException { final ScheduledThreadPoolService pool = ( ( ScheduledThreadPoolService ) ( service ) ) ; if ( attributeName . equals ( CommonAttributes . ACTIVE_COUNT ) ) { context . getResult ( ) . set ( pool . getActiveCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . COMPLETED_TASK_COUNT ) ) { context . getResult ( ) . set ( pool . getCompletedTaskCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . CURRENT_THREAD_COUNT ) ) { context . getResult ( ) . set ( pool . getCurrentThreadCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . LARGEST_THREAD_COUNT ) ) { context . getResult ( ) . set ( pool . getLargestThreadCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . TASK_COUNT ) ) { context . getResult ( ) . set ( pool . getTaskCount ( ) ) ; } else { <START_BUG> throw new IllegalStateException ( ( ( "Unsupported<seq2seq4repair_space>attribute<seq2seq4repair_space>'" + attributeName ) + "'" ) ) ; <END_BUG> } } }

Fix:
throw MESSAGES . unsupportedScheduledThreadPoolMetric ( attributeName ) ;
Buggy code:
public class MockWebResponse extends WebResponse { public MockWebResponse ( ) { } private final List < Cookie > cookies = new ArrayList < Cookie > ( ) ; @ Override public void addCookie ( Cookie cookie ) { } @ Override public void clearCookie ( Cookie cookie ) { } public List < Cookie > getCookies ( ) { } private String redirectUrl ; @ Override public void sendRedirect ( String url ) { } public String getRedirectUrl ( ) { } @ Override public boolean isRedirect ( ) { } private Long contentLength ; @ Override public void setContentLength ( long length ) { } public Long getContentLength ( ) { } private String contentType ; @ Override public void setContentType ( String mimeType ) { } public String getContentType ( ) { } private final Map < String , Object > headers = new HashMap < String , Object > ( ) ; @ Override public void setDateHeader ( String name , long date ) { } public long getDateHeader ( String name ) { } @ Override public void setHeader ( String name , String value ) { } public String getHeader ( String name ) { } public boolean hasHeader ( String name ) { } public Set < String > getHeaderNames ( ) { } Integer status ; @ Override public void setStatus ( int sc ) { } public Integer getStatus ( ) { } @ Override public String encodeURL ( CharSequence url ) { } private StringBuilder textResponse ; private ByteArrayOutputStream binaryResponse ; @ Override public void write ( CharSequence sequence ) { } public CharSequence getTextResponse ( ) { } @ Override public void write ( byte [ ] array ) { } public byte [ ] getBinaryResponse ( ) { } String errorMessage ; @ Override public void sendError ( int sc , String msg ) { } public String getErrorMessage ( ) { } @ Override public void flush ( ) { } @ Override public void reset ( ) { } @ Override public Object getContainerResponse ( ) { <START_BUG> return null ; <END_BUG> } }

Fix:
return this ;
Buggy code:
@ Controller @ RequestMapping ( "//category//" ) public class CategoryController { @ Autowired private CategoryService categoryService ; @ RequestMapping ( value = "add" , method = RequestMethod . GET ) public String loadAddCategory ( HttpServletRequest request , Map < String , Object > map ) { } @ RequestMapping ( "list" ) public String listCategory ( Map < String , Object > map ) { } @ RequestMapping ( value = "add" , method = RequestMethod . POST ) public String addCategory ( HttpServletRequest request , @ ModelAttribute ( "category" ) @ Valid Category category , BindingResult result ) { if ( ( ! ( request . isUserInRole ( "ADMIN" ) ) ) && ( request . isUserInRole ( "USER" ) ) ) { return "redirect://403" ; } if ( ( ! ( request . isUserInRole ( "ADMIN" ) ) ) && ( ! ( request . isUserInRole ( "USER" ) ) ) ) { return "redirect://login" ; } if ( result . hasErrors ( ) ) { <START_BUG> return "category" ; <END_BUG> } categoryService . create ( category ) ; return "redirect://category//add" ; } @ RequestMapping ( "//delete//{categoryId}" ) public String deleteCategory ( HttpServletRequest request , @ PathVariable ( "categoryId" ) Long categoryId ) { } }

Fix:
return "addCategory" ;
Buggy code:
public class Applet extends WebComponent implements IResourceListener , IFormSubmitListener { private static final long serialVersionUID = 1L ; private Class appletClass ; private List classes = new ArrayList ( 2 ) ; public Applet ( final String id , final Class appletClass ) { } public Applet ( final String id , final IModel model , final Class appletClass ) { } public void addClass ( final Class c ) { } public Object getAppletModel ( ) { } public void onFormSubmitted ( ) { } public void onResourceRequested ( ) { } public void setAppletModel ( final Object model ) { } protected int getHeight ( ) { } protected int getWidth ( ) { } protected void onComponentTag ( final ComponentTag tag ) { } protected void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { <START_BUG> replaceComponentTagBody ( markupStream , openTag , ( ( ( ( ( ( ( ( "\n<param<seq2seq4repair_space>name=\"getModelUrl\"<seq2seq4repair_space>value=\"" + ( urlFor ( RESOURCE_LISTENER_INTERFACE ) ) ) + "\"//>" ) + "\n<param<seq2seq4repair_space>name=\"setModelUrl\"<seq2seq4repair_space>value=\"" ) + ( urlFor ( INTERFACE ) ) ) + "\"//>" ) + "\n<param<seq2seq4repair_space>name=\"appletClassName\"<seq2seq4repair_space>value=\"" ) + ( appletClass . getName ( ) ) ) + "\"//>\n" ) ) ; <END_BUG> } private void addAppletClass ( final Class appletClass ) { } }

Fix:
replaceComponentTagBody ( markupStream , openTag , ( ( ( ( ( ( ( ( "\n<param<seq2seq4repair_space>name=\"getModelUrl\"<seq2seq4repair_space>value=\"" + ( urlFor ( INTERFACE ) ) ) + "\"//>" ) + "\n<param<seq2seq4repair_space>name=\"setModelUrl\"<seq2seq4repair_space>value=\"" ) + ( urlFor ( IFormSubmitListener . INTERFACE ) ) ) + "\"//>" ) + "\n<param<seq2seq4repair_space>name=\"appletClassName\"<seq2seq4repair_space>value=\"" ) + ( appletClass . getName ( ) ) ) + "\"//>\n" ) ) ;
Buggy code:
public class PropertyFileSnitch extends AbstractRackAwareSnitch implements PropertyFileSnitchMBean { private Properties hostProperties = new Properties ( ) ; private static String RACK_PROPERTY_FILENAME = "cassandra-rack.properties" ; private static Logger logger_ = LoggerFactory . getLogger ( PropertyFileSnitch . class ) ; public PropertyFileSnitch ( ) throws ConfigurationException { } public String [ ] getEndpointInfo ( InetAddress endpoint ) { <START_BUG> String key = endpoint . toString ( ) ; <END_BUG> String value = hostProperties . getProperty ( key ) ; if ( value == null ) { PropertyFileSnitch . logger_ . error ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>end<seq2seq4repair_space>point<seq2seq4repair_space>information<seq2seq4repair_space>for<seq2seq4repair_space>{},<seq2seq4repair_space>will<seq2seq4repair_space>use<seq2seq4repair_space>default." , key ) ; value = hostProperties . getProperty ( "default" ) ; } StringTokenizer st = new StringTokenizer ( value , ":" ) ; if ( ( st . countTokens ( ) ) < 2 ) { PropertyFileSnitch . logger_ . error ( ( ( ( "Value<seq2seq4repair_space>for<seq2seq4repair_space>" + key ) + "<seq2seq4repair_space>is<seq2seq4repair_space>invalid:<seq2seq4repair_space>" ) + value ) ) ; return new String [ ] { "default" , "default" } ; } return new String [ ] { st . nextToken ( ) , st . nextToken ( ) } ; } public String getDatacenter ( InetAddress endpoint ) { } public String getRack ( InetAddress endpoint ) { } public String displayConfiguration ( ) { } public void reloadConfiguration ( ) throws ConfigurationException { } }

Fix:
String key = endpoint . getHostAddress ( ) ;