nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class PerspectiveMenu extends ContributionItem { private static IPerspectiveRegistry reg ; private IWorkbenchWindow window ; private boolean showActive = false ; private boolean dirty = true ; private IMenuListener menuListener = new IMenuListener ( ) { public void menuAboutToShow ( IMenuManager manager ) { } } ; private Comparator comparator = new Comparator ( ) { private Collator collator = Collator . getInstance ( ) ; public int compare ( Object ob1 , Object ob2 ) { } } ; private static Hashtable imageCache = new Hashtable ( 11 ) ; public PerspectiveMenu ( IWorkbenchWindow window , String id ) { } void createMenuItem ( Menu menu , int index , final IPerspectiveDescriptor desc , boolean bCheck ) { } void createOtherItem ( Menu menu , int index ) { } public void fill ( Menu menu , int index ) { } private Image getImage ( IPerspectiveDescriptor perspDesc ) { } private ArrayList getPerspectiveShortcuts ( ) { ArrayList list = new ArrayList ( ) ; IWorkbenchPage page = window . getActivePage ( ) ; if ( page == null ) return list ; ArrayList ids = new ArrayList ( ( ( org . eclipse . ui . internal . WorkbenchPage ) ( page ) ) . getPerspectiveActionIds ( ) ) ; if ( ids == null ) return list ; <START_BUG> IObjectActivityManager activityManager = window . getWorkbench ( ) . getActivityManager ( PL_PERSPECTIVES , false ) ; <END_BUG> if ( activityManager != null ) { ids . retainAll ( activityManager . getActiveObjects ( ) ) ; } for ( int i = 0 ; i < ( ids . size ( ) ) ; i ++ ) { String perspID = ( ( String ) ( ids . get ( i ) ) ) ; IPerspectiveDescriptor desc = PerspectiveMenu . reg . findPerspectiveWithId ( perspID ) ; if ( ( desc != null ) && ( ! ( list . contains ( desc ) ) ) ) list . add ( desc ) ; } return list ; } protected ArrayList getPerspectiveItems ( ) { } protected boolean getShowActive ( ) { } protected IWorkbenchWindow getWindow ( ) { } public boolean isDirty ( ) { } public boolean isDynamic ( ) { } protected abstract void run ( IPerspectiveDescriptor desc ) { } protected void run ( IPerspectiveDescriptor desc , SelectionEvent event ) { } void runOther ( SelectionEvent event ) { } protected void showActive ( boolean b ) { } }

