nus-yam/ex-repair huggingface dataset:
Buggy code:
public class FastVectorHighlighterTest extends LuceneTestCase { private static final String FIELD = "text" ; public void testSimpleHighlightTest ( ) throws IOException { } public void testPhraseHighlightLongTextTest ( ) throws IOException { } public void testPhraseHighlightTest ( ) throws IOException { } public void testCommonTermsQueryHighlightTest ( ) throws IOException { } public void testLotsOfPhrases ( ) throws IOException { Directory dir = newDirectory ( ) ; IndexWriter writer = new IndexWriter ( dir , newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) , MockTokenizer . SIMPLE , true , MockTokenFilter . ENGLISH_STOPSET ) ) ) ; FieldType type = new FieldType ( TextField . TYPE_STORED ) ; type . setStoreTermVectorOffsets ( true ) ; type . setStoreTermVectorPositions ( true ) ; type . setStoreTermVectors ( true ) ; type . freeze ( ) ; String [ ] terms = new String [ ] { "org" , "apache" , "lucene" } ; <START_BUG> int iters = atLeast ( 1000 ) ; <END_BUG> StringBuilder builder = new StringBuilder ( ) ; for ( int i = 0 ; i < iters ; i ++ ) { builder . append ( terms [ random ( ) . nextInt ( terms . length ) ] ) . append ( "<seq2seq4repair_space>" ) ; if ( ( random ( ) . nextInt ( 6 ) ) == 3 ) { builder . append ( "solr" ) . append ( "<seq2seq4repair_space>" ) ; } } Document doc = new Document ( ) ; Field field = new Field ( "field" , builder . toString ( ) , type ) ; doc . add ( field ) ; writer . addDocument ( doc ) ; PhraseQuery query = new PhraseQuery ( ) ; query . add ( new Term ( "field" , "org" ) ) ; query . add ( new Term ( "field" , "apache" ) ) ; query . add ( new Term ( "field" , "lucene" ) ) ; FastVectorHighlighter highlighter = new FastVectorHighlighter ( ) ; IndexReader reader = DirectoryReader . open ( writer , true ) ; IndexSearcher searcher = newSearcher ( reader ) ; TopDocs hits = searcher . search ( query , 10 ) ; assertEquals ( 1 , hits . totalHits ) ; FieldQuery fieldQuery = highlighter . getFieldQuery ( query , reader ) ; String [ ] bestFragments = highlighter . getBestFragments ( fieldQuery , reader , hits . scoreDocs [ 0 ] . doc , "field" , 1000 , 1 ) ; for ( int i = 0 ; i < ( bestFragments . length ) ; i ++ ) { String result = bestFragments [ i ] . replaceAll ( "<b>org<seq2seq4repair_space>apache<seq2seq4repair_space>lucene<//b>" , "FOOBAR" ) ; assertFalse ( result . contains ( "org<seq2seq4repair_space>apache<seq2seq4repair_space>lucene" ) ) ; } reader . close ( ) ; writer . close ( ) ; dir . close ( ) ; } public void testOverlappingPhrases ( ) throws IOException { } public void testPhraseWithGap ( ) throws IOException { } private static class SynonymFilter extends TokenFilter { final CharTermAttribute termAtt = addAttribute ( CharTermAttribute . class ) ; final PositionIncrementAttribute posIncAtt = addAttribute ( PositionIncrementAttribute . class ) ; State pending ; protected SynonymFilter ( TokenStream input ) { } @ Override public boolean incrementToken ( ) throws IOException { } @ Override public void reset ( ) throws IOException { } } }

Fix:
int iters = 1000 ;
Buggy code:
public class AutorizadorInterceptor extends HandlerInterceptorAdapter { @ Override public boolean preHandle ( HttpServletRequest request , HttpServletResponse response , Object controller ) throws Exception { String uri = request . getRequestURI ( ) ; if ( ( ( ( ( ( ( ( uri . endsWith ( "//" ) ) || ( uri . endsWith ( "//entrar" ) ) ) || ( uri . endsWith ( "//cadastrar-usuario" ) ) ) || ( uri . endsWith ( "//autenticar-usuario" ) ) ) || ( uri . endsWith ( "head" ) ) ) || ( uri . endsWith ( "nav" ) ) ) || ( uri . endsWith ( "scripts" ) ) ) || ( uri . contains ( "resources" ) ) ) { return true ; } if ( ( request . getSession ( ) . getAttribute ( "ehAdministrador" ) ) != null ) { return true ; } else if ( ( request . getSession ( ) . getAttribute ( "usuarioLogado" ) ) != null ) { return true ; } <START_BUG> response . sendRedirect ( "//" ) ; <END_BUG> return false ; } No newline ; at end ; of file ; }

Fix:
response . sendRedirect ( "//entrar" ) ;
Buggy code:
public class DigestProxyAuthenticator implements ProxyAuthenticator { private static final Logger LOG = LoggerFactory . getLogger ( DigestProxyAuthenticator . class ) ; private static final String authMethod = "auth" ; private static final String userName = "lubin" ; private static final String password = "lubin" ; private static final String realm = "Restricted<seq2seq4repair_space>Files" ; private static String nonce = DigestProxyAuthenticator . calculateNonce ( ) ; @ Override public boolean authenticate ( HttpRequest request ) { } @ Override public String getAuthenticateHeader ( ) { String header = "" ; header += ( "Digest<seq2seq4repair_space>realm=\"" + ( DigestProxyAuthenticator . realm ) ) + "\"," ; if ( ! ( StringUtils . isBlank ( DigestProxyAuthenticator . authMethod ) ) ) { header += ( "qop=" + ( DigestProxyAuthenticator . authMethod ) ) + "," ; } header += ( "nonce=\"" + ( DigestProxyAuthenticator . nonce ) ) + "\"," ; <START_BUG> header += "domain=\"//\"," ; <END_BUG> header += ( "opaque=\"" + ( DigestProxyAuthenticator . getOpaque ( DigestProxyAuthenticator . realm , DigestProxyAuthenticator . nonce ) ) ) + "\"" ; return header ; } private static HashMap < String , String > parseHeader ( String headerString ) { } public static String calculateNonce ( ) { } private static String getOpaque ( String domain , String nonce ) { } }

