nus-yam/ex-repair huggingface dataset:
Buggy code:
@ Repository ( "analyzedResults" ) public class AnalyzedResultsDaoImpl extends BaseJDBCDaoImpl implements AnalyzedResultsDao { Logger LOG = LoggerFactory . getLogger ( AnalyzedResultsDaoImpl . class ) ; @ Override @ TransactionAttribute ( TransactionAttributeType . NOT_SUPPORTED ) public List < AnalyticResultsDTO > getAnalyzedResults ( ) { } @ Override public List < CandidateDTO > getCandidateProfileData ( long id ) { List < CandidateDTO > returnList = null ; StringBuilder query = new StringBuilder ( "" ) ; query . append ( "SELECT<seq2seq4repair_space>score,pic_path,name,address,email,gender,marital_status\n" ) ; query . append ( "FROM<seq2seq4repair_space>candidate\n" ) ; query . append ( "WHERE<seq2seq4repair_space>id<seq2seq4repair_space>=<seq2seq4repair_space>:id" ) ; Map < String , Object > paramMap = new HashMap < String , Object > ( ) ; paramMap . put ( "id" , id ) ; RowMapper < CandidateDTO > mapper = new RowMapper < CandidateDTO > ( ) { @ Override public CandidateDTO mapRow ( ResultSet resultSet , int i ) throws SQLException { CandidateDTO candidateDTO = new CandidateDTO ( ) ; <START_BUG> candidateDTO . setScore ( resultSet . getLong ( "score" ) ) ; <END_BUG> candidateDTO . setPic_path ( resultSet . getString ( "pic_path" ) ) ; candidateDTO . setName ( resultSet . getString ( "name" ) ) ; candidateDTO . setAddress ( resultSet . getString ( "address" ) ) ; candidateDTO . setEmail ( resultSet . getString ( "email" ) ) ; candidateDTO . setGender ( resultSet . getString ( "gender" ) ) ; candidateDTO . setMarital_status ( resultSet . getString ( "marital_status" ) ) ; return candidateDTO ; } } ; returnList = getNamedParameterJdbcTemplate ( ) . query ( query . toString ( ) , paramMap , mapper ) ; return returnList ; } @ Override public List < AchievementDTO > getCandidateAchievementsData ( long id ) { } @ Override public List < EducationDTO > getCandidateEducationData ( long id ) { } @ Override public List < ProjectDTO > getCandidateProjectData ( long id ) { } @ Override public List < PublicationsDTO > getCandidatePublicationsData ( long id ) { } @ Override public List < WorkExpDTO > getCandidateWorkExperienceData ( long id ) { } }

Fix:
candidateDTO . setScore ( resultSet . getDouble ( "score" ) ) ;
Buggy code:
public class SimpleStringOperatorNode extends UnaryOperatorNode { public void init ( Object operand , Object methodName ) { } public ValueNode bindExpression ( FromList fromList , SubqueryList subqueryList , Vector aggregateVector ) throws StandardException { TypeId operandType ; <START_BUG> super . bindExpression ( fromList , subqueryList , aggregateVector ) ; <END_BUG> operandType = operand . getTypeId ( ) ; switch ( operandType . getJDBCTypeId ( ) ) { case Types . CHAR : case Types . VARCHAR : case Types . LONGVARCHAR : case Types . CLOB : break ; case JDBC20Translation . SQL_TYPES_JAVA_OBJECT : case Types . OTHER : { throw StandardException . newException ( LANG_UNARY_FUNCTION_BAD_TYPE , methodName , operandType . getSQLTypeName ( ) ) ; } default : operand = ( ( ValueNode ) ( getNodeFactory ( ) . getNode ( CAST_NODE , operand , DataTypeDescriptor . getBuiltInDataTypeDescriptor ( Types . VARCHAR , true , operand . getTypeCompiler ( ) . getCastToCharWidth ( operand . getTypeServices ( ) ) ) , getContextManager ( ) ) ) ) ; ( ( CastNode ) ( operand ) ) . bindCastNodeOnly ( ) ; operandType = operand . getTypeId ( ) ; } setType ( new DataTypeDescriptor ( operandType , operand . getTypeServices ( ) . isNullable ( ) , operand . getTypeCompiler ( ) . getCastToCharWidth ( operand . getTypeServices ( ) ) ) ) ; getTypeServices ( ) . setCollationDerivation ( operand . getTypeServices ( ) . getCollationDerivation ( ) ) ; getTypeServices ( ) . setCollationType ( operand . getTypeServices ( ) . getCollationType ( ) ) ; return this ; } void bindParameter ( ) throws StandardException { } public String getReceiverInterfaceName ( ) { } public boolean requiresTypeFromContext ( ) { } }

Fix:
bindOperand ( fromList , subqueryList , aggregateVector ) ;
Buggy code:
public class TestObjectFactory extends TestCase { public void testSomething ( ) throws Exception { } public static void main ( String [ ] args ) { if ( ( args != null ) && ( ( args . length ) == 2 ) ) { String file = null ; if ( ( args [ 0 ] ) != null ) { file = args [ 0 ] ; } if ( ( args [ 1 ] ) != null ) { } try { ObjectFactory of = ObjectFactory . getInstance ( ) ; File infile = new File ( file ) ; FileInputStream fis = new FileInputStream ( infile ) ; InputStreamReader isr = new InputStreamReader ( fis ) ; <START_BUG> StringBuffer buf = new StringBuffer ( ) ; <END_BUG> BufferedReader br = new BufferedReader ( isr ) ; String line = null ; while ( ( line = br . readLine ( ) ) != null ) { buf . append ( line ) ; } System . out . println ( "contents:<seq2seq4repair_space>" ) ; System . out . println ( buf . toString ( ) ) ; System . out . println ( "----------------------" ) ; Status st = of . parseBytes ( buf . toString ( ) . getBytes ( ) ) ; if ( st == null ) { System . out . println ( "parse<seq2seq4repair_space>failed" ) ; } else { System . out . println ( "parse<seq2seq4repair_space>successful:" ) ; System . out . println ( st . getJvm ( ) . getMemory ( ) . getFree ( ) ) ; System . out . println ( st . getJvm ( ) . getMemory ( ) . getTotal ( ) ) ; System . out . println ( st . getJvm ( ) . getMemory ( ) . getMax ( ) ) ; System . out . println ( ( "connector<seq2seq4repair_space>size:<seq2seq4repair_space>" + ( st . getConnector ( ) . size ( ) ) ) ) ; Connector conn = st . getConnector ( ) . get ( 0 ) ; System . out . println ( ( "conn:<seq2seq4repair_space>" + ( conn . getThreadInfo ( ) . getMaxThreads ( ) ) ) ) ; } } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } else { } } }

