nus-yam/ex-repair huggingface dataset:
Buggy code:
public class VentilateState extends WorkflowInvoice { @ Inject private SequenceService sequenceService ; @ Inject private MoveService moveService ; @ Inject private AccountConfigService accountConfigService ; @ Override public void init ( Invoice invoice ) { } @ Override public void process ( ) throws AxelorException { } protected void updatePaymentSchedule ( ) { } protected void setDate ( ) throws AxelorException { } protected void checkInvoiceDate ( Sequence sequence ) throws AxelorException { } protected LocalDate getDueDate ( ) { } protected void setMove ( ) throws AxelorException { } protected void setStatus ( ) { } protected void setInvoiceId ( Sequence sequence ) throws AxelorException { <START_BUG> if ( ! ( Strings . isNullOrEmpty ( invoice . getInvoiceId ( ) ) ) ) { <END_BUG> return ; } invoice . setInvoiceId ( sequenceService . setRefDate ( invoice . getInvoiceDate ( ) ) . getSequenceNumber ( sequence ) ) ; if ( ( invoice . getInvoiceId ( ) ) != null ) { return ; } throw new AxelorException ( String . format ( I18n . get ( VENTILATE_STATE_4 ) , invoice . getCompany ( ) . getName ( ) ) , IException . CONFIGURATION_ERROR ) ; } protected Sequence getSequence ( ) throws AxelorException { } No newline ; at end ; of file ; }