Fix:
header += "domain=\"//https:////proxy08.xiaoman.cn:1433//<seq2seq4repair_space>http:////proxy08.xiaoman.cn:1433//\"," ;
Buggy code:
public class CLITestUtil { private static final String JBOSS_CLI_CONFIG = "jboss.cli.config" ; private static final String JREADLINE_TERMINAL = "jreadline.terminal" ; private static final String JREADLINE_TEST_TERMINAL = "org.jboss.jreadline.terminal.TestTerminal" ; private static final String serverAddr = TestSuiteEnvironment . getServerAddress ( ) ; private static final int serverPort = TestSuiteEnvironment . getServerPort ( ) ; public static CommandContext getCommandContext ( ) throws CliInitializationException { CLITestUtil . setJBossCliConfig ( ) ; <START_BUG> return CommandContextFactory . getInstance ( ) . newCommandContext ( CLITestUtil . serverAddr , CLITestUtil . serverPort , null , null ) ; <END_BUG> } public static CommandContext getCommandContext ( String address , int port , String user , char [ ] pwd , InputStream in , OutputStream out ) throws CliInitializationException { } public static CommandContext getCommandContext ( OutputStream out ) throws CliInitializationException { } protected static void setJBossCliConfig ( ) { } }

Fix:
return CommandContextFactory . getInstance ( ) . newCommandContext ( "http-remoting" , CLITestUtil . serverAddr , CLITestUtil . serverPort , null , null ) ;
Buggy code:
public class XTSExtension implements Extension { public static final String SUBSYSTEM_NAME = "xts" ; private static final XTSExtension . XTSSubsystemParser parser = new XTSExtension . XTSSubsystemParser ( ) ; public void initialize ( ExtensionContext context ) { } public void initializeParsers ( ExtensionParsingContext context ) { } private static ModelNode createEmptyAddOperation ( ) { } static class XTSSubsystemParser implements XMLStreamConstants , XMLElementReader < List < ModelNode > > , XMLElementWriter < SubsystemMarshallingContext > { @ Override public void readElement ( XMLExtendedStreamReader reader , List < ModelNode > list ) throws XMLStreamException { } static ModelNode parseXTSEnvironmentElement ( XMLExtendedStreamReader reader ) throws XMLStreamException { final ModelNode store = new ModelNode ( ) ; final int count = reader . getAttributeCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { ParseUtils . requireNoNamespaceAttribute ( reader , i ) ; final String value = reader . getAttributeValue ( i ) ; final Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; switch ( attribute ) { case URL : <START_BUG> store . get ( URL ) . set ( value ) ; <END_BUG> break ; default : throw ParseUtils . unexpectedAttribute ( reader , i ) ; } } ParseUtils . requireNoContent ( reader ) ; return store ; } @ Override public void writeContent ( XMLExtendedStreamWriter writer , SubsystemMarshallingContext context ) throws XMLStreamException { } private boolean has ( ModelNode node , String name ) { } private void writeAttribute ( final XMLExtendedStreamWriter writer , final Attribute attr , final ModelNode value ) throws XMLStreamException { } } }

Fix:
store . get ( URL ) . set ( ParseUtils . parsePossibleExpression ( value ) ) ;
Buggy code:
public class EJB3IIOPAdd extends AbstractBoottimeAddStepHandler { static final EJB3IIOPAdd INSTANCE = new EJB3IIOPAdd ( ) ; private EJB3IIOPAdd ( ) { } static ModelNode create ( final boolean enableByDefault , final boolean useQualifiedName ) { } @ Override protected void performBoottime ( final OperationContext context , final ModelNode operation , final ModelNode model , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers ) throws OperationFailedException { final Boolean enableByDefault = ENABLE_BY_DEFAULT . resolveModelAttribute ( context , model ) . asBoolean ( ) ; final Boolean useQualifiedName = USE_QUALIFIED_NAME . resolveModelAttribute ( context , model ) . asBoolean ( ) ; final IIOPSettingsService settingsService = new IIOPSettingsService ( enableByDefault , useQualifiedName ) ; context . addStep ( new AbstractDeploymentChainStep ( ) { protected void execute ( DeploymentProcessorTarget processorTarget ) { EjbLogger . ROOT_LOGGER . debug ( "Adding<seq2seq4repair_space>EJB<seq2seq4repair_space>IIOP<seq2seq4repair_space>support" ) ; <START_BUG> processorTarget . addDeploymentProcessor ( POST_MODULE , POST_MODULE_EJB_IIOP , new org . jboss . as . ejb3 . deployment . processors . EjbIIOPDeploymentUnitProcessor ( settingsService ) ) ; <END_BUG> } } , RUNTIME ) ; newControllers . add ( context . getServiceTarget ( ) . addService ( SERVICE_NAME , settingsService ) . install ( ) ) ; } @ Override protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { } }

Fix:
processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_IIOP , new org . jboss . as . ejb3 . deployment . processors . EjbIIOPDeploymentUnitProcessor ( settingsService ) ) ;
Buggy code:
public class MainFunctions { public static final int NOTIFICATION_ID_RUNNING = 1 ; public static final String INTENT_DATA_STATE = "DATA_STATE" ; public static int PERIOD_24_HOURS = ( ( 1000 * 60 ) * 60 ) * 24 ; static GeneralReceiver networkReceiver = new GeneralReceiver ( ) ; public static void startScheduler ( Context context , boolean syncFirst ) { Log . i ( "BatteryFu" , "Starting<seq2seq4repair_space>scheduler" ) ; Settings settings = Settings . getSettings ( context ) ; MainFunctions . showNotification ( context , settings , context . getString ( starting ) ) ; <START_BUG> context . getContentResolver ( ) . cancelSync ( null ) ; <END_BUG> Intent active = new Intent ( context , ToggleWidget . class ) ; active . setAction ( ACTION_WIDGET_RECEIVER ) ; active . setData ( Uri . parse ( "batteryfu:////enabled" ) ) ; context . sendBroadcast ( active ) ; settings . setDataStateOn ( true ) ; settings . setSyncOnData ( false ) ; settings . setIsNightmode ( false ) ; settings . setIsTravelMode ( false ) ; settings . setDisconnectOnScreenOff ( false ) ; Settings . getSettings ( context ) . setLastWakeTime ( System . currentTimeMillis ( ) ) ; AlarmManager am = ( ( AlarmManager ) ( context . getSystemService ( ALARM_SERVICE ) ) ) ; MainFunctions . setupNightMode ( context , settings , am ) ; if ( settings . isNightmodeOnly ( ) ) { MainFunctions . showNotification ( context , settings , context . getString ( data_enabled_until_next_night_mode_start ) ) ; DataToggler . enableData ( context , false ) ; } else { MainFunctions . setupDataAlarms ( context , am , syncFirst ) ; if ( DataToggler . disableData ( context , true ) ) { MainFunctions . showNotificationWaitingForSync ( context , settings ) ; } else { DataToggler . enableData ( context , false ) ; } } } public static void stopScheduler ( Context context ) { } static void setupDataAlarms ( Context context , AlarmManager am , boolean startNow ) { } static void setupNightMode ( Context context , Settings settings , AlarmManager am ) { } static void teardownDataAlarms ( Context context , AlarmManager am ) { } static void teardownNightMode ( Context context , AlarmManager am ) { } public static void cancelNotification ( Context context ) { } public static void showNotification ( Context context , Settings settings , String text ) { } public static void showNotificationWaitingForSync ( Context context , Settings settings ) { } public static void startSync ( Context context ) { } }

