nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ServiceRegistryListContext extends AbstractServiceRegistryContext implements Context { private OsgiName parentName ; private interface ThingManager < T > { public T get ( BundleContext ctx , ServiceReference ref ) { } public void release ( BundleContext ctx , ServiceReference ref ) { } } private static class ServiceNamingEnumeration < T > implements NamingEnumeration < T > { private BundleContext ctx ; private ServiceReference [ ] refs ; private int position = 0 ; private ServiceRegistryListContext . ThingManager < T > mgr ; private T last ; private ServiceNamingEnumeration ( BundleContext context , ServiceReference [ ] theRefs , ServiceRegistryListContext . ThingManager < T > manager ) { } public void close ( ) throws NamingException { } public boolean hasMore ( ) throws NamingException { } public T next ( ) throws NamingException { } public boolean hasMoreElements ( ) { } public T nextElement ( ) { } } public ServiceRegistryListContext ( Map < String , Object > env , OsgiName validName ) { } public NamingEnumeration < NameClassPair > list ( Name name ) throws NamingException { } public NamingEnumeration < NameClassPair > list ( String name ) throws NamingException { } public NamingEnumeration < Binding > listBindings ( Name name ) throws NamingException { } public NamingEnumeration < Binding > listBindings ( String name ) throws NamingException { } public Object lookup ( Name name ) throws NamingException { } public Object lookup ( String name ) throws NamingException { Object result = null ; <START_BUG> result = ServiceHelper . getService ( parentName . getInterface ( ) , parentName . getFilter ( ) , parentName . getServiceName ( ) , name , false , env ) ; <END_BUG> if ( result == null ) { throw new NameNotFoundException ( name . toString ( ) ) ; } return result ; } }

Fix:
result = ServiceHelper . getService ( parentName , name , false , env ) ;
Buggy code:
public abstract class CCMatchingTask extends MatchingTask { protected File viewpath ; protected CCUtils utils = new CCUtils ( this ) ; protected Hashtable files = null ; protected String comment = null ; protected File commentFile ; protected String [ ] options ; public void setViewPath ( File value ) { } public void setComment ( String value ) { } protected abstract Vector getOptions ( ) { } protected boolean accept ( CCFile file ) { } public void execute ( ) throws BuildException { } protected void preExecute ( ) throws BuildException { } protected void postExecute ( ) { } protected void doExecute ( ) throws BuildException { } protected void execute ( String [ ] args , CCFile file ) throws BuildException { } protected Hashtable getFiles ( ) { <START_BUG> if ( ( files ) == null ) { <END_BUG> return files ; } files = new Hashtable ( ) ; DirectoryScanner ds = getDirectoryScanner ( viewpath ) ; String [ ] includes = ds . getIncludedDirectories ( ) ; addElements ( files , ds . getBasedir ( ) , includes ) ; includes = ds . getIncludedFiles ( ) ; addElements ( files , ds . getBasedir ( ) , includes ) ; return files ; } protected void addElements ( Hashtable map , File basedir , String [ ] elems ) { } }

