nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class CreateElementInCUOperation extends JavaModelOperation { protected IDOMCompilationUnit fCUDOM ; protected static final int INSERT_LAST = 1 ; protected static final int INSERT_AFTER = 2 ; protected static final int INSERT_BEFORE = 3 ; protected int fInsertionPolicy = CreateElementInCUOperation . INSERT_LAST ; protected IJavaElement fAnchorElement = null ; protected boolean fCreationOccurred = true ; protected DOMNode fCreatedElement ; protected int fInsertionPosition = - 1 ; protected int fReplacementLength = - 1 ; public CreateElementInCUOperation ( IJavaElement parentElement ) { } protected void checkCanceled ( ) { } public void createAfter ( IJavaElement sibling ) { } public void createBefore ( IJavaElement sibling ) { } protected void executeOperation ( ) throws JavaModelException { beginTask ( getMainTaskName ( ) , getMainAmountOfWork ( ) ) ; JavaElementDelta delta = newJavaElementDelta ( ) ; ICompilationUnit unit = getCompilationUnit ( ) ; generateNewCompilationUnitDOM ( unit ) ; if ( fCreationOccurred ) { Buffer buffer = ( ( Buffer ) ( unit . getBuffer ( ) ) ) ; switch ( fReplacementLength ) { case - 1 : buffer . append ( fCreatedElement . getCharacters ( ) , true ) ; break ; case 0 : <START_BUG> if ( ( fInsertionPosition ) == ( ( buffer . getLength ( ) ) - 1 ) ) { <END_BUG> buffer . append ( fCreatedElement . getCharacters ( ) , true ) ; } else { buffer . replace ( fInsertionPosition , 0 , fCreatedElement . getCharacters ( ) , true ) ; } break ; default : buffer . replace ( fInsertionPosition , fReplacementLength , fCreatedElement . getCharacters ( ) , true ) ; } unit . save ( null , false ) ; this . hasModifiedResource = true ; worked ( 1 ) ; fResultElements = generateResultHandles ( ) ; if ( unit . getParent ( ) . exists ( ) ) { for ( int i = 0 ; i < ( fResultElements . length ) ; i ++ ) { delta . added ( fResultElements [ i ] ) ; } addDelta ( delta ) ; } } done ( ) ; } protected abstract IDOMNode generateElementDOM ( ) throws JavaModelException { } protected void generateNewCompilationUnitDOM ( ICompilationUnit cu ) throws JavaModelException { } protected abstract IJavaElement generateResultHandle ( ) { } protected IJavaElement [ ] generateResultHandles ( ) throws JavaModelException { } protected ICompilationUnit getCompilationUnit ( ) { } protected int getMainAmountOfWork ( ) { } protected abstract String getMainTaskName ( ) { } public IJavaElement [ ] getResultElements ( ) { } protected void initializeDefaultPosition ( ) { } protected void insertDOMNode ( IDOMNode parent , IDOMNode child ) { } protected void setAlteredName ( String newName ) { } protected void setRelativePosition ( IJavaElement sibling , int policy ) throws IllegalArgumentException { } public IJavaModelStatus verify ( ) { } }

