nus-yam/ex-repair huggingface dataset:
Buggy code:
public class EFSRemoteFileSystemBrowseFactory implements IRemoteFileSystemBrowserFactory { public IRemoteFileSystemBrowser newInstance ( ) { return new IRemoteFileSystemBrowser ( ) { public Namespace getBrowseNamespace ( ) { return IDFactory . getDefault ( ) . getNamespaceByName ( PROTOCOL ) ; } public IRemoteFileSystemRequest sendBrowseRequest ( IFileID directoryOrFileID , IRemoteFileSystemListener listener ) throws RemoteFileSystemException { Assert . isNotNull ( directoryOrFileID ) ; Assert . isNotNull ( listener ) ; URL efsDirectory = null ; FileStoreBrowser fsb = null ; try { efsDirectory = directoryOrFileID . getURL ( ) ; final String path = StringUtils . replaceAll ( efsDirectory . getPath ( ) , "<seq2seq4repair_space>" , "%20" ) ; fsb = new FileStoreBrowser ( EFS . getStore ( new URL ( path ) . toURI ( ) ) , efsDirectory , directoryOrFileID , listener ) ; } catch ( final Exception e ) { throw new RemoteFileSystemException ( e ) ; } <START_BUG> return fsb . sendDirectoryRequest ( ) ; <END_BUG> } public Object getAdapter ( Class adapter ) { return null ; } } ; } }

