nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ChatRoomManagerUI { IChatRoomManager manager ; public ChatRoomManagerUI ( IChatRoomManager manager ) { } public ChatRoomManagerUI setup ( final IContainer newClient , final ID targetID , String username ) { Display . getDefault ( ) . syncExec ( new Runnable ( ) { public void run ( ) { try { <START_BUG> IRoomInfo roomInfo = manager . getChatRoomInfo ( targetID ) ; <END_BUG> IChatRoomContainer chatRoom = null ; try { chatRoom = roomInfo . createChatRoomContainer ( ) ; } catch ( ContainerInstantiationException e1 ) { } IChatMessageSender sender = chatRoom . getChatMessageSender ( ) ; IWorkbenchWindow ww = PlatformUI . getWorkbench ( ) . getActiveWorkbenchWindow ( ) ; IWorkbenchPage wp = ww . getActivePage ( ) ; IViewPart view = wp . showView ( "org.eclipse.ecf.ui.views.ChatRoomView" ) ; final ChatRoomView chatroomview = ( ( ChatRoomView ) ( view ) ) ; chatroomview . initialize ( new IChatRoomViewCloseListener ( ) { public void chatRoomViewClosing ( String secondaryID ) { newClient . dispose ( ) ; } } , null , chatRoom , roomInfo , sender ) ; chatRoom . addMessageListener ( new IMessageListener ( ) { public void handleMessage ( ID fromID , ID toID , Type type , String subject , String messageBody ) { chatroomview . handleMessage ( fromID , toID , type , subject , messageBody ) ; } } ) ; chatRoom . addChatParticipantListener ( new IChatParticipantListener ( ) { public void handlePresence ( ID fromID , IPresence presence ) { chatroomview . handlePresence ( fromID , presence ) ; } public void joined ( ID user ) { chatroomview . handleJoin ( user ) ; } public void left ( ID user ) { chatroomview . handleLeave ( user ) ; } } ) ; chatRoom . addInvitationListener ( new IInvitationListener ( ) { public void handleInvitationReceived ( ID roomID , ID from , ID toID , String subject , String body ) { chatroomview . handleInvitationReceived ( roomID , from , toID , subject , body ) ; } } ) ; } catch ( PartInitException e ) { UiPlugin . log ( ( "Exception<seq2seq4repair_space>in<seq2seq4repair_space>chat<seq2seq4repair_space>room<seq2seq4repair_space>view<seq2seq4repair_space>initialization<seq2seq4repair_space>for<seq2seq4repair_space>chat<seq2seq4repair_space>room<seq2seq4repair_space>" + targetID ) , e ) ; } } } ) ; return this ; } }

Fix:
IRoomInfo roomInfo = manager . getChatRoomInfo ( targetID . getName ( ) ) ;
Buggy code:
public class RichSpoutBatchExecutor implements ITridentSpout { public static final String MAX_BATCH_SIZE_CONF = "topology.spout.max.batch.size" ; IRichSpout _spout ; public RichSpoutBatchExecutor ( IRichSpout spout ) { } @ Override public Map getComponentConfiguration ( ) { } @ Override public Fields getOutputFields ( ) { } @ Override public BatchCoordinator getCoordinator ( String txStateId , Map conf , TopologyContext context ) { } @ Override public Emitter getEmitter ( String txStateId , Map conf , TopologyContext context ) { } class RichSpoutEmitter implements ITridentSpout . Emitter < Object > { int _maxBatchSize ; boolean prepared = false ; RichSpoutBatchExecutor . CaptureCollector _collector ; RotatingMap < Long , List < Object > > idsMap ; Map _conf ; TopologyContext _context ; long lastRotate = System . currentTimeMillis ( ) ; long rotateTime ; public RichSpoutEmitter ( Map conf , TopologyContext context ) { } @ Override public void emitBatch ( TransactionAttempt tx , Object coordinatorMeta , TridentCollector collector ) { } @ Override public void success ( TransactionAttempt tx ) { } private void ack ( long batchId ) { } private void fail ( long batchId ) { } @ Override public void close ( ) { } } class RichSpoutCoordinator implements ITridentSpout . BatchCoordinator { @ Override <START_BUG> public Object initializeTransaction ( long txid , Object prevMetadata , Object currMetadata ) { <END_BUG> return null ; } @ Override public void success ( long txid ) { } @ Override public boolean isReady ( long txid ) { } @ Override public void close ( ) { } } static class CaptureCollector implements ISpoutOutputCollector { TridentCollector _collector ; public List < Object > ids ; public int numEmitted ; public void reset ( TridentCollector c ) { } @ Override public void reportError ( Throwable t ) { } @ Override public List < Integer > emit ( String stream , List < Object > values , Object id ) { } @ Override public void emitDirect ( int task , String stream , List < Object > values , Object id ) { } } }

