nus-yam/ex-repair huggingface dataset:
Buggy code:
public class AntPathMatcher implements PathMatcher { public static final String DEFAULT_PATH_SEPARATOR = "//" ; private String pathSeparator = AntPathMatcher . DEFAULT_PATH_SEPARATOR ; public void setPathSeparator ( String pathSeparator ) { } public boolean isPattern ( String path ) { } public boolean match ( String pattern , String path ) { } public boolean matchStart ( String pattern , String path ) { } protected boolean doMatch ( String pattern , String path , boolean fullMatch , Map < String , String > uriTemplateVariables ) { } private boolean matchStrings ( String pattern , String str , Map < String , String > uriTemplateVariables ) { } public String extractPathWithinPattern ( String pattern , String path ) { } public Map < String , String > extractUriTemplateVariables ( String pattern , String path ) { } public String combine ( String pattern1 , String pattern2 ) { } public Comparator < String > getPatternComparator ( String path ) { } private static class AntPatternComparator implements Comparator < String > { private final String path ; private AntPatternComparator ( String path ) { } public int compare ( String pattern1 , String pattern2 ) { if ( ( pattern1 == null ) && ( pattern2 == null ) ) { return 0 ; } else if ( pattern1 == null ) { return 1 ; } else if ( pattern2 == null ) { return - 1 ; } boolean pattern1EqualsPath = pattern1 . equals ( path ) ; boolean pattern2EqualsPath = pattern2 . equals ( path ) ; if ( pattern1EqualsPath && pattern2EqualsPath ) { return 0 ; } else if ( pattern1EqualsPath ) { return - 1 ; } else if ( pattern2EqualsPath ) { return 1 ; } int wildCardCount1 = StringUtils . countOccurrencesOf ( pattern1 , "*" ) ; int wildCardCount2 = StringUtils . countOccurrencesOf ( pattern2 , "*" ) ; if ( wildCardCount1 < wildCardCount2 ) { return - 1 ; } else if ( wildCardCount2 < wildCardCount1 ) { return 1 ; } int bracketCount1 = StringUtils . countOccurrencesOf ( pattern1 , "{" ) ; <START_BUG> int bracketCount2 = StringUtils . countOccurrencesOf ( pattern1 , "{" ) ; <END_BUG> if ( bracketCount1 < bracketCount2 ) { return - 1 ; } else if ( bracketCount1 < bracketCount2 ) { return 1 ; } return 0 ; } } }

Fix:
int bracketCount2 = StringUtils . countOccurrencesOf ( pattern2 , "{" ) ;
Buggy code:
public class Player extends Mobile { public Input _i ; private int _maxHealth ; public int shotsFired = 0 ; private Gun _gun ; public int score = 0 ; private static final int nextLifeStep = 10000 ; private int _nextLife = Player . nextLifeStep ; public int lives ; private int deadcounter = 0 ; private int invulncounter = 0 ; private int maxAmmo = 10 ; private int fireRate = 10 ; private int ammoRegenRate = 30 ; private int bulletSpeed = 6 ; public Player ( Input i , Game g ) { } public void setLevel ( Level l ) { } private void updateStats ( long ticks ) { } public void tick ( long ticks ) { } public void didShoot ( ) { } public void heal ( int n ) { } public void die ( ) { } public void hurt ( Entity cause , int damage , double dir ) { } public void render ( Renderer r ) { <START_BUG> if ( ( ( invulncounter ) == 0 ) || ( ( ( invulncounter ) % 3 ) == 0 ) ) <END_BUG> r . render ( PLAYER_INDEX , ( ( int ) ( x ) ) , ( ( int ) ( y ) ) , getDirection ( ) ) ; } public void setGun ( Gun g ) { } public boolean appearsOnMinimap ( ) { } public int getFireCount ( ) { } private boolean firing ( ) { } public boolean canUpgradeS ( ) { } public boolean canUpgradeH ( ) { } public boolean canUpgradeMA ( ) { } public boolean canUpgradeFR ( ) { } public boolean canUpgradeARR ( ) { } public boolean canUpgradeBS ( ) { } public void upgradeS ( ) { } public void upgradeH ( ) { } public void upgradeMA ( ) { } public void upgradeFR ( ) { } public void upgradeARR ( ) { } public void upgradeBS ( ) { } public void setMaxAmmo ( int a ) { } public void setAmmoRegenRate ( int arr ) { } public void setFireRate ( int fr ) { } public void setBulletSpeed ( int bs ) { } public int getColor ( ) { } public Gun getGun ( ) { } protected void touched ( Entity e ) { } public void replenish ( ) { } }

Fix:
if ( ( ( deadcounter ) == 0 ) && ( ( ( invulncounter ) == 0 ) || ( ( ( invulncounter ) % 3 ) == 0 ) ) )
Buggy code:
public abstract class StockPriceProvider implements StockPriceInfo { SortedSet < Share > shares = new TreeSet < Share > ( ) ; protected GlobalTimer timer = GlobalTimer . getInstance ( ) ; public StockPriceProvider ( ) { } public void createShare ( String shareName , long price ) { } public boolean isShareListed ( String shareName ) { } public long getCurrentShareRate ( String shareName ) { } public SortedSet getAllSharesAsSnapshot ( ) { } public Share getShare ( String shareName ) { for ( Share share : shares ) { <START_BUG> if ( ( share . getName ( ) ) == shareName ) <END_BUG> return share ; } throw new ObjectNotFoundException ( ( ( "Share<seq2seq4repair_space>" + shareName ) + "<seq2seq4repair_space>doesn't<seq2seq4repair_space>exist" ) ) ; } public void startUpdate ( ) { } public String shareInfo ( ) { } public String shareList ( ) { } protected void updateShareRates ( ) { } protected abstract void updateShareRate ( Share share ) { } }

Fix:
if ( share . getName ( ) . equals ( shareName ) )
Buggy code:
public class AllTests { public static void main ( String [ ] args ) { } public static Test suite ( ) { TestSuite suite = new TestSuite ( "All<seq2seq4repair_space>JUnit<seq2seq4repair_space>Tests" ) ; <START_BUG> suite . addTest ( VectorTest . suite ( ) ) ; <END_BUG> suite . addTest ( new TestSuite ( MoneyTest . class ) ) ; suite . addTest ( junit . tests . AllTests . suite ( ) ) ; return suite ; } }

Fix:
suite . addTest ( ListTest . suite ( ) ) ;
Buggy code:
@ Service public class ClientDispacherService extends ConnPoolService { private static Logger log = LoggerFactory . getLogger ( ClientDispacherService . class ) ; public void dispacher ( NettyConnection conn , String msg ) { } private void validateAndSave ( NettyConnection conn , String message ) { ClientInfo client = new ClientInfo ( ) ; <START_BUG> client . setCid ( ( ( new Date ( ) ) + "" ) ) ; <END_BUG> pool . set ( client . getCid ( ) , conn ) ; } }