Fix:
if ( ( ! ( Strings . isNullOrEmpty ( invoice . getInvoiceId ( ) ) ) ) && ( ! ( invoice . getInvoiceId ( ) . contains ( "*" ) ) ) ) {
Buggy code:
public class HandleTracker extends AbstractTool { private Handle fAnchorHandle ; public HandleTracker ( DrawingEditor newDrawingEditor , Handle anchorHandle ) { } public void mouseDown ( MouseEvent e , int x , int y ) { } public void mouseDrag ( MouseEvent e , int x , int y ) { } public void mouseUp ( MouseEvent e , int x , int y ) { <START_BUG> super . mouseDrag ( e , x , y ) ; <END_BUG> fAnchorHandle . invokeEnd ( x , y , fAnchorX , fAnchorY , view ( ) ) ; } public void activate ( ) { } }

Fix:
super . mouseUp ( e , x , y ) ;
Buggy code:
public class ShowCaseDbInitializerTest { ApplicationContext context ; @ Test public void initializeDatabase ( ) throws IOException { ApplicationContext context = new StaticApplicationContext ( ) ; Path directory = Files . createTempDirectory ( "database" ) ; ShowCaseDbInitializer showCaseDbInitializer = new ShowCaseDbInitializer ( context ) ; HsqlServerBean serverBean = showCaseDbInitializer . createDatabase ( directory ) ; try { serverBean . startDatabase ( ) ; <START_BUG> DataSource dataSource = serverBean . getDataSource ( ) ; <END_BUG> assertConent ( dataSource ) ; } finally { serverBean . stopDatabase ( ) ; deleteDirectory ( directory ) ; } } private void assertConent ( DataSource dataSource ) { } private void deleteDirectory ( Path path ) throws IOException { } }

Fix:
DataSource dataSource = serverBean . createDataSource ( ) ;
Buggy code:
public class SoundAdapter extends SoundProgressAdapter < SoundAdapter . ViewHolder > { private static final String TAG = SoundAdapter . class . getName ( ) ; private static final int VIEWPAGER_INDEX_SOUND_CONTROLS = 1 ; private final String parentFragmentTag ; private final int heightListItem ; private final int heightShadow ; private SoundAdapter . OnItemDeleteListener onItemDeleteListener ; public SoundAdapter ( SoundSheetFragment parent ) { } @ SuppressWarnings ( "unused" ) public void onEvent ( MediaPlayerStateChangedEvent event ) { } public void setOnItemDeleteListener ( SoundAdapter . OnItemDeleteListener onItemDeleteListener ) { } private EnhancedMediaPlayer getItem ( int position ) { List < EnhancedMediaPlayer > players = this . getValues ( ) ; <START_BUG> if ( position > ( players . size ( ) ) ) <END_BUG> return null ; return players . get ( position ) ; } @ Override protected List < EnhancedMediaPlayer > getValues ( ) { } @ Override public int getItemCount ( ) { } @ Override public SoundAdapter . ViewHolder onCreateViewHolder ( ViewGroup parent , int viewType ) { } @ Override public void onBindViewHolder ( SoundAdapter . ViewHolder holder , int position ) { } public class ViewHolder extends DismissibleItemViewHolder implements View . OnClickListener , SeekBar . OnSeekBarChangeListener , CustomEditText . OnTextEditedListener { private final View container ; private final CustomEditText name ; private final View play ; private final View loop ; private final View inPlaylist ; private final View stop ; private final View fadeOut ; private final View settings ; private final SeekBar timePosition ; private final View shadowBottomDeleteViewLeft ; private final View shadowBottomDeleteViewRight ; private final View shadowBottom ; public ViewHolder ( View itemView ) { } @ Override protected void bindData ( int positionInDataSet ) { } private void enableShadowOnLastItem ( ) { } private void disableShadow ( ) { } @ Override protected Handler getHandler ( ) { } @ Override protected PagerAdapter getPagerAdapter ( ) { } @ Override protected int getIndexOfContentPage ( ) { } @ Override public void onPageScrolled ( int position , float positionOffset , int positionOffsetPixels ) { } @ Override public void onPageScrollStateChanged ( int state ) { } @ Override protected void delete ( ) { } @ Override public void onTextEdited ( String text ) { } @ Override public void onClick ( View view ) { } @ Override public void onProgressChanged ( SeekBar seekBar , int progress , boolean fromUser ) { } @ Override public void onStartTrackingTouch ( SeekBar seekBar ) { } @ Override public void onStopTrackingTouch ( SeekBar seekBar ) { } } private class SoundItemPagerAdapter extends PagerAdapter { @ Override public int getCount ( ) { } @ Override public boolean isViewFromObject ( View view , Object object ) { } @ Override public Object instantiateItem ( ViewGroup container , int position ) { } } public static interface OnItemDeleteListener { public void onItemDelete ( EnhancedMediaPlayer data , int position ) { } } }

Fix:
if ( position >= ( players . size ( ) ) )
Buggy code:
public class Markup implements IMarkup { private static final Log log = LogFactory . getLog ( Markup . class ) ; private MarkupFragment markup ; private MarkupFragment markupFragments ; private Map < String , MarkupFragment > pathToFragment = new HashMap < String , MarkupFragment > ( ) ; private MarkupResourceStream resource ; private String xmlDeclaration ; private String encoding ; private String wicketNamespace ; private String wicketId ; private Map < String , Integer > componentMap ; Markup ( ) { } public MarkupElement get ( final int index ) { } public final MarkupResourceStream getResource ( ) { } public int size ( ) { } public String getXmlDeclaration ( ) { } public String getEncoding ( ) { } public String getWicketNamespace ( ) { } final void setEncoding ( final String encoding ) { } public final void setWicketNamespace ( final String wicketNamespace ) { } final void setXmlDeclaration ( final String xmlDeclaration ) { } final void setResource ( final MarkupResourceStream resource ) { } public final void addMarkupElement ( final MarkupElement markupElement ) { } public final void addMarkupElement ( final int pos , final MarkupElement markupElement ) { } final void makeImmutable ( ) { } public final MarkupFragment getMarkupFragments ( ) { } public Iterator < MarkupElement > iterator ( ) { } public int findTag ( final String path ) { } public MarkupFragment findMarkupFragment ( final String path , final boolean throwException ) { } private void initialize ( ) { } private void initializeMarkupFragments ( ) { } private StringBuffer setComponentPathForTag ( final StringBuffer tagPath , final ComponentTag tag , final int tagIndex ) { if ( ( ( tag . isOpen ( ) ) || ( tag . isOpenClose ( ) ) ) && ( tag . getAttributes ( ) . containsKey ( wicketId ) ) ) { int size = tagPath . length ( ) ; if ( size > 0 ) { tagPath . append ( TAG_PATH_SEPARATOR ) ; } tagPath . append ( tag . getId ( ) ) ; <START_BUG> this . componentMap . put ( tagPath . toString ( ) , new Integer ( tagIndex ) ) ; <END_BUG> if ( ( tag . isOpenClose ( ) ) || ( tag . hasNoCloseTag ( ) ) ) { tagPath . setLength ( size ) ; } } else if ( ( tag . isClose ( ) ) && ( tagPath != null ) ) { if ( ( ( tag . getOpenTag ( ) ) == null ) || ( tag . getOpenTag ( ) . getAttributes ( ) . containsKey ( wicketId ) ) ) { final int index = tagPath . lastIndexOf ( String . valueOf ( TAG_PATH_SEPARATOR ) ) ; if ( index != ( - 1 ) ) { tagPath . setLength ( index ) ; } else { tagPath . setLength ( 0 ) ; } } } return tagPath ; } public String toDebugString ( ) { } @ Override public String toString ( ) { } }

Fix:
this . componentMap . put ( tagPath . toString ( ) , Integer . valueOf ( tagIndex ) ) ;
Buggy code:
public class HeartbeatHandler < T extends EngineWireNetworkContext > extends AbstractSubHandler < T > implements HeartbeatEventHandler , Demarshallable , WriteMarshallable { static final Logger LOG = LoggerFactory . getLogger ( SimpleEngineMain . class ) ; private final long heartbeatIntervalMs ; private final long heartbeatTimeoutMs ; private final AtomicBoolean hasHeartbeats = new AtomicBoolean ( ) ; private volatile long lastTimeMessageReceived ; private ConnectionListener connectionMonitor ; private Timer timer ; @ UsedViaReflection protected HeartbeatHandler ( @ NotNull WireIn w ) { } private HeartbeatHandler ( long heartbeatTimeoutMs , long heartbeatIntervalMs ) { } private static WriteMarshallable heartbeatHandler ( final long heartbeatTimeoutMs , final long heartbeatIntervalMs , final long cid ) { } @ Override public void onInitialize ( WireOut outWire ) { } private void startPeriodicallySendingHeartbeats ( WriteMarshallable heartbeatMessage ) { } @ Override public void writeMarshallable ( @ NotNull WireOut w ) { } @ Override public void onRead ( @ NotNull WireIn inWire , @ NotNull WireOut outWire ) { } @ Override public void close ( ) { } private volatile long lastPing = 0 ; public void onMessageReceived ( ) { lastTimeMessageReceived = System . currentTimeMillis ( ) ; <START_BUG> long currentSecond = TimeUnit . MILLISECONDS . toSeconds ( System . currentTimeMillis ( ) ) ; <END_BUG> if ( ( lastPing ) != currentSecond ) { HeartbeatHandler . LOG . info ( ( "lastTimeMessageReceived=" + ( lastTimeMessageReceived ) ) ) ; lastPing = currentSecond ; } } private VanillaEventHandler heartbeatCheck ( ) { } private void startPeriodicHeartbeatCheck ( ) { } private boolean hasReceivedHeartbeat ( ) { } public static class Factory implements Function < ClusterContext , WriteMarshallable > , Demarshallable { @ UsedViaReflection private Factory ( WireIn w ) { } @ Override public WriteMarshallable apply ( ClusterContext clusterContext ) { } } }

Fix:
long currentSecond = TimeUnit . MILLISECONDS . toSeconds ( lastTimeMessageReceived ) ;
Buggy code:
public class Test { public static void main ( String [ ] args ) { } public static void ub12 ( ) { Frame frame = Frame . create ( "" , 21 , 14 ) ; Point point = new Point ( 10.5 , 7 ) ; Polygon [ ] polygons = new Polygon [ ] { ConvexHull . grahamScan ( null , Test . randomPoints ( 1 , 5 , 1 , 13 , 16 ) ) , ConvexHull . grahamScan ( null , Test . randomPoints ( 6 , 10 , 2 , 6 , 8 ) ) , ConvexHull . grahamScan ( null , Test . randomPoints ( 6 , 10 , 9 , 13 , 8 ) ) , ConvexHull . grahamScan ( null , Test . randomPoints ( 16 , 20 , 1 , 13 , 16 ) ) , ConvexHull . grahamScan ( null , Test . randomPoints ( 11 , 15 , 1 , 5 , 8 ) ) , ConvexHull . grahamScan ( null , Test . randomPoints ( 11 , 15 , 8 , 12 , 8 ) ) } ; <START_BUG> frame . draw ( point , Color . RED ) ; <END_BUG> for ( Polygon p : polygons ) frame . draw ( p , Color . BLACK ) ; RotationalSweep . visiblePoints ( frame , point , polygons ) ; } public static void ub7 ( String [ ] args ) { } public static void ub6 ( ) { } public static void ub5 ( ) { } public static void ub3 ( ) { } public static void ub2 ( ) { } public static void ub1 ( ) { } public static Point [ ] randomPoints ( double minX , double maxX , double minY , double maxY , int total ) { } public static void fortunesSweep ( ) { } }

Fix:
frame . draw ( point , Color . BLUE ) ;
Buggy code:
public class TestStressIndexing extends TestCase { private static final Analyzer ANALYZER = new SimpleAnalyzer ( ) ; private static final Random RANDOM = new Random ( ) ; private static Searcher SEARCHER ; private static int RUN_TIME_SEC = 15 ; private static class IndexerThread extends Thread { IndexModifier modifier ; int nextID ; public int count ; boolean failed ; public IndexerThread ( IndexModifier modifier ) { } public void run ( ) { } } private static class SearcherThread extends Thread { private Directory directory ; public int count ; boolean failed ; public SearcherThread ( Directory directory ) { } public void run ( ) { } } public void runStressTest ( Directory directory ) throws Exception { } public void testStressIndexAndSearching ( ) throws Exception { <START_BUG> Directory directory = new RAMDirectory ( ) ; <END_BUG> runStressTest ( directory ) ; directory . close ( ) ; String tempDir = System . getProperty ( "java.io.tmpdir" ) ; File dirPath = new File ( tempDir , "lucene.test.stress" ) ; directory = FSDirectory . getDirectory ( dirPath ) ; runStressTest ( directory ) ; directory . close ( ) ; rmDir ( dirPath ) ; } private void rmDir ( File dir ) { } }

Fix:
Directory directory = new MockRAMDirectory ( ) ;
Buggy code:
public abstract class ResponseCommand extends FileConfiguredDubBotCommand { @ Autowired protected DubtrackService dubtrackService ; protected abstract String getConfigFilePath ( ) { } @ Override public void execute ( DubChatPayload chatPayload ) { ResponseConfiguration responseConfiguration = new Gson ( ) . fromJson ( configurationJson . toString ( ) , ResponseConfiguration . class ) ; Random random = new Random ( ) ; <START_BUG> Integer randomInt = random . nextInt ( ( ( responseConfiguration . getResponses ( ) . size ( ) ) + 1 ) ) ; <END_BUG> String response = responseConfiguration . getResponses ( ) . get ( randomInt ) ; dubtrackService . sendMessage ( response . replaceAll ( "<<username>>" , chatPayload . getUser ( ) . getUsername ( ) ) ) ; } }

Fix:
Integer randomInt = random . nextInt ( responseConfiguration . getResponses ( ) . size ( ) ) ;
Buggy code:
public class Group extends Composite { NSView contentView ; String text = "" ; public Group ( Composite parent , int style ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } NSView contentView ( ) { } void createHandle ( ) { } NSFont defaultNSFont ( ) { } void deregister ( ) { } void drawBackground ( int id , NSGraphicsContext context , NSRect rect ) { } NSView eventView ( ) { } public Rectangle getClientArea ( ) { } String getNameText ( ) { } public String getText ( ) { } float getThemeAlpha ( ) { } void register ( ) { } void releaseHandle ( ) { } void setFont ( NSFont font ) { } void setForeground ( float [ ] color ) { NSColor nsColor ; if ( color == null ) { <START_BUG> return ; <END_BUG> } else { nsColor = NSColor . colorWithDeviceRed ( color [ 0 ] , color [ 1 ] , color [ 2 ] , 1 ) ; } NSTextFieldCell cell = new NSTextFieldCell ( ( ( NSBox ) ( view ) ) . titleCell ( ) . id ) ; cell . setTextColor ( nsColor ) ; } public void setText ( String string ) { } }

Fix:
nsColor = NSColor . textColor ( ) ;
Buggy code:
public class CompleteWord extends JWindow { public static void completeWord ( View view ) { } public CompleteWord ( View view , String word , Vector completions , Point location , String noWordSep ) { } public void dispose ( ) { } private static String getNonAlphaNumericWordChars ( Buffer buffer , KeywordMap keywordMap , int caret ) { } private static String getWordToComplete ( Buffer buffer , int caretLine , int caret , String noWordSep ) { } private static Vector getCompletions ( Buffer buffer , String word , KeywordMap keywordMap , String noWordSep , int caret ) { } private static String completeWord ( String line , int offset , String noWordSep ) { } private View view ; private JEditTextArea textArea ; private Buffer buffer ; private String word ; private JList words ; private String noWordSep ; private void insertSelected ( ) { } static class Completion { String text ; boolean keyword ; Completion ( String text , boolean keyword ) { } public String toString ( ) { } public boolean equals ( Object obj ) { } } static class Renderer extends DefaultListCellRenderer { public Component getListCellRendererComponent ( JList list , Object value , int index , boolean isSelected , boolean cellHasFocus ) { } } class KeyHandler extends KeyAdapter { public void keyPressed ( KeyEvent evt ) { } public void keyTyped ( KeyEvent evt ) { char ch = evt . getKeyChar ( ) ; evt = KeyEventWorkaround . processKeyEvent ( evt ) ; if ( evt == null ) return ; if ( Character . isDigit ( ch ) ) { int index = ch - '0' ; if ( index == 0 ) index = 9 ; else index -- ; if ( index < ( words . getModel ( ) . getSize ( ) ) ) { words . setSelectedIndex ( index ) ; textArea . setSelectedText ( words . getModel ( ) . getElementAt ( index ) . toString ( ) . substring ( word . length ( ) ) ) ; dispose ( ) ; return ; } } if ( ( ch != '\b' ) && ( ch != '\t' ) ) { <START_BUG> if ( ( ! ( Character . isLetter ( ch ) ) ) && ( ( noWordSep . indexOf ( ch ) ) == ( - 1 ) ) ) { <END_BUG> insertSelected ( ) ; textArea . userInput ( ch ) ; dispose ( ) ; return ; } textArea . userInput ( ch ) ; word = ( word ) + ch ; int caret = textArea . getCaretPosition ( ) ; KeywordMap keywordMap = buffer . getKeywordMapAtOffset ( caret ) ; Vector completions = CompleteWord . getCompletions ( buffer , word , keywordMap , noWordSep , caret ) ; if ( ( completions . size ( ) ) == 0 ) { dispose ( ) ; return ; } words . setListData ( completions ) ; words . setSelectedIndex ( 0 ) ; } } } class MouseHandler extends MouseAdapter { public void mouseClicked ( MouseEvent evt ) { } } }

Fix:
if ( ( ! ( Character . isLetterOrDigit ( ch ) ) ) && ( ( noWordSep . indexOf ( ch ) ) == ( - 1 ) ) ) {
Buggy code:
public class EntityController implements Runnable { static final int TIME_DELAY = 200 ; private static EntityController entityController ; ControllerRedEntity controllerRedEntity = ControllerRedEntity . getControllerRedEntity ( ) ; ControllerGreenEntity controllerGreenEntity = ControllerGreenEntity . getControllerGreenEntity ( ) ; private static boolean moveFlag = false ; List < Entity > add = new ArrayList < Entity > ( ) ; List < Entity > del = new ArrayList < Entity > ( ) ; public static EntityController getEntityController ( ) { } public static void setFlag ( boolean a ) { } @ Override public void run ( ) { Environment environment = Environment . getEnvironment ( ) ; while ( true ) { try { synchronized ( this ) { if ( ! ( EntityController . moveFlag ) ) { <START_BUG> wait ( ) ; <END_BUG> } wait ( EntityController . TIME_DELAY ) ; } } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } List < Entity > ar = Environment . getEnvironment ( ) . getEntities ( ) ; Iterator < Entity > it = ar . listIterator ( ) ; while ( it . hasNext ( ) ) { Entity entity = it . next ( ) ; if ( ( ! ( entity . checkLife ( ) ) ) && ( ! ( checkOvercrowding ( environment , entity ) ) ) ) { if ( entity . getClass ( ) . equals ( RedEntity . class ) ) { controllerRedEntity . search ( ar , ( ( RedEntity ) ( entity ) ) ) ; Entity repr = reproduction ( ar , entity ) ; if ( repr != null ) { add . add ( repr ) ; } } else { controllerGreenEntity . search ( ar , ( ( GreenEntity ) ( entity ) ) ) ; controllerGreenEntity . eat ( environment , ( ( GreenEntity ) ( entity ) ) ) ; Entity repr = reproduction ( ar , entity ) ; if ( repr != null ) { add . add ( repr ) ; } } entity . move ( ) ; } else { it . remove ( ) ; del . add ( entity ) ; } } deleteEntity ( del ) ; del . clear ( ) ; addEntity ( add ) ; add . clear ( ) ; environment . change ( ) ; } } public void deleteEntity ( Entity entity ) { } public void deleteEntity ( List < Entity > ud ) { } public void addEntity ( List < Entity > entities ) { } public Entity reproduction ( List < Entity > entities , Entity entity ) { } public boolean checkOvercrowding ( Environment environment , Entity entity ) { } public void stop ( ) { } }

Fix:
return ;
Buggy code:
public class RemoveAliasCommand implements OperationStepHandler { public static final RemoveAliasCommand INSTANCE = new RemoveAliasCommand ( ) ; private final ParametersValidator nameValidator = new ParametersValidator ( ) ; @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } protected boolean requiresRuntime ( OperationContext context ) { <START_BUG> return ( ( context . getType ( ) ) == ( Type . SERVER ) ) && ( ! ( context . isBooting ( ) ) ) ; <END_BUG> } private ModelNode removeAliasFromList ( ModelNode list , String alias ) { } }

