nus-yam/ex-repair huggingface dataset:
Buggy code:
public class CassandraStorage extends LoadFunc { private static final byte [ ] BOUND = new byte [ 0 ] ; private static final int LIMIT = 1024 ; private Configuration conf ; private RecordReader reader ; @ Override public Tuple getNext ( ) throws IOException { try { if ( ! ( reader . nextKeyValue ( ) ) ) return null ; <START_BUG> String key = ( ( String ) ( reader . getCurrentKey ( ) ) ) ; <END_BUG> SortedMap < byte [ ] , IColumn > cf = ( ( SortedMap < byte [ ] , IColumn > ) ( reader . getCurrentValue ( ) ) ) ; assert ( key != null ) && ( cf != null ) ; Tuple tuple = TupleFactory . getInstance ( ) . newTuple ( 2 ) ; ArrayList < Tuple > columns = new ArrayList < Tuple > ( ) ; tuple . set ( 0 , new DataByteArray ( key ) ) ; for ( Map . Entry < byte [ ] , IColumn > entry : cf . entrySet ( ) ) columns . add ( columnToTuple ( entry . getKey ( ) , entry . getValue ( ) ) ) ; tuple . set ( 1 , new org . apache . pig . data . DefaultDataBag ( columns ) ) ; return tuple ; } catch ( InterruptedException e ) { throw new IOException ( e . getMessage ( ) ) ; } } private Tuple columnToTuple ( byte [ ] name , IColumn col ) throws IOException { } @ Override public InputFormat getInputFormat ( ) { } @ Override public void prepareToRead ( RecordReader reader , PigSplit split ) { } @ Override public void setLocation ( String location , Job job ) throws IOException { } @ Override public String relativeToAbsolutePath ( String location , Path curDir ) throws IOException { } }

Fix:
byte [ ] key = ( ( byte [ ] ) ( reader . getCurrentKey ( ) ) ) ;
Buggy code:
public abstract class PropPanelEvent extends PropPanelModelElement { protected JScrollPane paramScroll ; public PropPanelEvent ( String name , ImageIcon icon , Orientation orientation ) { } public void buttonAddParameter ( ) { <START_BUG> TheInstance . setTarget ( CoreFactory . getFactory ( ) . buildParameter ( getTarget ( ) ) ) ; <END_BUG> } }

Fix:
ProjectBrowser . getInstance ( ) . setTarget ( CoreFactory . getFactory ( ) . buildParameter ( getTarget ( ) ) ) ;
Buggy code:
public class NetCommand extends AbstractLogEnabled { protected boolean _traceCommandLine = false ; protected Commandline _commandLine ; protected Execute2 _exe ; protected boolean _failOnError ; protected Task _owner ; protected String _program ; protected String _title ; public NetCommand ( Task owner , String title , String program ) throws TaskException { } public void setFailOnError ( boolean b ) { } public void setTraceCommandLine ( boolean b ) { } public boolean getFailFailOnError ( ) { } public void addArgument ( String argument ) { } public void runCommand ( ) throws TaskException { int err = - 1 ; try { if ( _traceCommandLine ) { } else { logVerbose ( _commandLine . toString ( ) ) ; } <START_BUG> _exe . setCommandline ( _commandLine . getCommandline ( ) ) ; <END_BUG> err = _exe . execute ( ) ; if ( err != 0 ) { if ( _failOnError ) { throw new TaskException ( ( ( ( _title ) + "<seq2seq4repair_space>returned:<seq2seq4repair_space>" ) + err ) ) ; } else { getLogger ( ) . error ( ( ( ( _title ) + "<seq2seq4repair_space>Result:<seq2seq4repair_space>" ) + err ) ) ; } } } catch ( IOException e ) { throw new TaskException ( ( ( ( _title ) + "<seq2seq4repair_space>failed:<seq2seq4repair_space>" ) + e ) , e ) ; } } protected void logError ( String msg ) { } protected void logVerbose ( String msg ) { } protected void prepareExecutor ( ) throws TaskException { } }

Fix:
_exe . setCommandline ( _commandLine ) ;
Buggy code:
class ChatImpl extends ChatPOA { private Map < ChatCallback , String > activeUsers ; private Map < String , ChatCallback > players ; private Board board ; private boolean activeGame = false ; public ChatImpl ( ) { } public String list ( ChatCallback objref ) { } public boolean join ( ChatCallback cref , String user ) { } public void leave ( ChatApp . ChatCallback cref , String user ) { } public void send ( ChatApp . ChatCallback senderRef , String msg ) { } @ Override public void mark ( ChatCallback objref , short x , short y , short mark ) { if ( activeGame ) { if ( board . full ( ) ) { sendAllPlayers ( "No<seq2seq4repair_space>winner<seq2seq4repair_space>new<seq2seq4repair_space>game" ) ; board . clearBoard ( ) ; sendAllPlayers ( board . toString ( ) ) ; return ; } Position lastMove = new Position ( x , y ) ; if ( board . markPosition ( lastMove , mark ) ) { if ( board . checkWin ( lastMove ) ) { activeGame = false ; sendAllPlayers ( board . toString ( ) ) ; board . clearBoard ( ) ; for ( ChatCallback playerCallbacks : players . values ( ) ) { <START_BUG> playerCallbacks . announceWin ( x ) ; <END_BUG> playerCallbacks . update ( board . toString ( ) ) ; } activeGame = true ; } else { sendAllPlayers ( ( "\n" + ( board . toString ( ) ) ) ) ; } } else { objref . update ( ( ( ( ( "(" + x ) + "," ) + y ) + ")<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>possible<seq2seq4repair_space>\n" ) ) ; } } } @ Override public void playGame ( ChatCallback callbackRef , String userName ) { } @ Override public void leaveGame ( ChatCallback objref , String user ) { } private void sendAll ( String msg ) { } private void sendAllPlayers ( String msg ) { } private void sendToSet ( String msg , Collection < ChatCallback > callbackRefs ) { } }