Fix:
return fsb . sendBrowseRequest ( ) ;
Buggy code:
public class ServerAndClientTimeFilter implements IResponseFilter { private static final Logger log = LoggerFactory . getLogger ( ServerAndClientTimeFilter . class ) ; public AppendingStringBuffer filter ( AppendingStringBuffer responseBuffer ) { int headIndex = responseBuffer . indexOf ( "<head>" ) ; int bodyIndex = responseBuffer . indexOf ( "<//body>" ) ; long timeTaken = ( System . currentTimeMillis ( ) ) - ( RequestCycle . get ( ) . getStartTime ( ) ) ; if ( ( headIndex != ( - 1 ) ) && ( bodyIndex != ( - 1 ) ) ) { Map < String , String > map = new HashMap < String , String > ( 4 ) ; map . put ( "clienttime" , "'<seq2seq4repair_space>+<seq2seq4repair_space>(new<seq2seq4repair_space>Date().getTime()<seq2seq4repair_space>-<seq2seq4repair_space>clientTimeVariable)//1000<seq2seq4repair_space>+<seq2seq4repair_space>'s" ) ; map . put ( "servertime" , ( ( ( ( double ) ( timeTaken ) ) // 1000 ) + "s" ) ) ; AppendingStringBuffer defaultValue = new AppendingStringBuffer ( 128 ) ; defaultValue . append ( "Server<seq2seq4repair_space>parsetime:<seq2seq4repair_space>" ) ; defaultValue . append ( ( ( ( double ) ( timeTaken ) ) // 1000 ) ) ; defaultValue . append ( "s,<seq2seq4repair_space>Client<seq2seq4repair_space>parsetime:<seq2seq4repair_space>'<seq2seq4repair_space>+<seq2seq4repair_space>(new<seq2seq4repair_space>Date().getTime()<seq2seq4repair_space>-<seq2seq4repair_space>clientTimeVariable)//1000<seq2seq4repair_space>+<seq2seq4repair_space>'s" ) ; <START_BUG> String txt = Application . get ( ) . getResourceSettings ( ) . getLocalizer ( ) . getString ( "ServerAndClientTimeFilter.statustext" , null , Model . of ( map ) , defaultValue . toString ( ) ) ; <END_BUG> AppendingStringBuffer endScript = new AppendingStringBuffer ( 150 ) ; endScript . append ( "\n" ) . append ( SCRIPT_OPEN_TAG ) ; endScript . append ( "\nwindow.defaultStatus=\'" ) ; endScript . append ( txt ) ; endScript . append ( "\';\n" ) . append ( SCRIPT_CLOSE_TAG ) . append ( "\n" ) ; responseBuffer . insert ( ( bodyIndex - 1 ) , endScript ) ; responseBuffer . insert ( ( headIndex + 6 ) , ( ( ( ( "\n" + ( JavascriptUtils . SCRIPT_OPEN_TAG ) ) + "\nvar<seq2seq4repair_space>clientTimeVariable<seq2seq4repair_space>=<seq2seq4repair_space>new<seq2seq4repair_space>Date().getTime();\n" ) + ( JavascriptUtils . SCRIPT_CLOSE_TAG ) ) + "\n" ) ) ; } ServerAndClientTimeFilter . log . info ( ( ( ( ( timeTaken + "ms<seq2seq4repair_space>server<seq2seq4repair_space>time<seq2seq4repair_space>taken<seq2seq4repair_space>for<seq2seq4repair_space>request<seq2seq4repair_space>" ) + ( RequestCycle . get ( ) . getRequest ( ) . getURL ( ) ) ) + "<seq2seq4repair_space>response<seq2seq4repair_space>size:<seq2seq4repair_space>" ) + ( responseBuffer . length ( ) ) ) ) ; return responseBuffer ; } }

Fix:
String txt = Application . get ( ) . getResourceSettings ( ) . getLocalizer ( ) . getString ( "ServerAndClientTimeFilter.statustext" , null , Model . ofMap ( map ) , defaultValue . toString ( ) ) ;
Buggy code:
public abstract class EuObject implements Serializable { private Long id ; public Long getId ( ) { } public void setId ( Long id ) { } @ XmlID public String getIdForJaxb ( ) { <START_BUG> return ( ( getClass ( ) . toString ( ) ) + "_" ) + ( getId ( ) ) ; <END_BUG> } public void setIdForJaxb ( String id ) { } }

Fix:
return ( ( getClass ( ) . getSimpleName ( ) ) + "_" ) + ( getId ( ) ) ;
Buggy code:
@ RunWith ( JUnit4 . class ) public class CallsHandlingTest { private static OSGiHandler osgi ; private MockProtocolProvider sipProvider ; private static int roomNameCounter = 1 ; private String roomName ; private MockJvbConferenceFocus focus ; @ BeforeClass public static void setUpClass ( ) throws InterruptedException { } @ Before public void setUp ( ) { } @ After public void tearDown ( ) throws InterruptedException , TimeoutException { focus . tearDown ( ) ; CallManager . restartPool ( ) ; BundleContext ctx = JigasiBundleActivator . osgiContext ; <START_BUG> ServiceReference [ ] refs = ServiceUtils . getServiceReferences ( ctx , ProtocolProviderService . class ) ; <END_BUG> for ( ServiceReference ref : refs ) { ProtocolProviderService protoService = ( ( ProtocolProviderService ) ( ctx . getService ( ref ) ) ) ; if ( JABBER . equals ( protoService . getProtocolName ( ) ) ) { throw new RuntimeException ( ( protoService + "<seq2seq4repair_space>is<seq2seq4repair_space>still<seq2seq4repair_space>registered" ) ) ; } } } @ AfterClass public static void tearDownClass ( ) { } private String getTestRoomName ( ) { } public void testIncomingSipCall ( ) throws Exception { } public void testOutgoingSipCall ( ) throws InterruptedException , OperationFailedException , OperationNotSupportedException { } @ Test public void testMultipleTime ( ) throws Exception { } @ Test public void testFocusLeftTheRoom ( ) throws InterruptedException , TimeoutException , OperationFailedException , OperationNotSupportedException { } @ Test public void testXmppComponent ( ) throws Exception { } @ Test public void testDefaultJVbRoomProperty ( ) throws Exception { } @ Test public void testSimultaneousCalls ( ) throws Exception { } @ Test public void testNoFocusInTheRoom ( ) throws Exception { } }

Fix:
Collection < ServiceReference < ProtocolProviderService > > refs = ServiceUtils . getServiceReferences ( ctx , ProtocolProviderService . class ) ;
Buggy code:
public class ECFStartJob extends Job { IECFStart start ; public ECFStartJob ( String name , IECFStart start ) { } protected IStatus run ( IProgressMonitor monitor ) { <START_BUG> return start . start ( monitor ) ; <END_BUG> } }

Fix:
return start . startup ( monitor ) ;
Buggy code:
public class YearMonthDV extends AbstractDateTimeDV { public Object getActualValue ( String content , ValidationContext context ) throws InvalidDatatypeValueException { } protected DateTimeData parse ( String str ) throws SchemaDateTimeException { <START_BUG> DateTimeData date = new DateTimeData ( this ) ; <END_BUG> int len = str . length ( ) ; int end = getYearMonth ( str , 0 , len , date ) ; date . day = DAY ; parseTimeZone ( str , end , len , date ) ; validateDateTime ( date ) ; if ( ( ( date . utc ) != 0 ) && ( ( date . utc ) != 'Z' ) ) { normalize ( date ) ; } date . position = 0 ; return date ; } protected String dateToString ( DateTimeData date ) { } }

Fix:
DateTimeData date = new DateTimeData ( str , this ) ;
Buggy code:
public class SimpleMethodCallSelector < T > implements Selector < T > { private final MethodCall method ; private final QueryBuilder < ? > queryBuilder ; public SimpleMethodCallSelector ( QueryBuilder < ? > queryBuilder , MethodCall method ) { } @ Override public String createQueryFragment ( AtomicInteger incrementor ) { } @ Override public Parameter < T > generateParameter ( T value ) { <START_BUG> return TorpedoMagic . getTorpedoMethodHandler ( ) . handle ( new ParameterQueryHandler < T > ( method , value ) ) ; <END_BUG> } }

Fix:
return TorpedoMagic . getTorpedoMethodHandler ( ) . handle ( new ParameterQueryHandler < T > ( method . getParamName ( ) , value ) ) ;
Buggy code:
public class EntityProducer { @ ApplicationScoped @ Produces @ PersistenceContext public EntityManager getEntityManager ( ) { <START_BUG> return Persistence . createEntityManagerFactory ( ( "'" %= entityManager % ( + "'" ) ) ) . createEntityManager ( ) ; <END_BUG> } public void closeEntityManager ( @ Disposes EntityManager em ) { } }

Fix:
return Persistence . createEntityManagerFactory ( ( "'" %= persistenceName % ( + "'" ) ) ) . createEntityManager ( ) ;
Buggy code:
public final class ProcessController { private final Object lock = new Object ( ) ; private final Random rng ; private final ProtocolServer server ; private final Map < String , ManagedProcess > processes = new HashMap < String , ManagedProcess > ( ) ; private final Map < ProcessController . Key , ManagedProcess > processesByKey = new HashMap < ProcessController . Key , ManagedProcess > ( ) ; private final Set < Connection > managedConnections = new CopyOnWriteArraySet < Connection > ( ) ; private boolean shutdown ; private final PrintStream stdout ; private final PrintStream stderr ; public ProcessController ( final ProtocolServer . Configuration configuration , final PrintStream stdout , final PrintStream stderr ) throws IOException { } void addManagedConnection ( final Connection connection ) { } void removeManagedConnection ( final Connection connection ) { } public void addProcess ( final String processName , final List < String > command , final Map < String , String > env , final String workingDirectory , final boolean isPrivileged , final boolean respawn ) { } public void startProcess ( final String processName ) { } public void stopProcess ( final String processName ) { } public void removeProcess ( final String processName ) { } public void sendStdin ( final String recipient , final InputStream source ) throws IOException { } public void shutdown ( ) { synchronized ( lock ) { if ( shutdown ) { return ; } ProcessLogger . ROOT_LOGGER . shuttingDown ( ) ; shutdown = true ; final ManagedProcess hc = processes . get ( HOST_CONTROLLER_PROCESS_NAME ) ; <START_BUG> if ( ( ( hc != null ) && ( hc . isRunning ( ) ) ) && ( ! ( hc . isStopping ( ) ) ) ) { <END_BUG> hc . shutdown ( ) ; while ( processes . containsKey ( HOST_CONTROLLER_PROCESS_NAME ) ) { try { lock . wait ( ) ; } catch ( InterruptedException e ) { } } } for ( ManagedProcess process : processes . values ( ) ) { process . shutdown ( ) ; } while ( ! ( processes . isEmpty ( ) ) ) { try { lock . wait ( ) ; } catch ( InterruptedException e ) { } } ProcessLogger . ROOT_LOGGER . shutdownComplete ( ) ; } } public ManagedProcess getServerByAuthCode ( final byte [ ] code ) { } void processAdded ( final String processName ) { } void processStarted ( final String processName ) { } void processStopped ( final String processName , final long uptime ) { } void processRemoved ( final String processName ) { } void sendInventory ( ) { } public void sendReconnectProcess ( String processName , String hostName , int port , boolean managementSubsystemEndpoint , byte [ ] asAuthKey ) { } void operationFailed ( final String processName , final ProcessMessageHandler . OperationType operationType ) { } public ProtocolServer getServer ( ) { } PrintStream getStdout ( ) { } PrintStream getStderr ( ) { } private static final class Key { private final byte [ ] authKey ; private final int hashCode ; public Key ( final byte [ ] authKey ) { } public boolean equals ( Object other ) { } public boolean equals ( ProcessController . Key other ) { } public int hashCode ( ) { } } }

Fix:
if ( ( hc != null ) && ( hc . isRunning ( ) ) ) {
Buggy code:
public class ProjectPrerequisitesInstaller extends AbstractBuilder { @ DataBoundConstructor public ProjectPrerequisitesInstaller ( ) { } @ Override public boolean perform ( AbstractBuild < ? , ? > build , Launcher launcher , BuildListener listener ) throws IOException , InterruptedException { final PrintStream logger = listener . getLogger ( ) ; AndroidEmulator . log ( logger , Messages . FINDING_PROJECTS ( ) ) ; Collection < String > platforms = build . getWorkspace ( ) . act ( new ProjectPrerequisitesInstaller . ProjectPlatformFinder ( listener ) ) ; if ( ( platforms == null ) || ( platforms . isEmpty ( ) ) ) { AndroidEmulator . log ( logger , Messages . NO_PROJECTS_FOUND_FOR_PREREQUISITES ( ) ) ; return true ; } AndroidSdk androidSdk = getAndroidSdk ( build , launcher , listener ) ; if ( androidSdk == null ) { return false ; } AndroidEmulator . log ( logger , Messages . ENSURING_PLATFORMS_INSTALLED ( platforms ) ) ; for ( String platform : platforms ) { <START_BUG> SdkInstaller . installPlatform ( logger , launcher , androidSdk , platform , false ) ; <END_BUG> } return true ; } private static final class ProjectPlatformFinder implements FileCallable < Collection < String > > { private final BuildListener listener ; private transient PrintStream logger ; ProjectPlatformFinder ( BuildListener listener ) { } public Collection < String > invoke ( File workspace , VirtualChannel channel ) throws IOException , InterruptedException { } private static String getPlatformFromProjectFile ( PrintStream logger , File f ) { } private static final long serialVersionUID = 1L ; } @ Extension public static final class DescriptorImpl extends Descriptor < Builder > implements Serializable { private static final long serialVersionUID = 1L ; public DescriptorImpl ( ) { } @ Override public String getHelpFile ( ) { } @ Override public String getDisplayName ( ) { } } }

Fix:
SdkInstaller . installPlatform ( logger , launcher , androidSdk , platform , null ) ;
Buggy code:
public class GoProjectDiagram implements TreeModelPrereqs { public String toString ( ) { <START_BUG> return Localizer . localize ( "Tree" , "Project->Diagram" ) ; <END_BUG> } public Object getRoot ( ) { } public Object getChild ( Object parent , int index ) { } public int getChildCount ( Object parent ) { } public int getIndexOfChild ( Object parent , Object child ) { } public boolean isLeaf ( Object node ) { } public void valueForPathChanged ( TreePath path , Object newValue ) { } public void addTreeModelListener ( TreeModelListener l ) { } public void removeTreeModelListener ( TreeModelListener l ) { } public Vector getPrereqs ( ) { } public Vector getProvidedTypes ( ) { } }

Fix:
return Localizer . localize ( "Tree" , "misc.project.diagram" ) ;
Buggy code:
public class MyDrawing extends JPanel { private Cat cat ; public MyDrawing ( ) { } public void paintComponent ( Graphics g ) { } public static void main ( String [ ] args ) { JFrame frame = new JFrame ( ) ; frame . setContentPane ( new MyDrawing ( ) ) ; frame . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE ) ; <START_BUG> frame . setSize ( 800 , 800 ) ; <END_BUG> frame . setVisible ( true ) ; } }

Fix:
frame . setSize ( 1000 , 1000 ) ;
Buggy code:
public class Player extends PerPlayer { @ Override protected void init ( GL2 gl ) { } @ Override public void draw ( final GL2 gl , final RobotState player , final Camera camera ) { final SPLStandardMessage msg = player . getLastMessage ( ) ; <START_BUG> if ( msg != null ) { <END_BUG> gl . glPushMatrix ( ) ; if ( ( player . getPenalty ( ) ) != ( PlayerInfo . PENALTY_NONE ) ) { gl . glTranslatef ( ( - ( msg . playerNum ) ) , ( - 3.5F ) , 0 ) ; } else { gl . glTranslatef ( ( ( msg . pose [ 0 ] ) // 1000.0F ) , ( ( msg . pose [ 1 ] ) // 1000.0F ) , 0 ) ; gl . glRotatef ( ( ( float ) ( Math . toDegrees ( msg . pose [ 2 ] ) ) ) , 0 , 0 , 1 ) ; } if ( ( msg . fallenValid ) && ( msg . fallen ) ) { gl . glTranslatef ( 0 , 0 , 0.05F ) ; gl . glRotatef ( 90 , 0 , 1 , 0 ) ; } switch ( GameState . getInstance ( ) . getTeamColor ( player . getTeamNumber ( ) ) ) { case GameControlData . TEAM_BLUE : gl . glCallList ( RoSi2Loader . getInstance ( ) . loadModel ( gl , "robotBlue" ) ) ; break ; case GameControlData . TEAM_RED : gl . glCallList ( RoSi2Loader . getInstance ( ) . loadModel ( gl , "robotRed" ) ) ; break ; case GameControlData . TEAM_BLACK : gl . glCallList ( RoSi2Loader . getInstance ( ) . loadModel ( gl , "robotBlack" ) ) ; break ; case GameControlData . TEAM_YELLOW : gl . glCallList ( RoSi2Loader . getInstance ( ) . loadModel ( gl , "robotYellow" ) ) ; break ; } gl . glPopMatrix ( ) ; } } @ Override public boolean hasAlpha ( ) { } @ Override public int getPriority ( ) { } }

Fix:
if ( ( msg != null ) && ( msg . poseValid ) ) {
Buggy code:
public abstract class View extends JPanel implements ActionListener { private static final String STOP = "Stop" ; private static final String START = "Start" ; private static final String STARTED = "Started" ; private String title = "" ; protected Service service = null ; protected JPanel servicePanel = new JPanel ( ) ; private JPanel startStopbuttonPanel = new JPanel ( ) ; private JTextArea terminal = new JTextArea ( ) ; private JButton start = new JButton ( ) ; private JButton stop = new JButton ( ) ; public View ( String title ) { } public String getTitle ( ) { } private void setUpUI ( ) { } private void setUpStartStopButton ( ) { } private void setUpTerminal ( ) { } @ Override public void actionPerformed ( ActionEvent e ) { switch ( e . getActionCommand ( ) ) { case View . START : this . start . setEnabled ( false ) ; this . stop . setEnabled ( true ) ; this . service = this . createService ( ) ; this . start . setText ( View . STARTED ) ; Server . getInstance ( ) . addService ( this . service ) ; <START_BUG> this . service . addLogAppender ( new GUILogAppender ( this . terminal , null ) ) ; <END_BUG> break ; case View . STOP : Server . getInstance ( ) . removeService ( this . service ) ; try { service . join ( ) ; } catch ( InterruptedException e1 ) { e1 . printStackTrace ( ) ; } service = null ; this . start . setEnabled ( true ) ; this . stop . setEnabled ( false ) ; this . start . setText ( View . START ) ; break ; } } protected abstract Service createService ( ) { } }

Fix:
this . service . addLogAppender ( new GUILogAppender ( this . terminal ) ) ;
Buggy code:
public class PersistenceManager { public static final Logger log = LoggerFactory . getLogger ( PersistenceManager . class ) ; private PersistenceManager ( ) { } private static Session initHibernate ( ) { } public static void saveEvent ( Event event ) { } public static void saveClientRegistration ( ClientRegistration clientRegistration ) { } public static void saveSubscriptionRegistration ( SubscriptionRegistration subscriptionRegistration ) { Session session = PersistenceManager . initHibernate ( ) ; Transaction tx = session . beginTransaction ( ) ; <START_BUG> session . saveOrUpdate ( subscriptionRegistration ) ; <END_BUG> tx . commit ( ) ; } public static List < Event > listEvents ( ) { } public static boolean isEventExists ( String eventId ) { } public static String getExangeIdFromClientId ( String clientId ) { } public static boolean isAlreadyRegistered ( String clientName , String businessUnit , String eventId ) { } public static boolean isAlreadySubscribed ( String clientName , String businessUnit , String eventId ) { } public static String getQueueFromSubscriptionClientId ( String clientId ) { } public static void cleanUp ( ) { } public static String getRegistrationClientIdFromOtherDetails ( String clientId , String businessUnit ) { } public static ClientRegistration getPublishingClientFromClientId ( String clientId ) { } public static SubscriptionRegistration getSubscriptionClientFromSubscpriptionId ( String clientId ) { } }

Fix:
session . save ( subscriptionRegistration ) ;
Buggy code:
public class TldParsingDeploymentProcessor implements DeploymentUnitProcessor { private static final String TLD = ".tld" ; private static final String META_INF = "META-INF" ; private static final String WEB_INF = "WEB-INF" ; private static final String CLASSES = "classes" ; private static final String LIB = "lib" ; private static final String IMPLICIT_TLD = "implicit.tld" ; @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } @ Override public void undeploy ( final DeploymentUnit context ) { } private void processTlds ( VirtualFile root , List < VirtualFile > files , Map < String , TldMetaData > tlds , final List < TldMetaData > uniqueTlds ) throws DeploymentUnitProcessingException { } private TldMetaData parseTLD ( VirtualFile tld ) throws DeploymentUnitProcessingException { if ( TldParsingDeploymentProcessor . IMPLICIT_TLD . equals ( tld . getName ( ) ) ) { return new TldMetaData ( ) ; } InputStream is = null ; try { is = tld . openStream ( ) ; final XMLInputFactory inputFactory = XMLInputFactory . newInstance ( ) ; inputFactory . setXMLResolver ( NoopXMLResolver . create ( ) ) ; XMLStreamReader xmlReader = inputFactory . createXMLStreamReader ( is ) ; return TldMetaDataParser . parse ( xmlReader ) ; } catch ( XMLStreamException e ) { <START_BUG> throw new DeploymentUnitProcessingException ( ROOT_LOGGER . failToParseXMLDescriptor ( tld , e . getLocation ( ) . getLineNumber ( ) , e . getLocation ( ) . getColumnNumber ( ) ) , e ) ; <END_BUG> } catch ( IOException e ) { throw new DeploymentUnitProcessingException ( ROOT_LOGGER . failToParseXMLDescriptor ( tld ) , e ) ; } finally { try { if ( is != null ) { is . close ( ) ; } } catch ( IOException e ) { } } } }

Fix:
throw new DeploymentUnitProcessingException ( ROOT_LOGGER . failToParseXMLDescriptor ( tld , e . getLocation ( ) . getLineNumber ( ) , e . getLocation ( ) . getColumnNumber ( ) ) ) ;
Buggy code:
public class DefaultFileWatcherFactory implements Stoppable , FileWatcherFactory { private final ExecutorService executor ; private final JavaVersion javaVersion ; private final ClassLoader classLoader ; private final FileWatcherFactory fileWatcherFactory ; private static final Logger LOG = Logging . getLogger ( DefaultFileWatcherFactory . class ) ; private static class NoOpFileWatcherFactory implements FileWatcherFactory { @ Override public FileWatcher watch ( Iterable < ? extends File > roots , FileWatcherListener listener ) { } } public DefaultFileWatcherFactory ( ExecutorFactory executorFactory ) { } DefaultFileWatcherFactory ( JavaVersion javaVersion , ClassLoader classLoader , ExecutorFactory executorFactory ) { } protected FileWatcherFactory createFileWatcherFactory ( ) { if ( javaVersion . isJava7Compatible ( ) ) { Class clazz ; try { clazz = classLoader . loadClass ( "org.gradle.internal.filewatch.jdk7.Jdk7FileWatcherFactory" ) ; return Cast . uncheckedCast ( DirectInstantiator . instantiate ( clazz , executor ) ) ; } catch ( ClassNotFoundException e ) { <START_BUG> DefaultFileWatcherFactory . LOG . error ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>load<seq2seq4repair_space>JDK7<seq2seq4repair_space>class<seq2seq4repair_space>with<seq2seq4repair_space>a<seq2seq4repair_space>JDK7+<seq2seq4repair_space>JVM,<seq2seq4repair_space>falling<seq2seq4repair_space>back<seq2seq4repair_space>to<seq2seq4repair_space>no-op<seq2seq4repair_space>implementation." , e ) ; <END_BUG> } } DefaultFileWatcherFactory . LOG . debug ( "Using<seq2seq4repair_space>no-op<seq2seq4repair_space>file<seq2seq4repair_space>watcher<seq2seq4repair_space>service." ) ; return new DefaultFileWatcherFactory . NoOpFileWatcherFactory ( ) ; } @ Override public void stop ( ) { } @ Override public FileWatcher watch ( Iterable < ? extends File > roots , FileWatcherListener listener ) { } }

Fix:
DefaultFileWatcherFactory . LOG . error ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>load<seq2seq4repair_space>JDK7<seq2seq4repair_space>class<seq2seq4repair_space>with<seq2seq4repair_space>a<seq2seq4repair_space>JDK7+<seq2seq4repair_space>JVM,<seq2seq4repair_space>falling<seq2seq4repair_space>back<seq2seq4repair_space>to<seq2seq4repair_space>no-op<seq2seq4repair_space>implementation." ) ;
Buggy code:
public class NotificationUtils { private String TAG = NotificationUtils . class . getSimpleName ( ) ; private Context mContext ; public NotificationUtils ( ) { } public NotificationUtils ( Context mContext ) { } public void showNotificationMessage ( Intent intent ) { } private int getTaskIconByType ( String type ) { } public static boolean isAppIsInBackground ( Context context ) { boolean isInBackground = true ; ActivityManager am = ( ( ActivityManager ) ( context . getSystemService ( ACTIVITY_SERVICE ) ) ) ; if ( ( VERSION . SDK_INT ) > ( VERSION_CODES . KITKAT_WATCH ) ) { List < ActivityManager . RunningAppProcessInfo > runningProcesses = am . getRunningAppProcesses ( ) ; for ( ActivityManager . RunningAppProcessInfo processInfo : runningProcesses ) { if ( ( processInfo . importance ) == ( RunningAppProcessInfo . IMPORTANCE_FOREGROUND ) ) { for ( String activeProcess : processInfo . pkgList ) { if ( activeProcess . equals ( context . getPackageName ( ) ) ) { isInBackground = false ; } } } } } else { List < ActivityManager . RunningTaskInfo > taskInfo = am . getRunningTasks ( 1 ) ; ComponentName componentInfo = taskInfo . get ( 0 ) . topActivity ; if ( componentInfo . getPackageName ( ) . equals ( context . getPackageName ( ) ) ) { isInBackground = false ; } } <START_BUG> return isInBackground ; <END_BUG> } }

Fix:
return true ;
Buggy code:
public class OverviewMapFragment extends Fragment implements OnInfoWindowClickListener { private static final String TAG = OverviewMapFragment . class . getSimpleName ( ) ; private GoogleMap mMap ; private InstaMeetService service = null ; private OverviewMapFragment . ServiceListener listener = new OverviewMapFragment . ServiceListener ( ) ; private Map < Marker , SimpleUser > userMarker = new HashMap < Marker , SimpleUser > ( ) ; private Map < Marker , SimpleAppointment > nearAppMarker = new HashMap < Marker , SimpleAppointment > ( ) ; private Map < Marker , SimpleAppointment > myAppMarker = new HashMap < Marker , SimpleAppointment > ( ) ; private Map < Marker , SimpleAppointment > visitingAppMarker = new HashMap < Marker , SimpleAppointment > ( ) ; @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onCreateOptionsMenu ( Menu menu , MenuInflater inflater ) { } @ Override public void onAttach ( Activity activity ) { } @ Override public void onDetach ( ) { } @ Override public void onResume ( ) { } private void setUpMapIfAvailable ( ) { } private void setUpMap ( ) { } @ Override public void onInfoWindowClick ( Marker marker ) { Intent intent ; if ( userMarker . containsKey ( marker ) ) { intent = new Intent ( getActivity ( ) , ViewUserActivity . class ) ; intent . putExtra ( EXTRA_USER_ID , userMarker . get ( marker ) . getId ( ) ) ; } else { intent = new Intent ( getActivity ( ) , ViewAppointmentActivity . class ) ; if ( myAppMarker . containsKey ( marker ) ) { intent . putExtra ( EXTRA_APPOINTMENT_ID , myAppMarker . get ( marker ) . getId ( ) ) ; } else if ( visitingAppMarker . containsKey ( marker ) ) { intent . putExtra ( EXTRA_APPOINTMENT_ID , visitingAppMarker . get ( marker ) . getId ( ) ) ; } else if ( nearAppMarker . containsKey ( marker ) ) { <START_BUG> intent . putExtra ( EXTRA_APPOINTMENT_ID , visitingAppMarker . get ( marker ) . getId ( ) ) ; <END_BUG> } } startActivity ( intent ) ; } private class ServiceListener extends AbstractInboundMessageListener { @ Override public void listFriends ( ) { } @ Override public void listNearAppointments ( ) { } @ Override public void listVisitingAppointments ( ) { } @ Override public void appointment ( ) { } } private ServiceConnection serviceConnection = new ServiceConnection ( ) { @ Override public void onServiceConnected ( ComponentName className , IBinder binder ) { } @ Override public void onServiceDisconnected ( ComponentName arg0 ) { } } ; }

Fix:
intent . putExtra ( EXTRA_APPOINTMENT_ID , nearAppMarker . get ( marker ) . getId ( ) ) ;
Buggy code:
public class LongLiteral extends NumberLiteral { long value ; static final Constant FORMAT_ERROR = new DoubleConstant ( ( 1.0 // 0.0 ) ) ; public LongLiteral ( char [ ] token , int s , int e ) { } public LongLiteral ( char [ ] token , int s , int e , long value ) { } public void computeConstant ( ) { int length = ( source . length ) - 1 ; long computedValue ; if ( ( source [ 0 ] ) == '0' ) { if ( length == 1 ) { <START_BUG> constant = Constant . fromValue ( 0 ) ; <END_BUG> return ; } final int shift ; final int radix ; int j ; if ( ( ( source [ 1 ] ) == 'x' ) | ( ( source [ 1 ] ) == 'X' ) ) { shift = 4 ; j = 2 ; radix = 16 ; } else { shift = 3 ; j = 1 ; radix = 8 ; } int nbDigit = 0 ; while ( ( source [ j ] ) == '0' ) { j ++ ; if ( j == length ) { constant = Constant . fromValue ( ( value = 0L ) ) ; return ; } } int digitValue ; if ( ( digitValue = Character . digit ( source [ ( j ++ ) ] , radix ) ) < 0 ) { constant = LongLiteral . FORMAT_ERROR ; return ; } if ( digitValue >= 8 ) nbDigit = 4 ; else if ( digitValue >= 4 ) nbDigit = 3 ; else if ( digitValue >= 2 ) nbDigit = 2 ; else nbDigit = 1 ; computedValue = digitValue ; while ( j < length ) { if ( ( digitValue = Character . digit ( source [ ( j ++ ) ] , radix ) ) < 0 ) { constant = LongLiteral . FORMAT_ERROR ; return ; } if ( ( nbDigit += shift ) > 64 ) return ; computedValue = ( computedValue << shift ) | digitValue ; } } else { long previous = computedValue = 0 ; for ( int i = 0 ; i < length ; i ++ ) { int digitValue ; if ( ( digitValue = Character . digit ( source [ i ] , 10 ) ) < 0 ) return ; previous = computedValue ; computedValue = ( 10 * computedValue ) + digitValue ; if ( previous > computedValue ) return ; } } constant = Constant . fromValue ( ( value = computedValue ) ) ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public TypeBinding literalType ( BlockScope scope ) { } public final boolean mayRepresentMIN_VALUE ( ) { } public TypeBinding resolveType ( BlockScope scope ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope scope ) { } }

Fix:
constant = Constant . fromValue ( 0L ) ;
Buggy code:
public class RedirectViewTests { @ Test ( expected = IllegalArgumentException . class ) public void noUrlSet ( ) throws Exception { } @ Test public void http11 ( ) throws Exception { } @ Test public void explicitStatusCodeHttp11 ( ) throws Exception { } @ Test public void explicitStatusCodeHttp10 ( ) throws Exception { } @ Test public void attributeStatusCodeHttp11 ( ) throws Exception { } @ Test public void flashMap ( ) throws Exception { RedirectView rv = new RedirectView ( ) ; rv . setUrl ( "http:////url.somewhere.com//path" ) ; rv . setHttp10Compatible ( false ) ; MockHttpServletRequest request = new MockHttpServletRequest ( ) ; MockHttpServletResponse response = new MockHttpServletResponse ( ) ; FlashMap flashMap = new FlashMap ( ) ; flashMap . put ( "successMessage" , "yay!" ) ; request . setAttribute ( OUTPUT_FLASH_MAP_ATTRIBUTE , flashMap ) ; ModelMap model = new ModelMap ( "id" , "1" ) ; rv . render ( model , request , response ) ; assertEquals ( 303 , response . getStatus ( ) ) ; assertEquals ( "http:////url.somewhere.com//path?id=1" , response . getHeader ( "Location" ) ) ; assertEquals ( "//path" , flashMap . getTargetRequestPath ( ) ) ; <START_BUG> assertEquals ( model , flashMap . getTargetRequestParams ( ) ) ; <END_BUG> } @ Test public void emptyMap ( ) throws Exception { } @ Test public void emptyMapWithContextRelative ( ) throws Exception { } @ Test public void singleParam ( ) throws Exception { } @ Test public void singleParamWithoutExposingModelAttributes ( ) throws Exception { } @ Test public void paramWithAnchor ( ) throws Exception { } @ Test public void contextRelativeQueryParam ( ) throws Exception { } @ Test public void twoParams ( ) throws Exception { } @ Test public void arrayParam ( ) throws Exception { } @ Test public void collectionParam ( ) throws Exception { } @ Test public void objectConversion ( ) throws Exception { } private void doTest ( Map < String , ? > map , String url , boolean contextRelative , String expectedUrlForEncoding ) throws Exception { } private void doTest ( final Map < String , ? > map , final String url , final boolean contextRelative , final boolean exposeModelAttributes , String expectedUrlForEncoding ) throws Exception { } }

Fix:
assertEquals ( model , flashMap . getTargetRequestParams ( ) . toSingleValueMap ( ) ) ;
Buggy code:
public class Sequence implements Serializable { private static final long serialVersionUID = 1L ; private Universe universe ; private List < TimeStep > timeLine = new ArrayList < TimeStep > ( ) ; private List < SquibGroup > squibGroups = new ArrayList < SquibGroup > ( ) ; private String projectName = "Temp<seq2seq4repair_space>Name" ; private String projectDetails = "Temp<seq2seq4repair_space>Details" ; public Sequence ( ) { } public Sequence ( Universe universe ) { } private void mergeTimelines ( ) { } private void insertBlanks ( int squibGroupNum , int numTimesteps ) { } private int insertRatePadding ( int rate , int squibGroup ) { int insertedTimesteps = 0 ; TimeStep blankTimestep = new TimeStep ( ) ; for ( int i = 0 ; i > ( ( rate - 10 ) * 2 ) ; i -- ) { validate ( blankTimestep ) ; <START_BUG> timeLine . add ( blankTimestep ) ; <END_BUG> insertedTimesteps ++ ; } return insertedTimesteps ; } public int loadUniverseSweep ( Universe universe , int rate , int squibGroup ) { } public int loadRandomOneAtATimeSequence ( Universe universe , int rate , int squibGroup ) { } public int loadRandomOneAtATimeSequence ( Universe universe , int numTimeSteps , int rate , int squibGroup ) { } public int loadRandomOnePerFireboxSequence ( Universe universe , int numTimeSteps , int rate , int squibGroup ) { } public int loadUniverseZigZag ( Universe universe , int rate , int squibGroup ) { } public int loadUniverseSimultaneousSweep ( Universe universe , int rate , int squibGroup ) { } public int loadUniverseAlternate ( Universe universe ) { } public Object [ ] validate ( TimeStep timeStep ) { } public String getProjectName ( ) { } public void setProjectName ( String projectName ) { } public String getProjectDetails ( ) { } public void setProjectDetails ( String projectDetails ) { } public Universe getUniverse ( ) { } public void setUniverse ( Universe universe ) { } public List < TimeStep > getTimeLine ( ) { } public void setTimeLine ( List < TimeStep > timeLine ) { } public List < SquibGroup > getSquibGroups ( ) { } public void setSquibGroups ( List < SquibGroup > squibGroups ) { } }

Fix:
squibGroups . get ( squibGroup ) . getTimeLine ( ) . add ( blankTimestep ) ;
Buggy code:
public class ShoppingListDetailFragment extends FragmentWithViewModel implements ShoppingListDetailsViewModel . Listener { public static final String EXTRA_SHOPPINGLISTID = "extra_ShoppingListId" ; private static final int VOICE_RECOGNITION_REQUEST_CODE = 1234 ; @ InjectView ( id . textView_ShoppingListName ) TextView textView_ShoppingListName ; @ InjectView ( id . create_calendar_event ) View button_CreateCalendarEvent ; @ InjectView ( id . edit_calendar_event ) View button_EditCalendarEvent ; @ InjectView ( id . micButton ) ImageButton micButton ; private ShoppingListDetailsViewModel viewModel ; private boolean updatingViewModel = false ; public static ShoppingListDetailFragment newInstance ( ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onResume ( ) { } @ Override public void onDestroy ( ) { } @ Override public void onNameChanged ( String value ) { } @ Override public void onFinish ( ) { } @ OnTextChanged ( id . textView_ShoppingListName ) public void textView_ShoppingListName_OnTextChanged ( CharSequence s ) { } @ Override public void onActivityResult ( int requestCode , int resultCode , Intent data ) { super . onActivityResult ( requestCode , resultCode , data ) ; getActivity ( ) ; <START_BUG> if ( requestCode == ( ShoppingListDetailFragment . VOICE_RECOGNITION_REQUEST_CODE ) ) { <END_BUG> List < String > results = data . getStringArrayListExtra ( EXTRA_RESULTS ) ; String spokenText = results . get ( 0 ) ; textView_ShoppingListName . setText ( spokenText ) ; } } private void initializeViewModel ( ) { } }

Fix:
if ( ( requestCode == ( ShoppingListDetailFragment . VOICE_RECOGNITION_REQUEST_CODE ) ) && ( resultCode == ( getActivity ( ) . RESULT_OK ) ) ) {
Buggy code:
public class Point { public static final Point ZERO = new Point ( ) ; public Point ( ) { } public final void apply ( Matrix m ) { } public Point ( float x , float y ) { } public Point ( Point point ) { } public final float x ( ) { } public final float y ( ) { } public final void setTo ( float x , float y ) { } public final void clear ( ) { } public final void setTo ( final Point source ) { } public final float magnitude ( ) { <START_BUG> return ( ( x ) * ( x ) ) + ( ( y ) * ( y ) ) ; <END_BUG> } public final void add ( Point point ) { } @ Override public String toString ( ) { } public String toStringAsInts ( ) { } public String dumpUnlabelled ( ) { } public float x ; public float y ; }

Fix:
return ( ( float ) ( Math . sqrt ( ( ( ( x ) * ( x ) ) + ( ( y ) * ( y ) ) ) ) ) ) ;
Buggy code:
public class LocalFacade { private LocalManager manager ; public LocalFacade ( LocalManager manager ) { } public ArrayList < PackagedInscription > fetchAll ( ) { } public ArrayList < PackagedInscription > fetchNearby ( Location location , double radius ) { } public ArrayList < PackagedInscription > fetchUnblocked ( ) { } public ArrayList < PackagedInscription > fetchNearbyUnblocked ( Location location , double radius ) { } public ArrayList < PackagedInscription > fetchWithinCity ( String cityName ) { } public ArrayList < PackagedInscription > textSearch ( String text , Language lingo ) { } public ArrayList < PackagedInscription > getPackagesByIds ( int [ ] ids ) { <START_BUG> return manager . getPackagesByIds ( ids ) ; <END_BUG> } public void insertInscriptions ( ArrayList < PackagedInscription > packagedInscriptions ) { } public void setEncounteredTrue ( int id ) { } public void setEncounteredFalse ( int id ) { } public void setOpenedTrue ( int id ) { } public void setOpenedFalse ( int id ) { } public void setFoundTrue ( int id ) { } public void setFoundFalse ( int id ) { } public void setNeverNotifyTrue ( int id ) { } public void setNeverNotifyFalse ( int id ) { } public void setTimeoutLimit ( int id , Date date ) { } public void removeTimeoutLimit ( int id ) { } public void setDateFound ( int id , Date date ) { } public void removeDateFound ( int id ) { } public void setDateLastNotified ( int id , Date date ) { } public void removeDateLastNotified ( int id ) { } public void resetAllPreferences ( ) { } public void dumpAll ( ) { } public void seedDatabase ( ) { } public void dumpTranslations ( ) { } }

Fix:
return manager . getPackagesByIds ( int [ ] :: ids ) ;
Buggy code:
public class TestBrazilianStemmer extends BaseTokenStreamTestCase { public void testWithSnowballExamples ( ) throws Exception { } public void testNormalization ( ) throws Exception { } public void testReusableTokenStream ( ) throws Exception { } public void testStemExclusionTable ( ) throws Exception { } public void testWithKeywordAttribute ( ) throws IOException { } private void check ( final String input , final String expected ) throws Exception { } private void checkReuse ( Analyzer a , String input , String expected ) throws Exception { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , new BrazilianAnalyzer ( TEST_VERSION_CURRENT ) , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } public void testEmptyTerm ( ) throws IOException { } }

Fix:
checkRandomData ( random ( ) , new BrazilianAnalyzer ( TEST_VERSION_CURRENT ) , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class Beaver extends Proletariat { private BeaverTask task ; private boolean reached ; private MapLocation buildLoc ; public Beaver ( RobotController rc ) throws GameActionException { } private BeaverTask getNextTask ( ) throws GameActionException { } @ Override public void run ( ) throws GameActionException { super . run ( ) ; rc . setIndicatorString ( 1 , ( "My<seq2seq4repair_space>task<seq2seq4repair_space>is:<seq2seq4repair_space>" + ( task ) ) ) ; if ( rc . isCoreReady ( ) ) { RobotInfo robAtBuildLoc = null ; if ( ( buildLoc ) != null ) { robAtBuildLoc = rc . senseRobotAtLocation ( buildLoc ) ; } if ( ( ( buildLoc ) == null ) || ( ( robAtBuildLoc != null ) && ( robAtBuildLoc . type . isBuilding ) ) ) { int count = rc . readBroadcast ( buildPathCount ) ; if ( count < ( rc . readBroadcast ( buildPathLength ) ) ) { buildLoc = getLocation ( ( count + ( Channels . buildPath ) ) ) ; rc . broadcast ( buildPathCount , ( count + 1 ) ) ; } } this . setDestination ( buildLoc ) ; rc . setIndicatorString ( 0 , ( "My<seq2seq4repair_space>build<seq2seq4repair_space>loc:<seq2seq4repair_space>" + ( buildLoc ) ) ) ; if ( ! ( reached ) ) { rc . setIndicatorString ( 1 , ( "HERE,<seq2seq4repair_space>trying<seq2seq4repair_space>to<seq2seq4repair_space>go<seq2seq4repair_space>to:<seq2seq4repair_space>" + ( buildLoc ) ) ) ; if ( ( ( rc . getLocation ( ) . x ) == ( buildLoc . x ) ) && ( ( rc . getLocation ( ) . y ) == ( buildLoc . y ) ) ) { reached = true ; } else if ( ( rc . getLocation ( ) . distanceSquaredTo ( buildLoc ) ) <= 2 ) { reached = true ; } else { <START_BUG> moveTowardsFacing ( ) ; <END_BUG> } } if ( reached ) { if ( build ( ) ) { task = getNextTask ( ) ; reached = false ; return ; } else { moveTowardsFacing ( ) ; } } } } private void moveTowardsFacing ( ) throws GameActionException { } private boolean build ( ) throws GameActionException { } private RobotType getTaskBuildType ( BeaverTask task ) { } }

Fix:
bug ( ) ;
Buggy code:
public class EjbResourceInjectionAnnotationProcessor implements DeploymentUnitProcessor { private static final DotName EJB_ANNOTATION_NAME = DotName . createSimple ( EJB . class . getName ( ) ) ; private static final Logger logger = Logger . getLogger ( EjbResourceInjectionAnnotationProcessor . class ) ; public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } public void undeploy ( DeploymentUnit context ) { } private void processField ( final EEModuleDescription eeModuleDescription , final EjbResourceInjectionAnnotationProcessor . EJBResourceWrapper annotation , final FieldInfo fieldInfo ) { final String fieldName = fieldInfo . name ( ) ; final String injectionType = ( ( isEmpty ( annotation . beanInterface ( ) ) ) || ( annotation . beanInterface ( ) . equals ( Object . class . getName ( ) ) ) ) ? fieldInfo . type ( ) . name ( ) . toString ( ) : annotation . beanInterface ( ) ; final InjectionTarget targetDescription = new org . jboss . as . ee . component . FieldInjectionTarget ( fieldInfo . declaringClass ( ) . name ( ) . toString ( ) , fieldName , injectionType ) ; final String localContextName = ( isEmpty ( annotation . name ( ) ) ) ? ( ( fieldInfo . declaringClass ( ) . name ( ) . toString ( ) ) + "//" ) + ( fieldInfo . name ( ) ) : annotation . name ( ) ; <START_BUG> process ( eeModuleDescription , targetDescription . getClassName ( ) , annotation . beanName ( ) , annotation . lookup ( ) , fieldInfo . declaringClass ( ) , targetDescription , localContextName ) ; <END_BUG> } private void processMethod ( final EEModuleDescription eeModuleDescription , final EjbResourceInjectionAnnotationProcessor . EJBResourceWrapper annotation , final MethodInfo methodInfo ) { } private void processClass ( final EEModuleDescription eeModuleDescription , final EjbResourceInjectionAnnotationProcessor . EJBResourceWrapper annotation , final ClassInfo classInfo ) throws DeploymentUnitProcessingException { } private void process ( final EEModuleDescription eeModuleDescription , final String beanInterface , final String beanName , final String lookup , final ClassInfo classInfo , final InjectionTarget targetDescription , final String localContextName ) { } private boolean isEmpty ( final String string ) { } private class EJBResourceWrapper { private final String name ; private final String beanInterface ; private final String beanName ; private final String lookup ; private final String description ; private EJBResourceWrapper ( final AnnotationInstance annotation ) { } private String name ( ) { } private String beanInterface ( ) { } private String beanName ( ) { } private String lookup ( ) { } private String description ( ) { } private String stringValueOrNull ( final AnnotationInstance annotation , final String attribute ) { } private String classValueOrNull ( final AnnotationInstance annotation , final String attribute ) { } } }

Fix:
process ( eeModuleDescription , targetDescription . getDeclaredValueClassName ( ) , annotation . beanName ( ) , annotation . lookup ( ) , fieldInfo . declaringClass ( ) , targetDescription , localContextName ) ;
Buggy code:
public abstract class LogMergePolicy extends MergePolicy { public static final double LEVEL_LOG_SPAN = 0.75 ; public static final int DEFAULT_MERGE_FACTOR = 10 ; public static final int DEFAULT_MAX_MERGE_DOCS = Integer . MAX_VALUE ; public static final double DEFAULT_NO_CFS_RATIO = 0.1 ; protected int mergeFactor = LogMergePolicy . DEFAULT_MERGE_FACTOR ; protected long minMergeSize ; protected long maxMergeSize ; protected int maxMergeDocs = LogMergePolicy . DEFAULT_MAX_MERGE_DOCS ; protected double noCFSRatio = LogMergePolicy . DEFAULT_NO_CFS_RATIO ; protected boolean calibrateSizeByDeletes = true ; protected boolean useCompoundFile = true ; public LogMergePolicy ( ) { } protected boolean verbose ( ) { } public double getNoCFSRatio ( ) { } public void setNoCFSRatio ( double noCFSRatio ) { } protected void message ( String message ) { } public int getMergeFactor ( ) { } public void setMergeFactor ( int mergeFactor ) { } @ Override public boolean useCompoundFile ( SegmentInfos infos , SegmentInfo mergedInfo ) throws IOException { } public void setUseCompoundFile ( boolean useCompoundFile ) { } public boolean getUseCompoundFile ( ) { } public void setCalibrateSizeByDeletes ( boolean calibrateSizeByDeletes ) { } public boolean getCalibrateSizeByDeletes ( ) { } @ Override public void close ( ) { } protected abstract long size ( SegmentInfo info ) throws IOException { } protected long sizeDocs ( SegmentInfo info ) throws IOException { } protected long sizeBytes ( SegmentInfo info ) throws IOException { <START_BUG> long byteSize = info . sizeInBytes ( ) ; <END_BUG> if ( calibrateSizeByDeletes ) { int delCount = writer . get ( ) . numDeletedDocs ( info ) ; double delRatio = ( ( info . docCount ) <= 0 ) ? 0.0F : ( ( float ) ( delCount ) ) // ( ( float ) ( info . docCount ) ) ; assert delRatio <= 1.0 ; return ( info . docCount ) <= 0 ? byteSize : ( ( long ) ( byteSize * ( 1.0 - delRatio ) ) ) ; } else { return byteSize ; } } protected boolean isOptimized ( SegmentInfos infos , int maxNumSegments , Set < SegmentInfo > segmentsToOptimize ) throws IOException { } protected boolean isOptimized ( SegmentInfo info ) throws IOException { } private MergeSpecification findMergesForOptimizeSizeLimit ( SegmentInfos infos , int maxNumSegments , int last ) throws IOException { } private MergeSpecification findMergesForOptimizeMaxNumSegments ( SegmentInfos infos , int maxNumSegments , int last ) throws IOException { } @ Override public MergeSpecification findMergesForOptimize ( SegmentInfos infos , int maxNumSegments , Set < SegmentInfo > segmentsToOptimize ) throws IOException { } @ Override public MergeSpecification findMergesToExpungeDeletes ( SegmentInfos segmentInfos ) throws IOException , CorruptIndexException { } @ Override public MergeSpecification findMerges ( SegmentInfos infos ) throws IOException { } public void setMaxMergeDocs ( int maxMergeDocs ) { } public int getMaxMergeDocs ( ) { } @ Override public String toString ( ) { } }

Fix:
long byteSize = info . sizeInBytes ( true ) ;