nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Zone extends NameSet { public static final int PRIMARY = 1 ; public static final int SECONDARY = 2 ; private int type ; private Name origin ; private short dclass = DClass . IN ; public Zone ( String file , Cache cache ) throws IOException { } public Name getOrigin ( ) { } public RRset getNS ( ) { } public SOARecord getSOA ( ) { } public short getDClass ( ) { } public SetResponse findRecords ( Name name , short type ) { SetResponse zr = null ; if ( ( findName ( name ) ) == null ) { if ( name . isWild ( ) ) return new SetResponse ( SetResponse . NXDOMAIN ) ; else <START_BUG> return findRecords ( name . wild ( ) , type ) ; <END_BUG> } Object [ ] objects = findSets ( name , type , dclass ) ; if ( objects == null ) return new SetResponse ( SetResponse . NODATA ) ; RRset [ ] rrsets = new RRset [ objects . length ] ; System . arraycopy ( objects , 0 , rrsets , 0 , objects . length ) ; for ( int i = 0 ; i < ( rrsets . length ) ; i ++ ) { RRset rrset = rrsets [ i ] ; if ( ( ( type != ( Type . CNAME ) ) && ( type != ( Type . ANY ) ) ) && ( ( rrset . getType ( ) ) == ( Type . CNAME ) ) ) { CNAMERecord cname = ( ( CNAMERecord ) ( rrset . first ( ) ) ) ; zr = findRecords ( cname . getTarget ( ) , type ) ; if ( zr . isNODATA ( ) ) zr . set ( PARTIAL , cname ) ; else if ( ( zr . isNXDOMAIN ( ) ) && ( ! ( cname . getTarget ( ) . subdomain ( origin ) ) ) ) zr . set ( PARTIAL , cname ) ; zr . addCNAME ( cname ) ; return zr ; } if ( zr == null ) zr = new SetResponse ( SetResponse . SUCCESSFUL ) ; zr . addRRset ( rrset ) ; } return zr ; } public RRset findExactMatch ( Name name , short type ) { } public void addRecord ( Record r ) { } }

Fix:
return findRecords ( name . wild ( 1 ) , type ) ;
Buggy code:
public class SpecifiedInterfaceResolveHandler implements OperationStepHandler , DescriptionProvider { static final AttributeDefinition [ ] ATTRIBUTES = InterfaceDescription . ROOT_ATTRIBUTES ; public static final String OPERATION_NAME = "resolve-internet-address" ; public static final SpecifiedInterfaceResolveHandler INSTANCE = new SpecifiedInterfaceResolveHandler ( ) ; private SpecifiedInterfaceResolveHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ModelNode config = new ModelNode ( ) ; for ( final AttributeDefinition definition : SpecifiedInterfaceResolveHandler . ATTRIBUTES ) { validateAndSet ( definition , operation , config ) ; } <START_BUG> ParsedInterfaceCriteria parsed = ParsedInterfaceCriteria . parse ( config , true ) ; <END_BUG> if ( ( parsed . getFailureMessage ( ) ) != null ) { throw new OperationFailedException ( new ModelNode ( ) . set ( parsed . getFailureMessage ( ) ) ) ; } try { NetworkInterfaceBinding nib = NetworkInterfaceService . createBinding ( parsed ) ; context . getResult ( ) . set ( nib . getAddress ( ) . getHostAddress ( ) ) ; } catch ( SocketException e ) { throw MESSAGES . cannotResolveInterface ( e , e ) ; } catch ( UnknownHostException e ) { throw MESSAGES . cannotResolveInterface ( e , e ) ; } context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; } private void validateAndSet ( final AttributeDefinition definition , final ModelNode operation , final ModelNode subModel ) throws OperationFailedException { } @ Override public ModelNode getModelDescription ( Locale locale ) { } }

Fix:
ParsedInterfaceCriteria parsed = ParsedInterfaceCriteria . parse ( config , true , context ) ;
Buggy code:
public final class TargetResource { private final PathAddress address ; private final ImmutableManagementResourceRegistration resourceRegistration ; private final Resource resource ; private final ServerGroupEffect serverGroupEffect ; private final HostEffect hostEffect ; private final List < AccessConstraintDefinition > accessConstraintDefinitions ; public static TargetResource forStandalone ( PathAddress address , ImmutableManagementResourceRegistration resourceRegistration , Resource resource ) { } public static TargetResource forDomain ( PathAddress address , ImmutableManagementResourceRegistration resourceRegistration , Resource resource , ServerGroupEffect serverGroupEffect , HostEffect hostEffect ) { } private TargetResource ( PathAddress address , ImmutableManagementResourceRegistration resourceRegistration , Resource resource , ServerGroupEffect serverGroupEffect , HostEffect hostEffect ) { } public PathAddress getResourceAddress ( ) { } public ServerGroupEffect getServerGroupEffect ( ) { } public HostEffect getHostEffect ( ) { } public List < AccessConstraintDefinition > getAccessConstraints ( ) { <START_BUG> return resourceRegistration . getAccessConstraints ( ) ; <END_BUG> } public Resource getResource ( ) { } public ImmutableManagementResourceRegistration getResourceRegistration ( ) { } }