Fix:
IObjectActivityManager activityManager = window . getWorkbench ( ) . getObjectActivityManager ( PL_PERSPECTIVES , false ) ;
Buggy code:
public class TableColumn extends Item { Table parent ; String displayText = "" ; int width ; boolean moveable ; boolean resizable = true ; int sort = SWT . NONE ; String toolTipText ; public TableColumn ( Table parent , int style ) { } public TableColumn ( Table parent , int style , int index ) { } public void addControlListener ( ControlListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } static Table checkNull ( Table table ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } void computeDisplayText ( GC gc ) { } public void dispose ( ) { } void dispose ( boolean notifyParent ) { } public int getAlignment ( ) { } int getContentWidth ( GC gc , boolean useDisplayText ) { } int getIndex ( ) { } public boolean getMoveable ( ) { } int getOrderIndex ( ) { } public Table getParent ( ) { } int getPreferredWidth ( ) { } public boolean getResizable ( ) { } public String getToolTipText ( ) { } public int getWidth ( ) { } int getX ( ) { } public void pack ( ) { } void paint ( GC gc ) { } public void removeControlListener ( ControlListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void setAlignment ( int alignment ) { } public void setImage ( Image value ) { } public void setMoveable ( boolean moveable ) { } public void setResizable ( boolean value ) { } void setSortDirection ( int value ) { } public void setText ( String value ) { } public void setToolTipText ( String string ) { } public void setWidth ( int value ) { } void updateFont ( GC gc ) { } void updateWidth ( GC gc ) { String oldDisplayText = displayText ; computeDisplayText ( gc ) ; if ( ( ( ( style ) & ( SWT . LEFT ) ) == 0 ) || ( ! ( oldDisplayText . equals ( displayText ) ) ) ) { int padding = parent . getHeaderPadding ( ) ; <START_BUG> parent . header . redraw ( ( ( getX ( ) ) + padding ) , 0 , ( ( width ) - padding ) , parent . header . getBounds ( ) . height , false ) ; <END_BUG> } } }

Fix:
parent . header . redraw ( ( ( getX ( ) ) + padding ) , 0 , ( ( width ) - padding ) , parent . getHeaderHeight ( ) , false ) ;
Buggy code:
public class SimpleDataWriterBuilder extends DataWriterBuilder < String , byte [ ] > { @ Override public DataWriter < byte [ ] > build ( ) throws IOException { <START_BUG> return new SimpleDataWriter ( this . destination . getProperties ( ) , this . writerId , this . branch , new Byte ( "\n" ) ) ; <END_BUG> } }

Fix:
return new SimpleDataWriter ( this . destination . getProperties ( ) , this . writerId , this . branch , "\n" . getBytes ( ) [ 0 ] ) ;
Buggy code:
public class CssUtilIE10Impl implements CssUtilImpl { public CssUtilIE10Impl ( ) { } @ Override public void translate ( Element el , int x , int y ) { } @ Override public native void setDelay ( Element el , int milliseconds ) { } @ Override public native void setOpacity ( Element el , double opacity ) { } @ Override public native void setDuration ( Element el , int time ) { } private native void _translate ( Element el , String css ) { } @ Override public void rotate ( Element el , int degree ) { } @ Override public boolean hasTransform ( ) { } @ Override public boolean hasTransistionEndEvent ( ) { } @ Override public boolean has3d ( ) { } @ Override public String getTransformProperty ( ) { } @ Override public int [ ] getPositionFromTransForm ( Element element ) { } private native JsArrayInteger getPositionFromTransform ( Element el ) { } @ Override public native int getTopPositionFromCssPosition ( Element element ) { } @ Override public native int getLeftPositionFromCssPosition ( Element element ) { } @ Override public native void resetTransform ( Element el ) { } @ Override public native void setTransistionProperty ( Element element , String string ) { } @ Override public native void setTransFormOrigin ( Element el , int x , int y ) { } @ Override <START_BUG> public native void setTransistionTimingFunction ( Element element , String string ) ; <END_BUG> @ Override public void setTranslateAndZoom ( Element el , int x , int y , double scale ) { } @ Override public void translatePercent ( Element el , double x , double y ) { } }

Fix:
public native void setTransistionTimingFunction ( Element el , String string ) ;
Buggy code:
public class HttpIndexSearcher { private static volatile HttpSolrServer service ; public static String url ; public HttpIndexSearcher ( ) { } public static HttpSolrServer getService ( ) { } public long searchTermSize ( String term ) throws SolrServerException { String queryTerm = ( "\"" + term ) + "\"" ; SolrQuery query = new SolrQuery ( ) ; <START_BUG> query . setQuery ( term ) ; <END_BUG> QueryResponse rsp = HttpIndexSearcher . getService ( ) . query ( query ) ; SolrDocumentList docs = rsp . getResults ( ) ; return docs . getNumFound ( ) ; } public long searchMultipleTerm ( String [ ] terms ) throws SolrServerException { } }

Fix:
query . setQuery ( queryTerm ) ;
Buggy code:
public class GcmIntentService extends IntentService { public static final int NOTIFICATION_OAUTH_RES_ID = 1 ; public static final int NOTIFICATION_SESSION_ID = 1872 ; private final PreferenceAccess preferenceAccess ; private BackendServer backendServer ; private GoogleFitAPIHelper googleFitAPIHelper ; private NotificationManager mNotificationManager ; private PendingIntent mainActivityContentIntent ; private StandAppMessages typeOfWork = null ; private static final boolean SUBSCRIBE_TO_STEPS = false ; private static final boolean UNSUBSCRIBE_TO_STEPS = false ; private Intent intent ; public GcmIntentService ( ) { } @ Override protected void onHandleIntent ( Intent intent ) { } private void disconnectGoogleFitAndReleaseWakeLock ( ) { } private boolean messageOriginatedFromPhone ( Bundle extras ) { } private void sendMessageToChromeToEndBreak ( ) { } private void releaseWakeLock ( ) { } private void startWorkout ( ) { } private void endWorkout ( ) { } private void unsubscribeFromSteps ( ) { } private void endSessionAndCreateNewOne ( String oldSessionId ) { } private void endSession ( ) { } private void clearRecordingNotification ( ) { } private void initFitnessClientAndConnect ( StandAppMessages typeOfWork ) { } private void createSession ( ) { } private Session getBeginSession ( ) { } private void createRecordingNotification ( ) { String msg = getResources ( ) . getString ( notif_in_session_msg ) ; <START_BUG> NotificationCompat . Builder mBuilder = new NotificationCompat . Builder ( this ) . setSmallIcon ( sa_ic_applauncher ) . setContentTitle ( getResources ( ) . getString ( notif_in_session_title ) ) . setStyle ( new NotificationCompat . BigTextStyle ( ) . bigText ( msg ) ) . setOngoing ( true ) . setContentText ( msg ) ; <END_BUG> PendingIntent endWorkoutPendingIntent = PendingIntent . getService ( this , 0 , new Intent ( this , GcmIntentService . class ) , FLAG_CANCEL_CURRENT ) ; mBuilder . setContentIntent ( endWorkoutPendingIntent ) ; mNotificationManager . notify ( GcmIntentService . NOTIFICATION_SESSION_ID , mBuilder . build ( ) ) ; } private ConnectionCallbacks connectionCallbacks ; OnConnectionFailedListener onConnectionFailedListener ; private void sendNotificationOAuthResolution ( ) { } private void subscribeToSteps ( ) { } private void subscribe ( DataType dataType ) { } private void unsubscribe ( final DataType dataType ) { } public void setTypeOfWork ( StandAppMessages typeOfWork ) { } No newline ; at end ; of file ; }

Fix:
NotificationCompat . Builder mBuilder = new NotificationCompat . Builder ( this ) . setSmallIcon ( ic_notif_workout ) . setContentTitle ( getResources ( ) . getString ( notif_in_session_title ) ) . setStyle ( new NotificationCompat . BigTextStyle ( ) . bigText ( msg ) ) . setOngoing ( true ) . setContentText ( msg ) ;
Buggy code:
public class FinderQueryImpl implements FinderQuery < ClassMapping , SelectExecutor , Result > { private final ClassMapping _mapping ; private final SelectImpl _select ; private final Column [ ] _pkCols ; private final Joinable [ ] _joins ; private final int [ ] _pkIndices ; private final SQLBuffer _buffer ; private final String _sql ; static FinderQueryImpl newFinder ( ClassMapping mapping , SelectExecutor select ) { } private FinderQueryImpl ( ClassMapping mapping , SelectImpl select , SQLBuffer buffer ) { } public ClassMapping getIdentifier ( ) { } public SelectExecutor getDelegate ( ) { } public String getQueryString ( ) { } public Column [ ] getPKColumns ( ) { } private Object [ ] getPKValues ( OpenJPAStateManager sm , JDBCStore store ) { } public Result execute ( OpenJPAStateManager sm , StoreManager store , FetchConfiguration fetch ) { boolean forUpdate = false ; JDBCStore jstore = ( ( JDBCStore ) ( store ) ) ; Connection conn = jstore . getConnection ( ) ; DBDictionary dict = jstore . getDBDictionary ( ) ; PreparedStatement stmnt = null ; ResultSet rs = null ; try { stmnt = _select . prepareStatement ( conn , _sql ) ; Object [ ] params = getPKValues ( sm , jstore ) ; if ( stmnt != null ) { for ( int i = 0 ; i < ( params . length ) ; i ++ ) { dict . setUnknown ( stmnt , ( i + 1 ) , params [ i ] , _pkCols [ i ] ) ; } } <START_BUG> rs = _select . executeQuery ( conn , stmnt , getQueryString ( ) , jstore , params ) ; <END_BUG> return _select . getEagerResult ( conn , stmnt , rs , jstore , ( ( JDBCFetchConfiguration ) ( fetch ) ) , forUpdate , _buffer ) ; } catch ( SQLException se ) { if ( stmnt != null ) try { stmnt . close ( ) ; } catch ( SQLException se2 ) { } try { conn . close ( ) ; } catch ( SQLException se2 ) { } throw new RuntimeException ( se ) ; } } private static SelectImpl extractImplementation ( SelectExecutor selector ) { } public String toString ( ) { } }

Fix:
rs = _select . executeQuery ( conn , stmnt , getQueryString ( ) , jstore , params , _pkCols ) ;
Buggy code:
@ ParseClassName ( "OrderItem" ) public class OrderItem extends ParseObject { private Long uid ; private double cost ; private Meal meal ; private int quantity ; public Long getUid ( ) { } public double getCost ( ) { } public Meal getMeal ( ) { <START_BUG> return getMeal ( ) ; <END_BUG> } public int getQuantity ( ) { } public void setUid ( Long uid ) { } public void setCost ( double cost ) { } public void setMeal ( Meal meal ) { } public void setQuantity ( int quantity ) { } public static OrderItem orderItemFromClick ( Meal meal , int quantity ) { } }

Fix:
return ( ( Meal ) ( getParseObject ( "meal" ) ) ) ;
Buggy code:
@ Service ( "accessRecordService" ) public class AccessRecordService { private final Logger logger = LoggerFactory . getLogger ( AccessRecordService . class ) ; @ Resource private AccessRecordDao accessRecordDao ; @ Resource private AccessRecordEntityDao accessRecordEntityDao ; public void update ( ) { } @ SuppressWarnings ( "unchecked" ) public void updateEntityLookupTable ( ) { List < AccessRecord > records = accessRecordDao . nextRecords ( ) ; Map < String , Object > [ ] batchValues = new Map [ records . size ( ) ] ; for ( int i = 0 ; i < ( records . size ( ) ) ; i ++ ) { AccessRecord record = records . get ( i ) ; Map < String , Object > value = new HashMap < String , Object > ( ) ; value . put ( "sessionId" , record . getSessionId ( ) ) ; String entityId = new EntityIdReader ( ) . read ( record ) ; if ( entityId == null ) { value . put ( "entityId" , ( - 1L ) ) ; } else { if ( entityId . startsWith ( "syn" ) ) { entityId = entityId . substring ( 3 ) ; } Long entity ; try { entity = Long . parseLong ( entityId ) ; } catch ( NumberFormatException e ) { entity = ( ( long ) ( - 1 ) ) ; } <START_BUG> value . put ( ":entityId" , entity ) ; <END_BUG> } batchValues [ i ] = value ; } logger . info ( ( ( "Updating<seq2seq4repair_space>" + ( records . size ( ) ) ) + "<seq2seq4repair_space>records<seq2seq4repair_space>..." ) ) ; accessRecordEntityDao . insertNewRecords ( batchValues ) ; logger . info ( ( ( "Finish<seq2seq4repair_space>updating<seq2seq4repair_space>" + ( records . size ( ) ) ) + "<seq2seq4repair_space>records." ) ) ; } }

Fix:
value . put ( "entityId" , entity ) ;
Buggy code:
public class Buffer implements IBuffer { protected IFile file ; protected int flags ; protected char [ ] contents ; protected ArrayList changeListeners ; protected IOpenable owner ; protected int gapStart = - 1 ; protected int gapEnd = - 1 ; protected Object lock = new Object ( ) ; protected static final int F_HAS_UNSAVED_CHANGES = 1 ; protected static final int F_IS_READ_ONLY = 2 ; protected static final int F_IS_CLOSED = 4 ; protected Buffer ( IFile file , IOpenable owner , boolean readOnly ) { } public void addBufferChangedListener ( IBufferChangedListener listener ) { } public void append ( char [ ] text ) { } public void append ( String text ) { } public void close ( ) throws IllegalArgumentException { } public char getChar ( int position ) { } public char [ ] getCharacters ( ) { } public String getContents ( ) { } public int getLength ( ) { } public IOpenable getOwner ( ) { } public String getText ( int offset , int length ) { } public IResource getUnderlyingResource ( ) { } public boolean hasUnsavedChanges ( ) { } public boolean isClosed ( ) { } public boolean isReadOnly ( ) { } protected void moveAndResizeGap ( int position , int size ) { } protected void notifyChanged ( BufferChangedEvent event ) { } public void removeBufferChangedListener ( IBufferChangedListener listener ) { } public void replace ( int position , int length , char [ ] text ) { } public void replace ( int position , int length , String text ) { } public void save ( IProgressMonitor progress , boolean force ) throws JavaModelException { if ( ( isReadOnly ( ) ) || ( ( this . file ) == null ) ) { return ; } synchronized ( this . lock ) { if ( ! ( hasUnsavedChanges ( ) ) ) return ; try { <START_BUG> String encoding = ( ( String ) ( JavaCore . getOptions ( ) . get ( JavaCore . CORE_ENCODING ) ) ) ; <END_BUG> byte [ ] bytes = ( encoding == null ) ? getContents ( ) . getBytes ( ) : getContents ( ) . getBytes ( encoding ) ; ByteArrayInputStream stream = new ByteArrayInputStream ( bytes ) ; this . file . setContents ( stream , ( force ? ( IResource . FORCE ) | ( IResource . KEEP_HISTORY ) : IResource . KEEP_HISTORY ) , null ) ; } catch ( IOException e ) { throw new JavaModelException ( e , IJavaModelStatusConstants . IO_EXCEPTION ) ; } catch ( CoreException e ) { throw new JavaModelException ( e ) ; } this . flags &= ~ ( Buffer . F_HAS_UNSAVED_CHANGES ) ; } } public void setContents ( char [ ] newContents ) { } public void setContents ( String newContents ) { } protected void setReadOnly ( boolean readOnly ) { } public String toString ( ) { } }

Fix:
String encoding = JavaCore . getOption ( JavaCore . CORE_ENCODING ) ;
Buggy code:
public final class AutoLinkResolver implements IComponentResolver { private static final Log log = LogFactory . getLog ( AutoLinkResolver . class ) ; private static final long serialVersionUID = 1L ; private static final ValueMap supportedPageExtensions = new ValueMap ( ) ; public final boolean resolve ( final MarkupContainer container , final MarkupStream markupStream , final ComponentTag tag ) { } private final Component resolveAutomaticLink ( final MarkupContainer container , final String id , final ComponentTag tag ) { } private static final class AutolinkBookmarkablePageLink extends BookmarkablePageLink { private static final long serialVersionUID = 1L ; public AutolinkBookmarkablePageLink ( final String id , final Class pageClass , final PageParameters parameters ) { } public boolean isTransparentResolver ( ) { } } private static final class AutolinkExternalLink extends ExternalLink { private static final long serialVersionUID = 1L ; public AutolinkExternalLink ( final String id , final String href ) { } public boolean isTransparentResolver ( ) { } } private static final class CssLink extends WebMarkupContainer { private static final long serialVersionUID = 1L ; private final ResourceReference resourceReference ; public CssLink ( final String id , final Class clazz , final String href ) { } protected final void onComponentTag ( final ComponentTag tag ) { super . onComponentTag ( tag ) ; <START_BUG> String url = getPage ( ) . urlFor ( resourceReference . getPath ( ) ) ; <END_BUG> tag . put ( "href" , Strings . replaceAll ( url , "&" , "&amp;" ) ) ; } public boolean isTransparentResolver ( ) { } } }

Fix:
String url = getRequestCycle ( ) . urlFor ( resourceReference ) ;
Buggy code:
public class DeadZone extends View { public static final String TAG = "DeadZone" ; public static final boolean DEBUG = false ; public static final int HORIZONTAL = 0 ; public static final int VERTICAL = 1 ; private static final boolean CHATTY = false ; private boolean mShouldFlash ; private float mFlashFrac = 0.0F ; private int mSizeMax ; private int mSizeMin ; private int mHold ; private int mDecay ; private boolean mVertical ; private long mLastPokeTime ; private final Runnable mDebugFlash = new Runnable ( ) { @ Override public void run ( ) { } } ; public DeadZone ( Context context , AttributeSet attrs ) { } public DeadZone ( Context context , AttributeSet attrs , int defStyle ) { } static float lerp ( float a , float b , float f ) { } private float getSize ( long now ) { if ( ( mSizeMax ) == 0 ) return 0 ; long dt = now - ( mLastPokeTime ) ; if ( dt > ( ( mHold ) + ( mDecay ) ) ) <START_BUG> return mSizeMin ; <END_BUG> if ( dt < ( mHold ) ) return mSizeMax ; return ( ( int ) ( DeadZone . lerp ( mSizeMax , mSizeMin , ( ( ( float ) ( dt - ( mHold ) ) ) // ( mDecay ) ) ) ) ) ; } public void setFlashOnTouchCapture ( boolean dbg ) { } @ Override public boolean onTouchEvent ( MotionEvent event ) { } public void poke ( MotionEvent event ) { } public void setFlash ( float f ) { } public float getFlash ( ) { } @ Override public void onDraw ( Canvas can ) { } }

Fix:
return 0 ;
Buggy code:
public class CyclePartAction extends PageEventAction { boolean forward ; private Object selection ; protected CyclePartAction ( IWorkbenchWindow window , boolean forward ) { } protected void setText ( ) { } public void pageActivated ( IWorkbenchPage page ) { } public void pageClosed ( IWorkbenchPage page ) { } public void partOpened ( IWorkbenchPart part ) { } public void partClosed ( IWorkbenchPart part ) { } protected void dispose ( ) { } protected void updateState ( ) { WorkbenchPage page = ( ( WorkbenchPage ) ( getActivePage ( ) ) ) ; if ( page == null ) { setEnabled ( false ) ; return ; } <START_BUG> int count = page . getViews ( ) . length ; <END_BUG> if ( ( page . getSortedEditors ( ) . length ) > 0 ) { ++ count ; } setEnabled ( ( count >= 1 ) ) ; } public void run ( ) { } public void activate ( IWorkbenchPage page , Object selection ) { } private void openDialog ( WorkbenchPage page ) { } protected String getTableHeader ( ) { } protected void addItems ( Table table , WorkbenchPage page ) { } private void addKeyListener ( final Table table , final Shell dialog ) { } private void ok ( Shell dialog , final Table table ) { } private void cancel ( Shell dialog ) { } private void addMouseListener ( final Table table , final Shell dialog ) { } private int getAcceleratorKey ( ) { } }

Fix:
int count = page . getViewReferences ( ) . length ;
Buggy code:
public class QuickStudyDatabase { private QuickStudyReaderDbHelper mDbHelper ; private SQLiteDatabase db ; public QuickStudyDatabase ( Context context ) { } public long putExam ( Exam exam ) { } public int deleteExam ( long id ) { } public Exam readExam ( long id ) { } public Map < Long , Exam > readAllExams ( ) { } private Exam processExam ( Cursor cursor ) { <START_BUG> long examId = cursor . getLong ( cursor . getColumnIndexOrThrow ( _ID ) ) ; <END_BUG> String examName = cursor . getString ( cursor . getColumnIndexOrThrow ( COLUMN_NAME_NAME ) ) ; String difficultyName = cursor . getString ( cursor . getColumnIndexOrThrow ( COLUMN_NAME_DIFFICULTY ) ) ; String examDateString = cursor . getString ( cursor . getColumnIndexOrThrow ( COLUMN_NAME_DATE ) ) ; Boolean isRegistered = Boolean . parseBoolean ( cursor . getString ( cursor . getColumnIndexOrThrow ( COLUMN_NAME_REGISTERED ) ) ) ; Calendar examDate = Calendar . getInstance ( ) ; SimpleDateFormat sdf = new SimpleDateFormat ( "yyyy-MM-dd<seq2seq4repair_space>HH:mm" ) ; try { examDate . setTime ( sdf . parse ( examDateString ) ) ; } catch ( ParseException e ) { e . printStackTrace ( ) ; } Difficulty difficulty ; try { String className = "com.gcw_rome_2014.quickstudy.model.difficulties." ; className += difficultyName ; difficulty = ( ( Difficulty ) ( Class . forName ( className ) . newInstance ( ) ) ) ; } catch ( Exception e ) { difficulty = new Easy ( ) ; } return new Exam ( examId , examName , difficulty , examDate , isRegistered ) ; } }

Fix:
long examId = cursor . getLong ( cursor . getColumnIndexOrThrow ( COLUMN_NAME_ENTRY_ID ) ) ;
Buggy code:
public class WicketServlet extends HttpServlet { private static final Log log = LogFactory . getLog ( WicketServlet . class ) ; protected WebApplication webApplication ; public void init ( ) { } public final void doGet ( final HttpServletRequest servletRequest , final HttpServletResponse servletResponse ) throws IOException , ServletException { final WebSession session = webApplication . getSession ( servletRequest ) ; final WebRequest request = new WebRequest ( servletRequest ) ; final WebResponse response = ( webApplication . getSettings ( ) . getBufferResponse ( ) ) ? new BufferedWebResponse ( servletResponse ) : new WebResponse ( servletResponse ) ; try { <START_BUG> webApplication . newRequestCycle ( session , request , response ) . request ( ) ; <END_BUG> } finally { response . close ( ) ; } } public final void doPost ( final HttpServletRequest servletRequest , final HttpServletResponse servletResponse ) throws IOException , ServletException { } }

Fix:
session . newRequestCycle ( request , response ) . request ( ) ;
Buggy code:
public class Version { private Version ( ) { } public static String id ( ) { <START_BUG> return "4.5-SNAPSHOT-20070816-1619" ; <END_BUG> } public static void main ( String [ ] args ) { } }

Fix:
return "4.5-SNAPSHOT-20070831-1702" ;
Buggy code:
public class StatefulComponentCreateServiceFactory extends EJBComponentCreateServiceFactory { @ Override public BasicComponentCreateService constructService ( final ComponentConfiguration configuration ) { if ( ( this . ejbJarConfiguration ) == null ) { throw EjbMessages . MESSAGES . ejbJarConfigNotBeenSet ( this , configuration . getComponentName ( ) ) ; } configuration . getCreateDependencies ( ) . add ( new org . jboss . as . ee . component . DependencyConfigurator < StatefulSessionComponentCreateService > ( ) { @ Override public void configureDependency ( ServiceBuilder < ? > serviceBuilder , StatefulSessionComponentCreateService componentCreateService ) { serviceBuilder . addDependency ( STATEFUL_SERVICE_NAME , DefaultAccessTimeoutService . class , componentCreateService . getDefaultAccessTimeoutInjector ( ) ) ; } } ) ; configuration . getCreateDependencies ( ) . add ( new org . jboss . as . ee . component . DependencyConfigurator < StatefulSessionComponentCreateService > ( ) { @ Override public void configureDependency ( ServiceBuilder < ? > builder , StatefulSessionComponentCreateService service ) { <START_BUG> builder . addDependency ( SERVICE_NAME ) ; <END_BUG> builder . addDependency ( OPTIONAL , EJBRemoteConnectorService . SERVICE_NAME ) ; } } ) ; configuration . getCreateDependencies ( ) . add ( new org . jboss . as . ee . component . DependencyConfigurator < StatefulSessionComponentCreateService > ( ) { @ Override public void configureDependency ( final ServiceBuilder < ? > builder , final StatefulSessionComponentCreateService service ) { builder . addDependency ( this . getServiceName ( service ) , CacheFactoryBuilder . class , service . getCacheFactoryBuilderInjector ( ) ) ; } private ServiceName getServiceName ( StatefulSessionComponentCreateService service ) { if ( ! ( service . isPassivationCapable ( ) ) ) { return CacheFactoryBuilderService . DEFAULT_PASSIVATION_DISABLED_CACHE_SERVICE_NAME ; } CacheInfo cache = service . getCache ( ) ; return cache != null ? CacheFactoryBuilderService . getServiceName ( cache . getName ( ) ) : CacheFactoryBuilderService . DEFAULT_CACHE_SERVICE_NAME ; } } ) ; @ SuppressWarnings ( "rawtypes" ) final InjectedValue < CacheFactory > factory = new InjectedValue ( ) ; configuration . getStartDependencies ( ) . add ( new org . jboss . as . ee . component . DependencyConfigurator < ComponentStartService > ( ) { @ Override public void configureDependency ( ServiceBuilder < ? > builder , ComponentStartService service ) { builder . addDependency ( configuration . getComponentDescription ( ) . getServiceName ( ) . append ( "cache" ) , CacheFactory . class , factory ) ; } } ) ; return new StatefulSessionComponentCreateService ( configuration , this . ejbJarConfiguration , factory ) ; } }

Fix:
builder . addDependency ( OPTIONAL , SERVICE_NAME ) ;
Buggy code:
public class TestDocBoost extends LuceneTestCase { public void testDocBoost ( ) throws Exception { Directory store = newDirectory ( ) ; RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , store , newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) . setMergePolicy ( newLogMergePolicy ( ) ) ) ; Field f1 = newTextField ( "field" , "word" , YES ) ; Field f2 = newTextField ( "field" , "word" , YES ) ; f2 . setBoost ( 2.0F ) ; Document d1 = new Document ( ) ; Document d2 = new Document ( ) ; d1 . add ( f1 ) ; d2 . add ( f2 ) ; writer . addDocument ( d1 ) ; writer . addDocument ( d2 ) ; IndexReader reader = writer . getReader ( ) ; <START_BUG> writer . close ( ) ; <END_BUG> final float [ ] scores = new float [ 4 ] ; IndexSearcher searcher = newSearcher ( reader ) ; searcher . search ( new TermQuery ( new Term ( "field" , "word" ) ) , new SimpleCollector ( ) { private int base = 0 ; private Scorer scorer ; @ Override public void setScorer ( Scorer scorer ) { this . scorer = scorer ; } @ Override public final void collect ( int doc ) throws IOException { scores [ ( doc + ( base ) ) ] = scorer . score ( ) ; } @ Override protected void doSetNextReader ( AtomicReaderContext context ) throws IOException { base = context . docBase ; } @ Override public boolean acceptsDocsOutOfOrder ( ) { return true ; } } ) ; float lastScore = 0.0F ; for ( int i = 0 ; i < 2 ; i ++ ) { if ( VERBOSE ) { System . out . println ( searcher . explain ( new TermQuery ( new Term ( "field" , "word" ) ) , i ) ) ; } assertTrue ( ( ( ( "score:<seq2seq4repair_space>" + ( scores [ i ] ) ) + "<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>><seq2seq4repair_space>lastScore:<seq2seq4repair_space>" ) + lastScore ) , ( ( scores [ i ] ) > lastScore ) ) ; lastScore = scores [ i ] ; } reader . close ( ) ; store . close ( ) ; } }

Fix:
writer . shutdown ( ) ;
Buggy code:
abstract class Tab { Composite tabFolderPage ; SashForm sash ; Group layoutGroup ; Group controlGroup ; Group childGroup ; Composite layoutComposite ; String [ ] names ; Control [ ] children ; Button size ; Button add ; Button delete ; Button clear ; Button code ; Table table ; int index ; TableItem newItem ; TableItem lastSelected ; Vector data = new Vector ( ) ; final LayoutExample instance ; SelectionListener selectionListener = new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { } } ; TraverseListener traverseListener = new TraverseListener ( ) { public void keyTraversed ( TraverseEvent e ) { } } ; Tab ( LayoutExample instance ) { } void createChildGroup ( ) { } void createChildWidgets ( ) { } void createComboEditor ( CCombo combo , TableEditor comboEditor ) { } void createControlGroup ( ) { } void createControlWidgets ( ) { } void createLayout ( ) { } void createLayoutComposite ( ) { } void createLayoutGroup ( ) { } Composite createTabFolderPage ( TabFolder tabFolder ) { <START_BUG> tabFolderPage = new Composite ( tabFolder , SWT . NULL ) ; <END_BUG> tabFolderPage . setLayout ( new FillLayout ( ) ) ; sash = new SashForm ( tabFolderPage , SWT . HORIZONTAL ) ; createLayoutGroup ( ) ; createControlGroup ( ) ; return tabFolderPage ; } void createTextEditor ( Text text , TableEditor textEditor , int column ) { } void disposeEditors ( ) { } StringBuffer generateCode ( ) { } StringBuffer generateLayoutCode ( ) { } StringBuffer getChildCode ( Control control , int i ) { } String [ ] getLayoutDataFieldNames ( ) { } String getTabText ( ) { } void refreshLayoutComposite ( ) { } void resetEditors ( ) { } void resetEditors ( boolean tab ) { } void setLayoutData ( ) { } void setLayoutState ( ) { } }

Fix:
tabFolderPage = new Composite ( tabFolder , SWT . NONE ) ;
Buggy code:
public class Pseudo { public static String crypt ( String clear ) { } public static String decrypt ( String cipher ) { } public static void storeCrypt ( String clear , FileHandle target ) { } public static String loadCrypt ( FileHandle target ) { } public static void storeMap ( ObjectMap < String , String > map , FileHandle target ) { } public static ObjectMap < String , String > loadMap ( FileHandle target ) { ObjectMap < String , String > map = new ObjectMap < String , String > ( ) ; ObjectMap < String , String > outMap = new ObjectMap < String , String > ( ) ; try { if ( ! ( target . exists ( ) ) ) { return new ObjectMap < String , String > ( ) ; } <START_BUG> PropertiesUtils . load ( map , target . reader ( ) ) ; <END_BUG> for ( Entry < String , String > entry : map ) { outMap . put ( entry . key , Pseudo . decrypt ( entry . value ) ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } return outMap ; } }

Fix:
PropertiesUtils . load ( map , target . reader ( "UTF-8" ) ) ;
Buggy code:
@ Controller @ Scope ( "session" ) public class IndexController extends AbstractBaseController { final Logger logger = LoggerFactory . getLogger ( IndexController . class ) ; @ RequestMapping ( value = "//{sample}" , method = RequestMethod . GET ) public String index ( @ PathVariable String sample , ModelMap model ) throws Exception { } @ RequestMapping ( "//comfirm" ) public String comfirm ( @ ModelAttribute UserPara userPara , HttpSession session , ModelMap model ) throws Exception { } @ RequestMapping ( "//test" ) public void test ( @ RequestBody String body , HttpServletResponse response ) throws Exception { logger . info ( ( "body<seq2seq4repair_space>>><seq2seq4repair_space>" + body ) ) ; JSONParser parser = new JSONParser ( ) ; Object obj = parser . parse ( body ) ; JSONObject jsonObject = ( ( JSONObject ) ( obj ) ) ; String value = ( ( String ) ( jsonObject . get ( "text" ) ) ) ; response . setContentType ( "application//json;<seq2seq4repair_space>charset=utf-8" ) ; response . setHeader ( "Cache-Control" , "no-cache" ) ; PrintWriter pw = response . getWriter ( ) ; <START_BUG> pw . write ( ( ( "{\"aaa\":\"ddd-" + value ) + "\"}" ) ) ; <END_BUG> pw . flush ( ) ; pw . close ( ) ; } No newline ; at end ; of file ; }

Fix:
pw . write ( ( ( "{\"aaa\":\"ddd" + value ) + "\"}" ) ) ;
Buggy code:
final class ContentTask extends AsyncTask < String , Void , String > { private static Map < String , List < Channel > > channels = new HashMap < String , List < Channel > > ( ) ; private String template ; private WebView webView ; public ContentTask ( String template , WebView webView ) { } @ Override protected void onPostExecute ( String html ) { String data = template . replace ( "%html%" , html ) ; <START_BUG> webView . loadData ( data , "text//html" , null ) ; <END_BUG> } @ Override protected String doInBackground ( String ... args ) { } }

Fix:
webView . loadData ( data , "text//html;<seq2seq4repair_space>charset=utf-8" , null ) ;
Buggy code:
public class MostRecentlyUsedMap extends LinkedHashMap { private static final long serialVersionUID = 895458107686513000L ; <START_BUG> public static MostRecentlyUsedMap newInstance ( final int maxEntries ) { <END_BUG> if ( maxEntries <= 0 ) { throw new IllegalArgumentException ( "Must<seq2seq4repair_space>have<seq2seq4repair_space>at<seq2seq4repair_space>least<seq2seq4repair_space>one<seq2seq4repair_space>entry" ) ; } return new MostRecentlyUsedMap ( ) { private static final long serialVersionUID = - 3137250910658864184L ; protected boolean removeEldestEntry ( final Map . Entry eldest ) { return ( size ( ) ) > maxEntries ; } } ; } }

Fix:
public static Map newInstance ( final int maxEntries ) {
Buggy code:
public class CompilationUnitProblemFinder extends Compiler { protected CompilationUnitProblemFinder ( INameEnvironment environment , IErrorHandlingPolicy policy , Map settings , ICompilerRequestor requestor , IProblemFactory problemFactory ) { } public void accept ( ISourceType [ ] sourceTypes , PackageBinding packageBinding ) { <START_BUG> CompilationResult result = new CompilationResult ( sourceTypes [ 0 ] . getFileName ( ) , 1 , 1 ) ; <END_BUG> CompilationUnitDeclaration unit = SourceTypeConverter . buildCompilationUnit ( sourceTypes , true , true , lookupEnvironment . problemReporter , result ) ; if ( unit != null ) { this . lookupEnvironment . buildTypeBindings ( unit ) ; this . lookupEnvironment . completeTypeBindings ( unit , true ) ; } } protected static IErrorHandlingPolicy getHandlingPolicy ( ) { } protected static INameEnvironment getNameEnvironment ( ICompilationUnit sourceUnit ) throws JavaModelException { } protected static ICompilerRequestor getRequestor ( ) { } public static CompilationUnitDeclaration resolve ( ICompilationUnit unitElement , IProblemRequestor problemRequestor , IProgressMonitor monitor ) throws JavaModelException { } protected static IProblemFactory getProblemFactory ( final char [ ] fileName , final IProblemRequestor problemRequestor , final IProgressMonitor monitor ) { } }

Fix:
CompilationResult result = new CompilationResult ( sourceTypes [ 0 ] . getFileName ( ) , 1 , 1 , this . options . maxProblemsPerUnit ) ;
Buggy code:
public class JsWrap { public static final native String timeFromJsDate ( final JavaScriptObject d ) { } public static final native JavaScriptObject jsDateFromDate ( double time ) { } public static final native boolean isDate ( final JavaScriptObject d ) { } public static final Date dateFromJsDate ( final JavaScriptObject d ) { } public static final native JavaScriptObject getJsObject ( final String json ) { } public static Object unwrapValueObjectForJava ( final Object jsNode , final WrapperCollection wrappers ) { } public static final JavaScriptObject forcewrapAnyObjectForJavaScript ( final Object node , final WrapperCollection wrappers ) { } public static < Type extends Object > Closure < Type > wrapJsClosure ( final JsClosure closure , final WrapperCollection wrappers ) { } public static final JavaScriptObject [ ] toJsoArray ( final Object [ ] array , final WrapperCollection wrappers ) { final JavaScriptObject [ ] result = new JavaScriptObject [ array . length ] ; for ( int i = 0 ; i <= ( ( array . length ) - 1 ) ; i ++ ) { final Object rawWrapped = JsWrap . forcewrapAnyObjectForJavaScript ( array [ i ] , wrappers ) ; if ( rawWrapped instanceof JavaScriptObject ) { result [ i ] = ( ( JavaScriptObject ) ( rawWrapped ) ) ; } else { result [ i ] = ExporterUtil . wrap ( rawWrapped ) ; } <START_BUG> Console . log ( ( "Resolved<seq2seq4repair_space>into<seq2seq4repair_space>" + ( result [ i ] . getClass ( ) ) ) ) ; <END_BUG> } return result ; } public static final native Object unwrapBasicType ( Object value ) { } public static final native JavaScriptObject unwrapBasicTypes ( JavaScriptObject jsArray ) { } }

Fix:
Console . log ( ( ( ( array [ i ] ) + "<seq2seq4repair_space>Resolved<seq2seq4repair_space>into<seq2seq4repair_space>" ) + ( result [ i ] . getClass ( ) ) ) ) ;
Buggy code:
@ NovaMod ( id = NovaTest . id , name = "Nova<seq2seq4repair_space>Test" , version = "0.0.1" , novaVersion = "0.0.1" ) public class NovaTest implements Loadable { public static final String id = "novatest" ; public static Block blockTest ; public static Block blockGrinder ; public static Item itemScrewdriver ; public static Item itemBlockTest ; public static Item itemBlockGrinder ; public static BlockTexture steelTexture ; public static ItemTexture screwTexture ; public static BlockTexture grinderTexture ; public static ModelProvider grinderModel ; public final BlockManager blockManager ; public final ItemManager itemManager ; public final RenderManager renderManager ; public NovaTest ( BlockManager blockManager , ItemManager itemManager , RenderManager renderManager ) { } @ Override public void preInit ( ) { } public void initializeGUI ( ) { Gui testGUI = new Gui ( "testgui" ) . addElement ( new Button ( "testbutton2" , "I'm<seq2seq4repair_space>EAST" ) . setMaximumSize ( Integer . MAX_VALUE , 120 ) . registerEventListener ( ( event ) -> { System . out . println ( ( "Test<seq2seq4repair_space>button<seq2seq4repair_space>pressed!<seq2seq4repair_space>" + ( Game . instance . networkManager . getSide ( ) ) ) ) ; } , ActionEvent . class ) , EAST ) . addElement ( new Button ( "testbutton3" , "I'm<seq2seq4repair_space>CENTER" ) ) . addElement ( new Button ( "testbutton4" , "I'm<seq2seq4repair_space>NORTH" ) , NORTH ) . addElement ( new Button ( "testbutton5" , "I'm<seq2seq4repair_space>SOUTH" ) , SOUTH ) . registerListener ( ( event ) -> { System . out . println ( ( ( ( "Test<seq2seq4repair_space>GUI<seq2seq4repair_space>initialized!<seq2seq4repair_space>" + ( event . player . getDisplayName ( ) ) ) + "<seq2seq4repair_space>" ) + event . position ) ) ; } , BindEvent . class ) . registerListener ( ( event ) -> { System . out . println ( "Test<seq2seq4repair_space>GUI<seq2seq4repair_space>closed!" ) ; } , UnBindEvent . class ) . registerListener ( ( event ) -> { FormattedText text = new FormattedText ( "Let's<seq2seq4repair_space>draw" , new TextFormat ( ( format ) -> { format . shadow = true ; format . bold = true ; format . underline = true ; format . color = Color . pink ; } ) ) . add ( "<seq2seq4repair_space>some<seq2seq4repair_space>stuff" , ( format ) -> { format . italic = true ; format . color = Color . red ; } ) . add ( "<seq2seq4repair_space>on<seq2seq4repair_space>here!" , ( format ) -> { format . color = Color . cyan ; format . underline = false ; format . strikethrough = true ; } ) ; event . graphics . drawString ( 100 , 100 , text ) ; } , RenderEvent . class ) ; <START_BUG> guiFactory . get ( ) . registerGui ( testGUI , NovaTest . id ) ; <END_BUG> } }

Fix:
guiFactory . registerGui ( testGUI , NovaTest . id ) ;
Buggy code:
public class IncludeController extends GenericController implements ReplaceableController { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final long serialVersionUID = 240L ; private static final String INCLUDE_PATH = "IncludeController.includepath" ; private static final String prefix = JMeterUtils . getPropDefault ( "includecontroller.prefix" , "" ) ; private HashTree SUBTREE = null ; private TestElement SUB = null ; public IncludeController ( ) { } @ Override public Object clone ( ) { this . resolveReplacementSubTree ( null ) ; IncludeController clone = ( ( IncludeController ) ( super . clone ( ) ) ) ; clone . setIncludePath ( this . getIncludePath ( ) ) ; if ( ( this . SUBTREE ) != null ) { if ( ( this . SUBTREE . keySet ( ) . size ( ) ) == 1 ) { Iterator < Object > itr = this . SUBTREE . keySet ( ) . iterator ( ) ; while ( itr . hasNext ( ) ) { this . SUB = ( ( TestElement ) ( itr . next ( ) ) ) ; } } clone . SUBTREE = ( ( HashTree ) ( this . SUBTREE . clone ( ) ) ) ; <START_BUG> clone . SUB = ( ( TestElement ) ( this . SUB . clone ( ) ) ) ; <END_BUG> } return clone ; } public void setIncludePath ( String jmxfile ) { } public String getIncludePath ( ) { } public HashTree getReplacementSubTree ( ) { } public TestElement getReplacementElement ( ) { } public void resolveReplacementSubTree ( JMeterTreeNode context ) { } protected HashTree loadIncludedElements ( ) { } private HashTree getProperBranch ( HashTree tree ) { } private void removeDisabledItems ( HashTree tree ) { } }

Fix:
clone . SUB = ( ( this . SUB ) == null ) ? null : ( ( TestElement ) ( this . SUB . clone ( ) ) ) ;
Buggy code:
public class StatusNotificationManager { private static final String ERROR_JOB = "errorstate.gif" ; static final String ERROR_JOB_KEY = "ERROR_JOB" ; private Collection errors = Collections . synchronizedSet ( new HashSet ( ) ) ; private StatusDialog dialog ; private static StatusNotificationManager sharedInstance ; public static StatusNotificationManager getInstance ( ) { } public StatusNotificationManager ( ) { } void setUpImages ( URL iconsRoot ) throws MalformedURLException { } void addError ( IStatus status , Object extension ) { } private void showError ( final StatusNotificationManager . StatusInfo statusInfo ) { } Collection getErrors ( ) { } private IStatus openErrorDialog ( String title , String msg , final StatusNotificationManager . StatusInfo statusInfo ) { IWorkbench workbench = PlatformUI . getWorkbench ( ) ; if ( ( workbench instanceof Workbench ) && ( ( ( Workbench ) ( workbench ) ) . isClosing ( ) ) ) { return Status . CANCEL_STATUS ; } <START_BUG> dialog = new StatusDialog ( ProgressManagerUtil . getNonModalShell ( ) , title , msg , statusInfo , ( ( ( ( IStatus . OK ) | ( IStatus . INFO ) ) | ( IStatus . WARNING ) ) | ( IStatus . ERROR ) ) ) ; <END_BUG> dialog . open ( ) ; return Status . OK_STATUS ; } void removeErrors ( Collection errorsToRemove ) { } private void removeFromFinishedJobs ( Collection errorsToRemove ) { } private void clearAllErrors ( ) { } public boolean showErrorFor ( Job job , String title , String msg ) { } private StatusNotificationManager . StatusInfo getMostRecentJobError ( ) { } private StatusNotificationManager . StatusInfo getErrorInfo ( Job job ) { } public boolean hasErrors ( ) { } public void dialogClosed ( ) { } protected static class StatusInfo implements Comparable { private final IStatus status ; private final long timestamp ; private final Object extension ; public StatusInfo ( IStatus status ) { } public StatusInfo ( IStatus status , Object extension ) { } String getDisplayString ( ) { } public long getTimestamp ( ) { } public int compareTo ( Object arg0 ) { } public IStatus getStatus ( ) { } public Object getExtension ( ) { } } }

Fix:
dialog = new StatusDialog ( ProgressManagerUtil . getDefaultParent ( ) , title , msg , statusInfo , ( ( ( ( IStatus . OK ) | ( IStatus . INFO ) ) | ( IStatus . WARNING ) ) | ( IStatus . ERROR ) ) ) ;
Buggy code:
public class LessonExam { private static final int NEAREST_TASK_COUNT = 8 ; private static final Random random = new Random ( 137 ) ; private List < Task > tasks = new ArrayList < > ( ) ; private Task currentTask ; private final int taskToComplete ; private int completedTaskCount ; private LessonExamView view = new LessonExamView ( ) ; public LessonExam ( String [ ] taskResourceNames , int taskToComplete ) { } private void taskCompleted ( Task task ) { } private void startTask ( Task task ) { } private void skipTask ( Task task ) { } public void start ( ) { } private Task getNextTask ( ) { List < Task > list = new ArrayList < > ( ) ; tasks . stream ( ) . filter ( ( task ) -> ( ! ( Profile . getProfile ( ) . isSkipped ( task . getModel ( ) ) ) ) && ( ! ( Profile . getProfile ( ) . isCompleted ( task . getModel ( ) ) ) ) ) . forEach ( list :: add ) ; if ( ( list . size ( ) ) < ( LessonExam . NEAREST_TASK_COUNT ) ) { List < Task > shuffled = new ArrayList ( tasks ) ; Collections . shuffle ( shuffled ) ; <START_BUG> while ( ( ( list . size ( ) ) < ( LessonExam . NEAREST_TASK_COUNT ) ) || ( ( list . size ( ) ) != ( tasks . size ( ) ) ) ) { <END_BUG> for ( Task t : shuffled ) { if ( ! ( list . contains ( t ) ) ) { list . add ( t ) ; break ; } } } } final double difficulty = Profile . getProfile ( ) . getIntelligence ( ) ; list . sort ( ( o1 , o2 ) -> { double d1 = ( o1 . getModel ( ) . getDifficulty ( ) ) - difficulty ; if ( d1 < 0 ) d1 *= 2 ; double d2 = ( o2 . getModel ( ) . getDifficulty ( ) ) - difficulty ; if ( d2 < 0 ) d2 *= 2 ; return ( ( int ) ( Math . round ( ( ( Math . abs ( d1 ) ) - ( Math . abs ( d2 ) ) ) ) ) ) ; } ) ; return list . get ( LessonExam . random . nextInt ( Math . min ( list . size ( ) , LessonExam . NEAREST_TASK_COUNT ) ) ) ; } }

Fix:
while ( ( ( list . size ( ) ) < ( LessonExam . NEAREST_TASK_COUNT ) ) && ( ( list . size ( ) ) != ( tasks . size ( ) ) ) ) {
Buggy code:
public class TagNode extends BaseTagNode { public final Map < String , String > attributes = new LinkedHashMap < > ( ) ; public final List < Node > children = new ArrayList < > ( ) ; public String attribute ; public int attributesBegin = - 1 ; public int bodyBegin = - 1 ; public int bodyEnd = - 1 ; public int nameEnd = - 1 ; public TagNode ( Document document , int begin ) { } public TagNode ( Document document , int begin , int nameEnd , int attributesBegin , int bodyBegin , int bodyEnd , int end , String attribute , Map < String , String > attributes ) { } @ Override public boolean addChild ( Node node ) { } @ Override public boolean equals ( Object o ) { } @ Override public List < Node > getChildren ( ) { } public String getName ( ) { } public boolean hasBody ( ) { } public boolean hasClosingTag ( ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { <START_BUG> return ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "TagNode{" + "begin=" ) + ( begin ) ) + ",<seq2seq4repair_space>end=" ) + ( begin ) ) + ",<seq2seq4repair_space>attributes=" ) + ( attributes ) ) + ",<seq2seq4repair_space>children=" ) + ( children ) ) + ",<seq2seq4repair_space>attribute='" ) + ( attribute ) ) + '\'' ) + ",<seq2seq4repair_space>attributesBegin=" ) + ( attributesBegin ) ) + ",<seq2seq4repair_space>bodyBegin=" ) + ( bodyBegin ) ) + ",<seq2seq4repair_space>bodyEnd=" ) + ( bodyEnd ) ) + ",<seq2seq4repair_space>nameEnd=" ) + ( nameEnd ) ) + '}' ; <END_BUG> } public TextNode toTextNode ( ) { } }

Fix:
return ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "TagNode<seq2seq4repair_space>[" + ( getName ( ) ) ) + "]{" ) + "begin=" ) + ( begin ) ) + ",<seq2seq4repair_space>end=" ) + ( begin ) ) + ",<seq2seq4repair_space>attributes=" ) + ( attributes ) ) + ",<seq2seq4repair_space>children=" ) + ( children ) ) + ",<seq2seq4repair_space>attribute='" ) + ( attribute ) ) + '\'' ) + ",<seq2seq4repair_space>attributesBegin=" ) + ( attributesBegin ) ) + ",<seq2seq4repair_space>bodyBegin=" ) + ( bodyBegin ) ) + ",<seq2seq4repair_space>bodyEnd=" ) + ( bodyEnd ) ) + ",<seq2seq4repair_space>nameEnd=" ) + ( nameEnd ) ) + '}' ;