nus-yam/ex-repair huggingface dataset:
Buggy code:
public class WeightedOverlap implements SignatureComparison { public double compare ( SemSig v1 , SemSig v2 , boolean sortedNormalized ) { } public double compare ( TIntFloatMap v1 , TIntFloatMap v2 , boolean sorted ) { } public static double compareSmallerWithBigger ( TIntSet overlaps , int [ ] v1 , int [ ] v2 ) { double nominator = 0 ; double normalization = 0 ; if ( overlaps . isEmpty ( ) ) return 0 ; TIntIntMap indexToPosition1 = new TIntIntHashMap ( overlaps . size ( ) ) ; TIntIntMap indexToPosition2 = new TIntIntHashMap ( overlaps . size ( ) ) ; for ( int i = 0 ; i < ( v1 . length ) ; ++ i ) indexToPosition1 . put ( v1 [ i ] , i ) ; for ( int i = 0 ; i < ( v2 . length ) ; ++ i ) <START_BUG> indexToPosition1 . put ( v2 [ i ] , i ) ; <END_BUG> int i = 1 ; TIntIterator iter = overlaps . iterator ( ) ; while ( iter . hasNext ( ) ) { int overlap = iter . next ( ) ; nominator += 1.0 // ( ( ( indexToPosition1 . get ( overlap ) ) + 1 ) + ( ( indexToPosition2 . get ( overlap ) ) + 1 ) ) ; normalization += 1.0 // ( 2 * i ) ; i ++ ; } if ( ( nominator == 0 ) || ( normalization == 0 ) ) return 0 ; return ( ( double ) ( nominator ) ) // normalization ; } private static Set < Integer > getOverlap ( List < Integer > v1 , List < Integer > v2 ) { } public static double compare ( TIntSet overlaps , int [ ] v1 , int [ ] v2 ) { } }

Fix:
indexToPosition2 . put ( v2 [ i ] , i ) ;
Buggy code:
public class ClientPlugin extends AbstractUIPlugin implements ClientPluginConstants { public static final String PLUGIN_ID = "org.eclipse.ecf.example.collab" ; private static ClientPlugin plugin ; private ResourceBundle resourceBundle ; private static URL pluginLocation ; private ImageRegistry registry = null ; private FontRegistry fontRegistry = null ; private ServerStartup serverStartup = null ; private DiscoveryStartup discoveryStartup = null ; public static URL getPluginTopLocation ( ) { } public static void log ( String message ) { } public static void log ( String message , Throwable e ) { } public ClientPlugin ( ) { } protected void setPreferenceDefaults ( ) { } class ClientStartupJob extends Job { public ClientStartupJob ( String name ) { } protected IStatus run ( IProgressMonitor monitor ) { } } public void start ( BundleContext context ) throws Exception { } protected synchronized void initDiscovery ( ) throws Exception { } protected synchronized void initServer ( ) throws Exception { } protected synchronized boolean isDiscoveryActive ( ) { } protected synchronized boolean isServerActive ( ) { } protected synchronized void disposeDiscovery ( ) { } protected synchronized void disposeServer ( ) { } public void stop ( BundleContext context ) throws Exception { } public FontRegistry getFontRegistry ( ) { } public Shell getActiveShell ( ) { } protected ImageRegistry createImageRegistry ( ) { } public static ClientPlugin getDefault ( ) { } public static String getResourceString ( String key ) { } public ResourceBundle getResourceBundle ( ) { try { if ( ( resourceBundle ) == null ) <START_BUG> resourceBundle = ResourceBundle . getBundle ( "org.eclipse.ecf.example.collab.ClientPluginResources" ) ; <END_BUG> } catch ( MissingResourceException x ) { resourceBundle = null ; } return resourceBundle ; } }

Fix:
resourceBundle = ResourceBundle . getBundle ( "org.eclipse.ecf.example.collab.ClientPlugin" ) ;
Buggy code:
public class DistanceActivity extends Activity { TextView dec_tv ; TextView speed_tv ; WheelView cen ; WheelView dec ; WheelView unit ; Button confirm_bt ; Button cancel_bt ; int curCenItemIndex ; int curDecItemIndex ; int curUnitItemIndex ; int curCen ; int curDec ; double curUnit ; String [ ] digits ; String [ ] dpoints ; String Unit ; String Distance ; SharedPreferences settingPref ; Editor settingPrefEdt ; @ Override public void onCreate ( Bundle savedInstanceState ) { } String [ ] initArray ( int size , int start ) { } String [ ] initArray ( int size , double start , double gap ) { } String getUnit ( ) { } String getDistance ( ) { String str = settingPref . getString ( "Distance" , "0" ) ; <START_BUG> Log . i ( "getDistance()" , Distance ) ; <END_BUG> int pos = str . indexOf ( "<seq2seq4repair_space>" ) ; if ( pos != ( - 1 ) ) { return str . substring ( 0 , pos ) ; } return str ; } String calculateDistance ( ) { } String doubleStringFormation ( String target ) { } int findIndex ( String s ) { } void initWheelValueIndex ( ) { } public class DateArrayAdapter extends ArrayWheelAdapter < String > { int currentItem ; int currentValue ; public DateArrayAdapter ( Context context , String [ ] items , int current ) { } @ Override protected void configureTextView ( TextView view ) { } @ Override public View getItem ( int index , View cachedView , ViewGroup parent ) { } } }

Fix:
Log . i ( "getDistance()" , str ) ;
Buggy code:
public class DateTimeHelper { private static final String TAG = "DateTimeHelper" ; private static Calendar cal ( ) { } public static BelltimesJson bells ; public static int getDateOffset ( ) { } public static String getGuessedDateString ( ) { <START_BUG> return String . format ( "%4d-%2d-%2d" , new Integer [ ] { DateTimeHelper . getYear ( ) , ( DateTimeHelper . getMonth ( ) ) + 1 , ( ( DateTimeHelper . getDate ( ) ) + ( DateTimeHelper . getDateOffset ( ) ) ) + ( DateTimeHelper . needsMidnightCountdown ( ) ? 1 : 0 ) } ) ; <END_BUG> } public static String getDateString ( Context optionalCon ) { } public static boolean needsMidnightCountdown ( ) { } public static long milliSecondsUntilNextEvent ( ) { } public static int getDay ( ) { } public static int getHour ( ) { } public static int getMinute ( ) { } public static int getYear ( ) { } public static int getMonth ( ) { } public static int getDate ( ) { } public static long getTimeMillis ( ) { } public static String formatToCountdown ( long millis ) { } }

Fix:
return String . format ( "%4d-%2d-%2d" , DateTimeHelper . getYear ( ) , ( ( DateTimeHelper . getMonth ( ) ) + 1 ) , ( ( ( DateTimeHelper . getDate ( ) ) + ( DateTimeHelper . getDateOffset ( ) ) ) + ( DateTimeHelper . needsMidnightCountdown ( ) ? 1 : 0 ) ) ) ;
Buggy code:
public enum ObjectHolderRegistry { INSTANCE ; private List < ObjectHolderRef > objectHolders = Lists . newArrayList ( ) ; public void findObjectHolders ( ASMDataTable table ) { } private void scanTarget ( Map < String , String > classModIds , Map < String , Class < ? > > classCache , String className , String annotationTarget , String value , boolean isClass , boolean extractFromValue ) { Class < ? > clazz ; if ( classCache . containsKey ( className ) ) { clazz = classCache . get ( className ) ; } else { try { <START_BUG> clazz = Class . forName ( className , true , getClass ( ) . getClassLoader ( ) ) ; <END_BUG> classCache . put ( className , clazz ) ; } catch ( Exception ex ) { throw Throwables . propagate ( ex ) ; } } if ( isClass ) { scanClassForFields ( classModIds , className , value , clazz , extractFromValue ) ; } else { if ( ( value . indexOf ( ':' ) ) == ( - 1 ) ) { String prefix = classModIds . get ( className ) ; if ( prefix == null ) { FMLLog . warning ( "Found<seq2seq4repair_space>an<seq2seq4repair_space>unqualified<seq2seq4repair_space>ObjectHolder<seq2seq4repair_space>annotation<seq2seq4repair_space>(%s)<seq2seq4repair_space>without<seq2seq4repair_space>a<seq2seq4repair_space>modid<seq2seq4repair_space>context<seq2seq4repair_space>at<seq2seq4repair_space>%s.%s,<seq2seq4repair_space>ignoring" , value , className , annotationTarget ) ; throw new IllegalStateException ( "Unqualified<seq2seq4repair_space>reference<seq2seq4repair_space>to<seq2seq4repair_space>ObjectHolder" ) ; } value = ( prefix + ":" ) + value ; } try { Field f = clazz . getField ( annotationTarget ) ; addHolderReference ( new ObjectHolderRef ( f , new ResourceLocation ( value ) , extractFromValue ) ) ; } catch ( Exception ex ) { throw Throwables . propagate ( ex ) ; } } } private void scanClassForFields ( Map < String , String > classModIds , String className , String value , Class < ? > clazz , boolean extractFromExistingValues ) { } private void addHolderReference ( ObjectHolderRef ref ) { } public void applyObjectHolders ( ) { } }

Fix:
clazz = Class . forName ( className , extractFromValue , getClass ( ) . getClassLoader ( ) ) ;
Buggy code:
public class EmbeddedServerFactory { private EmbeddedServerFactory ( ) { } public static StandaloneServer create ( final ModuleLoader moduleLoader , final File jbossHomeDir , final Properties systemProps , final Map < String , String > systemEnv ) { try { final ModuleIdentifier serverModuleId = ModuleIdentifier . create ( "org.jboss.as.server" ) ; final Module serverModule = moduleLoader . loadModule ( serverModuleId ) ; final ModuleClassLoader serverModuleClassLoader = serverModule . getClassLoader ( ) ; Class < ? > embeddedStandAloneServerFactoryClass = serverModuleClassLoader . loadClass ( "org.jboss.as.server.EmbeddedStandAloneServerFactory" ) ; Method createMethod = embeddedStandAloneServerFactoryClass . getMethod ( "create" , File . class , ModuleLoader . class , Properties . class , Map . class ) ; final StandaloneServer standaloneServer = ( ( StandaloneServer ) ( createMethod . invoke ( null , jbossHomeDir , moduleLoader , systemProps , systemEnv ) ) ) ; return standaloneServer ; } catch ( ModuleLoadException e ) { <START_BUG> throw new RuntimeException ( e ) ; <END_BUG> } catch ( ClassNotFoundException e ) { throw new RuntimeException ( e ) ; } catch ( NoSuchMethodException e ) { throw new RuntimeException ( e ) ; } catch ( InvocationTargetException e ) { throw new RuntimeException ( e ) ; } catch ( IllegalAccessException e ) { throw new RuntimeException ( e ) ; } } public static StandaloneServer create ( final File jbossHomeDir , final Properties systemProps , final Map < String , String > systemEnv , String ... systemPackages ) { } @ Deprecated public static void main ( String [ ] args ) throws Throwable { } }

Fix:
throw new RuntimeException ( ( ( ( e . getMessage ( ) ) + "<seq2seq4repair_space>in<seq2seq4repair_space>" ) + moduleLoader ) , e ) ;
Buggy code:
public class CombinedDataTableModel implements TableModel { StructuredDataMessage doc = null ; @ Override public int getRowCount ( ) { } @ Override public int getColumnCount ( ) { } @ Override public String getColumnName ( int columnIndex ) { } @ Override public Class < ? > getColumnClass ( int columnIndex ) { } @ Override public boolean isCellEditable ( int rowIndex , int columnIndex ) { } @ Override public Object getValueAt ( int rowIndex , int columnIndex ) { StructuredDataSet ds = doc . getStructuredDataSet ( 0 ) ; <START_BUG> return ds . getDecoratedValue ( rowIndex , columnIndex ) . toString ( ) ; <END_BUG> } @ Override public void setValueAt ( Object aValue , int rowIndex , int columnIndex ) { } List < TableModelListener > listeners = new ArrayList < TableModelListener > ( ) ; @ Override public void addTableModelListener ( TableModelListener l ) { } @ Override public void removeTableModelListener ( TableModelListener l ) { } public StructuredDataMessage getCombinedDataMessage ( ) { } public void setCombinedDataMessage ( StructuredDataMessage cds ) { } }

Fix:
return ds . getStructuredValue ( rowIndex , columnIndex ) . toString ( ) ;
Buggy code:
public class MainTest { @ BeforeClass public static void setUpClass ( ) { } @ AfterClass public static void tearDownClass ( ) { } @ Before public void setUp ( ) { } @ After public void tearDown ( ) { } @ Test public void testSomeMethod ( ) throws Exception { <START_BUG> Cli . main ( new String [ ] { "-p" , "target//test-classes//plugin" , "-r" , "TestResource" , "target//test-classes" } ) ; <END_BUG> } }

Fix:
Cli . main ( new String [ ] { "-f" , "-p" , "target//test-classes//plugin" , "-r" , "target//test-classes//TestResource.properties" , "target//test-classes" } ) ;
Buggy code:
public abstract class AttemptLoginStrategyDecorator implements IAuthorizationStrategy { private IAuthorizationStrategy delegate ; public AttemptLoginStrategyDecorator ( IAuthorizationStrategy delegate ) { } public final boolean isInstantiationAuthorized ( Class componentClass ) { } public final boolean isActionAuthorized ( Component component , Action action ) { } private boolean processResponse ( boolean isAuthorized ) { <START_BUG> if ( ( isAuthorized == false ) && ( ! ( isUserSignedIn ( ) ) ) ) { <END_BUG> throw new RestartResponseAtSignInPageException ( ) ; } return isAuthorized ; } protected abstract boolean isUserSignedIn ( ) { } }

Fix:
if ( ( isAuthorized == false ) && ( ( isUserSignedIn ( ) ) == false ) ) {
Buggy code:
public class RawTypeBinding extends ParameterizedTypeBinding { public RawTypeBinding ( ReferenceBinding type , ReferenceBinding enclosingType , LookupEnvironment environment ) { } public ParameterizedMethodBinding createParameterizedMethod ( MethodBinding originalMethod ) { } public String debugName ( ) { } public char [ ] genericTypeSignature ( ) { } public boolean isEquivalentTo ( TypeBinding otherType ) { } public boolean isParameterizedType ( ) { } public boolean isRawType ( ) { } protected void initializeArguments ( ) { } public char [ ] readableName ( ) { } public TypeBinding substitute ( TypeBinding originalType ) { if ( originalType . isTypeVariable ( ) ) { TypeVariableBinding originalVariable = ( ( TypeVariableBinding ) ( originalType ) ) ; ParameterizedTypeBinding currentType = this ; while ( true ) { TypeVariableBinding [ ] typeVariables = currentType . type . typeVariables ( ) ; int length = typeVariables . length ; if ( ( ( originalVariable . rank ) < length ) && ( ( typeVariables [ originalVariable . rank ] ) == originalVariable ) ) { if ( ( currentType . arguments ) == null ) currentType . initializeArguments ( ) ; if ( ( currentType . arguments ) != null ) return currentType . arguments [ originalVariable . rank ] ; } ReferenceBinding enclosing = currentType . enclosingType ( ) ; if ( ! ( enclosing instanceof ParameterizedTypeBinding ) ) break ; currentType = ( ( ParameterizedTypeBinding ) ( enclosing ) ) ; } } else if ( originalType . isParameterizedType ( ) ) { ParameterizedTypeBinding originalParameterizedType = ( ( ParameterizedTypeBinding ) ( originalType ) ) ; <START_BUG> return this . environment . createRawType ( originalParameterizedType . type , originalParameterizedType . enclosingType ) ; <END_BUG> } else if ( originalType . isGenericType ( ) ) { return this . environment . createRawType ( ( ( ReferenceBinding ) ( originalType ) ) , null ) ; } else if ( originalType . isArrayType ( ) ) { TypeBinding originalLeafComponentType = originalType . leafComponentType ( ) ; TypeBinding substitute = substitute ( originalLeafComponentType ) ; if ( substitute != originalLeafComponentType ) { return this . environment . createArrayType ( substitute . leafComponentType ( ) , ( ( substitute . dimensions ( ) ) + ( originalType . dimensions ( ) ) ) ) ; } } return originalType ; } public char [ ] shortReadableName ( ) { } }

Fix:
return this . environment . createRawType ( originalParameterizedType . type , originalParameterizedType . enclosingType ( ) ) ;
Buggy code:
abstract class VAJLocalUtil implements VAJUtil { private static Workspace workspace ; static Project getVAJProject ( String importProject ) { } static Workspace getWorkspace ( ) { } static BuildException createBuildException ( String errMsg , IvjException e ) { } public void exportPackages ( File dest , String [ ] includePatterns , String [ ] excludePatterns , boolean exportClasses , boolean exportDebugInfo , boolean exportResources , boolean exportSources , boolean useDefaultExcludes , boolean overwrite ) { } public void importFiles ( String importProject , File srcDir , String [ ] includePatterns , String [ ] excludePatterns , boolean importClasses , boolean importResources , boolean importSources , boolean useDefaultExcludes ) throws BuildException { } public void loadProjects ( Vector projectDescriptions ) { } private Vector getExpandedDescriptions ( Vector projectDescs ) { } private void addFilesToImport ( ImportCodeSpec spec , boolean doImport , Vector files , String fileType , StringBuffer summaryLog ) { if ( doImport ) { String [ ] fileArr = new String [ files . size ( ) ] ; files . copyInto ( fileArr ) ; try { String methodName = ( "set" + fileType ) + "Files" ; Class [ ] methodParams = new Class [ ] { fileArr . getClass ( ) } ; Method method = spec . getClass ( ) . getDeclaredMethod ( methodName , methodParams ) ; method . invoke ( spec , new Object [ ] { fileArr } ) ; } catch ( Exception e ) { <START_BUG> throw new BuildException ( e ) ; <END_BUG> } if ( ( files . size ( ) ) > 0 ) { logFiles ( files , fileType ) ; summaryLog . append ( files . size ( ) ) ; summaryLog . append ( ( ( "<seq2seq4repair_space>" + ( fileType . toLowerCase ( ) ) ) + "<seq2seq4repair_space>file" ) ) ; summaryLog . append ( ( ( files . size ( ) ) > 1 ? "s,<seq2seq4repair_space>" : ",<seq2seq4repair_space>" ) ) ; } } } private Vector findMatchingProjects ( String pattern ) { } private ProjectEdition findProjectEdition ( String name , String versionName ) { } private void logFiles ( Vector fileNames , String fileType ) { } private void scanForImport ( File dir , String [ ] files , Vector classes , Vector sources , Vector resources ) { } }

Fix:
throw new BuildException ( "Error" , e ) ;
Buggy code:
public interface JsonValidator { <START_BUG> boolean visit ( final JsonLeafInstance instance ) ; <END_BUG> }

Fix:
boolean visit ( final JsonInstance instance ) ;
Buggy code:
public class ThreadConnectionFT { public final String TABLE = ( this . getClass ( ) . getSimpleName ( ) ) + ( UUID . randomUUID ( ) . toString ( ) . replaceAll ( "-" , "_" ) ) ; protected final Logger logger = LoggerFactory . getLogger ( this . getClass ( ) ) ; public String CATALOG = "catalog_functional_test" ; protected String SERVER_KAFKA = "127.0.0.1" ; protected String PORT_KAFKA = "9092" ; protected String SERVER_ZOOKEEPER = "127.0.0.1" ; protected String PORT_ZOOKEEPER = "2181" ; protected Random random ; protected StreamingConnector sConnector ; protected boolean deleteBeteweenTest = true ; protected ClusterName getClusterName ( ) { } @ Test public void connectTest ( ) throws ConnectorException { } @ Test public void apiStreamingTest ( ) throws ConnectorException , StratioEngineConnectionException { <START_BUG> StratioStreamingAPI stratioStreamingAPI = ( ( StratioStreamingAPI ) ( StratioStreamingAPIFactory . create ( ) . withServerConfig ( "127.0.0.1" , 9092 , "127.0.0.1" , 2182 ) . init ( ) ) ) ; <END_BUG> waitSeconds ( 5 ) ; stratioStreamingAPI . close ( ) ; waitSeconds ( 5 ) ; StratioStreamingAPI stratioStreamingAPI2 = ( ( StratioStreamingAPI ) ( StratioStreamingAPIFactory . create ( ) . withServerConfig ( "127.0.0.1" , 9092 , "127.0.0.1" , 2181 ) . init ( ) ) ) ; waitSeconds ( 5 ) ; stratioStreamingAPI2 . close ( ) ; assertTrue ( true ) ; } protected void waitSeconds ( int sec ) { } protected IConfiguration getConfiguration ( ) { } protected ConnectorClusterConfig getConnectorClusterConfig ( ) { } protected ICredentials getICredentials ( ) { } }

Fix:
StratioStreamingAPI stratioStreamingAPI = ( ( StratioStreamingAPI ) ( StratioStreamingAPIFactory . create ( ) . withServerConfig ( "127.0.0.1" , 9092 , "127.0.0.1" , 2181 ) . init ( ) ) ) ;
Buggy code:
public class EhCachePathCache extends AbstractPathCache { private final String _repositoryId ; private final Ehcache _ec ; public EhCachePathCache ( final String repositoryId , final Ehcache cache ) { } protected String getRepositoryId ( ) { } protected Ehcache getEHCache ( ) { } public boolean doContains ( String key ) { } public boolean doIsExpired ( String key ) { } public void doPut ( String key , Object element , int expiration ) { } public boolean doRemove ( String key ) { } public boolean removeWithChildren ( String path ) { @ SuppressWarnings ( "unchecked" ) List < String > keys = getEHCache ( ) . getKeys ( ) ; String keyToRemove = makeKeyFromPath ( path ) ; boolean removed = false ; for ( String key : keys ) { if ( key . startsWith ( keyToRemove ) ) { <START_BUG> removed = removed || ( getEHCache ( ) . remove ( key ) ) ; <END_BUG> } } return removed ; } public boolean doPurge ( ) { } public CacheStatistics getStatistics ( ) { } @ SuppressWarnings ( "unchecked" ) public Collection < String > listKeysInCache ( ) { } @ Override protected String makeKeyFromPath ( String path ) { } protected String getKeyPrefix ( ) { } }

Fix:
removed = ( getEHCache ( ) . remove ( key ) ) || removed ;
Buggy code:
public class LperceptTrain { public static void train ( String dir , Random r ) throws IOException { Model model = new Model ( ) ; model . read ( ( ( dir + ( File . separatorChar ) ) + "model" ) ) ; LocalAveragedPerceptron lpton = new LocalAveragedPerceptron ( model , r ) ; Dataset train = ( ( Dataset ) ( new LRGraphMemoryDataset ( ( ( dir + ( File . separatorChar ) ) + "train" ) ) ) ) ; <START_BUG> System . out . println ( "starting<seq2seq4repair_space>training" ) ; <END_BUG> long start = System . currentTimeMillis ( ) ; Parameters params = lpton . train ( train ) ; long end = System . currentTimeMillis ( ) ; System . out . println ( ( ( "training<seq2seq4repair_space>time<seq2seq4repair_space>" + ( ( end - start ) // 1000.0 ) ) + "<seq2seq4repair_space>seconds" ) ) ; params . serialize ( ( ( dir + ( File . separatorChar ) ) + "params" ) ) ; } public static void train ( String dir ) throws IOException { } public static void main ( String [ ] args ) throws IOException { } }

Fix:
System . out . println ( "starting<seq2seq4repair_space>training<seq2seq4repair_space>m" ) ;
Buggy code:
public class GameScreen implements Screen { private Game game ; private Map currentMap ; private SpriteBatch batch = new SpriteBatch ( ) ; private ShapeRenderer shapeRenderer = new ShapeRenderer ( ) ; private Renderer renderer ; private MainController mainController ; private OrthographicCamera camera ; private FitViewport viewport ; public GameScreen ( Game g , Map map , Player player ) { } GameData gameData ; private void runDebugCode ( ) { <START_BUG> GameData . getInstance ( ) . setGameSpeed ( 1000 ) ; <END_BUG> } private void fixCamera ( ) { } @ Override public void show ( ) { } @ Override public void render ( float delta ) { } @ Override public void resize ( int width , int height ) { } @ Override public void pause ( ) { } @ Override public void resume ( ) { } @ Override public void hide ( ) { } @ Override public void dispose ( ) { } }

Fix:
GameData . getInstance ( ) . setGameSpeed ( 1 ) ;
Buggy code:
public class QueryKey implements Externalizable { private static Collection s_unmod = new HashSet ( ) ; private String _candidateClassName ; private boolean _subclasses ; private Set _accessPathClassNames ; private String _query ; private boolean _ignoreChanges ; private Map _params ; private long _rangeStart ; private long _rangeEnd ; private int _timeout = - 1 ; public static QueryKey newInstance ( Query q ) { } public static QueryKey newInstance ( Query q , Object [ ] args ) { } public static QueryKey newInstance ( Query q , Map args ) { } static QueryKey newInstance ( QueryContext q , boolean packed , Object [ ] args , Class candidate , boolean subs , long startIdx , long endIdx ) { } static QueryKey newInstance ( QueryContext q , boolean packed , Map args , Class candidate , boolean subs , long startIdx , long endIdx ) { } private static QueryKey createKey ( QueryContext q , boolean packed , Class candidateClass , boolean subclasses , long startIdx , long endIdx ) { } private static boolean setParams ( QueryKey key , QueryContext q , Object [ ] args ) { if ( ( args == null ) || ( ( args . length ) == 0 ) ) return true ; <START_BUG> Map types = q . getParameterTypes ( ) ; <END_BUG> Map map = new HashMap ( ( ( int ) ( ( ( types . size ( ) ) * 1.33 ) + 1 ) ) ) ; int idx = 0 ; for ( Iterator iter = types . keySet ( ) . iterator ( ) ; iter . hasNext ( ) ; idx ++ ) map . put ( iter . next ( ) , args [ idx ] ) ; return QueryKey . setParams ( key , q . getStoreContext ( ) , map ) ; } private static boolean setParams ( QueryKey key , StoreContext ctx , Map params ) { } public QueryKey ( ) { } public String getCandidateTypeName ( ) { } public int getTimeout ( ) { } public boolean changeInvalidatesQuery ( Collection changed ) { } private static boolean intersects ( Collection names , Collection changed ) { } public boolean equals ( Object ob ) { } public int hashCode ( ) { } public String toString ( ) { } public void writeExternal ( ObjectOutput out ) throws IOException { } public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { } public Set < String > getAcessPathClassNames ( ) { } }

Fix:
Map types = q . getOrderedParameterTypes ( ) ;
Buggy code:
public class LinkedList implements List { private Object Listdata ; private LinkedList pointer ; @ Override public boolean isEmpty ( ) { <START_BUG> return ( pointer ) == null ? false : true ; <END_BUG> } @ Override public int size ( ) { } @ Override public ReturnObject get ( int index ) { } @ Override public ReturnObject remove ( int index ) { } @ Override public ReturnObject add ( int index , Object item ) { } @ Override public ReturnObject add ( Object item ) { } }

Fix:
return ( pointer ) == null ? true : false ;
Buggy code:
public class SparkApp { public static void main ( String [ ] args ) { <START_BUG> String namenode = String . format ( "tcp:////%s:50070" , System . getenv ( "NAMENODE_SERVICE_HOST" ) ) ; <END_BUG> Configuration configuration = new Configuration ( ) ; try { FileSystem hdfs = FileSystem . get ( new URI ( namenode ) , configuration ) ; } catch ( IOException | URISyntaxException e ) { e . printStackTrace ( ) ; } String rabbitmq_address = String . format ( "tcp:////%s:%s" , System . getenv ( "RABBITMQ_SERVICE_HOST" ) , System . getenv ( "RABBITMQ_SERVICE_PORT_MQTT" ) ) ; System . out . println ( ( "connecting<seq2seq4repair_space>to" + rabbitmq_address ) ) ; SparkConf conf = new SparkConf ( ) . setAppName ( "testApp" ) . setIfMissing ( "spark.master" , "local[*]" ) ; JavaStreamingContext ssc = new JavaStreamingContext ( conf , new Duration ( 1000 ) ) ; JavaReceiverInputDStream < String > receiverStream = MQTTUtils . createStream ( ssc , rabbitmq_address , "s1" , StorageLevel . MEMORY_ONLY ( ) ) ; receiverStream . print ( ) ; ssc . start ( ) ; ssc . awaitTermination ( ) ; ssc . stop ( ) ; } No newline ; at end ; of file ; }

Fix:
String namenode = String . format ( "hdfs:////%s:50070" , System . getenv ( "NAMENODE_SERVICE_HOST" ) ) ;
Buggy code:
public class UpdateChecker { private static final Logger LOGGER = Logger . getLogger ( UpdateChecker . class ) ; private static final String GITHUB_VERSION_PROPERTIES = "https:////raw.github.com//heussd//socio//master//src//main//resources//version.properties" ; public static boolean updateAvailable ( ) { Properties packagedProperties = new Properties ( ) ; Properties gitHubProperties = new Properties ( ) ; if ( Config . useProxy ( ) ) { System . setProperty ( "proxyPort" , ( "" + ( Config . getProxyPort ( ) ) ) ) ; System . setProperty ( "proxyHost" , Config . getProxyAddress ( ) ) ; } try { packagedProperties . load ( UpdateChecker . class . getClassLoader ( ) . getResourceAsStream ( "version.properties" ) ) ; gitHubProperties . load ( new URL ( UpdateChecker . GITHUB_VERSION_PROPERTIES ) . openStream ( ) ) ; <START_BUG> UpdateChecker . LOGGER . debug ( ( "This<seq2seq4repair_space>is<seq2seq4repair_space>version<seq2seq4repair_space>#" + ( packagedProperties . get ( "version" ) ) ) ) ; <END_BUG> if ( ! ( packagedProperties . get ( "version" ) . equals ( gitHubProperties . get ( "version" ) ) ) ) { UpdateChecker . LOGGER . warn ( ( "New<seq2seq4repair_space>version<seq2seq4repair_space>available:<seq2seq4repair_space>Version<seq2seq4repair_space>#" + ( gitHubProperties . get ( "version" ) ) ) ) ; UpdateChecker . LOGGER . warn ( "Please<seq2seq4repair_space>always<seq2seq4repair_space>use<seq2seq4repair_space>the<seq2seq4repair_space>newest<seq2seq4repair_space>stable<seq2seq4repair_space>version!" ) ; return true ; } } catch ( Exception e ) { UpdateChecker . LOGGER . error ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>check<seq2seq4repair_space>for<seq2seq4repair_space>updates:" , e ) ; } UpdateChecker . LOGGER . debug ( "No<seq2seq4repair_space>update<seq2seq4repair_space>available" ) ; return false ; } }

Fix:
UpdateChecker . LOGGER . info ( ( "This<seq2seq4repair_space>is<seq2seq4repair_space>version<seq2seq4repair_space>#" + ( packagedProperties . get ( "version" ) ) ) ) ;
Buggy code:
public class ExampleRunner { public static void main ( String [ ] args ) throws Exception { DeploymentUtils utils = null ; try { utils = new DeploymentUtils ( ) ; <START_BUG> utils . addWarDeployment ( "war-example.war" , SimpleServlet . class . getPackage ( ) , true ) ; <END_BUG> utils . deploy ( ) ; ExampleRunner . performCall ( "simple" ) ; ExampleRunner . performCall ( "legacy" ) ; } finally { utils . undeploy ( ) ; safeClose ( utils ) ; } } private static void performCall ( String urlPattern ) throws Exception { } }

Fix:
utils . addWarDeployment ( "war-example.war" , true , SimpleServlet . class . getPackage ( ) ) ;
Buggy code:
public class HomeFragment extends Fragment { public static final int DRINK_REQUEST_CODE = 0 ; private ArrayList < Drink > mDrinks ; private DrinkAdapter mDrinkAdapter ; @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onActivityResult ( int requestCode , int resultCode , Intent data ) { if ( ( requestCode != ( HomeFragment . DRINK_REQUEST_CODE ) ) || ( resultCode != ( Activity . RESULT_OK ) ) ) return ; <START_BUG> mDrinks . add ( new Drink ( data . getExtras ( ) . getString ( KEY_DRINK_NAME ) , data . getExtras ( ) . getInt ( KEY_CAFFEINE_AMOUNT ) ) ) ; <END_BUG> mDrinkAdapter . notifyDataSetChanged ( ) ; } }

Fix:
mDrinks . add ( new Drink ( data . getExtras ( ) . getString ( KEY_DRINK_NAME ) , data . getExtras ( ) . getInt ( KEY_CAFFEINE_AMOUNT ) , new Date ( ) ) ) ;
Buggy code:
@ Component public class DayStatsDAO { private static Logger logger = Logger . getLogger ( DayStatsDAO . class ) ; @ Autowired private DayStatsBaseDAO dayStatsBaseDAO ; @ Autowired ApplicationBaseDAO applicationBaseDAO ; @ Autowired ApplicationServiceBaseDAO applicationServiceBaseDAO ; @ Autowired ApplicationServiceMethodBaseDAO applicationServiceMethodBaseDAO ; public void saveOrUpdate ( DayStats ds ) { } public Map < String , List < StatsSum > > getDatas ( DubboInvoke dubboInvoke ) { } private List < StatsSum > getApplicationData ( List < DayStats > list ) { } private List < StatsSum > getServiceData ( List < DayStats > list ) { } private List < StatsSum > getMethodData ( List < DayStats > list ) { } public List < StatsTable > getStatsTableList ( DubboInvoke dubboInvoke ) { List < DayStats > list = dayStatsBaseDAO . getList ( dubboInvoke ) ; List < StatsTable > stList = new ArrayList < StatsTable > ( ) ; Map < Long , StatsTable > map = new HashMap < Long , StatsTable > ( ) ; StatsTable st ; for ( DayStats ds : list ) { st = map . get ( ds . getMethodId ( ) ) ; if ( st == null ) { st = new StatsTable ( ds ) ; map . put ( ds . getMethodId ( ) , st ) ; st . setAppName ( applicationBaseDAO . getNameById ( ds . getAppId ( ) ) ) ; <START_BUG> st . setServiceName ( applicationServiceBaseDAO . getApplicationServiceById ( ds . getAppId ( ) ) . getName ( ) ) ; <END_BUG> st . setMethodName ( applicationServiceMethodBaseDAO . getApplicationServiceMethodById ( ds . getMethodId ( ) ) . getName ( ) ) ; stList . add ( st ) ; } else { st . addDayStats ( ds ) ; } } Collections . sort ( stList ) ; return stList ; } }

Fix:
st . setServiceName ( applicationServiceBaseDAO . getApplicationServiceById ( ds . getServiceId ( ) ) . getName ( ) ) ;
Buggy code:
public class CompilationMXBeanReadResourceHandler implements OperationStepHandler { public static final CompilationMXBeanReadResourceHandler INSTANCE = new CompilationMXBeanReadResourceHandler ( ) ; private CompilationMXBeanReadResourceHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ModelNode result = context . getResult ( ) ; for ( String attribute : PlatformMBeanConstants . COMPILATION_READ_ATTRIBUTES ) { final ModelNode store = result . get ( attribute ) ; try { CompilationMXBeanAttributeHandler . storeResult ( attribute , store ) ; } catch ( UnsupportedOperationException ignored ) { } } for ( String attribute : PlatformMBeanConstants . COMPILATION_METRICS ) { final ModelNode store = result . get ( attribute ) ; try { CompilationMXBeanAttributeHandler . storeResult ( attribute , store ) ; } catch ( UnsupportedOperationException ignored ) { } } if ( ( PlatformMBeanUtil . JVM_MAJOR_VERSION ) > 6 ) { final ModelNode store = result . get ( OBJECT_NAME ) ; CompilationMXBeanAttributeHandler . storeResult ( OBJECT_NAME , store ) ; } <START_BUG> context . completeStep ( ) ; <END_BUG> } }

Fix:
context . completeStep ( NOOP_ROLLBACK_HANDLER ) ;
Buggy code:
public class ArbitrageBL { private ArrayList < ArbDetail > detail_list ; private ArrayList < ArbBrief > brief_list ; private ArrayList < ArbGroup > group_list ; private NetHelper helper ; public ArbitrageBL ( NetHelper netHelper ) { } public ArrayList < ArbDetail > getDetailList ( ) { detail_list = new ArrayList < ArbDetail > ( ) ; HashMap < String , String > params = new HashMap < String , String > ( ) ; helper . setInitPara ( "detail" , params ) ; JSONArray ret = helper . getJSONArrayByGet ( ) ; if ( ret == null ) { return null ; } for ( int i = 0 ; i < ( ret . length ( ) ) ; i ++ ) { JSONObject temp = ret . getJSONObject ( i ) ; ArbDetail detail = new ArbDetail ( ) ; String symbol = temp . getString ( "RT_CODE" ) ; int year = Integer . valueOf ( symbol . substring ( 2 , 4 ) ) ; int month = Integer . valueOf ( symbol . substring ( 4 , 6 ) ) ; String End = ( ( ( ( 20 + "" ) + year ) + "��" ) + month ) + "��" ; detail . setSymbol ( symbol ) ; detail . setMonth ( End ) ; detail . setDate ( End ) ; Calendar calendar = Calendar . getInstance ( ) ; calendar . setTime ( new Date ( ) ) ; String clockString = ( ( ( ( twoNumberFormat ( calendar . get ( Calendar . HOUR_OF_DAY ) ) ) + ":" ) + ( twoNumberFormat ( calendar . get ( Calendar . MINUTE ) ) ) ) + ":" ) + ( twoNumberFormat ( calendar . get ( Calendar . SECOND ) ) ) ; detail . setClock ( clockString ) ; detail . setPresentPrice ( temp . getDouble ( "RT_LAST" ) ) ; double change = format ( temp . getString ( "RT_PCT_CHG" ) ) ; detail . setChange ( change ) ; detail . setPriceChange ( temp . getDouble ( "RT_CHG" ) ) ; <START_BUG> detail . setBidPirce ( temp . getDouble ( "RT_BID1" ) ) ; <END_BUG> detail . setAskPrice ( temp . getDouble ( "RT_ASK1" ) ) ; detail . setBid ( temp . getInt ( "RT_BSIZE1" ) ) ; detail . setAsk ( temp . getInt ( "RT_ASIZE1" ) ) ; detail . setVol ( temp . getInt ( "RT_VOL" ) ) ; detail . setPreRepository ( temp . getInt ( "RT_PRE_OI" ) ) ; detail . setRepository ( temp . getInt ( "RT_OI" ) ) ; detail . setDailyWarehouse ( temp . getInt ( "RT_OI_CHG" ) ) ; detail . setPreClose ( temp . getDouble ( "RT_PRE_CLOSE" ) ) ; detail . setOpen ( temp . getDouble ( "RT_OPEN" ) ) ; detail . setHigh ( temp . getDouble ( "RT_HIGH" ) ) ; detail . setLow ( temp . getDouble ( "RT_LOW" ) ) ; detail . setFullAmount ( temp . getDouble ( "RT_AMT" ) ) ; detail . setPreSettlePrice ( temp . getDouble ( "RT_PRE_SETTLE" ) ) ; double swing = format ( temp . getString ( "RT_SWING" ) ) ; detail . setSwing ( swing ) ; detail . setHardenPrice ( temp . getDouble ( "RT_HIGH_LIMIT" ) ) ; detail . setLimitPrice ( temp . getDouble ( "RT_LOW_LIMIT" ) ) ; detail . setAverPrice ( temp . getDouble ( "RT_VWAP" ) ) ; detail_list . add ( detail ) ; } return detail_list ; } private String twoNumberFormat ( int i ) { } public ArrayList < ArbGroup > getArbGroups ( ) { } public double format ( String precent ) { } public ArrayList < ArbBrief > getBriefList ( String symbol ) { } }

Fix:
detail . setBidPrice ( temp . getDouble ( "RT_BID1" ) ) ;
Buggy code:
public interface ModelQueryOperationHandler extends OperationHandler { <START_BUG> Cancellable execute ( NewOperationContext context , ModelNode operation , ResultHandler resultHandler ) ; <END_BUG> }

Fix:
Cancellable execute ( OperationContext context , ModelNode operation , ResultHandler resultHandler ) ;
Buggy code:
public class Domain extends DefaultCommand implements Primitive { private OWLExtension extension = null ; public void setExtension ( OWLExtension extension ) { } @ Override public Syntax getSyntax ( ) { } @ Override public String getAgentClassString ( ) { } @ Override public void perform ( Argument [ ] args , Context context ) throws ExtensionException , LogoException { if ( ( extension ) == null ) { throw new ExtensionException ( "Bug:<seq2seq4repair_space>Extension<seq2seq4repair_space>not<seq2seq4repair_space>initialised<seq2seq4repair_space>properly<seq2seq4repair_space>(NetLogo//OWL<seq2seq4repair_space>extension<seq2seq4repair_space>fault)" ) ; } if ( ( extension . getModelIRI ( ) ) != null ) { throw new ExtensionException ( "You<seq2seq4repair_space>must<seq2seq4repair_space>declare<seq2seq4repair_space>owl:domain<seq2seq4repair_space>before<seq2seq4repair_space>declaring<seq2seq4repair_space>the<seq2seq4repair_space>owl:model<seq2seq4repair_space>IRI" ) ; } String link = args [ 0 ] . getString ( ) . toUpperCase ( ) ; String breed = args [ 1 ] . getString ( ) . toUpperCase ( ) ; Program program = context . getAgent ( ) . world ( ) . program ( ) ; <START_BUG> if ( ( ( ( program . linkBreeds ( ) . size ( ) ) > 0 ) && ( ! ( program . linkBreeds ( ) . containsKey ( link ) ) ) ) || ( ( ( ( program . linkBreeds ( ) . size ( ) ) == 0 ) && ( ! ( link . equals ( "LINKS" ) ) ) ) && ( ! ( link . equalsIgnoreCase ( LOCATION_PROPERTY ) ) ) ) ) { <END_BUG> throw new ExtensionException ( ( ( "No<seq2seq4repair_space>such<seq2seq4repair_space>link<seq2seq4repair_space>breed<seq2seq4repair_space>as<seq2seq4repair_space>\"" + link ) + "\"" ) ) ; } if ( ( ( ( program . breeds ( ) . size ( ) ) > 0 ) && ( ! ( program . breeds ( ) . containsKey ( breed ) ) ) ) || ( ( ( program . breeds ( ) . size ( ) ) == 0 ) && ( ! ( breed . equals ( "TURTLES" ) ) ) ) ) { throw new ExtensionException ( ( ( "No<seq2seq4repair_space>such<seq2seq4repair_space>breed<seq2seq4repair_space>as<seq2seq4repair_space>\"" + breed ) + "\"" ) ) ; } extension . setDomain ( link , breed ) ; } }

Fix:
if ( ( ( ( ( program . linkBreeds ( ) . size ( ) ) > 0 ) && ( ! ( program . linkBreeds ( ) . containsKey ( link ) ) ) ) && ( ! ( link . equalsIgnoreCase ( LOCATION_PROPERTY ) ) ) ) || ( ( ( ( program . linkBreeds ( ) . size ( ) ) == 0 ) && ( ! ( link . equals ( "LINKS" ) ) ) ) && ( ! ( link . equalsIgnoreCase ( LOCATION_PROPERTY ) ) ) ) ) {
Buggy code:
public class TestCompiler implements SampleListener , HashTreeTraverser { private static transient Logger log = LoggingManager . getLoggerForClass ( ) ; private LinkedList stack = new LinkedList ( ) ; private Map samplerConfigMap = new HashMap ( ) ; private HashTree testTree ; private static Set pairing = new HashSet ( ) ; List loopIterListeners = new ArrayList ( ) ; public TestCompiler ( HashTree testTree , JMeterVariables vars ) { } public static void initialize ( ) { } public void sampleOccurred ( SampleEvent e ) { } public void sampleStarted ( SampleEvent e ) { } public void sampleStopped ( SampleEvent e ) { } public SamplePackage configureSampler ( Sampler sampler ) { } private void runPreProcessors ( List preProcessors ) { } public void done ( SamplePackage pack ) { } public void addNode ( Object node , HashTree subTree ) { } public void subtractNode ( ) { } private void trackIterationListeners ( LinkedList stack ) { } public void processPath ( ) { } private void saveSamplerConfigs ( Sampler sam ) { } private void addDirectParentControllers ( List controllers , TestElement maybeController ) { if ( maybeController instanceof Controller ) { <START_BUG> TestCompiler . log . info ( ( ( "adding<seq2seq4repair_space>controller:<seq2seq4repair_space>" + maybeController ) + "<seq2seq4repair_space>to<seq2seq4repair_space>sampler<seq2seq4repair_space>config" ) ) ; <END_BUG> controllers . add ( maybeController ) ; } } public static class Test extends TestCase { public Test ( String name ) { } public void testConfigGathering ( ) throws Exception { } class TestSampler extends AbstractSampler { public SampleResult sample ( Entry e ) { } public Object clone ( ) { } } } private class ObjectPair { TestElement child ; TestElement parent ; public ObjectPair ( TestElement one , TestElement two ) { } public void addTestElements ( ) { } public int hashCode ( ) { } public boolean equals ( Object o ) { } } private void configureWithConfigElements ( Sampler sam , List configs ) { } }

Fix:
TestCompiler . log . debug ( ( ( "adding<seq2seq4repair_space>controller:<seq2seq4repair_space>" + maybeController ) + "<seq2seq4repair_space>to<seq2seq4repair_space>sampler<seq2seq4repair_space>config" ) ) ;
Buggy code:
public class LocationManager { private static final String [ ] NAMES = new String [ ] { "lobby" , "player" , "spectate" , "freddy" , "chica" , "bonnie" , "foxy" } ; private File file ; private HashMap < String , Location > arena ; private HashMap < String , HashMap < String , Location > > arenas ; private String arenaName ; private LocationManager ( File file ) { } public static LocationManager load ( File file ) { } public void save ( ) { } public void switchTo ( String arenaName ) { } private static void setLocationToSection ( ConfigurationSection section , Location location ) { } private static Location getLocationFromSection ( ConfigurationSection section ) { } public String getNullLocationName ( ) { } public Set < String > getArenaNames ( ) { } public ArrayList < String > getReadyArenaNames ( ) { } public String getArenaName ( ) { } public Location getLobby ( ) { } public void setLobby ( Location lobby ) { } public Location getPlayer ( ) { } public void setPlayer ( Location player ) { } public Location getSpectate ( ) { <START_BUG> return arena . get ( "spactate" ) ; <END_BUG> } public void setSpectate ( Location spectate ) { } public Location getFreddy ( ) { } public void setFreddy ( Location freddy ) { } public Location getChica ( ) { } public void setChica ( Location chica ) { } public Location getBonnie ( ) { } public void setBonnie ( Location bonnie ) { } public Location getFoxy ( ) { } public void setFoxy ( Location foxy ) { } }

Fix:
return arena . get ( "spectate" ) ;
Buggy code:
public class ModClusterAddCustomMetric implements OperationStepHandler { static final ModClusterAddCustomMetric INSTANCE = new ModClusterAddCustomMetric ( ) ; @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { PathAddress opAddress = PathAddress . pathAddress ( operation . get ( OP_ADDR ) ) ; PathAddress parent = opAddress . append ( DYNAMIC_LOAD_PROVIDER_PATH ) ; String name = CLASS . resolveModelAttribute ( context , operation ) . asString ( ) ; ModelNode targetOperation = Util . createAddOperation ( parent . append ( PathElement . pathElement ( CUSTOM_LOAD_METRIC_PATH . getKey ( ) , name ) ) ) ; for ( AttributeDefinition def : CustomLoadMetricDefinition . ATTRIBUTES ) { def . validateAndSet ( operation , targetOperation ) ; } <START_BUG> context . addStep ( targetOperation , CustomLoadMetricAdd . INSTANCE , IMMEDIATE ) ; <END_BUG> context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; } }

Fix:
context . addStep ( targetOperation , CustomLoadMetricAdd . INSTANCE , MODEL , true ) ;
Buggy code:
public class DocumentIndex implements Callable < Document > { private File file ; public DocumentIndex ( File file ) { } @ Override public Document call ( ) throws Exception { } private Document parseDocument ( File file ) { FileInputStream input = null ; Document doc = new Document ( ) ; try { input = new FileInputStream ( file ) ; } catch ( FileNotFoundException e ) { System . out . println ( "File<seq2seq4repair_space>not<seq2seq4repair_space>found" ) ; } BufferedReader reader = new BufferedReader ( new InputStreamReader ( input ) ) ; String newstext = "" ; try { String line = reader . readLine ( ) ; while ( line != null ) { <START_BUG> newstext += line ; <END_BUG> line = reader . readLine ( ) ; } reader . close ( ) ; } catch ( IOException e ) { System . out . println ( e . getMessage ( ) ) ; } doc . add ( new org . apache . lucene . document . Field ( "newstext" , newstext , TextField . TYPE_STORED ) ) ; doc . add ( new org . apache . lucene . document . Field ( "name" , ( ( ( file . getParentFile ( ) . getName ( ) ) + "//" ) + ( file . getName ( ) ) ) , TextField . TYPE_STORED ) ) ; return doc ; } }

Fix:
newstext += line + "\n" ;
Buggy code:
public abstract class IndexCommit implements IndexCommitPoint { public abstract String getSegmentsFileName ( ) { } public abstract Collection getFileNames ( ) throws IOException { } public abstract Directory getDirectory ( ) { } public void delete ( ) { } public boolean equals ( Object other ) { if ( other instanceof IndexCommit ) { IndexCommit otherCommit = ( ( IndexCommit ) ( other ) ) ; <START_BUG> return ( otherCommit . getDirectory ( ) . equals ( getDirectory ( ) ) ) && ( otherCommit . getSegmentsFileName ( ) . equals ( getSegmentsFileName ( ) ) ) ; <END_BUG> } else return false ; } public int hashCode ( ) { } public long getVersion ( ) { } public long getGeneration ( ) { } }

Fix:
return ( otherCommit . getDirectory ( ) . equals ( getDirectory ( ) ) ) && ( ( otherCommit . getVersion ( ) ) == ( getVersion ( ) ) ) ;
Buggy code:
class InMemoryAutoIncrementGenerator implements AutoIdGenerator { private static final Logger logger = Logger . getLogger ( InMemoryAutoIncrementGenerator . class ) ; private static final DataClusterPOJOPK DC = new DataClusterPOJOPK ( DC_CONF . getName ( ) ) ; private static final String [ ] IDS = new String [ ] { "AutoIncrement" } ; private static final String CONCEPT = "AutoIncrement" ; public static String AUTO_INCREMENT = "Auto_Increment" ; private static Properties CONFIGURATION = null ; private boolean wasInitCalled = false ; @ Override public synchronized String generateId ( String dataClusterName , String conceptName , String keyElementName ) { } @ Override public synchronized void saveState ( XmlServer server ) { try { String xmlString = Util . convertAutoIncrement ( InMemoryAutoIncrementGenerator . CONFIGURATION ) ; ItemPOJO pojo = new ItemPOJO ( InMemoryAutoIncrementGenerator . DC , InMemoryAutoIncrementGenerator . CONCEPT , InMemoryAutoIncrementGenerator . IDS , System . currentTimeMillis ( ) , xmlString ) ; pojo . setDataModelName ( DM_CONF . getName ( ) ) ; server . start ( DC_CONF . getName ( ) ) ; <START_BUG> pojo . store ( null ) ; <END_BUG> server . commit ( DC_CONF . getName ( ) ) ; } catch ( Exception e ) { try { server . rollback ( DC_CONF . getName ( ) ) ; } catch ( XtentisException e1 ) { InMemoryAutoIncrementGenerator . logger . error ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>rollback<seq2seq4repair_space>upon<seq2seq4repair_space>error." , e ) ; } InMemoryAutoIncrementGenerator . logger . error ( e . getLocalizedMessage ( ) , e ) ; } } @ Override public synchronized void init ( ) { } }

Fix:
pojo . store ( ) ;