nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Entity { private final String identifier ; private float x ; private float y ; private int width ; private int height ; private float speedX ; private float speedY ; private float accelerationX ; private float accelerationY ; private CollisionBox collisionBox ; public Entity ( float pX , float pY , int pWidth , int pHeight , int subThick , String identifier , State state ) { } public Entity ( CollisionBox pCollisionBox , String identifier , State state ) { } public static String getEntityType ( ) { } public void setX ( float pX ) { } public void setY ( float pY ) { } public void setLocation ( float pX , float pY ) { } public void setScale ( double scale ) { } public void setBounds ( float pX , float pY , double scale ) { } public void setSpeedX ( float pSpeedX ) { } public void setSpeedY ( float pSpeedY ) { } public void setSpeed ( float pSpeedX , float pSpeedY ) { } public void setAccelerationX ( float pAccelerationX ) { } public void setAccelerationY ( float pAccelerationY ) { } public void setAcceleration ( float pAccelerationX , float pAccelerationY ) { } public void setState ( String state ) { } public float getX ( ) { } public float getY ( ) { } public int getWidth ( ) { } public int getHeight ( ) { } public float getSpeedX ( ) { } public float getSpeedY ( ) { } public float getSpeed ( ) { } public float getAccelerationX ( ) { } public float getAccelerationY ( ) { } public float getAcceleration ( ) { } public String getIdentifier ( ) { } public void render ( Graphics2D g2d ) { } public void update ( ) { } public boolean isColliding ( int sideNumber , Rectangle otherCollisionBoxSide ) { } public String [ ] save ( ) { String [ ] property = new String [ 2 ] ; <START_BUG> property [ 0 ] = ( Entity . getEntityType ( ) ) + ( identifier ) ; <END_BUG> property [ 1 ] = ( ( ( ( x ) + "," ) + ( y ) ) + "," ) + ( width ) ; return property ; } }

Fix:
property [ 0 ] = ( ( Entity . getEntityType ( ) ) + "<seq2seq4repair_space>" ) + ( identifier ) ;
Buggy code:
public final class NpcDropTable { private static final int DROP_THRESHOLD = 3 ; public static final Map < Integer , NpcDropTable > DROPS = new HashMap < > ( ) ; private static RandomGen random = new RandomGen ( ) ; private final int [ ] npcs ; private final NpcDrop [ ] dynamic ; private final NpcDrop [ ] rare ; public NpcDropTable ( int [ ] npcs , NpcDrop [ ] dynamic , NpcDrop [ ] rare ) { } public Item [ ] toItems ( Player player ) { int slot = 0 ; <START_BUG> Item [ ] items = new Item [ ( dynamic . length ) + 1 ] ; <END_BUG> LinkedList < NpcDrop > copyList = CollectionUtils . newLinkedList ( dynamic ) ; Collections . shuffle ( copyList ) ; for ( int amount = 0 ; amount < ( NpcDropTable . DROP_THRESHOLD ) ; amount ++ ) { if ( ( copyList . size ( ) ) == 0 ) break ; NpcDrop drop = copyList . remove ( ) ; if ( drop . getChance ( ) . successful ( NpcDropTable . random ) ) items [ ( slot ++ ) ] = drop . toItem ( NpcDropTable . random ) ; } if ( ( rare . length ) == 0 ) return items ; NpcDrop drop = NpcDropTable . random . random ( rare ) ; if ( drop . getChance ( ) . successful ( NpcDropTable . random ) ) items [ ( slot ++ ) ] = drop . toItem ( NpcDropTable . random ) ; return items ; } public int [ ] getNpcs ( ) { } public NpcDrop [ ] getDynamic ( ) { } public NpcDrop [ ] getRare ( ) { } }

Fix:
Item [ ] items = new Item [ ( NpcDropTable . DROP_THRESHOLD ) + 1 ] ;
Buggy code:
class PromptService { XPCOMObject supports ; XPCOMObject promptService ; int refCount = 0 ; public PromptService ( ) { } int AddRef ( ) { } void createCOMInterfaces ( ) { } void disposeCOMInterfaces ( ) { } int getAddress ( ) { } int QueryInterface ( int riid , int ppvObject ) { } int Release ( ) { } Browser getBrowser ( int aDOMWindow ) { } String getLabel ( int buttonFlag , int index , int buttonTitle ) { } public int Alert ( int parent , int dialogTitle , int text ) { } public int AlertCheck ( int parent , int dialogTitle , int text , int checkMsg , int checkValue ) { } public int Confirm ( int parent , int dialogTitle , int text , int _retval ) { Browser browser = getBrowser ( parent ) ; int length = XPCOM . strlen_PRUnichar ( dialogTitle ) ; char [ ] dest = new char [ length ] ; XPCOM . memmove ( dest , dialogTitle , ( length * 2 ) ) ; String titleLabel = new String ( dest ) ; length = XPCOM . strlen_PRUnichar ( text ) ; dest = new char [ length ] ; XPCOM . memmove ( dest , text , ( length * 2 ) ) ; String textLabel = new String ( dest ) ; <START_BUG> MessageBox messageBox = new MessageBox ( browser . getShell ( ) , ( ( SWT . OK ) | ( SWT . CANCEL ) ) ) ; <END_BUG> messageBox . setText ( titleLabel ) ; messageBox . setMessage ( textLabel ) ; int id = messageBox . open ( ) ; int [ ] result = new int [ ] { id == ( SWT . OK ) ? 1 : 0 } ; XPCOM . memmove ( _retval , result , 4 ) ; return XPCOM . NS_OK ; } public int ConfirmCheck ( int parent , int dialogTitle , int text , int checkMsg , int checkValue , int _retval ) { } public int ConfirmEx ( int parent , int dialogTitle , int text , int buttonFlags , int button0Title , int button1Title , int button2Title , int checkMsg , int checkValue , int _retval ) { } public int Prompt ( int parent , int dialogTitle , int text , int value , int checkMsg , int checkValue , int _retval ) { } public int PromptUsernameAndPassword ( int parent , int dialogTitle , int text , int username , int password , int checkMsg , int checkValue , int _retval ) { } public int PromptPassword ( int parent , int dialogTitle , int text , int password , int checkMsg , int checkValue , int _retval ) { } public int Select ( int parent , int dialogTitle , int text , int count , int selectList , int outSelection , int _retval ) { } }