Fix:
if ( ( files ) != null ) {
Buggy code:
public class MainActivity extends Activity implements OnClickListener { public String GetDay ( int now ) { } private int getScreenOrientation ( ) { } public String Week ( int now ) { } public String Lent ( int now ) { } @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public void onClick ( View v ) { switch ( v . getId ( ) ) { case id . schedule : Intent intent_rasp = new Intent ( this , rasp . class ) ; startActivity ( intent_rasp ) ; break ; case id . news : Intent intent_news = new Intent ( this , RSSactivity . class ) ; startActivity ( intent_news ) ; break ; case id . library : Intent intent_library = new Intent ( this , library . class ) ; startActivity ( intent_library ) ; break ; case id . teachers : Intent intent_teachers = new Intent ( this , teachers . class ) ; startActivity ( intent_teachers ) ; break ; case id . webcams : Intent intent_webcams = new Intent ( this , webcams . class ) ; startActivity ( intent_webcams ) ; break ; case id . maps : Intent mapIntent = new Intent ( this , Map . class ) ; startActivity ( mapIntent ) ; break ; case id . freepc : Intent freepc_Intent = new Intent ( this , freepc . class ) ; startActivity ( freepc_Intent ) ; break ; case id . calendar : Intent calendar_Intent = new Intent ( this , calendar . class ) ; startActivity ( calendar_Intent ) ; break ; case id . directory : <START_BUG> Intent directory_Intent = new Intent ( this , teachers . class ) ; <END_BUG> startActivity ( directory_Intent ) ; break ; case id . blogs : Intent blogs_Intent = new Intent ( this , blogs . class ) ; startActivity ( blogs_Intent ) ; break ; case id . clubs : Intent clubs_Intent = new Intent ( this , clubs . class ) ; startActivity ( clubs_Intent ) ; break ; case id . transport : Intent transportIntent = new Intent ( this , Transport . class ) ; startActivity ( transportIntent ) ; break ; default : break ; } } }

Fix:
Intent directory_Intent = new Intent ( this , navi . class ) ;
Buggy code:
public abstract class BaseSplashScreenActivity extends SimpleBaseGameActivity { private TextureRegion mLoadingScreenTextureRegion ; private int mWidth ; private int mHeight ; protected abstract float getWaitTime ( ) { } protected abstract int getHeight ( ) { } protected abstract int getWidth ( ) { } protected abstract String getGfxImagePath ( ) { } protected abstract ScreenOrientation getScreenOrientation ( ) { } protected abstract Class < ? extends Activity > getFollowUpActivity ( ) { } @ Override public EngineOptions onCreateEngineOptions ( ) { } @ Override protected void onCreateResources ( ) { } @ Override protected Scene onCreateScene ( ) { final Scene scene = new Scene ( ) ; <START_BUG> scene . setBackground ( new SpriteBackground ( new org . andengine . entity . sprite . Sprite ( 0 , 0 , this . mWidth , this . mHeight , this . mLoadingScreenTextureRegion ) ) ) ; <END_BUG> scene . registerUpdateHandler ( new TimerHandler ( this . getWaitTime ( ) , new ITimerCallback ( ) { @ Override public void onTimePassed ( TimerHandler pTimerHandler ) { BaseSplashScreenActivity . this . startFollowUpActivity ( ) ; } } ) ) ; return scene ; } @ Override public void onResumeGame ( ) { } private void startFollowUpActivity ( ) { } }

Fix:
scene . setBackground ( new SpriteBackground ( new org . andengine . entity . sprite . Sprite ( 0 , 0 , this . mWidth , this . mHeight , this . mLoadingScreenTextureRegion , this . mEngine . getVertexBufferObjectManager ( ) ) ) ) ;
Buggy code:
public class KieNavigatorAction extends SelectionProviderAction implements IKieNavigatorAction { public KieNavigatorAction ( ISelectionProvider provider , String text ) { } public void calculateEnabled ( ) { } protected IContainerNode < ? > getContainer ( ) { } protected IKieServiceDelegate getDelegate ( ) { } protected void refreshViewer ( final IContainerNode < ? > container ) { } protected Shell getShell ( ) { } @ Override <START_BUG> public void handleException ( Throwable t ) { <END_BUG> t . printStackTrace ( ) ; Display . getDefault ( ) . asyncExec ( new Runnable ( ) { @ Override public void run ( ) { MessageDialog . openError ( getShell ( ) , "Error" , t . getMessage ( ) ) ; } } ) ; } }

Fix:
public void handleException ( final Throwable t ) {
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class AddMySqlDataSourceOperationsUnitTestCase extends DsMgmtTestBase { @ Deployment ( testable = false ) public static Archive < ? > getDeployment ( ) { } @ Test public void testAddDsAndTestConnection ( ) throws Exception { final ModelNode address = new ModelNode ( ) ; address . add ( "subsystem" , "datasources" ) ; address . add ( "data-source" , "MySqlDs_Pool" ) ; address . protect ( ) ; final ModelNode operation = new ModelNode ( ) ; operation . get ( OP ) . set ( "add" ) ; operation . get ( OP_ADDR ) . set ( address ) ; operation . get ( "jndi-name" ) . set ( "java:jboss//datasources//MySqlDs" ) ; <START_BUG> operation . get ( "driver-name" ) . set ( "mysql-connector-java-5.1.15.jar" ) ; <END_BUG> operation . get ( "connection-url" ) . set ( "dont_care" ) ; operation . get ( "user-name" ) . set ( "sa" ) ; operation . get ( "password" ) . set ( "sa" ) ; executeOperation ( operation ) ; final ModelNode operation0 = new ModelNode ( ) ; operation0 . get ( OP ) . set ( "take-snapshot" ) ; executeOperation ( operation0 ) ; List < ModelNode > newList = marshalAndReparseDsResources ( "data-source" ) ; remove ( address ) ; Assert . assertNotNull ( "Reparsing<seq2seq4repair_space>failed:" , newList ) ; Assert . assertNotNull ( findNodeWithProperty ( newList , "jndi-name" , "java:jboss//datasources//MySqlDs" ) ) ; } }

Fix:
operation . get ( "driver-name" ) . set ( "mysql-connector-java-5.1.15.jar_com.mysql.jdbc.Driver_5_1" ) ;
Buggy code:
public class ContentNegotiatingViewResolverTests { private ContentNegotiatingViewResolver viewResolver ; @ Before public void createViewResolver ( ) { } @ Test public void getMediaTypeFromFilename ( ) { } @ Test public void getMediaTypeFilename ( ) { } @ Test public void getMediaTypeParameter ( ) { } @ Test public void getMediaTypeAcceptHeader ( ) { MockHttpServletRequest request = new MockHttpServletRequest ( "GET" , "//test" ) ; <START_BUG> request . addHeader ( "Accept" , "text//html,application//xhtml+xml,application//xml;q=0.9,*//*;q=0.8" ) ; <END_BUG> List < MediaType > result = viewResolver . getMediaTypes ( request ) ; assertEquals ( "Invalid<seq2seq4repair_space>amount<seq2seq4repair_space>of<seq2seq4repair_space>media<seq2seq4repair_space>types" , 4 , result . size ( ) ) ; assertEquals ( "Invalid<seq2seq4repair_space>content<seq2seq4repair_space>type" , new MediaType ( "text" , "html" ) , result . get ( 0 ) ) ; assertEquals ( "Invalid<seq2seq4repair_space>content<seq2seq4repair_space>type" , new MediaType ( "application" , "xhtml+xml" ) , result . get ( 1 ) ) ; assertEquals ( "Invalid<seq2seq4repair_space>content<seq2seq4repair_space>type" , new MediaType ( "application" , "xml" , Collections . singletonMap ( "q" , "0.9" ) ) , result . get ( 2 ) ) ; assertEquals ( "Invalid<seq2seq4repair_space>content<seq2seq4repair_space>type" , new MediaType ( "*" , "*" , Collections . singletonMap ( "q" , "0.8" ) ) , result . get ( 3 ) ) ; } @ Test public void getDefaultContentType ( ) { } @ Test public void resolveViewNameWithDefaultContentType ( ) throws Exception { } @ Test public void resolveViewNameAcceptHeader ( ) throws Exception { } @ Test public void resolveViewNameAcceptHeaderDefaultView ( ) throws Exception { } @ Test public void resolveViewNameFilename ( ) throws Exception { } @ Test public void resolveViewNameFilenameDefaultView ( ) throws Exception { } @ Test public void resolveViewContentTypeNull ( ) throws Exception { } @ Test public void resolveViewNoMatch ( ) throws Exception { } @ Test public void resolveViewNoMatchUseUnacceptableStatus ( ) throws Exception { } }

Fix:
request . addHeader ( "Accept" , "text//html,application//xml;q=0.9,application//xhtml+xml,*//*;q=0.8" ) ;
Buggy code:
public class MemoryPoolMXBeanReadResourceHandler implements OperationStepHandler { public static final MemoryPoolMXBeanReadResourceHandler INSTANCE = new MemoryPoolMXBeanReadResourceHandler ( ) ; private MemoryPoolMXBeanReadResourceHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final String memPoolName = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) . getLastElement ( ) . getValue ( ) ; MemoryPoolMXBean memoryPoolMXBean = MemoryPoolMXBeanAttributeHandler . getMemoryPoolMXBean ( memPoolName ) ; final ModelNode result = context . getResult ( ) ; for ( String attribute : PlatformMBeanConstants . MEMORY_POOL_READ_ATTRIBUTES ) { final ModelNode store = result . get ( attribute ) ; try { MemoryPoolMXBeanAttributeHandler . storeResult ( attribute , store , memoryPoolMXBean , memPoolName ) ; } catch ( UnsupportedOperationException ignored ) { } } for ( String attribute : PlatformMBeanConstants . MEMORY_POOL_READ_WRITE_ATTRIBUTES ) { final ModelNode store = result . get ( attribute ) ; try { MemoryPoolMXBeanAttributeHandler . storeResult ( attribute , store , memoryPoolMXBean , memPoolName ) ; } catch ( UnsupportedOperationException ignored ) { } } for ( String attribute : PlatformMBeanConstants . MEMORY_POOL_METRICS ) { final ModelNode store = result . get ( attribute ) ; try { MemoryPoolMXBeanAttributeHandler . storeResult ( attribute , store , memoryPoolMXBean , memPoolName ) ; } catch ( UnsupportedOperationException ignored ) { } } if ( ( PlatformMBeanUtil . JVM_MAJOR_VERSION ) > 6 ) { final ModelNode store = result . get ( OBJECT_NAME ) ; MemoryPoolMXBeanAttributeHandler . storeResult ( OBJECT_NAME , store , memoryPoolMXBean , memPoolName ) ; } <START_BUG> context . completeStep ( ) ; <END_BUG> } }

