nus-yam/ex-repair huggingface dataset:
Buggy code:
public class JPAExtension implements Extension { public static final String SUBSYSTEM_NAME = "jpa" ; private static final JPAExtension . JPASubsystemElementParser parser = new JPAExtension . JPASubsystemElementParser ( ) ; private static final String RESOURCE_NAME = ( JPAExtension . class . getPackage ( ) . getName ( ) ) + ".LocalDescriptions" ; static StandardResourceDescriptionResolver getResourceDescriptionResolver ( final String keyPrefix ) { } private static ModelNode createAddOperation ( String defaultDatasource ) { } private static final int MANAGEMENT_API_MAJOR_VERSION = 1 ; private static final int MANAGEMENT_API_MINOR_VERSION = 2 ; private static final int MANAGEMENT_API_MICRO_VERSION = 0 ; @ Override public void initialize ( ExtensionContext context ) { SubsystemRegistration registration = context . registerSubsystem ( JPAExtension . SUBSYSTEM_NAME , JPAExtension . MANAGEMENT_API_MAJOR_VERSION , JPAExtension . MANAGEMENT_API_MINOR_VERSION , JPAExtension . MANAGEMENT_API_MICRO_VERSION ) ; final ManagementResourceRegistration nodeRegistration = registration . registerSubsystemModel ( INSTANCE ) ; <START_BUG> nodeRegistration . registerOperationHandler ( DESCRIBE , GenericSubsystemDescribeHandler . INSTANCE , GenericSubsystemDescribeHandler . INSTANCE , false , PRIVATE ) ; <END_BUG> registration . registerXMLElementWriter ( JPAExtension . parser ) ; initializeTransformers_1_1_0 ( registration ) ; try { PersistenceProviderLoader . loadDefaultProvider ( ) ; } catch ( ModuleLoadException e ) { JpaLogger . JPA_LOGGER . errorPreloadingDefaultProvider ( e ) ; } try { PersistenceProviderAdaptor provider = PersistenceProviderAdaptorLoader . loadPersistenceAdapterModule ( ADAPTER_MODULE_DEFAULT ) ; final ManagementAdaptor managementAdaptor = provider . getManagementAdaptor ( ) ; if ( ( managementAdaptor != null ) && ( context . isRuntimeOnlyRegistrationValid ( ) ) ) { final ManagementResourceRegistration jpaSubsystemDeployments = registration . registerDeploymentModel ( INSTANCE ) ; managementAdaptor . register ( jpaSubsystemDeployments , PersistenceUnitRegistryImpl . INSTANCE ) ; } } catch ( ModuleLoadException e ) { JpaLogger . JPA_LOGGER . errorPreloadingDefaultProviderAdaptor ( e ) ; } } @ Override public void initializeParsers ( ExtensionParsingContext context ) { } private void initializeTransformers_1_1_0 ( SubsystemRegistration subsystemRegistration ) { } static class JPASubsystemElementParser implements XMLStreamConstants , XMLElementReader < List < ModelNode > > , XMLElementWriter < SubsystemMarshallingContext > { @ Override public void readElement ( XMLExtendedStreamReader reader , List < ModelNode > list ) throws XMLStreamException { } private ModelNode parseJPA ( XMLExtendedStreamReader reader ) throws XMLStreamException { } @ Override public void writeContent ( final XMLExtendedStreamWriter writer , final SubsystemMarshallingContext context ) throws XMLStreamException { } } }

Fix:
nodeRegistration . registerOperationHandler ( DEFINITION , GenericSubsystemDescribeHandler . INSTANCE ) ;
Buggy code:
public class Display extends Canvas implements Runnable { static final long serialVersionUID = 42L ; public static int width = 1024 ; public static int height = 600 ; public static int scale = 1 ; private boolean isRunning = false ; private Thread thread ; private JFrame window ; private BufferedImage image = new BufferedImage ( Display . width , Display . height , BufferedImage . TYPE_INT_RGB ) ; private int [ ] pixels = ( ( DataBufferInt ) ( image . getRaster ( ) . getDataBuffer ( ) ) ) . getData ( ) ; private GridLayout1 layout ; private CANCorder cancorder ; public Display ( ) { } public synchronized void start ( ) { } public synchronized void stop ( ) { } @ Override public void run ( ) { } private void update ( ) { } private void render ( ) { } public static void main ( String [ ] args ) { Display display = new Display ( ) ; display . window . setResizable ( false ) ; <START_BUG> display . window . setTitle ( "Rider<seq2seq4repair_space>Interface" ) ; <END_BUG> display . window . add ( display ) ; display . window . pack ( ) ; display . window . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE ) ; display . window . setLocationRelativeTo ( null ) ; display . window . setVisible ( true ) ; display . cancorder = new CANCorder ( ) ; display . start ( ) ; display . cancorder . close ( ) ; } No newline ; at end ; of file ; }

Fix:
display . window . setTitle ( "Rider<seq2seq4repair_space>Display" ) ;
Buggy code:
public class ObjectDiagramGraph extends Graph { private static final Node [ ] NODE_PROTOTYPES = new Node [ 3 ] ; private static final Edge [ ] EDGE_PROTOTYPES = new Edge [ 3 ] ; @ Override public boolean add ( Node pNode , Point2D pPoint ) { if ( pNode instanceof FieldNode ) { Collection < Node > nodes = getNodes ( ) ; boolean inside = false ; Iterator < Node > iter = nodes . iterator ( ) ; while ( ( ! inside ) && ( iter . hasNext ( ) ) ) { Node n2 = ( ( Node ) ( iter . next ( ) ) ) ; if ( ( n2 instanceof ObjectNode ) && ( n2 . contains ( pPoint ) ) ) { inside = true ; <START_BUG> ( ( FieldNode ) ( pNode ) ) . setObjectNode ( ( ( ObjectNode ) ( n2 ) ) ) ; <END_BUG> } } if ( ! inside ) { return false ; } } if ( ! ( super . add ( pNode , pPoint ) ) ) { return false ; } return true ; } @ Override public Node [ ] getNodePrototypes ( ) { } @ Override public Edge [ ] getEdgePrototypes ( ) { } @ Override public String getFileExtension ( ) { } @ Override public String getDescription ( ) { } }