Fix:
public Object initializeTransaction ( long txid , Object prevMetadata ) {
Buggy code:
public class DefaultsAnnotationAttributeInitializer extends AnnotationAttributeInitializer { public DefaultsAnnotationAttributeInitializer ( ) { } @ Override public List < MemberValuePair > getMemberValuePairs ( IJavaElement javaElement , AST ast , Class < ? extends Annotation > annotationClass ) { } private List < MemberValuePair > getMemberValuePairs ( AST ast , Class < ? extends Annotation > annotationClass ) { List < MemberValuePair > memberValuePairs = new ArrayList < MemberValuePair > ( ) ; Method [ ] declaredMethods = annotationClass . getDeclaredMethods ( ) ; for ( Method method : declaredMethods ) { String name = method . getName ( ) ; Class < ? > returnType = method . getReturnType ( ) ; Object defaultValue = method . getDefaultValue ( ) ; if ( defaultValue != null ) { if ( returnType . equals ( String . class ) ) { memberValuePairs . add ( AnnotationsCore . createStringMemberValuePair ( ast , name , defaultValue . toString ( ) ) ) ; } if ( returnType . equals ( Boolean . TYPE ) ) { memberValuePairs . add ( AnnotationsCore . createBooleanMemberValuePair ( ast , name , Boolean . parseBoolean ( defaultValue . toString ( ) ) ) ) ; } if ( ( returnType . isPrimitive ( ) ) && ( ( ( ( ( ( returnType . equals ( Byte . TYPE ) ) || ( returnType . equals ( Short . TYPE ) ) ) || ( returnType . equals ( Integer . TYPE ) ) ) || ( returnType . equals ( Long . TYPE ) ) ) || ( returnType . equals ( Float . TYPE ) ) ) || ( returnType . equals ( Double . TYPE ) ) ) ) { <START_BUG> memberValuePairs . add ( AnnotationsCore . createNumberMemberValuePair ( ast , name , defaultValue ) ) ; <END_BUG> } if ( returnType . isArray ( ) ) { memberValuePairs . add ( AnnotationsCore . createArrayMemberValuePair ( ast , method , ( ( Object [ ] ) ( defaultValue ) ) ) ) ; } if ( returnType . isEnum ( ) ) { memberValuePairs . add ( AnnotationsCore . createEnumMemberValuePair ( ast , method . getDeclaringClass ( ) . getCanonicalName ( ) , name , defaultValue ) ) ; } if ( returnType . equals ( Class . class ) ) { memberValuePairs . add ( AnnotationsCore . createTypeMemberValuePair ( ast , name , defaultValue ) ) ; } } } return memberValuePairs ; } }

Fix:
memberValuePairs . add ( AnnotationsCore . createNumberMemberValuePair ( ast , name , defaultValue . toString ( ) ) ) ;
Buggy code:
public class WicketTester extends MockWebApplication { private static Log log = LogFactory . getLog ( WicketTester . class ) ; public WicketTester ( ) { } public WicketTester ( final String path ) { } public final Page startPage ( ITestPageSource testPageSource ) { } private void newRequestToComponent ( Component component ) { } public final Page startPage ( final Page page ) { } public final Page startPage ( Class pageClass ) { } public final Panel startPanel ( final TestPanelSource testPanelSource ) { } public final Panel startPanel ( final Class panelClass ) { } private RuntimeException convertoUnexpect ( Exception e ) { } public Component getComponentFromLastRenderedPage ( String path ) { } public void assertLabel ( String path , String expectedLabelText ) { } public void assertPageLink ( String path , Class expectedPageClass ) { } public void assertComponent ( String path , Class expectedComponentClass ) { Component component = getComponentFromLastRenderedPage ( path ) ; <START_BUG> Assert . assertTrue ( ( ( ( "componet<seq2seq4repair_space>'" + ( Classes . name ( component . getClass ( ) ) ) ) + "'<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>type:" ) + ( Classes . name ( expectedComponentClass ) ) ) , expectedComponentClass . isAssignableFrom ( component . getClass ( ) ) ) ; <END_BUG> } public void assertVisible ( String path ) { } public void assertInvisible ( String path ) { } public void assertContains ( String pattern ) { } public void assertListView ( String path , List expectedList ) { } public FormTester newFormTester ( String path ) { } public FormTester newFormTester ( String path , boolean fillBlankString ) { } public void clickLink ( String path ) { } public void submitForm ( String path ) { } public void setParameterForNextRequest ( String componentPath , Object value ) { } public void assertRenderedPage ( Class expectedReneredPageClass ) { } public void assertNoErrorMessage ( ) { } public void assertNoInfoMessage ( ) { } public void assertErrorMessages ( String [ ] expectedErrorMessages ) { } public void assertInfoMessages ( String [ ] expectedInfoMessages ) { } public List getMessages ( final int level ) { } public void dumpPage ( ) { } public void debugComponentTrees ( ) { } }

Fix:
Assert . assertTrue ( ( ( ( "component<seq2seq4repair_space>'" + ( Classes . name ( component . getClass ( ) ) ) ) + "'<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>type:" ) + ( Classes . name ( expectedComponentClass ) ) ) , expectedComponentClass . isAssignableFrom ( component . getClass ( ) ) ) ;
Buggy code:
public class TestLucene3xTermVectorsFormat extends BaseTermVectorsFormatTestCase { @ Override public void setUp ( ) throws Exception { <START_BUG> LuceneTestCase . PREFLEX_IMPERSONATION_IS_ACTIVE = true ; <END_BUG> super . setUp ( ) ; } @ Override protected Codec getCodec ( ) { } @ Override protected Set < Options > validOptions ( ) { } }

Fix:
LuceneTestCase . OLD_FORMAT_IMPERSONATION_IS_ACTIVE = true ;
Buggy code:
public final class JettyHelper { private static final int CONFIDENTIALPORT = 8443 ; private static final int LOW_RESOURCE_PERSIST_TIME = 2000 ; private static final int MAX_IDLE_TIME = 30000 ; private static final int MAX_THREADS = 10 ; private static Log log = LogFactory . getLog ( JettyHelper . class ) ; private JettyHelper ( ) { } public static Server getJettyServerInstance ( URL config , boolean useJettyPlus ) throws JettyHelperException { } public static Server getJettyServerInstance ( int port , String webappContextRoot , String contextPath , boolean useJettyPlus ) throws JettyHelperException { } public static Server startJetty ( int port , String webappContextRoot , String contextPath , boolean useJettyPlus ) throws JettyHelperException { } public static Server startJetty ( String jettyConfig , boolean useJettyPlus ) throws JettyHelperException { } public static boolean pingMonitorForServerStarted ( String commKey , String host , int monitorPort , int maxTries , long sleepBetweenTries ) { } public static boolean pingMonitorForServerStarted ( String commKey , String host , int monitorPort ) throws IOException { } public static void issueStopCommandToMonitor ( String commKey , String host , int monitorPort ) throws IOException , JettyMonitorException { Socket socket = null ; try { socket = new Socket ( InetAddress . getByName ( host ) , monitorPort ) ; OutputStream out = socket . getOutputStream ( ) ; out . write ( ( commKey + "\r\nstop\r\n" ) . getBytes ( ) ) ; out . flush ( ) ; InputStream is = socket . getInputStream ( ) ; String response = JettyHelper . readFromInputStream ( is ) . trim ( ) ; if ( "ACK_STOP" . equalsIgnoreCase ( response ) ) { JettyHelper . log . info ( "Monitor<seq2seq4repair_space>acknowledged<seq2seq4repair_space>stop<seq2seq4repair_space>command" ) ; } else if ( "" . equalsIgnoreCase ( response ) ) { throw new JettyMonitorException ( "monitor<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>respond<seq2seq4repair_space>with<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>ack" ) ; } else { <START_BUG> throw new JettyMonitorException ( ( "unknown<seq2seq4repair_space>response<seq2seq4repair_space>from<seq2seq4repair_space>monitor:<seq2seq4repair_space>" + response ) ) ; <END_BUG> } } catch ( JettyMonitorException e ) { JettyHelper . log . error ( e . getMessage ( ) , e ) ; throw e ; } finally { if ( socket != null ) { socket . shutdownOutput ( ) ; socket . close ( ) ; } } } private static String readFromInputStream ( InputStream inputStream ) throws IOException { } }

Fix:
throw new JettyMonitorException ( ( "unknown<seq2seq4repair_space>wicket.response<seq2seq4repair_space>from<seq2seq4repair_space>monitor:<seq2seq4repair_space>" + response ) ) ;
Buggy code:
public class MeleeAttackController extends AttackController { private Hitbox hitbox ; private double damage ; public Hitbox getHitbox ( ) { } public void setHitbox ( Hitbox hitbox ) { } public MeleeAttackController ( TangibleEntity entity ) { } public double getDamage ( ) { } public void setDamage ( double damage ) { } @ Override public boolean attack ( TangibleEntity target ) { <START_BUG> if ( ( ( hitbox ) != null ) && ( ( controlledObject ) instanceof Attackable ) ) { <END_BUG> if ( hitbox . intersects ( hitbox . parentToLocal ( target . getHitbox ( ) . getBoundsInParent ( ) ) ) ) { ( ( Attackable ) ( target ) ) . damage ( damage ) ; return true ; } } return false ; } @ Override public boolean process ( Map < Entity , Boolean > changedEntities ) { } }

Fix:
if ( ( ( hitbox ) != null ) && ( target instanceof Attackable ) ) {
Buggy code:
public class TypeReference extends SpelNodeImpl { public TypeReference ( Token payload ) { } @ Override public TypedValue getValueInternal ( ExpressionState state ) throws EvaluationException { String typename = ( ( String ) ( getChild ( 0 ) . getValueInternal ( state ) . getValue ( ) ) ) ; if ( ( ( typename . indexOf ( "." ) ) == ( - 1 ) ) && ( Character . isLowerCase ( typename . charAt ( 0 ) ) ) ) { <START_BUG> TypeCode tc = TypeCode . forName ( typename ) ; <END_BUG> if ( tc != ( TypeCode . OBJECT ) ) { return new TypedValue ( tc . getType ( ) , CLASS_TYPE_DESCRIPTOR ) ; } } return new TypedValue ( state . findType ( typename ) , CLASS_TYPE_DESCRIPTOR ) ; } @ Override public String toStringAST ( ) { } }

Fix:
TypeCode tc = TypeCode . valueOf ( typename . toUpperCase ( ) ) ;
Buggy code:
public class CopyMethodAuthorization extends WebDAVMethodAuthorization { private static final Logger log = LoggerFactory . getLogger ( CopyMethodAuthorization . class ) ; public CopyMethodAuthorization ( ) { } @ Override public AuthorizationStatus isUserAuthorized ( HttpServletRequest request , HttpServletResponse response , UserCredentials user ) { HttpHelper httpHelper = new HttpHelper ( request , response ) ; if ( ! ( httpHelper . hasDestinationHeader ( ) ) ) { return AuthorizationStatus . NOTAUTHORIZED ( SC_BAD_REQUEST , "No<seq2seq4repair_space>destination<seq2seq4repair_space>header<seq2seq4repair_space>found" ) ; } String srcPath = this . stripContext ( httpHelper . getRequestURI ( ) . getRawPath ( ) ) ; String destPath = this . stripContext ( httpHelper . getDestinationURI ( ) . getRawPath ( ) ) ; if ( srcPath . equals ( destPath ) ) { <START_BUG> return AuthorizationStatus . NOTAUTHORIZED ( SC_PRECONDITION_FAILED , "The<seq2seq4repair_space>source<seq2seq4repair_space>and<seq2seq4repair_space>destination<seq2seq4repair_space>URIs<seq2seq4repair_space>are<seq2seq4repair_space>the<seq2seq4repair_space>same!" ) ; <END_BUG> } StorageArea srcSA = getMatchingSA ( srcPath ) ; CopyMethodAuthorization . log . debug ( "srcPath<seq2seq4repair_space>{}<seq2seq4repair_space>matches<seq2seq4repair_space>storage<seq2seq4repair_space>area<seq2seq4repair_space>{}" , srcPath , srcSA . getName ( ) ) ; StorageArea destSA = getMatchingSA ( destPath ) ; CopyMethodAuthorization . log . debug ( "destPath<seq2seq4repair_space>{}<seq2seq4repair_space>matches<seq2seq4repair_space>storage<seq2seq4repair_space>area<seq2seq4repair_space>{}" , destPath , destSA . getName ( ) ) ; if ( destSA . getName ( ) . equals ( srcSA . getName ( ) ) ) { CopyMethodAuthorization . log . debug ( "source<seq2seq4repair_space>and<seq2seq4repair_space>destination<seq2seq4repair_space>storage<seq2seq4repair_space>area<seq2seq4repair_space>are<seq2seq4repair_space>the<seq2seq4repair_space>same" ) ; return super . isAuthorized ( request . getScheme ( ) , srcSA , READWRITE , user ) ; } CopyMethodAuthorization . log . debug ( "source<seq2seq4repair_space>and<seq2seq4repair_space>destination<seq2seq4repair_space>storage<seq2seq4repair_space>area<seq2seq4repair_space>are<seq2seq4repair_space>different" ) ; AuthorizationStatus status = super . isAuthorized ( request . getScheme ( ) , srcSA , READ , user ) ; if ( ! ( status . isAuthorized ( ) ) ) { return status ; } return super . isAuthorized ( request . getScheme ( ) , destSA , READWRITE , user ) ; } No newline ; at end ; of file ; }

Fix:
return AuthorizationStatus . NOTAUTHORIZED ( SC_FORBIDDEN , "The<seq2seq4repair_space>source<seq2seq4repair_space>and<seq2seq4repair_space>destination<seq2seq4repair_space>URIs<seq2seq4repair_space>are<seq2seq4repair_space>the<seq2seq4repair_space>same!" ) ;
Buggy code:
public class ActivateOperationTestCase { @ Test @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) public void testActivateOperation ( ) throws Exception { ModelNode activateOp = new ModelNode ( ) ; activateOp . get ( OP_ADDR ) . add ( SUBSYSTEM , "osgi" ) ; activateOp . get ( OP ) . set ( ACTIVATE ) ; ServiceController sc = Mockito . mock ( ServiceController . class ) ; Mockito . when ( sc . getState ( ) ) . thenReturn ( UP ) ; ServiceRegistry sr = Mockito . mock ( ServiceRegistry . class ) ; Mockito . when ( sr . getRequiredService ( FRAMEWORK_ACTIVE ) ) . thenReturn ( sc ) ; OperationContext context = Mockito . mock ( OperationContext . class ) ; Mockito . when ( context . getServiceRegistry ( true ) ) . thenReturn ( sr ) ; INSTANCE . executeRuntimeStep ( context , activateOp ) ; Mockito . verify ( sc ) . setMode ( ACTIVE ) ; <START_BUG> Mockito . verify ( context ) . completeStep ( ) ; <END_BUG> } }

Fix:
Mockito . verify ( context ) . completeStep ( NOOP_ROLLBACK_HANDLER ) ;
Buggy code:
public class EchoService implements Echo , Service < Echo > { private static final Logger log = Logger . getLogger ( EchoService . class ) ; public static final ServiceName SERVICE_NAME = JBOSS . append ( "osgi" , "example" , "target" , "service" ) ; private final InjectedValue < BundleContext > injectedBundleContext = new InjectedValue < BundleContext > ( ) ; private ServiceRegistration registration ; public static void addService ( ServiceTarget serviceTarget ) { EchoService service = new EchoService ( ) ; ServiceBuilder < Echo > serviceBuilder = serviceTarget . addService ( EchoService . SERVICE_NAME , service ) ; <START_BUG> serviceBuilder . addDependency ( SYSTEM_CONTEXT , BundleContext . class , service . injectedBundleContext ) ; <END_BUG> serviceBuilder . setInitialMode ( ACTIVE ) ; serviceBuilder . install ( ) ; EchoService . log . infof ( "Service<seq2seq4repair_space>added:<seq2seq4repair_space>%s" , EchoService . SERVICE_NAME ) ; EchoService . log . infof ( "Echo<seq2seq4repair_space>Loader:<seq2seq4repair_space>%s" , Echo . class . getClassLoader ( ) ) ; } @ Override public String echo ( String message ) { } @ Override public void start ( StartContext context ) throws StartException { } @ Override public void stop ( StopContext context ) { } @ Override public Echo getValue ( ) throws IllegalStateException { } }

Fix:
serviceBuilder . addDependency ( FRAMEWORK_ACTIVE , BundleContext . class , service . injectedBundleContext ) ;
Buggy code:
public class DataflowPauseActivityBuilder extends ActivityBuilder { public Activity build ( ) { } @ Singleton public static class DataflowPauseActivityStepBuilder implements ActivityStepBuilder { @ Override public List < ActivityStep > build ( Activity activity , Injector container ) throws Exception { } } @ Singleton public static class CheckDataflowStatusStepExecutor implements ActivityStepExecutor { @ Inject private DataflowRegistry dflRegistry ; @ Override public void execute ( ActivityExecutionContext ctx , Activity activity , ActivityStep step ) throws Exception { if ( ( DataflowLifecycleStatus . RUNNING ) != ( dflRegistry . getStatus ( ) ) ) { ctx . setAbort ( true ) ; } } } @ Singleton public static class BroadcastPauseWorkerStepExecutor implements ActivityStepExecutor { @ Inject private DataflowService service ; @ Override public void execute ( ActivityExecutionContext ctx , Activity activity , ActivityStep step ) throws Exception { DataflowRegistry dflRegistry = service . getDataflowRegistry ( ) ; <START_BUG> Node workerNodes = dflRegistry . getAllWorkersNode ( ) ; <END_BUG> List < String > workers = workerNodes . getChildren ( ) ; WaitingNodeEventListener waitingListener = new com . neverwinterdp . registry . event . WaitingRandomNodeEventListener ( dflRegistry . getRegistry ( ) ) ; for ( int i = 0 ; i < ( workers . size ( ) ) ; i ++ ) { String path = ( ( ( workerNodes . getPath ( ) ) + "//" ) + ( workers . get ( i ) ) ) + "//status" ; waitingListener . add ( path , PAUSE ) ; } dflRegistry . broadcastWorkerEvent ( DataflowEvent . PAUSE ) ; waitingListener . waitForEvents ( ( 30 * 1000 ) ) ; if ( ( waitingListener . getUndetectNodeEventCount ( ) ) > 0 ) { dflRegistry . dump ( ) ; TabularFormater formater = waitingListener . getTabularFormaterEventLogInfo ( ) ; System . err . println ( formater . getFormatText ( ) ) ; throw new Exception ( ( ( "Cannot<seq2seq4repair_space>detect<seq2seq4repair_space>the<seq2seq4repair_space>PAUSE<seq2seq4repair_space>status<seq2seq4repair_space>for<seq2seq4repair_space>" + ( waitingListener . getUndetectNodeEventCount ( ) ) ) + "<seq2seq4repair_space>workers" ) ) ; } } } @ Singleton public static class SetPauseDataflowStatusStepExecutor implements ActivityStepExecutor { @ Inject private DataflowService service ; @ Override public void execute ( ActivityExecutionContext ctx , Activity activity , ActivityStep step ) throws Exception { DataflowRegistry dflRegistry = service . getDataflowRegistry ( ) ; dflRegistry . setStatus ( DataflowLifecycleStatus . PAUSE ) ; } } }

Fix:
Node workerNodes = dflRegistry . getActiveWorkersNode ( ) ;
Buggy code:
class TypeBinding implements ITypeBinding { private static final String NO_NAME = "" ; private static final ITypeBinding [ ] NO_INTERFACES = new ITypeBinding [ 0 ] ; private static final ITypeBinding [ ] NO_DECLARED_TYPES = new ITypeBinding [ 0 ] ; private static final IVariableBinding [ ] NO_DECLARED_FIELDS = new IVariableBinding [ 0 ] ; private static final IMethodBinding [ ] NO_DECLARED_METHODS = new IMethodBinding [ 0 ] ; private org . eclipse . jdt . internal . compiler . lookup . TypeBinding binding ; private BindingResolver resolver ; public TypeBinding ( BindingResolver resolver , org . eclipse . jdt . internal . compiler . lookup . TypeBinding binding ) { } public boolean isPrimitive ( ) { <START_BUG> return binding . isBaseType ( ) ; <END_BUG> } public boolean isArray ( ) { } public ITypeBinding getElementType ( ) { } public int getDimensions ( ) { } public boolean isClass ( ) { } public boolean isInterface ( ) { } public String getName ( ) { } public IPackageBinding getPackage ( ) { } public ITypeBinding getDeclaringClass ( ) { } public ITypeBinding getSuperclass ( ) { } public ITypeBinding [ ] getInterfaces ( ) { } public int getModifiers ( ) { } public int getDeclaredModifiers ( ) { } public boolean isTopLevel ( ) { } public boolean isNested ( ) { } public boolean isMember ( ) { } public boolean isLocal ( ) { } public boolean isAnonymous ( ) { } public ITypeBinding [ ] getDeclaredTypes ( ) { } public IVariableBinding [ ] getDeclaredFields ( ) { } public IMethodBinding [ ] getDeclaredMethods ( ) { } private boolean shouldBeRemoved ( MethodBinding methodBinding ) { } public boolean isFromSource ( ) { } public int getKind ( ) { } public boolean isDeprecated ( ) { } public boolean isSynthetic ( ) { } public String getKey ( ) { } public boolean isNullType ( ) { } public String getQualifiedName ( ) { } public String toString ( ) { } }

Fix:
return ( ! ( isNullType ( ) ) ) && ( binding . isBaseType ( ) ) ;
Buggy code:
public class ContainerTypeDescription { protected String name ; protected String instantiatorClass ; protected ClassLoader classLoader ; protected IContainerInstantiator instantiator ; protected String description ; protected String [ ] argTypes ; protected String [ ] argDefaults ; protected String [ ] argNames ; protected int hashCode = 0 ; protected static final String [ ] EMPTY = new String [ 0 ] ; protected Map properties ; public ContainerTypeDescription ( String name ) { } public ContainerTypeDescription ( String name , String description ) { } public ContainerTypeDescription ( String name , String description , Map properties ) { } public ContainerTypeDescription ( ClassLoader loader , String name , String instantiatorClass , String desc ) { } public ContainerTypeDescription ( String name , String instantiatorClass , String desc ) { } public ContainerTypeDescription ( ClassLoader loader , String name , String instantiatorClass , String desc , String [ ] argTypes , String [ ] argDefaults , String [ ] argNames ) { } public ContainerTypeDescription ( ClassLoader loader , String name , String instantiatorClass , String desc , String [ ] argTypes , String [ ] argDefaults , String [ ] argNames , Map props ) { } public ContainerTypeDescription ( String name , IContainerInstantiator inst , String desc , String [ ] argTypes , String [ ] argDefaults , String [ ] argNames ) { } public ContainerTypeDescription ( String name , IContainerInstantiator inst , String desc , String [ ] argTypes , String [ ] argDefaults , String [ ] argNames , Map props ) { } public ContainerTypeDescription ( String name , IContainerInstantiator inst , String desc ) { } public String getName ( ) { } public ClassLoader getClassLoader ( ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public String toString ( ) { <START_BUG> StringBuffer b = new StringBuffer ( "SharedObjectContainerDescription[" ) ; <END_BUG> b . append ( "name:" ) . append ( name ) . append ( ";" ) ; if ( ( instantiator ) == null ) b . append ( "class:" ) . append ( instantiatorClass ) . append ( ";" ) ; else b . append ( "instantiator:" ) . append ( instantiator ) . append ( ";" ) ; b . append ( "desc:" ) . append ( description ) . append ( ";" ) ; b . append ( "argtypes:" ) . append ( Arrays . asList ( argTypes ) ) . append ( ";" ) ; b . append ( "argdefaults:" ) . append ( Arrays . asList ( argDefaults ) ) . append ( ";" ) ; b . append ( "argnames:" ) . append ( Arrays . asList ( argNames ) ) . append ( "]" ) ; return b . toString ( ) ; } protected IContainerInstantiator getInstantiator ( ) throws ClassNotFoundException , IllegalAccessException , InstantiationException { } private void initializeInstantiator ( ClassLoader cl ) throws ClassNotFoundException , IllegalAccessException , InstantiationException { } public String getDescription ( ) { } public String [ ] getArgDefaults ( ) { } public String [ ] getArgTypes ( ) { } public String [ ] getArgNames ( ) { } public Map getProperties ( ) { } }

Fix:
StringBuffer b = new StringBuffer ( "ContainerTypeDescription[" ) ;
Buggy code:
public abstract class Record implements Cloneable , Comparable { protected Name name ; protected int type ; protected int dclass ; protected int ttl ; private boolean empty ; private static final Record [ ] knownRecords = new Record [ 256 ] ; private static final Class [ ] emptyClassArray = new Class [ 0 ] ; private static final Object [ ] emptyObjectArray = new Object [ 0 ] ; private static final DecimalFormat byteFormat = new DecimalFormat ( ) ; protected Record ( ) { } Record ( Name name , int type , int dclass , int ttl ) { } private static final Record getTypedObject ( int type ) { } abstract Record rrFromWire ( Name name , int type , int dclass , int ttl , int length , DataByteInputStream in ) throws IOException { } private static Record newRecord ( Name name , int type , int dclass , int ttl , int length , DataByteInputStream in ) throws IOException { } public static Record newRecord ( Name name , int type , int dclass , int ttl , int length , byte [ ] data ) { } public static Record newRecord ( Name name , int type , int dclass , int ttl , byte [ ] data ) { } public static Record newRecord ( Name name , int type , int dclass , int ttl ) { } public static Record newRecord ( Name name , int type , int dclass ) { } static Record fromWire ( DataByteInputStream in , int section ) throws IOException { } public static Record fromWire ( byte [ ] b , int section ) throws IOException { } void toWire ( DataByteOutputStream out , int section , Compression c ) { } public byte [ ] toWire ( int section ) { } void toWireCanonical ( DataByteOutputStream out ) { } public byte [ ] toWireCanonical ( ) { } public byte [ ] rdataToWireCanonical ( ) { } public abstract String rdataToString ( ) { } public String toString ( ) { } abstract Record rdataFromString ( Name name , int dclass , int ttl , Tokenizer st , Name origin ) throws IOException { } protected static String remainingStrings ( Tokenizer st ) throws IOException { } protected static byte [ ] byteArrayFromString ( String s ) throws TextParseException { } protected static String byteArrayToString ( byte [ ] array , boolean quote ) { } public static Record fromString ( Name name , int type , int dclass , int ttl , Tokenizer st , Name origin ) throws IOException { } public static Record fromString ( Name name , int type , int dclass , int ttl , String s , Name origin ) throws IOException { } public Name getName ( ) { } public int getType ( ) { } public int getRRsetType ( ) { } public int getDClass ( ) { } public int getTTL ( ) { } abstract void rrToWire ( DataByteOutputStream out , Compression c , boolean canonical ) { } public boolean equals ( Object arg ) { } public int hashCode ( ) { } private Record cloneRecord ( ) { } public Record withName ( Name name ) { } Record withDClass ( int dclass , int ttl ) { Record rec = cloneRecord ( ) ; rec . dclass = dclass ; <START_BUG> rec . ttl = 0 ; <END_BUG> return rec ; } public int compareTo ( Object o ) { } public Name getAdditionalName ( ) { } }

Fix:
rec . ttl = ttl ;
Buggy code:
public abstract class AbstractHeaderCache { private static final Logger LOG = Logger . getLogger ( "org.columba.mail.folder.headercache" ) ; protected HeaderList headerList ; protected File headerFile ; private boolean headerCacheLoaded ; protected String [ ] columnNames ; protected ObjectWriter writer ; protected ObjectReader reader ; protected List additionalHeaderfields ; public AbstractHeaderCache ( File headerFile ) { } public ColumbaHeader createHeaderInstance ( ) { } public boolean isHeaderCacheLoaded ( ) { } public boolean exists ( Object uid ) throws Exception { } public int count ( ) { } public void remove ( Object uid ) { } public void add ( ColumbaHeader header ) throws Exception { } public HeaderList getHeaderList ( ) throws IOException { } public abstract void load ( ) throws Exception { } public abstract void save ( ) throws Exception { } protected void loadHeader ( ColumbaHeader h ) throws Exception { } protected void saveHeader ( ColumbaHeader h ) throws Exception { Boolean [ ] b = new Boolean [ INTERNAL_COMPRESSED_HEADERFIELDS . length ] ; for ( int i = 0 ; i < ( b . length ) ; i ++ ) { b [ i ] = ( ( Boolean ) ( h . get ( CachedHeaderfields . INTERNAL_COMPRESSED_HEADERFIELDS [ i ] ) ) ) ; if ( ( b [ i ] ) == null ) { b [ i ] = Boolean . FALSE ; } } writer . writeObject ( new Integer ( BooleanCompressor . compress ( b ) ) ) ; String [ ] columnNames = CachedHeaderfields . INTERNAL_HEADERFIELDS ; Class [ ] columnTypes = CachedHeaderfields . INTERNAL_HEADERFIELDS_TYPE ; Object o ; for ( int j = 0 ; j < ( columnNames . length ) ; j ++ ) { o = h . get ( columnNames [ j ] ) ; if ( ( columnTypes [ j ] ) == ( Integer . class ) ) writer . writeInt ( ( ( Integer ) ( o ) ) . intValue ( ) ) ; else if ( ( columnTypes [ j ] ) == ( Date . class ) ) { writer . writeLong ( ( ( Date ) ( o ) ) . getTime ( ) ) ; } else if ( ( columnTypes [ j ] ) == ( Color . class ) ) { writer . writeInt ( ( ( Color ) ( o ) ) . getRGB ( ) ) ; } else if ( ( columnTypes [ j ] ) == ( Address . class ) ) { if ( o instanceof Address ) writer . writeString ( ( ( Address ) ( o ) ) . toString ( ) ) ; else writer . writeString ( ( ( String ) ( o ) ) ) ; } else writer . writeString ( o . toString ( ) ) ; } <START_BUG> columnNames = CachedHeaderfields . DEFAULT_HEADERFIELDS ; <END_BUG> for ( int j = 0 ; j < ( columnNames . length ) ; j ++ ) { String v = ( ( String ) ( h . get ( columnNames [ j ] ) ) ) ; if ( v == null ) v = "" ; writer . writeString ( v ) ; } } public void setHeaderCacheLoaded ( boolean b ) { } public void reset ( ) { } }

Fix:
columnNames = CachedHeaderfields . getDefaultHeaderfields ( ) ;
Buggy code:
public class MarkMessageCommand extends FolderCommand { public static final int MARK_AS_READ = 0 ; public static final int MARK_AS_FLAGGED = 1 ; public static final int MARK_AS_EXPUNGED = 2 ; public static final int MARK_AS_ANSWERED = 3 ; protected Object [ ] uids ; protected Folder folder ; protected int markVariant ; public MarkMessageCommand ( FrameController frameController , DefaultCommandReference [ ] references ) { } public void updateGUI ( ) throws Exception { } public void execute ( Worker worker ) throws Exception { FolderCommandReference [ ] r = ( ( FolderCommandReference [ ] ) ( getReferences ( ) ) ) ; uids = r [ 0 ] . getUids ( ) ; folder = ( ( Folder ) ( r [ 0 ] . getFolder ( ) ) ) ; markVariant = r [ 0 ] . getMarkVariant ( ) ; log . debug ( ( "src=" + ( folder ) ) ) ; <START_BUG> folder . markMessage ( MessageNode . toUidArray ( ( ( MessageNode [ ] ) ( uids ) ) ) , markVariant , worker ) ; <END_BUG> } }

Fix:
folder . markMessage ( r [ 0 ] . getUids ( ) , markVariant , worker ) ;
Buggy code:
public class DescriptorHandler extends HandlerBase { private static final String EJB_REF = "ejb-ref" ; private static final String HOME_INTERFACE = "home" ; private static final String REMOTE_INTERFACE = "remote" ; private static final String BEAN_CLASS = "ejb-class" ; private static final String PK_CLASS = "prim-key-class" ; protected String currentElement = null ; protected String currentText = null ; protected Hashtable ejbFiles = null ; private Hashtable fileDTDs = new Hashtable ( ) ; private Hashtable resourceDTDs = new Hashtable ( ) ; private boolean inEJBRef = false ; private File srcDir ; public DescriptorHandler ( File srcDir ) { } public void registerDTD ( String publicId , String location ) { } public InputSource resolveEntity ( String publicId , String systemId ) throws SAXException { } public Hashtable getFiles ( ) { } public void startDocument ( ) throws SAXException { } public void startElement ( String name , AttributeList attrs ) throws SAXException { } public void endElement ( String name ) throws SAXException { } public void characters ( char [ ] ch , int start , int length ) throws SAXException { } protected void processElement ( ) { if ( inEJBRef ) { return ; } if ( ( ( ( currentElement . equals ( DescriptorHandler . HOME_INTERFACE ) ) || ( currentElement . equals ( DescriptorHandler . REMOTE_INTERFACE ) ) ) || ( currentElement . equals ( DescriptorHandler . BEAN_CLASS ) ) ) || ( currentElement . equals ( DescriptorHandler . PK_CLASS ) ) ) { File classFile = null ; <START_BUG> String className = currentText ; <END_BUG> if ( ! ( className . startsWith ( "java.lang" ) ) ) { className = className . replace ( '.' , File . separatorChar ) ; className += ".class" ; classFile = new File ( srcDir , className ) ; ejbFiles . put ( className , classFile ) ; } } } }

Fix:
String className = currentText . trim ( ) ;
Buggy code:
public class AdminLogin extends Activity { private EditText user ; private EditText pass ; private Button login ; private TextView status ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public class AdminSigninActivity extends AsyncTask < String , Void , String > { TextView statuss ; ProgressDialog progress ; private Context context ; private int byGetOrPost = 0 ; public AdminSigninActivity ( AdminLogin context , TextView status ) { } protected void onPreExecute ( ) { } @ Override protected String doInBackground ( String ... arg0 ) { try { String username = ( ( String ) ( arg0 [ 0 ] ) ) ; String password = ( ( String ) ( arg0 [ 1 ] ) ) ; <START_BUG> String link = "http:////moonblade.in//bloodbankcet//admin//userlogin.php" ; <END_BUG> String data = ( ( URLEncoder . encode ( "username" , "UTF-8" ) ) + "=" ) + ( URLEncoder . encode ( username , "UTF-8" ) ) ; data += ( ( "&" + ( URLEncoder . encode ( "password" , "UTF-8" ) ) ) + "=" ) + ( URLEncoder . encode ( password , "UTF-8" ) ) ; URL url = new URL ( link ) ; URLConnection conn = url . openConnection ( ) ; conn . setDoOutput ( true ) ; OutputStreamWriter wr = new OutputStreamWriter ( conn . getOutputStream ( ) ) ; wr . write ( data ) ; wr . flush ( ) ; BufferedReader reader = new BufferedReader ( new InputStreamReader ( conn . getInputStream ( ) ) ) ; StringBuilder sb = new StringBuilder ( ) ; String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { sb . append ( line ) ; break ; } return sb . toString ( ) ; } catch ( Exception e ) { return new String ( ( "Exception:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } } @ Override protected void onPostExecute ( String result ) { } } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
String link = "http:////moonblade.in//bloodbankcet//admin//adminlogin.php" ;
Buggy code:
public class MongoCachedQueueStore implements CachedQueueStore < Object > { protected static final Logger logger = LoggerFactory . getLogger ( MongoCachedQueueStore . class ) ; public static Timer storeTimer = Metrics . newTimer ( MongoCachedQueueStore . class , "store" , TimeUnit . MILLISECONDS , TimeUnit . SECONDS ) ; public static Timer loadTimer = Metrics . newTimer ( MongoCachedQueueStore . class , "load" , TimeUnit . MILLISECONDS , TimeUnit . SECONDS ) ; public static Timer loadAllTimer = Metrics . newTimer ( MongoCachedQueueStore . class , "loadAll" , TimeUnit . MILLISECONDS , TimeUnit . SECONDS ) ; public static Timer deleteTimer = Metrics . newTimer ( MongoCachedQueueStore . class , "delete" , TimeUnit . MILLISECONDS , TimeUnit . SECONDS ) ; private String storageName ; private MongoTemplate mongoTemplate ; private MongoDBConverter converter ; private DBCollection coll ; private int batchSize ; public MongoCachedQueueStore ( String storageName , MongoTemplate mongoTemplate , CachedQueueStoreConfig config ) { } public MongoTemplate getMongoTemplate ( ) { } public String getStorageName ( ) { } @ Override public void delete ( Long aLong ) { } @ Override public void store ( Long aLong , Object taskQueueItem ) { } @ Override public void storeAll ( Map < Long , Object > longTaskQueueItemMap ) { } @ Override public void deleteAll ( Collection < Long > longs ) { } @ Override public void clear ( ) { } @ Override public Object load ( Long aLong ) { } @ Override public Map < Long , Object > loadAll ( Collection < Long > longs ) { } @ Override public Map < Long , Object > loadAll ( long from , long to ) { } public long getMinItemId ( ) { } public long getMaxItemId ( ) { } private long getFirstItemIdByAscDesc ( boolean asc ) { <START_BUG> long result = - 1L ; <END_BUG> final DBObject sortCommand = new BasicDBObject ( ) ; sortCommand . put ( "_id" , ( asc ? 1 : - 1 ) ) ; final DBObject val ; try ( DBCursor cursor = coll . find ( ) . sort ( sortCommand ) . limit ( 1 ) ) { if ( ( cursor . hasNext ( ) ) && ( ( val = cursor . next ( ) ) != null ) ) { result = ( ( Long ) ( val . get ( "_id" ) ) ) ; } } return result ; } @ Override public Set < Long > loadAllKeys ( ) { } }

Fix:
long result = ( asc ) ? 0 : - 1 ;
Buggy code:
public class LogStoreParticipantRecoveryHandler implements OperationStepHandler { private LogStoreParticipantRefreshHandler refreshHandler = null ; public LogStoreParticipantRecoveryHandler ( LogStoreParticipantRefreshHandler refreshHandler ) { } public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { MBeanServer mbs = TransactionExtension . getMBeanServer ( context ) ; final Resource resource = context . readResource ( EMPTY_ADDRESS ) ; try { final ObjectName on = LogStoreResource . getObjectName ( resource ) ; mbs . invoke ( on , "clearHeuristic" , null , null ) ; } catch ( Exception e ) { throw new OperationFailedException ( "JMX<seq2seq4repair_space>error:<seq2seq4repair_space>" , e ) ; } context . addStep ( refreshHandler , IMMEDIATE ) ; <START_BUG> context . completeStep ( ) ; <END_BUG> } }

Fix:
context . completeStep ( NOOP_ROLLBACK_HANDLER ) ;
Buggy code:
public class Util { private static int debugLevel = 0 ; private static SimpleDateFormat errDateFormat = new SimpleDateFormat ( "yyyy-MM-dd<seq2seq4repair_space>HH:mm:ssZ" ) ; public static int getDbgLevel ( ) { } public static int setDbgLevel ( int value ) { } public static void dbgOut ( String s , int mLevel ) { if ( ( ( Util . debugLevel ) > 0 ) && ( ( Util . debugLevel ) >= mLevel ) ) { <START_BUG> System . out . println ( ( ( ( ( ( Util . printTime ( ) ) + "<seq2seq4repair_space>(DBG|" ) + ( Integer . toString ( Util . debugLevel ) ) ) + ")<seq2seq4repair_space>" ) + s ) ) ; <END_BUG> } } public static void errOut ( Exception e ) { } public static void errOut ( Exception e , boolean fatal ) { } public static void setDbgOut ( File file ) { } public static void setDbgOut ( PrintStream stream ) { } public static void setDbgOut ( String path ) { } public static void setErrOut ( File file ) { } public static void setErrOut ( PrintStream stream ) { } public static void setErrOut ( String path ) { } private static String printTime ( ) { } }

Fix:
System . out . println ( ( ( ( ( ( Util . printTime ( ) ) + "<seq2seq4repair_space>(DBG|" ) + ( Integer . toString ( mLevel ) ) ) + ")<seq2seq4repair_space>" ) + s ) ) ;
Buggy code:
public class AssertStatement extends Statement { public Expression assertExpression ; public Expression exceptionArgument ; int preAssertInitStateIndex = - 1 ; private FieldBinding assertionSyntheticFieldBinding ; public AssertStatement ( Expression exceptionArgument , Expression assertExpression , int startPosition ) { } public AssertStatement ( Expression assertExpression , int startPosition ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public void resolve ( BlockScope scope ) { <START_BUG> assertExpression . resolveTypeExpecting ( scope , BooleanBinding ) ; <END_BUG> if ( ( exceptionArgument ) != null ) { TypeBinding exceptionArgumentType = exceptionArgument . resolveType ( scope ) ; if ( exceptionArgumentType != null ) { int id = exceptionArgumentType . id ; switch ( id ) { case TypeIds . T_void : scope . problemReporter ( ) . illegalVoidExpression ( exceptionArgument ) ; default : id = TypeIds . T_JavaLangObject ; case TypeIds . T_boolean : case TypeIds . T_byte : case TypeIds . T_char : case TypeIds . T_short : case TypeIds . T_double : case TypeIds . T_float : case TypeIds . T_int : case TypeIds . T_long : case TypeIds . T_JavaLangString : exceptionArgument . implicitConversion = ( id << 4 ) + id ; } } } } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { } public StringBuffer printStatement ( int tab , StringBuffer output ) { } }

Fix:
assertExpression . resolveTypeExpecting ( scope , TypeBinding . BOOLEAN ) ;
Buggy code:
public class NoMoreStockAdjustmentItem { private Long id ; private NoMoreStockAdjustment parent ; private SalesInvoiceItem salesInvoiceItem ; private Integer quantity ; public Long getId ( ) { } public void setId ( Long id ) { } public NoMoreStockAdjustment getParent ( ) { } public void setParent ( NoMoreStockAdjustment parent ) { } public Integer getQuantity ( ) { } public void setQuantity ( Integer quantity ) { } public SalesInvoiceItem getSalesInvoiceItem ( ) { } public void setSalesInvoiceItem ( SalesInvoiceItem salesInvoiceItem ) { } public BigDecimal getAmount ( ) { if ( ( ( salesInvoiceItem ) == null ) || ( ( quantity ) == null ) ) { return null ; } else { <START_BUG> return salesInvoiceItem . getUnitPrice ( ) . multiply ( new BigDecimal ( quantity ) ) ; <END_BUG> } } public BigDecimal getUnitPrice ( ) { } public BigDecimal getCost ( ) { } public BigDecimal getTotalCost ( ) { } No newline ; at end ; of file ; }

Fix:
return getUnitPrice ( ) . multiply ( new BigDecimal ( quantity ) ) ;
Buggy code:
public final class JUnitHelper { private static final String SUITE_METHODNAME = "suite" ; public static String [ ] parseTestString ( String testname ) { } public static Test getTest ( ClassLoader loader , String classname ) throws Exception { } public static Test getTest ( Class clazz ) { } public static File getResourceEntry ( String resource ) { URL url = JUnitHelper . class . getResource ( resource ) ; <START_BUG> if ( url != null ) { <END_BUG> return null ; } String u = url . toString ( ) ; if ( u . startsWith ( "jar:file:" ) ) { int pling = u . indexOf ( "!" ) ; String jarName = u . substring ( 9 , pling ) ; return new File ( new File ( jarName ) . getAbsolutePath ( ) ) ; } else if ( u . startsWith ( "file:" ) ) { int tail = u . indexOf ( resource ) ; String dirName = u . substring ( 5 , tail ) ; return new File ( new File ( dirName ) . getAbsolutePath ( ) ) ; } return null ; } public static void addClasspathEntry ( Path path , String resource ) { } }

Fix:
if ( url == null ) {
Buggy code:
public class MerkleBTree { public static final int MAX_NODE_CHILDREN = 16 ; public final ContentAddressedStorage storage ; public final int maxChildren ; public TreeNode root ; public MerkleBTree ( TreeNode root , byte [ ] rootHash , ContentAddressedStorage storage , int maxChildren ) { } public static MerkleBTree create ( byte [ ] rootHash , ContentAddressedStorage dht ) throws IOException { } public byte [ ] get ( byte [ ] rawKey ) throws IOException { } public byte [ ] put ( byte [ ] rawKey , byte [ ] value ) throws IOException { } public byte [ ] delete ( byte [ ] rawKey ) throws IOException { TreeNode newRoot = root . delete ( new ByteArrayWrapper ( rawKey ) , storage , maxChildren ) ; if ( root . hash . isPresent ( ) ) storage . remove ( root . hash . get ( ) ) ; if ( ! ( newRoot . hash . isPresent ( ) ) ) { <START_BUG> root = new TreeNode ( newRoot . keys , storage . put ( root . serialize ( ) ) ) ; <END_BUG> } else root = newRoot ; return root . hash . get ( ) ; } public int size ( ) throws IOException { } public void print ( PrintStream w ) throws IOException { } }

Fix:
root = new TreeNode ( newRoot . keys , storage . put ( newRoot . serialize ( ) ) ) ;