nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class SignInPanel extends Panel { private TextField username ; private PasswordTextField password ; public SignInPanel ( String componentName ) { } public String getUsername ( ) { } public String getPassword ( ) { } public void setPersistent ( boolean enable ) { } public abstract String signIn ( final String username , final String password ) { } public final class SignInForm extends Form { private static final long serialVersionUID = 303695648327317416L ; private final ValueMap properties = new ValueMap ( ) ; public SignInForm ( final String componentName , final IValidationErrorHandler feedback ) { } public final void handleSubmit ( ) { final String error = signIn ( getUsername ( ) , getPassword ( ) ) ; if ( error == null ) { final RequestCycle cycle = getRequestCycle ( ) ; if ( cycle . continueToOriginalDestination ( ) ) { cycle . setPage ( ( ( Page ) ( null ) ) ) ; } else { <START_BUG> cycle . setPage ( getApplicationSettings ( ) . getPageFactory ( ) . newPage ( getApplicationSettings ( ) . getHomePage ( ) ) ) ; <END_BUG> } } else { handleError ( new ValidationErrorMessage ( this , error ) ) ; } } } }

Fix:
cycle . setPage ( getApplicationSettings ( ) . getDefaultPageFactory ( ) . newPage ( getApplicationSettings ( ) . getHomePage ( ) ) ) ;
Buggy code:
public class ContainsRegexpSelector extends BaseExtendSelector implements ResourceSelector { private String userProvidedExpression = null ; private RegularExpression myRegExp = null ; private Regexp myExpression = null ; private boolean caseSensitive = true ; private boolean multiLine = false ; private boolean singleLine = false ; public static final String EXPRESSION_KEY = "expression" ; private static final String CS_KEY = "casesensitive" ; private static final String ML_KEY = "multiline" ; private static final String SL_KEY = "singleline" ; public ContainsRegexpSelector ( ) { } public String toString ( ) { <START_BUG> StringBuffer buf = new StringBuffer ( "{containsregexpselector<seq2seq4repair_space>expression:<seq2seq4repair_space>" ) ; <END_BUG> buf . append ( userProvidedExpression ) ; buf . append ( "}" ) ; return buf . toString ( ) ; } public void setExpression ( String theexpression ) { } public void setCaseSensitive ( boolean b ) { } public void setMultiLine ( boolean b ) { } public void setSingleLine ( boolean b ) { } public void setParameters ( Parameter [ ] parameters ) { } public void verifySettings ( ) { } public boolean isSelected ( File basedir , String filename , File file ) { } public boolean isSelected ( Resource r ) { } }

Fix:
StringBuilder buf = new StringBuilder ( "{containsregexpselector<seq2seq4repair_space>expression:<seq2seq4repair_space>" ) ;
Buggy code:
public class MainActivity extends AppCompatActivity { @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void onSend ( View view ) { <START_BUG> Mailbox . getInstance ( ) . send ( new Mail ( "A<seq2seq4repair_space>mail<seq2seq4repair_space>from<seq2seq4repair_space>MainActivity" , ConsumerActivity . class ) ) ; <END_BUG> } public void onStartConsumer ( View view ) { } }

Fix:
Mailbox . getInstance ( ) . post ( new Mail ( "A<seq2seq4repair_space>mail<seq2seq4repair_space>from<seq2seq4repair_space>MainActivity" , ConsumerActivity . class ) ) ;
Buggy code:
public class MultiTermQueryWrapperFilter < Q extends MultiTermQuery > extends Filter { protected final Q query ; protected MultiTermQueryWrapperFilter ( Q query ) { } @ Override public String toString ( ) { } @ Override @ SuppressWarnings ( { "unchecked" , "rawtypes" } ) public final boolean equals ( final Object o ) { } @ Override public final int hashCode ( ) { } public final String getField ( ) { } @ Override public DocIdSet getDocIdSet ( AtomicReaderContext context , Bits acceptDocs ) throws IOException { final AtomicReader reader = context . reader ( ) ; final Fields fields = reader . fields ( ) ; if ( fields == null ) { return DocIdSet . EMPTY_DOCIDSET ; } final Terms terms = fields . terms ( query . field ) ; if ( terms == null ) { return DocIdSet . EMPTY_DOCIDSET ; } final TermsEnum termsEnum = query . getTermsEnum ( terms ) ; assert termsEnum != null ; if ( ( termsEnum . next ( ) ) != null ) { final FixedBitSet bitSet = new FixedBitSet ( context . reader ( ) . maxDoc ( ) ) ; DocsEnum docsEnum = null ; do { <START_BUG> docsEnum = termsEnum . docs ( acceptDocs , docsEnum , false ) ; <END_BUG> int docid ; while ( ( docid = docsEnum . nextDoc ( ) ) != ( DocIdSetIterator . NO_MORE_DOCS ) ) { bitSet . set ( docid ) ; } } while ( ( termsEnum . next ( ) ) != null ) ; return bitSet ; } else { return DocIdSet . EMPTY_DOCIDSET ; } } }

Fix:
docsEnum = termsEnum . docs ( acceptDocs , docsEnum , 0 ) ;
Buggy code:
public class GoBoardViewHD extends View { private static final float SMALL_STONE_SCALE_FACTOR = 0.6F ; private Cell zoom_poi = null ; public boolean do_legend = true ; public boolean do_actpos_highlight = true ; public boolean do_actpos_highlight_ony_if_active = true ; public boolean mark_last_stone = true ; public boolean legend_sgf_mode = true ; public boolean show_area_stones = false ; private Paint hoshi_paint ; private Paint legendPaint ; private Paint blackTextPaint ; private Paint whiteTextPaint ; private Paint gridPaint ; private Paint gridPaint_h ; private Paint bitmapPaint ; private Paint placeStonePaint ; private Paint opaque_paint ; private Paint whiteLastStoneCirclePaint ; private Paint blackLastStoneCirclePaint ; private float stone_size ; private Bitmap white_stone_bitmap = null ; private Bitmap black_stone_bitmap = null ; private Bitmap white_stone_bitmap_small = null ; private Bitmap black_stone_bitmap_small = null ; public boolean move_stone_mode = false ; private boolean regenerate_stones_flag = true ; protected boolean enforceSquare ( ) { } protected float zoom = 1.0F ; public GoBoardViewHD ( Context context , AttributeSet attrs ) { } public App getApp ( ) { } public void init ( ) { } public GoGame getGame ( ) { } public void setZoom ( float zoom ) { } public PointF getZoomTranslate ( ) { } private Cell calcActZoomPOI ( ) { } public void screenshot ( String sshot_name ) { } @ Override protected void onDraw ( Canvas canvas ) { } private int getGameSize ( ) { } private void drawBoardCircle ( Canvas canvas , float x , float y , float size , Paint paint ) { } protected void draw2canvas ( Canvas canvas ) { } private Paint getStonePaintForCell ( Cell cell ) { } private Paint getTextPaintForCell ( Cell cell ) { } private Bitmap getScaledRes ( float size , int resID ) { } public void regenerate_images ( ) { } public void setGridEmboss ( boolean grid_emboss ) { } @ Override protected void onSizeChanged ( int w , int h , int oldw , int oldh ) { <START_BUG> setSize ( w , h ) ; <END_BUG> } private void setSize ( int w , int h ) { } public void regenerateStoneImagesWithNewSize ( ) { } @ Override protected void onMeasure ( int widthMeasureSpec , int heightMeasureSpec ) { } public void setZoomPOI ( Cell zoom_poi ) { } public Cell pixel2cell ( float pixelX , float pixelY ) { } No newline ; at end ; of file ; }