Fix:
return ( context . getProcessType ( ) . isServer ( ) ) && ( ! ( context . isBooting ( ) ) ) ;
Buggy code:
public class WeldComponentIntegrationProcessor implements DeploymentUnitProcessor { @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; if ( ! ( WeldDeploymentMarker . isWeldDeployment ( deploymentUnit ) ) ) { return ; } final EEModuleDescription eeModuleDescription = deploymentUnit . getAttachment ( EE_MODULE_DESCRIPTION ) ; final ServiceName beanManagerServiceName = BeanManagerService . serviceName ( deploymentUnit ) ; for ( ComponentDescription component : eeModuleDescription . getComponentDescriptions ( ) ) { final String beanName ; if ( component instanceof SessionBeanComponentDescription ) { beanName = component . getComponentName ( ) ; } else { beanName = null ; } component . getConfigurators ( ) . addFirst ( new ComponentConfigurator ( ) { @ Override public void configure ( final DeploymentPhaseContext context , final ComponentDescription description , final ComponentConfiguration configuration ) throws DeploymentUnitProcessingException { final Class < ? > componentClass = configuration . getModuleClassConfiguration ( ) . getModuleClass ( ) ; final EEModuleConfiguration module = configuration . getModuleClassConfiguration ( ) . getModuleConfiguration ( ) ; final ModuleClassLoader classLoader = deploymentUnit . getAttachment ( MODULE ) . getClassLoader ( ) ; final Set < Class < ? > > interceptorClasses = new HashSet < Class < ? > > ( ) ; <START_BUG> for ( InterceptorDescription interceptorDescription : description . getAllInterceptors ( ) . values ( ) ) { <END_BUG> EEModuleClassConfiguration clazz = module . getClassConfiguration ( interceptorDescription . getInterceptorClassName ( ) ) ; if ( clazz != null ) { interceptorClasses . add ( clazz . getModuleClass ( ) ) ; } } addWeldInstantiator ( context . getServiceTarget ( ) , configuration , componentClass , beanName , deploymentUnit . getServiceName ( ) , beanManagerServiceName , interceptorClasses , classLoader ) ; configuration . getPostConstructInterceptors ( ) . addLast ( new org . jboss . as . weld . injection . WeldInjectionInterceptor . Factory ( configuration , interceptorClasses ) ) ; } } ) ; } } private void addWeldInstantiator ( final ServiceTarget target , final ComponentConfiguration configuration , final Class < ? > componentClass , final String beanName , final ServiceName deploymentServiceName , final ServiceName beanManagerServiceName , final Set < Class < ? > > interceptorClasses , final ClassLoader classLoader ) { } @ Override public void undeploy ( DeploymentUnit context ) { } }

