nus-yam/ex-repair huggingface dataset:
Buggy code:
public interface FieldCache { public static final int STRING_INDEX = - 1 ; public static class StringIndex { public int binarySearchLookup ( String key ) { if ( key == null ) return 0 ; int low = 1 ; int high = ( lookup . length ) - 1 ; while ( low <= high ) { <START_BUG> int mid = ( low + high ) > > 1 ; <END_BUG> int cmp = lookup [ mid ] . compareTo ( key ) ; if ( cmp < 0 ) low = mid + 1 ; else if ( cmp > 0 ) high = mid - 1 ; else return mid ; } return - ( low + 1 ) ; } public final String [ ] lookup ; public final int [ ] order ; public StringIndex ( int [ ] values , String [ ] lookup ) { } } public interface ByteParser { public byte parseByte ( String string ) { } } public interface ShortParser { public short parseShort ( String string ) { } } public interface IntParser { public int parseInt ( String string ) { } } public interface FloatParser { public float parseFloat ( String string ) { } } public static FieldCache DEFAULT = new FieldCacheImpl ( ) ; public byte [ ] getBytes ( IndexReader reader , String field ) throws IOException { } public byte [ ] getBytes ( IndexReader reader , String field , FieldCache . ByteParser parser ) throws IOException { } public short [ ] getShorts ( IndexReader reader , String field ) throws IOException { } public short [ ] getShorts ( IndexReader reader , String field , FieldCache . ShortParser parser ) throws IOException { } public int [ ] getInts ( IndexReader reader , String field ) throws IOException { } public int [ ] getInts ( IndexReader reader , String field , FieldCache . IntParser parser ) throws IOException { } public float [ ] getFloats ( IndexReader reader , String field ) throws IOException { } public float [ ] getFloats ( IndexReader reader , String field , FieldCache . FloatParser parser ) throws IOException { } public String [ ] getStrings ( IndexReader reader , String field ) throws IOException { } public FieldCache . StringIndex getStringIndex ( IndexReader reader , String field ) throws IOException { } public Object getAuto ( IndexReader reader , String field ) throws IOException { } public Comparable [ ] getCustom ( IndexReader reader , String field , SortComparator comparator ) throws IOException { } }

Fix:
int mid = ( low + high ) > > > 1 ;
Buggy code:
public class AddressControlHandler extends AbstractRuntimeOnlyHandler { public static AddressControlHandler INSTANCE = new AddressControlHandler ( ) ; private AddressControlHandler ( ) { } @ Override protected void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { } private void handleReadAttribute ( OperationContext context , ModelNode operation ) { final AddressControl addressControl = getAddressControl ( context , operation ) ; if ( addressControl == null ) { <START_BUG> ManagementUtil . rollbackOperationWithNoHandler ( context , operation ) ; <END_BUG> return ; } final String name = operation . require ( NAME ) . asString ( ) ; try { if ( CommonAttributes . ROLES_ATTR_NAME . equals ( name ) ) { String json = addressControl . getRolesAsJSON ( ) ; ManagementUtil . reportRoles ( context , json ) ; } else if ( CommonAttributes . QUEUE_NAMES . equals ( name ) ) { String [ ] queues = addressControl . getQueueNames ( ) ; ManagementUtil . reportListOfString ( context , queues ) ; } else if ( CommonAttributes . NUMBER_OF_BYTES_PER_PAGE . equals ( name ) ) { long l = addressControl . getNumberOfBytesPerPage ( ) ; context . getResult ( ) . set ( l ) ; } else if ( CommonAttributes . NUMBER_OF_PAGES . equals ( name ) ) { int i = addressControl . getNumberOfPages ( ) ; context . getResult ( ) . set ( i ) ; } else if ( CommonAttributes . BINDING_NAMES . equals ( name ) ) { String [ ] bindings = addressControl . getBindingNames ( ) ; ManagementUtil . reportListOfString ( context , bindings ) ; } else { throw MessagingMessages . MESSAGES . unsupportedAttribute ( name ) ; } } catch ( RuntimeException e ) { throw e ; } catch ( Exception e ) { context . getFailureDescription ( ) . set ( e . getLocalizedMessage ( ) ) ; } context . stepCompleted ( ) ; } private void handleGetRolesAsJson ( final OperationContext context , final ModelNode operation ) { } private AddressControl getAddressControl ( final OperationContext context , final ModelNode operation ) { } }

Fix:
ManagementUtil . rollbackOperationWithResourceNotFound ( context , operation ) ;
Buggy code:
public class BlockedJobsDialog extends IconAndMessageDialog { private ProgressTreeViewer viewer ; private String blockedTaskName = null ; private Button cancelSelected ; private Cursor arrowCursor ; private Cursor waitCursor ; private IProgressMonitor blockingMonitor ; private JobTreeElement blockedElement = new BlockedJobsDialog . BlockedUIElement ( ) ; private class BlockedUIElement extends JobTreeElement { Object [ ] getChildren ( ) { } String getDisplayString ( ) { } public Image getDisplayImage ( ) { } Object getParent ( ) { } boolean hasChildren ( ) { } boolean isActive ( ) { } boolean isJobInfo ( ) { } public void cancel ( ) { } public boolean isCancellable ( ) { } } public BlockedJobsDialog ( Shell parentShell , IProgressMonitor blocking , IStatus blockingStatus ) { } protected Control createDialogArea ( Composite parent ) { } void showJobDetails ( Composite parent ) { } private ProgressTreeContentProvider getContentProvider ( ) { <START_BUG> return new ProgressTreeContentProvider ( viewer ) { <END_BUG> public Object [ ] getElements ( Object inputElement ) { Object [ ] elements = super . getElements ( inputElement ) ; Object [ ] result = new Object [ ( elements . length ) + 1 ] ; System . arraycopy ( elements , 0 , result , 1 , elements . length ) ; result [ 0 ] = blockedElement ; return result ; } } ; } protected Control createButtonBar ( Composite parent ) { } private Button createButton ( Composite parent , String text , SelectionListener listener ) { } private void clearCursors ( ) { } private void clearCursor ( Control control ) { } protected void configureShell ( Shell shell ) { } private void setMessage ( String messageString ) { } protected Image getImage ( ) { } public boolean close ( ) { } public void setBlockedTaskName ( String taskName ) { } }

