Buggy code:
public class RSSDataExport extends TemplateScreen { private static final String DEFAULT_FEED_FORMAT = "atom_0.3" ; private static final String MIME_TYPE = "application//xml;<seq2seq4repair_space>charset=UTF-8" ; private static final String COULD_NOT_GENERATE_FEED_ERROR = "Could<seq2seq4repair_space>not<seq2seq4repair_space>generate<seq2seq4repair_space>feed" ; private static final String COULD_NOT_GENERATE_FEED_ERROR_DATABASE = "Could<seq2seq4repair_space>not<seq2seq4repair_space>retrive<seq2seq4repair_space>data<seq2seq4repair_space>successfully" ; public static final String QUERY_ID_KEY = "queryId" ; public static final String ISSUE_ID_KEY = "issueId" ; public static final String USER_ID_KEY = "userId" ; public static final String FEED_TYPE_KEY = "feedType" ; public static final String FEED_FORMAT_KEY = "type" ; public void doBuildTemplate ( RunData data , TemplateContext context ) throws Exception { super . doBuildTemplate ( data , context ) ; data . getResponse ( ) . setContentType ( RSSDataExport . MIME_TYPE ) ; data . setTarget ( null ) ; Writer writer = data . getResponse ( ) . getWriter ( ) ; try { ParameterParser parser = data . getParameters ( ) ; String feedType = parser . getString ( RSSDataExport . FEED_TYPE_KEY ) ; String feedFormat = parser . getString ( RSSDataExport . FEED_FORMAT_KEY ) ; ScarabLink scarabLink = getScarabLinkTool ( context ) ; ScarabRequestTool scarabRequestTool = getScarabRequestTool ( context ) ; Feed feedSource = null ; ScarabToolManager scarabToolManager = new ScarabToolManager ( getLocalizationTool ( context ) ) ; if ( feedType . equals ( "QueryFeed" ) ) { long queryId = parser . getLong ( RSSDataExport . QUERY_ID_KEY ) ; long userId = parser . getLong ( RSSDataExport . USER_ID_KEY ) ; if ( queryId == 0 ) { throw new IllegalArgumentException ( "Query<seq2seq4repair_space>ID<seq2seq4repair_space>is<seq2seq4repair_space>missing.<seq2seq4repair_space>Should<seq2seq4repair_space>be<seq2seq4repair_space>appended<seq2seq4repair_space>like:<seq2seq4repair_space>//queryId//xxx" ) ; } if ( userId == 0 ) { throw new IllegalArgumentException ( "User<seq2seq4repair_space>ID<seq2seq4repair_space>is<seq2seq4repair_space>missing.<seq2seq4repair_space>Should<seq2seq4repair_space>be<seq2seq4repair_space>appended<seq2seq4repair_space>like:<seq2seq4repair_space>//userId//xxx" ) ; } Query query = QueryManager . getInstance ( new Long ( queryId ) ) ; ScarabUser user1 = ScarabUserManager . getInstance ( new NumberKey ( userId ) , false ) ; <START_BUG> feedSource = new org . tigris . scarab . feeds . QueryFeed ( query , user1 , scarabRequestTool , scarabLink ) ; <END_BUG> } else if ( feedType . equals ( "IssueFeed" ) ) { String issueId = parser . getString ( RSSDataExport . ISSUE_ID_KEY ) ; if ( issueId . equals ( "" ) ) { throw new IllegalArgumentException ( "Issue<seq2seq4repair_space>ID<seq2seq4repair_space>is<seq2seq4repair_space>missing.<seq2seq4repair_space>Should<seq2seq4repair_space>be<seq2seq4repair_space>appended<seq2seq4repair_space>like:<seq2seq4repair_space>//issueId//xxx" ) ; } Issue issue = IssueManager . getIssueById ( issueId ) ; feedSource = new org . tigris . scarab . feeds . IssueFeed ( issue , scarabLink , scarabToolManager ) ; } else { throw new Exception ( ( "Couldn't<seq2seq4repair_space>find<seq2seq4repair_space>feed<seq2seq4repair_space>for<seq2seq4repair_space>type:" + feedType ) ) ; } SyndFeed feed = feedSource . getFeed ( ) ; feedFormat = ( feedFormat != null ) ? feedFormat : RSSDataExport . DEFAULT_FEED_FORMAT ; feed . setFeedType ( feedFormat ) ; SyndFeedOutput output = new SyndFeedOutput ( ) ; output . output ( feed , writer ) ; } catch ( IllegalArgumentException iae ) { String msg = ( ( RSSDataExport . COULD_NOT_GENERATE_FEED_ERROR ) + ":<seq2seq4repair_space>" ) + ( iae . getMessage ( ) ) ; Log . get ( ) . error ( msg , iae ) ; data . getResponse ( ) . sendError ( SC_INTERNAL_SERVER_ERROR , msg ) ; } catch ( TorqueException te ) { String msg = RSSDataExport . COULD_NOT_GENERATE_FEED_ERROR_DATABASE ; Log . get ( ) . error ( msg , te ) ; data . getResponse ( ) . sendError ( SC_INTERNAL_SERVER_ERROR , msg ) ; } catch ( FeedException ex ) { String msg = RSSDataExport . COULD_NOT_GENERATE_FEED_ERROR ; Log . get ( ) . error ( msg , ex ) ; data . getResponse ( ) . sendError ( SC_INTERNAL_SERVER_ERROR , msg ) ; } catch ( Exception e ) { String msg = RSSDataExport . COULD_NOT_GENERATE_FEED_ERROR ; Log . get ( ) . error ( msg , e ) ; data . getResponse ( ) . sendError ( SC_INTERNAL_SERVER_ERROR , msg ) ; } } protected final ScarabLocalizationTool getLocalizationTool ( TemplateContext context ) { } public ScarabRequestTool getScarabRequestTool ( TemplateContext context ) { } public ScarabLink getScarabLinkTool ( TemplateContext context ) { } }

Fix:
feedSource = new org . tigris . scarab . feeds . QueryFeed ( query , user1 , scarabToolManager , scarabLink ) ;