Fix:
for ( InterceptorDescription interceptorDescription : description . getAllInterceptors ( ) ) {
Buggy code:
public class WebExternalResourceRequestTarget implements IRequestTarget { private static final Log log = LogFactory . getLog ( WebExternalResourceRequestTarget . class ) ; private final String url ; public WebExternalResourceRequestTarget ( String url ) { } public void respond ( RequestCycle requestCycle ) { try { WebResponse webResponse = ( ( wicket . protocol . http . WebRequestCycle ) ( requestCycle ) ) . getWebResponse ( ) ; <START_BUG> final ServletContext context = ( ( wicket . protocol . http . WebApplication ) ( requestCycle . getApplication ( ) ) ) . getWicketServlet ( ) . getServletContext ( ) ; <END_BUG> webResponse . setContentType ( context . getMimeType ( url ) ) ; final InputStream in = context . getResourceAsStream ( url ) ; if ( in != null ) { try { Streams . copy ( in , webResponse . getHttpServletResponse ( ) . getOutputStream ( ) ) ; } finally { in . close ( ) ; } } else { WebExternalResourceRequestTarget . log . warn ( ( ( "the<seq2seq4repair_space>resource<seq2seq4repair_space>requested<seq2seq4repair_space>by<seq2seq4repair_space>request<seq2seq4repair_space>" + ( requestCycle . getRequest ( ) ) ) + "<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>found" ) ) ; HttpServletResponse httpServletResponse = webResponse . getHttpServletResponse ( ) ; httpServletResponse . sendError ( SC_NOT_FOUND ) ; } } catch ( IOException e ) { throw new wicket . WicketRuntimeException ( ( "Cannot<seq2seq4repair_space>load<seq2seq4repair_space>static<seq2seq4repair_space>content<seq2seq4repair_space>for<seq2seq4repair_space>request<seq2seq4repair_space>" + ( requestCycle . getRequest ( ) ) ) , e ) ; } } public final String getUrl ( ) { } public void detach ( RequestCycle requestCycle ) { } public Object getLock ( RequestCycle requestCycle ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } }

Fix:
final ServletContext context = ( ( wicket . protocol . http . WebApplication ) ( requestCycle . getApplication ( ) ) ) . getServletContext ( ) ;
Buggy code:
public class WebSocketServerSockJsSession extends AbstractSockJsSession implements NativeWebSocketSession { private WebSocketSession webSocketSession ; public WebSocketServerSockJsSession ( String id , SockJsServiceConfig config , WebSocketHandler handler , Map < String , Object > attributes ) { } @ Override public URI getUri ( ) { } @ Override public HttpHeaders getHandshakeHeaders ( ) { } @ Override public Principal getPrincipal ( ) { } @ Override public InetSocketAddress getLocalAddress ( ) { } @ Override public InetSocketAddress getRemoteAddress ( ) { } @ Override public String getAcceptedProtocol ( ) { } @ Override public List < WebSocketExtension > getExtensions ( ) { } private void checkDelegateSessionInitialized ( ) { } @ Override public Object getNativeSession ( ) { } @ Override public < T > T getNativeSession ( Class < T > requiredType ) { } public void initializeDelegateSession ( WebSocketSession session ) { } @ Override public boolean isActive ( ) { } public void handleMessage ( TextMessage message , WebSocketSession wsSession ) throws Exception { } @ Override public void sendMessageInternal ( String message ) throws SockJsTransportFailureException { } @ Override protected void writeFrameInternal ( SockJsFrame frame ) throws IOException { } @ Override protected void disconnect ( CloseStatus status ) throws IOException { <START_BUG> if ( ( this . webSocketSession ) != null ) { <END_BUG> this . webSocketSession . close ( status ) ; } } }

Fix:
if ( isActive ( ) ) {
Buggy code:
public abstract class BaseCloudController extends BasePortalController { protected CloudStorageService [ ] cloudStorageServices ; protected CloudComputeService [ ] cloudComputeServices ; protected PortalPropertyPlaceholderConfigurer hostConfigurer ; public BaseCloudController ( CloudStorageService [ ] cloudStorageServices , CloudComputeService [ ] cloudComputeServices ) { } public BaseCloudController ( CloudStorageService [ ] cloudStorageServices , CloudComputeService [ ] cloudComputeServices , PortalPropertyPlaceholderConfigurer hostConfigurer ) { } protected CloudStorageService getStorageService ( String id ) { } protected CloudStorageService getStorageService ( VEGLJob job ) { } protected CloudComputeService getComputeService ( String id ) { } protected CloudComputeService getComputeService ( VEGLJob job ) { } private String getBootstrapTemplate ( ) throws IOException { } public String createBootstrapForJob ( VEGLJob job ) throws IOException { String bootstrapTemplate = getBootstrapTemplate ( ) ; CloudStorageService cloudStorageService = getStorageService ( job ) ; Object [ ] arguments ; try { <START_BUG> arguments = new Object [ ] { cloudStorageService . getBucket ( job . getProperty ( PROPERTY_CLIENT_SECRET ) ) , job . getStorageBaseKey ( ) . replace ( "////" , "//" ) , cloudStorageService . getAccessKey ( ) , cloudStorageService . getSecretKey ( ) , hostConfigurer . resolvePlaceholder ( "vm.sh" ) , cloudStorageService . getEndpoint ( ) , cloudStorageService . getProvider ( ) , ( cloudStorageService . getAuthVersion ( ) ) == null ? "" : cloudStorageService . getAuthVersion ( ) , ( cloudStorageService . getRegionName ( ) ) == null ? "" : cloudStorageService . getRegionName ( ) } ; <END_BUG> } catch ( PortalServiceException e ) { throw new IOException ( e ) ; } String result = MessageFormat . format ( bootstrapTemplate , arguments ) ; return result ; } }

Fix:
arguments = new Object [ ] { cloudStorageService . getBucket ( job . getProperty ( PROPERTY_STS_ARN ) ) , job . getStorageBaseKey ( ) . replace ( "////" , "//" ) , cloudStorageService . getAccessKey ( ) , cloudStorageService . getSecretKey ( ) , hostConfigurer . resolvePlaceholder ( "vm.sh" ) , cloudStorageService . getEndpoint ( ) , cloudStorageService . getProvider ( ) , ( cloudStorageService . getAuthVersion ( ) ) == null ? "" : cloudStorageService . getAuthVersion ( ) , ( cloudStorageService . getRegionName ( ) ) == null ? "" : cloudStorageService . getRegionName ( ) } ;
Buggy code:
public class TestTopDocsCollector extends LuceneTestCase { private static final class MyTopsDocCollector extends TopDocsCollector < ScoreDoc > { private int idx = 0 ; private int base = 0 ; public MyTopsDocCollector ( int size ) { } @ Override protected TopDocs newTopDocs ( ScoreDoc [ ] results , int start ) { } @ Override public void collect ( int doc ) { } @ Override protected void doSetNextReader ( AtomicReaderContext context ) throws IOException { } @ Override public void setScorer ( Scorer scorer ) { } @ Override public boolean acceptsDocsOutOfOrder ( ) { } } private static final float [ ] scores = new float [ ] { 0.7767749F , 1.7839992F , 8.9925785F , 7.9608946F , 0.07948637F , 2.6356435F , 7.4950366F , 7.1490803F , 8.108544F , 4.961808F , 2.2423935F , 7.285586F , 4.6699767F , 2.9655676F , 6.953706F , 5.383931F , 6.9916306F , 8.365894F , 7.888485F , 8.723962F , 3.1796896F , 0.39971232F , 1.3077754F , 6.8489285F , 9.17561F , 5.060466F , 7.9793315F , 8.601509F , 4.1858315F , 0.28146625F } ; private static final float MAX_SCORE = 9.17561F ; private Directory dir ; private IndexReader reader ; private TopDocsCollector < ScoreDoc > doSearch ( int numResults ) throws IOException { } @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; dir = newDirectory ( ) ; RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , dir ) ; for ( int i = 0 ; i < 30 ; i ++ ) { writer . addDocument ( new Document ( ) ) ; } reader = writer . getReader ( ) ; <START_BUG> writer . close ( ) ; <END_BUG> } @ Override public void tearDown ( ) throws Exception { } public void testInvalidArguments ( ) throws Exception { } public void testZeroResults ( ) throws Exception { } public void testFirstResultsPage ( ) throws Exception { } public void testSecondResultsPages ( ) throws Exception { } public void testGetAllResults ( ) throws Exception { } public void testGetResultsFromStart ( ) throws Exception { } public void testMaxScore ( ) throws Exception { } public void testResultsOrder ( ) throws Exception { } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class Scale extends Control { boolean ignoreResize ; static final int TrackBarProc ; static final TCHAR TrackBarClass = new TCHAR ( 0 , OS . TRACKBAR_CLASS , true ) ; public Scale ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } int callWindowProc ( int hwnd , int msg , int wParam , int lParam ) { } static int checkStyle ( int style ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { } int defaultForeground ( ) { } public int getIncrement ( ) { } public int getMaximum ( ) { } public int getMinimum ( ) { } public int getPageIncrement ( ) { } public int getSelection ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } void setBackgroundImage ( int hImage ) { } void setBackgroundPixel ( int pixel ) { } public void setIncrement ( int increment ) { } public void setMaximum ( int value ) { } public void setMinimum ( int value ) { } public void setPageIncrement ( int pageIncrement ) { } public void setSelection ( int value ) { } int widgetStyle ( ) { } TCHAR windowClass ( ) { } int windowProc ( ) { } LRESULT WM_PAINT ( int wParam , int lParam ) { <START_BUG> boolean fixPaint = ( findImageControl ( ) ) != null ; <END_BUG> if ( ! fixPaint ) { if ( ( ( OS . COMCTL32_MAJOR ) >= 6 ) && ( OS . IsAppThemed ( ) ) ) { Control control = findThemeControl ( ) ; fixPaint = control != null ; } } if ( fixPaint ) { boolean redraw = ( ( drawCount ) == 0 ) && ( OS . IsWindowVisible ( handle ) ) ; if ( redraw ) OS . SendMessage ( handle , WM_SETREDRAW , 0 , 0 ) ; ignoreResize = true ; OS . SendMessage ( handle , WM_SIZE , 0 , 0 ) ; ignoreResize = false ; if ( redraw ) { OS . SendMessage ( handle , WM_SETREDRAW , 1 , 0 ) ; OS . InvalidateRect ( handle , null , true ) ; } } return super . WM_PAINT ( wParam , lParam ) ; } LRESULT WM_SIZE ( int wParam , int lParam ) { } LRESULT wmScrollChild ( int wParam , int lParam ) { } }