Fix:
return accessConstraintDefinitions ;
Buggy code:
public class AutoWebApp extends BaseInterceptor { int debug = 0 ; Hashtable hosts = new Hashtable ( ) ; String appsD = "webapps" ; String defaultHost = null ; boolean flat = true ; boolean ignoreDot = true ; String profile = null ; boolean trusted = false ; String prefix = "" ; char hostSeparator = '@' ; char dotReplacement = '_' ; char slashReplacement = '_' ; public AutoWebApp ( ) { } public void setDir ( String d ) { } public void setPrefix ( String s ) { } public void setHost ( String h ) { } public void setIngoreDot ( boolean b ) { } public void setFlat ( boolean b ) { } public void setProfile ( String s ) { } public void setTrusted ( boolean b ) { } public void engineInit ( ContextManager cm ) throws TomcatException { } private void addWebApp ( ContextManager cm , File dir , String host , String name ) throws TomcatException { host = unEscapeHost ( host ) ; if ( host == null ) host = "DEFAULT" ; String path = "//" + ( unEscapePath ( name ) ) ; if ( path . equals ( "//ROOT" ) ) path = "" ; Hashtable loaded = ( ( Hashtable ) ( hosts . get ( host ) ) ) ; if ( ( loaded != null ) && ( ( loaded . get ( path ) ) != null ) ) { log ( ( ( ( "Loaded<seq2seq4repair_space>from<seq2seq4repair_space>config:<seq2seq4repair_space>" + host ) + ":" ) + ( "" . equals ( path ) ? "//" : path ) ) ) ; return ; } log ( ( ( ( "Auto-Adding<seq2seq4repair_space>" + host ) + ":" ) + ( "" . equals ( path ) ? "//" : path ) ) ) ; if ( dir . isDirectory ( ) ) { <START_BUG> Context ctx = new Context ( ) ; <END_BUG> ctx . setContextManager ( cm ) ; ctx . setPath ( ( ( prefix ) + path ) ) ; if ( ! ( "DEFAULT" . equals ( host ) ) ) ctx . setHost ( host ) ; try { ctx . setDocBase ( dir . getCanonicalPath ( ) ) ; } catch ( IOException ex ) { ctx . setDocBase ( dir . getAbsolutePath ( ) ) ; } if ( trusted ) ctx . setTrusted ( true ) ; if ( ( profile ) != null ) ctx . setProperty ( "profile" , profile ) ; if ( ( debug ) > 0 ) log ( ( ( ( ( ( "automatic<seq2seq4repair_space>add<seq2seq4repair_space>" + host ) + ":" ) + ( ctx . toString ( ) ) ) + "<seq2seq4repair_space>" ) + path ) ) ; cm . addContext ( ctx ) ; } else { log ( ( "Not<seq2seq4repair_space>a<seq2seq4repair_space>dir<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ) ) ; } } private void addVHost ( ContextManager cm , File dir , String host ) throws TomcatException { } private String unEscapeHost ( String hostName ) { } private String unEscapePath ( String pathDir ) { } private String unEscapeString ( String s , char esc , char repl ) { } }

Fix:
Context ctx = cm . createContext ( ) ;
Buggy code:
final class DeploymentModelBuilderJAXRPC_JSE extends AbstractDeploymentModelBuilder { DeploymentModelBuilderJAXRPC_JSE ( ) { } @ Override protected void build ( final Deployment dep , final DeploymentUnit unit ) { final JBossWebMetaData webMetaData = ASHelper . getJBossWebMetaData ( unit ) ; if ( webMetaData != null ) { dep . addAttachment ( JBossWebMetaData . class , webMetaData ) ; } final WebservicesMetaData wsMetaData = ASHelper . getOptionalAttachment ( unit , WEBSERVICES_METADATA_KEY ) ; if ( wsMetaData != null ) { dep . addAttachment ( WebservicesMetaData . class , wsMetaData ) ; } this . log . debug ( "Creating<seq2seq4repair_space>JAXRPC<seq2seq4repair_space>JSE<seq2seq4repair_space>endpoints<seq2seq4repair_space>meta<seq2seq4repair_space>data<seq2seq4repair_space>model" ) ; for ( WebserviceDescriptionMetaData wsd : wsMetaData . getWebserviceDescriptions ( ) ) { for ( PortComponentMetaData pcmd : wsd . getPortComponents ( ) ) { final String servletName = pcmd . getServletLink ( ) ; this . log . debug ( ( "JSE<seq2seq4repair_space>name:<seq2seq4repair_space>" + servletName ) ) ; final ServletMetaData servletMD = ASHelper . getServletForName ( webMetaData , servletName ) ; <START_BUG> final String servletClass = ASHelper . getEndpointName ( servletMD ) ; <END_BUG> this . log . debug ( ( "JSE<seq2seq4repair_space>class:<seq2seq4repair_space>" + servletClass ) ) ; this . newHttpEndpoint ( servletClass , servletName , dep ) ; } } } }

Fix:
final String servletClass = ASHelper . getEndpointClassName ( servletMD ) ;
Buggy code:
public class RecoveredMethod extends RecoveredElement implements BaseTypes , CompilerModifiers , TerminalTokens { public AbstractMethodDeclaration methodDeclaration ; public RecoveredType [ ] localTypes ; public int localTypeCount ; public RecoveredBlock methodBody ; public boolean discardBody = true ; public RecoveredMethod ( AbstractMethodDeclaration methodDeclaration , RecoveredElement parent , int bracketBalance , Parser parser ) { } public RecoveredElement add ( Block nestedBlockDeclaration , int bracketBalanceValue ) { } public RecoveredElement add ( FieldDeclaration fieldDeclaration , int bracketBalanceValue ) { } public RecoveredElement add ( LocalDeclaration localDeclaration , int bracketBalanceValue ) { } public RecoveredElement add ( Statement statement , int bracketBalanceValue ) { } public RecoveredElement add ( TypeDeclaration typeDeclaration , int bracketBalanceValue ) { if ( ( ( methodDeclaration . declarationSourceEnd ) != 0 ) && ( ( typeDeclaration . declarationSourceStart ) > ( methodDeclaration . declarationSourceEnd ) ) ) { if ( ( this . parent ) == null ) { return this ; } return this . parent . add ( typeDeclaration , bracketBalanceValue ) ; } if ( ( ( typeDeclaration . bits ) & ( IsLocalTypeMASK ) ) != 0 ) { if ( ( methodBody ) == null ) { Block block = new Block ( 0 ) ; block . sourceStart = methodDeclaration . bodyStart ; this . add ( block , 1 ) ; } return methodBody . add ( typeDeclaration , bracketBalanceValue , true ) ; } <START_BUG> if ( ( typeDeclaration . getKind ( ) ) == ( INTERFACE ) ) { <END_BUG> this . updateSourceEndIfNecessary ( this . previousAvailableLineEnd ( ( ( typeDeclaration . declarationSourceStart ) - 1 ) ) ) ; if ( ( this . parent ) == null ) { return this ; } return this . parent . add ( typeDeclaration , bracketBalanceValue ) ; } if ( ( localTypes ) == null ) { localTypes = new RecoveredType [ 5 ] ; localTypeCount = 0 ; } else { if ( ( localTypeCount ) == ( localTypes . length ) ) { System . arraycopy ( localTypes , 0 , ( localTypes = new RecoveredType [ 2 * ( localTypeCount ) ] ) , 0 , localTypeCount ) ; } } RecoveredType element = new RecoveredType ( typeDeclaration , this , bracketBalanceValue ) ; localTypes [ ( ( localTypeCount ) ++ ) ] = element ; if ( ! ( foundOpeningBrace ) ) { foundOpeningBrace = true ; ( this . bracketBalance ) ++ ; } return element ; } public boolean bodyStartsAtHeaderEnd ( ) { } public ASTNode parseTree ( ) { } public int sourceEnd ( ) { } public String toString ( int tab ) { } public void updateBodyStart ( int bodyStart ) { } public AbstractMethodDeclaration updatedMethodDeclaration ( ) { } public void updateFromParserState ( ) { } public RecoveredElement updateOnOpeningBrace ( int braceStart , int braceEnd ) { } public void updateParseTree ( ) { } public void updateSourceEndIfNecessary ( int braceStart , int braceEnd ) { } }

Fix:
if ( ( typeDeclaration . kind ( ) ) == ( INTERFACE ) ) {
Buggy code:
public class EditUserDialog extends TitleAreaDialog { private CmrRepositoryDefinition cmrRepositoryDefinition ; private Text mailBox ; private Text passwordBox ; private boolean isLocked ; private Button editButton ; private Button deleteUserButton ; private Combo roles ; private List < Role > rolesList ; private User userOld ; private static final int EDIT_ID = 0 ; private static final int DELETE_USER_ID = 2 ; public EditUserDialog ( Shell parentShell , CmrRepositoryDefinition cmrRepositoryDefinition , User user ) { } @ Override public void create ( ) { } @ Override protected Control createDialogArea ( Composite parent ) { } @ Override protected void createButtonsForButtonBar ( Composite parent ) { } @ Override protected void buttonPressed ( int buttonId ) { } private void editPressed ( ) { long id = 0 ; boolean passwordChanged = true ; int index = roles . getSelectionIndex ( ) ; String mail = mailBox . getText ( ) ; String password = passwordBox . getText ( ) ; String role = roles . getItem ( index ) ; for ( Role r : rolesList ) { if ( r . getTitle ( ) . equals ( role ) ) { id = r . getId ( ) ; } } if ( passwordBox . getText ( ) . isEmpty ( ) ) { passwordChanged = false ; } <START_BUG> if ( ( ( userOld . getEmail ( ) . equals ( "guest" ) ) && passwordChanged ) || ( ! ( mail . equals ( userOld . getEmail ( ) ) ) ) ) { <END_BUG> MessageDialog . openWarning ( null , "Warning" , "The<seq2seq4repair_space>guest<seq2seq4repair_space>user's<seq2seq4repair_space>login<seq2seq4repair_space>data<seq2seq4repair_space>can<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>edited." ) ; return ; } cmrRepositoryDefinition . getSecurityService ( ) . changeUserAttribute ( userOld , mail , password , id , passwordChanged , isLocked ) ; okPressed ( ) ; } private void deletePressed ( ) { } }

Fix:
if ( ( userOld . getEmail ( ) . equals ( "guest" ) ) && ( passwordChanged || ( ! ( mail . equals ( userOld . getEmail ( ) ) ) ) ) ) {
Buggy code:
public class ServerRootDescription { private static final String RESOURCE_NAME = ( ServerRootDescription . class . getPackage ( ) . getName ( ) ) + ".LocalDescriptions" ; public static ModelNode getDescription ( final Locale locale ) { } public static ModelNode getReadConfigAsXmlOperation ( Locale locale ) { final ResourceBundle bundle = ServerRootDescription . getResourceBundle ( locale ) ; final ModelNode root = new ModelNode ( ) ; root . get ( OPERATION_NAME ) . set ( READ_CONFIG_AS_XML ) ; root . get ( DESCRIPTION ) . set ( bundle . getString ( READ_CONFIG_AS_XML ) ) ; root . get ( REQUEST_PROPERTIES ) . setEmptyObject ( ) ; root . get ( REPLY_PROPERTIES , TYPE ) . set ( STRING ) ; <START_BUG> root . get ( REPLY_PROPERTIES , DESCRIPTION ) . set ( bundle . getString ( ( ( ReadConfigAsXmlHandler . READ_CONFIG_AS_XML ) + ".result" ) ) ) ; <END_BUG> return root ; } private static ResourceBundle getResourceBundle ( Locale locale ) { } public static void main ( final String [ ] args ) { } }

Fix:
root . get ( REPLY_PROPERTIES , DESCRIPTION ) . set ( bundle . getString ( ( ( ReadConfigAsXmlHandler . READ_CONFIG_AS_XML ) + ".response" ) ) ) ;
Buggy code:
public class HandleFactory { private String lastPkgFragmentRootPath ; private IPackageFragmentRoot lastPkgFragmentRoot ; private Map packageHandles ; private JavaModel javaModel ; public HandleFactory ( ) { } public Openable createOpenable ( String resourcePath , IJavaSearchScope scope ) { } public IJavaElement createElement ( final ASTNode toBeFound , CompilationUnitDeclaration parsedUnit , Openable openable ) { } private IJavaElement createElement ( ASTNode [ ] nodeStack , int start , int end , IJavaElement parent ) { } public IJavaElement createElement ( ClassScope scope , ICompilationUnit unit , HashSet existingElements , HashMap knownScopes ) { } private IJavaElement createElement ( Scope scope , int elementPosition , ICompilationUnit unit , HashSet existingElements , HashMap knownScopes ) { } private IPackageFragmentRoot getJarPkgFragmentRoot ( String jarPathString , IJavaSearchScope scope ) { } private IPackageFragmentRoot getJarPkgFragmentRoot ( IPath jarPath , Object target , IJavaProject [ ] projects ) { } private Openable getOpenable ( ASTNode toBeFound , Openable openable ) { } private IPackageFragmentRoot getPkgFragmentRoot ( String pathString ) { IPath path = new Path ( pathString ) ; IProject [ ] projects = ResourcesPlugin . getWorkspace ( ) . getRoot ( ) . getProjects ( ) ; for ( int i = 0 , max = projects . length ; i < max ; i ++ ) { try { IProject project = projects [ i ] ; if ( ( ! ( project . isAccessible ( ) ) ) || ( ! ( project . hasNature ( JavaCore . NATURE_ID ) ) ) ) continue ; IJavaProject javaProject = this . javaModel . getJavaProject ( project ) ; IPackageFragmentRoot [ ] roots = javaProject . getPackageFragmentRoots ( ) ; for ( int j = 0 , rootCount = roots . length ; j < rootCount ; j ++ ) { PackageFragmentRoot root = ( ( PackageFragmentRoot ) ( roots [ j ] ) ) ; <START_BUG> if ( ( root . getPath ( ) . isPrefixOf ( path ) ) && ( ! ( Util . isExcluded ( path , root . fullExclusionPatternChars ( ) ) ) ) ) { <END_BUG> return root ; } } } catch ( CoreException e ) { } } return null ; } }

Fix:
if ( ( root . getPath ( ) . isPrefixOf ( path ) ) && ( ! ( Util . isExcluded ( path , root . fullInclusionPatternChars ( ) , root . fullExclusionPatternChars ( ) , false ) ) ) ) {
Buggy code:
public class dnsHeader { private int id ; private boolean [ ] flags ; byte rcode ; byte opcode ; private short [ ] counts ; public dnsHeader ( int _id ) { } public dnsHeader ( CountedDataInputStream in ) throws IOException { } public void toWire ( CountedDataOutputStream out ) throws IOException { } public byte [ ] toWire ( ) throws IOException { } public void setFlag ( int bit ) { } public void unsetFlag ( int bit ) { } public boolean getFlag ( int bit ) { } public int getID ( ) { } public void setID ( int _id ) { } static short randomID ( ) { } public void setRcode ( byte value ) { } public byte getRcode ( ) { } public void setOpcode ( byte value ) { } public byte getOpcode ( ) { } public void setCount ( int field , short value ) { } public void incCount ( int field ) { } public void decCount ( int field ) { } <START_BUG> public int getCount ( int field ) { <END_BUG> return counts [ field ] ; } private void writeFlags ( CountedDataOutputStream out ) throws IOException { } private void readFlags ( CountedDataInputStream in ) throws IOException { } public String printFlags ( ) { } public String toString ( ) { } }

Fix:
public short getCount ( int field ) {
Buggy code:
public class OneCompactionTest extends CleanupHelper { private void testCompaction ( String columnFamilyName , int insertsPerTable ) throws IOException , InterruptedException , ExecutionException { instance . disableAutoCompaction ( ) ; Table table = Table . open ( "Keyspace1" ) ; ColumnFamilyStore store = table . getColumnFamilyStore ( columnFamilyName ) ; Set < DecoratedKey > inserted = new HashSet < DecoratedKey > ( ) ; for ( int j = 0 ; j < insertsPerTable ; j ++ ) { DecoratedKey key = Util . dk ( String . valueOf ( j ) ) ; RowMutation rm = new RowMutation ( "Keyspace1" , key . key ) ; <START_BUG> rm . add ( new QueryPath ( columnFamilyName , null , "0" . getBytes ( ) ) , new byte [ 0 ] , j ) ; <END_BUG> rm . apply ( ) ; inserted . add ( key ) ; store . forceBlockingFlush ( ) ; Assert . assertEquals ( inserted . size ( ) , Util . getRangeSlice ( store ) . rows . size ( ) ) ; } instance . submitMajor ( store ) . get ( ) ; Assert . assertEquals ( 1 , store . getSSTables ( ) . size ( ) ) ; } @ Test public void testCompaction1 ( ) throws IOException , InterruptedException , ExecutionException { } @ Test public void testCompaction2 ( ) throws IOException , InterruptedException , ExecutionException { } }

Fix:
rm . add ( new QueryPath ( columnFamilyName , null , "0" . getBytes ( ) ) , new byte [ 0 ] , new TimestampClock ( j ) ) ;
Buggy code:
public class InfinispanSubsystemAdd extends AbstractAddStepHandler implements DescriptionProvider { static ModelNode createOperation ( ModelNode address , ModelNode existing ) { } private static void populate ( ModelNode source , ModelNode target ) { } @ Override public ModelNode getModelDescription ( Locale locale ) { <START_BUG> return LocalDescriptions . getSubsystemAddDescription ( locale ) ; <END_BUG> } protected void populateModel ( ModelNode operation , ModelNode model ) { } protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) { } protected boolean requiresRuntimeVerification ( ) { } }

Fix:
return InfinispanDescriptions . getSubsystemAddDescription ( locale ) ;
Buggy code:
public class ArgumentChecker { private ArgumentChecker ( ) { } public static void checkInt ( int arg , String argName , int minValue , int maxValue ) { } public static void notNull ( final Object argument , final String argumentName ) throws InvalidArgumentException { } public static void notEmpty ( final String argument , final String argumentName ) throws InvalidArgumentException { } public static boolean isEmpty ( final String argument ) { <START_BUG> return Strings . isNullOrEmpty ( argument ) ; <END_BUG> } public static < T > void notEmpty ( final T [ ] argument , final String argumentName ) throws InvalidArgumentException { } public static void equals ( Object argument , Object expect , String argumentName ) { } public static void notEquals ( Object argument , Object unexpected , String argumentName ) { } public static void contains ( String argument , String unexpected , String argumentName ) { } public static < T > void notContains ( Collection < T > argument , String argumentName , String otherInfo , T ... unexpects ) { } public static void required ( final Object argument , final String argumentName ) throws InvalidArgumentException { } public static void notZero ( final Collection collection , final String argumentName ) throws InvalidArgumentException { } }

Fix:
return ( Strings . isNullOrEmpty ( argument ) ) || ( ( argument . trim ( ) . length ( ) ) == 0 ) ;
Buggy code:
public class DistributionGraph extends JComponent implements Scrollable , Clearable { private static final long serialVersionUID = 240L ; private SamplingStatCalculator model ; private final int xborder = 30 ; public DistributionGraph ( ) { } public DistributionGraph ( SamplingStatCalculator model ) { } private void init ( ) { } public boolean getScrollableTracksViewportWidth ( ) { } public boolean getScrollableTracksViewportHeight ( ) { } private void setModel ( Object model ) { } public Dimension getPreferredScrollableViewportSize ( ) { } public int getScrollableUnitIncrement ( Rectangle visibleRect , int orientation , int direction ) { } public int getScrollableBlockIncrement ( Rectangle visibleRect , int orientation , int direction ) { } public void clearData ( ) { } @ Override public void paintComponent ( Graphics g ) { } private void drawSample ( SamplingStatCalculator p_model , Graphics g ) { int width = getWidth ( ) ; double height = ( getHeight ( ) ) - 1.0 ; for ( int y = 0 ; y < 4 ; y ++ ) { int q1 = ( ( int ) ( height - ( ( height * 0.25 ) * y ) ) ) ; g . setColor ( Color . lightGray ) ; g . drawLine ( xborder , q1 , width , q1 ) ; g . setColor ( Color . black ) ; g . drawString ( String . valueOf ( ( ( 25 * y ) + "%" ) ) , 0 , q1 ) ; } g . setColor ( Color . black ) ; g . drawLine ( xborder , ( ( int ) ( height ) ) , width , ( ( int ) ( height ) ) ) ; g . drawLine ( xborder , 0 , xborder , ( ( int ) ( height ) ) ) ; if ( ( p_model != null ) && ( ( p_model . getCount ( ) ) > 50 ) ) { Number ninety = p_model . getPercentPoint ( 0.9 ) ; Number fifty = p_model . getPercentPoint ( 0.5 ) ; <START_BUG> int total = p_model . getCount ( ) ; <END_BUG> Collection < Number [ ] > values = p_model . getDistribution ( ) . values ( ) ; Number [ ] [ ] objval = values . toArray ( new Number [ ] [ ] { } ) ; Arrays . sort ( objval , new NumberComparator ( ) ) ; int len = objval . length ; for ( int count = 0 ; count < len ; count ++ ) { Number [ ] num = objval [ count ] ; double iper = ( ( double ) ( num [ 1 ] . intValue ( ) ) ) // ( ( double ) ( total ) ) ; double iheight = height * iper ; if ( iheight < 1 ) { iheight = 1.0 ; } int ix = ( ( count * 4 ) + ( xborder ) ) + 5 ; int dheight = ( ( int ) ( height - iheight ) ) ; g . setColor ( Color . blue ) ; g . drawLine ( ( ix - 1 ) , ( ( int ) ( height ) ) , ( ix - 1 ) , dheight ) ; g . drawLine ( ix , ( ( int ) ( height ) ) , ix , dheight ) ; g . setColor ( Color . black ) ; if ( ( num [ 0 ] . longValue ( ) ) == ( ninety . longValue ( ) ) ) { g . setColor ( Color . red ) ; g . drawLine ( ix , ( ( int ) ( height ) ) , ix , 55 ) ; g . drawLine ( ix , 35 , ix , 0 ) ; g . drawString ( "90%" , ( ix - 30 ) , 20 ) ; g . drawString ( String . valueOf ( num [ 0 ] . longValue ( ) ) , ( ix + 8 ) , 20 ) ; } if ( ( num [ 0 ] . longValue ( ) ) == ( fifty . longValue ( ) ) ) { g . setColor ( Color . orange ) ; g . drawLine ( ix , ( ( int ) ( height ) ) , ix , 30 ) ; g . drawString ( "50%" , ( ix - 30 ) , 50 ) ; g . drawString ( String . valueOf ( num [ 0 ] . longValue ( ) ) , ( ix + 8 ) , 50 ) ; } } } } }

Fix:
long total = p_model . getCount ( ) ;
Buggy code:
public class ThreadMXBeanDumpAllThreadsHandler implements OperationStepHandler , DescriptionProvider { public static final ThreadMXBeanDumpAllThreadsHandler INSTANCE = new ThreadMXBeanDumpAllThreadsHandler ( ) ; private final ParametersValidator lockedValidator = new ParametersValidator ( ) ; private ThreadMXBeanDumpAllThreadsHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } @ Override public ModelNode getModelDescription ( Locale locale ) { <START_BUG> return PlatformMBeanDescriptions . getDumpThreadsDescripton ( locale ) ; <END_BUG> } }

Fix:
return PlatformMBeanDescriptions . getDumpThreadsDescription ( locale ) ;
Buggy code:
public abstract class OnClickLink extends AbstractLink { public OnClickLink ( String componentName ) { } public OnClickLink ( String name , IModel model ) { } public OnClickLink ( String name , IModel model , String expression ) { } public OnClickLink ( String name , Serializable object ) { } public OnClickLink ( String name , Serializable object , String expression ) { } protected final void handleComponentTag ( final ComponentTag tag ) { final String url = getURL ( ) . replaceAll ( "&" , "&amp;" ) ; <START_BUG> PopupSettings popupSettings = getPopupSettings ( ) ; <END_BUG> if ( popupSettings != null ) { popupSettings . setTarget ( ( ( "'" + url ) + "'" ) ) ; String popupScript = popupSettings . getPopupJavaScript ( ) ; popupScript = popupScript . replaceAll ( "&" , "&amp;" ) ; tag . put ( "onclick" , popupScript ) ; } else { tag . put ( "onclick" , ( ( "location.href='" + url ) + "';" ) ) ; } } }

Fix:
final PopupSettings popupSettings = getPopupSettings ( ) ;
Buggy code:
public final class EditBook extends AuthenticatedWebPage { static final Book otherBook = new Book ( "Frisbee<seq2seq4repair_space>Techniques" , "Marty<seq2seq4repair_space>van<seq2seq4repair_space>Hoff" , Book . FICTION ) ; public EditBook ( final Book book ) { } public static PageLink link ( final String name , final long id ) { } public static final class EditBookForm extends Form { public EditBookForm ( final String componentName , final Book book , final FeedbackPanel feedback ) { } public final void onSubmit ( ) { final RequestCycle cycle = getRequestCycle ( ) ; PageParameters parameters = new PageParameters ( ) ; <START_BUG> final Book book = ( ( Book ) ( getRootModel ( ) ) ) ; <END_BUG> parameters . put ( "id" , new Long ( book . getId ( ) ) ) ; cycle . setPage ( getPageFactory ( ) . newPage ( BookDetails . class , parameters ) ) ; cycle . setRedirect ( true ) ; } } }

Fix:
final Book book = ( ( Book ) ( getRootModelObject ( ) ) ) ;
Buggy code:
public class TypeLiteral extends Expression { public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor ( TypeLiteral . class , "type" , Type . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private Type type = null ; TypeLiteral ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { TypeLiteral result = new TypeLiteral ( target ) ; <START_BUG> result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <END_BUG> result . setType ( ( ( Type ) ( getType ( ) . clone ( target ) ) ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Type getType ( ) { } public void setType ( Type type ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ;
Buggy code:
public class CategoryFragment extends Fragment { private ListView mListView ; private static final String ARG_SECTION_NUMBER = "section_number" ; private Interval _grouping = Interval . MONAT ; public static CategoryFragment createInstance ( int sectionNumber ) { } @ Override public void onAttach ( Activity activity ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { View rootView = inflater . inflate ( fragment_main , container , false ) ; mListView = ( ( ListView ) ( rootView . findViewById ( listView1 ) ) ) ; mListView . setOnItemLongClickListener ( new AdapterView . OnItemLongClickListener ( ) { @ Override public boolean onItemLongClick ( AdapterView < ? > parent , View view , int position , long id ) { Intent i = new Intent ( view . getContext ( ) , ExpenseActivity . class ) ; Log . i ( "catSelect" , mListView . getItemAtPosition ( position ) . toString ( ) ) ; i . putExtra ( "selctedCategory" , "test" ) ; startActivity ( i ) ; return true ; } } ) ; ArrayList < Category > categories = new ArrayList < Category > ( ) ; categories . add ( new Category ( "Studium" ) ) ; categories . get ( 0 ) . getExpenses ( ) . add ( new Expense ( Calendar . getInstance ( ) , 7.0F , "Test" ) ) ; categories . get ( 0 ) . getExpenses ( ) . add ( new Expense ( Calendar . getInstance ( ) , 5.0F , "Test2" ) ) ; categories . add ( new Category ( "Debug" ) ) ; categories . get ( 1 ) . getExpenses ( ) . add ( new Expense ( Calendar . getInstance ( ) , 12.0F , "Test" ) ) ; categories . get ( 1 ) . getExpenses ( ) . add ( new Expense ( Calendar . getInstance ( ) , 5.0F , "Test2" ) ) ; <START_BUG> FileHandler fh = new FileHandler ( ( ( Environment . getExternalStorageDirectory ( ) . getPath ( ) ) + "exp.json" ) , rootView . getContext ( ) ) ; <END_BUG> fh . write ( categories ) ; categories = fh . read ( rootView . getContext ( ) ) ; mListView . setAdapter ( new CategoryAdapter ( this . getActivity ( ) , categories , Interval . MONAT ) ) ; return rootView ; } }

Fix:
FileHandler fh = new FileHandler ( ( ( Environment . getExternalStorageDirectory ( ) . getPath ( ) ) + "//expenses.json" ) , rootView . getContext ( ) ) ;
Buggy code:
final class ServletContextFacade implements ServletContext { private StringManager sm = StringManager . getManager ( "org.apache.tomcat.core" ) ; private ContextManager contextM ; private Context context ; ServletContextFacade ( ContextManager server , Context context ) { } Context getRealContext ( ) { } public ServletContext getContext ( String path ) { } public Object getAttribute ( String name ) { } public Enumeration getAttributeNames ( ) { } public void setAttribute ( String name , Object object ) { } public void removeAttribute ( String name ) { } public int getMajorVersion ( ) { } public int getMinorVersion ( ) { } public String getMimeType ( String filename ) { } public String getRealPath ( String path ) { } public InputStream getResourceAsStream ( String path ) { } public URL getResource ( String path ) throws MalformedURLException { } public RequestDispatcher getRequestDispatcher ( String path ) { } public RequestDispatcher getNamedDispatcher ( String name ) { if ( name == null ) return null ; <START_BUG> ServletWrapper wrapper = context . getServletByName ( name ) ; <END_BUG> if ( wrapper == null ) return null ; RequestDispatcherImpl rD = new RequestDispatcherImpl ( context ) ; rD . setName ( name ) ; return rD ; } public String getServerInfo ( ) { } public void log ( String msg ) { } public String getInitParameter ( String name ) { } public Enumeration getInitParameterNames ( ) { } public void log ( String msg , Throwable t ) { } public void log ( Exception e , String msg ) { } public Servlet getServlet ( String name ) throws ServletException { } public Enumeration getServlets ( ) { } public Enumeration getServletNames ( ) { } }

Fix:
Handler wrapper = context . getServletByName ( name ) ;
Buggy code:
public class TemplateFile { private String templatePath ; private String content ; private String zipContent = new String ( ) ; public TemplateFile ( String templatePath ) { } public String getTemplatePath ( ) { } public void setTemplatePath ( String templatePath ) { } public String getContent ( ) { } public void setContent ( String content ) { } public void readTemplateFile ( Mode mode ) { try { this . setContent ( Utils . readFileAsString ( templatePath ) ) ; String str ; BufferedReader reader = new BufferedReader ( new StringReader ( this . getContent ( ) ) ) ; String foundTag = null ; while ( ( str = reader . readLine ( ) ) != null ) { String byteStr = str . toString ( ) ; if ( ( ( ( ( byteStr . length ( ) ) > 0 ) && ( ( str . getBytes ( ) [ 0 ] ) == '{' ) ) && ( ( byteStr . length ( ) ) > 1 ) ) && ( ( str . getBytes ( ) [ 1 ] ) == '#' ) ) { String currentLine = new String ( str . getBytes ( ) ) ; int secondSpace = 3 ; while ( ( currentLine . charAt ( secondSpace ) ) != '<seq2seq4repair_space>' ) { ++ secondSpace ; } foundTag = ( ( String ) ( new String ( str . getBytes ( ) ) . subSequence ( 3 , secondSpace ) ) ) ; String modulesToInsert = new String ( ) ; List < Module > modules = ModulesRegistry . getModulesByTag ( foundTag ) ; for ( Module currentModule : modules ) { List < Insert > inserts = currentModule . getInserts ( ) ; <START_BUG> String insertString = null ; <END_BUG> for ( Insert currentInsert : inserts ) { if ( ( ( currentInsert . getMode ( ) ) == null ) || ( currentInsert . getMode ( ) . equals ( mode . getId ( ) ) ) ) { if ( ( ( currentInsert . getType ( ) ) == null ) || ( ! ( currentInsert . getType ( ) . equals ( "file" ) ) ) ) { if ( currentInsert . getWhere ( ) . equals ( foundTag ) ) insertString = Utils . readFileAsString ( ( ( ( "builder//modules//" + ( currentModule . getId ( ) ) ) + "//" ) + ( currentInsert . getWhat ( ) ) ) ) ; } } } modulesToInsert += insertString ; } this . setZipContent ( ( ( this . getZipContent ( ) ) + modulesToInsert ) ) ; } else { this . setZipContent ( ( ( ( this . getZipContent ( ) ) + str ) + "\n" ) ) ; } } } catch ( IOException e ) { e . printStackTrace ( ) ; } } public void setZipContent ( String zipContent ) { } public String getZipContent ( ) { } }

Fix:
String insertString = "" ;
Buggy code:
public class IServerManagerServicePlugin extends IServerManagerSuper implements IServerManagerInterface { private static final Logger log = Logger . getLogger ( IServerManagerServicePlugin . class . getName ( ) ) ; @ Override public void addAndLinkFile ( String serviceName , String fileName , String fileId , String fileNameLabel ) { } @ Override public String addFile ( String serviceName , String fileName , String fileId , String fileNameLabel ) { String duplicateUri = searchFile ( serviceName , fileName ) ; if ( ( duplicateUri != null ) && ( ! ( duplicateUri . isEmpty ( ) ) ) ) { IServerManagerServicePlugin . log . info ( ( ( ( "File<seq2seq4repair_space>named:<seq2seq4repair_space>" + fileName ) + "<seq2seq4repair_space>already<seq2seq4repair_space>exists<seq2seq4repair_space>in<seq2seq4repair_space>service:<seq2seq4repair_space>" ) + serviceName ) ) ; return duplicateUri ; } DigitalObject newFile = null ; try { newFile = super . addFile ( fileName , fileId ) ; if ( fileNameLabel != null ) { newFile . setLabel ( fileNameLabel ) ; } newFile . addProperty ( HOST_ID , serviceName ) ; newFile . addProperty ( HOST_TYPE , SERVICE_PLUGIN ) ; } catch ( CardinalityConstraintException e ) { IServerManagerServicePlugin . log . severe ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>new<seq2seq4repair_space>DigitalObject" ) ; e . printStackTrace ( ) ; } <START_BUG> return newFile . getUri ( ) ; <END_BUG> } @ Override public void searchAndLinkRelatedByUri ( String fileUri ) { } @ Override public JSONArray getAllLinkedFiles ( String fileName ) { } @ Override public JSONArray getLinkedFiles ( String fileURI ) { } public void deleteFile ( String fileName ) { } public void modifyFile ( String deviceId , String fileName ) { } private String searchFile ( String serviceName , String fileName ) { } }

Fix:
return fileId ;
Buggy code:
public class MainActivity extends Activity { private HashSet < ContactGroupController > contactGroupCtrlSet ; public ContactGroup inCreation ; public ContactGroup inModif ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_main ) ; LinearLayout layout = ( ( LinearLayout ) ( findViewById ( group_list ) ) ) ; try { <START_BUG> contactGroupList = new ContactGroupListController ( this , layout ) ; <END_BUG> } catch ( Exception e ) { DialogFactory . showErrorDialog ( "La<seq2seq4repair_space>liste<seq2seq4repair_space>des<seq2seq4repair_space>groupes<seq2seq4repair_space>ne<seq2seq4repair_space>peut<seq2seq4repair_space>pas<seq2seq4repair_space>être<seq2seq4repair_space>chargée." , this ) ; } Button addGroup = ( ( Button ) ( findViewById ( add_group ) ) ) ; CreateGroupListener command = new CreateGroupListener ( this ) ; addGroup . setOnClickListener ( command ) ; } @ Override protected void onRestart ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void save ( ContactGroup cg ) throws IOException { } }

Fix:
this . contactGroupCtrlSet = new HashSet < ContactGroupController > ( ) ;
Buggy code:
public class EarInitializationProcessor implements DeploymentUnitProcessor { private static final String EAR_EXTENSION = ".ear" ; public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ResourceRoot resourceRoot = phaseContext . getDeploymentUnit ( ) . getAttachment ( DEPLOYMENT_ROOT ) ; final VirtualFile virtualFile = resourceRoot . getRoot ( ) ; <START_BUG> if ( virtualFile . getName ( ) . toLowerCase ( ) . endsWith ( EarInitializationProcessor . EAR_EXTENSION ) ) { <END_BUG> DeploymentTypeMarker . setType ( EAR , deploymentUnit ) ; } } public void undeploy ( DeploymentUnit context ) { } }

Fix:
if ( virtualFile . getLowerCaseName ( ) . endsWith ( EarInitializationProcessor . EAR_EXTENSION ) ) {
Buggy code:
public class BorderDecorator extends DecoratorFigure { private static final long serialVersionUID = 1205601808259084917L ; private int borderDecoratorSerializedDataVersion = 1 ; private Point myBorderOffset ; private Color myBorderColor ; private Color myShadowColor ; public BorderDecorator ( ) { } public BorderDecorator ( Figure figure ) { } protected void initialize ( ) { } public void setBorderOffset ( Point newBorderOffset ) { } public Point getBorderOffset ( ) { } public void draw ( Graphics g ) { } public Rectangle displayBox ( ) { } public void figureInvalidated ( FigureChangeEvent e ) { Rectangle rect = e . getInvalidatedRectangle ( ) ; rect . grow ( getBorderOffset ( ) . x , getBorderOffset ( ) . y ) ; <START_BUG> super . figureInvalidated ( new FigureChangeEvent ( e . getFigure ( ) , rect ) ) ; <END_BUG> } public Insets connectionInsets ( ) { } }

Fix:
super . figureInvalidated ( new FigureChangeEvent ( this , rect , e ) ) ;
Buggy code:
public class Checksum extends MatchingTask implements Condition { private File file = null ; private String algorithm = "MD5" ; private String provider = null ; private String fileext ; private String property ; private boolean forceOverwrite ; private String verifyProperty ; private Vector filesets = new Vector ( ) ; private Hashtable includeFileMap = new Hashtable ( ) ; private MessageDigest messageDigest ; private boolean isCondition ; public void setFile ( File file ) { } public void setAlgorithm ( String algorithm ) { } public void setProvider ( String provider ) { } public void setFileext ( String fileext ) { } public void setProperty ( String property ) { } public void setVerifyproperty ( String verifyProperty ) { } public void setForceOverwrite ( boolean forceOverwrite ) { } public void addFileset ( FileSet set ) { } public void execute ( ) throws BuildException { boolean value = validateAndExecute ( ) ; if ( ( verifyProperty ) != null ) { <START_BUG> project . setProperty ( verifyProperty , new Boolean ( value ) . toString ( ) ) ; <END_BUG> } } public boolean eval ( ) throws BuildException { } private boolean validateAndExecute ( ) throws BuildException { } private void addToIncludeFileMap ( File file ) throws BuildException { } private boolean generateChecksums ( ) throws BuildException { } }

Fix:
project . setNewProperty ( verifyProperty , new Boolean ( value ) . toString ( ) ) ;
Buggy code:
public class Group extends Composite { String text = "" ; public Group ( Composite parent , int style ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { checkWidget ( ) ; CGRect oldBounds = new CGRect ( ) ; CGRect bounds = oldBounds ; OS . HIViewGetFrame ( handle , oldBounds ) ; int MIN_SIZE = 100 ; if ( ( ( oldBounds . width ) < MIN_SIZE ) || ( ( oldBounds . height ) < MIN_SIZE ) ) { OS . HIViewSetDrawingEnabled ( handle , false ) ; bounds = new CGRect ( ) ; bounds . width = bounds . height = 100 ; OS . HIViewSetFrame ( handle , bounds ) ; } int rgnHandle = OS . NewRgn ( ) ; OS . GetControlRegion ( handle , ( ( short ) ( kControlContentMetaPart ) ) , rgnHandle ) ; Rect client = new Rect ( ) ; OS . GetRegionBounds ( rgnHandle , client ) ; OS . DisposeRgn ( rgnHandle ) ; width += ( ( int ) ( bounds . width ) ) - ( ( client . right ) - ( client . left ) ) ; height += ( ( int ) ( bounds . height ) ) - ( ( client . bottom ) - ( client . top ) ) ; if ( ( ( oldBounds . width ) < MIN_SIZE ) || ( ( oldBounds . height ) < MIN_SIZE ) ) { OS . HIViewSetFrame ( handle , oldBounds ) ; <START_BUG> OS . HIViewSetDrawingEnabled ( handle , ( ( drawCount ) == 0 ) ) ; <END_BUG> } return new Rectangle ( ( - ( client . left ) ) , ( - ( client . top ) ) , width , height ) ; } void createHandle ( ) { } void drawBackground ( int control , int context ) { } public Rectangle getClientArea ( ) { } String getNameText ( ) { } public String getText ( ) { } float getThemeAlpha ( ) { } public void setText ( String string ) { } }

Fix:
OS . HIViewSetDrawingEnabled ( handle , getDrawing ( ) ) ;
Buggy code:
@ ContextConfiguration ( classes = { PersistenceContext . class } ) @ RunWith ( SpringJUnit4ClassRunner . class ) @ DirtiesContext ( classMode = ClassMode . AFTER_EACH_TEST_METHOD ) public class RosterFileProcessorIntegrationTest extends WrappingServerIntegrationTest { @ Autowired RosterFileProcessor rfp ; @ Autowired PlayerRepository playerRepository ; @ Autowired FranchiseRepostitory franchiseRepository ; @ Autowired DOBRepository dobRepository ; @ Autowired YearRepository yearRepository ; @ Autowired CountryRepository countryRepository ; @ Autowired Session session ; @ Override protected int neoServerPort ( ) { } @ Test public void shouldProcessCSKFile ( ) { try { Player p = null ; p = playerRepository . findPlayerByName ( "Suresh<seq2seq4repair_space>Raina" ) ; assertNull ( p ) ; rfp . process ( new URI ( "file://////Users//sid//dev//ipl-roster//src//test//resources//2015//roster//csk.txt" ) ) ; p = playerRepository . findPlayerByName ( "Suresh<seq2seq4repair_space>Raina" ) ; assertNotNull ( p ) ; assertTrue ( ( p instanceof Batter ) ) ; Handedness h = p . bats ; assertTrue ( ( h instanceof Left ) ) ; assertEquals ( "Suresh<seq2seq4repair_space>Raina" , p . name ) ; Country india = countryRepository . findCountryByName ( "India" ) ; assertNotNull ( india ) ; assertEquals ( india , p . country ( ) ) ; DOB dbDOB = dobRepository . getBirthday ( 27 , 11 , 1986 ) ; assertEquals ( dbDOB , p . bornOn ) ; Franchise csk = franchiseRepository . findByCode ( "CSK" ) ; Year y2015 = yearRepository . findYearByYear ( 2015 ) ; List < Contract > contracts = p . contracts ( ) ; Contract contract = ( ( Contract ) ( contracts . stream ( ) . filter ( ( s ) -> s . franchise ( ) . equals ( csk ) ) . toArray ( ) [ 0 ] ) ) ; assertNotNull ( contract ) ; assertEquals ( 95000000 , contract . value ( ) ) ; assertEquals ( "INR" , contract . currency ( ) ) ; assertEquals ( y2015 , contract . year ( ) ) ; <START_BUG> Contract fContract = ( ( Contract ) ( csk . contracts . stream ( ) . filter ( ( s ) -> s . franchise ( ) . equals ( csk ) ) . toArray ( ) [ 0 ] ) ) ; <END_BUG> assertEquals ( contract , fContract ) ; Bowls b = p . bowls ; assertNotNull ( b ) ; assertEquals ( OFF_BREAK , b . variety ) ; assertEquals ( SLOW , b . pace ) ; assertTrue ( ( ( b . arm ( ) ) instanceof Right ) ) ; } catch ( Exception e ) { fail ( ( "Shouldn't<seq2seq4repair_space>have<seq2seq4repair_space>thrown<seq2seq4repair_space>exception<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } } }

Fix:
Contract fContract = ( ( Contract ) ( csk . contracts . stream ( ) . filter ( ( s ) -> ( s . franchise ( ) . equals ( csk ) ) && ( s . player ( ) . name . equals ( "Suresh<seq2seq4repair_space>Raina" ) ) ) . toArray ( ) [ 0 ] ) ) ;