nus-yam/ex-repair huggingface dataset:
Buggy code:
public class AboutCommand implements Command { private static Set commandSet ; private static JDialog about ; public void doAction ( ActionEvent e ) { } public Set getActionNames ( ) { } void about ( ) { JFrame mainFrame = GuiPackage . getInstance ( ) . getMainFrame ( ) ; if ( ( AboutCommand . about ) == null ) { AboutCommand . about = new JDialog ( mainFrame , "About<seq2seq4repair_space>Apache<seq2seq4repair_space>JMeter..." , false ) ; AboutCommand . about . addMouseListener ( new MouseAdapter ( ) { public void mouseClicked ( MouseEvent e ) { AboutCommand . about . setVisible ( false ) ; } } ) ; JLabel jmeter = new JLabel ( JMeterUtils . getImage ( "jmeter.jpg" ) ) ; <START_BUG> JLabel copyright = new JLabel ( "Copyright<seq2seq4repair_space>(c)<seq2seq4repair_space>1998-2003<seq2seq4repair_space>The<seq2seq4repair_space>Apache<seq2seq4repair_space>Software<seq2seq4repair_space>Foundation" , JLabel . CENTER ) ; <END_BUG> JLabel rights = new JLabel ( "All<seq2seq4repair_space>Rights<seq2seq4repair_space>Reserved." , JLabel . CENTER ) ; JLabel version = new JLabel ( ( "Apache<seq2seq4repair_space>JMeter<seq2seq4repair_space>Version<seq2seq4repair_space>" + ( JMeterUtils . getJMeterVersion ( ) ) ) , JLabel . CENTER ) ; JPanel infos = new JPanel ( ) ; infos . setOpaque ( false ) ; infos . setLayout ( new GridLayout ( 0 , 1 ) ) ; infos . setBorder ( new EmptyBorder ( 5 , 5 , 5 , 5 ) ) ; infos . add ( copyright ) ; infos . add ( rights ) ; infos . add ( version ) ; Container panel = AboutCommand . about . getContentPane ( ) ; panel . setLayout ( new BorderLayout ( ) ) ; panel . setBackground ( Color . white ) ; panel . add ( jmeter , BorderLayout . NORTH ) ; panel . add ( infos , BorderLayout . SOUTH ) ; } Point p = mainFrame . getLocationOnScreen ( ) ; Dimension d1 = mainFrame . getSize ( ) ; Dimension d2 = AboutCommand . about . getSize ( ) ; AboutCommand . about . setLocation ( ( ( p . x ) + ( ( ( d1 . width ) - ( d2 . width ) ) // 2 ) ) , ( ( p . y ) + ( ( ( d1 . height ) - ( d2 . height ) ) // 2 ) ) ) ; AboutCommand . about . pack ( ) ; AboutCommand . about . setVisible ( true ) ; } }

Fix:
JLabel copyright = new JLabel ( JMeterUtils . getJMeterCopyright ( ) , JLabel . CENTER ) ;
Buggy code:
public class WorldProviderSurface extends WorldProvider { @ Override public String getDimensionName ( ) { } @ Override public String getInternalNameSuffix ( ) { } @ Override protected void registerWorldChunkManager ( ) { } @ Override public IChunkProvider createChunkGenerator ( ) { } @ Override public boolean canCoordinateBeSpawn ( int x , int z ) { } @ Override public double getHorizon ( ) { <START_BUG> return 128.0 ; <END_BUG> } @ Override @ SideOnly ( Side . CLIENT ) public float getCloudHeight ( ) { } }

Fix:
return 64.0 ;
Buggy code:
public class PagedTableNavigatorWithMarginTest extends TestCase { public PagedTableNavigatorWithMarginTest ( ) { } public PagedTableNavigatorWithMarginTest ( String name ) { } public void testPagedTable ( ) throws Exception { } private boolean validatePage ( final String document , final String file ) throws IOException { <START_BUG> return DiffUtil . validatePage ( document , this . getClass ( ) , file ) ; <END_BUG> } }

Fix:
return DiffUtil . validatePage ( document , this . getClass ( ) , file , true ) ;
Buggy code:
public class Test { public static void main ( String [ ] args ) { try { Class . forName ( "connectionManagement.HPCCDriver" ) ; Properties connectionProperties = new Properties ( ) ; connectionProperties . put ( "EclResultLimit" , "2000" ) ; HPCCConnection connection = ( ( HPCCConnection ) ( DriverManager . getDriver ( "jdbc:hpcc" ) . connect ( "http:////192.168.56.101" , connectionProperties ) ) ) ; HPCCStatement stmt = ( ( HPCCStatement ) ( connection . createStatement ( ) ) ) ; <START_BUG> String query = "insert<seq2seq4repair_space>into<seq2seq4repair_space>i2b2demodata.modifier_dimension<seq2seq4repair_space>values('test','test','test','test','test','test','test','test',5);" ; <END_BUG> stmt . executeQuery ( query ) ; } catch ( SQLException | ClassNotFoundException e ) { e . printStackTrace ( ) ; } } }

Fix:
String query = "insert<seq2seq4repair_space>into<seq2seq4repair_space>i2b2demodata.query_global_temp<seq2seq4repair_space>values('test','test','test','test','test','test','test','test',5);" ;
Buggy code:
public class TestDocumentWriter extends LuceneTestCase { private Directory dir ; @ Override public void setUp ( ) throws Exception { } @ Override public void tearDown ( ) throws Exception { } public void test ( ) { } public void testAddDocument ( ) throws Exception { Document testDoc = new Document ( ) ; DocHelper . setupDoc ( testDoc ) ; IndexWriter writer = new IndexWriter ( dir , newIndexWriterConfig ( TEST_VERSION_CURRENT , new MockAnalyzer ( random ( ) ) ) ) ; writer . addDocument ( testDoc ) ; writer . commit ( ) ; SegmentInfoPerCommit info = writer . newestSegment ( ) ; writer . close ( ) ; SegmentReader reader = new SegmentReader ( info , DirectoryReader . DEFAULT_TERMS_INDEX_DIVISOR , newIOContext ( random ( ) ) ) ; assertTrue ( ( reader != null ) ) ; Document doc = reader . document ( 0 ) ; assertTrue ( ( doc != null ) ) ; IndexableField [ ] fields = doc . getFields ( "textField2" ) ; assertTrue ( ( ( fields != null ) && ( ( fields . length ) == 1 ) ) ) ; assertTrue ( fields [ 0 ] . stringValue ( ) . equals ( FIELD_2_TEXT ) ) ; assertTrue ( fields [ 0 ] . fieldType ( ) . storeTermVectors ( ) ) ; fields = doc . getFields ( "textField1" ) ; assertTrue ( ( ( fields != null ) && ( ( fields . length ) == 1 ) ) ) ; assertTrue ( fields [ 0 ] . stringValue ( ) . equals ( FIELD_1_TEXT ) ) ; assertFalse ( fields [ 0 ] . fieldType ( ) . storeTermVectors ( ) ) ; fields = doc . getFields ( "keyField" ) ; assertTrue ( ( ( fields != null ) && ( ( fields . length ) == 1 ) ) ) ; assertTrue ( fields [ 0 ] . stringValue ( ) . equals ( KEYWORD_TEXT ) ) ; fields = doc . getFields ( NO_NORMS_KEY ) ; assertTrue ( ( ( fields != null ) && ( ( fields . length ) == 1 ) ) ) ; assertTrue ( fields [ 0 ] . stringValue ( ) . equals ( NO_NORMS_TEXT ) ) ; fields = doc . getFields ( TEXT_FIELD_3_KEY ) ; assertTrue ( ( ( fields != null ) && ( ( fields . length ) == 1 ) ) ) ; assertTrue ( fields [ 0 ] . stringValue ( ) . equals ( FIELD_3_TEXT ) ) ; for ( FieldInfo fi : reader . getFieldInfos ( ) ) { if ( fi . isIndexed ( ) ) { <START_BUG> assertTrue ( ( ( fi . omitsNorms ( ) ) == ( ( reader . normValues ( fi . name ) ) == null ) ) ) ; <END_BUG> } } reader . close ( ) ; } public void testPositionIncrementGap ( ) throws IOException { } public void testTokenReuse ( ) throws IOException { } public void testPreAnalyzedField ( ) throws IOException { } public void testMixedTermVectorSettingsSameField ( ) throws Exception { } public void testLUCENE_1590 ( ) throws Exception { } }

Fix:
assertTrue ( ( ( fi . omitsNorms ( ) ) == ( ( reader . getNormValues ( fi . name ) ) == null ) ) ) ;
Buggy code:
final class ClosedState extends CircuitBreakerState { private final CircuitBreakerMetrics circuitBreakerMetrics ; private final float failureRateThreshold ; ClosedState ( CircuitBreakerStateMachine stateMachine ) { } @ Override boolean isCallPermitted ( ) { } @ Override void recordFailure ( ) { } @ Override void recordSuccess ( ) { } private void checkFailureRate ( float currentFailureRate ) { <START_BUG> if ( currentFailureRate > ( failureRateThreshold ) ) { <END_BUG> stateMachine . transitionToOpenState ( CLOSED_TO_OPEN , circuitBreakerMetrics ) ; } } @ Override State getState ( ) { } @ Override Metrics getMetrics ( ) { } }

Fix:
if ( currentFailureRate >= ( failureRateThreshold ) ) {
Buggy code:
public class WebMvcStompEndpointRegistryTests { private WebMvcStompEndpointRegistry registry ; private SubProtocolWebSocketHandler webSocketHandler ; private UserSessionRegistry userSessionRegistry ; private MessageBrokerRegistry messageBrokerRegistry ; @ Before public void setup ( ) { SubscribableChannel inChannel = Mockito . mock ( SubscribableChannel . class ) ; SubscribableChannel outChannel = Mockito . mock ( SubscribableChannel . class ) ; this . webSocketHandler = new SubProtocolWebSocketHandler ( inChannel , outChannel ) ; this . userSessionRegistry = new DefaultUserSessionRegistry ( ) ; this . messageBrokerRegistry = new MessageBrokerRegistry ( inChannel , outChannel ) ; TaskScheduler taskScheduler = Mockito . mock ( TaskScheduler . class ) ; <START_BUG> this . registry = new WebMvcStompEndpointRegistry ( webSocketHandler , userSessionRegistry , taskScheduler , messageBrokerRegistry ) ; <END_BUG> } @ Test public void stompProtocolHandler ( ) { } @ Test public void handlerMapping ( ) { } }

Fix:
this . registry = new WebMvcStompEndpointRegistry ( webSocketHandler , transportRegistration , userSessionRegistry , taskScheduler , messageBrokerRegistry ) ;
Buggy code:
public class NodeController { private Rectangle dragRectangle ; private Pane aDrawPane ; private MainController aMainController ; private double initMoveX ; private double initMoveY ; private HashMap < AbstractNode , Point2D . Double > initTranslateMap = new HashMap < > ( ) ; private ArrayList < AbstractNode > toBeMoved = new ArrayList < > ( ) ; public NodeController ( Pane pDrawPane , MainController pMainController ) { } public void translateDragRectangle ( double translateX , double translateY ) { } public void scaleDragRectangle ( double scaleX , double scaleY ) { } public void resizeStart ( AbstractNodeView nodeView , MouseEvent event ) { } public void resize ( AbstractNodeView nodeView , MouseEvent event ) { } public void resizeFinished ( AbstractNode node , MouseEvent event ) { } public void moveNodesStart ( MouseEvent event ) { } public void moveNodes ( MouseEvent event ) { } public double [ ] moveNodesFinished ( MouseEvent event ) { } public boolean addNodeTitle ( AbstractNode node ) { } private boolean putNodeInPackage ( AbstractNodeView potentialChild ) { } private void checkChildren ( PackageNodeView packageNodeView ) { } public void onDoubleClick ( AbstractNodeView nodeView ) { } private boolean showNodeTitleDialog ( AbstractNode node ) { } public boolean showClassNodeEditDialog ( ClassNode node ) { try { <START_BUG> FXMLLoader loader = new FXMLLoader ( getClass ( ) . getClassLoader ( ) . getResource ( "NodeEditDialog.fxml" ) ) ; <END_BUG> AnchorPane page = ( ( AnchorPane ) ( loader . load ( ) ) ) ; Stage dialogStage = new Stage ( ) ; dialogStage . setTitle ( "Edit<seq2seq4repair_space>Person" ) ; dialogStage . initModality ( Modality . WINDOW_MODAL ) ; dialogStage . initOwner ( aMainController . getStage ( ) ) ; Scene scene = new Scene ( page ) ; dialogStage . setScene ( scene ) ; NodeEditDialogController controller = loader . getController ( ) ; controller . setDialogStage ( dialogStage ) ; controller . setNode ( node ) ; dialogStage . showAndWait ( ) ; return controller . isOkClicked ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; return false ; } } }

Fix:
FXMLLoader loader = new FXMLLoader ( getClass ( ) . getClassLoader ( ) . getResource ( "nodeEditDialog.fxml" ) ) ;
Buggy code:
public final class SignIn extends HtmlPage { public SignIn ( final PageParameters parameters ) { } public final class SignInForm extends Form { private final ValueMap properties = new ValueMap ( ) ; public SignInForm ( final String componentName , final FeedbackPanel feedback ) { } public final void handleSubmit ( final RequestCycle cycle ) { if ( ( properties . getString ( "username" ) . equals ( "jonathan" ) ) && ( properties . getString ( "password" ) . equals ( "password" ) ) ) { <START_BUG> cycle . getSession ( ) . setProperty ( "user" , "jonathan" ) ; <END_BUG> if ( ! ( cycle . continueToOriginalDestination ( ) ) ) { cycle . setPage ( new Home ( PageParameters . NULL ) ) ; } } else { errorMessage ( "Couldn't<seq2seq4repair_space>sign<seq2seq4repair_space>you<seq2seq4repair_space>in" ) ; } } } }

Fix:
cycle . getSession ( ) . setProperty ( "signin.user" , "jonathan" ) ;
Buggy code:
public class LocalPatchGarbageCollectionHandler implements OperationStepHandler { public static final LocalPatchGarbageCollectionHandler INSTANCE = new LocalPatchGarbageCollectionHandler ( ) ; private final String PATCH_ID = PatchResourceDefinition . PATCH_ID . getName ( ) ; @ Override public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { final String patchId = operation . require ( PATCH_ID ) . asString ( ) ; context . acquireControllerLock ( ) ; final ServiceController < ? > mgrService = context . getServiceRegistry ( false ) . getRequiredService ( NAME ) ; final InstallationManager mgr = ( ( InstallationManager ) ( mgrService . getValue ( ) ) ) ; final PatchableTarget . TargetInfo info ; try { info = mgr . getIdentity ( ) . loadTargetInfo ( ) ; } catch ( IOException e ) { throw new OperationFailedException ( "failed<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>identity<seq2seq4repair_space>info" , e ) ; } <START_BUG> if ( info . getCumulativeID ( ) . equals ( patchId ) ) { <END_BUG> throw MESSAGES . patchActive ( patchId ) ; } if ( info . getPatchIDs ( ) . contains ( patchId ) ) { throw MESSAGES . patchActive ( patchId ) ; } final InstalledImage installedImage = info . getDirectoryStructure ( ) . getInstalledImage ( ) ; final File history = installedImage . getPatchHistoryDir ( patchId ) ; if ( history . exists ( ) ) { LocalPatchGarbageCollectionHandler . recursiveDelete ( history ) ; } final File patchRoot = installedImage . getPatchHistoryDir ( patchId ) ; if ( patchRoot . exists ( ) ) { LocalPatchGarbageCollectionHandler . recursiveDelete ( patchRoot ) ; } context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; } static boolean recursiveDelete ( File root ) { } }

Fix:
if ( info . getReleasePatchID ( ) . equals ( patchId ) ) {
Buggy code:
public class AirBlockState implements IBlockState { public static AirBlockState i = new AirBlockState ( ) ; private AirBlockState ( ) { } @ Override public boolean equals ( Block b , int m ) { } @ Override public boolean equals ( World w , int x , int y , int z ) { } @ Override public void set ( World w , int x , int y , int z ) { } @ Override public Block getDefaultBlock ( ) { <START_BUG> return null ; <END_BUG> } @ Override public int getDefaultMeta ( ) { } }

Fix:
return Blocks . air ;
Buggy code:
class ReadRepairManager { private static Logger logger_ = Logger . getLogger ( ReadRepairManager . class ) ; private static final long expirationTimeInMillis = 2000 ; private static Lock lock_ = new ReentrantLock ( ) ; private static ReadRepairManager self_ = null ; static class ReadRepairPerformer implements ICacheExpungeHook < String , Message > { public void callMe ( String target , Message message ) { } } private ICachetable < String , Message > readRepairTable_ = new org . apache . cassandra . utils . Cachetable < String , Message > ( ReadRepairManager . expirationTimeInMillis , new ReadRepairManager . ReadRepairPerformer ( ) ) ; protected ReadRepairManager ( ) { } public static ReadRepairManager instance ( ) { } public void schedule ( InetAddress target , RowMutationMessage rowMutationMessage ) { try { Message message = rowMutationMessage . makeRowMutationMessage ( readRepairVerbHandler_ ) ; <START_BUG> String key = ( target + ":" ) + ( message . getMessageId ( ) ) ; <END_BUG> readRepairTable_ . put ( key , message ) ; } catch ( IOException ex ) { ReadRepairManager . logger_ . error ( LogUtil . throwableToString ( ex ) ) ; } } }

Fix:
String key = ( ( target . getHostAddress ( ) ) + ":" ) + ( message . getMessageId ( ) ) ;
Buggy code:
public class ColumbaLoader implements Runnable { public static final int COLUMBA_PORT = 50000 ; private Thread thread ; private ServerSocket serverSocket ; public ColumbaLoader ( ) { } public synchronized void stop ( ) { } public synchronized boolean isRunning ( ) { } public void run ( ) { while ( isRunning ( ) ) { try { Socket client = serverSocket . accept ( ) ; if ( client == null ) { continue ; } String host = client . getLocalAddress ( ) . getHostAddress ( ) ; if ( ! ( host . equals ( "127.0.0.1" ) ) ) { client . close ( ) ; } BufferedReader reader = new BufferedReader ( new InputStreamReader ( client . getInputStream ( ) ) ) ; StringBuffer arguments = new StringBuffer ( ) ; arguments . append ( reader . readLine ( ) ) ; if ( ! ( arguments . toString ( ) . startsWith ( "columba:" ) ) ) { client . close ( ) ; } if ( MainInterface . DEBUG ) { <START_BUG> log . debug ( ( "passing<seq2seq4repair_space>to<seq2seq4repair_space>running<seq2seq4repair_space>Columba<seq2seq4repair_space>session:\n" + ( arguments . toString ( ) ) ) ) ; <END_BUG> } handleArgs ( arguments . toString ( ) ) ; client . close ( ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } } } protected void handleArgs ( String argumentString ) { } }

Fix:
log . info ( ( "passing<seq2seq4repair_space>to<seq2seq4repair_space>running<seq2seq4repair_space>Columba<seq2seq4repair_space>session:\n" + ( arguments . toString ( ) ) ) ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class GreetingServiceImpl extends RemoteServiceServlet implements GreetingService { private Persistence persistence ; public GreetingServiceImpl ( ) { } @ Override public RiaBootImageBean getRiaBootImage ( ) { } @ Override public Employee newEmployee ( ) { } @ Override public void saveEmployee ( Employee employee ) { } @ Override public Employee [ ] getEmployees ( ) { } @ Override public void deleteEmployee ( String key ) { } public PeriodPreferences newPeriodPreferences ( ) { } private PeriodPreferences newPeriodPreferences ( int year , int month ) { PeriodPreferences periodPreferences = new PeriodPreferences ( year , month ) ; <START_BUG> Calendar myCalendar = new GregorianCalendar ( year , month , 1 ) ; <END_BUG> int numberOfDaysInMonth = myCalendar . getActualMaximum ( Calendar . DAY_OF_MONTH ) ; periodPreferences . setMonthDays ( numberOfDaysInMonth ) ; Calendar calendar = Calendar . getInstance ( ) ; calendar . setTime ( myCalendar . getTime ( ) ) ; int dayOfWeek = calendar . get ( Calendar . DAY_OF_WEEK ) ; periodPreferences . setStartWeekDay ( dayOfWeek ) ; return persistence . createPeriodPreferences ( periodPreferences ) ; } @ Override public void savePeriodPreferences ( PeriodPreferences periodPreferences ) { } @ Override public void deletePeriodPreferences ( String key ) { } @ Override public PeriodPreferences [ ] getPeriodPreferences ( ) { } }

Fix:
Calendar myCalendar = new GregorianCalendar ( year , ( month - 1 ) , 1 ) ;
Buggy code:
class DefaultSingletonBeanAccessTimeoutWriteHandler extends AbstractWriteAttributeHandler < Void > { static final DefaultSingletonBeanAccessTimeoutWriteHandler INSTANCE = new DefaultSingletonBeanAccessTimeoutWriteHandler ( ) ; @ Override protected boolean applyUpdateToRuntime ( OperationContext context , ModelNode operation , String attributeName , ModelNode resolvedValue , ModelNode currentValue , HandbackHolder < Void > voidHandbackHolder ) throws OperationFailedException { } @ Override protected void revertUpdateToRuntime ( OperationContext context , ModelNode operation , String attributeName , ModelNode valueToRestore , ModelNode valueToRevert , Void handback ) throws OperationFailedException { } void updateOrCreateDefaultSingletonBeanAccessTimeoutService ( final OperationContext context , final ModelNode model , List < ServiceController < ? > > newControllers ) throws OperationFailedException { <START_BUG> final long defaultAccessTimeout = DEFAULT_SINGLETON_BEAN_ACCESS_TIMEOUT . validateResolvedOperation ( model ) . asLong ( ) ; <END_BUG> final ServiceName serviceName = DefaultAccessTimeoutService . SINGLETON_SERVICE_NAME ; final ServiceRegistry registry = context . getServiceRegistry ( true ) ; final ServiceController sc = registry . getService ( serviceName ) ; if ( sc != null ) { final DefaultAccessTimeoutService defaultAccessTimeoutService = DefaultAccessTimeoutService . class . cast ( sc . getValue ( ) ) ; defaultAccessTimeoutService . setDefaultAccessTimeout ( defaultAccessTimeout ) ; } else { final DefaultAccessTimeoutService defaultAccessTimeoutService = new DefaultAccessTimeoutService ( defaultAccessTimeout ) ; final ServiceController < ? > newService = context . getServiceTarget ( ) . addService ( serviceName , defaultAccessTimeoutService ) . install ( ) ; if ( newControllers != null ) { newControllers . add ( newService ) ; } } } }

Fix:
final long defaultAccessTimeout = DEFAULT_SINGLETON_BEAN_ACCESS_TIMEOUT . resolveModelAttribute ( context , model ) . asLong ( ) ;
Buggy code:
public class HttpSessionStore extends AbstractHttpSessionStore { public HttpSessionStore ( Application application ) { } public IPageMap createPageMap ( String name ) { } public Object getAttribute ( Request request , String name ) { } public List < String > getAttributeNames ( Request request ) { } public void removeAttribute ( Request request , String name ) { } public void setAttribute ( Request request , String name , Object value ) { } private String getSessionAttributePrefix ( final WebRequest request ) { <START_BUG> return application . getSessionAttributePrefix ( request ) ; <END_BUG> } private boolean isSessionValid ( ) { } }

Fix:
return application . getSessionAttributePrefix ( request , null ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class RemoteStatelessFailoverTestCase extends ClusterAbstractTestCase { private static final Logger log = Logger . getLogger ( RemoteStatelessFailoverTestCase . class ) ; private static final String MODULE_NAME = "remote-ejb-client-stateless-bean-failover-test" ; private static final String CLIENT_PROPERTIES = "cluster//ejb3//stateless//jboss-ejb-client.properties" ; private static EJBDirectory context ; private static final Integer PORT_2 = 4547 ; private static final String HOST_2 = System . getProperty ( "node1" ) ; private static final String REMOTE_PORT_PROPERTY_NAME = "remote.connection.default.port" ; private static final String REMOTE_HOST_PROPERTY_NAME = "remote.connection.default.host" ; @ Deployment ( name = DEPLOYMENT_1 , managed = false , testable = false ) @ TargetsContainer ( CONTAINER_1 ) public static Archive < ? > createDeploymentForContainer1 ( ) { } @ Deployment ( name = DEPLOYMENT_2 , managed = false , testable = false ) @ TargetsContainer ( CONTAINER_2 ) public static Archive < ? > createDeploymentForContainer2 ( ) { } private static Archive < ? > createDeployment ( ) { } @ BeforeClass public static void beforeClass ( ) throws NamingException { } @ AfterClass public static void destroy ( ) throws NamingException { } @ Override protected void setUp ( ) { } @ Test @ InSequence ( 1 ) public void testFailoverOnStop ( ) throws Exception { } @ Test @ InSequence ( 2 ) public void testFailoverOnUndeploy ( ) throws Exception { } @ Test @ InSequence ( 3 ) public void testLoadBalance ( ) throws Exception { } private void validateBalancing ( Stateless bean , int numCalls , int expectedServers , double minPercentage ) { List < String > results = new ArrayList < String > ( numCalls ) ; for ( int i = 0 ; i < numCalls ; i ++ ) { results . add ( bean . getNodeName ( ) ) ; } Set < String > entries = new HashSet < String > ( ) ; entries . addAll ( results ) ; Assert . assertEquals ( expectedServers , entries . size ( ) ) ; double minCalls = minPercentage * numCalls ; for ( String entry : entries ) { int frequency = Collections . frequency ( results , entry ) ; Assert . assertTrue ( Integer . toString ( frequency ) , ( frequency >= minCalls ) ) ; } <START_BUG> System . out . println ( String . format ( "All<seq2seq4repair_space>%d<seq2seq4repair_space>servers<seq2seq4repair_space>processed<seq2seq4repair_space>at<seq2seq4repair_space>least<seq2seq4repair_space>%f<seq2seq4repair_space>of<seq2seq4repair_space>calls" , expectedServers , minCalls ) ) ; <END_BUG> } private void establishView ( ViewChangeListener listener , String ... members ) throws InterruptedException { } }

Fix:
RemoteStatelessFailoverTestCase . log . info ( String . format ( "All<seq2seq4repair_space>%d<seq2seq4repair_space>servers<seq2seq4repair_space>processed<seq2seq4repair_space>at<seq2seq4repair_space>least<seq2seq4repair_space>%f<seq2seq4repair_space>of<seq2seq4repair_space>calls" , expectedServers , minCalls ) ) ;
Buggy code:
public class ValidatorHelper { public ValidatorHelper ( ) { } public static boolean validatePassword ( final String password ) { } public static boolean validateIPs ( final String ipsText ) { if ( Strings . isNullOrEmpty ( ipsText ) ) { return true ; } <START_BUG> String [ ] lines = ipsText . split ( System . getProperty ( "line.separator" ) ) ; <END_BUG> boolean valid = true ; for ( String line : lines ) { valid = new IPAddressValidator ( ) . validate ( line ) ; } return valid ; } public static boolean validateLogin ( final String login ) { } public static boolean validateString ( final String string ) { } }

Fix:
String [ ] lines = ipsText . split ( "\\r?\\n" ) ;
Buggy code:
public class FunctionDeclarationValidator extends ExpressionValidator { public void validate ( ) { } private void validateReturnValue ( ) { } private void validateParameterTuple ( TupleDeclarationExpression tuple ) { <START_BUG> for ( VerbaExpression expression : tuple . items ( ) ) { <END_BUG> if ( expression instanceof NamedValueExpression ) { NamedValueExpression varName = ( ( NamedValueExpression ) ( expression ) ) ; if ( ! ( varName . hasTypeConstraint ( ) ) ) { this . addError ( expression , "The<seq2seq4repair_space>parameter<seq2seq4repair_space>'%s'<seq2seq4repair_space>must<seq2seq4repair_space>have<seq2seq4repair_space>a<seq2seq4repair_space>type<seq2seq4repair_space>constraint." , varName . identifier ( ) . representation ( ) ) ; } } else { this . addError ( expression , "Expression<seq2seq4repair_space>%s<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>VarNameExpression" , expression ) ; } } } public void validateName ( ) { } }

Fix:
for ( VerbaExpression expression : tuple . items ( ) . cast ( VerbaExpression . class ) ) {
Buggy code:
public class PackageRequestTargetUrlCodingStrategy extends AbstractRequestTargetUrlCodingStrategy { private final PackageName packageName ; public PackageRequestTargetUrlCodingStrategy ( final String path , PackageName packageName ) { } public IRequestTarget decode ( String urlFragment ) { } public final String encode ( IRequestTarget requestTarget ) { if ( ! ( requestTarget instanceof IBookmarkablePageRequestTarget ) ) { throw new IllegalArgumentException ( ( "this<seq2seq4repair_space>encoder<seq2seq4repair_space>can<seq2seq4repair_space>only<seq2seq4repair_space>be<seq2seq4repair_space>used<seq2seq4repair_space>with<seq2seq4repair_space>instances<seq2seq4repair_space>of<seq2seq4repair_space>" + ( IBookmarkablePageRequestTarget . class . getName ( ) ) ) ) ; } StringBuffer url = new StringBuffer ( ) ; url . append ( getMountPath ( ) ) ; IBookmarkablePageRequestTarget target = ( ( IBookmarkablePageRequestTarget ) ( requestTarget ) ) ; <START_BUG> url . append ( "//" ) . append ( Classes . name ( target . getPageClass ( ) ) ) ; <END_BUG> appendPageParameters ( url , target . getPageParameters ( ) ) ; return url . toString ( ) ; } public boolean matches ( IRequestTarget requestTarget ) { } }

Fix:
url . append ( "//" ) . append ( Classes . simpleName ( target . getPageClass ( ) ) ) ;
Buggy code:
public class GUI extends JFrame { private static final long serialVersionUID = 1L ; private static final String versionNumber = "V2.3" ; private String OS ; private int height ; private int width ; private JMenuBar menuBar ; private JCheckBoxMenuItem spacesCheckBox ; private JCheckBoxMenuItem showButtonCheckBox ; private JTextField mainField ; private JButton toBinary ; private JButton toASCII ; private TextArea textArea ; private JButton btnCopyToClipboard ; private String output = "" ; private JButton btnX ; private String mainFieldText ; private boolean showButtons = false ; public boolean resultsWindow = false ; private boolean resized = false ; private ImageIcon icon ; public GUI ( ) { } public String getOS ( ) { } public void setJFrameSize ( ) { int JFrameHeight = getHeight ( ) ; int buttonsResultsHeight = 400 ; int buttonsNoResultsHeight = 124 ; int noButtonsResultsHeight = 360 ; int noButtonsNoResultsHeight = 78 ; <START_BUG> int collapseOnTextFieldCloseHeightRange = 70 ; <END_BUG> if ( resized ) { width = getWidth ( ) ; } else { width = 411 ; } if ( showButtons ) { if ( resultsWindow ) { if ( JFrameHeight < buttonsResultsHeight ) { if ( resized ) { } height = buttonsResultsHeight ; } else { height = JFrameHeight ; } } else { if ( JFrameHeight < collapseOnTextFieldCloseHeightRange ) { height = buttonsNoResultsHeight ; } else { height = JFrameHeight ; } } } else { if ( resultsWindow ) { if ( JFrameHeight < noButtonsResultsHeight ) { height = noButtonsResultsHeight ; } else { height = JFrameHeight ; } } else { if ( JFrameHeight < collapseOnTextFieldCloseHeightRange ) { height = noButtonsNoResultsHeight ; } else { height = JFrameHeight ; } } } setSize ( width , height ) ; } public void setBounds ( ) { } public void addConvertButtons ( ) { } public void removeConvertButtons ( ) { } public void addResultsObjects ( ) { } void removeResultsObjects ( ) { } private class handlerClass implements ActionListener { private int action ; private handlerClass ( int x ) { } public void actionPerformed ( ActionEvent e ) { } } public void loadResults ( String mainFieldText , int action ) { } }

Fix:
int collapseOnTextFieldCloseHeightRange = 700 ;
Buggy code:
public class Application extends Controller { @ Before static void addDefaults ( ) { } @ Before public static void initData ( ) { } public static void getBookings ( Integer year , Integer month , Integer day ) { } public static void index ( String date ) { Date currentDate = null ; try { SimpleDateFormat sdf = new SimpleDateFormat ( "MMM//dd//yyyy" ) ; ParsePosition pos = new ParsePosition ( 0 ) ; currentDate = sdf . parse ( date , pos ) ; } catch ( NullPointerException p ) { } if ( currentDate == null ) { Calendar startDate = Calendar . getInstance ( ) ; int daysUntilSaturday = 7 - ( startDate . get ( Calendar . DAY_OF_WEEK ) ) ; startDate . add ( Calendar . DATE , daysUntilSaturday ) ; currentDate = DateUtils . round ( startDate . getTime ( ) , Calendar . DATE ) ; } List < Category > categoryList = Category . findAll ( ) ; Map < Long , Category > allCategories = new HashMap < Long , Category > ( ) ; for ( Category cat : categoryList ) { allCategories . put ( cat . id , cat ) ; } List < Stall > stallList = Stall . findAll ( ) ; Map < Integer , Stall > allStalls = new HashMap < Integer , Stall > ( ) ; for ( Stall stall : stallList ) { allStalls . put ( stall . number , stall ) ; } List < Booking > currentBookingList = Booking . findAll ( ) ; Map < Integer , Booking > currentBookings = new HashMap < Integer , Booking > ( ) ; for ( Booking booking : currentBookingList ) { currentBookings . put ( booking . stallnumber , booking ) ; } Map < Long , Merchant > merchants = new HashMap < Long , Merchant > ( ) ; for ( Booking booking : currentBookingList ) { Merchant merchant = Merchant . findById ( booking . merchantid ) ; merchants . put ( booking . merchantid , merchant ) ; } <START_BUG> render ( allStalls , allCategories , categoryCounts , currentBookings , merchants , currentDate ) ; <END_BUG> } public static void add_booking ( ) { } public static void stalls ( ) { } public static void finance ( ) { } public static void merchants ( ) { } }

Fix:
render ( allStalls , allCategories , currentBookings , merchants , currentDate ) ;
Buggy code:
public class PageCreateKeystore extends WizardPage implements Listener { public static final String PAGE_NAME = "SignPageCreateKeystore" ; private String keystore ; private String keystoreName ; private String project ; private String name ; private boolean generatedKeystore = false ; private Button bCreateKeystore = null ; private Button bEchoKeystorePassword = null ; private Button bEchoKeyPassword = null ; private Combo cKeyAlgorithm = null ; private Label lPreview = null ; private Label lResult = null ; private Text tCommonName = null ; private Text tOrganizationalUnit = null ; private Text tOrganization = null ; private Text tLocation = null ; private Text tState = null ; private Text tCountry = null ; private Text tKeystoreName = null ; private Text tKeystorePassword = null ; private Text tKeyName = null ; private Text tKeyPassword = null ; private static final int LABELWIDTH = 160 ; private static final int TEXTHEIGHT = 40 ; private Signature signature = null ; private Keystore keyStore = null ; public PageCreateKeystore ( final Signature signature , final String project , final String name ) { } public void createControl ( final Composite parent ) { } private void createPageContent ( final Composite parent ) { } private void addListeners ( ) { } private void dialogChanged ( ) { } private void updateStatus ( final String message ) { } public void handleEvent ( final Event e ) { } private void echoPassword ( final Event e ) { } private void createKeystore ( ) throws Exception { } public void onEnterPage ( ) { } public IWizardPage getNextPage ( ) { } private void saveDataToModel ( ) { <START_BUG> signature . setKeystore ( keystore ) ; <END_BUG> signature . setKeystorePassword ( tKeystorePassword . getText ( ) . toCharArray ( ) ) ; signature . setKeyPassword ( tKeyPassword . getText ( ) . toCharArray ( ) ) ; signature . setKeyAlias ( tKeyName . getText ( ) ) ; if ( cKeyAlgorithm . getText ( ) . equals ( "DSA" ) ) { signature . setKeyAlgorithm ( "SHA1withDSA" ) ; } else if ( cKeyAlgorithm . getText ( ) . equals ( "EC" ) ) { signature . setKeyAlgorithm ( "SHA1withECDSA" ) ; } else if ( cKeyAlgorithm . getText ( ) . equals ( "RSA" ) ) { signature . setKeyAlgorithm ( "SHA1withRSA" ) ; } } }

Fix:
signature . setKeystore ( keyStore ) ;
Buggy code:
public interface IModelHandlerServer extends Remote { public class FileOperationHelper { static final int BUFFER = 2048 ; public static String getFileMD5 ( String filePath ) { } public static boolean createDirectory ( String dir ) { } public static boolean deleteDirectoryContents ( File directory ) { if ( ! ( directory . exists ( ) ) ) { return true ; } boolean ret = false ; try { File [ ] files = directory . listFiles ( ) ; if ( files != null ) { for ( int i = 0 ; i < ( files . length ) ; i ++ ) { if ( files [ i ] . isDirectory ( ) ) { IModelHandlerServer . FileOperationHelper . deleteDirectoryContents ( files [ i ] ) ; } else { <START_BUG> files [ i ] . delete ( ) ; <END_BUG> } } } ret = true ; } catch ( Exception e ) { e . printStackTrace ( ) ; ret = false ; } return ret ; } public static int unzipFile ( String zipfilePath , String targetDirectory ) { } } public boolean beginFileUpload ( String target ) throws RemoteException { } public boolean uploadFileChunk ( byte [ ] buffer ) throws RemoteException { } public int endFileUpload ( String md5 ) throws RemoteException { } public int deployModel ( String target ) throws RemoteException { } public String viewCurrentModel ( ) throws RemoteException { } public HashSet < String > viewFailedIP ( ) throws RemoteException { } public int resendFailedModels ( String target ) throws RemoteException { } }

Fix:
ret = files [ i ] . delete ( ) ;
Buggy code:
public class TransactionJndiBindingProcessor implements DeploymentUnitProcessor { @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final EEModuleDescription moduleDescription = deploymentUnit . getAttachment ( EE_MODULE_DESCRIPTION ) ; if ( moduleDescription == null ) { return ; } final ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; if ( DeploymentTypeMarker . isType ( WAR , deploymentUnit ) ) { final ServiceName moduleContextServiceName = ContextNames . contextServiceNameOfModule ( moduleDescription . getAppName ( ) , moduleDescription . getModuleName ( ) ) ; bindServices ( deploymentUnit , serviceTarget , moduleDescription , moduleDescription . getModuleName ( ) , moduleContextServiceName ) ; } for ( AbstractComponentDescription component : moduleDescription . getComponentDescriptions ( ) ) { if ( ( component . getNamingMode ( ) ) == ( ComponentNamingMode . CREATE ) ) { final ServiceName compContextServiceName = ContextNames . contextServiceNameOfComponent ( moduleDescription . getAppName ( ) , moduleDescription . getModuleName ( ) , component . getComponentName ( ) ) ; <START_BUG> bindServices ( deploymentUnit , serviceTarget , moduleDescription , moduleDescription . getModuleName ( ) , compContextServiceName ) ; <END_BUG> } } } private void bindServices ( DeploymentUnit deploymentUnit , ServiceTarget serviceTarget , EEModuleDescription description , String componentName , ServiceName contextServiceName ) { } @ Override public void undeploy ( DeploymentUnit context ) { } }

Fix:
bindServices ( deploymentUnit , serviceTarget , moduleDescription , component . getComponentName ( ) , compContextServiceName ) ;
Buggy code:
public final class IOFile extends IO { private static final Pattern VALIDNAME = Pattern . compile ( ( ( "^[^\\\\//" + ( Prop . WIN ? ":*?\"<>\\|" : "" ) ) + "]+$" ) ) ; private final File file ; public IOFile ( final String path ) { } public IOFile ( final File file ) { } public IOFile ( final String dir , final String name ) { } public IOFile ( final IOFile dir , final String name ) { } public File file ( ) { } public boolean touch ( ) { } @ Override public byte [ ] read ( ) throws IOException { } @ Override public boolean exists ( ) { } @ Override public boolean isDir ( ) { } @ Override public long timeStamp ( ) { } @ Override public long length ( ) { } @ Override public InputSource inputSource ( ) { } @ Override public StreamSource streamSource ( ) { } @ Override public InputStream inputStream ( ) throws IOException { } public IOFile resolve ( final String path ) { } @ Override public IO merge ( final String path ) { } public boolean md ( ) { } @ Override public String dir ( ) { } public IOFile parent ( ) { } public IOFile [ ] children ( ) { } public IOFile [ ] children ( final String regex ) { } public synchronized StringList descendants ( ) { } private static void add ( final IOFile io , final StringList files , final int offset ) { } public void write ( final byte [ ] bytes ) throws IOException { } public void write ( final InputStream in ) throws IOException { } public boolean delete ( ) { } public boolean rename ( final IOFile target ) { } public void copyTo ( final IOFile target ) throws IOException { target . parent ( ) . md ( ) ; <START_BUG> Files . copy ( toPath ( ) , target . toPath ( ) ) ; <END_BUG> } @ Override public boolean eq ( final IO io ) { } @ Override public String url ( ) { } public void open ( ) throws IOException { } private Path toPath ( ) throws IOException { } public IOFile normalize ( ) { } public static boolean isValidName ( final String name ) { } public static boolean isValid ( final String path ) { } public static String regex ( final String glob ) { } public static String regex ( final String glob , final boolean sub ) { } static class PathList extends StringList { String create ( final String path ) { } private void add ( final TokenBuilder tb ) { } } }

Fix:
Files . copy ( toPath ( ) , target . toPath ( ) , StandardCopyOption . REPLACE_EXISTING ) ;
Buggy code:
public class OAuthLoginTask extends UserTask < String , Void , String [ ] > { private static final String TAG = OAuthLoginTask . class . getName ( ) ; public interface OAuthLoginTaskListener { void onLoginUrlAvailable ( String url ) { } void onOAuthTaskFinished ( String userName , String token ) { } void onTaskError ( Intent errorIntent ) { } } private WeakReference < OAuthLoginTask . OAuthLoginTaskListener > oAuthLoginTaskListenerRef ; public void setOAuthLoginTaskListener ( OAuthLoginTask . OAuthLoginTaskListener oAuthLoginTaskListener ) { } @ Override protected String [ ] doInBackground ( String ... params ) throws Exception { OAuthConsumer consumer = LiveGeocachingApiFactory . getOAuthConsumer ( ) ; OAuthProvider provider = LiveGeocachingApiFactory . getOAuthProvider ( ) ; <START_BUG> String timestamp = Long . toString ( ( ( OAuthLoginTask . getServerDate ( GEOCACHING_WEBSITE_URL ) . getTime ( ) ) // 1000 ) ) ; <END_BUG> try { if ( ( params . length ) == 0 ) { String authUrl = provider . retrieveRequestToken ( consumer , OAUTH_CALLBACK_URL , OAUTH_TIMESTAMP , timestamp ) ; Geocaching4LocusApplication . storeRequestTokens ( consumer ) ; return new String [ ] { authUrl } ; } else { Geocaching4LocusApplication . loadRequestTokensIfNecessary ( consumer ) ; provider . retrieveAccessToken ( consumer , params [ 0 ] , OAUTH_TIMESTAMP , timestamp ) ; GeocachingApi api = LiveGeocachingApiFactory . getLiveGeocachingApi ( ) ; api . openSession ( consumer . getToken ( ) ) ; UserProfile userProfile = api . getYourUserProfile ( false , false , false , false , false , false , DeviceInfoFactory . create ( ) ) ; ApiLimits apiLimits = api . getApiLimits ( ) ; Geocaching4LocusApplication . getAuthenticatorHelper ( ) . getRestrictions ( ) . updateMemberType ( userProfile . getUser ( ) . getMemberType ( ) ) ; Geocaching4LocusApplication . getAuthenticatorHelper ( ) . getRestrictions ( ) . updateLimits ( apiLimits ) ; return new String [ ] { userProfile . getUser ( ) . getUserName ( ) , api . getSession ( ) } ; } } catch ( OAuthExpectationFailedException e ) { if ( provider . getResponseParameters ( ) . containsKey ( OAUTH_ERROR_MESSAGE_PARAMETER ) ) { throw new OAuthExpectationFailedException ( ( "Request<seq2seq4repair_space>token<seq2seq4repair_space>or<seq2seq4repair_space>token<seq2seq4repair_space>secret<seq2seq4repair_space>not<seq2seq4repair_space>set<seq2seq4repair_space>in<seq2seq4repair_space>server<seq2seq4repair_space>reply.<seq2seq4repair_space>" + ( provider . getResponseParameters ( ) . getFirst ( OAUTH_ERROR_MESSAGE_PARAMETER ) ) ) ) ; } throw e ; } } @ Override protected void onPostExecute ( String [ ] result ) { } @ Override protected void onException ( Throwable t ) { } private static Date getServerDate ( String url ) throws NetworkException { } }

Fix:
String timestamp = Long . toString ( ( ( OAuthLoginTask . getServerDate ( "https:////api.groundspeak.com//" ) . getTime ( ) ) // 1000 ) ) ;
Buggy code:
public class TestTeeSinkTokenFilter extends BaseTokenStreamTestCase { protected StringBuilder buffer1 ; protected StringBuilder buffer2 ; protected String [ ] tokens1 ; protected String [ ] tokens2 ; @ Override public void setUp ( ) throws Exception { } static final SinkFilter theFilter = new TeeSinkTokenFilter . SinkFilter ( ) { @ Override public boolean accept ( AttributeSource a ) { } } ; static final SinkFilter dogFilter = new TeeSinkTokenFilter . SinkFilter ( ) { @ Override public boolean accept ( AttributeSource a ) { } } ; public void testEndOffsetPositionWithTeeSinkTokenFilter ( ) throws Exception { Directory dir = newDirectory ( ) ; Analyzer analyzer = new MockAnalyzer ( random ( ) , MockTokenizer . WHITESPACE , false ) ; IndexWriter w = new IndexWriter ( dir , newIndexWriterConfig ( TEST_VERSION_CURRENT , analyzer ) ) ; Document doc = new Document ( ) ; <START_BUG> TokenStream tokenStream = analyzer . tokenStream ( "field" , new StringReader ( "abcd<seq2seq4repair_space>" ) ) ; <END_BUG> TeeSinkTokenFilter tee = new TeeSinkTokenFilter ( tokenStream ) ; TokenStream sink = tee . newSinkTokenStream ( ) ; FieldType ft = new FieldType ( TextField . TYPE_NOT_STORED ) ; ft . setStoreTermVectors ( true ) ; ft . setStoreTermVectorOffsets ( true ) ; ft . setStoreTermVectorPositions ( true ) ; Field f1 = new Field ( "field" , tee , ft ) ; Field f2 = new Field ( "field" , sink , ft ) ; doc . add ( f1 ) ; doc . add ( f2 ) ; w . addDocument ( doc ) ; w . close ( ) ; IndexReader r = DirectoryReader . open ( dir ) ; Terms vector = r . getTermVectors ( 0 ) . terms ( "field" ) ; assertEquals ( 1 , vector . size ( ) ) ; TermsEnum termsEnum = vector . iterator ( null ) ; termsEnum . next ( ) ; assertEquals ( 2 , termsEnum . totalTermFreq ( ) ) ; DocsAndPositionsEnum positions = termsEnum . docsAndPositions ( null , null ) ; assertTrue ( ( ( positions . nextDoc ( ) ) != ( DocIdSetIterator . NO_MORE_DOCS ) ) ) ; assertEquals ( 2 , positions . freq ( ) ) ; positions . nextPosition ( ) ; assertEquals ( 0 , positions . startOffset ( ) ) ; assertEquals ( 4 , positions . endOffset ( ) ) ; positions . nextPosition ( ) ; assertEquals ( 8 , positions . startOffset ( ) ) ; assertEquals ( 12 , positions . endOffset ( ) ) ; assertEquals ( NO_MORE_DOCS , positions . nextDoc ( ) ) ; r . close ( ) ; dir . close ( ) ; } public void testGeneral ( ) throws IOException { } public void testMultipleSources ( ) throws Exception { } public void performance ( ) throws Exception { } class ModuloTokenFilter extends TokenFilter { int modCount ; ModuloTokenFilter ( TokenStream input , int mc ) { } int count = 0 ; @ Override public boolean incrementToken ( ) throws IOException { } } class ModuloSinkFilter extends TeeSinkTokenFilter . SinkFilter { int count = 0 ; int modCount ; ModuloSinkFilter ( int mc ) { } @ Override public boolean accept ( AttributeSource a ) { } } }

Fix:
TokenStream tokenStream = analyzer . tokenStream ( "field" , "abcd<seq2seq4repair_space>" ) ;
Buggy code:
public class MapCreatorApp { private static final MapFileHeader DEFAULT = new MapFileHeader ( MapType . NORMAL , "new<seq2seq4repair_space>map" , null , "" , ( ( short ) ( 300 ) ) , ( ( short ) ( 300 ) ) , ( ( short ) ( 1 ) ) , ( ( short ) ( 10 ) ) , null , new short [ ( MapFileHeader . PREVIEW_IMAGE_SIZE ) * ( MapFileHeader . PREVIEW_IMAGE_SIZE ) ] ) ; private static final String [ ] GROUND_TYPES = new String [ ] { WATER8 . toString ( ) , GRASS . toString ( ) , DRY_GRASS . toString ( ) , SNOW . toString ( ) , DESERT . toString ( ) } ; private final JFrame selectMapFrame ; public static void main ( String [ ] args ) throws FileNotFoundException , IOException { <START_BUG> SwingManagedJSettlers . setupResourceManagers ( MainUtils . createArgumentsMap ( args ) , "..//jsettlers.main.swing//config.prp" ) ; <END_BUG> new MapCreatorApp ( ) ; } private MapCreatorApp ( ) { } private JPanel createOpenMapPanel ( ) { } private JPanel createNewMapPanel ( ) { } private void close ( ) { } protected void loadMap ( MapLoader value ) { } }

Fix:
SwingManagedJSettlers . setupResourceManagers ( MainUtils . createArgumentsMap ( args ) , "config.prp" ) ;
Buggy code:
public class ServerManagerCommunicationService implements Service < Void > { static final ServiceName SERVICE_NAME = JBOSS . append ( "domain" , "controller" , "communication" ) ; private static final Logger log = Logger . getLogger ( "org.jboss.as.domain.controller" ) ; private InjectedValue < NetworkInterfaceBinding > interfaceBindingValue = new InjectedValue < NetworkInterfaceBinding > ( ) ; private final LocalDomainControllerElement domainControllerElement ; private final DomainController domainController ; private ServerSocket serverSocket ; private ExecutorService executorService ; private ConcurrentMap < String , ServerManagerConnection > serverManagerConnections = new ConcurrentHashMap < String , ServerManagerConnection > ( ) ; public ServerManagerCommunicationService ( final DomainController domainController , final LocalDomainControllerElement domainControllerElement ) { } @ Override public synchronized void start ( StartContext context ) throws StartException { executorService = Executors . newCachedThreadPool ( ) ; final NetworkInterfaceBinding interfaceBinding = interfaceBindingValue . getValue ( ) ; try { serverSocket = new ServerSocket ( ) ; <START_BUG> final SocketAddress address = new InetSocketAddress ( interfaceBinding . getAddress ( ) , domainControllerElement . getAdminPort ( ) ) ; <END_BUG> serverSocket . setReuseAddress ( true ) ; serverSocket . bind ( address , 20 ) ; executorService . execute ( new ServerManagerCommunicationService . ServerSocketListener ( serverSocket ) ) ; } catch ( Exception e ) { throw new StartException ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>start<seq2seq4repair_space>server<seq2seq4repair_space>socket" , e ) ; } } @ Override public synchronized void stop ( StopContext context ) { } @ Override public Void getValue ( ) throws IllegalStateException { } public Injector < NetworkInterfaceBinding > getInterfaceInjector ( ) { } class ServerSocketListener implements Runnable { private final ServerSocket serverSocket ; private final ExecutorService executor = Executors . newCachedThreadPool ( ) ; private ServerSocketListener ( ServerSocket serverSocket ) { } @ Override public void run ( ) { } private void shutdown ( ) { } } }

Fix:
final SocketAddress address = new InetSocketAddress ( interfaceBinding . getAddress ( ) , domainControllerElement . getPort ( ) ) ;