Fix:
boolean fixPaint = ( findBackgroundControl ( ) ) != null ;
Buggy code:
public class FileUploadFieldTest extends WicketTestCase { public FileUploadFieldTest ( ) { } public void testInternalDetach ( ) throws Exception { final MockPageWithFormAndUploadField page = new MockPageWithFormAndUploadField ( ) ; FileUploadField field = new FileUploadField ( "upload" ) ; page . getForm ( ) . add ( field ) ; tester . startPage ( new ITestPageSource ( ) { private static final long serialVersionUID = 1L ; public Page getTestPage ( ) { return page ; } } ) ; RequestCycle requestCycle = tester . createRequestCycle ( ) ; MockHttpServletRequest servletRequest = tester . getServletRequest ( ) ; servletRequest . setMethod ( "POST" ) ; servletRequest . setParameter ( "form2:hf:fs" , "" ) ; servletRequest . setParameter ( "wicketState" , "" ) ; File tmp = null ; try { <START_BUG> tmp = new File ( File . createTempFile ( this . getClass ( ) . getName ( ) , ".txt" ) ) ; <END_BUG> OutputStream os = new BufferedOutputStream ( new FileOutputStream ( tmp ) ) ; for ( int i = 0 ; i < 1000 ; i ++ ) { os . write ( "test<seq2seq4repair_space>test<seq2seq4repair_space>test<seq2seq4repair_space>test<seq2seq4repair_space>test\n" . getBytes ( ) ) ; } os . close ( ) ; servletRequest . addFile ( "upload" , tmp , "text//plain" ) ; requestCycle . setRequest ( new org . apache . wicket . protocol . http . servlet . MultipartServletWebRequest ( servletRequest , Bytes . MAX ) ) ; field . attach ( ) ; FileUpload fileUpload = field . getFileUpload ( ) ; assertNotNull ( fileUpload ) ; InputStream is = fileUpload . getInputStream ( ) ; assertTrue ( ( ( is . read ( ) ) != ( - 1 ) ) ) ; field . detach ( ) ; try { is . read ( ) ; fail ( ) ; } catch ( IOException e ) { } catch ( Exception e ) { fail ( ) ; } } finally { if ( ( tmp != null ) && ( tmp . exists ( ) ) ) { tmp . delete ( ) ; } } } }