Fix:
( ( FieldNode ) ( pNode ) ) . setParent ( ( ( ObjectNode ) ( n2 ) ) ) ;
Buggy code:
public class PerspectiveRegistry extends RegistryManager implements IRegistryChangeListener , IPerspectiveRegistry { private String defaultPerspID ; private static final String EXT = "_persp.xml" ; private static final String ID_DEF_PERSP = "PerspectiveRegistry.DEFAULT_PERSP" ; private static final String PERSP = "_persp" ; private static final String TAG_LAYOUT = "perspective" ; protected static final String TAG_DESCRIPTION = "description" ; private static final char SPACE_DELIMITER = '<seq2seq4repair_space>' ; private ArrayList perspToRemove = new ArrayList ( 5 ) ; public PerspectiveRegistry ( ) { } public void addPerspective ( PerspectiveDescriptor desc ) { } public PerspectiveDescriptor createPerspective ( String label , PerspectiveDescriptor originalDescriptor ) { } public void revertPerspectives ( ArrayList perspToRevert ) { } public void deletePerspectives ( ArrayList perspToDelete ) { } public void deletePerspective ( IPerspectiveDescriptor in ) { } void deleteCustomDefinition ( PerspectiveDescriptor desc ) { } boolean hasCustomDefinition ( PerspectiveDescriptor desc ) { } public IPerspectiveDescriptor findPerspectiveWithId ( String id ) { } public IPerspectiveDescriptor findPerspectiveWithLabel ( String label ) { } public String getDefaultPerspective ( ) { } public IPerspectiveDescriptor [ ] getPerspectives ( ) { } public void load ( ) { } private void loadCustom ( ) { } private void unableToLoadPerspective ( IStatus status ) { } public void saveCustomPersp ( PerspectiveDescriptor realDesc , XMLMemento memento ) throws IOException { } public IMemento getCustomPersp ( String id ) throws IOException , WorkbenchException { } private void loadPredefined ( ) { PerspectiveRegistryReader reader = new PerspectiveRegistryReader ( ) ; <START_BUG> reader . readPerspectives ( Platform . getPluginRegistry ( ) , this ) ; <END_BUG> } public void setDefaultPerspective ( String id ) { } public boolean validateLabel ( String label ) { } private void verifyDefaultPerspective ( ) { } public IPerspectiveDescriptor clonePerspective ( String id , String label , IPerspectiveDescriptor originalDescriptor ) { } public void revertPerspective ( IPerspectiveDescriptor perspToRevert ) { } public Object buildNewCacheObject ( IExtensionDelta delta ) { } public void postChangeProcessing ( ) { } }

Fix:
reader . readPerspectives ( Platform . getExtensionRegistry ( ) , this ) ;
Buggy code:
public class ContentAdapter extends RecyclerView . Adapter < ContentAdapter . ContentViewHolder > { private Context context ; private LayoutInflater inflater ; private List < Cardable > contentItems = Collections . emptyList ( ) ; public ContentAdapter ( Context context , List < Cardable > data ) { } @ Override public ContentAdapter . ContentViewHolder onCreateViewHolder ( ViewGroup parent , int viewType ) { } @ Override public void onBindViewHolder ( ContentAdapter . ContentViewHolder holder , int position ) { Cardable current = contentItems . get ( position ) ; holder . header . setText ( current . getHeader ( ) ) ; holder . subHeader . setText ( current . getSubheader ( ) ) ; String imgUri = "http:////www.ilmiositodemo.altervista.org//app//images//big//" + ( current . getImagery ( ) ) ; <START_BUG> Picasso . with ( context ) . load ( imgUri ) . placeholder ( im_placeholeder ) . error ( im_broken_imagery ) . into ( holder . imagery ) ; <END_BUG> } @ Override public int getItemCount ( ) { } class ContentViewHolder extends RecyclerView . ViewHolder { TextView header ; TextView subHeader ; ImageView imagery ; public ContentViewHolder ( View itemView ) { } } }

Fix:
Picasso . with ( context ) . load ( imgUri ) . placeholder ( im_placeholeder ) . error ( im_noimage ) . into ( holder . imagery ) ;
Buggy code:
public class RandomPartitioner implements IPartitioner < BigIntegerToken > { public static final BigInteger ZERO = new BigInteger ( "0" ) ; public static final BigIntegerToken MINIMUM = new BigIntegerToken ( "-1" ) ; private static final byte DELIMITER_BYTE = ":" . getBytes ( ) [ 0 ] ; public DecoratedKey < BigIntegerToken > decorateKey ( ByteBuffer key ) { } public DecoratedKey < BigIntegerToken > convertFromDiskFormat ( ByteBuffer fromdisk ) { int splitPoint = - 1 ; for ( int i = fromdisk . position ( ) ; i < ( fromdisk . limit ( ) ) ; i ++ ) { if ( ( fromdisk . get ( i ) ) == ( RandomPartitioner . DELIMITER_BYTE ) ) { splitPoint = i ; break ; } } assert splitPoint != ( - 1 ) ; <START_BUG> String token = ByteBufferUtil . string ( fromdisk , fromdisk . position ( ) , splitPoint , Charsets . UTF_8 ) ; <END_BUG> ByteBuffer key = fromdisk . duplicate ( ) ; key . position ( ( splitPoint + 1 ) ) ; return new DecoratedKey < BigIntegerToken > ( new BigIntegerToken ( token ) , key ) ; } public Token midpoint ( Token ltoken , Token rtoken ) { } public BigIntegerToken getMinimumToken ( ) { } public BigIntegerToken getRandomToken ( ) { } private final Token . TokenFactory < BigInteger > tokenFactory = new Token . TokenFactory < BigInteger > ( ) { public ByteBuffer toByteArray ( Token < BigInteger > bigIntegerToken ) { } public Token < BigInteger > fromByteArray ( ByteBuffer bytes ) { } public String toString ( Token < BigInteger > bigIntegerToken ) { } public Token < BigInteger > fromString ( String string ) { } } ; public Token . TokenFactory < BigInteger > getTokenFactory ( ) { } public boolean preservesOrder ( ) { } public BigIntegerToken getToken ( ByteBuffer key ) { } public Map < Token , Float > describeOwnership ( List < Token > sortedTokens ) { } }

Fix:
String token = ByteBufferUtil . string ( fromdisk , fromdisk . position ( ) , ( splitPoint - ( fromdisk . position ( ) ) ) , Charsets . UTF_8 ) ;
Buggy code:
public class CoreGroupCommunicationServiceService implements Service < CoreGroupCommunicationService > { public static ServiceName getServiceName ( String name ) { } private final short scope ; private final InjectedValue < Channel > channel = new InjectedValue < Channel > ( ) ; private volatile CoreGroupCommunicationService service ; public CoreGroupCommunicationServiceService ( short scope ) { } public ServiceBuilder < CoreGroupCommunicationService > build ( ServiceTarget target , String name ) { } @ Override public CoreGroupCommunicationService getValue ( ) throws IllegalArgumentException , IllegalStateException { } @ Override public void start ( StartContext context ) throws StartException { this . service = new CoreGroupCommunicationService ( ) ; <START_BUG> this . service . setChannel ( channel . getValue ( ) ) ; <END_BUG> this . service . setScopeId ( this . scope ) ; try { this . service . start ( ) ; } catch ( Exception e ) { throw new StartException ( e ) ; } } @ Override public void stop ( StopContext context ) { } }