Fix:
return new ProgressTreeContentProvider ( viewer , true ) {
Buggy code:
public class PostItem extends bottomMenuActivity implements View . OnClickListener , Observer { private static final String TAG = "PostItem" ; private String UserName ; private String Email ; private String ApiKey ; private String CreatedAt ; private String UserID ; private Intent intent ; private Context ctx ; private String image_file_name ; private EditText time_limit ; private EditText direct_buy_price ; private EditText current_price ; private Spinner condition_name ; private Spinner category_name ; private TextView description ; private TextView name ; private ImageView itemImage ; private Button confirm ; private UploadImage imageUploader ; public int getContentViewLayoutResId ( ) { } protected final void onCreatOverride ( Bundle savedInstanceState ) { Log . i ( PostItem . TAG , "Subclass<seq2seq4repair_space>Activity:<seq2seq4repair_space>onCreate()" ) ; intent = this . getIntent ( ) ; ctx = getApplicationContext ( ) ; UserName = intent . getStringExtra ( "user_name" ) ; Email = intent . getStringExtra ( "user_email" ) ; ApiKey = intent . getStringExtra ( "user_apiKey" ) ; CreatedAt = intent . getStringExtra ( "user_createdAt" ) ; UserID = intent . getStringExtra ( "user_ID" ) ; Log . i ( PostItem . TAG , ( ( ( ( ( ( ( UserName ) + ",<seq2seq4repair_space>" ) + ( Email ) ) + ",<seq2seq4repair_space>" ) + ( ApiKey ) ) + ",<seq2seq4repair_space>" ) + ( CreatedAt ) ) ) ; image_file_name = "" ; itemImage = ( ( ImageView ) ( findViewById ( PostitemImage ) ) ) ; itemImage . setOnClickListener ( this ) ; condition_name = ( ( Spinner ) ( findViewById ( PostItemConditionSel ) ) ) ; category_name = ( ( Spinner ) ( findViewById ( PostItemCategorySel ) ) ) ; description = ( ( TextView ) ( findViewById ( descriptionEditContent ) ) ) ; name = ( ( TextView ) ( findViewById ( itemNameInput ) ) ) ; time_limit = ( ( EditText ) ( findViewById ( limitTime ) ) ) ; direct_buy_price = ( ( EditText ) ( findViewById ( dirPrice ) ) ) ; current_price = ( ( EditText ) ( findViewById ( iniPrice ) ) ) ; confirm = ( ( Button ) ( findViewById ( confirm_post_button ) ) ) ; confirm . setOnClickListener ( this ) ; <START_BUG> new com . project . zxt . ustauctionhouse . Utility . ConditionCategoryLoader ( condition_name , category_name , this ) . loadConditionCategory ( ) ; <END_BUG> } private void modifyItemImage ( ) { } protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } @ Override public void update ( Observable observable , Object data ) { } @ Override public void onDestroy ( ) { } public void onClick ( View v ) { } private boolean validateInput ( ) { } private class AsyncPostItem extends AsyncTask < String , Void , JSONObject > { @ Override protected JSONObject doInBackground ( String ... params ) { } protected void onPostExecute ( JSONObject result ) { } } No newline ; at end ; of file ; }

Fix:
new com . project . zxt . ustauctionhouse . Utility . ConditionCategoryLoader ( condition_name , category_name , this , true ) . loadConditionCategory ( ) ;
Buggy code:
public class JdrReportService implements JdrReportCollector , Service < JdrReportCollector > { public static final ServiceName SERVICE_NAME = JBOSS . append ( "jdr" , "collector" ) ; public static ServiceController < JdrReportCollector > addService ( final ServiceTarget target , final ServiceVerificationHandler verificationHandler ) { } private final InjectedValue < ServerEnvironment > serverEnvironmentValue = new InjectedValue < ServerEnvironment > ( ) ; private final InjectedValue < ModelController > modelControllerValue = new InjectedValue < ModelController > ( ) ; private ExecutorService executorService ; private ServerEnvironment serverEnvironment ; private ModelControllerClient controllerClient ; public JdrReport standaloneCollect ( String protocol , String host , String port ) throws OperationFailedException { String username = null ; String password = null ; if ( host == null ) { host = "localhost" ; } if ( port == null ) { <START_BUG> port = "9999" ; <END_BUG> } if ( protocol == null ) { protocol = "http-remoting" ; } return new JdrRunner ( protocol , username , password , host , port ) . collect ( ) ; } public JdrReport collect ( ) throws OperationFailedException { } public synchronized void start ( StartContext context ) throws StartException { } public synchronized void stop ( StopContext context ) { } public JdrReportService getValue ( ) throws IllegalArgumentException , IllegalStateException { } }

Fix:
port = "9990" ;
Buggy code:
public final class ConversionUtils { private final ConverterRegistry converterRegistry ; public ConversionUtils ( ConverterRegistry registry ) { } public Object convert ( Object value , Class toType ) { } public Object convert ( Object value , Class toType , Locale locale ) { <START_BUG> Converter converter = null ; <END_BUG> Object converted = null ; try { converter = converterRegistry . lookup ( toType , locale ) ; if ( converter != null ) { if ( ! ( toType . isArray ( ) ) ) { if ( ( value instanceof String [ ] ) && ( ( ( ( String [ ] ) ( value ) ) . length ) == 1 ) ) { value = ( ( String [ ] ) ( value ) ) [ 0 ] ; } } converted = converter . convert ( value ) ; } else { converted = OgnlOps . convertValue ( value , toType ) ; } } catch ( ConversionException e ) { throw e . setConverter ( converter ) . setLocale ( locale ) . setTargetType ( toType ) . setTriedValue ( value ) ; } catch ( Exception e ) { throw new ConversionException ( e ) . setConverter ( converter ) . setLocale ( locale ) . setTargetType ( toType ) . setTriedValue ( value ) ; } return converted ; } }

Fix:
IConverter converter = null ;
Buggy code:
public class Depend extends MatchingTask { private static final String CACHE_FILE_NAME = "dependencies.txt" ; private static final String CLASSNAME_PREPEND = "||:" ; private boolean closure = false ; private boolean dump = false ; private Hashtable affectedClassMap ; private File cache ; private Hashtable classFileInfoMap ; private Hashtable classpathDependencies ; private Path dependClasspath ; private Path destPath ; private Hashtable outOfDateClasses ; private Path srcPath ; public void setCache ( File cache ) { } public void setClasspath ( Path classpath ) throws TaskException { } public void setClasspathRef ( Reference r ) throws TaskException { } public void setClosure ( boolean closure ) { } public void setDestDir ( Path destPath ) { } public void setDump ( boolean dump ) { } public void setSrcdir ( Path srcPath ) { } public Path getClasspath ( ) { } public Path createClasspath ( ) throws TaskException { if ( ( dependClasspath ) == null ) { <START_BUG> dependClasspath = new Path ( project ) ; <END_BUG> } return dependClasspath . createPath ( ) ; } public void execute ( ) throws TaskException { } protected void scanDir ( File srcDir , String [ ] files ) { } private Vector getClassFiles ( Path classLocations ) throws TaskException { } private void addClassFiles ( Vector classFileList , File dir , File root ) { } private int deleteAffectedFiles ( String className ) { } private int deleteAllAffectedFiles ( ) { } private void determineDependencies ( ) throws IOException , TaskException { } private Hashtable readCachedDependencies ( ) throws IOException { } private void writeCachedDependencies ( Hashtable dependencyMap ) throws IOException { } private static class ClassFileInfo { public File absoluteFile ; public String className ; public String relativeName ; } }