Fix:
tmp = new File ( java . io . File . createTempFile ( this . getClass ( ) . getName ( ) , ".txt" ) ) ;
Buggy code:
public final class Main { public static void main ( String [ ] args ) throws IOException { } private Main ( ) { } private static HostControllerBootstrap create ( String [ ] args , InputStream stdin , PrintStream stdout , PrintStream stderr , final byte [ ] authCode ) { } private HostControllerBootstrap boot ( String [ ] args , InputStream stdin , PrintStream stdout , PrintStream stderr , final byte [ ] authCode ) { } private void abort ( Throwable t ) { } private void abort ( Throwable t , int exitCode ) { } public static HostControllerEnvironment determineEnvironment ( String [ ] args , InputStream stdin , PrintStream stdout , PrintStream stderr ) { } private static String parseValue ( final String arg , final String key ) { } private static boolean processProperties ( final String arg , final String urlSpec , Map < String , String > hostSystemProperties ) { } private static Integer parsePort ( final String value , final String key ) { } private static InetAddress parseAddress ( final String value , final String key ) { } private static URL makeURL ( String urlspec ) throws MalformedURLException { } private static Map < String , String > getHostSystemProperties ( ) { } private static class PCSocketConfig { private final String defaultBindAddress ; private InetAddress bindAddress ; private int bindPort = 0 ; private int argIncrement = 0 ; private boolean parseFailed ; private final UnknownHostException uhe ; private PCSocketConfig ( ) { } private InetAddress getBindAddress ( ) { } private int getBindPort ( ) { } private int getArgIncrement ( ) { } private boolean isParseFailed ( ) { } private boolean processPCSocketConfigArgument ( final String arg , final String [ ] args , final int index ) { } private void setBindAddress ( String key , String value ) { try { bindAddress = InetAddress . getByName ( value ) ; } catch ( UnknownHostException e ) { parseFailed = true ; <START_BUG> System . out . println ( HostControllerMessages . MESSAGES . invalidValue ( key , "InetAddress" , value ) ) ; <END_BUG> } } } }