Fix:
ContentResolver . cancelSync ( null , null ) ;
Buggy code:
@ Service @ ComponentScan ( basePackages = "ua.com.jobsukraine.security" ) @ Transactional public class CandidateServiceImpl implements CandidateService { @ Autowired private CandidateRepository candidateRepository ; @ Autowired private RoleService roleService ; @ Autowired private CategoryRepository categoryRepository ; @ Autowired private LoginInfoRepository loginInfoRepository ; @ Override public Candidate register ( Candidate candidate , LoginInfo info ) { } @ Override public void delete ( int id ) { } @ Override public Candidate edit ( Candidate candidate ) { } @ Override public Candidate find ( int id ) { } @ Override public Candidate findByLogin ( String login ) { Candidate c = null ; try { c = candidateRepository . findByInfo ( loginInfoRepository . findByLogin ( login ) ) ; <START_BUG> if ( ( candidateRepository . getFeedbacks ( c . getId ( ) ) ) != null ) <END_BUG> c . setRating ( candidateRepository . getGlobalRating ( c . getId ( ) ) ) ; } catch ( EmptyResultDataAccessException e ) { } return c ; } @ Override public List < Vacancy > getAvailableVacancies ( String login ) { } @ Override public int getAge ( String login ) { } public List < Feedback > getFeedbacks ( int id ) { } @ Override public Candidate add ( Candidate candidate ) { } }

Fix:
if ( ( candidateRepository . getFeedbacks ( c . getId ( ) ) . size ( ) ) > 0 )
Buggy code:
public class JMeterTreeNode extends DefaultMutableTreeNode implements JMeterGUIComponent { private static transient Logger log = Hierarchy . getDefaultHierarchy ( ) . getLoggerFor ( "jmeter.gui" ) ; JMeterTreeModel treeModel ; boolean enabled = true ; public JMeterTreeNode ( TestElement userObj , JMeterTreeModel treeModel ) { } public boolean isEnabled ( ) { } public void setEnabled ( boolean enabled ) { } public void clear ( ) { } public ImageIcon getIcon ( ) { } public Collection getMenuCategories ( ) { } public JPopupMenu createPopupMenu ( ) { } public void configure ( TestElement element ) { } public void modifyTestElement ( TestElement el ) { } public TestElement createTestElement ( ) { } public String getStaticLabel ( ) { <START_BUG> return ( ( TestElement ) ( getUserObject ( ) ) ) . getPropertyAsString ( NAME ) ; <END_BUG> } public void setName ( String name ) { } public String getName ( ) { } public void setNode ( JMeterTreeNode node ) { } public void nameChanged ( ) { } }