Fix:
dependClasspath = new Path ( getProject ( ) ) ;
Buggy code:
@ ContextConfiguration public class HibernateSessionFlushingTests extends AbstractTransactionalJUnit4SpringContextTests { private static final String SAM = "Sam" ; private static final String JUERGEN = "Juergen" ; @ Autowired private PersonService personService ; @ Autowired private SessionFactory sessionFactory ; protected int countRowsInPersonTable ( ) { } protected void assertPersonCount ( int expectedCount ) { } @ Before public void setUp ( ) { } @ Test public void findSam ( ) { } @ Test public void saveJuergenWithDriversLicense ( ) { } @ Test ( expected = ConstraintViolationException . class ) public void saveJuergenWithNullDriversLicense ( ) { } private void updateSamWithNullDriversLicense ( ) { } @ Test public void updateSamWithNullDriversLicenseWithoutSessionFlush ( ) { } <START_BUG> @ Test ( expected = GenericJDBCException . class ) <END_BUG> public void updateSamWithNullDriversLicenseWithSessionFlush ( ) { updateSamWithNullDriversLicense ( ) ; sessionFactory . getCurrentSession ( ) . flush ( ) ; } }

Fix:
@ Test ( expected = ConstraintViolationException . class )
Buggy code:
public class NameLookup implements SuffixConstants { public static final int ACCEPT_CLASSES = 2 ; public static final int ACCEPT_INTERFACES = 4 ; protected IPackageFragmentRoot [ ] packageFragmentRoots ; protected HashtableOfArrayToObject packageFragments ; protected HashMap unitsToLookInside ; public NameLookup ( IPackageFragmentRoot [ ] packageFragmentRoots , HashtableOfArrayToObject packageFragments , ICompilationUnit [ ] workingCopies ) { } protected boolean acceptType ( IType type , int acceptFlags ) { } private void findAllTypes ( String prefix , boolean partialMatch , int acceptFlags , IJavaElementRequestor requestor ) { } public ICompilationUnit findCompilationUnit ( String qualifiedTypeName ) { String [ ] pkgName = CharOperation . NO_STRINGS ; String cuName = qualifiedTypeName ; int index = qualifiedTypeName . lastIndexOf ( '.' ) ; if ( index != ( - 1 ) ) { <START_BUG> pkgName = Signature . getSimpleNames ( qualifiedTypeName . substring ( 0 , index ) ) ; <END_BUG> cuName = qualifiedTypeName . substring ( ( index + 1 ) ) ; } index = cuName . indexOf ( '$' ) ; if ( index != ( - 1 ) ) { cuName = cuName . substring ( 0 , index ) ; } cuName += SuffixConstants . SUFFIX_STRING_java ; IPackageFragment [ ] frags = ( ( IPackageFragment [ ] ) ( this . packageFragments . get ( pkgName ) ) ) ; if ( frags != null ) { for ( int i = 0 ; i < ( frags . length ) ; i ++ ) { IPackageFragment frag = frags [ i ] ; if ( ! ( frag instanceof JarPackageFragment ) ) { ICompilationUnit cu = frag . getCompilationUnit ( cuName ) ; if ( ( cu != null ) && ( cu . exists ( ) ) ) { return cu ; } } } } return null ; } public IPackageFragment findPackageFragment ( IPath path ) { } public IPackageFragment [ ] findPackageFragments ( String name , boolean partialMatch ) { } public IType findType ( String typeName , String packageName , boolean partialMatch , int acceptFlags ) { } public IType findType ( String name , IPackageFragment pkg , boolean partialMatch , int acceptFlags ) { } IType findSecondaryType ( String typeName , IPackageFragment pkg , boolean partialMatch , final int acceptFlags ) { } public IType findType ( String name , boolean partialMatch , int acceptFlags ) { } protected boolean nameMatches ( String searchName , IJavaElement element , boolean partialMatch ) { } public void seekPackageFragments ( String name , boolean partialMatch , IJavaElementRequestor requestor ) { } public void seekTypes ( String name , IPackageFragment pkg , boolean partialMatch , int acceptFlags , IJavaElementRequestor requestor ) { } protected void seekTypesInBinaryPackage ( String name , IPackageFragment pkg , boolean partialMatch , int acceptFlags , IJavaElementRequestor requestor ) { } protected void seekTypesInSourcePackage ( String name , IPackageFragment pkg , boolean partialMatch , int acceptFlags , IJavaElementRequestor requestor ) { } protected void seekQualifiedMemberTypes ( String qualifiedName , IType type , boolean partialMatch , IJavaElementRequestor requestor , int acceptFlags ) { } }

Fix:
pkgName = Util . splitOn ( '.' , qualifiedTypeName , 0 , index ) ;
Buggy code:
public class SensitivityClassificationParentResourceDefinition extends SimpleResourceDefinition { public static final PathElement PATH_ELEMENT = PathElement . pathElement ( CONSTRAINT , SENSITIVITY_CLASSIFICATION ) ; public static final SensitivityClassificationParentResourceDefinition INSTANCE = new SensitivityClassificationParentResourceDefinition ( ) ; private SensitivityClassificationParentResourceDefinition ( ) { } @ Override public void registerChildren ( ManagementResourceRegistration resourceRegistration ) { <START_BUG> resourceRegistration . registerSubModel ( new SensitivityClassificationResourceDefinition ( ) ) ; <END_BUG> } }

Fix:
resourceRegistration . registerSubModel ( new SensitivityClassificationTypeResourceDefinition ( ) ) ;
Buggy code:
public class AgreeLinkingService extends PropertiesLinkingService { public AgreeLinkingService ( ) { } @ Override public List < EObject > getLinkedObjects ( EObject context , EReference reference , INode node ) throws IllegalNodeException { } private static boolean sameName ( IEObjectDescription eod , String name ) { <START_BUG> return eod . getName ( ) . getLastSegment ( ) . equalsIgnoreCase ( name ) ; <END_BUG> } private static boolean isVisible ( IEObjectDescription eod , List < String > visibleProjects ) { } private static List < String > getVisibleProjects ( String contextProjectName ) { } private static List < EObject > findUnitLiteralAsList ( Element context , String name ) { } private static final EClass UNITS_TYPE = eINSTANCE . getUnitsType ( ) ; private static UnitLiteral findUnitLiteral ( Element context , String name ) { } }