Fix:
playerCallbacks . announceWin ( mark ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) @ Singleton public final class SearchServlet extends HttpServlet { private static final Log LOG = Log . get ( SearchServlet . class ) ; public static class SearchResponseUtils { public static SearchRequest parseSearchRequest ( HttpServletRequest req , HttpServletResponse response ) { } public static SearchResponse serializeSearchResult ( SearchResult searchResult , int total ) { } private static Digest serializeDigest ( Digest searchResultDigest ) { } } private final ConversationUtil conversationUtil ; private final EventDataConverterManager converterManager ; private final WaveletProvider waveletProvider ; private final SessionManager sessionManager ; private final OperationServiceRegistry operationRegistry ; private final ProtoSerializer serializer ; @ Inject public SearchServlet ( SessionManager sessionManager , EventDataConverterManager converterManager , @ Named ( "DataApiRegistry" ) OperationServiceRegistry operationRegistry , WaveletProvider waveletProvider , ConversationUtil conversationUtil , ProtoSerializer serializer ) { } @ Override @ VisibleForTesting protected void doGet ( HttpServletRequest req , HttpServletResponse response ) throws IOException { } private SearchResponse performSearch ( SearchRequest searchRequest , ParticipantId user ) { } private void serializeObjectToServlet ( MessageLite message , HttpServletResponse resp ) throws IOException { if ( message == null ) { resp . sendError ( SC_FORBIDDEN ) ; } else { resp . setStatus ( SC_OK ) ; <START_BUG> resp . setContentType ( "application//json" ) ; <END_BUG> resp . setHeader ( "Cache-Control" , "no-store" ) ; try { resp . getWriter ( ) . append ( serializer . toJson ( message ) . toString ( ) ) ; } catch ( SerializationException e ) { throw new IOException ( e ) ; } } } }

Fix:
resp . setContentType ( "application//json;<seq2seq4repair_space>charset=utf8" ) ;
Buggy code:
@ ProfileJdbcDb @ Component public class DatabaseInitializingServiceImpl implements InitializingService { @ Autowired private TestSuite testSuite ; @ Autowired private DaoTestSuite daoTestSuite ; @ Autowired private SakuliExceptionHandler exceptionHandler ; @ Override public int getServicePriority ( ) { } @ Override public void initTestSuite ( ) { try { testSuite . setDbPrimaryKey ( daoTestSuite . insertInitialTestSuiteData ( ) ) ; } catch ( Throwable e ) { <START_BUG> exceptionHandler . handleException ( new SakuliReceiverException ( e , "error<seq2seq4repair_space>at<seq2seq4repair_space>the<seq2seq4repair_space>initializing<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>database" ) , true ) ; <END_BUG> } } }

Fix:
exceptionHandler . handleException ( new SakuliReceiverException ( e , "error<seq2seq4repair_space>at<seq2seq4repair_space>database<seq2seq4repair_space>initialization!" ) , true ) ;
Buggy code:
public class AbortEventServlet extends HttpServlet { private static final long serialVersionUID = 1L ; public AbortEventServlet ( ) { } protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } private void sendEmail ( Event event , List < String > peeps ) { User user = UserServiceFactory . getUserService ( ) . getCurrentUser ( ) ; DateFormat fmt = new SimpleDateFormat ( "yyyy.mm.dd<seq2seq4repair_space>E<seq2seq4repair_space>HH:mma" ) ; Services s = new Services ( ) ; String subject = "[Teammate<seq2seq4repair_space>Finder]<seq2seq4repair_space>We<seq2seq4repair_space>are<seq2seq4repair_space>sorry<seq2seq4repair_space>to<seq2seq4repair_space>notice<seq2seq4repair_space>that<seq2seq4repair_space>an<seq2seq4repair_space>event<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>canceled." ; String content = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "<p>Hi<seq2seq4repair_space>" + ( ",<seq2seq4repair_space>We<seq2seq4repair_space>are<seq2seq4repair_space>sorry<seq2seq4repair_space>to<seq2seq4repair_space>notice<seq2seq4repair_space>that<seq2seq4repair_space>the<seq2seq4repair_space>following<seq2seq4repair_space>event<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>canceled<seq2seq4repair_space>by<seq2seq4repair_space>the<seq2seq4repair_space>host:<//p>" + "<ul><li>Title:<seq2seq4repair_space><strong>" ) ) + ( event . getTitle ( ) ) ) + "<seq2seq4repair_space><//strong><//li>" ) + "<li>Category:<seq2seq4repair_space><strong>" ) + ( event . getCategory ( ) ) ) + "<seq2seq4repair_space><//strong><//li>" ) + "<li>Start<seq2seq4repair_space>Time:<seq2seq4repair_space><strong>" ) + ( fmt . format ( event . getStartDateTime ( ) ) ) ) + "<//strong><//li>" ) + "<li>End<seq2seq4repair_space>Time:<seq2seq4repair_space><strong>" ) + ( fmt . format ( event . getEndDateTime ( ) ) ) ) + "<//strong><//li>" ) + "<li>Address:<seq2seq4repair_space><strong>" ) + ( event . getLocation ( ) ) ) + "<//strong><//li>" ) + "<li>Contact:<seq2seq4repair_space><strong>" ) + ( event . getContact ( ) ) ) + "<//strong><//li>" ) + "<//ul><p>Wish<seq2seq4repair_space>you<seq2seq4repair_space>a<seq2seq4repair_space>good<seq2seq4repair_space>time<seq2seq4repair_space>in<seq2seq4repair_space>rest<seq2seq4repair_space>of<seq2seq4repair_space>your<seq2seq4repair_space>events!<//p>" ) + "<br//><p>Sincerely,<//p>" ) + "<p>Ryan,<seq2seq4repair_space>Harris,<seq2seq4repair_space>Ling<//p>" ; String recipients = "" ; for ( String r : peeps ) { recipients += r + "," ; } <START_BUG> recipients = recipients . substring ( 0 , ( ( recipients . length ( ) ) - 2 ) ) ; <END_BUG> s . sendNoticingMail ( subject , content , recipients , user . getNickname ( ) ) ; } }

Fix:
recipients = recipients . substring ( 0 , ( ( recipients . length ( ) ) - 1 ) ) ;
Buggy code:
public class PackageReferencePattern extends AndPattern { private static char [ ] [ ] TAGS = new char [ ] [ ] { IIndexConstants . REF } ; private char [ ] pkgName ; private char [ ] [ ] segments ; private int currentSegment ; private char [ ] decodedSegment ; public PackageReferencePattern ( char [ ] pkgName , int matchMode , boolean isCaseSensitive ) { } public void decodeIndexEntry ( IEntryResult entryResult ) { } public void feedIndexRequestor ( IIndexSearchRequestor requestor , int detailLevel , int [ ] references , IndexInput input , IJavaSearchScope scope ) throws IOException { } protected char [ ] [ ] getPossibleTags ( ) { } protected boolean hasNextQuery ( ) { } public char [ ] indexEntryPrefix ( ) { } protected int matchContainer ( ) { } private boolean matches ( char [ ] [ ] tokens ) { } protected boolean matchIndexEntry ( ) { } protected void matchReportReference ( AstNode reference , IJavaElement element , int accuracy , MatchLocator locator ) throws CoreException { char [ ] [ ] splitName = CharOperation . splitOn ( '.' , ( ( this . pkgName ) == null ? new char [ 0 ] : this . pkgName ) ) ; <START_BUG> locator . reportQualifiedReference ( reference . sourceStart , reference . sourceEnd , splitName , element , accuracy ) ; <END_BUG> } protected void resetQuery ( ) { } public String toString ( ) { } public int matchLevel ( AstNode node , boolean resolve ) { } private int matchLevel ( ImportReference importRef , boolean resolve ) { } private int matchLevel ( QualifiedNameReference qNameRef , boolean resolve ) { } private int matchLevel ( QualifiedTypeReference typeRef , boolean resolve ) { } }