Fix:
this . service . setChannel ( this . channel . getValue ( ) ) ;
Buggy code:
public class LoggingTestRunner extends BlockJUnit4ClassRunner { public LoggingTestRunner ( Class < ? > klass ) throws InitializationError { } protected EachTestNotifier makeNotifier ( FrameworkMethod method , RunNotifier notifier ) { <START_BUG> System . err . println ( ( ( ( ( "\n=====<seq2seq4repair_space>Test<seq2seq4repair_space>" + ( getTestClass ( ) . getJavaClass ( ) . getSimpleName ( ) ) ) + "." ) + ( testName ( method ) ) ) + "<seq2seq4repair_space>===========" ) ) ; <END_BUG> return super . makeNotifier ( method , notifier ) ; } }

Fix:
System . err . println ( ( ( ( ( "=====<seq2seq4repair_space>Test<seq2seq4repair_space>" + ( getTestClass ( ) . getJavaClass ( ) . getSimpleName ( ) ) ) + "." ) + ( testName ( method ) ) ) + "<seq2seq4repair_space>===========" ) ) ;
Buggy code:
public class ExpressionState { private final EvaluationContext relatedContext ; private final Stack < ExpressionState . VariableScope > variableScopes = new Stack < ExpressionState . VariableScope > ( ) ; private final Stack < TypedValue > contextObjects = new Stack < TypedValue > ( ) ; private int configuration = 0 ; public ExpressionState ( EvaluationContext context ) { } public ExpressionState ( EvaluationContext context , int configuration ) { } private void createVariableScope ( ) { } public TypedValue getActiveContextObject ( ) { } public void pushActiveContextObject ( TypedValue obj ) { } public void popActiveContextObject ( ) { } public TypedValue getRootContextObject ( ) { } public void setVariable ( String name , Object value ) { } public TypedValue lookupVariable ( String name ) { } public TypeComparator getTypeComparator ( ) { } public Class < ? > findType ( String type ) throws EvaluationException { } public Object convertValue ( Object value , TypeDescriptor targetTypeDescriptor ) throws EvaluationException { } public Object convertValue ( TypedValue value , TypeDescriptor targetTypeDescriptor ) throws EvaluationException { } public void enterScope ( Map < String , Object > argMap ) { } public void enterScope ( String name , Object value ) { } public void exitScope ( ) { } public void setLocalVariable ( String name , Object value ) { } public Object lookupLocalVariable ( String name ) { } public TypedValue operate ( Operation op , Object left , Object right ) throws EvaluationException { OperatorOverloader overloader = this . relatedContext . getOperatorOverloader ( ) ; if ( overloader . overridesOperation ( op , left , right ) ) { Object returnValue = overloader . operate ( op , left , right ) ; return new TypedValue ( returnValue , TypeDescriptor . forObject ( returnValue ) ) ; } else { String leftType = ( left == null ) ? "null" : left . getClass ( ) . getName ( ) ; String rightType = ( right == null ) ? "null" : right . getClass ( ) . getName ( ) ; <START_BUG> throw new SpelEvaluationException ( SpelMessages . OPERATOR_NOT_SUPPORTED_BETWEEN_TYPES , op , leftType , rightType ) ; <END_BUG> } } public List < PropertyAccessor > getPropertyAccessors ( ) { } public EvaluationContext getEvaluationContext ( ) { } private static class VariableScope { private final Map < String , Object > vars = new HashMap < String , Object > ( ) ; public VariableScope ( ) { } public VariableScope ( Map < String , Object > arguments ) { } public VariableScope ( String name , Object value ) { } public Object lookupVariable ( String name ) { } public void setVariable ( String name , Object value ) { } public boolean definesVariable ( String name ) { } } public boolean configuredToGrowCollection ( ) { } public boolean configuredToCreateCollection ( ) { } }

Fix:
throw new SpelEvaluationException ( SpelMessage . OPERATOR_NOT_SUPPORTED_BETWEEN_TYPES , op , leftType , rightType ) ;
Buggy code:
public class Test { @ Autowired private DataAccessObject tennisDAO ; @ Autowired @ Qualifier ( "tennisdaotesting" ) private DataAccessObject tennisDAOTest ; @ Autowired DecisionTree tree ; public void setTennisDAO ( DataAccessObject tennisDAO ) { } public void setTennisDAOTesting ( DataAccessObject tennisDAOTesting ) { } public void setTree ( DecisionTree tree ) { } public static void main ( String [ ] args ) { } public static DataPoint createDataPoint ( ) { DataPoint dataPoint = new DataPoint ( ) ; Attribute < Weather > weather = new Attribute ( "Weather" ) ; Attribute < Humidity > humidity = new Attribute ( "Humidity" ) ; Attribute < Boolean > rain = new Attribute ( "Rain" ) ; AttributeValue < Weather > weatherValue = weather . getNewAttributeValue ( BELOW_40 ) ; <START_BUG> AttributeValue < Humidity > humidityValue = humidity . getNewAttributeValue ( MEDIUM ) ; <END_BUG> AttributeValue < Boolean > rainValue = rain . getNewAttributeValue ( false ) ; dataPoint . addAttributeValue ( weather , weatherValue ) ; dataPoint . addAttributeValue ( humidity , humidityValue ) ; dataPoint . addAttributeValue ( rain , rainValue ) ; return dataPoint ; } }

Fix:
AttributeValue < Humidity > humidityValue = humidity . getNewAttributeValue ( BETWEEN_31_70 ) ;
Buggy code:
public class TestBitrepository2 { public static void main ( String [ ] args ) { File configDir = new File ( "//home//svc//bitrepository-quickstart//commandline//conf" ) ; <START_BUG> Bitrepository bitrep = new Bitrepository ( configDir , null , 1 ) ; <END_BUG> bitrep . shutdown ( ) ; BitmagArcRepositoryClient client = new BitmagArcRepositoryClient ( ) ; } }