Fix:
return eod . getName ( ) . toString ( ) . equalsIgnoreCase ( name ) ;
Buggy code:
public class ToolBar extends JToolBar { ResourceBundle toolbarLabels ; GridBagConstraints gridbagConstraints ; GridBagLayout gridbagLayout ; int i ; XmlElement rootElement ; FrameMediator frameController ; public ToolBar ( XmlElement rootElement , FrameMediator controller ) { } public boolean getVisible ( ) { } private void createButtons ( ) { removeAll ( ) ; ListIterator iterator = rootElement . getElements ( ) . listIterator ( ) ; XmlElement buttonElement = null ; while ( iterator . hasNext ( ) ) { try { buttonElement = ( ( XmlElement ) ( iterator . next ( ) ) ) ; if ( buttonElement . getName ( ) . equals ( "button" ) ) { addButton ( ( ( ActionPluginHandler ) ( pluginManager . getHandler ( "org.columba.core.action" ) ) ) . getAction ( buttonElement . getAttribute ( "action" ) , frameController ) ) ; } else if ( buttonElement . getName ( ) . equals ( "separator" ) ) { addSeparator ( ) ; } } catch ( Exception e ) { <START_BUG> ColumbaLogger . log . debug ( ( "toolbar-button=" + ( ( String ) ( buttonElement . getAttribute ( "action" ) ) ) ) ) ; <END_BUG> e . printStackTrace ( ) ; } } add ( Box . createHorizontalGlue ( ) ) ; ImageSequenceTimer image = frameController . getStatusBar ( ) . getImageSequenceTimer ( ) ; add ( image ) ; } public void addButton ( AbstractColumbaAction action ) { } }

Fix:
ColumbaLogger . log . info ( ( "toolbar-button=" + ( ( String ) ( buttonElement . getAttribute ( "action" ) ) ) ) ) ;
Buggy code:
public interface RotateImage { <START_BUG> int [ ] [ ] rotate ( int [ ] [ ] matrix ) ; <END_BUG> }

Fix:
public void rotate ( int [ ] [ ] matrix ) ;
Buggy code:
public class PacketSetHollowShape implements IMessage { private boolean isWire ; private boolean hollowShape ; public PacketSetHollowShape ( ) { } public PacketSetHollowShape ( boolean hollowShape , boolean isWire ) { } @ Override public void toBytes ( ByteBuf buffer ) { } @ Override public void fromBytes ( ByteBuf buffer ) { } public static class Handler implements IMessageHandler < PacketSetHollowShape , IMessage > { @ Override public IMessage onMessage ( final PacketSetHollowShape message , final MessageContext ctx ) { IThreadListener mainThread = ( ( WorldServer ) ( ctx . getServerHandler ( ) . playerEntity . worldObj ) ) ; mainThread . addScheduledTask ( new Runnable ( ) { @ Override public void run ( ) { EntityPlayer player = ctx . getServerHandler ( ) . playerEntity ; <START_BUG> SculptSettingsHelper . setHollowShape ( player , player . getCurrentEquippedItem ( ) , message . hollowShape , message . isWire ) ; <END_BUG> } } ) ; return null ; } } No newline ; at end ; of file ; }

Fix:
SculptSettingsHelper . setHollowShape ( player , player . getCurrentEquippedItem ( ) , message . isWire , message . hollowShape ) ;
Buggy code:
public class ThinMenuItemUI extends BasicMenuItemUI { public static ComponentUI createUI ( JComponent c ) { } protected Dimension getPreferredMenuItemSize ( JComponent c , Icon checkIcon , Icon arrowIcon , int defaultTextIconGap ) { JMenuItem b = ( ( JMenuItem ) ( c ) ) ; Icon icon = ( ( Icon ) ( b . getIcon ( ) ) ) ; if ( icon == null ) b . setIcon ( new EmptyIcon ( ) ) ; <START_BUG> Dimension d = super . getPreferredMenuItemSize ( c , checkIcon , arrowIcon , ( defaultTextIconGap - 8 ) ) ; <END_BUG> return d ; } public void paint ( Graphics g , JComponent c ) { } }

Fix:
Dimension d = super . getPreferredMenuItemSize ( c , checkIcon , arrowIcon , defaultTextIconGap ) ;
Buggy code:
public class SimpleConfigurableAuthorizer implements ConfigurableAuthorizer { private final RoleMapper roleMapper ; private final DefaultPermissionFactory permissionFactory ; private final Authorizer authorizer ; private final Set < String > addedRoles = new HashSet < String > ( ) ; private static final Action FAKE_JMX_ACTION = new Action ( Util . createOperation ( "test" , EMPTY_ADDRESS ) , null ) ; public SimpleConfigurableAuthorizer ( ) { } public SimpleConfigurableAuthorizer ( final RoleMapper roleMapper ) { } @ Override public boolean isRoleBased ( ) { } @ Override public Set < String > getStandardRoles ( ) { } @ Override public Set < String > getAllRoles ( ) { } @ Override public void addScopedRole ( String roleName , String baseRole , ScopingConstraint scopingConstraint ) { } @ Override public void removeScopedRole ( String roleName ) { } @ Override public AuthorizationResult authorize ( Caller caller , Environment callEnvironment , Action action , TargetAttribute target ) { } @ Override public AuthorizationResult authorize ( Caller caller , Environment callEnvironment , Action action , TargetResource target ) { } @ Override public AuthorizationResult authorizeJmxOperation ( Caller caller , Environment callEnvironment , JmxTarget target ) { Set < String > roles = roleMapper . mapRoles ( caller , null , SimpleConfigurableAuthorizer . FAKE_JMX_ACTION , ( ( TargetAttribute ) ( null ) ) ) ; <START_BUG> if ( target . isNonFacadeMBeansSensitive ( ) ) { <END_BUG> return authorize ( roles , SUPERUSER , ADMINISTRATOR ) ; } else { if ( target . isReadOnly ( ) ) { return AuthorizationResult . PERMITTED ; } else { return authorize ( roles , SUPERUSER , ADMINISTRATOR , OPERATOR , MAINTAINER ) ; } } } private AuthorizationResult authorize ( Set < String > callerRoles , StandardRole ... roles ) { } }