Fix:
client . setCid ( ( ( new Date ( ) . getTime ( ) ) + "" ) ) ;
Buggy code:
public class StandardJMeterEngine implements Serializable , Runnable , JMeterEngine , JMeterThreadMonitor { private static transient Logger log = Hierarchy . getDefaultHierarchy ( ) . getLoggerFor ( "jmeter.engine" ) ; private static long WAIT_TO_DIE = 5 * 1000 ; Map allThreads ; boolean running = false ; HashTree test ; SearchByClass testListeners ; String host = null ; ListenerNotifier notifier ; public StandardJMeterEngine ( ) { } public StandardJMeterEngine ( String host ) { } public void configure ( HashTree testTree ) { } public void setHost ( String host ) { } protected HashTree getTestTree ( ) { } protected void compileTree ( ) { } public void runTest ( ) throws JMeterEngineException { } private void removeThreadGroups ( List elements ) { } protected void setMode ( ) { } protected void notifyTestListenersOfStart ( ) { } protected void notifyTestListenersOfEnd ( ) { } private ListedHashTree cloneTree ( ListedHashTree tree ) { <START_BUG> TreeCloner cloner = new TreeCloner ( ) ; <END_BUG> tree . traverse ( cloner ) ; return cloner . getClonedTree ( ) ; } public void reset ( ) { } public synchronized void threadFinished ( JMeterThread thread ) { } public synchronized void stopTest ( ) { } public void run ( ) { } private void verifyThreadsStopped ( ) { } private void tellThreadsToStop ( ) { } }

Fix:
TreeCloner cloner = new TreeCloner ( false ) ;
Buggy code:
public class SaveAllAddressbooksPlugin implements TaskInterface { public SaveAllAddressbooksPlugin ( ) { } public void run ( ) { } public void saveFolders ( AddressbookTreeNode folder ) { for ( int i = 0 ; i < ( folder . getChildCount ( ) ) ; i ++ ) { AddressbookTreeNode child = ( ( AddressbookTreeNode ) ( folder . getChildAt ( i ) ) ) ; if ( child instanceof AddressbookFolder ) { try { <START_BUG> ( ( AddressbookFolder ) ( child ) ) . save ( null ) ; <END_BUG> } catch ( Exception ex ) { ex . printStackTrace ( ) ; } } saveFolders ( child ) ; } } }

Fix:
( ( AddressbookFolder ) ( child ) ) . save ( ) ;
Buggy code:
public class ResourceSettings implements ResourceSettingsMBean { private final Application application ; public ResourceSettings ( wicket . Application application ) { } public String getLocalizer ( ) { } public String getPackageResourceGuard ( ) { } public String getPropertiesFactory ( ) { } public String getResourceFinder ( ) { } public String getResourcePollFrequency ( ) { } public String getResourceStreamLocator ( ) { <START_BUG> return Stringz . className ( application . getResourceSettings ( ) . getResourceStreamLocator ( ) ) ; <END_BUG> } @ SuppressWarnings ( "unchecked" ) public String [ ] getStringResourceLoaders ( ) { } public boolean getThrowExceptionOnMissingResource ( ) { } public boolean getUseDefaultOnMissingResource ( ) { } public void setThrowExceptionOnMissingResource ( boolean throwExceptionOnMissingResource ) { } public void setUseDefaultOnMissingResource ( boolean useDefaultOnMissingResource ) { } }

Fix:
return Stringz . className ( application . getResourceSettings ( ) . getResourceStreamFactory ( ) ) ;
Buggy code:
public class CoreFilter implements Filter { private String controllerBase = "//topaz//controller//" ; private String viewBase = "//WEB-INF//view" ; private String cfgFilePath ; private ConcurrentHashMap < String , Controller > controllers = new ConcurrentHashMap < String , Controller > ( ) ; private ModuleNode rootNode = new ModuleNode ( "" , null ) ; private static Log log = LogFactory . getLog ( CoreFilter . class ) ; public void init ( FilterConfig config ) throws ServletException { } private void feedNode ( ModuleNode node , File folder ) { } private Controller initController ( String fullClassPath ) { } public void doFilter ( ServletRequest request , ServletResponse response , FilterChain chain ) throws IOException , ServletException { } private ControllerNode findControllerNode ( ModuleNode node , int pos , String [ ] pNames ) { if ( pos >= ( pNames . length ) ) return null ; String pName = pNames [ pos ] ; if ( node . hasController ( pName ) ) { return node . findControllerNode ( pName ) ; } if ( node . hasNode ( pName ) ) { <START_BUG> return findControllerNode ( node . findNode ( pName ) , ( pos ++ ) , pNames ) ; <END_BUG> } return null ; } private void execute ( Controller c ) { } private Class [ ] getInterceptors ( Class < ? > clazz ) { } public void destroy ( ) { } public static void main ( String [ ] args ) { } }

Fix:
return findControllerNode ( node . findNode ( pName ) , ( ++ pos ) , pNames ) ;
Buggy code:
public abstract class AbstractKeyAnalyzer < K > implements KeyAnalyzer < K > { private static final long serialVersionUID = - 20497563720380683L ; @ SuppressWarnings ( "unchecked" ) public int compare ( final K o1 , final K o2 ) { } static boolean isOutOfBoundsIndex ( final int bitIndex ) { } static boolean isEqualBitKey ( final int bitIndex ) { } static boolean isNullBitKey ( final int bitIndex ) { } static boolean isValidBitIndex ( final int bitIndex ) { <START_BUG> return ( 0 <= bitIndex ) && ( bitIndex <= ( Integer . MAX_VALUE ) ) ; <END_BUG> } }

Fix:
return bitIndex >= 0 ;
Buggy code:
public class javaV { public static void check ( ) { LogHelper . info ( "Checking<seq2seq4repair_space>JRE<seq2seq4repair_space>version..." ) ; StringTokenizer Tokenizer ; String localVersion = System . getProperty ( "java.version" ) ; Tokenizer = new StringTokenizer ( localVersion , "_" ) ; String jreversion = Tokenizer . nextToken ( ) ; Tokenizer = new StringTokenizer ( jreversion , "." ) ; Tokenizer . nextToken ( ) ; int jre = Integer . parseInt ( Tokenizer . nextToken ( ) ) ; if ( jre != 8 ) { <START_BUG> guiFrame . displayError ( "Nie<seq2seq4repair_space>posiadasz<seq2seq4repair_space>oprogramowania<seq2seq4repair_space>Java<seq2seq4repair_space>w<seq2seq4repair_space>wersji<seq2seq4repair_space>\'7\'.<seq2seq4repair_space>Nie<seq2seq4repair_space>możesz<seq2seq4repair_space>uruchomić<seq2seq4repair_space>paczki<seq2seq4repair_space>modów<seq2seq4repair_space>X-Pack!" , "Błąd<seq2seq4repair_space>oprogramowania<seq2seq4repair_space>Java" ) ; <END_BUG> } else { LogHelper . info ( "JRE<seq2seq4repair_space>version<seq2seq4repair_space>is<seq2seq4repair_space>correct.." ) ; } } }

