nus-yam/ex-repair huggingface dataset:
Buggy code:
public final class DriverProcessor implements DeploymentUnitProcessor { @ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final Module module = deploymentUnit . getAttachment ( MODULE ) ; final ServicesAttachment servicesAttachment = deploymentUnit . getAttachment ( SERVICES ) ; if ( ( module != null ) && ( servicesAttachment != null ) ) { final ModuleClassLoader classLoader = module . getClassLoader ( ) ; final List < String > driverNames = servicesAttachment . getServiceImplementations ( Driver . class . getName ( ) ) ; for ( String driverClassName : driverNames ) { try { final Class < ? extends Driver > driverClass = classLoader . loadClass ( driverClassName ) . asSubclass ( Driver . class ) ; final Constructor < ? extends Driver > constructor = driverClass . getConstructor ( ) ; final Driver driver = constructor . newInstance ( ) ; final int majorVersion = driver . getMajorVersion ( ) ; final int minorVersion = driver . getMinorVersion ( ) ; final boolean compliant = driver . jdbcCompliant ( ) ; if ( compliant ) { DEPLOYER_JDBC_LOGGER . deployingCompliantJdbcDriver ( driverClass , Integer . valueOf ( majorVersion ) , Integer . valueOf ( minorVersion ) ) ; } else { DEPLOYER_JDBC_LOGGER . deployingNonCompliantJdbcDriver ( driverClass , Integer . valueOf ( majorVersion ) , Integer . valueOf ( minorVersion ) ) ; } String driverName = deploymentUnit . getName ( ) ; <START_BUG> if ( ( ( deploymentUnit . getName ( ) . contains ( "." ) ) && ( ! ( deploymentUnit . getName ( ) . endsWith ( ".jar" ) ) ) ) || ( ( driverNames . size ( ) ) != 1 ) ) { <END_BUG> driverName = ( ( ( ( ( ( deploymentUnit . getName ( ) ) + "_" ) + driverClassName ) + "_" ) + majorVersion ) + "_" ) + minorVersion ; } InstalledDriver driverMetadata = new InstalledDriver ( driverName , driverClass . getName ( ) , null , null , majorVersion , minorVersion , compliant ) ; DriverService driverService = new DriverService ( driverMetadata , driver ) ; phaseContext . getServiceTarget ( ) . addService ( JBOSS . append ( "jdbc-driver" , driverName . replaceAll ( "\\." , "_" ) ) , driverService ) . addDependency ( JDBC_DRIVER_REGISTRY_SERVICE , DriverRegistry . class , driverService . getDriverRegistryServiceInjector ( ) ) . setInitialMode ( ACTIVE ) . install ( ) ; } catch ( Exception e ) { DEPLOYER_JDBC_LOGGER . cannotInstantiateDriverClass ( driverClassName , e ) ; } } } } @ Override public void undeploy ( final DeploymentUnit context ) { } }

