nus-yam/ex-repair huggingface dataset:
Buggy code:
public final class ServerConfigService implements Service < ServerConfig > { private static final ServiceName MBEAN_SERVER_NAME = JBOSS . append ( "mbean" , "server" ) ; private final AbstractServerConfig serverConfig ; private ServerConfigService ( final AbstractServerConfig serverConfig ) { } @ Override public ServerConfig getValue ( ) { } @ Override public void start ( final StartContext context ) throws StartException { } @ Override public void stop ( final StopContext context ) { } public static ServiceController < ? > install ( final ServiceTarget serviceTarget , final ServerConfigImpl serverConfig , final ServiceListener < Object > listener ) { final ServiceBuilder < ServerConfig > builder = serviceTarget . addService ( CONFIG_SERVICE , new ServerConfigService ( serverConfig ) ) ; <START_BUG> builder . addDependency ( REQUIRED , ServerConfigService . MBEAN_SERVER_NAME , MBeanServer . class , serverConfig . getMBeanServerInjector ( ) ) ; <END_BUG> builder . addDependency ( SERVICE_NAME , ServerEnvironment . class , serverConfig . getServerEnvironmentInjector ( ) ) ; builder . addListener ( listener ) ; builder . setInitialMode ( ACTIVE ) ; return builder . install ( ) ; } }

Fix:
builder . addDependency ( OPTIONAL , ServerConfigService . MBEAN_SERVER_NAME , MBeanServer . class , serverConfig . getMBeanServerInjector ( ) ) ;
Buggy code:
public enum RegexTokenType { RE_CHAR , SET_CHAR , CHAR_CLASS , INVALID_CHAR_CLASS , OPEN_PAR , CLOSE_PAR , OPEN_BRACKET , CLOSE_BRACKET , ANY_CHAR , ZERO_OR_MORE_REP , ONE_OR_MORE_REP , UNION_OP , NEGATIVE_SET , RANGE_OP , IN_OP , EOS , INVALID_ESCAPE , OTHER , EQUALS_OP , POUND_OP , PIPE_OP , COMMA , SEMICOLON , BEGIN_OP , END_OP , REPLACE_OP , RECURSIVE_REPLACE_OP , INTERS_OP , PRINT_OP , WITH_OP , FIND_OP , DIFF_OP , MAXFREQSTRING_OP , ASCIISTR , ID , START_REGEX , END_REGEX , START_ASCII , INVALID_TOKEN ; public static String getTokenDescription ( RegexToken token ) { switch ( token . getType ( ) ) { case RE_CHAR : case SET_CHAR : return token . getValue ( ) ; case CHAR_CLASS : return "$" + ( token . getValue ( ) ) ; case INVALID_CHAR_CLASS : return "Invalid<seq2seq4repair_space>Character<seq2seq4repair_space>Class<seq2seq4repair_space>Name" ; case OPEN_PAR : return "(" ; case CLOSE_PAR : return ")" ; case OPEN_BRACKET : return "[" ; case CLOSE_BRACKET : return "]" ; case ANY_CHAR : return "." ; case ZERO_OR_MORE_REP : return "*" ; case ONE_OR_MORE_REP : return "+" ; case UNION_OP : return "|" ; case NEGATIVE_SET : return "^" ; case IN_OP : return "keyword<seq2seq4repair_space>IN" ; case EOS : return "End<seq2seq4repair_space>Of<seq2seq4repair_space>String" ; case INVALID_ESCAPE : return "Invalid<seq2seq4repair_space>Escape<seq2seq4repair_space>Sequence" ; case ID : return "ID" ; case ASCIISTR : return "ASCII-STR" ; case EQUALS_OP : return "keyword<seq2seq4repair_space>=" ; case POUND_OP : return "keyword<seq2seq4repair_space>#" ; case PIPE_OP : return "keyword<seq2seq4repair_space>>!" ; case COMMA : return "keyword<seq2seq4repair_space>," ; case SEMICOLON : return "keyword<seq2seq4repair_space>;" ; case BEGIN_OP : return "keyword<seq2seq4repair_space>begin" ; case END_OP : return "keyword<seq2seq4repair_space>end" ; case REPLACE_OP : return "keyword<seq2seq4repair_space>replace" ; case RECURSIVE_REPLACE_OP : return "keyword<seq2seq4repair_space>recursivereplace" ; case INTERS_OP : return "keyword<seq2seq4repair_space>inters" ; case PRINT_OP : return "keyword<seq2seq4repair_space>print" ; case WITH_OP : return "keyword<seq2seq4repair_space>with" ; case FIND_OP : return "keyword<seq2seq4repair_space>find" ; case DIFF_OP : return "keyword<seq2seq4repair_space>diff" ; case MAXFREQSTRING_OP : return "keyword<seq2seq4repair_space>maxfreqinstring" ; case INVALID_TOKEN : return "invalid<seq2seq4repair_space>token" ; case START_REGEX : return "start<seq2seq4repair_space>of<seq2seq4repair_space>regex" ; case START_ASCII : return "start<seq2seq4repair_space>of<seq2seq4repair_space>ascii" ; case END_REGEX : return "end<seq2seq4repair_space>of<seq2seq4repair_space>regex" ; default : <START_BUG> return "INVALID<seq2seq4repair_space>Token" ; <END_BUG> } } public static String getTokenDescription ( RegexTokenType type ) { } }

Fix:
return token . getType ( ) . toString ( ) ;
Buggy code:
public class DBConnectionFactory { private DBConnection defaultDBConnection ; public TemplateMethodModelEx getMethodNewDBConnection ( ) { } public TemplateMethodModelEx getMethodGetDefaultDBConnection ( ) { return new TemplateMethodModelEx ( ) { public Object exec ( List args ) throws TemplateModelException { if ( ( args . size ( ) ) != 0 ) { <START_BUG> throw new TemplateModelException ( ( "Wrong<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>arguments:<seq2seq4repair_space>expected<seq2seq4repair_space>0<seq2seq4repair_space>or<seq2seq4repair_space>3,<seq2seq4repair_space>got<seq2seq4repair_space>" + ( args . size ( ) ) ) ) ; <END_BUG> } return getDefaultDBConnection ( ) ; } } ; } public TemplateMethodModelEx getMethodSetDefaultDBConnection ( ) { } public DBConnection newDBConnection ( ) throws TemplateModelException { } public DBConnection newDBConnection ( String url , String user , String password ) throws TemplateModelException { } public synchronized DBConnection getDefaultDBConnection ( ) throws TemplateModelException { } public synchronized void setDefaultDBConnection ( DBConnection conn ) { } }