Fix:
guiFrame . displayError ( "Nie<seq2seq4repair_space>posiadasz<seq2seq4repair_space>oprogramowania<seq2seq4repair_space>Java<seq2seq4repair_space>w<seq2seq4repair_space>wersji<seq2seq4repair_space>\'8\'.<seq2seq4repair_space>Nie<seq2seq4repair_space>możesz<seq2seq4repair_space>uruchomić<seq2seq4repair_space>paczki<seq2seq4repair_space>modów<seq2seq4repair_space>X-Pack!" , "Błąd<seq2seq4repair_space>oprogramowania<seq2seq4repair_space>Java" ) ;
Buggy code:
public abstract class UploadResponseFactory { @ SuppressWarnings ( "UnusedDeclaration" ) interface ModelAutoBeanFactory extends AutoBeanFactory { AutoBean < RawSummary > token ( ) { } AutoBean < RawUploadResponse > response ( ) { } AutoBean < RawInteractorError > error ( ) { } } public static < T > T getUploadResponseObject ( Class < T > cls , String json ) throws UploadResponseException { try { AutoBeanFactory factory = GWT . create ( UploadResponseFactory . ModelAutoBeanFactory . class ) ; AutoBean < T > bean = AutoBeanCodex . decode ( factory , cls , json ) ; return bean . as ( ) ; } catch ( Throwable e ) { <START_BUG> throw new UploadResponseException ( ) ; <END_BUG> } } }

Fix:
throw new UploadResponseException ( e . getMessage ( ) , e ) ;
Buggy code:
public class SockJsWebSocketHandler extends TextWebSocketHandlerAdapter { private final SockJsServiceConfig sockJsServiceConfig ; private final WebSocketServerSockJsSession sockJsSession ; private final AtomicInteger sessionCount = new AtomicInteger ( 0 ) ; public SockJsWebSocketHandler ( SockJsServiceConfig serviceConfig , WebSocketHandler webSocketHandler , WebSocketServerSockJsSession sockJsSession ) { } protected SockJsServiceConfig getSockJsConfig ( ) { } @ Override public void afterConnectionEstablished ( WebSocketSession wsSession ) throws Exception { Assert . isTrue ( this . sessionCount . compareAndSet ( 0 , 1 ) , "Unexpected<seq2seq4repair_space>connection" ) ; <START_BUG> this . sockJsSession . afterSessionInitialized ( wsSession ) ; <END_BUG> } @ Override public void handleTextMessage ( WebSocketSession wsSession , TextMessage message ) throws Exception { } @ Override public void afterConnectionClosed ( WebSocketSession wsSession , CloseStatus status ) throws Exception { } @ Override public void handleTransportError ( WebSocketSession webSocketSession , Throwable exception ) throws Exception { } }

Fix:
this . sockJsSession . initializeDelegateSession ( wsSession ) ;
Buggy code:
class ClasspathJar extends ClasspathLocation { String zipFilename ; ZipFile zipFile ; SimpleLookupTable directoryCache ; ClasspathJar ( String zipFilename ) { } void buildDirectoryStructure ( ) { } void cleanup ( ) { } public boolean equals ( Object o ) { if ( ( this ) == o ) return true ; if ( ! ( o instanceof ClasspathJar ) ) return false ; <START_BUG> return zipFilename . equals ( ( ( ClasspathJar ) ( o ) ) . zipFilename ) ; <END_BUG> } NameEnvironmentAnswer findClass ( char [ ] className , char [ ] [ ] packageName ) { } boolean isPackage ( char [ ] [ ] compoundName , char [ ] packageName ) { } public String toString ( ) { } }

Fix:
return zipFilename . equalsIgnoreCase ( ( ( ClasspathJar ) ( o ) ) . zipFilename ) ;
Buggy code:
public class CsvPrinter extends GenericSheetPrinter { private final char delimiter ; private final boolean printHeaders ; public static final char DEFAULT_DELIMITER = ',' ; public static final boolean DEFAULT_HEADERS = true ; public static final boolean DEFAULT_DUPLICATES = false ; public CsvPrinter ( ) { } public CsvPrinter ( char delimiter ) { } public CsvPrinter ( char delimiter , boolean printHeaders , boolean allowDuplicates ) { } public void writeGrams ( String fileName , Blackboard b ) { <START_BUG> this . loadGrams ( b ) ; <END_BUG> writeFile ( fileName ) ; } public void writeSentences ( String fileName , Blackboard b ) { } @ Override public void writeFile ( String fileName ) { } }

Fix:
this . loadKeyphrases ( b ) ;
Buggy code:
public final class KMeansDriver { public static final String DEFAULT_OUTPUT_DIRECTORY = "//points" ; private static final Logger log = LoggerFactory . getLogger ( KMeansDriver . class ) ; private KMeansDriver ( ) { } public static void main ( String [ ] args ) throws Exception { } public static void runJob ( String input , String clustersIn , String output , String measureClass , double convergenceDelta , int maxIterations , int numReduceTasks ) { } private static boolean runIteration ( String input , String clustersIn , String clustersOut , String measureClass , String convergenceDelta , int numReduceTasks , int iteration ) { } private static void runClustering ( String input , String clustersIn , String output , String measureClass , String convergenceDelta ) { if ( KMeansDriver . log . isInfoEnabled ( ) ) { KMeansDriver . log . info ( "Running<seq2seq4repair_space>Clustering" ) ; KMeansDriver . log . info ( "Input:<seq2seq4repair_space>{}<seq2seq4repair_space>Clusters<seq2seq4repair_space>In:<seq2seq4repair_space>{}<seq2seq4repair_space>Out:<seq2seq4repair_space>{}<seq2seq4repair_space>Distance:<seq2seq4repair_space>{}" , new Object [ ] { input , clustersIn , output , measureClass } ) ; KMeansDriver . log . info ( "convergence:<seq2seq4repair_space>{}<seq2seq4repair_space>Input<seq2seq4repair_space>Vectors:<seq2seq4repair_space>{}" , convergenceDelta , VectorWritable . class . getName ( ) ) ; } JobConf conf = new JobConf ( KMeansDriver . class ) ; conf . setInputFormat ( SequenceFileInputFormat . class ) ; conf . setOutputFormat ( SequenceFileOutputFormat . class ) ; conf . setMapOutputKeyClass ( Text . class ) ; <START_BUG> conf . setMapOutputValueClass ( VectorWritable . class ) ; <END_BUG> conf . setOutputKeyClass ( Text . class ) ; conf . setOutputValueClass ( Text . class ) ; FileInputFormat . setInputPaths ( conf , new Path ( input ) ) ; Path outPath = new Path ( output ) ; FileOutputFormat . setOutputPath ( conf , outPath ) ; conf . setMapperClass ( KMeansClusterMapper . class ) ; conf . setNumReduceTasks ( 0 ) ; conf . set ( CLUSTER_PATH_KEY , clustersIn ) ; conf . set ( DISTANCE_MEASURE_KEY , measureClass ) ; conf . set ( CLUSTER_CONVERGENCE_KEY , convergenceDelta ) ; try { JobClient . runJob ( conf ) ; } catch ( IOException e ) { KMeansDriver . log . warn ( e . toString ( ) , e ) ; } } private static boolean isConverged ( String filePath , JobConf conf , FileSystem fs ) throws IOException { } }

