nus-yam/ex-repair huggingface dataset:
Buggy code:
public class RequestUtil { public static Hashtable readFormData ( Request request ) { String contentType = request . getContentType ( ) ; if ( contentType != null ) { if ( ( contentType . indexOf ( ";" ) ) > 0 ) <START_BUG> contentType = contentType . substring ( 0 , ( ( contentType . indexOf ( ";" ) ) - 1 ) ) ; <END_BUG> contentType = contentType . toLowerCase ( ) . trim ( ) ; } int contentLength = request . getContentLength ( ) ; if ( ( contentType != null ) && ( contentType . startsWith ( "application//x-www-form-urlencoded" ) ) ) { try { ServletInputStream is = request . getFacade ( ) . getInputStream ( ) ; Hashtable postParameters = HttpUtils . parsePostData ( contentLength , is ) ; return postParameters ; } catch ( IOException e ) { } } return null ; } public static Hashtable mergeParameters ( Hashtable one , Hashtable two ) { } public static BufferedReader getReader ( Request request ) throws IOException { } public static void processCookies ( Request request , Vector cookies ) { } private static String stripQuote ( String value ) { } public static void processFormData ( String data , Hashtable parameters ) { } public static int readData ( InputStream in , byte [ ] buf , int length ) { } public static final String URLDecode ( String str ) throws NumberFormatException , StringIndexOutOfBoundsException { } public static String unUrlDecode ( String data ) { } public static String getCharsetFromContentType ( String type ) { } public static Enumeration getLocales ( HttpServletRequest req ) { } private static final Locale loc = Locale . US ; private static final TimeZone zone = TimeZone . getTimeZone ( "GMT" ) ; private static final String rfc1123Pattern = "EEE,<seq2seq4repair_space>dd<seq2seq4repair_space>MMM<seq2seq4repair_space>yyyyy<seq2seq4repair_space>HH:mm:ss<seq2seq4repair_space>z" ; private static final String rfc1036Pattern = "EEEEEEEEE,<seq2seq4repair_space>dd-MMM-yy<seq2seq4repair_space>HH:mm:ss<seq2seq4repair_space>z" ; private static final String asctimePattern = "EEE<seq2seq4repair_space>MMM<seq2seq4repair_space>d<seq2seq4repair_space>HH:mm:ss<seq2seq4repair_space>yyyyy" ; private static final SimpleDateFormat rfc1123Format = new SimpleDateFormat ( RequestUtil . rfc1123Pattern , RequestUtil . loc ) ; private static final SimpleDateFormat rfc1036Format = new SimpleDateFormat ( RequestUtil . rfc1036Pattern , RequestUtil . loc ) ; private static final SimpleDateFormat asctimeFormat = new SimpleDateFormat ( RequestUtil . asctimePattern , RequestUtil . loc ) ; public static long toDate ( String dateString ) { } }

Fix:
contentType = contentType . substring ( 0 , contentType . indexOf ( ";" ) ) ;
Buggy code:
public class PerspectiveBarContributionItem extends ContributionItem { private IPerspectiveDescriptor perspective ; private IPreferenceStore apiPreferenceStore = PrefUtil . getAPIPreferenceStore ( ) ; private ToolItem toolItem = null ; private Image image ; private IWorkbenchPage workbenchPage ; public PerspectiveBarContributionItem ( IPerspectiveDescriptor perspective , IWorkbenchPage workbenchPage ) { } public void dispose ( ) { } public void fill ( ToolBar parent , int index ) { } private void createImage ( ) { } Image getImage ( ) { } public void select ( ) { } public void update ( ) { } public void update ( IPerspectiveDescriptor newDesc ) { } IWorkbenchPage getPage ( ) { } IPerspectiveDescriptor getPerspective ( ) { } ToolItem getToolItem ( ) { } <START_BUG> public boolean handles ( IPerspectiveDescriptor perspective , WorkbenchPage workbenchPage ) { <END_BUG> return ( ( this . perspective ) == perspective ) && ( ( this . workbenchPage ) == workbenchPage ) ; } public void setPerspective ( IPerspectiveDescriptor newPerspective ) { } void setSelection ( boolean b ) { } static int getMaxWidth ( Image image ) { } private static final String ellipsis = "..." ; protected String shortenText ( String textValue , ToolItem item ) { } }