Fix:
StringBuilder buf = new StringBuilder ( ) ;
Buggy code:
public class MolecularSystem { public ArrayList < AbstractParticle > particles ; public ArrayList < Interaction > interactions ; public double duration = 0.01 ; public void updateEnergyPotential ( ) { } public void updatePosition ( ) { for ( AbstractParticle particle : particles ) { Vector3D r = particle . getPosition ( ) ; Vector3D v = particle . getVelocity ( ) ; Vector3D a = particle . getAcceleration ( ) ; Vector3D a2 = particle . getAccumulatedAcceleration ( ) ; <START_BUG> Vector3D dr = particle . getPosition ( ) ; <END_BUG> dr . x = ( ( v . x ) * ( duration ) ) + ( ( ( 0.5 * ( a . x ) ) * ( duration ) ) * ( duration ) ) ; dr . y = ( ( v . y ) * ( duration ) ) + ( ( ( 0.5 * ( a . y ) ) * ( duration ) ) * ( duration ) ) ; dr . z = ( ( v . z ) * ( duration ) ) + ( ( ( 0.5 * ( a . z ) ) * ( duration ) ) * ( duration ) ) ; r . add ( dr ) ; Vector3D dv = new Vector3D ( ) ; dv . x = ( 0.5 * ( ( a . x ) + ( a2 . x ) ) ) * ( duration ) ; dv . y = ( 0.5 * ( ( a . y ) + ( a2 . y ) ) ) * ( duration ) ; dv . z = ( 0.5 * ( ( a . z ) + ( a2 . z ) ) ) * ( duration ) ; v . add ( dv ) ; particle . setAcceleration ( a2 . x , a2 . y , a2 . z ) ; particle . clearAccumulator ( ) ; System . out . println ( ( "Positon:<seq2seq4repair_space>" + ( particle . getPosition ( ) ) ) ) ; System . out . println ( ( "Velocity:<seq2seq4repair_space>" + ( particle . getVelocity ( ) ) ) ) ; } } }

Fix:
Vector3D dr = new Vector3D ( ) ;
Buggy code:
public abstract class PushPullCommand < O extends PushPullOptions > extends ConfigurableProjectCommand < O > { private static final Logger log = LoggerFactory . getLogger ( PushPullCommand . class ) ; protected static final String PROJECT_TYPE_OFFLINE_PO = "offlinepo" ; protected ETagCache eTagCache ; private Marshaller marshaller ; private String modulePrefix ; protected SourceDocResourceClient sourceDocResourceClient ; protected TransDocResourceClient transDocResourceClient ; protected final StatisticsResourceClient statsClient ; public PushPullCommand ( O opts , RestClientFactory clientFactory ) { } public PushPullCommand ( O opts ) { } protected void confirmWithUser ( String message ) throws IOException { } protected void debug ( Object jaxbElement ) { try { <START_BUG> if ( PushPullCommand . getOpts ( ) . isDebugSet ( ) ) { <END_BUG> StringWriter writer = new StringWriter ( ) ; getMarshaller ( ) . marshal ( jaxbElement , writer ) ; PushPullCommand . log . debug ( "{}" , writer ) ; } } catch ( JAXBException e ) { PushPullCommand . log . debug ( e . toString ( ) , e ) ; } } private Marshaller getMarshaller ( ) throws JAXBException { } protected String qualifiedDocName ( String localDocName ) { } protected String unqualifiedDocName ( String qualifiedDocName ) { } protected boolean belongsToCurrentModule ( String qualifiedDocName ) { } protected List < String > getQualifiedDocNamesForCurrentModuleFromServer ( ) { } protected List < ResourceMeta > getDocListForProjectIterationFromServer ( ) { } public static LocaleList getLocaleMapList ( LocaleList projectLocales , String [ ] locales ) { } protected void loadETagCache ( ) { } protected void storeETagCache ( ) { } protected Map < String , Map < LocaleId , PushPullCommand . TranslatedPercent > > getDocsTranslatedPercent ( LocaleList locales ) { } @ VisibleForTesting protected ContainerTranslationStatistics getDetailStatisticsForProjectVersion ( LocaleList locales ) { } protected Optional < Map < String , Map < LocaleId , PushPullCommand . TranslatedPercent > > > prepareStatsIfApplicable ( boolean pullTarget , LocaleList locales ) { } protected boolean needToGetStatistics ( boolean pullTarget ) { } protected boolean shouldPullThisLocale ( Optional < Map < String , Map < LocaleId , PushPullCommand . TranslatedPercent > > > optionalStats , String localDocName , LocaleId serverLocale ) { } protected static class TranslatedPercent { private final double translatedPercent ; private final long total ; private final long translated ; private final long approved ; public TranslatedPercent ( long total , long translated , long approved ) { } public boolean isAboveThreshold ( int minimumPercent ) { } public double getTranslatedPercent ( ) { } } }

