nus-yam/ex-repair huggingface dataset:
Buggy code:
public class RaDeploymentParsingProcessor implements DeploymentUnitProcessor { public RaDeploymentParsingProcessor ( ) { } @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ResourceRoot deploymentRoot = deploymentUnit . getAttachment ( DEPLOYMENT_ROOT ) ; final VirtualFile file = deploymentRoot . getRoot ( ) ; if ( ( file == null ) || ( ! ( file . exists ( ) ) ) ) return ; <START_BUG> final String deploymentRootName = file . getLowerCaseName ( ) ; <END_BUG> if ( ! ( deploymentRootName . endsWith ( ".rar" ) ) ) { return ; } final VirtualFile alternateDescriptor = deploymentRoot . getAttachment ( ALTERNATE_CONNECTOR_DEPLOYMENT_DESCRIPTOR ) ; final VirtualFile serviceXmlFile ; if ( alternateDescriptor != null ) { serviceXmlFile = alternateDescriptor ; } else { serviceXmlFile = file . getChild ( "//META-INF//ra.xml" ) ; } InputStream xmlStream = null ; Connector result = null ; try { if ( ( serviceXmlFile != null ) && ( serviceXmlFile . exists ( ) ) ) { xmlStream = serviceXmlFile . openStream ( ) ; result = new RaParser ( ) . parse ( xmlStream ) ; if ( result == null ) throw ConnectorMessages . MESSAGES . failedToParseServiceXml ( serviceXmlFile ) ; } File root = file . getPhysicalFile ( ) ; URL url = root . toURI ( ) . toURL ( ) ; String prefix = "" ; if ( ( deploymentUnit . getParent ( ) ) != null ) { prefix = ( deploymentUnit . getParent ( ) . getName ( ) ) + "#" ; } String deploymentName = prefix + ( file . getName ( ) . substring ( 0 , file . getName ( ) . indexOf ( ".rar" ) ) ) ; ConnectorXmlDescriptor xmlDescriptor = new ConnectorXmlDescriptor ( result , root , url , deploymentName ) ; phaseContext . getDeploymentUnit ( ) . putAttachment ( ATTACHMENT_KEY , xmlDescriptor ) ; } catch ( Exception e ) { throw ConnectorMessages . MESSAGES . failedToParseServiceXml ( e , serviceXmlFile ) ; } finally { VFSUtils . safeClose ( xmlStream ) ; } } public void undeploy ( final DeploymentUnit context ) { } }

