nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Deltree extends Task { private File dir ; public void setDir ( String dirName ) { } public void execute ( ) throws BuildException { <START_BUG> project . log ( ( "Deleting:<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ) ) ; <END_BUG> if ( dir . exists ( ) ) { if ( ! ( dir . isDirectory ( ) ) ) { if ( ! ( dir . delete ( ) ) ) { throw new BuildException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>delete<seq2seq4repair_space>file<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ) ) ; } return ; } try { removeDir ( dir ) ; } catch ( IOException ioe ) { String msg = "Unable<seq2seq4repair_space>to<seq2seq4repair_space>delete<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ; throw new BuildException ( msg ) ; } } } private void removeDir ( File dir ) throws IOException { } }

Fix:
log ( ( "Deleting:<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ) ) ;
Buggy code:
public class Tag { public String analysis ( String content ) { } public ArrayList < String > collect ( String res ) { ArrayList < String > noun = new ArrayList ( ) ; String [ ] sen = res . split ( "<seq2seq4repair_space>" ) ; for ( int i = 0 ; i < ( sen . length ) ; i ++ ) { if ( sen [ i ] . endsWith ( "_NN" ) ) { <START_BUG> noun . add ( sen [ i ] . substring ( 0 , ( ( sen [ i ] . length ( ) ) - 3 ) ) ) ; <END_BUG> } } return noun ; } No newline ; at end ; of file ; }

Fix:
noun . add ( sen [ i ] . substring ( 0 , ( ( sen [ i ] . length ( ) ) - 3 ) ) . toLowerCase ( ) ) ;
Buggy code:
public class LibraryTest extends TestCase { public void test_1 ( ) throws Exception { WicketTester tester = new WicketTester ( new LibraryApplication ( ) ) ; tester . startPage ( SignIn . class ) ; tester . assertContains ( "Wicket<seq2seq4repair_space>Examples<seq2seq4repair_space>-<seq2seq4repair_space>library" ) ; tester . assertContains ( "Username<seq2seq4repair_space>and<seq2seq4repair_space>password<seq2seq4repair_space>are<seq2seq4repair_space>both" ) ; FormTester formTester = tester . newFormTester ( "signInPanel:signInForm" ) ; formTester . setValue ( "username" , "wicket" ) ; formTester . setValue ( "password" , "wicket" ) ; formTester . submit ( ) ; tester . assertRenderedPage ( Home . class ) ; tester . assertContains ( "Wicket<seq2seq4repair_space>Examples<seq2seq4repair_space>-<seq2seq4repair_space>library" ) ; <START_BUG> tester . assertLabel ( "books:0:author" , "Effective<seq2seq4repair_space>Java<seq2seq4repair_space>(Joshua<seq2seq4repair_space>Bloch)" ) ; <END_BUG> } }

Fix:
tester . assertLabel ( "border:border_body:books:0:author" , "Effective<seq2seq4repair_space>Java<seq2seq4repair_space>(Joshua<seq2seq4repair_space>Bloch)" ) ;
Buggy code:
public class ReceiveSendAction extends AbstractColumbaAction { public ReceiveSendAction ( IFrameMediator controller ) { } public void actionPerformed ( ActionEvent evt ) { MailCheckingManager . getInstance ( ) . checkAll ( ) ; try { Action sendAllAction ; <START_BUG> IExtension extension = PluginManager . getInstance ( ) . getHandler ( ORG_COLUMBA_CORE_ACTION ) . getExtension ( "SendAll" ) ; <END_BUG> sendAllAction = ( ( Action ) ( extension . instanciateExtension ( new Object [ ] { getFrameMediator ( ) } ) ) ) ; if ( sendAllAction . isEnabled ( ) ) sendAllAction . actionPerformed ( evt ) ; } catch ( PluginHandlerNotFoundException e ) { e . printStackTrace ( ) ; } catch ( PluginException e ) { e . printStackTrace ( ) ; } } }

Fix:
IExtension extension = PluginManager . getInstance ( ) . getExtensionHandler ( ORG_COLUMBA_CORE_ACTION ) . getExtension ( "SendAll" ) ;
Buggy code:
public class Select extends FormComponent { private static final long serialVersionUID = 1L ; public Select ( String id ) { } public Select ( String id , IModel model ) { } public void updateModel ( ) { } boolean isSelected ( SelectOption option ) { if ( hasRawInput ( ) ) { <START_BUG> String [ ] paths = inputAsStringArray ( ) ; <END_BUG> if ( ( paths != null ) && ( ( paths . length ) > 0 ) ) { for ( int i = 0 ; i < ( paths . length ) ; i ++ ) { String path = paths [ i ] ; if ( path . equals ( option . getPath ( ) ) ) { return true ; } } } } else { Object selected = getModelObject ( ) ; Object value = option . getModelObject ( ) ; if ( ( selected != null ) && ( selected instanceof Collection ) ) { if ( value instanceof Collection ) { return ( ( Collection ) ( selected ) ) . containsAll ( ( ( Collection ) ( value ) ) ) ; } else { return ( ( Collection ) ( selected ) ) . contains ( value ) ; } } else { return Objects . equal ( selected , value ) ; } } return false ; } }

Fix:
String [ ] paths = getInputAsArray ( ) ;
Buggy code:
public class ItemServlet extends HttpServlet implements Servlet { public ItemServlet ( ) { } protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { String item_id = request . getParameter ( "id" ) ; if ( item_id == null ) item_id = "" ; String item_xml = AuctionSearchClient . getXMLDataForItemId ( item_id ) ; <START_BUG> item_xml = item_xml . replace ( "\n" , "" ) . replace ( "\r" , "" ) . replace ( "\t" , "" ) ; <END_BUG> request . setAttribute ( "item" , item_xml ) ; request . setAttribute ( "id" , item_id ) ; request . getRequestDispatcher ( "//item.jsp" ) . forward ( request , response ) ; } }

Fix:
item_xml = item_xml . replace ( "\n" , "" ) . replace ( "\r" , "" ) . replace ( "\t" , "" ) . replace ( "\'" , "\\\'" ) ;
Buggy code:
public class Subscriber extends Client { private final MqttCallback MESSAGE_HABDLER = new Subscriber . MQTTMessageHandler ( ) ; public Subscriber ( String protocol , String broker , String port , String topic , String will , ClientType type ) throws MqttException { } public void subscribe ( ) throws MqttException { } public void unsubscribe ( ) throws MqttException { } class MQTTMessageHandler implements MqttCallback { @ Override public void connectionLost ( Throwable thrwbl ) { System . out . println ( "Connection<seq2seq4repair_space>Lost..." ) ; System . out . println ( thrwbl . getCause ( ) ) ; <START_BUG> String m = ( DB . class . getName ( ) ) + ( thrwbl . getCause ( ) . getMessage ( ) ) ; <END_BUG> LOGGER . log ( Level . SEVERE , m ) ; } @ Override public void messageArrived ( String string , MqttMessage mm ) throws Exception { } @ Override public void deliveryComplete ( IMqttDeliveryToken imdt ) { } } }

Fix:
String m = ( ( Subscriber . class . getName ( ) ) + "\n" ) + ( thrwbl . getMessage ( ) ) ;
Buggy code:
public class Alignment { public String name ; public Alignment enclosing ; public Location location ; public int fragmentIndex ; public int fragmentCount ; public int [ ] fragmentIndentations ; public boolean needRedoColumnAlignment ; public int chunkStartIndex ; public int chunkKind ; public int originalIndentationLevel ; public int breakIndentationLevel ; public int shiftBreakIndentationLevel ; public int [ ] fragmentBreaks ; public boolean wasSplit ; public Scribe scribe ; public static final int M_FORCE = 1 ; public static final int M_INDENT_ON_COLUMN = 2 ; public static final int M_INDENT_BY_ONE = 4 ; public static final int M_COMPACT_SPLIT = 16 ; public static final int M_COMPACT_FIRST_BREAK_SPLIT = 32 ; public static final int M_ONE_PER_LINE_SPLIT = 32 + 16 ; public static final int M_NEXT_SHIFTED_SPLIT = 64 ; public static final int M_NEXT_PER_LINE_SPLIT = 64 + 16 ; public static final int M_MULTICOLUMN = 256 ; public static final int M_NO_ALIGNMENT = 512 ; public int mode ; public static final int SPLIT_MASK = ( ( ( ( Alignment . M_ONE_PER_LINE_SPLIT ) | ( Alignment . M_NEXT_SHIFTED_SPLIT ) ) | ( Alignment . M_COMPACT_SPLIT ) ) | ( Alignment . M_COMPACT_FIRST_BREAK_SPLIT ) ) | ( Alignment . M_NEXT_PER_LINE_SPLIT ) ; public static final int R_OUTERMOST = 1 ; public static final int R_INNERMOST = 2 ; public int tieBreakRule ; public static int NONE = 0 ; public static int BREAK = 1 ; public static final int CHUNK_FIELD = 1 ; public static final int CHUNK_METHOD = 2 ; public static final int CHUNK_TYPE = 3 ; public Alignment ( String name , int mode , int tieBreakRule , Scribe scribe , int fragmentCount , int sourceRestart ) { } public boolean checkChunkStart ( int kind , int startIndex , int sourceRestart ) { } public void checkColumn ( ) { } public boolean couldBreak ( ) { } public Alignment getAlignment ( String targetName ) { } public void performFragmentEffect ( ) { if ( ( ( this . mode ) & ( Alignment . M_NO_ALIGNMENT ) ) != 0 ) { <START_BUG> this . scribe . space ( ) ; <END_BUG> } if ( ( this . fragmentBreaks [ this . fragmentIndex ] ) == 1 ) { this . scribe . printNewLine ( ) ; } if ( ( this . fragmentIndentations [ this . fragmentIndex ] ) > 0 ) { this . scribe . indentationLevel = this . fragmentIndentations [ this . fragmentIndex ] ; } } public void reset ( ) { } public void toFragmentsString ( StringBuffer buffer ) { } public String toString ( ) { } }

Fix:
return ;
Buggy code:
public interface VEXDocumentFragment { public static final String MIME_TYPE = "application//x-vex-document-fragment" ; public Content getContent ( ) { } public int getLength ( ) { } public List < VEXElement > getElements ( ) { } public List < String > getNodeNames ( ) { } <START_BUG> public VEXNode [ ] getNodes ( ) ; <END_BUG> }

Fix:
public List < VEXNode > getNodes ( ) ;
Buggy code:
public class DashboardServlet extends HttpServlet { private static final long serialVersionUID = - 6074841711114263838L ; @ Override protected void doGet ( HttpServletRequest req , HttpServletResponse resp ) throws IOException , ServletException { resp . setContentType ( "text//html" ) ; String error = req . getParameter ( "error" ) ; HttpSession session = req . getSession ( true ) ; Object obj = session . getAttribute ( "UserInfo" ) ; <START_BUG> if ( ( obj != null ) && ( error != null ) ) { <END_BUG> UserInfoCerealWrapper userInfo = ( ( UserInfoCerealWrapper ) ( obj ) ) ; if ( ( userInfo . getEmployeeID ( ) ) > 0 ) { String ageData = AnalyticsServlet . getDemographicCountAllEvents ( userInfo ) [ 1 ] ; String tagsData = AnalyticsServlet . getTagsAllEvents ( userInfo , true ) ; JSONArray upcomingEvents = getUpcomingEvents ( userInfo . getVendorID ( ) ) ; JSONArray pastEvents = getPastEvents ( userInfo . getVendorID ( ) ) ; req . setAttribute ( "ageData" , ageData ) ; req . setAttribute ( "tagData" , tagsData ) ; req . setAttribute ( "upcomingEvents" , upcomingEvents . toJSONString ( ) ) ; req . setAttribute ( "pastEvents" , pastEvents . toJSONString ( ) ) ; req . getRequestDispatcher ( "WEB-INF//pages//home.jsp" ) . forward ( req , resp ) ; } else { req . getRequestDispatcher ( "WEB-INF//pages//login.jsp" ) . forward ( req , resp ) ; } } else { req . setAttribute ( "errorDivText" , ( "There<seq2seq4repair_space>was<seq2seq4repair_space>a<seq2seq4repair_space>problem<seq2seq4repair_space>when<seq2seq4repair_space>enabling<seq2seq4repair_space>PrivaKey,<seq2seq4repair_space>please<seq2seq4repair_space>try<seq2seq4repair_space>again.<seq2seq4repair_space>Error:" + error ) ) ; req . getRequestDispatcher ( "WEB-INF//pages//login.jsp" ) . forward ( req , resp ) ; } } @ Override protected void doPost ( HttpServletRequest req , HttpServletResponse resp ) throws IOException , ServletException { } private JSONArray getUpcomingEvents ( Long vendorId ) { } private JSONArray getPastEvents ( Long vendorId ) { } }

Fix:
if ( ( obj != null ) && ( error == null ) ) {
Buggy code:
public class IndicatorHash { public IndicatorHash ( ) { } @ SuppressWarnings ( "serial" ) public static void main ( String [ ] args ) { try { XMLGregorianCalendar now = DatatypeFactory . newInstance ( ) . newXMLGregorianCalendar ( new GregorianCalendar ( TimeZone . getTimeZone ( "UTC" ) ) ) ; FileObjectType fileObject = new FileObjectType ( ) . withHashes ( new HashListType ( new ArrayList < HashType > ( ) { } ) ) ; ObjectType obj = new ObjectType ( ) . withProperties ( fileObject ) . withId ( new QName ( "http:////example.com//" , ( "file-" + ( UUID . randomUUID ( ) . toString ( ) ) ) , "example" ) ) ; Observable observable = new Observable ( ) . withId ( new QName ( "http:////example.com//" , ( "observable-" + ( UUID . randomUUID ( ) . toString ( ) ) ) , "example" ) ) ; observable . setObject ( obj ) ; IdentityType identity = new IdentityType ( ) . withName ( "The<seq2seq4repair_space>MITRE<seq2seq4repair_space>Corporation" ) ; InformationSourceType producer = new InformationSourceType ( ) . withIdentity ( identity ) . withTime ( new TimeType ( ) . withProducedTime ( new DateTimeWithPrecisionType ( now , null ) ) ) ; final Indicator indicator = new Indicator ( ) . withId ( new QName ( "http:////example.com//" , ( "indicator-" + ( UUID . randomUUID ( ) . toString ( ) ) ) , "example" ) ) . withTimestamp ( now ) . withTitle ( "File<seq2seq4repair_space>Hash<seq2seq4repair_space>Example" ) . withDescriptions ( new StructuredTextType ( ) . withValue ( "An<seq2seq4repair_space>indicator<seq2seq4repair_space>containing<seq2seq4repair_space>a<seq2seq4repair_space>File<seq2seq4repair_space>observable<seq2seq4repair_space>with<seq2seq4repair_space>an<seq2seq4repair_space>associated<seq2seq4repair_space>hash" ) ) . withObservable ( observable ) . withProducer ( producer ) ; IndicatorsType indicators = new IndicatorsType ( new ArrayList < IndicatorBaseType > ( ) { } ) ; STIXHeaderType stixHeader = new STIXHeaderType ( ) . withDescriptions ( new StructuredTextType ( ) . withValue ( "Example" ) ) ; <START_BUG> STIXPackage stixPackage = new STIXPackage ( ) . withSTIXHeader ( stixHeader ) . withIndicators ( indicators ) . withVersion ( "1.2.0" ) . withTimestamp ( now ) . withId ( new QName ( "http:////example.com//" , ( "package-" + ( UUID . randomUUID ( ) . toString ( ) ) ) , "example" ) ) ; <END_BUG> System . out . println ( stixPackage . toXMLString ( true ) ) ; System . out . println ( StringUtils . repeat ( "-" , 120 ) ) ; System . out . println ( ( "Validates:<seq2seq4repair_space>" + ( stixPackage . validate ( ) ) ) ) ; } catch ( DatatypeConfigurationException e ) { throw new RuntimeException ( e ) ; } } }

Fix:
STIXPackage stixPackage = new STIXPackage ( ) . withSTIXHeader ( stixHeader ) . withIndicators ( indicators ) . withVersion ( "1.2" ) . withTimestamp ( now ) . withId ( new QName ( "http:////example.com//" , ( "package-" + ( UUID . randomUUID ( ) . toString ( ) ) ) , "example" ) ) ;
Buggy code:
public class MockApplication extends WebApplication { public MockApplication ( ) { } @ Override public Class < ? extends Page > getHomePage ( ) { <START_BUG> return null ; <END_BUG> } @ Override public String getConfigurationType ( ) { } @ Override protected MockRequestCycle newRequestCycle ( RequestCycleContext context ) { } private IRequestablePage lastRenderedPage ; public IRequestablePage getLastRenderedPage ( ) { } public void clearLastRenderedPage ( ) { } @ Override public RenderPageRequestHandlerDelegate getRenderPageRequestHandlerDelegate ( RenderPageRequestHandler renderPageRequestHandler ) { } @ Override protected IPageManager newPageManager ( IPageManagerContext context ) { } @ Override public ISessionStore newSessionStore ( ) { } public Session getSession ( ) { } private MockServletContext mockServletContext ; @ Override public ServletContext getServletContext ( ) { } @ Override public final String getInitParameter ( String key ) { } @ Override protected void internalInit ( ) { } public void destroy ( ) { } }

Fix:
return MockHomePage . class ;
Buggy code:
public class VelocityWrapper { private static final String VELOCITY_ENGINE_INSTANCE = "de.fuberlin.wiwiss.d2rs.VelocityHelper.VELOCITY_ENGINE_INSTANCE" ; private static final String VELOCITY_DEFAULT_CONTEXT = "de.fuberlin.wiwiss.d2rs.VelocityHelper.VELOCITY_DEFAULT_CONTEXT" ; private static final String TEXTHTML_CONTENTTYPE = "text//html;<seq2seq4repair_space>charset=utf-8" ; private static final String APPLICATIONXML_CONTENTTYPE = "application//xhtml+xml;<seq2seq4repair_space>charset=utf-8" ; private static final ContentTypeNegotiator xhtmlNegotiator ; public static synchronized void initEngine ( D2RServer d2r , ServletContext servletContext ) { } private static Context initDefaultContext ( D2RServer server ) { } private final VelocityEngine engine ; private final Context context ; private final HttpServletRequest request ; private final HttpServletResponse response ; public VelocityWrapper ( HttpServlet servlet , HttpServletRequest request , HttpServletResponse response ) { } public Context getContext ( ) { } public VelocityEngine getEngine ( ) { } public void mergeTemplateXHTML ( String templateName ) { MediaRangeSpec bestMatch = VelocityWrapper . xhtmlNegotiator . getBestMatch ( request . getHeader ( "Accept" ) , request . getHeader ( "User-Agent" ) ) ; response . addHeader ( "Content-Type" , ( bestMatch != null ? bestMatch . getMediaType ( ) : VelocityWrapper . TEXTHTML_CONTENTTYPE ) ) ; response . addHeader ( "Vary" , "Accept,<seq2seq4repair_space>User-Agent" ) ; response . addHeader ( "Cache-Control" , "no-cache" ) ; response . addHeader ( "Pragma" , "no-cache" ) ; try { <START_BUG> engine . mergeTemplate ( templateName , context , response . getWriter ( ) ) ; <END_BUG> } catch ( Exception ex ) { throw new RuntimeException ( ex ) ; } } }

Fix:
engine . mergeTemplate ( templateName , "utf-8" , context , response . getWriter ( ) ) ;
Buggy code:
public class ClassData extends ItemData { Class clazz ; public ClassData ( Class clazz , String str ) { } public static String [ ] getAllFlags ( ) { <START_BUG> return new String [ ] { "no_gen" , "cpp" } ; <END_BUG> } public Class getClazz ( ) { } public String getExclude ( ) { } public void setExclude ( String str ) { } }

Fix:
return new String [ ] { FLAG_NO_GEN , FLAG_CPP } ;
Buggy code:
public class MapDroppableSubscriber { @ NiftyEventSubscriber ( id = "mapDropTarget" ) public void dropOnMap ( final String topic , final DroppableDroppedEvent data ) { final Element droppedElement = data . getDraggable ( ) . getElement ( ) ; final int dropSpotX = ( droppedElement . getX ( ) ) + ( ( droppedElement . getWidth ( ) ) // 2 ) ; final int dropSpotY = ( droppedElement . getY ( ) ) + ( ( droppedElement . getHeight ( ) ) // 2 ) ; <START_BUG> droppedElement . markForRemoval ( ) ; <END_BUG> World . getInteractionManager ( ) . dropAt ( dropSpotX , dropSpotY ) ; } }

Fix:
droppedElement . setVisible ( false ) ;
Buggy code:
public class NodeImpl implements Node { protected final ApplicationContainer appContainer ; protected final DefaultMutableTreeNode jTreeNode ; private ListNodeContext listNodeContext ; private ObjectNodeContext objectNodeContext ; protected NodeImpl ( ApplicationContainer appContainer ) { } public NodeImpl ( ApplicationContainer appContainer , Node parent , int insertIndex , ObjectLocation objectLocation ) { } public NodeImpl ( ApplicationContainer appContainer , Node parent , int insertIndex , ObjectMeta objectMeta , Property locProperty ) { } private void addToJTree ( Node parent , int insertIndex ) { } public DefaultMutableTreeNode getJtreeNode ( ) { } public boolean isRoot ( ) { } public Node getParent ( ) { } public Node getChildBefore ( Node node ) { } @ Override public Node getChildAfter ( Node node ) { } public Node getChildAt ( int index ) { } public ObjectNodeContext getObjectNodeContext ( ) { } public ListNodeContext getListNodeContext ( ) { } @ Override public Class wrappedObjectClass ( ) { } @ Override public < T > boolean isA ( Class < T > aClass ) { } public Object wrappedObject ( ) { } public Object nearestWrappedObject ( ) { } public Node parentObjectNode ( ) { } public ObjectMeta parentObjectMeta ( ) { } @ Override public ObjectMeta objectMeta ( ) { } @ Override public Node refresh ( ) { } @ Override public ObjectLocation toObjLocation ( ) { <START_BUG> return ( listNodeContext ) != null ? listNodeContext . getObjectLocation ( ) : null ; <END_BUG> } @ Override public ObjectLocation myObjLocation ( ) { } @ Override public ClassDatabase getClassDatabase ( ) { } @ Override public void updateIndex ( int newIndex ) { } @ Override public boolean isObjectNode ( ) { } @ Override public Node find ( Property property ) { } @ Override public Node closest ( Class filter ) { } @ Override public Node closest ( String method , Class ... parameterTypes ) { } @ Override public Property getLocProperty ( ) { } public ApplicationContainer getAppContainer ( ) { } public int indexOf ( Node node ) { } public int numChildren ( ) { } public TreePath getPath ( ) { } public List < Command > createCommands ( CommandContext commandContext ) { } public String toString ( ) { } public boolean containsReferences ( ) { } public boolean isReference ( ) { } public boolean canEdit ( ) { } @ Override public int index ( ) { } No newline ; at end ; of file ; }

Fix:
return ( listNodeContext ) != null ? new ObjectLocation ( listNodeContext . getObjectLocation ( ) ) : null ;
Buggy code:
public class SignaturePatternTestCase extends TestCase { public SignaturePatternTestCase ( String name ) { } BcelWorld world = new BcelWorld ( ) ; public void testThrowsMatch ( ) throws IOException { } public void testInstanceMethodMatch ( ) throws IOException { } public void testStaticMethodMatch ( ) throws IOException { } public void testFieldMatch ( ) throws IOException { } public void testConstructorMatch ( ) throws IOException { } public void checkMatch ( SignaturePattern p , Member [ ] yes , Member [ ] no ) throws IOException { } private void checkMatch ( SignaturePattern p , Member member , boolean b ) { } private SignaturePattern makeMethodPat ( String pattern ) { } private SignaturePattern makeFieldPat ( String pattern ) { } private void checkSerialization ( SignaturePattern p ) throws IOException { ByteArrayOutputStream bo = new ByteArrayOutputStream ( ) ; DataOutputStream out = new DataOutputStream ( bo ) ; p . write ( out ) ; out . close ( ) ; ByteArrayInputStream bi = new ByteArrayInputStream ( bo . toByteArray ( ) ) ; <START_BUG> DataInputStream in = new DataInputStream ( bi ) ; <END_BUG> SignaturePattern newP = SignaturePattern . read ( in , null ) ; assertEquals ( "write//read" , p , newP ) ; } }

Fix:
VersionedDataInputStream in = new VersionedDataInputStream ( bi ) ;
Buggy code:
public class HeaderSectionTest extends TestCase { private static Log log = LogFactory . getLog ( HeaderSectionTest . class ) ; private MockWebApplication application ; protected void setUp ( ) throws Exception { } public HeaderSectionTest ( String name ) { } public void testRenderHomePage_1 ( ) throws Exception { } public void testRenderHomePage_2 ( ) throws Exception { } public void testRenderHomePage_3 ( ) throws Exception { } public void testRenderHomePage_4 ( ) throws Exception { } public void testRenderHomePage_5 ( ) throws Exception { } public void testRenderHomePage_6 ( ) throws Exception { } public void testRenderHomePage_7 ( ) throws Exception { } public void testRenderHomePage_8 ( ) throws Exception { } public void testRenderHomePage_9 ( ) throws Exception { } public void testRenderHomePage_9a ( ) throws Exception { } public void testRenderHomePage_10 ( ) throws Exception { } public void testRenderHomePage_11 ( ) throws Exception { } public void testRenderHomePage_12 ( ) throws Exception { executeTest ( HeaderSectionPage_12 . class , "HeaderSectionPageExpectedResult_12.html" ) ; <START_BUG> PackageResource res = ( ( PackageResource ) ( application . getSharedResources ( ) . get ( "wicket.Application//cborder.css" ) ) ) ; <END_BUG> assertNotNull ( res ) ; String absPath = res . getAbsolutePath ( ) ; assertNotNull ( absPath ) ; IResourceStream stream = res . getResourceStream ( ) ; assertNotNull ( stream ) ; } public void executeTest ( final Class pageClass , final String filename ) throws Exception { } }

Fix:
PackageResource res = ( ( PackageResource ) ( application . getSharedResources ( ) . get ( "wicket.markup.parser.filter.sub.HeaderSectionBorder//cborder.css" ) ) ) ;
Buggy code:
public class Flag { public String Name ; public flagmaker . Ratio Ratio ; public flagmaker . Ratio GridSize ; public flagmaker . Division Division ; public Overlay [ ] Overlays ; public Flag ( String name , flagmaker . Ratio ratio , flagmaker . Ratio gridSize , flagmaker . Division division , Overlay [ ] overlays ) { } public static Flag LoadFromFile ( File file ) throws Exception { } public static String GetFlagPath ( ) { } public void Draw ( Pane canvas ) { } public void Save ( String path ) throws IOException { try ( FileWriter writer = new FileWriter ( path , false ) ; PrintWriter printLine = new PrintWriter ( writer ) ) { printLine . printf ( "name=%s\n" , Name ) ; printLine . printf ( "ratio=%d:%d\n" , Ratio . Height , Ratio . Width ) ; printLine . printf ( "gridSize=%s\n\n" , GridSize . ToString ( ) ) ; printLine . printf ( "division\n" ) ; printLine . printf ( "type=%s\n" , Division . Name ( ) ) ; for ( int i = 0 ; i < ( Division . Colors . length ) ; i ++ ) { printLine . printf ( "color%d=%s\n" , ( i + 1 ) , ColorExtensions . ToHexString ( Division . Colors [ i ] , false ) ) ; } for ( int i = 0 ; i < ( Division . Values . length ) ; i ++ ) { <START_BUG> printLine . printf ( "size%d=%d\n" , ( i + 1 ) , Division . Values [ 0 ] ) ; <END_BUG> } for ( Overlay overlay : Overlays ) { printLine . printf ( "\noverlay\n" ) ; printLine . printf ( "type=%s\n" , overlay . Name ( ) ) ; if ( overlay . Name ( ) . equals ( "flag" ) ) { printLine . printf ( "path=%s\n" , ( ( OverlayFlag ) ( overlay ) ) . Path ) ; } if ( overlay . Name ( ) . equals ( "image" ) ) { printLine . printf ( "path=%s\n" , ( ( flagmaker . Overlays . OverlayTypes . ShapeTypes . OverlayImage ) ( overlay ) ) . GetPath ( ) ) ; } else { printLine . printf ( "color=%s\n" , ColorExtensions . ToHexString ( overlay . Color , true ) ) ; } for ( int i = 0 ; i < ( overlay . Attributes . length ) ; i ++ ) { printLine . printf ( "size%d=%f\n" , ( i + 1 ) , overlay . Attributes [ i ] . Value ) ; } if ( overlay instanceof OverlayPath ) { printLine . printf ( "stroke=%s\n" , ColorExtensions . ToHexString ( ( ( OverlayPath ) ( overlay ) ) . StrokeColor , true ) ) ; } } } } public void ExportToPng ( Size size , File path ) { } public void ExportToSvg ( File file ) { } public Color [ ] ColorsUsed ( ) { } private void SetRepeaterOverlays ( ) { } private static Double GetDoubleFromString ( String data ) { } }

Fix:
printLine . printf ( "size%d=%d\n" , ( i + 1 ) , Division . Values [ i ] ) ;
Buggy code:
public class StatelessComponentTest extends WicketTestCase { public void testStatelessComponentPage ( ) throws Exception { } public void testStatelessComponentPageWithMount ( ) throws Exception { tester . getApplication ( ) . mountBookmarkablePage ( "//stateless" , StatelessComponentPage . class ) ; executeTest ( StatelessComponentPage . class , "StatelessComponentPage_mount_result.html" ) ; <START_BUG> tester . getRequest ( ) . setUrl ( Url . parse ( "stateless?0-1.ILinkListener-link&amp;testParam1=testValue1&amp;testParam2=testValue2" ) ) ; <END_BUG> try { tester . processRequest ( ) ; fail ( "An<seq2seq4repair_space>exception<seq2seq4repair_space>should<seq2seq4repair_space>have<seq2seq4repair_space>been<seq2seq4repair_space>thrown<seq2seq4repair_space>for<seq2seq4repair_space>this<seq2seq4repair_space>request!" ) ; } catch ( Exception e ) { assertEquals ( "wanted<seq2seq4repair_space>exception" , e . getMessage ( ) ) ; } } public void testStatelessComponentPageWithParams ( ) throws Exception { } public void testStatelessComponentPageWithParamsWithMount ( ) throws Exception { } public void testStatelessComponentPageWithParamsWithIndexMount ( ) throws Exception { } }

Fix:
tester . getRequest ( ) . setUrl ( Url . parse ( "stateless?0-1.ILinkListener-link&testParam1=testValue1&testParam2=testValue2" ) ) ;
Buggy code:
@ Entity public class Farm extends IntegerIdentifier { private static final long serialVersionUID = 389464594214451307L ; private Map < Integer , MarketingYear > marketingYears = new HashMap < > ( ) ; private FarmData coreData ; public void setFarmData ( FarmData coreData ) { } public List < MarketingYear > getMarketingYears ( ) { } public void setMarketingYears ( List < MarketingYear > marketingYears ) { } public FarmData getCoreData ( ) { } public void addMarketingYear ( MarketingYear year ) { <START_BUG> marketingYears . put ( year . getYear ( ) . getValue ( ) , year ) ; <END_BUG> } public void removeMarketingYear ( Integer year ) { } public boolean containsMarketingYear ( Integer year ) { } public MarketingYear getMarketingYear ( Integer year ) { } public void setMarketingYear ( MarketingYear toSet ) { } No newline ; at end ; of file ; }

Fix:
marketingYears . put ( year . getYear ( ) , year ) ;
Buggy code:
public class Activator implements BundleActivator { private JmxWhiteboardSupport jmxWhiteBoard ; private ServiceTracker mbeanServerTracker ; private ServiceTracker mbeanTracker ; public void start ( BundleContext context ) throws Exception { jmxWhiteBoard = new JmxWhiteboardSupport ( ) ; mbeanServerTracker = new Activator . MBeanServerTracker ( context ) ; mbeanServerTracker . open ( ) ; mbeanTracker = new Activator . MBeanTracker ( context ) ; <START_BUG> mbeanTracker . open ( ) ; <END_BUG> } public void stop ( BundleContext context ) throws Exception { } private class MBeanServerTracker extends ServiceTracker { public MBeanServerTracker ( BundleContext context ) { } @ Override public Object addingService ( ServiceReference reference ) { } @ Override public void removedService ( ServiceReference reference , Object service ) { } } private class MBeanTracker extends ServiceTracker { private static final String SIMPLE_MBEAN_FILTER = ( "(" + ( Constants . OBJECTCLASS ) ) + "=*MBean)" ; public MBeanTracker ( BundleContext context ) throws InvalidSyntaxException { } @ Override public Object addingService ( ServiceReference reference ) { } @ Override public void removedService ( ServiceReference reference , Object service ) { } } }

Fix:
mbeanTracker . open ( true ) ;
Buggy code:
public class MatrixVariableMethodArgumentResolver extends AbstractNamedValueMethodArgumentResolver { public MatrixVariableMethodArgumentResolver ( ) { } public boolean supportsParameter ( MethodParameter parameter ) { } @ Override protected NamedValueInfo createNamedValueInfo ( MethodParameter parameter ) { } @ Override protected Object resolveName ( String name , MethodParameter parameter , NativeWebRequest request ) throws Exception { } @ Override protected void handleMissingValue ( String name , MethodParameter param ) throws ServletRequestBindingException { String paramType = param . getParameterType ( ) . getName ( ) ; <START_BUG> throw new ServletRequestBindingException ( ( ( ( ( "Missing<seq2seq4repair_space>URI<seq2seq4repair_space>path<seq2seq4repair_space>parameter<seq2seq4repair_space>'" + name ) + "'<seq2seq4repair_space>for<seq2seq4repair_space>method<seq2seq4repair_space>parameter<seq2seq4repair_space>type<seq2seq4repair_space>[" ) + paramType ) + "]" ) ) ; <END_BUG> } private static class PathParamNamedValueInfo extends NamedValueInfo { private PathParamNamedValueInfo ( MatrixVariable annotation ) { } } }

Fix:
throw new ServletRequestBindingException ( ( ( ( ( "Missing<seq2seq4repair_space>matrix<seq2seq4repair_space>variable<seq2seq4repair_space>'" + name ) + "'<seq2seq4repair_space>for<seq2seq4repair_space>method<seq2seq4repair_space>parameter<seq2seq4repair_space>type<seq2seq4repair_space>[" ) + paramType ) + "]" ) ) ;
Buggy code:
public class GlanceFace extends CanvasWatchFaceService { private static final String TAG = "myTag" ; private static final Typeface NORMAL_TYPEFACE = Typeface . create ( SANS_SERIF , NORMAL ) ; private static int textraCount ; private static int messengerCount ; private static int snapchatCount ; private static int emailCount ; private static final long INTERACTIVE_UPDATE_RATE_MS = TimeUnit . SECONDS . toMillis ( 1 ) ; private static final int MSG_UPDATE_TIME = 0 ; @ Override public GlanceFace . Engine onCreateEngine ( ) { } private class Engine extends CanvasWatchFaceService . Engine { final Handler mUpdateTimeHandler = new GlanceFace . EngineHandler ( this ) ; final BroadcastReceiver mTimeZoneReceiver = new BroadcastReceiver ( ) { @ Override public void onReceive ( Context context , Intent intent ) { } } ; boolean mRegisteredTimeZoneReceiver = false ; Paint mBackgroundPaint ; Paint mTextPaint ; boolean mAmbient ; Time mTime ; float mXOffset ; float mYOffset ; boolean mLowBitAmbient ; @ Override public void onCreate ( SurfaceHolder holder ) { } @ Override public void onDestroy ( ) { } private Paint createTextPaint ( int textColor ) { } @ Override public void onVisibilityChanged ( boolean visible ) { } private void registerReceiver ( ) { } private void unregisterReceiver ( ) { } @ Override public void onApplyWindowInsets ( WindowInsets insets ) { } @ Override public void onPropertiesChanged ( Bundle properties ) { } @ Override public void onTimeTick ( ) { } @ Override public void onAmbientModeChanged ( boolean inAmbientMode ) { } @ Override public void onDraw ( Canvas canvas , Rect bounds ) { } private void updateTimer ( ) { } private boolean shouldTimerBeRunning ( ) { } private void handleUpdateTimeMessage ( ) { } } private static class EngineHandler extends Handler { private final WeakReference < GlanceFace . Engine > mWeakReference ; public EngineHandler ( GlanceFace . Engine reference ) { } @ Override public void handleMessage ( Message msg ) { } } public static void parseNotifPackage ( DataMap dataMap ) { <START_BUG> Log . d ( GlanceFace . TAG , "Notification<seq2seq4repair_space>package<seq2seq4repair_space>received...parsing." ) ; <END_BUG> GlanceFace . textraCount = dataMap . getInt ( "textra" ) ; GlanceFace . messengerCount = dataMap . getInt ( "messenger" ) ; GlanceFace . snapchatCount = dataMap . getInt ( "snapchat" ) ; GlanceFace . emailCount = dataMap . getInt ( "email" ) ; } }

Fix:
Log . d ( GlanceFace . TAG , ( "Notification<seq2seq4repair_space>package<seq2seq4repair_space>received...<seq2seq4repair_space>" + dataMap ) ) ;
Buggy code:
public class DisjunctionSumScorer extends Scorer { private final int nrScorers ; protected final List subScorers ; private final int minimumNrMatchers ; private DisjunctionSumScorer . ScorerQueue scorerQueue = null ; private int currentDoc = - 1 ; protected int nrMatchers = - 1 ; private float currentScore = Float . NaN ; public DisjunctionSumScorer ( List subScorers , int minimumNrMatchers ) { } public DisjunctionSumScorer ( List subScorers ) { } private void initScorerQueue ( ) throws IOException { } private class ScorerQueue extends PriorityQueue { ScorerQueue ( int size ) { } protected boolean lessThan ( Object o1 , Object o2 ) { } } public boolean next ( ) throws IOException { } protected boolean advanceAfterCurrent ( ) throws IOException { } public float score ( ) throws IOException { } public int doc ( ) { } public int nrMatchers ( ) { } public boolean skipTo ( int target ) throws IOException { if ( ( scorerQueue ) == null ) { initScorerQueue ( ) ; } if ( ( scorerQueue . size ( ) ) < ( minimumNrMatchers ) ) { return false ; } if ( target <= ( currentDoc ) ) { <START_BUG> target = ( currentDoc ) + 1 ; <END_BUG> } do { Scorer top = ( ( Scorer ) ( scorerQueue . top ( ) ) ) ; if ( ( top . doc ( ) ) >= target ) { return advanceAfterCurrent ( ) ; } else if ( top . skipTo ( target ) ) { scorerQueue . adjustTop ( ) ; } else { scorerQueue . pop ( ) ; if ( ( scorerQueue . size ( ) ) < ( minimumNrMatchers ) ) { return false ; } } } while ( true ) ; } public Explanation explain ( int doc ) throws IOException { } }

Fix:
return true ;
Buggy code:
public class ListPathTask extends AbstractTask { private final Path m_path = new Path ( ) ; public void add ( final FileList list ) { } public void execute ( ) throws TaskException { final String [ ] files = m_path . listFiles ( getContext ( ) ) ; for ( int i = 0 ; i < ( files . length ) ; i ++ ) { final String file = files [ i ] ; <START_BUG> getContext ( ) . warn ( file ) ; <END_BUG> } } }

Fix:
getContext ( ) . info ( file ) ;
Buggy code:
public interface PCResultObjectProvider extends ResultObjectProvider { <START_BUG> public void initialize ( OpenJPAStateManager sm , PCState state , FetchState fetchState ) throws Exception ; <END_BUG> }

Fix:
public void initialize ( OpenJPAStateManager sm , PCState state , FetchConfiguration fetch ) throws Exception ;
Buggy code:
public final class ExpandProperties extends BaseFilterReader implements ChainableReader { private String queuedData = null ; public ExpandProperties ( ) { } public ExpandProperties ( final Reader in ) { } public int read ( ) throws IOException { int ch = - 1 ; if ( ( ( queuedData ) != null ) && ( ( queuedData . length ( ) ) == 0 ) ) { queuedData = null ; } if ( ( queuedData ) != null ) { ch = queuedData . charAt ( 0 ) ; queuedData = queuedData . substring ( 1 ) ; if ( ( queuedData . length ( ) ) == 0 ) { queuedData = null ; } } else { queuedData = readFully ( ) ; <START_BUG> if ( ( queuedData . length ( ) ) == 0 ) { <END_BUG> ch = - 1 ; } else { Project project = getProject ( ) ; queuedData = project . replaceProperties ( queuedData ) ; return read ( ) ; } } return ch ; } public Reader chain ( final Reader rdr ) { } }

Fix:
if ( ( ( queuedData ) == null ) || ( ( queuedData . length ( ) ) == 0 ) ) {
Buggy code:
public class EndpointDescriptionAdvertiser implements IEndpointDescriptionAdvertiser { private EndpointDescriptionLocator endpointDescriptionLocator ; public EndpointDescriptionAdvertiser ( EndpointDescriptionLocator endpointDescriptionLocator ) { } public IStatus advertise ( EndpointDescription endpointDescription ) { } protected IStatus doDiscovery ( IDiscoveryAdvertiser discoveryAdvertiser , IServiceInfo serviceInfo , boolean advertise ) { } protected IServiceInfoFactory getServiceInfoFactory ( ) { } protected IDiscoveryAdvertiser [ ] getDiscoveryAdvertisers ( ) { } protected IStatus createErrorStatus ( String message ) { } protected IStatus createErrorStatus ( String message , Throwable e ) { } protected IStatus doDiscovery ( EndpointDescription endpointDescription , boolean advertise ) { } public IStatus unadvertise ( EndpointDescription endpointDescription ) { } private IStatus createResultStatus ( List < IStatus > statuses , String errorMessage ) { List < IStatus > errorStatuses = new ArrayList < IStatus > ( ) ; for ( IStatus status : statuses ) if ( ! ( status . isOK ( ) ) ) errorStatuses . add ( status ) ; if ( ( errorStatuses . size ( ) ) > 0 ) <START_BUG> return new MultiStatus ( Activator . PLUGIN_ID , IStatus . ERROR , ( ( IStatus [ ] ) ( statuses . toArray ( ) ) ) , errorMessage , null ) ; <END_BUG> else return Status . OK_STATUS ; } public void close ( ) { } }

Fix:
return new MultiStatus ( Activator . PLUGIN_ID , IStatus . ERROR , ( ( IStatus [ ] ) ( statuses . toArray ( new IStatus [ statuses . size ( ) ] ) ) ) , errorMessage , null ) ;
Buggy code:
public class ColumnSerializer implements ICompactSerializer2 < IColumn > { private static final Logger logger = LoggerFactory . getLogger ( ColumnSerializer . class ) ; public static final int DELETION_MASK = 1 ; public static final int EXPIRATION_MASK = 2 ; public static final int COUNTER_MASK = 4 ; public void serialize ( IColumn column , DataOutput dos ) { } public Column deserialize ( DataInput dis ) throws IOException { ByteBuffer name = FBUtilities . readShortByteArray ( dis ) ; if ( ( name . remaining ( ) ) <= 0 ) throw new ColumnSerializer . CorruptColumnException ( ( "invalid<seq2seq4repair_space>column<seq2seq4repair_space>name<seq2seq4repair_space>length<seq2seq4repair_space>" + ( name . remaining ( ) ) ) ) ; int b = dis . readUnsignedByte ( ) ; if ( ( b & ( ColumnSerializer . COUNTER_MASK ) ) != 0 ) { long timestampOfLastDelete = dis . readLong ( ) ; ByteBuffer pc = FBUtilities . readShortByteArray ( dis ) ; <START_BUG> byte [ ] partitionedCounter = Arrays . copyOfRange ( pc . array ( ) , ( ( pc . position ( ) ) + ( pc . arrayOffset ( ) ) ) , pc . limit ( ) ) ; <END_BUG> long timestamp = dis . readLong ( ) ; ByteBuffer value = FBUtilities . readByteArray ( dis ) ; return new CounterColumn ( name , value , timestamp , partitionedCounter , timestampOfLastDelete ) ; } else if ( ( b & ( ColumnSerializer . EXPIRATION_MASK ) ) != 0 ) { int ttl = dis . readInt ( ) ; int expiration = dis . readInt ( ) ; long ts = dis . readLong ( ) ; ByteBuffer value = FBUtilities . readByteArray ( dis ) ; if ( ( ( int ) ( ( System . currentTimeMillis ( ) ) // 1000 ) ) > expiration ) { ByteBuffer bytes = ByteBuffer . allocate ( 4 ) ; bytes . putInt ( expiration ) ; bytes . rewind ( ) ; return new DeletedColumn ( name , bytes , ts ) ; } else { return new ExpiringColumn ( name , value , ts , ttl , expiration ) ; } } else { long ts = dis . readLong ( ) ; ByteBuffer value = FBUtilities . readByteArray ( dis ) ; return ( b & ( ColumnSerializer . DELETION_MASK ) ) == 0 ? new Column ( name , value , ts ) : new DeletedColumn ( name , value , ts ) ; } } private static class CorruptColumnException extends IOException { public CorruptColumnException ( String s ) { } } }

Fix:
byte [ ] partitionedCounter = ByteBufferUtil . getArray ( pc ) ;
Buggy code:
@ Controller public class MultiController extends MultiActionController { private static final Logger logger = LoggerFactory . getLogger ( MultiController . class ) ; @ RequestMapping ( value = "Index.htm" , method = RequestMethod . GET ) public String home ( Locale locale , Model model ) { } <START_BUG> @ RequestMapping ( "afficherClients.htm" ) <END_BUG> public ModelAndView afficherLesClients ( HttpServletRequest request , HttpServletResponse response ) throws Exception { String destinationPage ; HibernateClient unGestClient = new HibernateClient ( ) ; try { List < Apprenant > mesApprenants = unGestClient . getTouteslesLignes ( ) ; request . setAttribute ( "mesapprenants" , mesApprenants ) ; } catch ( Exception e ) { request . setAttribute ( "MesErreurs" , e . getMessage ( ) ) ; } destinationPage = "//ListeApprenants" ; return new ModelAndView ( destinationPage ) ; } @ RequestMapping ( "SelectApprenantScore.htm" ) public ModelAndView selectApprenantScore ( HttpServletRequest request , HttpServletResponse response ) throws Exception { } @ RequestMapping ( "ListeScores.htm" ) public ModelAndView afficherLesScores ( HttpServletRequest request , HttpServletResponse response ) throws Exception { } @ RequestMapping ( "SelectApprenantBilan.htm" ) public ModelAndView selectApprenantBilan ( HttpServletRequest request , HttpServletResponse response ) throws Exception { } @ RequestMapping ( "Bilan.htm" ) public ModelAndView afficherLeBilan ( HttpServletRequest request , HttpServletResponse response ) throws Exception { } No newline ; at end ; of file ; }

Fix:
@ RequestMapping ( "ListeApprenants.htm" )
Buggy code:
public class Caret extends Widget { Canvas parent ; int x ; int y ; int width ; int height ; boolean moved ; boolean resized ; boolean isVisible ; Image image ; Font font ; LOGFONT oldFont ; public Caret ( Canvas parent , int style ) { } void createWidget ( ) { } int defaultFont ( ) { } public Rectangle getBounds ( ) { } public Font getFont ( ) { } public Image getImage ( ) { } public Point getLocation ( ) { } public Canvas getParent ( ) { } public Point getSize ( ) { } public boolean getVisible ( ) { } boolean hasFocus ( ) { } boolean isFocusCaret ( ) { } public boolean isVisible ( ) { } void killFocus ( ) { } void move ( ) { } void resizeIME ( ) { if ( ! ( OS . IsDBLocale ) ) return ; POINT ptCurrentPos = new POINT ( ) ; if ( ! ( OS . GetCaretPos ( ptCurrentPos ) ) ) return ; int hwnd = parent . handle ; int hIMC = OS . ImmGetContext ( hwnd ) ; <START_BUG> if ( parent . hooks ( ImeComposition ) ) { <END_BUG> CANDIDATEFORM lpCandidate = new CANDIDATEFORM ( ) ; lpCandidate . dwStyle = OS . CFS_CANDIDATEPOS ; lpCandidate . ptCurrentPos = ptCurrentPos ; OS . ImmSetCandidateWindow ( hIMC , lpCandidate ) ; } else { RECT rect = new RECT ( ) ; OS . GetClientRect ( hwnd , rect ) ; COMPOSITIONFORM lpCompForm = new COMPOSITIONFORM ( ) ; lpCompForm . dwStyle = OS . CFS_RECT ; lpCompForm . x = ptCurrentPos . x ; lpCompForm . y = ptCurrentPos . y ; lpCompForm . left = rect . left ; lpCompForm . right = rect . right ; lpCompForm . top = rect . top ; lpCompForm . bottom = rect . bottom ; OS . ImmSetCompositionWindow ( hIMC , lpCompForm ) ; } OS . ImmReleaseContext ( hwnd , hIMC ) ; } void releaseParent ( ) { } void releaseWidget ( ) { } void resize ( ) { } void restoreIMEFont ( ) { } public void setBounds ( int x , int y , int width , int height ) { } public void setBounds ( Rectangle rect ) { } void setFocus ( ) { } public void setFont ( Font font ) { } public void setImage ( Image image ) { } void setIMEFont ( ) { } public void setLocation ( int x , int y ) { } public void setLocation ( Point location ) { } public void setSize ( int width , int height ) { } public void setSize ( Point size ) { } public void setVisible ( boolean visible ) { } }

Fix:
if ( parent . isInlineIMEEnabled ( ) ) {
Buggy code:
public final class IntRange extends Range implements Serializable { private static final long serialVersionUID = 71849363892730L ; private final int min ; private final int max ; private transient Integer minObject = null ; private transient Integer maxObject = null ; private transient int hashCode = 0 ; private transient String toString = null ; public IntRange ( int number ) { } public IntRange ( Number number ) { } public IntRange ( int number1 , int number2 ) { } public IntRange ( Number number1 , Number number2 ) { } @ Override public Number getMinimumNumber ( ) { } @ Override public long getMinimumLong ( ) { } @ Override public int getMinimumInteger ( ) { } @ Override public double getMinimumDouble ( ) { } @ Override public float getMinimumFloat ( ) { } @ Override public Number getMaximumNumber ( ) { } @ Override public long getMaximumLong ( ) { } @ Override public int getMaximumInteger ( ) { } @ Override public double getMaximumDouble ( ) { } @ Override public float getMaximumFloat ( ) { } @ Override public boolean containsNumber ( Number number ) { } @ Override public boolean containsInteger ( int value ) { } @ Override public boolean containsRange ( Range range ) { } @ Override public boolean overlapsRange ( Range range ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { if ( ( toString ) == null ) { <START_BUG> StringBuffer buf = new StringBuffer ( 32 ) ; <END_BUG> buf . append ( "Range[" ) ; buf . append ( min ) ; buf . append ( ',' ) ; buf . append ( max ) ; buf . append ( ']' ) ; toString = buf . toString ( ) ; } return toString ; } public int [ ] toArray ( ) { } }

Fix:
StringBuilder buf = new StringBuilder ( 32 ) ;
Buggy code:
@ Controller @ RequestMapping ( "//" ) public class HomeController { private final Logger logger = LoggerFactory . getLogger ( getClass ( ) ) ; private final KhanOAuthService oauthService ; private final KhanAcademyApi api ; @ Inject public HomeController ( final KhanOAuthService oauthService , final KhanAcademyApi api ) { } @ RequestMapping ( method = RequestMethod . GET ) public String display ( final HttpSession session , final HttpServletRequest request , final Model model ) { final Token accessToken = ( ( Token ) ( session . getAttribute ( "accessToken" ) ) ) ; model . addAttribute ( "loggedIn" , ( accessToken != null ) ) ; if ( accessToken == null ) { <START_BUG> final String callbackUrl = String . format ( "http:////%s%s" , request . getServerName ( ) , CALLBACK ) ; <END_BUG> logger . debug ( ( "Callback<seq2seq4repair_space>url<seq2seq4repair_space>for<seq2seq4repair_space>OAuth<seq2seq4repair_space>is:<seq2seq4repair_space>" + callbackUrl ) ) ; final String requestTokenUrl = oauthService . getRequestTokenUrl ( callbackUrl ) ; model . addAttribute ( "requestTokenUrl" , requestTokenUrl ) ; return "login" ; } final ApiHelper apiHelper = new ApiHelper ( accessToken , oauthService , api ) ; model . addAttribute ( "exercises" , new org . knetwork . webapp . model . ExerciseContainer ( apiHelper . getExercises ( ) , apiHelper . getBadges ( ) ) ) ; model . addAttribute ( "user" , apiHelper . getUser ( ) ) ; return "home" ; } @ RequestMapping ( "logout" ) public String logout ( HttpSession session ) { } }

Fix:
final String callbackUrl = String . format ( "http:////%s//%s" , request . getServerName ( ) , CALLBACK ) ;