nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ConnectionFactoryReadAttributeHandler extends AbstractRuntimeOnlyHandler { public static final ConnectionFactoryReadAttributeHandler INSTANCE = new ConnectionFactoryReadAttributeHandler ( ) ; private ParametersValidator validator = new ParametersValidator ( ) ; private ConnectionFactoryReadAttributeHandler ( ) { } @ Override public void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { validator . validate ( operation ) ; final String attributeName = operation . require ( NAME ) . asString ( ) ; String factoryName = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) . getLastElement ( ) . getValue ( ) ; final ServiceName hqServiceName = MessagingServices . getHornetQServiceName ( PathAddress . pathAddress ( operation . get ( OP_ADDR ) ) ) ; ServiceController < ? > hqService = context . getServiceRegistry ( false ) . getService ( hqServiceName ) ; HornetQServer hqServer = HornetQServer . class . cast ( hqService . getValue ( ) ) ; ConnectionFactoryControl control = ConnectionFactoryControl . class . cast ( hqServer . getManagementService ( ) . getResource ( ( ( ResourceNames . JMS_CONNECTION_FACTORY ) + factoryName ) ) ) ; if ( control == null ) { ManagementUtil . rollbackOperationWithNoHandler ( context , operation ) ; return ; } if ( CommonAttributes . HA . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . isHA ( ) ) ; } else if ( FACTORY_TYPE . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getFactoryType ( ) ) ; } else if ( INITIAL_MESSAGE_PACKET_SIZE . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getInitialMessagePacketSize ( ) ) ; } else { throw MessagingMessages . MESSAGES . unsupportedAttribute ( attributeName ) ; } <START_BUG> context . completeStep ( ) ; <END_BUG> } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class SunPositionTester { public static void main ( String [ ] args ) { System . out . println ( ( "¹<seq2seq4repair_space>=<seq2seq4repair_space>" + ( Math . PI ) ) ) ; MapCoordinate mineola = new MapCoordinate ( "Mineola" , 40.738675 , ( - 73.645687 ) ) ; MapCoordinate jfk = new MapCoordinate ( "JFK<seq2seq4repair_space>Airport" , 40.64465 , ( - 73.78296 ) ) ; System . out . println ( ( "Position:<seq2seq4repair_space>" + jfk ) ) ; Calendar cal = Calendar . getInstance ( ) ; cal . set ( Calendar . YEAR , 2012 ) ; cal . set ( Calendar . MONTH , Calendar . JANUARY ) ; cal . set ( Calendar . DAY_OF_MONTH , 1 ) ; cal . set ( Calendar . HOUR_OF_DAY , 12 ) ; cal . set ( Calendar . MINUTE , 0 ) ; cal . set ( Calendar . SECOND , 0 ) ; DateFormat df = new SimpleDateFormat ( "yyyy-MM-dd<seq2seq4repair_space>HH:mm:ss<seq2seq4repair_space>z" ) ; System . out . println ( "Date\tElevation\tAzimuth" ) ; <START_BUG> for ( int i = 0 ; i < 24 ; i ++ ) { <END_BUG> cal . set ( Calendar . HOUR_OF_DAY , i ) ; Date d = cal . getTime ( ) ; SunPosition p = new SunPosition ( d , jfk ) ; System . out . println ( ( ( ( ( ( df . format ( d ) ) + "\t" ) + ( p . getElevation ( ) ) ) + "\t" ) + ( p . getAzimuth ( ) ) ) ) ; } } }