Fix:
MessageBox messageBox = new MessageBox ( browser . getShell ( ) , ( ( ( SWT . OK ) | ( SWT . CANCEL ) ) | ( SWT . ICON_QUESTION ) ) ) ;
Buggy code:
public class ViewWrapper implements ComponentWrapper { private final View c ; public ViewWrapper ( View c ) { } public final int getBaseline ( int width , int height ) { } public final View getComponent ( ) { } public final float getPixelUnitFactor ( boolean isHor ) { } public final int getX ( ) { } public final int getY ( ) { } public final int getWidth ( ) { } public final int getHeight ( ) { } public final int getScreenLocationX ( ) { } public final int getScreenLocationY ( ) { } public int [ ] getScreenLocation ( ) { } public final int getMinimumHeight ( int sz ) { } public final int getMinimumWidth ( int sz ) { } public final int getPreferredHeight ( int sz ) { } public final int getPreferredWidth ( int sz ) { } public final int getMaximumHeight ( int sz ) { } public final int getMaximumWidth ( int sz ) { } public final ContainerWrapper getParent ( ) { } public int getHorizontalScreenDPI ( ) { } public int getVerticalScreenDPI ( ) { } private transient DisplayMetrics displayMetrics = null ; public DisplayMetrics getDisplayMetrics ( ) { } public final int getScreenWidth ( ) { } public final int getScreenHeight ( ) { } public final boolean hasBaseline ( ) { } public final String getLinkId ( ) { } public final void setBounds ( int x , int y , int width , int height ) { } private void measureAgainIfNeedsShrinking ( int width , int height ) { } public boolean isVisible ( ) { } public final int [ ] getVisualPadding ( ) { } public int getLayoutHashCode ( ) { <START_BUG> int h = ( getWidth ( ) ) + ( ( getHeight ( ) ) << 5 ) ; <END_BUG> if ( isVisible ( ) ) { h += 1324511 ; } String id = getLinkId ( ) ; if ( id != null ) h += id . hashCode ( ) ; return h ; } public void paintDebugOutline ( ) { } public int getComponetType ( boolean disregardScrollPane ) { } public final int hashCode ( ) { } public final boolean equals ( Object o ) { } }

Fix:
int h = ( ( ( getWidth ( ) ) + ( ( getHeight ( ) ) << 5 ) ) + ( ( c . getMeasuredWidth ( ) ) << 7 ) ) + ( ( c . getMeasuredHeight ( ) ) << 9 ) ;
Buggy code:
public abstract class WebApplication extends Application { private ISessionFactory sessionFactory = new ISessionFactory ( ) { public Session newSession ( ) { } } ; private WicketServlet wicketServlet ; private Map redirectMap = Collections . synchronizedMap ( new HashMap ( ) ) ; public WebApplication ( ) { } public final WicketServlet getWicketServlet ( ) { } public final void setSessionFactory ( final ISessionFactory sessionFactory ) { } public final void setWicketServlet ( final WicketServlet wicketServlet ) { } protected ISessionFactory getSessionFactory ( ) { } protected void init ( ) { } protected final void internalInit ( ) { final WicketServlet servlet = getWicketServlet ( ) ; final String configuration = wicketServlet . getInitParameter ( "configuration" ) ; if ( configuration != null ) { <START_BUG> getSettings ( ) . configure ( configuration , wicketServlet . getInitParameter ( "sourceFolder" ) ) ; <END_BUG> } } final WebSession getSession ( final HttpServletRequest request ) { } protected WebRequest newWebRequest ( final HttpServletRequest servletRequest ) { } protected WebResponse newWebResponse ( final HttpServletResponse servletResponse ) throws IOException { } public BufferedResponse getBufferedResponse ( HttpServletRequest request , String requestUri ) { } public void addRedirect ( HttpServletRequest request , String requestUri , BufferedResponse renderedResponse ) { } }

Fix:
getSettings ( ) . configure ( wicketServlet . getServletContext ( ) , configuration , wicketServlet . getInitParameter ( "sourceFolder" ) ) ;
Buggy code:
public class MarkupCache { private static final Logger log = LoggerFactory . getLogger ( MarkupCache . class ) ; private Map < CharSequence , MarkupFragment > markupCache = new ConcurrentHashMap < CharSequence , MarkupFragment > ( ) ; private final Watcher afterLoadListeners = new Watcher ( ) ; private final Application application ; public MarkupCache ( final Application application ) { } public void clear ( ) { } public int size ( ) { } public final void addAfterLoadListener ( final MarkupResourceStream resourceStream , final IChangeListener listener ) { } public void removeAllListeners ( ) { } public final void removeMarkup ( final MarkupResourceStream markupResourceStream ) { } public final MarkupFragment getMarkup ( final MarkupContainer container , final boolean throwException ) { } public final boolean hasAssociatedMarkup ( final MarkupContainer container ) { } public final MarkupFragment getMarkup ( final MarkupContainer < ? > container , final Class < ? extends MarkupContainer > clazz ) { } protected IMarkupResourceStreamProvider getMarkupResourceStreamProvider ( final MarkupContainer container ) { } protected IMarkupCacheKeyProvider getMarkupCacheKeyProvider ( final MarkupContainer container ) { } private final MarkupFragment loadMarkup ( final MarkupContainer container , final MarkupResourceStream markupResourceStream ) { } private final MarkupFragment loadMarkupAndWatchForChanges ( final MarkupContainer container , final MarkupResourceStream markupResourceStream ) { } protected IMarkupLoader newMarkupLoader ( ) { <START_BUG> return new wicket . markup . loader . DefaultMarkupLoader ( application ) ; <END_BUG> } public void setCacheMap ( Map < CharSequence , MarkupFragment > markupCache ) { } }

Fix:
return new DefaultMarkupLoader ( ) ;
Buggy code:
public class GeoshapeTest { @ Test public void testDistance ( ) { } @ Test public void testIntersection ( ) { } @ Test public void testEquality ( ) { } @ Test public void testParseCollection ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testFailParseCollection ( ) { } @ Test public void testGeoJsonPoint ( ) throws IOException { } @ Test ( expected = IllegalArgumentException . class ) public void testGeoJsonPointUnparseable ( ) throws IOException { } @ Test public void testGeoJsonCircle ( ) throws IOException { } @ Test ( expected = IllegalArgumentException . class ) public void testGeoJsonCircleMissingRadius ( ) throws IOException { } @ Test public void testGeoJsonPolygon ( ) throws IOException { } @ Test ( expected = IllegalArgumentException . class ) public void testGeoJsonPolygonNotBox1 ( ) throws IOException { } @ Test ( expected = IllegalArgumentException . class ) public void testGeoJsonPolygonNotBox2 ( ) throws IOException { } @ Test public void testGeoJsonGeometry ( ) throws IOException { } @ Test public void testGeoJsonSerialization ( ) throws IOException { SimpleModule module = new SimpleModule ( ) ; <START_BUG> module . addSerializer ( new Geoshape . GeoshapeGsonSerializer ( Geoshape . class ) ) ; <END_BUG> final ObjectMapper om = new ObjectMapper ( ) ; om . registerModule ( module ) ; assertEquals ( "{\"type\":\"Point\",\"coordinates\":[20.5,10.5]}" , om . writeValueAsString ( Geoshape . point ( 10.5 , 20.5 ) ) ) ; assertEquals ( "{\"type\":\"Polygon\",\"coordinates\":[[20.5,10.5],[22.5,10.5],[22.5,12.5],[20.5,12.5]]}" , om . writeValueAsString ( Geoshape . box ( 10.5 , 20.5 , 12.5 , 22.5 ) ) ) ; assertEquals ( "{\"type\":\"Circle\",\"radius\":30.5,\"coordinates\":[20.5,10.5]}" , om . writeValueAsString ( Geoshape . circle ( 10.5 , 20.5 , 30.5 ) ) ) ; } }

