nus-yam/ex-repair huggingface dataset:
Buggy code:
public class SimpleDimWorldFileParser { private static final String dimensionConfigEntryPattern = "(?<name>[A-z]+[0-9A-z]*)\\s*\\{\\s*" + ( ( ( ( ( ( ( ( "(?=[^{]*?id\\s*:\\s*(?<dimensionId>-?\\d+)\\s*)" + "(?=[^{]*?type\\s*:\\s*(?<type>[A-z]+))" ) + "(?:[^{]*?generator\\s*:\\s*[\'\"](?<generator>.+)[\'\"])?" ) + "(?:[^{]*?spawn\\s*:\\s*\\(?(?<spawnCoords>-?\\d+\\s*,\\s*\\d+\\s*,\\s*-?\\d+\\s*)\\)?)?" ) + "(?:[^{]*?biome\\s*:\\s*(?<biome>[A-z]+))?" ) + "(?:[^{]*?biomeList\\s*:\\s*\\[(?<biomeList>[A-z,<seq2seq4repair_space>]+)])?" ) + "(?:[^{]*?seed\\s*:\\s*(?<seed>(?:0x[0-9a-fA-F]+)|(?:-?\\d+)))?" ) + "(?:[^{]*?loadSpawn\\s*:\\s*(?<loadSpawn>(?:true|false)))?" ) + "(?:[^{]*)\\}" ) ; private Pattern dimensionPattern ; private static final String teleporterConfigEntryPattern = "item<seq2seq4repair_space>(?<name>[A-z]+[0-9A-z_\\-<seq2seq4repair_space>]*?)\\s*\\{\\s*" + ( ( ( ( ( "(?=[^{]*?forDim(?:ension)?\\s*:\\s*(?<forDimension>[A-z]+[A-z0-9]*))" + "(?=[^{]*?type\\s*:\\s*(?<type>[A-z]+))" ) + "(?:[^{]*?colou?rs?\\s*:\\s*\\[(?<colour>(?:(?:0x[0-9a-f-F]+|-?[0-9]+)(?:,<seq2seq4repair_space>)*)+)])?" ) + "(?:[^{]*?variants?\\s*:\\s*\\[(?<variant>[0-9,<seq2seq4repair_space>]+))?" ) + "(?:[^{]*?displayName\\s*:\\s*\"(?<displayName>[A-z0-9_\\-<seq2seq4repair_space>]+)\")?" ) + "(?:[^{]*)\\}" ) ; private Pattern itemPattern ; public SimpleDimWorldFileParser ( ) { } public List < DimensionInfo > parseDimensions ( String contents ) { } public DimensionInfo getDimensionInfoForEntry ( String dimensionDescription ) { } public List < TransportItemInfo > parseTransportItems ( String contents ) { } public TransportItemInfo getTransportItemInfoForEntry ( String dimensionDescription ) { } private DimensionInfo getDimensionInfoFromMatcher ( Matcher matcher ) { } private TransportItemInfo getTransportItemInfoFromMatcher ( Matcher matcher ) { } private BiomeGenBase parseBiomeFromString ( String tmp ) { for ( BiomeGenBase biome : BiomeGenBase . getBiomeGenArray ( ) ) { <START_BUG> if ( biome . biomeName . replace ( "<seq2seq4repair_space>" , "" ) . equalsIgnoreCase ( tmp ) ) { <END_BUG> return biome ; } } LogHelper . warn ( ( ( "Provided<seq2seq4repair_space>biome<seq2seq4repair_space>name<seq2seq4repair_space>'" + tmp ) + "'<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>match<seq2seq4repair_space>any<seq2seq4repair_space>known<seq2seq4repair_space>biomes." ) ) ; return null ; } private BiomeGenBase [ ] parseBiomeListFromString ( String tmp ) { } private byte [ ] parseVariantInfoFromString ( String tmp ) { } private int [ ] parseLayerColoursFromString ( String tmp ) { } }