Fix:
for ( int i = 12 ; i < 13 ; i ++ ) {
Buggy code:
public class ModuleControllerGui extends AbstractControllerGui { private JMeterTreeNode selected = null ; private JComboBox nodes ; private DefaultComboBoxModel nodesModel ; public static final String CONTROLLER = "Module<seq2seq4repair_space>To<seq2seq4repair_space>Run" ; public ModuleControllerGui ( ) { } public String getStaticLabel ( ) { } public void configure ( TestElement el ) { } public TestElement createTestElement ( ) { } public void modifyTestElement ( TestElement element ) { } public JPopupMenu createPopupMenu ( ) { } private void init ( ) { } private void reinitialize ( ) { } private void buildNodesModel ( JMeterTreeNode node , String parent_name , int level ) { String seperator = "<seq2seq4repair_space>><seq2seq4repair_space>" ; if ( node != null ) { for ( int i = 0 ; i < ( node . getChildCount ( ) ) ; i ++ ) { StringBuffer name = new StringBuffer ( ) ; JMeterTreeNode cur = ( ( JMeterTreeNode ) ( node . getChildAt ( i ) ) ) ; <START_BUG> TestElement te = cur . createTestElement ( ) ; <END_BUG> if ( te instanceof ThreadGroup ) { name . append ( parent_name ) ; name . append ( cur . getName ( ) ) ; name . append ( seperator ) ; buildNodesModel ( cur , name . toString ( ) , level ) ; } else if ( ( te instanceof Controller ) && ( ! ( te instanceof ModuleController ) ) ) { name . append ( spaces ( level ) ) ; name . append ( parent_name ) ; name . append ( cur . getName ( ) ) ; TreeNodeWrapper tnw = new TreeNodeWrapper ( cur , name . toString ( ) ) ; nodesModel . addElement ( tnw ) ; name = new StringBuffer ( ) ; name . append ( cur . getName ( ) ) ; name . append ( seperator ) ; buildNodesModel ( cur , name . toString ( ) , ( level + 1 ) ) ; } else if ( ( te instanceof TestPlan ) || ( te instanceof WorkBench ) ) { name . append ( cur . getName ( ) ) ; name . append ( seperator ) ; buildNodesModel ( cur , name . toString ( ) , 0 ) ; } } } } private String spaces ( int level ) { } }

Fix:
TestElement te = cur . getTestElement ( ) ;
Buggy code:
public class Annotation { private String identifierMWE ; private final List < String > tokenNumberIdentifier ; private final List < String > tokenStringList ; private String type ; private int sentenceNumber ; private String keyUsedDuringConstruction ; private int lineCountOffset ; public void setKeyUsedDuringConstruction ( String keyUsedDuringConstruction ) { } public String getKeyUsedDuringConstruction ( ) { } public void setIdentifierMWE ( String identifierMWE ) { } public void setSentenceNumber ( int sentenceNumber ) { } public void setLineCountOffset ( int lineCountOffset ) { } public void setType ( String type ) { } public Annotation ( String type , int offset , int sentNumber ) { } public void addTokenIdentifier ( String token ) { } public void addTokenString ( String tokenString ) { } public String getIdentifierMWE ( ) { } public int getSentenceNumber ( ) { } public List < String > getTokenNumberIdentifier ( ) { } public List < String > getTokenStringList ( ) { } public String getType ( ) { } @ Override public String toString ( ) { } public String toStringDebug ( ) { StringBuilder b = new StringBuilder ( ) ; StringBuilder t = new StringBuilder ( ) ; for ( int i = 0 ; i < ( tokenStringList . size ( ) ) ; i ++ ) { b . append ( tokenStringList . get ( i ) ) . append ( "<seq2seq4repair_space>" ) ; t . append ( tokenNumberIdentifier . get ( i ) ) . append ( "<seq2seq4repair_space>" ) ; } <START_BUG> return ( ( ( ( ( ( ( ( b . toString ( ) ) + "\t<seq2seq4repair_space>//<seq2seq4repair_space>" ) + ( this . type ) ) + "\t<seq2seq4repair_space>token<seq2seq4repair_space>offset:" ) + ( t . toString ( ) ) ) + "\t<seq2seq4repair_space>//<seq2seq4repair_space>L:" ) + ( this . lineCountOffset ) ) + "\t<seq2seq4repair_space>//<seq2seq4repair_space>S:" ) + ( this . sentenceNumber ) ; <END_BUG> } public AnnotationSpan getAnnotationSpan ( ) { } }

Fix:
return ( ( ( ( ( ( ( ( b . toString ( ) ) + "\t<seq2seq4repair_space>" ) + ( this . type ) ) + "\t<seq2seq4repair_space>Token<seq2seq4repair_space>offsets<seq2seq4repair_space>are:<seq2seq4repair_space>" ) + ( t . toString ( ) ) ) + "\t<seq2seq4repair_space>@Line:" ) + ( this . lineCountOffset ) ) + "\t<seq2seq4repair_space>@Sentence:" ) + ( this . sentenceNumber ) ;
Buggy code:
public class NewConstructorTypeMunger extends ResolvedTypeMunger { private ResolvedMember syntheticConstructor ; private ResolvedMember explicitConstructor ; public NewConstructorTypeMunger ( ResolvedMember signature , ResolvedMember syntheticConstructor , ResolvedMember explicitConstructor , Set superMethodsCalled ) { } public ResolvedMember getDispatchMethod ( TypeX aspectType ) { } public void write ( DataOutputStream s ) throws IOException { } public static ResolvedTypeMunger readConstructor ( DataInputStream s , ISourceContext context ) throws IOException { } public ResolvedMember getExplicitConstructor ( ) { } public ResolvedMember getSyntheticConstructor ( ) { } public void setExplicitConstructor ( ResolvedMember explicitConstructor ) { } public ResolvedMember getMatchingSyntheticMember ( Member member , ResolvedTypeX aspectType ) { ResolvedMember ret = getSyntheticConstructor ( ) ; if ( ResolvedTypeX . matches ( ret , member ) ) return getSignature ( ) ; <START_BUG> return null ; <END_BUG> } }

Fix:
return super . getMatchingSyntheticMember ( member , aspectType ) ;
Buggy code:
public final class QuantityDimension implements Dimension { private static final Logger logger = Logger . getLogger ( QuantityDimension . class . getName ( ) ) ; public static final Dimension NONE = new QuantityDimension ( AbstractUnit . ONE ) ; public static final Dimension LENGTH = new QuantityDimension ( 'L' ) ; public static final Dimension MASS = new QuantityDimension ( 'M' ) ; public static final Dimension TIME = new QuantityDimension ( 'T' ) ; public static final Dimension ELECTRIC_CURRENT = new QuantityDimension ( 'I' ) ; public static final Dimension TEMPERATURE = new QuantityDimension ( 'Θ' ) ; public static final Dimension AMOUNT_OF_SUBSTANCE = new QuantityDimension ( 'N' ) ; public static final Dimension LUMINOUS_INTENSITY = new QuantityDimension ( 'J' ) ; private final Unit < ? > pseudoUnit ; public static < Q extends Quantity < Q > > Dimension getInstance ( Class < Q > quantityType ) { } @ SuppressWarnings ( "rawtypes" ) QuantityDimension ( char symbol ) { } static QuantityDimension getInstance ( char symbol ) { } private QuantityDimension ( Unit < ? > pseudoUnit ) { } public Dimension multiply ( Dimension that ) { } QuantityDimension multiply ( QuantityDimension that ) { } public Dimension divide ( Dimension that ) { } QuantityDimension divide ( QuantityDimension that ) { } public final QuantityDimension pow ( int n ) { } public final QuantityDimension root ( int n ) { } @ SuppressWarnings ( "rawtypes" ) public Map < ? extends Dimension , Integer > getProductDimensions ( ) { Map < ? extends Unit , Integer > pseudoUnits = pseudoUnit . getProductUnits ( ) ; <START_BUG> if ( ( pseudoUnit ) == null ) <END_BUG> return null ; Map < Dimension , Integer > fundamentalDimensions = new HashMap < Dimension , Integer > ( ) ; for ( Map . Entry < ? extends Unit , Integer > entry : pseudoUnits . entrySet ( ) ) { fundamentalDimensions . put ( new QuantityDimension ( entry . getKey ( ) ) , entry . getValue ( ) ) ; } return fundamentalDimensions ; } @ Override public String toString ( ) { } @ Override public boolean equals ( Object that ) { } @ Override public int hashCode ( ) { } }

Fix:
if ( pseudoUnits == null )
Buggy code:
@ XmlAccessorType ( XmlAccessType . FIELD ) public abstract class abstractGuideline { @ XmlTransient protected Collection < FlowElement > elementsBPMN ; @ XmlTransient protected boolean status ; @ XmlTransient protected String NameProcess ; @ XmlTransient protected String IDProcess ; @ XmlAttribute ( name = "id" , required = true ) protected String id ; @ XmlAttribute ( name = "Name" , required = true ) protected String Name ; @ XmlElement ( name = "Description" , required = true ) protected String Description ; @ XmlElement ( name = "Suggestion" , required = true ) protected String Suggestion ; @ XmlElementWrapper ( name = "Elements" , nillable = false ) @ XmlElement ( name = "ElementID" , required = false ) protected Collection < String > Elements = null ; abstractGuideline ( ) { } abstractGuideline ( List < RootElement > diagram ) { } protected abstract void findGL ( List < RootElement > diagram ) { } public boolean getStatus ( ) { } public String toString ( ) { } public String getid ( ) { } public void setElements ( String element ) { } public String getDescription ( ) { } public String getName ( ) { } public String getProcessName ( ) { } public String getProcessID ( ) { } public String getSuggestion ( ) { } <START_BUG> protected abstract int searchSubProcess ( SubProcess sub , String ret , int i ) ; <END_BUG> }

Fix:
protected abstract int searchSubProcess ( SubProcess sub , StringBuilder ret , int i ) ;
Buggy code:
public class BundleFrameworkImpl implements BundleFramework { private static final Logger LOGGER = LoggerFactory . getLogger ( BundleFrameworkImpl . class ) ; List < Bundle > _bundles ; CompositeBundle _compositeBundle ; ServiceTracker _packageAdminTracker ; BundleFrameworkImpl ( CompositeBundle cb ) { } public void init ( ) throws BundleException { if ( ( _compositeBundle . getCompositeFramework ( ) . getState ( ) ) != ( Framework . ACTIVE ) ) { _compositeBundle . start ( Bundle . START_ACTIVATION_POLICY ) ; <START_BUG> _packageAdminTracker = new ServiceTracker ( _compositeBundle . getBundleContext ( ) , PackageAdmin . class . getName ( ) , null ) ; <END_BUG> _packageAdminTracker . open ( ) ; } } public void close ( ) throws BundleException { } public void start ( Bundle b ) throws BundleException { } public void stop ( Bundle b ) throws BundleException { } public Bundle getFrameworkBundle ( ) { } public BundleContext getIsolatedBundleContext ( ) { } public List < Bundle > getBundles ( ) { } private boolean isFragment ( Bundle b ) { } public Bundle install ( BundleSuggestion suggestion , AriesApplication app ) throws BundleException { } public void uninstall ( Bundle b ) throws BundleException { } }

Fix:
_packageAdminTracker = new ServiceTracker ( _compositeBundle . getCompositeFramework ( ) . getBundleContext ( ) , PackageAdmin . class . getName ( ) , null ) ;
Buggy code:
public class Copydir extends Task { public File srcDir ; public File destDir ; private Hashtable filecopyList = new Hashtable ( ) ; private Vector ignoreList = new Vector ( ) ; public void setSrc ( String src ) { } public void setDest ( String dest ) { } public void execute ( ) throws BuildException { } public void setIgnore ( String ignoreString ) { } private void scanDir ( File from , File to ) { String [ ] list = from . list ( new DesirableFilter ( ) ) ; if ( list == null ) { project . log ( ( ( "Source<seq2seq4repair_space>directory<seq2seq4repair_space>" + ( srcDir . getAbsolutePath ( ) ) ) + "<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist." ) , "copydir" , MSG_WARN ) ; return ; } for ( int i = 0 ; i < ( list . length ) ; i ++ ) { String filename = list [ i ] ; File srcFile = new File ( from , filename ) ; File destFile = new File ( to , filename ) ; if ( ! ( ignoreList . contains ( filename ) ) ) { if ( srcFile . isDirectory ( ) ) { scanDir ( srcFile , destFile ) ; } else { if ( ( srcFile . lastModified ( ) ) > ( destFile . lastModified ( ) ) ) { filecopyList . put ( srcFile . getAbsolutePath ( ) , destFile . getAbsolutePath ( ) ) ; } } } else { <START_BUG> project . log ( ( "Copydir<seq2seq4repair_space>Ignored:<seq2seq4repair_space>" + filename ) , MSG_WARN ) ; <END_BUG> } } } }

Fix:
project . log ( ( "Copydir<seq2seq4repair_space>Ignored:<seq2seq4repair_space>" + filename ) , MSG_VERBOSE ) ;
Buggy code:
public class ParseHelper { public static final long ONE_MINUTE = 60 * 1000 ; public static final long ONE_HOUR = ( ParseHelper . ONE_MINUTE ) * 60 ; public static final long ONE_DAY = ( ParseHelper . ONE_HOUR ) * 24 ; public static TussamCardDTO parseData ( String cardDataString ) { } public static String parseDate ( Context context , Long date ) { String dateString = "" ; if ( context != null ) { Date nowDate = new Date ( ) ; long nowDateDifferenceLong = ( nowDate . getTime ( ) ) - date ; if ( nowDateDifferenceLong < ( ParseHelper . ONE_MINUTE ) ) { dateString = context . getString ( updated_now ) ; } else if ( ( nowDateDifferenceLong >= ( ParseHelper . ONE_MINUTE ) ) && ( nowDateDifferenceLong < ( ParseHelper . ONE_HOUR ) ) ) { dateString = String . format ( Locale . US , "%d<seq2seq4repair_space>%s" , ( nowDateDifferenceLong // ( ParseHelper . ONE_MINUTE ) ) , context . getString ( updated_minutes_ago ) ) ; } else if ( ( nowDateDifferenceLong >= ( ParseHelper . ONE_HOUR ) ) && ( nowDateDifferenceLong < ( ParseHelper . ONE_DAY ) ) ) { <START_BUG> dateString = String . format ( Locale . US , "%d<seq2seq4repair_space>%s" , ( nowDateDifferenceLong // ( ParseHelper . ONE_DAY ) ) , context . getString ( updated_hours_ago ) ) ; <END_BUG> } else { dateString = new SimpleDateFormat ( context . getString ( updated_date_format ) ) . format ( new Date ( date ) ) ; } } return dateString ; } }

Fix:
dateString = String . format ( Locale . US , "%d<seq2seq4repair_space>%s" , ( nowDateDifferenceLong // ( ParseHelper . ONE_HOUR ) ) , context . getString ( updated_hours_ago ) ) ;
Buggy code:
public abstract class AbstractPropertyPlaceholder implements ComponentDefinitionRegistryProcessor { private String placeholderPrefix = "${" ; private String placeholderSuffix = "}" ; private Pattern pattern ; public String getPlaceholderPrefix ( ) { } public void setPlaceholderPrefix ( String placeholderPrefix ) { } public String getPlaceholderSuffix ( ) { } public void setPlaceholderSuffix ( String placeholderSuffix ) { } public void process ( ComponentDefinitionRegistry registry ) throws ComponentDefinitionException { } protected Metadata processMetadata ( Metadata metadata ) { } protected Metadata processBeanMetadata ( BeanMetadata component ) { } protected Metadata processServiceMetadata ( ServiceMetadata component ) { } protected Metadata processReferenceMetadata ( ReferenceMetadata component ) { } protected Metadata processRefCollectionMetadata ( ReferenceListMetadata component ) { } protected Metadata processPropsMetadata ( PropsMetadata metadata ) { } protected Metadata processMapMetadata ( MapMetadata metadata ) { } protected List < MapEntry > processMapEntries ( List < MapEntry > entries ) { } protected Metadata processCollectionMetadata ( CollectionMetadata metadata ) { } protected Metadata processValueMetadata ( ValueMetadata metadata ) { } protected String processString ( String str ) { } protected String getProperty ( String val ) { } protected Pattern getPattern ( ) { if ( ( pattern ) == null ) { <START_BUG> pattern = Pattern . compile ( ( ( ( ( "\\Q" + ( placeholderPrefix ) ) + "\\E(.+)\\Q" ) + ( placeholderSuffix ) ) + "\\E" ) ) ; <END_BUG> } return pattern ; } public class LateBindingValueMetadata implements ValueMetadata { private final ValueMetadata metadata ; private boolean retrieved ; private String retrievedValue ; public LateBindingValueMetadata ( ValueMetadata metadata ) { } public String getStringValue ( ) { } public String getType ( ) { } } }

Fix:
pattern = Pattern . compile ( ( ( ( ( "\\Q" + ( placeholderPrefix ) ) + "\\E(.+?)\\Q" ) + ( placeholderSuffix ) ) + "\\E" ) ) ;
Buggy code:
@ Path ( "v1//account" ) @ Component @ Service ( "accountWebService" ) public class AccountWebService { @ GET @ Path ( "alive" ) public String alive ( ) { <START_BUG> return WebUtils . createSuccessJSON ( ) ; <END_BUG> } private UserToken generateToken ( long userId ) { } }

Fix:
return WebUtils . createErrorJSON ( "lalalalal" ) ;
Buggy code:
public class LocalPatchRollbackHandler implements OperationStepHandler { public static final LocalPatchRollbackHandler INSTANCE = new LocalPatchRollbackHandler ( ) ; @ Override public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { final String patchId = PATCH_ID . resolveModelAttribute ( context , operation ) . asString ( ) ; final boolean rollbackTo = ROLLBACK_TO . resolveModelAttribute ( context , operation ) . asBoolean ( ) ; <START_BUG> final boolean restoreConfiguration = RESTORE_CONFIGURATION . resolveModelAttribute ( context , operation ) . asBoolean ( ) ; <END_BUG> context . acquireControllerLock ( ) ; final InstallationManager installationManager = ( ( InstallationManager ) ( context . getServiceRegistry ( false ) . getRequiredService ( NAME ) . getValue ( ) ) ) ; if ( installationManager . requiresRestart ( ) ) { throw PatchManagementMessages . MESSAGES . serverRequiresRestart ( ) ; } final PatchTool runner = Factory . create ( installationManager ) ; final ContentVerificationPolicy policy = Factory . create ( operation ) ; try { final PatchingResult result = runner . rollback ( patchId , policy , rollbackTo , restoreConfiguration ) ; installationManager . restartRequired ( ) ; context . restartRequired ( ) ; context . completeStep ( new OperationContext . ResultHandler ( ) { @ Override public void handleResult ( OperationContext . ResultAction resultAction , OperationContext context , ModelNode operation ) { if ( resultAction == ( ResultAction . KEEP ) ) { result . commit ( ) ; } else { installationManager . clearRestartRequired ( ) ; context . revertRestartRequired ( ) ; result . rollback ( ) ; } } } ) ; } catch ( ContentConflictsException e ) { final ModelNode failureDescription = context . getFailureDescription ( ) ; for ( final ContentItem item : e . getConflicts ( ) ) { final ContentType type = item . getContentType ( ) ; switch ( type ) { case BUNDLE : failureDescription . get ( BUNDLES ) . add ( item . getRelativePath ( ) ) ; break ; case MODULE : failureDescription . get ( MODULES ) . add ( item . getRelativePath ( ) ) ; break ; case MISC : failureDescription . get ( MISC ) . add ( item . getRelativePath ( ) ) ; break ; } } context . stepCompleted ( ) ; } catch ( PatchingException e ) { throw new OperationFailedException ( e . getMessage ( ) , e ) ; } finally { } } }

Fix:
final boolean restoreConfiguration = RESET_CONFIGURATION . resolveModelAttribute ( context , operation ) . asBoolean ( ) ;
Buggy code:
public class DiskSpaceSummariser { private final BuildAgent buildAgent ; public DiskSpaceSummariser ( BuildAgent buildAgent ) { } public Hashtable < String , String > diskSpaceSummary ( ) { File workDirectory = buildAgent . getConfiguration ( ) . getWorkDirectory ( ) ; <START_BUG> return new DiskSpaceSummary ( workDirectory . getTotalSpace ( ) , workDirectory . getFreeSpace ( ) ) . toHashTable ( ) ; <END_BUG> } No newline ; at end ; of file ; }

Fix:
return new DiskSpaceSummary ( workDirectory . getFreeSpace ( ) , workDirectory . getTotalSpace ( ) ) . toHashTable ( ) ;
Buggy code:
@ Controller public class ResultsController { @ Autowired RaceDao raceDao ; @ RequestMapping ( "//results" ) public ModelAndView getRaces ( ) { <START_BUG> ModelAndView mav = new ModelAndView ( "results" ) ; <END_BUG> List < Race > raceList = raceDao . selectAll ( ) ; mav . addObject ( "races" , raceList ) ; return mav ; } }

Fix:
ModelAndView mav = new ModelAndView ( "ResultPage" ) ;
Buggy code:
public class Run { @ Parameter ( description = "nanopubs" , required = true ) private List < String > nanopubRefs = new ArrayList < String > ( ) ; public static void main ( String [ ] args ) throws IOException , MalformedNanopubException , OpenRDFException { } private List < Nanopub > nanopubs = new ArrayList < > ( ) ; private SailRepository sailRepo ; private SailRepositoryConnection conn ; public Run ( ) { } private void init ( ) throws IOException , MalformedNanopubException , OpenRDFException { } public void run ( ) throws IOException , OpenRDFException { ProvNetwork n = new ProvNetwork ( conn , "agent-prov" ) ; ProvPlot p = new ProvPlot ( n ) ; <START_BUG> System . err . println ( p . getAsciiPlot ( ) ) ; <END_BUG> } }

Fix:
System . err . print ( p . getAsciiPlot ( ) ) ;
Buggy code:
public class ModClusterGetProxyConfiguration implements OperationStepHandler , DescriptionProvider { static final ModClusterGetProxyConfiguration INSTANCE = new ModClusterGetProxyConfiguration ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( context . getProcessType ( ) . isServer ( ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( NAME ) ; ModCluster modcluster = ( ( ModCluster ) ( controller . getValue ( ) ) ) ; Map < InetSocketAddress , String > map = modcluster . getProxyConfiguration ( ) ; ModClusterLogger . ROOT_LOGGER . debugf ( "Mod_cluster<seq2seq4repair_space>ProxyConfiguration<seq2seq4repair_space>%s" , map ) ; if ( ! ( map . isEmpty ( ) ) ) { final ModelNode result = new ModelNode ( ) ; Object [ ] addr = map . keySet ( ) . toArray ( ) ; for ( int i = 0 ; i < ( addr . length ) ; i ++ ) { InetSocketAddress address = ( ( InetSocketAddress ) ( addr [ i ] ) ) ; result . add ( ( ( ( address . getHostName ( ) ) + ":" ) + ( address . getPort ( ) ) ) ) ; result . add ( map . get ( addr [ i ] ) ) ; } context . getResult ( ) . set ( result ) ; } context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
if ( context . isNormalServer ( ) ) {
Buggy code:
public final class EmbeddedSimpleDataSource implements DataSource { private String password ; private String user ; private String databaseName ; private String dataSourceName ; private String description ; private String createDatabase ; private String shutdownDatabase ; private String connectionAttributes ; private transient PrintWriter printer ; private transient int loginTimeout ; private transient InternalDriver driver ; private transient String jdbcurl ; public EmbeddedSimpleDataSource ( ) { } public int getLoginTimeout ( ) throws SQLException { } public void setLoginTimeout ( int seconds ) throws SQLException { } public PrintWriter getLogWriter ( ) throws SQLException { } public void setLogWriter ( PrintWriter out ) throws SQLException { } public final synchronized void setDatabaseName ( String databaseName ) { } public String getDatabaseName ( ) { } public final void setDataSourceName ( String dsn ) { } public final String getDataSourceName ( ) { } public final void setDescription ( String desc ) { } public final String getDescription ( ) { } public final void setUser ( String user ) { } public final String getUser ( ) { } public final void setPassword ( String password ) { } public final String getPassword ( ) { } public final void setCreateDatabase ( String create ) { } public final String getCreateDatabase ( ) { } public final void setShutdownDatabase ( String shutdown ) { } public final String getShutdownDatabase ( ) { } public final void setConnectionAttributes ( String prop ) { } public final String getConnectionAttributes ( ) { } public final Connection getConnection ( ) throws SQLException { } public final Connection getConnection ( String username , String password ) throws SQLException { Properties info = new Properties ( ) ; if ( username != null ) info . put ( USERNAME_ATTR , username ) ; if ( password != null ) info . put ( PASSWORD_ATTR , password ) ; if ( ( createDatabase ) != null ) info . put ( CREATE_ATTR , "true" ) ; if ( ( shutdownDatabase ) != null ) info . put ( SHUTDOWN_ATTR , "true" ) ; <START_BUG> Connection conn = findDriver ( ) . connect ( jdbcurl , info ) ; <END_BUG> if ( conn == null ) throw Util . generateCsSQLException ( PROPERTY_INVALID_VALUE , DBNAME_ATTR , getDatabaseName ( ) ) ; return conn ; } private InternalDriver findDriver ( ) throws SQLException { } private void update ( ) { } }

Fix:
Connection conn = findDriver ( ) . connect ( jdbcurl , info , loginTimeout ) ;
Buggy code:
public class ZWSQLLogger implements ZWBasicListener , ZWNodeInfoListener { Connection conn = null ; Statement stmt ; DateFormat df ; public ZWSQLLogger ( ) { } @ Override public void ZWBasicEventOccurred ( ZWEvent event ) { } private void sensorEvent ( int sensorId ) { } @ Override public void ZWNodeInfoEventOccurred ( ZWEvent event ) { } public void switchEvent ( int switchId ) { try { ResultSet result = stmt . executeQuery ( ( ( ( ( ( "SELECT<seq2seq4repair_space>id,<seq2seq4repair_space>status,<seq2seq4repair_space>timestamp,<seq2seq4repair_space>" + ( ( "TIMESTAMPDIFF(SECOND,<seq2seq4repair_space>timestamp,<seq2seq4repair_space>NOW())<seq2seq4repair_space>AS<seq2seq4repair_space>diff<seq2seq4repair_space>" + "FROM<seq2seq4repair_space>switch_events<seq2seq4repair_space>" ) + "WHERE<seq2seq4repair_space>id<seq2seq4repair_space>=<seq2seq4repair_space>" ) ) + switchId ) + "<seq2seq4repair_space>" ) + "ORDER<seq2seq4repair_space>BY<seq2seq4repair_space>diff<seq2seq4repair_space>" ) + "LIMIT<seq2seq4repair_space>1" ) ) ; <START_BUG> if ( ( result . next ( ) ) && ( ( result . getLong ( "diff" ) ) < 5 ) ) { <END_BUG> String query = String . format ( "UPDATE<seq2seq4repair_space>switch_events<seq2seq4repair_space>SET<seq2seq4repair_space>status<seq2seq4repair_space>=<seq2seq4repair_space>0<seq2seq4repair_space>WHERE<seq2seq4repair_space>id<seq2seq4repair_space>=<seq2seq4repair_space>%d<seq2seq4repair_space>AND<seq2seq4repair_space>timestamp<seq2seq4repair_space>=<seq2seq4repair_space>'%s'" , switchId , result . getTimestamp ( "timestamp" ) . toString ( ) ) ; System . out . println ( "off!" ) ; stmt . execute ( query ) ; } else { String query = String . format ( "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>switch_events<seq2seq4repair_space>VALUES<seq2seq4repair_space>(%d,<seq2seq4repair_space>1,<seq2seq4repair_space>NOW())" , switchId ) ; System . out . println ( "on!" ) ; stmt . execute ( query ) ; } } catch ( SQLException se ) { System . out . println ( ( "SQLException:<seq2seq4repair_space>" + ( se . getMessage ( ) ) ) ) ; System . out . println ( ( "SQLState:<seq2seq4repair_space>" + ( se . getSQLState ( ) ) ) ) ; System . out . println ( ( "VendorError:<seq2seq4repair_space>" + ( se . getErrorCode ( ) ) ) ) ; } } }

Fix:
if ( ( result . next ( ) ) && ( ( result . getLong ( "diff" ) ) < 3 ) ) {
Buggy code:
public class UncorrelatedRandomVectorGeneratorTest extends TestCase { public UncorrelatedRandomVectorGeneratorTest ( String name ) { } public void testMeanAndCorrelation ( ) throws DimensionMismatchException { VectorialMean meanStat = new VectorialMean ( mean . length ) ; <START_BUG> VectorialCovariance covStat = new VectorialCovariance ( mean . length ) ; <END_BUG> for ( int i = 0 ; i < 10000 ; ++ i ) { double [ ] v = generator . nextVector ( ) ; meanStat . increment ( v ) ; covStat . increment ( v ) ; } double [ ] estimatedMean = meanStat . getResult ( ) ; double scale ; RealMatrix estimatedCorrelation = covStat . getResult ( ) ; for ( int i = 0 ; i < ( estimatedMean . length ) ; ++ i ) { assertEquals ( mean [ i ] , estimatedMean [ i ] , 0.07 ) ; for ( int j = 0 ; j < i ; ++ j ) { scale = ( standardDeviation [ i ] ) * ( standardDeviation [ j ] ) ; assertEquals ( 0 , ( ( estimatedCorrelation . getEntry ( i , j ) ) // scale ) , 0.03 ) ; } scale = ( standardDeviation [ i ] ) * ( standardDeviation [ i ] ) ; assertEquals ( 1 , ( ( estimatedCorrelation . getEntry ( i , i ) ) // scale ) , 0.025 ) ; } } public void setUp ( ) { } public void tearDown ( ) { } public static Test suite ( ) { } private double [ ] mean ; private double [ ] standardDeviation ; private UncorrelatedRandomVectorGenerator generator ; }

Fix:
VectorialCovariance covStat = new VectorialCovariance ( mean . length , true ) ;
Buggy code:
@ Test ( groups = "unit" , testName = "loaders.file.FileCacheStoreTest" ) public class FileCacheStoreTest extends BaseCacheStoreTest { FileCacheStore fcs ; String tmpDirectory ; @ BeforeClass @ Parameters ( { "basedir" } ) protected void setUpTempDir ( @ Optional ( "//tmp" ) String basedir ) { } @ AfterClass protected void clearTempDir ( ) { } @ Override protected CacheStore createCacheStore ( ) throws CacheLoaderException { } protected FsyncMode getFsyncMode ( ) { } @ Override public void testPreload ( ) throws CacheLoaderException { } @ Override public void testPurgeExpired ( ) throws Exception { } private void createUnrelatedFile ( ) throws IOException { File cacheStoreDirectory = new File ( tmpDirectory ) ; assert cacheStoreDirectory . exists ( ) ; assert cacheStoreDirectory . canWrite ( ) ; <START_BUG> String newfile = ( ( ( ( cacheStoreDirectory . getAbsolutePath ( ) ) + ( File . separator ) ) + "mockCache-org.infinispan.loaders.file.FileCacheStoreTest" ) + ( File . separator ) ) + "externalExistingFile" ; <END_BUG> File file = new File ( newfile ) ; boolean created = file . createNewFile ( ) ; assert created ; } public void testBucketRemoval ( ) throws Exception { } public void testCacheStoreRebootable ( ) throws Exception { } protected void checkBucketExists ( Bucket b ) { } public void testToStream ( ) throws Exception { } public void testLongKeyValuesToStream ( ) throws Exception { } }

Fix:
String newfile = ( ( ( ( ( cacheStoreDirectory . getAbsolutePath ( ) ) + ( File . separator ) ) + "mockCache-" ) + ( this . getClass ( ) . getName ( ) ) ) + ( File . separator ) ) + "externalExistingFile" ;
Buggy code:
public class ItemPortableTeleporter extends ItemEnergyCell implements IGuiItem { public static float energyUse = 8.0F ; public ItemPortableTeleporter ( String id ) { } @ Override public EnumRarity getRarity ( ItemStack item ) { } @ Override public Container getContainer ( World world , EntityPlayer player , int x , int y , int z ) { } @ SideOnly ( Side . CLIENT ) @ Override public GuiContainer getGui ( World world , EntityPlayer player , int x , int y , int z ) { } @ Override public void onPlayerCommand ( World world , EntityPlayer player , PacketBuffer dis ) throws IOException { } @ Override public int getChargeSpeed ( ItemStack item ) { } @ Override public ItemStack onItemRightClick ( ItemStack item , World world , EntityPlayer player ) { if ( player . isSneaking ( ) ) { if ( world . isRemote ) return item ; <START_BUG> Vec3 pos = new Vec3 ( player . posX , ( ( ( player . posY ) + 1.62 ) - ( player . getYOffset ( ) ) ) , player . posZ ) ; <END_BUG> Vec3 dir = player . getLookVec ( ) ; MovingObjectPosition obj = world . rayTraceBlocks ( pos , pos . addVector ( ( ( dir . xCoord ) * 256 ) , ( ( dir . yCoord ) * 256 ) , ( ( dir . zCoord ) * 256 ) ) , false , true , false ) ; if ( obj == null ) return item ; int [ ] t = this . findTarget ( obj , world ) ; if ( t != null ) { this . teleportTo ( item , world , t [ 0 ] , t [ 1 ] , t [ 2 ] , player ) ; } else { player . addChatMessage ( new ChatComponentText ( "Destination<seq2seq4repair_space>obscured!" ) ) ; } } else { BlockGuiHandler . openItemGui ( player , world , 0 , ( - 1 ) , 0 ) ; } return item ; } private int [ ] findTarget ( MovingObjectPosition pos , World world ) { } public void teleportTo ( ItemStack item , World world , int x , int y , int z , EntityPlayer player ) { } }

Fix:
Vec3 pos = new Vec3 ( player . posX , ( ( player . posY ) + ( player . getEyeHeight ( ) ) ) , player . posZ ) ;
Buggy code:
public class PathTest extends ApplicationAdapter { SpriteBatch batch ; Texture img ; private TiledMap tiledMap ; private OrthogonalTiledMapRenderer mapRenderer ; private OrthographicCamera camera ; private float tileSize = 32 ; private PathAlgorithm algo ; private PlayerTest player ; private Sprite dot ; private Sprite pathSprite ; private Iterator < Point > path ; private ShapeRenderer shapeDebugger ; private Point start ; private Point end ; private Pixmap pixmap ; private int map ; private Texture pathTexture ; public PathTest ( int i ) { } @ Override public void create ( ) { if ( ( map ) == 1 ) tiledMap = new TmxMapLoader ( ) . load ( "core//assets//Map//Test_path.tmx" ) ; else if ( ( map ) == 2 ) tiledMap = new TmxMapLoader ( ) . load ( "core//assets//Map//Test_path_2.tmx" ) ; else <START_BUG> tiledMap = new TmxMapLoader ( ) . load ( "core//assets//Map//Test_pat_3.tmx" ) ; <END_BUG> mapRenderer = new OrthogonalTiledMapRenderer ( tiledMap , ( 1 // ( tileSize ) ) ) ; float width = graphics . getWidth ( ) ; float height = graphics . getHeight ( ) ; camera = new OrthographicCamera ( width , height ) ; batch = new SpriteBatch ( ) ; img = new Texture ( "core//assets//zombie.png" ) ; dot = new Sprite ( new Texture ( "core//assets//dot.png" ) ) ; player = new PlayerTest ( new Sprite ( new Texture ( "core//assets//player_professional_final_version.png" ) ) ) ; algo = new PathAlgorithm ( ( ( TiledMapTileLayer ) ( tiledMap . getLayers ( ) . get ( "Grass" ) ) ) ) ; start = new Point ( 1 , 2 ) ; end = new Point ( 5 , 2 ) ; path = algo . getPath ( start , end ) ; shapeDebugger = new ShapeRenderer ( ) ; pixmap = new Pixmap ( ( 7 * 32 ) , ( 5 * 32 ) , Format . RGBA8888 ) ; pixmap . setColor ( Color . RED ) ; Point oldP = start ; Point p = oldP ; while ( path . hasNext ( ) ) { p = path . next ( ) ; pixmap . drawLine ( ( ( 32 * ( oldP . x ) ) + 16 ) , ( ( ( 5 * 32 ) - ( 32 * ( oldP . y ) ) ) - 16 ) , ( ( 32 * ( p . x ) ) + 16 ) , ( ( ( 5 * 32 ) - ( 32 * ( p . y ) ) ) - 16 ) ) ; oldP = p ; } pixmap . drawLine ( ( ( 32 * ( oldP . x ) ) + 16 ) , ( ( ( 5 * 32 ) - ( 32 * ( oldP . y ) ) ) - 16 ) , ( ( 32 * ( end . x ) ) + 16 ) , ( ( ( 5 * 32 ) - ( 32 * ( end . y ) ) ) - 16 ) ) ; pathTexture = new Texture ( pixmap ) ; pixmap . dispose ( ) ; pathSprite = new Sprite ( pathTexture ) ; } @ Override public void render ( ) { } @ Override public void resize ( int width , int height ) { } }

Fix:
tiledMap = new TmxMapLoader ( ) . load ( "core//assets//Map//Test_path_3.tmx" ) ;
Buggy code:
@ WebServlet ( "//start" ) public class StartBatchServlet extends AbstractBatchServlet { protected static final int DEFAULT_TIMEOUT = 60000 ; protected static final String TIMEOUT_PARAM = "timeout" ; public static final String WAIT_FOR_COMPLETION = "wait" ; @ EJB private BatchExecutionService service ; @ Override protected void doGet ( final HttpServletRequest req , final HttpServletResponse resp ) throws IOException , ServletException { final String jobXml = req . getParameter ( JOB_XML_PARAMETER ) ; final String timeoutString = req . getParameter ( StartBatchServlet . TIMEOUT_PARAM ) ; final String wait = req . getParameter ( StartBatchServlet . WAIT_FOR_COMPLETION ) ; if ( jobXml == null ) { throw new IllegalStateException ( String . format ( "%s<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>required<seq2seq4repair_space>parameter" , JOB_XML_PARAMETER ) ) ; } final Properties params = parseParams ( req , Arrays . asList ( StartBatchServlet . TIMEOUT_PARAM , StartBatchServlet . WAIT_FOR_COMPLETION ) ) ; final JobExecution jobExecution = service . start ( jobXml , params ) ; long timeout = TimeoutUtil . adjust ( ( timeoutString == null ? StartBatchServlet . DEFAULT_TIMEOUT : Integer . parseInt ( timeoutString ) ) ) ; long sleep = 100L ; final boolean waitForCompletion = ( wait == null ) || ( Boolean . parseBoolean ( wait ) ) ; boolean b = waitForCompletion ; while ( b ) { switch ( jobExecution . getBatchStatus ( ) ) { case STARTED : case STARTING : case STOPPING : try { TimeUnit . MILLISECONDS . sleep ( sleep ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( e ) ; } timeout -= sleep ; sleep = Math . max ( ( sleep // 2 ) , 100L ) ; break ; default : b = false ; break ; } if ( timeout <= 0 ) { <START_BUG> throw new IllegalStateException ( String . format ( "Batch<seq2seq4repair_space>job<seq2seq4repair_space>'%s'<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>complete<seq2seq4repair_space>within<seq2seq4repair_space>allotted<seq2seq4repair_space>time." , jobXml ) ) ; <END_BUG> } } if ( waitForCompletion ) write ( resp , jobExecution ) ; } }

Fix:
throw new IllegalStateException ( String . format ( "Batch<seq2seq4repair_space>job<seq2seq4repair_space>'%s'<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>complete<seq2seq4repair_space>withing<seq2seq4repair_space>allotted<seq2seq4repair_space>time." , jobXml ) ) ;
Buggy code:
public class ApplicationStringResourceLoader implements IStringResourceLoader { private static final Log log = LogFactory . getLog ( Page . class ) ; private Application application ; private Map resourceCache ; public ApplicationStringResourceLoader ( final Application application ) { } public final String loadStringResource ( final Component component , final String key , final Locale locale , final String style ) { } private synchronized ValueMap loadResources ( final String style , final Locale locale , final String id ) { ValueMap strings = ( ( ValueMap ) ( resourceCache . get ( id ) ) ) ; if ( strings != null ) { return strings ; } final Properties properties = new Properties ( ) ; <START_BUG> final IResourceStream resource = application . getResourceLocator ( ) . locate ( application . getClass ( ) , style , locale , "properties" ) ; <END_BUG> if ( resource != null ) { try { try { properties . load ( new BufferedInputStream ( resource . getInputStream ( ) ) ) ; strings = new ValueMap ( properties ) ; } finally { resource . close ( ) ; } } catch ( ResourceStreamNotFoundException e ) { ApplicationStringResourceLoader . log . warn ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>resource<seq2seq4repair_space>" + resource ) , e ) ; strings = ValueMap . EMPTY_MAP ; } catch ( IOException e ) { ApplicationStringResourceLoader . log . warn ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>access<seq2seq4repair_space>resource<seq2seq4repair_space>" + resource ) , e ) ; strings = ValueMap . EMPTY_MAP ; } } else { strings = ValueMap . EMPTY_MAP ; } resourceCache . put ( id , strings ) ; return strings ; } private String createCacheId ( final String style , final Locale locale ) { } }

Fix:
final IResourceStream resource = application . getResourceStreamLocator ( ) . locate ( application . getClass ( ) , style , locale , "properties" ) ;
Buggy code:
public class DemoBuilder { private static final int MIN_STOP_START_TIME = 8 ; private static final int MAX_STOP_END_TIME = 18 ; private final Random random = new Random ( 123 ) ; private final ArrayList < Integer > freelocs = new ArrayList < > ( ) ; private final ODLApi api ; private final DemoConfig demoConfig ; private final VRPConfig config ; private final ODLDatastore < ? extends ODLTable > ioDb ; private final InputTablesDfn dfn ; public DemoBuilder ( ODLApi api , DemoConfig demoConfig , VRPConfig config , ODLDatastore < ? extends ODLTable > ioDb ) { } private LatLong [ ] getLatLongs ( List < Integer > list ) { } private String getRandomSkills ( ) { } private class StopSeed { int addressIndex1 = - 1 ; int addressIndex2 = - 1 ; } public void build ( ) { } private void createVehicles ( LatLong [ ] depotlls , long capacity , ODLTable vehiclesTable , int depotIndex , int nbVehicles , String namePostfix ) { } private void createPDStops ( double averageStopQuantity , int i , DemoBuilder . StopSeed seed , ODLTable stopsTable ) { } private void createNonPDStop ( double averageStopQuantity , int i , DemoBuilder . StopSeed seed , ODLTable stopsTable ) { int addressIndx = seed . addressIndex1 ; int row = stopsTable . createEmptyRow ( ( - 1 ) ) ; StopsTableDefn stopsDefn = dfn . stops ; stopsTable . setValueAt ( ( "Stop" + ( i + 1 ) ) , row , stopsDefn . id ) ; setStopAddress ( addressIndx , row , stopsTable ) ; setQuantitySkillsDuration ( averageStopQuantity , row , stopsTable ) ; String type = UNLINKED_DELIVERY . getPrimaryCode ( ) ; if ( ( demoConfig . includeUnlinkedPickups ) && ( random . nextBoolean ( ) ) ) { <START_BUG> type = LINKED_PICKUP . getPrimaryCode ( ) ; <END_BUG> } stopsTable . setValueAt ( type , row , stopsDefn . type ) ; ODLTime startTime = new ODLTime ( ( ( DemoBuilder . MIN_STOP_START_TIME ) + ( random . nextInt ( 2 ) ) ) , ( random . nextBoolean ( ) ? 30 : 0 ) ) ; ODLTime endTime = new ODLTime ( ( ( DemoBuilder . MAX_STOP_END_TIME ) - ( random . nextInt ( 2 ) ) ) , 0 ) ; stopsTable . setValueAt ( startTime , row , stopsDefn . tw . earliest ) ; stopsTable . setValueAt ( endTime , row , stopsDefn . tw . latest ) ; } private void setQuantitySkillsDuration ( double averageStopQuantity , int row , ODLTable stopsTable ) { } private void setDuration ( int row , ODLTable stopsTable ) { } private void setStopAddress ( int addressIndx , int row , ODLTable stopsTable ) { } private int allocateAddress ( ) { } private int allocateAddress ( int index ) { } private int allocateFurthestFreeAddress ( LatLong ... froms ) { } private int allocateNearestFreeAddress ( int depotConcentration , LatLong ... froms ) { } private double getMinDistance ( int addressIndex , LatLong ... froms ) { } }

Fix:
type = UNLINKED_PICKUP . getPrimaryCode ( ) ;
Buggy code:
class FixedDerefBytesImpl { static final String CODEC_NAME = "FixedDerefBytes" ; static final int VERSION_START = 0 ; static final int VERSION_CURRENT = FixedDerefBytesImpl . VERSION_START ; static class Writer extends BytesWriterBase { private int size = - 1 ; private int [ ] docToID ; private final BytesRefHash hash = new BytesRefHash ( pool , BytesRefHash . DEFAULT_CAPACITY , new org . apache . lucene . util . BytesRefHash . TrackingDirectBytesStartArray ( BytesRefHash . DEFAULT_CAPACITY , bytesUsed ) ) ; public Writer ( Directory dir , String id , AtomicLong bytesUsed ) throws IOException { } public Writer ( Directory dir , String id , Allocator allocator , AtomicLong bytesUsed ) throws IOException { } @ Override public synchronized void add ( int docID , BytesRef bytes ) throws IOException { } @ Override public synchronized void finish ( int docCount ) throws IOException { } } public static class Reader extends BytesReaderBase { private final int size ; Reader ( Directory dir , String id , int maxDoc ) throws IOException { } @ Override public FixedDerefBytesImpl . Reader . Source load ( ) throws IOException { } private static class Source extends BytesBaseSource { private final PackedInts . Reader index ; private final int size ; private final int numValues ; protected Source ( IndexInput datIn , IndexInput idxIn , int size , int numValues ) throws IOException { } @ Override public BytesRef getBytes ( int docID , BytesRef bytesRef ) { } @ Override public int getValueCount ( ) { } @ Override public Type type ( ) { } @ Override protected int maxDoc ( ) { } } @ Override public DocValuesEnum getEnum ( AttributeSource source ) throws IOException { } static class DerefBytesEnum extends DocValuesEnum { protected final IndexInput datIn ; private final ReaderIterator idx ; protected final long fp ; private final int size ; private final int valueCount ; private int pos = - 1 ; public DerefBytesEnum ( AttributeSource source , IndexInput datIn , IndexInput idxIn , int size ) throws IOException { } protected DerefBytesEnum ( AttributeSource source , IndexInput datIn , IndexInput idxIn , int size , Type enumType ) throws IOException { } protected void copyReferences ( DocValuesEnum valuesEnum ) { } @ Override public int advance ( int target ) throws IOException { } @ Override public int nextDoc ( ) throws IOException { <START_BUG> if ( ( pos ) < ( valueCount ) ) { <END_BUG> return pos = NO_MORE_DOCS ; } return advance ( ( ( pos ) + 1 ) ) ; } public void close ( ) throws IOException { } protected void fill ( long address , BytesRef ref ) throws IOException { } @ Override public int docID ( ) { } } @ Override public Type type ( ) { } } }

Fix:
if ( ( pos ) >= ( valueCount ) ) {
Buggy code:
public class ProgressCanvasViewer extends AbstractProgressViewer { Canvas canvas ; Object [ ] displayedItems = new Object [ 0 ] ; private static final List EMPTY_LIST = new ArrayList ( ) ; private FontMetrics fontMetrics ; private int numShowItems = 1 ; private int maxCharacterWidth ; ProgressCanvasViewer ( Composite parent , int style , int itemsToShow , int numChars ) { } protected void hookControl ( Control control ) { } protected Widget doFindInputItem ( Object element ) { } protected Widget doFindItem ( Object element ) { } protected void doUpdateItem ( Widget item , Object element , boolean fullMap ) { } protected List getSelectionFromWidget ( ) { } protected void internalRefresh ( Object element ) { } public void reveal ( Object element ) { } protected void setSelectionToWidget ( List l , boolean reveal ) { } public Control getControl ( ) { } private void initializeListeners ( ) { } public void setLabelProvider ( IBaseLabelProvider labelProvider ) { } public Point getSizeHints ( ) { Display display = canvas . getDisplay ( ) ; <START_BUG> GC gc = new GC ( display ) ; <END_BUG> FontMetrics fm = gc . getFontMetrics ( ) ; int charWidth = fm . getAverageCharWidth ( ) ; int charHeight = fm . getHeight ( ) ; int maxWidth = ( display . getBounds ( ) . width ) // 2 ; int maxHeight = ( display . getBounds ( ) . height ) // 6 ; int fontWidth = charWidth * ( maxCharacterWidth ) ; int fontHeight = charHeight * ( numShowItems ) ; if ( maxWidth < fontWidth ) fontWidth = maxWidth ; if ( maxHeight < fontHeight ) fontHeight = maxHeight ; gc . dispose ( ) ; return new Point ( fontWidth , fontHeight ) ; } public void add ( Object [ ] elements ) { } public void remove ( Object [ ] elements ) { } }

Fix:
GC gc = new GC ( canvas ) ;