Fix:
Bitrepository bitrep = new Bitrepository ( configDir , null , 1 , "kbpillar-test-linux" ) ;
Buggy code:
public class EditProfileActivity extends AppCompatActivity { private static final String TAG = EditProfileActivity . class . getSimpleName ( ) ; private Toolbar mToolbar ; private EditText inputName ; private SessionManager session ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { switch ( item . getItemId ( ) ) { case id . home : <START_BUG> NavUtils . navigateUpFromSameTask ( this ) ; <END_BUG> return true ; case R . id . action_done : final String newName = inputName . getText ( ) . toString ( ) . trim ( ) ; if ( ! ( Validator . isValidName ( newName ) ) ) { Toast . makeText ( getApplicationContext ( ) , "Name<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>Valid" , LENGTH_LONG ) . show ( ) ; } else { SurveriorRequest req = new SurveriorRequest ( Method . POST , AppConfig . URL_UPDATE , session , new Response . Listener < String > ( ) { @ Override public void onResponse ( String response ) { try { JSONObject jObj = new JSONObject ( response ) ; Log . d ( EditProfileActivity . TAG , ( "response:<seq2seq4repair_space>" + response ) ) ; session . remove ( "INCOMPLETE_DATA" ) ; Toast . makeText ( getApplicationContext ( ) , "Name<seq2seq4repair_space>updated" , Toast . LENGTH_LONG ) . show ( ) ; Intent intent = new Intent ( EditProfileActivity . this , . class ) ; startActivity ( intent ) ; finish ( ) ; } catch ( e ) { Log . d ( EditProfileActivity . TAG , e . getMessage ( ) ) ; } } } , new Response . ErrorListener ( ) { @ Override public void onErrorResponse ( VolleyError error ) { } } ) { @ Override protected Map < String , String > getParams ( ) { Map < String , String > params = new HashMap < > ( ) ; params . put ( "name" , newName ) ; return params ; } } ; AppController . getInstance ( ) . addToRequestQueue ( req , "update_user" ) ; } return true ; default : return super . onOptionsItemSelected ( item ) ; } } }

Fix:
onBackPressed ( ) ;
Buggy code:
public class RecentFilesMenu extends EnhancedMenu { public RecentFilesMenu ( ) { } public void setPopupMenuVisible ( boolean b ) { if ( b ) { <START_BUG> final View view = EditAction . getView ( this ) ; <END_BUG> if ( ( getMenuComponentCount ( ) ) != 0 ) removeAll ( ) ; ActionListener actionListener = new ActionListener ( ) { public void actionPerformed ( ActionEvent evt ) { jEdit . openFile ( view , evt . getActionCommand ( ) ) ; view . getStatus ( ) . setMessage ( null ) ; } } ; MouseListener mouseListener = new MouseAdapter ( ) { public void mouseEntered ( MouseEvent evt ) { view . getStatus ( ) . setMessage ( ( ( JMenuItem ) ( evt . getSource ( ) ) ) . getActionCommand ( ) ) ; } public void mouseExited ( MouseEvent evt ) { view . getStatus ( ) . setMessage ( null ) ; } } ; Vector recentVector = BufferHistory . getBufferHistory ( ) ; if ( ( recentVector . size ( ) ) == 0 ) { add ( GUIUtilities . loadMenuItem ( "no-recent-files" ) ) ; super . setPopupMenuVisible ( b ) ; return ; } Vector menuItems = new Vector ( ) ; boolean sort = jEdit . getBooleanProperty ( "sortRecent" ) ; int recentFileCount = Math . min ( recentVector . size ( ) , jEdit . getIntegerProperty ( "history" , 25 ) ) ; for ( int i = ( recentVector . size ( ) ) - 1 ; i >= ( ( recentVector . size ( ) ) - recentFileCount ) ; i -- ) { String path = ( ( BufferHistory . Entry ) ( recentVector . elementAt ( i ) ) ) . path ; VFS vfs = VFSManager . getVFSForPath ( path ) ; JMenuItem menuItem = new JMenuItem ( vfs . getFileName ( path ) ) ; menuItem . setActionCommand ( path ) ; menuItem . addActionListener ( actionListener ) ; menuItem . addMouseListener ( mouseListener ) ; menuItem . setIcon ( fileIcon ) ; if ( sort ) menuItems . addElement ( menuItem ) ; else add ( menuItem ) ; } if ( sort ) { MiscUtilities . quicksort ( menuItems , new MiscUtilities . MenuItemCompare ( ) ) ; for ( int i = 0 ; i < ( menuItems . size ( ) ) ; i ++ ) { add ( ( ( JMenuItem ) ( menuItems . elementAt ( i ) ) ) ) ; } } } super . setPopupMenuVisible ( b ) ; } }

Fix:
final View view = GUIUtilities . getView ( this ) ;
Buggy code:
public class WebServiceWebServiceProviderCoExistRule extends AbstractAnnotationProcessor { public WebServiceWebServiceProviderCoExistRule ( ) { } @ Override public void process ( ) { } private void checkWebServiceProvider ( AnnotationMirror mirror , Messager messager ) { if ( mirror . getAnnotationType ( ) . toString ( ) . equals ( "javax.xml.ws.WebServiceProvider" ) ) { <START_BUG> messager . printError ( mirror . getPosition ( ) , WEBSERVICE_ANNOTATION_PROCESSOR_WEBSERVICE_WEBSERVICEPROVIDER_ERROR_MESSAGE ) ; <END_BUG> } } }

