nus-yam/ex-repair huggingface dataset:
Buggy code:
public class EclipseSourceType extends ResolvedTypeX . ConcreteName { protected ResolvedPointcutDefinition [ ] declaredPointcuts = null ; protected ResolvedMember [ ] declaredMethods = null ; protected ResolvedMember [ ] declaredFields = null ; public List declares = new ArrayList ( ) ; public List typeMungers = new ArrayList ( ) ; private EclipseFactory factory ; private SourceTypeBinding binding ; private TypeDeclaration declaration ; protected EclipseFactory eclipseWorld ( ) { } public EclipseSourceType ( ResolvedTypeX . Name resolvedTypeX , EclipseFactory factory , SourceTypeBinding binding , TypeDeclaration declaration ) { } public boolean isAspect ( ) { } public WeaverStateInfo getWeaverState ( ) { } public ResolvedTypeX getSuperclass ( ) { } public ResolvedTypeX [ ] getDeclaredInterfaces ( ) { } protected void fillDeclaredMembers ( ) { } public ResolvedMember [ ] getDeclaredFields ( ) { } public ResolvedMember [ ] getDeclaredMethods ( ) { } public ResolvedMember [ ] getDeclaredPointcuts ( ) { } public int getModifiers ( ) { } public String toString ( ) { } public void checkPointcutDeclarations ( ) { } public boolean isInterface ( ) { } public static final short ACC_ANNOTATION = 8192 ; public static final short ACC_ENUM = 16384 ; public boolean isEnum ( ) { } public boolean isAnnotation ( ) { } public boolean isAnnotationWithRuntimeRetention ( ) { if ( ! ( isAnnotation ( ) ) ) { return false ; } else { <START_BUG> throw new RuntimeException ( "How<seq2seq4repair_space>to<seq2seq4repair_space>implement<seq2seq4repair_space>this?<seq2seq4repair_space>Needs<seq2seq4repair_space>to<seq2seq4repair_space>ask<seq2seq4repair_space>eclipse!" ) ; <END_BUG> } } public boolean hasAnnotation ( TypeX ofType ) { } public ResolvedTypeX [ ] getAnnotationTypes ( ) { } public PerClause getPerClause ( ) { } protected Collection getDeclares ( ) { } protected Collection getPrivilegedAccesses ( ) { } protected Collection getTypeMungers ( ) { } public boolean doesNotExposeShadowMungers ( ) { } }

Fix:
return ( ( binding . getAnnotationTagBits ( ) ) & ( TagBits . AnnotationRuntimeRetention ) ) != 0 ;
Buggy code:
public class QuizFactory { private static QuizFactory sharedInstance ; public static QuizFactory sharedInstance ( ) { } public Quiz retrieveQuiz ( int quizID ) { } private ArrayList < Question > retrieveQuestions ( int quizID ) { } public void insertQuiz ( Quiz quiz ) { DBConnection connection = new DBConnection ( ) ; <START_BUG> connection . insert ( ( ( ( ( ( ( ( ( ( ( ( "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>quizzes<seq2seq4repair_space>(name,<seq2seq4repair_space>description,<seq2seq4repair_space>creator,<seq2seq4repair_space>ordered,<seq2seq4repair_space>multi_page)<seq2seq4repair_space>" + "VALUES<seq2seq4repair_space>('" ) + ( quiz . getName ( ) ) ) + "',<seq2seq4repair_space>'" ) + ( quiz . getDescription ( ) ) ) + "',<seq2seq4repair_space>'" ) + ( quiz . getCreatorID ( ) ) ) + "',<seq2seq4repair_space>'" ) + ( quiz . isOrdered ( ) ) ) + "',<seq2seq4repair_space>'" ) + ( quiz . isMultipage ( ) ) ) + "')" ) ) ; <END_BUG> for ( Question q : quiz . getQuestions ( ) ) { QuestionFactory factory = QuestionFactory . sharedInstance ( ) ; factory . insertQuestion ( q ) ; } } }

Fix:
connection . insert ( ( ( ( ( ( ( ( ( ( ( ( "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>quizzes<seq2seq4repair_space>(name,<seq2seq4repair_space>description,<seq2seq4repair_space>creator,<seq2seq4repair_space>ordered,<seq2seq4repair_space>multi_page)<seq2seq4repair_space>" + "VALUES<seq2seq4repair_space>('" ) + ( quiz . getName ( ) ) ) + "',<seq2seq4repair_space>'" ) + ( quiz . getDescription ( ) ) ) + "',<seq2seq4repair_space>'" ) + ( quiz . getCreatorID ( ) ) ) + "',<seq2seq4repair_space>'" ) + ( quiz . isOrdered ( ) ? 1 : 0 ) ) + "',<seq2seq4repair_space>'" ) + ( quiz . isMultipage ( ) ? 1 : 0 ) ) + "')" ) ) ;
Buggy code:
public class MainActivity extends ActionBarActivity { private String mFileName = null ; private MediaRecorder mRec = null ; private MediaPlayer mPlay = null ; ToggleButton RecButton ; Button PlayButton ; Chronometer timer ; private boolean startPlay ; private ListView lv ; private ArrayAdapter < String > listAdapter ; private List < String > myList ; File file ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private void onRecord ( boolean start ) { } private void onPlay ( boolean start ) { } private void startPlaying ( ) { } private void stopPlaying ( ) { } private void startRecording ( ) { } private void stopRecording ( ) { } OnClickListener RecClick = new OnClickListener ( ) { boolean startRec = true ; @ Override public void onClick ( View v ) { } } ; OnClickListener PlayClick = new OnClickListener ( ) { @ Override public void onClick ( View v ) { } } ; private void CreateFile ( ) { Calendar now = Calendar . getInstance ( ) ; String ext = Integer . toString ( now . get ( Calendar . YEAR ) ) ; ext += Integer . toString ( now . get ( Calendar . MONTH ) ) ; ext += Integer . toString ( now . get ( Calendar . DATE ) ) ; ext += Integer . toString ( now . get ( Calendar . HOUR ) ) ; ext += Integer . toString ( now . get ( Calendar . MINUTE ) ) ; mFileName = Environment . getExternalStorageDirectory ( ) . getAbsolutePath ( ) ; <START_BUG> mFileName += ( "//Music" + ext ) + ".3gp" ; <END_BUG> } @ Override public void onPause ( ) { } @ Override public void onDestroy ( ) { } }