Fix:
final String deploymentRootName = file . getName ( ) . toLowerCase ( ) ;
Buggy code:
public class FinalGame extends BaseGame { private IDisplaySystem display ; private IRenderer renderer ; private IEventManager eventManager ; private IInputManager inputManager ; private ICamera camera1 ; private ICamera camera2 ; private SceneNode player1 ; private SceneNode player2 ; private OrbitCameraController camera1Controller ; private OrbitCameraController camera2Controller ; private String keyboardName ; private String gamepadName ; protected void initSystem ( ) { } private IDisplaySystem createDisplaySystem ( ) { <START_BUG> IDisplaySystem display = new UltraDisplaySystem ( 1920 , 1080 , 24 , 20 , true , "sage.renderer.jogl.JOGLRenderer" ) ; <END_BUG> System . out . print ( "\nWaiting<seq2seq4repair_space>for<seq2seq4repair_space>display<seq2seq4repair_space>creation..." ) ; int count = 0 ; while ( ! ( display . isCreated ( ) ) ) { try { Thread . sleep ( 10 ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( "Display<seq2seq4repair_space>creation<seq2seq4repair_space>interrupted" ) ; } count ++ ; System . out . print ( "+" ) ; if ( ( count % 80 ) == 0 ) { System . out . println ( ) ; } if ( count > 2000 ) { throw new RuntimeException ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>display" ) ; } } System . out . println ( ) ; return display ; } @ Override protected void initGame ( ) { } private void createEssentialObjects ( ) { } private void createPlayers ( ) { } private void createGameWorldObjects ( ) { } private void createWorldAxes ( ) { } @ Override protected void update ( float elapsedTimeMS ) { } @ Override protected void render ( ) { } @ Override protected void shutdown ( ) { } }

Fix:
IDisplaySystem display = new UltraDisplaySystem ( 700 , 300 , 24 , 20 , true , "sage.renderer.jogl.JOGLRenderer" ) ;
Buggy code:
public class InsertIfServersSame implements ServerVariable { @ Override public String getReplacement ( ProxiedPlayer viewer , ServerInfo server , String args ) { <START_BUG> if ( Objects . equals ( server , viewer . getServer ( ) ) ) <END_BUG> return args ; return "" ; } }

Fix:
if ( ( ( viewer . getServer ( ) ) != null ) && ( Objects . equals ( server , viewer . getServer ( ) . getInfo ( ) ) ) )
Buggy code:
class NewEstablishChannelModelControllerClient extends NewAbstractModelControllerClient { private final String hostName ; private final int port ; private final ExecutorService executorService = Executors . newCachedThreadPool ( ) ; public NewEstablishChannelModelControllerClient ( final String hostName , int port ) { } public NewEstablishChannelModelControllerClient ( final InetAddress address , int port ) { } @ Override ManagementClientChannelStrategy getClientChannelStrategy ( ) throws IOException , URISyntaxException { <START_BUG> return ManagementClientChannelStrategy . create ( hostName , port , executorService ) ; <END_BUG> } }

Fix:
return ManagementClientChannelStrategy . create ( hostName , port , executorService , this ) ;
Buggy code:
class ConvertibleOutputStream extends ByteArrayOutputStream { private static final Logger log = LoggerFactory . getLogger ( ConvertibleOutputStream . class ) ; public ConvertibleOutputStream ( int initialCapacity ) { } public InputStream toInputStream ( ) { } public ConvertibleOutputStream split ( int countToKeep , int initialCapacityForNewStream ) { int newCount = ( count ) - countToKeep ; <START_BUG> ConvertibleOutputStream . log . info ( "Splitting<seq2seq4repair_space>stream<seq2seq4repair_space>of<seq2seq4repair_space>size<seq2seq4repair_space>{}<seq2seq4repair_space>into<seq2seq4repair_space>parts<seq2seq4repair_space>with<seq2seq4repair_space>sizes<seq2seq4repair_space>{}<seq2seq4repair_space>and<seq2seq4repair_space>{}" , count , countToKeep , newCount ) ; <END_BUG> initialCapacityForNewStream = Math . max ( initialCapacityForNewStream , newCount ) ; ConvertibleOutputStream newStream = new ConvertibleOutputStream ( initialCapacityForNewStream ) ; newStream . write ( buf , countToKeep , newCount ) ; count = countToKeep ; return newStream ; } public void append ( ConvertibleOutputStream otherStream ) { } No newline ; at end ; of file ; }

Fix:
ConvertibleOutputStream . log . debug ( "Splitting<seq2seq4repair_space>stream<seq2seq4repair_space>of<seq2seq4repair_space>size<seq2seq4repair_space>{}<seq2seq4repair_space>into<seq2seq4repair_space>parts<seq2seq4repair_space>with<seq2seq4repair_space>sizes<seq2seq4repair_space>{}<seq2seq4repair_space>and<seq2seq4repair_space>{}" , count , countToKeep , newCount ) ;
Buggy code:
class ListTab extends ScrollableTab { List list1 ; Group listGroup ; static String [ ] ListData1 = new String [ ] { ControlExample . getResourceString ( "ListData1_0" ) , ControlExample . getResourceString ( "ListData1_1" ) , ControlExample . getResourceString ( "ListData1_2" ) , ControlExample . getResourceString ( "ListData1_3" ) , ControlExample . getResourceString ( "ListData1_4" ) , ControlExample . getResourceString ( "ListData1_5" ) , ControlExample . getResourceString ( "ListData1_6" ) , ControlExample . getResourceString ( "ListData1_7" ) , ControlExample . getResourceString ( "ListData1_8" ) } ; ListTab ( ControlExample instance ) { } void createExampleGroup ( ) { super . createExampleGroup ( ) ; listGroup = new Group ( exampleGroup , SWT . NONE ) ; listGroup . setLayout ( new GridLayout ( ) ) ; <START_BUG> listGroup . setLayoutData ( new GridData ( ( ( ( GridData . GRAB_HORIZONTAL ) | ( GridData . HORIZONTAL_ALIGN_FILL ) ) | ( GridData . VERTICAL_ALIGN_FILL ) ) ) ) ; <END_BUG> listGroup . setText ( "List" ) ; } void createExampleWidgets ( ) { } Control [ ] getExampleWidgets ( ) { } String [ ] getMethodNames ( ) { } String getTabText ( ) { } }

Fix:
listGroup . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true ) ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class EJBClientUserTransactionTestCase { private static final Logger logger = Logger . getLogger ( EJBClientUserTransactionTestCase . class ) ; private static final String APP_NAME = "ejb-remote-client-api-usertx-test" ; private static final String MODULE_NAME = "ejb" ; private static String nodeName ; @ Deployment public static Archive < ? > createDeployment ( ) { } @ BeforeClass public static void beforeTestClass ( ) throws Exception { <START_BUG> EJBClientUserTransactionTestCase . nodeName = EJBManagementUtil . getNodeName ( "localhost" , 9999 ) ; <END_BUG> EJBClientUserTransactionTestCase . logger . info ( ( "Using<seq2seq4repair_space>node<seq2seq4repair_space>name<seq2seq4repair_space>" + ( EJBClientUserTransactionTestCase . nodeName ) ) ) ; } @ Before public void beforeTest ( ) throws Exception { } @ Test public void testMandatoryTxOnSLSB ( ) throws Exception { } @ Test public void testBatchOperationsInTx ( ) throws Exception { } }

Fix:
EJBClientUserTransactionTestCase . nodeName = EJBManagementUtil . getNodeName ( ) ;
Buggy code:
public class ZkCoordinatorTest { @ Mock private DynamicBrokersReader reader ; @ Mock private DynamicPartitionConnections dynamicPartitionConnections ; private KafkaTestBroker broker = new KafkaTestBroker ( ) ; private TestingServer server ; private Map stormConf = new HashMap ( ) ; private SpoutConfig spoutConfig ; private ZkState state ; private SimpleConsumer simpleConsumer ; @ Before public void setUp ( ) throws Exception { } private Map buildZookeeperConfig ( TestingServer server ) { } @ After public void shutdown ( ) throws Exception { simpleConsumer . close ( ) ; broker . shutdown ( ) ; <START_BUG> server . stop ( ) ; <END_BUG> } @ Test public void testOnePartitionPerTask ( ) throws Exception { } @ Test public void testPartitionsChange ( ) throws Exception { } private void assertPartitionsAreDifferent ( List < PartitionManager > partitionManagersBefore , List < PartitionManager > partitionManagersAfter , int partitionsPerTask ) { } private List < List < PartitionManager > > getPartitionManagers ( List < ZkCoordinator > coordinatorList ) { } private void waitForRefresh ( ) throws InterruptedException { } private List < ZkCoordinator > buildCoordinators ( int totalTasks ) { } }

Fix:
server . close ( ) ;
Buggy code:
final class CommandPersistence extends RegistryPersistence { private static final int INDEX_CATEGORY_DEFINITIONS = 0 ; private static final int INDEX_COMMAND_DEFINITIONS = 1 ; private static final int INDEX_PARAMETER_TYPE_DEFINITIONS = 2 ; private static final String PREFERENCE_KEY_PREFIX = "org.eclipse.ui.handlers//state" ; private static final void readCategoriesFromRegistry ( final IConfigurationElement [ ] configurationElements , final int configurationElementCount , final ICommandService commandService ) { } private static final void readCommandsFromRegistry ( final IConfigurationElement [ ] configurationElements , final int configurationElementCount , final ICommandService commandService ) { } private static final Parameter [ ] readParameters ( final IConfigurationElement configurationElement , final List warningsToLog , final ICommandService commandService ) { } private static final void readParameterTypesFromRegistry ( final IConfigurationElement [ ] configurationElements , final int configurationElementCount , final ICommandService commandService ) { } private static final void readState ( final IConfigurationElement configurationElement , final List warningsToLog , final Command command ) { final IConfigurationElement [ ] stateElements = configurationElement . getChildren ( ELEMENT_STATE ) ; if ( ( stateElements == null ) || ( ( stateElements . length ) == 0 ) ) { return ; } for ( int i = 0 ; i < ( stateElements . length ) ; i ++ ) { final IConfigurationElement stateElement = stateElements [ i ] ; final String id = readRequired ( stateElement , ATTRIBUTE_ID , warningsToLog , "State<seq2seq4repair_space>needs<seq2seq4repair_space>an<seq2seq4repair_space>id" ) ; if ( id == null ) { continue ; } if ( checkClass ( stateElement , warningsToLog , "State<seq2seq4repair_space>must<seq2seq4repair_space>have<seq2seq4repair_space>an<seq2seq4repair_space>associated<seq2seq4repair_space>class" , id ) ) { final String preferenceKey = ( ( ( ( CommandPersistence . PREFERENCE_KEY_PREFIX ) + '//' ) + ( command . getId ( ) ) ) + '//' ) + id ; <START_BUG> final IState state = new CommandStateProxy ( stateElement , ELEMENT_STATE , PrefUtil . getInternalPreferenceStore ( ) , preferenceKey ) ; <END_BUG> command . addState ( id , state ) ; } } } private final ICommandService commandService ; CommandPersistence ( final ICommandService commandService ) { } protected final boolean isChangeImportant ( final IRegistryChangeEvent event ) { } protected final void read ( ) { } }

Fix:
final IState state = new CommandStateProxy ( stateElement , ATTRIBUTE_CLASS , PrefUtil . getInternalPreferenceStore ( ) , preferenceKey ) ;
Buggy code:
public class WelcomeActivity extends Activity { Handler mHandler = new Handler ( Looper . getMainLooper ( ) ) { @ Override public void handleMessage ( Message msg ) { } } ; private ImageView imageView ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; this . requestWindowFeature ( FEATURE_NO_TITLE ) ; setContentView ( activity_welcome ) ; imageView = ( ( ImageView ) ( findViewById ( id_imageview ) ) ) ; Animation animation = AnimationUtils . loadAnimation ( this , anim_welcome_image ) ; animation . setFillAfter ( true ) ; imageView . startAnimation ( animation ) ; <START_BUG> mHandler . sendEmptyMessageDelayed ( 291 , ( 1 * 1000 ) ) ; <END_BUG> } }

Fix:
mHandler . sendEmptyMessageDelayed ( 291 , ( 3 * 1000 ) ) ;
Buggy code:
public class TestQueryWrapperFilter extends LuceneTestCase { public void testBasic ( ) throws Exception { Directory dir = new RAMDirectory ( ) ; <START_BUG> IndexWriter writer = new IndexWriter ( dir , new org . apache . lucene . analysis . standard . StandardAnalyzer ( Version . LUCENE_CURRENT ) , true , MaxFieldLength . LIMITED ) ; <END_BUG> Document doc = new Document ( ) ; doc . add ( new org . apache . lucene . document . Field ( "field" , "value" , Store . NO , Index . ANALYZED ) ) ; writer . addDocument ( doc ) ; writer . close ( ) ; TermQuery termQuery = new TermQuery ( new Term ( "field" , "value" ) ) ; QueryWrapperFilter qwf = new QueryWrapperFilter ( termQuery ) ; IndexSearcher searcher = new IndexSearcher ( dir , true ) ; TopDocs hits = searcher . search ( new MatchAllDocsQuery ( ) , qwf , 10 ) ; assertEquals ( 1 , hits . totalHits ) ; hits = searcher . search ( new MatchAllDocsQuery ( ) , new CachingWrapperFilter ( qwf ) , 10 ) ; assertEquals ( 1 , hits . totalHits ) ; BooleanQuery booleanQuery = new BooleanQuery ( ) ; booleanQuery . add ( termQuery , MUST ) ; booleanQuery . add ( new TermQuery ( new Term ( "field" , "missing" ) ) , MUST_NOT ) ; qwf = new QueryWrapperFilter ( termQuery ) ; hits = searcher . search ( new MatchAllDocsQuery ( ) , qwf , 10 ) ; assertEquals ( 1 , hits . totalHits ) ; hits = searcher . search ( new MatchAllDocsQuery ( ) , new CachingWrapperFilter ( qwf ) , 10 ) ; assertEquals ( 1 , hits . totalHits ) ; qwf = new QueryWrapperFilter ( new FuzzyQuery ( new Term ( "field" , "valu" ) ) ) ; hits = searcher . search ( new MatchAllDocsQuery ( ) , qwf , 10 ) ; assertEquals ( 1 , hits . totalHits ) ; hits = searcher . search ( new MatchAllDocsQuery ( ) , new CachingWrapperFilter ( qwf ) , 10 ) ; assertEquals ( 1 , hits . totalHits ) ; termQuery = new TermQuery ( new Term ( "field" , "not_exist" ) ) ; qwf = new QueryWrapperFilter ( termQuery ) ; hits = searcher . search ( new MatchAllDocsQuery ( ) , qwf , 10 ) ; assertEquals ( 0 , hits . totalHits ) ; hits = searcher . search ( new MatchAllDocsQuery ( ) , new CachingWrapperFilter ( qwf ) , 10 ) ; assertEquals ( 0 , hits . totalHits ) ; } }

Fix:
IndexWriter writer = new IndexWriter ( dir , new org . apache . lucene . analysis . standard . StandardAnalyzer ( TEST_VERSION_CURRENT ) , true , MaxFieldLength . LIMITED ) ;
Buggy code:
public class SingletonComponentDescription extends SessionBeanComponentDescription { private boolean initOnStartup ; private final List < ServiceName > dependsOn = new ArrayList < ServiceName > ( ) ; private DefaultAccessTimeoutService defaultAccessTimeoutProvider ; public SingletonComponentDescription ( final String componentName , final String componentClassName , final EjbJarDescription ejbJarDescription , final ServiceName deploymentUnitServiceName , final SessionBeanMetaData descriptorData ) { } @ Override public ComponentConfiguration createConfiguration ( final ClassIndex classIndex , final ClassLoader moduleClassLoder , final ModuleLoader moduleLoader ) { } public boolean isInitOnStartup ( ) { } public void initOnStartup ( ) { } @ Override public boolean allowsConcurrentAccess ( ) { } @ Override public SessionBeanType getSessionBeanType ( ) { } @ Override protected void setupViewInterceptors ( EJBViewDescription view ) { } private void addViewSerializationInterceptor ( final ViewDescription view ) { view . setSerializable ( true ) ; view . setUseWriteReplace ( true ) ; view . getConfigurators ( ) . add ( new ViewConfigurator ( ) { @ Override public void configure ( final DeploymentPhaseContext context , final ComponentConfiguration componentConfiguration , final ViewDescription description , final ViewConfiguration configuration ) throws DeploymentUnitProcessingException { final DeploymentReflectionIndex index = context . getDeploymentUnit ( ) . getAttachment ( REFLECTION_INDEX ) ; ClassReflectionIndex < WriteReplaceInterface > classIndex = index . getClassIndex ( WriteReplaceInterface . class ) ; for ( Method method : classIndex . getMethods ( ) ) { <START_BUG> configuration . addClientInterceptor ( method , new org . jboss . as . ejb3 . component . session . StatelessWriteReplaceInterceptor . Factory ( configuration . getViewServiceName ( ) . getCanonicalName ( ) ) , WRITE_REPLACE ) ; <END_BUG> } } } ) ; } @ Override protected ViewConfigurator getSessionBeanObjectViewConfigurator ( ) { } private void addConcurrencyManagementInterceptor ( ) { } public List < ServiceName > getDependsOn ( ) { } @ Override public boolean isTimerServiceApplicable ( ) { } }

Fix:
configuration . addClientInterceptor ( method , StatelessWriteReplaceInterceptor . factory ( configuration . getViewServiceName ( ) . getCanonicalName ( ) ) , WRITE_REPLACE ) ;
Buggy code:
public class CopyMessageAction extends AbstractColumbaAction implements SelectionListener { public CopyMessageAction ( FrameMediator frameMediator ) { } public void actionPerformed ( ActionEvent evt ) { <START_BUG> SelectFolderDialog dialog = treeModel . getSelectFolderDialog ( ) ; <END_BUG> if ( dialog . success ( ) ) { MessageFolder destFolder = dialog . getSelectedFolder ( ) ; FolderCommandReference [ ] result = new FolderCommandReference [ 2 ] ; FolderCommandReference [ ] r1 = ( ( org . columba . mail . gui . frame . MailFrameMediator ) ( getFrameMediator ( ) ) ) . getTableSelection ( ) ; FolderCommandReference r2 = new FolderCommandReference ( destFolder ) ; result [ 0 ] = r1 [ 0 ] ; result [ 1 ] = r2 ; CopyMessageCommand c = new CopyMessageCommand ( result ) ; processor . addOp ( c ) ; } } public void selectionChanged ( SelectionChangedEvent e ) { } }

Fix:
SelectFolderDialog dialog = new SelectFolderDialog ( getFrameMediator ( ) ) ;
Buggy code:
@ PublicSPI public class MasterPositionSource implements PositionSource , VersionedSource { private static final Logger s_logger = LoggerFactory . getLogger ( MasterPositionSource . class ) ; private final PortfolioMaster _portfolioMaster ; private final PositionMaster _positionMaster ; private volatile VersionCorrection _versionCorrection ; public MasterPositionSource ( final PortfolioMaster portfolioMaster , final PositionMaster positionMaster ) { } public MasterPositionSource ( final PortfolioMaster portfolioMaster , final PositionMaster positionMaster , final VersionCorrection versionCorrection ) { } public PortfolioMaster getPortfolioMaster ( ) { } public PositionMaster getPositionMaster ( ) { } public VersionCorrection getVersionCorrection ( ) { } @ Override public void setVersionCorrection ( final VersionCorrection versionCorrection ) { } @ Override public Portfolio getPortfolio ( final UniqueId uniqueId ) { } private void copyAttributes ( ManageablePortfolio manPrt , SimplePortfolio prt ) { } @ Override public Portfolio getPortfolio ( ObjectId objectId , VersionCorrection versionCorrection ) { } @ Override public PortfolioNode getPortfolioNode ( final UniqueId uniqueId ) { } @ Override public Position getPosition ( final UniqueId uniqueId ) { } @ Override public Trade getTrade ( UniqueId uniqueId ) { } private static int populatePositionSearchRequest ( final PositionSearchRequest positionSearch , final ManageablePortfolioNode node ) { } protected void convertNode ( final ManageablePortfolioNode manNode , final SimplePortfolioNode sourceNode ) { } protected void convertNode ( final ManageablePortfolioNode manNode , final SimplePortfolioNode sourceNode , final Map < ObjectId , ManageablePosition > positionCache ) { } protected void convertPosition ( final UniqueId nodeId , final ManageablePosition manPos , final SimplePosition sourcePosition ) { } protected void convertTrade ( final UniqueId nodeId , final UniqueId posId , final ManageableTrade manTrade ) { } protected UniqueId convertId ( final UniqueId positionOrTradeId , final UniqueId nodeId ) { } @ Override public ChangeManager changeManager ( ) { } @ Override public String toString ( ) { <START_BUG> String str = ( ( ( ( getClass ( ) . getSimpleName ( ) ) + "[" ) + ( getPositionMaster ( ) ) ) + "," ) + ( getPositionMaster ( ) ) ; <END_BUG> if ( ( getVersionCorrection ( ) ) != null ) { str += ",versionCorrection=" + ( getVersionCorrection ( ) ) ; } return str + "]" ; } }

Fix:
String str = ( ( ( ( getClass ( ) . getSimpleName ( ) ) + "[" ) + ( getPortfolioMaster ( ) ) ) + "," ) + ( getPositionMaster ( ) ) ;
Buggy code:
public class JMXAgentImpl implements JMXAgent { private ServiceTracker mbeanServiceTracker ; private Set < MBeanHandler > mbeansHandlers ; private JMXAgentContext agentContext ; private Logger logger ; private ExecutorService registrationExecutor ; public JMXAgentImpl ( Logger logger ) { } public void start ( ) { logger . log ( LogService . LOG_INFO , "Starting<seq2seq4repair_space>JMX<seq2seq4repair_space>OSGi<seq2seq4repair_space>agent" ) ; BundleContext bc = agentContext . getBundleContext ( ) ; MBeanHandler frameworkHandler = new org . apache . aries . jmx . framework . FrameworkMBeanHandler ( bc , logger ) ; frameworkHandler . open ( ) ; mbeansHandlers . add ( frameworkHandler ) ; MBeanHandler bundleStateHandler = new org . apache . aries . jmx . framework . BundleStateMBeanHandler ( bc , logger ) ; bundleStateHandler . open ( ) ; mbeansHandlers . add ( bundleStateHandler ) ; MBeanHandler serviceStateHandler = new org . apache . aries . jmx . framework . ServiceStateMBeanHandler ( bc , logger ) ; serviceStateHandler . open ( ) ; mbeansHandlers . add ( serviceStateHandler ) ; MBeanHandler packageStateHandler = new org . apache . aries . jmx . framework . PackageStateMBeanHandler ( bc , logger ) ; packageStateHandler . open ( ) ; mbeansHandlers . add ( packageStateHandler ) ; <START_BUG> MBeanHandler permissionAdminHandler = new org . apache . aries . jmx . permissionadmin . PermissionAdminMBeanHandler ( bc , logger ) ; <END_BUG> permissionAdminHandler . open ( ) ; mbeansHandlers . add ( permissionAdminHandler ) ; MBeanHandler userAdminHandler = new org . apache . aries . jmx . useradmin . UserAdminMBeanHandler ( agentContext ) ; userAdminHandler . open ( ) ; mbeansHandlers . add ( userAdminHandler ) ; mbeanServiceTracker = new org . apache . aries . jmx . MBeanServiceTracker ( agentContext ) ; mbeanServiceTracker . open ( ) ; } public void registerMBeans ( final MBeanServer server ) { } public void unregisterMBeans ( final MBeanServer server ) { } public void registerMBean ( final MBeanHandler mBeanHandler ) { } public void unregisterMBean ( final String name ) { } public void stop ( ) { } public JMXAgentContext getAgentContext ( ) { } public void setAgentContext ( JMXAgentContext agentContext ) { } private Object [ ] getMBeanServers ( ) { } public ExecutorService getRegistrationExecutor ( ) { } }

Fix:
MBeanHandler permissionAdminHandler = new org . apache . aries . jmx . permissionadmin . PermissionAdminMBeanHandler ( agentContext ) ;
Buggy code:
public class ScrollBar extends Widget { Scrollable parent ; int increment ; int pageIncrement ; ScrollBar ( Scrollable parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } void createWidget ( ) { } void destroyWidget ( ) { } Rectangle getBounds ( ) { } public boolean getEnabled ( ) { } public int getIncrement ( ) { } public int getMaximum ( ) { } public int getMinimum ( ) { } public int getPageIncrement ( ) { } public Scrollable getParent ( ) { } public int getSelection ( ) { } public Point getSize ( ) { } public int getThumb ( ) { } public boolean getVisible ( ) { } int hwndScrollBar ( ) { } public boolean isEnabled ( ) { } public boolean isVisible ( ) { } void releaseHandle ( ) { } void releaseParent ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } int scrollBarType ( ) { } public void setEnabled ( boolean enabled ) { } public void setIncrement ( int value ) { } public void setMaximum ( int value ) { } public void setMinimum ( int value ) { } public void setPageIncrement ( int value ) { } boolean SetScrollInfo ( int hwnd , int flags , SCROLLINFO info , boolean fRedraw ) { boolean barVisible = false ; boolean visible = getVisible ( ) ; ScrollBar bar = null ; if ( ! ( OS . IsWinCE ) ) { switch ( flags ) { case OS . SB_HORZ : bar = parent . getVerticalBar ( ) ; break ; case OS . SB_VERT : bar = parent . getHorizontalBar ( ) ; break ; } barVisible = ( bar != null ) && ( bar . getVisible ( ) ) ; } if ( ( ! visible ) || ( ( ( state ) & ( DISABLED ) ) != 0 ) ) fRedraw = false ; boolean result = OS . SetScrollInfo ( hwnd , flags , info , fRedraw ) ; if ( ! visible ) { if ( ! ( OS . IsWinCE ) ) { OS . ShowScrollBar ( hwnd , ( ! barVisible ? OS . SB_BOTH : flags ) , false ) ; } } if ( ( ! ( OS . IsWinCE ) ) && ( ( OS . WIN32_VERSION ) >= ( OS . VERSION ( 6 , 0 ) ) ) ) { <START_BUG> if ( visible && ( ! barVisible ) ) { <END_BUG> OS . ShowScrollBar ( hwnd , ( flags == ( OS . SB_HORZ ) ? OS . SB_VERT : OS . SB_HORZ ) , false ) ; } } if ( ( ( state ) & ( DISABLED ) ) != 0 ) { if ( ! ( OS . IsWinCE ) ) { OS . EnableScrollBar ( hwnd , flags , ESB_DISABLE_BOTH ) ; } } return result ; } public void setSelection ( int selection ) { } public void setThumb ( int value ) { } public void setValues ( int selection , int minimum , int maximum , int thumb , int increment , int pageIncrement ) { } public void setVisible ( boolean visible ) { } LRESULT wmScrollChild ( int wParam , int lParam ) { } }

Fix:
if ( ( visible && ( bar != null ) ) && ( ! barVisible ) ) {
Buggy code:
public class FileFilterTestCase extends FileBasedTestCase { public FileFilterTestCase ( String name ) { } public static void main ( String [ ] args ) { } public static TestSuite suite ( ) { } public void setUp ( ) { } public void tearDown ( ) throws Exception { } public void assertFiltering ( IOFileFilter filter , File file , boolean expected ) throws Exception { } public void testSuffix ( ) throws Exception { } public void testDirectory ( ) throws Exception { } public void testPrefix ( ) throws Exception { } public void testNameFilter ( ) throws Exception { } public void testNameFilterNullArgument ( ) throws Exception { } public void testNameFilterNullArrayArgument ( ) throws Exception { } public void testNameFilterNullListArgument ( ) throws Exception { } public void testTrue ( ) throws Exception { } public void testFalse ( ) throws Exception { } public void testNot ( ) throws Exception { } public void testAnd ( ) throws Exception { } public void testOr ( ) throws Exception { } public void testWildcard ( ) throws Exception { } public void testDelegateFileFilter ( ) throws Exception { } public void testMakeCVSAware ( ) throws Exception { } public void testMakeSVNAware ( ) throws Exception { } public void testAgeFilter ( ) throws Exception { } public void testSizeFilter ( ) throws Exception { } private void spin ( long now ) { <START_BUG> while ( ( System . currentTimeMillis ( ) ) <= now ) ; <END_BUG> } }

Fix:
while ( ( System . currentTimeMillis ( ) ) <= ( now + 1000 ) ) ;
Buggy code:
public class BorlandDeploymentTool extends GenericDeploymentTool implements ExecuteStreamHandler { public static final String PUBLICID_BORLAND_EJB = "-////Inprise<seq2seq4repair_space>Corporation////DTD<seq2seq4repair_space>Enterprise<seq2seq4repair_space>JavaBeans<seq2seq4repair_space>1.1////EN" ; protected static final String DEFAULT_BAS45_EJB11_DTD_LOCATION = "//com//inprise//j2ee//xml//dtds//ejb-jar.dtd" ; protected static final String DEFAULT_BAS_DTD_LOCATION = "//com//inprise//j2ee//xml//dtds//ejb-inprise.dtd" ; protected static final String BAS_DD = "ejb-inprise.xml" ; protected static final String JAVA2IIOP = "java2iiop" ; protected static final String VERIFY = "com.inprise.ejb.util.Verify" ; private String jarSuffix = "-ejb.jar" ; private boolean java2iiopdebug = false ; private boolean generateclient = false ; private boolean verify = true ; private String verifyArgs = "" ; private Hashtable _genfiles = new Hashtable ( ) ; private String borlandDTD ; public void setBASdtd ( String inString ) { } public void setDebug ( boolean debug ) { } public void setGenerateclient ( boolean b ) { } public void setProcessErrorStream ( InputStream is ) throws IOException { } public void setProcessInputStream ( OutputStream param1 ) throws IOException { } public void setProcessOutputStream ( InputStream is ) throws IOException { } public void setSuffix ( String inString ) { } public void setVerify ( boolean verify ) { } public void setVerifyArgs ( String args ) { } public void start ( ) throws IOException { } public void stop ( ) { } protected DescriptorHandler getBorlandDescriptorHandler ( final File srcDir ) { } protected void addVendorFiles ( Hashtable ejbFiles , String ddPrefix ) { } protected void writeJar ( String baseName , File jarFile , Hashtable files , String publicId ) throws TaskException { } File getVendorOutputJarFile ( String baseName ) { } private void buildBorlandStubs ( Iterator ithomes , Hashtable files ) { final Execute2 exe = new Execute2 ( ) ; exe . setWorkingDirectory ( getTask ( ) . getBaseDirectory ( ) ) ; final Commandline cmd = buildCommandline ( ithomes ) ; <START_BUG> exe . setCommandline ( cmd . getCommandline ( ) ) ; <END_BUG> getLogger ( ) . debug ( "Calling<seq2seq4repair_space>java2iiop" ) ; getLogger ( ) . debug ( cmd . toString ( ) ) ; try { final int result = exe . execute ( ) ; if ( result != 0 ) { String msg = ( "Failed<seq2seq4repair_space>executing<seq2seq4repair_space>java2iiop<seq2seq4repair_space>(ret<seq2seq4repair_space>code<seq2seq4repair_space>is<seq2seq4repair_space>" + result ) + ")" ; throw new TaskException ( msg ) ; } } catch ( IOException e ) { getLogger ( ) . error ( ( "java2iiop<seq2seq4repair_space>exception<seq2seq4repair_space>:" + ( e . getMessage ( ) ) ) ) ; throw new TaskException ( "Error" , e ) ; } } private Commandline buildCommandline ( final Iterator ithomes ) { } private void generateClient ( File sourceJar ) { } private String toClass ( String filename ) { } private String toClassFile ( String filename ) { } private void verifyBorlandJar ( File sourceJar ) throws TaskException { } }

Fix:
exe . setCommandline ( cmd ) ;
Buggy code:
public class ExternalToolsWizardLauncher { protected DataModel data ; protected ExternalToolsWizardModelListener listener ; public void launchWizard ( final String pluginID , boolean firstTime ) { final AbstractExternalToolsPlugin plugin ; ExternalToolsExtensionHandler handler = null ; try { handler = ( ( ExternalToolsExtensionHandler ) ( PluginManager . getInstance ( ) . getHandler ( NAME ) ) ) ; } catch ( PluginHandlerNotFoundException e ) { e . printStackTrace ( ) ; } try { IExtension extension = handler . getExtension ( pluginID ) ; plugin = ( ( AbstractExternalToolsPlugin ) ( extension . instanciateExtension ( null ) ) ) ; } catch ( Exception e1 ) { e1 . printStackTrace ( ) ; return ; } data = new DataModel ( ) ; data . registerDataLookup ( "id" , new DataLookup ( ) { public Object lookupData ( ) { return pluginID ; } } ) ; data . registerDataLookup ( "Plugin" , new DataLookup ( ) { public Object lookupData ( ) { return plugin ; } } ) ; WizardModel model ; if ( firstTime ) { model = new net . javaprog . ui . wizard . DefaultWizardModel ( new Step [ ] { new DescriptionStep ( data ) , new LocationStep ( data ) } ) ; } else { model = new net . javaprog . ui . wizard . DefaultWizardModel ( new Step [ ] { new InfoStep ( ) , new DescriptionStep ( data ) , new LocationStep ( data ) } ) ; } listener = new ExternalToolsWizardModelListener ( data ) ; model . addWizardModelListener ( listener ) ; Wizard wizard = new Wizard ( model , "External<seq2seq4repair_space>Tools<seq2seq4repair_space>Configuration" , ImageLoader . getSmallImageIcon ( "stock_preferences.png" ) ) ; CSH . setHelpIDString ( wizard , "extending_columba_2" ) ; <START_BUG> JavaHelpSupport . enableHelp ( wizard , HelpManager . getHelpManager ( ) . getHelpBroker ( ) ) ; <END_BUG> wizard . pack ( ) ; wizard . setLocationRelativeTo ( null ) ; wizard . setVisible ( true ) ; } public boolean isFinished ( ) { } public DataModel getData ( ) { } }

Fix:
JavaHelpSupport . enableHelp ( wizard , HelpManager . getInstance ( ) . getHelpBroker ( ) ) ;
Buggy code:
public class Contacts implements EntryPoint { class MyPanel extends HorizontalPanel { public void attach ( ) { } } @ Override public void onModuleLoad ( ) { Contacts . MyPanel panel = new Contacts . MyPanel ( ) ; new AppController ( ) . go ( panel ) ; Element e = DOM . getElementById ( "app1" ) ; <START_BUG> e . getParentElement ( ) . replaceChild ( panel . getElement ( ) , e ) ; <END_BUG> panel . attach ( ) ; } No newline ; at end ; of file ; }

Fix:
e . appendChild ( panel . getElement ( ) ) ;
Buggy code:
@ Path ( "//eventElection" ) public class EventElectionResource { private static Logger log = Logger . getLogger ( EventElectionResource . class . getName ( ) ) ; @ Inject DAOBean dao ; @ Inject EventVSBean eventVSBean ; @ Inject EventElectionBean eventElectionBean ; @ Inject ConfigVS config ; @ Transactional @ Path ( "//id//{id}" ) @ GET public Response getById ( @ PathParam ( "id" ) long id , @ Context ServletContext context , @ Context HttpServletRequest req , @ Context HttpServletResponse resp ) throws IOException , URISyntaxException , ServletException , ValidationException { } @ Transactional @ Path ( "//" ) @ GET public Response index ( @ QueryParam ( "eventVSState" ) String eventVSStateReq , @ DefaultValue ( "0" ) @ QueryParam ( "offset" ) int offset , @ DefaultValue ( "50" ) @ QueryParam ( "max" ) int max , @ Context ServletContext context , @ Context HttpServletRequest req , @ Context HttpServletResponse resp ) throws IOException , ServletException , ValidationException { } @ Path ( "//" ) @ POST public Response save ( CMSMessage cmsMessage , @ Context ServletContext context , @ Context HttpServletRequest req , @ Context HttpServletResponse resp ) throws Exception { EventElection response = eventElectionBean . saveEvent ( cmsMessage ) ; MessageDto responseDto = new MessageDto ( ) . setURL ( MessageFormat . format ( "{0}//rest//eventElection//id//{1}" , config . getContextURL ( ) , response . getId ( ) ) ) ; responseDto . setCmsMessagePEM ( new String ( response . getCmsMessage ( ) . getContentPEM ( ) ) ) ; <START_BUG> return Response . ok ( ) . entity ( responseDto ) . type ( JSON ) . build ( ) ; <END_BUG> } @ Path ( "//cancel" ) @ POST public Response cancelled ( CMSMessage cmsMessage ) throws Exception { } @ Transactional @ Path ( "//id//{id}//stats" ) @ GET public Response stats ( @ PathParam ( "id" ) long id , @ Context ServletContext context , @ Context HttpServletRequest req , @ Context HttpServletResponse resp ) throws Exception { } @ Transactional @ Path ( "//id//{id}//checkDates" ) @ GET public Response checkDates ( @ PathParam ( "id" ) long id ) throws Exception { } @ Transactional @ Path ( "//id//{id}//publishRequest" ) @ GET public Response publishRequest ( @ PathParam ( "id" ) long id , @ Context ServletContext context , @ Context HttpServletRequest req , @ Context HttpServletResponse resp ) throws Exception { } }

Fix:
return Response . ok ( ) . entity ( JSON . getMapper ( ) . writeValueAsBytes ( responseDto ) ) . type ( MediaType . JSON ) . build ( ) ;
Buggy code:
public class SwitchStatementTranslator extends AbstractStatementTranslator { public SwitchStatementTranslator ( Set < CompilerFeature > cFeatures , Set < AnalysisFeature > aFeatures ) { } public String translate ( Statement statement , String tab ) throws StatementTranslationException { SwitchStatement switchStatement = ( ( SwitchStatement ) ( statement ) ) ; String retValue = tab + "switch<seq2seq4repair_space>(" ; retValue += ( ( StatementTranslatorContainer . translate ( switchStatement . getExpression ( ) , "" ) ) + ")<seq2seq4repair_space>{" ) + ( NEW_LINE ) ; for ( SwitchStatementGroup sbsg : switchStatement . getSwitchStatementGroups ( ) ) { Expression switchLabel = sbsg . getExpression ( ) ; <START_BUG> retValue += ( ( tab + ( StatementTranslatorContainer . translate ( switchLabel , "" ) ) ) + ":" ) + ( NEW_LINE ) ; <END_BUG> for ( Statement innerStatement : sbsg . getStatements ( ) ) { retValue += StatementTranslatorContainer . translate ( innerStatement , ( tab + ( TAB ) ) ) ; retValue += super . adjustSemicolonForExpression ( innerStatement ) ; } } return ( retValue + "}" ) + ( NEW_LINE ) ; } }

Fix:
retValue += ( ( ( tab + "case<seq2seq4repair_space>(" ) + ( StatementTranslatorContainer . translate ( switchLabel , "" ) ) ) + "):" ) + ( NEW_LINE ) ;
Buggy code:
@ NonTransactiveCommandAttribute public class DeleteGeoRepSessionCommand extends GeoRepSessionCommandBase < GlusterVolumeGeoRepSessionParameters > { public DeleteGeoRepSessionCommand ( GlusterVolumeGeoRepSessionParameters params ) { } @ Override protected LockProperties applyLockProperties ( LockProperties lockProperties ) { } @ Override protected void setActionMessageParameters ( ) { } @ Override protected void executeCommand ( ) { } @ Override public AuditLogType getAuditLogTypeValue ( ) { if ( getSucceeded ( ) ) { <START_BUG> return AuditLogType . GEOREP_SESSION_DELETE ; <END_BUG> } else { return ( errorType ) == null ? AuditLogType . GEOREP_SESSION_DELETE_FAILED : errorType ; } } }

Fix:
return AuditLogType . GEOREP_SESSION_DELETED ;
Buggy code:
public class NotificationDeliverToDatabase { private static final Logger log = Logger . getLogger ( NotificationDeliverToDatabase . class ) ; @ Inject private PeerStatus peerStatus ; @ Inject private IAlertsDatabaseConnector alertsConnector ; public void sendCollectorResult ( String collectorName , NodeInfo node , ProjectJson project , String output , int exit_status , String duration , boolean is_for_collector , int notifications_in_24h ) { String version = new NodeHelper ( ) . getVersionOrNull ( peerStatus . createJson ( ) , project , node ) ; <START_BUG> CollectorNotificationJson collectorNotificationJson = new CollectorNotificationJson ( collectorName , project . name ( ) , output , node , version , InetUtils . getLocalHost ( ) . getHostName ( ) , exit_status , duration , is_for_collector , notifications_in_24h ) ; <END_BUG> NotificationDeliverToDatabase . log . info ( ( "sending<seq2seq4repair_space>notification<seq2seq4repair_space>" + ( collectorNotificationJson . toStringNoOutput ( ) ) ) ) ; alertsConnector . put ( collectorNotificationJson ) ; } }

Fix:
CollectorNotificationJson collectorNotificationJson = new CollectorNotificationJson ( collectorName , project . name ( ) , output , node . name ( ) , node . alias ( ) , version , InetUtils . getLocalHost ( ) . getHostName ( ) , exit_status , duration , is_for_collector , notifications_in_24h ) ;
Buggy code:
public class CitiesActivity extends FragmentActivity implements CitiesFragment . Callbacks { private boolean mTwoPane ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_item_list ) ; if ( ( findViewById ( item_detail_container ) ) != null ) { mTwoPane = true ; ( ( CitiesFragment ) ( getSupportFragmentManager ( ) . findFragmentById ( R . id . item_list ) ) ) . setActivateOnItemClick ( true ) ; } <START_BUG> Log . i ( "" , "activity<seq2seq4repair_space>created" ) ; <END_BUG> } @ Override public void onItemSelected ( String city ) { } @ Override public boolean onKeyDown ( int keycode , KeyEvent e ) { } }

Fix:
Log . i ( "" , "citiesactivity<seq2seq4repair_space>created" ) ;
Buggy code:
public class JMSQueueReadAttributeHandler extends AbstractRuntimeOnlyHandler { public static final JMSQueueReadAttributeHandler INSTANCE = new JMSQueueReadAttributeHandler ( ) ; private ParametersValidator validator = new ParametersValidator ( ) ; private JMSQueueReadAttributeHandler ( ) { } @ Override public void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { validator . validate ( operation ) ; final String attributeName = operation . require ( NAME ) . asString ( ) ; JMSQueueControl control = getControl ( context , operation ) ; if ( control == null ) { <START_BUG> ManagementUtil . rollbackOperationWithNoHandler ( context , operation ) ; <END_BUG> return ; } if ( MESSAGE_COUNT . getName ( ) . equals ( attributeName ) ) { try { context . getResult ( ) . set ( control . getMessageCount ( ) ) ; } catch ( RuntimeException e ) { throw e ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } else if ( SCHEDULED_COUNT . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getScheduledCount ( ) ) ; } else if ( CONSUMER_COUNT . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getConsumerCount ( ) ) ; } else if ( DELIVERING_COUNT . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getDeliveringCount ( ) ) ; } else if ( MESSAGES_ADDED . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getMessagesAdded ( ) ) ; } else if ( QUEUE_ADDRESS . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . getAddress ( ) ) ; } else if ( EXPIRY_ADDRESS . getName ( ) . equals ( attributeName ) ) { ModelNode result = context . getResult ( ) ; String expiryAddress = control . getExpiryAddress ( ) ; if ( expiryAddress != null ) { result . set ( expiryAddress ) ; } } else if ( DEAD_LETTER_ADDRESS . getName ( ) . equals ( attributeName ) ) { ModelNode result = context . getResult ( ) ; String dla = control . getDeadLetterAddress ( ) ; if ( dla != null ) { result . set ( dla ) ; } } else if ( PAUSED . getName ( ) . equals ( attributeName ) ) { try { context . getResult ( ) . set ( control . isPaused ( ) ) ; } catch ( RuntimeException e ) { throw e ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } else if ( TEMPORARY . getName ( ) . equals ( attributeName ) ) { context . getResult ( ) . set ( control . isTemporary ( ) ) ; } else { throw MessagingMessages . MESSAGES . unsupportedAttribute ( attributeName ) ; } context . stepCompleted ( ) ; } private JMSQueueControl getControl ( OperationContext context , ModelNode operation ) { } }