Fix:
conf . setMapOutputValueClass ( Text . class ) ;
Buggy code:
public class DiscoveredServiceTrackerImpl implements DiscoveredServiceTracker { DistributionProviderImpl distributionProvider ; public DiscoveredServiceTrackerImpl ( DistributionProviderImpl dp ) { } Map serviceRegistrationMap = Collections . synchronizedMap ( new HashMap ( ) ) ; public void serviceChanged ( DiscoveredServiceNotification notification ) { } private IContainerManager getContainerManager ( ) { } private void handleDiscoveredServiceModifiedEndmatch ( ServiceEndpointDescription description ) { } private void handleDiscoveredServiceModified ( ServiceEndpointDescription description ) { } private void handleDiscoveredServiceUnavailable ( ServiceEndpointDescription description ) { } private void handleDiscoveredServiceAvailable ( ServiceEndpointDescription description ) { } private String getRemoteFilterForQuery ( ServiceEndpointDescription description ) { } long getTimeout ( ServiceEndpointDescription description ) { } private void processFutureForRemoteServiceReferences ( final IFuture futureRemoteReferences , final IRemoteServiceContainerAdapter rsca , final ServiceEndpointDescription description , final long timeout ) { } void logFutureError ( IStatus futureStatus ) { } private ServiceRegistration getRemoteServiceRegistration ( IRemoteServiceReference reference ) { } private ServiceRegistration addRemoteServiceRegistration ( IRemoteServiceReference ref , ServiceRegistration registration ) { } private void registerRemoteServiceReferences ( IRemoteServiceContainerAdapter rsca , IRemoteServiceReference [ ] remoteReferences , ServiceEndpointDescription description ) { } private Dictionary getPropertiesForRemoteServiceReference ( IRemoteServiceReference remoteServiceReference , ServiceEndpointDescription description ) { } private String [ ] getClazzesForRemoteServiceReference ( IRemoteServiceReference iRemoteServiceReference , ServiceEndpointDescription description ) { } private ID [ ] createContainerIDsForQuery ( ServiceEndpointDescription description ) { } private IRemoteServiceContainerAdapter [ ] findRSCAs ( ServiceEndpointDescription description ) { } private boolean includeRCSAForDescription ( IContainer container , IRemoteServiceContainerAdapter adapter , ServiceEndpointDescription description ) { <START_BUG> String namespaceName = ( ( String ) ( description . getProperty ( REMOTESERVICE_NAMESPACE_NAME ) ) ) ; <END_BUG> if ( namespaceName != null ) { Namespace namespace = adapter . getRemoteServiceNamespace ( ) ; if ( namespace . getName ( ) . equals ( namespaceName ) ) return true ; } return true ; } private void logError ( String string , Throwable t ) { } }

Fix:
String namespaceName = ( ( String ) ( description . getProperty ( SERVICE_NAMESPACE ) ) ) ;
Buggy code:
public class SliceImplHelper { private static final Localizer _loc = Localizer . forPackage ( SliceImplHelper . class ) ; public static SliceInfo getSlicesByPolicy ( Object pc , DistributedConfiguration conf , Object ctx ) { List < String > actives = conf . getActiveSliceNames ( ) ; Object policy = null ; String [ ] targets = null ; boolean replicated = SliceImplHelper . isReplicated ( pc , conf ) ; if ( replicated ) { policy = conf . getReplicationPolicyInstance ( ) ; targets = ( ( ReplicationPolicy ) ( policy ) ) . replicate ( pc , actives , ctx ) ; } else { policy = conf . getDistributionPolicyInstance ( ) ; targets = new String [ ] { ( ( DistributionPolicy ) ( policy ) ) . distribute ( pc , actives , ctx ) } ; } <START_BUG> SliceImplHelper . assertSlices ( targets , pc , actives , policy ) ; <END_BUG> return new SliceInfo ( replicated , targets ) ; } private static void assertSlices ( String [ ] targets , Object pc , List < String > actives , Object policy ) { } public static SliceInfo getSlicesByPolicy ( OpenJPAStateManager sm , DistributedConfiguration conf , Object ctx ) { } public static boolean isReplicated ( Object pc , OpenJPAConfiguration conf ) { } public static boolean isReplicated ( OpenJPAStateManager sm ) { } public static boolean isSliceAssigned ( OpenJPAStateManager sm ) { } public static SliceInfo getSliceInfo ( OpenJPAStateManager sm ) { } }

Fix:
SliceImplHelper . assertSlices ( targets , pc , conf . getActiveSliceNames ( ) , policy ) ;
Buggy code:
public class NetworkInterfaceRuntimeHandler implements OperationStepHandler { public static final OperationStepHandler INSTANCE = new NetworkInterfaceRuntimeHandler ( ) ; public static final String RESOLVED_ADDRESS = "resolved-address" ; protected NetworkInterfaceRuntimeHandler ( ) { } @ Override public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { final PathAddress address = PathAddress . pathAddress ( operation . get ( OP_ADDR ) ) ; final String interfaceName = address . getLastElement ( ) . getValue ( ) ; final String attributeName = operation . require ( NAME ) . asString ( ) ; context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { final ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( JBOSS_NETWORK_INTERFACE . append ( interfaceName ) ) ; <START_BUG> if ( controller != null ) { <END_BUG> final NetworkInterfaceBinding binding = NetworkInterfaceBinding . class . cast ( controller . getValue ( ) ) ; final InetAddress address = binding . getAddress ( ) ; final ModelNode result = new ModelNode ( ) ; if ( NetworkInterfaceRuntimeHandler . RESOLVED_ADDRESS . equals ( attributeName ) ) { result . set ( address . getHostAddress ( ) ) ; } context . getResult ( ) . set ( result ) ; } context . completeStep ( ) ; } } , RUNTIME ) ; context . completeStep ( ) ; } }

