nus-yam/ex-repair huggingface dataset:
Buggy code:
public class SendMailSSL { public AuthMe plugin ; public SendMailSSL ( AuthMe plugin ) { } public void main ( final PlayerAuth auth , final String newPass ) { String sendername ; if ( ( getmailSenderName . isEmpty ( ) ) || ( ( Settings . getmailSenderName ) == null ) ) { sendername = Settings . getmailAccount ; } else { sendername = Settings . getmailSenderName ; } final String sender = sendername ; final String port = String . valueOf ( getMailPort ) ; final String acc = Settings . getmailAccount ; final String subject = Settings . getMailSubject ; final String smtp = Settings . getmailSMTP ; final String password = Settings . getmailPassword ; final String mailText = getMailText . replace ( "<playername>" , auth . getNickname ( ) ) . replace ( "<servername>" , plugin . getServer ( ) . getServerName ( ) ) . replace ( "<generatedpass>" , newPass ) ; final String mail = auth . getEmail ( ) ; Bukkit . getScheduler ( ) . runTaskAsynchronously ( plugin , new Runnable ( ) { @ Override public void run ( ) { try { Properties props = new Properties ( ) ; props . put ( "mail.smtp.host" , smtp ) ; props . put ( "mail.smtp.auth" , "true" ) ; props . put ( "mail.smtp.port" , port ) ; props . put ( "mail.smtp.starttls.enable" , true ) ; Session session = Session . getInstance ( props , null ) ; Message message = new javax . mail . internet . MimeMessage ( session ) ; try { message . setFrom ( new InternetAddress ( acc , sender ) ) ; } catch ( UnsupportedEncodingException uee ) { message . setFrom ( new InternetAddress ( acc ) ) ; } message . setRecipients ( TO , InternetAddress . parse ( mail ) ) ; message . setSubject ( subject ) ; message . setSentDate ( new Date ( ) ) ; BodyPart messageBodyPart = new MimeBodyPart ( ) ; messageBodyPart . setText ( mailText ) ; Multipart multipart = new MimeMultipart ( ) ; multipart . addBodyPart ( messageBodyPart ) ; File file = null ; if ( Settings . generateImage ) { <START_BUG> ImageGenerator gen = new ImageGenerator ( plugin , newPass ) ; <END_BUG> file = new File ( ( ( ( ( plugin . getDataFolder ( ) ) + ( File . separator ) ) + ( auth . getNickname ( ) ) ) + "_new_pass.jpg" ) ) ; ImageIO . write ( gen . generateImage ( ) , "jpg" , file ) ; messageBodyPart = new MimeBodyPart ( ) ; DataSource source = new FileDataSource ( file ) ; messageBodyPart . setDataHandler ( new DataHandler ( source ) ) ; messageBodyPart . setFileName ( ( ( auth . getNickname ( ) ) + "_new_pass.jpg" ) ) ; multipart . addBodyPart ( messageBodyPart ) ; } message . setContent ( multipart ) ; Transport transport = session . getTransport ( "smtp" ) ; transport . connect ( smtp , acc , password ) ; transport . sendMessage ( message , message . getAllRecipients ( ) ) ; if ( file != null ) file . delete ( ) ; } catch ( Exception e ) { System . out . println ( ( "Some<seq2seq4repair_space>error<seq2seq4repair_space>occured<seq2seq4repair_space>while<seq2seq4repair_space>trying<seq2seq4repair_space>to<seq2seq4repair_space>send<seq2seq4repair_space>a<seq2seq4repair_space>mail<seq2seq4repair_space>to<seq2seq4repair_space>" + mail ) ) ; } } } ) ; } }

