nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ActionNewCallEvent extends ActionNewEvent { public static ActionNewCallEvent SINGLETON = new ActionNewCallEvent ( ) ; protected ActionNewCallEvent ( ) { } protected Object createEvent ( ) { <START_BUG> return StateMachinesFactory . getFactory ( ) . createCallEvent ( ) ; <END_BUG> } }

Fix:
return StateMachinesFactory . getFactory ( ) . buildCallEvent ( ) ;
Buggy code:
public class LifecycleCMTTxInterceptor extends CMTTxInterceptor implements Interceptor { private final TransactionAttributeType transactionAttributeType ; private final int transactionTimeout ; public LifecycleCMTTxInterceptor ( final TransactionAttributeType transactionAttributeType , final int transactionTimeout ) { } @ Override public Object processInvocation ( InterceptorContext invocation ) throws Exception { } public static class Factory extends ComponentInterceptorFactory { private final MethodIdentifier methodIdentifier ; private final boolean treatRequiredAsRequiresNew ; public Factory ( final MethodIdentifier methodIdentifier , final boolean treatRequiredAsRequiresNew ) { } @ Override protected Interceptor create ( Component component , InterceptorFactoryContext context ) { final EJBComponent ejb = ( ( EJBComponent ) ( component ) ) ; TransactionAttributeType txAttr ; if ( ( methodIdentifier ) == null ) { if ( treatRequiredAsRequiresNew ) { txAttr = TransactionAttributeType . REQUIRED ; } else { txAttr = TransactionAttributeType . NOT_SUPPORTED ; } } else { txAttr = ejb . getTransactionAttributeType ( BEAN , methodIdentifier , ( treatRequiredAsRequiresNew ? TransactionAttributeType . REQUIRES_NEW : TransactionAttributeType . NOT_SUPPORTED ) ) ; } final int txTimeout ; if ( ( methodIdentifier ) == null ) { txTimeout = - 1 ; } else { txTimeout = ejb . getTransactionTimeout ( BEAN , methodIdentifier ) ; } if ( ( treatRequiredAsRequiresNew ) && ( txAttr == ( TransactionAttributeType . REQUIRED ) ) ) { txAttr = TransactionAttributeType . REQUIRES_NEW ; } if ( ! ( treatRequiredAsRequiresNew ) ) { if ( ( txAttr != ( TransactionAttributeType . NOT_SUPPORTED ) ) && ( txAttr != ( TransactionAttributeType . REQUIRES_NEW ) ) ) { <START_BUG> ROOT_LOGGER . invalidTransactionTypeForSfsbLifecycleMethod ( txAttr , methodIdentifier , ejb . getComponentClass ( ) ) ; <END_BUG> txAttr = TransactionAttributeType . NOT_SUPPORTED ; } } final LifecycleCMTTxInterceptor interceptor = new LifecycleCMTTxInterceptor ( txAttr , txTimeout ) ; return interceptor ; } } }

Fix:
ROOT_LOGGER . invalidTransactionTypeForSfsbLifecycleMethod ( txAttr , methodIdentifier ) ;
Buggy code:
public class LightBox { private String name ; private String number ; private Client owner ; private List < Client > owners = new ArrayList < > ( ) ; private List < Product > items = new ArrayList < > ( ) ; private boolean closed ; public LightBox ( Client owner ) { } public void addOwner ( Client owner ) { } public void close ( ) { } public void add ( Product ... products ) throws IllegalArgumentException , IllegalStateException { validate ( ) ; for ( Product product : products ) { if ( items . contains ( product ) ) throw new IllegalArgumentException ( "LightBox<seq2seq4repair_space>już<seq2seq4repair_space>zawiera<seq2seq4repair_space>ten<seq2seq4repair_space>produkt." ) ; if ( ! ( product . isAvailable ( ) ) ) <START_BUG> throw new pl . com . bottega . photostock . sales . model . exceptions . ProductNotAvailableException ( "Produkt<seq2seq4repair_space>jest<seq2seq4repair_space>nieaktywny<seq2seq4repair_space>" , product . getNumber ( ) , product . getClass ( ) ) ; <END_BUG> items . add ( product ) ; } } public void remove ( Product productToRemove ) throws IllegalArgumentException { } public void changeName ( String newName ) throws IllegalStateException { } private void validate ( ) throws IllegalStateException { } public String getName ( ) { } public void setName ( String name ) { } public List < Client > getOwners ( ) { } public List < Product > getItems ( ) { } public int getItemsCount ( ) { } public String getNumber ( ) { } public void setNumber ( String number ) { } public Client getOwner ( ) { } No newline ; at end ; of file ; }

