nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ThingProfileActivity extends Activity { private static final String TAG = "ItApplication" ; @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( thing ) ; Bundle b = getIntent ( ) . getExtras ( ) ; Thing thing = b . getParcelable ( EXTRA_THING ) ; this . setTitle ( thing . getName ( ) ) ; <START_BUG> final ImageView pictureView = ( ( ImageView ) ( findViewById ( thingimage ) ) ) ; <END_BUG> thing . setImageViewImage ( pictureView ) ; File folder = new File ( thing . getFolderPath ( ) ) ; String [ ] filenames = folder . list ( ) ; ArrayAdapter < String > fileAdapter = new ArrayAdapter < String > ( this , layout . simple_list_item_1 , filenames ) ; ListView fileListView = ( ( ListView ) ( findViewById ( filelist ) ) ) ; fileListView . setAdapter ( fileAdapter ) ; final Context mContext = this ; final String folderPath = ( thing . getFolderPath ( ) ) + "//" ; fileListView . setOnItemClickListener ( new OnItemClickListener ( ) { public void onItemClick ( AdapterView < ? > parent , View v , int position , long id ) { File myFile = new File ( ( ( ( String ) ( folderPath ) ) + ( parent . getItemAtPosition ( position ) ) ) ) ; try { Log . d ( ThingProfileActivity . TAG , myFile . getAbsolutePath ( ) ) ; ThingProfileActivity . openFile ( mContext , myFile ) ; } catch ( IOException ex ) { } } } ) ; } private static void openFile ( Context context , File url ) throws IOException { } No newline ; at end ; of file ; }

Fix:
ImageView pictureView = ( ( ImageView ) ( findViewById ( thingimage ) ) ) ;
Buggy code:
public class MarkupFragment { @ SuppressWarnings ( "unused" ) private static final Log log = LogFactory . getLog ( MarkupFragment . class ) ; public static final MarkupFragment NO_MARKUP_FRAGMENT = new MarkupFragment ( IMarkup . NO_MARKUP ) ; private List < MarkupElement > markupElements ; private final IMarkup markup ; MarkupFragment ( final IMarkup markup ) { } @ Override public final String toString ( ) { } public final MarkupElement get ( final int index ) { } public final IMarkup getMarkup ( ) { } public int size ( ) { } final void addMarkupElement ( final MarkupElement markupElement ) { } final void addMarkupElement ( final int pos , final MarkupElement markupElement ) { } final void makeImmutable ( ) { for ( int i = 0 ; i < ( this . markupElements . size ( ) ) ; i ++ ) { <START_BUG> MarkupElement elem = this . markupElements . get ( i ) ; <END_BUG> if ( elem instanceof ComponentTag ) { ( ( ComponentTag ) ( elem ) ) . makeImmutable ( ) ; } } this . markupElements = Collections . unmodifiableList ( this . markupElements ) ; } final void reset ( ) { } }

Fix:
final MarkupElement elem = this . markupElements . get ( i ) ;
Buggy code:
@ SuppressWarnings ( "unchecked" ) public class ThumbnailRetrieverTest { static final String REMOTE_URL = "http:////radio-t.com//thumbnail1.jpg" ; static final String CACHED_URL = "http:////radio-t.com//thumbnail2.jpg" ; static final byte [ ] THUMBNAIL = new byte [ 0 ] ; private final HttpClient httpClient = mock ( HttpClient . class ) ; private final PodcastsConsumer consumer = mock ( PodcastsConsumer . class ) ; private final ThumbnailCache cache = mock ( ThumbnailCache . class ) ; private final PodcastList list = anEmptyList ( ) ; private ThumbnailRetriever retriever = new ThumbnailRetriever ( httpClient , cache ) ; @ Test public void whenThumbnailIsCached_willFetchItFromCache ( ) throws Exception { } @ Test public void whenThumbnailIsNotCached_willDownloadIt ( ) throws Exception { } @ Test public void whenDownloadsThumbnail_willStoreItInCache ( ) throws Exception { } @ Test public void whenRetrievingThumbnails_firstRetrieveAllCached_thenDownloadRemotes ( ) throws Exception { } @ Test public void whenNoThumbnailUrl_skipsItemEntirely ( ) throws Exception { } @ Test public void whenFailsToRetrieveThumbnail_doesNotProcessItem ( ) throws Exception { final PodcastItem item = aPodcastItem ( withThumbnailUrl ( ThumbnailRetrieverTest . REMOTE_URL ) ) ; list . add ( item ) ; when ( cache . lookup ( ThumbnailRetrieverTest . REMOTE_URL ) ) . thenReturn ( null ) ; <START_BUG> when ( httpClient . getByteContent ( ThumbnailRetrieverTest . REMOTE_URL ) ) . thenThrow ( IOException . class ) ; <END_BUG> retriever . retrieve ( list , consumer , noInterrupts ( ) ) ; verify ( cache , never ( ) ) . update ( eq ( ThumbnailRetrieverTest . REMOTE_URL ) , any ( byte [ ] . class ) ) ; verify ( consumer , never ( ) ) . updateThumbnail ( eq ( item ) , any ( byte [ ] . class ) ) ; } private void thumbnailIsCached ( String url , byte [ ] data ) { } private void thumbnailIsRemote ( String url , byte [ ] data ) throws IOException { } private Controller noInterrupts ( ) { } }