Fix:
ImageGenerator gen = new ImageGenerator ( newPass ) ;
Buggy code:
public class Main { public static final String DEFAULT_BUILD_FILENAME = "build.xml" ; private int msgOutputLevel = Project . MSG_INFO ; private File buildFile ; private PrintStream out = System . out ; private PrintStream err = System . err ; private Vector targets = new Vector ( 5 ) ; private Properties definedProps = new Properties ( ) ; private Vector listeners = new Vector ( 5 ) ; private String loggerClassname = null ; private boolean emacsMode = false ; private boolean readyToRun = false ; private boolean projectHelp = false ; private static void printMessage ( Throwable t ) { } public static void start ( String [ ] args , Properties additionalUserProperties , ClassLoader systemLoader ) { } public static void main ( String [ ] args ) { } protected Main ( String [ ] args ) throws BuildException { } private File getParentFile ( File file ) { } private File findBuildFile ( String start , String suffix ) throws BuildException { } private void runBuild ( ClassLoader systemLoader ) throws BuildException { } protected void addBuildListeners ( Project project ) { project . addBuildListener ( createLogger ( ) ) ; for ( int i = 0 ; i < ( listeners . size ( ) ) ; i ++ ) { String className = ( ( String ) ( listeners . elementAt ( i ) ) ) ; try { BuildListener listener = ( ( BuildListener ) ( Class . forName ( className ) . newInstance ( ) ) ) ; project . addBuildListener ( listener ) ; <START_BUG> } catch ( Exception exc ) { <END_BUG> throw new BuildException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>instantiate<seq2seq4repair_space>listener<seq2seq4repair_space>" + className ) , exc ) ; } } } private BuildLogger createLogger ( ) { } private static void printUsage ( ) { } private static void printVersion ( ) throws BuildException { } private static String antVersion = null ; public static synchronized String getAntVersion ( ) throws BuildException { } private static void printTargets ( Project project ) { } private static int findTargetPosition ( Vector names , String name ) { } private static void printTargets ( Vector names , Vector descriptions , String heading , int maxlen ) { } }

Fix:
} catch ( Throwable exc ) {
Buggy code:
@ SuppressWarnings ( "boxing" ) public class PerformanceTest { private static final String [ ] PROPS = new String [ ] { "java.version" , "java.vendor" , "java.vm.version" , "java.vm.name" , "os.name" , "os.arch" , "os.version" } ; private static int max = 10 ; private static int num = 0 ; private static long [ ] elapsedTimes = new long [ PerformanceTest . max ] ; private static final CSVFormat format = CSVFormat . EXCEL ; public static void main ( String [ ] args ) throws Exception { } private static BufferedReader getReader ( ) throws IOException { } private static class Stats { final int count ; final int fields ; Stats ( int c , int f ) { } } private static void show ( String msg , PerformanceTest . Stats s , long start ) { } private static void show ( ) { } private static void testReadBigFile ( boolean split ) throws Exception { } private static PerformanceTest . Stats readAll ( BufferedReader in , boolean split ) throws IOException { } private static void testExtendedBuffer ( boolean makeString ) throws Exception { } private static void testParseCommonsCSV ( ) throws Exception { } private static Constructor < Lexer > getLexerCtor ( String clazz ) throws Exception { } private static void testCSVLexer ( final boolean newToken , String test ) throws Exception { Token token = new Token ( ) ; String dynamic = "" ; for ( int i = 0 ; i < ( PerformanceTest . max ) ; i ++ ) { final ExtendedBufferedReader input = new ExtendedBufferedReader ( PerformanceTest . getReader ( ) ) ; Lexer lexer = null ; if ( test . startsWith ( "CSVLexer" ) ) { dynamic = "!" ; lexer = PerformanceTest . getLexerCtor ( test ) . newInstance ( new Object [ ] { PerformanceTest . format , input } ) ; } else { lexer = new CSVLexer ( PerformanceTest . format , input ) ; } int count = 0 ; int fields = 0 ; long t0 = System . currentTimeMillis ( ) ; do { if ( newToken ) { token = new Token ( ) ; } else { token . reset ( ) ; } lexer . nextToken ( token ) ; switch ( token . type ) { case EOF : break ; case EORECORD : fields ++ ; count ++ ; break ; case INVALID : <START_BUG> throw new IOException ( "invalid<seq2seq4repair_space>parse<seq2seq4repair_space>sequence" ) ; <END_BUG> case TOKEN : fields ++ ; break ; } } while ( ! ( token . type . equals ( EOF ) ) ) ; PerformanceTest . Stats s = new PerformanceTest . Stats ( count , fields ) ; input . close ( ) ; PerformanceTest . show ( ( ( ( ( lexer . getClass ( ) . getSimpleName ( ) ) + dynamic ) + "<seq2seq4repair_space>" ) + ( newToken ? "new" : "reset" ) ) , s , t0 ) ; } PerformanceTest . show ( ) ; } private static PerformanceTest . Stats iterate ( Iterable < CSVRecord > it ) { } }

Fix:
throw new IOException ( ( ( "invalid<seq2seq4repair_space>parse<seq2seq4repair_space>sequence<seq2seq4repair_space><" + ( token . content . toString ( ) ) ) + ">" ) ) ;
Buggy code:
public class Euler { public static void main ( String [ ] args ) { <START_BUG> Problem curProb = new PE0031 ( ) ; <END_BUG> String result = curProb . getResult ( ) ; IO . info ( ( "result<seq2seq4repair_space>for<seq2seq4repair_space>problem<seq2seq4repair_space>#" + curProb ) ) ; IO . info ( ( ( "<seq2seq4repair_space>is<seq2seq4repair_space>'" + result ) + "'" ) ) ; IO . infoln ( ( ( "<seq2seq4repair_space>found<seq2seq4repair_space>in<seq2seq4repair_space>" + ( curProb . getRuntime ( 2 ) ) ) + "<seq2seq4repair_space>ms" ) ) ; } }

Fix:
Problem curProb = new PE0032 ( ) ;
Buggy code:
public class FunctionReference extends SpelNodeImpl { private final String name ; public FunctionReference ( Token payload ) { } @ Override public TypedValue getValueInternal ( ExpressionState state ) throws EvaluationException { } private TypedValue executeFunctionJLRMethod ( ExpressionState state , Method m ) throws EvaluationException { Object [ ] functionArgs = getArguments ( state ) ; if ( ( ! ( m . isVarArgs ( ) ) ) && ( ( m . getParameterTypes ( ) . length ) != ( functionArgs . length ) ) ) { throw new org . springframework . expression . spel . SpelException ( SpelMessages . INCORRECT_NUMBER_OF_ARGUMENTS_TO_FUNCTION , functionArgs . length , m . getParameterTypes ( ) . length ) ; } if ( ! ( Modifier . isStatic ( m . getModifiers ( ) ) ) ) { throw new org . springframework . expression . spel . SpelException ( getCharPositionInLine ( ) , SpelMessages . FUNCTION_MUST_BE_STATIC , ( ( ( m . getDeclaringClass ( ) . getName ( ) ) + "." ) + ( m . getName ( ) ) ) , name ) ; } if ( functionArgs != null ) { TypeConverter converter = state . getEvaluationContext ( ) . getTypeConverter ( ) ; <START_BUG> ReflectionHelper . convertArguments ( m . getParameterTypes ( ) , m . isVarArgs ( ) , converter , functionArgs ) ; <END_BUG> } if ( m . isVarArgs ( ) ) { functionArgs = ReflectionHelper . setupArgumentsForVarargsInvocation ( m . getParameterTypes ( ) , functionArgs ) ; } try { ReflectionUtils . makeAccessible ( m ) ; Object result = m . invoke ( m . getClass ( ) , functionArgs ) ; return new TypedValue ( result , new org . springframework . core . convert . TypeDescriptor ( new MethodParameter ( m , ( - 1 ) ) ) ) ; } catch ( IllegalArgumentException e ) { throw new org . springframework . expression . spel . SpelException ( getCharPositionInLine ( ) , e , SpelMessages . EXCEPTION_DURING_FUNCTION_CALL , name , e . getMessage ( ) ) ; } catch ( IllegalAccessException e ) { throw new org . springframework . expression . spel . SpelException ( getCharPositionInLine ( ) , e , SpelMessages . EXCEPTION_DURING_FUNCTION_CALL , name , e . getMessage ( ) ) ; } catch ( InvocationTargetException e ) { throw new org . springframework . expression . spel . SpelException ( getCharPositionInLine ( ) , e , SpelMessages . EXCEPTION_DURING_FUNCTION_CALL , name , e . getMessage ( ) ) ; } } @ Override public String toStringAST ( ) { } private Object [ ] getArguments ( ExpressionState state ) throws EvaluationException { } }

Fix:
ReflectionHelper . convertAllArguments ( m . getParameterTypes ( ) , m . isVarArgs ( ) , converter , functionArgs ) ;
Buggy code:
public final class DistributedCityBlockVectorSimilarity extends AbstractDistributedVectorSimilarity { @ Override <START_BUG> protected double doComputeResult ( int rowA , int rowB , Iterable < Cooccurrence > cooccurrences , double weightOfVectorA , double weightOfVectorB , int numberOfColumns ) { <END_BUG> int cooccurrenceCount = countElements ( cooccurrences ) ; if ( cooccurrenceCount == 0 ) { return Double . NaN ; } double distance = ( weightOfVectorA + weightOfVectorB ) - ( 2 * cooccurrenceCount ) ; return 1.0 // ( 1.0 + distance ) ; } @ Override public double weight ( Vector v ) { } }

Fix:
protected double doComputeResult ( int rowA , int rowB , Iterable < Cooccurrence > cooccurrences , double weightOfVectorA , double weightOfVectorB , long numberOfColumns ) {
Buggy code:
public class RedstoneClientScreenModule implements ClientScreenModule { private String line = "" ; private String yestext = "on" ; private String notext = "off" ; private int color = 16777215 ; private int yescolor = 16777215 ; private int nocolor = 16777215 ; private int dim = 0 ; @ Override public TransformMode getTransformMode ( ) { } @ Override public int getHeight ( ) { } @ Override public void render ( FontRenderer fontRenderer , int currenty , Object [ ] screenData , float factor ) { GL11 . glDisable ( GL_LIGHTING ) ; int xoffset ; if ( ! ( line . isEmpty ( ) ) ) { fontRenderer . drawString ( line , 7 , currenty , color ) ; xoffset = 7 + 40 ; } else { xoffset = 7 ; } <START_BUG> if ( ( screenData != null ) && ( ( screenData . length ) > 0 ) ) { <END_BUG> boolean rs = ( ( Boolean ) ( screenData [ 0 ] ) ) ; fontRenderer . drawString ( ( rs ? yestext : notext ) , xoffset , currenty , ( rs ? yescolor : nocolor ) ) ; } else { fontRenderer . drawString ( "<invalid>" , xoffset , currenty , 16711680 ) ; } } @ Override public void mouseClick ( World world , int x , int y , boolean clicked ) { } @ Override public Panel createGui ( Minecraft mc , Gui gui , final NBTTagCompound currentData , final ModuleGuiChanged moduleGuiChanged ) { } @ Override public void setupFromNBT ( NBTTagCompound tagCompound , int dim , int x , int y , int z ) { } @ Override public boolean needsServerData ( ) { } }

Fix:
if ( ( ( screenData != null ) && ( ( screenData . length ) > 0 ) ) && ( ( screenData [ 0 ] ) instanceof Boolean ) ) {
Buggy code:
public class GameActivity extends MyBaseGameActivity { private static final String TAG = "GameActivity" ; public SelectionCircle mSelectionCircle ; public Entity mGroundLayer ; public TMXTiledMap mTmxTiledMap ; private Dungeon mDungeon ; private Hero mHero ; private Room mRoom ; private Unit mActiveCharacter ; private ActionsDispatcher mActionDispatcher ; @ Override protected void initGameActivity ( ) { Bundle extras = getIntent ( ) . getExtras ( ) ; if ( ( extras != null ) && ( ( extras . getSerializable ( Game . class . getName ( ) ) ) != null ) ) { mGame = ( ( Game ) ( extras . getSerializable ( Game . class . getName ( ) ) ) ) ; } else { mGame = new Game ( ) ; <START_BUG> mGame . setHero ( HeroFactory . buildBerserker ( ) ) ; <END_BUG> mGame . setBook ( BookFactory . buildInitiationBook ( ) ) ; } if ( ( mGame . getDungeon ( ) ) == null ) { Chapter chapter = mGame . getBook ( ) . getActiveChapter ( ) ; chapter . createDungeon ( ) ; mGame . setDungeon ( chapter . getDungeon ( ) ) ; try { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; ObjectOutputStream oos = new ObjectOutputStream ( bos ) ; oos . writeObject ( mGame . getHero ( ) ) ; oos . flush ( ) ; oos . close ( ) ; bos . close ( ) ; byte [ ] byteData = bos . toByteArray ( ) ; ByteArrayInputStream bais = new ByteArrayInputStream ( byteData ) ; mHero = ( ( Hero ) ( new ObjectInputStream ( bais ) . readObject ( ) ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } catch ( ClassNotFoundException e ) { e . printStackTrace ( ) ; } mDungeon = mGame . getDungeon ( ) ; mHero . reset ( ) ; } else { mDungeon = mGame . getDungeon ( ) ; } mRoom = mDungeon . getCurrentRoom ( ) ; Log . d ( GameActivity . TAG , ( "current<seq2seq4repair_space>room<seq2seq4repair_space>" + ( mRoom ) ) ) ; } @ Override protected int getLayoutID ( ) { } @ Override public void onCreateScene ( OnCreateSceneCallback pOnCreateSceneCallback ) throws Exception { } @ Override public void onPopulateScene ( Scene pScene , OnPopulateSceneCallback pOnPopulateSceneCallback ) throws Exception { } public void addElementToScene ( GameElement gameElement ) { } public void removeElement ( GameElement gameElement ) { } @ Override protected void onPause ( ) { } @ Override protected int [ ] getMusicResource ( ) { } @ Override public void endGame ( ) { } @ Override public void onTouch ( float x , float y ) { } @ Override public void onCancel ( float x , float y ) { } @ Override public void onTap ( float x , float y ) { } @ Override public void onClick ( View view ) { } public Unit getActiveCharacter ( ) { } public Room getRoom ( ) { } public Hero getHero ( ) { } public void startGame ( ) { } public void showChapterIntro ( ) { } public void nextTurn ( ) { } private void updateActionTiles ( ) { } public void switchRoom ( final Tile doorTile ) { } private void animateRoomSwitch ( final Directions doorDirection ) { } }

Fix:
mGame . setHero ( HeroFactory . buildDwarfWarrior ( ) ) ;
Buggy code:
public class RegisteredIntegrations { public static IntegrationMorph morph ; public static IntegrationThaumicExploration thaumicExploration ; public static IntegrationAutomagy automagy ; private RegisteredIntegrations ( ) { } public static void init ( ) { } private static void registerDependent ( String modId , String clazz ) { if ( ! ( Loader . isModLoaded ( modId ) ) ) { return ; } Object integration ; try { integration = Injector . getClass ( clazz ) . newInstance ( ) ; <START_BUG> } catch ( Exception e ) { <END_BUG> return ; } if ( integration instanceof IntegrationMod ) { ( ( IntegrationMod ) ( integration ) ) . init ( ) ; } } private static < T extends IntegrationMod > T registerUndependent ( Class < T > clazz ) { } No newline ; at end ; of file ; }

Fix:
} catch ( Throwable e ) {
Buggy code:
final class KeyBindingService implements INestableKeyBindingService { private IKeyBindingService activeService = null ; private Set enabledContextIds = Collections . EMPTY_SET ; private List enabledSubmissions = new ArrayList ( ) ; private Map handlerSubmissionsByCommandId = new HashMap ( ) ; private List nestedEnabledSubmissions = null ; private List nestedHandlerSubmissions = null ; private final Map nestedServices = new HashMap ( ) ; private final KeyBindingService parent ; private IWorkbenchPartSite workbenchPartSite ; KeyBindingService ( IWorkbenchPartSite workbenchPartSite ) { } KeyBindingService ( IWorkbenchPartSite workbenchPartSite , KeyBindingService parent ) { } private boolean disposed ; public void dispose ( ) { } public boolean activateKeyBindingService ( IWorkbenchSite nestedSite ) { } private final void activateNestedService ( final IKeyBindingService service ) { } private final void deactivateNestedService ( ) { } private final List getEnabledSubmissions ( ) { } private final List getHandlerSubmissions ( ) { } public IKeyBindingService getKeyBindingService ( IWorkbenchSite nestedSite ) { } public String [ ] getScopes ( ) { } private final void normalizeSites ( final List submissionsToModify ) { } public void registerAction ( IAction action ) { if ( disposed ) return ; unregisterAction ( action ) ; String commandId = action . getActionDefinitionId ( ) ; if ( commandId != null ) { boolean active = false ; if ( ( ( parent ) != null ) && ( ( parent . activeService ) == ( this ) ) ) { active = true ; parent . deactivateNestedService ( ) ; } IHandler handler = new org . eclipse . ui . commands . ActionHandler ( action ) ; <START_BUG> HandlerSubmission handlerSubmission = new HandlerSubmission ( null , null , workbenchPartSite , commandId , handler , Priority . NORMAL ) ; <END_BUG> handlerSubmissionsByCommandId . put ( commandId , handlerSubmission ) ; if ( ( parent ) != null ) { if ( active ) { parent . activateNestedService ( this ) ; } } else { Workbench . getInstance ( ) . getCommandSupport ( ) . addHandlerSubmissions ( Collections . singletonList ( handlerSubmission ) ) ; } } } public boolean removeKeyBindingService ( IWorkbenchSite nestedSite ) { } public void setScopes ( String [ ] scopes ) { } public void unregisterAction ( IAction action ) { } }

Fix:
HandlerSubmission handlerSubmission = new HandlerSubmission ( null , null , workbenchPartSite , commandId , handler , Priority . MEDIUM ) ;
Buggy code:
@ SuppressWarnings ( "restriction" ) public class FeatureTrackHandler extends AbstractHandler { public Object execute ( ExecutionEvent event ) throws ExecutionException { IStructuredSelection selection = ( ( IStructuredSelection ) ( HandlerUtil . getCurrentSelection ( event ) ) ) ; PlatformObject firstElement = ( ( PlatformObject ) ( selection . getFirstElement ( ) ) ) ; Repository repository = ( ( Repository ) ( firstElement . getAdapter ( Repository . class ) ) ) ; final GitFlowRepository gfRepo = new GitFlowRepository ( repository ) ; final List < Ref > refs = new ArrayList < Ref > ( ) ; UIJob uiJob = new UIJob ( HandlerUtil . getActiveShell ( event ) . getDisplay ( ) , UIText . FeatureTrackHandler_fetchingRemoteFeatures ) { @ Override public IStatus runInUIThread ( IProgressMonitor monitor ) { try { int timeout = Activator . getDefault ( ) . getPreferenceStore ( ) . getInt ( REMOTE_CONNECTION_TIMEOUT ) ; FeatureListOperation featureListOperation = new FeatureListOperation ( gfRepo , timeout ) ; featureListOperation . execute ( monitor ) ; refs . addAll ( featureListOperation . getResult ( ) ) ; } catch ( CoreException e ) { return Activator . error ( e . getMessage ( ) , e ) ; } AbstractSelectionDialog < Ref > dialog = new AbstractSelectionDialog < Ref > ( getDisplay ( ) . getActiveShell ( ) , refs , UIText . FeatureTrackHandler_selectFeature , UIText . FeatureTrackHandler_remoteFeatures ) { @ Override protected String getPrefix ( ) { return ( ( ( Constants . R_REMOTES ) + ( Constants . DEFAULT_REMOTE_NAME ) ) + ( SEP ) ) + ( gfRepo . getFeaturePrefix ( ) ) ; } } ; if ( ( dialog . open ( ) ) != ( Window . OK ) ) { <START_BUG> return null ; <END_BUG> } setName ( FeatureTrackHandler_trackingFeature ) ; Ref ref = dialog . getSelectedNode ( ) ; try { new org . eclipse . egit . gitflow . op . FeatureTrackOperation ( gfRepo , ref ) . execute ( monitor ) ; } catch ( CoreException e ) { return Activator . error ( e . getMessage ( ) , e ) ; } return Status . OK_STATUS ; } } ; uiJob . setUser ( true ) ; uiJob . schedule ( ) ; return null ; } }

Fix:
return Status . CANCEL_STATUS ;
Buggy code:
public class UnknownElement extends Task { private String elementName ; private Object realThing ; private Vector children = new Vector ( ) ; public UnknownElement ( String elementName ) { } public String getTag ( ) { } public void maybeConfigure ( ) throws BuildException { } public void execute ( ) { if ( ( realThing ) == null ) { throw new BuildException ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>task<seq2seq4repair_space>of<seq2seq4repair_space>type:<seq2seq4repair_space>" + ( elementName ) ) , location ) ; } if ( ( realThing ) instanceof Task ) { <START_BUG> ( ( Task ) ( realThing ) ) . perform ( ) ; <END_BUG> } } public void addChild ( UnknownElement child ) { } protected void handleChildren ( Object parent , RuntimeConfigurable parentWrapper ) throws BuildException { } protected Object makeObject ( UnknownElement ue , RuntimeConfigurable w ) { } protected Task makeTask ( UnknownElement ue , RuntimeConfigurable w , boolean onTopLevel ) { } protected BuildException getNotFoundException ( String what , String elementName ) { } public String getTaskName ( ) { } public Task getTask ( ) { } }

Fix:
( ( Task ) ( realThing ) ) . execute ( ) ;
Buggy code:
public class TestXPathExtractor extends TestCase { private XPathExtractor extractor ; private SampleResult result ; private String data ; private JMeterVariables vars ; public TestXPathExtractor ( String name ) { } private JMeterContext jmctx ; private static final String VAL_NAME = "value" ; private static final String VAL_NAME_NR = "value_matchNr" ; @ Override public void setUp ( ) throws UnsupportedEncodingException { } public void testAttributeExtraction ( ) throws Exception { } public void testVariableExtraction ( ) throws Exception { } public void testScope ( ) { } public void testInvalidXpath ( ) throws Exception { } public void testInvalidDocument ( ) throws Exception { <START_BUG> result . setResponseData ( "<z>" . getBytes ( ) ) ; <END_BUG> extractor . setXPathQuery ( "<" ) ; extractor . process ( ) ; assertEquals ( "Default" , vars . get ( TestXPathExtractor . VAL_NAME ) ) ; assertEquals ( "0" , vars . get ( TestXPathExtractor . VAL_NAME_NR ) ) ; } }

Fix:
result . setResponseData ( "<z>" , null ) ;
Buggy code:
public class MyAuthenticatedWebSession extends AuthenticatedWebSession { public MyAuthenticatedWebSession ( final AuthenticatedWebApplication application , Request request ) { } @ Override public boolean authenticate ( final String username , final String password ) { <START_BUG> return ( username . equals ( "org.apache.wicket" ) ) && ( password . equals ( "org.apache.wicket" ) ) ; <END_BUG> } @ Override public Roles getRoles ( ) { } }

Fix:
return ( username . equals ( "wicket" ) ) && ( password . equals ( "wicket" ) ) ;
Buggy code:
public class TaskRunner { private Game game ; public List < Task > pendingTasks = new ArrayList < Task > ( ) ; public TaskRunner ( Game game ) { } public void startTask ( Task job ) { } public void finishTask ( Task job ) { pendingTasks . remove ( job ) ; job . getCharacter ( ) . setAvailable ( true ) ; job . setCompleted ( true ) ; boolean succeeded = succeeds ( job ) ; job . setSucceeded ( succeeded ) ; checkRisk ( job . getCharacter ( ) , job ) ; <START_BUG> if ( succeeded ) { <END_BUG> if ( ( job . getPrimarySkill ( ) ) != ( Skill . NONE ) ) { game . resources . add ( job . getRewards ( ) ) ; levelUp ( job . getCharacter ( ) , job ) ; } if ( job . getRewards ( ) . containsKey ( HEALING ) ) { job . getCharacter ( ) . setHealth ( ( ( job . getCharacter ( ) . getHealth ( ) ) + ( job . getRewards ( ) . get ( HEALING ) . intValue ( ) ) ) ) ; } } else { game . resources . subtract ( job . getPenalty ( ) ) ; if ( ( job . getPrimarySkill ( ) ) == ( Skill . FIGHTING ) ) { survive ( job . getCharacter ( ) , job ) ; } } } private boolean succeeds ( Task job ) { } public void levelUp ( Character character , Task job ) { } public void survive ( Character character , Task job ) { } public void checkRisk ( Character character , Task job ) { } private void dp ( String s ) { } }

Fix:
if ( succeeded && ( ( job . getCharacter ( ) ) != null ) ) {
Buggy code:
public class SearchFilesActivity extends AppCompatActivity implements IItemListViewContainer { private ProgressBar pbLoading ; private ListView fileListView ; private ViewAnimator viewAnimator ; private NowPlayingFloatingActionButton nowPlayingFloatingActionButton ; @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; getSupportActionBar ( ) . setDisplayHomeAsUpEnabled ( true ) ; setContentView ( activity_view_items ) ; fileListView = ( ( ListView ) ( findViewById ( lvItems ) ) ) ; pbLoading = ( ( ProgressBar ) ( findViewById ( pbLoadingItems ) ) ) ; fileListView . setVisibility ( INVISIBLE ) ; pbLoading . setVisibility ( VISIBLE ) ; <START_BUG> nowPlayingFloatingActionButton = NowPlayingFloatingActionButton . addNowPlayingFloatingActionButton ( ( ( RelativeLayout ) ( findViewById ( rlViewFiles ) ) ) ) ; <END_BUG> handleIntent ( getIntent ( ) ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override protected void onNewIntent ( Intent intent ) { } private void handleIntent ( Intent intent ) { } @ Override public void onStart ( ) { } @ Override public void onBackPressed ( ) { } @ Override public void updateViewAnimator ( ViewAnimator viewAnimator ) { } @ Override public NowPlayingFloatingActionButton getNowPlayingFloatingActionButton ( ) { } }

Fix:
nowPlayingFloatingActionButton = NowPlayingFloatingActionButton . addNowPlayingFloatingActionButton ( ( ( RelativeLayout ) ( findViewById ( rlViewItems ) ) ) ) ;
Buggy code:
public class StationsSpinnerAdapter implements SpinnerAdapter { private List < SLStation > stations ; private int colour ; public StationsSpinnerAdapter ( List < SLStation > stations , String linecode ) { } @ Override public int getCount ( ) { } @ Override public Object getItem ( int position ) { } @ Override public long getItemId ( int position ) { } @ Override public int getItemViewType ( int position ) { } @ Override public View getView ( int position , View convertView , ViewGroup parent ) { SLStation station = ( ( SLStation ) ( getItem ( position ) ) ) ; WheresMyTrain w = WheresMyTrain . INSTANCE ; w . setTextColour ( colour ) ; if ( convertView == null ) { LayoutInflater inflater = ( ( LayoutInflater ) ( w . getSystemService ( LAYOUT_INFLATER_SERVICE ) ) ) ; convertView = inflater . inflate ( spinner_row , null ) ; } TextView tv = ( ( TextView ) ( convertView . findViewById ( row ) ) ) ; tv . setTextColor ( colour ) ; <START_BUG> tv . setTypeface ( w . typeface ) ; <END_BUG> tv . setText ( station . stationname ) ; return convertView ; } @ Override public int getViewTypeCount ( ) { } @ Override public boolean hasStableIds ( ) { } @ Override public boolean isEmpty ( ) { } @ Override public void registerDataSetObserver ( DataSetObserver observer ) { } @ Override public void unregisterDataSetObserver ( DataSetObserver observer ) { } @ Override public View getDropDownView ( int position , View convertView , ViewGroup parent ) { } }

Fix:
tv . setTypeface ( w . book ) ;
Buggy code:
public class RemoteServiceTrackerTest extends AbstractRemoteServiceTest { RemoteServiceTracker remoteServiceTracker ; protected String getClientContainerName ( ) { } protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } protected IRemoteService getRemoteService ( IRemoteServiceContainerAdapter adapter , String clazz , String filter ) { } public void testRemoteServiceTracker ( ) throws Exception { } IRemoteService remoteService ; boolean done ; public void testServiceListener ( ) throws Exception { final IRemoteServiceContainerAdapter [ ] adapters = getRemoteServiceAdapters ( ) ; done = false ; final Object lock = new Object ( ) ; adapters [ 1 ] . addRemoteServiceListener ( new IRemoteServiceListener ( ) { public void handleServiceEvent ( IRemoteServiceEvent event ) { if ( event instanceof IRemoteServiceRegisteredEvent ) { IRemoteServiceRegisteredEvent e = ( ( IRemoteServiceRegisteredEvent ) ( event ) ) ; IRemoteServiceReference ref = e . getReference ( ) ; remoteService = adapters [ 1 ] . getRemoteService ( ref ) ; assertNotNull ( remoteService ) ; synchronized ( lock ) { done = true ; lock . notify ( ) ; } } } } ) ; adapters [ 0 ] . registerRemoteService ( new String [ ] { IConcatService . class . getName ( ) } , createService ( ) , customizeProperties ( null ) ) ; int count = 0 ; synchronized ( lock ) { while ( ( ! ( done ) ) && ( ( count ++ ) < 10 ) ) { try { lock . wait ( 1000 ) ; } catch ( InterruptedException e ) { fail ( ) ; } } } assertTrue ( done ) ; if ( ( remoteService ) == null ) return ; assertTrue ( ( ( remoteService ) != null ) ) ; traceCallStart ( "callAsynchResult" ) ; final IFuture result = remoteService . callAsync ( createRemoteConcat ( "ECF<seq2seq4repair_space>AsynchResults<seq2seq4repair_space>" , "are<seq2seq4repair_space>cool" ) ) ; traceCallEnd ( "callAsynch" ) ; assertNotNull ( result ) ; <START_BUG> Thread . sleep ( ASYNC_WAITTIME ) ; <END_BUG> } }

Fix:
Thread . sleep ( SLEEPTIME ) ;
Buggy code:
public class POP3Store { public static final int STATE_NONAUTHENTICATE = 0 ; public static final int STATE_AUTHENTICATE = 1 ; private int state = POP3Store . STATE_NONAUTHENTICATE ; private POP3Protocol protocol ; private PopItem popItem ; private POP3PreProcessingFilterPluginHandler handler ; private Hashtable filterCache ; private StatusObservableImpl observable ; public POP3Store ( PopItem popItem ) { } public int getState ( ) { } public void setState ( int state ) { } public List fetchUIDList ( int totalMessageCount ) throws Exception { } public List fetchMessageSizeList ( ) throws Exception { } public int fetchMessageCount ( ) throws Exception { } public boolean deleteMessage ( int index ) throws Exception { } protected String modifyMessage ( String rawString ) { } public ColumbaMessage fetchMessage ( int index ) throws Exception { isLogin ( ) ; String rawString = protocol . fetchMessage ( new Integer ( index ) . toString ( ) ) ; if ( ( rawString . length ( ) ) == 0 ) return null ; if ( popItem . getBoolean ( "enable_pop3preprocessingfilter" , false ) ) rawString = modifyMessage ( rawString ) ; Source source = new CharSequenceSource ( rawString ) ; Header header = HeaderParser . parse ( source ) ; ColumbaMessage m = new ColumbaMessage ( header ) ; ColumbaHeader h = ( ( ColumbaHeader ) ( m . getHeaderInterface ( ) ) ) ; m . setStringSource ( rawString ) ; m . setAttribute ( "columba.host" , popItem . get ( "host" ) ) ; <START_BUG> m . setAttribute ( "columba.fetchstate" , new Boolean ( true ) ) ; <END_BUG> return m ; } public void logout ( ) throws Exception { } public void close ( ) throws Exception { } public void login ( ) throws Exception { } public boolean isLogin ( ) throws Exception { } public StatusObservable getObservable ( ) { } }

Fix:
m . setAttribute ( "columba.fetchstate" , Boolean . TRUE ) ;
Buggy code:
public interface Logger { public void log ( String message ) { } public void logSql ( String sql ) { } <START_BUG> public void logError ( String sql ) ; <END_BUG> }

Fix:
public void logError ( String error ) ;
Buggy code:
public abstract class Panel extends WebMarkupContainer { private static final long serialVersionUID = 1L ; public static final String PANEL = "panel" ; public Panel ( final String id ) { } public Panel ( final String id , final IModel < ? > model ) { } @ Override protected IMarkupSourcingStrategy newMarkupSourcingStrategy ( ) { <START_BUG> return new PanelMarkupSourcingStrategy ( ) ; <END_BUG> } }

Fix:
return new PanelMarkupSourcingStrategy ( false ) ;
Buggy code:
public class EntityBeanHomeRemoveInterceptorFactory implements InterceptorFactory { private final boolean remote ; public EntityBeanHomeRemoveInterceptorFactory ( final boolean remote ) { } public Interceptor create ( final InterceptorFactoryContext context ) { return new AbstractEJBInterceptor ( ) { public Object processInvocation ( final InterceptorContext context ) throws Exception { final EntityBeanComponent component = getComponent ( context , EntityBeanComponent . class ) ; if ( remote ) { component . getEJBObject ( context . getParameters ( ) [ 0 ] ) . remove ( ) ; } else { <START_BUG> component . getEjbLocalObject ( context . getParameters ( ) [ 0 ] ) . remove ( ) ; <END_BUG> } return null ; } } ; } }

Fix:
component . getEJBLocalObject ( context . getParameters ( ) [ 0 ] ) . remove ( ) ;
Buggy code:
public abstract class TableViewController < T > extends FragmentController implements TableViewDataSource < T > , TableViewDelegate { private TableView < T > tableView ; private TableViewStyle style ; public void setStyle ( TableViewStyle style ) { } @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override protected Fragment getRootFragment ( ) { if ( ( tableView ) == null ) { TableView . Builder < T > builder ; if ( ( style ) == ( TableViewStyle . GROUP ) ) { builder = new GroupTableView . Builder < > ( ) ; } else { builder = new PlainTableView . Builder < > ( ) ; } builder . setContext ( this ) ; builder . setRefreshType ( getRefreshControlType ( ) ) ; builder . setEnableLoadMore ( enableRefresh ( ) ) ; builder . setEnableLoadMore ( enableLoadMore ( ) ) ; builder . setEnableAutoLoadMore ( enableAutoLoadMore ( ) ) ; builder . setDataSource ( this ) ; builder . setDelegate ( this ) ; <START_BUG> tableView = builder . bulid ( ) ; <END_BUG> } return new net . datafans . android . common . widget . table . TableViewFragment ( tableView ) ; } @ Override public void onStatusOk ( BaseResponse response , Class < ? > type ) { } @ Override public void onStatusError ( BaseResponse response ) { } @ Override public void onRequestError ( int errorCode , byte [ ] errorResponse , Throwable throwable ) { } public void onEnd ( ) { } protected RefreshControlType getRefreshControlType ( ) { } protected void loadOver ( boolean over ) { } protected boolean enableRefresh ( ) { } protected boolean enableLoadMore ( ) { } protected boolean enableAutoLoadMore ( ) { } @ Override public int getSections ( ) { } @ Override public int getSectionFooterHeight ( int section ) { } @ Override public int getSectionHeaderHeight ( int section ) { } @ Override public String getSectionFooterTitle ( int section ) { } @ Override public String getSectionHeaderTitle ( int section ) { } @ Override public int getItemViewType ( int section , int row ) { } @ Override public int getItemViewTypeCount ( ) { } }

Fix:
tableView = builder . build ( ) ;
Buggy code:
public class SwingLocation { private SwingLocation ( ) { } public static int mapCoordinateX ( int x , int y , int transX , int transY , float zoom ) { } public static int mapCoordinateY ( int x , int y , int transX , int transY , float zoom ) { } public static int displayCoordinateX ( int x , int y , int z ) { } public static int displayCoordinateY ( int x , int y , int z ) { <START_BUG> return - ( ServerCoordinate . toDisplayY ( x , y , z ) ) ; <END_BUG> } }

Fix:
return ServerCoordinate . toDisplayY ( x , y , z ) ;
Buggy code:
@ Controller @ RequestMapping ( "patient" ) public class PatientController { private final Logger log = LoggerFactory . getLogger ( PatientController . class ) ; @ Autowired IUserService userService ; @ Autowired IUserRoleService userRoleService ; @ Autowired IBookingService bookingService ; @ Autowired IBookingStatusService bookingStatusService ; @ RequestMapping ( value = { "//" } , method = RequestMethod . GET ) public ModelAndView userHomePage ( ) { } @ RequestMapping ( value = { "myprofile" } , method = RequestMethod . GET ) public ModelAndView getProfile ( HttpSession session ) throws DocException { } @ RequestMapping ( value = { "editViewProfile" } , method = RequestMethod . GET ) public ModelAndView editViewProfile ( HttpSession session ) throws DocException { } @ RequestMapping ( value = "updateProfile" , method = RequestMethod . POST ) public String updateUser ( HttpSession session , @ ModelAttribute ( "user" ) UserProfile userprofile ) throws DocException { } @ RequestMapping ( value = { "searchDoctor" } , method = RequestMethod . POST ) public ModelAndView searchDoctor ( HttpSession session , @ RequestParam ( "keyword" ) String keyword ) throws DocException { } @ RequestMapping ( value = { "saveAppointment//{id}//{timeSlot}" } , method = RequestMethod . GET ) public ModelAndView saveAppointment ( @ PathVariable Integer id , @ PathVariable Long timeSlot , HttpSession session ) throws DocException { ModelAndView mv = new ModelAndView ( "appointmentSuccessPage" ) ; UserProfile patientProfile = DocUtils . getLoggedInUserProfile ( session , userService ) ; UserProfile doctorProfile = userService . getRowById ( id ) ; <START_BUG> Bookings booking = DocUtils . getBooking ( timeSlot , doctorProfile , patientProfile , "illness" , bookingStatusService . getRowByName ( "code" , "2" ) ) ; <END_BUG> Integer appointId = bookingService . insertRow ( booking ) ; mv . addObject ( "doctor" , doctorProfile ) ; mv . addObject ( "appointId" , appointId ) ; return mv ; } @ RequestMapping ( value = { "getAppointment//{doctorId}" } , method = RequestMethod . GET ) public ModelAndView getAppointment ( @ PathVariable Integer doctorId ) throws DocException { } @ RequestMapping ( value = { "appointmentlist" } , method = RequestMethod . GET ) public ModelAndView appointmentlist ( HttpSession session ) throws DocException { } @ RequestMapping ( value = { "viewDoctorAppointment" } , method = { RequestMethod . GET , RequestMethod . POST } ) public String viewDoctorAppointment ( ) throws DocException { } @ RequestMapping ( value = { "getAppointment//{doctorId}//{userId}" } , method = RequestMethod . GET ) public String getAppointment ( @ PathVariable Integer doctorId , @ PathVariable Integer userId , Model model ) throws DocException { } }

Fix:
Bookings booking = DocUtils . getBooking ( timeSlot , doctorProfile , patientProfile , "illness" , bookingStatusService . getRowById ( 1 ) ) ;
Buggy code:
public abstract class ServerRestartRequiredServerConfigWriteAttributeHandler extends WriteAttributeOperationHandler { public static final ServerRestartRequiredServerConfigWriteAttributeHandler GROUP_INSTANCE = new ServerRestartRequiredServerConfigWriteAttributeHandler . GroupHandler ( ) ; public static final ServerRestartRequiredServerConfigWriteAttributeHandler SOCKET_BINDING_GROUP_INSTANCE = new ServerRestartRequiredServerConfigWriteAttributeHandler . SocketBindingGroupHandler ( ) ; public static final ServerRestartRequiredServerConfigWriteAttributeHandler SOCKET_BINDING_PORT_OFFSET_INSTANCE = new ServerRestartRequiredServerConfigWriteAttributeHandler . SocketBindingPortOffsetHandler ( ) ; private static StringLengthValidator STRING_VALIDATOR = new StringLengthValidator ( 1 , false ) ; public ServerRestartRequiredServerConfigWriteAttributeHandler ( ParameterValidator validator ) { } @ Override protected void modelChanged ( OperationContext context , ModelNode operation , String attributeName , ModelNode newValue , ModelNode currentValue ) throws OperationFailedException { if ( newValue . equals ( currentValue ) ) { <START_BUG> context . attach ( DONT_PROPAGATE_TO_SERVERS_ATTACHMENT , true ) ; <END_BUG> } validateReferencedNewValueExisits ( context , newValue ) ; context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; } protected abstract void validateReferencedNewValueExisits ( OperationContext context , ModelNode value ) throws OperationFailedException { } private static class GroupHandler extends ServerRestartRequiredServerConfigWriteAttributeHandler { public GroupHandler ( ) { } @ Override protected void validateReferencedNewValueExisits ( OperationContext context , ModelNode value ) throws OperationFailedException { } } private static class SocketBindingGroupHandler extends ServerRestartRequiredServerConfigWriteAttributeHandler { public SocketBindingGroupHandler ( ) { } @ Override protected void validateReferencedNewValueExisits ( OperationContext context , ModelNode value ) throws OperationFailedException { } } private static class SocketBindingPortOffsetHandler extends ServerRestartRequiredServerConfigWriteAttributeHandler { static final IntRangeValidator VALIDATOR = new IntRangeValidator ( 0 , true ) ; public SocketBindingPortOffsetHandler ( ) { } @ Override protected void validateReferencedNewValueExisits ( OperationContext context , ModelNode value ) throws OperationFailedException { } } }

Fix:
ServerOperationResolver . addToDontPropagateToServersAttachment ( context , operation ) ;
Buggy code:
public class EmployeeTask { protected ProjectTask _projectTask ; protected int _firstStep ; protected int _lastStep ; protected List < String > _dependencies ; protected String _taskName ; public EmployeeTask ( String taskName , List < String > dependencies , ProjectTask projectTask , final int firstStep , final int lastStep ) throws GameException { } public String getTaskName ( ) { } public EmployeeTaskMemento getMemento ( ) { } public boolean executeTask ( Map < String , Double > employeeSkills , double currentStep ) { } public boolean conflictsWithTask ( EmployeeTask task ) { } public boolean hasDependencie ( EmployeeTask task ) { } public boolean applyDependencie ( EmployeeTask dependencieTask ) { boolean result = false ; if ( dependencieTask != null ) { if ( _dependencies . contains ( dependencieTask . getTaskName ( ) ) ) { if ( ( dependencieTask . _lastStep ) > ( _firstStep ) ) { int duration = ( _lastStep ) - ( _firstStep ) ; _firstStep = dependencieTask . _lastStep ; <START_BUG> _lastStep += duration ; <END_BUG> } result = true ; } } return result ; } public boolean isValid ( int currentStep ) { } public int getFirstStep ( ) { } }

Fix:
_lastStep = ( _firstStep ) + duration ;
Buggy code:
public class TestSQLBigDecimalId extends SingleEMFTestCase { public void setUp ( ) { } public void testPersist ( ) { } public static void main ( String [ ] args ) { <START_BUG> TestRunner . run ( SQLBigDecimalIdEntity . class ) ; <END_BUG> } }

Fix:
TestRunner . run ( TestSQLBigDecimalId . class ) ;
Buggy code:
public class LogitBoost implements Classifier , Parameterized { protected double fScaleConstant = 0.5 ; protected List < Regressor > baseLearners ; protected Regressor baseLearner ; private int maxIterations ; private double zMax = 3 ; public LogitBoost ( int M ) { } public LogitBoost ( Regressor baseLearner , int M ) { } public void setMaxIterations ( int maxIterations ) { } public int getMaxIterations ( ) { } public void setzMax ( double zMax ) { } public double getzMax ( ) { } public CategoricalResults classify ( DataPoint data ) { } public void trainC ( ClassificationDataSet dataSet , ExecutorService threadPool ) { } public void trainC ( ClassificationDataSet dataSet ) { } private double F ( DataPoint x ) { } protected double P ( DataPoint x ) { } public boolean supportsWeightedData ( ) { } @ Override <START_BUG> public Classifier clone ( ) { <END_BUG> LogitBoost clone = new LogitBoost ( maxIterations ) ; clone . zMax = this . zMax ; if ( ( this . baseLearner ) != null ) clone . baseLearner = this . baseLearner . clone ( ) ; if ( ( this . baseLearners ) != null ) { clone . baseLearners = new ArrayList < Regressor > ( this . baseLearners . size ( ) ) ; for ( Regressor r : baseLearners ) clone . baseLearners . add ( r . clone ( ) ) ; } return clone ; } @ Override public List < Parameter > getParameters ( ) { } @ Override public Parameter getParameter ( String paramName ) { } }

Fix:
public LogitBoost clone ( ) {
Buggy code:
public class FlagsFilter extends AbstractFilter { public FlagsFilter ( ) { } public Object [ ] getAttributes ( ) { } public boolean process ( Object [ ] args , Folder folder , Object uid ) throws Exception { boolean result = false ; String headerField = ( ( String ) ( args [ 1 ] ) ) ; int condition = FilterCriteria . getCriteria ( ( ( String ) ( args [ 0 ] ) ) ) ; String searchHeaderField = null ; if ( headerField . equalsIgnoreCase ( "Answered" ) ) { searchHeaderField = new String ( "columba.flags.answered" ) ; } else if ( headerField . equalsIgnoreCase ( "Deleted" ) ) { searchHeaderField = new String ( "columba.flags.expunged" ) ; } else if ( headerField . equalsIgnoreCase ( "Flagged" ) ) { searchHeaderField = new String ( "columba.flags.flagged" ) ; } else if ( headerField . equalsIgnoreCase ( "Recent" ) ) { searchHeaderField = new String ( "columba.flags.recent" ) ; } else if ( headerField . equalsIgnoreCase ( "Draft" ) ) { searchHeaderField = new String ( "columba.flags.draft" ) ; } else if ( headerField . equalsIgnoreCase ( "Seen" ) ) { searchHeaderField = new String ( "columba.flags.seen" ) ; } else if ( headerField . equalsIgnoreCase ( "Spam" ) ) { <START_BUG> searchHeaderField = new String ( "columba.flags.spam" ) ; <END_BUG> } Boolean flags = ( ( Boolean ) ( folder . getAttribute ( uid , searchHeaderField ) ) ) ; if ( flags == null ) { return false ; } switch ( condition ) { case FilterCriteria . IS : { if ( flags . equals ( Boolean . TRUE ) ) result = true ; break ; } case FilterCriteria . IS_NOT : { if ( flags . equals ( Boolean . FALSE ) ) result = true ; break ; } } return result ; } }

Fix:
searchHeaderField = new String ( "columba.spam" ) ;