Fix:
if ( biome . biomeName . equalsIgnoreCase ( tmp ) ) {
Buggy code:
public class JspCompiler extends Jsr199JavaCompiler { @ Override public void init ( JspCompilationContext jspCompilationContext , ErrorDispatcher errorDispatcher , boolean suppressLogging ) { } protected void addBundleWirings ( BundleJavaManager bundleJavaManager ) { } protected void addDependenciesToClassPath ( ) { } protected void addDependencyToClassPath ( Class < ? > clazz ) { } protected void collectTLDMappings ( SAXParser saxParser , Map < String , String [ ] > tldMappings , Bundle bundle ) { } @ Override protected JavaFileManager getJavaFileManager ( JavaFileManager javaFileManager ) { } protected String getTldUri ( SAXParser saxParser , URL url ) { } protected void initClassPath ( ServletContext servletContext ) { } @ SuppressWarnings ( "unchecked" ) protected void initTLDMappings ( ServletContext servletContext ) { } protected URI toURI ( URL url ) throws MalformedURLException , URISyntaxException { String protocol = url . getProtocol ( ) ; if ( protocol . equals ( "reference" ) ) { String file = url . getFile ( ) ; url = new URL ( file ) ; protocol = url . getProtocol ( ) ; } if ( protocol . equals ( "file" ) ) { return url . toURI ( ) ; } else if ( protocol . equals ( "jar" ) ) { String file = url . getFile ( ) ; int pos = file . indexOf ( "!//" ) ; if ( pos != ( - 1 ) ) { <START_BUG> file . substring ( 0 , pos ) ; <END_BUG> } return new URI ( file ) ; } throw new URISyntaxException ( url . toString ( ) , ( "Unknown<seq2seq4repair_space>protocol<seq2seq4repair_space>" + protocol ) ) ; } private static final String [ ] _JSP_COMPILER_DEPENDENCIES = new String [ ] { "com.liferay.portal.kernel.exception.PortalException" , "com.liferay.portal.util.PortalImpl" , "javax.portlet.PortletException" , "javax.servlet.ServletException" } ; private Bundle _bundle ; private BundleContext _bundleContext ; private final List < File > _classPath = new ArrayList < File > ( ) ; private Bundle _jspBundle ; private Logger _logger ; private class URIHandler extends DefaultHandler { @ Override public void characters ( char [ ] c , int start , int length ) { } @ Override public void endElement ( String uri , String localName , String qName ) throws SAXException { } @ Override public InputSource resolveEntity ( String publicId , String systemId ) throws IOException { } @ Override public void startElement ( String uri , String localName , String qName , Attributes attributes ) { } private final Reader _reader = new StringReader ( "" ) ; private StringBuilder _sb ; private boolean inTaglib = false ; private boolean inURI = false ; } private class URISAXException extends SAXException { public URISAXException ( String uri ) { } } No newline ; at end ; of file ; }

Fix:
file = file . substring ( 0 , pos ) ;
Buggy code:
class ReflectiveMethodExecutor implements MethodExecutor { private final Method method ; private final Integer varargsPosition ; private final int [ ] argsRequiringConversion ; public ReflectiveMethodExecutor ( Method theMethod , int [ ] argumentsRequiringConversion ) { } public TypedValue execute ( EvaluationContext context , Object target , Object ... arguments ) throws AccessException { try { if ( ( ( this . argsRequiringConversion ) != null ) && ( arguments != null ) ) { ReflectionHelper . convertArguments ( context . getTypeConverter ( ) , arguments , this . method , this . argsRequiringConversion , this . varargsPosition ) ; } if ( this . method . isVarArgs ( ) ) { arguments = ReflectionHelper . setupArgumentsForVarargsInvocation ( this . method . getParameterTypes ( ) , arguments ) ; } ReflectionUtils . makeAccessible ( this . method ) ; Object value = this . method . invoke ( target , arguments ) ; <START_BUG> return new TypedValue ( value , new org . springframework . core . convert . TypeDescriptor ( new org . springframework . core . MethodParameter ( this . method , ( - 1 ) ) ) . narrowType ( value ) ) ; <END_BUG> } catch ( Exception ex ) { throw new AccessException ( ( "Problem<seq2seq4repair_space>invoking<seq2seq4repair_space>method:<seq2seq4repair_space>" + ( this . method ) ) , ex ) ; } } }

Fix:
return new TypedValue ( value , new org . springframework . core . convert . TypeDescriptor ( new org . springframework . core . MethodParameter ( this . method , ( - 1 ) ) ) . narrow ( value ) ) ;
Buggy code:
public class UMLDeploymentDiagram extends UMLDiagram { protected static Category cat = Category . getInstance ( UMLDeploymentDiagram . class ) ; protected static Action _actionMNode = new CmdCreateNode ( MNode . class , "Node" ) ; protected static Action _actionMNodeInstance = new CmdCreateNode ( MNodeInstance . class , "NodeInstance" ) ; protected static Action _actionMComponent = new CmdCreateNode ( MComponent . class , "Component" ) ; protected static Action _actionMComponentInstance = new CmdCreateNode ( MComponentInstance . class , "ComponentInstance" ) ; protected static Action _actionMClass = new CmdCreateNode ( MClass . class , "Class" ) ; protected static Action _actionMInterface = new CmdCreateNode ( MInterface . class , "Interface" ) ; protected static Action _actionMObject = new CmdCreateNode ( MObject . class , "Object" ) ; protected static Action _actionMDependency = new CmdSetMode ( ModeCreatePolyEdge . class , "edgeClass" , MDependency . class , "Dependency" ) ; protected static Action _actionMAssociation = new CmdSetMode ( ModeCreatePolyEdge . class , "edgeClass" , MAssociation . class , "Association" ) ; protected static Action _actionMLink = new CmdSetMode ( ModeCreatePolyEdge . class , "edgeClass" , MLink . class , "Link" ) ; protected static int _DeploymentDiagramSerial = 1 ; public UMLDeploymentDiagram ( ) { } public UMLDeploymentDiagram ( MNamespace m ) { } public void setNamespace ( MNamespace m ) { } protected void initToolBar ( ) { UMLDeploymentDiagram . cat . debug ( "making<seq2seq4repair_space>deployment<seq2seq4repair_space>toolbar" ) ; _toolBar = new ToolBar ( ) ; _toolBar . putClientProperty ( "JToolBar.isRollover" , Boolean . TRUE ) ; _toolBar . add ( _actionSelect ) ; _toolBar . add ( _actionBroom ) ; _toolBar . addSeparator ( ) ; _toolBar . add ( UMLDeploymentDiagram . _actionMNode ) ; _toolBar . add ( UMLDeploymentDiagram . _actionMNodeInstance ) ; _toolBar . add ( UMLDeploymentDiagram . _actionMComponent ) ; _toolBar . add ( UMLDeploymentDiagram . _actionMComponentInstance ) ; _toolBar . add ( UMLDeploymentDiagram . _actionMDependency ) ; _toolBar . add ( UMLDeploymentDiagram . _actionMAssociation ) ; _toolBar . add ( UMLDeploymentDiagram . _actionMObject ) ; _toolBar . add ( UMLDeploymentDiagram . _actionMLink ) ; _toolBar . addSeparator ( ) ; _toolBar . add ( SINGLETON ) ; _toolBar . addSeparator ( ) ; _toolBar . add ( _actionRectangle ) ; _toolBar . add ( _actionRRectangle ) ; _toolBar . add ( _actionCircle ) ; _toolBar . add ( _actionLine ) ; _toolBar . add ( _actionText ) ; _toolBar . add ( _actionPoly ) ; _toolBar . add ( _actionSpline ) ; _toolBar . add ( _actionInk ) ; _toolBar . addSeparator ( ) ; <START_BUG> _toolBar . add ( _diagramName ) ; <END_BUG> } static final long serialVersionUID = - 375918274062198744L ; protected static String getNewDiagramName ( ) { } }

Fix:
_toolBar . add ( _diagramName . getJComponent ( ) ) ;
Buggy code:
public class FilesystemServiceImpl implements FilesystemService { private Neo4JRestConnection neo4jRestConnection ; private GraphDatabaseService graphDatabaseService ; public FilesystemServiceImpl ( ) { } @ Override public void createNewFilesystem ( String filesystemId , String userId , Map < String , Object > filesystemProperties ) throws DuplicateFilesystem , UserNotFound { } @ Override public void createNewVersion ( String userId , String filesystemId , Map < String , Object > changeMetadata , Map < String , Object > changedProperties ) throws FilesystemNotFound , UserNotFound { } @ Override public void deleteFilesystemTemporarily ( String userId , String filesystemId ) throws FilesystemNotFound , UserNotFound { } @ Override public Map < String , Object > getFilesystem ( String userId , String filesystemId , int version ) throws FilesystemNotFound , UserNotFound , VersionNotFound { try ( Transaction transaction = this . graphDatabaseService . beginTx ( ) ) { Node filesystem = null ; try { <START_BUG> filesystem = new CommonCode ( ) . getVersion ( "filesystem" , userId , filesystemId , null , null , ( - 1 ) ) ; <END_BUG> } catch ( FileNotFound | DirectoryNotFound e ) { } Map < String , Object > filesystemProperties = new HashMap < String , Object > ( ) ; Iterable < String > keys = filesystem . getPropertyKeys ( ) ; for ( String key : keys ) { filesystemProperties . put ( key , filesystem . getProperty ( key ) ) ; } transaction . success ( ) ; return filesystemProperties ; } } }

Fix:
filesystem = new CommonCode ( ) . getVersion ( "filesystem" , userId , filesystemId , null , null , version ) ;
Buggy code:
public final class SerDeUtils { private static final DecoderFactory DIRECT_DECODERS = new DecoderFactory ( ) . configureDirectDecoder ( true ) ; public static byte [ ] copy ( ByteBuffer buff ) { } public static < T extends SpecificRecord > T deserialize ( Schema writer , ByteBuffer bytes , T ob ) throws IOException { } public static < T extends SpecificRecord > ByteBuffer serialize ( T o ) throws IOException { } public static < T extends SpecificRecord > T deserializeWithSchema ( ByteBuffer bytes , T ob ) throws IOException { BinaryDecoder dec = SerDeUtils . DIRECT_DECODERS . createBinaryDecoder ( bytes . array ( ) , ( ( bytes . position ( ) ) + ( bytes . arrayOffset ( ) ) ) , bytes . remaining ( ) , null ) ; Schema writer = Schema . parse ( dec . readString ( new Utf8 ( ) ) . toString ( ) ) ; SpecificDatumReader < T > reader = new SpecificDatumReader < T > ( writer ) ; reader . setExpected ( ob . getSchema ( ) ) ; <START_BUG> return new SpecificDatumReader < T > ( writer ) . read ( ob , dec ) ; <END_BUG> } public static < T extends SpecificRecord > ByteBuffer serializeWithSchema ( T o ) throws IOException { } public static DataInputStream createDataInputStream ( ByteBuffer buff ) { } public static < T > GenericArray < T > createArray ( int size , Schema schema ) { } }

Fix:
return reader . read ( ob , dec ) ;
Buggy code:
public class Image implements Serializable { private static final DateFormat sdf = SimpleDateFormat . getDateInstance ( ) ; private String color ; private String image_src ; private String author ; private Date date ; private Date modified_date ; private float ratio ; private int width ; private int height ; private int featured ; private int category ; private transient Swatch swatch ; public String getColor ( ) { } public void setColor ( String color ) { } public String getUrl ( ) { } public String getHighResImage ( int minWidth , int minHeight ) { <START_BUG> String url = ( image_src ) + "?q=100&fm=jpg" ; <END_BUG> if ( ( minWidth > 0 ) && ( minHeight > 0 ) ) { float phoneRatio = ( 1.0F * minWidth ) // minHeight ; if ( phoneRatio < ( getRatio ( ) ) ) { if ( minHeight < 1080 ) { url = ( url + "&h=" ) + 1080 ; } } else { if ( minWidth < 1920 ) { url = ( url + "&w=" ) + 1920 ; } } } return url ; } public String getImage_src ( int screenWidth ) { } public void setImage_src ( String image_src ) { } public String getAuthor ( ) { } public void setAuthor ( String author ) { } public Date getDate ( ) { } public String getReadableDate ( ) { } public void setDate ( Date date ) { } public Date getModified_date ( ) { } public String getReadableModified_Date ( ) { } public void setModified_date ( Date modified_date ) { } public float getRatio ( ) { } public void setRatio ( float ratio ) { } public int getWidth ( ) { } public void setWidth ( int width ) { } public int getHeight ( ) { } public void setHeight ( int height ) { } public Swatch getSwatch ( ) { } public void setSwatch ( Palette . Swatch swatch ) { } public int getFeatured ( ) { } public void setFeatured ( int featured ) { } public int getCategory ( ) { } public void setCategory ( int category ) { } }

Fix:
String url = ( image_src ) + "?fm=png" ;
Buggy code:
public class MsgUtils { private static final int TIME_FLAGS = ( ( DateUtils . FORMAT_SHOW_TIME ) | ( DateUtils . FORMAT_SHOW_WEEKDAY ) ) | ( DateUtils . FORMAT_ABBREV_WEEKDAY ) ; public static String formatEventVSSubtitle ( Context context , String params ) { } public static String formatIntervalTimeString ( long intervalStart , long intervalEnd , StringBuilder recycle , Context context ) { } public static String getHashtagsString ( String hashtags ) { } public static String getMessagesDrawerItemMessage ( Context context ) { } public static String getTagVSMessage ( String tag , Context context ) { } public static String getCurrencyDescriptionMessage ( Currency currency , Context context ) { } public static String getCertInfoMessage ( X509Certificate certificate , Context context ) { } public static String getCurrencyStateMessage ( Currency currency , Context context ) { } public static String getVotingStateMessage ( EventVSDto . State state , Context context ) { } public static String getAnonymousSignedTransactionOKMsg ( TransactionVSDto transactionRequest , Context context ) { <START_BUG> String toUser = ( ( transactionRequest . getToUser ( ) ) != null ) ? transactionRequest . getToUser ( ) : transactionRequest . getToUserIBAN ( ) . get ( 0 ) ; <END_BUG> return context . getString ( anonymous_signed_transaction_ok_msg , ( ( ( transactionRequest . getAmount ( ) . toString ( ) ) + "<seq2seq4repair_space>" ) + ( transactionRequest . getCurrencyCode ( ) ) ) , toUser ) ; } public static String getCurrencyRequestMessage ( TransactionVSDto transactionDto , Context context ) { } public static String getTransactionVSConfirmMessage ( TransactionVSDto transactionDto , Context context ) { } public static String getVoteVSStateMsg ( VoteVSDto . State voteState , Context context ) { } public static String getUpdateCurrencyWithErrorMsg ( Collection < Currency > currencyWithErrors , Context context ) { } }

Fix:
String toUser = ( ( transactionRequest . getToUser ( ) ) != null ) ? transactionRequest . getToUser ( ) : transactionRequest . getToUserIBAN ( ) . iterator ( ) . next ( ) ;
Buggy code:
public class ExternalClassLoader extends URLClassLoader { public ExternalClassLoader ( URL [ ] urls , ClassLoader parent ) { } public ExternalClassLoader ( URL [ ] urls ) { } public ExternalClassLoader ( URL [ ] urls , ClassLoader parent , URLStreamHandlerFactory factory ) { } public void addURL ( URL url ) { } public Class findClass ( String className ) throws ClassNotFoundException { } public Object instanciate ( String className ) throws Exception { } public Object instanciate ( String className , Object [ ] args ) throws Exception { Class actClass = findClass ( className ) ; Constructor constructor = null ; <START_BUG> if ( ( args . length ) == 0 ) { <END_BUG> constructor = actClass . getConstructors ( ) [ 0 ] ; return constructor . newInstance ( args ) ; } Constructor [ ] list = actClass . getConstructors ( ) ; Class [ ] classes = new Class [ args . length ] ; for ( int i = 0 ; i < ( list . length ) ; i ++ ) { Constructor c = list [ i ] ; Class [ ] parameterTypes = c . getParameterTypes ( ) ; if ( ( parameterTypes . length ) == ( args . length ) ) { boolean success = true ; for ( int j = 0 ; j < ( parameterTypes . length ) ; j ++ ) { Class parameter = parameterTypes [ j ] ; if ( ( args [ j ] ) == null ) success = true ; else if ( ! ( parameter . isAssignableFrom ( args [ j ] . getClass ( ) ) ) ) success = false ; } if ( success ) { constructor = actClass . getConstructor ( parameterTypes ) ; } } } if ( constructor == null ) return null ; return constructor . newInstance ( args ) ; } }

Fix:
if ( ( args == null ) || ( ( args . length ) == 0 ) ) {
Buggy code:
public class BookmarkablePageRequestTargetUrlCodingStrategy extends AbstractRequestTargetUrlCodingStrategy { private final Class bookmarkablePageClass ; private final String pageMapName ; public BookmarkablePageRequestTargetUrlCodingStrategy ( final String mountPath , final Class bookmarkablePageClass , String pageMapName ) { } public IRequestTarget decode ( RequestParameters requestParameters ) { final String parametersFragment = requestParameters . getPath ( ) . substring ( getMountPath ( ) . length ( ) ) ; final PageParameters parameters = new PageParameters ( decodeParameters ( parametersFragment , requestParameters . getParameters ( ) ) ) ; String pageMapName = ( ( String ) ( parameters . remove ( PAGEMAP ) ) ) ; if ( ( requestParameters . getPageMapName ( ) ) == null ) { requestParameters . setPageMapName ( pageMapName ) ; } else { pageMapName = requestParameters . getPageMapName ( ) ; } final BookmarkablePageRequestTarget target ; final String bookmarkableInterfaceListener = ( ( String ) ( parameters . remove ( INTERFACE_PARAMETER_NAME ) ) ) ; if ( bookmarkableInterfaceListener != null ) { final String [ ] pathComponents = Strings . split ( bookmarkableInterfaceListener , PATH_SEPARATOR ) ; if ( ( pathComponents . length ) < 4 ) { throw new wicket . WicketRuntimeException ( ( ( ( "Internal<seq2seq4repair_space>error<seq2seq4repair_space>parsing<seq2seq4repair_space>" + ( WebRequestCodingStrategy . INTERFACE_PARAMETER_NAME ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + bookmarkableInterfaceListener ) ) ; } <START_BUG> final String interfaceName = pathComponents [ ( ( pathComponents . length ) - 1 ) ] ; <END_BUG> int start = ( pageMapName != null ) ? ( pageMapName . length ( ) ) + 1 : 1 ; final String componentPath = bookmarkableInterfaceListener . substring ( start , ( ( ( bookmarkableInterfaceListener . length ( ) ) - ( interfaceName . length ( ) ) ) - 2 ) ) ; target = new wicket . request . target . component . BookmarkableListenerInterfaceRequestTarget ( pageMapName , bookmarkablePageClass , parameters , componentPath , interfaceName ) ; } else { target = new BookmarkablePageRequestTarget ( pageMapName , bookmarkablePageClass , parameters ) ; } return target ; } public final CharSequence encode ( final IRequestTarget requestTarget ) { } public boolean matches ( IRequestTarget requestTarget ) { } public String toString ( ) { } }

Fix:
final String interfaceName = pathComponents [ ( ( pathComponents . length ) - 2 ) ] ;
Buggy code:
public class Bandage extends CItem { int TotalHealAmount ; int TotalHealTime ; boolean StopAtFullHealth ; int healBursts ; public Bandage ( String originalName , ChatColor color , String lDescription , long lCooldown , Material mat ) { } @ Override public boolean effect ( Event event , Player player ) { if ( event instanceof PlayerInteractEvent ) { PlayerInteractEvent e = ( ( PlayerInteractEvent ) ( event ) ) ; if ( e . getAction ( ) . toString ( ) . startsWith ( "RIGHT" ) ) { if ( ( ( ( org . bukkit . entity . Damageable ) ( player ) ) . getHealth ( ) ) != ( ( ( org . bukkit . entity . Damageable ) ( player ) ) . getMaxHealth ( ) ) ) { heal ( player ) ; return true ; } else player . sendMessage ( ( ( ChatColor . RED ) + "You<seq2seq4repair_space>do<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>any<seq2seq4repair_space>wounds<seq2seq4repair_space>to<seq2seq4repair_space>apply<seq2seq4repair_space>the<seq2seq4repair_space>bandage<seq2seq4repair_space>to!" ) ) ; } } else if ( ( event instanceof PlayerInteractEntityEvent ) || ( event instanceof EntityDamageByEntityEvent ) ) { Player toHeal = null ; if ( event instanceof PlayerInteractEntityEvent ) { toHeal = ( ( PlayerInteractEntityEvent ) ( event ) ) . getPlayer ( ) ; } else if ( event instanceof EntityDamageByEntityEvent ) { EntityDamageByEntityEvent e = ( ( EntityDamageByEntityEvent ) ( event ) ) ; if ( ( ( e . getDamager ( ) ) == player ) && ( ( e . getEntity ( ) ) instanceof Player ) ) { <START_BUG> e . setDamage ( ( ( double ) ( 0 ) ) ) ; <END_BUG> toHeal = ( ( Player ) ( e . getEntity ( ) ) ) ; } } if ( toHeal != null ) { if ( ! ( toHeal . hasMetadata ( ( "ce." + ( getOriginalName ( ) ) ) ) ) ) if ( ( ( ( org . bukkit . entity . Damageable ) ( toHeal ) ) . getHealth ( ) ) != ( ( ( org . bukkit . entity . Damageable ) ( toHeal ) ) . getMaxHealth ( ) ) ) { heal ( toHeal ) ; player . sendMessage ( ( ( ( ( ChatColor . GREEN ) + "You<seq2seq4repair_space>have<seq2seq4repair_space>applied<seq2seq4repair_space>a<seq2seq4repair_space>bandage<seq2seq4repair_space>on<seq2seq4repair_space>" ) + ( toHeal . getName ( ) ) ) + "." ) ) ; toHeal . sendMessage ( ( ( ( ChatColor . GREEN ) + ( player . getName ( ) ) ) + "<seq2seq4repair_space>has<seq2seq4repair_space>applied<seq2seq4repair_space>a<seq2seq4repair_space>bandage<seq2seq4repair_space>on<seq2seq4repair_space>you." ) ) ; return true ; } else player . sendMessage ( ( ( ChatColor . RED ) + "Your<seq2seq4repair_space>target<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>any<seq2seq4repair_space>wounds<seq2seq4repair_space>to<seq2seq4repair_space>apply<seq2seq4repair_space>the<seq2seq4repair_space>bandage<seq2seq4repair_space>to!" ) ) ; else player . sendMessage ( ( ( ChatColor . RED ) + "Your<seq2seq4repair_space>target<seq2seq4repair_space>is<seq2seq4repair_space>already<seq2seq4repair_space>using<seq2seq4repair_space>a<seq2seq4repair_space>bandage!" ) ) ; } } return false ; } @ Override public void initConfigEntries ( ) { } private void heal ( final Player p ) { } }

Fix:
e . setDamage ( 0 ) ;
Buggy code:
public class JMSSubsystemElement extends AbstractSubsystemElement < JMSSubsystemElement > { private static final long serialVersionUID = 3225118788089921849L ; public static final ServiceName JMS = JBOSS_MESSAGING . append ( "jms" ) ; public static final ServiceName JMS_MANAGER = JMSSubsystemElement . JMS . append ( "manager" ) ; public static final ServiceName JMS_QUEUE_BASE = JMSSubsystemElement . JMS . append ( "queue" ) ; public static final ServiceName JMS_TOPIC_BASE = JMSSubsystemElement . JMS . append ( "topic" ) ; public static final ServiceName JMS_CF_BASE = JMSSubsystemElement . JMS . append ( "connection-factory" ) ; private final NavigableMap < String , JMSQueueElement > queues = new TreeMap < String , JMSQueueElement > ( ) ; private final NavigableMap < String , JMSTopicElement > topics = new TreeMap < String , JMSTopicElement > ( ) ; private final NavigableMap < String , ConnectionFactoryElement > connectionFactories = new TreeMap < String , ConnectionFactoryElement > ( ) ; protected JMSSubsystemElement ( ) { } protected void getUpdates ( List < ? super AbstractSubsystemUpdate < JMSSubsystemElement , ? > > list ) { } protected boolean isEmpty ( ) { } protected JMSSubsystemAdd getAdd ( ) { } protected < P > void applyRemove ( UpdateContext context , UpdateResultHandler < ? super Void , P > resultHandler , P param ) { <START_BUG> final ServiceController < ? > service = context . getServiceContainer ( ) . getService ( JMSSubsystemElement . JMS_MANAGER ) ; <END_BUG> if ( service == null ) { resultHandler . handleSuccess ( null , param ) ; } else { service . addListener ( new UpdateResultHandler . ServiceRemoveListener < P > ( resultHandler , param ) ) ; } } boolean addConnectionFactory ( final ConnectionFactoryElement cf ) { } public ConnectionFactoryElement getConnectionFactory ( final String name ) { } boolean removeConnectionFactory ( final String name ) { } JMSQueueElement addQueue ( final String name ) { } public JMSQueueElement getQueue ( final String name ) { } boolean removeQueue ( final String name ) { } JMSTopicElement addTopic ( final String name ) { } public JMSTopicElement getTopic ( final String name ) { } boolean removeTopic ( final String name ) { } protected Class < JMSSubsystemElement > getElementClass ( ) { } public void writeContent ( XMLExtendedStreamWriter streamWriter ) throws XMLStreamException { } }

Fix:
final ServiceController < ? > service = context . getServiceRegistry ( ) . getService ( JMSSubsystemElement . JMS_MANAGER ) ;
Buggy code:
public class FunctionSymbol extends Symbol { public String returnType ; public List < VariableSymbol > parameters = new ArrayList < > ( ) ; @ Override public String toString ( ) { <START_BUG> return ( ( ( ( ( "Function<" + ( returnType ) ) + ",<seq2seq4repair_space>" ) + ( name ) ) + ",<seq2seq4repair_space>" ) + ( parameters ) ) + ">" ; <END_BUG> } }

Fix:
return ( ( ( returnType ) + "<seq2seq4repair_space>" ) + ( name ) ) + ( parameters ) ;
Buggy code:
public class IndexerAgent extends AbstractAgent { private static final Logger LOG = Logger . getLogger ( IndexerAgent . class . getName ( ) ) ; @ Override public void run ( Config config ) throws IOException { } private boolean index ( Date date , Feed feed , URL url , Config config ) { } private SearchDocument createSearchDocument ( FSObject file ) throws IOException { Properties props = PropertiesHelper . load ( file ) ; String url = props . getProperty ( Context . URL ) ; try { List < Tag > keywords = PropertiesHelper . getTags ( KEYWORDS , props ) ; List < Tag > people = PropertiesHelper . getTags ( PEOPLE , props ) ; List < Tag > tags = new ArrayList < > ( ) ; tags . addAll ( keywords ) ; tags . addAll ( people ) ; SearchDocument doc = new SearchDocument ( ) ; doc . date = this . date ; doc . url = new URL ( url ) ; doc . title = props . getProperty ( TITLE ) ; doc . keywords = toList ( tags ) ; doc . language = new Locale ( props . getProperty ( LANGUAGE ) ) ; return doc ; } catch ( MalformedURLException e ) { <START_BUG> IndexerAgent . LOG . log ( Level . WARNING , ( "Invalid<seq2seq4repair_space>URL:<seq2seq4repair_space>" + url ) , e ) ; <END_BUG> return null ; } } private List < String > toList ( List < Tag > tags ) { } }

Fix:
IndexerAgent . LOG . log ( Level . WARNING , ( ( ( "Invalid<seq2seq4repair_space>URL:<seq2seq4repair_space>" + url ) + "<seq2seq4repair_space>-<seq2seq4repair_space>meta=" ) + props ) , e ) ;
Buggy code:
@ UseEngine ( Type . COMPUTER ) public class ComputerGraphTest extends AbstractGremlinTest { @ Test @ FeatureRequirement ( featureClass = VertexFeatures . class , feature = VertexFeatures . FEATURE_ADD_VERTICES ) public void shouldFilterHiddenProperties ( ) { } @ Test <START_BUG> @ Ignore <END_BUG> @ FeatureRequirement ( featureClass = VertexFeatures . class , feature = VertexFeatures . FEATURE_ADD_VERTICES ) public void shouldAccessHiddenProperties ( ) { final ComputerGraph sg = new ComputerGraph ( graph , new HashSet ( new HashSet ( Arrays . asList ( "***hidden-guy" ) ) ) ) ; final Vertex v = sg . addVertex ( "***hidden-guy" , "X" , "not-hidden-guy" , "Y" ) ; final Iterator < VertexProperty < String > > props = v . properties ( "***hidden-guy" ) ; final VertexProperty < String > v1 = props . next ( ) ; assertEquals ( "X" , v1 . value ( ) ) ; assertEquals ( "***hidden-guy" , v1 . key ( ) ) ; assertFalse ( props . hasNext ( ) ) ; final Iterator < String > values = v . values ( "***hidden-guy" ) ; assertEquals ( "X" , values . next ( ) ) ; assertFalse ( values . hasNext ( ) ) ; } @ Test @ FeatureRequirement ( featureClass = VertexFeatures . class , feature = VertexFeatures . FEATURE_ADD_VERTICES ) public void shouldHideHiddenKeys ( ) { } }

Fix:
@ Ignore ( "We<seq2seq4repair_space>need<seq2seq4repair_space>to<seq2seq4repair_space>decide<seq2seq4repair_space>the<seq2seq4repair_space>semantics" )
Buggy code:
public class App { public static void main ( String [ ] args ) { <START_BUG> System . out . println ( "My<seq2seq4repair_space>first<seq2seq4repair_space>maven<seq2seq4repair_space>project!" ) ; <END_BUG> } }

Fix:
System . out . println ( "My<seq2seq4repair_space>first<seq2seq4repair_space>maven<seq2seq4repair_space>project" ) ;
Buggy code:
public class ExampleSampler extends AbstractSampler { protected static Logger log = LoggingManager . getLoggerForClass ( ) ; public static final String DATA = "ExampleSampler.data" ; private static transient int classCount = 0 ; public ExampleSampler ( ) { } public SampleResult sample ( Entry e ) { trace ( "sample()" ) ; SampleResult res = new SampleResult ( ) ; boolean isOK = false ; String data = getData ( ) ; String response = null ; res . setSampleLabel ( getTitle ( ) ) ; res . sampleStart ( ) ; try { response = Thread . currentThread ( ) . getName ( ) ; res . setSamplerData ( data ) ; res . setResponseData ( response . getBytes ( ) ) ; res . setDataType ( TEXT ) ; <START_BUG> res . setResponseCode ( "200" ) ; <END_BUG> res . setResponseMessage ( "OK" ) ; isOK = true ; } catch ( Exception ex ) { ExampleSampler . log . debug ( "" , ex ) ; res . setResponseCode ( "500" ) ; res . setResponseMessage ( ex . toString ( ) ) ; } res . sampleEnd ( ) ; res . setSuccessful ( isOK ) ; return res ; } private String getTitle ( ) { } public String getData ( ) { } private void trace ( String s ) { } }

Fix:
res . setResponseCodeOK ( ) ;
Buggy code:
public class TableColumn extends Item { Table parent ; boolean resizable ; boolean moveable ; String toolTipText ; int id ; public TableColumn ( Table parent , int style ) { } public TableColumn ( Table parent , int style , int index ) { } public void addControlListener ( ControlListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } void destroyWidget ( ) { } public int getAlignment ( ) { } String getNameText ( ) { } public Table getParent ( ) { } public boolean getMoveable ( ) { } public boolean getResizable ( ) { } public String getToolTipText ( ) { } public int getWidth ( ) { } public void pack ( ) { } void releaseHandle ( ) { } void releaseParent ( ) { } public void removeControlListener ( ControlListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void setAlignment ( int alignment ) { } public void setImage ( Image image ) { } void setImage ( Image image , boolean sort , boolean right ) { } public void setMoveable ( boolean moveable ) { } public void setResizable ( boolean resizable ) { } void setSortDirection ( int direction ) { } public void setText ( String string ) { checkWidget ( ) ; if ( string == null ) error ( ERROR_NULL_ARGUMENT ) ; if ( string . equals ( text ) ) return ; int index = parent . indexOf ( this ) ; if ( index == ( - 1 ) ) return ; super . setText ( string ) ; int hwnd = parent . handle ; LVCOLUMN lvColumn = new LVCOLUMN ( ) ; lvColumn . mask = OS . LVCF_FMT ; OS . SendMessage ( hwnd , LVM_GETCOLUMN , index , lvColumn ) ; int hHeap = OS . GetProcessHeap ( ) ; <START_BUG> TCHAR buffer = new TCHAR ( parent . getCodePage ( ) , fixMnemonic ( string ) , true ) ; <END_BUG> int byteCount = ( buffer . length ( ) ) * ( TCHAR . sizeof ) ; int pszText = OS . HeapAlloc ( hHeap , HEAP_ZERO_MEMORY , byteCount ) ; OS . MoveMemory ( pszText , buffer , byteCount ) ; lvColumn . mask |= OS . LVCF_TEXT ; lvColumn . pszText = pszText ; int result = OS . SendMessage ( hwnd , LVM_SETCOLUMN , index , lvColumn ) ; if ( pszText != 0 ) OS . HeapFree ( hHeap , 0 , pszText ) ; if ( result == 0 ) error ( ERROR_CANNOT_SET_TEXT ) ; } public void setToolTipText ( String string ) { } public void setWidth ( int width ) { } void updateToolTip ( int index ) { } }

Fix:
TCHAR buffer = new TCHAR ( parent . getCodePage ( ) , fixMnemonic ( string , true ) , true ) ;
Buggy code:
public class ItemGrapeSoda extends ItemDrink { int potionLength = 0 ; public ItemGrapeSoda ( int amount , float saturation , boolean isWolfFood , int potionLength ) { } public ItemGrapeSoda ( int amount , float saturation , boolean isWolfFood ) { } protected void onFoodEaten ( ItemStack stack , World worldIn , EntityPlayer player ) { if ( ( ! ( worldIn . isRemote ) ) && ( ( this . potionLength ) != 0 ) ) { <START_BUG> player . addPotionEffect ( new net . minecraft . potion . PotionEffect ( fireResistance . id , this . potionLength , 0 ) ) ; <END_BUG> } } public ItemStack onItemUseFinish ( ItemStack stack , World worldIn , EntityPlayer playerIn ) { } }

Fix:
player . addPotionEffect ( new net . minecraft . potion . PotionEffect ( jump . id , this . potionLength , 0 ) ) ;
Buggy code:
@ Service public class TimeServiceImpl implements TimeService { @ Autowired private AccountRepository accountRepository ; @ Autowired private TimeRepository timeRepository ; public TimeServiceImpl ( ) { } @ Override public ResponseEntity < TimeStamp > addNowTime ( String id ) { } @ Override public ResponseEntity < TimeStamp > addTime ( String id , TimeStamp newStamp ) { } @ Override public ResponseEntity < TimeStamp > deleteTime ( String id , String stampId ) { } @ Override public ResponseEntity < ArrayList < TimeStamp > > getAll ( String id ) { } @ Override public ResponseEntity < TimeStamp > getTime ( String id , String stampId ) { } @ Override public ResponseEntity < TimeStamp > updateTime ( String id , String stampId , TimeStamp updateStamp ) { TimeStamp timeToUpdate = timeRepository . findOne ( stampId ) ; Calendar cal = new GregorianCalendar ( ) ; if ( ( updateStamp . getDate ( ) ) != null ) { <START_BUG> long date = Long . parseLong ( updateStamp . getDate ( ) . toString ( ) ) ; <END_BUG> cal . setTimeInMillis ( date ) ; timeToUpdate . setDate ( cal ) ; } timeToUpdate . setCheckIn ( updateStamp . getCheckIn ( ) ) ; if ( ( updateStamp . getRfidkey ( ) ) != null ) { timeToUpdate . setRfidkey ( new org . demo . model . RfidKey ( updateStamp . getRfidkey ( ) . toString ( ) ) ) ; } timeRepository . save ( timeToUpdate ) ; System . out . println ( ( "Updated<seq2seq4repair_space>time:<seq2seq4repair_space>" + timeToUpdate ) ) ; return new ResponseEntity ( timeToUpdate , HttpStatus . OK ) ; } }

Fix:
long date = updateStamp . getDate ( ) . getTimeInMillis ( ) ;
Buggy code:
class QueueService implements Service < Void > { private final InjectedValue < HornetQServer > hornetQService = new InjectedValue < HornetQServer > ( ) ; private final CoreQueueConfiguration queueConfiguration ; private final boolean temporary ; public QueueService ( final CoreQueueConfiguration queueConfiguration , final boolean temporary ) { } @ Override public synchronized void start ( StartContext context ) throws StartException { } @ Override public synchronized void stop ( StopContext context ) { try { final HornetQServer hornetQService = this . hornetQService . getValue ( ) ; <START_BUG> hornetQService . destroyQueue ( new org . hornetq . api . core . SimpleString ( queueConfiguration . getName ( ) ) , null ) ; <END_BUG> } catch ( Exception e ) { MessagingLogger . MESSAGING_LOGGER . failedToDestroy ( "queue" , queueConfiguration . getName ( ) ) ; } } @ Override public Void getValue ( ) throws IllegalStateException { } InjectedValue < HornetQServer > getHornetQService ( ) { } }

Fix:
hornetQService . destroyQueue ( new org . hornetq . api . core . SimpleString ( queueConfiguration . getName ( ) ) , null , false ) ;
Buggy code:
@ RunWith ( SpringJUnit4ClassRunner . class ) @ ContextConfiguration ( locations = { "//testExecutionServiceContext.xml" } ) @ Transactional public class ReleaseFilesDataLoaderTestHarness { @ Resource ( name = "snomedDataSource" ) private DataSource snomedDataSource ; @ Autowired private ReleaseDataManager releaseDataManager ; private final String intFilePath = "//Users//mchu//SNOMED_Releases//SnomedCT_RF2Release_INT_20150131.zip" ; private final String extentionFilePath = "//Users//mchu//SNOMED_Releases//SnomedCT_SpanishRelease_INT_20141031.zip" ; @ Test public void testLoadSctData ( ) throws Exception { assert ( snomedDataSource ) != null ; final File intFile = new File ( intFilePath ) ; final File extentionFile = new File ( extentionFilePath ) ; assertNotNull ( extentionFile ) ; final String versionName = "test_20150131" ; <START_BUG> releaseDataManager . loadSnomedData ( versionName , intFile ) ; <END_BUG> try ( Connection connection = snomedDataSource . getConnection ( ) ; ResultSet catalogs = connection . getMetaData ( ) . getCatalogs ( ) ) { boolean exists = false ; while ( catalogs . next ( ) ) { final String catalogName = catalogs . getString ( 1 ) ; if ( catalogName . equals ( versionName ) ) { exists = true ; break ; } } assertTrue ( ( "Schema<seq2seq4repair_space>name<seq2seq4repair_space>must<seq2seq4repair_space>exist<seq2seq4repair_space>:<seq2seq4repair_space>" + versionName ) , exists ) ; } } }

Fix:
releaseDataManager . loadSnomedData ( versionName , intFile , extentionFile ) ;
Buggy code:
public class Board implements Cloneable { private String sessionName ; private Square [ ] [ ] board ; private static final int MAX_ROW = 10 ; private static final int MAX_COL = 9 ; private static final int MIN = 0 ; private static final int ZERO = 0 ; private static final int ONE = 1 ; private static final int TWO = 2 ; private static final int THREE = 3 ; private static final int FOUR = 4 ; private static final int FIVE = 5 ; private static final int SIX = 6 ; private static final int SEVEN = 7 ; private static final int EIGHT = 8 ; private static final int NINE = 9 ; private Piece redGeneral ; private Piece blackGeneral ; private int moveCounter ; public Board ( ) { } public String getSessionName ( ) { } public void setSessionName ( String id ) { } public Square [ ] [ ] getSquareMatrix ( ) { } public void setSquareMatrix ( Square [ ] [ ] board ) { } public boolean onBoard ( int targetRow , int targetCol ) { } public void increaseMoveCounter ( ) { } public int getMoveCounter ( ) { } public void setMoveCounter ( int moveCounter ) { } public Piece getRedGeneral ( ) { } public Piece getBlackGeneral ( ) { } public void setRedGeneral ( Piece redGeneral ) { } public void setBlackGeneral ( Piece blackGeneral ) { } public void setPiecesRed ( ) { } public void setPiecesBlack ( ) { } public void fillBoard ( ) { } @ Override public Board clone ( ) throws CloneNotSupportedException { Board b = new Board ( ) ; b . moveCounter = moveCounter ; b . setSessionName ( this . sessionName ) ; b . fillBoard ( ) ; for ( int i = 0 ; i < ( Board . MAX_ROW ) ; ++ i ) { for ( int o = 0 ; o < ( Board . MAX_COL ) ; ++ o ) { if ( ( board [ i ] [ o ] . getPiece ( ) ) == null ) { board [ i ] [ o ] = new Square ( null ) ; } else { Piece p = board [ i ] [ o ] . getPiece ( ) ; <START_BUG> b . board [ i ] [ o ] = new Square ( p . clone ( ) ) ; <END_BUG> } } } b . redGeneral = findGeneral ( RED ) ; b . blackGeneral = findGeneral ( BLACK ) ; return b ; } private PieceGeneral findGeneral ( Player color ) { } public static int getMaxRow ( ) { } public static int getMaxCol ( ) { } @ Override public String toString ( ) { } }

Fix:
b . board [ i ] [ o ] = new Square ( ( ( Piece ) ( p . clone ( ) ) ) ) ;
Buggy code:
public class Ant extends AntBase { private File antFile ; private File baseDir ; private File outputFile ; public void setAntFile ( File antFile ) { } public void setDir ( File baseDir ) { } public void setOutput ( File outputFile ) { } public void execute ( ) throws ExecutionException { if ( ( baseDir ) == null ) { <START_BUG> baseDir = getContext ( ) . getBaseDir ( ) ; <END_BUG> } if ( ( antFile ) == null ) { antFile = new File ( baseDir , "build.ant" ) ; if ( ! ( antFile . exists ( ) ) ) { antFile = new File ( baseDir , "build.xml" ) ; } } setProperty ( BASEDIR , baseDir . getAbsolutePath ( ) ) ; ExecService execService = ( ( ExecService ) ( getCoreService ( ExecService . class ) ) ) ; execService . runBuild ( antFile , getProperties ( ) , getTargets ( ) ) ; } }

Fix:
baseDir = getAntContext ( ) . getBaseDir ( ) ;
Buggy code:
public class DBlogger { Connection connection = null ; public static final String TABLENAME = "sensordata" ; public DBlogger ( String serverIP , String dbName , String user , String password ) { } public Connection getConnection ( ) { } public void log ( DS18B20 sensor ) { Statement stmt = null ; try { stmt = connection . createStatement ( ) ; if ( sensor != null ) try { <START_BUG> stmt . execute ( ( ( ( ( ( ( "insert<seq2seq4repair_space>into<seq2seq4repair_space>" + ( DBlogger . TABLENAME ) ) + "<seq2seq4repair_space>(timestamp,temp,pressure)<seq2seq4repair_space>Values<seq2seq4repair_space>(now()," ) + ( sensor . getTemperature ( ) ) ) + "," ) + 0 ) + ")" ) ) ; <END_BUG> } catch ( IOException ex ) { Logger . getLogger ( DBlogger . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } else stmt . execute ( ( ( "insert<seq2seq4repair_space>into<seq2seq4repair_space>" + ( DBlogger . TABLENAME ) ) + "<seq2seq4repair_space>(timestamp,temp,pressure)<seq2seq4repair_space>Values<seq2seq4repair_space>(now(),-1,0)" ) ) ; } catch ( SQLException ex ) { Logger . getLogger ( DBlogger . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } finally { try { stmt . close ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } limit ( 10000 ) ; } public void close ( ) { } public static void main ( String [ ] args ) { } private void limit ( int max ) { } private void createTable ( ) { } }

Fix:
stmt . execute ( ( ( ( ( ( ( "insert<seq2seq4repair_space>into<seq2seq4repair_space>" + ( DBlogger . TABLENAME ) ) + "<seq2seq4repair_space>(timestamp,temp,pressure)<seq2seq4repair_space>Values<seq2seq4repair_space>(now()," ) + ( sensor . getTemperature ( ) . getTemperature ( ) ) ) + "," ) + 0 ) + ")" ) ) ;
Buggy code:
public class FilterSet extends DataType implements Cloneable { public static class Filter { String token ; String value ; public Filter ( String token , String value ) { } public Filter ( ) { } public void setToken ( String token ) { } public void setValue ( String value ) { } public String getToken ( ) { } public String getValue ( ) { } } public class FiltersFile { public FiltersFile ( ) { } public void setFile ( File file ) { } } public static final String DEFAULT_TOKEN_START = "@" ; public static final String DEFAULT_TOKEN_END = "@" ; private String startOfToken = FilterSet . DEFAULT_TOKEN_START ; private String endOfToken = FilterSet . DEFAULT_TOKEN_END ; private Vector filters = new Vector ( ) ; public FilterSet ( ) { } protected FilterSet ( FilterSet filterset ) { } protected Vector getFilters ( ) { } protected FilterSet getRef ( ) { } public Hashtable getFilterHash ( ) { int filterSize = getFilters ( ) . size ( ) ; <START_BUG> Hashtable filterHash = new Hashtable ( filterSize ) ; <END_BUG> for ( Enumeration e = getFilters ( ) . elements ( ) ; e . hasMoreElements ( ) ; ) { FilterSet . Filter filter = ( ( FilterSet . Filter ) ( e . nextElement ( ) ) ) ; filterHash . put ( filter . getToken ( ) , filter . getValue ( ) ) ; } return filterHash ; } public void setFiltersfile ( File filtersFile ) throws BuildException { } public void setBeginToken ( String startOfToken ) { } public String getBeginToken ( ) { } public void setEndToken ( String endOfToken ) { } public String getEndToken ( ) { } public void readFiltersFromFile ( File filtersFile ) throws BuildException { } public String replaceTokens ( String line ) { } private Vector passedTokens ; private boolean duplicateToken = false ; private String replaceTokens ( String line , String parent ) throws BuildException { } public void addFilter ( FilterSet . Filter filter ) { } public FilterSet . FiltersFile createFiltersfile ( ) { } public void addFilter ( String token , String value ) { } public void addConfiguredFilterSet ( FilterSet filterSet ) { } public boolean hasFilters ( ) { } public Object clone ( ) throws BuildException { } }

Fix:
Hashtable filterHash = new Hashtable ( ( filterSize + 1 ) ) ;
Buggy code:
public class Translator { private String line = "" ; private Labels labels ; private ArrayList < Instruction > program ; private String fileName ; private static final String SRC = "src" ; private static final Class < ? > [ ] PARAMS_SIII = new Class < ? > [ ] { String . class , int . class , int . class , int . class } ; private static final Class < ? > [ ] PARAMS_SII = new Class < ? > [ ] { String . class , int . class , int . class } ; private static final Class < ? > [ ] PARAMS_SIS = new Class < ? > [ ] { String . class , int . class , String . class } ; private static final Class < ? > [ ] PARAMS_SI = new Class < ? > [ ] { String . class , int . class } ; public Translator ( String fileName ) { } public boolean readAndTranslate ( Labels lab , ArrayList < Instruction > prog ) { } public Instruction getInstruction ( String label ) { } private boolean pTypesMatch ( Class < ? > [ ] pTypes , Class < ? > [ ] gTypes ) { } private void throwIfNotValid ( int parseInt , String instruction ) { } private void throwIfNotValid ( String parseStr , String instruction ) { <START_BUG> if ( parseStr == "" ) <END_BUG> throwIfNotValid ( Integer . MAX_VALUE , instruction ) ; } private String scan ( ) { } private int scanInt ( ) { } No newline ; at end ; of file ; }

Fix:
if ( parseStr . equals ( "" ) )
Buggy code:
public class WordCountTopology { public static class SplitSentence extends ShellBolt implements IRichBolt { public SplitSentence ( ) { } @ Override public void declareOutputFields ( OutputFieldsDeclarer declarer ) { } } public static class WordCount implements IBasicBolt { Map < String , Integer > counts = new HashMap < String , Integer > ( ) ; @ Override public void prepare ( Map conf , TopologyContext context ) { } @ Override public void execute ( Tuple tuple , BasicOutputCollector collector ) { } @ Override public void cleanup ( ) { } @ Override public void declareOutputFields ( OutputFieldsDeclarer declarer ) { } } public static void main ( String [ ] args ) throws Exception { TopologyBuilder builder = new TopologyBuilder ( ) ; builder . setSpout ( 1 , new RandomSentenceSpout ( ) , 5 ) ; builder . setBolt ( 2 , new WordCountTopology . SplitSentence ( ) , 8 ) . shuffleGrouping ( 1 ) ; builder . setBolt ( 3 , new WordCountTopology . WordCount ( ) , 12 ) . fieldsGrouping ( 2 , new Fields ( "word" ) ) ; Config conf = new Config ( ) ; conf . setDebug ( true ) ; <START_BUG> if ( ( args . length ) > 0 ) { <END_BUG> conf . setNumWorkers ( 3 ) ; StormSubmitter . submitTopology ( args [ 0 ] , conf , builder . createTopology ( ) ) ; } else { conf . setMaxTaskParallelism ( 3 ) ; LocalCluster cluster = new LocalCluster ( ) ; cluster . submitTopology ( "word-count" , conf , builder . createTopology ( ) ) ; Thread . sleep ( 10000 ) ; cluster . shutdown ( ) ; } } }

Fix:
if ( ( args != null ) && ( ( args . length ) > 0 ) ) {