Fix:
if ( ( PushPullCommand . getOpts ( ) . isDebugSet ( ) ) && ( PushPullCommand . getOpts ( ) . getLogHttp ( ) ) ) {
Buggy code:
public class MethodReferencePattern extends MethodPattern { IType declaringType ; public char [ ] [ ] [ ] allSuperDeclaringTypeNames ; public MethodReferencePattern ( char [ ] selector , int matchMode , boolean isCaseSensitive , char [ ] declaringQualification , char [ ] declaringSimpleName , char [ ] returnQualification , char [ ] returnSimpleName , char [ ] [ ] parameterQualifications , char [ ] [ ] parameterSimpleNames , IType declaringType ) { } public void decodeIndexEntry ( IEntryResult entryResult ) { } public void feedIndexRequestor ( IIndexSearchRequestor requestor , int detailLevel , int [ ] references , IndexInput input , IJavaSearchScope scope ) throws IOException { } public String getPatternName ( ) { } public char [ ] indexEntryPrefix ( ) { } protected int matchContainer ( ) { } public void initializePolymorphicSearch ( MatchLocator locator , IProgressMonitor progressMonitor ) { try { <START_BUG> this . allSuperDeclaringTypeNames = new SuperTypeNamesCollector ( this , locator . handleFactory , this . declaringType , progressMonitor ) . collect ( ) ; <END_BUG> } catch ( JavaModelException e ) { } } private boolean isVirtualInvoke ( MethodBinding method , MessageSend messageSend ) { } public int matchLevel ( AstNode node , boolean resolve ) { } public int matchLevel ( Binding binding , MessageSend messageSend ) { } protected void matchReportReference ( AstNode reference , IJavaElement element , int accuracy , MatchLocator locator ) throws CoreException { } }

Fix:
this . allSuperDeclaringTypeNames = new SuperTypeNamesCollector ( this , locator , this . declaringType , progressMonitor ) . collect ( ) ;
Buggy code:
class CategoryFilter implements Filter { Logger LOGGER = LoggerFactory . getLogger ( CategoryFilter . class ) ; @ Override public List < RawMenu > filter ( List < RawMenu > menus ) { } private RawMenu cleanCategories ( RawMenu menu ) { } private void updateDeCategory ( RawMenu menu ) { } private void updateEnCategory ( RawMenu menu ) { String subcategory_en = menu . getSubcategory_en ( ) ; if ( ( subcategory_en != null ) && ( TextUtils . isEmpty ( subcategory_en . trim ( ) ) ) ) { return ; } <START_BUG> menu . setCategory_de ( subcategory_en ) ; <END_BUG> } }

Fix:
menu . setCategory_en ( subcategory_en ) ;
Buggy code:
public class CoreDOMImplementationImpl implements DOMImplementation , DOMImplementationLS { RevalidationHandler fDOMRevalidator = null ; boolean free = true ; static CoreDOMImplementationImpl singleton = new CoreDOMImplementationImpl ( ) ; public static DOMImplementation getDOMImplementation ( ) { } public boolean hasFeature ( String feature , String version ) { } public DocumentType createDocumentType ( String qualifiedName , String publicID , String systemID ) { } final void checkQName ( String qname ) { } public Document createDocument ( String namespaceURI , String qualifiedName , DocumentType doctype ) throws DOMException { } public DOMImplementation getInterface ( String feature ) { } public DOMBuilder createDOMBuilder ( short mode , String schemaType ) throws DOMException { } public DOMWriter createDOMWriter ( ) { <START_BUG> return new DOMWriterImpl ( true ) ; <END_BUG> } public DOMInputSource createDOMInputSource ( ) { } synchronized RevalidationHandler getValidator ( String schemaType ) { } synchronized void releaseValidator ( String schemaType ) { } final synchronized boolean isFree ( ) { } }

Fix:
return new DOMWriterImpl ( ) ;
Buggy code:
public class Test2 { public static void main ( String [ ] args ) { String [ ] header = new String [ ] { "周一" , "周二" , "周三" , "周四" , "周五" , "周六" , "周日" } ; List < Object [ ] > list = new ArrayList < Object [ ] > ( ) ; for ( int i = 0 ; i < 6 ; i ++ ) { Object [ ] data = new Object [ 7 ] ; data [ 1 ] = "String" + i ; data [ 2 ] = new Object ( ) ; data [ 3 ] = 10 + i ; data [ 4 ] = 20.5 + i ; data [ 5 ] = true ; data [ 6 ] = new Date ( ) ; data [ 0 ] = null ; list . add ( data ) ; } Pager pager = new MyPager ( "测试" , header , list ) ; Template t = TemplateFactory . createTemplate ( DefaultTemplate . class , pager ) ; Config config = t . getConfig ( ) ; config . setDefaultWidth ( ( ( Config . DEFAULT_WIDTH ) + 5 ) ) ; FileOutputStream fos = null ; try { <START_BUG> fos = new FileOutputStream ( "D://text.xls" ) ; <END_BUG> t . build ( fos ) ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } finally { try { if ( fos != null ) { fos . close ( ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } } } }

Fix:
fos = new FileOutputStream ( "D://text.xlsx" ) ;
Buggy code:
public class PlayScene extends GameScene { private static final int SMALL_ENEMY_ROWS = 1 ; private static final int MEDIUM_ENEMY_ROWS = 2 ; private static final int LARGE_ENEMY_ROWS = 2 ; private static final int ENEMY_COLUMNS = 12 ; private static final double SHIP_MARGIN_FROM_LEFT = 0.05 ; private static final double SHIP_MARGIN_FROM_BOTTOM = 0.1 ; private static final int UFO_MARGIN_FROM_TOP = 100 ; private static final double UFO_CHANCE = 0.002 ; private static final int ENTITY_DIMENSION = 100 ; private static final double COLUMN_WIDTH = 100 ; private static final double ROW_HEIGHT = 90 ; private static final double ENEMY_OFFSET_X = 10 ; private int points = 0 ; public int enemyCount = 0 ; private int fieldWidth ; private int fieldHeight ; private Random random = new Random ( ) ; public Ship ship ; private boolean finished = false ; private LabelEntity scoreLabel ; private LabelEntity livesLabel ; public PlayScene ( Scene scene ) { } private void createEnemies ( EnemyBlock block ) { } public void createUfo ( ) { } public int getPoints ( ) { } public void addPoints ( int points ) { if ( points < 0 ) { return ; } this . points += points ; <START_BUG> scoreLabel . setText ( ( "Score:<seq2seq4repair_space>" + points ) ) ; <END_BUG> } @ Override public void update ( ) { } public void lose ( ) { } public void win ( ) { } }

Fix:
scoreLabel . setText ( ( "Score:<seq2seq4repair_space>" + ( this . points ) ) ) ;
Buggy code:
public class ClasspathDirectory extends ClasspathLocation { IContainer binaryFolder ; boolean isOutputFolder ; SimpleLookupTable directoryCache ; String [ ] missingPackageHolder = new String [ 1 ] ; AccessRuleSet accessRuleSet ; ClasspathDirectory ( IContainer binaryFolder , boolean isOutputFolder , AccessRuleSet accessRuleSet ) { } public void cleanup ( ) { } String [ ] directoryList ( String qualifiedPackageName ) { String [ ] dirList = ( ( String [ ] ) ( directoryCache . get ( qualifiedPackageName ) ) ) ; if ( dirList == ( missingPackageHolder ) ) return null ; if ( dirList != null ) return dirList ; try { IResource container = binaryFolder . findMember ( qualifiedPackageName ) ; <START_BUG> if ( ( container instanceof IContainer ) && ( ! ( isExcluded ( container ) ) ) ) { <END_BUG> IResource [ ] members = ( ( IContainer ) ( container ) ) . members ( ) ; dirList = new String [ members . length ] ; int index = 0 ; for ( int i = 0 , l = members . length ; i < l ; i ++ ) { IResource m = members [ i ] ; if ( ( ( m . getType ( ) ) == ( IResource . FILE ) ) && ( Util . isClassFileName ( m . getName ( ) ) ) ) dirList [ ( index ++ ) ] = m . getName ( ) ; } if ( index < ( dirList . length ) ) System . arraycopy ( dirList , 0 , ( dirList = new String [ index ] ) , 0 , index ) ; directoryCache . put ( qualifiedPackageName , dirList ) ; return dirList ; } } catch ( CoreException ignored ) { } directoryCache . put ( qualifiedPackageName , missingPackageHolder ) ; return null ; } boolean doesFileExist ( String fileName , String qualifiedPackageName , String qualifiedFullName ) { } public boolean equals ( Object o ) { } public NameEnvironmentAnswer findClass ( String binaryFileName , String qualifiedPackageName , String qualifiedBinaryFileName ) { } public IPath getProjectRelativePath ( ) { } protected boolean isExcluded ( IResource resource ) { } public boolean isOutputFolder ( ) { } public boolean isPackage ( String qualifiedPackageName ) { } public void reset ( ) { } public String toString ( ) { } public String debugPathString ( ) { } }

Fix:
if ( container instanceof IContainer ) {
Buggy code:
public class TestMappedById extends SingleEMFTestCase { public int numEmployees = 4 ; public int numDependentsPerEmployee = 2 ; public List < String > namedQueries = new ArrayList < String > ( ) ; public Map < Integer , Employee1 > emps = new HashMap < Integer , Employee1 > ( ) ; public Map < String , Dependent1 > deps = new HashMap < String , Dependent1 > ( ) ; public int eId = 1 ; public int dId = 1 ; public void setUp ( ) throws Exception { <START_BUG> super . setUp ( CLEAR_TABLES , Dependent1 . class , Employee1 . class , DependentId1 . class ) ; <END_BUG> } public void testMappedById1 ( ) { } public void createObj ( ) { } public Employee1 createEmployee ( EntityManager em , int id ) { } public Dependent1 createDependent ( EntityManager em , int id , Employee1 e ) { } public void findObj ( ) { } public void queryObj ( ) { } public void queryDependent ( ) { } public void assertDependent ( Dependent1 d ) { } }

Fix:
super . setUp ( DROP_TABLES , Dependent1 . class , Employee1 . class , DependentId1 . class ) ;
Buggy code:
public class VirtualFunctionInvoke extends Expr { static final boolean IS_DEBUG = false ; final FunctionBasic func ; final ArrayList < Expr > para ; final Expr expr ; final Position position ; public VirtualFunctionInvoke ( Expr e , FunctionBasic f , ArrayList < Expr > p ) { } void check ( ) { } @ Override boolean isChangeable ( ) { } @ Override public Expr optimize ( ) { } @ Override public String toString ( ) { } @ Override public Constant getValue ( ) { <START_BUG> Constant result = null ; <END_BUG> final Constant [ ] args = new Constant [ ( para . size ( ) ) + 1 ] ; args [ 0 ] = expr . getValue ( ) ; if ( ( args [ 0 ] ) == ( Constant . Null ) ) { error ( ( ( "null<seq2seq4repair_space>pointer<seq2seq4repair_space>error:try<seq2seq4repair_space>to<seq2seq4repair_space>invoke<seq2seq4repair_space>virtual<seq2seq4repair_space>function<seq2seq4repair_space>`" + ( func ) ) + "'<seq2seq4repair_space>of<seq2seq4repair_space>a<seq2seq4repair_space>null<seq2seq4repair_space>pointer" ) ) ; } assert ( args [ 0 ] ) instanceof StructConst ; VirtualTable vtable = ( ( StructConst ) ( args [ 0 ] ) ) . getVirtualTable ( ) ; FunctionBasic f = vtable . getVirtualFunction ( position ) ; for ( int i = 1 ; i < ( args . length ) ; i ++ ) { args [ i ] = para . get ( ( i - 1 ) ) . getValue ( ) ; } VarTable . pushTop ( ) ; int i = 0 ; for ( Constant c : args ) { if ( VirtualFunctionInvoke . IS_DEBUG ) { System . out . println ( ( ( ( ( ( ( ( "\narg[" + i ) + "]{" ) + ( para . get ( i ) ) ) + "}<seq2seq4repair_space>=<seq2seq4repair_space>" ) + c ) + "<->" ) + ( c . hashCode ( ) ) ) ) ; } VarTable . pushVar ( c ) ; i ++ ; } if ( VirtualFunctionInvoke . IS_DEBUG ) { System . out . println ( ( ( "\nVirtualInvoke<seq2seq4repair_space>" + ( func . toString ( ) ) ) + "{" ) ) ; } RunStack . invokeFunction ( lexline , filename , f ) ; try { f . run ( ) ; if ( VirtualFunctionInvoke . IS_DEBUG ) { System . out . println ( ( "\n}End<seq2seq4repair_space>VirtualInvoke#2<seq2seq4repair_space>" + ( func . toString ( ) ) ) ) ; } } catch ( ReturnResult e ) { if ( VirtualFunctionInvoke . IS_DEBUG ) { System . out . println ( ( "\n}End<seq2seq4repair_space>VirtualInvoke#1<seq2seq4repair_space>" + ( func . toString ( ) ) ) ) ; } result = e . value ; } RunStack . endInvokeFunction ( ) ; VarTable . popTop ( ) ; return result ; } No newline ; at end ; of file ; }

Fix:
Constant result = type . getInitialValue ( ) ;
Buggy code:
public class MapBackedARFFModel implements ARFFModel { private static final Pattern QUOTE_PATTERN = Pattern . compile ( "\"" ) ; private long wordCount = 1 ; private String relation ; private final Map < String , Integer > labelBindings ; private final Map < Integer , String > idxLabel ; private final Map < Integer , ARFFType > typeMap ; private final Map < Integer , DateFormat > dateMap ; private final Map < String , Map < String , Integer > > nominalMap ; private final Map < String , Long > words ; public MapBackedARFFModel ( ) { } public MapBackedARFFModel ( Map < String , Long > words , long wordCount , Map < String , Map < String , Integer > > nominalMap ) { } @ Override public String getRelation ( ) { } @ Override public void setRelation ( String relation ) { } @ Override public double getValue ( String data , int idx ) { } protected double processNominal ( String label , String data ) { double result ; Map < String , Integer > classes = nominalMap . get ( label ) ; if ( classes != null ) { <START_BUG> Integer ord = classes . get ( data ) ; <END_BUG> if ( ord != null ) { result = ord ; } else { throw new IllegalStateException ( ( ( ( "Invalid<seq2seq4repair_space>nominal:<seq2seq4repair_space>" + data ) + "<seq2seq4repair_space>for<seq2seq4repair_space>label:<seq2seq4repair_space>" ) + label ) ) ; } } else { throw new IllegalArgumentException ( ( ( ( "Invalid<seq2seq4repair_space>nominal<seq2seq4repair_space>label:<seq2seq4repair_space>" + label ) + "<seq2seq4repair_space>Data:<seq2seq4repair_space>" ) + data ) ) ; } return result ; } protected double processString ( String data ) { } protected static double processNumeric ( String data ) { } protected double processDate ( String data , int idx ) { } @ Override public Map < String , Integer > getLabelBindings ( ) { } public Map < Integer , ARFFType > getTypeMap ( ) { } public Map < Integer , DateFormat > getDateMap ( ) { } @ Override public Map < String , Map < String , Integer > > getNominalMap ( ) { } @ Override public Map < String , Long > getWords ( ) { } @ Override public Integer getNominalValue ( String label , String nominal ) { } @ Override public void addNominal ( String label , String nominal , int idx ) { } @ Override public DateFormat getDateFormat ( Integer idx ) { } @ Override public void addDateFormat ( Integer idx , DateFormat format ) { } @ Override public Integer getLabelIndex ( String label ) { } @ Override public void addLabel ( String label , Integer idx ) { } @ Override public ARFFType getARFFType ( Integer idx ) { } @ Override public void addType ( Integer idx , ARFFType type ) { } @ Override public long getWordCount ( ) { } @ Override public int getLabelSize ( ) { } }

Fix:
Integer ord = classes . get ( ARFFType . removeQuotes ( data ) ) ;
Buggy code:
@ ManagedResource public class ContainerAwareExecutionVenue extends ServiceRegisterableExecutionVenue implements CougarStartingGate , ExportableRegistration { private static final Logger LOGGER = LoggerFactory . getLogger ( ContainerAwareExecutionVenue . class ) ; private List < GateListener > startingListeners = new ArrayList < GateListener > ( ) ; private List < Exportable > exportables = new ArrayList < Exportable > ( ) ; public ContainerAwareExecutionVenue ( ) { } @ Override public void registerExportable ( Exportable exportable ) { } @ Override public void onApplicationEvent ( ApplicationEvent event ) { } private Collection < ServiceAware > getServiceAwareImplementations ( ApplicationContext ctx ) { } private void logSuccessfulCougarStartup ( ) { } @ Override public boolean registerStartingListener ( GateListener listener ) { } private void notifyStartingGateListeners ( ) { int numListeners = startingListeners . size ( ) ; int cnt = 0 ; Collections . sort ( startingListeners , ContainerAwareExecutionVenue . LISTENER_COMPARATOR ) ; for ( GateListener listener : startingListeners ) { <START_BUG> ContainerAwareExecutionVenue . LOGGER . info ( "({}<seq2seq4repair_space>of<seq2seq4repair_space>{})<seq2seq4repair_space>Calling<seq2seq4repair_space>gate<seq2seq4repair_space>listener<seq2seq4repair_space>{2}" , ( ++ cnt ) , numListeners , listener . getName ( ) ) ; <END_BUG> listener . onCougarStart ( ) ; } } private static Comparator < GateListener > LISTENER_COMPARATOR = new Comparator < GateListener > ( ) { @ Override public int compare ( GateListener g1 , GateListener g2 ) { } } ; }

Fix:
ContainerAwareExecutionVenue . LOGGER . info ( "({}<seq2seq4repair_space>of<seq2seq4repair_space>{})<seq2seq4repair_space>Calling<seq2seq4repair_space>gate<seq2seq4repair_space>listener<seq2seq4repair_space>{}" , ( ++ cnt ) , numListeners , listener . getName ( ) ) ;
Buggy code:
public class CookieUtils { private static final Logger log = LoggerFactory . getLogger ( CookieUtils . class ) ; private final CookieDefaults settings ; public CookieUtils ( ) { } public CookieUtils ( final CookieDefaults settings ) { } public final CookieDefaults getSettings ( ) { } public final void remove ( final String key ) { } public final void remove ( final FormComponent < ? > formComponent ) { } protected String getKey ( final FormComponent < ? > component ) { } public final String load ( final String key ) { } public final String load ( final FormComponent < ? > formComponent ) { } protected String [ ] splitValue ( final String value ) { } protected String joinValues ( final String ... values ) { } public final void save ( String key , final String ... values ) { } public final void save ( final FormComponent < ? > formComponent ) { } protected String getSaveKey ( String key ) { } private void remove ( final Cookie cookie ) { } private Cookie getCookie ( final String name ) { } private Cookie save ( final Cookie cookie ) { } protected void initializeCookie ( final Cookie cookie ) { } private WebRequest getWebRequest ( ) { } private WebResponse getWebResponse ( ) { } private String cookieToDebugString ( final Cookie cookie ) { <START_BUG> return ( ( ( ( ( ( ( ( ( ( ( ( ( "[Cookie<seq2seq4repair_space>" + "<seq2seq4repair_space>name<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( cookie . getName ( ) ) ) + ",<seq2seq4repair_space>value<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( cookie . getValue ( ) ) ) + ",<seq2seq4repair_space>domain<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( cookie . getDomain ( ) ) ) + ",<seq2seq4repair_space>path<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( cookie . getPath ( ) ) ) + ",<seq2seq4repair_space>maxAge<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( Time . valueOf ( cookie . getMaxAge ( ) ) . toDateString ( ) ) ) + "(" ) + ( cookie . getMaxAge ( ) ) ) + ")" ) + "]" ; <END_BUG> } }

Fix:
return ( ( ( ( ( ( ( ( ( ( ( ( ( "[Cookie<seq2seq4repair_space>" + "<seq2seq4repair_space>name<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( cookie . getName ( ) ) ) + ",<seq2seq4repair_space>value<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( cookie . getValue ( ) ) ) + ",<seq2seq4repair_space>domain<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( cookie . getDomain ( ) ) ) + ",<seq2seq4repair_space>path<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( cookie . getPath ( ) ) ) + ",<seq2seq4repair_space>maxAge<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( Time . millis ( cookie . getMaxAge ( ) ) . toDateString ( ) ) ) + "(" ) + ( cookie . getMaxAge ( ) ) ) + ")" ) + "]" ;
Buggy code:
public class DNTParser implements Parser , Runnable { private static final Logger log = LoggerFactory . getLogger ( DNTParser . class ) ; private static final Object LOCK = new Object ( ) ; private DNT dnt ; public DNTParser ( DNT dnt ) { } public void parse ( ) throws IOException { ReadStream readStream = new ReadStream ( dnt . getLocation ( ) ) ; DNTFields fields = new DNTFields ( dnt ) ; int numCols = readStream . seek ( 4 ) . readShort ( ) ; int numRows = readStream . readInt ( ) ; ArrayList < Pair < String , Types > > fieldList = new ArrayList < Pair < String , Types > > ( ) ; <START_BUG> fieldList . add ( new Pair < String , Types > ( "_ID" , Types . INT ) ) ; <END_BUG> for ( int i = 0 ; i < numCols ; i ++ ) { String fieldName = readStream . readString ( readStream . readShort ( ) ) ; Types type = Types . resolve ( readStream . read ( ) ) ; Pair < String , Types > pair = new Pair < String , Types > ( fieldName , type ) ; fields . accumulate ( pair ) ; fieldList . add ( pair ) ; } DNTEntries entries = new DNTEntries ( dnt , fieldList ) ; for ( int i = 0 ; i < numRows ; i ++ ) { ArrayList < Object > values = new ArrayList < Object > ( ) ; for ( Pair < String , Types > field : fieldList ) { values . add ( field . getRight ( ) . read ( readStream ) ) ; } entries . accumulate ( values ) ; } readStream . close ( ) ; File destination = dnt . getDestination ( ) ; File destinationDir = destination . getParentFile ( ) ; synchronized ( DNTParser . LOCK ) { if ( ( ! ( destinationDir . exists ( ) ) ) && ( ! ( destinationDir . mkdirs ( ) ) ) ) { throw new IOException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>directory<seq2seq4repair_space>" + ( destinationDir . getPath ( ) ) ) ) ; } } FileWriter writer = new FileWriter ( destination ) ; writer . write ( fields . dissipate ( ) . toString ( ) ) ; writer . write ( entries . dissipate ( ) . toString ( ) ) ; writer . close ( ) ; } @ Override public void run ( ) { } }

Fix:
fieldList . add ( new Pair < String , Types > ( DNTFields . id , Types . INT ) ) ;
Buggy code:
public class TypeVariable { private boolean isResolved = false ; private String name ; private TypeX upperBound = TypeX . OBJECT ; private TypeX [ ] additionalInterfaceBounds = new TypeX [ 0 ] ; private TypeX lowerBound = null ; public TypeVariable ( String aName ) { } public TypeVariable ( String aName , TypeX anUpperBound ) { } public TypeVariable ( String aName , TypeX anUpperBound , TypeX [ ] someAdditionalInterfaceBounds ) { } public TypeVariable ( String aName , TypeX anUpperBound , TypeX [ ] someAdditionalInterfaceBounds , TypeX aLowerBound ) { } public TypeX getUpperBound ( ) { } public TypeX [ ] getAdditionalInterfaceBounds ( ) { } public TypeX getLowerBound ( ) { } public String getName ( ) { } public void resolve ( World inSomeWorld ) { if ( isResolved ) <START_BUG> throw new IllegalStateException ( "already<seq2seq4repair_space>resolved!" ) ; <END_BUG> upperBound = upperBound . resolve ( inSomeWorld ) ; if ( ( lowerBound ) != null ) lowerBound = lowerBound . resolve ( inSomeWorld ) ; for ( int i = 0 ; i < ( additionalInterfaceBounds . length ) ; i ++ ) { additionalInterfaceBounds [ i ] = additionalInterfaceBounds [ i ] . resolve ( inSomeWorld ) ; } isResolved = true ; } public boolean canBeBoundTo ( ResolvedTypeX aCandidateType ) { } private boolean isASubtypeOf ( TypeX candidateSuperType , TypeX candidateSubType ) { } public void setUpperBound ( TypeX aTypeX ) { } public String toString ( ) { } }

Fix:
return ;
Buggy code:
public class JsonPathAsTextExpression extends BaseJSONExpression { public JsonPathAsTextExpression ( List < Expression > children ) { } public JsonPathAsTextExpression ( ) { } @ Override public boolean evaluate ( Tuple tuple , ImmutableBytesWritable ptr ) { if ( ! ( children . get ( 1 ) . evaluate ( tuple , ptr ) ) ) { return false ; } String [ ] pattern = decodePath ( ( ( String ) ( INSTANCE . toObject ( ptr ) ) ) ) ; if ( ! ( children . get ( 0 ) . evaluate ( tuple , ptr ) ) ) { return false ; } String value = ( ( String ) ( INSTANCE . toObject ( ptr ) ) ) ; JSONutil util = new JSONutil ( ) ; try { <START_BUG> JsonNode node = util . gerateJsonTree ( value ) ; <END_BUG> for ( int i = 0 ; i < ( pattern . length ) ; i ++ ) { if ( node . isValueNode ( ) ) { ptr . set ( NULL_BYTES ) ; return false ; } else if ( node . isArray ( ) ) { if ( pattern [ i ] . matches ( "\\d+" ) ) { node = util . enterJsonNodeArray ( node , Integer . valueOf ( pattern [ i ] ) ) ; } else { ptr . set ( NULL_BYTES ) ; return false ; } } else { node = util . enterJsonTreeNode ( node , pattern [ i ] ) ; } } if ( node != null ) { ptr . set ( INSTANCE . toBytes ( node . asText ( ) , SortOrder . getDefault ( ) ) ) ; } else { ptr . set ( NULL_BYTES ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } return true ; } private String [ ] decodePath ( String path ) { } @ Override public < T > T accept ( ExpressionVisitor < T > visitor ) { } @ Override public PDataType getDataType ( ) { } @ Override public PDataType getRealDataType ( ) { } }

Fix:
JsonNode node = util . getJsonNode ( value ) ;
Buggy code:
public class DefsTable { public static final ByteBuffer DEFINITION_SCHEMA_COLUMN_NAME = ByteBufferUtil . bytes ( "Avro//Schema" ) ; public static synchronized void dumpToStorage ( UUID version ) throws IOException { } public static synchronized Collection < KSMetaData > loadFromStorage ( UUID version ) throws IOException { DecoratedKey vkey = StorageService . getPartitioner ( ) . decorateKey ( Migration . toUTF8Bytes ( version ) ) ; Table defs = Table . open ( SYSTEM_TABLE ) ; ColumnFamilyStore cfStore = defs . getColumnFamilyStore ( SCHEMA_CF ) ; QueryFilter filter = QueryFilter . getIdentityFilter ( vkey , new org . apache . cassandra . db . filter . QueryPath ( Migration . SCHEMA_CF ) ) ; ColumnFamily cf = cfStore . getColumnFamily ( filter ) ; IColumn avroschema = cf . getColumn ( DefsTable . DEFINITION_SCHEMA_COLUMN_NAME ) ; if ( avroschema == null ) throw new RuntimeException ( "Cannot<seq2seq4repair_space>read<seq2seq4repair_space>system<seq2seq4repair_space>table!<seq2seq4repair_space>Are<seq2seq4repair_space>you<seq2seq4repair_space>upgrading<seq2seq4repair_space>a<seq2seq4repair_space>pre-release<seq2seq4repair_space>version?" ) ; ByteBuffer value = avroschema . value ( ) ; <START_BUG> Schema schema = Schema . parse ( ByteBufferUtil . string ( value , value . position ( ) , value . remaining ( ) ) ) ; <END_BUG> Collection < KSMetaData > keyspaces = new ArrayList < KSMetaData > ( ) ; for ( IColumn column : cf . getSortedColumns ( ) ) { if ( column . name ( ) . equals ( DefsTable . DEFINITION_SCHEMA_COLUMN_NAME ) ) continue ; KsDef ks = SerDeUtils . deserialize ( schema , column . value ( ) , new KsDef ( ) ) ; keyspaces . add ( KSMetaData . inflate ( ks ) ) ; } return keyspaces ; } public static Set < File > getFiles ( String table , final String cf ) { } }

Fix:
Schema schema = Schema . parse ( ByteBufferUtil . string ( value ) ) ;
Buggy code:
public class ProvNetwork { private List < ProvTrail > trails ; private List < String > varNames ; public ProvNetwork ( RepositoryConnection conn , String queryName ) throws IOException , OpenRDFException { } private void init ( RepositoryConnection conn , String queryName ) throws IOException , OpenRDFException { trails = new ArrayList ( ) ; <START_BUG> Scanner scanner = new Scanner ( NanolyticsUtils . getQueryFile ( "agent-prov" ) ) ; <END_BUG> String queryString = "" ; varNames = new ArrayList < > ( ) ; while ( scanner . hasNextLine ( ) ) { String line = scanner . nextLine ( ) ; if ( line . toLowerCase ( ) . startsWith ( "select<seq2seq4repair_space>" ) ) { for ( String token : line . split ( "\\s+" ) ) { if ( token . startsWith ( "?" ) ) { varNames . add ( token . substring ( 1 ) ) ; } } } queryString += line + "\n" ; } scanner . close ( ) ; varNames = ImmutableList . copyOf ( varNames ) ; TupleQuery query = conn . prepareTupleQuery ( SPARQL , queryString ) ; TupleQueryResult result = query . evaluate ( ) ; while ( result . hasNext ( ) ) { BindingSet bs = result . next ( ) ; List < URI > uris = new ArrayList < > ( ) ; for ( String n : varNames ) { Value v = bs . getBinding ( n ) . getValue ( ) ; if ( ! ( v instanceof URI ) ) { throw new RuntimeException ( ( "Not<seq2seq4repair_space>a<seq2seq4repair_space>URI:<seq2seq4repair_space>" + v ) ) ; } uris . add ( ( ( URI ) ( v ) ) ) ; } trails . add ( new ProvTrail ( uris ) ) ; } trails = ImmutableList . copyOf ( trails ) ; } public List < ProvTrail > getTrails ( ) { } public List < String > getVarNames ( ) { } public int getTrailLength ( ) { } }

Fix:
Scanner scanner = new Scanner ( NanolyticsUtils . getQueryFile ( queryName ) ) ;
Buggy code:
public class ReplyActivity extends AppCompatActivity { RecyclerView recyclerView ; private Firebase firebase ; private EditText sendText ; private ImageView sendbtn ; private Query mStatusRef ; static Bitmap mBitmap ; FirebaseRecyclerAdapter < ResponsePost , View_Holder > firebaseAdapter ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_reply ) ; sendText = ( ( EditText ) ( findViewById ( replyStatus ) ) ) ; try { ReplyActivity . mBitmap = Media . getBitmap ( this . getContentResolver ( ) , personPhoto ) ; } catch ( Exception e ) { } sendbtn = ( ( ImageView ) ( findViewById ( ivSend ) ) ) ; sendbtn . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { <START_BUG> ResponsePost reply = new ResponsePost ( LogInActivity . personName , LogInActivity . personId , sendText . getText ( ) . toString ( ) , 5 ) ; <END_BUG> firebase . push ( ) . setValue ( reply , new Firebase . CompletionListener ( ) { @ Override public void onComplete ( FirebaseError firebaseError , Firebase firebase ) { if ( firebaseError != null ) { Log . e ( "Error" , firebaseError . toString ( ) ) ; } } } ) ; sendText . setText ( "" ) ; } } ) ; recyclerView = ( ( RecyclerView ) ( findViewById ( recyclerview ) ) ) ; recyclerView . setLayoutManager ( new LinearLayoutManager ( this ) ) ; firebase = new Firebase ( "https:////studdy-buddy.firebaseio.com//Reply" ) ; mStatusRef = firebase . limitToLast ( 10 ) ; firebaseAdapter = new FirebaseRecyclerAdapter < ResponsePost , View_Holder > ( ResponsePost . class , layout . second_card_view , View_Holder . class , mStatusRef ) { @ Override public View_Holder onCreateViewHolder ( ViewGroup parent , int viewType ) { View v = LayoutInflater . from ( parent . getContext ( ) ) . inflate ( second_card_view , parent , false ) ; View_Holder holder = new View_Holder ( v ) ; return holder ; } @ Override public void populateViewHolder ( View_Holder holder , ResponsePost reply , int position ) { holder . setName ( reply . getName ( ) ) ; holder . setDescription ( reply . getDescription ( ) ) ; } } ; recyclerView . setAdapter ( firebaseAdapter ) ; } @ Override protected void onDestroy ( ) { } }

Fix:
ResponsePost reply = new ResponsePost ( LogInActivity . personName , LogInActivity . personId , sendText . getText ( ) . toString ( ) , "Status<seq2seq4repair_space>Post<seq2seq4repair_space>ID" ) ;
Buggy code:
public final class OperationEntry { public enum EntryType { PUBLIC , PRIVATE ; } public enum Flag { READ_ONLY , DEPLOYMENT_UPLOAD ; } private final NewStepHandler operationHandler ; private final DescriptionProvider descriptionProvider ; private final OperationEntry . EntryType type ; private final EnumSet < OperationEntry . Flag > flags ; private final boolean inherited ; protected OperationEntry ( final NewStepHandler operationHandler , final DescriptionProvider descriptionProvider , final boolean inherited , final OperationEntry . EntryType type , final EnumSet < OperationEntry . Flag > flags ) { } protected OperationEntry ( final NewStepHandler operationHandler , final DescriptionProvider descriptionProvider , final boolean inherited , final OperationEntry . EntryType type ) { } public NewStepHandler getOperationHandler ( ) { } public DescriptionProvider getDescriptionProvider ( ) { } public boolean isInherited ( ) { } public OperationEntry . EntryType getType ( ) { } public EnumSet < OperationEntry . Flag > getFlags ( ) { <START_BUG> return flags ; <END_BUG> } }

Fix:
return ( flags ) == null ? EnumSet . noneOf ( OperationEntry . Flag . class ) : flags . clone ( ) ;
Buggy code:
public class StatisticsToXmlTransformer implements StatisticsTransformer { private final OutputStream outputStream ; private XMLStreamWriter xmlStreamWriter ; public StatisticsToXmlTransformer ( OutputStream outputStream ) { } @ Override public void startStatistics ( Date start , Date end ) { XMLOutputFactory xmlOutputFactory = XMLOutputFactory . newInstance ( ) ; try { <START_BUG> xmlStreamWriter = xmlOutputFactory . createXMLStreamWriter ( outputStream ) ; <END_BUG> xmlStreamWriter . writeStartDocument ( "UTF-8" , "1.0" ) ; xmlStreamWriter . writeStartElement ( STATISTICS_DOCUMENT_START_ELEMENT_NAME ) ; String startString = String . format ( "%tF<seq2seq4repair_space>%tR" , start , start ) ; xmlStreamWriter . writeAttribute ( "start" , startString ) ; String endString = String . format ( "%tF<seq2seq4repair_space>%tR" , end , end ) ; xmlStreamWriter . writeAttribute ( "end" , endString ) ; } catch ( XMLStreamException e ) { throw new IllegalStateException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>XML<seq2seq4repair_space>stream<seq2seq4repair_space>writer;<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) , e ) ; } } @ Override public void startEntry ( ) { } @ Override public void writeAccessPointIdentifier ( String accessPointIdentifier ) { } @ Override public void writePeriod ( String period ) { } @ Override public void writeDirection ( String direction ) { } private void writeElementAndContents ( String elementName , String contents ) { } @ Override public void writeParticipantIdentifier ( String participantId ) { } @ Override public void writeDocumentType ( String documentType ) { } @ Override public void writeProfileId ( String profileId ) { } @ Override public void writeChannel ( String channel ) { } @ Override public void writeCount ( int count ) { } @ Override public void endEntry ( ) { } @ Override public void endStatistics ( ) { } }

Fix:
xmlStreamWriter = xmlOutputFactory . createXMLStreamWriter ( outputStream , "UTF-8" ) ;
Buggy code:
public abstract class ColoredChit implements Serializable { private static final long serialVersionUID = 6504002032717018780L ; protected int clearingNumber ; protected String description ; protected boolean hidden = true ; public abstract ChitColor getChitColor ( ) { } public int getClearingNumber ( ) { } public String getDescription ( ) { } public boolean isHidden ( ) { } public void reveal ( ) { <START_BUG> this . hidden = true ; <END_BUG> } @ Override public String toString ( ) { } }

Fix:
this . hidden = false ;
Buggy code:
public class ForgotPassword extends ScarabTemplateAction { private static final int UNIQUE_ID_MAX_LEN = 10 ; public void doForgotpassword ( RunData data , TemplateContext context ) throws Exception { } public boolean forgotPassword ( RunData data , TemplateContext context ) throws Exception { IntakeTool intake = getIntakeTool ( context ) ; Group password = intake . get ( "ForgotPassword" , DEFAULT_KEY ) ; String username = password . get ( "Username" ) . toString ( ) ; ScarabUser user = null ; try { user = ( ( ScarabUser ) ( TurbineSecurity . getUser ( username ) ) ) ; String tempPassword = GenerateUniqueId . getIdentifier ( ) ; if ( ( tempPassword . length ( ) ) > ( ForgotPassword . UNIQUE_ID_MAX_LEN ) ) { tempPassword = tempPassword . substring ( 0 , ForgotPassword . UNIQUE_ID_MAX_LEN ) ; } user . setPasswordExpire ( Calendar . getInstance ( ) ) ; user . setHasLoggedIn ( Boolean . FALSE ) ; data . setUser ( user ) ; data . save ( ) ; TurbineSecurity . forcePassword ( user , tempPassword ) ; context . put ( "password" , tempPassword ) ; TemplateEmail te = new TemplateEmail ( ) ; te . setContext ( new org . apache . turbine . modules . ContextAdapter ( context ) ) ; te . setTo ( ( ( ( user . getFirstName ( ) ) + "<seq2seq4repair_space>" ) + ( user . getLastName ( ) ) ) , user . getEmail ( ) ) ; te . setFrom ( Turbine . getConfiguration ( ) . getString ( "scarab.email.forgotpassword.fromName" , "Scarab<seq2seq4repair_space>System" ) , Turbine . getConfiguration ( ) . getString ( "scarab.email.forgotpassword.fromAddress" , "help@localhost" ) ) ; te . setSubject ( Turbine . getConfiguration ( ) . getString ( "scarab.email.forgotpassword.subject" , "Account<seq2seq4repair_space>Password" ) ) ; <START_BUG> te . setTemplate ( Turbine . getConfiguration ( ) . getString ( "scarab.email.forgotpassword.template" , "email//ForgotPassword.vm" ) ) ; <END_BUG> te . send ( ) ; } catch ( TurbineSecurityException e ) { getScarabRequestTool ( context ) . setAlertMessage ( "Invalid<seq2seq4repair_space>username." ) ; Log . get ( ) . error ( "ForgotPassword:<seq2seq4repair_space>" , e ) ; setTarget ( data , "ForgotPassword.vm" ) ; return false ; } return true ; } }

Fix:
te . setTemplate ( Turbine . getConfiguration ( ) . getString ( "scarab.email.forgotpassword.template" , "ForgotPassword.vm" ) ) ;