Fix:
ManagementUtil . rollbackOperationWithResourceNotFound ( context , operation ) ;
Buggy code:
public class SectionService { public static float [ ] [ ] generateNodes ( int nodes , float maxHeight , float minWidth , float widthVariation ) { } public static ArrayList < Section > coordToSections ( float [ ] [ ] coord ) { } private static void setToPlatform ( Section section , float [ ] [ ] coord , int i ) { } public static void insertWaterToLakes ( ArrayList < Section > sections , float [ ] [ ] coord , float rainPerWidth , float time ) { for ( int i = 0 ; i < ( sections . size ( ) ) ; i ++ ) { if ( ! ( sections . get ( i ) . isFilled ( ) ) ) { float effectiveWidth = SectionService . calculateRainCollectingWidth ( sections , i ) ; float rainVolume = ( effectiveWidth * rainPerWidth ) * time ; sections . get ( i ) . addWater ( rainVolume ) ; } } <START_BUG> for ( int i = 1 ; i < ( ( sections . size ( ) ) - 1 ) ; i ++ ) { <END_BUG> Section s = sections . get ( i ) ; if ( s . testIfJustFilled ( ) ) { int rightLakeIndex = - 1 ; int leftLakeIndex = - 1 ; for ( int j = i + 1 ; j < ( sections . size ( ) ) ; j ++ ) { if ( ! ( sections . get ( j ) . isFilled ( ) ) ) { rightLakeIndex = j ; break ; } } for ( int j = i - 1 ; j >= 0 ; j -- ) { if ( ! ( sections . get ( j ) . isFilled ( ) ) ) { leftLakeIndex = j ; break ; } } if ( ( coord [ s . getMinIndex ( ) ] [ 1 ] ) <= ( coord [ s . getMaxIndex ( ) ] [ 1 ] ) ) { int min = ( leftLakeIndex == ( - 1 ) ) ? 0 : sections . get ( leftLakeIndex ) . getMaxIndex ( ) ; for ( int k = s . getMinIndex ( ) ; k >= min ; k -- ) { if ( ( coord [ k ] [ 1 ] ) > ( coord [ s . getMinIndex ( ) ] [ 1 ] ) ) { for ( int l = i - 1 ; l >= 0 ; l -- ) { Section toBeIgnored = sections . get ( l ) ; if ( ( toBeIgnored . getType ( ) ) == ( SectionType . LAKE ) ) { if ( ( toBeIgnored . getMinIndex ( ) ) >= min ) { s . setIgnoreLakeIndexes ( toBeIgnored ) ; } else { break ; } } } s . setRange ( k , s . getMaxIndex ( ) ) ; s . updateVolume ( coord ) ; break ; } } } if ( ( coord [ s . getMinIndex ( ) ] [ 1 ] ) >= ( coord [ s . getMaxIndex ( ) ] [ 1 ] ) ) { int max = ( rightLakeIndex == ( - 1 ) ) ? ( coord . length ) - 1 : sections . get ( rightLakeIndex ) . getMinIndex ( ) ; for ( int k = s . getMaxIndex ( ) ; k <= max ; k ++ ) { if ( ( coord [ k ] [ 1 ] ) > ( coord [ s . getMaxIndex ( ) ] [ 1 ] ) ) { for ( int l = i + 1 ; l < ( sections . size ( ) ) ; l ++ ) { Section toBeIgnored = sections . get ( l ) ; if ( ( toBeIgnored . getType ( ) ) == ( SectionType . LAKE ) ) { if ( ( toBeIgnored . getMaxIndex ( ) ) <= max ) { s . setIgnoreLakeIndexes ( toBeIgnored ) ; } else { break ; } } } s . setRange ( s . getMinIndex ( ) , k ) ; s . updateVolume ( coord ) ; break ; } } } } } } public static void calculateTimeToFillSections ( ArrayList < Section > sections , float rainPerWidth ) { } public static float calculateRainCollectingWidth ( ArrayList < Section > sections , int i ) { } public static boolean isInitialDataValid ( float [ ] [ ] coord ) { } No newline ; at end ; of file ; }