Fix:
throw new pl . com . bottega . photostock . sales . model . exceptions . ProductNotAvailableException ( ( ( "Produkt<seq2seq4repair_space>" + ( product . getNumber ( ) ) ) + "<seq2seq4repair_space>jest<seq2seq4repair_space>nieaktywny<seq2seq4repair_space>" ) , product . getNumber ( ) ) ;
Buggy code:
public class MainActivity extends ActionBarActivity { Button song1 ; Button song2 ; Button song3 ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void buttonListnener ( ) { song1 . setOnClickListener ( new View . OnClickListener ( ) { public void onClick ( View v ) { startSecondActivity ( 1 ) ; } } ) ; song2 . setOnClickListener ( new View . OnClickListener ( ) { public void onClick ( View v ) { startSecondActivity ( 2 ) ; } } ) ; song3 . setOnClickListener ( new View . OnClickListener ( ) { public void onClick ( View v ) { <START_BUG> startSecondActivity ( 1 ) ; <END_BUG> } } ) ; } private void startSecondActivity ( int buttonNum ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
startSecondActivity ( 3 ) ;
Buggy code:
public class SETLaunchingPlugin extends Plugin implements IInterpreterInstallChangedListener { public static final String PLUGIN_ID = "org.eclipse.wst.xquery.set.launching" ; private static SETLaunchingPlugin plugin ; public static final boolean DEBUG_SERVER = Boolean . valueOf ( Platform . getDebugOption ( ( ( SETLaunchingPlugin . PLUGIN_ID ) + "//debug//server" ) ) ) . booleanValue ( ) ; public SETLaunchingPlugin ( ) { } public void start ( BundleContext context ) throws Exception { } public void stop ( BundleContext context ) throws Exception { } public static SETLaunchingPlugin getDefault ( ) { } public static void log ( IStatus status ) { } public void defaultInterpreterInstallChanged ( IInterpreterInstall previous , IInterpreterInstall current ) { } public void interpreterAdded ( IInterpreterInstall interpreter ) { if ( interpreter instanceof CoreSDKInstall ) { IFileHandle handle = interpreter . getInstallLocation ( ) ; if ( ! ( handle . exists ( ) ) ) { Path path = new Path ( handle . toOSString ( ) ) ; StringBuffer pathSB = new StringBuffer ( path . toPortableString ( ) ) ; String xml = ScriptRuntime . getPreferences ( ) . getString ( PREF_INTERPRETER_XML ) ; String newValue = "" ; try { newValue = VariablesPlugin . getDefault ( ) . getStringVariableManager ( ) . performStringSubstitution ( "${sdk_loc}" , false ) ; } catch ( CoreException ce ) { } if ( ( newValue == null ) || ( newValue . equals ( "" ) ) ) { String envId = LocalEnvironment . ENVIRONMENT_ID ; <START_BUG> xml = xml . replace ( ( ( ( ( "<interpreter<seq2seq4repair_space>environmentId=\"" + envId ) + "\"<seq2seq4repair_space>id=\"defaultSausalitoCoreSDK\"<seq2seq4repair_space>name=\"Sausalito<seq2seq4repair_space>CoreSDK<seq2seq4repair_space>1.0.8\"<seq2seq4repair_space>path=\"" ) + ( pathSB . toString ( ) ) ) + "\"//>" ) , "" ) ; <END_BUG> SETLaunchingPlugin . log ( new Status ( IStatus . WARNING , SETLaunchingPlugin . PLUGIN_ID , "Could<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>Sausalito<seq2seq4repair_space>Core<seq2seq4repair_space>SDK<seq2seq4repair_space>installation." ) ) ; } xml = xml . replace ( pathSB , newValue ) ; ScriptRuntime . getPreferences ( ) . setValue ( PREF_INTERPRETER_XML , xml ) ; ScriptRuntime . savePreferences ( ) ; } } } public void interpreterChanged ( PropertyChangeEvent event ) { } public void interpreterRemoved ( IInterpreterInstall interpreter ) { } }

Fix:
xml = xml . replace ( ( ( ( ( "<interpreter<seq2seq4repair_space>environmentId=\"" + envId ) + "\"<seq2seq4repair_space>id=\"defaultSausalitoCoreSDK\"<seq2seq4repair_space>name=\"Sausalito<seq2seq4repair_space>CoreSDK<seq2seq4repair_space>1.0.12\"<seq2seq4repair_space>path=\"" ) + ( pathSB . toString ( ) ) ) + "\"//>" ) , "" ) ;
Buggy code:
public class SchemaGroup extends NameSet implements Cloneable { private Map _schemaMap = null ; private Map < String , Schema > _delimSchemaMap = null ; private Schema [ ] _schemas = null ; public Schema [ ] getSchemas ( ) { } public Schema getSchema ( String name ) { } public Schema addSchema ( ) { } public Schema addSchema ( String name ) { } public void addDelimSchemaName ( String name , Schema schema ) { } public boolean removeSchema ( Schema schema ) { } public Schema importSchema ( Schema schema ) { if ( schema == null ) return null ; Schema copy = addSchema ( schema . getName ( ) ) ; Sequence [ ] seqs = schema . getSequences ( ) ; for ( int i = 0 ; i < ( seqs . length ) ; i ++ ) copy . importSequence ( seqs [ i ] ) ; Table [ ] tables = schema . getTables ( ) ; Index [ ] idxs ; Unique [ ] unqs ; Table tab ; for ( int i = 0 ; i < ( tables . length ) ; i ++ ) { tab = copy . importTable ( tables [ i ] ) ; idxs = tables [ i ] . getIndexes ( ) ; for ( int j = 0 ; j < ( idxs . length ) ; j ++ ) tab . importIndex ( idxs [ j ] ) ; unqs = tables [ i ] . getUniques ( ) ; for ( int j = 0 ; j < ( unqs . length ) ; j ++ ) <START_BUG> tab . importUnique ( unqs [ j ] , null ) ; <END_BUG> } return copy ; } public boolean isKnownTable ( Table table ) { } public boolean isKnownTable ( String name ) { } public Table findTable ( Table table ) { } public Table findTable ( String name ) { } public Table findTable ( Schema inSchema , String name ) { } public boolean isKnownSequence ( Sequence seq ) { } public boolean isKnownSequence ( String name ) { } public Sequence findSequence ( Sequence seq ) { } public Sequence findSequence ( String name ) { } public Sequence findSequence ( Schema inSchema , String name ) { } public ForeignKey [ ] findExportedForeignKeys ( PrimaryKey pk ) { } public void removeUnusedComponents ( ) { } public Object clone ( ) { } protected SchemaGroup newInstance ( ) { } protected void copy ( SchemaGroup group ) { } protected Schema newSchema ( String name ) { } protected Sequence newSequence ( String name , Schema schema ) { } protected Table newTable ( String name , Schema schema ) { } protected Column newColumn ( String name , Table table ) { } protected PrimaryKey newPrimaryKey ( String name , Table table ) { } protected Index newIndex ( String name , Table table ) { } protected Unique newUnique ( String name , Table table ) { } protected ForeignKey newForeignKey ( String name , Table table ) { } }

Fix:
tab . importUnique ( unqs [ j ] ) ;
Buggy code:
public abstract class AbstractEventAdminApplication implements IApplication { public static final String DEFAULT_TOPIC = "defaultTopic" ; protected BundleContext bundleContext ; protected String containerType ; protected String containerId ; protected String targetId ; protected String topic = AbstractEventAdminApplication . DEFAULT_TOPIC ; protected ServiceTracker containerManagerTracker ; private final Object appLock = new Object ( ) ; private boolean done = false ; protected DistributedEventAdmin eventAdminImpl ; protected ServiceRegistration eventAdminRegistration ; protected IContainer container ; protected Object startup ( IApplicationContext context ) throws Exception { bundleContext = Activator . getContext ( ) ; final String [ ] args = mungeArguments ( ( ( String [ ] ) ( context . getArguments ( ) . get ( "application.args" ) ) ) ) ; processArgs ( args ) ; <START_BUG> eventAdminImpl = new DistributedEventAdmin ( bundleContext , topic ) ; <END_BUG> createConfigureAndConnectContainer ( ) ; eventAdminImpl . start ( ) ; Properties props = new Properties ( ) ; props . put ( EVENT_TOPIC , topic ) ; eventAdminRegistration = bundleContext . registerService ( "org.osgi.service.event.EventAdmin" , eventAdminImpl , props ) ; return IApplication . EXIT_OK ; } protected void shutdown ( ) { } protected Object run ( ) { } public Object start ( IApplicationContext context ) throws Exception { } private String [ ] mungeArguments ( String [ ] originalArgs ) { } protected void usage ( ) { } protected abstract String usageApplicationId ( ) { } protected abstract String usageParameters ( ) { } protected abstract void processArgs ( String [ ] args ) { } protected void waitForDone ( ) { } public void stop ( ) { } protected void createConfigureAndConnectContainer ( ) throws ContainerConnectException , ContainerCreateException , SharedObjectAddException { } protected IContainerManager getContainerManager ( ) { } }

Fix:
eventAdminImpl = new DistributedEventAdmin ( bundleContext ) ;
Buggy code:
public class PacketResponse { enum ResponseCode { GENERIC_ERROR ( "Generic<seq2seq4repair_space>Error" ) , OK ( "OK" ) , BUFFER_OVERFLOW ( "Buffer<seq2seq4repair_space>full" ) , CRC_MISMATCH ( "CRC<seq2seq4repair_space>mismatch" ) , QUERY_OVERFLOW ( "Query<seq2seq4repair_space>overflow" ) , UNSUPPORTED ( "Unsupported<seq2seq4repair_space>command" ) , TIMEOUT ( "Packet<seq2seq4repair_space>timeout" ) , UNKNOWN ( "Unknown<seq2seq4repair_space>code" ) ; private final String message ; ResponseCode ( String message ) { } public String getMessage ( ) { } public static PacketResponse . ResponseCode fromInt ( int value ) { } } byte [ ] payload ; int readPoint = 1 ; public PacketResponse ( ) { } public PacketResponse ( byte [ ] p ) { } public boolean isEmpty ( ) { } public void printDebug ( ) { } public byte [ ] getPayload ( ) { } int get8 ( ) { } int get16 ( ) { } int get32 ( ) { } public boolean isOK ( ) { } public PacketResponse . ResponseCode getResponseCode ( ) { if ( ( ( payload ) != null ) && ( ( payload . length ) > 0 ) ) <START_BUG> return PacketResponse . ResponseCode . fromInt ( payload [ 0 ] ) ; <END_BUG> else return PacketResponse . ResponseCode . GENERIC_ERROR ; } public static PacketResponse okResponse ( ) { } public static PacketResponse timeoutResponse ( ) { } }

Fix:
return PacketResponse . ResponseCode . fromInt ( ( ( payload [ 0 ] ) & 255 ) ) ;
Buggy code:
class PackageFragmentInfo extends OpenableElementInfo { protected Object [ ] nonJavaResources ; public PackageFragmentInfo ( ) { } boolean containsJavaResources ( ) { } Object [ ] getNonJavaResources ( IResource underlyingResource , PackageFragmentRoot rootHandle ) { if ( ( this . nonJavaResources ) == null ) { try { <START_BUG> this . nonJavaResources = PackageFragmentRootInfo . computeFolderNonJavaResources ( ( ( JavaProject ) ( rootHandle . getJavaProject ( ) ) ) , ( ( IContainer ) ( underlyingResource ) ) , rootHandle . fullInclusionPatternChars ( ) , rootHandle . fullExclusionPatternChars ( ) ) ; <END_BUG> } catch ( JavaModelException e ) { this . nonJavaResources = JavaElementInfo . NO_NON_JAVA_RESOURCES ; } } return this . nonJavaResources ; } void setNonJavaResources ( Object [ ] resources ) { } }

Fix:
this . nonJavaResources = PackageFragmentRootInfo . computeFolderNonJavaResources ( rootHandle , ( ( IContainer ) ( underlyingResource ) ) , rootHandle . fullInclusionPatternChars ( ) , rootHandle . fullExclusionPatternChars ( ) ) ;
Buggy code:
public class StringCondition extends Condition { private final MsgLogger msgLog = MsgLogger . LOGGER ; public enum Operator { EQUAL , NOT_EQUAL , STARTS_WITH , ENDS_WITH , CONTAINS , MATCH ; } private String dataId ; private StringCondition . Operator operator ; private String pattern ; private boolean ignoreCase ; public StringCondition ( ) { } public StringCondition ( String triggerId , int conditionSetSize , int conditionSetIndex , String dataId , StringCondition . Operator operator , String pattern , boolean ignoreCase ) { } public String getDataId ( ) { } public void setDataId ( String dataId ) { } public boolean isIgnoreCase ( ) { } public void setIgnoreCase ( boolean ignoreCase ) { } public StringCondition . Operator getOperator ( ) { } public void setOperator ( StringCondition . Operator operator ) { } public String getPattern ( ) { } public void setPattern ( String pattern ) { } public String getLog ( String value ) { } public boolean match ( String value ) { if ( ( ignoreCase ) && ( ( operator ) != ( StringCondition . Operator . MATCH ) ) ) { pattern = pattern . toLowerCase ( ) ; value = value . toLowerCase ( ) ; } switch ( operator ) { case EQUAL : return value . equals ( pattern ) ; case NOT_EQUAL : return ! ( value . equals ( pattern ) ) ; case ENDS_WITH : return value . endsWith ( pattern ) ; case STARTS_WITH : return value . startsWith ( pattern ) ; case CONTAINS : return value . contains ( pattern ) ; case MATCH : <START_BUG> return value . matches ( pattern ) ; <END_BUG> default : msgLog . warnUnknowOperatorOnCondition ( operator . name ( ) , this . getClass ( ) . getName ( ) ) ; return false ; } } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } }

Fix:
return value . matches ( ( ignoreCase ? "(?i)" + ( pattern ) : pattern ) ) ;
Buggy code:
public class CandleTest { private DateTime from ; private DateTime to ; private Interval interval1 ; private Interval interval2 ; private Candle c1 ; private Candle c2 ; @ BeforeClass public static void setUpBeforeClass ( ) throws Exception { } @ Before public void setUp ( ) throws Exception { } @ Test public void testGetStartTime ( ) throws Exception { } @ Test public void testGetEndTime ( ) throws Exception { } @ Test public void testConstruct6 ( ) throws Exception { } @ Test public void testConstruct1 ( ) throws Exception { } @ Test public void testConstruct2 ( ) throws Exception { } @ Test public void testAddDeal2 ( ) throws Exception { } @ Test public void testAddCandle ( ) throws Exception { } @ Test ( expected = OutOfIntervalException . class ) public void testAddCandle_ThrowsIfOutOfInterval ( ) throws Exception { } @ Test public void testEquals ( ) throws Exception { } @ Test public void testEquals_SpecialCases ( ) throws Exception { } @ Test public void testGetBody ( ) throws Exception { } @ Test public void testGetBodyMiddle ( ) throws Exception { } @ Test public void testGetBodyMiddleOrCloseIfBullish ( ) throws Exception { } @ Test public void testGetBodyMiddleOrCloseIfBearish ( ) throws Exception { } @ Test public void testIsBullish ( ) throws Exception { } @ Test public void testIsBearish ( ) throws Exception { } @ Test public void testGetTopShadow ( ) throws Exception { } @ Test public void testGetBottomShadow ( ) throws Exception { } @ Test public void testToString ( ) throws Exception { <START_BUG> String expected = "Candle[T=2013-10-05T19:50:00.000+04:00<seq2seq4repair_space>PT5M,<seq2seq4repair_space>" + "O=120.05,<seq2seq4repair_space>H=130.0,<seq2seq4repair_space>L=90.55,<seq2seq4repair_space>C=125.15,<seq2seq4repair_space>V=10000]" ; <END_BUG> assertEquals ( expected , c2 . toString ( ) ) ; } @ Test public void testAddTrade ( ) throws Exception { } @ Test ( expected = OutOfIntervalException . class ) public void testAddTrade_ThrowsIfOutOfInterval ( ) throws Exception { } @ Test public void testAddTick ( ) throws Exception { } @ Test ( expected = OutOfIntervalException . class ) public void testAddTick_ThrowsIfOutOfInterval ( ) throws Exception { } }

Fix:
String expected = ( ( "Candle[T=" + ( c2 . getStartTime ( ) ) ) + "<seq2seq4repair_space>PT5M,<seq2seq4repair_space>" ) + "O=120.05,<seq2seq4repair_space>H=130.0,<seq2seq4repair_space>L=90.55,<seq2seq4repair_space>C=125.15,<seq2seq4repair_space>V=10000]" ;
Buggy code:
@ RunWith ( Arquillian . class ) @ ServerSetup ( { MDBTestCase . JmsQueueSetup . class } ) public class MDBTestCase { private static final Logger logger = Logger . getLogger ( MDBTestCase . class ) ; @ EJB ( mappedName = "java:module//JMSMessagingUtil" ) private JMSMessagingUtil jmsUtil ; @ Resource ( mappedName = "java:jboss//mdbtest//queue" ) private Queue queue ; @ Resource ( mappedName = "java:jboss//mdbtest//replyQueue" ) private Queue replyQueue ; @ Resource ( mappedName = "java:jboss//mdbtest//annoQueue" ) private Queue annoQueue ; @ Resource ( mappedName = "java:jboss//mdbtest//annoReplyQueue" ) private Queue annoReplyQueue ; static class JmsQueueSetup implements ServerSetupTask { private JMSOperations jmsAdminOperations ; @ Override public void setup ( ManagementClient managementClient , String containerId ) throws Exception { jmsAdminOperations = JMSOperationsProvider . getInstance ( managementClient ) ; jmsAdminOperations . createJmsQueue ( "mdbtest//queue" , "java:jboss//mdbtest//queue" ) ; jmsAdminOperations . createJmsQueue ( "mdbtest//replyQueue" , "java:jboss//mdbtest//replyQueue" ) ; jmsAdminOperations . createJmsQueue ( "mdbtest//annoQueue" , "java:jboss//mdbtest//annoQueue" ) ; jmsAdminOperations . createJmsQueue ( "mdbtest//annoReplyQueue" , "java:jboss//mdbtest//annoReplyQueue" ) ; <START_BUG> jmsAdminOperations . setSystemProperties ( "jboss//mdbtest//annoQueue" , "hornetq-ra" ) ; <END_BUG> } @ Override public void tearDown ( ManagementClient managementClient , String containerId ) throws Exception { } } @ Deployment public static Archive getDeployment ( ) { } @ Test public void testDDBasedMDB ( ) throws Exception { } @ Test public void testAnnoBasedMDB ( ) throws Exception { } }

Fix:
jmsAdminOperations . setSystemProperties ( "jboss//mdbtest//annoQueue" , "hornetq-ra.rar" ) ;
Buggy code:
public class HTTPResultConverter extends SampleResultConverter { public HTTPResultConverter ( ClassMapper arg0 , String arg1 ) { } public boolean canConvert ( Class arg0 ) { } public void marshal ( Object obj , HierarchicalStreamWriter writer , MarshallingContext context ) { } protected void saveSamplerData ( HierarchicalStreamWriter writer , MarshallingContext context , HTTPSampleResult res , SampleSaveConfiguration save ) { <START_BUG> if ( save . saveSamplerData ( ) ) { <END_BUG> writeString ( writer , "cookies" , res . getCookies ( ) ) ; writeString ( writer , "method" , res . getHTTPMethod ( ) ) ; writeString ( writer , "queryString" , res . getQueryString ( ) ) ; writeString ( writer , "redirectLocation" , res . getRedirectLocation ( ) ) ; writeItem ( res . getURL ( ) , context , writer ) ; } } public Object unmarshal ( HierarchicalStreamReader reader , UnmarshallingContext context ) { } protected void retrieveHTTPItem ( HierarchicalStreamReader reader , UnmarshallingContext context , HTTPSampleResult res , Object subItem ) { } }

Fix:
if ( save . saveSamplerData ( res ) ) {
Buggy code:
public class CloseAllPerspectivesAction extends Action { private WorkbenchWindow window ; public CloseAllPerspectivesAction ( WorkbenchWindow window ) { } public void run ( ) { WorkbenchPage page = ( ( WorkbenchPage ) ( window . getActivePage ( ) ) ) ; if ( page != null ) <START_BUG> page . closeAllPerspectives ( true ) ; <END_BUG> } }

Fix:
page . close ( ) ;
Buggy code:
@ SuppressCodecs ( { "SimpleText" , "Memory" } ) public class Test2BPostings extends LuceneTestCase { @ Nightly public void test ( ) throws Exception { MockDirectoryWrapper dir = newFSDirectory ( _TestUtil . getTempDir ( "2BPostings" ) ) ; dir . setThrottling ( NEVER ) ; dir . setCheckIndexOnClose ( false ) ; IndexWriter w = new IndexWriter ( dir , new IndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) . setMaxBufferedDocs ( DISABLE_AUTO_FLUSH ) . setRAMBufferSizeMB ( 256.0 ) . setMergeScheduler ( new ConcurrentMergeScheduler ( ) ) . setMergePolicy ( newLogMergePolicy ( false , 10 ) ) . setOpenMode ( CREATE ) ) ; MergePolicy mp = w . getConfig ( ) . getMergePolicy ( ) ; if ( mp instanceof LogByteSizeMergePolicy ) { ( ( LogByteSizeMergePolicy ) ( mp ) ) . setMaxMergeMB ( ( ( 1024 * 1024 ) * 1024 ) ) ; } Document doc = new Document ( ) ; <START_BUG> FieldType ft = new FieldType ( TextField . TYPE_UNSTORED ) ; <END_BUG> ft . setOmitNorms ( true ) ; ft . setIndexOptions ( DOCS_ONLY ) ; Field field = new Field ( "field" , new Test2BPostings . MyTokenStream ( ) , ft ) ; doc . add ( field ) ; final int numDocs = ( ( Integer . MAX_VALUE ) // 26 ) + 1 ; for ( int i = 0 ; i < numDocs ; i ++ ) { w . addDocument ( doc ) ; if ( ( VERBOSE ) && ( ( i % 100000 ) == 0 ) ) { System . out . println ( ( ( ( i + "<seq2seq4repair_space>of<seq2seq4repair_space>" ) + numDocs ) + "..." ) ) ; } } w . forceMerge ( 1 ) ; w . close ( ) ; CheckIndex ci = new CheckIndex ( dir ) ; if ( VERBOSE ) { ci . setInfoStream ( System . out ) ; } ci . checkIndex ( ) ; dir . close ( ) ; } public static final class MyTokenStream extends TokenStream { private final CharTermAttribute termAtt = addAttribute ( CharTermAttribute . class ) ; private final char [ ] buffer ; int index ; public MyTokenStream ( ) { } @ Override public boolean incrementToken ( ) throws IOException { } @ Override public void reset ( ) throws IOException { } } }

Fix:
FieldType ft = new FieldType ( TextField . TYPE_NOT_STORED ) ;
Buggy code:
public class IPlanetEjbcTask extends Task { private File ejbdescriptor ; private File iasdescriptor ; private File dest ; private Path classpath ; private boolean keepgenerated = false ; private boolean debug = false ; private File iashome ; public void setEjbdescriptor ( File ejbdescriptor ) { } public void setIasdescriptor ( File iasdescriptor ) { } public void setDest ( File dest ) { } public void setClasspath ( Path classpath ) { } public Path createClasspath ( ) { if ( ( classpath ) == null ) { <START_BUG> classpath = new Path ( project ) ; <END_BUG> } return classpath . createPath ( ) ; } public void setKeepgenerated ( boolean keepgenerated ) { } public void setDebug ( boolean debug ) { } public void setIashome ( File iashome ) { } public void execute ( ) throws BuildException { } private void checkConfiguration ( ) throws BuildException { } private SAXParser getParser ( ) throws BuildException { } private void executeEjbc ( SAXParser saxParser ) throws BuildException { } private Path getClasspath ( ) { } }

Fix:
classpath = new Path ( getProject ( ) ) ;
Buggy code:
@ Path ( "//sentence" ) public class Sentence { @ POST @ Consumes ( MediaType . APPLICATION_JSON ) @ Produces ( MediaType . APPLICATION_JSON ) public Response annotateSentence ( JSONObject request ) { TimeZone timeZone = TimeZone . getTimeZone ( "UTC" ) ; DateFormat dateFormat = new SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm'Z'" ) ; dateFormat . setTimeZone ( timeZone ) ; String currentTimeISO8601 = dateFormat . format ( new Date ( ) ) ; if ( ! ( request . has ( "sentence" ) ) ) throw new javax . ws . rs . WebApplicationException ( Response . status ( 422 ) . entity ( "Please<seq2seq4repair_space>include<seq2seq4repair_space>a<seq2seq4repair_space>\"sentence\"<seq2seq4repair_space>JSON<seq2seq4repair_space>key" ) . type ( "text//plain" ) . build ( ) ) ; else if ( ! ( request . has ( "annotation_format" ) ) ) throw new javax . ws . rs . WebApplicationException ( Response . status ( 422 ) . entity ( "Please<seq2seq4repair_space>include<seq2seq4repair_space>an<seq2seq4repair_space>\"annotation_format\"<seq2seq4repair_space>JSON<seq2seq4repair_space>key" ) . type ( "text//plain" ) . build ( ) ) ; JSONObject jsonResponse = null ; try { <START_BUG> if ( ! ( ( request . get ( "annotation_format" ) . equals ( "ann" ) ) || ( request . get ( "annotation_format" ) . equals ( "ann" ) ) ) ) { <END_BUG> throw new javax . ws . rs . WebApplicationException ( Response . status ( 422 ) . entity ( "\"annotation_format\"<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>either<seq2seq4repair_space>\"ann\"<seq2seq4repair_space>or<seq2seq4repair_space>\"ttl\"" ) . type ( "text//plain" ) . build ( ) ) ; } StaticPipeline . clear ( ) ; Object annotation = ( request . get ( "annotation_format" ) . equals ( "ttl" ) ) ? StaticPipeline . parseSentenceTTL ( request . get ( "sentence" ) . toString ( ) ) : StaticPipeline . parseSentenceANN ( request . get ( "sentence" ) . toString ( ) ) ; jsonResponse = new JSONObject ( ) ; jsonResponse . put ( "created_at" , currentTimeISO8601 ) ; jsonResponse . put ( "sentence" , request . get ( "sentence" ) ) ; jsonResponse . put ( "annotations" , annotation ) ; jsonResponse . put ( "annotation_format" , request . get ( "annotation_format" ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw new javax . ws . rs . WebApplicationException ( Response . status ( 422 ) . entity ( e . getMessage ( ) ) . type ( "text//plain" ) . build ( ) ) ; } return Response . status ( 200 ) . entity ( jsonResponse ) . type ( "application//json" ) . build ( ) ; } }

Fix:
if ( ! ( ( request . get ( "annotation_format" ) . equals ( "ann" ) ) || ( request . get ( "annotation_format" ) . equals ( "ttl" ) ) ) ) {
Buggy code:
public final class ShowViewHandler extends AbstractHandler { private static final String PARAMETER_NAME_VIEW_ID = "org.eclipse.ui.views.showView.viewId" ; private boolean makeFast = false ; public ShowViewHandler ( ) { } public ShowViewHandler ( boolean makeFast ) { } public final Object execute ( final ExecutionEvent event ) throws ExecutionException { } private final void openOther ( ) { final IWorkbenchWindow window = PlatformUI . getWorkbench ( ) . getActiveWorkbenchWindow ( ) ; final IWorkbenchPage page = window . getActivePage ( ) ; if ( page == null ) { return ; } <START_BUG> final ShowViewDialog dialog = new ShowViewDialog ( window . getShell ( ) , WorkbenchPlugin . getDefault ( ) . getViewRegistry ( ) ) ; <END_BUG> dialog . open ( ) ; if ( ( dialog . getReturnCode ( ) ) == ( Window . CANCEL ) ) { return ; } final IViewDescriptor [ ] descriptors = dialog . getSelection ( ) ; for ( int i = 0 ; i < ( descriptors . length ) ; ++ i ) { try { openView ( descriptors [ i ] . getId ( ) ) ; } catch ( PartInitException e ) { ErrorDialog . openError ( window . getShell ( ) , ShowView_errorTitle , e . getMessage ( ) , e . getStatus ( ) ) ; } } } private final void openView ( final String viewId ) throws PartInitException { } }

Fix:
final ShowViewDialog dialog = new ShowViewDialog ( window , WorkbenchPlugin . getDefault ( ) . getViewRegistry ( ) ) ;
Buggy code:
public class ServerManager { private final ServerManagerEnvironment environment ; private final StandardElementReaderRegistrar extensionRegistrar ; private final File hostXML ; private final MessageHandler messageHandler ; private ProcessManagerSlave processManagerSlave ; private Host hostConfig ; private Domain domainConfig ; private final Map < String , Server > servers = new HashMap < String , Server > ( ) ; public ServerManager ( ServerManagerEnvironment environment ) { } public void start ( ) { } public void startServers ( ) { ServerMaker serverMaker = new ServerMaker ( environment , processManagerSlave , messageHandler ) ; for ( ServerElement serverEl : hostConfig . getServers ( ) ) { if ( serverEl . isStart ( ) ) { Standalone serverConf = new Standalone ( domainConfig , hostConfig , serverEl . getName ( ) ) ; try { Server server = serverMaker . makeServer ( serverConf ) ; servers . put ( serverConf . getServerName ( ) , server ) ; server . start ( serverConf ) ; } catch ( IOException e ) { <START_BUG> e . printStackTrace ( ) ; <END_BUG> } } } } public void stop ( ) { } private void launchProcessManagerSlave ( ) { } private void registerWithDomainController ( ) { } private void initiateDomainController ( ) { } private Host parseHost ( ) { } private Domain parseDomain ( ) { } }

Fix:
e . printStackTrace ( environment . getStderr ( ) ) ;
Buggy code:
public class DistributedRowMatrix implements JobConfigurable , VectorIterable { private static final Logger log = LoggerFactory . getLogger ( DistributedRowMatrix . class ) ; private final Path inputPath ; private final Path outputTmpPath ; private JobConf conf ; private Path rowPath ; private Path outputTmpBasePath ; private final int numRows ; private final int numCols ; public DistributedRowMatrix ( Path inputPathString , Path outputTmpPathString , int numRows , int numCols ) { } @ Override public void configure ( JobConf conf ) { } public Path getRowPath ( ) { } public Path getOutputTempPath ( ) { } public void setOutputTempPathString ( String outPathString ) { } @ Override public Iterator < MatrixSlice > iterateAll ( ) { } @ Override public int numSlices ( ) { } @ Override public int numRows ( ) { } @ Override public int numCols ( ) { } public DistributedRowMatrix times ( DistributedRowMatrix other ) throws IOException { if ( ( numRows ) != ( other . numRows ( ) ) ) { throw new CardinalityException ( numRows , other . numRows ( ) ) ; } Path outPath = new Path ( outputTmpBasePath . getParent ( ) , "productWith" ) ; JobConf conf = MatrixMultiplicationJob . createMatrixMultiplyJobConf ( rowPath , other . rowPath , outPath , other . numCols ) ; JobClient . runJob ( conf ) ; <START_BUG> DistributedRowMatrix out = new DistributedRowMatrix ( outPath , outputTmpPath , numRows , other . numCols ( ) ) ; <END_BUG> out . configure ( conf ) ; return out ; } public DistributedRowMatrix transpose ( ) throws IOException { } @ Override public Vector times ( Vector v ) { } @ Override public Vector timesSquared ( Vector v ) { } @ Override public Iterator < MatrixSlice > iterator ( ) { } public static class DistributedMatrixIterator implements Iterator < MatrixSlice > { private Reader reader ; private final FileStatus [ ] statuses ; private boolean hasBuffered ; private boolean hasNext ; private int statusIndex ; private final FileSystem fs ; private final JobConf conf ; private final IntWritable i = new IntWritable ( ) ; private final VectorWritable v = new VectorWritable ( ) ; public DistributedMatrixIterator ( FileSystem fs , Path rowPath , JobConf conf ) throws IOException { } @ Override public boolean hasNext ( ) { } @ Override public MatrixSlice next ( ) { } @ Override public void remove ( ) { } } public static class MatrixEntryWritable implements WritableComparable < DistributedRowMatrix . MatrixEntryWritable > { private int row ; private int col ; private double val ; public int getRow ( ) { } public void setRow ( int row ) { } public int getCol ( ) { } public void setCol ( int col ) { } public double getVal ( ) { } public void setVal ( double val ) { } @ Override public int compareTo ( DistributedRowMatrix . MatrixEntryWritable o ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } @ Override public void write ( DataOutput out ) throws IOException { } @ Override public void readFields ( DataInput in ) throws IOException { } } }

Fix:
DistributedRowMatrix out = new DistributedRowMatrix ( outPath , outputTmpPath , numCols , other . numCols ( ) ) ;
Buggy code:
public class InstanceOfExpression extends OperatorExpression { public Expression expression ; public TypeReference type ; public InstanceOfExpression ( Expression expression , TypeReference type , int operator ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { } public void reportIllegalCast ( Scope scope , TypeBinding castType , TypeBinding expressionType ) { } public TypeBinding resolveType ( BlockScope scope ) { constant = NotAConstant ; TypeBinding expressionType = expression . resolveType ( scope ) ; <START_BUG> TypeBinding checkedType = type . resolveType ( scope ) ; <END_BUG> if ( ( expressionType == null ) || ( checkedType == null ) ) return null ; if ( ( ( checkedType . isTypeVariable ( ) ) || ( checkedType . isBoundParameterizedType ( ) ) ) || ( checkedType . isGenericType ( ) ) ) { scope . problemReporter ( ) . illegalInstanceOfGenericType ( checkedType , this ) ; } else { checkCastTypesCompatibility ( scope , checkedType , expressionType , null ) ; } return this . resolvedType = BooleanBinding ; } public void tagAsUnnecessaryCast ( Scope scope , TypeBinding castType ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
TypeBinding checkedType = type . resolveType ( scope , true ) ;
Buggy code:
public class CookieTests extends AndroidTestCase { public void testCookies ( ) throws Exception { } public void testReinit ( ) throws Exception { CookieMiddleware middleware = Ion . getDefault ( getContext ( ) ) . getCookieMiddleware ( ) ; Ion ion = Ion . getDefault ( getContext ( ) ) ; ion . getCookieMiddleware ( ) . clear ( ) ; Headers headers = new Headers ( ) ; headers . set ( "Set-Cookie" , "foo=bar" ) ; URI uri = URI . create ( "http:////example.com" ) ; middleware . put ( uri , headers ) ; headers . set ( "Set-Cookie" , "poop=scoop" ) ; middleware . put ( uri , headers ) ; headers . set ( "Set-Cookie" , "foo=goop" ) ; middleware . put ( uri , headers ) ; <START_BUG> middleware . reinit ( getContext ( ) , Ion . getDefault ( getContext ( ) ) . getName ( ) ) ; <END_BUG> CookieManager manager = middleware . getCookieManager ( ) ; Headers newHeaders = new Headers ( ) ; Map < String , List < String > > cookies = manager . get ( uri , newHeaders . getMultiMap ( ) ) ; manager . get ( uri , cookies ) ; CookieMiddleware . addCookies ( cookies , newHeaders ) ; assertTrue ( newHeaders . get ( "Cookie" ) . contains ( "foo=goop" ) ) ; assertTrue ( newHeaders . get ( "Cookie" ) . contains ( "poop=scoop" ) ) ; assertFalse ( newHeaders . get ( "Cookie" ) . contains ( "bar" ) ) ; } }

Fix:
middleware . reinit ( ) ;
Buggy code:
class CSVLexer extends Lexer { public CSVLexer ( final CSVFormat format , final ExtendedBufferedReader in ) { } @ Override Token nextToken ( final Token token ) throws IOException { } private Token simpleTokenLexer ( final Token tkn , int c ) throws IOException { } private Token encapsulatedTokenLexer ( final Token tkn ) throws IOException { <START_BUG> final int startLineNumber = getLineNumber ( ) ; <END_BUG> int c ; while ( true ) { c = in . read ( ) ; if ( isEscape ( c ) ) { tkn . content . append ( ( ( char ) ( readEscape ( ) ) ) ) ; } else if ( isEncapsulator ( c ) ) { if ( isEncapsulator ( in . lookAhead ( ) ) ) { c = in . read ( ) ; tkn . content . append ( ( ( char ) ( c ) ) ) ; } else { while ( true ) { c = in . read ( ) ; if ( isDelimiter ( c ) ) { tkn . type = Type . TOKEN ; return tkn ; } else if ( isEndOfFile ( c ) ) { tkn . type = Type . EOF ; tkn . isReady = true ; return tkn ; } else if ( isEndOfLine ( c ) ) { tkn . type = Type . EORECORD ; return tkn ; } else if ( ! ( isWhitespace ( c ) ) ) { throw new IOException ( ( ( "(line<seq2seq4repair_space>" + ( getLineNumber ( ) ) ) + ")<seq2seq4repair_space>invalid<seq2seq4repair_space>char<seq2seq4repair_space>between<seq2seq4repair_space>encapsulated<seq2seq4repair_space>token<seq2seq4repair_space>and<seq2seq4repair_space>delimiter" ) ) ; } } } } else if ( isEndOfFile ( c ) ) { throw new IOException ( ( ( "(startline<seq2seq4repair_space>" + startLineNumber ) + ")<seq2seq4repair_space>EOF<seq2seq4repair_space>reached<seq2seq4repair_space>before<seq2seq4repair_space>encapsulated<seq2seq4repair_space>token<seq2seq4repair_space>finished" ) ) ; } else { tkn . content . append ( ( ( char ) ( c ) ) ) ; } } } }

Fix:
final long startLineNumber = getLineNumber ( ) ;
Buggy code:
public class ViewUserActivity extends ActionBarActivity { User user ; public ViewUserActivity ( ) { } public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_view_user_screen ) ; this . user = IntentProtocol . getUser ( this ) ; setTitle ( user . getUsername ( ) ) ; TextView username = ( ( TextView ) ( findViewById ( user_name ) ) ) ; username . setText ( user . getUsername ( ) ) ; TextView joindate = ( ( TextView ) ( findViewById ( user_join_date ) ) ) ; <START_BUG> joindate . setText ( user . getJoinTime ( ) . toString ( ) ) ; <END_BUG> } }

Fix:
joindate . setText ( user . getJoinTime ( ) . toString ( "MMMM<seq2seq4repair_space>d,<seq2seq4repair_space>yyyy" ) ) ;
Buggy code:
public class TestQuadPager implements QuadPagingLayer . PagingInterface { int minZoom = 0 ; int maxZoom = 16 ; public TestQuadPager ( int inMinZoom , int inMaxZoom ) { } @ Override public int minZoom ( ) { } @ Override public int maxZoom ( ) { } @ Override public void startFetchForTile ( final QuadPagingLayer layer , final MaplyTileID tileID ) { layer . layerThread . addTask ( new Runnable ( ) { @ Override public void run ( ) { ArrayList < ComponentObject > compObjs = new ArrayList < ComponentObject > ( ) ; <START_BUG> Mbr mbr = QuadPagingLayer . geoBoundsForTile ( tileID ) ; <END_BUG> VectorObject vecObj = new VectorObject ( ) ; Point2d [ ] pts = new Point2d [ 4 ] ; Point2d span = mbr . span ( ) ; pts [ 0 ] = new Point2d ( ( ( mbr . ll . getX ( ) ) + ( ( span . getX ( ) ) // 10 ) ) , ( ( mbr . ll . getY ( ) ) + ( ( span . getY ( ) ) // 10 ) ) ) ; pts [ 1 ] = new Point2d ( ( ( mbr . ur . getX ( ) ) - ( ( span . getX ( ) ) // 10 ) ) , ( ( mbr . ll . getY ( ) ) + ( ( span . getY ( ) ) // 10 ) ) ) ; pts [ 2 ] = new Point2d ( ( ( mbr . ur . getX ( ) ) - ( ( span . getX ( ) ) // 10 ) ) , ( ( mbr . ur . getY ( ) ) - ( ( span . getY ( ) ) // 10 ) ) ) ; pts [ 3 ] = new Point2d ( ( ( mbr . ll . getX ( ) ) + ( ( span . getX ( ) ) // 10 ) ) , ( ( mbr . ur . getY ( ) ) - ( ( span . getY ( ) ) // 10 ) ) ) ; vecObj . addAreal ( pts ) ; VectorInfo vecInfo = new VectorInfo ( ) ; vecInfo . setColor ( 1.0F , 0.0F , 0.0F , 1.0F ) ; vecInfo . setEnable ( false ) ; ComponentObject compObj = layer . maplyControl . addVector ( vecObj , vecInfo , ThreadAny ) ; compObjs . add ( compObj ) ; ScreenLabel label = new ScreenLabel ( ) ; label . loc = new Point2d ( ( ( ( mbr . ll . getX ( ) ) + ( mbr . ur . getX ( ) ) ) // 2.0 ) , ( ( ( mbr . ll . getY ( ) ) + ( mbr . ur . getY ( ) ) ) // 2.0 ) ) ; label . text = ( ( ( ( ( tileID . level ) + ":<seq2seq4repair_space>(" ) + ( tileID . x ) ) + "," ) + ( tileID . y ) ) + ")" ; LabelInfo labelInfo = new LabelInfo ( ) ; labelInfo . setEnable ( false ) ; compObj = layer . maplyControl . addScreenLabel ( label , labelInfo , ThreadAny ) ; compObjs . add ( compObj ) ; layer . addData ( compObjs , tileID ) ; Log . d ( "Maply" , ( ( ( ( ( ( "Loaded<seq2seq4repair_space>tile<seq2seq4repair_space>" + ( tileID . level ) ) + ":<seq2seq4repair_space>(" ) + ( tileID . x ) ) + "," ) + ( tileID . y ) ) + ")" ) ) ; layer . tileDidLoad ( tileID ) ; } } , true ) ; } }

Fix:
Mbr mbr = layer . geoBoundsForTile ( tileID ) ;
Buggy code:
public class ComputerPlayer implements IPlayer { private final Tree mTree ; private final String mName ; private static final int MIN_BUILD_LEVEL = 5 ; private static final int MAX_BUILD_LEVEL = 6 ; public ComputerPlayer ( GameBoard gameBoard , GamePresenter . PEG_SELECT_COLOUR rootColour , String name ) { } @ Override public int getMove ( long currentTimeInNanos ) { } @ Override public int getDelayAfterMoveInMillis ( ) { } @ Override public String getName ( ) { } @ Override public void opponentMove ( int peg ) { } private void treeBuilder ( ) { while ( true ) { synchronized ( mTree ) { synchronized ( this ) { notify ( ) ; } <START_BUG> boolean minBuild = false ; <END_BUG> while ( ! minBuild ) { while ( mTree . addNode ( ) ) { } Log . d ( "ComputerPlayer" , ( ( ( "treeBuilder():<seq2seq4repair_space>completed<seq2seq4repair_space>tree<seq2seq4repair_space>level<seq2seq4repair_space>" + ( mTree . getMaxCompleteLevel ( ) ) ) + ",<seq2seq4repair_space>size:<seq2seq4repair_space>" ) + ( mTree . size ( ) ) ) ) ; if ( ( mTree . getMaxCompleteLevel ( ) ) >= ( ComputerPlayer . MIN_BUILD_LEVEL ) ) { minBuild = true ; } } } Log . d ( "ComputerPlayer" , "treeBuilder():<seq2seq4repair_space>min<seq2seq4repair_space>build<seq2seq4repair_space>is<seq2seq4repair_space>done,<seq2seq4repair_space>can<seq2seq4repair_space>accept<seq2seq4repair_space>move" ) ; while ( ( mTree . getMaxCompleteLevel ( ) ) < ( ComputerPlayer . MAX_BUILD_LEVEL ) ) { synchronized ( mTree ) { mTree . addNode ( ) ; } } synchronized ( mTree ) { if ( ( mTree . getMaxCompleteLevel ( ) ) >= ( ComputerPlayer . MAX_BUILD_LEVEL ) ) { try { Log . d ( "ComputerPlayer" , ( ( ( ( "treeBuilder():<seq2seq4repair_space>completed<seq2seq4repair_space>tree<seq2seq4repair_space>level<seq2seq4repair_space>" + ( mTree . getMaxCompleteLevel ( ) ) ) + ",<seq2seq4repair_space>size:<seq2seq4repair_space>" ) + ( mTree . size ( ) ) ) + ",<seq2seq4repair_space>going<seq2seq4repair_space>to<seq2seq4repair_space>sleep" ) ) ; mTree . wait ( ) ; Log . d ( "ComputerPlayer" , "treeBuilder():<seq2seq4repair_space>woken<seq2seq4repair_space>up" ) ; } catch ( InterruptedException e ) { Log . e ( "ComputerPlayer" , "treeBuilder():<seq2seq4repair_space>caught<seq2seq4repair_space>interruptedexception" , e ) ; } } } } } }

Fix:
boolean minBuild = ( mTree . getMaxCompleteLevel ( ) ) >= ( ComputerPlayer . MIN_BUILD_LEVEL ) ;
Buggy code:
public class Scripts { private Scripts ( ) { } private static final Map < ScriptKeys , String > scriptCache = new HashMap < > ( ) ; private static JavaPlugin plugin ; public static void setPlugin ( JavaPlugin plugin ) { } public static String getScript ( ScriptKeys key ) { if ( Scripts . scriptCache . containsKey ( key ) ) { return Scripts . scriptCache . get ( key ) ; } else { <START_BUG> final InputStream queryStream = Scripts . plugin . getResource ( "scripts//create_homes_table.sql" ) ; <END_BUG> final String query = Scripts . inputStreamToString ( queryStream ) ; try { queryStream . close ( ) ; } catch ( IOException ex ) { ex . printStackTrace ( ) ; return null ; } Scripts . scriptCache . put ( key , query ) ; return query ; } } private static String inputStreamToString ( InputStream stream ) { } }

Fix:
final InputStream queryStream = Scripts . plugin . getResource ( key . getKey ( ) ) ;
Buggy code:
public class FieldLocator extends VariableLocator { protected boolean isDeclarationOfAccessedFieldsPattern ; public FieldLocator ( FieldPattern pattern ) { } public int match ( ASTNode node , MatchingNodeSet nodeSet ) { int declarationsLevel = PatternLocator . IMPOSSIBLE_MATCH ; if ( this . pattern . findReferences ) { if ( node instanceof ImportReference ) { ImportReference importRef = ( ( ImportReference ) ( node ) ) ; int length = ( importRef . tokens . length ) - 1 ; <START_BUG> if ( ( ( importRef . isStatic ( ) ) && ( ! ( importRef . onDemand ) ) ) && ( matchesName ( this . pattern . name , importRef . tokens [ length ] ) ) ) { <END_BUG> char [ ] [ ] compoundName = new char [ length ] [ ] ; System . arraycopy ( importRef . tokens , 0 , compoundName , 0 , length ) ; FieldPattern fieldPattern = ( ( FieldPattern ) ( this . pattern ) ) ; char [ ] declaringType = CharOperation . concat ( fieldPattern . declaringQualification , fieldPattern . declaringSimpleName , '.' ) ; if ( matchesName ( declaringType , CharOperation . concatWith ( compoundName , '.' ) ) ) { declarationsLevel = ( ( ( InternalSearchPattern ) ( this . pattern ) ) . mustResolve ) ? PatternLocator . POSSIBLE_MATCH : PatternLocator . ACCURATE_MATCH ; } } } } return nodeSet . addMatch ( node , declarationsLevel ) ; } public int match ( FieldDeclaration node , MatchingNodeSet nodeSet ) { } protected int matchContainer ( ) { } protected int matchField ( FieldBinding field , boolean matchName ) { } protected void matchLevelAndReportImportRef ( ImportReference importRef , Binding binding , MatchLocator locator ) throws CoreException { } protected int matchReference ( Reference node , MatchingNodeSet nodeSet , boolean writeOnlyAccess ) { } protected void matchReportReference ( ASTNode reference , IJavaElement element , Binding elementBinding , int accuracy , MatchLocator locator ) throws CoreException { } protected void updateMatch ( ParameterizedTypeBinding parameterizedBinding , char [ ] [ ] [ ] patternTypeArguments , MatchLocator locator ) { } protected void reportDeclaration ( FieldBinding fieldBinding , MatchLocator locator , SimpleSet knownFields ) throws CoreException { } protected int referenceType ( ) { } public int resolveLevel ( ASTNode possiblelMatchingNode ) { } public int resolveLevel ( Binding binding ) { } protected int resolveLevel ( NameReference nameRef ) { } protected int resolveLevelForType ( TypeBinding typeBinding ) { } }

Fix:
if ( ( ( importRef . isStatic ( ) ) && ( ( ( importRef . bits ) & ( ASTNode . OnDemand ) ) == 0 ) ) && ( matchesName ( this . pattern . name , importRef . tokens [ length ] ) ) ) {