nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Jdk11Compat { public static String getJavaVersion ( ) { } public static boolean isJava2 ( ) { } public ClassLoader newClassLoaderInstance ( URL [ ] urls , ClassLoader parent ) { } public Object getAccessControlContext ( ) throws Exception { } public Object doPrivileged ( Action action , Object acc ) throws Exception { } public void setContextClassLoader ( ClassLoader cl ) { } public void refreshPolicy ( ) { } public ClassLoader getContextClassLoader ( ) { } public ClassLoader getParentLoader ( ClassLoader cl ) { } public URL [ ] getURLs ( ClassLoader cl , int depth ) { int c = 0 ; do { while ( ( cl instanceof DependClassLoader ) && ( cl != null ) ) cl = ( ( DependClassLoader ) ( cl ) ) . getParentLoader ( ) ; if ( depth == c ) return ( ( SimpleClassLoader ) ( cl ) ) . getURLs ( ) ; c ++ ; cl = ( ( SimpleClassLoader ) ( cl ) ) . getParentLoader ( ) ; <START_BUG> } while ( ( cl != null ) && ( depth < c ) ) ; <END_BUG> return null ; } public ResourceBundle getBundle ( String name , Locale loc , ClassLoader cl ) { } public static Jdk11Compat getJdkCompat ( ) { } public static final String JAVA_1_0 = "1.0" ; public static final String JAVA_1_1 = "1.1" ; public static final String JAVA_1_2 = "1.2" ; public static final String JAVA_1_3 = "1.3" ; static String javaVersion ; static boolean java2 = false ; static Jdk11Compat compat ; static final String JAVA2_SUPPORT = "org.apache.tomcat.util.compat.Jdk12Support" ; private static void init ( ) { } }

Fix:
} while ( ( cl != null ) && ( depth >= c ) ) ;
Buggy code:
final class XMPPSConnectWizardPage extends XMPPConnectWizardPage { XMPPSConnectWizardPage ( ) { } public void createControl ( Composite parent ) { parent . setLayout ( new GridLayout ( ) ) ; GridData fillData = new GridData ( SWT . FILL , SWT . CENTER , true , false ) ; GridData endData = new GridData ( SWT . FILL , SWT . CENTER , true , false , 2 , 1 ) ; Label label = new Label ( parent , SWT . LEFT ) ; label . setText ( "Connect<seq2seq4repair_space>ID:" ) ; connectText = new org . eclipse . swt . widgets . Text ( parent , ( ( SWT . SINGLE ) | ( SWT . BORDER ) ) ) ; connectText . setLayoutData ( fillData ) ; connectText . addModifyListener ( new ModifyListener ( ) { public void modifyText ( ModifyEvent e ) { if ( ! ( connectText . getText ( ) . equals ( "" ) ) ) { updateStatus ( null ) ; } else { updateStatus ( "An<seq2seq4repair_space>connect<seq2seq4repair_space>ID<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>specified." ) ; } } } ) ; label = new Label ( parent , SWT . RIGHT ) ; <START_BUG> label . setText ( "xmpps:////<user>@<xmppserver>[:port]" ) ; <END_BUG> label . setLayoutData ( endData ) ; label = new Label ( parent , SWT . LEFT ) ; label . setText ( "Password:" ) ; passwordText = new org . eclipse . swt . widgets . Text ( parent , ( ( ( SWT . SINGLE ) | ( SWT . PASSWORD ) ) | ( SWT . BORDER ) ) ) ; passwordText . setLayoutData ( fillData ) ; setControl ( parent ) ; } }