Fix:
mFileName += ( "//Music//" + ext ) + ".3gp" ;
Buggy code:
public class Common { public static ProgressDialog dialogLoading ; public static Context context ; public static void showHintDialog ( String title , String content ) { } public static void showLoading ( ) { } public static void showLoading ( String str ) { if ( ( Common . dialogLoading ) != null ) return ; if ( ( Common . context ) == null ) return ; Common . dialogLoading = new ProgressDialog ( Common . context ) ; Common . dialogLoading . setProgressStyle ( STYLE_SPINNER ) ; Common . dialogLoading . setMessage ( str ) ; Common . dialogLoading . setIndeterminate ( false ) ; <START_BUG> Common . dialogLoading . setCancelable ( true ) ; <END_BUG> Common . dialogLoading . setOnDismissListener ( Common . listenerDismissLoading ) ; Common . dialogLoading . show ( ) ; } static OnDismissListener listenerDismissLoading ; public static void cancelLoading ( ) { } No newline ; at end ; of file ; }

Fix:
Common . dialogLoading . setCancelable ( false ) ;
Buggy code:
public class ANTLR extends AbstractTask { private final ExecuteJava m_exe = new ExecuteJava ( ) ; private File m_outputDirectory ; private File m_target ; public void setDir ( final File dir ) { } public void setFork ( final boolean fork ) { } public void setOutputdirectory ( final File outputDirectory ) { } public void setTarget ( final File target ) { } public void addClasspath ( final Path path ) { <START_BUG> m_exe . getClassPath ( ) . addPath ( path ) ; <END_BUG> } public void addJvmarg ( final Argument argument ) { } public void execute ( ) throws TaskException { } protected void addClasspathEntry ( final String resource ) { } private File getGeneratedFile ( ) throws TaskException { } private void validateAttributes ( ) throws TaskException { } }

Fix:
m_exe . getClassPath ( ) . add ( path ) ;
Buggy code:
public class TitanBootstrapper extends BootstrapClient { private long _vertexId ; private long _edgeId ; private BatchGraph < TitanGraph > _batchGraph ; public TitanBootstrapper ( String configPath ) { } public void shutdown ( ) { } @ Override protected long createUsers ( ) { } @ Override protected long createSubscriptions ( ) { } @ Override protected long createPosts ( ) { long numTotalPosts = 0 ; Vertex vertex ; Map < String , Object > postProperties ; long tsLastPost = System . currentTimeMillis ( ) ; long nodeId ; for ( User user : _users . getUsers ( ) ) { long [ ] userPostNodes = user . getPostNodeIds ( ) ; for ( int iPost = 0 ; iPost < ( userPostNodes . length ) ; ++ iPost ) { postProperties = new HashMap < > ( ) ; postProperties . put ( PROP_PUBLISHED , tsLastPost ) ; postProperties . put ( PROP_MESSAGE , generatePostMessage ( 140 ) ) ; vertex = _batchGraph . addVertex ( ( ( _vertexId ) ++ ) , postProperties ) ; nodeId = ( ( long ) ( vertex . getId ( ) ) ) ; userPostNodes [ iPost ] = nodeId ; tsLastPost += 1 ; numTotalPosts += 1 ; } <START_BUG> _batchGraph . getVertex ( user . getId ( ) ) . setProperty ( PROP_LAST_STREAM_UDPATE , tsLastPost ) ; <END_BUG> } return numTotalPosts ; } @ Override protected long linkPosts ( ) { } private static boolean IS_SHUT_DOWN = false ; private static void shutdown ( TitanBootstrapper bootstrapClient ) { } public static void main ( String [ ] args ) throws IOException { } }

Fix:
_batchGraph . getVertex ( user . getNodeId ( ) ) . setProperty ( PROP_LAST_STREAM_UDPATE , tsLastPost ) ;
Buggy code:
public class BaseLayerTestCase extends AbstractTaskTestCase { @ Test public void baseLayerIsAlwaysInstalled ( ) throws Exception { tree ( env . getInstalledImage ( ) . getJbossHome ( ) ) ; InstalledIdentity installedIdentity = loadInstalledIdentity ( ) ; List < Layer > layers = installedIdentity . getLayers ( ) ; Assert . assertEquals ( 1 , layers . size ( ) ) ; Layer layer = layers . get ( 0 ) ; Assert . assertEquals ( PatchInfo . BASE , layer . getName ( ) ) ; PatchableTarget . TargetInfo targetInfo = layer . loadTargetInfo ( ) ; <START_BUG> Assert . assertEquals ( PatchInfo . BASE , targetInfo . getCumulativeID ( ) ) ; <END_BUG> Assert . assertTrue ( targetInfo . getPatchIDs ( ) . isEmpty ( ) ) ; DirectoryStructure directoryStructure = targetInfo . getDirectoryStructure ( ) ; Assert . assertEquals ( IoUtils . newFile ( env . getBundleRepositoryRoot ( ) , "system" , Constants . LAYERS , PatchInfo . BASE ) , directoryStructure . getBundleRepositoryRoot ( ) ) ; Assert . assertEquals ( IoUtils . newFile ( env . getModuleRoot ( ) , "system" , Constants . LAYERS , PatchInfo . BASE ) , directoryStructure . getModuleRoot ( ) ) ; } @ Test public void patchBase ( ) throws Exception { } }

Fix:
Assert . assertEquals ( PatchInfo . BASE , targetInfo . getReleasePatchID ( ) ) ;
Buggy code:
public class HTTPSampleResult extends SampleResult { private static final long serialVersionUID = 240L ; private String cookies = "" ; private String method ; private String redirectLocation ; private String queryString = "" ; private static final String HTTP_NO_CONTENT_CODE = Integer . toString ( HttpURLConnection . HTTP_NO_CONTENT ) ; private static final String HTTP_NO_CONTENT_MSG = "No<seq2seq4repair_space>Content" ; public HTTPSampleResult ( ) { } public HTTPSampleResult ( long elapsed ) { } public HTTPSampleResult ( HTTPSampleResult res ) { } public void setHTTPMethod ( String method ) { } public String getHTTPMethod ( ) { } public void setRedirectLocation ( String redirectLocation ) { } public String getRedirectLocation ( ) { } public boolean isRedirect ( ) { final String [ ] REDIRECT_CODES = new String [ ] { "301" , "302" , "303" } ; String code = getResponseCode ( ) ; for ( int i = 0 ; i < ( REDIRECT_CODES . length ) ; i ++ ) { if ( REDIRECT_CODES [ i ] . equals ( code ) ) { return true ; } } <START_BUG> if ( ( "307" . equals ( code ) ) && ( ( "GET" . equals ( getHTTPMethod ( ) ) ) || ( "HEAD" . equals ( getHTTPMethod ( ) ) ) ) ) { <END_BUG> return true ; } return false ; } @ Override public String getSamplerData ( ) { } public String getCookies ( ) { } public void setCookies ( String string ) { } public String getQueryString ( ) { } public void setQueryString ( String string ) { } @ Override public String getDataEncodingWithDefault ( ) { } public void setResponseNoContent ( ) { } }