Fix:
throw new TemplateModelException ( ( "Wrong<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>arguments:<seq2seq4repair_space>expected<seq2seq4repair_space>0,<seq2seq4repair_space>got<seq2seq4repair_space>" + ( args . size ( ) ) ) ) ;
Buggy code:
public class GameMain extends BasicGameState { public String mouse = "" ; public Image background ; public Image gameBoard ; public Image gameBoardZoom ; public Image spinner ; public Image player ; private int playerX = - 416 ; private int playerY = 464 ; public GameMain ( int state ) { } @ Override public void init ( GameContainer gc , StateBasedGame sbg ) throws SlickException { } @ Override public void update ( GameContainer gc , StateBasedGame sbg , int i ) throws SlickException { int xPosition = Mouse . getX ( ) ; int yPosition = Mouse . getY ( ) ; Input input = gc . getInput ( ) ; mouse = ( ( "Mouse<seq2seq4repair_space>position<seq2seq4repair_space>x:<seq2seq4repair_space>" + xPosition ) + "<seq2seq4repair_space>y:<seq2seq4repair_space>" ) + yPosition ; <START_BUG> if ( ( ( ( ( input . isMousePressed ( 0 ) ) && ( xPosition > 20 ) ) && ( xPosition < 170 ) ) && ( yPosition < 60 ) ) && ( yPosition > 20 ) ) { <END_BUG> sbg . enterState ( 0 ) ; } if ( ( ( ( ( input . isMousePressed ( 0 ) ) && ( xPosition > 333 ) ) && ( xPosition < 490 ) ) && ( yPosition < 180 ) ) && ( yPosition > 20 ) ) { updateBoardView ( 128 , 0 ) ; sbg . enterState ( 3 ) ; } } @ Override public void render ( GameContainer gc , StateBasedGame sbg , Graphics g ) throws SlickException { } public int getID ( ) { } public void updateBoardView ( int x , int y ) { } No newline ; at end ; of file ; }