Fix:
module . addSerializer ( new Geoshape . GeoshapeGsonSerializer ( ) ) ;
Buggy code:
public class WebServer { public static void main ( String [ ] args ) throws Exception { if ( ( args . length ) < 2 ) { <START_BUG> System . err . println ( "Usage:<seq2seq4repair_space>WebServer<seq2seq4repair_space><port><seq2seq4repair_space><yaml<seq2seq4repair_space>configuration<seq2seq4repair_space>file>" ) ; <END_BUG> System . exit ( 1 ) ; } for ( int i = 1 ; i < ( args . length ) ; i ++ ) { new JmxCollector ( new FileReader ( args [ i ] ) ) . register ( ) ; } int port = Integer . parseInt ( args [ 0 ] ) ; Server server = new Server ( port ) ; ServletContextHandler context = new ServletContextHandler ( ) ; context . setContextPath ( "//" ) ; server . setHandler ( context ) ; context . addServlet ( new org . eclipse . jetty . servlet . ServletHolder ( new MetricsServlet ( ) ) , "//metrics" ) ; server . start ( ) ; server . join ( ) ; } }

Fix:
System . err . println ( "Usage:<seq2seq4repair_space>WebServer<seq2seq4repair_space><port><seq2seq4repair_space><yaml<seq2seq4repair_space>configuration<seq2seq4repair_space>files>" ) ;
Buggy code:
public class BlockLogger { private static final String FILE_HEADER = "TimeStamp,UUID,DimID,BlockX,BlockY,BlockZ,BlockName" ; private static final DateFormat DATE_FORMAT = new SimpleDateFormat ( "MM-dd-YYYY" ) ; private static final DateFormat TIME_FORMAT = new SimpleDateFormat ( "kk-mm-ss" ) ; private final File breakDirectory ; private final Lock breakFileLock = new ReentrantLock ( ) ; private final File placeDirectory ; private final Lock placeFileLock = new ReentrantLock ( ) ; private final boolean logBlockPlaces ; private final boolean logBlockBreaks ; public BlockLogger ( File breakDirectory , boolean logBlockBreaks , File placeDirectory , boolean logBlockPlaces ) { } @ SubscribeEvent public void onBlockBreak ( BlockEvent . BreakEvent event ) { } @ SubscribeEvent public void onBlockPlace ( BlockEvent . PlaceEvent event ) { if ( ! ( logBlockPlaces ) ) { return ; } final File logFile = new File ( placeDirectory , ( ( BlockLogger . DATE_FORMAT . format ( Calendar . getInstance ( ) . getTime ( ) ) ) + ".csv" ) ) ; new info . servertools . core . util . SaveThread ( ( ( String . format ( "%s,%s,%s,%s,%s,%s,%s" , BlockLogger . TIME_FORMAT . format ( Calendar . getInstance ( ) . getTime ( ) ) , event . player . getPersistentID ( ) , event . world . provider . getDimensionId ( ) , event . pos . getX ( ) , event . pos . getY ( ) , event . pos . getZ ( ) , event . state . getBlock ( ) . getUnlocalizedName ( ) ) ) + ( info . servertools . core . lib . Environment . LINE_SEPARATOR ) ) ) { @ Override public void run ( ) { <START_BUG> placeFileLock . unlock ( ) ; <END_BUG> try { if ( ! ( logFile . exists ( ) ) ) { BlockLogger . writeHeader ( logFile ) ; } com . google . common . io . Files . append ( data , logFile , Reference . CHARSET ) ; } catch ( IOException e ) { super . log . warn ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>save<seq2seq4repair_space>block<seq2seq4repair_space>place<seq2seq4repair_space>file<seq2seq4repair_space>to<seq2seq4repair_space>disk" , e ) ; } finally { placeFileLock . unlock ( ) ; } } } . start ( ) ; } private static void writeHeader ( File file ) throws IOException { } }

Fix:
placeFileLock . lock ( ) ;
Buggy code:
public final class Opcode { private static StringValueTable opcodes = new StringValueTable ( ) ; public static final byte QUERY = 0 ; public static final byte IQUERY = 1 ; public static final byte STATUS = 2 ; public static final byte NOTIFY = 4 ; public static final byte UPDATE = 5 ; private Opcode ( ) { } public static String string ( int i ) { String s = Opcode . opcodes . getString ( i ) ; <START_BUG> return s != null ? s : new Integer ( i ) . toString ( ) ; <END_BUG> } public static byte value ( String s ) { } }

Fix:
return s != null ? s : Integer . toString ( i ) ;
Buggy code:
public class ChessBoard { Factory factory = new BWChessFactory ( ) ; private Chess [ ] [ ] ChessStatus = new BWChess [ 20 ] [ 20 ] ; private short nowPlayer ; private Rule rule ; private Record gameRecord ; public ChessBoard ( Rule rule ) { } private void initializeGame ( ) { } private void initializeChessBoard ( ) { } public boolean clickDot ( Location loc ) { <START_BUG> if ( ( this . ChessStatus [ loc . getX ( ) ] [ loc . getY ( ) ] ) != null ) { <END_BUG> this . ChessStatus [ loc . getX ( ) ] [ loc . getY ( ) ] = ( ( BWChessFactory ) ( factory ) ) . makeChess ( this . nowPlayer , loc ) ; this . gameRecord . addRecord ( this . ChessStatus [ loc . getX ( ) ] [ loc . getY ( ) ] ) ; if ( Const . DEBUG ) System . out . println ( this . gameRecord . lastRecord ( ) ) ; return true ; } else { return false ; } } public short checkFinish ( ) { } public ArrayList < Location > checkEat ( ) { } public short checkToLose ( ) { } public void changePlayer ( ) { } public short getNowPlayer ( ) { } public void setRule ( Rule rule ) { } public Rule getRule ( ) { } No newline ; at end ; of file ; }

Fix:
if ( ( this . ChessStatus [ loc . getX ( ) ] [ loc . getY ( ) ] ) == null ) {
Buggy code:
public class FormTagTests extends AbstractHtmlElementTagTests { private static final String REQUEST_URI = "//my//form" ; private static final String QUERY_STRING = "foo=bar" ; private FormTag tag ; private MockHttpServletRequest request ; @ Override @ SuppressWarnings ( "serial" ) protected void onSetUp ( ) { } @ Override protected void extendRequest ( MockHttpServletRequest request ) { } public void testWriteForm ( ) throws Exception { } public void testWithActionFromRequest ( ) throws Exception { } public void testPrependServletPath ( ) throws Exception { } public void testWithNullResolvedCommand ( ) throws Exception { } public void testXSSScriptingExploitWhenActionIsResolvedFromQueryString ( ) throws Exception { } public void testGet ( ) throws Exception { } public void testPost ( ) throws Exception { } public void testPut ( ) throws Exception { } public void testDelete ( ) throws Exception { } public void testCustomMethodParameter ( ) throws Exception { } public void testClearAttributesOnFinally ( ) throws Exception { } public void testRequestDataValueProcessorHooks ( ) throws Exception { String action = "//my//form?foo=bar" ; RequestDataValueProcessor processor = getMockRequestDataValueProcessor ( ) ; <START_BUG> given ( processor . processAction ( this . request , action , "post" ) ) . willReturn ( action ) ; <END_BUG> given ( processor . getExtraHiddenFields ( this . request ) ) . willReturn ( Collections . singletonMap ( "key" , "value" ) ) ; this . tag . doStartTag ( ) ; this . tag . doEndTag ( ) ; this . tag . doFinally ( ) ; String output = getOutput ( ) ; assertEquals ( "<input<seq2seq4repair_space>type=\"hidden\"<seq2seq4repair_space>name=\"key\"<seq2seq4repair_space>value=\"value\"<seq2seq4repair_space>//>" , getInputTag ( output ) ) ; FormTagTests . assertFormTagOpened ( output ) ; FormTagTests . assertFormTagClosed ( output ) ; } private String getFormTag ( String output ) { } private String getInputTag ( String output ) { } private static void assertFormTagOpened ( String output ) { } private static void assertFormTagClosed ( String output ) { } }

Fix:
given ( processor . processAction ( this . request , action ) ) . willReturn ( action ) ;
Buggy code:
@ Named ( "workflowController" ) @ SessionScoped public class WorkflowController extends org . imixs . workflow . jee . faces . workitem . WorkflowController implements Serializable { private static final long serialVersionUID = 1L ; @ Inject private FileUploadController fileUploadController ; public void setFileUploadController ( FileUploadController fleUploadController ) { } @ Override public String process ( ) throws AccessDeniedException , PluginException , ProcessingErrorException { String id = this . getWorkitem ( ) . getItemValueString ( "Team" ) ; if ( ! ( "" . equals ( id ) ) ) { ItemCollection team = this . getEntityService ( ) . load ( id ) ; if ( team != null ) this . getWorkitem ( ) . replaceItemValue ( "namTeam" , team . getItemValue ( "Members" ) ) ; } <START_BUG> fileUploadController . updateWorkitem ( this . getWorkitem ( ) , false ) ; <END_BUG> String result = super . process ( ) ; return result ; } @ Override public void setWorkitem ( ItemCollection aworkitem ) { } }

Fix:
fileUploadController . updateWorkitem ( this . getWorkitem ( ) ) ;
Buggy code:
public class SessionAttributeCacheKey { private final String id ; private final String attribute ; public SessionAttributeCacheKey ( String id , String attribute ) { } @ Group public String getId ( ) { } public String getAttribute ( ) { } @ Override public int hashCode ( ) { <START_BUG> return ( this . id . hashCode ( ) ) ^ ( this . attribute . hashCode ( ) ) ; <END_BUG> } @ Override public boolean equals ( Object object ) { } @ Override public String toString ( ) { } }

Fix:
return this . id . hashCode ( ) ;
Buggy code:
public class ConnectionManager { private final String USER_AGENT = "Mozilla//5.0" ; private HttpURLConnection connection ; private static final boolean BACKEND_DEBUG = false ; private static final String BASE_URL = "http:////104.236.221.152//sb//" ; public ConnectionManager ( ) { } public String register ( String username , String email , String gcm_id ) throws Exception { } public void updateCoords ( String usr_id , double latitude , double longitude ) throws Exception { } public void addCourses ( String usr_id , String courses_str ) throws Exception { } public String startConvo ( String name ) throws Exception { } public void addUsertoConvo ( String convoId , String userId ) throws Exception { } public void sendMessage ( String convo_id , String author , String message ) throws Exception { } public List < Integer > getNearbyUsers ( String [ ] courses , double latitude , double longitude , int radius ) throws Exception { StringBuilder sb = new StringBuilder ( ) ; for ( String course : courses ) { sb . append ( course ) ; sb . append ( "," ) ; } sb . setLength ( ( ( sb . length ( ) ) - 1 ) ) ; String url = ( ( ( ( ( ( ( ( ( ConnectionManager . BASE_URL ) + "close_users" ) + ( sb . toString ( ) ) ) + "//" ) + ( Double . toString ( latitude ) ) ) + "//" ) + ( Double . toString ( longitude ) ) ) + "//" ) + ( Integer . toString ( radius ) ) ) + "//" ; String response = sendGet ( url ) ; JSONObject respJson = new JSONObject ( response ) ; List < Integer > closePeople = new ArrayList < Integer > ( ) ; for ( String course : courses ) { JSONArray ary = respJson . getJSONArray ( course ) ; for ( int i = 0 ; i < ( ary . length ( ) ) ; i ++ ) { <START_BUG> JSONObject item = ary [ i ] ; <END_BUG> closePeople . add ( item . getInt ( "id" ) ) ; } } return closePeople ; } private String sendGet ( String url ) throws Exception { } private String sendPost ( String url , String postParams ) throws Exception { } }

Fix:
JSONObject item = ary . getJSONObject ( i ) ;
Buggy code:
public class JDBCInformixCreateCommand extends JDBCIdentityColumnCreateCommand { private static final String NAME = "class-name" ; private static final String DEFAULT_CLASS = "com.informix.jdbc.IfxStatement" ; private static final String METHOD = "method" ; private static final String DEFAULT_METHOD = "getSerial" ; private String className ; private String methodName ; private Method method ; private Method getUnderlyingStatement ; public void init ( JDBCStoreManager manager ) { super . init ( manager ) ; ClassLoader loader = GetTCLAction . getContextClassLoader ( ) ; try { Class psClass = loader . loadClass ( className ) ; method = psClass . getMethod ( methodName ) ; } catch ( ClassNotFoundException e ) { throw CmpMessages . MESSAGES . failedToLoadDriverClass ( className , e ) ; } catch ( NoSuchMethodException e ) { throw CmpMessages . MESSAGES . driverDoesNotHaveMethod ( className , methodName ) ; } try { <START_BUG> Class wrapperClass = loader . loadClass ( "org.jboss.resource.adapter.jdbc.StatementAccess" ) ; <END_BUG> getUnderlyingStatement = wrapperClass . getMethod ( "getUnderlyingStatement" ) ; } catch ( ClassNotFoundException e ) { throw CmpMessages . MESSAGES . couldNotLoadStatementAccess ( e ) ; } catch ( NoSuchMethodException e ) { throw CmpMessages . MESSAGES . getUnderlyingStatementNotFound ( e ) ; } } protected void initEntityCommand ( JDBCEntityCommandMetaData entityCommand ) { } protected int executeInsert ( int paramIndex , PreparedStatement ps , CmpEntityBeanContext ctx ) throws SQLException { } }

Fix:
Class wrapperClass = loader . loadClass ( "org.jboss.jca.adapters.jdbc.StatementAccess" ) ;
Buggy code:
public abstract class Resource implements IResourceListener { private static final long serialVersionUID = 1L ; private static Log log = LogFactory . getLog ( Resource . class ) ; private boolean cacheable ; private Duration idleTimeout = Duration . NONE ; private static final ThreadLocal parameters = new ThreadLocal ( ) ; protected Resource ( ) { } public Resource ( Duration value ) { } public Duration getIdleTimeout ( ) { } public abstract IResourceStream getResourceStream ( ) { } public final boolean isCacheable ( ) { } public final void onResourceRequested ( ) { } public final Resource setCacheable ( boolean cacheable ) { } public final void setParameters ( final Map parameters ) { } protected void configureResponse ( final Response response ) { } protected ValueMap getParameters ( ) { <START_BUG> if ( ( Resource . parameters ) == null ) { <END_BUG> setParameters ( RequestCycle . get ( ) . getRequest ( ) . getParameterMap ( ) ) ; } return ( ( ValueMap ) ( Resource . parameters . get ( ) ) ) ; } protected void invalidate ( ) { } private final IResourceStream init ( ) { } private final void respond ( final IResourceStream resourceStream , final Response response ) { } }

Fix:
if ( ( Resource . parameters . get ( ) ) == null ) {
Buggy code:
public class QuillUtils { static Fraction getFraction ( String fraction ) { } static Fraction getFraction ( char d ) { if ( PianoHolder . getDotted ( ) ) { <START_BUG> QuillUtils . getDottedFraction ( d ) ; <END_BUG> } else { switch ( d ) { case 'w' : return fr ( 1 , 1 ) ; case 'h' : return fr ( 1 , 2 ) ; case 'q' : return fr ( 1 , 4 ) ; case 'i' : return fr ( 1 , 8 ) ; case 's' : return fr ( 1 , 16 ) ; case 't' : return fr ( 1 , 32 ) ; case 'x' : return fr ( 1 , 64 ) ; } } System . err . println ( ( "Invalid<seq2seq4repair_space>duration:<seq2seq4repair_space>" + d ) ) ; return null ; } static Fraction getDottedFraction ( char d ) { } static Pitch getPitch ( char p , char a , int o ) { } static int getFifth ( String keyRoot , String mode ) { } public static Key getKeySig ( String keyRoot , String mode ) { } public static Clef getClef ( String clef ) { } public static Time getTime ( String timeSig ) { } public static Chord chord ( Fraction fraction , Pitch ... pitches ) { } private static Chord chord ( Fraction fraction , ArticulationType [ ] articulations , Pitch ... pitches ) { } public static SlurWaypoint clwp ( Chord c , BezierPoint bezierPoint ) { } class Beamer { private Fraction counter = null ; public Beamer ( Fraction initialNote ) { } } }

Fix:
return QuillUtils . getDottedFraction ( d ) ;
Buggy code:
public class SubstitutionGroupComparator { private final int TOP_LEVEL_SCOPE = - 1 ; private StringPool fStringPool = null ; private GrammarResolver fGrammarResolver = null ; private XMLErrorReporter fErrorReporter = null ; private SubstitutionGroupComparator ( ) { } public SubstitutionGroupComparator ( GrammarResolver grammarResolver , StringPool stringPool , XMLErrorReporter errorReporter ) { } public boolean isEquivalentTo ( QName anElement , QName exemplar ) throws Exception { } public boolean isAllowedByWildcard ( QName element , int wuri , boolean wother ) throws Exception { if ( ( ( ! wother ) && ( ( element . uri ) == wuri ) ) || ( wother && ( ( element . uri ) != wuri ) ) ) { return true ; } if ( ( ( fGrammarResolver ) == null ) || ( ( fStringPool ) == null ) ) { throw new SAXException ( "Internal<seq2seq4repair_space>error;<seq2seq4repair_space>tried<seq2seq4repair_space>to<seq2seq4repair_space>check<seq2seq4repair_space>an<seq2seq4repair_space>element<seq2seq4repair_space>against<seq2seq4repair_space>a<seq2seq4repair_space>substitutionGroup,<seq2seq4repair_space>but<seq2seq4repair_space>no<seq2seq4repair_space>GrammarResolver<seq2seq4repair_space>is<seq2seq4repair_space>defined" ) ; } String uri = fStringPool . toString ( element . uri ) ; if ( uri == null ) return false ; SchemaGrammar sGrammar = null ; try { sGrammar = ( ( SchemaGrammar ) ( fGrammarResolver . getGrammar ( uri ) ) ) ; } catch ( ClassCastException ce ) { String er = ( "Grammar<seq2seq4repair_space>with<seq2seq4repair_space>URI<seq2seq4repair_space>" + uri ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>schema<seq2seq4repair_space>grammar!" ; Object [ ] a = new Object [ ] { er } ; fErrorReporter . reportError ( fErrorReporter . getLocator ( ) , XML_DOMAIN , MSG_GENERIC_SCHEMA_ERROR , SCHEMA_GENERIC_ERROR , a , ERRORTYPE_RECOVERABLE_ERROR ) ; return false ; } if ( sGrammar == null ) return false ; int elementIndex = sGrammar . getElementDeclIndex ( element , TOP_LEVEL_SCOPE ) ; Vector substitutionGroupQNames = sGrammar . getElementDeclAllSubstitutionGroupQNames ( elementIndex , fGrammarResolver , fStringPool ) ; int size = ( substitutionGroupQNames == null ) ? 0 : substitutionGroupQNames . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { <START_BUG> QName name = ( ( SchemaGrammar . OneSubGroup ) ( substitutionGroupQNames . get ( i ) ) ) . name ; <END_BUG> if ( ( ( ! wother ) && ( ( name . uri ) == wuri ) ) || ( wother && ( ( name . uri ) != wuri ) ) ) { return true ; } } return false ; } }

Fix:
QName name = ( ( SchemaGrammar . OneSubGroup ) ( substitutionGroupQNames . elementAt ( i ) ) ) . name ;
Buggy code:
public class AIRS_remotevalues extends Activity { public static final int REFRESH_VALUES = 1 ; private TextView mTitle ; private TextView mTitle2 ; private TextView mValue1 ; private TextView mValue2 ; private com . airs . AIRS_remote AIRS_remote = null ; private Activity act ; private AIRS_remotevalues . ValuesThread Values ; @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public synchronized void onRestart ( ) { } @ Override public void onStop ( ) { } @ Override public void onDestroy ( ) { } public void onActivityResult ( int requestCode , int resultCode , Intent data ) { } @ Override public boolean onPrepareOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { switch ( item . getItemId ( ) ) { case id . main_about : Toast . makeText ( getApplicationContext ( ) , RemoteAbout , LENGTH_LONG ) . show ( ) ; return true ; case id . remote_exit : AlertDialog . Builder builder = new AlertDialog . Builder ( this ) ; <START_BUG> builder . setMessage ( "Are<seq2seq4repair_space>you<seq2seq4repair_space>sure<seq2seq4repair_space>you<seq2seq4repair_space>want<seq2seq4repair_space>to<seq2seq4repair_space>exit?" ) . setTitle ( "NORS<seq2seq4repair_space>Remote<seq2seq4repair_space>Sensing" ) . setCancelable ( false ) . setPositiveButton ( "Yes" , new DialogInterface . OnClickListener ( ) { <END_BUG> public void onClick ( DialogInterface dialog , int id ) { SerialPortLogger . debugForced ( "AIRS_remotevalues::Exiting" ) ; if ( ( AIRS_remote ) != null ) stopService ( new Intent ( act , com . airs . AIRS_remote . class ) ) ; SerialPortLogger . debugForced ( "AIRS_remotevalues::...stopped<seq2seq4repair_space>service" ) ; finish ( ) ; } } ) . setNegativeButton ( "No" , new DialogInterface . OnClickListener ( ) { public void onClick ( DialogInterface dialog , int id ) { dialog . cancel ( ) ; } } ) ; AlertDialog alert = builder . create ( ) ; alert . show ( ) ; return true ; } return false ; } private ServiceConnection mConnection = new ServiceConnection ( ) { public void onServiceConnected ( ComponentName className , IBinder service ) { } public void onServiceDisconnected ( ComponentName className ) { } } ; public final Handler mHandler = new Handler ( ) { @ Override public void handleMessage ( Message msg ) { } } ; private class ValuesThread implements Runnable { public Thread thread ; ValuesThread ( ) { } public void run ( ) { } } }

Fix:
builder . setMessage ( "Are<seq2seq4repair_space>you<seq2seq4repair_space>sure<seq2seq4repair_space>you<seq2seq4repair_space>want<seq2seq4repair_space>to<seq2seq4repair_space>exit?" ) . setTitle ( "AIRS<seq2seq4repair_space>Remote<seq2seq4repair_space>Sensing" ) . setCancelable ( false ) . setPositiveButton ( "Yes" , new DialogInterface . OnClickListener ( ) {
Buggy code:
public class MountMapper extends AbstractMapper { private final String [ ] mountSegments ; private final IMountedRequestMapper mapper ; public MountMapper ( String mountPath , IMountedRequestMapper mapper ) { } public MountMapper ( String mountPath , IRequestMapper mapper ) { } public MountMapper ( String mountPath , IRequestHandler handler ) { } public int getCompatibilityScore ( Request request ) { } private Request dismountRequest ( Request request ) { Url dismountedUrl = new Url ( request . getUrl ( ) ) ; dismountedUrl . removeLeadingSegments ( mountSegments . length ) ; <START_BUG> return request . requestWithUrl ( dismountedUrl ) ; <END_BUG> } public final IRequestHandler mapRequest ( Request request ) { } public Url mapHandler ( IRequestHandler handler ) { } }

Fix:
return request . cloneWithUrl ( dismountedUrl ) ;
Buggy code:
public class AddressbookTreeModel extends DefaultTreeModel { protected DefaultXmlConfig folderXmlConfig ; private final Class [ ] FOLDER_ITEM_ARG = new Class [ ] { FolderItem . class } ; public AddressbookTreeModel ( XmlElement root ) { } public void createDirectories ( XmlElement parentTreeNode , AddressbookTreeNode parentFolder ) { } public AddressbookTreeNode add ( XmlElement childNode , AddressbookTreeNode parentFolder ) { FolderItem item = new FolderItem ( childNode ) ; if ( item == null ) return null ; String name = null ; int uid = item . getInteger ( "uid" ) ; name = item . get ( "property" , "name" ) ; String type = item . get ( "type" ) ; Object [ ] args = new Object [ ] { item } ; FolderPluginHandler handler = null ; try { <START_BUG> handler = ( ( FolderPluginHandler ) ( pluginManager . getHandler ( "addressbook_folder" ) ) ) ; <END_BUG> } catch ( PluginHandlerNotFoundException ex ) { NotifyDialog d = new NotifyDialog ( ) ; d . showDialog ( ex ) ; } AddressbookTreeNode folder = null ; try { folder = ( ( AddressbookTreeNode ) ( handler . getPlugin ( type , args ) ) ) ; parentFolder . add ( folder ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } return folder ; } public AddressbookTreeNode getFolder ( int uid ) { } }

Fix:
handler = ( ( FolderPluginHandler ) ( pluginManager . getHandler ( "org.columba.addressbook.folder" ) ) ) ;
Buggy code:
public class LinkingContainerEditpart extends AbstractLinkingContainerEditpart { private static int linkingContainerID = 0 ; private List < ConnectionModel > connectionList ; private Map < ConnectionModel , PointList > originalPoints ; @ Override protected IFigure doCreateFigure ( ) { LinkingContainerFigure f = new LinkingContainerFigure ( ) ; f . setZoomToFitAll ( getWidgetModel ( ) . isAutoFit ( ) ) ; f . getZoomManager ( ) . addZoomListener ( new ZoomListener ( ) { @ Override public void zoomChanged ( double arg0 ) { <START_BUG> if ( ( getViewer ( ) ) == null ) { <END_BUG> return ; } getViewer ( ) . getControl ( ) . getDisplay ( ) . timerExec ( 100 , new Runnable ( ) { @ Override public void run ( ) { updateConnectionList ( ) ; } } ) ; } } ) ; return f ; } @ Override public void setParent ( EditPart parent ) { } @ Override protected void createEditPolicies ( ) { } @ Override public LinkingContainerModel getWidgetModel ( ) { } @ Override protected void registerPropertyChangeHandlers ( ) { } private synchronized void loadWidgets ( final IPath path , final boolean checkSelf ) { } private synchronized void configureDisplayModel ( ) { } private void updateConnectionList ( ) { } @ Override protected final EditPart createChild ( final Object model ) { } @ Override public IFigure getContentPane ( ) { } @ Override public void layout ( ) { } @ Override protected synchronized void doRefreshVisuals ( IFigure refreshableFigure ) { } @ Override public Object getAdapter ( @ SuppressWarnings ( "rawtypes" ) Class adapter ) { } }

Fix:
if ( ( ( getViewer ( ) ) == null ) || ( ( getViewer ( ) . getControl ( ) ) == null ) ) {
Buggy code:
public class MenuState extends State implements Button . Listener { private final Button play ; private final Button settings ; private final MenuResources resources = new MenuResources ( ) ; private Camera cam ; private Sprite background ; private BitmapFont font ; private enum Screen { MENU , SETTINGS ; } private MenuState . Screen screen = MenuState . Screen . MENU ; private boolean switchToPlay ; private static final int PLAYBUTTON_X = 240 ; private static final int PLAYBUTTON_Y = 80 ; private static final int SETTINGSBUTTON_X = 340 ; private static final int SETTINGSBUTTON_Y = 80 ; public MenuState ( Game game ) { } @ Override public void update ( long delta ) { } @ Override public void draw ( SpriteBatch batch ) { cam . beginFocus ( ) ; batch . begin ( ) ; batch . draw ( background ) ; <START_BUG> font . draw ( batch , "JE<seq2seq4repair_space>MOEDER<seq2seq4repair_space>IS<seq2seq4repair_space>DIK!" , 0 , 0 , 1 , 1 , new Color ( 0 , 127 , 127 , 127 ) ) ; <END_BUG> switch ( screen ) { case MENU : play . draw ( batch ) ; settings . draw ( batch ) ; break ; case SETTINGS : break ; } batch . end ( ) ; cam . endFocus ( ) ; Display . update ( ) ; } @ Override public void deleteResources ( ) { } @ Override public void onPress ( Button b ) { } @ Override public void onRelease ( Button b ) { } @ Override public void onPressed ( Button b ) { } }

Fix:
font . draw ( batch , "echo:<seq2seq4repair_space>dat<seq2seq4repair_space>swag<seq2seq4repair_space>doe" , 0 , 0 , 0.4F , 0.3F , new Color ( 0 , 127 , 127 , 127 ) ) ;
Buggy code:
public class TestBinaryTerms extends LuceneTestCase { public void testBinary ( ) throws IOException { Directory dir = newDirectory ( ) ; RandomIndexWriter iw = new RandomIndexWriter ( random ( ) , dir ) ; BytesRef bytes = new BytesRef ( 2 ) ; BinaryTokenStream tokenStream = new BinaryTokenStream ( bytes ) ; for ( int i = 0 ; i < 256 ; i ++ ) { bytes . bytes [ 0 ] = ( ( byte ) ( i ) ) ; bytes . bytes [ 1 ] = ( ( byte ) ( 255 - i ) ) ; bytes . length = 2 ; Document doc = new Document ( ) ; FieldType customType = new FieldType ( ) ; customType . setStored ( true ) ; doc . add ( new org . apache . lucene . document . Field ( "id" , ( "" + i ) , customType ) ) ; doc . add ( new org . apache . lucene . document . TextField ( "bytes" , tokenStream ) ) ; iw . addDocument ( doc ) ; } IndexReader ir = iw . getReader ( ) ; <START_BUG> iw . close ( ) ; <END_BUG> IndexSearcher is = newSearcher ( ir ) ; for ( int i = 0 ; i < 256 ; i ++ ) { bytes . bytes [ 0 ] = ( ( byte ) ( i ) ) ; bytes . bytes [ 1 ] = ( ( byte ) ( 255 - i ) ) ; bytes . length = 2 ; TopDocs docs = is . search ( new TermQuery ( new Term ( "bytes" , bytes ) ) , 5 ) ; assertEquals ( 1 , docs . totalHits ) ; assertEquals ( ( "" + i ) , is . doc ( docs . scoreDocs [ 0 ] . doc ) . get ( "id" ) ) ; } ir . close ( ) ; dir . close ( ) ; } public void testToString ( ) { } }

Fix:
iw . shutdown ( ) ;
Buggy code:
public class SendAllMessagesCommand extends FolderCommand { protected SendListManager sendListManager = new SendListManager ( ) ; protected OutboxFolder outboxFolder ; public SendAllMessagesCommand ( FrameMediator frameMediator , DefaultCommandReference [ ] references ) { } public void execute ( Worker worker ) throws Exception { FolderCommandReference [ ] r = ( ( FolderCommandReference [ ] ) ( getReferences ( ) ) ) ; worker . setDisplayText ( MailResourceLoader . getString ( "statusbar" , "message" , "send_message" ) ) ; outboxFolder = ( ( OutboxFolder ) ( r [ 0 ] . getFolder ( ) ) ) ; Object [ ] uids = outboxFolder . getUids ( ) ; for ( int i = 0 ; i < ( uids . length ) ; i ++ ) { if ( ( outboxFolder . exists ( uids [ i ] ) ) == true ) { <START_BUG> SendableMessage message = ( ( SendableMessage ) ( outboxFolder . getMessage ( uids [ i ] ) ) ) ; <END_BUG> sendListManager . add ( message ) ; } } int actAccountUid = - 1 ; List sentList = new Vector ( ) ; boolean open = false ; SMTPServer smtpServer = null ; Folder sentFolder = null ; while ( sendListManager . hasMoreMessages ( ) ) { SendableMessage message = sendListManager . getNextMessage ( ) ; if ( ( message . getAccountUid ( ) ) != actAccountUid ) { actAccountUid = message . getAccountUid ( ) ; AccountItem accountItem = MailConfig . getAccountList ( ) . uidGet ( actAccountUid ) ; sentFolder = ( ( Folder ) ( treeModel . getFolder ( Integer . parseInt ( accountItem . getSpecialFoldersItem ( ) . get ( "sent" ) ) ) ) ) ; smtpServer = new SMTPServer ( accountItem ) ; open = smtpServer . openConnection ( ) ; ( ( StatusObservableImpl ) ( smtpServer . getObservable ( ) ) ) . setWorker ( worker ) ; } if ( open ) { try { smtpServer . sendMessage ( message , worker ) ; sentList . add ( message . getHeader ( ) . get ( "columba.uid" ) ) ; } catch ( SMTPException e ) { JOptionPane . showMessageDialog ( null , e . getMessage ( ) , "Error<seq2seq4repair_space>while<seq2seq4repair_space>sending" , JOptionPane . ERROR_MESSAGE ) ; } } } worker . clearDisplayTextWithDelay ( ) ; if ( ( sentList . size ( ) ) > 0 ) { moveToSentFolder ( sentList , sentFolder ) ; sentList . clear ( ) ; } } protected void moveToSentFolder ( List v , Folder sentFolder ) { } }

Fix:
SendableMessage message = outboxFolder . getSendableMessage ( uids [ i ] ) ;
Buggy code:
public class StandardDeviation { public static void calcSD ( ArrayList < Double > arr ) { double ss = 0 ; double ave = 0 ; for ( int i = 0 ; i < ( arr . size ( ) ) ; i ++ ) { ave += arr . get ( i ) ; } ave //= arr . size ( ) ; System . out . println ( ( "Average<seq2seq4repair_space>=<seq2seq4repair_space>" + ave ) ) ; for ( int i = 0 ; i < ( arr . size ( ) ) ; i ++ ) { ss += ( ( arr . get ( i ) ) - ave ) * ( ( arr . get ( i ) ) - ave ) ; } <START_BUG> ss //= arr . size ( ) ; <END_BUG> System . out . println ( ( "Standard<seq2seq4repair_space>Deviation<seq2seq4repair_space>is<seq2seq4repair_space>" + ( Math . sqrt ( ss ) ) ) ) ; } public static void main ( String [ ] args ) { } }

Fix:
ss //= ( arr . size ( ) ) - 1 ;
Buggy code:
public class Relation { private final Identifier first ; private final Identifier second ; public Relation ( Identifier first , Identifier second ) { } public Identifier getFirst ( ) { } public Identifier getSecond ( ) { } public boolean isCyclic ( ) { <START_BUG> return ( first . toString ( ) ) == ( second . toString ( ) ) ; <END_BUG> } public void print ( ) { } }

Fix:
return first . toString ( ) . equals ( second . toString ( ) ) ;
Buggy code:
public class AutomatonTestUtil { public static String randomRegexp ( Random r ) { } private static String randomRegexpString ( Random r ) { } private static int getRandomCodePoint ( final Random r , final Transition t ) { final int code ; if ( ( ( t . max ) < ( UnicodeUtil . UNI_SUR_HIGH_START ) ) || ( ( t . min ) > ( UnicodeUtil . UNI_SUR_HIGH_END ) ) ) { code = ( t . min ) + ( r . nextInt ( ( ( ( t . max ) - ( t . min ) ) + 1 ) ) ) ; } else if ( ( t . min ) >= ( UnicodeUtil . UNI_SUR_HIGH_START ) ) { if ( ( t . max ) > ( UnicodeUtil . UNI_SUR_LOW_END ) ) { <START_BUG> code = ( 1 + ( UnicodeUtil . UNI_SUR_LOW_END ) ) + ( r . nextInt ( ( ( ( t . max ) - ( UnicodeUtil . UNI_SUR_LOW_END ) ) + 1 ) ) ) ; <END_BUG> } else { throw new IllegalArgumentException ( ( "transition<seq2seq4repair_space>accepts<seq2seq4repair_space>only<seq2seq4repair_space>surrogates:<seq2seq4repair_space>" + t ) ) ; } } else if ( ( t . max ) <= ( UnicodeUtil . UNI_SUR_LOW_END ) ) { if ( ( t . min ) < ( UnicodeUtil . UNI_SUR_HIGH_START ) ) { code = ( t . min ) + ( r . nextInt ( ( ( UnicodeUtil . UNI_SUR_HIGH_START ) - ( t . min ) ) ) ) ; } else { throw new IllegalArgumentException ( ( "transition<seq2seq4repair_space>accepts<seq2seq4repair_space>only<seq2seq4repair_space>surrogates:<seq2seq4repair_space>" + t ) ) ; } } else { int gap1 = ( UnicodeUtil . UNI_SUR_HIGH_START ) - ( t . min ) ; int gap2 = ( t . max ) - ( UnicodeUtil . UNI_SUR_LOW_END ) ; int c = r . nextInt ( ( gap1 + gap2 ) ) ; if ( c < gap1 ) { code = ( t . min ) + c ; } else { code = ( ( ( UnicodeUtil . UNI_SUR_LOW_END ) + c ) - gap1 ) + 1 ; } } assert ( ( code >= ( t . min ) ) && ( code <= ( t . max ) ) ) && ( ( code < ( UnicodeUtil . UNI_SUR_HIGH_START ) ) || ( code > ( UnicodeUtil . UNI_SUR_LOW_END ) ) ) : ( ( ( ( "code=" + code ) + "<seq2seq4repair_space>min=" ) + ( t . min ) ) + "<seq2seq4repair_space>max=" ) + ( t . max ) ; return code ; } public static class RandomAcceptedStrings { private final Map < Transition , Boolean > leadsToAccept ; private final Automaton a ; private static class ArrivingTransition { final State from ; final Transition t ; public ArrivingTransition ( State from , Transition t ) { } } public RandomAcceptedStrings ( Automaton a ) { } public int [ ] getRandomAcceptedString ( Random r ) { } } public static Automaton randomAutomaton ( Random random ) { } public static void minimizeSimple ( Automaton a ) { } public static void determinizeSimple ( Automaton a ) { } public static void determinizeSimple ( Automaton a , Set < State > initialset ) { } }

Fix:
code = ( 1 + ( UnicodeUtil . UNI_SUR_LOW_END ) ) + ( r . nextInt ( ( ( t . max ) - ( UnicodeUtil . UNI_SUR_LOW_END ) ) ) ) ;