Fix:
if ( ( ( fInsertionPosition ) == ( ( buffer . getLength ( ) ) - 1 ) ) && ( ( buffer . getChar ( fInsertionPosition ) ) == '{' ) ) {
Buggy code:
public class TestSQLBigIntegerId extends SingleEMFTestCase { public void setUp ( ) { } public void testPersist ( ) { } public static void main ( String [ ] args ) { <START_BUG> TestRunner . run ( SQLBigIntegerIdEntity . class ) ; <END_BUG> } }

Fix:
TestRunner . run ( TestSQLBigIntegerId . class ) ;
Buggy code:
public class OperatorToken extends FunctionToken { private enum Operator { PLUS ( '+' ) , MINUS ( '-' ) , MULTIPLY ( '*' ) , DIVIDE ( '//' ) , MODULO ( '%' ) , POW ( '^' ) ; private final char mToken ; private Operator ( ) { } private Operator ( char token ) { } } private static final HashMap < String , OperatorToken > mMap ; private final byte mPrecedence ; private final boolean bIsRightAssoc ; private final OperatorToken . Operator mOperator ; public OperatorToken ( OperatorToken . Operator op , byte prec , boolean bRightAssoc ) { } public byte getPrecedence ( ) { } public boolean isRightAssociative ( ) { } public static boolean isValidToken ( String token ) { } public static OperatorToken getOperator ( String token ) { } public static HashMap < String , OperatorToken > getTokenMap ( ) { } @ Override public double calculate ( double [ ] params ) throws CalculationException { if ( ( params . length ) == 2 ) { switch ( mOperator ) { case PLUS : return ( params [ 0 ] ) + ( params [ 1 ] ) ; case MINUS : return ( params [ 0 ] ) - ( params [ 1 ] ) ; case MULTIPLY : <START_BUG> return ( params [ 0 ] ) - ( params [ 1 ] ) ; <END_BUG> case MODULO : return ( params [ 0 ] ) % ( params [ 1 ] ) ; case POW : return MathUtils . pow ( params [ 1 ] , params [ 2 ] ) ; case DIVIDE : if ( ( params [ 1 ] ) != 0 ) { return ( params [ 0 ] ) // ( params [ 1 ] ) ; } else { throw new CalculationException ( "Division<seq2seq4repair_space>by<seq2seq4repair_space>zero" ) ; } default : throw new CalculationException ( ( "Invalid<seq2seq4repair_space>operator:<seq2seq4repair_space>" + ( mStrToken ) ) ) ; } } else if ( ( params . length ) == 1 ) { if ( mStrToken . equals ( "-" ) ) { return ( params [ 0 ] ) * ( - 1.0 ) ; } else { throw new FunctionArgException ( this ) ; } } else { throw new FunctionArgException ( this ) ; } } }

Fix:
return ( params [ 0 ] ) * ( params [ 1 ] ) ;
Buggy code:
public class ServletWebRequestTests { private MockHttpServletRequest servletRequest ; private MockHttpServletResponse servletResponse ; private ServletWebRequest request ; @ Before public void setUp ( ) { } @ Test public void parameters ( ) { } @ Test public void locale ( ) { } @ Test public void nativeRequest ( ) { } @ Test public void decoratedNativeRequest ( ) { } @ Test public void checkNotModifiedTimeStamp ( ) { } @ Test public void checkModifiedTimeStamp ( ) { long currentTime = new Date ( ) . getTime ( ) ; long oneMinuteAgo = currentTime - ( 1000 * 60 ) ; servletRequest . setMethod ( "GET" ) ; servletRequest . addHeader ( "If-Modified-Since" , oneMinuteAgo ) ; request . checkNotModified ( currentTime ) ; assertEquals ( 200 , servletResponse . getStatus ( ) ) ; <START_BUG> assertEquals ( currentTime , servletResponse . getHeader ( "Last-Modified" ) ) ; <END_BUG> } @ Test public void checkNotModifiedETag ( ) { } @ Test public void checkModifiedETag ( ) { } }

Fix:
assertEquals ( ( "" + currentTime ) , servletResponse . getHeader ( "Last-Modified" ) ) ;
Buggy code:
public class DirichletJob { private DirichletJob ( ) { } public static void main ( String [ ] args ) throws IOException , ClassNotFoundException , IllegalAccessException , InstantiationException { } public static void runJob ( String input , String output , String modelFactory , int numModels , int maxIterations , double alpha_0 ) throws IOException , ClassNotFoundException , IllegalAccessException , InstantiationException { JobConf conf = new JobConf ( DirichletJob . class ) ; Path outPath = new Path ( output ) ; <START_BUG> FileSystem fs = FileSystem . get ( conf ) ; <END_BUG> if ( fs . exists ( outPath ) ) { fs . delete ( outPath , true ) ; } fs . mkdirs ( outPath ) ; DirichletDriver . runJob ( input , output , modelFactory , numModels , maxIterations , alpha_0 , 1 ) ; } }

Fix:
FileSystem fs = FileSystem . get ( outPath . toUri ( ) , conf ) ;
Buggy code:
public class CardComparator implements Comparator < Card > { private boolean sortBySuit ; private Suit trump ; private ArrayList < Suit > suitOrder ; private ArrayList < Rank > rankOrder ; public CardComparator ( ) { } public CardComparator ( ArrayList < Rank > ranks ) { } public int compare ( Card a , Card b ) { Rank aRank = a . getRank ( ) ; Rank bRank = b . getRank ( ) ; Suit aSuit = a . getSuit ( ) ; Suit bSuit = b . getSuit ( ) ; <START_BUG> assert ( aRank != bRank ) && ( aSuit != bSuit ) ; <END_BUG> if ( aSuit == ( trump ) ) { if ( bSuit == ( trump ) ) return ( rankOrder . indexOf ( aRank ) ) - ( rankOrder . indexOf ( bRank ) ) ; else return 1 ; } else if ( bSuit == ( trump ) ) return - 1 ; else if ( sortBySuit ) { if ( aSuit == bSuit ) return ( rankOrder . indexOf ( aRank ) ) - ( rankOrder . indexOf ( bRank ) ) ; return ( suitOrder . indexOf ( aSuit ) ) - ( suitOrder . indexOf ( bSuit ) ) ; } else return ( rankOrder . indexOf ( aRank ) ) - ( rankOrder . indexOf ( bRank ) ) ; } public void setAcesHigh ( boolean b ) { } public void sortBySuit ( boolean b ) { } public void setHighestSuit ( Suit s ) { } public void setTrump ( Suit s ) { } }

Fix:
assert ( aRank != bRank ) || ( aSuit != bSuit ) ;
Buggy code:
public class ChannelService implements Service < Channel > { private static final ServiceName SERVICE_NAME = JBOSS . append ( SUBSYSTEM_NAME ) . append ( "channel" ) ; private static final long STATE_TRANSFER_TIMEOUT = 60000 ; public static ServiceName getServiceName ( String id ) { } private final Value < ChannelFactory > factory ; private final String id ; private volatile Channel channel ; public ChannelService ( String id , Value < ChannelFactory > factory ) { } @ Override public Channel getValue ( ) { } @ Override public void start ( StartContext context ) throws StartException { ChannelFactory factory = this . factory . getValue ( ) ; try { this . channel = factory . createChannel ( this . id ) ; if ( ( this . channel . getProtocolStack ( ) . findProtocol ( STATE_TRANSFER . class , STATE . class , STATE_SOCK . class ) ) != null ) { this . channel . connect ( this . id , null , ChannelService . STATE_TRANSFER_TIMEOUT ) ; } else { this . channel . connect ( this . id ) ; } } catch ( Exception e ) { throw new StartException ( e ) ; } String localName = this . channel . getName ( ) ; Address localAddress = this . channel . getAddress ( ) ; for ( Address address : this . channel . getView ( ) ) { String name = this . channel . getName ( address ) ; <START_BUG> if ( ( name . equals ( localName ) ) && ( ! ( address . equals ( localAddress ) ) ) ) { <END_BUG> this . channel . close ( ) ; throw MESSAGES . duplicateNodeName ( factory . getProtocolStackConfiguration ( ) . getEnvironment ( ) . getNodeName ( ) ) ; } } } @ Override public void stop ( StopContext context ) { } }

Fix:
if ( ( ( name != null ) && ( name . equals ( localName ) ) ) && ( ! ( address . equals ( localAddress ) ) ) ) {
Buggy code:
public class FileEditorMapping extends Object implements Cloneable , IFileEditorMapping { private String name = "*" ; private String extension ; private List editors = new ArrayList ( 1 ) ; private List deletedEditors = new ArrayList ( 1 ) ; public FileEditorMapping ( String extension ) { } public FileEditorMapping ( String name , String extension ) { } public void addEditor ( EditorDescriptor editor ) { } private void addToObjectActivityManager ( EditorDescriptor editor ) { } private IObjectActivityManager getObjectActivityManager ( ) { <START_BUG> return WorkbenchPlugin . getDefault ( ) . getWorkbench ( ) . getActivityManager ( ( ( ( IWorkbenchConstants . PL_EDITOR ) + ( getName ( ) ) ) + ( getExtension ( ) ) ) , true ) ; <END_BUG> } public Object clone ( ) { } public boolean equals ( Object obj ) { } private boolean compareList ( List l1 , List l2 ) { } public IEditorDescriptor getDefaultEditor ( ) { } public IEditorDescriptor [ ] getEditors ( ) { } public IEditorDescriptor [ ] getDeletedEditors ( ) { } public String getExtension ( ) { } public ImageDescriptor getImageDescriptor ( ) { } public String getLabel ( ) { } public String getName ( ) { } public void removeEditor ( EditorDescriptor editor ) { } public void setDefaultEditor ( EditorDescriptor editor ) { } public void setEditorsList ( List newEditors ) { } public void setDeletedEditorsList ( List newDeletedEditors ) { } public void setExtension ( String extension ) { } public void setName ( String name ) { } private List filteredEditors ( ) { } }

Fix:
return org . eclipse . ui . internal . WorkbenchPlugin . getDefault ( ) . getWorkbench ( ) . getObjectActivityManager ( ( ( ( org . eclipse . ui . internal . IWorkbenchConstants . PL_EDITOR ) + ( getName ( ) ) ) + ( getExtension ( ) ) ) , true ) ;
Buggy code:
@ Deprecated public abstract class AbstractTransactionalDataSourceSpringContextTests extends AbstractTransactionalSpringContextTests { protected JdbcTemplate jdbcTemplate ; private String sqlScriptEncoding ; private boolean zappedTables ; public AbstractTransactionalDataSourceSpringContextTests ( ) { } public AbstractTransactionalDataSourceSpringContextTests ( String name ) { } public void setDataSource ( DataSource dataSource ) { } public final JdbcTemplate getJdbcTemplate ( ) { } public void setSqlScriptEncoding ( String sqlScriptEncoding ) { } protected void deleteFromTables ( String [ ] names ) { } @ Override protected final void setComplete ( ) { } protected int countRowsInTable ( String tableName ) { <START_BUG> return this . jdbcTemplate . queryForInt ( ( "SELECT<seq2seq4repair_space>COUNT(0)<seq2seq4repair_space>FROM<seq2seq4repair_space>" + tableName ) ) ; <END_BUG> } protected void executeSqlScript ( String sqlResourcePath , boolean continueOnError ) throws DataAccessException { } }

Fix:
return this . jdbcTemplate . queryForObject ( ( "SELECT<seq2seq4repair_space>COUNT(0)<seq2seq4repair_space>FROM<seq2seq4repair_space>" + tableName ) , Integer . class ) ;
Buggy code:
public class ToStringCreatorTests extends TestCase { private ToStringCreatorTests . SomeObject s1 ; private ToStringCreatorTests . SomeObject s2 ; private ToStringCreatorTests . SomeObject s3 ; protected void setUp ( ) throws Exception { } public void testDefaultStyleMap ( ) { } private Map getMap ( ) { } public void testDefaultStyleArray ( ) { } public void testPrimitiveArrays ( ) { } public void testList ( ) { } public void testSet ( ) { } public void testClass ( ) { } public void testMethod ( ) throws Exception { <START_BUG> String str = new ToStringCreator ( this ) . append ( "myMethod" , this . getClass ( ) . getMethod ( "testMethod" , null ) ) . toString ( ) ; <END_BUG> assertEquals ( ( ( "[ToStringCreatorTests@" + ( ObjectUtils . getIdentityHexString ( this ) ) ) + "<seq2seq4repair_space>myMethod<seq2seq4repair_space>=<seq2seq4repair_space>testMethod@ToStringCreatorTests]" ) , str ) ; } public static class SomeObject { } }

Fix:
String str = new ToStringCreator ( this ) . append ( "myMethod" , this . getClass ( ) . getMethod ( "testMethod" ) ) . toString ( ) ;
Buggy code:
public class AnyInterfaceCriteria implements InterfaceCriteria { private static final long serialVersionUID = 3384500068401101329L ; private final Set < InterfaceCriteria > criteria = new HashSet < InterfaceCriteria > ( ) ; public AnyInterfaceCriteria ( Set < InterfaceCriteria > criteria ) { } @ Override public Map < NetworkInterface , Set < InetAddress > > getAcceptableAddresses ( Map < NetworkInterface , Set < InetAddress > > candidates ) throws SocketException { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object o ) { <START_BUG> if ( ( o instanceof AnyInterfaceCriteria ) == false ) { <END_BUG> return false ; } return criteria . equals ( ( ( AnyInterfaceCriteria ) ( o ) ) . criteria ) ; } private void addAccepted ( Map < NetworkInterface , Set < InetAddress > > accepted , Map < NetworkInterface , Set < InetAddress > > result ) { } }

Fix:
if ( ! ( o instanceof AnyInterfaceCriteria ) ) {
Buggy code:
public class CutoutModel extends ModelAsset { public static final int VERTEX_SIZE = ( 3 + 1 ) + 2 ; public static final int SIZE = 4 * ( CutoutModel . VERTEX_SIZE ) ; public static final int X0 = 0 ; public static final int Y0 = 1 ; public static final int Z0 = 2 ; public static final int C0 = 3 ; public static final int U0 = 4 ; public static final int V0 = 5 ; public static final float [ ] VERT_PATTERN = new float [ ] { 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 } ; public static final short [ ] VERT_INDICES = new short [ ] { 0 , 2 , 1 , 1 , 2 , 3 } ; private String fileName ; private Box2D window ; private float size ; private boolean loaded = false ; Texture texture ; Texture lightSkin ; TextureRegion region ; Vector2 offset ; Vector2 dimension ; final boolean splat ; final float [ ] vertices = new float [ CutoutModel . SIZE ] ; private CutoutModel ( String fileName , Class modelClass , Box2D window , float size , boolean splat ) { } protected void loadAsset ( ) { } public boolean isLoaded ( ) { } protected void disposeAsset ( ) { } public Sprite makeSprite ( ) { if ( ! ( loaded ) ) <START_BUG> I . complain ( "CANNOT<seq2seq4repair_space>CREATE<seq2seq4repair_space>SPRITE<seq2seq4repair_space>UNTIL<seq2seq4repair_space>LOADED!" ) ; <END_BUG> return new CutoutSprite ( this ) ; } public static CutoutModel fromImage ( Class sourceClass , String fileName , float size , float height ) { } public static CutoutModel fromSplatImage ( Class sourceClass , String fileName , float size ) { } public static CutoutModel [ ] fromImages ( Class sourceClass , String path , float size , float height , boolean splat , String ... files ) { } public static CutoutModel [ ] [ ] fromImageGrid ( Class sourceClass , String fileName , int gridX , int gridY , float size , float height ) { } private void setupDimensions ( float size , float relHigh ) { } private void setupVertices ( ) { } }

Fix:
I . complain ( ( "CANNOT<seq2seq4repair_space>CREATE<seq2seq4repair_space>SPRITE<seq2seq4repair_space>UNTIL<seq2seq4repair_space>LOADED:<seq2seq4repair_space>" + ( fileName ) ) ) ;
Buggy code:
public class BuildFlightActivity extends ActionBarActivity implements AdapterView . OnItemClickListener { private EditText olanEntry ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { switch ( item . getItemId ( ) ) { case id . menu_a_help : <START_BUG> new AlertDialog . Builder ( this ) . setTitle ( a_help ) . setMessage ( bfa_help_message ) . create ( ) . show ( ) ; <END_BUG> return true ; case id . menu_a_settings : startActivity ( new Intent ( this , SettingsActivity . class ) ) ; return true ; default : return super . onOptionsItemSelected ( item ) ; } } @ Override public void onItemClick ( AdapterView < ? > parent , final View view , int position , long id ) { } public void button_vis ( View view ) { } }

Fix:
new AlertDialog . Builder ( this ) . setTitle ( app_help ) . setMessage ( bfa_help_message ) . create ( ) . show ( ) ;
Buggy code:
public abstract class DefaultRmicAdapter implements RmicAdapter { private Rmic attributes ; private FileNameMapper mapper ; private static final Random rand = new Random ( ) ; public DefaultRmicAdapter ( ) { } public void setRmic ( Rmic attributes ) { } public Rmic getRmic ( ) { } protected String getStubClassSuffix ( ) { } protected String getSkelClassSuffix ( ) { } protected String getTieClassSuffix ( ) { } public FileNameMapper getMapper ( ) { } public Path getClasspath ( ) { } protected Path getCompileClasspath ( ) { } protected Commandline setupRmicCommand ( ) { } protected Commandline setupRmicCommand ( String [ ] options ) { } protected void logAndAddFilesToCompile ( Commandline cmd ) { Vector compileList = attributes . getCompileList ( ) ; <START_BUG> attributes . log ( ( "Compilation<seq2seq4repair_space>args:<seq2seq4repair_space>" + ( cmd . toString ( ) ) ) , MSG_VERBOSE ) ; <END_BUG> StringBuffer niceSourceList = new StringBuffer ( "File" ) ; if ( ( compileList . size ( ) ) != 1 ) { niceSourceList . append ( "s" ) ; } niceSourceList . append ( "<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>compiled:" ) ; for ( int i = 0 ; i < ( compileList . size ( ) ) ; i ++ ) { String arg = ( ( String ) ( compileList . elementAt ( i ) ) ) ; cmd . createArgument ( ) . setValue ( arg ) ; niceSourceList . append ( ( "<seq2seq4repair_space>" + arg ) ) ; } attributes . log ( niceSourceList . toString ( ) , MSG_VERBOSE ) ; } private class RmicFileNameMapper implements FileNameMapper { RmicFileNameMapper ( ) { } public void setFrom ( String s ) { } public void setTo ( String s ) { } public String [ ] mapFileName ( String name ) { } } }

Fix:
attributes . log ( ( "Compilation<seq2seq4repair_space>" + ( cmd . describeArguments ( ) ) ) , MSG_VERBOSE ) ;
Buggy code:
public class DateFormatterTest extends TestCase { public void testDateFormat ( ) { } public void testDateFormatString ( ) { } public void testDateFormatStringStringCHN ( ) { } public void testDateFormatLocale ( ) { } public void testDateFormatStringLocale ( ) { } public void testGetPattern ( ) { } public void testApplyPattern ( ) { } public void testIFormat ( ) { } public void testTimeZone ( ) { String result = null ; DateFormatter df = null ; Calendar dateCal = Calendar . getInstance ( ) ; dateCal . setTimeZone ( TimeZone . getTimeZone ( "PST" ) ) ; dateCal . set ( 1998 , 8 , 13 , 5 , 1 , 44 ) ; Date dateTime = dateCal . getTime ( ) ; Time sqlTime = new Time ( dateTime . getTime ( ) ) ; <START_BUG> String utcDate = "13<seq2seq4repair_space>Sep<seq2seq4repair_space>1998,<seq2seq4repair_space>12:01" ; <END_BUG> String utcTime = "12:01:44" ; com . ibm . icu . util . TimeZone UTCTimeZone = com . ibm . icu . util . TimeZone . getTimeZone ( "UTC" ) ; df = new DateFormatter ( ULocale . UK , UTCTimeZone ) ; result = df . format ( dateTime ) ; assertTrue ( utcDate . equalsIgnoreCase ( result ) ) ; result = df . format ( sqlTime ) ; assertTrue ( utcTime . equalsIgnoreCase ( result ) ) ; String japanDate = "1998//09//13<seq2seq4repair_space>21:01" ; String japanTime = "21:01:44" ; com . ibm . icu . util . TimeZone japanTimeZone = com . ibm . icu . util . TimeZone . getTimeZone ( "Japan" ) ; df = new DateFormatter ( ULocale . JAPAN , japanTimeZone ) ; result = df . format ( dateTime ) ; assertTrue ( japanDate . equalsIgnoreCase ( result ) ) ; result = df . format ( sqlTime ) ; assertTrue ( japanTime . equalsIgnoreCase ( result ) ) ; } No newline ; at end ; of file ; }

Fix:
String utcDate = "13<seq2seq4repair_space>Sep<seq2seq4repair_space>1998<seq2seq4repair_space>12:01" ;
Buggy code:
public class HomeFragment extends Fragment { @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onViewCreated ( View view , Bundle savedInstanceState ) { SlidingTabLayout mSlidingTabLayout = ( ( SlidingTabLayout ) ( view . findViewById ( sliding_tabs ) ) ) ; mSlidingTabLayout . setDistributeEvenly ( true ) ; mSlidingTabLayout . setCustomTabColorizer ( new SlidingTabLayout . TabColorizer ( ) { @ Override public int getIndicatorColor ( int position ) { <START_BUG> return ContextCompat . getColor ( getActivity ( ) , colorAccent ) ; <END_BUG> } @ Override public int getDividerColor ( int position ) { return ContextCompat . getColor ( getActivity ( ) , colorPrimary ) ; } } ) ; ViewPager viewPager = ( ( ViewPager ) ( view . findViewById ( view_pager ) ) ) ; viewPager . setOffscreenPageLimit ( HomeFragment . CustomPagerAdapter . SO_LUONG_TAB ) ; viewPager . setAdapter ( new HomeFragment . CustomPagerAdapter ( getFragmentManager ( ) ) ) ; mSlidingTabLayout . setViewPager ( viewPager ) ; } class CustomPagerAdapter extends FragmentPagerAdapter { public static final int SO_LUONG_TAB = 3 ; public CustomPagerAdapter ( FragmentManager fm ) { } @ Override public Fragment getItem ( int position ) { } @ Override public int getCount ( ) { } @ Override public CharSequence getPageTitle ( int position ) { } } }

Fix:
return ContextCompat . getColor ( getActivity ( ) , white ) ;
Buggy code:
public class TestJerseyBaseServerModule extends AbstractBaseServerModuleTest { <START_BUG> @ Test ( groups = "slow" , enabled = false , description = "https:////github.com//killbill//killbill-commons//issues//5" ) <END_BUG> public void testJerseyIntegration ( ) throws Exception { final BaseServerModuleBuilder builder = new BaseServerModuleBuilder ( ) ; builder . addJaxrsResource ( "org.killbill.commons.skeleton.modules" ) ; final Server server = startServer ( builder . build ( ) , new HelloModule ( ) ) ; final AsyncHttpClient client = new AsyncHttpClient ( ) ; final Future < Response > responseFuture = client . prepareGet ( ( ( "http:////127.0.0.1:" + ( ( ( org . eclipse . jetty . server . NetworkConnector ) ( server . getConnectors ( ) [ 0 ] ) ) . getPort ( ) ) ) + "//hello//alhuile//" ) ) . execute ( ) ; final String body = responseFuture . get ( ) . getResponseBody ( ) ; Assert . assertEquals ( body , "Hello<seq2seq4repair_space>alhuile" ) ; server . stop ( ) ; } @ Test ( groups = "fast" ) public void testJerseyParams ( ) throws Exception { } }

Fix:
@ Test ( groups = "slow" )
Buggy code:
public class Snippet46 { public static void main ( String [ ] args ) { Display display = new Display ( ) ; final Shell shell = new Shell ( display ) ; <START_BUG> final Composite composite = new Composite ( shell , SWT . NULL ) ; <END_BUG> composite . setEnabled ( false ) ; composite . setLayout ( new FillLayout ( ) ) ; Button button = new Button ( composite , SWT . PUSH ) ; button . setText ( "Button" ) ; composite . pack ( ) ; composite . setLocation ( 10 , 10 ) ; final Point [ ] offset = new Point [ 1 ] ; Listener listener = new Listener ( ) { public void handleEvent ( Event event ) { switch ( event . type ) { case SWT . MouseDown : Rectangle rect = composite . getBounds ( ) ; if ( rect . contains ( event . x , event . y ) ) { Point pt1 = composite . toDisplay ( 0 , 0 ) ; Point pt2 = shell . toDisplay ( event . x , event . y ) ; offset [ 0 ] = new Point ( ( ( pt2 . x ) - ( pt1 . x ) ) , ( ( pt2 . y ) - ( pt1 . y ) ) ) ; } break ; case SWT . MouseMove : if ( ( offset [ 0 ] ) != null ) { Point pt = offset [ 0 ] ; composite . setLocation ( ( ( event . x ) - ( pt . x ) ) , ( ( event . y ) - ( pt . y ) ) ) ; } break ; case SWT . MouseUp : offset [ 0 ] = null ; break ; } } } ; shell . addListener ( MouseDown , listener ) ; shell . addListener ( MouseUp , listener ) ; shell . addListener ( MouseMove , listener ) ; shell . setSize ( 300 , 300 ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
final Composite composite = new Composite ( shell , SWT . NONE ) ;
Buggy code:
public class InsertVMFormController implements Initializable { @ FXML Button btnFinish ; @ FXML Button btnCancel ; @ FXML TextField tfName ; @ FXML TextField tfVer ; @ FXML TextField tfSrc ; @ FXML ChoiceBox < String > cbOs ; @ FXML ChoiceBox < String > cbSrc ; @ FXML VBox infRow ; int index = 1 ; @ Override public void initialize ( URL location , ResourceBundle resources ) { } @ FXML private void closeForm ( ) { } @ FXML private void addInfRow ( ) { String eth = "eth" ; <START_BUG> String infName = ( eth + ( Integer . toString ( index ) ) ) + ":" ; <END_BUG> Graphics . addInfRow ( infName , infRow ) ; ( index ) ++ ; infRow . getScene ( ) . getWindow ( ) . sizeToScene ( ) ; } @ FXML private void submitForm ( ) { } private TreeMap < String , String > getInterfaces ( VBox formInfRow ) { } }

Fix:
String infName = eth + ( Integer . toString ( index ) ) ;
Buggy code:
public class ProcessManagerServerCommunicationHandler extends ServerCommunicationHandler { private static final Logger logger = Logger . getLogger ( "org.jboss.as.server" ) ; private final ProcessManagerServerCommunicationHandler . Controller controller = new ProcessManagerServerCommunicationHandler . Controller ( ) ; private final OutgoingPmCommandHandler handler ; private ProcessManagerServerCommunicationHandler ( String processName , InetAddress addr , Integer port , OutgoingPmCommandHandler handler ) { } public static ProcessManagerServerCommunicationHandler create ( String processName , InetAddress addr , Integer port , OutgoingPmCommandHandler handler ) { } @ Override public Runnable getController ( ) { } @ Override public void shutdown ( ) { } private final class Controller implements Runnable { private final AtomicBoolean shutdown = new AtomicBoolean ( false ) ; public void run ( ) { <START_BUG> final InputStream input = ProcessManagerServerCommunicationHandler . this . input ; <END_BUG> final StringBuilder b = new StringBuilder ( ) ; try { for ( ; ; ) { Status status = StreamUtils . readWord ( input , b ) ; if ( status == ( Status . END_OF_STREAM ) ) { shutdown ( ) ; break ; } try { final OutgoingPmCommand command = OutgoingPmCommand . valueOf ( b . toString ( ) ) ; status = command . handleMessage ( input , status , handler , b ) ; } catch ( IllegalArgumentException e ) { ProcessManagerServerCommunicationHandler . logger . error ( ( "Received<seq2seq4repair_space>unknown<seq2seq4repair_space>command:<seq2seq4repair_space>" + ( b . toString ( ) ) ) ) ; } if ( status == ( Status . MORE ) ) StreamUtils . readToEol ( input ) ; } } catch ( IOException e ) { shutdown ( ) ; } } private void shutdown ( ) { } } }

Fix:
final InputStream input = ProcessManagerServerCommunicationHandler . this . getInput ( ) ;
Buggy code:
public class FormUploadTest extends InstrumentationTestCase { final CountDownLatch signal = new CountDownLatch ( 1 ) ; private UploadManager uploadManager ; private String key ; private ResponseInfo info ; private JSONObject resp ; public void setUp ( ) throws Exception { } @ SmallTest public void testHello ( ) throws Throwable { <START_BUG> final String expectKey = "你好" ; <END_BUG> Map < String , String > params = new HashMap < String , String > ( ) ; params . put ( "x:foo" , "fooval" ) ; final UploadOptions opt = new UploadOptions ( params , null , true , null , null ) ; uploadManager . put ( "hello" . getBytes ( ) , expectKey , token , new UpCompletionHandler ( ) { public void complete ( String k , ResponseInfo rinfo , JSONObject response ) { Log . i ( "qiniutest" , ( k + rinfo ) ) ; key = k ; info = rinfo ; resp = response ; signal . countDown ( ) ; } } , opt ) ; try { signal . await ( 60 , TimeUnit . SECONDS ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } Assert . assertEquals ( expectKey , key ) ; Assert . assertTrue ( info . isOK ( ) ) ; Assert . assertNotNull ( info . reqId ) ; Assert . assertNotNull ( resp ) ; } @ SmallTest public void testNoKey ( ) throws Throwable { } @ SmallTest public void testInvalidToken ( ) throws Throwable { } @ SmallTest public void testNoData ( ) throws Throwable { } @ SmallTest public void testNoToken ( ) throws Throwable { } @ SmallTest public void testEmptyToken ( ) throws Throwable { } @ MediumTest public void testFile ( ) throws Throwable { } @ SmallTest public void testNoComplete ( ) { } }

Fix:
final String expectKey = "你好;\"\r\n\r\n\r\n" ;
Buggy code:
public class RenameFolderAction extends FrameAction implements SelectionListener { public RenameFolderAction ( AbstractFrameController frameController ) { } public void actionPerformed ( ActionEvent evt ) { <START_BUG> FolderCommandReference [ ] r = ( ( FolderCommandReference [ ] ) ( ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( frameController ) ) . getTreeSelection ( ) ) ) ; <END_BUG> new FolderOptionsDialog ( ( ( Folder ) ( r [ 0 ] . getFolder ( ) ) ) , true ) ; } public void selectionChanged ( SelectionChangedEvent evt ) { } }

Fix:
FolderCommandReference [ ] r = ( ( FolderCommandReference [ ] ) ( ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( frameMediator ) ) . getTreeSelection ( ) ) ) ;
Buggy code:
public final class JDBCPostCreateEntityCommand { private final JDBCEntityBridge entity ; private final JDBCCMRFieldBridge [ ] cmrWithFKMappedToCMP ; public JDBCPostCreateEntityCommand ( JDBCStoreManager manager ) { } public Object execute ( Method m , Object [ ] args , CmpEntityBeanContext ctx ) { if ( ( cmrWithFKMappedToCMP ) == null ) return null ; for ( int i = 0 ; i < ( cmrWithFKMappedToCMP . length ) ; ++ i ) { JDBCCMRFieldBridge cmrField = cmrWithFKMappedToCMP [ i ] ; JDBCCMRFieldBridge relatedCMRField = ( ( JDBCCMRFieldBridge ) ( cmrField . getRelatedCMRField ( ) ) ) ; if ( cmrField . hasFKFieldsMappedToCMPFields ( ) ) { Object relatedId = cmrField . getRelatedIdFromContext ( ctx ) ; if ( relatedId != null ) { try { if ( cmrField . isForeignKeyValid ( relatedId ) ) { cmrField . createRelationLinks ( ctx , relatedId ) ; } else { <START_BUG> relatedCMRField . addRelatedPKWaitingForMyPK ( relatedId , ctx . getPrimaryKey ( ) ) ; <END_BUG> } } catch ( Exception e ) { } } } else if ( relatedCMRField . hasFKFieldsMappedToCMPFields ( ) ) { cmrField . addRelatedPKsWaitedForMe ( ctx ) ; } } return null ; } }

Fix:
relatedCMRField . addRelatedPKWaitingForMyPK ( relatedId , ctx . getPrimaryKeyUnchecked ( ) ) ;
Buggy code:
public class PanelWithHeaderPart extends Panel { private static final long serialVersionUID = 1L ; public PanelWithHeaderPart ( String id ) { } @ Override public void renderHead ( IHeaderResponse response ) { response . renderCSSReference ( new PackageResourceReference ( PanelWithHeaderPart . class , "test.css" ) ) ; <START_BUG> response . renderJavascriptReference ( new JavaScriptResourceReference ( PanelWithHeaderPart . class , "test.js" ) ) ; <END_BUG> } }

Fix:
response . renderJavaScriptReference ( new JavaScriptResourceReference ( PanelWithHeaderPart . class , "test.js" ) ) ;
Buggy code:
public class GenomeGraph { private HashMap < Integer , Strand > strandNodes ; private HashMap < String , Genome > genomes ; private ArrayList < String > activeGenomes ; public GenomeGraph ( ) { } public HashMap < Integer , Strand > getStrandNodes ( ) { } public void addStrand ( Strand strand ) { } public void generateGenomes ( ) { genomes = new HashMap < String , Genome > ( ) ; for ( Strand strand : strandNodes . values ( ) ) { for ( String genomeID : strand . getGenomes ( ) ) { if ( ! ( genomes . containsKey ( genomeID ) ) ) { Genome genome = new Genome ( genomeID ) ; <START_BUG> genome = new Genome ( genomeID ) ; <END_BUG> genomes . put ( genomeID , genome ) ; } else { genomes . get ( genomeID ) . addStrand ( strand ) ; } } } } public HashMap < String , Genome > getGenomes ( ) { } public void setGenomes ( HashMap < String , Genome > genomes ) { } public ArrayList < String > getActiveGenomes ( ) { } public void setActiveGenomes ( ArrayList < String > activeGenomes ) { } }

Fix:
genome . addStrand ( strand ) ;
Buggy code:
class ProcessMonitor extends AbstractLogEnabled implements Runnable { private static final int SLEEP_TIME = 5 ; private static final int STATE_RUNNING = 0 ; private static final int STATE_STOPPED = 1 ; private static final int STATE_TERMINATED = 2 ; private int m_state = ProcessMonitor . STATE_RUNNING ; private final Process m_process ; private final long m_timeout ; private InputStream m_input ; private final OutputStream m_output ; private final OutputStream m_error ; public ProcessMonitor ( final Process process , final InputStream input , final OutputStream output , final OutputStream error , final long timeoutDuration ) { } public boolean didProcessTimeout ( ) { } public void run ( ) { } private boolean isProcessStopped ( ) { } private void checkTimeout ( ) { } private void processStandardInput ( ) { } private void processStandardOutput ( ) { } private void processStandardError ( ) { <START_BUG> final InputStream input = m_process . getInputStream ( ) ; <END_BUG> copy ( input , m_error ) ; } private void copy ( final InputStream input , final OutputStream output ) { } }

Fix:
final InputStream input = m_process . getErrorStream ( ) ;
Buggy code:
public class Utility { public static String getReadableDateString ( long dateTime ) { } public static String getPreferredLocation ( Context context ) { } public static boolean isMetric ( Context context ) { } public static String formatTemperature ( double temperature , boolean isMetric ) { double temp ; if ( ! isMetric ) { temp = ( ( 9 * temperature ) // 5 ) + 32 ; } else { temp = temperature ; } <START_BUG> return String . format ( "%0.0f" , temp ) ; <END_BUG> } public static String formatDate ( long dateInMillis ) { } }

Fix:
return String . format ( "%.0f" , temp ) ;
Buggy code:
public class CleanupHelper extends SchemaLoader { private static Logger logger = LoggerFactory . getLogger ( CleanupHelper . class ) ; @ BeforeClass public static void cleanupAndLeaveDirs ( ) throws IOException { } public static void cleanup ( ) throws IOException { <START_BUG> String [ ] directoryNames = new String [ ] { DatabaseDescriptor . getLogFileLocation ( ) } ; <END_BUG> for ( String dirName : directoryNames ) { File dir = new File ( dirName ) ; if ( ! ( dir . exists ( ) ) ) { throw new RuntimeException ( ( "No<seq2seq4repair_space>such<seq2seq4repair_space>directory:<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ) ) ; } FileUtils . deleteRecursive ( dir ) ; } for ( String dirName : DatabaseDescriptor . getAllDataFileLocations ( ) ) { File dir = new File ( dirName ) ; if ( ! ( dir . exists ( ) ) ) { throw new RuntimeException ( ( "No<seq2seq4repair_space>such<seq2seq4repair_space>directory:<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ) ) ; } FileUtils . deleteRecursive ( dir ) ; } } public static void mkdirs ( ) { } }

Fix:
String [ ] directoryNames = new String [ ] { DatabaseDescriptor . getCommitLogLocation ( ) } ;
Buggy code:
public class MessageSend extends Expression implements InvocationSite { public Expression receiver ; public char [ ] selector ; public Expression [ ] arguments ; public MethodBinding binding ; protected MethodBinding codegenBinding ; MethodBinding syntheticAccessor ; public TypeBinding expectedType ; public long nameSourcePosition ; public TypeBinding actualReceiverType ; public TypeBinding valueCast ; public TypeReference [ ] typeArguments ; public TypeBinding [ ] genericTypeArguments ; public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { boolean nonStatic = ! ( binding . isStatic ( ) ) ; flowInfo = receiver . analyseCode ( currentScope , flowContext , flowInfo , nonStatic ) . unconditionalInits ( ) ; if ( nonStatic ) <START_BUG> receiver . checkNullStatus ( currentScope , flowInfo , FlowInfo . NON_NULL ) ; <END_BUG> if ( ( arguments ) != null ) { int length = arguments . length ; for ( int i = 0 ; i < length ; i ++ ) { flowInfo = arguments [ i ] . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; } } ReferenceBinding [ ] thrownExceptions ; if ( ( thrownExceptions = binding . thrownExceptions ) != ( NoExceptions ) ) { flowContext . checkExceptionHandlers ( thrownExceptions , this , flowInfo , currentScope ) ; } manageSyntheticAccessIfNecessary ( currentScope , flowInfo ) ; return flowInfo ; } public void computeConversion ( Scope scope , TypeBinding runtimeTimeType , TypeBinding compileTimeType ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public TypeBinding [ ] genericTypeArguments ( ) { } public boolean isSuperAccess ( ) { } public boolean isTypeAccess ( ) { } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { } public int nullStatus ( FlowInfo flowInfo ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { } public void setActualReceiverType ( ReferenceBinding receiverType ) { } public void setExpectedType ( TypeBinding expectedType ) { } public void setDepth ( int depth ) { } public void setFieldIndex ( int depth ) { } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
receiver . checkNullStatus ( currentScope , flowContext , flowInfo , FlowInfo . NON_NULL ) ;
Buggy code:
public class AjaxLinkClickTest extends WicketTestCase { private boolean linkClicked ; private AjaxRequestTarget ajaxRequestTarget ; public AjaxLinkClickTest ( ) { } @ Override protected void setUp ( ) throws Exception { } public void testBasicAjaxLinkClick ( ) { <START_BUG> final AjaxLink ajaxLink = new AjaxLink ( "ajaxLink" ) { <END_BUG> private static final long serialVersionUID = 1L ; @ Override public void onClick ( AjaxRequestTarget target ) { linkClicked = true ; ajaxRequestTarget = target ; } } ; tester . startPage ( new ITestPageSource ( ) { private static final long serialVersionUID = 1L ; public Page getTestPage ( ) { Page page = new MockPageWithLink ( ) ; page . add ( ajaxLink ) ; return page ; } } ) ; tester . clickLink ( "ajaxLink" ) ; assertTrue ( linkClicked ) ; assertNotNull ( ajaxRequestTarget ) ; } public void testAjaxFallbackLinkClick ( ) { } public void testFallbackLinkWithAjaxDisabled ( ) { } }

Fix:
final AjaxLink < Void > ajaxLink = new AjaxLink < Void > ( "ajaxLink" ) {
Buggy code:
public class DiscoveryServer { private int port ; private Channel channel ; private ConnectionlessBootstrap bootstrap ; private InetSocketAddress serverAddress ; public DiscoveryServer ( int port ) { } public void start ( ) { } public void shutdown ( ) { <START_BUG> channel . disconnect ( ) ; <END_BUG> bootstrap . releaseExternalResources ( ) ; } public void setServerAddress ( InetSocketAddress inetSocketAddress ) { } public InetSocketAddress getServerAddress ( ) { } public static void main ( String [ ] args ) { } }

Fix:
channel . close ( ) ;
Buggy code:
public class SelectorManager extends Thread { private static final Logger logger = Logger . getLogger ( SelectorManager . class ) ; protected Selector selector ; Object gate = new Object ( ) ; private static SelectorManager manager ; private static SelectorManager udpManager ; private SelectorManager ( String name ) { } public SelectionKey register ( SelectableChannel channel , SelectionKeyHandler handler , int ops ) throws IOException { } public void run ( ) { while ( true ) { try { <START_BUG> selector . select ( 100 ) ; <END_BUG> doProcess ( ) ; synchronized ( gate ) { } } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } } protected void doProcess ( ) throws IOException { } public static SelectorManager getSelectorManager ( ) { } public static SelectorManager getUdpSelectorManager ( ) { } }

Fix:
selector . select ( 1 ) ;
Buggy code:
public class InfinispanExtension implements Extension { public static final String SUBSYSTEM_NAME = "infinispan" ; static final PathElement SUBSYSTEM_PATH = PathElement . pathElement ( SUBSYSTEM , InfinispanExtension . SUBSYSTEM_NAME ) ; public static final String RESOURCE_NAME = ( ( InfinispanExtension . class . getPackage ( ) . getName ( ) ) + "." ) + "LocalDescriptions" ; private static final int MANAGEMENT_API_MAJOR_VERSION = 2 ; private static final int MANAGEMENT_API_MINOR_VERSION = 0 ; private static final int MANAGEMENT_API_MICRO_VERSION = 0 ; static ResourceDescriptionResolver getResourceDescriptionResolver ( final String ... keyPrefix ) { } @ Override public void initialize ( ExtensionContext context ) { SubsystemRegistration subsystem = context . registerSubsystem ( InfinispanExtension . SUBSYSTEM_NAME , InfinispanExtension . MANAGEMENT_API_MAJOR_VERSION , InfinispanExtension . MANAGEMENT_API_MINOR_VERSION , InfinispanExtension . MANAGEMENT_API_MICRO_VERSION ) ; final ResolvePathHandler resolvePathHandler ; if ( context . getProcessType ( ) . isServer ( ) ) { resolvePathHandler = Builder . of ( context . getPathManager ( ) ) . setPathAttribute ( PATH ) . setRelativeToAttribute ( RELATIVE_TO ) . build ( ) ; } else { resolvePathHandler = null ; } <START_BUG> subsystem . registerSubsystemModel ( new InfinispanSubsystemRootResourceDefinition ( resolvePathHandler ) ) ; <END_BUG> subsystem . registerXMLElementWriter ( new InfinispanSubsystemXMLWriter ( ) ) ; if ( context . isRegisterTransformers ( ) ) { InfinispanTransformers . registerTransformers ( subsystem ) ; } } @ Override public void initializeParsers ( ExtensionParsingContext context ) { } }

Fix:
subsystem . registerSubsystemModel ( new InfinispanSubsystemRootResourceDefinition ( resolvePathHandler , context . isRuntimeOnlyRegistrationValid ( ) ) ) ;
Buggy code:
@ PublicationReferences ( references = { @ PublicationReference ( title = "Factorization<seq2seq4repair_space>Machines" , author = { "Steffen<seq2seq4repair_space>Rendle" } , year = 2010 , type = PublicationType . Conference , publication = "Proceedings<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>10th<seq2seq4repair_space>IEEE<seq2seq4repair_space>International<seq2seq4repair_space>Conference<seq2seq4repair_space>on<seq2seq4repair_space>Data<seq2seq4repair_space>Mining<seq2seq4repair_space>(ICDM)" , url = "http:////www.inf.uni-konstanz.de//~rendle//pdf//Rendle2010FM.pdf" ) , @ PublicationReference ( title = "Factorization<seq2seq4repair_space>Machines<seq2seq4repair_space>with<seq2seq4repair_space>libFM" , author = "Steffen<seq2seq4repair_space>Rendle" , year = 2012 , type = PublicationType . Journal , publication = "ACM<seq2seq4repair_space>Transactions<seq2seq4repair_space>on<seq2seq4repair_space>Intelligent<seq2seq4repair_space>Systems<seq2seq4repair_space>Technology" , url = "http:////www.csie.ntu.edu.tw//~b97053//paper//Factorization%20Machines%20with%20libFM.pdf" ) } ) public class FactorizationMachine extends AbstractRegressor < Vector > implements ParameterGradientEvaluator < Vector , Double , Vector > , VectorInputEvaluator < Vector , Double > { protected double bias ; protected Vector weights ; protected Matrix factors ; public FactorizationMachine ( ) { } public FactorizationMachine ( final int dimensionality , final int factorCount ) { } public FactorizationMachine ( final double bias , final Vector weights , final Matrix factors ) { } @ Override public FactorizationMachine clone ( ) { } @ Override public double evaluateAsDouble ( final Vector input ) { double result = this . bias ; if ( ( this . weights ) != null ) { <START_BUG> result += this . weights . dotProduct ( input ) ; <END_BUG> } if ( ( this . factors ) != null ) { final int factorCount = this . getFactorCount ( ) ; for ( int k = 0 ; k < factorCount ; k ++ ) { double sum = 0.0 ; double sumSquares = 0.0 ; for ( final VectorEntry entry : input ) { final double product = ( entry . getValue ( ) ) * ( this . factors . getElement ( k , entry . getIndex ( ) ) ) ; sum += product ; sumSquares += product * product ; } result += 0.5 * ( ( sum * sum ) - sumSquares ) ; } } return result ; } @ Override public int getInputDimensionality ( ) { } public int getFactorCount ( ) { } @ Override public Vector computeParameterGradient ( final Vector input ) { } @ Override public Vector convertToVector ( ) { } @ Override public void convertFromVector ( final Vector parameters ) { } public int getParameterCount ( ) { } public boolean hasWeights ( ) { } public boolean hasFactors ( ) { } public double getBias ( ) { } public void setBias ( final double bias ) { } public Vector getWeights ( ) { } public void setWeights ( final Vector weights ) { } public Matrix getFactors ( ) { } public void setFactors ( final Matrix factors ) { } }

Fix:
result += input . dot ( this . weights ) ;
Buggy code:
final class BestPathSelector { private static final Collection < PathArgument > ORIGINATOR_ID = ImmutableList . < PathArgument > of ( new org . opendaylight . yangtools . yang . data . api . YangInstanceIdentifier . NodeIdentifier ( OriginatorId . QNAME ) , new org . opendaylight . yangtools . yang . data . api . YangInstanceIdentifier . NodeIdentifier ( QName . create ( QNAME , "originator" ) ) ) ; private final Long ourAs ; private UnsignedInteger bestOriginatorId = null ; private UnsignedInteger bestRouterId = null ; private BestPathState bestState = null ; BestPathSelector ( final Long ourAs ) { } void processPath ( final UnsignedInteger routerId , final ContainerNode attrs ) { Preconditions . checkNotNull ( routerId , "Router<seq2seq4repair_space>ID<seq2seq4repair_space>may<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; if ( attrs != null ) { final Optional < NormalizedNode < ? , ? > > maybeOriginatorId = NormalizedNodes . findNode ( attrs , BestPathSelector . ORIGINATOR_ID ) ; final UnsignedInteger originatorId ; if ( maybeOriginatorId . isPresent ( ) ) { <START_BUG> originatorId = RouterIds . routerIdForAddress ( ( ( LeafNode < String > ) ( maybeOriginatorId . get ( ) ) ) . getValue ( ) ) ; <END_BUG> } else { originatorId = routerId ; } final BestPathState state = new BestPathState ( attrs ) ; if ( ( ( this . bestOriginatorId ) == null ) || ( selectPath ( originatorId , state ) ) ) { this . bestOriginatorId = originatorId ; this . bestRouterId = routerId ; this . bestState = state ; } } } BestPath result ( ) { } private boolean selectPath ( @ Nonnull final UnsignedInteger originatorId , @ Nonnull final BestPathState state ) { } }

Fix:
originatorId = RouterIds . routerIdForAddress ( ( ( String ) ( ( ( LeafNode < ? > ) ( maybeOriginatorId . get ( ) ) ) . getValue ( ) ) ) ) ;