Fix:
when ( httpClient . getByteContent ( ThumbnailRetrieverTest . REMOTE_URL ) ) . thenThrow ( Exception . class ) ;
Buggy code:
public class POP3Server { private static final Logger LOG = Logger . getLogger ( "org.columba.mail.folder.headercache" ) ; private static final long DAY_IN_MS = ( ( 24 * 60 ) * 60 ) * 1000 ; private AccountItem accountItem ; private File file ; private boolean alreadyLoaded ; private POP3Store store ; protected POP3HeaderCache headerCache ; private Lock lock ; private boolean cacheChanged ; public POP3Server ( AccountItem accountItem ) { } public void save ( ) throws Exception { } public File getConfigFile ( ) { } public AccountItem getAccountItem ( ) { } public AbstractMessageFolder getFolder ( ) { } public void logout ( ) throws Exception { } public void forceLogout ( ) throws Exception { } public List synchronize ( ) throws Exception { } public void deleteMessage ( Object uid ) throws IOException , CommandCancelledException , POP3Exception { } public void deleteMessagesOlderThan ( Date date ) throws IOException , CommandCancelledException , POP3Exception { } public void cleanUpServer ( ) throws IOException , CommandCancelledException , POP3Exception { } public int getMessageCount ( ) throws Exception { } public ColumbaMessage getMessage ( Object uid , WorkerStatusController worker ) throws Exception { InputStream messageStream = new org . columba . core . command . ProgressObservedInputStream ( getStore ( ) . fetchMessage ( store . getIndex ( uid ) ) , worker , true ) ; Source source = TempSourceFactory . createTempSource ( messageStream , ( - 1 ) ) ; Header header = HeaderParser . parse ( source ) ; ColumbaMessage m = new ColumbaMessage ( header ) ; ColumbaHeader h = ( ( ColumbaHeader ) ( m . getHeader ( ) ) ) ; m . setSource ( source ) ; h . getAttributes ( ) . put ( "columba.pop3uid" , uid ) ; int size = Math . max ( ( ( source . length ( ) ) // 1024 ) , 1 ) ; h . getAttributes ( ) . put ( "columba.size" , new Integer ( size ) ) ; String contentType = ( ( String ) ( header . get ( "Content-Type" ) ) ) ; <START_BUG> h . set ( "columba.attachment" , h . hasAttachments ( ) ) ; <END_BUG> h . getAttributes ( ) . put ( "columba.fetchstate" , Boolean . TRUE ) ; h . getAttributes ( ) . put ( "columba.accountuid" , new Integer ( accountItem . getInteger ( "uid" ) ) ) ; headerCache . add ( h ) ; setCacheChanged ( true ) ; return m ; } public int getMessageSize ( Object uid ) throws Exception { } public String getFolderName ( ) { } public POP3Store getStore ( ) { } public StatusObservable getObservable ( ) { } public boolean tryToGetLock ( Object locker ) { } public void releaseLock ( Object locker ) { } public boolean isCacheChanged ( ) { } private void setCacheChanged ( boolean hasChanged ) { } public void updateConfig ( ) { } }

Fix:
h . getAttributes ( ) . put ( "columba.attachment" , h . hasAttachments ( ) ) ;
Buggy code:
public final class BookDetails extends AuthenticatedWebPage { <START_BUG> public static BookmarkablePageLink link ( MarkupContainer parent , final String name , final Book book , final String noBookTitle ) { <END_BUG> final BookmarkablePageLink link = new BookmarkablePageLink ( parent , name , BookDetails . class ) ; if ( book != null ) { link . setParameter ( "id" , book . getId ( ) ) ; new wicket . markup . html . basic . Label ( link , "title" , new wicket . model . Model < Book > ( book ) ) ; } else { new wicket . markup . html . basic . Label ( link , "title" , noBookTitle ) ; link . setEnabled ( false ) ; } return link ; } public BookDetails ( final Book book ) { } public BookDetails ( final PageParameters parameters ) throws StringValueConversionException { } }

Fix:
public static BookmarkablePageLink link ( final MarkupContainer parent , final String name , final Book book , final String noBookTitle ) {
Buggy code:
public abstract class AbstractBehavior implements IBehavior , IHeaderContributor { public AbstractBehavior ( ) { } public void beforeRender ( Component component ) { } public void bind ( final Component component ) { } public void cleanup ( ) { } public void detach ( Component component ) { } public final void exception ( Component component , RuntimeException exception ) { } public boolean getStatelessHint ( Component component ) { } public void onComponentTag ( final Component component , final ComponentTag tag ) { } public void onException ( Component component , RuntimeException exception ) { } public void onRendered ( Component component ) { } public final void afterRender ( final Component component ) { } public void renderHead ( IHeaderResponse response ) { } public boolean isEnabled ( Component component ) { <START_BUG> return true ; <END_BUG> } public boolean isTemporary ( ) { } public final void detachModel ( Component component ) { } public final void rendered ( Component component ) { } }

Fix:
return component . isEnabled ( ) ;
Buggy code:
public class Game extends Observable implements Runnable { private Board board ; private List < Player > players ; private int current ; public Game ( List < Player > players ) { } public Board getBoard ( ) { } public void run ( ) { } private void nextPlayer ( ) { } public Player getCurrentPlayer ( ) { } public void reset ( ) { } public void updateScore ( ) { } public boolean gameOver ( ) { if ( getBoard ( ) . canPickStone ( ) ) { return false ; } for ( Player p : players ) { if ( ( p . getHandSize ( ) ) == 0 ) { return true ; } } <START_BUG> return true ; <END_BUG> } public boolean isWinner ( ) { } public List < Player > getPlayers ( ) { } }

Fix:
return false ;
Buggy code:
public class Pen extends MapDrawerTool { private static final String TOOL_NAME_STRING = "Pen" ; private boolean mouseDown = false ; private printEverySec printer ; private Line currentLine ; private Color currentColor ; private int currentStroke ; private PenToolBar toolBar ; public Pen ( GraphicsObjectTracker graphicsObjectTracker , DrawingCanvas drawingCanvas ) { } public void setCurrentStroke ( int currentStroke ) { } public void setCurrentColor ( Color currentColor ) { } @ Override public String getToolString ( ) { } @ Override public String getToolDisplayName ( ) { } @ Override public void toolSelected ( ) { } @ Override public void toolDeSelected ( ) { } @ Override public void update ( ) { if ( mouseDown ) { PointerInfo a = MouseInfo . getPointerInfo ( ) ; Point mousePoint = new Point ( ( ( a . getLocation ( ) . x ) - ( drawingCanvas . getLocationOnScreen ( ) . x ) ) , ( ( a . getLocation ( ) . y ) - ( drawingCanvas . getLocationOnScreen ( ) . y ) ) ) ; if ( ( currentLine ) != null ) { <START_BUG> if ( currentLine . isPointCollinear ( mousePoint ) ) { <END_BUG> currentLine . changeEndPoint ( mousePoint ) ; graphicsObjectTracker . addCurrentFrameObject ( currentLine ) ; } else { graphicsObjectTracker . addGraphicsObject ( currentLine ) ; currentLine = newLineFromLastPoint ( mousePoint ) ; graphicsObjectTracker . addCurrentFrameObject ( currentLine ) ; } } else { currentLine = newLineFromPoint ( mousePoint ) ; graphicsObjectTracker . addCurrentFrameObject ( currentLine ) ; } } else if ( ( currentLine ) != null ) { graphicsObjectTracker . addGraphicsObject ( currentLine ) ; currentLine = null ; } } @ Override public ToolToolBar getToolbar ( ) { } private Line newLineFromLastPoint ( Point mousePoint ) { } private Line newLineFromPoint ( Point pointToPass ) { } @ Override public void mouseClicked ( MouseEvent e ) { } @ Override public void mousePressed ( MouseEvent e ) { } @ Override public void mouseReleased ( MouseEvent e ) { } @ Override public void mouseEntered ( MouseEvent e ) { } @ Override public void mouseExited ( MouseEvent e ) { } @ Override public void mouseDragged ( MouseEvent e ) { } @ Override public void mouseMoved ( MouseEvent e ) { } public Color getCurrentColor ( ) { } public int getCurrentStroke ( ) { } }

Fix:
if ( currentLine . isPointAnExtension ( mousePoint ) ) {
Buggy code:
public class CSVPrinter implements Closeable , Flushable { private final Appendable out ; private final CSVFormat format ; private boolean newLine = true ; public CSVPrinter ( final Appendable out , final CSVFormat format ) { } public void println ( ) throws IOException { } public void flush ( ) throws IOException { } public void printRecord ( final Object ... values ) throws IOException { } public void printRecord ( final Iterable < ? > values ) throws IOException { } public void printComment ( final String comment ) throws IOException { } private void print ( final Object object , final CharSequence value , final int offset , final int len ) throws IOException { } void printDelimiter ( ) throws IOException { } void printAndEscape ( final CharSequence value , final int offset , final int len ) throws IOException { } void printAndQuote ( final Object object , final CharSequence value , final int offset , final int len ) throws IOException { } public void print ( final Object value ) throws IOException { <START_BUG> final String strValue = ( value == null ) ? Constants . EMPTY : value . toString ( ) ; <END_BUG> print ( value , strValue , 0 , strValue . length ( ) ) ; } public void printRecords ( final Object [ ] values ) throws IOException { } public void printRecords ( final Iterable < ? > values ) throws IOException { } public void printRecords ( final ResultSet resultSet ) throws IOException , SQLException { } public void close ( ) throws IOException { } }

Fix:
final String strValue = ( value == null ) ? format . getNullToString ( ) : value . toString ( ) ;
Buggy code:
public class TableVisualizer extends AbstractVisualizer implements Clearable { private static Logger log = LoggingManager . getLoggerForClass ( ) ; private final String [ ] COLUMNS = new String [ ] { JMeterUtils . getResString ( "table_visualizer_sample_num" ) , JMeterUtils . getResString ( "url" ) , JMeterUtils . getResString ( "table_visualizer_sample_time" ) , JMeterUtils . getResString ( "Success?" ) , JMeterUtils . getResString ( "table_visualizer_bytes" ) } ; private ObjectTableModel model = null ; private JTable table = null ; private JTextField dataField = null ; private JTextField averageField = null ; private JTextField deviationField = null ; private JTextField noSamplesField = null ; private JScrollPane tableScrollPanel = null ; private StatCalculator calc = new StatCalculator ( ) ; private long currentData = 0 ; public TableVisualizer ( ) { } public String getLabelResource ( ) { } protected synchronized void updateTextFields ( ) { } public void add ( SampleResult res ) { synchronized ( calc ) { calc . addValue ( res . getTime ( ) ) ; <START_BUG> Sample newS = new Sample ( res . getSampleLabel ( ) , res . getTime ( ) , 0 , 0 , 0 , 0 , 0 , 0 , res . isSuccessful ( ) , calc . getCount ( ) , res . getTimeStamp ( ) , res . getResponseData ( ) . length ) ; <END_BUG> model . addRow ( newS ) ; } currentData = res . getTime ( ) ; updateTextFields ( ) ; } public synchronized void clear ( ) { } public String toString ( ) { } private void init ( ) { } }

Fix:
Sample newS = new Sample ( res . getSampleLabel ( ) , res . getTime ( ) , 0 , 0 , 0 , 0 , 0 , 0 , res . isSuccessful ( ) , calc . getCount ( ) , res . getTimeStamp ( ) , res . getBytes ( ) ) ;
Buggy code:
public class StaticPartitionConnections { Map < Integer , SimpleConsumer > _kafka = new HashMap < Integer , SimpleConsumer > ( ) ; KafkaConfig _config ; StaticHosts hosts ; public StaticPartitionConnections ( KafkaConfig conf ) { } public SimpleConsumer getConsumer ( int partition ) { if ( ! ( _kafka . containsKey ( partition ) ) ) { HostPort hp = hosts . getPartitionInformation ( ) . getHostFor ( partition ) ; <START_BUG> _kafka . put ( partition , new SimpleConsumer ( hp . host , hp . port , _config . socketTimeoutMs , _config . bufferSizeBytes , OffsetRequest . DefaultClientId ( ) ) ) ; <END_BUG> } return _kafka . get ( partition ) ; } public void close ( ) { } }

Fix:
_kafka . put ( partition , new SimpleConsumer ( hp . host , hp . port , _config . socketTimeoutMs , _config . bufferSizeBytes , _config . clientId ) ) ;
Buggy code:
public class WebServiceSEIPresentNoWebMethodRuleTest extends AbstractAnnotationValidationTest { @ Override protected Annotation getAnnotation ( ) { } @ Override protected String getClassContents ( ) { } @ Override protected String getClassName ( ) { } @ Override protected String getPackageName ( ) { } public void testWebServiceSEIPresentNoWebMethodRule ( ) { try { assertNotNull ( annotation ) ; assertEquals ( "WebMethod" , AnnotationUtils . getAnnotationName ( annotation ) ) ; IMethod method = source . findPrimaryType ( ) . getMethod ( "myMethod" , new String [ 0 ] ) ; assertNotNull ( method ) ; AnnotationUtils . getImportChange ( compilationUnit , WebMethod . class , textFileChange , true ) ; AnnotationUtils . createMethodAnnotationChange ( source , compilationUnit , rewriter , method , annotation , textFileChange ) ; assertTrue ( executeChange ( new NullProgressMonitor ( ) , textFileChange ) ) ; assertTrue ( AnnotationUtils . isAnnotationPresent ( method , AnnotationUtils . getAnnotationName ( annotation ) ) ) ; Job . getJobManager ( ) . join ( ResourcesPlugin . FAMILY_AUTO_BUILD , null ) ; IMarker [ ] allmarkers = source . getResource ( ) . findMarkers ( IMarker . PROBLEM , true , IResource . DEPTH_INFINITE ) ; assertEquals ( 1 , allmarkers . length ) ; IMarker annotationProblemMarker = allmarkers [ 0 ] ; assertEquals ( source . getResource ( ) , annotationProblemMarker . getResource ( ) ) ; <START_BUG> assertEquals ( WEBSERVICE_ENPOINTINTERFACE_NO_WEBMETHOS_ERROR_MESSAGE , annotationProblemMarker . getAttribute ( IMarker . MESSAGE ) ) ; <END_BUG> } catch ( CoreException ce ) { fail ( ce . getLocalizedMessage ( ) ) ; } catch ( OperationCanceledException oce ) { fail ( oce . getLocalizedMessage ( ) ) ; } catch ( InterruptedException ie ) { fail ( ie . getLocalizedMessage ( ) ) ; } } }

Fix:
assertEquals ( WEBSERVICE_ENPOINTINTERFACE_NO_WEBMETHODS_ERROR_MESSAGE , annotationProblemMarker . getAttribute ( IMarker . MESSAGE ) ) ;
Buggy code:
public class TextListenerTest extends TestCase { private JUnitCore runner ; private OutputStream results ; private TextListener listener ; @ Override public void setUp ( ) { } public static class OneTest { @ Test public void one ( ) { } } public void testSuccess ( ) throws Exception { } public static class ErrorTest { @ Test public void error ( ) throws Exception { } } public void testError ( ) throws Exception { runner . run ( TextListenerTest . ErrorTest . class ) ; assertTrue ( results . toString ( ) . startsWith ( convert ( ".E\nTime:<seq2seq4repair_space>" ) ) ) ; <START_BUG> assertTrue ( ( ( results . toString ( ) . indexOf ( convert ( "\nThere<seq2seq4repair_space>was<seq2seq4repair_space>1<seq2seq4repair_space>failure:\n1)<seq2seq4repair_space>error(org.junit.tests.TextListenerTest$ErrorTest)\njava.lang.Exception" ) ) ) != ( - 1 ) ) ) ; <END_BUG> } public static class Slow { @ Test public void pause ( ) throws InterruptedException { } } public void testTime ( ) { } private String convert ( String string ) { } }

Fix:
assertTrue ( ( ( results . toString ( ) . indexOf ( convert ( "\nThere<seq2seq4repair_space>was<seq2seq4repair_space>1<seq2seq4repair_space>failure:\n1)<seq2seq4repair_space>error(org.junit.tests.listening.TextListenerTest$ErrorTest)\njava.lang.Exception" ) ) ) != ( - 1 ) ) ) ;
Buggy code:
public class TextTestSuite extends TestCase { public TextTestSuite ( String name ) { } public static void main ( String [ ] args ) { } public static Test suite ( ) { TestSuite suite = new TestSuite ( ) ; suite . setName ( "Commons-Lang-Text<seq2seq4repair_space>Tests" ) ; suite . addTest ( InterpolationTest . suite ( ) ) ; suite . addTest ( StrBuilderTest . suite ( ) ) ; suite . addTest ( StrTokenizerTest . suite ( ) ) ; <START_BUG> suite . addTestSuite ( VariableFormatTest . class ) ; <END_BUG> return suite ; } }

Fix:
suite . addTestSuite ( VariableFormatterTest . class ) ;
Buggy code:
public class CompoundAssignment extends Assignment implements OperatorIds { public int operator ; public int assignmentImplicitConversion ; public CompoundAssignment ( Expression lhs , Expression expression , int operator , int sourceEnd ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; lhs . generateCompoundAssignment ( currentScope , codeStream , expression , operator , assignmentImplicitConversion , valueRequired ) ; if ( valueRequired ) { codeStream . generateImplicitConversion ( implicitConversion ) ; } <START_BUG> codeStream . recordPositionsFrom ( pc , this ) ; <END_BUG> } public String operatorToString ( ) { } public TypeBinding resolveType ( BlockScope scope ) { } public boolean restrainUsageToNumericTypes ( ) { } public String toStringExpressionNoParenthesis ( ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope scope ) { } }

Fix:
codeStream . recordPositionsFrom ( pc , this . sourceStart ) ;
Buggy code:
public class SourceIndexer extends AbstractIndexer implements SuffixConstants { public SourceIndexer ( SearchDocument document ) { } public void indexDocument ( ) { SourceIndexerRequestor requestor = new SourceIndexerRequestor ( this ) ; String documentPath = this . document . getPath ( ) ; SourceElementParser parser = ( ( InternalSearchDocument ) ( this . document ) ) . parser ; if ( parser == null ) { IPath path = new Path ( documentPath ) ; IProject project = ResourcesPlugin . getWorkspace ( ) . getRoot ( ) . getProject ( path . segment ( 0 ) ) ; parser = JavaModelManager . getJavaModelManager ( ) . indexManager . getSourceElementParser ( JavaCore . create ( project ) , requestor ) ; } else { parser . setRequestor ( requestor ) ; } char [ ] source = null ; char [ ] name = null ; try { <START_BUG> source = document . getCharContents ( ) ; <END_BUG> name = documentPath . toCharArray ( ) ; } catch ( Exception e ) { } if ( ( source == null ) || ( name == null ) ) return ; CompilationUnit compilationUnit = new CompilationUnit ( source , name ) ; try { parser . parseCompilationUnit ( compilationUnit , true , null ) ; } catch ( Exception e ) { if ( JobManager . VERBOSE ) { e . printStackTrace ( ) ; } } } }

Fix:
source = this . document . getCharContents ( ) ;
Buggy code:
public class ResourceReference implements IClusterable { private static final long serialVersionUID = 1L ; protected Locale locale ; private final String name ; private transient Resource resource ; private final Class scope ; private String style ; public ResourceReference ( final Class scope , final String name ) { } public ResourceReference ( final Class scope , final String name , Locale locale , String style ) { } public ResourceReference ( final String name ) { } public final void bind ( final Application application ) { } public boolean equals ( Object obj ) { if ( obj instanceof ResourceReference ) { ResourceReference that = ( ( ResourceReference ) ( obj ) ) ; <START_BUG> return ( ( ( Objects . equal ( this . scope , that . scope ) ) && ( Objects . equal ( this . name , that . name ) ) ) && ( Objects . equal ( this . locale , that . locale ) ) ) && ( Objects . equal ( this . style , that . style ) ) ; <END_BUG> } return false ; } public final Locale getLocale ( ) { } public final String getName ( ) { } public final Resource getResource ( ) { } public final Class getScope ( ) { } public final String getSharedResourceKey ( ) { } public final String getStyle ( ) { } public int hashCode ( ) { } public final void invalidate ( ) { } public final void setLocale ( Locale locale ) { } public final void setStyle ( String style ) { } public String toString ( ) { } protected Resource newResource ( ) { } }

Fix:
return ( ( ( Objects . equal ( this . scope . getName ( ) , that . scope . getName ( ) ) ) && ( Objects . equal ( this . name , that . name ) ) ) && ( Objects . equal ( this . locale , that . locale ) ) ) && ( Objects . equal ( this . style , that . style ) ) ;
Buggy code:
public final class Streams { <START_BUG> public static long copyAndClose ( final InputStream in , final OutputStream out ) throws IOException { <END_BUG> try { return Streams . copy ( in , out ) ; } finally { IOUtils . closeQuietly ( in ) ; IOUtils . closeQuietly ( out ) ; } } public static int copy ( final InputStream in , final OutputStream out ) throws IOException { } public static int copy ( final InputStream in , final OutputStream out , final int bufSize ) throws IOException { } public static void loadFromXml ( final Properties properties , final InputStream inputStream ) throws IOException { } public static String readString ( final InputStream in ) throws IOException { } public static String readString ( final InputStream in , final CharSequence encoding ) throws IOException { } public static String readString ( final Reader in ) throws IOException { } private Streams ( ) { } }

Fix:
public static int copyAndClose ( final InputStream in , final OutputStream out ) throws IOException {
Buggy code:
public class Link extends Control { String text ; TextLayout layout ; Color linkColor ; Color disabledColor ; Point [ ] offsets ; Point selection ; String [ ] ids ; int [ ] mnemonics ; int focusIndex ; static final RGB LINK_FOREGROUND = new RGB ( 0 , 51 , 153 ) ; static final RGB LINK_DISABLED_FOREGROUND = new RGB ( 172 , 168 , 153 ) ; public Link ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( int index ) { <START_BUG> state |= HANDLE ; <END_BUG> handle = OS . g_object_new ( display . gtk_fixed_get_type ( ) , 0 ) ; if ( ( handle ) == 0 ) SWT . error ( ERROR_NO_HANDLES ) ; OS . gtk_fixed_set_has_window ( handle , true ) ; OS . GTK_WIDGET_SET_FLAGS ( handle , GTK_CAN_FOCUS ) ; layout = new TextLayout ( display ) ; linkColor = new Color ( display , Link . LINK_FOREGROUND ) ; disabledColor = new Color ( display , Link . LINK_DISABLED_FOREGROUND ) ; offsets = new Point [ 0 ] ; ids = new String [ 0 ] ; mnemonics = new int [ 0 ] ; selection = new Point ( ( - 1 ) , ( - 1 ) ) ; focusIndex = - 1 ; } void createWidget ( int index ) { } void enableWidget ( boolean enabled ) { } void initAccessible ( ) { } String getNameText ( ) { } Rectangle [ ] getRectangles ( int linkIndex ) { } public String getText ( ) { } int gtk_button_press_event ( int widget , int event ) { } int gtk_button_release_event ( int widget , int event ) { } int gtk_event_after ( int widget , int gdkEvent ) { } int gtk_expose_event ( int widget , int eventPtr ) { } int gtk_key_press_event ( int widget , int eventPtr ) { } int gtk_motion_notify_event ( int widget , int event ) { } void releaseWidget ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } String parse ( String string ) { } int parseMnemonics ( char [ ] buffer , int start , int end , StringBuffer result ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize ) { } void setFontDescription ( int font ) { } public void setText ( String string ) { } void showWidget ( ) { } int traversalCode ( int key , GdkEventKey event ) { } }

Fix:
state |= ( HANDLE ) | ( THEME_BACKGROUND ) ;
Buggy code:
public class ProgressBarViewer { private static ProgressDialog progress ; public static void view ( Activity activity , String message ) { } public static void hide ( ) { if ( ( ( ProgressBarViewer . progress ) != null ) && ( ProgressBarViewer . progress . isShowing ( ) ) ) <START_BUG> ProgressBarViewer . progress . hide ( ) ; <END_BUG> } }

Fix:
ProgressBarViewer . progress . dismiss ( ) ;
Buggy code:
public class ThreadMXBeanReadResourceHandler implements OperationStepHandler { public static final ThreadMXBeanReadResourceHandler INSTANCE = new ThreadMXBeanReadResourceHandler ( ) ; private ThreadMXBeanReadResourceHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ModelNode result = context . getResult ( ) ; for ( String attribute : PlatformMBeanConstants . THREADING_READ_ATTRIBUTES ) { final ModelNode store = result . get ( attribute ) ; try { ThreadMXBeanAttributeHandler . storeResult ( attribute , store ) ; } catch ( SecurityException ignored ) { } catch ( UnsupportedOperationException ignored ) { } } for ( String attribute : PlatformMBeanConstants . THREADING_READ_WRITE_ATTRIBUTES ) { final ModelNode store = result . get ( attribute ) ; try { ThreadMXBeanAttributeHandler . storeResult ( attribute , store ) ; } catch ( SecurityException ignored ) { } catch ( UnsupportedOperationException ignored ) { } } for ( String attribute : PlatformMBeanConstants . THREADING_METRICS ) { final ModelNode store = result . get ( attribute ) ; try { ThreadMXBeanAttributeHandler . storeResult ( attribute , store ) ; } catch ( SecurityException ignored ) { } catch ( UnsupportedOperationException ignored ) { } } if ( ( PlatformMBeanUtil . JVM_MAJOR_VERSION ) > 6 ) { final ModelNode store = result . get ( OBJECT_NAME ) ; ThreadMXBeanAttributeHandler . storeResult ( OBJECT_NAME , store ) ; } <START_BUG> context . completeStep ( ) ; <END_BUG> } }

Fix:
context . completeStep ( NOOP_ROLLBACK_HANDLER ) ;
Buggy code:
public class KafkaBolt < K , V > extends BaseRichBolt { private static final Logger LOG = LoggerFactory . getLogger ( KafkaBolt . class ) ; public static final String TOPIC = "topic" ; public static final String KAFKA_BROKER_PROPERTIES = "kafka.broker.properties" ; private Producer < K , V > producer ; private OutputCollector collector ; private TupleToKafkaMapper < K , V > mapper ; private KafkaTopicSelector topicSelector ; public KafkaBolt < K , V > withTupleToKafkaMapper ( TupleToKafkaMapper < K , V > mapper ) { } public KafkaBolt < K , V > withTopicSelector ( KafkaTopicSelector selector ) { <START_BUG> this . topicSelector = topicSelector ; <END_BUG> return this ; } @ Override public void prepare ( Map stormConf , TopologyContext context , OutputCollector collector ) { } @ Override public void execute ( Tuple input ) { } @ Override public void declareOutputFields ( OutputFieldsDeclarer declarer ) { } }

Fix:
this . topicSelector = selector ;
Buggy code:
public class MainActivity extends AppCompatActivity { private static final int MAX_HEIGHT = 160 ; private static final int MIN_HEIGHT = 48 ; private PullToScaleHeaderLayout pullToScrollLayout ; private ImageView fadeCover ; private ImageView cover ; private int heightOfHeader ; private int heightOfFooter ; private int heightOfActionBar ; private ArrayAdapter < String > arrayAdapter ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void initScrollToScaleHeaderLayout ( ) { ArrayList < String > arrayList = new ArrayList < > ( ) ; <START_BUG> for ( int i = 0 ; i < 15 ; i ++ ) { <END_BUG> arrayList . add ( ( "text" + i ) ) ; } arrayAdapter = new ArrayAdapter ( this , layout . list_item_layout , arrayList ) ; heightOfHeader = MainActivity . dipToPx ( this , MainActivity . MAX_HEIGHT ) ; heightOfFooter = MainActivity . dipToPx ( this , MainActivity . MIN_HEIGHT ) ; heightOfActionBar = MainActivity . dipToPx ( this , MainActivity . MIN_HEIGHT ) ; pullToScrollLayout = ( ( PullToScaleHeaderLayout ) ( findViewById ( pull_to_scroll_layout ) ) ) ; fadeCover = ( ( ImageView ) ( findViewById ( fade_cover ) ) ) ; cover = ( ( ImageView ) ( findViewById ( R . id . cover ) ) ) ; pullToScrollLayout . setHeightOfActionBar ( heightOfActionBar ) ; pullToScrollLayout . setHeightOfHeader ( heightOfHeader ) ; pullToScrollLayout . setHeightOfFooter ( heightOfFooter ) ; pullToScrollLayout . setAdapter ( arrayAdapter ) ; pullToScrollLayout . setOnHeaderScrollChangedListener ( new PullToScaleHeaderLayout . OnHeaderScrollChangedListener ( ) { @ Override public void headerScrollChanged ( float scrollDistance ) { float friction = ( scrollDistance + ( heightOfHeader ) ) // ( heightOfHeader ) ; float alphaFriction = ( heightOfHeader ) // ( scrollDistance + ( heightOfHeader ) ) ; scaleView ( friction , friction , cover , fadeCover ) ; setAlpha ( alphaFriction , fadeCover ) ; setTranslate ( 0 , ( ( ( int ) ( scrollDistance ) ) // 2 ) , cover , fadeCover ) ; } @ Override public void actionBarTranslate ( float translateDistance ) { setTranslate ( 0 , translateDistance , cover , fadeCover ) ; } } ) ; } private void scaleView ( float frictionX , float fractionY , View ... params ) { } private void setAlpha ( float alpha , View ... params ) { } private synchronized void setTranslate ( float offsetX , float offsetY , View ... params ) { } public static int dipToPx ( Context context , float dpValue ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
for ( int i = 0 ; i < 13 ; i ++ ) {
Buggy code:
public class CSVReader extends Reader { private String delimiter = ";" ; private FileReader fr ; private BufferedReader br ; public CSVReader ( String filepath ) throws FileNotFoundException { } public CSVReader ( String filepath , String delimiter ) throws FileNotFoundException { } public String [ ] readRow ( ) { String line = null ; try { line = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } if ( line == null ) return null ; <START_BUG> String [ ] record = line . split ( ( ( delimiter ) + "(?=([^\"]*\"[^\"]*\")*[^\"]*$)" ) ) ; <END_BUG> return record ; } public String getDelimiter ( ) { } public void setDelimiter ( String delimiter ) { } }

Fix:
String [ ] record = line . split ( ( ( delimiter ) + "(?=([^\"]*\"[^\"]*\")*[^\"]*$)" ) , ( - 1 ) ) ;
Buggy code:
public class Utils { public static final String FAKED_OS_NAME_PROPERTY_KEY = "webdriverextensions.faked.os.name" ; public static final String FAKED_BIT_PROPERTY_KEY = "webdriverextensions.faked.bit" ; public static String quote ( String text ) { } public static String quote ( Path path ) { } public static String quote ( File file ) { } public static String quote ( URL url ) { } public static boolean isWindows ( ) { } public static boolean isMac ( ) { } public static boolean isLinux ( ) { } public static boolean is64Bit ( ) { } public static String debugInfo ( InstallDriversMojo mojo ) { } public static String debugInfo ( Driver driver ) { } public static String debugInfo ( InstallDriversMojo mojo , Driver driver ) { } public static String directoryToString ( File path ) { if ( ! ( path . exists ( ) ) ) { <START_BUG> throw new IllegalArgumentException ( ( "Directory<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist:<seq2seq4repair_space>" + path ) ) ; <END_BUG> } if ( ! ( path . isDirectory ( ) ) ) { throw new IllegalArgumentException ( ( "The<seq2seq4repair_space>path<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>directory:<seq2seq4repair_space>" + path ) ) ; } Collection < File > files = FileUtils . listFiles ( path , new RegexFileFilter ( "^(.*?)" ) , DirectoryFileFilter . DIRECTORY ) ; StringBuilder stringBuilder = new StringBuilder ( ) ; stringBuilder . append ( path ) ; stringBuilder . append ( System . lineSeparator ( ) ) ; int padSize = Utils . longestPath ( files , path ) ; for ( Iterator iterator = files . iterator ( ) ; iterator . hasNext ( ) ; ) { File file = ( ( File ) ( iterator . next ( ) ) ) ; String relativePath = Utils . getRelativePath ( file , path ) ; if ( iterator . hasNext ( ) ) { stringBuilder . append ( "├──<seq2seq4repair_space>" ) ; } else { stringBuilder . append ( "└──<seq2seq4repair_space>" ) ; } stringBuilder . append ( StringUtils . rightPad ( relativePath , padSize ) ) ; stringBuilder . append ( Utils . readableFileSize ( file ) ) ; stringBuilder . append ( System . lineSeparator ( ) ) ; } return stringBuilder . toString ( ) ; } private static int longestPath ( Collection < File > files , File relativeToPath ) { } private static String getRelativePath ( File file , File relativeToPath ) { } private static String readableFileSize ( File file ) { } }

Fix:
return ( "Directory<seq2seq4repair_space>" + ( Utils . quote ( path ) ) ) + "<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist" ;
Buggy code:
public class RemoteChannelPairSetup { static final String ENDPOINT_NAME = "endpoint" ; static final String URI_SCHEME = "test123" ; static final String TEST_CHANNEL = "Test-Channel" ; static final int PORT = 32123 ; ChannelServer channelServer ; protected ExecutorService executorService ; protected ManagementChannel serverChannel ; protected ManagementChannel clientChannel ; final CountDownLatch clientConnectedLatch = new CountDownLatch ( 1 ) ; public ManagementChannel getServerChannel ( ) { } public ManagementChannel getClientChannel ( ) { } public ExecutorService getExecutorService ( ) { } public void setupRemoting ( ) throws IOException { } public void startChannels ( ) throws IOException , URISyntaxException { ProtocolChannelClient . Configuration < ManagementChannel > configuration = new ProtocolChannelClient . Configuration < ManagementChannel > ( ) ; configuration . setEndpointName ( RemoteChannelPairSetup . ENDPOINT_NAME ) ; configuration . setUriScheme ( RemoteChannelPairSetup . URI_SCHEME ) ; configuration . setUri ( new URI ( ( ( ( ( "" + ( RemoteChannelPairSetup . URI_SCHEME ) ) + ":////127.0.0.1:" ) + ( RemoteChannelPairSetup . PORT ) ) + "" ) ) ) ; configuration . setExecutor ( executorService ) ; configuration . setChannelFactory ( new ManagementChannelFactory ( ) ) ; ProtocolChannelClient < ManagementChannel > client = ProtocolChannelClient . create ( configuration ) ; <START_BUG> client . connect ( ) ; <END_BUG> clientChannel = client . openChannel ( RemoteChannelPairSetup . TEST_CHANNEL ) ; try { clientConnectedLatch . await ( ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( e ) ; } } public void stopChannels ( ) throws InterruptedException { } public void shutdownRemoting ( ) throws IOException , InterruptedException { } }

Fix:
client . connect ( null ) ;
Buggy code:
public class ThreadGroup extends AbstractTestElement implements Serializable , Controller , SampleListener { private static Logger log = LoggingManager . getLoggerForClass ( ) ; public static final String NUM_THREADS = "ThreadGroup.num_threads" ; public static final String RAMP_TIME = "ThreadGroup.ramp_time" ; public static final String MAIN_CONTROLLER = "ThreadGroup.main_controller" ; public static final String SCHEDULER = "ThreadGroup.scheduler" ; public static final String START_TIME = "ThreadGroup.start_time" ; public static final String END_TIME = "ThreadGroup.end_time" ; public static final String DURATION = "ThreadGroup.duration" ; public static final String DELAY = "ThreadGroup.delay" ; public static final String ON_SAMPLE_ERROR = "ThreadGroup.on_sample_error" ; public static final String ON_SAMPLE_ERROR_CONTINUE = "continue" ; public static final String ON_SAMPLE_ERROR_STOPTHREAD = "stopthread" ; public static final String ON_SAMPLE_ERROR_STOPTEST = "stoptest" ; private static final int DEFAULT_NUM_THREADS = 1 ; private static final int DEFAULT_RAMP_UP = 0 ; private ThreadGroup . SampleQueue queue = null ; private LinkedList listeners = new LinkedList ( ) ; private LinkedList remoteListeners = new LinkedList ( ) ; public ThreadGroup ( ) { } public void setNumThreads ( int numThreads ) { } public boolean isDone ( ) { } public Sampler next ( ) { } public void setScheduler ( boolean Scheduler ) { } public boolean getScheduler ( ) { } public void setStartTime ( long stime ) { } public long getStartTime ( ) { } public long getDuration ( ) { } public void setDuration ( long duration ) { } public long getDelay ( ) { } public void setDelay ( long delay ) { } public void setEndTime ( long etime ) { } public long getEndTime ( ) { } public void setRampUp ( int rampUp ) { } public int getRampUp ( ) { } public Controller getSamplerController ( ) { } public void setSamplerController ( LoopController c ) { } public int getNumThreads ( ) { } public int getDefaultNumThreads ( ) { } public int getDefaultRampUp ( ) { } public void addTestElement ( TestElement child ) { } public void sampleOccurred ( SampleEvent e ) { if ( ( queue ) == null ) { queue = new ThreadGroup . SampleQueue ( ) ; Thread thread = new Thread ( queue ) ; thread . start ( ) ; } queue . sampleOccurred ( e ) ; } public void sampleStarted ( SampleEvent e ) { } public void sampleStopped ( SampleEvent e ) { } private class SampleQueue implements Serializable , Runnable { List occurredQ = Collections . synchronizedList ( new LinkedList ( ) ) ; public SampleQueue ( ) { } public synchronized void sampleOccurred ( SampleEvent e ) { occurredQ . add ( e ) ; <START_BUG> this . notify ( ) ; <END_BUG> } public void run ( ) { } private synchronized void waitForSamples ( ) { } } public void addIterationListener ( LoopIterationListener lis ) { } public void initialize ( ) { } public boolean getOnErrorStopThread ( ) { } public boolean getOnErrorStopTest ( ) { } }

Fix:
this . notifyAll ( ) ;
Buggy code:
public abstract class AbstractEdge implements Edge { private static final long serialVersionUID = 1L ; protected Vertex fromv ; protected Vertex tov ; private List < Patch > patches ; protected AbstractEdge ( Vertex v1 , Vertex v2 ) { } @ Override public Vertex getFromVertex ( ) { } @ Override public Vertex getToVertex ( ) { } public void attachFrom ( Vertex fromv ) { } public void attachTo ( Vertex tov ) { } @ Override public void attach ( Vertex fromv , Vertex tov ) { } private void detachFrom ( ) { } private void detachTo ( ) { } @ Override public void detach ( ) { } public Trip getTrip ( ) { } public Set < Alert > getNotes ( ) { } @ Override public int hashCode ( ) { } @ Override public boolean isRoundabout ( ) { } @ Override public State optimisticTraverse ( State s0 ) { } public double weightLowerBound ( TraverseOptions options ) { } public double timeLowerBound ( TraverseOptions options ) { } @ Override public void addPatch ( Patch patch ) { } public List < Patch > getPatches ( ) { } @ Override public void removePatch ( Patch patch ) { <START_BUG> if ( ( patches . size ( ) ) == 1 ) { <END_BUG> patches = null ; } else { patches . remove ( patch ) ; } } public boolean hasBogusName ( ) { } public String toString ( ) { } private void readObject ( ObjectInputStream in ) throws IOException , ClassNotFoundException { } private void writeObject ( ObjectOutputStream out ) throws IOException , ClassNotFoundException { } @ SuppressWarnings ( "unchecked" ) private static final AbstractEdge . ValidVertexTypes VALID_VERTEX_TYPES = new AbstractEdge . ValidVertexTypes ( Vertex . class , Vertex . class ) ; @ Override public AbstractEdge . ValidVertexTypes getValidVertexTypes ( ) { } @ Override public final boolean vertexTypesValid ( ) { } public static final class ValidVertexTypes { private final Class < ? extends Vertex > [ ] classes ; public ValidVertexTypes ( Class < ? extends Vertex > ... classes ) { } public boolean isValid ( Vertex from , Vertex to ) { } } }

Fix:
if ( ( ( patches ) == null ) || ( ( patches . size ( ) ) == 1 ) ) {
Buggy code:
@ RestController public class MeasurementController { @ Autowired private MeasurementRepository measurementRepository ; <START_BUG> @ RequestMapping ( method = RequestMethod . GET , value = "//measurement" , produces = "application//json" , consumes = "text//html" ) <END_BUG> @ ResponseBody public List < BodyMeasurement > loadMeasurements ( @ RequestParam ( required = false ) final LocalDate from , @ RequestParam ( required = false ) final LocalDate to ) { return new ArrayList < BodyMeasurement > ( ) { } ; } @ RequestMapping ( method = RequestMethod . POST , value = "//measurement" ) @ ResponseBody public void saveMeasurements ( List < BodyMeasurement > measurements ) { } private String getCurrentUser ( ) { } }

Fix:
@ RequestMapping ( method = RequestMethod . GET , value = "//measurement" )
Buggy code:
public class GZip extends Pack { protected void pack ( ) { GZIPOutputStream zOut = null ; try { zOut = new GZIPOutputStream ( new FileOutputStream ( zipFile ) ) ; zipFile ( source , zOut ) ; } catch ( IOException ioe ) { String msg = "Problem<seq2seq4repair_space>creating<seq2seq4repair_space>gzip<seq2seq4repair_space>" + ( ioe . getMessage ( ) ) ; <START_BUG> throw new org . apache . tools . ant . BuildException ( msg , ioe , location ) ; <END_BUG> } finally { if ( zOut != null ) { try { zOut . close ( ) ; } catch ( IOException e ) { } } } } }

Fix:
throw new BuildException ( msg , ioe ) ;
Buggy code:
public class HOGTests { private File simpleImg ; @ Before public void setup ( ) { <START_BUG> Path simpleImgPath = Paths . get ( ( ( Helper . getAssetsFolder ( ) . toAbsolutePath ( ) . toString ( ) ) + "//Test//vectorGradientTest.png" ) ) ; <END_BUG> System . out . println ( simpleImgPath ) ; simpleImg = simpleImgPath . toFile ( ) ; } @ Test public void testCreation ( ) { } @ Test public void testCreationRectangular ( ) { } @ Test public void testGetPixelArray ( ) { } @ Test public void testComputingGradientVector ( ) { } @ Test public void computingAGradientVectorForEdgePixel ( ) { } @ Test public void testGradientVectorMagnitude ( ) { } @ Test public void testComputeAngle ( ) { } @ Test public void testHistogram ( ) { } @ Test public void testVectorNormalization ( ) { } @ Test public void testBlockNormalization ( ) { } @ Test public void testFinalDescriptor ( ) { } }

Fix:
Path simpleImgPath = Paths . get ( ( ( Helper . getAssetsFolderStr ( ) ) + "//Test//vectorGradientTest.png" ) ) ;
Buggy code:
public abstract class AbstractRequestCycleProcessor implements IRequestCycleProcessor { private IRequestCodingStrategy requestCodingStrategy ; public AbstractRequestCycleProcessor ( ) { } public IRequestCodingStrategy getRequestCodingStrategy ( ) { } public void processEvents ( RequestCycle requestCycle ) { } public void respond ( RequestCycle requestCycle ) { } public void respond ( RuntimeException e , RequestCycle requestCycle ) { } protected abstract IRequestCodingStrategy newRequestCodingStrategy ( ) { } protected Page onRuntimeException ( final Page page , final RuntimeException e ) { } protected IRequestTarget resolveBookmarkablePage ( final RequestCycle requestCycle , final RequestParameters requestParameters ) { } protected IRequestTarget resolveExternalResource ( RequestCycle requestCycle ) { <START_BUG> final String url = '//' + ( requestCycle . getRequest ( ) . getRelativeURL ( ) ) ; <END_BUG> return new WebExternalResourceRequestTarget ( url ) ; } protected IRequestTarget resolveHomePageTarget ( final RequestCycle requestCycle , final RequestParameters requestParameters ) { } protected IRequestTarget resolveListenerInterfaceTarget ( final RequestCycle requestCycle , final Page page , final String componentPath , final String interfaceName , final RequestParameters requestParameters ) { } protected IRequestTarget resolveRenderedPage ( final RequestCycle requestCycle , final RequestParameters requestParameters ) { } protected IRequestTarget resolveSharedResource ( final RequestCycle requestCycle , final RequestParameters requestParameters ) { } }

Fix:
final String url = '//' + ( requestCycle . getRequest ( ) . getURL ( ) ) ;