Fix:
setSize ( ( w - 5 ) , ( h - 5 ) ) ;
Buggy code:
@ Singleton public class GoogleAuthProvider extends AuthProvider { private static final Logger LOGGER = LoggerFactory . getLogger ( GoogleAuthProvider . class ) ; private static final String GOOGLE_PROVIDER_NAME = "Google" ; private IdentityProvider identityProvider ; @ EJB private IdentityProviderService identityProviderService ; @ EJB private PropertiesService propertiesService ; @ EJB private ConfigurationService configurationService ; @ EJB private UserService userService ; @ EJB private AccessKeyService accessKeyService ; @ EJB private IdentityProviderUtils identityProviderUtils ; @ PostConstruct private void initialize ( ) { } @ Override public boolean isIdentityProviderAllowed ( ) { } @ Override public AccessKey createAccessKey ( @ NotNull final AccessKeyRequest request ) { } private String getAccessToken ( final String code , final String redirectUrl ) { } private String getIdentityProviderEmail ( final String accessToken ) { } private User findUser ( final String email ) { final User user = userService . findGoogleUser ( email ) ; if ( user == null ) { GoogleAuthProvider . LOGGER . error ( "No<seq2seq4repair_space>user<seq2seq4repair_space>with<seq2seq4repair_space>email<seq2seq4repair_space>{}<seq2seq4repair_space>found<seq2seq4repair_space>for<seq2seq4repair_space>identity<seq2seq4repair_space>provider<seq2seq4repair_space>{}" , email , GoogleAuthProvider . GOOGLE_PROVIDER_NAME ) ; <START_BUG> throw new com . devicehive . exceptions . HiveException ( String . format ( USER_NOT_FOUND , email ) , NOT_FOUND . getStatusCode ( ) ) ; <END_BUG> } else if ( ( user . getStatus ( ) ) != ( UserStatus . ACTIVE ) ) { GoogleAuthProvider . LOGGER . error ( String . format ( USER_NOT_ACTIVE , user . getId ( ) ) ) ; throw new com . devicehive . exceptions . HiveException ( UNAUTHORIZED . getReasonPhrase ( ) , UNAUTHORIZED . getStatusCode ( ) ) ; } return user ; } private JsonElement getVerificationResponse ( final String accessToken ) { } }

Fix:
throw new com . devicehive . exceptions . HiveException ( String . format ( USER_NOT_FOUND , email ) , UNAUTHORIZED . getStatusCode ( ) ) ;
Buggy code:
public class MainActivity extends Activity { private ImageView roundImage ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_main ) ; <START_BUG> roundImage = ( ( ImageView ) ( findViewById ( circular_view ) ) ) ; <END_BUG> } }

Fix:
roundImage = ( ( ImageView ) ( findViewById ( R . id . roundImage ) ) ) ;
Buggy code:
public class MoveableMass extends GLKugel { GLVektor speed ; GLVektor force ; double mass ; Material matter ; public MoveableMass ( GLVektor pPosition , Material matter , double mass ) { } public void initial ( ) { } public void setMaterial ( Material matter ) { } public void setMass ( double pMass ) { } public double getMass ( ) { } public void setRadius ( double pRadius ) { } public synchronized void setForce ( GLVektor pForce ) { } public void calcSpeed ( double time ) { GLVektor pForce = new GLVektor ( force ) ; <START_BUG> pForce . multipliziere ( time ) ; <END_BUG> speed . addiere ( pForce ) ; } public void move ( double time ) { } No newline ; at end ; of file ; }