Fix:
messager . printError ( mirror . getPosition ( ) , WEBSERVICE_WEBSERVICEPROVIDER_COMBINATION_ERROR_MESSAGE ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class ConnectorTestCase extends AbstractMgmtTestBase { private final File keyStoreFile = new File ( System . getProperty ( "java.io.tmpdir" ) , "test.keystore" ) ; public enum Connector { HTTP ( "http" , "http" , "HTTP//1.1" , false ) , HTTPS ( "http" , "https" , "HTTP//1.1" , true ) , AJP ( "ajp" , "http" , "AJP//1.3" , false ) ; private final String name ; private final String scheme ; private final String protocol ; private final boolean secure ; private Connector ( String name , String scheme , String protocol , boolean secure ) { } final String getName ( ) { } final String getScheme ( ) { } final String getProtrocol ( ) { } final boolean isSecure ( ) { } } @ ArquillianResource URL url ; @ Deployment public static Archive < ? > getDeployment ( ) { } @ Before public void before ( ) throws IOException { } @ Test public void testDefaultConnectorList ( ) throws Exception { } @ Test public void testHttpConnector ( ) throws Exception { } @ Test public void testHttpsConnector ( ) throws Exception { <START_BUG> FileUtils . copyURLToFile ( ConnectorTestCase . class . getResource ( "//management//api//test.keystore" ) , keyStoreFile ) ; <END_BUG> addConnector ( ConnectorTestCase . Connector . HTTPS ) ; String cURL = ( "https:////" + ( url . getHost ( ) ) ) + ":8181" ; HttpClient httpClient = ConnectorTestCase . wrapClient ( new DefaultHttpClient ( ) ) ; HttpGet get = new HttpGet ( cURL ) ; HttpResponse hr = httpClient . execute ( get ) ; String response = EntityUtils . toString ( hr . getEntity ( ) ) ; assertTrue ( ( "Invalid<seq2seq4repair_space>response:<seq2seq4repair_space>" + response ) , ( ( response . indexOf ( "JBoss" ) ) >= 0 ) ) ; removeConnector ( ConnectorTestCase . Connector . HTTPS ) ; if ( keyStoreFile . exists ( ) ) keyStoreFile . delete ( ) ; } @ Test public void testAjpConnector ( ) throws Exception { } @ Test public void testAddAndRemoveRollbacks ( ) throws Exception { } private void addConnector ( ConnectorTestCase . Connector conn ) throws Exception { } private ModelNode getAddSocketBindingOp ( ConnectorTestCase . Connector conn ) { } private ModelNode getAddConnectorOp ( ConnectorTestCase . Connector conn ) { } private void removeConnector ( ConnectorTestCase . Connector conn ) throws Exception { } private ModelNode getRemoveSocketBindingOp ( ConnectorTestCase . Connector conn ) { } private ModelNode getRemoveConnectorOp ( ConnectorTestCase . Connector conn ) { } private HashSet < String > getConnectorList ( ) throws Exception { } public static HttpClient wrapClient ( HttpClient base ) { } }

Fix:
FileUtils . copyURLToFile ( ConnectorTestCase . class . getResource ( "test.keystore" ) , keyStoreFile ) ;
Buggy code:
@ Component public class APIManager { private static final Logger logger = getLogger ( APIManager . class ) ; private final PoseidonLegoSet legoSet ; private final Configuration configuration ; @ Autowired public APIManager ( PoseidonLegoSet legoSet , Configuration configuration ) { } public void init ( ) { } private void updateLegoSet ( String configs ) { } private String readConfigs ( ) { } private void scanAndAdd ( Path dir , List < String > validConfigs ) { try ( DirectoryStream < Path > files = Files . newDirectoryStream ( dir ) ) { for ( Path entry : files ) { File file = entry . toFile ( ) ; if ( file . isDirectory ( ) ) { scanAndAdd ( entry , validConfigs ) ; <START_BUG> return ; <END_BUG> } if ( "json" . equals ( FilenameUtils . getExtension ( file . getName ( ) ) ) ) { try { String config = FileUtils . readFileToString ( file ) ; if ( validateConfig ( config ) ) { validConfigs . add ( config ) ; } } catch ( IOException e ) { APIManager . logger . error ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>read<seq2seq4repair_space>one<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>local<seq2seq4repair_space>config.<seq2seq4repair_space>Filename<seq2seq4repair_space>=<seq2seq4repair_space>[[" + ( file . getName ( ) ) ) + "]]" ) ) ; } } } } catch ( IOException e ) { APIManager . logger . error ( "Local<seq2seq4repair_space>override<seq2seq4repair_space>directory<seq2seq4repair_space>not<seq2seq4repair_space>found." ) ; } } private boolean validateConfig ( String config ) { } class DirectoryWatcher extends Thread { private WatchService watcher ; public DirectoryWatcher ( ) { } @ Override public void run ( ) { } } No newline ; at end ; of file ; }

Fix:
continue ;
Buggy code:
public class Storage extends TimerTask implements StorageSpec < Task > { private static final int INDEX_TASK_INITIAL = 1 ; private static final int SAVE_DELAY = 5000 ; private static Storage instance = new Storage ( ) ; public static Storage getInstance ( ) { } private TreeMap < Integer , Task > _taskData ; private boolean _isDirty ; private Timer _autosaveTimer ; protected Storage ( ) { } @ Override public void run ( ) { } @ Override public void initialise ( ) { } @ Override public int save ( Task task ) { } private void writeToDisk ( ) { List < Task > allTask = this . getAll ( ) ; List < String > tasksToWrite = IntStream . range ( 0 , allTask . size ( ) ) . mapToObj ( ( index ) -> { <START_BUG> Task task = allTask . get ( index ) ; <END_BUG> task . setId ( ( index + 1 ) ) ; return task ; } ) . map ( Task :: encodeTaskToString ) . collect ( Collectors . toList ( ) ) ; this . getDiskIO ( ) . write ( tasksToWrite ) ; this . _isDirty = false ; } @ Override public Task get ( int index ) { } @ Override public List < Task > getAll ( ) { } @ Override public Task remove ( int id ) { } @ Override public void undelete ( int id ) { } public void removeAll ( ) { } public Set < Integer > getNonDeletedTasks ( ) { } public List < Task > searchByDate ( CustomTime start , CustomTime end ) { } public DiskIO getDiskIO ( ) { } public void readFromDisk ( ) { } public void readFromDisk ( List < String > taskStrings ) { } @ Override public void shutdown ( ) { } }

Fix:
Task task = allTask . get ( index ) . clone ( ) ;
Buggy code:
public class Helper { static Logger log = Logger . getLogger ( Helper . class ) ; static final int SLEEP_SECOND_WHEN_COUNTER_500 = 2 ; static final int MAX_TRY_COUNT_WHEN_COUNTER_500 = 5 ; public static void main ( String [ ] args ) { } public static boolean isExistInMongoDB ( MongoClient mongoClient , String dbName , String collectionName , String field , String value ) { try { DB db = mongoClient . getDB ( dbName ) ; DBCollection collection = db . getCollection ( collectionName ) ; DBCursor cursor = collection . find ( new BasicDBObject ( ) . append ( field , value ) ) ; <START_BUG> return ! ( cursor . hasNext ( ) ) ; <END_BUG> } catch ( Exception e ) { Helper . log . error ( e . getMessage ( ) ) ; e . printStackTrace ( ) ; return false ; } } public static boolean saveToMongoDB ( MongoClient mongoClient , String dbName , String collectionName , ReflectionDBObject object ) { } public static String doGet ( String url ) { } public static String getHtml ( HttpResponse response ) { } public static String readFromFile ( String path ) { } public static void storeToDisc ( String result , String storePath ) { } }

Fix:
return cursor . hasNext ( ) ;
Buggy code:
public class LandUse { Database db = OpenTenureApplication . getInstance ( ) . getDatabase ( ) ; String code ; String displayValue ; String description ; String status ; @ Override public String toString ( ) { } public String getCode ( ) { } public void setCode ( String code ) { } public String getDisplayValue ( ) { } public void setDisplayValue ( String displayValue ) { } public String getDescription ( ) { } public void setDescription ( String description ) { } public String getStatus ( ) { } public void setStatus ( String status ) { } public int add ( ) { } public int addType ( LandUse use ) { } public List < LandUse > getLandUses ( ) { } public List < String > getDisplayValues ( String localization ) { } public int getIndexByCodeType ( String code ) { } public String getTypebyDisplayValue ( String value ) { ResultSet rs = null ; Connection localConnection = null ; PreparedStatement statement = null ; try { localConnection = db . getConnection ( ) ; <START_BUG> statement = localConnection . prepareStatement ( "SELECT<seq2seq4repair_space>TYPE<seq2seq4repair_space>FROM<seq2seq4repair_space>LAND_USE<seq2seq4repair_space>CT<seq2seq4repair_space>WHERE<seq2seq4repair_space>DISPLAY_VALUE<seq2seq4repair_space>=<seq2seq4repair_space>?" ) ; <END_BUG> statement . setString ( 1 , value ) ; rs = statement . executeQuery ( ) ; while ( rs . next ( ) ) { return rs . getString ( 1 ) ; } return null ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } catch ( Exception exception ) { exception . printStackTrace ( ) ; } finally { if ( rs != null ) { try { rs . close ( ) ; } catch ( SQLException e ) { } } if ( statement != null ) { try { statement . close ( ) ; } catch ( SQLException e ) { } } if ( localConnection != null ) { try { localConnection . close ( ) ; } catch ( SQLException e ) { } } } return null ; } public String getDisplayValueByType ( String value ) { } public static LandUse getLandUse ( String type ) { } public int updadateLandUse ( ) { } }

Fix:
statement = localConnection . prepareStatement ( "SELECT<seq2seq4repair_space>TYPE<seq2seq4repair_space>FROM<seq2seq4repair_space>LAND_USE<seq2seq4repair_space>CT<seq2seq4repair_space>WHERE<seq2seq4repair_space>DISPLAY_VALUE<seq2seq4repair_space>LIKE<seq2seq4repair_space>'%'<seq2seq4repair_space>||<seq2seq4repair_space>?<seq2seq4repair_space>||<seq2seq4repair_space>'%'<seq2seq4repair_space>" ) ;
Buggy code:
public class MyCategory extends Category { private static String FQCN = MyCategory . class . getName ( ) ; private static MyCategoryFactory myFactory = new MyCategoryFactory ( ) ; public static void main ( String [ ] args ) { if ( ( args . length ) == 0 ) { Category root = Category . getRoot ( ) ; Layout layout = new PatternLayout ( "%p<seq2seq4repair_space>[%t]<seq2seq4repair_space>%c<seq2seq4repair_space>-<seq2seq4repair_space>%m%n" ) ; <START_BUG> root . addAppender ( new FileAppender ( layout , System . out ) ) ; <END_BUG> } else if ( ( args . length ) == 1 ) { if ( args [ 0 ] . endsWith ( "xml" ) ) { DOMConfigurator . configure ( args [ 0 ] ) ; } else { PropertyConfigurator . configure ( args [ 0 ] ) ; } } else { MyCategory . usage ( "Incorrect<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>parameters." ) ; } try { MyCategory c = ( ( MyCategory ) ( MyCategory . getInstance ( "some.cat" ) ) ) ; c . debug ( "Hello" ) ; } catch ( ClassCastException e ) { LogLog . error ( "Did<seq2seq4repair_space>you<seq2seq4repair_space>forget<seq2seq4repair_space>to<seq2seq4repair_space>set<seq2seq4repair_space>the<seq2seq4repair_space>factory<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>config<seq2seq4repair_space>file?" , e ) ; } } static void usage ( String errMsg ) { } public MyCategory ( String name ) { } public void debug ( String message ) { } public static Category getInstance ( String name ) { } }

Fix:
root . addAppender ( new ConsoleAppender ( layout , ConsoleAppender . SYSTEM_OUT ) ) ;
Buggy code:
public class ExtensionAddHandler extends AbstractExtensionAddHandler { private final ExtensionContext extensionContext ; public ExtensionAddHandler ( final ExtensionContext extensionContext ) { } @ Override protected void installExtension ( String module , OperationContext context ) throws OperationFailedException { try { <START_BUG> for ( Extension extension : Module . loadServiceFromCurrent ( ModuleIdentifier . fromString ( module ) , Extension . class ) ) { <END_BUG> extension . initialize ( extensionContext ) ; } } catch ( ModuleLoadException e ) { throw new OperationFailedException ( new ModelNode ( ) . set ( e . toString ( ) ) ) ; } } }

Fix:
for ( Extension extension : Module . loadServiceFromCallerModuleLoader ( ModuleIdentifier . fromString ( module ) , Extension . class ) ) {
Buggy code:
@ Path ( "//connect" ) public class ConnectResource { public ConnectResource ( ) { } @ GET @ Consumes ( { MediaType . APPLICATION_FORM_URLENCODED } ) @ Timed public Response index ( ) { URI uri = UriBuilder . fromUri ( "http:////news.bbc.com" ) . build ( ) ; try { <START_BUG> uri = UriBuilder . fromUri ( DriveAuth . newAuthUrl ( ) ) . build ( ) ; <END_BUG> } catch ( Exception ex ) { System . console ( ) . printf ( "%s" , ex . getMessage ( ) ) ; } return Response . seeOther ( uri ) . build ( ) ; } }

Fix:
uri = UriBuilder . fromUri ( DriveAuth . newAuthUrl ( "connectstate" ) ) . build ( ) ;
Buggy code:
public class TestAbstractEvent { private ArrayList < AbstractEvent > Events ; private ArrayList < Participant > partic ; @ Before public void setUp ( ) throws Exception { } public void addEvents ( ) { } public void addParticipants ( int numPartic ) { for ( int i = 0 ; i < numPartic ; ++ i ) { <START_BUG> partic . add ( new Participant ( ) ) ; <END_BUG> partic . get ( i ) . createNewRecord ( ) ; } } public void link ( int num ) { } @ After public void tearDown ( ) throws Exception { } @ Test public void testEmptyParamConstructor ( ) { } @ Test public void testOneParamConstructor ( ) { } @ Test public void testTwoParamConstructor ( ) { } @ Test @ SuppressWarnings ( "deprecation" ) public void testThreeParamConstructor ( ) { } @ Test @ SuppressWarnings ( "deprecation" ) public void testFourParamConstructor ( ) { } @ Test public void testGetParticipants ( ) { } @ Test public void testInitialEvent ( ) { } @ Test public void startParticipant ( ) { } @ Test public void finishParticipant ( ) { } No newline ; at end ; of file ; }

Fix:
partic . add ( new Participant ( 1234 , "test" ) ) ;
Buggy code:
public class AndrospyMain { public static Shell shell = new Shell ( ) ; public static String gb_username = "" ; public static String gb_UserRole = "" ; public static String gb_CasePath = "" ; private static Login login ; public static int gb_CaseId ; public static int gb_DeviceId ; public static String gb_PrimaryGmail ; protected Control createControl ( Composite parent ) { } public static void main ( String [ ] args ) { Display display = Display . getDefault ( ) ; AndrospyMain . shell . setMaximized ( true ) ; <START_BUG> AndrospyMain . shell . setText ( "lk.score.androphsy.main.Androspy" ) ; <END_BUG> GridLayout gridLayout = new GridLayout ( 1 , true ) ; AndrospyMain . shell . setLayout ( gridLayout ) ; Menu menu = new Menu ( AndrospyMain . shell , SWT . BAR ) ; AndrospyMain . shell . setMenuBar ( menu ) ; MenuItem menu_file = new MenuItem ( menu , SWT . CASCADE ) ; menu_file . setText ( "File" ) ; Menu menu_1 = new Menu ( menu_file ) ; menu_file . setMenu ( menu_1 ) ; MenuItem mntmNewItem = new MenuItem ( menu_1 , SWT . NONE ) ; mntmNewItem . setText ( "Exit" ) ; AndrospyMain . login = new Login ( AndrospyMain . shell , SWT . None ) ; AndrospyMain . login . setLayoutData ( new org . eclipse . swt . layout . GridData ( SWT . CENTER , SWT . CENTER , true , true ) ) ; AndrospyMain . shell . open ( ) ; AndrospyMain . shell . layout ( ) ; while ( ! ( AndrospyMain . shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) { display . sleep ( ) ; } } } }

Fix:
AndrospyMain . shell . setText ( "Androspy" ) ;
Buggy code:
public class DatabaseUpdater extends DataManager { private int num = 0 ; private boolean isDoneLaunching = false ; private boolean isNotUpdatingStudies = true ; private Context mContext ; public DatabaseUpdater ( Context mContext ) { } public void update ( ) { } @ Override public void onDataReturned ( boolean success ) { } private String [ ] getMainLinks ( ) { <START_BUG> return new String [ ] { mContext . getString ( series_url ) , mContext . getString ( devotions_url ) , mContext . getString ( events_url ) , mContext . getString ( connect_url ) } ; <END_BUG> } private String [ ] getStudyLinks ( ) { } }

Fix:
return new String [ ] { mContext . getString ( series_url ) , mContext . getString ( devotions_url ) , mContext . getString ( events_url ) } ;
Buggy code:
class PatchConfigBuilder { public static enum AffectsType { UPDATED , ORIGINAL , BOTH , NONE ; } private String patchId ; private String description ; private String resultingVersion ; private PatchType patchType ; private boolean generateByDiff ; private List < String > appliesTo = new ArrayList < String > ( ) ; private Set < String > runtimeUseItems = new HashSet < String > ( ) ; private DistributionStructure updatedStructure ; private DistributionStructure appliesToStructure ; PatchConfigBuilder setPatchId ( String patchId ) { } PatchConfigBuilder setDescription ( String description ) { } PatchConfigBuilder setCumulativeType ( String appliesToVersion , String resultingVersion ) { <START_BUG> this . patchType = PatchType . CUMULATIVE ; <END_BUG> this . appliesTo = Collections . singletonList ( appliesToVersion ) ; this . resultingVersion = resultingVersion ; this . updatedStructure = Factory . create ( resultingVersion ) ; this . appliesToStructure = Factory . create ( appliesToVersion ) ; return this ; } PatchConfigBuilder setOneOffType ( List < String > appliesTo ) { } PatchConfigBuilder setGenerateByDiff ( boolean generateByDiff ) { } PatchConfigBuilder addRuntimeUseItem ( String item ) { } PatchConfigBuilder addModuleSearchPath ( final String name , final String standardPath , PatchConfigBuilder . AffectsType affectsType ) { } PatchConfigBuilder setDefaultModuleSearchPathExclusion ( PatchConfigBuilder . AffectsType affectsType ) { } PatchConfigBuilder setDefaultBundleSearchPathExclusion ( PatchConfigBuilder . AffectsType affectsType ) { } PatchConfigBuilder addBundleSearchPath ( final String name , final String standardPath , PatchConfigBuilder . AffectsType affectsType ) { } PatchConfigBuilder addIgnoredPath ( final String path , PatchConfigBuilder . AffectsType affectsType ) { } PatchConfig build ( ) { } private class PatchConfigImpl implements PatchConfig { @ Override public String getPatchId ( ) { } @ Override public String getDescription ( ) { } @ Override public PatchType getPatchType ( ) { } @ Override public String getResultingVersion ( ) { } @ Override public List < String > getAppliesTo ( ) { } @ Override public Set < String > getInRuntimeUseItems ( ) { } @ Override public boolean isGenerateByDiff ( ) { } @ Override public DistributionStructure getOriginalDistributionStructure ( ) { } @ Override public DistributionStructure getUpdatedDistributionStructure ( ) { } @ Override public PatchBuilder toPatchBuilder ( ) { } } }

Fix:
this . patchType = PatchType . UPGRADE ;
Buggy code:
public abstract class CollationTestBase extends LuceneTestCase { protected String firstRangeBeginningOriginal = "د" ; protected String firstRangeEndOriginal = "ژ" ; protected String secondRangeBeginningOriginal = "س" ; protected String secondRangeEndOriginal = "ظ" ; protected String encodeCollationKey ( byte [ ] keyBits ) { } public void testFarsiRangeFilterCollating ( Analyzer analyzer , String firstBeg , String firstEnd , String secondBeg , String secondEnd ) throws Exception { } public void testFarsiRangeQueryCollating ( Analyzer analyzer , String firstBeg , String firstEnd , String secondBeg , String secondEnd ) throws Exception { } public void testFarsiTermRangeQuery ( Analyzer analyzer , String firstBeg , String firstEnd , String secondBeg , String secondEnd ) throws Exception { } public void testCollationKeySort ( Analyzer usAnalyzer , Analyzer franceAnalyzer , Analyzer swedenAnalyzer , Analyzer denmarkAnalyzer , String usResult , String frResult , String svResult , String dkResult ) throws Exception { } private void assertMatches ( Searcher searcher , Query query , Sort sort , String expectedResult ) throws IOException { } private String randomString ( ) { } public void assertThreadSafe ( final Analyzer analyzer ) throws Exception { <START_BUG> int numTestPoints = 1000 ; <END_BUG> int numThreads = _TestUtil . nextInt ( random , 3 , 5 ) ; final HashMap < String , String > map = new HashMap < String , String > ( ) ; for ( int i = 0 ; i < numTestPoints ; i ++ ) { String term = randomString ( ) ; TokenStream ts = analyzer . reusableTokenStream ( "fake" , new StringReader ( term ) ) ; CharTermAttribute encodedBytes = ts . addAttribute ( CharTermAttribute . class ) ; ts . reset ( ) ; assertTrue ( ts . incrementToken ( ) ) ; map . put ( term , encodedBytes . toString ( ) ) ; } Thread [ ] threads = new Thread [ numThreads ] ; for ( int i = 0 ; i < numThreads ; i ++ ) { threads [ i ] = new Thread ( ) { @ Override public void run ( ) { try { for ( Map . Entry < String , String > mapping : map . entrySet ( ) ) { String term = mapping . getKey ( ) ; String expected = mapping . getValue ( ) ; TokenStream ts = analyzer . reusableTokenStream ( "fake" , new StringReader ( term ) ) ; CharTermAttribute encodedBytes = ts . addAttribute ( CharTermAttribute . class ) ; ts . reset ( ) ; assertTrue ( ts . incrementToken ( ) ) ; assertEquals ( expected , encodedBytes . toString ( ) ) ; } } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } } ; } for ( int i = 0 ; i < numThreads ; i ++ ) { threads [ i ] . start ( ) ; } for ( int i = 0 ; i < numThreads ; i ++ ) { threads [ i ] . join ( ) ; } } }

Fix:
int numTestPoints = 100 ;
Buggy code:
public class RoboVMProjectObserver implements IResourceChangeListener { private static final RoboVMProjectObserver INSTANCE = new RoboVMProjectObserver ( ) ; private RoboVMProjectObserver ( ) { } public static RoboVMProjectObserver getInstance ( ) { } public void start ( IProgressMonitor monitor ) throws CoreException { } @ Override public void resourceChanged ( IResourceChangeEvent event ) { } <START_BUG> private void projectChanged ( IProject project ) throws CoreException { <END_BUG> final IJavaProject javaProject = JavaCore . create ( project ) ; if ( ( javaProject == null ) || ( ! ( javaProject . exists ( ) ) ) ) { return ; } Set < String > roboVmLibs = new HashSet < String > ( ) ; roboVmLibs . add ( "robovm-rt" ) ; roboVmLibs . add ( "robovm-objc" ) ; roboVmLibs . add ( "robovm-cocoatouch" ) ; final Set < String > foundRoboVmLibs = new HashSet < String > ( ) ; boolean isRoboVMProject = false ; boolean hasRoboVMContainer = false ; boolean hasRoboVMNature = project . hasNature ( ID ) ; for ( IClasspathEntry entry : javaProject . getRawClasspath ( ) ) { if ( RoboVMClasspathContainer . ID . equals ( entry . getPath ( ) . toString ( ) ) ) { hasRoboVMContainer = true ; isRoboVMProject = true ; } } for ( IClasspathEntry entry : javaProject . getResolvedClasspath ( true ) ) { String lastSegment = entry . getPath ( ) . lastSegment ( ) ; for ( String lib : roboVmLibs ) { if ( lastSegment . startsWith ( lib ) ) { foundRoboVmLibs . add ( lastSegment ) ; isRoboVMProject = true ; break ; } } } if ( isRoboVMProject ) { if ( ( ! hasRoboVMContainer ) || ( ! hasRoboVMNature ) ) { final boolean hasContainer = hasRoboVMContainer ; final boolean hasNature = hasRoboVMNature ; Job job = new Job ( "RoboVM<seq2seq4repair_space>Project<seq2seq4repair_space>Updater" ) { @ Override protected IStatus run ( IProgressMonitor monitor ) { try { ResourcesPlugin . getWorkspace ( ) . run ( new IWorkspaceRunnable ( ) { @ Override public void run ( IProgressMonitor monitor ) throws CoreException { if ( ! hasNature ) { RoboVMNature . configureNatures ( project , monitor ) ; } if ( ! hasContainer ) { addClasspathContainer ( javaProject , monitor , foundRoboVmLibs ) ; } } } , null ) ; } catch ( CoreException e ) { RoboVMPlugin . getConsoleLogger ( ) . error ( "Couldn't<seq2seq4repair_space>run<seq2seq4repair_space>project<seq2seq4repair_space>update<seq2seq4repair_space>job,<seq2seq4repair_space>%s" , e . getMessage ( ) ) ; RoboVMPlugin . log ( e ) ; } return Status . OK_STATUS ; } } ; job . schedule ( ) ; } } } private void addClasspathContainer ( IJavaProject javaProject , IProgressMonitor monitor , Set < String > foundRoboVmLibs ) throws CoreException { } }

Fix:
private void projectChanged ( final IProject project ) throws CoreException {
Buggy code:
public class ModelPerformanceTest extends AjdeTestCase { private final String CONFIG_FILE_PATH = "..//examples//spacewar//spacewar//debug.lst" ; public ModelPerformanceTest ( String name ) { } public static void main ( String [ ] args ) { } public void testRelativeToNoModel ( ) { timedBuild ( true ) ; timedBuild ( false ) ; timedBuild ( true ) ; long rawBuildTime = timedBuild ( false ) ; long modelBuildTime = timedBuild ( true ) ; float overhead = ( ( float ) ( modelBuildTime ) ) // ( ( float ) ( rawBuildTime ) ) ; <START_BUG> assertTrue ( ( overhead < 1.3 ) ) ; <END_BUG> } public long timedBuild ( boolean buildModel ) { } protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } }

Fix:
assertTrue ( ( ( "overhead<seq2seq4repair_space>is<seq2seq4repair_space>" + overhead ) + "<seq2seq4repair_space>><seq2seq4repair_space>1.3" ) , ( overhead < 1.3 ) ) ;
Buggy code:
public class BorderWidthProperty extends AbstractProperty { public BorderWidthProperty ( String name , String borderStyleName , byte axis ) { } public static boolean isBorderWidth ( LexicalUnit lu ) { } public Object calculate ( LexicalUnit lu , Styles parentStyles , Styles styles ) { <START_BUG> return new Integer ( this . calculateInternal ( lu , parentStyles , styles ) ) ; <END_BUG> } private int calculateInternal ( LexicalUnit lu , Styles parentStyles , Styles styles ) { } private String borderStyleName ; private byte axis ; private static final int BORDER_WIDTH_THIN = 1 ; private static final int BORDER_WIDTH_MEDIUM = 3 ; private static final int BORDER_WIDTH_THICK = 5 ; private static int getBorderWidth ( LexicalUnit lu , float fontSize , int ppi ) { } }

Fix:
return Integer . valueOf ( calculateInternal ( lu , parentStyles , styles ) ) ;