Fix:
public boolean handles ( IPerspectiveDescriptor perspective , IWorkbenchPage workbenchPage ) {
Buggy code:
public class UserAuthorDataUtil { private static final Logger logger = Logger . getLogger ( UserAuthorDataUtil . class . getName ( ) ) ; public static boolean hasAccessToAddOrUpdateUserAuthorData ( UserAuthorData userAuthorData ) { <START_BUG> return userAuthorData . equals ( AccessTokenFilter . getAccessToken ( ) . getUserId ( ) ) ; <END_BUG> } public static UserAuthorData createUserAuthorData ( UserAuthor userAuthor ) { } public static List < UserAuthorData > createUserAuthorDataList ( List < UserAuthor > userAuthorList ) { } public static UserAuthorData getUserAuthor ( Long userId , Long authorId ) { } public static UserAuthorData saveUserAuthor ( UserAuthorData userAuthorData ) throws InsufficientAccessException , InvalidArgumentException { } private static void _validateUserAuthorDataForSave ( UserAuthorData userAuthorData ) throws InvalidArgumentException { } }

Fix:
return userAuthorData . getUserId ( ) . equals ( AccessTokenFilter . getAccessToken ( ) . getUserId ( ) ) ;
Buggy code:
public class EJB3AsyncServiceAdd extends AbstractBoottimeAddStepHandler { static final EJB3AsyncServiceAdd INSTANCE = new EJB3AsyncServiceAdd ( ) ; private static final Logger logger = Logger . getLogger ( EJB3AsyncServiceAdd . class ) ; private EJB3AsyncServiceAdd ( ) { } static ModelNode create ( final String threadPoolName ) { } @ Override protected void performBoottime ( final OperationContext context , final ModelNode operation , final ModelNode model , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers ) throws OperationFailedException { <START_BUG> final String threadPoolName = THREAD_POOL_NAME . validateResolvedOperation ( model ) . asString ( ) ; <END_BUG> final ServiceName threadPoolServiceName = BASE_SERVICE_NAME . append ( threadPoolName ) ; context . addStep ( new AbstractDeploymentChainStep ( ) { protected void execute ( DeploymentProcessorTarget processorTarget ) { EJB3AsyncServiceAdd . logger . debug ( "Adding<seq2seq4repair_space>EJB<seq2seq4repair_space>@Asynchronous<seq2seq4repair_space>support" ) ; processorTarget . addDeploymentProcessor ( POST_MODULE , POST_MODULE_EJB_ASYNCHRONOUS_MERGE , new org . jboss . as . ejb3 . deployment . processors . merging . AsynchronousMergingProcessor ( threadPoolServiceName ) ) ; } } , RUNTIME ) ; } @ Override protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { } }

Fix:
final String threadPoolName = THREAD_POOL_NAME . resolveModelAttribute ( context , model ) . asString ( ) ;
Buggy code:
public class GeodeClient { private static final String PROBE_REGION = "Probe_requests" ; private ClientCacheFactory clientCacheFactory ; private ClientCache cache ; private Region < String , ProbeRequest > probesRegion ; public GeodeClient ( ) { } public void putProbeReq ( ProbeRequest req ) { <START_BUG> probesRegion . put ( ( ( req . getProbe_timestamp ( ) ) + ( req . getDevice_id ( ) ) ) , req ) ; <END_BUG> } }

Fix:
probesRegion . put ( ( ( req . getProbe_timeepoch ( ) ) + ( req . getDevice_id ( ) ) ) , req ) ;
Buggy code:
public class PropertyValAnnotationService extends BatchService < PropertyValAnnotationTask > { public static final String MAX_THREAD_PROP = "uk.ac.ebi.fg.biosd.annotator.maxThreads" ; private double randomSelectionQuota = 100.0 ; private Random rndGenerator = new Random ( System . currentTimeMillis ( ) ) ; private PropertyValAnnotationManager pvAnnMgr = new PropertyValAnnotationManager ( ) ; private static final String PV_CRITERIA = "pv<seq2seq4repair_space>NOT<seq2seq4repair_space>IN<seq2seq4repair_space>(\n" + ( ( ( ( "\t<seq2seq4repair_space>SELECT<seq2seq4repair_space>pv1.id<seq2seq4repair_space>FROM<seq2seq4repair_space>ExperimentalPropertyValue<seq2seq4repair_space>pv1<seq2seq4repair_space>JOIN<seq2seq4repair_space>pv1.ontologyTerms<seq2seq4repair_space>oe<seq2seq4repair_space>JOIN<seq2seq4repair_space>oe.annotations<seq2seq4repair_space>oa<seq2seq4repair_space>WHERE\n" + "<seq2seq4repair_space>oa.type.name<seq2seq4repair_space>=<seq2seq4repair_space>:oeAnnType<seq2seq4repair_space>)\n" ) + "AND<seq2seq4repair_space>pv<seq2seq4repair_space>NOT<seq2seq4repair_space>IN<seq2seq4repair_space>(\n" ) + "<seq2seq4repair_space>SELECT<seq2seq4repair_space>pv2.id<seq2seq4repair_space>FROM<seq2seq4repair_space>ExperimentalPropertyValue<seq2seq4repair_space>pv2<seq2seq4repair_space>JOIN<seq2seq4repair_space>pv2.annotations<seq2seq4repair_space>pa<seq2seq4repair_space>WHERE\n" ) + "<seq2seq4repair_space>pa.type.name<seq2seq4repair_space>=<seq2seq4repair_space>:pvAnnType<seq2seq4repair_space>)\n" ) ; public PropertyValAnnotationService ( ) { } public void submit ( long pvalId ) { } @ SuppressWarnings ( { "unchecked" } ) public void submit ( Integer offset , Integer limit ) { EntityManager em = Resources . getInstance ( ) . getEntityManagerFactory ( ) . createEntityManager ( ) ; try { EntityTransaction tx = em . getTransaction ( ) ; tx . begin ( ) ; Query q = em . createQuery ( ( "SELECT<seq2seq4repair_space>id<seq2seq4repair_space>FROM<seq2seq4repair_space>ExperimentalPropertyValue<seq2seq4repair_space>pv<seq2seq4repair_space>WHERE\n" + ( PropertyValAnnotationService . PV_CRITERIA ) ) ) ; TextAnnotation oeMarker = BioSDOntoDiscoveringCache . createZOOMAMarker ( "foo" , "foo" ) ; TextAnnotation pvMarker = OntoDiscoveryAndAnnotator . createEmptyZoomaMappingMarker ( ) ; q . setParameter ( "oeAnnType" , oeMarker . getType ( ) . getName ( ) ) ; q . setParameter ( "pvAnnType" , pvMarker . getType ( ) . getName ( ) ) ; if ( offset != null ) q . setFirstResult ( offset ) ; if ( limit != null ) q . setMaxResults ( limit ) ; for ( Number id : ( ( List < Number > ) ( q . getResultList ( ) ) ) ) <START_BUG> submit ( id . intValue ( ) ) ; <END_BUG> tx . commit ( ) ; } finally { if ( em . isOpen ( ) ) em . close ( ) ; } } public void submitAll ( ) { } public void submitMSI ( MSI msi ) { } public void submitMSI ( String msiAcc ) { } public void submitMSI ( InputStream sampleTabIn ) { } public int getPropValCount ( ) { } public double getRandomSelectionQuota ( ) { } public void setRandomSelectionQuota ( double randomSelectionQuota ) { } }

Fix:
submit ( id . longValue ( ) ) ;
Buggy code:
public class saveTask extends task { PrintWriter out ; @ Override public void runTask ( ) { try { FileWriter fr = new FileWriter ( main . fileName ) ; BufferedWriter br = new BufferedWriter ( fr ) ; out = new PrintWriter ( br ) ; out . write ( "Head" ) ; out . println ( "<seq2seq4repair_space>" ) ; <START_BUG> out . write ( currentScreen ) ; <END_BUG> out . println ( "<seq2seq4repair_space>" ) ; savePlayer ( main . getPlayer ( ) ) ; for ( int i = 0 ; i < ( chunk . size ( ) ) ; i ++ ) { saveChunk ( chunk . get ( i ) , i ) ; } out . close ( ) ; } catch ( IOException ex ) { System . out . println ( ex ) ; } } @ Override public Boolean returnRunnable ( ) { } @ Override public int getWait ( ) { } @ Override public int [ ] getData ( ) { } @ Override public int getCPULoad ( ) { } public void savePlayer ( player play ) { } public void saveChunk ( ArrayList < ArrayList < block > > chunk , int chunkNum ) { } }

Fix:
out . write ( ( "<seq2seq4repair_space>" + ( map . currentScreen ) ) ) ;
Buggy code:
public class CharLiteral extends NumberLiteral { char value ; public CharLiteral ( char [ ] token , int s , int e ) { } public void computeConstant ( ) { } private void computeValue ( ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public TypeBinding literalType ( BlockScope scope ) { <START_BUG> return CharBinding ; <END_BUG> } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
return TypeBinding . CHAR ;
Buggy code:
public class UsersService { private static UsersService INSTANCE ; private List < User > users = new ArrayList < User > ( ) ; private UsersService ( ) { } public static UsersService getInstance ( ) { } public List < User > getUsers ( ) { } public User getUser ( Integer id ) { } public void removeUser ( User user ) { } public void addUser ( User user ) { <START_BUG> user . setId ( ( ( users . size ( ) ) + 1 ) ) ; <END_BUG> users . add ( user ) ; } }

Fix:
user . setId ( users . size ( ) ) ;
Buggy code:
public class Group extends Composite { int clientHandle ; int labelHandle ; String text = "" ; public Group ( Composite parent , int style ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } int clientHandle ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } void createHandle ( int index ) { <START_BUG> state |= HANDLE ; <END_BUG> fixedHandle = OS . g_object_new ( display . gtk_fixed_get_type ( ) , 0 ) ; if ( ( fixedHandle ) == 0 ) error ( ERROR_NO_HANDLES ) ; OS . gtk_fixed_set_has_window ( fixedHandle , true ) ; handle = OS . gtk_frame_new ( null ) ; if ( ( handle ) == 0 ) error ( ERROR_NO_HANDLES ) ; labelHandle = OS . gtk_label_new ( null ) ; if ( ( labelHandle ) == 0 ) error ( ERROR_NO_HANDLES ) ; OS . g_object_ref ( labelHandle ) ; OS . gtk_object_sink ( labelHandle ) ; clientHandle = OS . g_object_new ( display . gtk_fixed_get_type ( ) , 0 ) ; if ( ( clientHandle ) == 0 ) error ( ERROR_NO_HANDLES ) ; OS . gtk_container_add ( fixedHandle , handle ) ; OS . gtk_container_add ( handle , clientHandle ) ; if ( ( ( style ) & ( SWT . SHADOW_IN ) ) != 0 ) { OS . gtk_frame_set_shadow_type ( handle , GTK_SHADOW_IN ) ; } if ( ( ( style ) & ( SWT . SHADOW_OUT ) ) != 0 ) { OS . gtk_frame_set_shadow_type ( handle , GTK_SHADOW_OUT ) ; } if ( ( ( style ) & ( SWT . SHADOW_ETCHED_IN ) ) != 0 ) { OS . gtk_frame_set_shadow_type ( handle , GTK_SHADOW_ETCHED_IN ) ; } if ( ( ( style ) & ( SWT . SHADOW_ETCHED_OUT ) ) != 0 ) { OS . gtk_frame_set_shadow_type ( handle , GTK_SHADOW_ETCHED_OUT ) ; } } void deregister ( ) { } void enableWidget ( boolean enabled ) { } int eventHandle ( ) { } String getNameText ( ) { } public String getText ( ) { } void hookEvents ( ) { } boolean mnemonicHit ( char key ) { } boolean mnemonicMatch ( char key ) { } int parentingHandle ( ) { } void register ( ) { } void releaseHandle ( ) { } void releaseWidget ( ) { } void setBackgroundColor ( GdkColor color ) { } void setFontDescription ( int font ) { } void setForegroundColor ( GdkColor color ) { } void setOrientation ( ) { } public void setText ( String string ) { } void showWidget ( ) { } }

Fix:
state |= ( HANDLE ) | ( THEME_BACKGROUND ) ;
Buggy code:
public class AccountManager { DBConnection db ; public AccountManager ( ) { } public void createNewAccount ( String name , String password , String type ) { Encryption e = new Encryption ( ) ; String hashedPassword = e . generateHashedPassword ( password ) ; <START_BUG> String statement = new String ( ( ( ( ( ( ( "insert<seq2seq4repair_space>into<seq2seq4repair_space>user<seq2seq4repair_space>(name,<seq2seq4repair_space>password,<seq2seq4repair_space>type)<seq2seq4repair_space>values<seq2seq4repair_space>(\"" + name ) + "\",\"" ) + hashedPassword ) + "\",\"" ) + type ) + "\"" ) ) ; <END_BUG> db . DBUpdate ( statement ) ; } public boolean accountMatch ( String name , String password ) { } public boolean isExisted ( String name ) { } }

Fix:
String statement = new String ( ( ( ( ( ( ( "insert<seq2seq4repair_space>into<seq2seq4repair_space>user<seq2seq4repair_space>(name,<seq2seq4repair_space>password,<seq2seq4repair_space>type)<seq2seq4repair_space>values<seq2seq4repair_space>(\"" + name ) + "\",\"" ) + hashedPassword ) + "\",\"" ) + type ) + "\")" ) ) ;
Buggy code:
@ SuppressWarnings ( "unused" ) public class Client < C extends Connection > extends EndPointClient < C > implements Connection { public static String getVersion ( ) { <START_BUG> return "1.6" ; <END_BUG> } public Client ( ) throws InitializationException , IOException , SecurityException { } public Client ( String host , int tcpPort , int udpPort , int udtPort , String localChannelName ) throws InitializationException , IOException , SecurityException { } @ SuppressWarnings ( "AutoBoxing" ) public Client ( final Configuration options ) throws InitializationException , IOException , SecurityException { } public void reconnect ( ) throws IOException { } public void reconnect ( int connectionTimeout ) throws IOException { } public void connect ( ) throws IOException { } public void connect ( int connectionTimeout ) throws IOException { } @ Override public boolean hasRemoteKeyChanged ( ) { } @ Override public String getRemoteHost ( ) { } @ SuppressWarnings ( "rawtypes" ) @ Override public EndPoint getEndPoint ( ) { } @ Override public int id ( ) { } @ Override public String idAsHex ( ) { } @ Override public boolean hasUDP ( ) { } @ Override public boolean hasUDT ( ) { } @ Override public IdleBridge sendOnIdle ( IdleSender < ? , ? > sender ) { } @ Override public IdleBridge sendOnIdle ( Object message ) { } @ Override public void closeAsap ( ) { } @ Override public < Iface , Impl extends Iface > Iface createProxyObject ( final Class < Impl > remoteImplementationClass ) throws IOException { } @ Override public < Iface , Impl extends Iface > Iface getProxyObject ( final int objectId ) throws IOException { } public C getConnection ( ) { } @ Override public void closeConnections ( ) { } @ Override public void close ( ) { } }

Fix:
return "1.8" ;
Buggy code:
public class HttpManagementWriteAttributeHandler extends AbstractWriteAttributeHandler < Void > { public static final OperationStepHandler INSTANCE = new HttpManagementWriteAttributeHandler ( ) ; private HttpManagementWriteAttributeHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ModelNode model = context . readResource ( EMPTY_ADDRESS ) . getModel ( ) ; if ( ( model . hasDefined ( INTERFACE . getName ( ) ) ) && ( ( model . hasDefined ( SOCKET_BINDING . getName ( ) ) ) || ( model . hasDefined ( SECURE_SOCKET_BINDING . getName ( ) ) ) ) ) { throw MESSAGES . illegalCombinationOfHttpManagementInterfaceConfigurations ( INTERFACE . getName ( ) , SOCKET_BINDING . getName ( ) , SECURE_SOCKET_BINDING . getName ( ) ) ; } <START_BUG> context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; <END_BUG> } } , MODEL ) ; super . execute ( context , operation ) ; } @ Override protected boolean requiresRuntime ( OperationContext context ) { } @ Override protected boolean applyUpdateToRuntime ( OperationContext context , ModelNode operation , String attributeName , ModelNode resolvedValue , ModelNode currentValue , HandbackHolder < Void > handbackHolder ) throws OperationFailedException { } @ Override protected void revertUpdateToRuntime ( final OperationContext context , final ModelNode operation , final String attributeName , final ModelNode valueToRestore , final ModelNode valueToRevert , final Void handback ) throws OperationFailedException { } static void updateHttpManagementService ( final OperationContext context , final ModelNode subModel , final ServiceVerificationHandler verificationHandler ) throws OperationFailedException { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class WicketTagPanelTest extends TestCase { private static Log log = LogFactory . getLog ( WicketTagPanelTest . class ) ; private MockWebApplication application ; public WicketTagPanelTest ( String name ) { } protected void setUp ( ) throws Exception { } public void testRenderHomePage ( ) throws Exception { } private boolean validatePage1 ( String document ) { } public void testRenderHomePageWicketTagRemoved ( ) throws Exception { <START_BUG> application . getSettings ( ) . setStripWicketTags ( true ) ; <END_BUG> application . setupRequestAndResponse ( ) ; application . processRequestCycle ( ) ; String document = application . getServletResponse ( ) . getDocument ( ) ; WicketTagPanelTest . log . info ( document ) ; assertTrue ( validatePage2 ( document ) ) ; } private boolean validatePage2 ( String document ) { } }

Fix:
application . getMarkupSettings ( ) . setStripWicketTags ( true ) ;
Buggy code:
public class DirectionalCoverSystem { public static CoverType getDirectionalCover ( BattleMap map , GridPosition pos , Direction dir ) { } public static CoverType getCover ( BattleMap map , GridPosition pos ) { } public static ArrayList < Direction > getCoverDirections ( BattleMap map , GridPosition pos ) { } public static ArrayList < Direction > getNeededCoverDirections ( GridPosition pos , GridPosition attackPos ) { ArrayList < Direction > l = new ArrayList < Direction > ( ) ; if ( ( pos . x ) == ( attackPos . x ) ) { if ( ( attackPos . y ) > ( pos . y ) ) { l . add ( N ) ; } else { l . add ( S ) ; } } else if ( ( pos . y ) == ( attackPos . y ) ) { if ( ( attackPos . x ) > ( pos . x ) ) { l . add ( E ) ; } else { l . add ( W ) ; } } else { if ( ( ( attackPos . x ) > ( pos . x ) ) && ( ( attackPos . y ) > ( pos . y ) ) ) { l . add ( N ) ; l . add ( E ) ; } else if ( ( ( attackPos . x ) > ( pos . x ) ) && ( ( attackPos . y ) < ( pos . y ) ) ) { l . add ( S ) ; l . add ( E ) ; } else if ( ( ( attackPos . x ) < ( pos . x ) ) && ( ( attackPos . y ) > ( pos . y ) ) ) { l . add ( N ) ; l . add ( W ) ; } else { l . add ( S ) ; <START_BUG> l . add ( E ) ; <END_BUG> } } return l ; } public static boolean isOpen ( BattleMap map , GridPosition pos ) { } public static boolean isFlankedBy ( BattleMap map , GridPosition pos , GridPosition flanker ) { } public static CoverType getBestCoverAgainstAttack ( BattleMap map , GridPosition pos , GridPosition attacker ) { } No newline ; at end ; of file ; }

Fix:
l . add ( W ) ;
Buggy code:
public class TransactionSynchronizationRegistryService extends AbstractService < TransactionSynchronizationRegistry > { public static final ServiceName SERVICE_NAME = TxnServices . JBOSS_TXN_SYNCHRONIZATION_REGISTRY ; private InjectedValue < TransactionManagerService > injectedArjunaTM = new InjectedValue < TransactionManagerService > ( ) ; public static void addService ( final ServiceTarget target ) { TransactionSynchronizationRegistryService service = new TransactionSynchronizationRegistryService ( ) ; ServiceBuilder < ? > serviceBuilder = target . addService ( TransactionSynchronizationRegistryService . SERVICE_NAME , service ) ; <START_BUG> serviceBuilder . addAliases ( ServiceName . of ( "jbosgi" , TransactionSynchronizationRegistryService . class . getName ( ) ) ) ; <END_BUG> serviceBuilder . addDependency ( ArjunaTransactionManagerService . SERVICE_NAME , TransactionManagerService . class , service . injectedArjunaTM ) ; serviceBuilder . install ( ) ; } @ Override public TransactionSynchronizationRegistry getValue ( ) throws IllegalStateException { } }

Fix:
serviceBuilder . addAliases ( ServiceName . of ( "jbosgi" , "xservice" , TransactionSynchronizationRegistryService . class . getName ( ) ) ) ;
Buggy code:
public class PartialContentResponderTest { private PartialContentResponder partialContentResponder ; private String testDirectory ; @ Before public void setUp ( ) throws Exception { } @ Test public void returnsPartialContentsBasedOnByteRangeRequest ( ) throws Exception { HTTPStatusCodes httpStatusCodes = new HTTPStatusCodes ( ) ; <START_BUG> assertEquals ( "<seq2seq4repair_space>206." , new String ( partialContentResponder . getHTTPMessageBody ( ) ) ) ; <END_BUG> assertEquals ( "206<seq2seq4repair_space>Partial<seq2seq4repair_space>Content" , partialContentResponder . getHTTPStatusCode ( httpStatusCodes ) ) ; } @ Test public void returnsPartialContentForByteRangeZeroToSixRequest ( ) throws Exception { } No newline ; at end ; of file ; }

Fix:
assertEquals ( "<seq2seq4repair_space>206.\n" , new String ( partialContentResponder . getHTTPMessageBody ( ) ) ) ;
Buggy code:
public class WebParsingDeploymentProcessor implements DeploymentUnitProcessor { public static final long PRIORITY = PARSE_DESCRIPTORS . plus ( 300L ) ; private static final String WEB_XML = "WEB-INF//web.xml" ; public void processDeployment ( DeploymentUnitContext context ) throws DeploymentUnitProcessingException { final VirtualFile deploymentRoot = VirtualFileAttachment . getVirtualFileAttachment ( context ) ; final VirtualFile webXml = deploymentRoot . getChild ( WebParsingDeploymentProcessor . WEB_XML ) ; WarMetaData warMetaData = context . getAttachment ( ATTACHMENT_KEY ) ; assert warMetaData != null ; if ( webXml . exists ( ) ) { InputStream is = null ; long time = System . currentTimeMillis ( ) ; try { is = webXml . openStream ( ) ; final XMLInputFactory inputFactory = XMLInputFactory . newInstance ( ) ; XMLStreamReader xmlReader = inputFactory . createXMLStreamReader ( is ) ; warMetaData . setWebMetaData ( WebMetaDataParser . parse ( xmlReader ) ) ; } catch ( Exception e ) { throw new DeploymentUnitProcessingException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>" + webXml ) , e ) ; } finally { <START_BUG> Logger . getLogger ( "org.jboss.web" ) . info ( ( "parse<seq2seq4repair_space>" + ( ( System . currentTimeMillis ( ) ) - time ) ) ) ; <END_BUG> try { if ( is != null ) { is . close ( ) ; } } catch ( IOException e ) { } } } } }

Fix:
Logger . getLogger ( "org.jboss.web.WebParsingDeploymentProcessor" ) . info ( ( ( "parse:<seq2seq4repair_space>" + ( ( System . currentTimeMillis ( ) ) - time ) ) + "ms" ) ) ;
Buggy code:
public class DateFilterTest extends AbstractFilterTst { public DateFilterTest ( String arg0 ) { } public DateFilterTest ( MailboxTstFactory factory , String arg0 ) { } public void testBefore ( ) throws Exception { Object uid = addMessage ( ) ; GregorianCalendar c = new GregorianCalendar ( ) ; c . set ( 2004 , 5 , 10 ) ; Date date = c . getTime ( ) ; getSourceFolder ( ) . setAttribute ( uid , "columba.date" , date ) ; MailFilterCriteria criteria = MailFilterFactory . createDateBefore ( "Jan<seq2seq4repair_space>17,<seq2seq4repair_space>2005" ) ; DateFilter filter = new DateFilter ( ) ; filter . setUp ( criteria ) ; <START_BUG> boolean result = filter . process ( getSourceFolder ( ) , uid ) ; <END_BUG> } public void testAfter ( ) throws Exception { } }

Fix:
filter . process ( getSourceFolder ( ) , uid ) ;
Buggy code:
public class ModClusterAddMetric implements OperationStepHandler , DescriptionProvider { static final ModClusterAddMetric INSTANCE = new ModClusterAddMetric ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ModelNode dynamicLoadProvider = context . readResourceForUpdate ( EMPTY_ADDRESS ) . getModel ( ) . get ( DYNAMIC_LOAD_PROVIDER ) ; final ModelNode metric = new ModelNode ( ) ; List < Property > list = operation . asPropertyList ( ) ; Iterator < Property > it = list . iterator ( ) ; while ( it . hasNext ( ) ) { Property prop = it . next ( ) ; if ( prop . getName ( ) . equals ( "property" ) ) { String properties = prop . getValue ( ) . asString ( ) ; ModelNode props = ModelNode . fromString ( properties ) ; metric . get ( "property" ) . set ( props ) ; } else { metric . get ( prop . getName ( ) ) . set ( prop . getValue ( ) . asString ( ) ) ; } } if ( ! ( metric . get ( "type" ) . isDefined ( ) ) ) { throw new OperationFailedException ( new ModelNode ( ) . set ( ModClusterMessages . MESSAGES . typeAttributeRequired ( "add-metric" ) ) ) ; } if ( ! ( dynamicLoadProvider . isDefined ( ) ) ) { dynamicLoadProvider . get ( HISTORY ) . set ( 9 ) ; dynamicLoadProvider . get ( DECAY ) . set ( 2 ) ; } replaceMetric ( dynamicLoadProvider , metric ) ; context . completeStep ( ) ; } private void replaceMetric ( ModelNode dynamicLoadProvider , ModelNode metric ) { List < ModelNode > newlist = Collections . < ModelNode > emptyList ( ) ; if ( dynamicLoadProvider . get ( LOAD_METRIC ) . isDefined ( ) ) { List < ModelNode > list = dynamicLoadProvider . get ( LOAD_METRIC ) . asList ( ) ; String type = metric . get ( "type" ) . asString ( ) ; Iterator < ModelNode > it = list . iterator ( ) ; dynamicLoadProvider . get ( LOAD_METRIC ) . set ( newlist ) ; while ( it . hasNext ( ) ) { ModelNode node = it . next ( ) ; if ( ! ( node . get ( "type" ) . asString ( ) . equals ( type ) ) ) { dynamicLoadProvider . get ( LOAD_METRIC ) . add ( node ) ; } } } else { dynamicLoadProvider . get ( LOAD_METRIC ) . set ( newlist ) ; } dynamicLoadProvider . get ( LOAD_METRIC ) . add ( metric ) ; } } , MODEL ) ; } context . completeStep ( ) ; } }