Fix:
System . err . println ( HostControllerMessages . MESSAGES . invalidValue ( key , "InetAddress" , value ) ) ;
Buggy code:
public class Settings { private static Settings ourInstance ; private Boolean mHasBackgroundUpdates ; private Boolean mHasBackgroundAlerts ; private Boolean loggedIn ; private long mReconnectInterval ; private long mLocationInterval ; private long mFastestLocationInterval ; private String username ; private String password ; private long mAnnouncementUpdateInterval ; public static Settings getInstance ( ) { } private Settings ( ) { } public void toggleBackgroundUpdates ( ) { } public void toggleBackgroundAlerts ( ) { } public void setLocationInterval ( long value ) { } public void setLoggedIn ( boolean value ) { } public void setUsername ( String username ) { } public void setPassword ( String password ) { } public void setFastestLocationInterval ( long value ) { } public void setAnnouncementUpdateInterval ( long value ) { <START_BUG> mAnnouncementUpdateInterval = value ; <END_BUG> } public Boolean hasBackgroundUpdates ( ) { } public Boolean hasBackgroundAlerts ( ) { } public void setHasBackgroundUpdates ( boolean value ) { } public void setHasBackgroundAlerts ( boolean value ) { } public long getLocationUpdateInterval ( ) { } public long getFastestLocationUpdateInterval ( ) { } public long getReconnectInterval ( ) { } public Boolean getLoggedIn ( ) { } public String getUsername ( ) { } public String getPassword ( ) { } public long getAnnouncementUpdateInterval ( ) { } public void setReconnectInterval ( long value ) { } public void resetSettings ( ) { } }