Fix:
if ( ( controller != null ) && ( ( controller . getState ( ) ) == ( State . UP ) ) ) {
Buggy code:
public class YProductA implements AbstractProductA { @ Override public String methodA ( ) { <START_BUG> return "Implementación<seq2seq4repair_space>Y<seq2seq4repair_space>del<seq2seq4repair_space>producto<seq2seq4repair_space>A" ; <END_BUG> } }

Fix:
return "Implementaci_n<seq2seq4repair_space>Y<seq2seq4repair_space>del<seq2seq4repair_space>producto<seq2seq4repair_space>A" ;
Buggy code:
public class PascalDistribution extends AbstractIntegerDistribution { private static final long serialVersionUID = 6751309484392813623L ; private final int numberOfSuccesses ; private final double probabilityOfSuccess ; public PascalDistribution ( int r , double p ) throws NotStrictlyPositiveException , OutOfRangeException { } public int getNumberOfSuccesses ( ) { } public double getProbabilityOfSuccess ( ) { } public double probability ( int x ) { } public double cumulativeProbability ( int x ) { double ret ; if ( x < 0 ) { ret = 0.0 ; } else { <START_BUG> ret = Beta . regularizedBeta ( probabilityOfSuccess , numberOfSuccesses , ( x + 1 ) ) ; <END_BUG> } return ret ; } public double getNumericalMean ( ) { } public double getNumericalVariance ( ) { } public int getSupportLowerBound ( ) { } public int getSupportUpperBound ( ) { } public boolean isSupportConnected ( ) { } }

Fix:
ret = Beta . regularizedBeta ( probabilityOfSuccess , numberOfSuccesses , ( x + 1.0 ) ) ;
Buggy code:
public class SimpleMapper1 extends BaseInterceptor { ContextManager cm ; PrefixMapper map ; int ctExtMapNote = - 1 ; int defaultMapNOTE = - 1 ; boolean mapCacheEnabled = false ; public SimpleMapper1 ( ) { } public void setMapCache ( boolean v ) { } public void engineInit ( ContextManager cm ) throws TomcatException { } public void addContext ( ContextManager cm , Context ctx ) throws TomcatException { } public void removeContext ( ContextManager cm , Context ctx ) throws TomcatException { } public void addContainer ( Container ct ) throws TomcatException { } public void removeContainer ( Container ct ) throws TomcatException { } public int contextMap ( Request req ) { } Container matchExtension ( Request req ) { Context ctx = req . getContext ( ) ; String ctxP = ctx . getPath ( ) ; String path = req . getServletPath ( ) ; if ( path == null ) return null ; <START_BUG> String extension = URLUtil . getExtension ( path ) ; <END_BUG> if ( extension == null ) return null ; if ( ( debug ) > 0 ) cm . log ( ( ( ( ( ( "SM:<seq2seq4repair_space>Extension<seq2seq4repair_space>match<seq2seq4repair_space>" + ctxP ) + "<seq2seq4repair_space>" ) + path ) + "<seq2seq4repair_space>" ) + extension ) ) ; SimpleHashtable extM = ( ( SimpleHashtable ) ( ctx . getContainer ( ) . getNote ( ctExtMapNote ) ) ) ; if ( extM == null ) return null ; Container container = ( ( Container ) ( extM . get ( extension ) ) ) ; if ( container == null ) return null ; if ( ( container . getHandler ( ) ) == null ) return container ; return container ; } void fixRequestPaths ( String path , Request req , Container container ) throws Exception { } }

Fix:
String extension = FileUtil . getExtension ( path ) ;
Buggy code:
public class ItemFluidPipe extends ItemMultiPart { public ItemFluidPipe ( ) { } @ Override public IMultipart createPart ( World world , BlockPos pos , EnumFacing side , Vec3d hit , ItemStack stack , EntityPlayer player ) { <START_BUG> return new MultipartFluidPipe ( ) ; <END_BUG> } }

Fix:
return new EmptyFluidPipe ( ) ;
Buggy code:
public abstract class LdapGroupAssignmentBaseSuiteTest extends BaseLdapSuiteTest { @ Test public void testCycleUser ( ) throws Exception { } @ Test public void testTestUserOne ( ) throws Exception { } @ Test public void testTestUserTwo ( ) throws Exception { } @ Test public void testTestUserThree ( ) throws Exception { } @ Test public void testTestUserFour ( ) throws Exception { } @ Test public void testTestUserFive ( ) throws Exception { } @ Test public void testTestUserSix ( ) throws Exception { <START_BUG> verifyGroupMembership ( "TestUserSix" , "passwordSix" , "GroupSix" , "GroupOne" ) ; <END_BUG> } }

Fix:
verifyGroupMembership ( "TestUserSix" , "passwordSix" , "GroupSix" , "GroupTwo" ) ;
Buggy code:
public class StartMenu { Container container ; private Frame frame ; private boolean inMenu ; private boolean inOption ; private boolean inCredit ; public StartMenu ( Frame frame ) { } public void setMenu ( ) { } public void setOption ( ) { } public void setCredit ( ) { } public void render ( Graphics g ) { } private void addButton ( String text ) { JButton button = new JButton ( text ) ; button . setAlignmentX ( container . CENTER_ALIGNMENT ) ; <START_BUG> button . addMouseListener ( new edu . chl . Game . handler . MouseInput ( frame ) ) ; <END_BUG> button . setMaximumSize ( new Dimension ( 180 , 50 ) ) ; container . add ( button ) ; } private void resetState ( ) { } public boolean inMenu ( ) { } public boolean inOption ( ) { } public boolean inCredit ( ) { } }

Fix:
button . addMouseListener ( new MouseInput ( ) ) ;
Buggy code:
public class ClientModel { private Board board ; private Player player ; private String messages ; public ClientModel ( ) { } public Board getBoard ( ) { } public void setBoard ( Board b ) { } public void setPlayer ( Player p ) { } public Player getPlayer ( ) { } public void addMessage ( String m ) { <START_BUG> this . messages += m ; <END_BUG> } public String getMessages ( ) { } }

Fix:
this . messages += m + "\n" ;
Buggy code:
public class AnnotationPersistenceXMLMetaDataParser { private static final Localizer _loc = Localizer . forPackage ( AnnotationPersistenceXMLMetaDataParser . class ) ; private final OpenJPAConfiguration _conf ; private final Log _log ; private MetaDataRepository _repos = null ; private Class _cls = null ; private FieldMetaData _fmd = null ; private Class xmlTypeClass = null ; private Class xmlRootElementClass = null ; private Class xmlAccessorTypeClass = null ; private Class xmlAttributeClass = null ; private Class xmlElementClass = null ; private Method xmlTypeName = null ; private Method xmlTypeNamespace = null ; private Method xmlRootName = null ; private Method xmlRootNamespace = null ; private Method xmlAttributeName = null ; private Method xmlAttributeNamespace = null ; private Method xmlElementName = null ; private Method xmlElementNamespace = null ; private Method xmlAccessorValue = null ; public AnnotationPersistenceXMLMetaDataParser ( OpenJPAConfiguration conf ) { } public OpenJPAConfiguration getConfiguration ( ) { } public Log getLog ( ) { } public MetaDataRepository getRepository ( ) { } public void setRepository ( MetaDataRepository repos ) { } public void clear ( ) { } public void parse ( FieldMetaData fmd ) { } private XMLMetaData parseXMLClassAnnotations ( ) { <START_BUG> if ( ! ( _cls . isAnnotationPresent ( xmlTypeClass ) ) ) <END_BUG> return null ; XMLMetaData meta = getXMLMetaData ( ) ; return meta ; } private synchronized XMLMetaData getXMLMetaData ( ) { } private void parseXmlRootElement ( Class type , XMLMetaData meta ) { } private void populateFromReflection ( Class cls , XMLMetaData meta ) { } }

Fix:
if ( ( ( _cls ) == null ) || ( ! ( _cls . isAnnotationPresent ( xmlTypeClass ) ) ) )
Buggy code:
public class OptIgSplitTest extends TestCase { protected static final int nbAttributes = 20 ; protected static final int numInstances = 100 ; @ Override protected void setUp ( ) throws Exception { } public void testComputeSplit ( ) throws Exception { int n = 100 ; IgSplit ref = new DefaultIgSplit ( ) ; IgSplit opt = new OptIgSplit ( ) ; Random rng = RandomUtils . getRandom ( ) ; Data data = Utils . randomData ( rng , OptIgSplitTest . nbAttributes , OptIgSplitTest . numInstances ) ; for ( int nloop = 0 ; nloop < n ; nloop ++ ) { int attr = rng . nextInt ( data . getDataset ( ) . nbAttributes ( ) ) ; Split expected = ref . computeSplit ( data , attr ) ; Split actual = opt . computeSplit ( data , attr ) ; <START_BUG> assertEquals ( expected . ig , actual . ig ) ; <END_BUG> assertEquals ( expected . split , actual . split ) ; } } }

Fix:
assertEquals ( expected . ig , actual . ig , 1.0E-7 ) ;
Buggy code:
public class Load implements Command { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final boolean expandTree = JMeterUtils . getPropDefault ( "onload.expandtree" , false ) ; private static final Set < String > commands = new HashSet < String > ( ) ; public Load ( ) { } public Set < String > getActionNames ( ) { } public void doAction ( ActionEvent e ) { } static void loadProjectFile ( ActionEvent e , File f , boolean merging ) { } public static boolean insertLoadedTree ( int id , HashTree tree , boolean merging ) throws Exception , IllegalUserActionException { if ( tree == null ) { throw new Exception ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>TestPlan<seq2seq4repair_space>-<seq2seq4repair_space>see<seq2seq4repair_space>log<seq2seq4repair_space>file" ) ; } boolean isTestPlan = ( tree . getArray ( ) [ 0 ] ) instanceof TestPlan ; GuiPackage guiInstance = GuiPackage . getInstance ( ) ; if ( isTestPlan && ( ! merging ) ) { guiInstance . clearTestPlan ( ( ( TestElement ) ( tree . getArray ( ) [ 0 ] ) ) ) ; } if ( merging ) { TestElement te = ( ( TestElement ) ( tree . getArray ( ) [ 0 ] ) ) ; if ( ! ( ( te instanceof WorkBench ) || ( te instanceof TestPlan ) ) ) { boolean ok = MenuFactory . canAddTo ( guiInstance . getCurrentNode ( ) , te ) ; if ( ! ok ) { String name = te . getName ( ) ; String className = te . getClass ( ) . getName ( ) ; <START_BUG> className = className . substring ( ( ( className . lastIndexOf ( "." ) ) + 1 ) ) ; <END_BUG> throw new IllegalUserActionException ( ( ( ( ( "Can't<seq2seq4repair_space>merge<seq2seq4repair_space>" + name ) + "<seq2seq4repair_space>(" ) + className ) + ")<seq2seq4repair_space>here" ) ) ; } } } HashTree newTree = guiInstance . addSubTree ( tree ) ; guiInstance . updateCurrentGui ( ) ; guiInstance . getMainFrame ( ) . getTree ( ) . setSelectionPath ( new TreePath ( ( ( org . apache . jmeter . gui . tree . JMeterTreeNode ) ( newTree . getArray ( ) [ 0 ] ) ) . getPath ( ) ) ) ; tree = guiInstance . getCurrentSubTree ( ) ; ActionEvent actionEvent = null ; if ( ! merging ) { actionEvent = new ActionEvent ( tree . get ( tree . getArray ( ) [ ( ( tree . size ( ) ) - 1 ) ] ) , id , ActionNames . SUB_TREE_LOADED ) ; } else { actionEvent = new ActionEvent ( tree . get ( tree . getArray ( ) [ ( ( tree . size ( ) ) - 1 ) ] ) , id , ActionNames . SUB_TREE_MERGED ) ; } ActionRouter . getInstance ( ) . actionPerformed ( actionEvent ) ; JTree jTree = guiInstance . getMainFrame ( ) . getTree ( ) ; if ( ( Load . expandTree ) && ( ! merging ) ) { for ( int i = 0 ; i < ( jTree . getRowCount ( ) ) ; i ++ ) { jTree . expandRow ( i ) ; } } else { jTree . expandRow ( 0 ) ; } TreePath path = jTree . getPathForRow ( 1 ) ; jTree . setSelectionPath ( path ) ; new FocusRequester ( jTree ) ; return isTestPlan ; } public static boolean insertLoadedTree ( int id , HashTree tree ) throws Exception , IllegalUserActionException { } }

Fix:
className = className . substring ( ( ( className . lastIndexOf ( '.' ) ) + 1 ) ) ;
Buggy code:
public class DnsSdDiscoveryLocator extends AbstractDiscoveryContainerAdapter { private static final String DNS_SD_PATH = "path" ; private static final String DNS_SD_PTCL = "dns-sd.ptcl" ; private DnsSdServiceTypeID targetID ; private Resolver resolver ; public DnsSdDiscoveryLocator ( ) { } public IServiceInfo getServiceInfo ( IServiceID aServiceId ) { } public IServiceTypeID [ ] getServiceTypes ( ) { } private IServiceTypeID [ ] getServiceTypes ( final DnsSdServiceTypeID serviceTypeId ) { } private Record [ ] getRecords ( final DnsSdServiceTypeID serviceTypeId ) { } public IServiceInfo [ ] getServices ( ) { } public IServiceInfo [ ] getServices ( IServiceTypeID aServiceTypeId ) { } private List getSRVRecords ( Lookup [ ] queries ) { } private List getServiceInfos ( List srvQueryResult ) { } public void registerService ( IServiceInfo serviceInfo ) { } public void unregisterService ( IServiceInfo serviceInfo ) { } public void connect ( ID aTargetID , IConnectContext connectContext ) throws ContainerConnectException { } private String [ ] getBrowsingDomains ( IServiceTypeID aServiceTypeId ) { Set res = new HashSet ( ) ; <START_BUG> String [ ] rrs = new String [ ] { BnRDnsSdServiceTypeID . BROWSE_DOMAIN , BnRDnsSdServiceTypeID . DEFAULT_BROWSE_DOMAIN } ; <END_BUG> for ( int i = 0 ; i < ( rrs . length ) ; i ++ ) { BnRDnsSdServiceTypeID serviceType = new BnRDnsSdServiceTypeID ( aServiceTypeId , rrs [ i ] ) ; Record [ ] defaultBrowsing = getRecords ( serviceType ) ; for ( int j = 0 ; j < ( defaultBrowsing . length ) ; j ++ ) { PTRRecord record = ( ( PTRRecord ) ( defaultBrowsing [ j ] ) ) ; res . add ( record . getTarget ( ) . toString ( ) ) ; } } return ( ( String [ ] ) ( res . toArray ( new String [ res . size ( ) ] ) ) ) ; } public void disconnect ( ) { } public ID getConnectedID ( ) { } public void setSearchPath ( String [ ] searchPaths ) { } public String [ ] getSearchPath ( ) { } public void setResolver ( String aResolver ) { } }

Fix:
String [ ] rrs = new String [ ] { BnRDnsSdServiceTypeID . BROWSE_DOMAINS , BnRDnsSdServiceTypeID . DEFAULT_BROWSE_DOMAIN } ;
Buggy code:
public class Results { @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) public static void start ( Stage primaryStage , gameEngine match ) { } @ SuppressWarnings ( { "unchecked" , "rawtypes" } ) private static void setColor ( TableColumn t ) { t . setCellFactory ( new Callback < TableColumn , TableCell > ( ) { public TableCell call ( TableColumn param ) { return new TableCell < Team , String > ( ) { public void updateItem ( String item , boolean empty ) { super . updateItem ( item , empty ) ; if ( ! ( isEmpty ( ) ) ) { <START_BUG> this . setTextFill ( Color . BLACK ) ; <END_BUG> Team t = saveGame . getDB ( ) . findTeam ( this . getItem ( ) ) ; if ( t . getNm ( ) . equals ( saveGame . getMyTeam ( ) . getNm ( ) ) ) { this . setUnderline ( true ) ; } setText ( item ) ; } } } ; } } ) ; } }

Fix:
this . setUnderline ( false ) ;
Buggy code:
public class Button extends Control { String text ; Image image ; boolean grayed ; static final int EXTRA_HEIGHT = 2 ; static final int EXTRA_WIDTH = 6 ; public Button ( Composite parent , int style ) { } int accessibilityAttributeValue ( int id , int sel , int arg0 ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } void click ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } NSAttributedString createString ( ) { <START_BUG> NSAttributedString attribStr = createString ( text , null , foreground , style , true ) ; <END_BUG> attribStr . autorelease ( ) ; if ( ( ( ( style ) & ( ( SWT . RADIO ) | ( SWT . CHECK ) ) ) != 0 ) && ( ( image ) != null ) ) { NSFileWrapper wrapper = ( ( NSFileWrapper ) ( new NSFileWrapper ( ) . alloc ( ) . init ( ) ) ) ; wrapper . setIcon ( image . handle ) ; wrapper . autorelease ( ) ; NSTextAttachment attach = ( ( NSTextAttachment ) ( new NSTextAttachment ( ) . alloc ( ) ) ) ; attach . initWithFileWrapper ( wrapper ) ; attach . autorelease ( ) ; NSAttributedString imgString = ( ( NSAttributedString ) ( NSAttributedString . attributedStringWithAttachment ( attach ) ) ) ; if ( ( text ) != null ) { NSMutableAttributedString mutable = ( ( NSMutableAttributedString ) ( new NSMutableAttributedString ( ) . alloc ( ) . init ( ) ) ) ; mutable . appendAttributedString ( imgString ) ; NSRange range = new NSRange ( ) ; range . location = mutable . length ( ) ; range . length = 0 ; mutable . replaceCharactersInRange ( range , NSString . stringWith ( "<seq2seq4repair_space>" ) ) ; mutable . appendAttributedString ( attribStr ) ; mutable . autorelease ( ) ; return mutable ; } return imgString ; } return attribStr ; } void createHandle ( ) { } void createWidget ( ) { } NSFont defaultNSFont ( ) { } void deregister ( ) { } boolean dragDetect ( int x , int y , boolean filter , boolean [ ] consume ) { } void drawImageWithFrameInView ( int id , int sel , int image , NSRect rect , int view ) { } void drawWidget ( int id , NSGraphicsContext context , NSRect rect ) { } public int getAlignment ( ) { } public boolean getGrayed ( ) { } public Image getImage ( ) { } String getNameText ( ) { } public boolean getSelection ( ) { } public String getText ( ) { } boolean isDescribedByLabel ( ) { } int nextState ( int id , int sel ) { } void register ( ) { } void releaseWidget ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } void selectRadio ( ) { } void sendSelection ( ) { } public void setAlignment ( int alignment ) { } void _setAlignment ( int alignment ) { } void updateBackground ( ) { } void setFont ( NSFont font ) { } void setForeground ( float [ ] color ) { } public void setGrayed ( boolean grayed ) { } public void setImage ( Image image ) { } boolean setRadioSelection ( boolean value ) { } public void setSelection ( boolean selected ) { } public void setText ( String string ) { } int traversalCode ( int key , NSEvent theEvent ) { } void updateAlignment ( ) { } }

Fix:
NSAttributedString attribStr = createString ( text , null , foreground , style , true , true ) ;
Buggy code:
public class WebSphereUowTransactionManager extends JtaTransactionManager implements CallbackPreferringPlatformTransactionManager { public static final String DEFAULT_UOW_MANAGER_NAME = "java:comp//websphere//UOWManager" ; private UOWManager uowManager ; private String uowManagerName ; public WebSphereUowTransactionManager ( ) { } public WebSphereUowTransactionManager ( UOWManager uowManager ) { } public void setUowManager ( UOWManager uowManager ) { } public void setUowManagerName ( String uowManagerName ) { } @ Override public void afterPropertiesSet ( ) throws TransactionSystemException { } protected UOWManager lookupUowManager ( String uowManagerName ) throws TransactionSystemException { } protected UOWManager lookupDefaultUowManager ( ) throws TransactionSystemException { } @ Override protected void doRegisterAfterCompletionWithJtaTransaction ( JtaTransactionObject txObject , List < TransactionSynchronization > synchronizations ) { } @ Override public boolean supportsResourceAdapterManagedTransactions ( ) { } public < T > T execute ( TransactionDefinition definition , TransactionCallback < T > callback ) throws TransactionException { } private class UOWActionAdapter < T > implements UOWAction { private final TransactionDefinition definition ; private final TransactionCallback < T > callback ; private final boolean actualTransaction ; private final boolean newTransaction ; private final boolean newSynchronization ; private boolean debug ; private T result ; private Throwable exception ; public UOWActionAdapter ( TransactionDefinition definition , TransactionCallback < T > callback , boolean actualTransaction , boolean newTransaction , boolean newSynchronization , boolean debug ) { } public void run ( ) { <START_BUG> DefaultTransactionStatus status = newTransactionStatus ( this . definition , ( this . actualTransaction ? this : null ) , this . newTransaction , this . newSynchronization , this . debug , null ) ; <END_BUG> try { this . result = this . callback . doInTransaction ( status ) ; triggerBeforeCommit ( status ) ; } catch ( Throwable ex ) { this . exception = ex ; } finally { if ( status . isLocalRollbackOnly ( ) ) { if ( status . isDebug ( ) ) { logger . debug ( "Transactional<seq2seq4repair_space>code<seq2seq4repair_space>has<seq2seq4repair_space>requested<seq2seq4repair_space>rollback" ) ; } uowManager . setRollbackOnly ( ) ; } triggerBeforeCompletion ( status ) ; if ( status . isNewSynchronization ( ) ) { List < TransactionSynchronization > synchronizations = TransactionSynchronizationManager . getSynchronizations ( ) ; TransactionSynchronizationManager . clear ( ) ; uowManager . registerInterposedSynchronization ( new JtaAfterCompletionSynchronization ( synchronizations ) ) ; } } } public T getResult ( ) { } } }

Fix:
DefaultTransactionStatus status = prepareTransactionStatus ( this . definition , ( this . actualTransaction ? this : null ) , this . newTransaction , this . newSynchronization , this . debug , null ) ;
Buggy code:
public class XMPPCriteria implements ICriteria { protected List criteria ; public XMPPCriteria ( ) { } public void add ( ICriterion criterion ) { } public List getCriterions ( ) { } public boolean isEmpty ( ) { } public String toString ( ) { StringBuffer sb = new StringBuffer ( "XMPPCriteria[" ) ; Iterator it = criteria . iterator ( ) ; while ( it . hasNext ( ) ) { sb . append ( "[" ) ; ICriterion criterion = ( ( ICriterion ) ( it . next ( ) ) ) ; sb . append ( criterion . toString ( ) ) ; sb . append ( "];" ) ; } <START_BUG> sb . append ( "];" ) ; <END_BUG> return sb . toString ( ) ; } }

Fix:
sb . append ( "]" ) ;
Buggy code:
public class AttackDrawer { public static void drawAttacks ( int MAP_WIDTH , int MAP_HEIGHT , int BLOCK_SIZE , Stage myStage , Graphics g ) { List < List < MapCell > > myMap = myStage . getCells ( ) ; Player myPlayer = myStage . getPlayer ( ) ; for ( int i = 0 ; i < ( myMap . size ( ) ) ; i ++ ) { <START_BUG> for ( int j = 0 ; j < ( myMap . size ( ) ) ; j ++ ) { <END_BUG> myMap . get ( i ) . get ( j ) . setValidMove ( false ) ; } } if ( ( myPlayer . getCommand ( ) ) != null ) { if ( myPlayer . getCommand ( ) . equals ( "boulderfall" ) ) { AttackDrawer . drawLine ( MAP_WIDTH , MAP_HEIGHT , BLOCK_SIZE , myStage , g , 0 , 1 , new Color ( 0.6F , 0.4F , 0.3F , 0.6F ) , 1 , 1 , true ) ; AttackDrawer . drawLine ( MAP_WIDTH , MAP_HEIGHT , BLOCK_SIZE , myStage , g , 1 , 0 , new Color ( 0.6F , 0.4F , 0.3F , 0.6F ) , 1 , 1 , true ) ; } if ( myPlayer . getCommand ( ) . equals ( "skytoss" ) ) { Color c = Color . lightGray ; c = new Color ( c . getRed ( ) , c . getGreen ( ) , c . getBlue ( ) , 153 ) ; AttackDrawer . drawLine ( MAP_WIDTH , MAP_HEIGHT , BLOCK_SIZE , myStage , g , 0 , 0 , c , 0 , 0 , false ) ; } if ( myPlayer . getCommand ( ) . equals ( "cascade" ) ) { Color c = Color . BLUE ; c = new Color ( c . getRed ( ) , c . getGreen ( ) , c . getBlue ( ) , 153 ) ; AttackDrawer . drawLine ( MAP_WIDTH , MAP_HEIGHT , BLOCK_SIZE , myStage , g , 0 , 1 , c , 1 , 1 , true ) ; AttackDrawer . drawLine ( MAP_WIDTH , MAP_HEIGHT , BLOCK_SIZE , myStage , g , 1 , 0 , c , 1 , 1 , true ) ; AttackDrawer . drawLine ( MAP_WIDTH , MAP_HEIGHT , BLOCK_SIZE , myStage , g , 1 , 1 , c , 1 , 1 , true ) ; AttackDrawer . drawLine ( MAP_WIDTH , MAP_HEIGHT , BLOCK_SIZE , myStage , g , 1 , ( - 1 ) , c , 1 , 1 , true ) ; } if ( myPlayer . getCommand ( ) . equals ( "detonate" ) ) { Color c = Color . RED ; c = new Color ( c . getRed ( ) , c . getGreen ( ) , c . getBlue ( ) , 153 ) ; AttackDrawer . drawLine ( MAP_WIDTH , MAP_HEIGHT , BLOCK_SIZE , myStage , g , 0 , 1 , c , 1 , 3 , true ) ; AttackDrawer . drawLine ( MAP_WIDTH , MAP_HEIGHT , BLOCK_SIZE , myStage , g , 1 , 0 , c , 1 , 3 , true ) ; AttackDrawer . drawLine ( MAP_WIDTH , MAP_HEIGHT , BLOCK_SIZE , myStage , g , 1 , 1 , c , 1 , 2 , true ) ; AttackDrawer . drawLine ( MAP_WIDTH , MAP_HEIGHT , BLOCK_SIZE , myStage , g , 1 , ( - 1 ) , c , 1 , 2 , true ) ; AttackDrawer . drawLine ( MAP_WIDTH , MAP_HEIGHT , BLOCK_SIZE , myStage , g , 1 , 2 , c , 1 , 1 , true ) ; AttackDrawer . drawLine ( MAP_WIDTH , MAP_HEIGHT , BLOCK_SIZE , myStage , g , 1 , ( - 2 ) , c , 1 , 1 , true ) ; AttackDrawer . drawLine ( MAP_WIDTH , MAP_HEIGHT , BLOCK_SIZE , myStage , g , 2 , 1 , c , 1 , 1 , true ) ; AttackDrawer . drawLine ( MAP_WIDTH , MAP_HEIGHT , BLOCK_SIZE , myStage , g , 2 , ( - 1 ) , c , 1 , 1 , true ) ; } } } private static void drawLine ( int MAP_WIDTH , int MAP_HEIGHT , int BLOCK_SIZE , Stage myStage , Graphics g , int xScale , int yScale , Color c , int start , int end , boolean first ) { } }

Fix:
for ( int j = 0 ; j < ( myMap . get ( 0 ) . size ( ) ) ; j ++ ) {