Fix:
if ( ( target . isNonFacadeMBeansSensitive ( ) ) || ( target . isSuperUserOrAdminOnly ( ) ) ) {
Buggy code:
public class CSVStrategyTest extends TestCase { public CSVStrategyTest ( String name ) { } public static Test suite ( ) { } public void testGetSetCommentStart ( ) { } public void testGetSetEncapsulator ( ) { } public void testGetSetDelimiter ( ) { } public void testSetCSVStrategy ( ) { } public void testSetExcelStrategy ( ) { CSVStrategy strategy = CSVStrategy . EXCEL_STRATEGY ; <START_BUG> assertEquals ( strategy . getDelimiter ( ) , ';' ) ; <END_BUG> assertEquals ( strategy . getEncapsulator ( ) , '"' ) ; assertEquals ( strategy . getCommentStart ( ) , '' ) ; assertEquals ( false , strategy . getIgnoreLeadingWhitespaces ( ) ) ; assertEquals ( false , strategy . getUnicodeEscapeInterpretation ( ) ) ; assertEquals ( false , strategy . getIgnoreEmptyLines ( ) ) ; } }

Fix:
assertEquals ( strategy . getDelimiter ( ) , ',' ) ;
Buggy code:
final class PreferenceRegistry extends AbstractMutableRegistry { private static final String KEY = Persistence . PACKAGE_FULL ; private static final String TAG_ROOT = Persistence . PACKAGE_FULL ; private IPreferenceStore preferenceStore ; PreferenceRegistry ( IPreferenceStore preferenceStore ) { } public void load ( ) throws IOException { String preferenceString = preferenceStore . getString ( PreferenceRegistry . KEY ) ; if ( ( preferenceString != null ) && ( ( preferenceString . length ( ) ) != 0 ) ) { Reader reader = new StringReader ( preferenceString ) ; try { IMemento memento = XMLMemento . createReadRoot ( reader ) ; activeKeyConfigurations = Collections . unmodifiableList ( Persistence . readActiveKeyConfigurations ( memento , TAG_ACTIVE_KEY_CONFIGURATION , null ) ) ; categories = Collections . unmodifiableList ( Persistence . readCategories ( memento , TAG_CATEGORY , null ) ) ; commands = Collections . unmodifiableList ( Persistence . readCommands ( memento , TAG_COMMAND , null ) ) ; contextBindings = Collections . unmodifiableList ( Persistence . readContextBindings ( memento , TAG_CONTEXT_BINDING , null ) ) ; imageBindings = Collections . unmodifiableList ( Persistence . readImageBindings ( memento , TAG_IMAGE_BINDING , null ) ) ; <START_BUG> keyBindings = Collections . unmodifiableList ( Persistence . readKeyBindings ( memento , TAG_KEY_BINDING , null ) ) ; <END_BUG> keyConfigurations = Collections . unmodifiableList ( Persistence . readKeyConfigurations ( memento , TAG_KEY_CONFIGURATION , null ) ) ; } catch ( WorkbenchException eWorkbench ) { throw new IOException ( ) ; } finally { reader . close ( ) ; } } } public void save ( ) throws IOException { } }

Fix:
keyBindings = Collections . unmodifiableList ( Persistence . readKeyBindings ( memento , TAG_KEY_BINDING , null , 0 ) ) ;
Buggy code:
public class DependTest extends BuildFileTest { public static final String RESULT_FILESET = "result" ; public static final String TEST_BUILD_FILE = "src//etc//testcases//taskdefs//optional//depend//depend.xml" ; public DependTest ( String name ) { } public void setUp ( ) { } public void tearDown ( ) { } public void testDirect ( ) { } public void testClosure ( ) { } public void testInner ( ) { } public void testInnerInner ( ) { } public void testNoSource ( ) { } public void testEmptySource ( ) { } private Hashtable getResultFiles ( ) { } public void testInnerClosure ( ) { Project project = getProject ( ) ; executeTarget ( "testinnerclosure" ) ; <START_BUG> assertEquals ( "Depend<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>leave<seq2seq4repair_space>correct<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>files" , 2 , getResultFiles ( ) . size ( ) ) ; <END_BUG> } public void testCache ( ) { } public void testNonPublic ( ) { } }

Fix:
assertEquals ( "Depend<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>leave<seq2seq4repair_space>correct<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>files" , 4 , getResultFiles ( ) . size ( ) ) ;
Buggy code:
public class DrawLocus extends Drawable { private GeoLocus locus ; boolean isVisible ; boolean labelVisible ; private GeneralPathClipped gp ; private double [ ] lastPointCoords ; public DrawLocus ( EuclidianView view , GeoLocus locus ) { } @ Override public final void update ( ) { } final void drawTrace ( Graphics2D g2 ) { } private void buildGeneralPath ( ArrayList < MyPoint > pointList ) { } @ Override public final void draw ( Graphics2D g2 ) { if ( isVisible ) { if ( geo . doHighlighting ( ) ) { g2 . setPaint ( geo . getSelColor ( ) ) ; g2 . setStroke ( selStroke ) ; EuclidianStatic . drawWithValueStrokePure ( gp , g2 ) ; } g2 . setPaint ( geo . getObjectColor ( ) ) ; g2 . setStroke ( objStroke ) ; EuclidianStatic . drawWithValueStrokePure ( gp , g2 ) ; if ( ( geo . isFillable ( ) ) && ( ( ( geo . getAlphaValue ( ) ) > 0 ) || ( geo . isHatchingEnabled ( ) ) ) ) { try { <START_BUG> fill ( g2 , ( ( Shape ) ( geo . isInverseFill ( ) ? geogebra . awt . Area . getAWTArea ( getShape ( ) ) : gp ) ) , false ) ; <END_BUG> } catch ( Exception e ) { System . err . println ( e . getMessage ( ) ) ; } } if ( labelVisible ) { g2 . setFont ( view . getFontLine ( ) ) ; g2 . setColor ( geo . getLabelColor ( ) ) ; drawLabel ( g2 ) ; } } } @ Override public final boolean hit ( int x , int y ) { } @ Override public final boolean isInside ( Rectangle rect ) { } @ Override public final GeoElement getGeoElement ( ) { } @ Override public final void setGeoElement ( GeoElement geo ) { } @ Override public final java . awt . Rectangle getBounds ( ) { } }

Fix:
fill ( g2 , new geogebra . awt . GenericShape ( ( geo . isInverseFill ( ) ? geogebra . awt . Area . getAWTArea ( getShape ( ) ) : gp ) ) , false ) ;
Buggy code:
public class StormWordCountLocal { public static final String topologyId = "Streaming<seq2seq4repair_space>WordCount" ; public static void main ( final String [ ] args ) throws Exception { if ( ! ( WordCountTopology . parseParameters ( args ) ) ) { return ; } final FlinkTopologyBuilder builder = WordCountTopology . buildTopology ( ) ; final FlinkLocalCluster cluster = FlinkLocalCluster . getLocalCluster ( ) ; cluster . submitTopology ( StormWordCountLocal . topologyId , null , builder . createTopology ( ) ) ; <START_BUG> Utils . sleep ( ( 5 * 1000 ) ) ; <END_BUG> cluster . killTopology ( StormWordCountLocal . topologyId ) ; cluster . shutdown ( ) ; } }

Fix:
Utils . sleep ( ( 10 * 1000 ) ) ;
Buggy code:
public class ResourceUrlMapperTests { ResourceHttpRequestHandler handler ; SimpleUrlHandlerMapping mapping ; ResourceUrlMapper mapper ; @ Before public void setUp ( ) { } private void resetMapper ( ) { } @ Test public void getStaticResourceUrl ( ) { } @ Test public void getFingerprintedResourceUrl ( ) { } @ Test public void getExtensionMappedResourceUrl ( ) { List < ResourceResolver > resolvers = new ArrayList < ResourceResolver > ( ) ; <START_BUG> resolvers . add ( new ExtensionMappingResourceResolver ( ) ) ; <END_BUG> resolvers . add ( new PathResourceResolver ( ) ) ; handler . setResourceResolvers ( resolvers ) ; resetMapper ( ) ; String url = mapper . getUrlForResource ( "//resources//zoo.css" ) ; assertEquals ( "//resources//zoo.css" , url ) ; } }

Fix:
resolvers . add ( new PathExtensionResourceResolver ( ) ) ;
Buggy code:
public class LoadBalancingService implements Runnable { private static final int DEFAULT_WORKER_POOL_SIZE = 25 ; private static final int DEFAULT_BACKLOG_SIZE = 10 ; private static final int DEFAULT_PORT = 80 ; private final ConnectionConfiguration serviceConfig_ ; private AtomicBoolean running_ = new AtomicBoolean ( false ) ; private ServerSocketChannel serverSocket_ ; private ConnectionProtocol protocol_ ; private Thread service_ ; private ExecutorService workers_ ; public LoadBalancingService ( int port , ConnectionProtocol protocol ) throws IOException { } public LoadBalancingService ( ConnectionConfiguration config , ConnectionProtocol protocol ) { } public void start ( ) { } public void stop ( ) { } public boolean isRunning ( ) { } @ Override public void run ( ) { } @ Override protected void finalize ( ) throws Throwable { } public static void main ( String [ ] args ) { <START_BUG> Debug . println ( "MAIN" , "Init..." ) ; <END_BUG> ResourcePool resources = new ResourcePool ( ) ; resources . register ( new ResourcePlugin ( "10.10.10.2" , 80 , "WebServer_1" ) ) ; resources . register ( new ResourcePlugin ( "10.10.10.3" , 80 , "Webserver_2" ) ) ; LoadBalancingAlgorithm LBA = new LoadBalancingAlgorithm ( resources ) ; try { LoadBalancingService svc = new LoadBalancingService ( 80 , LBA ) ; Debug . println ( "MAIN" , "Start<seq2seq4repair_space>balancing..." ) ; svc . start ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } Debug . println ( "MAIN" , "Stop<seq2seq4repair_space>balancing." ) ; } }

Fix:
Debug . println ( "MAIN<seq2seq4repair_space>2" , "Init..." ) ;
Buggy code:
public class DatabaseManager { private SQLiteDatabase database ; private MySQLiteHelper dbHelper ; private String [ ] allColumns = new String [ ] { MySQLiteHelper . COLUMN_ID , MySQLiteHelper . COLUMN_RATING } ; public DatabaseManager ( Context context ) { } public void open ( ) throws SQLException { } public void close ( ) { } public String createRating ( int id , int rating ) { ContentValues values = new ContentValues ( ) ; values . put ( COLUMN_RATING , rating ) ; database . execSQL ( ( ( ( ( "INSERT<seq2seq4repair_space>OR<seq2seq4repair_space>replace<seq2seq4repair_space>INTO<seq2seq4repair_space>RATINGS<seq2seq4repair_space>(_id,<seq2seq4repair_space>rating)<seq2seq4repair_space>values(" + id ) + ",<seq2seq4repair_space>" ) + rating ) + ")" ) ) ; <START_BUG> return ( ( "insert<seq2seq4repair_space>or<seq2seq4repair_space>update<seq2seq4repair_space>" + id ) + "<seq2seq4repair_space>" ) + rating ; <END_BUG> } public String createState ( int id , String sorting ) { } public Pair < Integer , String > getState ( ) { } public int getRating ( int id ) { } public List < Integer > getIdsWithRatingASC ( ) { } public int getOverallKnowledge ( int size ) { } private int cursorToRating ( Cursor cursor ) { } private int cursorToId ( Cursor cursor ) { } }

Fix:
return ( ( ( ( "insert<seq2seq4repair_space>or<seq2seq4repair_space>update<seq2seq4repair_space>" + id ) + "<seq2seq4repair_space>" ) + rating ) + "getRate()<seq2seq4repair_space>" ) + ( getRating ( id ) ) ;
Buggy code:
class NykthosDynamicManaEffect extends ManaEffect { private final Mana computedMana ; public NykthosDynamicManaEffect ( ) { } public NykthosDynamicManaEffect ( final NykthosDynamicManaEffect effect ) { } @ Override public NykthosDynamicManaEffect copy ( ) { } @ Override public boolean apply ( Game game , Ability source ) { } @ Override public Mana getMana ( Game game , Ability source ) { } public Mana computeMana ( String color , Game game , Ability source ) { this . computedMana . clear ( ) ; if ( ( color != null ) && ( ! ( color . isEmpty ( ) ) ) ) { switch ( color ) { case "Red" : computedMana . setRed ( new mage . abilities . dynamicvalue . common . DevotionCount ( ColoredManaSymbol . R ) . calculate ( game , source , this ) ) ; break ; case "Blue" : computedMana . setBlue ( new mage . abilities . dynamicvalue . common . DevotionCount ( ColoredManaSymbol . U ) . calculate ( game , source , this ) ) ; break ; case "White" : computedMana . setWhite ( new mage . abilities . dynamicvalue . common . DevotionCount ( ColoredManaSymbol . W ) . calculate ( game , source , this ) ) ; break ; case "Black" : computedMana . setBlack ( new mage . abilities . dynamicvalue . common . DevotionCount ( ColoredManaSymbol . B ) . calculate ( game , source , this ) ) ; break ; case "Green" : computedMana . setGreen ( new mage . abilities . dynamicvalue . common . DevotionCount ( ColoredManaSymbol . G ) . calculate ( game , source , this ) ) ; break ; } } <START_BUG> return computedMana ; <END_BUG> } }

Fix:
return computedMana . copy ( ) ;
Buggy code:
public class MainActivity extends Activity { Button button0 ; Button button1 ; Button button2 ; Button button3 ; Button button4 ; Button button5 ; Button button6 ; Button button7 ; Button button8 ; Button button9 ; Button buttonClear ; Button buttonBackspace ; Button buttonDivide ; Button buttonMultiply ; Button buttonSubtract ; Button buttonAdd ; Button buttonDecimalPoint ; Button buttonEquals ; TextView textView1 ; String operator ; Float temp1 ; Float temp2 ; Float temp4 ; Float result ; Float floatNull ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void onClickListenerNum ( View v ) { } public void onClickListenerDelete ( View v ) { switch ( v . getId ( ) ) { case id . buttonBackspace : String temp3 = textView1 . getText ( ) . toString ( ) ; <START_BUG> if ( ( temp3 . length ( ) ) == 0 ) { <END_BUG> textView1 . setText ( temp3 . substring ( 0 , ( ( temp3 . length ( ) ) - 1 ) ) ) ; } break ; case id . buttonClear : textView1 . setText ( "" ) ; temp1 = floatNull ; temp2 = floatNull ; break ; } } public void onClickListenerOperator ( View v ) { } public void onClickEquals ( View v ) { } No newline ; at end ; of file ; }

Fix:
if ( ( temp3 . length ( ) ) != 0 ) {
Buggy code:
public class CupolaBlock extends SteamNSteelMachineBlock implements ITileEntityProvider { public static final String NAME = "cupola" ; public CupolaBlock ( ) { } private static void renderSmokeOnTop ( World world , int x , int y , int z , Random rng ) { } @ Override public TileEntity createNewTileEntity ( World world , int metadata ) { } @ Override public int getLightValue ( IBlockAccess world , int x , int y , int z ) { TileEntity te = world . getTileEntity ( x , y , z ) ; if ( ( ( mod . steamnsteel . tileentity . CupolaTE ) ( te ) ) . isSlave ( ) ) { te = world . getTileEntity ( x , ( y - 1 ) , z ) ; } <START_BUG> if ( ( ( mod . steamnsteel . tileentity . CupolaTE ) ( te ) ) . isActive ( ) ) <END_BUG> return 15 ; return super . getLightValue ( world , x , y , z ) ; } @ Override public boolean canPlaceBlockAt ( World world , int x , int y , int z ) { } @ Override public boolean onBlockActivated ( World world , int x , int y , int z , EntityPlayer player , int side , float xOffset , float yOffset , float zOffset ) { } @ Override public void onNeighborBlockChange ( World world , int x , int y , int z , Block block ) { } @ Override public Item getItemDropped ( int metadata , Random rng , int fortune ) { } @ Override public void onPostBlockPlaced ( World world , int x , int y , int z , int metadata ) { } @ SideOnly ( Side . CLIENT ) @ Override public void randomDisplayTick ( World world , int x , int y , int z , Random rng ) { } @ Override public boolean removedByPlayer ( World world , EntityPlayer player , int x , int y , int z , boolean willHarvest ) { } }

Fix:
if ( ( te != null ) && ( ( ( mod . steamnsteel . tileentity . CupolaTE ) ( te ) ) . isActive ( ) ) )
Buggy code:
public class SwitchStatement extends Statement { public Expression testExpression ; public Statement [ ] statements ; public BlockScope scope ; public int explicitDeclarations ; public Label breakLabel ; public CaseStatement [ ] cases ; public CaseStatement defaultCase ; public int caseCount = 0 ; int preSwitchInitStateIndex = - 1 ; int mergedInitStateIndex = - 1 ; public SwitchStatement ( ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { flowInfo = testExpression . analyseCode ( currentScope , flowContext , flowInfo ) ; SwitchFlowContext switchContext = new SwitchFlowContext ( flowContext , this , ( breakLabel = new Label ( ) ) ) ; FlowInfo caseInits = FlowInfo . DEAD_END ; preSwitchInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( flowInfo ) ; int caseIndex = 0 ; if ( ( statements ) != null ) { boolean didAlreadyComplain = false ; for ( int i = 0 , max = statements . length ; i < max ; i ++ ) { Statement statement = statements [ i ] ; if ( ( caseIndex < ( caseCount ) ) && ( statement == ( cases [ caseIndex ] ) ) ) { caseIndex ++ ; caseInits = caseInits . mergedWith ( flowInfo . copy ( ) . unconditionalInits ( ) ) ; didAlreadyComplain = false ; } else if ( statement == ( defaultCase ) ) { caseInits = caseInits . mergedWith ( flowInfo . copy ( ) . unconditionalInits ( ) ) ; didAlreadyComplain = false ; } <START_BUG> if ( ! ( caseInits . complainIfUnreachable ( statement , scope , didAlreadyComplain ) ) ) { <END_BUG> caseInits = statement . analyseCode ( scope , switchContext , caseInits ) ; } else { didAlreadyComplain = true ; } } } if ( ( defaultCase ) == null ) { flowInfo . addPotentialInitializationsFrom ( caseInits . mergedWith ( switchContext . initsOnBreak ) ) ; mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( flowInfo ) ; return flowInfo ; } FlowInfo mergedInfo = caseInits . mergedWith ( switchContext . initsOnBreak ) ; mergedInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( mergedInfo ) ; return mergedInfo ; } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public void resetStateForCodeGeneration ( ) { } public void resolve ( BlockScope upperScope ) { } public String toString ( int tab ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } public void branchChainTo ( Label label ) { } }

Fix:
if ( ! ( statement . complainIfUnreachable ( caseInits , scope , didAlreadyComplain ) ) ) {
Buggy code:
@ Component @ PerRequest @ Scope ( "prototype" ) @ Path ( "alarms" ) public class AlarmRestService extends AlarmRestServiceBase { @ Autowired private AlarmDao m_alarmDao ; @ Autowired private AcknowledgmentDao m_ackDao ; @ Context UriInfo m_uriInfo ; @ Context SecurityContext m_securityContext ; @ GET @ Produces ( { MediaType . APPLICATION_XML , MediaType . APPLICATION_JSON , MediaType . APPLICATION_ATOM_XML } ) @ Path ( "{alarmId}" ) @ Transactional public OnmsAlarm getAlarm ( @ PathParam ( "alarmId" ) final String alarmId ) { } @ GET @ Produces ( MediaType . TEXT_PLAIN ) @ Path ( "count" ) @ Transactional public String getCount ( ) { } @ GET @ Produces ( { MediaType . APPLICATION_XML , MediaType . APPLICATION_JSON , MediaType . APPLICATION_ATOM_XML } ) @ Transactional public OnmsAlarmCollection getAlarms ( ) { readLock ( ) ; try { final CriteriaBuilder builder = getCriteriaBuilder ( m_uriInfo . getQueryParameters ( ) , false ) ; builder . distinct ( ) ; final OnmsAlarmCollection coll = new OnmsAlarmCollection ( m_alarmDao . findMatching ( builder . toCriteria ( ) ) ) ; <START_BUG> coll . setTotalCount ( m_alarmDao . countMatching ( builder . clearOrder ( ) . limit ( 0 ) . offset ( 0 ) . toCriteria ( ) ) ) ; <END_BUG> return coll ; } finally { readUnlock ( ) ; } } @ PUT @ Path ( "{alarmId}" ) @ Consumes ( MediaType . APPLICATION_FORM_URLENCODED ) @ Transactional public Response updateAlarm ( @ PathParam ( "alarmId" ) final Integer alarmId , final MultivaluedMapImpl formProperties ) { } @ PUT @ Transactional @ Consumes ( MediaType . APPLICATION_FORM_URLENCODED ) public Response updateAlarms ( final MultivaluedMapImpl formProperties ) { } private void assertUserCredentials ( final String ackUser ) { } }

Fix:
coll . setTotalCount ( m_alarmDao . countMatching ( builder . count ( ) . toCriteria ( ) ) ) ;
Buggy code:
public class Befit { static final Logger log = Logger . getLogger ( Befit . class ) ; private int TD ; private WebDriver driver ; private String [ ] WORKOUT ; private String LOGIN ; protected String PASSWORD ; public Befit ( ) throws Exception { } public void signToWorkout ( ) throws Exception { loginAndOpenCalendarPageInListView ( ) ; clickNextTabAfterTuesday ( ) ; <START_BUG> getWorkoutContainsData ( WORKOUT , 3 ) . click ( ) ; <END_BUG> if ( isWorkoutStatusFree ( getMessageFromEventContent ( ) ) ) { submitWorkout ( ) ; } else { Befit . log . info ( ( "Status:<seq2seq4repair_space>" + ( getMessageFromEventContent ( ) ) ) ) ; } } public void tearDown ( ) throws Exception { } public boolean isWorkoutStatusFree ( String message ) { } private void clickNextTabAfterTuesday ( ) throws NoSuchElementException { } private void loginAndOpenCalendarPageInListView ( ) throws NoSuchElementException { } private void submitWorkout ( ) throws NoSuchElementException { } private String getMessageFromEventContent ( ) throws Exception { } public WebElement getWorkoutContainsData ( String [ ] dataWorkout , int td ) throws ArrayIndexOutOfBoundsException { } }

Fix:
getWorkoutContainsData ( WORKOUT , TD ) . click ( ) ;
Buggy code:
public class LDAPAuthentication { public static int SUCCESS = 0 ; public static int ERROR = 1 ; public static int INVALID_CREDENTIALS = 2 ; private BindResult bindResult = null ; private int status ; private static Logger logger = LoggerFactory . getLogger ( LDAPAuthentication . class ) ; static SettingsManager sm ; @ Context static ServletContext context ; static String ldapURI ; static String defaultLdapDomain ; private String shortUsername ; private String longUsername ; database db ; protected Connection conn ; public static String showShortUserName ( String username ) { } public static String showLongUsername ( String username ) { } public LDAPAuthentication ( ) { } public Integer getLoginAttempts ( String username ) { PreparedStatement stmt = null ; ResultSet rs = null ; Integer ldapTimeout = Integer . parseInt ( LDAPAuthentication . sm . retrieveValue ( "ldapLockedAccountTimeout" ) ) ; try { <START_BUG> String selectString = ( ( "SELECT<seq2seq4repair_space>current_timestamp()<seq2seq4repair_space>as<seq2seq4repair_space>current,<seq2seq4repair_space>attempts,<seq2seq4repair_space>ts<seq2seq4repair_space>FROM<seq2seq4repair_space>ldapNonces<seq2seq4repair_space>WHERE<seq2seq4repair_space>username<seq2seq4repair_space>=<seq2seq4repair_space>" + "?<seq2seq4repair_space>&&<seq2seq4repair_space>ts<seq2seq4repair_space>><seq2seq4repair_space>(NOW()<seq2seq4repair_space>-<seq2seq4repair_space>INTERVAL<seq2seq4repair_space>" ) + ldapTimeout ) + "<seq2seq4repair_space>MINUTE" ; <END_BUG> stmt = conn . prepareStatement ( selectString ) ; stmt . setString ( 1 , LDAPAuthentication . showLongUsername ( username ) ) ; rs = stmt . executeQuery ( ) ; if ( rs . next ( ) ) { Timestamp ts = rs . getTimestamp ( "ts" ) ; Timestamp currentTs = rs . getTimestamp ( "current" ) ; Timestamp expiredTs = new Timestamp ( ( ( currentTs . getTime ( ) ) - ( ( ldapTimeout * 60 ) * 100 ) ) ) ; if ( ( ts != null ) && ( ts . after ( expiredTs ) ) ) { return rs . getInt ( "attempts" ) ; } } } catch ( SQLException e ) { LDAPAuthentication . logger . warn ( null , e ) ; } finally { db . close ( stmt , rs ) ; } return 0 ; } private void deleteExpiredNonces ( ) { } private void updateNonce ( ) { } public LDAPAuthentication ( String username , String password , Boolean recognizeDemo ) { } public int getStatus ( ) { } public static void main ( String [ ] args ) throws Exception { } }

Fix:
String selectString = ( ( "SELECT<seq2seq4repair_space>current_timestamp()<seq2seq4repair_space>as<seq2seq4repair_space>current,<seq2seq4repair_space>attempts,<seq2seq4repair_space>ts<seq2seq4repair_space>FROM<seq2seq4repair_space>ldapNonces<seq2seq4repair_space>WHERE<seq2seq4repair_space>username<seq2seq4repair_space>=<seq2seq4repair_space>" + "?<seq2seq4repair_space>&&<seq2seq4repair_space>ts<seq2seq4repair_space>><seq2seq4repair_space>(NOW()<seq2seq4repair_space>-<seq2seq4repair_space>INTERVAL<seq2seq4repair_space>" ) + ldapTimeout ) + "<seq2seq4repair_space>MINUTE)" ;