Fix:
if ( ( ! ( deploymentUnit . getName ( ) . endsWith ( ".jar" ) ) ) || ( ( driverNames . size ( ) ) != 1 ) ) {
Buggy code:
public class GenericSiteChecker { private final String failureRemark = "Failed" ; protected HttpInvoker invoker ; protected String resultHtml = "" ; protected String successRemark = "Working" ; private boolean isHttps = false ; private String url ; public GenericSiteChecker ( ) { } public HttpInvoker getInvoker ( ) { } public GenericSiteChecker setInvoker ( HttpInvoker invoker ) { } public GenericSiteChecker setUrl ( String url ) { } public GenericSiteChecker setSSl ( boolean ssl ) { } private void fixSsl ( ) throws Exception { } private String getStatus ( String msg ) { } public String getStatus ( ) { } private void prepareInvoker ( ) { <START_BUG> invoker . config ( ) . setUrl ( url ) . update ( ) ; <END_BUG> } protected boolean isSupported ( ) throws Exception { } }

Fix:
invoker . config ( ) . setUrl ( url ) ;
Buggy code:
public class MSCAuxiliaryArchiveAppender implements AuxiliaryArchiveAppender { @ Override public Archive < ? > createAuxiliaryArchive ( ) { JavaArchive archive = ShrinkWrap . create ( JavaArchive . class , "arquillian-testenricher-msc.jar" ) ; archive . addAsServiceProvider ( RemoteLoadableExtension . class , MSCEnricherRemoteExtension . class ) ; <START_BUG> archive . addPackage ( MSCTestEnricher . class . getPackage ( ) ) ; <END_BUG> return archive ; } }

Fix:
archive . addPackage ( MSCEnricherExtension . class . getPackage ( ) ) ;
Buggy code:
public class SocialPlayDataServiceImpl implements SocialPlayDataService { private String dbUrl ; private String dbName ; private String userName ; private String password ; private SocialPlayDB db ; public SocialPlayDataServiceImpl ( String url , String name , String uName , String pwd ) { } @ Override public Long getCurrentId ( ) { } @ Override public Long getAccountIdFromHash ( String accountCode ) { } @ Override public ActivationRecord getActivationRecord ( long accountId ) { } @ Override public boolean updateActivationRecord ( long accountId , ActivationRecord activationRecord ) { } @ Override public Long insertAccount ( Account account ) { <START_BUG> return db . insertAccountRecord ( account . getIdentity ( ) . getIdentityType ( ) , "" , account . getName ( ) , account . getIdentity ( ) . getIdentityStr ( ) , false ) ; <END_BUG> } @ Override public boolean invite ( long invitorAccount , long inviteeAccount ) { } @ Override public boolean keepLive ( long accountId ) { } }

Fix:
return db . insertAccountRecord ( account . getIdentity ( ) . getIdentityType ( ) , account . getName ( ) , account . getIdentity ( ) . getIdentityStr ( ) , false ) ;
Buggy code:
public class TestDupNamedQuery extends SingleEMFTestCase { public void setUp ( ) { } public void testSimpleQuery ( ) { } private void simpleQuery ( boolean simple2 , String findOneQName , String findAllQName , String nameOne , String ValueOne , String nameTwo , String ValueTwo ) { EntityManager em = emf . createEntityManager ( ) ; <START_BUG> List list = em . createNamedQuery ( findOneQName ) . setParameter ( 1 , nameOne ) . getResultList ( ) ; <END_BUG> assertNotNull ( list ) ; assertEquals ( list . size ( ) , 1 ) ; Object o = list . get ( 0 ) ; assertSame ( o . getClass ( ) , ( simple2 ? SimpleEntity2 . class : SimpleEntity . class ) ) ; assertEquals ( ( simple2 ? ( ( SimpleEntity2 ) ( o ) ) . getValue ( ) : ( ( SimpleEntity ) ( o ) ) . getValue ( ) ) , ValueOne ) ; if ( findAllQName != null ) { list = em . createNamedQuery ( findAllQName ) . getResultList ( ) ; assertNotNull ( list ) ; assertEquals ( list . size ( ) , 2 ) ; for ( Iterator resultIter = list . iterator ( ) ; resultIter . hasNext ( ) ; ) { o = resultIter . next ( ) ; assertSame ( o . getClass ( ) , ( simple2 ? SimpleEntity2 . class : SimpleEntity . class ) ) ; String n = null ; String v = null ; if ( simple2 ) { n = ( ( SimpleEntity2 ) ( o ) ) . getName ( ) ; v = ( ( SimpleEntity2 ) ( o ) ) . getValue ( ) ; } else { n = ( ( SimpleEntity ) ( o ) ) . getName ( ) ; v = ( ( SimpleEntity ) ( o ) ) . getValue ( ) ; } if ( n . equals ( nameOne ) ) { assertTrue ( v . equals ( ValueOne ) ) ; } else if ( n . equals ( nameTwo ) ) { assertTrue ( v . equals ( ValueTwo ) ) ; } else { assertTrue ( false ) ; } } } em . close ( ) ; } public static void main ( String [ ] args ) { } }

Fix:
List list = em . createNamedQuery ( findOneQName ) . setParameter ( "fname" , nameOne ) . getResultList ( ) ;
Buggy code:
public class Utils { public static void checkDirectory ( File dir ) throws IOException { } public static void checkFileExecutable ( File file ) throws IOException { } public static void checkFile ( File file ) throws IOException { } private static String twoCharacter ( int value ) { } public static File createCalendarBasedDirectory ( File parent ) throws IOException { Utils . checkDirectory ( parent ) ; GregorianCalendar calendar = new GregorianCalendar ( ) ; <START_BUG> String name = ( ( ( ( ( ( ( ( ( ( calendar . get ( Calendar . YEAR ) ) + "_" ) + ( Utils . twoCharacter ( calendar . get ( Calendar . MONTH ) ) ) ) + "_" ) + ( Utils . twoCharacter ( calendar . get ( Calendar . DAY_OF_MONTH ) ) ) ) + "_" ) + ( Utils . twoCharacter ( calendar . get ( Calendar . HOUR_OF_DAY ) ) ) ) + "_" ) + ( Utils . twoCharacter ( calendar . get ( Calendar . MINUTE ) ) ) ) + "_" ) + ( Utils . twoCharacter ( calendar . get ( Calendar . SECOND ) ) ) ; <END_BUG> File directory = new File ( parent , name ) ; directory . mkdir ( ) ; if ( ! ( directory . isDirectory ( ) ) ) { throw new IOException ( ( ( "Not<seq2seq4repair_space>able<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>Directory<seq2seq4repair_space>" + ( directory . getAbsolutePath ( ) ) ) + "<seq2seq4repair_space>directory." ) ) ; } return directory ; } public static boolean isWindows ( ) { } No newline ; at end ; of file ; }

Fix:
String name = ( ( ( ( ( ( ( ( ( ( calendar . get ( Calendar . YEAR ) ) + "_" ) + ( Utils . twoCharacter ( ( ( calendar . get ( Calendar . MONTH ) ) + 1 ) ) ) ) + "_" ) + ( Utils . twoCharacter ( calendar . get ( Calendar . DAY_OF_MONTH ) ) ) ) + "_" ) + ( Utils . twoCharacter ( calendar . get ( Calendar . HOUR_OF_DAY ) ) ) ) + "_" ) + ( Utils . twoCharacter ( calendar . get ( Calendar . MINUTE ) ) ) ) + "_" ) + ( Utils . twoCharacter ( calendar . get ( Calendar . SECOND ) ) ) ;
Buggy code:
public class SubTypeSearchJob extends PatternSearchJob { Map inputs = new HashMap ( 5 ) ; public SubTypeSearchJob ( SearchPattern pattern , IJavaSearchScope scope , int detailLevel , IIndexSearchRequestor requestor , IndexManager indexManager ) { } public SubTypeSearchJob ( SearchPattern pattern , IJavaSearchScope scope , IJavaElement focus , int detailLevel , IIndexSearchRequestor requestor , IndexManager indexManager ) { } public void closeAll ( ) { } public boolean search ( IIndex index , IProgressMonitor progressMonitor ) { if ( ( progressMonitor != null ) && ( progressMonitor . isCanceled ( ) ) ) throw new OperationCanceledException ( ) ; if ( index == null ) return IJob . COMPLETE ; ReadWriteMonitor monitor = indexManager . getMonitorFor ( index ) ; if ( monitor == null ) return IJob . COMPLETE ; try { monitor . enterRead ( ) ; if ( index . hasChanged ( ) ) { try { monitor . exitRead ( ) ; monitor . enterWrite ( ) ; if ( IndexManager . VERBOSE ) <START_BUG> JobManager . log ( ( "-><seq2seq4repair_space>merging<seq2seq4repair_space>index<seq2seq4repair_space>" + ( index . getIndexFile ( ) ) ) ) ; <END_BUG> index . save ( ) ; } catch ( IOException e ) { return IJob . FAILED ; } finally { monitor . exitWriteEnterRead ( ) ; } } long start = System . currentTimeMillis ( ) ; IndexInput input ; if ( ( input = ( ( IndexInput ) ( inputs . get ( index ) ) ) ) == null ) { input = new BlocksIndexInput ( index . getIndexFile ( ) ) ; input . open ( ) ; inputs . put ( index , input ) ; } pattern . findIndexMatches ( input , requestor , detailLevel , progressMonitor , this . scope ) ; executionTime += ( System . currentTimeMillis ( ) ) - start ; return IJob . COMPLETE ; } catch ( IOException e ) { return IJob . FAILED ; } finally { monitor . exitRead ( ) ; } } }

Fix:
JobManager . verbose ( ( "-><seq2seq4repair_space>merging<seq2seq4repair_space>index<seq2seq4repair_space>" + ( index . getIndexFile ( ) ) ) ) ;
Buggy code:
public class ComponentStringResourceLoader implements IStringResourceLoader { private static final Logger log = LoggerFactory . getLogger ( ComponentStringResourceLoader . class ) ; public ComponentStringResourceLoader ( ) { } public String loadStringResource ( Class < ? > clazz , final String key , final Locale locale , final String style , final String variation ) { if ( clazz == null ) { return null ; } if ( ComponentStringResourceLoader . log . isDebugEnabled ( ) ) { ComponentStringResourceLoader . log . debug ( ( ( ( ( ( ( ( ( ( ( "key:<seq2seq4repair_space>'" + key ) + "';<seq2seq4repair_space>class:<seq2seq4repair_space>'" ) + ( clazz . getName ( ) ) ) + "';<seq2seq4repair_space>locale:<seq2seq4repair_space>'" ) + locale ) + "';<seq2seq4repair_space>Style:<seq2seq4repair_space>'" ) + style ) + "';<seq2seq4repair_space>Variation:<seq2seq4repair_space>'" ) + variation ) + "'" ) ) ; } IPropertiesFactory propertiesFactory = getPropertiesFactory ( ) ; while ( true ) { String path = clazz . getName ( ) . replace ( '.' , '//' ) ; <START_BUG> ResourceNameIterator iter = new ResourceNameIterator ( path , style , variation , locale , null ) ; <END_BUG> while ( iter . hasNext ( ) ) { String newPath = iter . next ( ) ; final Properties props = propertiesFactory . load ( clazz , newPath ) ; if ( props != null ) { String value = props . getString ( key ) ; if ( value != null ) { if ( ComponentStringResourceLoader . log . isDebugEnabled ( ) ) { ComponentStringResourceLoader . log . debug ( ( ( ( ( ( ( ( "Found<seq2seq4repair_space>property<seq2seq4repair_space>'" + key ) + "'<seq2seq4repair_space>in:<seq2seq4repair_space>'" ) + props ) + "'" ) + ";<seq2seq4repair_space>value:<seq2seq4repair_space>'" ) + value ) + "'" ) ) ; } return value ; } else { if ( ComponentStringResourceLoader . log . isDebugEnabled ( ) ) { ComponentStringResourceLoader . log . debug ( ( ( "Found<seq2seq4repair_space>properties<seq2seq4repair_space>file:<seq2seq4repair_space>'" + newPath ) + "'<seq2seq4repair_space>but<seq2seq4repair_space>it<seq2seq4repair_space>doesn't<seq2seq4repair_space>contain<seq2seq4repair_space>the<seq2seq4repair_space>property" ) ) ; } } } else { if ( ComponentStringResourceLoader . log . isDebugEnabled ( ) ) { ComponentStringResourceLoader . log . debug ( ( ( "Properties<seq2seq4repair_space>file<seq2seq4repair_space>not<seq2seq4repair_space>found:<seq2seq4repair_space>'" + newPath ) + "'" ) ) ; } } } if ( isStopResourceSearch ( clazz ) ) { break ; } clazz = clazz . getSuperclass ( ) ; if ( clazz == null ) { break ; } } return null ; } protected IPropertiesFactory getPropertiesFactory ( ) { } public String loadStringResource ( final Component component , final String key ) { } private List < Class < ? > > getComponentStack ( final Component component ) { } protected boolean isStopResourceSearch ( final Class < ? > clazz ) { } }

Fix:
ResourceNameIterator iter = new ResourceNameIterator ( path , style , variation , locale , null , false ) ;
Buggy code:
@ Service @ Transactional public class ResourceServiceImpl extends GenericServiceImpl < ResourceDAO , Resource > implements ResourceService { @ Autowired private SpecialityDAO specialityDao ; @ Autowired private SubjectDAO subjectDAO ; @ Autowired private CategoryDAO categoryDAO ; @ Autowired public ResourceServiceImpl ( ResourceDAO dao ) { } @ Override public List < Resource > listByCategoryId ( Long categoryId ) { } @ Override public List < Resource > listResourcesByTeacherIdByLinks ( Long teacherId ) { <START_BUG> return listResourcesByTeacherIdByLinks ( teacherId ) ; <END_BUG> } @ Override public Resource get ( Long id ) { } private void copySubjects ( Resource current , Resource newEntity ) { } private void copyCategories ( Resource current , Resource newEntity ) { } private void copySpeciality ( Resource current , Resource newEntity ) { } @ Override protected void copyProperties ( Resource current , Resource newEntity ) { } @ Override public List < Resource > listByFacultyId ( long facultyId ) { } }

Fix:
return dao . listResourcesByTeacherIdByLinks ( teacherId ) ;
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 { } protected abstract IDOMNode generateElementDOM ( ) throws JavaModelException { } protected void generateNewCompilationUnitDOM ( ICompilationUnit cu ) throws JavaModelException { } protected abstract IJavaElement generateResultHandle ( ) { } protected IJavaElement [ ] generateResultHandles ( ) { } protected ICompilationUnit getCompilationUnit ( ) { } protected int getMainAmountOfWork ( ) { } public abstract String getMainTaskName ( ) { } protected ISchedulingRule getSchedulingRule ( ) { <START_BUG> return getParentElement ( ) . getSchedulingRule ( ) ; <END_BUG> } 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:
return getCompilationUnit ( ) . getParent ( ) . getSchedulingRule ( ) ;
Buggy code:
public class FetchSubFolderListCommand extends FolderCommand { FolderTreeNode treeNode ; public FetchSubFolderListCommand ( DefaultCommandReference [ ] references ) { } public void updateGUI ( ) throws Exception { } public void execute ( Worker worker ) throws Exception { <START_BUG> log . debug ( ( "reference=" + ( getReferences ( UNDOABLE_OPERATION ) ) ) ) ; <END_BUG> FolderCommandReference [ ] r = ( ( FolderCommandReference [ ] ) ( getReferences ( FIRST_EXECUTION ) ) ) ; if ( r == null ) { return ; } treeNode = ( ( FolderTreeNode ) ( r [ 0 ] . getFolder ( ) ) ) ; if ( ( treeNode ) instanceof IMAPRootFolder ) { ( ( IMAPRootFolder ) ( treeNode ) ) . syncSubscribedFolders ( ) ; } } public void undo ( Worker worker ) throws Exception { } public void redo ( Worker worker ) throws Exception { } }

Fix:
log . info ( ( "reference=" + ( getReferences ( UNDOABLE_OPERATION ) ) ) ) ;
Buggy code:
public class DefaultTreeColumn extends AbstractTreeColumn { public DefaultTreeColumn ( ColumnLocation location , String header ) { } private ColumnLocation location ; private String header ; private boolean visible = true ; public Component createHeader ( MarkupContainer < ? > parent , String id ) { } public ColumnLocation getLocation ( ) { } public boolean isVisible ( ) { } public void setVisible ( boolean visible ) { } public int getSpan ( TreeNode node ) { } <START_BUG> public Renderable createCell ( TreeTable treeTable , TreeNode node , int level ) { <END_BUG> return null ; } }

Fix:
public IRenderable createCell ( TreeTable treeTable , TreeNode node , int level ) {
Buggy code:
public class JavaxScriptRunner extends ScriptRunnerBase { private ReflectWrapper engine ; public String getManagerName ( ) { } public boolean supportsLanguage ( ) { } public void executeScript ( String execName ) throws BuildException { } public Object evaluateScript ( String execName ) throws BuildException { checkLanguage ( ) ; ClassLoader origLoader = replaceContextLoader ( ) ; try { ReflectWrapper engine = createEngine ( ) ; if ( engine == null ) { throw new BuildException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>javax<seq2seq4repair_space>script<seq2seq4repair_space>engine<seq2seq4repair_space>for<seq2seq4repair_space>" + ( getLanguage ( ) ) ) ) ; } for ( Iterator i = getBeans ( ) . keySet ( ) . iterator ( ) ; i . hasNext ( ) ; ) { String key = ( ( String ) ( i . next ( ) ) ) ; Object value = getBeans ( ) . get ( key ) ; <START_BUG> if ( "FX" . equals ( getLanguage ( ) ) ) { <END_BUG> engine . invoke ( "put" , String . class , ( ( key + ":" ) + ( value . getClass ( ) . getName ( ) ) ) , Object . class , value ) ; } else { engine . invoke ( "put" , String . class , key , Object . class , value ) ; } } return engine . invoke ( "eval" , String . class , getScript ( ) ) ; } catch ( BuildException be ) { throw be ; } catch ( Exception be ) { Throwable t = be ; Throwable te = ( ( Throwable ) ( ReflectUtil . invoke ( be , "getCause" ) ) ) ; if ( te != null ) { if ( te instanceof BuildException ) { throw ( ( BuildException ) ( te ) ) ; } else { t = te ; } } throw new BuildException ( t ) ; } finally { restoreContextLoader ( origLoader ) ; } } private ReflectWrapper createEngine ( ) throws Exception { } }

Fix:
if ( "FX" . equalsIgnoreCase ( getLanguage ( ) ) ) {
Buggy code:
public class JavadocReturnStatement extends ReturnStatement { public char [ ] description ; public JavadocReturnStatement ( int s , int e , char [ ] descr ) { } public void resolve ( BlockScope scope ) { MethodScope methodScope = scope . methodScope ( ) ; MethodBinding methodBinding ; TypeBinding methodType = ( ( methodScope . referenceContext ) instanceof AbstractMethodDeclaration ) ? ( methodBinding = ( ( AbstractMethodDeclaration ) ( methodScope . referenceContext ) ) . binding ) == null ? null : methodBinding . returnType : VoidBinding ; <START_BUG> if ( methodType == ( VoidBinding ) ) { <END_BUG> scope . problemReporter ( ) . javadocUnexpectedTag ( this . sourceStart , this . sourceEnd ) ; } } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
if ( ( methodType == null ) || ( methodType == ( VoidBinding ) ) ) {
Buggy code:
final class BcelField extends ResolvedMember { private Field field ; private boolean isAjSynthetic ; private boolean isSynthetic = false ; private ResolvedTypeX [ ] resolvedAnnotations ; private World world ; BcelField ( BcelObjectType declaringType , Field field ) { } private void unpackAttributes ( World world ) { Attribute [ ] attrs = field . getAttributes ( ) ; <START_BUG> List as = BcelAttributes . readAjAttributes ( attrs , getSourceContext ( world ) , world . getMessageHandler ( ) ) ; <END_BUG> for ( Iterator iter = as . iterator ( ) ; iter . hasNext ( ) ; ) { AjAttribute a = ( ( AjAttribute ) ( iter . next ( ) ) ) ; if ( a instanceof AjAttribute . AjSynthetic ) { isAjSynthetic = true ; } else { throw new org . aspectj . weaver . BCException ( ( "weird<seq2seq4repair_space>field<seq2seq4repair_space>attribute<seq2seq4repair_space>" + a ) ) ; } } isAjSynthetic = false ; for ( int i = ( attrs . length ) - 1 ; i >= 0 ; i -- ) { if ( ( attrs [ i ] ) instanceof Synthetic ) isSynthetic = true ; } } public boolean isAjSynthetic ( ) { } public boolean isSynthetic ( ) { } public boolean hasAnnotation ( TypeX ofType ) { } public ResolvedTypeX [ ] getAnnotationTypes ( ) { } }

Fix:
List as = BcelAttributes . readAjAttributes ( getDeclaringType ( ) . getClassName ( ) , attrs , getSourceContext ( world ) , world . getMessageHandler ( ) ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class ParseModMboxPageFunction extends BaseOperation < NullContext > implements Function < NullContext > { private static final Logger LOGGER = Logger . getLogger ( ParseModMboxPageFunction . class ) ; private List < String > _ids = new ArrayList < String > ( ) ; private transient HtmlParser _parser ; private transient ContentHandler _handler ; public ParseModMboxPageFunction ( ) { } private synchronized void init ( ) { } @ Override public void operate ( FlowProcess process , FunctionCall < NullContext > functionCall ) { TupleEntry arguments = functionCall . getArguments ( ) ; FetchedDatum fetchedDatum = new FetchedDatum ( arguments . getTuple ( ) ) ; if ( fetchedDatum . getContentType ( ) . startsWith ( "text//html" ) ) { init ( ) ; Metadata metadata = new Metadata ( ) ; InputStream is = new ByteArrayInputStream ( fetchedDatum . getContentBytes ( ) ) ; try { _parser . parse ( is , _handler , metadata , new ParseContext ( ) ) ; for ( String id : _ids ) { <START_BUG> String url = String . format ( "%s//%s.mbox" , fetchedDatum . getBaseUrl ( ) , id ) ; <END_BUG> UrlDatum datum = new UrlDatum ( url ) ; functionCall . getOutputCollector ( ) . add ( datum . getTuple ( ) ) ; } } catch ( Exception e ) { ParseModMboxPageFunction . LOGGER . error ( "Exception<seq2seq4repair_space>parsing<seq2seq4repair_space>mod_mbox<seq2seq4repair_space>page" , e ) ; } } } }

Fix:
String url = String . format ( "%s//%s.mbox" , fetchedDatum . getUrl ( ) , id ) ;
Buggy code:
public class NewSurtTokenizer implements Iterable < String > { private String surt ; private int endOfAuthority ; private int endOfPath ; private int surtLength ; private int preTabLength ; public NewSurtTokenizer ( String surt ) { } private class NewSurtTokenizerIterator implements Iterator < String > { int pos = 0 ; public boolean hasNext ( ) { } private int nextPieceEnd ( ) { if ( ( ( pos ) >= ( preTabLength ) ) && ( ( pos ) < ( surtLength ) ) ) { return surtLength ; } if ( ( pos ) == 0 ) { int i = surt . indexOf ( '(' ) ; if ( i == ( - 1 ) ) { return preTabLength ; } return i + 1 ; } if ( ( ( pos ) < ( endOfAuthority ) ) || ( ( endOfAuthority ) == ( - 1 ) ) ) { int endOfHostComponent = surt . indexOf ( ',' , pos ) ; if ( endOfHostComponent == ( - 1 ) ) { return preTabLength ; } else { return endOfHostComponent + 1 ; } } <START_BUG> if ( ( pos ) == ( endOfAuthority ) ) { <END_BUG> return ( pos ) + 2 ; } if ( ( ( pos ) < ( endOfPath ) ) || ( ( endOfPath ) == ( - 1 ) ) ) { int endOfPathSegment = surt . indexOf ( '//' , pos ) ; if ( ( endOfPathSegment < ( endOfPath ) ) && ( endOfPathSegment != ( - 1 ) ) ) { return endOfPathSegment + 1 ; } else if ( ( endOfPath ) != ( - 1 ) ) { return endOfPath ; } else { return preTabLength ; } } if ( ( surt . charAt ( pos ) ) == '?' ) { int endOfQuery = surt . indexOf ( '#' ) ; if ( endOfQuery != ( - 1 ) ) { return endOfQuery ; } else { return preTabLength ; } } return preTabLength ; } public String next ( ) { } public void remove ( ) { } } public Iterator < String > iterator ( ) { } public List < String > toList ( ) { } public String [ ] toArray ( ) { } public List < String > getSearchList ( ) { } }

Fix:
if ( ( ( pos ) == ( endOfAuthority ) ) && ( ( ( pos ) + 2 ) <= ( endOfPath ) ) ) {
Buggy code:
public class MainUI extends JFrame implements ActionListener , MouseListener , MouseMotionListener { private Hub hub ; private UIConsole bottomPanel ; private Board board ; private int turn ; private boolean canMove ; private boolean inDisprove ; private boolean inAccuse ; private boolean turnToggle ; private boolean humanTurn ; private Player [ ] players ; private AI [ ] aiPlayers ; private Card [ ] envelope ; private Card [ ] accusation ; private Timer diceRoll ; private Timer diceRollStop ; private AudioPlayer dice ; private AudioPlayer button ; private Random rand = new Random ( ) ; public MainUI ( ) { } public void actionPerformed ( ActionEvent e ) { } public void mouseClicked ( MouseEvent e ) { if ( ( canMove ) && ( humanTurn ) ) { Rooms clicked = roomClicked ( e . getPoint ( ) ) ; <START_BUG> if ( clicked != null ) { <END_BUG> players [ turn ] . getMovement ( ) . setDestination ( clicked ) ; dice . play ( ) ; diceRoll . start ( ) ; diceRollStop . start ( ) ; } } } public void mouseMoved ( MouseEvent e ) { } private Rooms roomHovered ( Point point ) { } private Rooms roomClicked ( Point point ) { } public void nextTurn ( ) { } public void displayPlayerAccusation ( ) { } public void displayAIAccusation ( ) { } public void displayPlayerAssumption ( ) { } public void displayAIAssumption ( ) { } public void displayMovement ( ) { } public void displayDisproval ( ) { } private void performAIAction ( int actionValue ) { } private void checkAccusation ( ) { } public void mousePressed ( MouseEvent e ) { } public void mouseReleased ( MouseEvent e ) { } public void mouseEntered ( MouseEvent e ) { } public void mouseExited ( MouseEvent e ) { } public void mouseDragged ( MouseEvent e ) { } }

Fix:
if ( ( clicked != null ) && ( bottomPanel . messageConfirmed ( ) ) ) {
Buggy code:
public class TestQueryIdOfRelationDoesNotJoin extends TestCase { private EntityManagerFactory emf ; private long e3Id ; public void setUp ( ) { <START_BUG> Map props = new HashMap ( ) ; <END_BUG> props . put ( "openjpa.MetaDataFactory" , ( ( ( ( "jpa(Types=" + ( ManyOneEntity . class . getName ( ) ) ) + ";" ) + ( ManyOneEntitySub . class . getName ( ) ) ) + ")" ) ) ; emf = Persistence . createEntityManagerFactory ( "test" , props ) ; ManyOneEntity e1 = new ManyOneEntity ( ) ; e1 . setName ( "e1" ) ; ManyOneEntity e2 = new ManyOneEntity ( ) ; e2 . setName ( "e2" ) ; ManyOneEntity e3 = new ManyOneEntity ( ) ; e3 . setName ( "e3" ) ; e1 . setRel ( e3 ) ; e2 . setRel ( e1 ) ; EntityManager em = emf . createEntityManager ( ) ; em . getTransaction ( ) . begin ( ) ; em . persist ( e1 ) ; em . getTransaction ( ) . commit ( ) ; e3Id = e3 . getId ( ) ; em . getTransaction ( ) . begin ( ) ; em . remove ( e3 ) ; em . getTransaction ( ) . commit ( ) ; em . close ( ) ; } public void tearDown ( ) { } public void testQuery ( ) { } public static void main ( String [ ] args ) { } }

Fix:
Map props = new HashMap ( System . getProperties ( ) ) ;
Buggy code:
public final class ConversionServiceFactory { private ConversionServiceFactory ( ) { } public static ConversionService createDefaultConversionService ( ) { GenericConversionService conversionService = new GenericConversionService ( ) ; conversionService . addGenericConverter ( new ArrayToArrayConverter ( conversionService ) ) ; conversionService . addGenericConverter ( new ArrayToCollectionConverter ( conversionService ) ) ; conversionService . addGenericConverter ( new ArrayToMapConverter ( conversionService ) ) ; conversionService . addGenericConverter ( new ArrayToObjectConverter ( conversionService ) ) ; conversionService . addGenericConverter ( new CollectionToCollectionConverter ( conversionService ) ) ; conversionService . addGenericConverter ( new CollectionToArrayConverter ( conversionService ) ) ; conversionService . addGenericConverter ( new CollectionToMapConverter ( conversionService ) ) ; conversionService . addGenericConverter ( new CollectionToObjectConverter ( conversionService ) ) ; conversionService . addGenericConverter ( new MapToMapConverter ( conversionService ) ) ; conversionService . addGenericConverter ( new MapToArrayConverter ( conversionService ) ) ; conversionService . addGenericConverter ( new MapToCollectionConverter ( conversionService ) ) ; conversionService . addGenericConverter ( new MapToObjectConverter ( conversionService ) ) ; conversionService . addGenericConverter ( new ObjectToArrayConverter ( conversionService ) ) ; conversionService . addGenericConverter ( new ObjectToCollectionConverter ( conversionService ) ) ; conversionService . addGenericConverter ( new ObjectToMapConverter ( conversionService ) ) ; conversionService . addConverter ( new StringToBooleanConverter ( ) ) ; conversionService . addConverter ( new StringToCharacterConverter ( ) ) ; conversionService . addConverter ( new StringToLocaleConverter ( ) ) ; conversionService . addConverter ( new NumberToCharacterConverter ( ) ) ; conversionService . addConverterFactory ( new StringToNumberConverterFactory ( ) ) ; conversionService . addConverterFactory ( new StringToEnumConverterFactory ( ) ) ; conversionService . addConverterFactory ( new NumberToNumberConverterFactory ( ) ) ; conversionService . addConverterFactory ( new CharacterToNumberFactory ( ) ) ; conversionService . addConverter ( new ObjectToStringConverter ( ) ) ; conversionService . addGenericConverter ( new ObjectToObjectGenericConverter ( ) ) ; <START_BUG> conversionService . addGenericConverter ( new EntityConverter ( conversionService ) ) ; <END_BUG> return conversionService ; } }

Fix:
conversionService . addGenericConverter ( new IdToEntityConverter ( conversionService ) ) ;
Buggy code:
class AjpListenerAdd extends AbstractListenerAdd { AjpListenerAdd ( AjpListenerResourceDefinition def ) { } protected ServiceName constructServiceName ( final String name ) { <START_BUG> return AJP_LISTENER . append ( name ) ; <END_BUG> } @ Override AbstractListenerService < ? extends AbstractListenerService > createService ( String name , OperationContext context , ModelNode model ) throws OperationFailedException { } @ Override void configureAdditionalDependencies ( OperationContext context , ServiceBuilder < ? extends AbstractListenerService > serviceBuilder , ModelNode model , AbstractListenerService service ) throws OperationFailedException { } }

Fix:
return LISTENER . append ( name ) ;
Buggy code:
public class ProxySCM extends SCM { private final String projectName ; @ DataBoundConstructor public ProxySCM ( String projectName ) { } public String getProjectName ( ) { } public AbstractProject < ? , ? > getProject ( ) { <START_BUG> return ( ( AbstractProject < ? , ? > ) ( Hudson . getInstance ( ) . getItem ( projectName ) ) ) ; <END_BUG> } @ Override public boolean checkout ( AbstractBuild build , Launcher launcher , FilePath workspace , BuildListener listener , File changelogFile ) throws IOException , InterruptedException { } @ Override public ChangeLogParser createChangeLogParser ( ) { } @ Override @ Deprecated public boolean pollChanges ( AbstractProject project , Launcher launcher , FilePath workspace , TaskListener listener ) throws IOException , InterruptedException { } @ Extension public static class DescriptorImpl extends SCMDescriptor { public DescriptorImpl ( ) { } @ Override public String getDisplayName ( ) { } public FormValidation doCheckProjectName ( @ AncestorInPath AccessControlled anc , @ QueryParameter String value ) { } } @ Override public RepositoryBrowser getBrowser ( ) { } @ Override public FilePath getModuleRoot ( FilePath workspace ) { } @ Override public FilePath [ ] getModuleRoots ( FilePath workspace ) { } @ Override public boolean processWorkspaceBeforeDeletion ( AbstractProject < ? , ? > project , FilePath workspace , Node node ) throws IOException , InterruptedException { } @ Override public boolean requiresWorkspaceForPolling ( ) { } @ Override public boolean supportsPolling ( ) { } @ Override public void buildEnvVars ( AbstractBuild < ? , ? > build , Map < String , String > env ) { } @ Override public SCMRevisionState calcRevisionsFromBuild ( AbstractBuild < ? , ? > paramAbstractBuild , Launcher paramLauncher , TaskListener paramTaskListener ) throws IOException , InterruptedException { } @ Override protected PollingResult compareRemoteRevisionWith ( AbstractProject < ? , ? > project , Launcher launcher , FilePath workspace , TaskListener listener , SCMRevisionState baseline ) throws IOException , InterruptedException { } }

Fix:
return ( ( AbstractProject < ? , ? > ) ( Hudson . getInstance ( ) . getItemByFullName ( projectName ) ) ) ;
Buggy code:
public class LayoutTest1 { private static Grammar getGrammar ( ) { } @ Test public void test ( ) { Input input = Input . fromString ( "a<seq2seq4repair_space>b" ) ; Grammar grammar = LayoutTest1 . getGrammar ( ) ; <START_BUG> ParseResult result = Iguana . parse ( input , grammar , DEFAULT , Nonterminal . withName ( "S" ) ) ; <END_BUG> assertTrue ( result . isParseSuccess ( ) ) ; } }

Fix:
ParseResult result = Iguana . parse ( input , grammar , Nonterminal . withName ( "S" ) ) ;
Buggy code:
public class SimpleMapper1 extends BaseInterceptor { ContextManager cm ; PrefixMapper map ; int ctExtMapNote = - 1 ; int defaultMapNOTE = - 1 ; boolean mapCacheEnabled = false ; Helper loghelper = new Logger . Helper ( "tc_log" , "SimpleMapper1" ) ; public SimpleMapper1 ( ) { } public void setMapCache ( boolean v ) { } public void engineInit ( ContextManager cm ) throws TomcatException { } public void addContext ( ContextManager cm , Context ctx ) throws TomcatException { } public void removeContext ( ContextManager cm , Context ctx ) throws TomcatException { } public void addContainer ( Container ct ) throws TomcatException { } public void removeContainer ( Container ct ) throws TomcatException { } public int contextMap ( Request req ) { } public int requestMap ( Request req ) { } Container matchExtension ( Request req ) { Context ctx = req . getContext ( ) ; String ctxP = ctx . getPath ( ) ; <START_BUG> String path = req . getPathInfo ( ) ; <END_BUG> if ( path == null ) return null ; String extension = URLUtil . getExtension ( path ) ; if ( extension == null ) return null ; if ( ( debug ) > 0 ) cm . log ( ( ( ( ( ( "SM:<seq2seq4repair_space>Extension<seq2seq4repair_space>match<seq2seq4repair_space>" + ctxP ) + "<seq2seq4repair_space>" ) + path ) + "<seq2seq4repair_space>" ) + extension ) ) ; SimpleHashtable extM = ( ( SimpleHashtable ) ( ctx . getContainer ( ) . getNote ( ctExtMapNote ) ) ) ; if ( extM == null ) return null ; Container container = ( ( Container ) ( extM . get ( extension ) ) ) ; if ( container == null ) return null ; if ( ( container . getHandler ( ) ) == null ) return container ; return container ; } void fixRequestPaths ( String path , Request req , Container container ) { } }

Fix:
String path = req . getServletPath ( ) ;
Buggy code:
public class SourceField extends NamedMember implements IField { protected SourceField ( JavaElement parent , String name ) { } public boolean equals ( Object o ) { } public ASTNode findNode ( CompilationUnit ast ) { } public Object getConstant ( ) throws JavaModelException { } public int getElementType ( ) { } public String getKey ( ) { try { <START_BUG> return getKey ( this , Binding . USE_ACCESS_FLAGS_IN_BINDING_KEY , false ) ; <END_BUG> } catch ( JavaModelException e ) { return null ; } } protected char getHandleMementoDelimiter ( ) { } public IJavaElement getPrimaryElement ( boolean checkOwner ) { } public String getTypeSignature ( ) throws JavaModelException { } public boolean isEnumConstant ( ) throws JavaModelException { } public boolean isResolved ( ) { } public JavaElement resolved ( Binding binding ) { } protected void toStringInfo ( int tab , StringBuffer buffer , Object info , boolean showResolvedInfo ) { } }

Fix:
return getKey ( this , true , false ) ;
Buggy code:
public abstract class HeaderContainer extends WebMarkupContainer { private static final long serialVersionUID = 1L ; private transient Map < String , Map < Class , MarkupContainer > > componentsPerScope ; public HeaderContainer ( MarkupContainer parent , final String id ) { } protected final void renderHeaderSections ( final Page page ) { <START_BUG> page . renderHead ( new HeaderResponse ( getResponse ( ) ) ) ; <END_BUG> } @ Override public boolean isTransparentResolver ( ) { } public boolean okToRender ( final WicketHeadContainer header ) { } @ Override protected void onBeforeRender ( ) { } @ Override protected void onDetach ( ) { } }

Fix:
page . internalRenderHead ( new HeaderResponse ( getResponse ( ) ) ) ;
Buggy code:
public abstract class GenericPortletBean extends GenericPortlet implements EnvironmentAware , EnvironmentCapable { protected final Log logger = LogFactory . getLog ( getClass ( ) ) ; private final Set < String > requiredProperties = new HashSet < String > ( ) ; private ConfigurableEnvironment environment ; protected final void addRequiredProperty ( String property ) { } @ Override public final void init ( ) throws PortletException { if ( logger . isInfoEnabled ( ) ) { logger . info ( ( ( "Initializing<seq2seq4repair_space>portlet<seq2seq4repair_space>'" + ( getPortletName ( ) ) ) + "'" ) ) ; } try { PropertyValues pvs = new GenericPortletBean . PortletConfigPropertyValues ( getPortletConfig ( ) , this . requiredProperties ) ; BeanWrapper bw = PropertyAccessorFactory . forBeanPropertyAccess ( this ) ; ResourceLoader resourceLoader = new org . springframework . web . portlet . context . PortletContextResourceLoader ( getPortletContext ( ) ) ; <START_BUG> bw . registerCustomEditor ( Resource . class , new org . springframework . core . io . ResourceEditor ( resourceLoader , this . getEnvironment ( ) ) ) ; <END_BUG> initBeanWrapper ( bw ) ; bw . setPropertyValues ( pvs , true ) ; } catch ( BeansException ex ) { logger . error ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>set<seq2seq4repair_space>bean<seq2seq4repair_space>properties<seq2seq4repair_space>on<seq2seq4repair_space>portlet<seq2seq4repair_space>'" + ( getPortletName ( ) ) ) + "'" ) , ex ) ; throw ex ; } initPortletBean ( ) ; if ( logger . isInfoEnabled ( ) ) { logger . info ( ( ( "Portlet<seq2seq4repair_space>'" + ( getPortletName ( ) ) ) + "'<seq2seq4repair_space>configured<seq2seq4repair_space>successfully" ) ) ; } } protected void initBeanWrapper ( BeanWrapper bw ) throws BeansException { } @ Override public final String getPortletName ( ) { } @ Override public final PortletContext getPortletContext ( ) { } protected void initPortletBean ( ) throws PortletException { } public void setEnvironment ( Environment environment ) { } public ConfigurableEnvironment getEnvironment ( ) { } protected ConfigurableEnvironment createEnvironment ( ) { } @ SuppressWarnings ( "serial" ) private static class PortletConfigPropertyValues extends MutablePropertyValues { private PortletConfigPropertyValues ( PortletConfig config , Set < String > requiredProperties ) throws PortletException { } } }

Fix:
bw . registerCustomEditor ( Resource . class , new org . springframework . core . io . ResourceEditor ( resourceLoader , getEnvironment ( ) ) ) ;
Buggy code:
public class JMSConfigGui extends AbstractSamplerGui { private JLabeledTextField queueuConnectionFactory = new JLabeledTextField ( JMeterUtils . getResString ( "jms_queue_connection_factory" ) ) ; private JLabeledTextField sendQueue = new JLabeledTextField ( JMeterUtils . getResString ( "jms_send_queue" ) ) ; private JLabeledTextField receiveQueue = new JLabeledTextField ( JMeterUtils . getResString ( "jms_receive_queue" ) ) ; private JLabeledTextField timeout = new JLabeledTextField ( JMeterUtils . getResString ( "jms_timeout" ) ) ; private JLabeledTextArea soapXml = new JLabeledTextArea ( JMeterUtils . getResString ( "jms_msg_content" ) ) ; private JLabeledTextField initialContextFactory = new JLabeledTextField ( JMeterUtils . getResString ( "jms_initial_context_factory" ) ) ; private JLabeledTextField providerUrl = new JLabeledTextField ( JMeterUtils . getResString ( "jms_provider_url" ) ) ; private String [ ] labels = new String [ ] { JMeterUtils . getResString ( "jms_request" ) , JMeterUtils . getResString ( "jms_requestreply" ) } ; private JLabeledChoice oneWay = new JLabeledChoice ( JMeterUtils . getResString ( "jms_communication_style" ) , labels ) ; private ArgumentsPanel jmsPropertiesPanel ; private ArgumentsPanel jndiPropertiesPanel ; private JCheckBox useNonPersistentDelivery ; private JCheckBox useReqMsgIdAsCorrelId ; public JMSConfigGui ( ) { } @ Override public void clearGui ( ) { } public TestElement createTestElement ( ) { } private void transfer ( JMSSampler element ) { } public void modifyTestElement ( TestElement element ) { } @ Override public void configure ( TestElement el ) { super . configure ( el ) ; JMSSampler sampler = ( ( JMSSampler ) ( el ) ) ; queueuConnectionFactory . setText ( sampler . getQueueConnectionFactory ( ) ) ; sendQueue . setText ( sampler . getSendQueue ( ) ) ; receiveQueue . setText ( sampler . getReceiveQueue ( ) ) ; JComboBox box = ( ( JComboBox ) ( oneWay . getComponentList ( ) . get ( 1 ) ) ) ; String selected = null ; if ( sampler . isOneway ( ) ) { selected = JMeterUtils . getResString ( "jms_request" ) ; } else { selected = JMeterUtils . getResString ( "jms_requestreply" ) ; } box . setSelectedItem ( selected ) ; useNonPersistentDelivery . setSelected ( sampler . isNonPersistent ( ) ) ; useReqMsgIdAsCorrelId . setSelected ( sampler . isUseReqMsgIdAsCorrelId ( ) ) ; <START_BUG> timeout . setText ( String . valueOf ( sampler . getTimeout ( ) ) ) ; <END_BUG> soapXml . setText ( sampler . getContent ( ) ) ; initialContextFactory . setText ( sampler . getInitialContextFactory ( ) ) ; providerUrl . setText ( sampler . getContextProvider ( ) ) ; jmsPropertiesPanel . configure ( sampler . getJMSProperties ( ) ) ; jndiPropertiesPanel . configure ( sampler . getJNDIProperties ( ) ) ; } private void init ( ) { } private JPanel createJNDIPanel ( ) { } public String getLabelResource ( ) { } }

Fix:
timeout . setText ( sampler . getTimeout ( ) ) ;
Buggy code:
public class LoginServlet extends HttpServlet { private static final long serialVersionUID = 1L ; private String userID = "" ; private String password = "" ; protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { String user = request . getParameter ( "user" ) ; String pwd = request . getParameter ( "pwd" ) ; ResultSet myRs = null ; db myDB = new db ( ) ; String sql = ( ( ( "select<seq2seq4repair_space>*<seq2seq4repair_space>from<seq2seq4repair_space>users<seq2seq4repair_space>where<seq2seq4repair_space>email='" + user ) + "'<seq2seq4repair_space>and<seq2seq4repair_space>pass='" ) + pwd ) + "'" ; try { myRs = myDB . select ( sql ) ; } catch ( ClassNotFoundException e ) { e . printStackTrace ( ) ; } try { if ( myRs . next ( ) ) { userID = myRs . getString ( "email" ) ; password = myRs . getString ( "pass" ) ; } } catch ( SQLException ex ) { Logger . getLogger ( LoginServlet . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } if ( ( userID . equals ( user ) ) && ( password . equals ( pwd ) ) ) { HttpSession session = request . getSession ( ) ; try { User userClient = new User ( myRs . getString ( "fname" ) , myRs . getString ( "lname" ) , myRs . getString ( "pass" ) , myRs . getString ( "email" ) , myRs . getString ( "gender" ) , myRs . getString ( "country" ) , myRs . getString ( "city" ) ) ; session . setAttribute ( "ObjPerson" , userClient ) ; session . setMaxInactiveInterval ( ( 1 * 60 ) ) ; <START_BUG> String encodedURL = response . encodeRedirectURL ( "homeJsp.jsp" ) ; <END_BUG> response . sendRedirect ( encodedURL ) ; } catch ( SQLException ex ) { Logger . getLogger ( LoginServlet . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } } else { myMessageBox . infoBox ( "Either<seq2seq4repair_space>user<seq2seq4repair_space>name<seq2seq4repair_space>or<seq2seq4repair_space>password<seq2seq4repair_space>is<seq2seq4repair_space>wrong" , "OOPS...." ) ; RequestDispatcher rd = getServletContext ( ) . getRequestDispatcher ( "//index.html" ) ; PrintWriter out = response . getWriter ( ) ; rd . include ( request , response ) ; } } No newline ; at end ; of file ; }

Fix:
String encodedURL = response . encodeRedirectURL ( "blogJsp.jsp" ) ;
Buggy code:
public class Game extends Activity implements OnClickListener { private QuestionService questionService ; private PhotoService photoService ; private Set < Question > questions ; private Iterator < Question > questionsIterator ; private Question currentQuestion ; private List < Button > buttonList ; private ImageView portrait ; private int questionIndex ; private int clickedIndex ; private GamePhase gamePhase ; private Drawable buttonBackground ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void mainGameLoop ( ) { } @ Override public void onClick ( View v ) { } void init ( ) { } QuestionService createQuestionService ( ) throws IOException { } List < Button > createButtons ( ) { } ImageView createImageView ( ) { } void runLogic ( ) { } void paintQuestion ( ) { } void paintAfterAnswer ( ) { final Button clicked = buttonList . get ( clickedIndex ) ; final int green = Color . parseColor ( "#11FF00" ) ; final int red = Color . parseColor ( "#FF0000" ) ; Animation animation = new AlphaAnimation ( 1 , 0 ) ; animation . setDuration ( 500 ) ; animation . setInterpolator ( new LinearInterpolator ( ) ) ; animation . setRepeatCount ( 8 ) ; animation . setRepeatMode ( REVERSE ) ; animation . setAnimationListener ( new Animation . AnimationListener ( ) { private long started ; @ Override public void onAnimationStart ( Animation animation ) { started = System . currentTimeMillis ( ) ; } @ Override public void onAnimationEnd ( Animation animation ) { clicked . getBackground ( ) . clearColorFilter ( ) ; goToNextQuestion ( ) ; mainGameLoop ( ) ; } @ Override public void onAnimationRepeat ( Animation animation ) { if ( ( ( System . currentTimeMillis ( ) ) - ( started ) ) < 2000 ) return ; int color = 0 ; if ( currentQuestion . isCorrectlyAnswered ( ) ) { color = green ; } else { color = red ; } <START_BUG> clicked . getBackground ( ) . setColorFilter ( red , MULTIPLY ) ; <END_BUG> clicked . invalidate ( ) ; } } ) ; clicked . startAnimation ( animation ) ; } public void goToNextQuestion ( ) { } }

Fix:
clicked . getBackground ( ) . setColorFilter ( color , MULTIPLY ) ;