Fix:
label . setText ( "<user>@<xmppserver>[:port]" ) ;
Buggy code:
public class PostfixExpression extends Expression { public static class Operator { private String token ; private Operator ( String token ) { } public String toString ( ) { } public static final PostfixExpression . Operator INCREMENT = new PostfixExpression . Operator ( "++" ) ; public static final PostfixExpression . Operator DECREMENT = new PostfixExpression . Operator ( "--" ) ; private static final Map CODES ; public static PostfixExpression . Operator toOperator ( String token ) { } } public static final SimplePropertyDescriptor OPERATOR_PROPERTY = new SimplePropertyDescriptor ( PostfixExpression . class , "operator" , PostfixExpression . Operator . class , ASTNode . MANDATORY ) ; public static final ChildPropertyDescriptor OPERAND_PROPERTY = new ChildPropertyDescriptor ( PostfixExpression . class , "operand" , Expression . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private PostfixExpression . Operator operator = PostfixExpression . Operator . INCREMENT ; private Expression operand = null ; PostfixExpression ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final Object internalGetSetObjectProperty ( SimplePropertyDescriptor property , boolean get , Object value ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public PostfixExpression . Operator getOperator ( ) { } public void setOperator ( PostfixExpression . Operator operator ) { } public Expression getOperand ( ) { if ( ( this . operand ) == null ) { <START_BUG> synchronized ( this . ast ) { <END_BUG> if ( ( this . operand ) == null ) { preLazyInit ( ) ; this . operand = new SimpleName ( this . ast ) ; postLazyInit ( this . operand , PostfixExpression . OPERAND_PROPERTY ) ; } } } return this . operand ; } public void setOperand ( Expression expression ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
synchronized ( this ) {
Buggy code:
public final class ComponentInstallProcessor implements DeploymentUnitProcessor { private static final Logger logger = Logger . getLogger ( ComponentInstallProcessor . class ) ; private static class IntHolder { private int value ; } public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } protected void deployComponent ( final DeploymentPhaseContext phaseContext , final ComponentConfiguration configuration ) throws DeploymentUnitProcessingException { } private void processBindings ( DeploymentPhaseContext phaseContext , ComponentConfiguration configuration , ServiceTarget serviceTarget , ServiceName contextServiceName , ServiceName compServiceName , InjectionSource . ResolutionContext resolutionContext , List < BindingConfiguration > bindings , ComponentInstallProcessor . IntHolder handleCount ) throws DeploymentUnitProcessingException { for ( BindingConfiguration bindingConfiguration : bindings ) { if ( ( bindingConfiguration . getName ( ) . startsWith ( "java:comp" ) ) || ( ! ( bindingConfiguration . getName ( ) . startsWith ( "java:" ) ) ) ) { <START_BUG> final String bindingName = bindingConfiguration . getName ( ) ; <END_BUG> final ServiceName binderServiceName = ContextNames . serviceNameOfEnvEntry ( configuration . getApplicationName ( ) , configuration . getModuleName ( ) , configuration . getComponentName ( ) , ( ( configuration . getComponentDescription ( ) . getNamingMode ( ) ) == ( ComponentNamingMode . CREATE ) ) , bindingName ) ; final BindingHandleService service = new BindingHandleService ( bindingName , binderServiceName , bindingConfiguration . getSource ( ) , contextServiceName ) ; final ServiceName handleServiceName = binderServiceName . append ( compServiceName ) . append ( String . valueOf ( ( ( handleCount . value ) ++ ) ) ) ; ServiceBuilder < Void > serviceBuilder = serviceTarget . addService ( handleServiceName , service ) ; bindingConfiguration . getSource ( ) . getResourceValue ( resolutionContext , serviceBuilder , phaseContext , service . getManagedObjectInjector ( ) ) ; serviceBuilder . install ( ) ; } } } public void undeploy ( final DeploymentUnit context ) { } }

Fix:
final String bindingName = ( bindingConfiguration . getName ( ) . startsWith ( "java:comp" ) ) ? bindingConfiguration . getName ( ) : "java:comp//env//" + ( bindingConfiguration . getName ( ) ) ;
Buggy code:
public class ShowPropertiesAction extends PropertyDialogAction implements IKieNavigatorAction { public ShowPropertiesAction ( ICommonActionExtensionSite aSite ) { } public void calculateEnabled ( ) { } @ Override <START_BUG> public void handleException ( Throwable t ) { <END_BUG> t . printStackTrace ( ) ; Display . getDefault ( ) . asyncExec ( new Runnable ( ) { @ Override public void run ( ) { MessageDialog . openError ( Display . getDefault ( ) . getActiveShell ( ) , "Error" , t . getMessage ( ) ) ; } } ) ; } No newline ; at end ; of file ; }

Fix:
public void handleException ( final Throwable t ) {
Buggy code:
public class LazyPackage extends Package { private AbstractModelLoader modelLoader ; private List < Declaration > compiledDeclarations = new LinkedList < Declaration > ( ) ; public LazyPackage ( AbstractModelLoader modelLoader ) { } @ Override public Declaration getImportedMember ( String name , List < String > erasure ) { } @ Override public Declaration getDirectMemberOrParameter ( String name ) { } @ Override public Declaration getDirectMember ( String name ) { } private Declaration getDirectMemberFromSource ( String name ) { } private String getQualifiedName ( final String pkgName , String name ) { name = Util . quoteIfJavaKeyword ( name ) ; <START_BUG> String className = ( pkgName . isEmpty ( ) ) ? name : ( pkgName + "." ) + name ; <END_BUG> return className ; } @ Override public List < Declaration > getMembers ( ) { } public void addMember ( Declaration d ) { } static boolean isResolvable ( Declaration declaration ) { } static boolean isNamed ( String name , Declaration d ) { } }

Fix:
String className = ( pkgName . isEmpty ( ) ) ? name : ( ( Util . quoteJavaKeywords ( pkgName ) ) + "." ) + name ;
Buggy code:
public class JsonpReceivingTransportHandler extends AbstractHttpReceivingTransportHandler { private final FormHttpMessageConverter formConverter = new FormHttpMessageConverter ( ) ; @ Override public TransportType getTransportType ( ) { } @ Override public void handleRequestInternal ( ServerHttpRequest request , ServerHttpResponse response , WebSocketHandler wsHandler , AbstractHttpSockJsSession sockJsSession ) throws SockJsException { super . handleRequestInternal ( request , response , wsHandler , sockJsSession ) ; try { <START_BUG> response . getBody ( ) . write ( "ok" . getBytes ( "UTF-8" ) ) ; <END_BUG> } catch ( IOException ex ) { throw new SockJsException ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>write<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>response<seq2seq4repair_space>body" , sockJsSession . getId ( ) , ex ) ; } } @ Override protected String [ ] readMessages ( ServerHttpRequest request ) throws IOException { } @ Override protected HttpStatus getResponseStatus ( ) { } }

Fix:
response . getBody ( ) . write ( "ok" . getBytes ( UTF8_CHARSET ) ) ;
Buggy code:
public class Untar extends Task { private String dest ; private String source ; public void execute ( ) throws BuildException { Touch touch = ( ( Touch ) ( project . createTask ( "touch" ) ) ) ; <START_BUG> touch . setTarget ( target ) ; <END_BUG> File srcF = project . resolveFile ( source ) ; TarInputStream tis = null ; try { if ( ( source ) == null ) { throw new BuildException ( "No<seq2seq4repair_space>source<seq2seq4repair_space>specified" , location ) ; } if ( ! ( srcF . exists ( ) ) ) { throw new BuildException ( ( ( "source<seq2seq4repair_space>" + srcF ) + "<seq2seq4repair_space>doesn't<seq2seq4repair_space>exist" ) , location ) ; } if ( ( dest ) == null ) { throw new BuildException ( "No<seq2seq4repair_space>destination<seq2seq4repair_space>specified" , location ) ; } File dir = project . resolveFile ( dest ) ; log ( ( ( ( "Expanding:<seq2seq4repair_space>" + srcF ) + "<seq2seq4repair_space>into<seq2seq4repair_space>" ) + dir ) , MSG_INFO ) ; tis = new TarInputStream ( new FileInputStream ( srcF ) ) ; TarEntry te = null ; while ( ( te = tis . getNextEntry ( ) ) != null ) { try { File f = new File ( dir , project . translatePath ( te . getName ( ) ) ) ; log ( ( "expand-file<seq2seq4repair_space>" + ( te . getName ( ) ) ) , MSG_VERBOSE ) ; File dirF = new File ( f . getParent ( ) ) ; dirF . mkdirs ( ) ; if ( te . isDirectory ( ) ) { f . mkdirs ( ) ; } else { byte [ ] buffer = new byte [ 1024 ] ; int length = 0 ; FileOutputStream fos = new FileOutputStream ( f ) ; while ( ( length = tis . read ( buffer ) ) >= 0 ) { fos . write ( buffer , 0 , length ) ; } fos . close ( ) ; } if ( ( project . getJavaVersion ( ) ) != ( Project . JAVA_1_1 ) ) { touch . setFile ( f . getAbsolutePath ( ) ) ; touch . setMillis ( te . getModTime ( ) . getTime ( ) ) ; touch . touch ( ) ; } } catch ( FileNotFoundException ex ) { log ( ( "FileNotFoundException:<seq2seq4repair_space>" + ( te . getName ( ) ) ) , MSG_WARN ) ; } } } catch ( IOException ioe ) { throw new BuildException ( ( "Error<seq2seq4repair_space>while<seq2seq4repair_space>expanding<seq2seq4repair_space>" + ( srcF . getPath ( ) ) ) , ioe , location ) ; } finally { if ( tis != null ) { try { tis . close ( ) ; } catch ( IOException e ) { } } } } public void setDest ( String d ) { } public void setSrc ( String s ) { } }

Fix:
touch . setOwningTarget ( target ) ;
Buggy code:
public class TestAllDie extends TestClient { public static void main ( String [ ] args ) { } @ Override protected void run ( ) { try { long xid = wc ( ) . start ( ) ; assertTrue ( "Add<seq2seq4repair_space>flight" , wc ( ) . addFlight ( xid , "427" , 230 , 999 ) ) ; assertTrue ( "Add<seq2seq4repair_space>room" , wc ( ) . addRooms ( xid , "SFW" , 500 , 150 ) ) ; assertEqual ( "Check<seq2seq4repair_space>Flight<seq2seq4repair_space>Seat<seq2seq4repair_space>Number" , wc ( ) . queryFlight ( xid , "427" ) , 230 ) ; assertTrue ( "Add<seq2seq4repair_space>customer" , wc ( ) . newCustomer ( xid , "Harry" ) ) ; assertTrue ( "Reserve<seq2seq4repair_space>Flight" , wc ( ) . reserveFlight ( xid , "Harry" , "427" ) ) ; assertTrue ( "All<seq2seq4repair_space>Die" , wc ( ) . dieNow ( ALL ) ) ; try { wc ( ) . commit ( xid ) ; assertTrue ( "Commit<seq2seq4repair_space>Must<seq2seq4repair_space>Fail" , false ) ; } catch ( RemoteException e ) { System . out . println ( "Transaction<seq2seq4repair_space>Abort" ) ; assertTrue ( "WC<seq2seq4repair_space>reconnect" , wc ( ) . reconnect ( ) ) ; } Thread . sleep ( 2000 ) ; xid = wc ( ) . start ( ) ; assertTrue ( "No<seq2seq4repair_space>Flight<seq2seq4repair_space>Add" , ( ( wc ( ) . queryFlight ( xid , "427" ) ) == ( - 1 ) ) ) ; assertTrue ( "No<seq2seq4repair_space>Room<seq2seq4repair_space>Add" , ( ( wc ( ) . queryRooms ( xid , "SFW" ) ) == ( - 1 ) ) ) ; assertTrue ( "No<seq2seq4repair_space>Customer<seq2seq4repair_space>And<seq2seq4repair_space>Reservation<seq2seq4repair_space>Add" , ( ( wc ( ) . queryCustomerBill ( xid , "Harry" ) ) == ( - 1 ) ) ) ; <START_BUG> assertTrue ( "Commmit" , wc ( ) . commit ( xid ) ) ; <END_BUG> } catch ( Exception e ) { e . printStackTrace ( ) ; } } }

Fix:
assertTrue ( "Commit" , wc ( ) . commit ( xid ) ) ;
Buggy code:
public class SimplexOptimizerMultiDirectionalTest { @ Test public void testMinimize1 ( ) { } @ Test public void testMinimize2 ( ) { } @ Test public void testMaximize1 ( ) { } @ Test public void testMaximize2 ( ) { } @ Test public void testRosenbrock ( ) { } @ Test public void testPowell ( ) { } @ Test public void testMath283 ( ) { <START_BUG> SimplexOptimizer optimizer = new SimplexOptimizer ( ) ; <END_BUG> optimizer . setSimplex ( new MultiDirectionalSimplex ( 2 ) ) ; final SimplexOptimizerMultiDirectionalTest . Gaussian2D function = new SimplexOptimizerMultiDirectionalTest . Gaussian2D ( 0 , 0 , 1 ) ; PointValuePair estimate = optimizer . optimize ( 1000 , function , MAXIMIZE , function . getMaximumPosition ( ) ) ; final double EPSILON = 1.0E-5 ; final double expectedMaximum = function . getMaximum ( ) ; final double actualMaximum = estimate . getValue ( ) ; Assert . assertEquals ( expectedMaximum , actualMaximum , EPSILON ) ; final double [ ] expectedPosition = function . getMaximumPosition ( ) ; final double [ ] actualPosition = estimate . getPoint ( ) ; Assert . assertEquals ( expectedPosition [ 0 ] , actualPosition [ 0 ] , EPSILON ) ; Assert . assertEquals ( expectedPosition [ 1 ] , actualPosition [ 1 ] , EPSILON ) ; } private static class FourExtrema implements MultivariateFunction { final double xM = - 3.841947088256864 ; final double yM = - 1.391745200270735 ; final double xP = 0.22866822373490592 ; final double yP = - ( yM ) ; final double valueXmYm = 0.2373295333134217 ; final double valueXmYp = - ( valueXmYm ) ; final double valueXpYm = - 0.7290400707055187 ; final double valueXpYp = - ( valueXpYm ) ; public double value ( double [ ] variables ) { } } private static class Gaussian2D implements MultivariateFunction { private final double [ ] maximumPosition ; private final double std ; public Gaussian2D ( double xOpt , double yOpt , double std ) { } public double getMaximum ( ) { } public double [ ] getMaximumPosition ( ) { } public double value ( double [ ] point ) { } } private int count ; }

Fix:
SimplexOptimizer optimizer = new SimplexOptimizer ( 1.0E-14 , 1.0E-14 ) ;
Buggy code:
public class SensorDataProxy implements DataProducer , Copyable { private SensorDataManager sensorManager ; private DataProducer producer = null ; private SensorDataProducer sensorDataProducer = null ; private ExperimentRequest experimentRequest = null ; private boolean running = false ; private OTZeroSensor zeroSensor = null ; private ArrayList < DataListener > dataListeners = new ArrayList < DataListener > ( ) ; private ArrayList < StartableListener > startableListeners = new ArrayList ( ) ; public void setup ( SensorDataManager sdm , ExperimentRequest request , OTZeroSensor zeroSensor ) { } public ExperimentRequest getExperimentRequest ( ) { } public void setExperimentRequest ( ExperimentRequest experimentRequest ) { } public SensorDataManager getSensorManager ( ) { } public void setSensorManager ( SensorDataManager sensorManager ) { } public OTZeroSensor getZeroSensor ( ) { } public void setZeroSensor ( OTZeroSensor zeroSensor ) { } public void addDataListener ( DataListener listener ) { } public void removeDataListener ( DataListener listener ) { } public DataStreamDescription getDataDescription ( ) { } public void reset ( ) { } public void start ( ) { ExperimentRequest request = experimentRequest ; if ( ( ( sensorDataProducer ) != null ) && ( ! ( sensorDataProducer . isAttached ( ) ) ) ) { sensorDataProducer . close ( ) ; sensorDataProducer = null ; } if ( ( sensorDataProducer ) == null ) { sensorDataProducer = sensorManager . createDataProducer ( ) ; producer = sensorDataProducer ; if ( ( sensorDataProducer ) == null ) { return ; } for ( int i = 0 ; i < ( dataListeners . size ( ) ) ; i ++ ) { DataListener listener = dataListeners . get ( i ) ; DataStreamEvent changeEvent = new DataStreamEvent ( DataStreamEvent . DATA_DESC_CHANGED ) ; changeEvent . setDataDescription ( getDataDescription ( ) ) ; listener . dataStreamEvent ( changeEvent ) ; producer . addDataListener ( listener ) ; } } ExperimentConfig config = sensorDataProducer . configure ( request ) ; if ( ( config == null ) || ( ! ( config . isValid ( ) ) ) ) { return ; } if ( ( zeroSensor ) != null ) { <START_BUG> DataProducer newProducer = zeroSensor . setupDataFilter ( sensorDataProducer ) ; <END_BUG> if ( ( producer ) != newProducer ) { for ( int i = 0 ; i < ( dataListeners . size ( ) ) ; i ++ ) { DataListener listener = dataListeners . get ( i ) ; producer . removeDataListener ( listener ) ; newProducer . addDataListener ( listener ) ; } producer = newProducer ; } } producer . start ( ) ; running = true ; } public void stop ( ) { } public Object getCopy ( ) { } public void close ( ) { } public boolean isRunning ( ) { } public boolean isInInitialState ( ) { } public void addStartableListener ( StartableListener listener ) { } public void removeStartableListener ( StartableListener listener ) { } public StartableInfo getStartableInfo ( ) { } public boolean isAtEndOfStream ( ) { } }

Fix:
DataProducer newProducer = zeroSensor . setupDataFilter ( sensorDataProducer , config ) ;
Buggy code:
public class DefaultDeployer extends AbstractLogEnabled implements Composable , Deployer { private static final Resources REZ = ResourceManager . getPackageResources ( DefaultDeployer . class ) ; private Deployer m_parent ; private ComponentManager m_componentManager ; private PackageManager m_packageManager ; private Map m_classLoaderDeployers = new HashMap ( ) ; private Map m_fileDeployers ; public DefaultDeployer ( ) { } private DefaultDeployer ( final DefaultDeployer parent ) { } public void compose ( final ComponentManager componentManager ) throws ComponentException { } public Deployer createChildDeployer ( ComponentManager componentManager ) throws ComponentException { } public TypeDeployer createDeployer ( final ClassLoader loader ) throws DeploymentException { try { return createDeployment ( loader , null ) ; } catch ( Exception e ) { <START_BUG> final String message = DefaultDeployer . REZ . getString ( "deploy-from-classloader.error" ) ; <END_BUG> throw new DeploymentException ( message , e ) ; } } public TypeDeployer createDeployer ( final File file ) throws DeploymentException { } private URLClassLoader getClassLoaderForFile ( final File file ) throws Exception { } private Deployment createDeployment ( final ClassLoader loader , final URL jarUrl ) throws Exception { } private URL [ ] buildClasspath ( final File file , final File [ ] dependencies ) throws MalformedURLException { } private File [ ] getOptionalPackagesFor ( final File typeLibrary ) throws Exception { } private void checkFile ( final File file ) throws DeploymentException { } }

Fix:
final String message = DefaultDeployer . REZ . getString ( "deploy-from-classloader.error" , loader ) ;
Buggy code:
public final class Path implements IResourceFinder { private final List folders = new ArrayList ( ) ; public Path ( ) { } public Path ( final Folder folder ) { } public Path ( final Folder [ ] folders ) { } public IResourceFinder add ( final Folder folder ) { } public IResourceFinder add ( String path ) { } public URL find ( final String pathname ) { for ( final Iterator iterator = folders . iterator ( ) ; iterator . hasNext ( ) ; ) { final Folder folder = ( ( Folder ) ( iterator . next ( ) ) ) ; final File file = new File ( folder , pathname ) ; if ( file . exists ( ) ) { try { <START_BUG> return file . toURL ( ) ; <END_BUG> } catch ( MalformedURLException ex ) { } } } return null ; } public List getFolders ( ) { } public int size ( ) { } public String toString ( ) { } }

Fix:
return file . toURI ( ) . toURL ( ) ;
Buggy code:
public class TestNonstandardMappingAnnotations extends SingleEMFTestCase { private ClassMapping _mapping ; private DBDictionary _dict ; public void setUp ( ) { <START_BUG> setUp ( NonstandardMappingEntity . class , ExtensionsEntity . class , NonstandardMappingMappedSuper . class , EmbedValue2 . class , EmbedValue . class , CLEAR_TABLES ) ; <END_BUG> emf . createEntityManager ( ) . close ( ) ; JDBCConfiguration conf = ( ( JDBCConfiguration ) ( emf . getConfiguration ( ) ) ) ; _dict = conf . getDBDictionaryInstance ( ) ; _mapping = ( ( ClassMapping ) ( JPAFacadeHelper . getMetaData ( emf , NonstandardMappingEntity . class ) ) ) ; } public void testNonpolymorphic ( ) { } public void testDataStoreIdColumn ( ) { } public void testDiscriminator ( ) { } public void testSuperclassOverride ( ) { } public void testCustomField ( ) { } public void testValueCollection ( ) { } public void testJoinCollection ( ) { } private void assertForeignKey ( ForeignKey fk ) { } public void testValueMap ( ) { } public void testJoinMap ( ) { } public void testEmbeddedOverride ( ) { } public void testEmbeddedElementOverride ( ) { } public void testInsertAndRetrieve ( ) { } public void testInsertAndRetrieveEmbeddedCollection ( ) { } }

Fix:
setUp ( NonstandardMappingEntity . class , ExtensionsEntity . class , NonstandardMappingMappedSuper . class , EmbedValue2 . class , EmbedValue . class , CLEAR_TABLES , RETAIN_DATA ) ;
Buggy code:
abstract class EJBIdentifierBasedMessageHandler extends AbstractMessageHandler { protected final DeploymentRepository deploymentRepository ; EJBIdentifierBasedMessageHandler ( final DeploymentRepository deploymentRepository ) { } protected EjbDeploymentInformation findEJB ( final String appName , final String moduleName , final String distinctName , final String beanName ) { final DeploymentModuleIdentifier ejbModule = new DeploymentModuleIdentifier ( appName , moduleName , distinctName ) ; <START_BUG> final Map < DeploymentModuleIdentifier , ModuleDeployment > modules = this . deploymentRepository . getModules ( ) ; <END_BUG> if ( ( modules == null ) || ( modules . isEmpty ( ) ) ) { return null ; } final ModuleDeployment moduleDeployment = modules . get ( ejbModule ) ; if ( moduleDeployment == null ) { return null ; } return moduleDeployment . getEjbs ( ) . get ( beanName ) ; } }

Fix:
final Map < DeploymentModuleIdentifier , ModuleDeployment > modules = this . deploymentRepository . getStartedModules ( ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient @ ServerSetup ( RaTestConnectionTestCase . RaTestConnectionTestCaseSetup . class ) public class RaTestConnectionTestCase extends ContainerResourceMgmtTestBase { private static ModelNode address ; private static String deploymentName = "testcon_mult.rar" ; static class RaTestConnectionTestCaseSetup extends AbstractMgmtServerSetupTask { @ Override public void doSetup ( final ManagementClient managementClient ) throws Exception { RaTestConnectionTestCase . address = new ModelNode ( ) ; RaTestConnectionTestCase . address . add ( "subsystem" , "resource-adapters" ) ; RaTestConnectionTestCase . address . add ( "resource-adapter" , RaTestConnectionTestCase . deploymentName ) ; RaTestConnectionTestCase . address . protect ( ) ; String xml = FileUtils . readFile ( RaTestConnectionTestCase . class , "testcon_multiple.xml" ) ; <START_BUG> List < ModelNode > operations = xmlToModelOperations ( xml , CURRENT . getUriString ( ) , new ResourceAdapterSubsystemParser ( ) ) ; <END_BUG> System . out . println ( operations ) ; executeOperation ( operationListToCompositeOperation ( operations ) ) ; } @ Override public void tearDown ( final ManagementClient managementClient , final String containerId ) throws Exception { } } @ Deployment public static ResourceAdapterArchive createDeployment ( ) throws Exception { } @ Test public void testConnection ( ) throws Exception { } @ Test public void flushConnections ( ) throws Exception { } }

Fix:
List < ModelNode > operations = xmlToModelOperations ( xml , RESOURCEADAPTERS_1_0 . getUriString ( ) , new ResourceAdapterSubsystemParser ( ) ) ;
Buggy code:
public class MainActivity extends AppCompatActivity { String baseURL = "https:////facepunch.com//" ; ObservableWebView webview ; ProgressBar pb ; RelativeLayout pbc ; private boolean isInjected ; String CSSfromfile ; String JSfromfile ; String Jquery ; Boolean loginStatus ; Toolbar toolbar_bottom ; Integer currentpage ; Integer totalpages ; MenuItem addstartpage ; OnSharedPreferenceChangeListener spChanged ; Integer oldScrollPos = 0 ; Boolean paginationEnabled = false ; Boolean paginationHidden = true ; private int mShortAnimationDuration ; private SharedPreferences sharedPref ; boolean useCustomStyles ; SwipeRefreshLayout mSwipeRefreshLayout ; Toolbar toolbar ; private String mActivityTitle ; RealmConfiguration realmConfig ; Realm realm ; Drawer drawer ; AccountHeader headerResult ; ProfileDrawerItem defaultProfile ; PrimaryDrawerItem nav_logout ; Activity mActivity ; Boolean dissableAllImages = false ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public void onDestroy ( ) { } @ Override protected void onPause ( ) { } @ Override protected void onResume ( ) { } protected void onSaveInstanceState ( Bundle outState ) { } private void setupDrawer ( ) { } protected void addDrawerItems ( ) { } protected void refreshDrawerItems ( ) { } @ Override protected void onPostCreate ( Bundle savedInstanceState ) { } @ Override public void onConfigurationChanged ( Configuration newConfig ) { } public void setupToolbar ( ) { } public void setupBottomToolbar ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onKeyDown ( int keyCode , KeyEvent event ) { } public class WebAppInterface { Context mContext ; WebAppInterface ( Context c ) { } @ JavascriptInterface public void showToast ( String toast ) { } @ JavascriptInterface public void showImage ( String url ) { } @ JavascriptInterface public void finishedInjection ( ) { } @ JavascriptInterface public void setupPagination ( final String currentPage , final String totalPages ) { Log . d ( "DEBUG" , "Update<seq2seq4repair_space>spinner" ) ; currentpage = Integer . parseInt ( currentPage ) ; totalpages = Integer . parseInt ( totalPages ) ; runOnUiThread ( new Runnable ( ) { @ Override public void run ( ) { paginationEnabled = true ; <START_BUG> toolbar_bottom . setVisibility ( 1 ) ; <END_BUG> toolbar_bottom . setTitle ( "Current<seq2seq4repair_space>page" ) ; toolbar_bottom . setSubtitle ( ( ( ( currentpage ) + "<seq2seq4repair_space>of<seq2seq4repair_space>" ) + ( totalpages ) ) ) ; } } ) ; } @ JavascriptInterface public void disablePagination ( ) { } @ JavascriptInterface public void showPagination ( ) { } @ JavascriptInterface public void hidePagination ( ) { } @ JavascriptInterface public void setLoginStatus ( boolean status , final String username , final String userid ) { } } private void hideViews ( ) { } private void showViews ( ) { } }

Fix:
toolbar_bottom . setVisibility ( VISIBLE ) ;
Buggy code:
public class EntityBuilder { private final JDAImpl api ; public EntityBuilder ( JDAImpl api ) { } public Guild createGuild ( JSONObject guild ) { } public TextChannel createTextChannel ( JSONObject json , String guildId ) { } public VoiceChannel createVoiceChannel ( JSONObject json , String guildId ) { } public PrivateChannel createPrivateChannel ( JSONObject privatechat ) { } protected Role createRole ( JSONObject roleJson , String guildId ) { } protected User createUser ( JSONObject user ) { } protected SelfInfo createSelfInfo ( JSONObject self ) { } public Message createMessage ( JSONObject jsonObject ) { String id = jsonObject . getString ( "id" ) ; MessageImpl message = new MessageImpl ( id , api ) . setAuthor ( api . getUserMap ( ) . get ( jsonObject . getJSONObject ( "author" ) . getString ( "id" ) ) ) . setContent ( jsonObject . getString ( "content" ) ) . setTime ( OffsetDateTime . parse ( jsonObject . getString ( "timestamp" ) ) ) . setMentionsEveryone ( jsonObject . getBoolean ( "mention_everyone" ) ) . setTTS ( jsonObject . getBoolean ( "tts" ) ) ; if ( ! ( jsonObject . isNull ( "edited_timestamp" ) ) ) message . setEditedTime ( OffsetDateTime . parse ( jsonObject . getString ( "edited_timestamp" ) ) ) ; String channelId = jsonObject . getString ( "channel_id" ) ; TextChannel textChannel = api . getChannelMap ( ) . get ( channelId ) ; if ( textChannel != null ) { message . setChannelId ( textChannel . getId ( ) ) ; message . setIsPrivate ( false ) ; List < User > mentioned = new LinkedList < > ( ) ; JSONArray mentions = jsonObject . getJSONArray ( "mentions" ) ; for ( int i = 0 ; i < ( mentions . length ( ) ) ; i ++ ) { <START_BUG> JSONObject mention = mentions . getJSONObject ( 0 ) ; <END_BUG> mentioned . add ( api . getUserMap ( ) . get ( mention . getString ( "id" ) ) ) ; } message . setMentionedUsers ( mentioned ) ; } else { message . setIsPrivate ( true ) ; PrivateChannel privateChannel = api . getPmChannelMap ( ) . get ( channelId ) ; if ( privateChannel != null ) { message . setChannelId ( privateChannel . getId ( ) ) ; } else { throw new IllegalArgumentException ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>Private<seq2seq4repair_space>Channel<seq2seq4repair_space>of<seq2seq4repair_space>id<seq2seq4repair_space>" + channelId ) ) ; } } return message ; } protected MessageEmbed createMessageEmbed ( JSONObject messageEmbed ) { } }

Fix:
JSONObject mention = mentions . getJSONObject ( i ) ;
Buggy code:
public interface IValue extends IASTNode , ITyped { public static int NULL = 0 ; public static int BOOLEAN = 1 ; public static int BYTE = 2 ; public static int SHORT = 3 ; public static int CHAR = 4 ; public static int INT = 5 ; public static int LONG = 6 ; public static int FLOAT = 7 ; public static int DOUBLE = 8 ; public static int STRING = 9 ; public static int ENUM = 10 ; public static int BOXED = 11 ; public static int THIS = 11 ; public static int SUPER = 12 ; public static int VALUE_LIST = 13 ; public static int CLASS_ACCESS = 16 ; public static int FIELD_ACCESS = 17 ; public static int FIELD_ASSIGN = 18 ; public static int METHOD_CALL = 19 ; public static int APPLY_METHOD_CALL = 20 ; public static int UPDATE_METHOD_CALL = 21 ; public static int CONSTRUCTOR_CALL = 22 ; public static int ARRAY_CONSTRUCTOR = 23 ; public static int VARIABLE = 24 ; public static int CAST_OPERATOR = 32 ; public static int ISOF_OPERATOR = 33 ; public static int SWAP_OPERATOR = 34 ; public static int BOOLEAN_AND = 35 ; public static int BOOLEAN_OR = 36 ; public static int BOOLEAN_NOT = 37 ; public static int TUPLE = 48 ; public static int LAMBDA = 49 ; public static int BYTECODE = 50 ; public static int RETURN = 64 ; public static int IF = 65 ; public static int SWITCH = 66 ; public static int FOR = 67 ; public static int WHILE = 68 ; public static int DO_WHILE = 69 ; public static int BREAK = 72 ; public static int CONTINUE = 73 ; public static int GOTO = 74 ; public int getValueType ( ) { } public static boolean isNumeric ( int t1 ) { } public default boolean isConstant ( ) { } public default boolean isStatement ( ) { } public default boolean isPrimitive ( ) { } @ Override public IType getType ( ) { } @ Override public default void setType ( IType type ) { } public default IValue withType ( IType type ) { IType type1 = this . getType ( ) ; if ( type1 == null ) { return null ; } <START_BUG> boolean primitive = type1 . isPrimitive ( ) ; <END_BUG> if ( primitive != ( type . isPrimitive ( ) ) ) { if ( ! ( Type . isSuperType ( type , type1 ) ) ) { return null ; } if ( primitive ) { return type1 . box ( this ) ; } else { return type . unbox ( this ) ; } } if ( Type . isSuperType ( type , type1 ) ) { return this ; } return null ; } @ Override public boolean isType ( IType type ) { } public int getTypeMatch ( IType type ) { } public default void addTypeVariables ( IType type , Map < String , IType > typeVariables ) { } public void resolveTypes ( List < Marker > markers , IContext context ) { } public IValue resolve ( List < Marker > markers , IContext context ) { } public void check ( List < Marker > markers , IContext context ) { } public IValue foldConstants ( ) { } public void writeExpression ( MethodWriter writer ) { } public void writeStatement ( MethodWriter writer ) { } public default void writeJump ( MethodWriter writer , Label dest ) { } public default void writeInvJump ( MethodWriter writer , Label dest ) { } public static IValue fromObject ( Object o ) { } }

Fix:
boolean primitive = this . isPrimitive ( ) ;
Buggy code:
public class ScheduleFragment extends Fragment { private static final String DIALOG_TIME = "time" ; public static final String EXTRA_DAYEVENT_ID = "com.josephoh.williamsScheduler.DayEvent_id" ; private DayEvent mDayEvent ; private EditText mTitle ; private Button mTimePickerButton ; private NumberPicker mNumberPicker ; private EditText mDescription ; public ScheduleFragment ( ) { } public static ScheduleFragment newInstance ( UUID uuid ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; UUID eventID = ( ( UUID ) ( getArguments ( ) . getSerializable ( ScheduleFragment . EXTRA_DAYEVENT_ID ) ) ) ; <START_BUG> mDayEvent = EventLab . get ( getActivity ( ) ) . getDayEvent ( eventID ) ; <END_BUG> } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup parent , Bundle savedInstanceState ) { } }

Fix:
mDayEvent = TodayLab . get ( getActivity ( ) ) . getDayEvent ( eventID ) ;
Buggy code:
public class CSVFormat implements Serializable , Cloneable { private char delimiter = ',' ; private char encapsulator = '"' ; private char commentStart = CSVFormat . DISABLED ; private char escape = CSVFormat . DISABLED ; private boolean leadingSpacesIgnored = true ; private boolean trailingSpacesIgnored = true ; private boolean unicodeEscapesInterpreted = false ; private boolean emptyLinesIgnored = true ; private String lineSeparator = "\n" ; public static final char DISABLED = '￾' ; public static final CSVFormat DEFAULT = new CSVFormat ( ',' , '"' , CSVFormat . DISABLED , CSVFormat . DISABLED , true , true , false , true ) ; public static final CSVFormat EXCEL = new CSVFormat ( ',' , '"' , CSVFormat . DISABLED , CSVFormat . DISABLED , false , false , false , false ) ; public static final CSVFormat TDF = new CSVFormat ( '\t' , '"' , CSVFormat . DISABLED , CSVFormat . DISABLED , true , true , false , true ) ; public CSVFormat ( ) { } public CSVFormat ( char delimiter , char encapsulator , char commentStart ) { } public CSVFormat ( char delimiter , char encapsulator , char commentStart , char escape , boolean leadingSpacesIgnored , boolean trailingSpacesIgnored , boolean unicodeEscapesInterpreted , boolean emptyLinesIgnored ) { } public char getDelimiter ( ) { } public CSVFormat withDelimiter ( char delimiter ) { CSVFormat format = ( ( CSVFormat ) ( clone ( ) ) ) ; <START_BUG> this . delimiter = delimiter ; <END_BUG> return format ; } public char getEncapsulator ( ) { } public CSVFormat withEncapsulator ( char encapsulator ) { } boolean isEncapsulating ( ) { } public char getCommentStart ( ) { } public CSVFormat withCommentStart ( char commentStart ) { } public boolean isCommentingDisabled ( ) { } public char getEscape ( ) { } public CSVFormat withEscape ( char escape ) { } boolean isEscaping ( ) { } public boolean isLeadingSpacesIgnored ( ) { } public CSVFormat withLeadingSpacesIgnored ( boolean leadingSpacesIgnored ) { } public boolean isTrailingSpacesIgnored ( ) { } public CSVFormat withTrailingSpacesIgnored ( boolean trailingSpacesIgnored ) { } public boolean isUnicodeEscapesInterpreted ( ) { } public CSVFormat withUnicodeEscapesInterpreted ( boolean unicodeEscapesInterpreted ) { } public boolean isEmptyLinesIgnored ( ) { } public CSVFormat withEmptyLinesIgnored ( boolean emptyLinesIgnored ) { } public String getLineSeparator ( ) { } public CSVFormat withLineSeparator ( String lineSeparator ) { } protected Object clone ( ) { } }

Fix:
format . delimiter = delimiter ;
Buggy code:
public class PropertyModel extends DetachableModel { private static final long serialVersionUID = - 3136339624173288385L ; private final IModel model ; private final String expression ; private Locale locale ; private String formatterName ; private String formatPattern ; private transient OgnlContext context ; private transient ConverterRegistry converterRegistry ; private boolean applyFormatting ; public PropertyModel ( final IModel model , final String expression ) { } public PropertyModel ( final IModel model , final String expression , boolean applyFormatting ) { } private final void checkModelNotNull ( final IModel model ) { if ( model == null ) { <START_BUG> throw new NullPointerException ( "Parameter<seq2seq4repair_space>'model'<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; <END_BUG> } } public Object getObject ( ) { } public void setObject ( Object object ) { } protected final void doAttach ( ) { } protected final void doDetach ( ) { } protected final OgnlContext getContext ( ) { } protected final void setContext ( OgnlContext context ) { } protected final String getExpression ( ) { } protected final Locale getLocale ( ) { } protected final IModel getModel ( ) { } public final PropertyModel setApplyFormatting ( boolean applyFormatting ) { } public final PropertyModel setFormatPattern ( String formatPattern ) { } public final PropertyModel setFormatterName ( String formatterName ) { } protected final boolean isApplyFormatting ( ) { } protected final String getFormatPattern ( ) { } protected final String getFormatterName ( ) { } public final ConverterRegistry getConverterRegistry ( ) { } protected final class OgnlConverterWrapper extends DefaultTypeConverter { public OgnlConverterWrapper ( ) { } public Object convertValue ( Map context , Object value , Class toType ) { } public Object convertValue ( Map context , Object target , Member member , String propertyName , Object value , Class toType ) { } } }

Fix:
throw new IllegalArgumentException ( "Model<seq2seq4repair_space>parameter<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ;
Buggy code:
public class PCClassFileTransformer implements ClassFileTransformer { private static final Localizer _loc = Localizer . forPackage ( PCClassFileTransformer . class ) ; private final MetaDataRepository _repos ; private final Flags _flags ; private final ClassLoader _tmpLoader ; private final Log _log ; private final Set _names ; private boolean _transforming = false ; public PCClassFileTransformer ( MetaDataRepository repos , Options opts , ClassLoader loader ) { } private static Flags toFlags ( Options opts ) { } public PCClassFileTransformer ( MetaDataRepository repos , PCEnhancer . Flags flags , ClassLoader tmpLoader , boolean devscan ) { } public byte [ ] transform ( ClassLoader loader , String className , Class redef , ProtectionDomain domain , byte [ ] bytes ) throws IllegalClassFormatException { } private Boolean needsEnhance ( String clsName , Class redef , byte [ ] bytes ) { } private static boolean isEnhanced ( byte [ ] b ) { ConstantPoolTable table = new ConstantPoolTable ( b ) ; int idx = table . getEndIndex ( ) ; idx += 6 ; int ifaces = table . readUnsignedShort ( idx ) ; int clsEntry ; int utfEntry ; String name ; for ( int i = 0 ; i < ifaces ; i ++ ) { idx += 2 ; clsEntry = table . readUnsignedShort ( idx ) ; utfEntry = table . readUnsignedShort ( table . get ( clsEntry ) ) ; name = table . readString ( table . get ( utfEntry ) ) ; <START_BUG> if ( "openjpa//enhance//PersistenceCapable" . equals ( name ) ) <END_BUG> return true ; } return false ; } }

Fix:
if ( "org//apache//openjpa//enhance//PersistenceCapable" . equals ( name ) )
Buggy code:
public abstract class TInputStream extends TObject implements TCloseable { public TInputStream ( ) { } public abstract int read ( ) throws TIOException { } public int read ( byte [ ] b ) throws TIOException { } public int read ( byte [ ] b , int off , int len ) throws TIOException { for ( int i = 0 ; i < len ; ++ i ) { int bt = read ( ) ; if ( bt < 0 ) { <START_BUG> return i ; <END_BUG> } b [ ( off ++ ) ] = ( ( byte ) ( bt ) ) ; } return len > 0 ? len : - 1 ; } public long skip ( long n ) throws TIOException { } private int skip ( int n ) throws TIOException { } public int available ( ) throws TIOException { } @ Override public void close ( ) throws TIOException { } public void mark ( @ SuppressWarnings ( "unused" ) int readlimit ) { } public void reset ( ) throws TIOException { } public boolean markSupported ( ) { } }

Fix:
return i == 0 ? - 1 : i ;
Buggy code:
public class MainActivity extends ActionBarActivity implements ViewActivitiesFragment . OnViewActivitiesInteractionListener , ViewActivityFragment . OnViewActivityInteractionListener , ViewCategoriesFragment . OnViewCategoriesInteractionListener { private DatabaseHelper dbHelper ; @ Override protected void onDestroy ( ) { } @ Override protected void onCreate ( Bundle savedInstanceState ) { } private ArrayList < Category > getCategories ( ) throws SQLException { } private void createSampleCategories ( ) throws SQLException { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public void onEditCategory ( Category category ) { } @ Override public void onViewActivities ( Category category ) { } @ Override public void onEditActivity ( Activity activity ) { } @ Override public void onViewActivity ( Activity activity ) { } public DatabaseHelper getDbHelper ( ) { if ( ( dbHelper ) == null ) { <START_BUG> dbHelper = new DatabaseHelper ( getApplicationContext ( ) ) ; <END_BUG> } return dbHelper ; } }

Fix:
dbHelper = OpenHelperManager . getHelper ( this , DatabaseHelper . class ) ;
Buggy code:
public class InventoryData { private static final String PLAYER_INVENTORY_TAG = "Inventory" ; private static final String ENDER_ITEMS_TAG = "EnderItems" ; public IWrappedItemStack [ ] getInventoryContents ( File datafile ) { } public IWrappedItemStack [ ] getArmorContents ( File datafile ) { } public IWrappedItemStack [ ] getEnderChestContents ( File datafile ) { } public void setInventoryContents ( File datafile , ItemStack [ ] contents ) { } public void setArmorContents ( File datafile , ItemStack [ ] contents ) { } public void setEnderChestContents ( File datafile , ItemStack [ ] contents ) { if ( ( contents . length ) != 27 ) { <START_BUG> throw new IllegalArgumentException ( "Armor<seq2seq4repair_space>contents<seq2seq4repair_space>array<seq2seq4repair_space>should<seq2seq4repair_space>have<seq2seq4repair_space>a<seq2seq4repair_space>length<seq2seq4repair_space>of<seq2seq4repair_space>4" ) ; <END_BUG> } NBTTagCompound data = DataUtils . getData ( datafile ) ; DataUtils . saveData ( datafile , setItems ( data , InventoryData . ENDER_ITEMS_TAG , setSpecificItems ( getItems ( data , InventoryData . ENDER_ITEMS_TAG ) , 0 , 27 , contents ) ) ) ; } private IWrappedItemStack [ ] getSpecificItems ( HashMap < Integer , ItemStack > items , int startslot , int endslot ) { } private HashMap < Integer , ItemStack > setSpecificItems ( HashMap < Integer , ItemStack > items , int startslot , int endslot , ItemStack [ ] setitems ) { } @ SuppressWarnings ( "unchecked" ) private HashMap < Integer , ItemStack > getItems ( NBTTagCompound data , String invtagname ) { } private NBTTagCompound setItems ( NBTTagCompound data , String invtagname , HashMap < Integer , ItemStack > items ) { } }

Fix:
throw new IllegalArgumentException ( "Ender<seq2seq4repair_space>chest<seq2seq4repair_space>contents<seq2seq4repair_space>array<seq2seq4repair_space>should<seq2seq4repair_space>have<seq2seq4repair_space>a<seq2seq4repair_space>length<seq2seq4repair_space>of<seq2seq4repair_space>27" ) ;
Buggy code:
public class TestAllFilesHaveCodecHeader extends LuceneTestCase { public void test ( ) throws Exception { Directory dir = newDirectory ( ) ; IndexWriterConfig conf = newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) ; conf . setCodec ( new Lucene46Codec ( ) ) ; RandomIndexWriter riw = new RandomIndexWriter ( random ( ) , dir , conf ) ; Document doc = new Document ( ) ; Field idField = newStringField ( "id" , "" , NO ) ; Field bodyField = newTextField ( "body" , "" , NO ) ; Field dvField = new NumericDocValuesField ( "dv" , 5 ) ; doc . add ( idField ) ; doc . add ( bodyField ) ; doc . add ( dvField ) ; for ( int i = 0 ; i < 100 ; i ++ ) { idField . setStringValue ( Integer . toString ( i ) ) ; bodyField . setStringValue ( TestUtil . randomUnicodeString ( random ( ) ) ) ; riw . addDocument ( doc ) ; if ( ( random ( ) . nextInt ( 7 ) ) == 0 ) { riw . commit ( ) ; } } <START_BUG> riw . close ( ) ; <END_BUG> checkHeaders ( dir ) ; dir . close ( ) ; } private void checkHeaders ( Directory dir ) throws IOException { } }

Fix:
riw . shutdown ( ) ;