Fix:
if ( ( "307" . equals ( code ) ) && ( ( GET . equals ( getHTTPMethod ( ) ) ) || ( HEAD . equals ( getHTTPMethod ( ) ) ) ) ) {
Buggy code:
public final class ThreadFactoryGroupNameUpdate extends AbstractThreadsSubsystemUpdate < Void > { private static final long serialVersionUID = 4253625376544201028L ; private final String name ; private final String newGroupName ; public ThreadFactoryGroupNameUpdate ( final String name , final String newGroupName ) { } public ThreadFactoryGroupNameUpdate getCompensatingUpdate ( final ThreadsSubsystemElement original ) { } protected < P > void applyUpdate ( final UpdateContext updateContext , final UpdateResultHandler < ? super Void , P > handler , final P param ) { <START_BUG> final ServiceController < ? > service = updateContext . getServiceContainer ( ) . getService ( Services . threadFactoryName ( name ) ) ; <END_BUG> if ( service == null ) { handler . handleFailure ( notConfigured ( ) , param ) ; } else { try { final ThreadFactoryService threadFactoryService = ( ( ThreadFactoryService ) ( service . getValue ( ) ) ) ; threadFactoryService . setThreadGroupName ( newGroupName ) ; handler . handleSuccess ( null , param ) ; } catch ( Throwable t ) { handler . handleFailure ( t , param ) ; } } } protected void applyUpdate ( final ThreadsSubsystemElement element ) throws UpdateFailedException { } public String getNewGroupName ( ) { } public String getName ( ) { } private UpdateFailedException notConfigured ( ) { } }

Fix:
final ServiceController < ? > service = updateContext . getServiceContainer ( ) . getService ( ThreadsServices . threadFactoryName ( name ) ) ;
Buggy code:
public class DeploymentAddHandler implements ModelAddOperationHandler , DescriptionProvider { public static final String OPERATION_NAME = ADD ; static final ModelNode getOperation ( ModelNode address , ModelNode state ) { } private static final List < String > CONTENT_ADDITION_PARAMETERS = Arrays . asList ( INPUT_STREAM_INDEX , BYTES , URL ) ; private final ContentRepository contentRepository ; private final boolean isMaster ; private final ParametersValidator validator = new ParametersValidator ( ) ; public DeploymentAddHandler ( final ContentRepository contentRepository , final boolean isMaster ) { } @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public OperationResult execute ( OperationContext context , ModelNode operation , ResultHandler resultHandler ) throws OperationFailedException { } private static InputStream getInputStream ( OperationContext context , ModelNode operation ) throws OperationFailedException { } private static boolean hasValidContentAdditionParameterDefined ( ModelNode operation ) { } private static OperationFailedException createFailureException ( String format , Object ... params ) { } private static OperationFailedException createFailureException ( Throwable cause , String format , Object ... params ) { } private static OperationFailedException createFailureException ( String msg ) { } private static OperationFailedException createFailureException ( Throwable cause , String msg ) { } private static void validateOnePieceOfContent ( final ModelNode content ) throws OperationFailedException { if ( ( content . asList ( ) . size ( ) ) != 1 ) <START_BUG> throw DeploymentAddHandler . createFailureException ( "Only<seq2seq4repair_space>1<seq2seq4repair_space>piece<seq2seq4repair_space>of<seq2seq4repair_space>content<seq2seq4repair_space>is<seq2seq4repair_space>current<seq2seq4repair_space>supported<seq2seq4repair_space>(JBAS-9020)" ) ; <END_BUG> } }

Fix:
throw DeploymentAddHandler . createFailureException ( "Only<seq2seq4repair_space>1<seq2seq4repair_space>piece<seq2seq4repair_space>of<seq2seq4repair_space>content<seq2seq4repair_space>is<seq2seq4repair_space>current<seq2seq4repair_space>supported<seq2seq4repair_space>(AS7-431" ) ;
Buggy code:
public class AccusationsByMeArrayAdapter extends BaseArrayAdapter < Accusation > { public AccusationsByMeArrayAdapter ( Context context , int resource , List < Accusation > accusations ) { } @ Override protected Date getDate ( Accusation obj ) { } @ Override protected String getReason ( Accusation obj ) { } @ Override protected String getAttribution ( Accusation accusation ) { <START_BUG> return String . format ( getContext ( ) . getString ( accusation_by_me_attribution_format ) , accusation . getAccusedDisplay ( ) ) ; <END_BUG> } }

Fix:
return String . format ( getContext ( ) . getString ( accused_format ) , accusation . getAccusedDisplay ( ) ) ;
Buggy code:
public class ServerGroupDeploymentAddHandler implements OperationStepHandler , DescriptionProvider { public static final String OPERATION_NAME = ADD ; static final ModelNode getOperation ( ModelNode address , ModelNode state ) { } private final HostFileRepository fileRepository ; public ServerGroupDeploymentAddHandler ( final HostFileRepository fileRepository ) { } @ Override public ModelNode getModelDescription ( Locale locale ) { } public void execute ( OperationContext context , ModelNode operation ) { final ModelNode opAddr = operation . get ( OP_ADDR ) ; PathAddress address = PathAddress . pathAddress ( opAddr ) ; String name = address . getLastElement ( ) . getValue ( ) ; <START_BUG> final Resource deploymentResource = context . getRootResource ( ) . navigate ( PathAddress . pathAddress ( PathElement . pathElement ( DEPLOYMENT , name ) ) ) ; <END_BUG> ModelNode deployment = deploymentResource . getModel ( ) ; for ( ModelNode content : deployment . require ( CONTENT ) . asList ( ) ) { if ( content . hasDefined ( HASH ) ) { byte [ ] hash = content . require ( HASH ) . asBytes ( ) ; fileRepository . getDeploymentFiles ( hash ) ; } } final String runtimeName = ( operation . hasDefined ( RUNTIME_NAME ) ) ? operation . get ( RUNTIME_NAME ) . asString ( ) : deployment . get ( RUNTIME_NAME ) . asString ( ) ; final Resource resource = context . createResource ( EMPTY_ADDRESS ) ; final ModelNode subModel = resource . getModel ( ) ; subModel . get ( NAME ) . set ( name ) ; subModel . get ( RUNTIME_NAME ) . set ( runtimeName ) ; subModel . get ( ENABLED ) . set ( ( ( operation . has ( ENABLED ) ) && ( operation . get ( ENABLED ) . asBoolean ( ) ) ) ) ; context . completeStep ( ) ; } }

Fix:
final Resource deploymentResource = context . readResourceFromRoot ( PathAddress . pathAddress ( PathElement . pathElement ( DEPLOYMENT , name ) ) ) ;
Buggy code:
public class GossipDigestSynVerbHandler implements IVerbHandler { private static Logger logger_ = LoggerFactory . getLogger ( GossipDigestSynVerbHandler . class ) ; public void doVerb ( Message message ) { InetAddress from = message . getFrom ( ) ; if ( GossipDigestSynVerbHandler . logger_ . isTraceEnabled ( ) ) GossipDigestSynVerbHandler . logger_ . trace ( "Received<seq2seq4repair_space>a<seq2seq4repair_space>GossipDigestSynMessage<seq2seq4repair_space>from<seq2seq4repair_space>{}" , from ) ; if ( ! ( instance . isEnabled ( ) ) ) { if ( GossipDigestSynVerbHandler . logger_ . isTraceEnabled ( ) ) GossipDigestSynVerbHandler . logger_ . trace ( "Ignoring<seq2seq4repair_space>GossipDigestSynMessage<seq2seq4repair_space>because<seq2seq4repair_space>gossip<seq2seq4repair_space>is<seq2seq4repair_space>disabled" ) ; return ; } byte [ ] bytes = message . getMessageBody ( ) ; DataInputStream dis = new DataInputStream ( new ByteArrayInputStream ( bytes ) ) ; try { GossipDigestSynMessage gDigestMessage = GossipDigestSynMessage . serializer ( ) . deserialize ( dis ) ; if ( ! ( gDigestMessage . clusterId_ . equals ( DatabaseDescriptor . getClusterName ( ) ) ) ) { GossipDigestSynVerbHandler . logger_ . warn ( ( ( ( ( ( "ClusterName<seq2seq4repair_space>mismatch<seq2seq4repair_space>from<seq2seq4repair_space>" + from ) + "<seq2seq4repair_space>" ) + ( gDigestMessage . clusterId_ ) ) + "!=" ) + ( DatabaseDescriptor . getClusterName ( ) ) ) ) ; return ; } List < GossipDigest > gDigestList = gDigestMessage . getGossipDigests ( ) ; if ( GossipDigestSynVerbHandler . logger_ . isTraceEnabled ( ) ) { StringBuilder sb = new StringBuilder ( ) ; for ( GossipDigest gDigest : gDigestList ) { sb . append ( gDigest ) ; sb . append ( "<seq2seq4repair_space>" ) ; } GossipDigestSynVerbHandler . logger_ . trace ( ( "Gossip<seq2seq4repair_space>syn<seq2seq4repair_space>digests<seq2seq4repair_space>are<seq2seq4repair_space>:<seq2seq4repair_space>" + ( sb . toString ( ) ) ) ) ; } instance . notifyFailureDetector ( gDigestList ) ; doSort ( gDigestList ) ; List < GossipDigest > deltaGossipDigestList = new ArrayList < GossipDigest > ( ) ; Map < InetAddress , EndpointState > deltaEpStateMap = new HashMap < InetAddress , EndpointState > ( ) ; instance . examineGossiper ( gDigestList , deltaGossipDigestList , deltaEpStateMap ) ; GossipDigestAckMessage gDigestAck = new GossipDigestAckMessage ( deltaGossipDigestList , deltaEpStateMap ) ; <START_BUG> Message gDigestAckMessage = instance . makeGossipDigestAckMessage ( gDigestAck ) ; <END_BUG> if ( GossipDigestSynVerbHandler . logger_ . isTraceEnabled ( ) ) GossipDigestSynVerbHandler . logger_ . trace ( "Sending<seq2seq4repair_space>a<seq2seq4repair_space>GossipDigestAckMessage<seq2seq4repair_space>to<seq2seq4repair_space>{}" , from ) ; MessagingService . instance ( ) . sendOneWay ( gDigestAckMessage , from ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } private void doSort ( List < GossipDigest > gDigestList ) { } }

Fix:
Message gDigestAckMessage = instance . makeGossipDigestAckMessage ( gDigestAck , message . getVersion ( ) ) ;
Buggy code:
public class Database extends SQLiteOpenHelper { private static final int DB_VERSION = 1 ; private static final String DB_NAME = "database.db" ; private Context context ; private HashMap < Integer , String > categories ; public Database ( Context context ) { } @ Override public void onCreate ( SQLiteDatabase db ) { } @ Override public void onUpgrade ( SQLiteDatabase db , int oldVersion , int newVersion ) { } private void executeSQLScript ( SQLiteDatabase database , String dbname ) { } private void initCategories ( ) { } public void showTuples ( ) { } public Cursor getAllESubstances ( ) { <START_BUG> return getReadableDatabase ( ) . rawQuery ( ( "SELECT<seq2seq4repair_space>*<seq2seq4repair_space>" + ( "<seq2seq4repair_space>FROM<seq2seq4repair_space>" + "esubstances" ) ) , null ) ; <END_BUG> } public Cursor getAllEsubstancesDependOnNumber ( String number ) { } public ESubstanceItem getESubstanceItemById ( int id ) { } public Cursor getAllDiseases ( ) { } public Cursor getAllDiseasesDependOnName ( String name ) { } public ArrayList < DiseaseItem > getDiseaseBasedOnName ( String name ) { } public ArrayList < String > getAllCategories ( ) { } public ArrayList < String > getAllDiseasesBasedOnCategories ( String nameOfCategory ) { } }

Fix:
return getReadableDatabase ( ) . rawQuery ( ( "SELECT<seq2seq4repair_space>*<seq2seq4repair_space>" + ( "<seq2seq4repair_space>FROM<seq2seq4repair_space>" + "esubstances<seq2seq4repair_space>ORDER<seq2seq4repair_space>BY<seq2seq4repair_space>name" ) ) , null ) ;
Buggy code:
public class ResourceReference implements Serializable { private static final long serialVersionUID = 1L ; protected Locale locale ; private final String name ; private transient Resource resource ; private final Class scope ; private String style ; public ResourceReference ( final Class scope , final String name ) { } public ResourceReference ( final String name ) { } public final void bind ( final Application application ) { } public final Locale getLocale ( ) { } public final String getName ( ) { } public final String getSharedResourceKey ( ) { Application application = Application . get ( ) ; bind ( application ) ; <START_BUG> return SharedResources . path ( application , scope , name , locale , style ) ; <END_BUG> } public final Resource getResource ( ) { } public final Class getScope ( ) { } public final String getStyle ( ) { } public final void invalidate ( ) { } public final void setLocale ( Locale locale ) { } public final void setStyle ( String style ) { } public String toString ( ) { } protected Resource newResource ( ) { } }

Fix:
return SharedResources . resourceKey ( application , scope , name , locale , style ) ;
Buggy code:
public class CliClient { private Client thriftClient_ = null ; private CliSessionState css_ = null ; public CliClient ( CliSessionState css , Cassandra . Client thriftClient ) { } public void executeCLIStmt ( String stmt ) throws InvalidRequestException , NotFoundException , TException , UnavailableException { } private void printCmdHelp ( ) { } private void cleanupAndExit ( ) { } private void executeGet ( CommonTree ast ) throws InvalidRequestException , NotFoundException , TException { } private void executeSet ( CommonTree ast ) throws InvalidRequestException , TException , UnavailableException { if ( ! ( CliMain . isConnected ( ) ) ) return ; int childCount = ast . getChildCount ( ) ; assert childCount == 2 ; CommonTree columnFamilySpec = ( ( CommonTree ) ( ast . getChild ( 0 ) ) ) ; assert ( columnFamilySpec . getType ( ) ) == ( CliParser . NODE_COLUMN_ACCESS ) ; String tableName = CliCompiler . getTableName ( columnFamilySpec ) ; String key = CliCompiler . getKey ( columnFamilySpec ) ; String columnFamily = CliCompiler . getColumnFamily ( columnFamilySpec ) ; int columnSpecCnt = CliCompiler . numColumnSpecifiers ( columnFamilySpec ) ; String value = Utils . unescapeSQLString ( ast . getChild ( 1 ) . getText ( ) ) ; if ( columnSpecCnt == 1 ) { String columnName = CliCompiler . getColumn ( columnFamilySpec , 0 ) ; <START_BUG> thriftClient_ . insert ( tableName , key , ( ( columnFamily + ":" ) + columnName ) , value . getBytes ( ) , System . currentTimeMillis ( ) , true ) ; <END_BUG> css_ . out . println ( "Value<seq2seq4repair_space>inserted." ) ; } else { assert false ; } } private void executeShowProperty ( CommonTree ast , String propertyName ) throws TException { } private void executeShowTables ( CommonTree ast ) throws TException { } private void executeDescribeTable ( CommonTree ast ) throws TException { } private void executeConnect ( CommonTree ast ) throws TException { } public void executeQueryOnServer ( String query ) throws TException { } }

Fix:
thriftClient_ . insert ( tableName , key , ( ( columnFamily + ":" ) + columnName ) , value . getBytes ( ) , System . currentTimeMillis ( ) , 1 ) ;
Buggy code:
public class ManifestTest extends BuildFileTest { public static final String EXPANDED_MANIFEST = "src//etc//testcases//taskdefs//manifests//META-INF//MANIFEST.MF" ; public static final String LONG_LINE = "AReallyLongLineToTestLineBreakingInManifests-ACapabilityWhich" + ( ( "IsSureToLeadToHundredsOfQuestionsAboutWhyAntMungesManifests" + "OfCourseTheAnswerIsThatIsWhatTheSpecRequiresAndIfAnythingHas" ) + "AProblemWithThatItIsNotABugInAnt" ) ; public static final String LONG_70_NAME = "ThisNameIsJustSeventyCharactersWhichIsAllowedAccordingToTheSpecsFiller" ; public static final String LONG_68_NAME = "ThisNameIsJustSixtyEightCharactersWhichIsAllowedAccordingToTheSpecsX" ; public static final String NOT_LONG_NAME = "NameIsJustUnderSeventyCharactersWhichIsAllowedAccordingTheSpec" ; public static final String VALUE = "NOT_LONG" ; public ManifestTest ( String name ) { } public void setUp ( ) { } public void tearDown ( ) { } public void test1 ( ) throws IOException , ManifestException { } public void test2 ( ) throws IOException , ManifestException { } public void test3 ( ) { } public void test4 ( ) { } public void test5 ( ) { } public void test6 ( ) { } public void test7 ( ) { } public void test8 ( ) throws IOException , ManifestException { } public void test9 ( ) { } public void test10 ( ) { } public void test11 ( ) { } public void test12 ( ) { } public void test13 ( ) { } public void test14 ( ) throws IOException , ManifestException { } public void testLongLine ( ) throws IOException , ManifestException { } public void testOrder1 ( ) throws IOException , ManifestException { } public void testOrder2 ( ) throws IOException , ManifestException { } public void testNoFile ( ) { } public void testReplace ( ) throws IOException , ManifestException { } public void testUpdate ( ) throws IOException , ManifestException { } public void testFrom ( ) { } public void testIllegalName ( ) { } public void testIllegalNameInSection ( ) { } public void testIllegalNameBegin ( ) { <START_BUG> expectBuildException ( "testIllegalNameInSection" , "Manifest<seq2seq4repair_space>attribute<seq2seq4repair_space>names<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>contain<seq2seq4repair_space>'-'<seq2seq4repair_space>at<seq2seq4repair_space>the<seq2seq4repair_space>begin." ) ; <END_BUG> } public void testIllegalName2 ( ) { } public void testIllegalName3 ( ) { } private Manifest getManifest ( String filename ) throws IOException , ManifestException { } }

Fix:
expectBuildException ( "testIllegalNameInSection" , "Manifest<seq2seq4repair_space>attribute<seq2seq4repair_space>names<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>start<seq2seq4repair_space>with<seq2seq4repair_space>'-'<seq2seq4repair_space>at<seq2seq4repair_space>the<seq2seq4repair_space>begin." ) ;
Buggy code:
public class DataSourceDisable implements OperationStepHandler { static final DataSourceDisable INSTANCE = new DataSourceDisable ( ) ; public static final Logger log = Logger . getLogger ( "org.jboss.as.connector.subsystems.datasources" ) ; public void execute ( OperationContext context , ModelNode operation ) { final ModelNode model = context . readResourceForUpdate ( EMPTY_ADDRESS ) . getModel ( ) ; model . get ( ENABLED ) . set ( false ) ; if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { context . addStep ( new OperationStepHandler ( ) { public void execute ( final OperationContext context , ModelNode operation ) throws OperationFailedException { final String jndiName = Util . getJndiName ( model ) ; final ServiceRegistry registry = context . getServiceRegistry ( true ) ; final ServiceName dataSourceServiceName = SERVICE_NAME_BASE . append ( jndiName ) ; final ServiceController < ? > dataSourceController = registry . getService ( dataSourceServiceName ) ; if ( dataSourceController != null ) { if ( UP . equals ( dataSourceController . getState ( ) ) ) { dataSourceController . setMode ( NEVER ) ; } else { throw new OperationFailedException ( new ModelNode ( ) . set ( ( ( "Data-source<seq2seq4repair_space>service<seq2seq4repair_space>[" + jndiName ) + "]<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>enabled" ) ) ) ; } } else { throw new OperationFailedException ( new ModelNode ( ) . set ( ( ( "Data-source<seq2seq4repair_space>service<seq2seq4repair_space>[" + jndiName ) + "]<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>available" ) ) ) ; } final ServiceName referenceServiceName = DataSourceReferenceFactoryService . SERVICE_NAME_BASE . append ( jndiName ) ; final ServiceController < ? > referenceController = registry . getService ( referenceServiceName ) ; if ( ( referenceController != null ) && ( UP . equals ( referenceController . getState ( ) ) ) ) { referenceController . setMode ( NEVER ) ; } <START_BUG> final ServiceName binderServiceName = Util . getBinderServiceName ( jndiName ) ; <END_BUG> final ServiceController < ? > binderController = registry . getService ( binderServiceName ) ; if ( ( binderController != null ) && ( UP . equals ( binderController . getState ( ) ) ) ) { binderController . setMode ( NEVER ) ; } context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
final ServiceName binderServiceName = ContextNames . bindInfoFor ( jndiName ) . getBinderServiceName ( ) ;
Buggy code:
public class EvalTag extends HtmlEscapingAwareTag { private final ExpressionParser expressionParser = new SpelExpressionParser ( ) ; private EvaluationContext evaluationContext ; private Expression expression ; private String var ; private int scope = PageContext . PAGE_SCOPE ; private boolean javaScriptEscape = false ; @ Override public void setPageContext ( PageContext pageContext ) { } public void setExpression ( String expression ) { } public void setVar ( String var ) { } public void setScope ( String scope ) { } public void setJavaScriptEscape ( String javaScriptEscape ) throws JspException { } @ Override public int doStartTagInternal ( ) throws JspException { } @ Override public int doEndTag ( ) throws JspException { } private EvaluationContext createEvaluationContext ( PageContext pageContext ) { } private ConversionService getConversionService ( PageContext pageContext ) { } private static class JspPropertyAccessor implements PropertyAccessor { private final PageContext pageContext ; public JspPropertyAccessor ( PageContext pageContext ) { } public Class < ? > [ ] getSpecificTargetClasses ( ) { } public boolean canRead ( EvaluationContext context , Object target , String name ) throws AccessException { <START_BUG> return ( ( resolveImplicitVariable ( name ) ) != null ) || ( ( this . pageContext . findAttribute ( name ) ) != null ) ; <END_BUG> } public TypedValue read ( EvaluationContext context , Object target , String name ) throws AccessException { } public boolean canWrite ( EvaluationContext context , Object target , String name ) { } public void write ( EvaluationContext context , Object target , String name , Object newValue ) { } private Object resolveImplicitVariable ( String name ) throws AccessException { } } }

Fix:
return ( target == null ) && ( ( ( resolveImplicitVariable ( name ) ) != null ) || ( ( this . pageContext . findAttribute ( name ) ) != null ) ) ;
Buggy code:
public class RangeSliceCommand implements MessageProducer { private static final RangeSliceCommandSerializer serializer = new RangeSliceCommandSerializer ( ) ; public final String keyspace ; public final String column_family ; public final ByteBuffer super_column ; public final SlicePredicate predicate ; public final AbstractBounds range ; public final int max_keys ; public RangeSliceCommand ( String keyspace , ColumnParent column_parent , SlicePredicate predicate , AbstractBounds range , int max_keys ) { } public RangeSliceCommand ( String keyspace , String column_family , ByteBuffer super_column , SlicePredicate predicate , AbstractBounds range , int max_keys ) { } <START_BUG> public Message getMessage ( int version ) throws IOException { <END_BUG> DataOutputBuffer dob = new DataOutputBuffer ( ) ; RangeSliceCommand . serializer . serialize ( this , dob , version ) ; return new Message ( FBUtilities . getLocalAddress ( ) , Verb . RANGE_SLICE , Arrays . copyOf ( dob . getData ( ) , dob . getLength ( ) ) , version ) ; } @ Override public String toString ( ) { } public static RangeSliceCommand read ( Message message ) throws IOException { } }

Fix:
public Message getMessage ( Integer version ) throws IOException {
Buggy code:
public class TabbedPanel extends Panel { private static final long serialVersionUID = 1L ; public static final String TAB_PANEL_ID = "panel" ; private List tabs ; public TabbedPanel ( MarkupContainer parent , final String id , List tabs ) { } protected WebMarkupContainer newLink ( MarkupContainer parent , String linkId , final int index ) { } public final void setSelectedTab ( int index ) { if ( ( index < 0 ) || ( index >= ( tabs . size ( ) ) ) ) { throw new IndexOutOfBoundsException ( ) ; } setModelObject ( new Integer ( index ) ) ; ITab tab = ( ( ITab ) ( tabs . get ( index ) ) ) ; Panel panel = tab . getPanel ( this , TabbedPanel . TAB_PANEL_ID ) ; if ( panel == null ) { throw new wicket . WicketRuntimeException ( ( ( ( ( "ITab.getPanel()<seq2seq4repair_space>returned<seq2seq4repair_space>null.<seq2seq4repair_space>TabbedPanel<seq2seq4repair_space>[" + ( getPath ( ) ) ) + "]<seq2seq4repair_space>ITab<seq2seq4repair_space>index<seq2seq4repair_space>[" ) + index ) + "]" ) ) ; } if ( ! ( panel . getId ( ) . equals ( TabbedPanel . TAB_PANEL_ID ) ) ) { throw new wicket . WicketRuntimeException ( ( ( ( ( ( ( "ITab.getPanel()<seq2seq4repair_space>returned<seq2seq4repair_space>a<seq2seq4repair_space>panel<seq2seq4repair_space>with<seq2seq4repair_space>invalid<seq2seq4repair_space>id<seq2seq4repair_space>[" + ( panel . getId ( ) ) ) + "].<seq2seq4repair_space>You<seq2seq4repair_space>must<seq2seq4repair_space>always<seq2seq4repair_space>return<seq2seq4repair_space>a<seq2seq4repair_space>panel<seq2seq4repair_space>with<seq2seq4repair_space>id<seq2seq4repair_space>equal<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>provided<seq2seq4repair_space>panelId<seq2seq4repair_space>parameter.<seq2seq4repair_space>TabbedPanel<seq2seq4repair_space>[" ) + ( getPath ( ) ) ) + "]<seq2seq4repair_space>ITab<seq2seq4repair_space>index<seq2seq4repair_space>[" ) + index ) + "]" ) ) ; } <START_BUG> panel . reattach ( ) ; <END_BUG> } public final int getSelectedTab ( ) { } }

Fix:
panel . reAttach ( ) ;
Buggy code:
public interface IDataProvider < T > extends IDetachable { Iterator < T > iterator ( int first , int count ) { } int size ( ) { } <START_BUG> IModel < T > model ( Object object ) ; <END_BUG> }

Fix:
IModel < T > model ( T object ) ;
Buggy code:
class PreparedStatementManagerImpl implements PreparedStatementManager { private static final Localizer _loc = Localizer . forPackage ( PreparedStatementManagerImpl . class ) ; private final JDBCStore _store ; private final Connection _conn ; private final DBDictionary _dict ; private final Collection _exceptions = new LinkedList ( ) ; public PreparedStatementManagerImpl ( JDBCStore store , Connection conn ) { } public Collection getExceptions ( ) { } public void flush ( RowImpl row ) { } private void flushInternal ( RowImpl row ) throws SQLException { Column [ ] autoAssign = null ; if ( ( row . getAction ( ) ) == ( Row . ACTION_INSERT ) ) autoAssign = row . getTable ( ) . getAutoAssignedColumns ( ) ; String sql = row . getSQL ( _dict ) ; PreparedStatement stmnt = _conn . prepareStatement ( sql ) ; row . flush ( stmnt , _dict , _store ) ; try { int count = stmnt . executeUpdate ( ) ; if ( count != 1 ) { Object failed = row . getFailedObject ( ) ; if ( failed != null ) _exceptions . add ( new OptimisticException ( failed ) ) ; else if ( ( row . getAction ( ) ) == ( Row . ACTION_INSERT ) ) <START_BUG> throw new SQLException ( PreparedStatementManagerImpl . _loc . get ( "update-failed-no-failed-obj" , String . valueOf ( count ) , sql ) ) ; <END_BUG> } } catch ( SQLException se ) { throw SQLExceptions . getStore ( se , row . getFailedObject ( ) , _dict ) ; } finally { try { stmnt . close ( ) ; } catch ( SQLException se ) { } } if ( ( ( autoAssign != null ) && ( ( autoAssign . length ) > 0 ) ) && ( ( row . getPrimaryKey ( ) ) != null ) ) { OpenJPAStateManager sm = row . getPrimaryKey ( ) ; ClassMapping mapping = ( ( ClassMapping ) ( sm . getMetaData ( ) ) ) ; Object val ; for ( int i = 0 ; i < ( autoAssign . length ) ; i ++ ) { val = _dict . getGeneratedKey ( autoAssign [ i ] , _conn ) ; mapping . assertJoinable ( autoAssign [ i ] ) . setAutoAssignedValue ( sm , _store , autoAssign [ i ] , val ) ; } } } public void flush ( ) { } }

Fix:
throw new SQLException ( PreparedStatementManagerImpl . _loc . get ( "update-failed-no-failed-obj" , String . valueOf ( count ) , sql ) . getMessage ( ) ) ;
Buggy code:
public class Domain extends DefaultCommand implements Primitive { private OWLExtension extension = null ; public void setExtension ( OWLExtension extension ) { } @ Override public Syntax getSyntax ( ) { } @ Override public String getAgentClassString ( ) { } @ Override public void perform ( Argument [ ] args , Context context ) throws ExtensionException , LogoException { if ( ( extension ) == null ) { throw new ExtensionException ( "Bug:<seq2seq4repair_space>Extension<seq2seq4repair_space>not<seq2seq4repair_space>initialised<seq2seq4repair_space>properly<seq2seq4repair_space>(NetLogo//OWL<seq2seq4repair_space>extension<seq2seq4repair_space>fault)" ) ; } if ( ( extension . getModelIRI ( ) ) != null ) { throw new ExtensionException ( "You<seq2seq4repair_space>must<seq2seq4repair_space>declare<seq2seq4repair_space>owl:domain<seq2seq4repair_space>before<seq2seq4repair_space>declaring<seq2seq4repair_space>the<seq2seq4repair_space>owl:model<seq2seq4repair_space>IRI" ) ; } String link = args [ 0 ] . getString ( ) . toUpperCase ( ) ; String breed = args [ 1 ] . getString ( ) . toUpperCase ( ) ; Program program = context . getAgent ( ) . world ( ) . program ( ) ; if ( ( ( ( program . linkBreeds ( ) . size ( ) ) > 0 ) && ( ! ( program . linkBreeds ( ) . containsKey ( link ) ) ) ) || ( ( ( ( program . linkBreeds ( ) . size ( ) ) == 0 ) && ( ! ( link . equals ( "LINKS" ) ) ) ) && ( ! ( link . equalsIgnoreCase ( LOCATION_PROPERTY ) ) ) ) ) { throw new ExtensionException ( ( ( "No<seq2seq4repair_space>such<seq2seq4repair_space>link<seq2seq4repair_space>breed<seq2seq4repair_space>as<seq2seq4repair_space>\"" + link ) + "\"" ) ) ; } if ( ( ( ( program . breeds ( ) . size ( ) ) > 0 ) && ( ! ( program . breeds ( ) . containsKey ( breed ) ) ) ) || ( ( ( program . breeds ( ) . size ( ) ) == 0 ) && ( ! ( breed . equals ( "TURTLES" ) ) ) ) ) { <START_BUG> throw new ExtensionException ( ( ( "No<seq2seq4repair_space>such<seq2seq4repair_space>breed<seq2seq4repair_space>as<seq2seq4repair_space>\"" + link ) + "\"" ) ) ; <END_BUG> } extension . setDomain ( link , breed ) ; } }

Fix:
throw new ExtensionException ( ( ( "No<seq2seq4repair_space>such<seq2seq4repair_space>breed<seq2seq4repair_space>as<seq2seq4repair_space>\"" + breed ) + "\"" ) ) ;
Buggy code:
public class CombatSystem extends EntitySystem { private ComponentMapper < CCombat > cm = ComponentMapper . getFor ( CCombat . class ) ; private ComponentMapper < CPhysics > pm = ComponentMapper . getFor ( CPhysics . class ) ; private ImmutableArray < Entity > entities ; @ Override public void addedToEngine ( Engine engine ) { } @ Override public void update ( float deltaTime ) { for ( int i = 0 ; i < ( entities . size ( ) ) ; i ++ ) { Entity e = entities . get ( i ) ; CCombat combat = cm . get ( e ) ; CPhysics obj = pm . get ( e ) ; if ( ( combat . swingCdCounter ) > 0 ) { combat . swingCdCounter -= deltaTime ; } if ( ( combat . swingCdCounter ) > 0 ) { <START_BUG> return ; <END_BUG> } combat . getSwing ( ) . setZero ( ) ; if ( combat . inputs . get ( LEFT ) ) { combat . getSwing ( ) . add ( ( - 1 ) , 0 ) ; } if ( combat . inputs . get ( RIGHT ) ) { combat . getSwing ( ) . add ( 1 , 0 ) ; } if ( combat . inputs . get ( UP ) ) { combat . getSwing ( ) . add ( 0 , 1 ) ; } if ( combat . inputs . get ( DOWN ) ) { combat . getSwing ( ) . add ( 0 , ( - 1 ) ) ; } if ( ( ! ( combat . getSwing ( ) . isZero ( ) ) ) && ( ( combat . swingCdCounter ) <= 0 ) ) { Vector2 pos = obj . getPosition ( ) . cpy ( ) ; if ( ( combat . getSwingDirection ( ) ) == ( Direction . LEFT ) ) { pos . add ( ( ( - ( combat . getSwingSize ( ) . x ) ) // 2 ) , 0 ) ; } else if ( ( combat . getSwingDirection ( ) ) == ( Direction . RIGHT ) ) { pos . add ( ( ( combat . getSwingSize ( ) . x ) // 2 ) , 0 ) ; } else if ( ( combat . getSwingDirection ( ) ) == ( Direction . UP ) ) { pos . add ( 0 , combat . getSwingSize ( ) . y ) ; } else if ( ( combat . getSwingDirection ( ) ) == ( Direction . DOWN ) ) { pos . add ( 0 , ( ( ( - ( combat . getSwingSize ( ) . y ) ) // 3 ) * 2 ) ) ; } createSwingHitbox ( e , pos ) ; combat . swingCdCounter = combat . getSwingDuration ( ) ; } } } public void createSwingHitbox ( Entity source , Vector2 position ) { } public void updateEntities ( Engine engine ) { } public static void dealDamage ( Entity source , Entity target , int damage ) { } public static void killEntity ( Entity source , Entity target , int damage ) { } }

Fix:
continue ;
Buggy code:
@ Repository @ SuppressWarnings ( "unchecked" ) @ Transactional public class TryDao extends BaseDao { @ Autowired protected SessionData data ; @ Autowired private RemindDao remindDao ; public Try create ( Ticket ticket , int examId , int num , int attemptNum ) { Try someTry = new Try ( ) ; <START_BUG> someTry . setShortText ( HtmlUtils . getShortText ( ticket . getQuestions ( ) , 100 ) ) ; <END_BUG> someTry . setUser ( data . getUser ( ) . getId ( ) ) ; someTry . setCorrect ( false ) ; someTry . setDone ( false ) ; someTry . setExam ( examId ) ; someTry . setTicket ( ticket . getId ( ) ) ; someTry . setPathToSection ( ticket . getPath ( ) ) ; someTry . setNum ( num ) ; someTry . setAttemptNum ( attemptNum ) ; int id = ( ( int ) ( getSess ( ) . save ( someTry ) ) ) ; someTry . setId ( id ) ; return someTry ; } public Try createNextAttempt ( Try lastTry , int num ) { } public List < Try > getTriesFromExam ( int examId ) { } public Try getTry ( int id ) { } public void updateTry ( Try someTry ) { } public Try getTempTry ( int examId ) { } No newline ; at end ; of file ; }

Fix:
someTry . setShortText ( HtmlUtils . getEscapedShortText ( ticket . getQuestions ( ) , 100 ) ) ;
Buggy code:
public class SecurityUrlAuthenticationSuccessHandler implements AuthenticationSuccessHandler { protected Logger logger = Logger . getLogger ( SecurityUrlAuthenticationSuccessHandler . class . getName ( ) ) ; private RedirectStrategy redirectStrategy = new DefaultRedirectStrategy ( ) ; @ Override public void onAuthenticationSuccess ( HttpServletRequest request , HttpServletResponse response , Authentication authentication ) throws IOException { } protected void handle ( HttpServletRequest request , HttpServletResponse response , Authentication authentication ) throws IOException { } protected String determineTargetUrl ( Authentication authentication ) { boolean isUser = false ; boolean isAdmin = false ; Collection < ? extends GrantedAuthority > authorities = authentication . getAuthorities ( ) ; for ( GrantedAuthority grantedAuthority : authorities ) { if ( grantedAuthority . getAuthority ( ) . equals ( "ROLE_USER" ) ) { isUser = true ; break ; } else if ( grantedAuthority . getAuthority ( ) . equals ( "ROLE_ADMIN" ) ) { isAdmin = true ; break ; } } if ( isUser ) { <START_BUG> return "//loggedPage.html" ; <END_BUG> } else if ( isAdmin ) { return "//console.html" ; } else { throw new IllegalStateException ( ) ; } } protected void clearAuthenticationAttributes ( HttpServletRequest request ) { } public void setRedirectStrategy ( RedirectStrategy redirectStrategy ) { } protected RedirectStrategy getRedirectStrategy ( ) { } }

Fix:
return "//pages//loggedPage.html" ;
Buggy code:
@ MojoGoal ( "keygen" ) @ MojoPhase ( "initialize" ) public final class KeygenMojo extends AbstractMojo { @ MojoParameter ( expression = "${project}" , required = true , readonly = true , description = "Maven<seq2seq4repair_space>project" ) private transient MavenProject project ; @ MojoParameter ( defaultValue = "false" , required = false , description = "Skips<seq2seq4repair_space>execution" ) private transient boolean skip ; @ MojoParameter ( defaultValue = "${project.build.directory}//keystore.jks" , required = false , description = "Name<seq2seq4repair_space>of<seq2seq4repair_space>keystore.jks<seq2seq4repair_space>file" ) private transient File keystore ; @ MojoParameter ( defaultValue = "${project.build.directory}//cacerts.jks" , required = false , description = "Name<seq2seq4repair_space>of<seq2seq4repair_space>cacerts.jks<seq2seq4repair_space>file" ) private transient File cacerts ; public void setSkip ( final boolean skp ) { } @ Override public void execute ( ) throws MojoFailureException { StaticLoggerBinder . getSingleton ( ) . setMavenLog ( this . getLog ( ) ) ; if ( this . skip ) { Logger . info ( this , "execution<seq2seq4repair_space>skipped<seq2seq4repair_space>because<seq2seq4repair_space>of<seq2seq4repair_space>'skip'<seq2seq4repair_space>option" ) ; return ; } final Keystore store = new Keystore ( DigestUtils . md5Hex ( this . getClass ( ) . getName ( ) ) ) ; if ( ! ( store . isActive ( ) ) ) { try { store . activate ( this . keystore ) ; <START_BUG> Cacerts truststore = new Cacerts ( this . cacerts ) ; <END_BUG> truststore . imprt ( ) ; truststore . populate ( this . project . getProperties ( ) ) ; } catch ( final IOException ex ) { throw new IllegalStateException ( ex ) ; } } store . populate ( this . project . getProperties ( ) ) ; Logger . info ( this , "Keystore<seq2seq4repair_space>is<seq2seq4repair_space>active:<seq2seq4repair_space>%s" , store ) ; } }

Fix:
final Cacerts truststore = new Cacerts ( this . cacerts ) ;
Buggy code:
public class SimpleAttributeModifier extends AbstractBehavior { private static final long serialVersionUID = 1L ; private String attribute ; private CharSequence value ; public SimpleAttributeModifier ( final String attribute , final CharSequence value ) { } public void onComponentTag ( final Component component , final ComponentTag tag ) { <START_BUG> if ( isEnabled ( ) ) { <END_BUG> tag . getAttributes ( ) . put ( attribute , value ) ; } } }

Fix:
if ( isEnabled ( component ) ) {