Fix:
mAnnouncementUpdateInterval = value * 1000 ;
Buggy code:
public class HttpClientDefaultParameters { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private HttpClientDefaultParameters ( ) { } private abstract static class GenericHttpParams { public abstract void setParameter ( String name , Object value ) { } public abstract void setVersion ( String name , String value ) throws Exception { } } public static void load ( String file , final HttpParams params ) { } public static void load ( String file , final org . apache . http . params . HttpParams params ) { } private static void load ( String file , HttpClientDefaultParameters . GenericHttpParams params ) { HttpClientDefaultParameters . log . info ( ( "Reading<seq2seq4repair_space>httpclient<seq2seq4repair_space>parameters<seq2seq4repair_space>from<seq2seq4repair_space>" + file ) ) ; File f = new File ( file ) ; InputStream is = null ; Properties props = new Properties ( ) ; try { is = new FileInputStream ( f ) ; props . load ( is ) ; for ( Map . Entry < Object , Object > me : props . entrySet ( ) ) { String key = ( ( String ) ( me . getKey ( ) ) ) ; String value = ( ( String ) ( me . getValue ( ) ) ) ; <START_BUG> int typeSep = key . indexOf ( "$" ) ; <END_BUG> try { if ( typeSep > 0 ) { String type = key . substring ( ( typeSep + 1 ) ) ; String name = key . substring ( 0 , typeSep ) ; HttpClientDefaultParameters . log . info ( ( ( ( ( ( ( "Defining<seq2seq4repair_space>" + name ) + "<seq2seq4repair_space>as<seq2seq4repair_space>" ) + value ) + "<seq2seq4repair_space>(" ) + type ) + ")" ) ) ; if ( type . equals ( "Integer" ) ) { params . setParameter ( name , Integer . valueOf ( value ) ) ; } else if ( type . equals ( "Long" ) ) { params . setParameter ( name , Long . valueOf ( value ) ) ; } else if ( type . equals ( "Boolean" ) ) { params . setParameter ( name , Boolean . valueOf ( value ) ) ; } else if ( type . equals ( "HttpVersion" ) ) { params . setVersion ( name , value ) ; } else { HttpClientDefaultParameters . log . warn ( ( ( ( "Unexpected<seq2seq4repair_space>type:<seq2seq4repair_space>" + type ) + "<seq2seq4repair_space>for<seq2seq4repair_space>name<seq2seq4repair_space>" ) + name ) ) ; } } else { HttpClientDefaultParameters . log . info ( ( ( ( "Defining<seq2seq4repair_space>" + key ) + "<seq2seq4repair_space>as<seq2seq4repair_space>" ) + value ) ) ; params . setParameter ( key , value ) ; } } catch ( Exception e ) { HttpClientDefaultParameters . log . error ( ( ( ( ( ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>property:<seq2seq4repair_space>" + key ) + "=" ) + value ) + "<seq2seq4repair_space>" ) + ( e . toString ( ) ) ) ) ; } } } catch ( FileNotFoundException e ) { HttpClientDefaultParameters . log . error ( ( "Problem<seq2seq4repair_space>loading<seq2seq4repair_space>properties<seq2seq4repair_space>" + ( e . toString ( ) ) ) ) ; } catch ( IOException e ) { HttpClientDefaultParameters . log . error ( ( "Problem<seq2seq4repair_space>loading<seq2seq4repair_space>properties<seq2seq4repair_space>" + ( e . toString ( ) ) ) ) ; } finally { JOrphanUtils . closeQuietly ( is ) ; } } }

Fix:
int typeSep = key . indexOf ( '$' ) ;
Buggy code:
public abstract class CachedDAO { private static final Logger log = LoggerFactory . getLogger ( CachedDAO . class ) ; private Cache cacheImpl ; protected Integer SEARCH_EXPIRE = 60 ; public CachedDAO ( String namespace ) { } private void initProperties ( ) { } @ SuppressWarnings ( "unchecked" ) protected Object getCachedList ( String key , int [ ] count ) { } protected void putCachedList ( String key , Object list , int [ ] count ) { } protected void createCache ( String namespace ) { try { <START_BUG> this . cacheImpl = CacheFactory . getInstance ( ) . getCache ( "alias" ) ; <END_BUG> } catch ( UnavailableCacheException e ) { this . cacheImpl = null ; } } protected void cachePut ( String key , Object value ) { } protected void cachePut ( String key , Object value , Integer expire_in_seconds ) { } protected Object cacheGet ( String key ) { } protected void cacheClear ( ) { } }

Fix:
this . cacheImpl = CacheFactory . getInstance ( ) . getCache ( namespace ) ;
Buggy code:
public class Interaction { private Map < Collaboration , ArrayList < AbstractEdge > > map = null ; private int threshold ; public Interaction ( List < ? extends AbstractEdge > edgeList , int type , int threshold ) { } public Map < Collaboration , ArrayList < AbstractEdge > > getAbstractMap ( ) { } public int getThreshold ( ) { } private Map < Collaboration , ArrayList < AbstractEdge > > loadAbstractMap ( List < ? extends AbstractEdge > abstractEdgeList ) { } private Map < Collaboration , ArrayList < AbstractEdge > > loadAcademiaMap ( List < ? extends AbstractEdge > results ) { Map < Collaboration , ArrayList < AbstractEdge > > academiaMap = new HashMap < Collaboration , ArrayList < AbstractEdge > > ( ) ; Map < Author , Author > authorMap = new HashMap < Author , Author > ( ) ; int h = 0 ; int i = 0 ; int j = 0 ; Collaboration collaboration = null ; Author author1 = null ; Author author2 = null ; Copublications copublications = null ; Publication publication = null ; List < Author > listOfNodes = null ; while ( h <= ( ( results . size ( ) ) - 1 ) ) { i = 0 ; j = 0 ; collaboration = null ; author1 = null ; author2 = null ; copublications = null ; listOfNodes = null ; publication = ( ( Publication ) ( results . get ( h ) ) ) ; <START_BUG> if ( ( ( this . threshold ) > ( - 1 ) ) && ( ( this . threshold ) < ( publication . getNodes ( ) . size ( ) ) ) ) { <END_BUG> listOfNodes = ( ( List < Author > ) ( publication . getNodes ( ) . subList ( 0 , this . threshold ) ) ) ; if ( ( this . threshold ) == 1 ) { listOfNodes . add ( listOfNodes . get ( 0 ) ) ; } } else { listOfNodes = ( ( List < Author > ) ( publication . getNodes ( ) ) ) ; } while ( i < ( listOfNodes . size ( ) ) ) { author1 = listOfNodes . get ( i ) ; if ( ( authorMap . get ( author1 ) ) == null ) { authorMap . put ( author1 , author1 ) ; } authorMap . get ( author1 ) . addPublication ( publication ) ; j = i + 1 ; while ( j < ( listOfNodes . size ( ) ) ) { author2 = listOfNodes . get ( j ) ; if ( ( authorMap . get ( author2 ) ) == null ) { authorMap . put ( author2 , author2 ) ; } collaboration = new Collaboration ( authorMap . get ( author1 ) , authorMap . get ( author2 ) ) ; if ( ! ( academiaMap . containsKey ( collaboration ) ) ) { copublications = new Copublications ( collaboration , publication ) ; ArrayList < AbstractEdge > edgeList = new ArrayList < AbstractEdge > ( ) ; edgeList . add ( copublications ) ; academiaMap . put ( collaboration , edgeList ) ; } else { ArrayList < AbstractEdge > array = academiaMap . get ( collaboration ) ; copublications = ( ( Copublications ) ( array . get ( 0 ) ) ) ; copublications . addPublication ( publication ) ; } j ++ ; } i ++ ; } h ++ ; } return academiaMap ; } private void setAbstractMap ( Map < Collaboration , ArrayList < AbstractEdge > > abstractMap ) { } public void setThreshold ( int threshold ) { } No newline ; at end ; of file ; }

Fix:
if ( ( ( this . threshold ) > 0 ) && ( ( this . threshold ) < ( publication . getNodes ( ) . size ( ) ) ) ) {
Buggy code:
public class DirectoryGroupingByTypeTestCase { private static DomainTestSupport testSupport ; @ BeforeClass public static void setupDomain ( ) throws Exception { <START_BUG> DirectoryGroupingByTypeTestCase . testSupport = DomainTestSuite . createSupport ( CoreResourceManagementTestCase . class . getSimpleName ( ) ) ; <END_BUG> } @ AfterClass public static void tearDownDomain ( ) throws Exception { } @ Test public void testDirectoryLocations ( ) throws Exception { } private void validateServerDirectory ( File typeDir ) { } private void validateDirectory ( File file ) { } }

Fix:
DirectoryGroupingByTypeTestCase . testSupport = DomainTestSuite . createSupport ( DirectoryGroupingByTypeTestCase . class . getSimpleName ( ) ) ;
Buggy code:
public class StringUtilsTest { List < String > expectedList ; @ BeforeTest public void setup ( ) { } @ Test public void listToString ( ) { String resultStringList = StringUtils . listToString ( expectedList ) ; <START_BUG> Assert . assertEquals ( resultStringList , "c://With<seq2seq4repair_space>Space//test.xml,c://WithoutSpace//test.xml,c://test//test<seq2seq4repair_space>A//test<seq2seq4repair_space>B//test.xml," ) ; <END_BUG> } @ Test public void stringToList ( ) { } @ Test public void stringToNullListShouldReturnNullList ( ) { } @ Test public void stringToNullListShouldNotReturnNullList ( ) { } }

Fix:
Assert . assertEquals ( resultStringList , "c://With<seq2seq4repair_space>Space//test.xml,c://WithoutSpace//test.xml,c://test//test<seq2seq4repair_space>A//test<seq2seq4repair_space>B//test.xml" ) ;