Fix:
for ( int i = 0 ; i < ( sections . size ( ) ) ; i ++ ) {
Buggy code:
@ Controller public class FindOwnersForm { private final Clinic clinic ; @ Autowired public FindOwnersForm ( Clinic clinic ) { } @ InitBinder public void setAllowedFields ( WebDataBinder dataBinder ) { <START_BUG> dataBinder . setDisallowedFields ( new String [ ] { "id" } ) ; <END_BUG> } @ RequestMapping ( value = "//owners//search" , method = RequestMethod . GET ) public String setupForm ( Model model ) { } @ RequestMapping ( value = "//owners" , method = RequestMethod . GET ) public String processSubmit ( Owner owner , BindingResult result , Model model ) { } }

Fix:
dataBinder . setDisallowedFields ( "id" ) ;
Buggy code:
public class Snippet252 { public static void main ( String [ ] args ) { final Display display = new Display ( ) ; final Shell shell = new Shell ( display ) ; shell . addListener ( Paint , new Listener ( ) { public void handleEvent ( Event event ) { GC gc = event . gc ; gc . setLineAttributes ( new LineAttributes ( 10 , SWT . CAP_FLAT , SWT . JOIN_MITER , SWT . LINE_SOLID , null , 0 , 10 ) ) ; gc . drawPolyline ( new int [ ] { 50 , 100 , 50 , 20 , 60 , 30 , 50 , 45 } ) ; gc . setLineAttributes ( new LineAttributes ( ( 1 // 2.0F ) , SWT . CAP_FLAT , SWT . JOIN_MITER , SWT . LINE_DOT , null , 0 , 10 ) ) ; gc . drawPolyline ( new int [ ] { 100 , 100 , 100 , 20 , 110 , 30 , 100 , 45 } ) ; } } ) ; <START_BUG> shell . setSize ( 170 , 170 ) ; <END_BUG> shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
shell . setSize ( 150 , 150 ) ;