Fix:
return org . apache . jmeter . gui . GuiPackage . getInstance ( ) . getGui ( ( ( TestElement ) ( getUserObject ( ) ) ) ) . getStaticLabel ( ) ;
Buggy code:
public class JSON { private static Logger log = Logger . getLogger ( JSON . class . getSimpleName ( ) ) ; private static DateFormat dateFormat = new SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss'Z'" , Locale . getDefault ( ) ) ; public static class HTMLCharacterEscapes extends CharacterEscapes { private final int [ ] asciiEscapes ; public HTMLCharacterEscapes ( ) { } @ Override public int [ ] getEscapeCodesForAscii ( ) { } @ Override public SerializableString getEscapeSequence ( int ch ) { } } public static ObjectMapper getMapper ( ) { <START_BUG> ObjectMapper mapper = JSON . getMapper ( ) ; <END_BUG> mapper . setSerializationInclusion ( JsonInclude . Include . NON_NULL ) ; mapper . enable ( SerializationFeature . WRITE_BIGDECIMAL_AS_PLAIN ) ; mapper . getJsonFactory ( ) . setCharacterEscapes ( new JSON . HTMLCharacterEscapes ( ) ) ; return mapper ; } }

Fix:
ObjectMapper mapper = new ObjectMapper ( ) ;
Buggy code:
public class SpelExpression implements Expression { private final String expression ; private final SpelNodeImpl ast ; private final SpelParserConfiguration configuration ; private EvaluationContext defaultContext ; public SpelExpression ( String expression , SpelNodeImpl ast , SpelParserConfiguration configuration ) { } public Object getValue ( ) throws EvaluationException { } public Object getValue ( Object rootObject ) throws EvaluationException { } public < T > T getValue ( Class < T > expectedResultType ) throws EvaluationException { } public < T > T getValue ( Object rootObject , Class < T > expectedResultType ) throws EvaluationException { } public Object getValue ( EvaluationContext context ) throws EvaluationException { } public Object getValue ( EvaluationContext context , Object rootObject ) throws EvaluationException { } @ SuppressWarnings ( "unchecked" ) public < T > T getValue ( EvaluationContext context , Class < T > expectedResultType ) throws EvaluationException { } @ SuppressWarnings ( "unchecked" ) public < T > T getValue ( EvaluationContext context , Object rootObject , Class < T > expectedResultType ) throws EvaluationException { } public Class getValueType ( ) throws EvaluationException { } public Class getValueType ( EvaluationContext context ) throws EvaluationException { } public Class getValueType ( EvaluationContext context , Object rootObject ) throws EvaluationException { } public Class getValueType ( Object rootObject ) throws EvaluationException { } public TypeDescriptor getValueTypeDescriptor ( ) throws EvaluationException { } public TypeDescriptor getValueTypeDescriptor ( Object rootObject ) throws EvaluationException { } public TypeDescriptor getValueTypeDescriptor ( EvaluationContext context ) throws EvaluationException { } public TypeDescriptor getValueTypeDescriptor ( EvaluationContext context , Object rootObject ) throws EvaluationException { } public String getExpressionString ( ) { } public boolean isWritable ( EvaluationContext context ) throws EvaluationException { } public boolean isWritable ( Object rootObject ) throws EvaluationException { } public boolean isWritable ( EvaluationContext context , Object rootObject ) throws EvaluationException { } public void setValue ( EvaluationContext context , Object value ) throws EvaluationException { } public void setValue ( Object rootObject , Object value ) throws EvaluationException { } public void setValue ( EvaluationContext context , Object rootObject , Object value ) throws EvaluationException { } public SpelNode getAST ( ) { } public String toStringAST ( ) { } public EvaluationContext getEvaluationContext ( ) { } public void setEvaluationContext ( EvaluationContext context ) { } private TypedValue toTypedValue ( Object object ) { if ( object == null ) { <START_BUG> return TypedValue . NULL_TYPED_VALUE ; <END_BUG> } else { return new TypedValue ( object ) ; } } }

Fix:
return TypedValue . NULL ;
Buggy code:
public class Configuration implements Service < Configuration > { public static final ServiceName SERVICE_NAME = JBOSS . append ( "osgi.configuration" ) ; static final String PROP_JBOSS_OSGI_SYSTEM_MODULES = "org.jboss.osgi.system.modules" ; private InjectedValue < ServerEnvironment > injectedEnvironment = new InjectedValue < ServerEnvironment > ( ) ; private final OSGiSubsystemState subsystemState ; public static void addService ( final BatchBuilder batchBuilder , final OSGiSubsystemState state ) { Configuration config = new Configuration ( state ) ; BatchServiceBuilder < ? > serviceBuilder = batchBuilder . addService ( Configuration . SERVICE_NAME , config ) ; serviceBuilder . addDependency ( ServerEnvironmentService . SERVICE_NAME , ServerEnvironment . class , config . injectedEnvironment ) ; <START_BUG> serviceBuilder . setInitialMode ( IMMEDIATE ) ; <END_BUG> } public static Configuration getServiceValue ( ServiceContainer container ) { } private Configuration ( final OSGiSubsystemState state ) { } public Activation getActivationPolicy ( ) { } public Map < String , Object > getProperties ( ) { } public List < OSGiModule > getModules ( ) { } @ Override public void start ( StartContext context ) throws StartException { } @ Override public void stop ( StopContext context ) { } @ Override public Configuration getValue ( ) throws IllegalStateException { } @ Override public String toString ( ) { } }

Fix:
serviceBuilder . setInitialMode ( ACTIVE ) ;
Buggy code:
public class TempFolder extends Folder { protected HeaderList headerList ; protected Hashtable messageList ; protected int nextUid ; protected ColumbaMessage aktMessage ; protected DataStorageInterface dataStorage ; protected DefaultSearchEngine searchEngine ; public TempFolder ( ) { } public void clear ( ) { } public void expungeFolder ( ) throws Exception { } protected Object generateNextUid ( ) { } public void setNextUid ( int next ) { } public Object addMessage ( ColumbaMessage message ) throws Exception { } public Object addMessage ( String source ) throws Exception { } public boolean exists ( Object uid ) throws Exception { } public HeaderList getHeaderList ( ) throws Exception { } public void markMessage ( Object [ ] uids , int variant ) throws Exception { } public void removeMessage ( Object uid ) throws Exception { } public MimePart getMimePart ( Object uid , Integer [ ] address ) throws Exception { } public String getMessageSource ( Object uid ) throws Exception { } public MimeTree getMimePartTree ( Object uid ) throws Exception { } public ColumbaHeader getMessageHeader ( Object uid ) throws Exception { } public ColumbaMessage getMessage ( Object uid ) throws Exception { } public DefaultSearchEngine getSearchEngineInstance ( ) { } public Object [ ] searchMessages ( Filter filter , Object [ ] uids ) throws Exception { } public Object [ ] searchMessages ( Filter filter ) throws Exception { } public String getDefaultChild ( ) { } public String getName ( ) { } public String toString ( ) { } public void innerCopy ( MailboxInterface destFolder , Object [ ] uids ) throws Exception { } public Object addMessage ( InputStream in , Attributes attributes ) throws Exception { } public Object getAttribute ( Object uid , String key ) throws Exception { } public Flags getFlags ( Object uid ) throws Exception { } public Attributes getAttributes ( Object uid ) throws Exception { } public Header getHeaderFields ( Object uid , String [ ] keys ) throws Exception { } public InputStream getMessageSourceStream ( Object uid ) throws Exception { } public InputStream getMimePartBodyStream ( Object uid , Integer [ ] address ) throws Exception { } public InputStream getMimePartSourceStream ( Object uid , Integer [ ] address ) throws Exception { } public void setAttribute ( Object uid , String key , Object value ) throws Exception { } public Object addMessage ( InputStream in ) throws Exception { <START_BUG> return null ; <END_BUG> } }

Fix:
return addMessage ( in , null ) ;
Buggy code:
class TransactionSubsystem10Parser implements XMLStreamConstants , XMLElementReader < List < ModelNode > > { public static final TransactionSubsystem10Parser INSTANCE = new TransactionSubsystem10Parser ( ) ; private TransactionSubsystem10Parser ( ) { } @ Override public void readElement ( XMLExtendedStreamReader reader , List < ModelNode > list ) throws XMLStreamException { } static void parseObjectStoreEnvironmentElementAndEnrichOperation ( final XMLExtendedStreamReader reader , ModelNode operation ) throws XMLStreamException { } static void parseCoordinatorEnvironmentElement ( final XMLExtendedStreamReader reader , final ModelNode operation ) throws XMLStreamException { final int count = reader . getAttributeCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { requireNoNamespaceAttribute ( reader , i ) ; final String value = reader . getAttributeValue ( i ) ; final Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; switch ( attribute ) { case ENABLE_STATISTICS : <START_BUG> ENABLE_STATISTICS . parseAndSetParameter ( value , operation , reader ) ; <END_BUG> break ; case ENABLE_TSM_STATUS : ENABLE_TSM_STATUS . parseAndSetParameter ( value , operation , reader ) ; break ; case DEFAULT_TIMEOUT : DEFAULT_TIMEOUT . parseAndSetParameter ( value , operation , reader ) ; break ; default : throw unexpectedAttribute ( reader , i ) ; } } requireNoContent ( reader ) ; } static void parseCoreEnvironmentElement ( final XMLExtendedStreamReader reader , final ModelNode operation ) throws XMLStreamException { } static void parseProcessIdEnvironmentElement ( XMLExtendedStreamReader reader , ModelNode coreEnvironmentAdd ) throws XMLStreamException { } static void parseSocketProcessIdElement ( XMLExtendedStreamReader reader , ModelNode coreEnvironmentAdd ) throws XMLStreamException { } static void parseRecoveryEnvironmentElement ( final XMLExtendedStreamReader reader , final ModelNode operation ) throws XMLStreamException { } }

Fix:
STATISTICS_ENABLED . parseAndSetParameter ( value , operation , reader ) ;
Buggy code:
public class TestIndirectRecursion extends SingleEMFTestCase { static byte [ ] [ ] transitions = new byte [ ] [ ] { new byte [ ] { 0 , 1 , 0 , 0 , 0 } , new byte [ ] { 1 , 0 , 1 , 1 , 0 } , new byte [ ] { 1 , 1 , 0 , 1 , 0 } , new byte [ ] { 0 , 0 , 0 , 0 , 1 } , new byte [ ] { 0 , 0 , 0 , 0 , 0 } } ; public void setUp ( ) { <START_BUG> super . setUp ( CLEAR_TABLES , State . class , Transition . class ) ; <END_BUG> DBDictionary dict = ( ( org . apache . openjpa . jdbc . conf . JDBCConfiguration ) ( emf . getConfiguration ( ) ) ) . getDBDictionaryInstance ( ) ; if ( dict instanceof OracleDictionary ) { ( ( OracleDictionary ) ( dict ) ) . useTriggersForAutoAssign = true ; } } public void testFetch ( ) { } void assertMatrixEqual ( byte [ ] [ ] expected , byte [ ] [ ] actual ) { } void fillTransitionMatrix ( byte [ ] [ ] matrix , Set < State > visited , State s ) { } void fillTransitionMatrix ( byte [ ] [ ] matrix , Transition t ) { } int getIndex ( State s ) { } Transition newTransition ( State from , State to ) { } State findOutgoingState ( String name , State root ) { } State findIncomingState ( String name , State root ) { } void assertIncomingStates ( State origin , State ... expected ) { } void assertOutgoingStates ( State origin , State ... expected ) { } }

Fix:
super . setUp ( DROP_TABLES , State . class , Transition . class ) ;
Buggy code:
public abstract class Response { private String defaultEncoding ; public Response ( ) { } public void close ( ) { } public String encodeURL ( final String url ) { } public abstract OutputStream getOutputStream ( ) { } public boolean isRedirect ( ) { } public void redirect ( final String url ) { } public void setContentLength ( final long length ) { } public void setContentType ( final String mimeType ) { } public void setLastModifiedTime ( Time time ) { } public void setLocale ( final Locale locale ) { } public void setCharacterEncoding ( final String encoding ) { } public String getCharacterEncoding ( ) { if ( ( this . defaultEncoding ) == null ) { <START_BUG> return Application . get ( ) . getSettings ( ) . getResponseRequestEncoding ( ) ; <END_BUG> } else { return this . defaultEncoding ; } } public final void write ( final ComponentTag tag ) { } public abstract void write ( final String string ) { } }

Fix:
return Application . get ( ) . getRequestCycleSettings ( ) . getResponseRequestEncoding ( ) ;
Buggy code:
public class HTTPHC3Impl extends HTTPHCAbstractImpl { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final String HTTP_AUTHENTICATION_PREEMPTIVE = "http.authentication.preemptive" ; private static final boolean canSetPreEmptive ; private static final ThreadLocal < Map < HostConfiguration , HttpClient > > httpClients = new ThreadLocal < Map < HostConfiguration , HttpClient > > ( ) { @ Override protected Map < HostConfiguration , HttpClient > initialValue ( ) { } } ; volatile HttpClient savedClient ; protected HTTPHC3Impl ( HTTPSamplerBase base ) { } @ Override protected HTTPSampleResult sample ( URL url , String method , boolean areFollowingRedirect , int frameDepth ) { } private static int calculateHeadersSize ( HttpMethodBase httpMethod ) { } protected HttpClient setupConnection ( URL u , HttpMethodBase httpMethod , HTTPSampleResult res ) throws IOException { } protected void setDefaultRequestHeaders ( HttpMethod httpMethod ) { } protected String getResponseHeaders ( HttpMethod method ) { } private String setConnectionCookie ( HttpMethod method , URL u , CookieManager cookieManager ) { } private void setConnectionHeaders ( HttpMethod method , URL u , HeaderManager headerManager , CacheManager cacheManager ) { if ( headerManager != null ) { CollectionProperty headers = headerManager . getHeaders ( ) ; if ( headers != null ) { PropertyIterator i = headers . iterator ( ) ; while ( i . hasNext ( ) ) { Header header = ( ( Header ) ( i . next ( ) . getObjectValue ( ) ) ) ; String n = header . getName ( ) ; if ( ! ( HEADER_CONTENT_LENGTH . equalsIgnoreCase ( n ) ) ) { String v = header . getValue ( ) ; if ( HEADER_HOST . equalsIgnoreCase ( n ) ) { <START_BUG> v = removePortInHostHeader ( v , u . getPort ( ) ) ; <END_BUG> method . getParams ( ) . setVirtualHost ( v ) ; } else { method . addRequestHeader ( n , v ) ; } } } } } if ( cacheManager != null ) { cacheManager . setHeaders ( u , method ) ; } } protected String getConnectionHeaders ( HttpMethod method ) { } private void setConnectionAuthorization ( HttpClient client , URL u , AuthManager authManager ) { } private String sendPostData ( PostMethod post ) throws IOException { } private String sendPutData ( PutMethod put ) throws IOException { } private static class ViewableFilePart extends FilePart { private boolean hideFileData ; public ViewableFilePart ( String name , File file , String contentType , String charset ) throws FileNotFoundException { } public void setHideFileData ( boolean hideFileData ) { } @ Override protected void sendData ( OutputStream out ) throws IOException { } } protected void saveConnectionCookies ( HttpMethod method , URL u , CookieManager cookieManager ) { } @ Override public void threadFinished ( ) { } public boolean interrupt ( ) { } }

Fix:
v = v . replaceFirst ( ":\\d+$" , "" ) ;
Buggy code:
public class NumberLiteral extends Expression { private String tokenValue = "0" ; NumberLiteral ( AST ast ) { } ASTNode clone ( AST target ) { } public boolean subtreeMatch ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public String getToken ( ) { } public void setToken ( String token ) { if ( ( token == null ) || ( ( token . length ( ) ) == 0 ) ) { throw new IllegalArgumentException ( ) ; } Scanner scanner = getAST ( ) . scanner ; char [ ] source = token . toCharArray ( ) ; <START_BUG> scanner . setSourceBuffer ( source ) ; <END_BUG> scanner . resetTo ( 0 , source . length ) ; try { int tokenType = scanner . getNextToken ( ) ; switch ( tokenType ) { case Scanner . TokenNameDoubleLiteral : case Scanner . TokenNameIntegerLiteral : case Scanner . TokenNameFloatingPointLiteral : case Scanner . TokenNameLongLiteral : break ; case Scanner . TokenNameMINUS : tokenType = scanner . getNextToken ( ) ; switch ( tokenType ) { case Scanner . TokenNameDoubleLiteral : case Scanner . TokenNameIntegerLiteral : case Scanner . TokenNameFloatingPointLiteral : case Scanner . TokenNameLongLiteral : break ; default : throw new IllegalArgumentException ( ) ; } break ; default : throw new IllegalArgumentException ( ) ; } } catch ( InvalidInputException e ) { throw new IllegalArgumentException ( ) ; } modifying ( ) ; this . tokenValue = token ; } int memSize ( ) { } int treeSize ( ) { } }

Fix:
scanner . setSource ( source ) ;
Buggy code:
public class DeciduousTileManager extends TileManager { public DeciduousTileManager ( Stage m ) throws IOException { } @ Override public BufferedImage getImage ( MapCell m ) { } public BufferedImage doBackground ( MapCell m ) { } private BufferedImage generateFlowers ( MapCell m ) { } private BufferedImage generateForest ( MapCell m ) { } private BufferedImage generateBricks ( MapCell m ) { } private BufferedImage generateWater ( MapCell m ) { } public BufferedImage getHoverTransparency ( ) { } public BufferedImage getHighlightTransparency ( ) { } private BufferedImage generateLargeRocks ( MapCell m ) { } private BufferedImage generateSmallRocks ( MapCell m ) { } private BufferedImage generateDirt ( MapCell m ) { } private void fuzzBorderWithGrass ( MapCell m , Graphics g ) { if ( ( ( m . getX ( ) ) < 0 ) || ( ( m . getY ( ) ) < 0 ) ) return ; String up = "" ; String down = "" ; String left = "" ; String right = "" ; if ( ( ( m . getY ( ) ) - 1 ) >= 0 ) up = myMap . getCell ( m . getX ( ) , ( ( m . getY ( ) ) - 1 ) ) . getID ( ) ; <START_BUG> if ( ( ( m . getY ( ) ) + 1 ) < ( myMap . getWidth ( ) ) ) <END_BUG> down = myMap . getCell ( m . getX ( ) , ( ( m . getY ( ) ) + 1 ) ) . getID ( ) ; if ( ( ( m . getX ( ) ) - 1 ) >= 0 ) left = myMap . getCell ( ( ( m . getX ( ) ) - 1 ) , m . getY ( ) ) . getID ( ) ; if ( ( ( m . getX ( ) ) + 1 ) < ( myMap . getWidth ( ) ) ) right = myMap . getCell ( ( ( m . getX ( ) ) + 1 ) , m . getY ( ) ) . getID ( ) ; boolean u = ( ( up . equals ( GRASS ) ) || ( up . equals ( SMALL_ROCKS ) ) ) || ( up . equals ( LARGE_ROCKS ) ) ; boolean d = ( ( down . equals ( GRASS ) ) || ( down . equals ( SMALL_ROCKS ) ) ) || ( down . equals ( LARGE_ROCKS ) ) ; boolean l = ( ( left . equals ( GRASS ) ) || ( left . equals ( SMALL_ROCKS ) ) ) || ( left . equals ( LARGE_ROCKS ) ) ; boolean r = ( ( right . equals ( GRASS ) ) || ( right . equals ( SMALL_ROCKS ) ) ) || ( right . equals ( LARGE_ROCKS ) ) ; if ( u ) { g . drawImage ( myImage . getSubimage ( ( 3 * 32 ) , 0 , 32 , 32 ) , 0 , 0 , null ) ; } if ( d ) { g . drawImage ( myImage . getSubimage ( ( 5 * 32 ) , 0 , 32 , 32 ) , 0 , 0 , null ) ; } if ( l ) { g . drawImage ( myImage . getSubimage ( ( 4 * 32 ) , 0 , 32 , 32 ) , 0 , 0 , null ) ; } if ( r ) { g . drawImage ( myImage . getSubimage ( ( 6 * 32 ) , 0 , 32 , 32 ) , 0 , 0 , null ) ; } } private void fuzzBorderWithForest ( MapCell m , Graphics g ) { } private BufferedImage generateGrass ( ) { } private BufferedImage generateShoals ( ) { } public BufferedImage getImage ( Player player ) { } public BufferedImage getImage ( Collectible c ) { } public BufferedImage getImage ( Enemy enemy ) { } }

Fix:
if ( ( ( m . getY ( ) ) + 1 ) < ( myMap . getHeight ( ) ) )
Buggy code:
final class CollectionToObjectConverter implements ConditionalGenericConverter { private final ConversionService conversionService ; public CollectionToObjectConverter ( ConversionService conversionService ) { } public Set < ConvertiblePair > getConvertibleTypes ( ) { } public boolean matches ( TypeDescriptor sourceType , TypeDescriptor targetType ) { } public Object convert ( Object source , TypeDescriptor sourceType , TypeDescriptor targetType ) { if ( source == null ) { return null ; } Collection < ? > sourceCollection = ( ( Collection < ? > ) ( source ) ) ; if ( ( sourceCollection . size ( ) ) == 0 ) { return null ; } Object firstElement = sourceCollection . iterator ( ) . next ( ) ; <START_BUG> return this . conversionService . convert ( firstElement , sourceType . getElementTypeDescriptor ( firstElement ) , targetType ) ; <END_BUG> } }

Fix:
return this . conversionService . convert ( firstElement , sourceType . getElementTypeDescriptor ( ) , targetType ) ;
Buggy code:
public class SynchronizedCollection < E > implements Serializable , Collection < E > { private static final long serialVersionUID = 2412805092710877986L ; protected final Collection < E > collection ; protected final Object lock ; <START_BUG> public static < T > Collection < T > synchronizedCollection ( Collection < T > coll ) { <END_BUG> return new SynchronizedCollection < T > ( coll ) ; } protected SynchronizedCollection ( Collection < E > collection ) { } protected SynchronizedCollection ( Collection < E > collection , Object lock ) { } protected Collection < E > decorated ( ) { } public boolean add ( E object ) { } public boolean addAll ( Collection < ? extends E > coll ) { } public void clear ( ) { } public boolean contains ( Object object ) { } public boolean containsAll ( Collection < ? > coll ) { } public boolean isEmpty ( ) { } public Iterator < E > iterator ( ) { } public Object [ ] toArray ( ) { } public < T > T [ ] toArray ( T [ ] object ) { } public boolean remove ( Object object ) { } public boolean removeAll ( Collection < ? > coll ) { } public boolean retainAll ( Collection < ? > coll ) { } public int size ( ) { } @ Override public boolean equals ( Object object ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } }

Fix:
public static < T > SynchronizedCollection < T > synchronizedCollection ( Collection < T > coll ) {
Buggy code:
public class AsyncFortunaStandalone extends FortunaStandalone implements Runnable { private static final int DEFAULT_BUFFERS = 2 ; private static final int DEFAULT_BUFSIZE = 256 * 1024 ; private final int _bufferCount ; private final int _bufferSize ; private final Object asyncBuffers = new Object ( ) ; private final I2PAppContext _context ; private final Log _log ; private volatile boolean _isRunning ; private Thread _refillThread ; private final LinkedBlockingQueue < AsyncFortunaStandalone . AsyncBuffer > _fullBuffers ; private final LinkedBlockingQueue < AsyncFortunaStandalone . AsyncBuffer > _emptyBuffers ; private AsyncFortunaStandalone . AsyncBuffer _currentBuffer ; public AsyncFortunaStandalone ( I2PAppContext context ) { } public void startup ( ) { for ( int i = 0 ; i < ( _bufferCount ) ; i ++ ) _emptyBuffers . offer ( new AsyncFortunaStandalone . AsyncBuffer ( _bufferSize ) ) ; _isRunning = true ; _refillThread = new I2PThread ( this , "PRNG" ) ; _refillThread . setDaemon ( true ) ; <START_BUG> _refillThread . setPriority ( ( ( Thread . MIN_PRIORITY ) + 1 ) ) ; <END_BUG> _refillThread . start ( ) ; } public void shutdown ( ) { } @ Override public void seed ( byte [ ] val ) { } @ Override protected void allocBuffer ( ) { } private static class AsyncBuffer { public final byte [ ] buffer ; public AsyncBuffer ( int size ) { } } protected void rotateBuffer ( ) { } public void run ( ) { } @ Override public void fillBlock ( ) { } private void doFill ( byte [ ] buf ) { } }

Fix:
_refillThread . setPriority ( ( ( Thread . NORM_PRIORITY ) - 2 ) ) ;
Buggy code:
public class SessionContextAdapterTestCase { private final Deployment deployment = mock ( Deployment . class ) ; private final SessionContext context = new SessionContextAdapter ( this . deployment ) ; @ Test public void getServletContext ( ) { DeploymentInfo info = mock ( DeploymentInfo . class ) ; ServletContainer container = mock ( ServletContainer . class ) ; when ( this . deployment . getDeploymentInfo ( ) ) . thenReturn ( info ) ; <START_BUG> ServletContextImpl context = new ServletContextImpl ( container , deployment ) ; <END_BUG> when ( this . deployment . getServletContext ( ) ) . thenReturn ( context ) ; ServletContext result = this . context . getServletContext ( ) ; assertSame ( context , result ) ; } @ Test public void getSessionListeners ( ) { } @ Test public void getSessionAttributeListeners ( ) { } }

Fix:
ServletContextImpl context = new ServletContextImpl ( container , this . deployment ) ;
Buggy code:
public class MutableObjectTest extends TestCase { public MutableObjectTest ( String testName ) { } public void testConstructors ( ) { assertEquals ( null , new MutableObject < String > ( ) . getValue ( ) ) ; <START_BUG> Integer i = new Integer ( 6 ) ; <END_BUG> assertSame ( i , new MutableObject < Integer > ( i ) . getValue ( ) ) ; assertSame ( "HI" , new MutableObject < String > ( "HI" ) . getValue ( ) ) ; assertSame ( null , new MutableObject < Object > ( null ) . getValue ( ) ) ; } public void testGetSet ( ) { } public void testEquals ( ) { } public void testHashCode ( ) { } public void testToString ( ) { } }

Fix:
Integer i = Integer . valueOf ( 6 ) ;
Buggy code:
class XSDAttributeGroupTraverser extends XSDAbstractTraverser { XSDAttributeGroupTraverser ( XSDHandler handler , XSAttributeChecker gAttrCheck ) { } XSAttributeGroupDecl traverseLocal ( Element elmNode , XSDocumentInfo schemaDoc , SchemaGrammar grammar ) { } XSAttributeGroupDecl traverseGlobal ( Element elmNode , XSDocumentInfo schemaDoc , SchemaGrammar grammar ) { XSAttributeGroupDecl attrGrp = new XSAttributeGroupDecl ( ) ; Object [ ] attrValues = fAttrChecker . checkAttributes ( elmNode , true , schemaDoc ) ; String nameAttr = ( ( String ) ( attrValues [ XSAttributeChecker . ATTIDX_NAME ] ) ) ; if ( nameAttr == null ) { reportSchemaError ( "s4s-att-must-appear" , new Object [ ] { "attributeGroup<seq2seq4repair_space>(global)" , "name" } , elmNode ) ; nameAttr = "no<seq2seq4repair_space>name" ; } attrGrp . fName = nameAttr ; attrGrp . fTargetNamespace = schemaDoc . fTargetNamespace ; Element child = DOMUtil . getFirstChildElement ( elmNode ) ; if ( child != null ) { String childName = DOMUtil . getLocalName ( child ) ; if ( childName . equals ( ELT_ANNOTATION ) ) { traverseAnnotationDecl ( child , attrValues , false , schemaDoc ) ; child = DOMUtil . getNextSiblingElement ( child ) ; } } <START_BUG> Element nextNode = traverseAttrsAndAttrGrps ( child , attrGrp , schemaDoc , grammar ) ; <END_BUG> if ( nextNode != null ) { Object [ ] args = new Object [ ] { nameAttr , DOMUtil . getLocalName ( nextNode ) } ; reportSchemaError ( "src-attribute_group" , args , nextNode ) ; } attrGrp . removeProhibitedAttrs ( ) ; XSAttributeGroupDecl redefinedAttrGrp = ( ( XSAttributeGroupDecl ) ( fSchemaHandler . getGrpOrAttrGrpRedefinedByRestriction ( ATTRIBUTEGROUP_TYPE , new org . apache . xerces . xni . QName ( fSchemaHandler . EMPTY_STRING , nameAttr , nameAttr , schemaDoc . fTargetNamespace ) , schemaDoc , elmNode ) ) ) ; if ( redefinedAttrGrp != null ) { String err = attrGrp . validRestrictionOf ( redefinedAttrGrp ) ; if ( err != null ) { reportSchemaError ( "src-redefine.7.2.2" , new Object [ ] { nameAttr , err } , child ) ; } } grammar . addGlobalAttributeGroupDecl ( attrGrp ) ; fAttrChecker . returnAttrArray ( attrValues , schemaDoc ) ; return attrGrp ; } }

Fix:
Element nextNode = traverseAttrsAndAttrGrps ( child , attrGrp , schemaDoc , grammar , null ) ;
Buggy code:
public class TestOmitTf extends LuceneTestCase { public static class SimpleSimilarity extends Similarity { public float lengthNorm ( String field , int numTerms ) { } public float queryNorm ( float sumOfSquaredWeights ) { } public float tf ( float freq ) { } public float sloppyFreq ( int distance ) { } public float idf ( Collection terms , Searcher searcher ) { } public float idf ( int docFreq , int numDocs ) { } public float coord ( int overlap , int maxOverlap ) { } } public void testOmitTf ( ) throws Exception { } public void testMixedMerge ( ) throws Exception { } public void testMixedRAM ( ) throws Exception { } private void assertNoPrx ( Directory dir ) throws Throwable { <START_BUG> final String [ ] files = dir . list ( ) ; <END_BUG> for ( int i = 0 ; i < ( files . length ) ; i ++ ) assertFalse ( files [ i ] . endsWith ( ".prx" ) ) ; } public void testNoPrxFile ( ) throws Throwable { } public void testBasic ( ) throws Exception { } public static class CountingHitCollector extends HitCollector { static int count = 0 ; static int sum = 0 ; CountingHitCollector ( ) { } public void collect ( int doc , float score ) { } public static int getCount ( ) { } public static int getSum ( ) { } } }

Fix:
final String [ ] files = dir . listAll ( ) ;
Buggy code:
public class ThreadedViewAction extends CheckBoxAction implements SelectionListener { public ThreadedViewAction ( FrameMediator frameMediator ) { } public void tableChanged ( TableModelChangedEvent e ) { <START_BUG> log . info ( ( "event=" + e ) ) ; <END_BUG> if ( ( e . getEventType ( ) ) == ( TableModelChangedEvent . UPDATE ) ) { FolderCommandReference [ ] r = ( ( FolderCommandReference [ ] ) ( ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( frameMediator ) ) . getTreeSelection ( ) ) ) ; Folder folder = ( ( Folder ) ( r [ 0 ] . getFolder ( ) ) ) ; final boolean enableThreadedView = folder . getFolderItem ( ) . getBoolean ( "property" , "enable_threaded_view" , false ) ; updateTable ( enableThreadedView ) ; try { SwingUtilities . invokeAndWait ( new Runnable ( ) { public void run ( ) { getCheckBoxMenuItem ( ) . setSelected ( enableThreadedView ) ; } } ) ; } catch ( InterruptedException e1 ) { e1 . printStackTrace ( ) ; } catch ( InvocationTargetException e1 ) { e1 . printStackTrace ( ) ; } } } public void actionPerformed ( ActionEvent e ) { } protected void updateTable ( boolean enableThreadedView ) { } public void selectionChanged ( SelectionChangedEvent e ) { } }

Fix:
log . fine ( ( "event=" + e ) ) ;
Buggy code:
public class ConversionUtils { private static final String CHARSET_EQ = "charset=" ; private static final int CHARSET_EQ_LEN = ConversionUtils . CHARSET_EQ . length ( ) ; private static final String SLASHDOTDOT = "//.." ; private static final String DOTDOT = ".." ; private static final String SLASH = "//" ; private static final String COLONSLASHSLASH = ":////" ; public static String getEncodingFromContentType ( String contentType ) { } public static URL makeRelativeURL ( URL baseURL , String location ) throws MalformedURLException { } public static String escapeIllegalURLCharacters ( String url ) throws Exception { } public static final URI sanitizeUrl ( URL url ) throws UnsupportedEncodingException , URISyntaxException { <START_BUG> URIBuilder builder = new URIBuilder ( ) . setScheme ( url . getProtocol ( ) ) . setHost ( url . getHost ( ) ) . setPort ( url . getPort ( ) ) . setUserInfo ( url . getUserInfo ( ) ) . setPath ( URLDecoder . decode ( url . getPath ( ) , "UTF-8" ) ) . setQuery ( url . getQuery ( ) ) ; <END_BUG> URI uri = builder . build ( ) ; return uri ; } public static String removeSlashDotDot ( String url ) { } }

Fix:
URIBuilder builder = new URIBuilder ( ) . setScheme ( url . getProtocol ( ) ) . setHost ( url . getHost ( ) ) . setPort ( url . getPort ( ) ) . setUserInfo ( url . getUserInfo ( ) ) . setPath ( ( ( url . getPath ( ) ) != null ? URLDecoder . decode ( url . getPath ( ) , "UTF-8" ) : null ) ) . setQuery ( url . getQuery ( ) ) ;
Buggy code:
public class JavaHandler implements UUIDHandler { private ExpireHashMap < String , UUID > uuid_cache = new ExpireHashMap < String , UUID > ( ) ; private ExpireHashMap < UUID , String > name_cache = new ExpireHashMap < UUID , String > ( ) ; public ExpireHashMap < String , UUID > getUUIDCache ( ) { } public ExpireHashMap < UUID , String > getNameCache ( ) { } @ Override public UUID getUUID ( String username ) { username = username . toLowerCase ( ) ; if ( uuid_cache . containsKey ( username ) ) { return uuid_cache . get ( username ) ; } <START_BUG> APIQuery query = new APIQuery ( username , "full_uuid" ) ; <END_BUG> try { UUID uuid = UUID . fromString ( query . request ( ) ) ; uuid_cache . put ( username , uuid , 1 , TimeUnit . HOURS ) ; return uuid ; } catch ( Exception ex ) { System . err . println ( ( ( "[MC-API]<seq2seq4repair_space>Could<seq2seq4repair_space>not<seq2seq4repair_space>lookup<seq2seq4repair_space>'" + username ) + "',<seq2seq4repair_space>returning<seq2seq4repair_space>null.." ) ) ; System . err . println ( ( ( ( ( "[MC-API]<seq2seq4repair_space>Server:<seq2seq4repair_space>" + ( UUIDAPI . getRegion ( ) . toString ( ) ) ) + "<seq2seq4repair_space>(" ) + ( UUIDAPI . getRegion ( ) . buildURL ( ) ) ) + ")" ) ) ; return null ; } } @ Override public String getUUIDString ( String username ) { } @ Override public String getUsername ( UUID uuid ) { } @ Override public String getUsername ( String uuid ) { } }

Fix:
APIQuery query = new APIQuery ( username , "full_uuid" , "uuid" ) ;