Fix:
locator . reportAccurateReference ( reference . sourceStart , reference . sourceEnd , splitName , element , accuracy ) ;
Buggy code:
public class PalindromePermutation { public boolean canPermutePalindrome ( String s ) { <START_BUG> if ( ( s == null ) && ( ( s . length ( ) ) < 2 ) ) { <END_BUG> return true ; } Map < Character , Integer > map = new HashMap < > ( ) ; for ( int i = 0 ; i < ( s . length ( ) ) ; i ++ ) { char c = s . charAt ( i ) ; int val = 1 ; if ( map . containsKey ( c ) ) { val += map . get ( c ) ; } map . put ( c , val ) ; } int count = 0 ; for ( Map . Entry < Character , Integer > entry : map . entrySet ( ) ) { if ( ( ( entry . getValue ( ) ) % 2 ) != 0 ) { count ++ ; } } return count < 2 ; } }

Fix:
if ( ( s == null ) || ( ( s . length ( ) ) < 2 ) ) {
Buggy code:
public class ServerRemoveHandler extends AbstractRemoveStepHandler { public static final String OPERATION_NAME = REMOVE ; public static final ServerRemoveHandler INSTANCE = new ServerRemoveHandler ( ) ; protected ServerRemoveHandler ( ) { } @ Override protected void performRemove ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { super . performRemove ( context , operation , model ) ; final PathAddress address = PathAddress . pathAddress ( operation . get ( OP_ADDR ) ) ; final String serverName = address . getLastElement ( ) . getValue ( ) ; final ModelNode verifyOp = new ModelNode ( ) ; verifyOp . get ( OP ) . set ( "verify-running-server" ) ; verifyOp . get ( OP_ADDR ) . add ( HOST , address . getElement ( 0 ) . getValue ( ) ) ; <START_BUG> context . addStep ( context . getResult ( ) , verifyOp , new OperationStepHandler ( ) { <END_BUG> @ Override public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { final PathAddress serverAddress = EMPTY_ADDRESS . append ( PathElement . pathElement ( SERVER , serverName ) ) ; final ProxyController controller = context . getResourceRegistration ( ) . getProxyController ( serverAddress ) ; if ( ! ( context . getResourceRegistration ( ) . getChildNames ( EMPTY_ADDRESS ) . contains ( SERVER ) ) ) { throw new OperationFailedException ( new ModelNode ( ) . set ( context . getResourceRegistration ( ) . getChildNames ( EMPTY_ADDRESS ) . toString ( ) ) ) ; } if ( controller != null ) { context . getFailureDescription ( ) . set ( HostControllerMessages . MESSAGES . serverStillRunning ( serverName ) ) ; } context . stepCompleted ( ) ; } } , RUNTIME ) ; } protected boolean requiresRuntime ( OperationContext context ) { } }

Fix:
context . addStep ( verifyOp , new OperationStepHandler ( ) {
Buggy code:
public class TopologicalSort { public static < V > List < V > topologicalSort ( Digraph < V > g ) { } private static < V > void visit ( Digraph < V > g , V n , Set < V > visited , List < V > sorted ) { } public static < V > Set < V > findNodesWithNoIncomingEdges ( Digraph < V > g ) { } public static < V > Set < V > findNodesWithNoOutgoingEdges ( Digraph < V > g ) { Set < V > s = new HashSet < V > ( ) ; for ( V node : g . getNodes ( ) ) { <START_BUG> if ( g . nodesReferencing ( node ) . isEmpty ( ) ) { <END_BUG> s . add ( node ) ; } } return s ; } }

Fix:
if ( g . nodesReferencedFrom ( node ) . isEmpty ( ) ) {
Buggy code:
public class NullLiteral extends Expression { private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } NullLiteral ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { NullLiteral result = new NullLiteral ( target ) ; <START_BUG> result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <END_BUG> return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ;
Buggy code:
public class TestCompoundFile extends LuceneTestCase { public static void main ( String [ ] args ) { } private Directory dir ; public void setUp ( ) throws Exception { super . setUp ( ) ; File file = new File ( System . getProperty ( "tempDir" ) , "testIndex" ) ; _TestUtil . rmDir ( file ) ; <START_BUG> dir = FSDirectory . getDirectory ( file ) ; <END_BUG> } private void createRandomFile ( Directory dir , String name , int size ) throws IOException { } private void createSequenceFile ( Directory dir , String name , byte start , int size ) throws IOException { } private void assertSameStreams ( String msg , IndexInput expected , IndexInput test ) throws IOException { } private void assertSameStreams ( String msg , IndexInput expected , IndexInput actual , long seekTo ) throws IOException { } private void assertSameSeekBehavior ( String msg , IndexInput expected , IndexInput actual ) throws IOException { } private void assertEqualArrays ( String msg , byte [ ] expected , byte [ ] test , int start , int len ) { } public void testSingleFile ( ) throws IOException { } public void testTwoFiles ( ) throws IOException { } public void testRandomFiles ( ) throws IOException { } private void setUp_2 ( ) throws IOException { } public void testReadAfterClose ( ) throws IOException { } private void demo_FSIndexInputBug ( FSDirectory fsdir , String file ) throws IOException { } static boolean isCSIndexInput ( IndexInput is ) { } static boolean isCSIndexInputOpen ( IndexInput is ) throws IOException { } public void testClonedStreamsClosing ( ) throws IOException { } public void testRandomAccess ( ) throws IOException { } public void testRandomAccessClones ( ) throws IOException { } public void testFileNotFound ( ) throws IOException { } public void testReadPastEOF ( ) throws IOException { } public void testLargeWrites ( ) throws IOException { } }

Fix:
dir = FSDirectory . getDirectory ( file , null , false ) ;
Buggy code:
public final class NormalShader extends Shader { interface Resources extends DefaultResources { NormalShader . Resources INSTANCE = GWT . create ( NormalShader . Resources . class ) ; @ Source ( "source//normal.vs" ) TextResource getVertexShader ( ) { } @ Source ( "source//normal.fs" ) TextResource getFragmentShader ( ) { } } public NormalShader ( ) { } @ Override protected void initUniforms ( ) { } @ Override protected void updateVertexSource ( String src ) { List < String > vars = Arrays . asList ( MORPHTARGET_PARS , LOGDEPTHBUF_PAR ) ; List < String > main1 = Arrays . asList ( MORPHTARGET , DEFAULT , LOGDEPTHBUF ) ; <START_BUG> super . updateFragmentSource ( Shader . updateShaderSource ( src , vars , main1 ) ) ; <END_BUG> } @ Override protected void updateFragmentSource ( String src ) { } }

Fix:
super . updateVertexSource ( Shader . updateShaderSource ( src , vars , main1 ) ) ;
Buggy code:
public class YearMonthDV extends AbstractDateTimeDV { public Object getActualValue ( String content , ValidationContext context ) throws InvalidDatatypeValueException { } protected DateTimeData parse ( String str ) throws SchemaDateTimeException { } protected String dateToString ( DateTimeData date ) { } protected XMLGregorianCalendar getXMLGregorianCalendar ( DateTimeData date ) { <START_BUG> return factory . newXMLGregorianCalendar ( date . unNormYear , date . unNormMonth , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , ( date . hasTimeZone ( ) ? ( ( date . timezoneHr ) * 60 ) + ( date . timezoneMin ) : DatatypeConstants . FIELD_UNDEFINED ) ) ; <END_BUG> } }

Fix:
return datatypeFactory . newXMLGregorianCalendar ( date . unNormYear , date . unNormMonth , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , ( date . hasTimeZone ( ) ? ( ( date . timezoneHr ) * 60 ) + ( date . timezoneMin ) : DatatypeConstants . FIELD_UNDEFINED ) ) ;
Buggy code:
public class ThisReference extends Reference { public static final ThisReference ThisImplicit = new ThisReference ( ) ; public ThisReference ( ) { } public ThisReference ( int s , int sourceEnd ) { } protected boolean checkAccess ( MethodScope methodScope ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public boolean isThis ( ) { } public TypeBinding resolveType ( BlockScope scope ) { constant = NotAConstant ; if ( ( ( this ) != ( ThisReference . ThisImplicit ) ) && ( ! ( checkAccess ( scope . methodScope ( ) ) ) ) ) return null ; <START_BUG> return this . expressionType = scope . enclosingSourceType ( ) ; <END_BUG> } public String toStringExpression ( ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } }

Fix:
return this . resolvedType = scope . enclosingSourceType ( ) ;
Buggy code:
@ Singleton public class TenantOverdueConfigCacheLoader extends BaseCacheLoader { private static final Logger log = LoggerFactory . getLogger ( TenantOverdueConfigCacheLoader . class ) ; private final TenantInternalApi tenantApi ; @ Inject public TenantOverdueConfigCacheLoader ( final TenantInternalApi tenantApi ) { } @ Override public CacheType getCacheType ( ) { } @ Override public Object load ( final Object key , final Object argument ) { checkCacheLoaderStatus ( ) ; if ( ! ( key instanceof Long ) ) { throw new IllegalArgumentException ( ( "Unexpected<seq2seq4repair_space>key<seq2seq4repair_space>type<seq2seq4repair_space>of<seq2seq4repair_space>" + ( key . getClass ( ) . getName ( ) ) ) ) ; } if ( ! ( argument instanceof CacheLoaderArgument ) ) { throw new IllegalArgumentException ( ( "Unexpected<seq2seq4repair_space>argument<seq2seq4repair_space>type<seq2seq4repair_space>of<seq2seq4repair_space>" + ( argument . getClass ( ) . getName ( ) ) ) ) ; } final Long tenantRecordId = ( ( Long ) ( key ) ) ; final InternalTenantContext internalTenantContext = new InternalTenantContext ( tenantRecordId ) ; final CacheLoaderArgument cacheLoaderArgument = ( ( CacheLoaderArgument ) ( argument ) ) ; if ( ( ( cacheLoaderArgument . getArgs ( ) ) == null ) || ( ! ( ( cacheLoaderArgument . getArgs ( ) [ 0 ] ) instanceof TenantOverdueConfigCacheLoader . LoaderCallback ) ) ) { throw new IllegalArgumentException ( "Missing<seq2seq4repair_space>LoaderCallback<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>arguments" ) ; } final TenantOverdueConfigCacheLoader . LoaderCallback callback = ( ( TenantOverdueConfigCacheLoader . LoaderCallback ) ( cacheLoaderArgument . getArgs ( ) [ 0 ] ) ) ; final String overdueXML = tenantApi . getTenantOverdueConfig ( internalTenantContext ) ; if ( overdueXML == null ) { <START_BUG> return null ; <END_BUG> } try { TenantOverdueConfigCacheLoader . log . info ( ( "Loading<seq2seq4repair_space>overdue<seq2seq4repair_space>cache<seq2seq4repair_space>for<seq2seq4repair_space>tenant<seq2seq4repair_space>" + ( internalTenantContext . getTenantRecordId ( ) ) ) ) ; return callback . loadOverdueConfig ( overdueXML ) ; } catch ( final OverdueApiException e ) { throw new IllegalStateException ( String . format ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>de-serialize<seq2seq4repair_space>overdue<seq2seq4repair_space>config<seq2seq4repair_space>for<seq2seq4repair_space>tenant<seq2seq4repair_space>%s<seq2seq4repair_space>:<seq2seq4repair_space>%s" , internalTenantContext . getTenantRecordId ( ) , e . getMessage ( ) ) , e ) ; } } public interface LoaderCallback { public Object loadOverdueConfig ( final String overdueConfigXML ) throws OverdueApiException { } } }

Fix:
return EMPTY_VALUE_PLACEHOLDER ;
Buggy code:
public class HeaderSectionMyLabel extends WebMarkupContainer { private static final long serialVersionUID = 1L ; public HeaderSectionMyLabel ( final String id , final String label ) { } @ Override public void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { } @ Override protected IMarkupSourcingStrategy newMarkupSourcingStrategy ( ) { return new PanelMarkupSourcingStrategy ( ) { @ Override public IMarkupFragment getMarkup ( final MarkupContainer parent , final Component child ) { <START_BUG> MarkupStream markup = parent . getAssociatedMarkupStream ( true ) ; <END_BUG> markup . skipRawMarkup ( ) ; return markup . getMarkupFragment ( ) ; } @ Override public void onComponentTagBody ( Component component , MarkupStream markupStream , ComponentTag openTag ) { HeaderSectionMyLabel . this . onComponentTagBody ( markupStream , openTag ) ; } } ; } }

Fix:
MarkupStream markup = new MarkupStream ( parent . getAssociatedMarkup ( ) ) ;
Buggy code:
public class SearchTask extends ReadTask { public SearchTask ( PerfRunData runData ) { } public boolean withRetrieve ( ) { } public boolean withSearch ( ) { } public boolean withTraverse ( ) { } public boolean withWarm ( ) { } public QueryMaker getQueryMaker ( ) { <START_BUG> return getRunData ( ) . getSearchQueryMaker ( ) ; <END_BUG> } }

Fix:
return getRunData ( ) . getQueryMaker ( this ) ;
Buggy code:
public class CflowPointcut extends Pointcut { private Pointcut entry ; private boolean isBelow ; private int [ ] freeVars ; public static final ResolvedPointcutDefinition CFLOW_MARKER = new ResolvedPointcutDefinition ( null , 0 , null , TypeX . NONE , Pointcut . makeMatchesNothing ( RESOLVED ) ) ; public CflowPointcut ( Pointcut entry , boolean isBelow , int [ ] freeVars ) { } public FuzzyBoolean fastMatch ( FastMatchInfo type ) { } public FuzzyBoolean match ( Shadow shadow ) { } public void write ( DataOutputStream s ) throws IOException { } public static Pointcut read ( DataInputStream s , ISourceContext context ) throws IOException { } public void resolveBindings ( IScope scope , Bindings bindings ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public String toString ( ) { } public Test findResidue ( Shadow shadow , ExposedState state ) { } public Pointcut concretize1 ( ResolvedTypeX inAspect , IntMap bindings ) { IntMap entryBindings = new IntMap ( ) ; for ( int i = 0 , len = freeVars . length ; i < len ; i ++ ) { int freeVar = freeVars [ i ] ; entryBindings . put ( freeVar , i ) ; } entryBindings . copyContext ( bindings ) ; World world = inAspect . getWorld ( ) ; Pointcut concreteEntry ; ResolvedTypeX concreteAspect = bindings . getConcreteAspect ( ) ; CrosscuttingMembers xcut = concreteAspect . crosscuttingMembers ; Collection previousCflowEntries = xcut . getCflowEntries ( ) ; entryBindings . pushEnclosingDefinition ( CflowPointcut . CFLOW_MARKER ) ; try { concreteEntry = entry . concretize ( inAspect , entryBindings ) ; } finally { entryBindings . popEnclosingDefinitition ( ) ; } List innerCflowEntries = new ArrayList ( xcut . getCflowEntries ( ) ) ; innerCflowEntries . removeAll ( previousCflowEntries ) ; ResolvedMember cflowField = new ResolvedMember ( Member . FIELD , concreteAspect , ( ( ( Modifier . STATIC ) | ( Modifier . PUBLIC ) ) | ( Modifier . FINAL ) ) , NameMangler . cflowStack ( xcut ) , TypeX . forName ( CFLOW_STACK_TYPE ) . getSignature ( ) ) ; <START_BUG> concreteAspect . crosscuttingMembers . addConcreteShadowMunger ( Advice . makeCflowEntry ( world , concreteEntry , isBelow , cflowField , freeVars . length , innerCflowEntries ) ) ; <END_BUG> concreteAspect . crosscuttingMembers . addTypeMunger ( world . makeCflowStackFieldAdder ( cflowField ) ) ; List slots = new ArrayList ( ) ; for ( int i = 0 , len = freeVars . length ; i < len ; i ++ ) { int freeVar = freeVars [ i ] ; if ( ! ( bindings . hasKey ( freeVar ) ) ) continue ; int formalIndex = bindings . get ( freeVar ) ; ResolvedTypeX formalType = bindings . getAdviceSignature ( ) . getParameterTypes ( ) [ formalIndex ] . resolve ( world ) ; ConcreteCflowPointcut . Slot slot = new ConcreteCflowPointcut . Slot ( formalIndex , formalType , i ) ; slots . add ( slot ) ; } return new ConcreteCflowPointcut ( cflowField , slots ) ; } }

Fix:
concreteAspect . crosscuttingMembers . addConcreteShadowMunger ( Advice . makeCflowEntry ( world , concreteEntry , isBelow , cflowField , freeVars . length , innerCflowEntries , inAspect ) ) ;
Buggy code:
public final class LevelBuilder { private static Random rand = new Random ( ) ; public static final double MAX_EFISH_SPEED = 4 ; public static final double MIN_EFISH_SPEED = 1 ; public static final int FISH_SPRITES = 28 ; private LevelBuilder ( ) { } public static EnemyFish randomizedFish ( ICollisionArea ba ) { int minSize = ( ( int ) ( ( ba . getSize ( ) ) * 0.5 ) ) ; int maxSize = ( ( int ) ( ( ba . getSize ( ) ) * 2.5 ) ) ; int size = ( LevelBuilder . rand . nextInt ( ( ( maxSize - minSize ) + 1 ) ) ) + minSize ; Image sprite = LevelBuilder . getRandomSprite ( ) ; double ratio = ( sprite . getWidth ( ) ) // ( sprite . getHeight ( ) ) ; double width = Math . sqrt ( ( size * ratio ) ) ; double height = size // width ; double vx = 0.0 ; double vy = 0.0 ; Vec2d position = null ; <START_BUG> switch ( LevelBuilder . rand . nextInt ( 5 ) ) { <END_BUG> case 0 : position = new Vec2d ( ( - width ) , ( ( Math . random ( ) ) * ( PlayingField . WINDOW_Y ) ) ) ; vx = Math . abs ( LevelBuilder . randomSpeed ( ) ) ; vy = LevelBuilder . randomSpeed ( ) ; break ; case 1 : position = new Vec2d ( ( ( Math . random ( ) ) * ( PlayingField . WINDOW_X ) ) , ( - height ) ) ; vx = LevelBuilder . randomSpeed ( ) ; vy = - ( Math . abs ( LevelBuilder . randomSpeed ( ) ) ) ; break ; case 2 : position = new Vec2d ( ( ( PlayingField . WINDOW_X ) + width ) , ( ( Math . random ( ) ) * ( PlayingField . WINDOW_Y ) ) ) ; vx = - ( Math . abs ( LevelBuilder . randomSpeed ( ) ) ) ; vy = LevelBuilder . randomSpeed ( ) ; break ; default : position = new Vec2d ( ( ( Math . random ( ) ) * ( PlayingField . WINDOW_X ) ) , ( ( PlayingField . WINDOW_Y ) + height ) ) ; vx = LevelBuilder . randomSpeed ( ) ; vy = Math . abs ( LevelBuilder . randomSpeed ( ) ) ; break ; } EnemyFish eFish = new EnemyFish ( new BoundingBox ( position . x , position . y , ( ( position . x ) + width ) , ( ( position . y ) + height ) ) , sprite , vx , vy ) ; return eFish ; } private static Image getRandomSprite ( ) { } public static double randomSpeed ( ) { } }

Fix:
switch ( LevelBuilder . rand . nextInt ( 4 ) ) {
Buggy code:
public class HeapRowLocation extends DataType implements RowLocation { private long pageno ; private int recid ; private RecordHandle rh ; private static final int BASE_MEMORY_USAGE = ClassSize . estimateBaseFromCatalog ( HeapRowLocation . class ) ; private static final int RECORD_HANDLE_MEMORY_USAGE = ClassSize . estimateBaseFromCatalog ( RecordId . class ) ; public int estimateMemoryUsage ( ) { } public String getTypeName ( ) { } public void setValueFromResultSet ( ResultSet resultSet , int colNumber , boolean isNullable ) { } public DataValueDescriptor getNewNull ( ) { <START_BUG> return null ; <END_BUG> } public void setValue ( Object o ) { } public Object getObject ( ) { } public Object cloneObject ( ) { } public DataValueDescriptor getClone ( ) { } public int getLength ( ) { } public String getString ( ) { } public boolean compare ( int op , DataValueDescriptor other , boolean orderedNulls , boolean unknownRV ) { } public int compare ( DataValueDescriptor other ) { } HeapRowLocation ( RecordHandle rh ) { } public HeapRowLocation ( ) { } private HeapRowLocation ( HeapRowLocation other ) { } public RecordHandle getRecordHandle ( ContainerHandle ch ) throws StandardException { } void setFrom ( RecordHandle rh ) { } public int getTypeFormatId ( ) { } public boolean isNull ( ) { } public void writeExternal ( ObjectOutput out ) throws IOException { } public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { } public void readExternalFromArray ( ArrayInputStream in ) throws IOException , ClassNotFoundException { } public void restoreToNull ( ) { } protected void setFrom ( DataValueDescriptor theValue ) { } public boolean equals ( Object ref ) { } public int hashCode ( ) { } public String toString ( ) { } }

Fix:
return new HeapRowLocation ( ) ;
Buggy code:
public class LongLiteral extends NumberLiteral { long value ; static final Constant FORMAT_ERROR = new DoubleConstant ( ( 1.0 // 0.0 ) ) ; public LongLiteral ( char [ ] token , int s , int e ) { } public LongLiteral ( char [ ] token , int s , int e , long value ) { } public void computeConstant ( ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public TypeBinding literalType ( BlockScope scope ) { <START_BUG> return LongBinding ; <END_BUG> } public final boolean mayRepresentMIN_VALUE ( ) { } public TypeBinding resolveType ( BlockScope scope ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
return TypeBinding . LONG ;
Buggy code:
final class JVMOptionRemoveHandler implements OperationStepHandler , DescriptionProvider { static final String OPERATION_NAME = "remove-jvm-option" ; static final JVMOptionRemoveHandler INSTANCE = new JVMOptionRemoveHandler ( ) ; private final ParameterValidator validator = new StringLengthValidator ( 1 ) ; @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { validator . validateParameter ( JVM_OPTION , operation . get ( JVM_OPTION ) ) ; final Resource resource = context . readResourceForUpdate ( EMPTY_ADDRESS ) ; final ModelNode model = resource . getModel ( ) ; final ModelNode option = operation . require ( JVM_OPTION ) ; if ( model . hasDefined ( JVM_OPTIONS ) ) { final ModelNode values = model . get ( JVM_OPTIONS ) . clone ( ) ; model . get ( JVM_OPTIONS ) . setEmptyList ( ) ; for ( ModelNode value : values . asList ( ) ) { if ( ! ( value . equals ( option ) ) ) { model . get ( JVM_OPTIONS ) . add ( value ) ; } } } <START_BUG> context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; <END_BUG> } @ Override public ModelNode getModelDescription ( Locale locale ) { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class SimpleBrokerMessageHandler extends AbstractBrokerMessageHandler { private static final byte [ ] EMPTY_PAYLOAD = new byte [ 0 ] ; private final MessageChannel messageChannel ; private SubscriptionRegistry subscriptionRegistry = new DefaultSubscriptionRegistry ( ) ; public SimpleBrokerMessageHandler ( MessageChannel messageChannel , Collection < String > destinationPrefixes ) { } public MessageChannel getMessageChannel ( ) { } public void setSubscriptionRegistry ( SubscriptionRegistry subscriptionRegistry ) { } public SubscriptionRegistry getSubscriptionRegistry ( ) { } @ Override public void startInternal ( ) { } @ Override public void stopInternal ( ) { } @ Override protected void handleMessageInternal ( Message < ? > message ) { SimpMessageHeaderAccessor headers = SimpMessageHeaderAccessor . wrap ( message ) ; SimpMessageType messageType = headers . getMessageType ( ) ; String destination = headers . getDestination ( ) ; if ( ! ( checkDestinationPrefix ( destination ) ) ) { if ( logger . isTraceEnabled ( ) ) { <START_BUG> logger . trace ( ( "Ingoring<seq2seq4repair_space>message<seq2seq4repair_space>to<seq2seq4repair_space>destination=" + destination ) ) ; <END_BUG> } return ; } if ( SUBSCRIBE . equals ( messageType ) ) { this . subscriptionRegistry . registerSubscription ( message ) ; } else if ( UNSUBSCRIBE . equals ( messageType ) ) { this . subscriptionRegistry . unregisterSubscription ( message ) ; } else if ( MESSAGE . equals ( messageType ) ) { sendMessageToSubscribers ( headers . getDestination ( ) , message ) ; } else if ( DISCONNECT . equals ( messageType ) ) { String sessionId = headers . getSessionId ( ) ; this . subscriptionRegistry . unregisterAllSubscriptions ( sessionId ) ; } else if ( CONNECT . equals ( messageType ) ) { SimpMessageHeaderAccessor replyHeaders = SimpMessageHeaderAccessor . create ( CONNECT_ACK ) ; replyHeaders . setSessionId ( headers . getSessionId ( ) ) ; replyHeaders . setHeader ( CONNECT_MESSAGE_HEADER , message ) ; Message < byte [ ] > connectAck = MessageBuilder . withPayload ( SimpleBrokerMessageHandler . EMPTY_PAYLOAD ) . setHeaders ( replyHeaders ) . build ( ) ; this . messageChannel . send ( connectAck ) ; } } protected void sendMessageToSubscribers ( String destination , Message < ? > message ) { } }

Fix:
logger . trace ( ( "Ignoring<seq2seq4repair_space>message<seq2seq4repair_space>to<seq2seq4repair_space>destination=" + destination ) ) ;
Buggy code:
public class SSTableWriterTest extends CleanupHelper { @ Test public void testRecoverAndOpen ( ) throws IOException , InterruptedException , ExecutionException { RowMutation rm ; rm = new RowMutation ( "Keyspace1" , ByteBufferUtil . bytes ( "k1" ) ) ; rm . add ( new org . apache . cassandra . db . filter . QueryPath ( "Indexed1" , null , ByteBufferUtil . bytes ( "birthdate" ) ) , FBUtilities . toByteBuffer ( 1L ) , 0 ) ; rm . apply ( ) ; ColumnFamily cf = ColumnFamily . create ( "Keyspace1" , "Indexed1" ) ; cf . addColumn ( new Column ( ByteBufferUtil . bytes ( "birthdate" ) , FBUtilities . toByteBuffer ( 1L ) , 0 ) ) ; cf . addColumn ( new Column ( ByteBufferUtil . bytes ( "anydate" ) , FBUtilities . toByteBuffer ( 1L ) , 0 ) ) ; Map < ByteBuffer , ByteBuffer > entries = new HashMap < ByteBuffer , ByteBuffer > ( ) ; DataOutputBuffer buffer = new DataOutputBuffer ( ) ; ColumnFamily . serializer ( ) . serializeWithIndexes ( cf , buffer ) ; entries . put ( ByteBufferUtil . bytes ( "k2" ) , ByteBuffer . wrap ( Arrays . copyOf ( buffer . getData ( ) , buffer . getLength ( ) ) ) ) ; cf . clear ( ) ; cf . addColumn ( new Column ( ByteBufferUtil . bytes ( "anydate" ) , FBUtilities . toByteBuffer ( 1L ) , 0 ) ) ; buffer = new DataOutputBuffer ( ) ; ColumnFamily . serializer ( ) . serializeWithIndexes ( cf , buffer ) ; entries . put ( ByteBufferUtil . bytes ( "k3" ) , ByteBuffer . wrap ( Arrays . copyOf ( buffer . getData ( ) , buffer . getLength ( ) ) ) ) ; <START_BUG> SSTableReader orig = SSTableUtils . writeRawSSTable ( "Keyspace1" , "Indexed1" , entries ) ; <END_BUG> FileUtils . deleteWithConfirm ( orig . descriptor . filenameFor ( PRIMARY_INDEX ) ) ; FileUtils . deleteWithConfirm ( orig . descriptor . filenameFor ( FILTER ) ) ; SSTableReader sstr = instance . submitSSTableBuild ( orig . descriptor , AES ) . get ( ) ; assert sstr != null ; ColumnFamilyStore cfs = Table . open ( "Keyspace1" ) . getColumnFamilyStore ( "Indexed1" ) ; cfs . addSSTable ( sstr ) ; cfs . buildSecondaryIndexes ( cfs . getSSTables ( ) , cfs . getIndexedColumns ( ) ) ; IndexExpression expr = new IndexExpression ( ByteBufferUtil . bytes ( "birthdate" ) , IndexOperator . EQ , FBUtilities . toByteBuffer ( 1L ) ) ; IndexClause clause = new IndexClause ( Arrays . asList ( expr ) , FBUtilities . EMPTY_BYTE_BUFFER , 100 ) ; IFilter filter = new IdentityQueryFilter ( ) ; IPartitioner p = StorageService . getPartitioner ( ) ; Range range = new Range ( p . getMinimumToken ( ) , p . getMinimumToken ( ) ) ; List < Row > rows = cfs . scan ( clause , range , filter ) ; assertEquals ( "IndexExpression<seq2seq4repair_space>should<seq2seq4repair_space>return<seq2seq4repair_space>two<seq2seq4repair_space>rows<seq2seq4repair_space>on<seq2seq4repair_space>recoverAndOpen" , 2 , rows . size ( ) ) ; assertTrue ( "First<seq2seq4repair_space>result<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>'k1'" , ByteBufferUtil . bytes ( "k1" ) . equals ( rows . get ( 0 ) . key . key ) ) ; } }

Fix:
SSTableReader orig = SSTableUtils . prepare ( ) . cf ( "Indexed1" ) . writeRaw ( entries ) ;
Buggy code:
public class TransformersTestParameters { private final ModelVersion modelVersion ; private final TestControllerVersion testControllerVersion ; public TransformersTestParameters ( ModelVersion modelVersion , TestControllerVersion testControllerVersion ) { } protected TransformersTestParameters ( TransformersTestParameters delegate ) { } public ModelVersion getModelVersion ( ) { } public TestControllerVersion getTestControllerVersion ( ) { } public static List < Object [ ] > setupVersions ( ) { List < Object [ ] > data = new ArrayList < Object [ ] > ( ) ; data . add ( new Object [ ] { new TransformersTestParameters ( ModelVersion . create ( 1 , 2 , 0 ) , TestControllerVersion . V7_1_2_FINAL ) } ) ; <START_BUG> data . add ( new Object [ ] { new TransformersTestParameters ( ModelVersion . create ( 1 , 3 , 0 ) , TestControllerVersion . V7_1_2_FINAL ) } ) ; <END_BUG> data . add ( new Object [ ] { new TransformersTestParameters ( ModelVersion . create ( 1 , 4 , 0 ) , TestControllerVersion . MASTER ) } ) ; for ( int i = 0 ; i < ( data . size ( ) ) ; i ++ ) { Object [ ] entry = data . get ( i ) ; System . out . println ( ( ( ( "Parameter<seq2seq4repair_space>" + i ) + ":<seq2seq4repair_space>" ) + ( entry [ 0 ] ) ) ) ; } return data ; } @ Override public String toString ( ) { } }

Fix:
data . add ( new Object [ ] { new TransformersTestParameters ( ModelVersion . create ( 1 , 3 , 0 ) , TestControllerVersion . V7_1_3_FINAL ) } ) ;
Buggy code:
public class RequestHandler extends Route { private final Searcher searcher ; private final Set < String > supportedLanguages ; protected RequestHandler ( String path , Searcher searcher , String languages ) { } @ Override public String handle ( Request request , Response response ) { String reverse = request . queryParams ( "reverse" ) ; String query = request . queryParams ( "q" ) ; if ( ( query == null ) && ( reverse == null ) ) { halt ( 400 , "missing<seq2seq4repair_space>search<seq2seq4repair_space>term<seq2seq4repair_space>'q':<seq2seq4repair_space>//?q=berlin<seq2seq4repair_space>or<seq2seq4repair_space>'reverse':<seq2seq4repair_space>//?reverse=true" ) ; } String lang = request . queryParams ( "lang" ) ; if ( lang == null ) lang = "en" ; if ( ! ( supportedLanguages . contains ( lang ) ) ) { halt ( 400 , ( ( ( "language<seq2seq4repair_space>" + lang ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>supported,<seq2seq4repair_space>supported<seq2seq4repair_space>languages<seq2seq4repair_space>are:<seq2seq4repair_space>" ) + ( Joiner . on ( ",<seq2seq4repair_space>" ) . join ( supportedLanguages ) ) ) ) ; } Double lon = null ; Double lat = null ; try { lon = Double . valueOf ( request . queryParams ( "lon" ) ) ; lat = Double . valueOf ( request . queryParams ( "lat" ) ) ; } catch ( Exception nfe ) { } if ( ( ( reverse != null ) && ( reverse . equalsIgnoreCase ( "true" ) ) ) && ( ( lat == null ) || ( lon == null ) ) ) { halt ( 400 , "missing<seq2seq4repair_space>search<seq2seq4repair_space>term<seq2seq4repair_space>'lat'<seq2seq4repair_space>and//or<seq2seq4repair_space>'lon':<seq2seq4repair_space>//?reverse=true&lat=51.5&lon=8.0" ) ; } int limit ; try { limit = Math . min ( 50 , Integer . parseInt ( request . queryParams ( "limit" ) ) ) ; } catch ( Exception e ) { limit = 15 ; } List < JSONObject > results ; if ( ( reverse != null ) && ( reverse . equalsIgnoreCase ( "true" ) ) ) { results = searcher . reverse ( lang , lon , lat ) ; } else { results = searcher . search ( query , lang , lon , lat , limit , true ) ; } <START_BUG> if ( results . isEmpty ( ) ) { <END_BUG> results = searcher . search ( query , lang , lon , lat , limit , false ) ; } final JSONObject collection = new JSONObject ( ) ; collection . put ( "type" , "FeatureCollection" ) ; collection . put ( "features" , new org . json . JSONArray ( results ) ) ; response . type ( "application//json;<seq2seq4repair_space>charset=utf-8" ) ; response . header ( "Access-Control-Allow-Origin" , "*" ) ; if ( ( request . queryParams ( "debug" ) ) != null ) return collection . toString ( 4 ) ; return collection . toString ( ) ; } }

Fix:
if ( ( results . isEmpty ( ) ) && ( ( reverse == null ) || ( ! ( reverse . equalsIgnoreCase ( "true" ) ) ) ) ) {
Buggy code:
public abstract class SpringWebApplication extends WebApplication implements ApplicationContextAware { private ApplicationContext applicationContext ; private static final ISpringContextLocator contextLocator = new ISpringContextLocator ( ) { public ApplicationContext getSpringContext ( ) { } } ; public SpringWebApplication ( ) { } protected void internalInit ( ) { super . internalInit ( ) ; if ( ( applicationContext ) == null ) { <START_BUG> ServletContext sc = getWicketServlet ( ) . getServletContext ( ) ; <END_BUG> applicationContext = WebApplicationContextUtils . getRequiredWebApplicationContext ( sc ) ; } } public final void setApplicationContext ( ApplicationContext applicationContext ) throws BeansException { } protected final ApplicationContext internalGetApplicationContext ( ) { } public ISpringContextLocator getSpringContextLocator ( ) { } protected Object createSpringBeanProxy ( Class clazz , String beanName ) { } protected Object createSpringBeanProxy ( Class clazz ) { } }

Fix:
ServletContext sc = getServletContext ( ) ;
Buggy code:
public final class DeXTable extends AbstractMap < Object , Object > implements DeXIterable < Object > { private Set < Map . Entry < Object , Object > > underlying ; private DeXArray array ; private boolean isArray = true ; SerializationMap serialization ; String tag ; public static DeXTable create ( Map < ? , ? > m ) { } public static DeXTable create ( Map < ? , ? > m , String tag ) { } public static DeXTable create ( Iterable < ? > i ) { } public static DeXTable create ( Iterable < ? > i , String tag ) { } private DeXTable ( int size , String tag ) { } public static DeXTable . Builder builder ( String tag , int size ) { } public static DeXTable . Builder builder ( int size ) { } public static DeXTable . Builder builder ( String tag ) { } public static DeXTable . Builder builder ( ) { } public static class Builder { private DeXTable table ; private Builder ( int size , String tag ) { } public DeXTable . Builder put ( Object key , Object value ) { if ( ( table ) == null ) throw new IllegalStateException ( "Builder<seq2seq4repair_space>finished!" ) ; int i = table . size ( ) ; if ( ( key == null ) || ( value == null ) ) throw new IllegalArgumentException ( "DeXTable<seq2seq4repair_space>doesn't<seq2seq4repair_space>allow<seq2seq4repair_space>null<seq2seq4repair_space>keys<seq2seq4repair_space>or<seq2seq4repair_space>values!" ) ; if ( ( ( value instanceof DeXTable ) || ( DeX . isPrimitive ( value ) ) ) && ( ( key instanceof DeXTable ) || ( DeX . isPrimitive ( key ) ) ) ) { <START_BUG> if ( ( ! ( table . isArray ) ) && ( ! ( key . equals ( i ) ) ) ) <END_BUG> table . isArray = false ; table . underlying . add ( new AbstractMap . SimpleImmutableEntry < > ( key , value ) ) ; return this ; } throw new IllegalArgumentException ( "DeXTable<seq2seq4repair_space>only<seq2seq4repair_space>allows<seq2seq4repair_space>String,<seq2seq4repair_space>DeXTable<seq2seq4repair_space>and<seq2seq4repair_space>numbers!" ) ; } public DeXTable . Builder add ( Object value ) { } public DeXTable . Builder addAll ( Iterable < ? > iterable ) { } public DeXTable . Builder addAll ( Map < ? , ? > map ) { } public DeXTable create ( ) { } } @ Override public int size ( ) { } @ Override public Iterator < Object > iterator ( ) { } @ Override public String tag ( ) { } @ Override public Set < Map . Entry < Object , Object > > entrySet ( ) { } @ Override public DeXArray values ( ) { } public boolean isArray ( ) { } public DeXArray toDeXArray ( ) { } public < T extends DeXSerializable > T deserialize ( Class < T > target ) { } public < T > T deserialize ( ) { } public HashMap < Object , Object > copy ( ) { } @ Override public String toString ( ) { } }

Fix:
if ( ( table . isArray ) && ( ! ( key . equals ( i ) ) ) )