Fix:
context . completeStep ( NOOP_ROLLBACK_HANDLER ) ;
Buggy code:
public class Snippet160 { public static void main ( String [ ] args ) { final String html = "<html><title>Snippet<//title><body><p<seq2seq4repair_space>id='myid'>Best<seq2seq4repair_space>Friends<//p><p<seq2seq4repair_space>id='myid2'>Cat<seq2seq4repair_space>and<seq2seq4repair_space>Dog<//p><//body><//html>" ; Display display = new Display ( ) ; final Shell shell = new Shell ( display ) ; shell . setLayout ( new FillLayout ( ) ) ; final Browser browser ; try { browser = new Browser ( shell , SWT . NONE ) ; } catch ( SWTError e ) { <START_BUG> System . out . println ( ( "Count<seq2seq4repair_space>not<seq2seq4repair_space>instantiate<seq2seq4repair_space>Browser:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; <END_BUG> return ; } browser . addStatusTextListener ( new StatusTextListener ( ) { public void changed ( StatusTextEvent event ) { browser . setData ( "query" , event . text ) ; } } ) ; browser . addProgressListener ( new ProgressListener ( ) { public void changed ( ProgressEvent event ) { } public void completed ( ProgressEvent event ) { boolean result = browser . execute ( "window.status=document.getElementById('myid').childNodes[0].nodeValue;" ) ; if ( ! result ) { System . out . println ( "Script<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>executed." ) ; return ; } String value = ( ( String ) ( browser . getData ( "query" ) ) ) ; System . out . println ( ( "Node<seq2seq4repair_space>value:<seq2seq4repair_space>" + value ) ) ; } } ) ; browser . setText ( html ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
System . out . println ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>instantiate<seq2seq4repair_space>Browser:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ;
Buggy code:
public interface StorageServiceMBean { public Set < String > getLiveNodes ( ) { } public Set < String > getUnreachableNodes ( ) { } public String getToken ( ) { } public Map < Range , List < String > > getRangeToEndPointMap ( String keyspace ) { } public double getLoad ( ) { } public String getLoadString ( ) { } public Map < String , String > getLoadMap ( ) { } public int getCurrentGenerationNumber ( ) { } <START_BUG> public List < InetAddress > getNaturalEndpoints ( String key , String table ) ; <END_BUG> public void forceTableCompaction ( ) throws IOException { } public void forceTableCleanup ( ) throws IOException { } public void takeSnapshot ( String tableName , String tag ) throws IOException { } public void takeAllSnapshot ( String tag ) throws IOException { } public void clearSnapshot ( ) throws IOException { } public void forceTableFlush ( String tableName , String ... columnFamilies ) throws IOException { } public void forceTableRepair ( String tableName , String ... columnFamilies ) throws IOException { } public void decommission ( ) throws InterruptedException { } public void move ( String newToken ) throws IOException , InterruptedException { } public void loadBalance ( ) throws IOException , InterruptedException { } public void removeToken ( String token ) { } public void setLog4jLevel ( String classQualifier , String level ) { } public String getOperationMode ( ) { } public void drain ( ) throws IOException , InterruptedException , ExecutionException { } public void loadSchemaFromXML ( ) throws IOException , ConfigurationException { } }

Fix:
public List < InetAddress > getNaturalEndpoints ( String table , byte [ ] key ) ;
Buggy code:
public abstract class AbstractTestElement implements Serializable , TestElement { private static transient Logger log = Hierarchy . getDefaultHierarchy ( ) . getLoggerFor ( "jmeter.elements" ) ; private Map propMap = Collections . synchronizedMap ( new HashMap ( ) ) ; private boolean runningVersion ; public Object clone ( ) { TestElement clonedElement = null ; try { clonedElement = ( ( TestElement ) ( this . getClass ( ) . newInstance ( ) ) ) ; } catch ( Exception e ) { } PropertyIterator iter = propertyIterator ( ) ; while ( iter . hasNext ( ) ) { <START_BUG> clonedElement . addProperty ( ( ( JMeterProperty ) ( iter . next ( ) . clone ( ) ) ) ) ; <END_BUG> } return clonedElement ; } public void clear ( ) { } public void removeProperty ( String key ) { } public boolean equals ( Object o ) { } public void addTestElement ( TestElement el ) { } public void setName ( String name ) { } public String getName ( ) { } public JMeterProperty getProperty ( String key ) { } public void traverse ( TestElementTraverser traverser ) { } protected void traverseProperty ( TestElementTraverser traverser , JMeterProperty value ) { } protected void traverseMap ( MapProperty map , TestElementTraverser traverser ) { } protected void traverseCollection ( CollectionProperty col , TestElementTraverser traverser ) { } public int getPropertyAsInt ( String key ) { } public boolean getPropertyAsBoolean ( String key ) { } public float getPropertyAsFloat ( String key ) { } public long getPropertyAsLong ( String key ) { } public double getPropertyAsDouble ( String key ) { } public String getPropertyAsString ( String key ) { } public void addProperty ( JMeterProperty property ) { } public void setProperty ( JMeterProperty property ) { } public void setProperty ( String name , String value ) { } public PropertyIterator propertyIterator ( ) { } protected void mergeIn ( TestElement element ) { } public boolean isRunningVersion ( ) { } public void setRunningVersion ( boolean runningVersion ) { } public void recoverRunningVersion ( ) { } }

Fix:
clonedElement . setProperty ( ( ( JMeterProperty ) ( iter . next ( ) . clone ( ) ) ) ) ;
Buggy code:
public final class FramedSnappyCompressorInputStreamTest extends AbstractTestCase { public void testMatches ( ) throws IOException { } public void testLoremIpsum ( ) throws Exception { } public void testRemainingChunkTypes ( ) throws Exception { } public void testAvailable ( ) throws Exception { } public void testUnskippableChunk ( ) { byte [ ] input = new byte [ ] { ( ( byte ) ( 255 ) ) , 6 , 0 , 0 , 's' , 'N' , 'a' , 'P' , 'p' , 'Y' , 2 , 2 , 0 , 0 , 1 , 1 } ; try { FramedSnappyCompressorInputStream in = new FramedSnappyCompressorInputStream ( new ByteArrayInputStream ( input ) ) ; in . read ( ) ; fail ( "expected<seq2seq4repair_space>an<seq2seq4repair_space>exception" ) ; in . close ( ) ; } catch ( IOException ex ) { <START_BUG> assertTrue ( ( ( ex . getMessage ( ) . indexOf ( "unskippable<seq2seq4repair_space>chunk" ) ) > ( - 1 ) ) ) ; <END_BUG> } } public void testChecksumUnmasking ( ) { } public void testChecksumUnmasking ( long x ) { } private long mask ( long x ) { } }

Fix:
assertTrue ( ex . getMessage ( ) . contains ( "unskippable<seq2seq4repair_space>chunk" ) ) ;
Buggy code:
public class WeldExtension implements Extension { public static final String SUBSYSTEM_NAME = "weld" ; static final PathElement PATH_SUBSYSTEM = PathElement . pathElement ( SUBSYSTEM , WeldExtension . SUBSYSTEM_NAME ) ; private static final String RESOURCE_NAME = ( WeldExtension . class . getPackage ( ) . getName ( ) ) + ".LocalDescriptions" ; private static final int MANAGEMENT_API_MAJOR_VERSION = 2 ; private static final int MANAGEMENT_API_MINOR_VERSION = 0 ; private static final int MANAGEMENT_API_MICRO_VERSION = 0 ; static StandardResourceDescriptionResolver getResourceDescriptionResolver ( final String ... keyPrefix ) { } @ Override public void initialize ( final ExtensionContext context ) { ROOT_LOGGER . debug ( "Activating<seq2seq4repair_space>Weld<seq2seq4repair_space>Extension" ) ; final SubsystemRegistration subsystem = context . registerSubsystem ( WeldExtension . SUBSYSTEM_NAME , WeldExtension . MANAGEMENT_API_MAJOR_VERSION , WeldExtension . MANAGEMENT_API_MINOR_VERSION , WeldExtension . MANAGEMENT_API_MICRO_VERSION ) ; final ManagementResourceRegistration registration = subsystem . registerSubsystemModel ( INSTANCE ) ; registration . registerOperationHandler ( DEFINITION , GenericSubsystemDescribeHandler . INSTANCE ) ; <START_BUG> subsystem . registerXMLElementWriter ( WeldSubsystem20Parser . INSTANCE ) ; <END_BUG> if ( context . isRegisterTransformers ( ) ) { registerTransformers ( subsystem ) ; } } @ Override public void initializeParsers ( final ExtensionParsingContext context ) { } private void registerTransformers ( SubsystemRegistration subsystem ) { } }

Fix:
subsystem . registerXMLElementWriter ( WeldSubsystemPersister . INSTANCE ) ;
Buggy code:
public class ClustersFilterTest extends MahoutTestCase { private Configuration configuration ; private Path output ; @ Override @ Before public void setUp ( ) throws Exception { super . setUp ( ) ; <START_BUG> configuration = new Configuration ( ) ; <END_BUG> output = getTestTempDirPath ( ) ; } @ Test public void testAcceptNotFinal ( ) throws Exception { } @ Test public void testAcceptFinalPath ( ) throws IOException { } }

Fix:
configuration = getConfiguration ( ) ;
Buggy code:
public class DataGetter { private static final Logger LOG = LoggerFactory . getLogger ( DataGetter . class ) ; public boolean get ( String link , File out , String checksum ) { } private boolean get ( String link , File out , String checksum , int tries ) { <START_BUG> System . out . println ( ( ( ( "Downloading:<seq2seq4repair_space>" + link ) + "<seq2seq4repair_space>to:<seq2seq4repair_space>" ) + ( out . getAbsolutePath ( ) ) ) ) ; <END_BUG> DigestInputStream input = null ; FileOutputStream output = null ; int n ; try { MessageDigest md = MessageDigest . getInstance ( "MD5" ) ; URL url = new URL ( link ) ; URLConnection con = url . openConnection ( ) ; byte [ ] buffer = new byte [ 4096 ] ; input = new DigestInputStream ( con . getInputStream ( ) , md ) ; output = new FileOutputStream ( out ) ; while ( ( n = input . read ( buffer ) ) != ( - 1 ) ) { output . write ( buffer , 0 , n ) ; } output . flush ( ) ; String sum = getToHex ( md . digest ( ) ) ; if ( sum . equals ( checksum ) ) { return true ; } } catch ( MalformedInputException ex ) { DataGetter . LOG . error ( ex . getMessage ( ) , ex ) ; } catch ( IOException ex ) { DataGetter . LOG . error ( ex . getMessage ( ) , ex ) ; } catch ( NoSuchAlgorithmException ex ) { DataGetter . LOG . error ( ex . getMessage ( ) , ex ) ; } finally { if ( input != null ) { try { input . close ( ) ; } catch ( IOException ex ) { DataGetter . LOG . error ( ex . getMessage ( ) , ex ) ; } } if ( output != null ) { try { output . close ( ) ; } catch ( IOException ex ) { DataGetter . LOG . error ( ex . getMessage ( ) , ex ) ; } } } if ( tries < 10 ) { out . delete ( ) ; tries ++ ; return get ( link , out , checksum , tries ) ; } else { return false ; } } private String getToHex ( byte [ ] b ) { } }

Fix:
DataGetter . LOG . info ( ( ( ( "Downloading:<seq2seq4repair_space>" + link ) + "<seq2seq4repair_space>to:<seq2seq4repair_space>" ) + ( out . getAbsolutePath ( ) ) ) ) ;
Buggy code:
public class DeferredEntityImpl extends EntityImpl implements DeferredNode { static final long serialVersionUID = 4760180431078941638L ; protected transient int fNodeIndex ; DeferredEntityImpl ( DeferredDocumentImpl ownerDocument , int nodeIndex ) { } public int getNodeIndex ( ) { } protected void synchronizeData ( ) { needsSyncData ( false ) ; DeferredDocumentImpl ownerDocument = ( ( DeferredDocumentImpl ) ( this . ownerDocument ) ) ; name = ownerDocument . getNodeName ( fNodeIndex ) ; publicId = ownerDocument . getNodeValue ( fNodeIndex ) ; systemId = ownerDocument . getNodeURI ( fNodeIndex ) ; int extraDataIndex = ownerDocument . getNodeExtra ( fNodeIndex ) ; ownerDocument . getNodeType ( extraDataIndex ) ; notationName = ownerDocument . getNodeName ( extraDataIndex ) ; version = ownerDocument . getNodeValue ( extraDataIndex ) ; encoding = ownerDocument . getNodeURI ( extraDataIndex ) ; int extraIndex2 = ownerDocument . getNodeExtra ( extraDataIndex ) ; baseURI = ownerDocument . getNodeName ( extraIndex2 ) ; <START_BUG> actualEncoding = ownerDocument . getNodeValue ( extraIndex2 ) ; <END_BUG> } protected void synchronizeChildren ( ) { } }

Fix:
inputEncoding = ownerDocument . getNodeValue ( extraIndex2 ) ;
Buggy code:
@ With ( Authentication . class ) public class Student extends AbstractVireoController { protected static Submission getSubmission ( ) { } @ Security ( RoleType . STUDENT ) public static void submissionList ( ) { } @ Security ( RoleType . STUDENT ) public static void submissionRemoveAdditionalDocumentsJSON ( Long subId ) { } @ Security ( RoleType . STUDENT ) public static void submissionUploadAdditionalDocumentJSON ( Long subId ) { } @ Security ( RoleType . STUDENT ) public static void submissionUploadPrimaryDocumentJSON ( Long subId ) { } @ Security ( RoleType . STUDENT ) public static void submissionAddMessageJSON ( Long subId ) { } @ Security ( RoleType . STUDENT ) public static void submissionView ( Long subId ) { } @ Security ( RoleType . STUDENT ) public static void correctionsComplete ( Long subId ) { } @ Security ( RoleType . STUDENT ) public static void submissionDelete ( Long subId ) { } public static boolean uploadPrimaryDocument ( Submission sub ) { } public static boolean uploadAdditional ( Submission sub ) { } public static boolean removeAdditional ( Submission sub ) { <START_BUG> String [ ] idsToRemove = params . getAll ( "attachmentToRemove[]" ) ; <END_BUG> if ( idsToRemove != null ) { for ( String idString : idsToRemove ) { Long id = Long . valueOf ( idString ) ; Attachment attachment = subRepo . findAttachment ( id ) ; if ( ( ( attachment . getSubmission ( ) ) == sub ) && ( ( ( ( attachment . getType ( ) ) == ( AttachmentType . SUPPLEMENTAL ) ) || ( ( attachment . getType ( ) ) == ( AttachmentType . ADMINISTRATIVE ) ) ) || ( ( attachment . getType ( ) ) == ( AttachmentType . SOURCE ) ) ) ) attachment . delete ( ) ; } } return true ; } public static void viewAttachment ( Long subId , Long attachmentId , String name ) { } public static boolean verify ( Submission sub ) { } No newline ; at end ; of file ; }

Fix:
String [ ] idsToRemove = params . getAll ( "attachmentToRemove" ) ;
Buggy code:
public class FileTransfer extends ByteArrayTransfer { static FileTransfer _instance = new FileTransfer ( ) ; static final String HFS = "hfs<seq2seq4repair_space>" ; static final String FURL = "furl" ; static final int HFSID = registerType ( FileTransfer . HFS ) ; static final int FURLID = registerType ( FileTransfer . FURL ) ; FileTransfer ( ) { } public static FileTransfer getInstance ( ) { } public void javaToNative ( Object object , TransferData transferData ) { } public Object nativeToJava ( TransferData transferData ) { if ( ( ! ( isSupportedType ( transferData ) ) ) || ( ( transferData . data ) == null ) ) return null ; if ( ( transferData . data . length ) == 0 ) return null ; int count = transferData . data . length ; String [ ] fileNames = new String [ count ] ; for ( int i = 0 ; i < count ; i ++ ) { byte [ ] data = transferData . data [ i ] ; int url = 0 ; if ( ( transferData . type ) == ( FileTransfer . HFSID ) ) { byte [ ] fsspec = new byte [ ( data . length ) - 10 ] ; System . arraycopy ( data , 10 , fsspec , 0 , fsspec . length ) ; byte [ ] fsRef = new byte [ 80 ] ; if ( ( OS . FSpMakeFSRef ( fsspec , fsRef ) ) != ( OS . noErr ) ) return null ; url = OS . CFURLCreateFromFSRef ( kCFAllocatorDefault , fsRef ) ; if ( url == 0 ) return null ; } if ( ( transferData . type ) == ( FileTransfer . FURLID ) ) { <START_BUG> int encoding = OS . CFStringGetSystemEncoding ( ) ; <END_BUG> url = OS . CFURLCreateWithBytes ( kCFAllocatorDefault , data , data . length , encoding , 0 ) ; if ( url == 0 ) return null ; } try { int path = OS . CFURLCopyFileSystemPath ( url , kCFURLPOSIXPathStyle ) ; if ( path == 0 ) return null ; try { int length = OS . CFStringGetLength ( path ) ; if ( length == 0 ) return null ; char [ ] buffer = new char [ length ] ; CFRange range = new CFRange ( ) ; range . length = length ; OS . CFStringGetCharacters ( path , range , buffer ) ; fileNames [ i ] = new String ( buffer ) ; } finally { OS . CFRelease ( path ) ; } } finally { OS . CFRelease ( url ) ; } } return fileNames ; } protected int [ ] getTypeIds ( ) { } protected String [ ] getTypeNames ( ) { } boolean checkFile ( Object object ) { } protected boolean validate ( Object object ) { } }

Fix:
int encoding = OS . kCFStringEncodingUTF8 ;
Buggy code:
public class LiteralTests extends ExpressionTestCase { public void testLiteralBoolean01 ( ) { } public void testLiteralBoolean02 ( ) { } public void testLiteralInteger01 ( ) { } public void testLiteralInteger02 ( ) { } public void testLiteralString01 ( ) { } public void testLiteralString02 ( ) { } public void testLiteralString03 ( ) { } public void testLiteralString04 ( ) { } public void testLiteralString05 ( ) { } public void testLiteralString06 ( ) { } public void testHexIntLiteral01 ( ) { } public void testLongIntLiteral01 ( ) { } public void testLongIntInteractions01 ( ) { evaluate ( "0x20<seq2seq4repair_space>*<seq2seq4repair_space>2L" , 64L , Long . class ) ; evaluateAndAskForReturnType ( "0x20<seq2seq4repair_space>*<seq2seq4repair_space>2L" , 64 , Integer . class ) ; <START_BUG> evaluateAndCheckError ( "0x1220<seq2seq4repair_space>*<seq2seq4repair_space>0xffffffffL" , Integer . class , PROBLEM_DURING_TYPE_CONVERSION , ( - 1 ) ) ; <END_BUG> } public void testSignedIntLiterals ( ) { } public void testLiteralReal01_CreatingDoubles ( ) { } public void testLiteralReal02_CreatingFloats ( ) { } public void testLiteralReal03_UsingExponents ( ) { } public void testLiteralReal04_BadExpressions ( ) { } public void testLiteralNull01 ( ) { } public void testConversions ( ) { } public void testNotWritable ( ) throws Exception { } }

Fix:
evaluateAndCheckError ( "0x1220<seq2seq4repair_space>*<seq2seq4repair_space>0xffffffffL" , Integer . class , TYPE_CONVERSION_ERROR , ( - 1 ) ) ;
Buggy code:
public abstract class AbstractFeedView < T extends WireFeed > extends AbstractView { @ Override protected final void renderMergedOutputModel ( Map < String , Object > model , HttpServletRequest request , HttpServletResponse response ) throws Exception { T wireFeed = newFeed ( ) ; buildFeedMetadata ( model , wireFeed , request ) ; buildFeedEntries ( model , wireFeed , request , response ) ; <START_BUG> response . setContentType ( AbstractFeedView . getContentType ( ) ) ; <END_BUG> if ( ! ( StringUtils . hasText ( wireFeed . getEncoding ( ) ) ) ) { wireFeed . setEncoding ( "UTF-8" ) ; } WireFeedOutput feedOutput = new WireFeedOutput ( ) ; ServletOutputStream out = response . getOutputStream ( ) ; feedOutput . output ( wireFeed , new OutputStreamWriter ( out , wireFeed . getEncoding ( ) ) ) ; out . flush ( ) ; } protected abstract T newFeed ( ) { } protected void buildFeedMetadata ( Map < String , Object > model , T feed , HttpServletRequest request ) { } protected abstract void buildFeedEntries ( Map < String , Object > model , T feed , HttpServletRequest request , HttpServletResponse response ) throws Exception { } }

Fix:
setResponseContentType ( request , response ) ;
Buggy code:
public class TestTermVectorsReader extends LuceneTestCase { private String [ ] testFields = new String [ ] { "f1" , "f2" , "f3" , "f4" } ; private boolean [ ] testFieldsStorePos = new boolean [ ] { true , false , true , false } ; private boolean [ ] testFieldsStoreOff = new boolean [ ] { true , false , false , true } ; private String [ ] testTerms = new String [ ] { "this" , "is" , "a" , "test" } ; private int [ ] [ ] positions = new int [ testTerms . length ] [ ] ; private Directory dir ; private SegmentInfoPerCommit seg ; private FieldInfos fieldInfos = new FieldInfos ( new FieldInfo [ 0 ] ) ; private static int TERM_FREQ = 3 ; private class TestToken implements Comparable < TestTermVectorsReader . TestToken > { String text ; int pos ; int startOffset ; int endOffset ; public int compareTo ( TestTermVectorsReader . TestToken other ) { } } TestTermVectorsReader . TestToken [ ] tokens = new TestTermVectorsReader . TestToken [ ( testTerms . length ) * ( TestTermVectorsReader . TERM_FREQ ) ] ; @ Override public void setUp ( ) throws Exception { } @ Override public void tearDown ( ) throws Exception { } private class MyTokenizer extends Tokenizer { private int tokenUpto ; private final CharTermAttribute termAtt ; private final PositionIncrementAttribute posIncrAtt ; private final OffsetAttribute offsetAtt ; public MyTokenizer ( Reader reader ) { } @ Override public boolean incrementToken ( ) { } @ Override public void reset ( ) throws IOException { } } private class MyAnalyzer extends Analyzer { @ Override public TokenStreamComponents createComponents ( String fieldName , Reader reader ) { } } public void test ( ) throws IOException { } public void testReader ( ) throws IOException { } public void testDocsEnum ( ) throws IOException { TermVectorsReader reader = Codec . getDefault ( ) . termVectorsFormat ( ) . vectorsReader ( dir , seg . info , fieldInfos , newIOContext ( random ( ) ) ) ; for ( int j = 0 ; j < 5 ; j ++ ) { Terms vector = reader . get ( j ) . terms ( testFields [ 0 ] ) ; assertNotNull ( vector ) ; assertEquals ( testTerms . length , vector . size ( ) ) ; TermsEnum termsEnum = vector . iterator ( null ) ; DocsEnum docsEnum = null ; for ( int i = 0 ; i < ( testTerms . length ) ; i ++ ) { final BytesRef text = termsEnum . next ( ) ; assertNotNull ( text ) ; String term = text . utf8ToString ( ) ; assertEquals ( testTerms [ i ] , term ) ; <START_BUG> docsEnum = _TestUtil . docs ( random ( ) , termsEnum , null , docsEnum , 0 ) ; <END_BUG> assertNotNull ( docsEnum ) ; int doc = docsEnum . docID ( ) ; assertTrue ( ( ( doc == ( - 1 ) ) || ( doc == ( DocIdSetIterator . NO_MORE_DOCS ) ) ) ) ; assertTrue ( ( ( docsEnum . nextDoc ( ) ) != ( DocIdSetIterator . NO_MORE_DOCS ) ) ) ; assertEquals ( NO_MORE_DOCS , docsEnum . nextDoc ( ) ) ; } assertNull ( termsEnum . next ( ) ) ; } reader . close ( ) ; } public void testPositionReader ( ) throws IOException { } public void testOffsetReader ( ) throws IOException { } public void testBadParams ( ) throws IOException { } }

Fix:
docsEnum = _TestUtil . docs ( random ( ) , termsEnum , null , docsEnum , false ) ;
Buggy code:
class WorkbenchShowInAction extends ShowInAction implements IPartListener { public WorkbenchShowInAction ( IWorkbenchWindow window ) { } public void partActivated ( IWorkbenchPart part ) { <START_BUG> updateState ( part ) ; <END_BUG> } public void partBroughtToTop ( IWorkbenchPart part ) { } public void partClosed ( IWorkbenchPart part ) { } public void partDeactivated ( IWorkbenchPart part ) { } public void partOpened ( IWorkbenchPart part ) { } }

Fix:
updateState ( ) ;
Buggy code:
public class PassVaultApplication extends Application { private Map < Integer , List < String > > dictionary ; private final List < Integer > wordLengths = Arrays . asList ( 3 , 4 , 5 , 6 , 7 ) ; private UserPreferences userPrefs ; @ Override public void onCreate ( ) { } public UserPreferences getUserPrefs ( ) { } public Map < Integer , List < String > > getDictionary ( ) { } public List < Integer > getWordLengths ( ) { } private String constructFilename ( final Integer wordLength ) { <START_BUG> return String . format ( "enable1_%d.txt" , wordLength ) ; <END_BUG> } }

Fix:
return String . format ( Locale . UK , "enable1_%d.txt" , wordLength ) ;
Buggy code:
public class Kurtosis extends AbstractStorelessUnivariateStatistic implements Serializable { private static final long serialVersionUID = 2784465764798260919L ; protected FourthMoment moment ; protected boolean incMoment ; public Kurtosis ( ) { } public Kurtosis ( final FourthMoment m4 ) { } public Kurtosis ( Kurtosis original ) { } @ Override public void increment ( final double d ) { } @ Override public double getResult ( ) { double kurtosis = Double . NaN ; if ( ( moment . getN ( ) ) > 3 ) { double variance = ( moment . m2 ) // ( ( moment . n ) - 1 ) ; if ( ( ( moment . n ) <= 3 ) || ( variance < 1.0E-19 ) ) { kurtosis = 0.0 ; } else { double n = moment . n ; <START_BUG> kurtosis = ( ( ( n * ( n + 1 ) ) * ( moment . m4 ) ) - ( ( ( 3 * ( moment . m2 ) ) * ( moment . m2 ) ) * ( n - 1 ) ) ) // ( ( ( ( ( n - 1 ) * ( n - 2 ) ) * ( n - 3 ) ) * variance ) * variance ) ; <END_BUG> } } return kurtosis ; } @ Override public void clear ( ) { } public long getN ( ) { } @ Override public double evaluate ( final double [ ] values , final int begin , final int length ) { } @ Override public Kurtosis copy ( ) { } public static void copy ( Kurtosis source , Kurtosis dest ) throws NullArgumentException { } }

Fix:
kurtosis = ( ( ( n * ( n + 1 ) ) * ( moment . getResult ( ) ) ) - ( ( ( 3 * ( moment . m2 ) ) * ( moment . m2 ) ) * ( n - 1 ) ) ) // ( ( ( ( ( n - 1 ) * ( n - 2 ) ) * ( n - 3 ) ) * variance ) * variance ) ;
Buggy code:
@ Version ( AsVersion . V_7_1_2_Final ) public class SimpleMixedDomain_7_1_2_Final_TestCase extends SimpleMixedDomainTest { @ BeforeClass public static void beforeClass ( ) { <START_BUG> SimpleMixedDomain_7_1_2_Final_TestCase . beforeClass ( SimpleMixedDomain_7_1_2_Final_TestCase . class ) ; <END_BUG> } }

Fix:
MixedDomainTestSuite . getSupport ( SimpleMixedDomain_7_1_2_Final_TestCase . class ) ;
Buggy code:
public class Util { private static final PeriodFormatter TIME_FORMATTER = new PeriodFormatterBuilder ( ) . appendDays ( ) . appendSuffix ( "d" ) . appendSeparator ( "<seq2seq4repair_space>" ) . appendHours ( ) . appendSuffix ( "h" ) . appendSeparator ( "<seq2seq4repair_space>" ) . appendMinutes ( ) . appendSuffix ( "m" ) . appendSeparator ( "<seq2seq4repair_space>" ) . minimumPrintedDigits ( 2 ) . appendSeconds ( ) . appendSuffix ( "s" ) . appendSeparator ( "<seq2seq4repair_space>" ) . minimumPrintedDigits ( 3 ) . appendMillis ( ) . appendSuffix ( "ms" ) . toFormatter ( ) ; public static String readFileAsString ( String filePath ) throws IOException { } public static String passed ( boolean value ) { } <START_BUG> public static String formatDuration ( Long duration ) { <END_BUG> return Util . TIME_FORMATTER . print ( new Period ( 0 , ( duration // 1000000 ) ) ) ; } public static int findStatusCount ( List < Status > statuses , Status statusToFind ) { } public static String tagsToHtml ( Tag [ ] tags ) { } public static void unzipToFile ( File srcZipFile , String destDirectory ) { } public static String formatErrorMessage ( String errorMessage , int errorID ) { } No newline ; at end ; of file ; }

Fix:
public static String formatDuration ( long duration ) {
Buggy code:
public class Version { private Version ( ) { } public static String id ( ) { <START_BUG> return "4.0" ; <END_BUG> } public static void main ( String [ ] args ) { } }

Fix:
return "4.1" ;
Buggy code:
public class RuntimeConfigurable implements Serializable { private String elementTag = null ; private Vector children = new Vector ( ) ; private transient Object wrappedObject = null ; private transient AttributeList attributes ; private Hashtable attMap = new Hashtable ( ) ; private StringBuffer characters = new StringBuffer ( ) ; private boolean proxyConfigured = false ; public RuntimeConfigurable ( Object proxy , String elementTag ) { } void setProxy ( Object proxy ) { } public Object getProxy ( ) { } public void setAttributes ( AttributeList attributes ) { } public void setAttribute ( String name , String value ) { } public Hashtable getAttributeMap ( ) { } public AttributeList getAttributes ( ) { } public void addChild ( RuntimeConfigurable child ) { } RuntimeConfigurable getChild ( int index ) { } Enumeration getChildren ( ) { } public void addText ( String data ) { } public void addText ( char [ ] buf , int start , int count ) { } public StringBuffer getText ( ) { } public String getElementTag ( ) { } public void maybeConfigure ( Project p ) throws BuildException { } public void maybeConfigure ( Project p , boolean configureChildren ) throws BuildException { String id = null ; if ( proxyConfigured ) { return ; } Object target = ( ( wrappedObject ) instanceof TaskAdapter ) ? ( ( TaskAdapter ) ( wrappedObject ) ) . getProxy ( ) : wrappedObject ; IntrospectionHelper ih = IntrospectionHelper . getHelper ( p , target . getClass ( ) ) ; Enumeration attNames = attMap . keys ( ) ; while ( attNames . hasMoreElements ( ) ) { String name = ( ( String ) ( attNames . nextElement ( ) ) ) ; String value = ( ( String ) ( attMap . get ( name ) ) ) ; <START_BUG> value = ProjectHelper . replaceProperties ( p , value , p . getProperties ( ) ) ; <END_BUG> try { ih . setAttribute ( p , target , name . toLowerCase ( Locale . US ) , value ) ; } catch ( BuildException be ) { if ( ! ( name . equals ( "id" ) ) ) { throw be ; } } } id = ( ( String ) ( attMap . get ( "id" ) ) ) ; if ( ( characters . length ( ) ) != 0 ) { ProjectHelper . addText ( p , wrappedObject , characters . toString ( ) ) ; } Enumeration = children . elements ( ) ; } }

Fix:
value = p . replaceProperties ( value ) ;
Buggy code:
public class JSONQuery { public static class InvalidJSONQuery extends Exception { public InvalidJSONQuery ( ) { } public InvalidJSONQuery ( String msg ) { } private static final long serialVersionUID = 1L ; } public static ThreadedQuery makeQuery ( String json ) throws JSONQuery . InvalidJSONQuery { } public static JSONObject encodeResult ( Hashtable < String , Term > bindings ) { JSONObject result = new JSONObject ( ) ; Iterator < Map . Entry < String , Term > > it = bindings . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { Map . Entry < String , Term > e = it . next ( ) ; if ( e . getValue ( ) . isFloat ( ) ) <START_BUG> result . put ( e . getKey ( ) , e . getValue ( ) . floatValue ( ) ) ; <END_BUG> else if ( e . getValue ( ) . isInteger ( ) ) result . put ( e . getKey ( ) , e . getValue ( ) . intValue ( ) ) ; else if ( ( e . getValue ( ) . isCompound ( ) ) && ( ! ( e . getValue ( ) . isAtom ( ) ) ) ) { if ( JSONQuery . isList ( e . getValue ( ) ) ) result . put ( e . getKey ( ) , JSONQuery . encodeList ( e . getValue ( ) ) ) ; else result . put ( e . getKey ( ) , JSONQuery . encodeCompoundTerm ( e . getValue ( ) ) ) ; } else result . put ( e . getKey ( ) , e . getValue ( ) . name ( ) ) ; } return result ; } static Term makeCompoundTerm ( JSONArray val ) throws JSONQuery . InvalidJSONQuery { } public static Term [ ] decodeJSONArray ( JSONArray val ) throws JSONQuery . InvalidJSONQuery { } private static Term [ ] decodeJSONArray ( JSONArray val , int startIndex ) throws JSONQuery . InvalidJSONQuery { } static Term decodeJSONValue ( String val ) { } static Term decodeJSONValue ( boolean val ) { } static Term decodeJSONValue ( double val ) { } static Term decodeJSONValue ( int val ) { } public static Term decodeJSONValue ( JSONObject val ) throws JSONQuery . InvalidJSONQuery { } private static JSONObject encodeCompoundTerm ( Term term ) { } private static JSONArray encodeList ( Term term ) throws JPLException { } private static JSONArray encodeList ( Term [ ] term_list ) throws JPLException { } private static boolean isList ( Term term ) { } }

Fix:
result . put ( e . getKey ( ) , e . getValue ( ) . doubleValue ( ) ) ;
Buggy code:
public class HOFCApplication extends Application { private RequestQueue requestQueue ; @ Override public void onCreate ( ) { } @ Override public void onTerminate ( ) { <START_BUG> requestQueue . stop ( ) ; <END_BUG> super . onTerminate ( ) ; } private void init ( ) { } public RequestQueue getRequestQueue ( ) { } }

Fix:
requestQueue . cancelAll ( true ) ;
Buggy code:
public class DeleteElementsOperation extends MultiOperation { protected Map fChildrenToRemove ; protected DOMFactory fFactory ; public DeleteElementsOperation ( IJavaElement [ ] elementsToDelete , boolean force ) { } protected String getMainTaskName ( ) { } protected void groupElements ( ) throws JavaModelException { } protected void processElement ( IJavaElement element ) throws JavaModelException { } protected void processElements ( ) throws JavaModelException { } protected void verify ( IJavaElement element ) throws JavaModelException { IJavaElement [ ] children = ( ( IRegion ) ( fChildrenToRemove . get ( element ) ) ) . getElements ( ) ; for ( int i = 0 ; i < ( children . length ) ; i ++ ) { IJavaElement child = children [ i ] ; <START_BUG> if ( ( child . getCorrespondingResource ( ) ) != null ) <END_BUG> error ( IJavaModelStatusConstants . INVALID_ELEMENT_TYPES , child ) ; if ( child . isReadOnly ( ) ) error ( IJavaModelStatusConstants . READ_ONLY , child ) ; } } }

Fix:
if ( ( child . getResource ( ) ) != null )
Buggy code:
public class UpdateLocationVisitor extends BasicVisitor { private int currentStartLine ; private int currentStartColumn ; private int cachedStartLine ; private int cachedStartColumn ; public UpdateLocationVisitor ( int currentStartLine , int currentStartColumn , int cachedStartLine , int cachedStartColumn ) { } public Void visit ( ASTNode node , Void _void ) { <START_BUG> node . setLocation ( UpdateLocationVisitor . updateLocation ( currentStartLine , currentStartColumn , cachedStartColumn , cachedStartLine , node . getLocation ( ) ) ) ; <END_BUG> return null ; } public static Location updateLocation ( int currentStartLine , int currentStartColumn , int cachedStartLine , int cachedStartColumn , Location loc ) { } @ Override public boolean cache ( ) { } }

Fix:
node . setLocation ( UpdateLocationVisitor . updateLocation ( currentStartLine , currentStartColumn , cachedStartLine , cachedStartColumn , node . getLocation ( ) ) ) ;
Buggy code:
public class KeyToolFactoryTest { @ Test public void testGetInstance ( ) throws Exception { } @ Test public void testGetInstanceWithRandom ( ) throws Exception { <START_BUG> SecureRandom random = SecureRandom . getInstance ( "NativePRNG" ) ; <END_BUG> assertNotNull ( random ) ; KeyTool keyTool = KeyToolFactory . getInstanceWithRandom ( random ) ; assertNotNull ( keyTool ) ; Optional < Key > keyOptional = keyTool . aes128key ( ) ; assertTrue ( keyOptional . isPresent ( ) ) ; } No newline ; at end ; of file ; }

Fix:
SecureRandom random = SecureRandom . getInstance ( PRNG_NATIVE ) ;
Buggy code:
facets . maxInclusive = "-1" ; <START_BUG> XSSimpleTypeDecl negativeDV = new XSSimpleTypeDecl ( integerDV , NEGATIVEINTEGER , SchemaDVFactoryImpl . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false , null , XSConstants . NEGATIVEINTEGER_DT ) ; <END_BUG>

Fix:
XSSimpleTypeDecl negativeDV = new XSSimpleTypeDecl ( nonPositiveDV , NEGATIVEINTEGER , SchemaDVFactoryImpl . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false , null , XSConstants . NEGATIVEINTEGER_DT ) ;