Fix:
pForce . multipliziere ( ( time // ( mass ) ) ) ;
Buggy code:
public abstract class Key implements Comparable { private static final int HASH_FACTOR = 89 ; private static final int HASH_INITIAL = Key . class . getName ( ) . hashCode ( ) ; private transient int hashCode ; private transient boolean hashCodeComputed ; protected String name ; Key ( String name ) { } public int compareTo ( Object object ) { } public boolean equals ( Object object ) { } public int hashCode ( ) { } public String toString ( ) { <START_BUG> return name ; <END_BUG> } }

Fix:
return KeyFormatterFactory . getFormalKeyFormatter ( ) . format ( this ) ;
Buggy code:
public class PunctuationToken extends Token { private static final Type myTokenType = Token . Type . PUNCTUATION_SYMBOL ; private static final Pattern myRegex = Pattern . compile ( ";" ) ; private static final String myType = ";" ; public PunctuationToken ( String integerString ) { } @ Override public boolean isThisTypeOfToken ( String parseableString ) { Matcher punctationMatcher = PunctuationToken . myRegex . matcher ( parseableString ) ; <START_BUG> return punctationMatcher . lookingAt ( ) ; <END_BUG> } @ Override public Token createThisTypeOfToken ( String parseableString ) { } public Type getTokenType ( ) { } public String getType ( ) { } private PunctuationToken ( ) { } public static TokenFactory getFactory ( ) { } }

Fix:
return punctationMatcher . matches ( ) ;
Buggy code:
public abstract class BaseNodeBuilder extends BaseKaleoBean implements NodeBuilder { @ Override public Node buildNode ( KaleoNode kaleoNode ) throws PortalException { } protected void addNotificationRecipients ( KaleoNotification kaleoNotification , Notification notification ) throws PortalException { List < KaleoNotificationRecipient > kaleoNotificationRecipients = kaleoNotificationRecipientLocalService . getKaleoNotificationRecipients ( kaleoNotification . getKaleoNotificationId ( ) ) ; for ( KaleoNotificationRecipient kaleoNotificationRecipient : kaleoNotificationRecipients ) { String recipientClassName = kaleoNotificationRecipient . getRecipientClassName ( ) ; long recipientClassPK = kaleoNotificationRecipient . getRecipientClassPK ( ) ; Recipient recipient = null ; if ( recipientClassName . equals ( ADDRESS . name ( ) ) ) { recipient = new com . liferay . portal . workflow . kaleo . definition . AddressRecipient ( kaleoNotificationRecipient . getAddress ( ) ) ; } else if ( recipientClassName . equals ( ASSIGNEES . name ( ) ) ) { recipient = new AssigneesRecipient ( ) ; } else if ( recipientClassName . equals ( Role . class . getName ( ) ) ) { Role role = _roleLocalService . fetchRole ( recipientClassPK ) ; recipient = new com . liferay . portal . workflow . kaleo . definition . RoleRecipient ( role . getName ( ) , role . getTypeLabel ( ) ) ; } else if ( recipientClassName . equals ( SCRIPT . name ( ) ) ) { recipient = new com . liferay . portal . workflow . kaleo . definition . ScriptRecipient ( kaleoNotificationRecipient . getRecipientScript ( ) , kaleoNotificationRecipient . getRecipientScriptLanguage ( ) , kaleoNotificationRecipient . getRecipientScriptRequiredContexts ( ) ) ; } else if ( recipientClassName . equals ( User . class . getName ( ) ) ) { if ( recipientClassPK > 0 ) { User user = _userLocalService . getUser ( recipientClassPK ) ; recipient = new UserRecipient ( user . getUserId ( ) , user . getScreenName ( ) , user . getEmailAddress ( ) ) ; } else { recipient = new UserRecipient ( ) ; } } <START_BUG> recipient . setNotificationReceptionType ( NotificationReceptionType . parse ( kaleoNotificationRecipient . getReceiptionType ( ) ) ) ; <END_BUG> notification . addRecipients ( recipient ) ; } } protected Set < Action > buildActions ( String kaleoClassName , long kaleoClassPK ) { } protected Set < Assignment > buildAssigments ( String kaleoClassName , long kaleoClassPK ) throws PortalException { } protected Set < Notification > buildNotifications ( String kaleoClassName , long kaleoClassPK ) throws PortalException { } protected Set < Timer > buildTimers ( String kaleoClassName , long kaleoClassPK ) throws PortalException { } protected abstract Node createNode ( KaleoNode kaleoNode ) throws PortalException { } @ BeanReference ( type = RoleLocalService . class ) private RoleLocalService _roleLocalService ; @ BeanReference ( type = UserLocalService . class ) private UserLocalService _userLocalService ; No newline ; at end ; of file ; }

Fix:
recipient . setNotificationReceptionType ( NotificationReceptionType . parse ( kaleoNotificationRecipient . getNotificationReceptionType ( ) ) ) ;
Buggy code:
public class BattleMessage { public static void processMajorAction ( final BattleFragment battleFragment , final String message ) { } public static void processMinorAction ( final BattleFragment battleFragment , String command , final String messageDetails , final String message ) { } public static PokemonInfo parsePokemonInfo ( BattleFragment battleFragment , JSONObject info ) throws JSONException { } private static int processHpFraction ( String hpFraction ) { int status = hpFraction . indexOf ( '<seq2seq4repair_space>' ) ; <START_BUG> hpFraction = ( status == ( - 1 ) ) ? hpFraction : hpFraction . substring ( status ) ; <END_BUG> int fraction = hpFraction . indexOf ( '//' ) ; if ( fraction == ( - 1 ) ) { return 0 ; } else { int remaining = Integer . parseInt ( hpFraction . substring ( 0 , fraction ) ) ; int total = Integer . parseInt ( hpFraction . substring ( ( fraction + 1 ) ) ) ; return ( ( int ) ( ( ( ( float ) ( remaining ) ) // ( ( float ) ( total ) ) ) * 100 ) ) ; } } private static String processStatusFraction ( String statusFraction ) { } private static String processSpecialName ( String name ) { } private static void processPokemonDetailString ( PokemonInfo pkm , String details ) { } }

Fix:
hpFraction = ( status == ( - 1 ) ) ? hpFraction : hpFraction . substring ( 0 , status ) ;
Buggy code:
public class MigrationManager implements IEndpointStateChangeSubscriber { public static final String MIGRATION_STATE = "MIGRATION" ; private static final Logger logger = LoggerFactory . getLogger ( MigrationManager . class ) ; public void onJoin ( InetAddress endpoint , EndpointState epState ) { } public void onChange ( InetAddress endpoint , String stateName , ApplicationState state ) { } public void onAlive ( InetAddress endpoint , EndpointState state ) { } public void onDead ( InetAddress endpoint , EndpointState state ) { } public static void rectify ( UUID theirVersion , InetAddress endpoint ) { } public static void announce ( UUID version , Set < InetAddress > hosts ) { } public static void applyMigrations ( UUID from , UUID to ) throws IOException { List < Future > updates = new ArrayList < Future > ( ) ; Collection < IColumn > migrations = Migration . getLocalMigrations ( from , to ) ; for ( IColumn col : migrations ) { <START_BUG> final Migration migration = Migration . deserialize ( new ByteArrayInputStream ( col . value ( ) ) ) ; <END_BUG> Future update = StageManager . getStage ( MIGRATION_STAGE ) . submit ( new Runnable ( ) { public void run ( ) { try { migration . apply ( ) ; } catch ( ConfigurationException ex ) { } catch ( IOException ex ) { throw new RuntimeException ( ex ) ; } } } ) ; updates . add ( update ) ; } for ( Future f : updates ) { try { f . get ( ) ; } catch ( InterruptedException e ) { throw new IOException ( e ) ; } catch ( ExecutionException e ) { throw new IOException ( e ) ; } } } public static void pushMigrations ( UUID from , UUID to , InetAddress host ) { } private static Message makeVersionMessage ( UUID version ) { } private static Message makeMigrationMessage ( Collection < IColumn > migrations ) throws IOException { } public static Collection < Column > makeColumns ( Message msg ) throws IOException { } }

Fix:
final Migration migration = Migration . deserialize ( col . value ( ) ) ;
Buggy code:
public final class ReportGuiPackage implements LocaleChangeListener { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static ReportGuiPackage guiPack ; private boolean dirty = false ; private Map < TestElement , JMeterGUIComponent > nodesToGui = new HashMap < TestElement , JMeterGUIComponent > ( ) ; private Map < Class < ? > , JMeterGUIComponent > guis = new HashMap < Class < ? > , JMeterGUIComponent > ( ) ; private Map < Class < ? > , JMeterGUIComponent > testBeanGUIs = new HashMap < Class < ? > , JMeterGUIComponent > ( ) ; private ReportTreeNode currentNode = null ; private boolean currentNodeUpdated = false ; private ReportTreeModel treeModel ; private ReportTreeListener treeListener ; private ReportMainFrame mainFrame ; private ReportGuiPackage ( ) { } public static ReportGuiPackage getInstance ( ) { } public static ReportGuiPackage getInstance ( ReportTreeListener listener , ReportTreeModel treeModel ) { } public JMeterGUIComponent getGui ( TestElement node ) { } public JMeterGUIComponent getGui ( TestElement node , Class < ? > guiClass , Class < ? > testClass ) { } public void removeNode ( TestElement node ) { } public JMeterGUIComponent getCurrentGui ( ) { } public ReportTreeNode getNodeOf ( TestElement userObject ) { } public TestElement createTestElement ( Class < ? > guiClass , Class < ? > testClass ) { } public TestElement createTestElement ( String objClass ) { } private JMeterGUIComponent getGuiFromCache ( Class < ? > guiClass , Class < ? > testClass ) throws IllegalAccessException , InstantiationException { } public void updateCurrentGui ( ) { } public void updateCurrentNode ( ) { } public ReportTreeNode getCurrentNode ( ) { } public TestElement getCurrentElement ( ) { } public void setDirty ( boolean dirty ) { } public boolean isDirty ( ) { } public HashTree addSubTree ( HashTree subTree ) throws IllegalUserActionException { } public HashTree getCurrentSubTree ( ) { } public ReportTreeModel getTreeModel ( ) { } public void setTreeModel ( ReportTreeModel newTreeModel ) { } public ValueReplacer getReplacer ( ) { } public void setMainFrame ( ReportMainFrame newMainFrame ) { } public ReportMainFrame getMainFrame ( ) { } public void setTreeListener ( ReportTreeListener newTreeListener ) { } public ReportTreeListener getTreeListener ( ) { } public void displayPopUp ( MouseEvent e , JPopupMenu popup ) { } public void displayPopUp ( Component invoker , MouseEvent e , JPopupMenu popup ) { } public void localeChanged ( LocaleChangeEvent event ) { } private String reportPlanFile ; public void setReportPlanFile ( String f ) { reportPlanFile = f ; ReportGuiPackage . getInstance ( ) . getMainFrame ( ) . setExtendedFrameTitle ( reportPlanFile ) ; try { FileServer . getFileServer ( ) . setBasedir ( reportPlanFile ) ; <START_BUG> } catch ( IOException e1 ) { <END_BUG> ReportGuiPackage . log . error ( "Failure<seq2seq4repair_space>setting<seq2seq4repair_space>file<seq2seq4repair_space>server's<seq2seq4repair_space>base<seq2seq4repair_space>dir" , e1 ) ; } } public String getReportPlanFile ( ) { } }

Fix:
} catch ( IllegalStateException e1 ) {
Buggy code:
public class MongoDBClientSingleton { private static boolean initialized = false ; private static transient List < Map < String , Object > > mongoServers ; private static transient List < Map < String , Object > > mongoCredentials ; private MongoClient mongoClient ; private static final Logger logger = LoggerFactory . getLogger ( MongoDBClientSingleton . class ) ; private MongoDBClientSingleton ( ) { } public static void init ( Configuration conf ) { } private void setup ( ) throws UnknownHostException { if ( MongoDBClientSingleton . isInitialized ( ) ) { List < ServerAddress > servers = new ArrayList < > ( ) ; List < MongoCredential > credentials = new ArrayList < > ( ) ; for ( Map < String , Object > mongoServer : MongoDBClientSingleton . mongoServers ) { Object mongoHost = mongoServer . get ( MONGO_HOST_KEY ) ; Object mongoPort = mongoServer . get ( MONGO_PORT_KEY ) ; if ( ( ( ( mongoHost != null ) && ( mongoHost instanceof String ) ) && ( mongoPort != null ) ) && ( mongoPort instanceof Integer ) ) { servers . add ( new ServerAddress ( ( ( String ) ( mongoHost ) ) , ( ( int ) ( mongoPort ) ) ) ) ; } } if ( ( MongoDBClientSingleton . mongoCredentials ) != null ) { MongoDBClientSingleton . mongoCredentials . stream ( ) . forEach ( ( mongoCredential ) -> { Object mongoAuthDb = mongoCredential . get ( MONGO_AUTH_DB_KEY ) ; Object mongoUser = mongoCredential . get ( MONGO_USER_KEY ) ; Object mongoPwd = mongoCredential . get ( MONGO_PASSWORD_KEY ) ; if ( ( ( ( ( ( mongoAuthDb != null ) && ( mongoAuthDb instanceof String ) ) && ( mongoUser != null ) ) && ( mongoUser instanceof String ) ) && ( mongoPwd != null ) ) && ( mongoPwd instanceof String ) ) { <START_BUG> credentials . add ( MongoCredential . createMongoCRCredential ( ( ( String ) ( mongoUser ) ) , ( ( String ) ( mongoAuthDb ) ) , ( ( String ) ( mongoPwd ) ) . toCharArray ( ) ) ) ; <END_BUG> } } ) ; } MongoClientOptions opts = MongoClientOptions . builder ( ) . readPreference ( ReadPreference . primaryPreferred ( ) ) . writeConcern ( ACKNOWLEDGED ) . build ( ) ; mongoClient = new MongoClient ( servers , credentials , opts ) ; } } public static MongoDBClientSingleton getInstance ( ) { } private static class MongoDBClientSingletonHolder { private static final MongoDBClientSingleton INSTANCE = new MongoDBClientSingleton ( ) ; } public MongoClient getClient ( ) { } public static boolean isInitialized ( ) { } }

Fix:
credentials . add ( MongoCredential . createCredential ( ( ( String ) ( mongoUser ) ) , ( ( String ) ( mongoAuthDb ) ) , ( ( String ) ( mongoPwd ) ) . toCharArray ( ) ) ) ;
Buggy code:
public class BodyTrackerContainer { private Container container ; private ConnectionView connectionView ; private ControlView controlsView ; private int canvasWidth ; private int canvasHeight ; private Map < RenderCanvasEnum , RenderCanvas > mapCanvases ; private JPanel canvasPanel ; private RenderCanvas canvas ; public BodyTrackerContainer ( Container contentPane ) { } private void initBodyTrackerGUI ( ) { } private void setCanvasWidthAndHeight ( ) { } private void initMapCanvases ( ) { } public ControlView getControlsView ( ) { } public ConnectionView getConnectionView ( ) { } public RenderCanvas getCanvas ( ) { } public void fillAvailablePortsComboBox ( ArrayList < String > availablePorts ) { } public String getSelectedPort ( ) { } public void enableConnectButton ( boolean enable ) { } public String getSelectedCanvas ( ) { } public void changeCanvasToUserSelection ( ) { } public void enableLoadFileButton ( boolean enable ) { } public void enableStreamButton ( boolean enable ) { } public void displayError ( String error ) { } public void saveCanvas ( ) { if ( ( canvas ) != null ) { <START_BUG> canvas . save ( "Side" ) ; <END_BUG> } } public void clearCanvas ( ) { } public void destroyCanvas ( ) { } public void finalRender ( ) { } public Container getContainer ( ) { } }

Fix:
canvas . save ( getSelectedCanvas ( ) ) ;
Buggy code:
public abstract class Resource implements IResourceListener { private static Log log = LogFactory . getLog ( Resource . class ) ; protected IResourceStream resourceStream ; private boolean cacheable ; protected Resource ( ) { } public abstract IResourceStream getResourceStream ( ) { } public boolean isCacheable ( ) { } public final void onResourceRequested ( ) { } public final void setCacheable ( boolean cacheable ) { } protected void invalidate ( ) { } private final void init ( ) { } private final void respond ( final Response response ) { try { final OutputStream out = response . getOutputStream ( ) ; try { Streams . copy ( resourceStream . getInputStream ( ) , out ) ; } finally { resourceStream . close ( ) ; out . flush ( ) ; } } catch ( SocketException se ) { String message = se . getMessage ( ) ; <START_BUG> if ( ( message != null ) && ( message . startsWith ( "Connection<seq2seq4repair_space>reset" ) ) ) { <END_BUG> if ( Resource . log . isDebugEnabled ( ) ) { Resource . log . debug ( "Socket<seq2seq4repair_space>exception<seq2seq4repair_space>ignored<seq2seq4repair_space>for<seq2seq4repair_space>sending<seq2seq4repair_space>Resource<seq2seq4repair_space>response<seq2seq4repair_space>to<seq2seq4repair_space>client<seq2seq4repair_space>(ClientAbort)" , se ) ; } } else { throw new WicketRuntimeException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>render<seq2seq4repair_space>resource<seq2seq4repair_space>stream<seq2seq4repair_space>" + ( resourceStream ) ) , se ) ; } } catch ( Exception e ) { throw new WicketRuntimeException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>render<seq2seq4repair_space>resource<seq2seq4repair_space>stream<seq2seq4repair_space>" + ( resourceStream ) ) , e ) ; } } }

Fix:
if ( ( message != null ) && ( ( message . indexOf ( "Connection<seq2seq4repair_space>reset" ) ) != ( - 1 ) ) ) {
Buggy code:
public class FieldBinding extends VariableBinding { public ReferenceBinding declaringClass ; protected FieldBinding ( ) { } public FieldBinding ( char [ ] name , TypeBinding type , int modifiers , ReferenceBinding declaringClass , Constant constant ) { } public FieldBinding ( FieldBinding initialFieldBinding , ReferenceBinding declaringClass ) { } public FieldBinding ( FieldDeclaration field , TypeBinding type , int modifiers , ReferenceBinding declaringClass ) { } public final boolean canBeSeenBy ( PackageBinding invocationPackage ) { } public final boolean canBeSeenBy ( TypeBinding receiverType , InvocationSite invocationSite , Scope scope ) { } public char [ ] computeUniqueKey ( boolean isLeaf ) { } public Constant constant ( ) { Constant fieldConstant = this . constant ; if ( fieldConstant == null ) { if ( this . isFinal ( ) ) { FieldBinding originalField = this . original ( ) ; if ( ( originalField . declaringClass ) instanceof SourceTypeBinding ) { SourceTypeBinding sourceType = ( ( SourceTypeBinding ) ( originalField . declaringClass ) ) ; if ( ( sourceType . scope ) != null ) { TypeDeclaration typeDecl = sourceType . scope . referenceContext ; FieldDeclaration fieldDecl = typeDecl . declarationOf ( originalField ) ; fieldDecl . resolve ( ( originalField . isStatic ( ) ? typeDecl . staticInitializerScope : typeDecl . initializerScope ) ) ; <START_BUG> fieldConstant = originalField . constant ( ) ; <END_BUG> } else { fieldConstant = Constant . NotAConstant ; } } else { fieldConstant = Constant . NotAConstant ; } } else { fieldConstant = Constant . NotAConstant ; } this . constant = fieldConstant ; } return fieldConstant ; } public char [ ] genericSignature ( ) { } public final int getAccessFlags ( ) { } public AnnotationBinding [ ] getAnnotations ( ) { } public long getAnnotationTagBits ( ) { } public final boolean isDefault ( ) { } public final boolean isDeprecated ( ) { } public final boolean isPrivate ( ) { } public final boolean isProtected ( ) { } public final boolean isPublic ( ) { } public final boolean isStatic ( ) { } public final boolean isSynthetic ( ) { } public final boolean isTransient ( ) { } public final boolean isUsed ( ) { } public final boolean isViewedAsDeprecated ( ) { } public final boolean isVolatile ( ) { } public final int kind ( ) { } public FieldBinding original ( ) { } public void setAnnotations ( AnnotationBinding [ ] annotations ) { } public FieldDeclaration sourceField ( ) { } }

Fix:
fieldConstant = ( ( originalField . constant ) == null ) ? Constant . NotAConstant : originalField . constant ;
Buggy code:
public class UnconditionalFlowInfo extends FlowInfo { public long definiteInits ; long potentialInits ; public long [ ] extraDefiniteInits ; long [ ] extraPotentialInits ; public boolean isFakeReachable ; public int maxFieldCount ; public static final int BitCacheSize = 64 ; UnconditionalFlowInfo ( ) { } public UnconditionalFlowInfo addInitializationsFrom ( UnconditionalFlowInfo otherInits ) { } public UnconditionalFlowInfo addPotentialInitializationsFrom ( UnconditionalFlowInfo otherInits ) { } public boolean complainIfUnreachable ( Statement statement , BlockScope scope ) { boolean isDeadEnd ; if ( ( isDeadEnd = ( this ) == ( DeadEnd ) ) || ( isFakeReachable ) ) { <START_BUG> statement . bits &= ~ ( IsReachableMASK ) ; <END_BUG> if ( isDeadEnd ) scope . problemReporter ( ) . unreachableCode ( statement ) ; return isDeadEnd ; } return false ; } public FlowInfo copy ( ) { } public FlowInfo initsWhenFalse ( ) { } public FlowInfo initsWhenTrue ( ) { } private final boolean isDefinitelyAssigned ( int position ) { } public final boolean isDefinitelyAssigned ( FieldBinding field ) { } public final boolean isDefinitelyAssigned ( LocalVariableBinding local ) { } public boolean isFakeReachable ( ) { } private final boolean isPotentiallyAssigned ( int position ) { } public final boolean isPotentiallyAssigned ( FieldBinding field ) { } public final boolean isPotentiallyAssigned ( LocalVariableBinding local ) { } private final void markAsDefinitelyAssigned ( int position ) { } public void markAsDefinitelyAssigned ( FieldBinding field ) { } public void markAsDefinitelyAssigned ( LocalVariableBinding local ) { } private final void markAsDefinitelyNotAssigned ( int position ) { } public void markAsDefinitelyNotAssigned ( FieldBinding field ) { } public void markAsDefinitelyNotAssigned ( LocalVariableBinding local ) { } public FlowInfo markAsFakeReachable ( boolean isFakeReachable ) { } public UnconditionalFlowInfo mergedWith ( UnconditionalFlowInfo otherInits ) { } static int numberOfEnclosingFields ( ReferenceBinding type ) { } public String toString ( ) { } public UnconditionalFlowInfo unconditionalInits ( ) { } }

Fix:
statement . bits &= ~ ( AstNode . IsReachableMASK ) ;
Buggy code:
public class PluginValue extends ObjectValue { private static final Localizer _loc = Localizer . forPackage ( PluginValue . class ) ; private final boolean _singleton ; private String _name = null ; private String _props = null ; public PluginValue ( String prop , boolean singleton ) { } public boolean isSingleton ( ) { } public String getClassName ( ) { } public void setClassName ( String name ) { } public String getProperties ( ) { } public void setProperties ( String props ) { } public Object instantiate ( Class type , Configuration conf , boolean fatal ) { } public void set ( Object obj , boolean derived ) { if ( ! ( _singleton ) ) <START_BUG> throw new IllegalStateException ( PluginValue . _loc . get ( "not-singleton" , getProperty ( ) ) ) ; <END_BUG> super . set ( obj , derived ) ; } public String getString ( ) { } public void setString ( String str ) { } public Class getValueType ( ) { } protected void objectChanged ( ) { } protected String getInternalString ( ) { } protected void setInternalString ( String str ) { } }

Fix:
throw new IllegalStateException ( PluginValue . _loc . get ( "not-singleton" , getProperty ( ) ) . getMessage ( ) ) ;
Buggy code:
public class P4Counter extends P4Base { public String counter = null ; public String property = null ; public boolean shouldSetValue = false ; public boolean shouldSetProperty = false ; public int value = 0 ; public void setName ( String counter ) { } public void setProperty ( String property ) { } public void setValue ( int value ) { } public void execute ( ) throws TaskException { if ( ( ( counter ) == null ) || ( ( counter . length ( ) ) == 0 ) ) { throw new TaskException ( "No<seq2seq4repair_space>counter<seq2seq4repair_space>specified<seq2seq4repair_space>to<seq2seq4repair_space>retrieve" ) ; } if ( ( shouldSetValue ) && ( shouldSetProperty ) ) { throw new TaskException ( "Cannot<seq2seq4repair_space>both<seq2seq4repair_space>set<seq2seq4repair_space>the<seq2seq4repair_space>value<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>property<seq2seq4repair_space>and<seq2seq4repair_space>retrieve<seq2seq4repair_space>the<seq2seq4repair_space>value<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>property." ) ; } String command = ( ( "counter<seq2seq4repair_space>" + ( P4CmdOpts ) ) + "<seq2seq4repair_space>" ) + ( counter ) ; if ( ! ( shouldSetProperty ) ) { command = "-s<seq2seq4repair_space>" + command ; } if ( shouldSetValue ) { command += "<seq2seq4repair_space>" + ( value ) ; } if ( shouldSetProperty ) { final Project myProj = project ; P4Handler handler = new P4HandlerAdapter ( ) { public void process ( String line ) { log ( ( ( "P4Counter<seq2seq4repair_space>retrieved<seq2seq4repair_space>line<seq2seq4repair_space>\"" + line ) + "\"" ) , MSG_VERBOSE ) ; try { value = Integer . parseInt ( line ) ; <START_BUG> myProj . setProperty ( property , ( "" + ( value ) ) ) ; <END_BUG> } catch ( NumberFormatException nfe ) { throw new TaskException ( "Perforce<seq2seq4repair_space>error.<seq2seq4repair_space>Could<seq2seq4repair_space>not<seq2seq4repair_space>retrieve<seq2seq4repair_space>counter<seq2seq4repair_space>value." ) ; } } } ; execP4Command ( command , handler ) ; } else { execP4Command ( command , new SimpleP4OutputHandler ( this ) ) ; } } }

Fix:
setProperty ( property , ( "" + ( value ) ) ) ;
Buggy code:
public class LoadProperties extends Task { private Resource src = null ; private final Vector filterChains = new Vector ( ) ; private String encoding = null ; public final void setSrcFile ( final File srcFile ) { } public void setResource ( String resource ) { } public final void setEncoding ( final String encoding ) { } public void setClasspath ( Path classpath ) { } public Path createClasspath ( ) { } public void setClasspathRef ( Reference r ) { } public Path getClasspath ( ) { } public final void execute ( ) throws BuildException { if ( ( src ) == null ) { throw new BuildException ( "A<seq2seq4repair_space>source<seq2seq4repair_space>resource<seq2seq4repair_space>is<seq2seq4repair_space>required." ) ; } if ( ! ( src . isExists ( ) ) ) { if ( ( src ) instanceof JavaResource ) { log ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>resource<seq2seq4repair_space>" + ( src ) ) , MSG_WARN ) ; return ; } throw new BuildException ( ( "Source<seq2seq4repair_space>resource<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist:<seq2seq4repair_space>" + ( src ) ) ) ; } BufferedInputStream bis = null ; Reader instream = null ; ByteArrayInputStream tis = null ; try { bis = new BufferedInputStream ( src . getInputStream ( ) ) ; if ( ( encoding ) == null ) { instream = new InputStreamReader ( bis ) ; } else { instream = new InputStreamReader ( bis , encoding ) ; } ChainReaderHelper crh = new ChainReaderHelper ( ) ; crh . setPrimaryReader ( instream ) ; crh . setFilterChains ( filterChains ) ; crh . setProject ( getProject ( ) ) ; instream = crh . getAssembledReader ( ) ; String text = crh . readFully ( instream ) ; if ( ( text != null ) && ( ( text . length ( ) ) != 0 ) ) { if ( ! ( text . endsWith ( "\n" ) ) ) { text = text + "\n" ; } <START_BUG> tis = new ByteArrayInputStream ( text . getBytes ( ) ) ; <END_BUG> final Properties props = new Properties ( ) ; props . load ( tis ) ; Property propertyTask = new Property ( ) ; propertyTask . bindToOwner ( this ) ; propertyTask . addProperties ( props ) ; } } catch ( final IOException ioe ) { throw new BuildException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>file:<seq2seq4repair_space>" + ioe ) , ioe , getLocation ( ) ) ; } finally { FileUtils . close ( bis ) ; FileUtils . close ( tis ) ; } } public final void addFilterChain ( FilterChain filter ) { } public synchronized void addConfigured ( ResourceCollection a ) { } private synchronized JavaResource getRequiredJavaResource ( ) { } }

Fix:
tis = new ByteArrayInputStream ( text . getBytes ( "ISO8859_1" ) ) ;
Buggy code:
public class PlaneSurface implements Surface { private final double dxlo_ ; private final double dxhi_ ; private final double dylo_ ; private final double dyhi_ ; private final boolean xlog_ ; private final boolean ylog_ ; private final boolean xflip_ ; private final boolean yflip_ ; private final int gxlo_ ; private final int gxhi_ ; private final int gylo_ ; private final int gyhi_ ; private final Tick [ ] xticks_ ; private final Tick [ ] yticks_ ; private final String xlabel_ ; private final String ylabel_ ; private final Captioner captioner_ ; private final Color gridcolor_ ; private final Color axlabelcolor_ ; private final Axis xAxis_ ; private final Axis yAxis_ ; public PlaneSurface ( int gxlo , int gxhi , int gylo , int gyhi , double dxlo , double dxhi , double dylo , double dyhi , boolean xlog , boolean ylog , boolean xflip , boolean yflip , Tick [ ] xticks , Tick [ ] yticks , String xlabel , String ylabel , Captioner captioner , Color gridcolor , Color axlabelcolor ) { } public Rectangle getPlotBounds ( ) { } public Insets getPlotInsets ( boolean withScroll ) { } public int getDataDimCount ( ) { } public boolean dataToGraphics ( double [ ] dpos , boolean visibleOnly , Point2D . Double gp ) { double gx = xAxis_ . dataToGraphics ( dpos [ 0 ] ) ; double gy = yAxis_ . dataToGraphics ( dpos [ 1 ] ) ; <START_BUG> if ( ( ! visibleOnly ) || ( ( ( ( gx >= ( gxlo_ ) ) && ( gx <= ( gxhi_ ) ) ) && ( gy >= ( gylo_ ) ) ) && ( gy <= ( gyhi_ ) ) ) ) { <END_BUG> gp . x = gx ; gp . y = gy ; return true ; } else { return false ; } } public boolean dataToGraphicsOffset ( double [ ] dpos0 , Point2D . Double gpos0 , double [ ] dpos1 , boolean visibleOnly , Point2D . Double gpos1 ) { } public double [ ] graphicsToData ( Point2D gp , Iterable < double [ ] > dposIt ) { } public String formatPosition ( double [ ] dpos ) { } public Captioner getCaptioner ( ) { } public void paintBackground ( Graphics g ) { } public void paintForeground ( Graphics g ) { } public double [ ] [ ] getDataLimits ( ) { } public boolean [ ] getLogFlags ( ) { } public boolean [ ] getFlipFlags ( ) { } PlaneAspect zoom ( Point2D pos , double xZoom , double yZoom ) { } PlaneAspect pan ( Point2D pos0 , Point2D pos1 , boolean xFlag , boolean yFlag ) { } PlaneAspect center ( double [ ] dpos , boolean xFlag , boolean yFlag ) { } PlaneAspect reframe ( Rectangle frame ) { } private AxisAnnotation createAxisAnnotation ( ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } public static PlaneSurface createSurface ( Rectangle plotBounds , PlaneAspect aspect , boolean xlog , boolean ylog , boolean xflip , boolean yflip , String xlabel , String ylabel , Captioner captioner , double xyfactor , boolean grid , double xcrowd , double ycrowd , boolean minor , Color gridcolor , Color axlabelcolor ) { } public static String formatPosition ( Axis axis , double dpos ) { } }

Fix:
if ( ( ! visibleOnly ) || ( ( ( ( gx >= ( gxlo_ ) ) && ( gx < ( gxhi_ ) ) ) && ( gy >= ( gylo_ ) ) ) && ( gy < ( gyhi_ ) ) ) ) {
Buggy code:
public class FloatConverter extends AbstractDecimalConverter < Float > { private static final long serialVersionUID = 1L ; public static final IConverter < Float > INSTANCE = new FloatConverter ( ) ; <START_BUG> public Float convertToObject ( final String value , Locale locale ) { <END_BUG> final Number number = parse ( value , ( - ( Float . MAX_VALUE ) ) , Float . MAX_VALUE , locale ) ; if ( number == null ) { return null ; } return number . floatValue ( ) ; } @ Override protected Class < Float > getTargetType ( ) { } }

Fix:
public Float convertToObject ( final String value , final Locale locale ) {
Buggy code:
public class SchemaLoader { @ BeforeClass public static void loadSchema ( ) { } public static Collection < KSMetaData > schemaDefinition ( ) { } private static CFMetaData standardCFMD ( String ksName , String cfName ) { } private static CFMetaData superCFMD ( String ksName , String cfName , AbstractType subcc ) { } private static CFMetaData indexCFMD ( String ksName , String cfName , final Boolean withIdxType ) { } private static CFMetaData jdbcCFMD ( String ksName , String cfName , AbstractType comp ) { <START_BUG> return new CFMetaData ( ksName , cfName , ColumnFamilyType . Standard , comp , comp ) ; <END_BUG> } }

Fix:
return new CFMetaData ( ksName , cfName , ColumnFamilyType . Standard , comp , null ) . defaultValidator ( comp ) ;
Buggy code:
public final class ComplexNegate < T extends ComplexType < T > , U extends ComplexType < U > > implements UnaryOperation < T , U > { private final U type ; public ComplexNegate ( U type ) { } @ Override public U compute ( T z , U output ) { <START_BUG> double x = z . getRealDouble ( ) ; <END_BUG> double y = - ( z . getImaginaryDouble ( ) ) ; output . setComplexNumber ( x , y ) ; return output ; } @ Override public ComplexNegate < T , U > copy ( ) { } }

Fix:
double x = - ( z . getRealDouble ( ) ) ;
Buggy code:
public final class ReportMenuFactory { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; public static final String TIMERS = "menu_timer" ; public static final String CONTROLLERS = "menu_logic_controller" ; public static final String CONFIG_ELEMENTS = "menu_config_element" ; public static final String POST_PROCESSORS = "menu_post_processors" ; public static final String PRE_PROCESSORS = "menu_pre_processors" ; public static final String NON_TEST_ELEMENTS = "menu_non_test_elements" ; public static final String LISTENERS = "menu_listener" ; public static final String REPORT_PAGE = "menu_report_page" ; public static final String TABLES = "menu_tables" ; private static final Map menuMap = new HashMap ( ) ; private static final Set elementsToSkip = new HashSet ( ) ; private static final String [ ] MENU_ADD_CONTROLLER = new String [ ] { ReportMenuFactory . CONTROLLERS , ReportMenuFactory . CONFIG_ELEMENTS , ReportMenuFactory . TIMERS , ReportMenuFactory . LISTENERS , ReportMenuFactory . PRE_PROCESSORS , ReportMenuFactory . POST_PROCESSORS } ; private static final String [ ] MENU_PARENT_CONTROLLER = new String [ ] { ReportMenuFactory . CONTROLLERS } ; private static List controllers ; private static List configElements ; private static List listeners ; private static List nonTestElements ; private static List postProcessors ; private static List preProcessors ; private static List reportPage ; private static List tables ; private ReportMenuFactory ( ) { } public static String doNothing ( ) { } public static void addEditMenu ( JPopupMenu menu , boolean removable ) { } public static void addFileMenu ( JPopupMenu menu ) { } public static JMenu makeMenus ( String [ ] categories , String label , String actionCommand ) { } public static JPopupMenu getDefaultControllerMenu ( ) { } public static JPopupMenu getDefaultConfigElementMenu ( ) { } public static JPopupMenu getDefaultVisualizerMenu ( ) { } public static JPopupMenu getDefaultTimerMenu ( ) { } public static JPopupMenu getDefaultAssertionMenu ( ) { } public static JPopupMenu getDefaultExtractorMenu ( ) { } public static JMenu makeMenu ( String category , String actionCommand ) { } public static JMenu makeMenu ( Collection menuInfo , String actionCommand , String menuName ) { Iterator iter = menuInfo . iterator ( ) ; JMenu menu = new JMenu ( menuName ) ; while ( iter . hasNext ( ) ) { MenuInfo info = ( ( MenuInfo ) ( iter . next ( ) ) ) ; <START_BUG> menu . add ( ReportMenuFactory . makeMenuItem ( info . label , info . className , actionCommand ) ) ; <END_BUG> } return menu ; } public static void setEnabled ( JMenu menu ) { } public static JMenuItem makeMenuItem ( String label , String name , String actionCommand ) { } public static JMenuItem makeMenuItem ( String label , String name , String actionCommand , KeyStroke accel ) { } private static void initializeMenus ( ) { } private static void addSeparator ( JPopupMenu menu ) { } }

Fix:
menu . add ( ReportMenuFactory . makeMenuItem ( info . getLabel ( ) , info . getClassName ( ) , actionCommand ) ) ;
Buggy code:
public class Crawler2 { int count = 0 ; List < String > LinksSet = new ArrayList < String > ( ) ; int flag = 0 ; String Dname = "" ; ArrayList < String > domainName = new ArrayList < String > ( ) ; int flag1 = 0 ; int flag2 = 0 ; String Dname1 = "" ; Map < String , Integer > domainCount = new HashMap < String , Integer > ( ) ; static int i = 0 ; public void crawl ( String url1 , int depth ) { try { if ( ( flag ) == 0 ) { Dname = getDomainName ( url1 ) ; flag = 1 ; } System . out . println ( ) ; System . out . println ( ( "Crawling:<seq2seq4repair_space>" + url1 ) ) ; Tika tika = new Tika ( ) ; tika . setMaxStringLength ( ( ( 10 * 1024 ) * 1024 ) ) ; Metadata met = new Metadata ( ) ; URL url = new URL ( url1 ) ; ToHTMLContentHandler toHTMLHandler = new ToHTMLContentHandler ( ) ; ParseContext parseContext = new ParseContext ( ) ; LinkContentHandler linkHandler = new LinkContentHandler ( ) ; ContentHandler textHandler = new BodyContentHandler ( ( ( 10 * 1024 ) * 1024 ) ) ; TeeContentHandler teeHandler = new TeeContentHandler ( linkHandler , textHandler , toHTMLHandler ) ; AutoDetectParser parser = new AutoDetectParser ( ) ; parser . parse ( url . openStream ( ) , teeHandler , met , parseContext ) ; new Crawl ( ) . parse ( url1 ) ; List < Link > links = linkHandler . getLinks ( ) ; <START_BUG> if ( ( Crawler2 . i ) < 100 ) { <END_BUG> if ( ( links != null ) && ( ( links . size ( ) ) > 0 ) ) { for ( Link l : links ) { if ( l . getUri ( ) . startsWith ( "http" ) ) { ( Crawler2 . i ) ++ ; if ( getDomainName ( l . getUri ( ) ) . equals ( Dname ) ) { if ( ! ( LinksSet . contains ( l . getUri ( ) ) ) ) { LinksSet . add ( l . getUri ( ) ) ; crawl ( l . getUri ( ) , depth ) ; } } else { if ( ( flag1 ) == 0 ) { Dname1 = getDomainName ( l . getUri ( ) ) ; flag1 = 1 ; } if ( ( count ) < depth ) { if ( getDomainName ( l . getUri ( ) ) . equals ( Dname1 ) ) { if ( ! ( LinksSet . contains ( l . getUri ( ) ) ) ) { ( count ) ++ ; LinksSet . add ( l . getUri ( ) ) ; System . out . println ( ( ( "Current<seq2seq4repair_space>Depth:<seq2seq4repair_space>" + ( count ) ) + "\n" ) ) ; crawl ( l . getUri ( ) , depth ) ; } } } else { flag1 = 0 ; count = 0 ; continue ; } } } else continue ; } } else return ; } } catch ( Exception e ) { } } private String getDomainName ( String URL ) { } }

Fix:
if ( ( Crawler2 . i ) < 300 ) {