Fix:
if ( context . getProcessType ( ) . isServer ( ) ) {
Buggy code:
public class UnboundedFifoBuffer extends AbstractCollection implements Serializable , Buffer { private static final long serialVersionUID = - 3482960336579541419L ; protected transient Object [ ] buffer ; protected transient int head ; protected transient int tail ; public UnboundedFifoBuffer ( ) { } public UnboundedFifoBuffer ( int initialSize ) { } private void writeObject ( ObjectOutputStream out ) throws IOException { } private void readObject ( ObjectInputStream in ) throws IOException , ClassNotFoundException { in . defaultReadObject ( ) ; int size = in . readInt ( ) ; <START_BUG> buffer = new Object [ size ] ; <END_BUG> for ( int i = 0 ; i < size ; i ++ ) { buffer [ i ] = in . readObject ( ) ; } head = 0 ; tail = size ; } public int size ( ) { } public boolean isEmpty ( ) { } public boolean add ( final Object obj ) { } public Object get ( ) { } public Object remove ( ) { } private int increment ( int index ) { } private int decrement ( int index ) { } public Iterator iterator ( ) { } }

Fix:
buffer = new Object [ size + 1 ] ;
Buggy code:
@ RunWith ( Arquillian . class ) public class SFSBMandatoryTransactionTestCase { @ Inject private UserTransaction userTransaction ; @ Inject private MandatorySFSB sfsb ; @ Deployment public static Archive < ? > deploy ( ) { } @ Test public void testSFSBNotDestroyed ( ) throws NotSupportedException , SystemException { try { sfsb . doStuff ( ) ; <START_BUG> throw new RuntimeException ( "Expected<seq2seq4repair_space>an<seq2seq4repair_space>EJBTransactionRequiredException" ) ; <END_BUG> } catch ( EJBTransactionRequiredException e ) { } userTransaction . begin ( ) ; sfsb . doStuff ( ) ; userTransaction . rollback ( ) ; } }

Fix:
throw new RuntimeException ( "Expected<seq2seq4repair_space>a<seq2seq4repair_space>EJBTransactionRequiredException" ) ;
Buggy code:
public class SplashScreenActivity extends AppCompatActivity implements LoaderCallbacks < ArrayList < BoardNews > > { private Button mReloadBtn ; private TextView mStatusTextView ; public static final String NEWS_LIST = "SplashScreenActivity.newsList" ; public static final String SPLASH_HAS_NEWS = "SplashScreenActivity.splashHasNews" ; public void onAttachedToWindow ( ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } private void StartAnimations ( ) { } public void startLoading ( String message ) { } @ Override public Loader < ArrayList < BoardNews > > onCreateLoader ( int id , Bundle args ) { } @ Override public void onLoadFinished ( Loader < ArrayList < BoardNews > > loader , ArrayList < BoardNews > data ) { } private void showNewsListActivity ( ArrayList < BoardNews > data ) { } @ Override public void onLoaderReset ( Loader < ArrayList < BoardNews > > loader ) { } public static class BoardNewsLoader extends AsyncTaskLoader < ArrayList < BoardNews > > { ArrayList < BoardNews > mBoardNews ; public BoardNewsLoader ( Context context ) { } @ Override public ArrayList < BoardNews > loadInBackground ( ) { final Context context = getContext ( ) ; NewsLoader mNewsLoader = new NewsLoader ( "http:////live.goodline.info//guest//page" , context ) ; boolean isResultCorrect = false ; try { mNewsLoader . fetchFromDB ( ) ; if ( ( mNewsLoader . getData ( ) . size ( ) ) > 0 ) { isResultCorrect = true ; } else if ( BoardNewsApplication . isOnline ( context ) ) { <START_BUG> isResultCorrect = mNewsLoader . fetchFromInternet ( 1 , true ) ; <END_BUG> } } catch ( ExecutionException e ) { e . printStackTrace ( ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } if ( isResultCorrect ) { return mNewsLoader . getData ( ) ; } else { return new ArrayList < > ( ) ; } } @ Override public void deliverResult ( ArrayList < BoardNews > boardNews ) { } @ Override protected void onStartLoading ( ) { } @ Override protected void onStopLoading ( ) { } @ Override public void onCanceled ( ArrayList < BoardNews > apps ) { } @ Override protected void onReset ( ) { } protected void onReleaseResources ( ArrayList < BoardNews > boardNews ) { } } }

Fix:
isResultCorrect = mNewsLoader . fetchFromInternet ( 0 , true ) ;
Buggy code:
public abstract class SocketcandConnection { private static final int BUFFER_SIZE = 4096 ; private static final int ELEMENT_SIZE = 512 ; private static final Logger logger = Logger . getLogger ( SocketcandConnection . class . getCanonicalName ( ) ) ; protected String busName ; protected int port ; protected String host ; private FrameReceiver receiver ; private BufferedReader reader ; private final char [ ] elementBuffer = new char [ SocketcandConnection . ELEMENT_SIZE ] ; public FrameReceiver getReceiver ( ) { } public void setReceiver ( FrameReceiver receiver ) { } public String getBusName ( ) { } public String getHost ( ) { } public int getPort ( ) { } protected void setInput ( InputStreamReader stream ) { } protected String getElement ( ) throws IOException , InterruptedException , SocketTimeoutException { int pos = 0 ; boolean inElement = false ; while ( true ) { char c = ( ( char ) ( reader . read ( ) ) ) ; if ( ! inElement ) { if ( c == '<' ) { inElement = true ; elementBuffer [ pos ] = c ; pos ++ ; } } else { if ( pos >= ( ( SocketcandConnection . ELEMENT_SIZE ) - 1 ) ) { SocketcandConnection . logger . log ( Level . WARNING , "Found<seq2seq4repair_space>frame<seq2seq4repair_space>that<seq2seq4repair_space>is<seq2seq4repair_space>too<seq2seq4repair_space>large.<seq2seq4repair_space>Ignoring..." ) ; pos = 0 ; inElement = false ; } else if ( c == '>' ) { elementBuffer [ pos ] = c ; pos ++ ; break ; } else { elementBuffer [ pos ] = c ; pos ++ ; } } } <START_BUG> return String . valueOf ( elementBuffer , 0 , ( pos + 1 ) ) ; <END_BUG> } }

Fix:
return String . valueOf ( elementBuffer , 0 , pos ) ;
Buggy code:
public class RegServlet extends HttpServlet { private static final long serialVersionUID = 1L ; private RequestDispatcher view ; private AntiMessBusiness bus ; public RegServlet ( ) { } protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { if ( bus . registrieren ( request . getParameter ( "email" ) , request . getParameter ( "password" ) ) ) { view = request . getRequestDispatcher ( ".//.//" ) ; } else { <START_BUG> view = request . getRequestDispatcher ( ".//" ) ; <END_BUG> } view . forward ( request , response ) ; } }

Fix:
view = request . getRequestDispatcher ( "reg.html" ) ;
Buggy code:
public class CodeSnippetEvaluator extends Evaluator implements EvaluationConstants { static final boolean DEVELOPMENT_MODE = false ; char [ ] codeSnippet ; CodeSnippetToCuMapper mapper ; CodeSnippetEvaluator ( char [ ] codeSnippet , EvaluationContext context , INameEnvironment environment , Map options , IRequestor requestor , IProblemFactory problemFactory ) { } protected void addEvaluationResultForCompilationProblem ( Map resultsByIDs , IProblem problem , char [ ] cuSource ) { } protected char [ ] getClassName ( ) { <START_BUG> return CharOperation . concat ( EvaluationConstants . CODE_SNIPPET_CLASS_NAME_PREFIX , Integer . toString ( ( ( this . context . CODE_SNIPPET_COUNTER ) + 1 ) ) . toCharArray ( ) ) ; <END_BUG> } Compiler getCompiler ( ICompilerRequestor requestor ) { } private CodeSnippetToCuMapper getMapper ( ) { } protected char [ ] getSource ( ) { } private INameEnvironment getWrapperEnvironment ( ) { } }

Fix:
return CharOperation . concat ( EvaluationConstants . CODE_SNIPPET_CLASS_NAME_PREFIX , Integer . toString ( ( ( EvaluationContext . CODE_SNIPPET_COUNTER ) + 1 ) ) . toCharArray ( ) ) ;
Buggy code:
public class VersionInfo { public static final String VERSION_FIELD = "_version_" ; private final UpdateLog ulog ; private final VersionBucket [ ] buckets ; private SchemaField versionField ; private SchemaField idField ; final ReadWriteLock lock = new ReentrantReadWriteLock ( true ) ; public static SchemaField getAndCheckVersionField ( IndexSchema schema ) throws SolrException { final String errPrefix = ( VersionInfo . VERSION_FIELD ) + "field<seq2seq4repair_space>must<seq2seq4repair_space>exist<seq2seq4repair_space>in<seq2seq4repair_space>schema,<seq2seq4repair_space>using<seq2seq4repair_space>indexed=\"true\"<seq2seq4repair_space>stored=\"true\"<seq2seq4repair_space>and<seq2seq4repair_space>multiValued=\"false\"" ; SchemaField sf = schema . getFieldOrNull ( VersionInfo . VERSION_FIELD ) ; if ( null == sf ) { throw new SolrException ( ErrorCode . SERVER_ERROR , ( ( ( errPrefix + "<seq2seq4repair_space>(" ) + ( VersionInfo . VERSION_FIELD ) ) + "<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist)" ) ) ; } if ( ! ( sf . indexed ( ) ) ) { throw new SolrException ( ErrorCode . SERVER_ERROR , ( ( ( errPrefix + "<seq2seq4repair_space>(" ) + ( VersionInfo . VERSION_FIELD ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>indexed" ) ) ; } if ( ! ( sf . stored ( ) ) ) { throw new SolrException ( ErrorCode . SERVER_ERROR , ( ( ( errPrefix + "<seq2seq4repair_space>(" ) + ( VersionInfo . VERSION_FIELD ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>stored" ) ) ; } if ( sf . multiValued ( ) ) { <START_BUG> throw new SolrException ( ErrorCode . SERVER_ERROR , ( ( ( errPrefix + "<seq2seq4repair_space>(" ) + ( VersionInfo . VERSION_FIELD ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>multiValued" ) ) ; <END_BUG> } return sf ; } public VersionInfo ( UpdateLog ulog , int nBuckets ) { } public void reload ( ) { } public SchemaField getVersionField ( ) { } public void lockForUpdate ( ) { } public void unlockForUpdate ( ) { } public void blockUpdates ( ) { } public void unblockUpdates ( ) { } long vclock ; long time ; private final Object clockSync = new Object ( ) ; public long getNewClock ( ) { } public long getOldClock ( ) { } public void updateClock ( long clock ) { } public VersionBucket bucket ( int hash ) { } public Long lookupVersion ( BytesRef idBytes ) { } public Long getVersionFromIndex ( BytesRef idBytes ) { } }

Fix:
throw new SolrException ( ErrorCode . SERVER_ERROR , ( ( ( errPrefix + "<seq2seq4repair_space>(" ) + ( VersionInfo . VERSION_FIELD ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>multiValued" ) ) ;
Buggy code:
@ WebServlet ( "//report//CategoryScoresByScoreGroup" ) public class CategoryScoresByScoreGroup extends BaseFLLServlet { protected void processRequest ( final HttpServletRequest request , final HttpServletResponse response , final ServletContext application , final HttpSession session ) throws IOException , ServletException { Connection connection = null ; try { final DataSource datasource = ApplicationAttributes . getDataSource ( application ) ; connection = datasource . getConnection ( ) ; final ChallengeDescription challengeDescription = ApplicationAttributes . getChallengeDescription ( application ) ; final int tournamentID = Queries . getCurrentTournament ( connection ) ; final Tournament tournament = Tournament . findTournamentByID ( connection , tournamentID ) ; response . reset ( ) ; response . setContentType ( "application//pdf" ) ; response . setHeader ( "Content-Disposition" , "filename=categoryScoresByJudgingStation.pdf" ) ; <START_BUG> final Document pdfDoc = PdfUtils . createPdfDoc ( response . getOutputStream ( ) , new SimpleFooterHandler ( ) ) ; <END_BUG> generateReport ( connection , pdfDoc , challengeDescription , tournament ) ; pdfDoc . close ( ) ; } catch ( final SQLException e ) { throw new RuntimeException ( e ) ; } catch ( final DocumentException e ) { throw new RuntimeException ( e ) ; } finally { SQLFunctions . close ( connection ) ; } } @ SuppressFBWarnings ( value = { "SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING" } , justification = "Category<seq2seq4repair_space>name<seq2seq4repair_space>determines<seq2seq4repair_space>table<seq2seq4repair_space>column,<seq2seq4repair_space>winner<seq2seq4repair_space>criteria<seq2seq4repair_space>determines<seq2seq4repair_space>sort" ) private void generateReport ( final Connection connection , final Document pdfDoc , final ChallengeDescription challengeDescription , final Tournament tournament ) throws DocumentException , SQLException { } private void createHeader ( final PdfPTable table , final String challengeTitle , final String catTitle , final String division , final String judgingStation , final Tournament tournament ) throws BadElementException { } }

Fix:
final Document pdfDoc = PdfUtils . createPortraitPdfDoc ( response . getOutputStream ( ) , new SimpleFooterHandler ( ) ) ;
Buggy code:
public final class TarTestCase extends AbstractTestCase { public void testTarArchiveCreation ( ) throws Exception { } public void testTarArchiveLongNameCreation ( ) throws Exception { String name = "testdata//12345678901234567890123456789012345678901234567890123456789012345678901234567890123456.xml" ; <START_BUG> byte [ ] bytes = name . getBytes ( ) ; <END_BUG> assertEquals ( bytes . length , 99 ) ; final File output = new File ( dir , "bla.tar" ) ; final File file1 = getFile ( "test1.xml" ) ; final OutputStream out = new FileOutputStream ( output ) ; final ArchiveOutputStream os = new ArchiveStreamFactory ( ) . createArchiveOutputStream ( "tar" , out ) ; final TarArchiveEntry entry = new TarArchiveEntry ( name ) ; entry . setModTime ( 0 ) ; entry . setSize ( file1 . length ( ) ) ; entry . setUserId ( 0 ) ; entry . setGroupId ( 0 ) ; entry . setUserName ( "avalon" ) ; entry . setGroupName ( "excalibur" ) ; entry . setMode ( 32768 ) ; os . putArchiveEntry ( entry ) ; FileInputStream in = new FileInputStream ( file1 ) ; IOUtils . copy ( in , os ) ; os . closeArchiveEntry ( ) ; os . close ( ) ; out . close ( ) ; in . close ( ) ; ArchiveOutputStream os2 = null ; try { String toLongName = "testdata//123456789012345678901234567890123456789012345678901234567890123456789012345678901234567.xml" ; final File output2 = new File ( dir , "bla.tar" ) ; final OutputStream out2 = new FileOutputStream ( output2 ) ; os2 = new ArchiveStreamFactory ( ) . createArchiveOutputStream ( "tar" , out2 ) ; final TarArchiveEntry entry2 = new TarArchiveEntry ( toLongName ) ; entry2 . setModTime ( 0 ) ; entry2 . setSize ( file1 . length ( ) ) ; entry2 . setUserId ( 0 ) ; entry2 . setGroupId ( 0 ) ; entry2 . setUserName ( "avalon" ) ; entry2 . setGroupName ( "excalibur" ) ; entry2 . setMode ( 32768 ) ; os2 . putArchiveEntry ( entry ) ; IOUtils . copy ( new FileInputStream ( file1 ) , os2 ) ; os2 . closeArchiveEntry ( ) ; } catch ( IOException e ) { assertTrue ( true ) ; } finally { if ( os2 != null ) { os2 . close ( ) ; } } } public void testTarUnarchive ( ) throws Exception { } public void testDirectoryEntryFromFile ( ) throws Exception { } public void testExplicitDirectoryEntry ( ) throws Exception { } public void testFileEntryFromFile ( ) throws Exception { } public void testExplicitFileEntry ( ) throws Exception { } }

Fix:
byte [ ] bytes = name . getBytes ( "UTF-8" ) ;
Buggy code:
public class GridFromXml extends CombinedGridsPlugin { int [ ] xstartArray ; int [ ] ystartArray ; int [ ] xstartCoarseArray ; int [ ] ystartCoarseArray ; int [ ] sliceNoArray ; private String imageName ; private String unitsXml ; private int totalGridNo ; String filePath ; private boolean goBack = false ; @ Override public void run ( String arg ) { } void xmlReader ( ) { try { DocumentBuilder builder = DocumentBuilderFactory . newInstance ( ) . newDocumentBuilder ( ) ; Document doc = builder . parse ( new File ( filePath ) ) ; <START_BUG> NodeList combinedgridNL = doc . getElementsByTagName ( "CombinedGrid" ) ; <END_BUG> Element combinedgridEl = ( ( Element ) ( combinedgridNL . item ( 0 ) ) ) ; if ( combinedgridEl == null ) { err += "This<seq2seq4repair_space>file<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>information<seq2seq4repair_space>for<seq2seq4repair_space>grids" ; } else { NodeList gridNL = combinedgridEl . getElementsByTagName ( "grid" ) ; Element gridEl = ( ( Element ) ( gridNL . item ( 0 ) ) ) ; gridEl . getAttribute ( "date" ) ; imageName = getElementValueAsStr ( gridEl , "image" , 0 ) ; type = getElementValueAsStr ( gridEl , "type" , 0 ) ; areaPerPoint = getElementValueAsDouble ( gridEl , "app" , 0 ) ; unitsXml = getElementValueAsStr ( gridEl , "unit" , 0 ) ; gridRatio = getElementValueAsStr ( gridEl , "ratio" , 0 ) ; NodeList sliceNL = gridEl . getElementsByTagName ( "slice" ) ; totalGridNo = sliceNL . getLength ( ) ; sliceNoArray = new int [ totalGridNo ] ; xstartArray = new int [ totalGridNo ] ; ystartArray = new int [ totalGridNo ] ; xstartCoarseArray = new int [ totalGridNo ] ; ystartCoarseArray = new int [ totalGridNo ] ; for ( int i = 0 ; i < ( sliceNL . getLength ( ) ) ; i ++ ) { Element sliceNode = ( ( Element ) ( sliceNL . item ( i ) ) ) ; String sliceNo = sliceNode . getAttribute ( "z" ) ; if ( ! ( "All" . equals ( sliceNo ) ) ) sliceNoArray [ i ] = Integer . parseInt ( sliceNo ) ; xstartArray [ i ] = getElementValueAsInteger ( sliceNode , "xstart" , 0 ) ; ystartArray [ i ] = getElementValueAsInteger ( sliceNode , "ystart" , 0 ) ; xstartCoarseArray [ i ] = getElementValueAsInteger ( sliceNode , "xstartCoarse" , 0 ) ; ystartCoarseArray [ i ] = getElementValueAsInteger ( sliceNode , "ystartCoarse" , 0 ) ; } } } catch ( ParserConfigurationException e ) { } catch ( SAXException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } String getElementValueAsStr ( Element e , String tag , int index ) { } int getElementValueAsInteger ( Element e , String tag , int index ) { } double getElementValueAsDouble ( Element e , String tag , int index ) { } void gridLayer ( ) { } void xmlFileOpen ( ) { } void imageInformation ( ) { } void imageCheck ( ) { } No newline ; at end ; of file ; }

Fix:
NodeList combinedgridNL = doc . getElementsByTagName ( "CombinedGrids" ) ;
Buggy code:
public class DetachableContactModel extends LoadableDetachableModel { private long id ; protected ContactsDatabase getContactsDB ( ) { } public DetachableContactModel ( Contact c ) { } public DetachableContactModel ( long id ) { } public int hashCode ( ) { <START_BUG> return new Long ( id ) . hashCode ( ) ; <END_BUG> } public boolean equals ( final Object obj ) { } protected Object load ( ) { } }

Fix:
return Long . valueOf ( id ) . hashCode ( ) ;
Buggy code:
public class CryptTest extends TestCase { public void testNoCrypt ( ) { } public void testCrypt ( ) { <START_BUG> final ICrypt crypt = new Crypt ( ) ; <END_BUG> try { if ( ( crypt . encryptString ( "test" ) ) != null ) { assertEquals ( "KxMxhk6i4Us=" , crypt . encryptString ( "test" ) ) ; assertEquals ( "test" , crypt . decryptString ( "KxMxhk6i4Us=" ) ) ; } } catch ( Exception ex ) { } } }

Fix:
final ICrypt crypt = new SunJceCrypt ( ) ;