Fix:
if ( ( ( ( ( input . isMouseButtonDown ( 0 ) ) && ( xPosition > 20 ) ) && ( xPosition < 170 ) ) && ( yPosition < 60 ) ) && ( yPosition > 20 ) ) {
Buggy code:
@ RestController public class NewsController { @ Autowired private NewsLangRepo langRepo ; @ Autowired private NewsLinkRepo linkRepo ; @ RequestMapping ( "//alltitles" ) public Collection < News > getTitles ( ) { } @ RequestMapping ( "//titles" ) public Collection < News > getTitlesByLanguage ( @ RequestParam ( "language" ) String language ) { } private Collection < News > getNews ( String language ) { HashSet < News > news = new HashSet < > ( ) ; Collection < NewsLang > findByLanguage = langRepo . findByLanguage ( language ) ; for ( NewsLang findByLanguage1 : findByLanguage ) { <START_BUG> Optional < NewsLink > findById = linkRepo . findByNewsId ( findByLanguage1 . getId ( ) ) ; <END_BUG> if ( findById . isPresent ( ) ) { news . add ( new News ( findByLanguage1 , findById . get ( ) ) ) ; } } return news ; } }

Fix:
Optional < NewsLink > findById = linkRepo . findByNewsId ( findByLanguage1 . getNewsId ( ) ) ;
Buggy code:
public class ZorbaInstallType extends XQDTInterpreterInstallType { public static final String INSTALL_TYPE_ID = "org.eclipse.wst.xquery.launching.ZorbaInstallType" ; private static final String INSTALL_TYPE_NAME = "Zorba<seq2seq4repair_space>XQuery<seq2seq4repair_space>Engine" ; public String getName ( ) { } @ Override public String getId ( ) { } @ Override protected String [ ] getPossibleInterpreterNames ( ) { <START_BUG> return new String [ ] { "zorba" } ; <END_BUG> } protected IInterpreterInstall doCreateInterpreterInstall ( String id ) { } @ Override public IEnvironment getEnvironment ( ) { } @ Override public String getResolverFacetId ( ) { } @ Override protected IPath createPathFile ( IDeployment deployment ) throws IOException { } protected String [ ] buildCommandLine ( IFileHandle installLocation , IFileHandle pathFile ) { } }

Fix:
return new String [ ] { "zorba" , "zorba_sausastore" } ;
Buggy code:
public class ApplicationSettingsTest extends TestCase { public ApplicationSettingsTest ( final String message ) { } public void testExceptionOnMissingResourceDefaultValue ( ) throws Exception { } public void testExceptionOnMissingResourceSetsCorrectly ( ) throws Exception { } public void testUseDefaultOnMissingResourceDefaultValue ( ) throws Exception { } public void testUseDefaultOnMissingResourceSetsCorrectly ( ) throws Exception { } public void testDefaultStringResourceLoaderSetup ( ) { } public void testOverrideStringResourceLoaderSetup ( ) { } public void testLocalizer ( ) { Application dummy = new DummyApplication ( ) ; <START_BUG> Assert . assertNotNull ( "Localizer<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>available" , dummy . getMarkupSettings ( ) . getLocalizer ( ) ) ; <END_BUG> } }

Fix:
Assert . assertNotNull ( "Localizer<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>available" , dummy . getResourceSettings ( ) . getLocalizer ( ) ) ;
Buggy code:
@ MSExtension ( "CHActionBar" ) public class LifeCycle extends AbstractExtension { @ Override public void onStartup ( ) { System . out . println ( ( ( "CHActionBar<seq2seq4repair_space>" + ( getVersion ( ) ) ) + "<seq2seq4repair_space>loaded." ) ) ; <START_BUG> Bukkit . getServer ( ) . getScheduler ( ) . scheduleSyncRepeatingTask ( ( ( Plugin ) ( this ) ) , new Lag ( ) , 100L , 1L ) ; <END_BUG> } @ Override public void onShutdown ( ) { } public Version getVersion ( ) { } }

Fix:
Bukkit . getServer ( ) . getScheduler ( ) . scheduleSyncRepeatingTask ( Bukkit . getPluginManager ( ) . getPlugin ( "CommandHelper" ) , new Lag ( ) , 100L , 1L ) ;
Buggy code:
public class SelfKeywordUsageCheckTest extends CheckTest { @ Test public void test ( ) throws Exception { SourceFile file = PHPAstScanner . scanSingleFile ( TestUtils . getCheckFile ( "SelfKeywordUsageCheck.php" ) , new SelfKeywordUsageCheck ( ) ) ; <START_BUG> checkMessagesVerifier . verify ( file . getCheckMessages ( ) ) . next ( ) . atLine ( 8 ) . withMessage ( "Use<seq2seq4repair_space>\"static\"<seq2seq4repair_space>keyword<seq2seq4repair_space>instead<seq2seq4repair_space>of<seq2seq4repair_space>\"self\"." ) . noMore ( ) ; <END_BUG> } }

Fix:
checkMessagesVerifier . verify ( file . getCheckMessages ( ) ) . next ( ) . atLine ( 14 ) . withMessage ( "Use<seq2seq4repair_space>\"static\"<seq2seq4repair_space>keyword<seq2seq4repair_space>instead<seq2seq4repair_space>of<seq2seq4repair_space>\"self\"." ) . noMore ( ) ;
Buggy code:
public class DeploymentUnitTestCase extends AbstractDeploymentTest { private ServiceContainer serviceContainer ; private final DeploymentChain deploymentChain = new DeploymentChainImpl ( "test.chain" ) ; private static final byte [ ] BLANK_SHA1 = new byte [ 20 ] ; @ Before public void setup ( ) throws Exception { } @ After public void shutdown ( ) { } @ Test public void testDeployVirtualFile ( ) throws Exception { final VirtualFile virtualFile = VFS . getChild ( getResource ( "//test//testDeployment" ) ) ; final DeploymentUnitKey expectedKey = new DeploymentUnitKey ( virtualFile . getName ( ) , DeploymentUnitTestCase . BLANK_SHA1 ) ; <START_BUG> final String expectedDeploymentName = ( ( expectedKey . getName ( ) ) + ":" ) + ( expectedKey . getSha1HashAsHexString ( ) ) ; <END_BUG> final BatchBuilder batchBuilder = serviceContainer . batchBuilder ( ) ; final CountDownLatch latch = new CountDownLatch ( 1 ) ; final TimingServiceListener listener = new TimingServiceListener ( new Runnable ( ) { @ Override public void run ( ) { latch . countDown ( ) ; } } ) ; batchBuilder . addListener ( listener ) ; new org . jboss . as . model . ServerGroupDeploymentElement ( null , virtualFile . getName ( ) , DeploymentUnitTestCase . BLANK_SHA1 , true ) . activate ( new org . jboss . msc . service . ServiceActivatorContextImpl ( batchBuilder ) ) ; batchBuilder . install ( ) ; listener . finishBatch ( ) ; latch . await ( 1L , TimeUnit . SECONDS ) ; if ( ! ( listener . finished ( ) ) ) fail ( "Did<seq2seq4repair_space>not<seq2seq4repair_space>install<seq2seq4repair_space>deployment<seq2seq4repair_space>within<seq2seq4repair_space>1<seq2seq4repair_space>second." ) ; final ServiceController < ? > serviceController = serviceContainer . getService ( SERVICE_NAME . append ( expectedDeploymentName ) ) ; assertNotNull ( serviceController ) ; assertEquals ( UP , serviceController . getState ( ) ) ; } }

Fix:
final String expectedDeploymentName = ( ( expectedKey . getName ( ) ) + '_' ) + ( expectedKey . getSha1HashAsHexString ( ) ) ;
Buggy code:
public class GUIMenu extends Component { public static JFrame frame ; public static JPanel base ; public static JButton openNew ; public static JButton openExisting ; public static JLabel panelIcon ; public static JFileChooser openSave ; public static JFileChooser newSave ; protected static ImageIcon createImageIcon ( String path ) { } public Image getFrameIcon ( ) { BufferedImage fIcon ; try { <START_BUG> fIcon = ImageIO . read ( getClass ( ) . getResource ( "rsc//Icon1616.png" ) ) ; <END_BUG> } catch ( Exception e ) { System . err . println ( "Can't<seq2seq4repair_space>load<seq2seq4repair_space>Frame<seq2seq4repair_space>Icon" ) ; return null ; } return fIcon ; } public static class PaneFrameMain implements ActionListener , ItemListener { public static void createGUI ( ) throws IOException { } public JPanel paneContent ( ) throws IOException { } @ Override public void actionPerformed ( ActionEvent e ) { } @ Override public void itemStateChanged ( ItemEvent e ) { } } }

Fix:
fIcon = ImageIO . read ( getClass ( ) . getResource ( "rsc//FIcon.png" ) ) ;
Buggy code:
public class GetInstalledDriverOperationHandler implements OperationStepHandler { public static final GetInstalledDriverOperationHandler INSTANCE = new GetInstalledDriverOperationHandler ( ) ; private final ParametersValidator validator = new ParametersValidator ( ) ; private GetInstalledDriverOperationHandler ( ) { } @ Override public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { validator . validate ( operation ) ; final String name = operation . require ( Constants . DRIVER_NAME . getName ( ) ) . asString ( ) ; <START_BUG> if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { ServiceController < ? > sc = context . getServiceRegistry ( false ) . getRequiredService ( JDBC_DRIVER_REGISTRY_SERVICE ) ; DriverRegistry driverRegistry = DriverRegistry . class . cast ( sc . getValue ( ) ) ; ModelNode result = new ModelNode ( ) ; InstalledDriver driver = driverRegistry . getInstalledDriver ( name ) ; ModelNode driverNode = new ModelNode ( ) ; driverNode . get ( Constants . DRIVER_NAME . getName ( ) ) . set ( driver . getDriverName ( ) ) ; if ( driver . isFromDeployment ( ) ) { driverNode . get ( Constants . DEPLOYMENT_NAME ) . set ( driver . getDriverName ( ) ) ; driverNode . get ( Constants . DRIVER_MODULE_NAME . getName ( ) ) ; driverNode . get ( Constants . MODULE_SLOT ) ; driverNode . get ( Constants . DRIVER_XA_DATASOURCE_CLASS_NAME . getName ( ) ) ; } else { driverNode . get ( Constants . DEPLOYMENT_NAME ) ; driverNode . get ( Constants . DRIVER_MODULE_NAME . getName ( ) ) . set ( driver . getModuleName ( ) . getName ( ) ) ; driverNode . get ( Constants . MODULE_SLOT ) . set ( ( ( driver . getModuleName ( ) ) != null ? driver . getModuleName ( ) . getSlot ( ) : "" ) ) ; driverNode . get ( Constants . DRIVER_XA_DATASOURCE_CLASS_NAME . getName ( ) ) . set ( driver . getXaDataSourceClassName ( ) ) ; } driverNode . get ( Constants . DRIVER_CLASS_NAME . getName ( ) ) . set ( driver . getDriverClassName ( ) ) ; driverNode . get ( Constants . DRIVER_MAJOR_VERSION . getName ( ) ) . set ( driver . getMajorVersion ( ) ) ; driverNode . get ( Constants . DRIVER_MINOR_VERSION . getName ( ) ) . set ( driver . getMinorVersion ( ) ) ; driverNode . get ( Constants . JDBC_COMPLIANT ) . set ( driver . isJdbcCompliant ( ) ) ; result . add ( driverNode ) ; context . getResult ( ) . set ( result ) ; context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
if ( context . isNormalServer ( ) ) {
Buggy code:
public class ContactManagerTest { private ContactManager test1 ; private Calendar date1 ; private Set < Contact > contacts ; private Contact simon ; private Contact nick ; private Contact edgar ; private Contact scott ; @ Before public void buildUp ( ) { } @ After public void cleanUp ( ) { } @ Test public void testAddContacts ( ) { String name = "Simon" ; String notes = "Test" ; test1 . addNewContact ( name , notes ) ; <START_BUG> assertFalse ( test1 . isEmpty ( ) ) ; <END_BUG> } }

Fix:
assertFalse ( ( ( sourcecode . ContactManagerImpl ) ( test1 ) ) . isEmpty ( ) ) ;
Buggy code:
public final class ValidationAjaxHandler extends DojoAjaxHandler { private static Log log = LogFactory . getLog ( ValidationAjaxHandler . class ) ; private final String eventName ; private FormComponent formComponent ; public ValidationAjaxHandler ( String eventName ) { } public final String getEventName ( ) { } public final void renderHeadContribution ( HtmlHeaderContainer container ) { } public final void onComponentTag ( final ComponentTag tag ) { final ValueMap attributes = tag . getAttributes ( ) ; <START_BUG> final String attributeValue = ( ( ( "javascript:validate('" + ( getCallbackUrl ( ) ) ) + "',<seq2seq4repair_space>'" ) + ( formComponent . getInput ( ) ) ) + "',<seq2seq4repair_space>this);" ; <END_BUG> attributes . put ( getEventName ( ) , attributeValue ) ; } protected final IResourceStream getResponse ( ) { } }

Fix:
final String attributeValue = ( ( ( "javascript:validate('" + ( getCallbackUrl ( ) ) ) + "',<seq2seq4repair_space>'" ) + ( formComponent . getInputName ( ) ) ) + "',<seq2seq4repair_space>this);" ;
Buggy code:
<START_BUG> public class InternalErrorPage extends WebPage < Object > { <END_BUG> private static final long serialVersionUID = 1L ; public InternalErrorPage ( ) { } @ Override protected void configureResponse ( ) { super . configureResponse ( ) ; getWebRequestCycle ( ) . getWebResponse ( ) . getHttpServletResponse ( ) . setStatus ( SC_INTERNAL_SERVER_ERROR ) ; } @ Override public boolean isVersioned ( ) { } @ Override public boolean isErrorPage ( ) { } }

Fix:
public class InternalErrorPage extends WebPage {
Buggy code:
public class MemoryFileSystem extends FileSystem { public static final String SCHEME_MEMORY = "memory" ; public static URI toURI ( IPath path ) { try { <START_BUG> return new URI ( MemoryFileSystem . SCHEME_MEMORY , path . toPortableString ( ) , null ) ; <END_BUG> } catch ( URISyntaxException e ) { throw new RuntimeException ( e ) ; } } public MemoryFileSystem ( ) { } public IFileStore getStore ( URI uri ) { } public boolean isCaseSensitive ( ) { } }

Fix:
return new URI ( MemoryFileSystem . SCHEME_MEMORY , null , path . setDevice ( null ) . toPortableString ( ) , null ) ;
Buggy code:
public class BlockingClient extends AbstractClient { private static final Logger log = Logger . getLogger ( BlockingClient . class ) ; private BlockingSocketTrunk trunk ; private Socket socket ; private ServerAddress serverAddress ; public void connect ( ServerAddress serverAddress , ThreadGroup threadGroup ) throws IOException { this . serverAddress = serverAddress ; boolean tracing = BlockingClient . log . isTraceEnabled ( ) ; if ( tracing ) BlockingClient . log . trace ( ( "Connecting<seq2seq4repair_space>to<seq2seq4repair_space>:<seq2seq4repair_space>" + serverAddress ) ) ; socket = new Socket ( serverAddress . address , serverAddress . port ) ; socket . setTcpNoDelay ( serverAddress . enableTcpNoDelay ) ; trunk = new BlockingSocketTrunk ( socket , threadGroup ) ; CommTrunkRamp ramp = new CommTrunkRamp ( trunk , workManager ) ; trunk . setCommTrunkRamp ( ramp ) ; <START_BUG> ramp . setTrunkListner ( this ) ; <END_BUG> if ( tracing ) BlockingClient . log . trace ( "Connection<seq2seq4repair_space>established." ) ; } public ServerAddress getServerAddress ( ) { } public ICommTrunk getCommTrunk ( ) { } public void start ( ) { } public void stop ( ) { } }

Fix:
ramp . setTrunkListener ( this ) ;
Buggy code:
public class NodeIteratorImpl implements NodeIterator { private DocumentImpl fDocument ; private Node fRoot ; private int fWhatToShow = NodeFilter . SHOW_ALL ; private NodeFilter fNodeFilter ; private boolean fDetach = false ; private Node fCurrentNode ; private boolean fForward = true ; private boolean fEntityReferenceExpansion ; public NodeIteratorImpl ( DocumentImpl document , Node root , int whatToShow , NodeFilter nodeFilter , boolean entityReferenceExpansion ) { } public Node getRoot ( ) { } public int getWhatToShow ( ) { } public NodeFilter getFilter ( ) { } public boolean getExpandEntityReferences ( ) { } public Node nextNode ( ) { } public Node previousNode ( ) { } boolean acceptNode ( Node node ) { } Node matchNodeOrParent ( Node node ) { <START_BUG> for ( Node n = node ; n != ( fRoot ) ; n = n . getParentNode ( ) ) { <END_BUG> if ( node == n ) return n ; } return null ; } Node nextNode ( Node node , boolean visitChildren ) { } Node previousNode ( Node node ) { } public void removeNode ( Node node ) { } public void detach ( ) { } }

Fix:
for ( Node n = fCurrentNode ; n != ( fRoot ) ; n = n . getParentNode ( ) ) {
Buggy code:
class AddressSettingsWriteHandler implements OperationStepHandler { static final AddressSettingsWriteHandler INSTANCE = new AddressSettingsWriteHandler ( ) ; public void registerAttributes ( final ManagementResourceRegistration registry ) { } @ Override public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { final Resource resource = context . readResourceForUpdate ( EMPTY_ADDRESS ) ; final String attribute = operation . require ( NAME ) . asString ( ) ; final AttributeDefinition def = AddressSettingsWriteHandler . getAttributeDefinition ( attribute ) ; if ( def == null ) { context . getFailureDescription ( ) . set ( new ModelNode ( ) . set ( MessagingMessages . MESSAGES . unknownAttribute ( attribute ) ) ) ; } def . getValidator ( ) . validateParameter ( VALUE , operation ) ; resource . getModel ( ) . get ( attribute ) . set ( operation . get ( VALUE ) ) ; if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { final HornetQServer server = AddressSettingAdd . getServer ( context , operation ) ; PathAddress address = null ; HierarchicalRepository < AddressSettings > repository = null ; AddressSettings existingSettings = null ; if ( server != null ) { final ModelNode model = resource . getModel ( ) ; address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; <START_BUG> final AddressSettings settings = AddressSettingAdd . createSettings ( model ) ; <END_BUG> repository = server . getAddressSettingsRepository ( ) ; String match = address . getLastElement ( ) . getValue ( ) ; existingSettings = repository . getMatch ( match ) ; repository . addMatch ( match , settings ) ; } if ( ( ( context . completeStep ( ) ) != ( ResultAction . KEEP ) ) && ( existingSettings != null ) ) { repository . addMatch ( address . getLastElement ( ) . getValue ( ) , existingSettings ) ; } } } , RUNTIME ) ; } context . completeStep ( ) ; } static final AttributeDefinition getAttributeDefinition ( final String attributeName ) { } }

Fix:
final AddressSettings settings = AddressSettingAdd . createSettings ( context , model ) ;
Buggy code:
public class SimpleMapper1 extends BaseInterceptor { int debug = 0 ; ContextManager cm ; PrefixMapper map ; int ctExtMapNote = - 1 ; boolean mapCacheEnabled = false ; public SimpleMapper1 ( ) { } public void setDebug ( int level ) { } void log ( String msg ) { } public void setMapCache ( boolean v ) { } public void setContextManager ( ContextManager cm ) { } public void addContext ( ContextManager cm , Context ctx ) throws TomcatException { } public void removeContext ( ContextManager cm , Context ctx ) throws TomcatException { } public void addContainer ( Container ct ) throws TomcatException { Context ctx = ct . getContext ( ) ; String vhost = ctx . getHost ( ) ; String path = ct . getPath ( ) ; String ctxP = ctx . getPath ( ) ; <START_BUG> if ( ( ct . getHandler ( ) ) == null ) { <END_BUG> return ; } switch ( ct . getMapType ( ) ) { case Container . PREFIX_MAP : map . addMapping ( vhost , ( ctxP + ( path . substring ( 0 , ( ( path . length ( ) ) - 2 ) ) ) ) , ct ) ; if ( ( debug ) > 0 ) log ( ( ( ( ( ( ( ( "SM:<seq2seq4repair_space>prefix<seq2seq4repair_space>map<seq2seq4repair_space>" + vhost ) + ":" ) + ctxP ) + path ) + "<seq2seq4repair_space>-><seq2seq4repair_space>" ) + ct ) + "<seq2seq4repair_space>" ) ) ; break ; case Container . EXTENSION_MAP : Context mapCtx = ct . getContext ( ) ; Container defC = mapCtx . getContainer ( ) ; SimpleHashtable eM = ( ( SimpleHashtable ) ( defC . getNote ( ctExtMapNote ) ) ) ; if ( eM == null ) { eM = new SimpleHashtable ( ) ; defC . setNote ( ctExtMapNote , eM ) ; } eM . put ( path . substring ( 1 ) , ct ) ; if ( ( debug ) > 0 ) log ( ( ( ( ( ( ( "SM:<seq2seq4repair_space>extension<seq2seq4repair_space>map<seq2seq4repair_space>" + ctxP ) + "//" ) + path ) + "<seq2seq4repair_space>" ) + ct ) + "<seq2seq4repair_space>" ) ) ; break ; case Container . PATH_MAP : map . addExactMapping ( vhost , ( ctxP + path ) , ct ) ; if ( ( debug ) > 0 ) log ( ( ( ( ( ( ( ( "SM:<seq2seq4repair_space>exact<seq2seq4repair_space>map<seq2seq4repair_space>" + vhost ) + ":" ) + ctxP ) + path ) + "<seq2seq4repair_space>-><seq2seq4repair_space>" ) + ct ) + "<seq2seq4repair_space>" ) ) ; break ; } } public void removeContainer ( Container ct ) throws TomcatException { } public int contextMap ( Request req ) { } public int requestMap ( Request req ) { } Container matchExtension ( Request req ) { } void fixRequestPaths ( String path , Request req , Container container ) { } }

Fix:
if ( ( ( ct . getRoles ( ) ) != null ) || ( ( ct . getTransport ( ) ) != null ) ) {
Buggy code:
public class Version { private Version ( ) { } public static String id ( ) { <START_BUG> return "4.5-SNAPSHOT-20080715-1721" ; <END_BUG> } public static void main ( String [ ] args ) { } }

Fix:
return "4.5-SNAPSHOT-20080722-1051" ;
Buggy code:
@ RunWith ( Arquillian . class ) public class WeldModuleDeploymentTestCase { public static void doSetup ( ) throws Exception { } @ AfterClass public static void tearDown ( ) throws Exception { } private static void deleteRecursively ( File file ) { } private static void createTestModule ( File testModuleRoot ) throws IOException { } private static void copyFile ( File target , InputStream src ) throws IOException { } private static File getModulePath ( ) { String modulePath = System . getProperty ( "module.path" , null ) ; if ( modulePath == null ) { String jbossHome = System . getProperty ( "jboss.home" , null ) ; if ( jbossHome == null ) { throw new IllegalStateException ( "Neither<seq2seq4repair_space>-Dmodule.path<seq2seq4repair_space>nor<seq2seq4repair_space>-Djboss.home<seq2seq4repair_space>were<seq2seq4repair_space>set" ) ; } modulePath = ( jbossHome + ( File . separatorChar ) ) + "modules" ; } else { <START_BUG> modulePath = modulePath . split ( File . pathSeparator ) [ 1 ] ; <END_BUG> } File moduleDir = new File ( modulePath ) ; if ( ! ( moduleDir . exists ( ) ) ) { throw new IllegalStateException ( "Determined<seq2seq4repair_space>module<seq2seq4repair_space>path<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist" ) ; } if ( ! ( moduleDir . isDirectory ( ) ) ) { throw new IllegalStateException ( "Determined<seq2seq4repair_space>module<seq2seq4repair_space>path<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>dir" ) ; } return moduleDir ; } @ Deployment public static Archive < ? > deploy2 ( ) throws Exception { } @ Inject private SimpleBean bean ; @ Test public void testSimpleBeanInjected ( ) throws Exception { } }

Fix:
modulePath = modulePath . split ( File . pathSeparator ) [ 0 ] ;
Buggy code:
public class ToStringStyleConcurrencyTest { static class CollectionHolder < T extends Collection < ? > > { T collection ; CollectionHolder ( T collection ) { } } private static final List < Integer > LIST ; private static final int LIST_SIZE = 100000 ; private static final int REPEAT = 100 ; @ Test public void testLinkedList ( ) throws InterruptedException , ExecutionException { } @ Test public void testArrayList ( ) throws InterruptedException , ExecutionException { } @ Test public void testCopyOnWriteArrayList ( ) throws InterruptedException , ExecutionException { } private void testConcurrency ( final ToStringStyleConcurrencyTest . CollectionHolder < List < Integer > > holder ) throws InterruptedException , ExecutionException { final List < Integer > list = holder . collection ; list . addAll ( ToStringStyleConcurrencyTest . LIST ) ; final ExecutorService threadPool = Executors . newFixedThreadPool ( 2 ) ; Callable < Integer > consumer = new Callable < Integer > ( ) { @ Override public Integer call ( ) { for ( int i = 0 ; i < ( ToStringStyleConcurrencyTest . REPEAT ) ; i ++ ) { new ToStringBuilder ( holder ) . append ( holder . collection ) ; } <START_BUG> return ToStringStyleConcurrencyTest . REPEAT ; <END_BUG> } } ; Collection < Callable < Integer > > tasks = new ArrayList < Callable < Integer > > ( ) ; tasks . add ( consumer ) ; tasks . add ( consumer ) ; final List < Future < Integer > > futures = threadPool . invokeAll ( tasks ) ; for ( Future < Integer > future : futures ) { future . get ( ) ; } } }

Fix:
return Integer . valueOf ( ToStringStyleConcurrencyTest . REPEAT ) ;
Buggy code:
public class MakeEnvironment extends Environment { public MakeEnvironment ( ) { } @ Override public void setup ( ) { } public void dispose ( ) { } public StandaloneMPSProject createDummyProject ( ) { } public Project loadProject ( File projectFile ) { <START_BUG> jetbrains . mps . project . Project project = null ; <END_BUG> try { Class < ? > cls = Class . forName ( "jetbrains.mps.TestMain" ) ; Method meth = cls . getMethod ( "loadProject" , File . class ) ; project = ( ( jetbrains . mps . project . Project ) ( meth . invoke ( null , projectFile ) ) ) ; } catch ( Exception ex ) { throw new RuntimeException ( ex ) ; } return project ; } protected void configureMPS ( ) { } }

Fix:
jetbrains . mps . project . Project project ;
Buggy code:
public class IIOPSubsystemAdd extends AbstractAddStepHandler { static final IIOPSubsystemAdd INSTANCE = new IIOPSubsystemAdd ( ) ; private static final ServiceName SECURITY_DOMAIN_SERVICE_NAME = JBOSS . append ( "security" ) . append ( "security-domain" ) ; @ Override protected void performRuntime ( final OperationContext context , final ModelNode operation , final ModelNode model , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers ) throws OperationFailedException { } protected void launchServices ( final OperationContext context , final ModelNode model , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers ) throws OperationFailedException { } private Properties getConfigurationProperties ( OperationContext context , ModelNode model ) throws OperationFailedException { } private void getResourceProperties ( final Properties properties , PersistentResourceDefinition resource , OperationContext context , ModelNode model ) throws OperationFailedException { } private void setupInitializers ( Properties props ) { } private void setupSSLFactories ( final Properties props ) throws OperationFailedException { boolean supportSSL = "on" . equalsIgnoreCase ( props . getProperty ( SECURITY_SUPPORT_SSL ) ) ; if ( supportSSL ) { String securityDomain = props . getProperty ( SECURITY_SECURITY_DOMAIN ) ; if ( ( securityDomain == null ) || ( securityDomain . isEmpty ( ) ) ) <START_BUG> throw MESSAGES . noSecurityDomainSpecified ( ) ; <END_BUG> SocketFactory . setSecurityDomain ( securityDomain ) ; props . setProperty ( ORBConstants . SOCKET_FACTORY_CLASS_PROPERTY , SocketFactory . class . getName ( ) ) ; } } private IORSecurityConfigMetaData createIORSecurityConfigMetaData ( final OperationContext context , final ModelNode node ) throws OperationFailedException { } private void configureClientSecurity ( final Properties props ) { } }

Fix:
throw ROOT_LOGGER . noSecurityDomainSpecified ( ) ;
Buggy code:
public final class Program { String name ; String fullPath ; String identifier ; static final String PREFIX_HTTP = "http:////" ; static final String PREFIX_HTTPS = "https:////" ; Program ( ) { } public static Program findProgram ( String extension ) { } public static String [ ] getExtensions ( ) { } static Program getProgram ( NSBundle bundle ) { } public static Program [ ] getPrograms ( ) { } static NSURL getURL ( String fileName ) { } static boolean isExecutable ( String fileName ) { } public static boolean launch ( String fileName ) { } public static boolean launch ( String fileName , String workingDir ) { if ( fileName == null ) SWT . error ( ERROR_NULL_ARGUMENT ) ; NSAutoreleasePool pool = ( ( NSAutoreleasePool ) ( new NSAutoreleasePool ( ) . alloc ( ) . init ( ) ) ) ; try { <START_BUG> if ( Program . isExecutable ( fileName ) ) { <END_BUG> try { Compatibility . exec ( new String [ ] { fileName } , null , workingDir ) ; return true ; } catch ( IOException e ) { return false ; } } NSURL url = Program . getURL ( fileName ) ; NSWorkspace workspace = NSWorkspace . sharedWorkspace ( ) ; return workspace . openURL ( url ) ; } finally { pool . release ( ) ; } } public boolean execute ( String fileName ) { } public ImageData getImageData ( ) { } public String getName ( ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public String toString ( ) { } }

Fix:
if ( ( workingDir != null ) && ( Program . isExecutable ( fileName ) ) ) {
Buggy code:
public class ContextNames extends org . jboss . as . naming . deployment . ContextNames { public static final JndiName GLOBAL_CONTEXT_NAME = JndiName . of ( "java:global" ) ; public static final ServiceName GLOBAL_CONTEXT_SERVICE_NAME = JAVA_CONTEXT_SERVICE_NAME . append ( "global" ) ; public static final JndiName APPLICATION_CONTEXT_NAME = JndiName . of ( "java:app" ) ; public static final ServiceName APPLICATION_CONTEXT_SERVICE_NAME = JAVA_CONTEXT_SERVICE_NAME . append ( "app" ) ; public static final JndiName MODULE_CONTEXT_NAME = JndiName . of ( "java:module" ) ; public static final ServiceName MODULE_CONTEXT_SERVICE_NAME = JAVA_CONTEXT_SERVICE_NAME . append ( "module" ) ; public static final JndiName COMPONENT_CONTEXT_NAME = JndiName . of ( "java:comp" ) ; public static final ServiceName COMPONENT_CONTEXT_SERVICE_NAME = JAVA_CONTEXT_SERVICE_NAME . append ( "comp" ) ; public static ServiceName contextServiceNameOfComponent ( String app , String module , String comp ) { } public static ServiceName contextServiceNameOfModule ( String app , String module ) { } public static ServiceName contextServiceNameOfApplication ( String app ) { } public static ServiceName serviceNameOfContext ( String app , String module , String comp , String context ) { if ( context . startsWith ( "java:" ) ) { final String namespace ; final int i = context . indexOf ( '//' ) ; if ( i == ( - 1 ) ) { namespace = context . substring ( 5 ) ; } else { namespace = context . substring ( 5 , i ) ; } if ( namespace . equals ( "global" ) ) { return ContextNames . GLOBAL_CONTEXT_SERVICE_NAME . append ( context . substring ( 12 ) ) ; } else if ( namespace . equals ( "app" ) ) { return ContextNames . contextServiceNameOfApplication ( app ) . append ( context . substring ( 9 ) ) ; } else if ( namespace . equals ( "module" ) ) { return ContextNames . contextServiceNameOfModule ( app , module ) . append ( context . substring ( 12 ) ) ; } else if ( namespace . equals ( "comp" ) ) { return ContextNames . contextServiceNameOfComponent ( app , module , comp ) . append ( context . substring ( 10 ) ) ; } else { <START_BUG> return null ; <END_BUG> } } else { return null ; } } }

Fix:
return JAVA_CONTEXT_SERVICE_NAME . append ( context ) ;
Buggy code:
public class CommandLineMain { private static CommandLineParser parser = new GnuParser ( ) ; private static Options options = new Options ( ) ; private static HelpFormatter formatter = new HelpFormatter ( ) ; private static final String usage = "jdr.{sh,bat}<seq2seq4repair_space>[options]" ; public static void main ( String [ ] args ) { <START_BUG> String port = "9999" ; <END_BUG> String host = "localhost" ; String protocol = "http-remoting" ; try { CommandLine line = CommandLineMain . parser . parse ( CommandLineMain . options , args , false ) ; if ( line . hasOption ( "help" ) ) { CommandLineMain . formatter . printHelp ( CommandLineMain . usage , CommandLineMain . options ) ; return ; } if ( line . hasOption ( "host" ) ) { host = line . getOptionValue ( "host" ) ; } if ( line . hasOption ( "port" ) ) { port = line . getOptionValue ( "port" ) ; } if ( line . hasOption ( "protocol" ) ) { protocol = line . getOptionValue ( "protocol" ) ; } } catch ( ParseException e ) { System . out . println ( e . getMessage ( ) ) ; CommandLineMain . formatter . printHelp ( CommandLineMain . usage , CommandLineMain . options ) ; return ; } System . out . println ( "Initializing<seq2seq4repair_space>JBoss<seq2seq4repair_space>Diagnostic<seq2seq4repair_space>Reporter..." ) ; JdrReportService reportService = new JdrReportService ( ) ; JdrReport response = null ; try { response = reportService . standaloneCollect ( protocol , host , port ) ; System . out . println ( ( "JDR<seq2seq4repair_space>started:<seq2seq4repair_space>" + ( response . getStartTime ( ) . toString ( ) ) ) ) ; System . out . println ( ( "JDR<seq2seq4repair_space>ended:<seq2seq4repair_space>" + ( response . getEndTime ( ) . toString ( ) ) ) ) ; System . out . println ( ( "JDR<seq2seq4repair_space>location:<seq2seq4repair_space>" + ( response . getLocation ( ) ) ) ) ; } catch ( OperationFailedException e ) { System . out . println ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>complete<seq2seq4repair_space>the<seq2seq4repair_space>JDR<seq2seq4repair_space>report:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } System . exit ( 0 ) ; } }

Fix:
String port = "9990" ;
Buggy code:
public class Table extends AbstractTable { public Table ( ) { } public String [ ] [ ] getTableData ( List data ) { <START_BUG> return null ; <END_BUG> } }

Fix:
return new String [ 0 ] [ 0 ] ;
Buggy code:
public abstract class ServerRestartRequiredServerConfigWriteAttributeHandler extends WriteAttributeOperationHandler { public static final ServerRestartRequiredServerConfigWriteAttributeHandler GROUP_INSTANCE = new ServerRestartRequiredServerConfigWriteAttributeHandler . GroupHandler ( ) ; public static final ServerRestartRequiredServerConfigWriteAttributeHandler SOCKET_BINDING_GROUP_INSTANCE = new ServerRestartRequiredServerConfigWriteAttributeHandler . SocketBindingGroupHandler ( ) ; public static final ServerRestartRequiredServerConfigWriteAttributeHandler SOCKET_BINDING_PORT_OFFSET_INSTANCE = new ServerRestartRequiredServerConfigWriteAttributeHandler . SocketBindingPortOffsetHandler ( ) ; private static StringLengthValidator STRING_VALIDATOR = new StringLengthValidator ( 1 , false ) ; public ServerRestartRequiredServerConfigWriteAttributeHandler ( ParameterValidator validator ) { } @ Override protected void modelChanged ( OperationContext context , ModelNode operation , String attributeName , ModelNode newValue , ModelNode currentValue ) throws OperationFailedException { if ( newValue . equals ( currentValue ) ) { ServerOperationResolver . addToDontPropagateToServersAttachment ( context , operation ) ; } validateReferencedNewValueExisits ( context , newValue ) ; <START_BUG> context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; <END_BUG> } protected abstract void validateReferencedNewValueExisits ( OperationContext context , ModelNode value ) throws OperationFailedException { } private static class GroupHandler extends ServerRestartRequiredServerConfigWriteAttributeHandler { public GroupHandler ( ) { } @ Override protected void validateReferencedNewValueExisits ( OperationContext context , ModelNode value ) throws OperationFailedException { } } private static class SocketBindingGroupHandler extends ServerRestartRequiredServerConfigWriteAttributeHandler { public SocketBindingGroupHandler ( ) { } @ Override protected void validateReferencedNewValueExisits ( OperationContext context , ModelNode value ) throws OperationFailedException { } } private static class SocketBindingPortOffsetHandler extends ServerRestartRequiredServerConfigWriteAttributeHandler { static final IntRangeValidator VALIDATOR = new IntRangeValidator ( 0 , true ) ; public SocketBindingPortOffsetHandler ( ) { } @ Override protected void validateReferencedNewValueExisits ( OperationContext context , ModelNode value ) throws OperationFailedException { } } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
@ SuppressWarnings ( "OctalInteger" ) public class BabySitterChargeCalculator { private static final LocalTime FOUR_AM = LocalTime . of ( 4 , 0 ) ; @ VisibleForTesting static final int AFTER_MIDNIGHT_RATE = 16 ; @ VisibleForTesting static final int BEFORE_BEDTIME_RATE = 12 ; @ VisibleForTesting static final int AFTER_BEDTIME_RATE = 8 ; private static final int HOUR_OF_MIDNIGHT = 0 ; private static final int HOUR_OF_4_AM = 4 ; private static final int HOUR_OF_5_PM = 17 ; public static int calculateTotalCharge ( LocalTime startTime , LocalTime bedTime , LocalTime endTime ) { } @ VisibleForTesting static void checkArguments ( LocalTime startTime , LocalTime bedTime , LocalTime endTime ) { } private static boolean isStartTimeNotBefore5pm ( LocalTime startTime ) { int hour = startTime . getHour ( ) ; <START_BUG> return ( hour >= ( BabySitterChargeCalculator . HOUR_OF_5_PM ) ) || ( hour == ( BabySitterChargeCalculator . HOUR_OF_MIDNIGHT ) ) ; <END_BUG> } private static boolean isEndTimeNotAfter4am ( LocalTime endTime ) { } private static boolean isBedTimeNotAfterMidnight ( LocalTime bedTime ) { } private static boolean isBedTimeNotBeforeStartTime ( LocalTime startTime , LocalTime bedTime ) { } private static boolean isEndTimeNotBeforeBedTime ( LocalTime bedTime , LocalTime endTime ) { } @ VisibleForTesting static int hoursBeforeMidnight ( LocalTime startTime ) { } @ VisibleForTesting static int hoursAfterMidnight ( LocalTime endTime ) { } @ VisibleForTesting static int hoursPreBedTime ( LocalTime startTime , LocalTime bedTime ) { } @ VisibleForTesting static int hoursPostBedTime ( LocalTime startTime , LocalTime bedTime , LocalTime endTime ) { } private static int getHourRoundUp ( LocalTime t ) { } @ VisibleForTesting static int getChargeForAfterMidnight ( LocalTime endTime ) { } @ VisibleForTesting static int getChargeForBeforeBedTime ( LocalTime startTime , LocalTime bedTime ) { } @ VisibleForTesting static int getChargeForAfterBedTime ( LocalTime startTime , LocalTime bedTime , LocalTime endTime ) { } }

Fix:
return ( hour >= ( BabySitterChargeCalculator . HOUR_OF_5_PM ) ) || ( startTime . equals ( LocalTime . MIDNIGHT ) ) ;
Buggy code:
public class RequiredValidator extends AbstractValidator { public final void validate ( final FormComponent component ) { } public String toString ( ) { <START_BUG> return "[required]" ; <END_BUG> } }

Fix:
return "[RequiredValidator]" ;
Buggy code:
@ Component public class QualityJob { private static final int UNCONTROLLED_BLOCK = 20 ; protected static Logger logger = LoggerFactory . getLogger ( QualityJob . class ) ; @ Autowired private IStationPersistence stationPersistence = null ; @ Autowired private IObservationPersistence observationPersistence = null ; @ Transactional ( propagation = Propagation . REQUIRED ) @ Scheduled ( fixedRate = IServerConstants . QUALITY_POLLING_TIME ) public synchronized void timeout ( ) { } @ Transactional ( propagation = Propagation . REQUIRED ) private void processQuality ( Station station , List < Observation > observations ) { } private boolean processQuality ( String stringValue , Double minimum , Double maximum , Double physicalMinimum , Double physicalMaximum , StringBuffer warning ) { Double value = null ; boolean ok = true ; try { value = Double . valueOf ( stringValue ) ; if ( ( minimum != null ) && ( value < minimum ) ) { ok = false ; addWarning ( String . format ( "Value<seq2seq4repair_space>'%s'<seq2seq4repair_space>should<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>less<seq2seq4repair_space>than<seq2seq4repair_space>'%s'" , value , minimum ) , warning ) ; } if ( ( maximum != null ) && ( value > maximum ) ) { ok = false ; addWarning ( String . format ( "Value<seq2seq4repair_space>'%s'<seq2seq4repair_space>should<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>more<seq2seq4repair_space>than<seq2seq4repair_space>'%s'" , value , maximum ) , warning ) ; } if ( ( minimum != null ) && ( value < physicalMinimum ) ) { ok = false ; addWarning ( String . format ( "Value<seq2seq4repair_space>'%s'<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>less<seq2seq4repair_space>than<seq2seq4repair_space>'%s'" , value , physicalMinimum ) , warning ) ; } if ( ( maximum != null ) && ( value > physicalMaximum ) ) { ok = false ; addWarning ( String . format ( "Value<seq2seq4repair_space>'%s'<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>more<seq2seq4repair_space>than<seq2seq4repair_space>'%s'" , value , physicalMaximum ) , warning ) ; } } catch ( Exception e ) { ok = false ; <START_BUG> addWarning ( String . format ( "Value<seq2seq4repair_space>'%s'<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>number" , value , physicalMaximum ) , warning ) ; <END_BUG> } return ok ; } private void addWarning ( String message , StringBuffer warning ) { } }

Fix:
addWarning ( String . format ( "Value<seq2seq4repair_space>'%s'<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>number" , value ) , warning ) ;