buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public LabelWithoutEscapeMarkupPage()
{
Label label = new Label(this,"label", "test:'\"");
label.setEscapeModelStrings(false);
add(label);
}
| public LabelWithoutEscapeMarkupPage()
{
Label label = new Label("label", "test:'\"");
label.setEscapeModelStrings(false);
add(label);
}
|
public SimplePage_10()
{
add(new SimplePanel(this,"myPanel").setVisible(false));
}
| public SimplePage_10()
{
add(new SimplePanel("myPanel").setVisible(false));
}
|
public SimplePage_6()
{
Panel panel = new SimplePanel_6(this,"myPanel");
add(panel);
}
| public SimplePage_6()
{
Panel panel = new SimplePanel_6("myPanel");
add(panel);
}
|
public SimplePage_7()
{
add(new Label(this,"message", "here it goes"));
}
| public SimplePage_7()
{
add(new Label("message", "here it goes"));
}
|
public SimplePage_8()
{
// One Label, but two <span> tag in the html with the same id => Not allowed.
add(new Label(this,"myLabel", "test-1"));
}
| public SimplePage_8()
{
// One Label, but two <span> tag in the html with the same id => Not allowed.
add(new Label("myLabel", "test-1"));
}
|
public BoxBorderTestPage_5()
{
add(new MyApplicationBorder(this,"border"));
}
| public BoxBorderTestPage_5()
{
add(new MyApplicationBorder("border"));
}
|
public ConcretePage()
{
add(new MyPanel(this,"panel"));
}
| public ConcretePage()
{
add(new MyPanel("panel"));
}
|
public ConcretePage2()
{
add(new MyPanel2(this,"panel"));
}
| public ConcretePage2()
{
add(new MyPanel2("panel"));
}
|
public TestPage()
{
add(new TestExtendedPanel(this));
}
| public TestPage()
{
add(new TestExtendedPanel());
}
|
public AbstractMeldingPage()
{
add(new Label(this,"foo", "FooBar"));
}
| public AbstractMeldingPage()
{
add(new Label("foo", "FooBar"));
}
|
public AbstractSecurePage()
{
add(new Label(this,"username", "Pietje Puk"));
}
| public AbstractSecurePage()
{
add(new Label("username", "Pietje Puk"));
}
|
public AutolinkPage_1()
{
add(new Label(this,"myLabel", "Home"));
getSession().setStyle("myStyle");
getSession().setLocale(Locale.GERMANY);
}
| public AutolinkPage_1()
{
add(new Label("myLabel", "Home"));
getSession().setStyle("myStyle");
getSession().setLocale(Locale.GERMANY);
}
|
public AutolinkPage_2()
{
add(new Label(this,"myLabel", "Home"));
getSession().setStyle("myStyle");
getSession().setLocale(Locale.GERMANY);
}
| public AutolinkPage_2()
{
add(new Label("myLabel", "Home"));
getSession().setStyle("myStyle");
getSession().setLocale(Locale.GERMANY);
}
|
public InlinePanelPage_4()
{
add(new InlinePanel_4(this,"myPanel"));
}
| public InlinePanelPage_4()
{
add(new InlinePanel_4("myPanel"));
}
|
public PanelPage_1()
{
Panel panel = new SimplePanel_1(this,"myPanel");
add(panel);
}
| public PanelPage_1()
{
Panel panel = new SimplePanel_1("myPanel");
add(panel);
}
|
public PanelPage_2()
{
Panel panel = new SimplePanel_2(this,"myPanel");
add(panel);
}
| public PanelPage_2()
{
Panel panel = new SimplePanel_2("myPanel");
add(panel);
}
|
public PanelWithAttributeModifierPage()
{
Panel panel = new PanelWithAttributeModifier(this,"myPanel");
add(panel);
}
| public PanelWithAttributeModifierPage()
{
Panel panel = new PanelWithAttributeModifier("myPanel");
add(panel);
}
|
public AbstractTreePage()
{
// create a list with sublists
List l1 = new ArrayList();
l1.add("test 1.1");
l1.add("test 1.2");
List l2 = new ArrayList();
l2.add("test 2.1");
l2.add("test 2.2");
l2.add("test 2.3");
List l3 = new ArrayList();
l3.add("test 3.1");
l2.add(l3);
l2.add("test 2.4");
... | public AbstractTreePage()
{
// create a list with sublists
List l1 = new ArrayList();
l1.add("test 1.1");
l1.add("test 1.2");
List l2 = new ArrayList();
l2.add("test 2.1");
l2.add("test 2.2");
l2.add("test 2.3");
List l3 = new ArrayList();
l3.add("test 3.1");
l2.add(l3);
l2.add("test 2.4");
... |
public BorderedPage()
{
border = new PageBorder(this,"border");
border.setTransparentResolver(true);
super.add(border);
}
| public BorderedPage()
{
border = new PageBorder("border");
border.setTransparentResolver(true);
super.add(border);
}
|
public TreePageWithBorder()
{
// create a list with sublists
List l1 = new ArrayList();
l1.add("test 1.1");
l1.add("test 1.2");
List l2 = new ArrayList();
l2.add("test 2.1");
l2.add("test 2.2");
l2.add("test 2.3");
List l3 = new ArrayList();
l3.add("test 3.1");
l2.add(l3);
l2.add("test 2.4");
... | public TreePageWithBorder()
{
// create a list with sublists
List l1 = new ArrayList();
l1.add("test 1.1");
l1.add("test 1.2");
List l2 = new ArrayList();
l2.add("test 2.1");
l2.add("test 2.2");
l2.add("test 2.3");
List l3 = new ArrayList();
l3.add("test 3.1");
l2.add(l3);
l2.add("test 2.4");
... |
public AbstractTest14WebPage()
{
// Create border and add it to the page
border = new HeaderSectionBorder_2(this,"border");
border.setTransparentResolver(true);
super.add(border);
}
| public AbstractTest14WebPage()
{
// Create border and add it to the page
border = new HeaderSectionBorder_2("border");
border.setTransparentResolver(true);
super.add(border);
}
|
public HeaderSectionBasePage_12()
{
// Create border and add it to the page
border = new HeaderSectionBorder(this,"border");
border.setTransparentResolver(true);
super.add(border);
}
| public HeaderSectionBasePage_12()
{
// Create border and add it to the page
border = new HeaderSectionBorder("border");
border.setTransparentResolver(true);
super.add(border);
}
|
public HeaderSectionPage_10()
{
add(new HeaderSectionPanel_3(this,"panel"));
}
| public HeaderSectionPage_10()
{
add(new HeaderSectionPanel_3("panel"));
}
|
public HeaderSectionPage_11()
{
add(new HeaderSectionMyLabel2(this,"label", "mein Label"));
}
| public HeaderSectionPage_11()
{
add(new HeaderSectionMyLabel2("label", "mein Label"));
}
|
public HeaderSectionPage_13()
{
add(new HeaderSectionPanel_4(this,"panel"));
}
| public HeaderSectionPage_13()
{
add(new HeaderSectionPanel_4("panel"));
}
|
public HeaderSectionPage_15()
{
add(new HeaderSectionPanel_5(this,"myPanel"));
}
| public HeaderSectionPage_15()
{
add(new HeaderSectionPanel_5("myPanel"));
}
|
public HeaderSectionPage_16()
{
add(new Label(this,"label", "my label text"));
}
| public HeaderSectionPage_16()
{
add(new Label("label", "my label text"));
}
|
public HeaderSectionPage_17()
{
// for the test: the panel must the same id as the panels header contribution
add(new HeaderSectionPanel_17(this,"foo"));
}
| public HeaderSectionPage_17()
{
// for the test: the panel must the same id as the panels header contribution
add(new HeaderSectionPanel_17("foo"));
}
|
public HeaderSectionPage_19()
{
// for the test: the panel must the same id as the panels header contribution
add(new HeaderSectionPanel_19(this,"foo"));
}
| public HeaderSectionPage_19()
{
// for the test: the panel must the same id as the panels header contribution
add(new HeaderSectionPanel_19("foo"));
}
|
public HeaderSectionPage_4()
{
add(new HeaderSectionPanel(this,"panel"));
}
| public HeaderSectionPage_4()
{
add(new HeaderSectionPanel("panel"));
}
|
public HeaderSectionPage_5()
{
add(new HeaderSectionBorder(this,"border"));
}
| public HeaderSectionPage_5()
{
add(new HeaderSectionBorder("border"));
}
|
public HeaderSectionPage_7()
{
add(new HeaderSectionMyLabel(this,"label", "mein Label"));
}
| public HeaderSectionPage_7()
{
add(new HeaderSectionMyLabel("label", "mein Label"));
}
|
public HeaderSectionPage_9()
{
add(new HeaderSectionPanel_2(this,"panel"));
}
| public HeaderSectionPage_9()
{
add(new HeaderSectionPanel_2("panel"));
}
|
public HeaderSectionPage_9a()
{
add(new HeaderSectionPanel_2(this,"panel"));
((MarkupContainer)get("panel")).get("cssHref").setVisible(false);
}
| public HeaderSectionPage_9a()
{
add(new HeaderSectionPanel_2("panel"));
((MarkupContainer)get("panel")).get("cssHref").setVisible(false);
}
|
public WicketPanelPage()
{
add(new WicketPanel(this,"myPanel"));
}
| public WicketPanelPage()
{
add(new WicketPanel("myPanel"));
}
|
private void writeStartFileMultipart(OutputStream out, String filename,
String nameField, String mimetype)
throws IOException {
write(out, "Content-Disposition: form-data; name=\""); // $NON-NLS-1$
write(out, nameField);
write(out, "\"; filename=\"");// $NON-NLS-1$
... | private void writeStartFileMultipart(OutputStream out, String filename,
String nameField, String mimetype)
throws IOException {
write(out, "Content-Disposition: form-data; name=\""); // $NON-NLS-1$
write(out, nameField);
write(out, "\"; filename=\"");// $NON-NLS-1$
... |
public void testDecode7()
{
Url url = Url.parse("some/mount/path?15-ILinkListener.4-foo-bar");
IRequestHandler handler = encoder.mapRequest(getRequest(url));
assertTrue(handler instanceof ListenerInterfaceRequestHandler);
ListenerInterfaceRequestHandler h = (ListenerInterfaceRequestHandler)handler;
IRequ... | public void testDecode7()
{
Url url = Url.parse("some/mount/path?param1=value1&15-ILinkListener.4-foo-bar");
IRequestHandler handler = encoder.mapRequest(getRequest(url));
assertTrue(handler instanceof ListenerInterfaceRequestHandler);
ListenerInterfaceRequestHandler h = (ListenerInterfaceRequestHandler)han... |
public Url mapHandler(IRequestHandler requestHandler)
{
if (requestHandler instanceof ResourceReferenceRequestHandler)
{
ResourceReferenceRequestHandler referenceRequestHandler = (ResourceReferenceRequestHandler)requestHandler;
ResourceReference reference = referenceRequestHandler.getResourceReference();
... | public Url mapHandler(IRequestHandler requestHandler)
{
if (requestHandler instanceof ResourceReferenceRequestHandler)
{
ResourceReferenceRequestHandler referenceRequestHandler = (ResourceReferenceRequestHandler)requestHandler;
ResourceReference reference = referenceRequestHandler.getResourceReference();
... |
protected ImageDescriptor getRosterImageDescriptor(IRoster roster) {
IUser user = roster.getUser();
if (user == null)
return getImageDescriptor(SharedImages.IMG_USER_UNAVAILABLE);
else
return getImageDescriptor(SharedImages.IMG_USER_AVAILABLE);
}
| protected ImageDescriptor getRosterImageDescriptor(IRoster roster) {
IUser user = roster.getUser();
if (user == null)
return getImageDescriptor(SharedImages.IMG_USER_UNAVAILABLE);
else
return getImageDescriptor(SharedImages.IMG_IDENTITY);
}
|
protected byte[] getImageData()
{
return cd.getImage();
}
};
return img.getResource();
}
};
getRequestCycle().setPage(new ImagePopup(imgResource));
}
| protected byte[] getImageData()
{
return cd.getImage();
}
};
return img.getResource();
}
};
getRequestCycle().setResponsePage(new ImagePopup(imgResource));
}
|
public void onClick()
{
final RequestCycle requestCycle = getRequestCycle();
final Long id = (Long)getModelObject();
requestCycle.setPage(new EditPage(SearchPage.this, id));
}
}
| public void onClick()
{
final RequestCycle requestCycle = getRequestCycle();
final Long id = (Long)getModelObject();
requestCycle.setResponsePage(new EditPage(SearchPage.this, id));
}
}
|
public void onClick()
{
final RequestCycle cycle = getRequestCycle();
new Export().doExport(cycle, exportView, data);
// rendering completed
cycle.setPage((Page)null);
}
| public void onClick()
{
final RequestCycle cycle = getRequestCycle();
new Export().doExport(cycle, exportView, data);
// rendering completed
cycle.setResponsePage((Page)null);
}
|
public void onClick()
{
getHangman().newGame();
guessPage.resetLetters();
getRequestCycle().setPage(guessPage);
}
});
}
| public void onClick()
{
getHangman().newGame();
guessPage.resetLetters();
getRequestCycle().setResponsePage(guessPage);
}
});
}
|
public final void onSubmit()
{
final RequestCycle cycle = getRequestCycle();
PageParameters parameters = new PageParameters();
final Book book = (Book)getRootModelObject();
parameters.put("id", new Long(book.getId()));
cycle.setPage(getPageFactory().newPage(BookDetails.class, parameters));
cycle.s... | public final void onSubmit()
{
final RequestCycle cycle = getRequestCycle();
PageParameters parameters = new PageParameters();
final Book book = (Book)getRootModelObject();
parameters.put("id", new Long(book.getId()));
cycle.setResponsePage(getPageFactory().newPage(BookDetails.class, parameters));
... |
public void onSubmit()
{
getRequestCycle().setPage(Home.this);
}
}
| public void onSubmit()
{
getRequestCycle().setResponsePage(Home.this);
}
}
|
public final void onSubmit()
{
// Get session info
SignInSession session = (SignInSession)getSession();
// Sign the user in
if (session.authenticate(properties.getString("username"),
properties.getString("password... | public final void onSubmit()
{
// Get session info
SignInSession session = (SignInSession)getSession();
// Sign the user in
if (session.authenticate(properties.getString("username"),
properties.getString("password... |
public final void onRedirect()
{
// This method is used when redirecting to a page
getRequestCycle().setPage(this);
}
| public final void onRedirect()
{
// This method is used when redirecting to a page
getRequestCycle().setResponsePage(this);
}
|
public final void onResourceRequested()
{
// Get request cycle
final RequestCycle cycle = RequestCycle.get();
// The cycle's page is set to null so that it won't be rendered back to
// the client since the resource being requested has nothing to do with
// pages
cycle.setPage((Page)null);
// Fetch res... | public final void onResourceRequested()
{
// Get request cycle
final RequestCycle cycle = RequestCycle.get();
// The cycle's page is set to null so that it won't be rendered back to
// the client since the resource being requested has nothing to do with
// pages
cycle.setResponsePage((Page)null);
// F... |
public void onClick()
{
// Set page source's page as response page
getRequestCycle().setPage(pageLink.getPage());
}
| public void onClick()
{
// Set page source's page as response page
getRequestCycle().setResponsePage(pageLink.getPage());
}
|
public void processRequestCycle() throws ServletException
{
WebRequestCycle cycle = new WebRequestCycle(this, wicketSession, wicketRequest,
wicketResponse);
cycle.request();
lastRenderedPage = cycle.getPage();
}
| public void processRequestCycle() throws ServletException
{
WebRequestCycle cycle = new WebRequestCycle(this, wicketSession, wicketRequest,
wicketResponse);
cycle.request();
lastRenderedPage = cycle.getResponsePage();
}
|
private WebRequestCycle createRequestCycle() throws IOException
{
// Prepare the mock application to test the Link
application.setupRequestAndResponse();
WebRequestCycle cycle = new WebRequestCycle(application, application.getWicketSession(),
application.getWicketRequest(), application.getWicketResponse());... | private WebRequestCycle createRequestCycle() throws IOException
{
// Prepare the mock application to test the Link
application.setupRequestAndResponse();
WebRequestCycle cycle = new WebRequestCycle(application, application.getWicketSession(),
application.getWicketRequest(), application.getWicketResponse());... |
public int getSelection () {
checkWidget();
NSScroller widget = (NSScroller)view;
float value = widget.floatValue();
return (int)((maximum - thumb - minimum) * value + minimum);
}
| public int getSelection () {
checkWidget();
NSScroller widget = (NSScroller)view;
double value = widget.doubleValue();
return (int)((maximum - thumb - minimum) * value + minimum);
}
|
private void checkRecursingComplexType() throws Exception {
if ( fCurrentTypeNameStack.empty() ) {
if (! fElementRecurseComplex.isEmpty() ) {
int count= fElementRecurseComplex.size();
for (int i = 0; i<count; i++) {
ElementInfo eobj = (ElementInf... | private void checkRecursingComplexType() throws Exception {
if ( fCurrentTypeNameStack.empty() ) {
if (! fElementRecurseComplex.isEmpty() ) {
int count= fElementRecurseComplex.size();
for (int i = 0; i<count; i++) {
ElementInfo eobj = (ElementInf... |
public String replaceProperties( String value ) {
if (value == null) {
return null;
}
Vector fragments = new Vector();
Vector propertyRefs = new Vector();
// XXX Move the static method here - if this is accepted in the main
// branch.
ProjectHelp... | public String replaceProperties( String value ) {
if (value == null) {
return null;
}
Vector fragments = new Vector();
Vector propertyRefs = new Vector();
// XXX Move the static method here - if this is accepted in the main
// branch.
ProjectHelp... |
private static final String DEFAULT_DELIMITER = ","; // $NON_NLS-1$
/**
* Read in the properties having to do with saving from a properties file.
*/
static {
Properties props = JMeterUtils.getJMeterProperties();
_subresults = TRUE.equalsIgnoreCase(props.getProperty(SUBRESULTS_PROP, TRUE));
... | private static final String DEFAULT_DELIMITER = ","; // $NON_NLS-1$
/**
* Read in the properties having to do with saving from a properties file.
*/
static {
Properties props = JMeterUtils.getJMeterProperties();
_subresults = TRUE.equalsIgnoreCase(props.getProperty(SUBRESULTS_PROP, TRUE));
... |
public void render()
{
// Get request cycle to render to
final RequestCycle cycle = getRequestCycle();
// Save original Response
final Response originalResponse = cycle.getResponse();
// If component is not visible, set response to NullResponse
if (!visible)
{
cycle.setResponse(NullResponse.getInst... | public void render()
{
// Get request cycle to render to
final RequestCycle cycle = getRequestCycle();
// Save original Response
final Response originalResponse = cycle.getResponse();
// If component is not visible, set response to NullResponse
if (!isVisible())
{
cycle.setResponse(NullResponse.get... |
public PropertiesFactory(final Application application)
{
this.application = application;
propertiesLoader = new ArrayList<IPropertiesLoader>();
propertiesLoader.add(new IsoPropertiesFilePropertiesLoader("properties"));
propertiesLoader.add(new UtfPropertiesFilePropertiesLoader("utf8.properties", "utf-8"));
... | public PropertiesFactory(final Application application)
{
this.application = application;
propertiesLoader = new ArrayList<IPropertiesLoader>();
propertiesLoader.add(new IsoPropertiesFilePropertiesLoader("properties"));
propertiesLoader.add(new UtfPropertiesFilePropertiesLoader("utf8.properties", "utf-8"));
... |
private static ArrayList removeDuplicates(final ArrayList list) {
final ArrayList results = new ArrayList();
final ArrayList sections = new ArrayList();
while (list.size() > 0) {
final Specification specification = (Specification) list.remove(0);
final Iterator iterat... | private static ArrayList removeDuplicates(final ArrayList list) {
final ArrayList results = new ArrayList();
final ArrayList sections = new ArrayList();
while (list.size() > 0) {
final Specification specification = (Specification) list.remove(0);
final Iterator iterat... |
/*public*/ void sort () {
checkWidget ();
if ((style & SWT.VIRTUAL) != 0) return;
sort (OS.TVI_ROOT, false);
}
void sort (int /*long*/ hParent, boolean all) {
int itemCount = (int)/*64*/OS.SendMessage (handle, OS.TVM_GETCOUNT, 0, 0);
if (itemCount == 0 || itemCount == 1) return;
hFirstIndexOf = hLastIndexOf = 0;... | /*public*/ void sort () {
checkWidget ();
if ((style & SWT.VIRTUAL) != 0) return;
sort (OS.TVI_ROOT, false);
}
void sort (int /*long*/ hParent, boolean all) {
int itemCount = (int)/*64*/OS.SendMessage (handle, OS.TVM_GETCOUNT, 0, 0);
if (itemCount == 0 || itemCount == 1) return;
hFirstIndexOf = hLastIndexOf = 0;... |
private FormalTypeParameter parseFormalTypeParameter() {
FormalTypeParameter ftp = new FormalTypeParameter();
// Identifier
ftp.identifier = eatIdentifier();
// ClassBound
eat(":");
ftp.classBound = parseFieldTypeSignature(true);
if (ftp.classBound == null) {
ftp.classBound = new Cla... | private FormalTypeParameter parseFormalTypeParameter() {
FormalTypeParameter ftp = new FormalTypeParameter();
// Identifier
ftp.identifier = eatIdentifier();
// ClassBound
eat(":");
ftp.classBound = parseFieldTypeSignature(true);
if (ftp.classBound == null) {
ftp.classBound = new Cla... |
public interface ZipEncoding {
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Vers... | public interface ZipEncoding {
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Vers... |
private JLabeledTextArea introduction =
new JLabeledTextArea(JMeterUtils.getResString("report_page_intro"), null);
| private JLabeledTextArea introduction =
new JLabeledTextArea(JMeterUtils.getResString("report_page_intro"));
|
protected Copy getCopyTask() {
Copy cd = (Copy)project.createTask("copy");
if (null == cd) {
log("project.createTask(\"copy\") failed - direct", project.MSG_VERBOSE);
cd = new Copy();
cd.setProject(getProject());
}
return cd;
}
| protected Copy getCopyTask() {
Copy cd = (Copy)project.createTask("copy");
if (null == cd) {
log("project.createTask(\"copy\") failed - direct", Project.MSG_VERBOSE);
cd = new Copy();
cd.setProject(getProject());
}
return cd;
}
|
public RuntimeConfigurable getRuntimeConfigurableWrapper() {
if (wrapper == null) {
wrapper = new RuntimeConfigurable(this);
}
return wrapper;
}
| public RuntimeConfigurable getRuntimeConfigurableWrapper() {
if (wrapper == null) {
wrapper = new RuntimeConfigurable(this, getTaskName());
}
return wrapper;
}
|
protected void buttonPressed(int buttonId) {
if (buttonId == IDialogConstants.OK_ID) {
userid = useridText.getText();
passwd = passwordText.getText();
filename = fileLocation.getText();
File f = new File(filename);
if (f.exists()) {
if (MessageDialog.openQuestion(getShell(), Messages.getString("St... | protected void buttonPressed(int buttonId) {
if (buttonId == IDialogConstants.OK_ID) {
userid = useridText.getText();
passwd = passwordText.getText();
filename = fileLocation.getText();
File f = new File(filename);
if (f.exists()) {
if (MessageDialog.openQuestion(getShell(), Messages.getString("St... |
public void testSignIn2()
{
if (1 == 1)
{
// FIXME this test is disabled until we have a better wicket tester that can deal with
// CryptedUrlWebRequestCodingStrategy
return;
}
WicketTester tester = new WicketTester(new SignIn2Application());
tester.startPage(Home.class);
tester.assertRenderedP... | public void testSignIn2()
{
if (1 == 1)
{
// FIXME this test is disabled until we have a better wicket tester that can deal with
// CryptedUrlWebRequestCodingStrategy
return;
}
WicketTester tester = new WicketTester(new SignIn2Application());
tester.startPage(Home.class);
tester.assertRenderedP... |
public Component getLazyLoadComponent(String markupId)
{
return new Label(markupId, "lazy panel test").setRenderBodyOnly(true);
}
};
ajaxLazyLoadPanel = ajaxLazyLoadPanel1;
return (Panel)ajaxLazyLoadPanel;
}
});
tester.startPage(dummyPanelPage);
tester.assertLabel("panel:conte... | public Component getLazyLoadComponent(String markupId)
{
return new Label(markupId, "lazy panel test").setRenderBodyOnly(true);
}
};
ajaxLazyLoadPanel = ajaxLazyLoadPanel1;
return (Panel)ajaxLazyLoadPanel;
}
});
tester.startPage(dummyPanelPage);
tester.assertLabel("panel:conte... |
protected byte[] getImageData()
{
return imageData;
}
} | protected byte[] getImageData(Attributes attributes)
{
return imageData;
}
} |
protected void computeFromPostBody(HTTPSamplerBase sampler,
HttpRequestHdr request) throws Exception {
// If it was a HTTP GET request, then all parameters in the URL
// has been handled by the sampler.setPath above, so we just need
// to do parse the rest of the request if it is... | protected void computeFromPostBody(HTTPSamplerBase sampler,
HttpRequestHdr request) throws Exception {
// If it was a HTTP GET request, then all parameters in the URL
// has been handled by the sampler.setPath above, so we just need
// to do parse the rest of the request if it is... |
public Object getObject(wicket.Component component)
{
return book.getTitle() + " by " + book.getAuthor();
};
}));
TextField dateField1 = new TextField("date1", new Model(new Date()), Date.class);
add(dateField1);
add(new DatePicker("datePicker1", dateField1));
TextField dateField2 = new TextFie... | public Object getObject(wicket.Component component)
{
return book.getTitle() + " by " + book.getAuthor();
};
}));
TextField dateField1 = new TextField("date1", new Model(new Date()), Date.class);
add(dateField1);
add(new DatePicker("datePicker1", dateField1));
TextField dateField2 = new TextFie... |
public void itemStateChanged(ItemEvent event)
{
if (event.getStateChange() == ItemEvent.SELECTED)
isPerThread = true;
else
isPerThread = false;
}
}
);
// add(perthread);
}
| public void itemStateChanged(ItemEvent event)
{
if (event.getStateChange() == ItemEvent.SELECTED)
isPerThread = true;
else
isPerThread = false;
}
}
);
add(perthread);
}
|
protected String resourceKey(T value)
{
return value.getClass().getSimpleName() + "." + value.name();
}
| protected String resourceKey(T value)
{
return value.getDeclaringClass().getSimpleName() + "." + value.name();
}
|
public final void onSubmit()
{
if (signIn(getUsername(), getPassword()))
{
// If login has been called because the user was not yet
// logged in, than continue to the original destination,
// otherwise to the Home page
if (!getPage().continueToOriginalDestination())
{
setResponsePage(... | public final void onSubmit()
{
if (signIn(getUsername(), getPassword()))
{
// If login has been called because the user was not yet
// logged in, than continue to the original destination,
// otherwise to the Home page
if (!getPage().continueToOriginalDestination())
{
setResponsePage(... |
public void testPagedTable() throws Exception
{
MockWebApplication application = new MockWebApplication(null);
application.getRequestCycleSettings().setRenderStrategy(Settings.REDIRECT_TO_BUFFER);
application.getRequiredPageSettings().setHomePage(SortableTableHeadersPage.class);
application.setupRequestAndRes... | public void testPagedTable() throws Exception
{
MockWebApplication application = new MockWebApplication(null);
application.getRequestCycleSettings().setRenderStrategy(Settings.REDIRECT_TO_BUFFER);
application.setHomePage(SortableTableHeadersPage.class);
application.setupRequestAndResponse();
application.pro... |
public Path createClasspath()
throws TaskException
{
return cmdl.createClasspath( getProject() ).createPath();
}
| public Path createClasspath()
throws TaskException
{
return cmdl.createClasspath().createPath();
}
|
public AbstractLRSProxyCollection(Class elementType, boolean ordered) {
_elementType = elementType;
_ct = new CollectionChangeTrackerImpl(this, false, ordered);
_ct.setAutoOff(false);
}
| public AbstractLRSProxyCollection(Class elementType, boolean ordered) {
_elementType = elementType;
_ct = new CollectionChangeTrackerImpl(this, false, ordered,false);
_ct.setAutoOff(false);
}
|
public AbstractLRSProxyMap(Class<K> keyType, Class<V> valueType) {
_keyType = keyType;
_valueType = valueType;
_ct = new MapChangeTrackerImpl(this);
_ct.setAutoOff(false);
}
| public AbstractLRSProxyMap(Class<K> keyType, Class<V> valueType) {
_keyType = keyType;
_valueType = valueType;
_ct = new MapChangeTrackerImpl(this,false);
_ct.setAutoOff(false);
}
|
public ProxyCollection newInstance(Class elementType, Comparator comp,
boolean trackChanges);
} | public ProxyCollection newInstance(Class elementType, Comparator comp,
boolean trackChanges, boolean autoOff);
} |
public ProxyMap newInstance(Class keyType, Class valueType,
Comparator compare, boolean trackChanges);
} | public ProxyMap newInstance(Class keyType, Class valueType,
Comparator compare, boolean trackChanges, boolean autoOff);
} |
public String getSamplerData() {
StringBuilder sb = new StringBuilder();
sb.append(method);
URL u = super.getURL();
if (u != null) {
sb.append(' ');
sb.append(u.toString());
sb.append("\n");
// Include request body if it is a post or pu... | public String getSamplerData() {
StringBuilder sb = new StringBuilder();
sb.append(method);
URL u = super.getURL();
if (u != null) {
sb.append(' ');
sb.append(u.toString());
sb.append("\n");
// Include request body if it is a post or pu... |
+ ": public ".length(), declaration.indexOf(" {"));
}
// parse methods and constants declarations starting at the current index
// out:
// .String body - contains the corresponding java content
// .n - set to the end of the interface body declaration ( line with the enclosing "};" )
// .nMethods - set to ... | + ": public ".length(), declaration.indexOf(" {"));
}
// parse methods and constants declarations starting at the current index
// out:
// .String body - contains the corresponding java content
// .n - set to the end of the interface body declaration ( line with the enclosing "};" )
// .nMethods - set to ... |
protected String extractVariablePart(String name) {
String var = name.substring(prefixLength,
name.length() - postfixLength);
if (getHandleDirSep()) {
var = name.replace('/', '.').replace('\\', '.');
}
return var.replace(File.separatorChar, '.');
}
| protected String extractVariablePart(String name) {
String var = name.substring(prefixLength,
name.length() - postfixLength);
if (getHandleDirSep()) {
var = var.replace('/', '.').replace('\\', '.');
}
return var.replace(File.separatorChar, '.');
}
|
public void testDefaultStringResourceLoaderSetup()
{
Settings settings = new Settings(new DummyApplication());
List loaders = settings.getStringResourceLoaders();
Assert.assertEquals("There should be 2 default loaders", 2, loaders.size());
Assert.assertTrue("First loader one should be the component one",
... | public void testDefaultStringResourceLoaderSetup()
{
Settings settings = new Settings(new DummyApplication());
List loaders = settings.getStringResourceLoaders();
Assert.assertEquals("There should be 3 default loaders", 3, loaders.size());
Assert.assertTrue("First loader one should be the component one",
... |
public void testControllingChildShouldDefaultToTheSingleComponentInsideEnclosure()
{
final String enclosurePath = "InlineEnclosure-1";
{
// enclosure On
AjaxEnclosurePage_3 ajaxPage = (AjaxEnclosurePage_3)tester.startPage(AjaxEnclosurePage_3.class);
assertVisible(ajaxPage.getLabel1(), true);
ensureEn... | public void testControllingChildShouldDefaultToTheSingleComponentInsideEnclosure()
{
final String enclosurePath = "InlineEnclosure-1";
{
// enclosure On
AjaxEnclosurePage_3 ajaxPage = tester.startPage(AjaxEnclosurePage_3.class);
assertVisible(ajaxPage.getLabel1(), true);
ensureEnclosureIsVisible(encl... |
public void doAction(ActionEvent e)
{
ActionRouter.getInstance().actionPerformed(
new ActionEvent(e.getSource(), e.getID(), CheckDirty.CHECK_DIRTY));
if (GuiPackage.getInstance().isDirty())
{
int chosenOption =
JOptionPane.showConfirmDialog(
... | public void doAction(ActionEvent e)
{
ActionRouter.getInstance().doActionNow(
new ActionEvent(e.getSource(), e.getID(), CheckDirty.CHECK_DIRTY));
if (GuiPackage.getInstance().isDirty())
{
int chosenOption =
JOptionPane.showConfirmDialog(
... |
public void doAction(ActionEvent e)
{
ActionRouter.getInstance().actionPerformed(
new ActionEvent(e.getSource(), e.getID(), CheckDirty.CHECK_DIRTY));
GuiPackage guiPackage = GuiPackage.getInstance();
if (guiPackage.isDirty())
{
if (JOptionPane
... | public void doAction(ActionEvent e)
{
ActionRouter.getInstance().doActionNow(
new ActionEvent(e.getSource(), e.getID(), CheckDirty.CHECK_DIRTY));
GuiPackage guiPackage = GuiPackage.getInstance();
if (guiPackage.isDirty())
{
if (JOptionPane
... |
public void setEnabled (boolean enabled) {
checkWidget ();
if (OS.UIElement_IsEnabled (handle) == enabled) return;
super.setEnabled (enabled);
if (enabled && OS.Window_IsActive (shellHandle)) {
if (!restoreFocus ()) traverseGroup (true);
}
}
| public void setEnabled (boolean enabled) {
checkWidget ();
if (enabled == getEnabled ()) return;
super.setEnabled (enabled);
if (enabled && OS.Window_IsActive (shellHandle)) {
if (!restoreFocus ()) traverseGroup (true);
}
}
|
public void setAttachmentHeader(String filename)
{
setHeader("Content-Disposition", "attachment"
+ ((!Strings.isEmpty(filename)) ? ("; filename=" + filename) : ""));
}
| public void setAttachmentHeader(String filename)
{
setHeader("Content-Disposition", "attachment"
+ ((!Strings.isEmpty(filename)) ? ("; filename=\"" + filename+"\"") : ""));
}
|
public String toHtmlDebugString()
{
final StringBuffer buffer = new StringBuffer();
for (int i = 0; i < markup.size(); i++)
{
if (i == currentIndex)
{
buffer.append("<font color = \"red\">");
}
final MarkupElement element = markup.get(i);
buffer.append(Strings.escapeMarkup(element.toString... | public String toHtmlDebugString()
{
final StringBuffer buffer = new StringBuffer();
for (int i = 0; i < markup.size(); i++)
{
if (i == currentIndex)
{
buffer.append("<font color = \"red\">");
}
final MarkupElement element = markup.get(i);
buffer.append(Strings.escapeMarkup(element.toString... |
protected boolean versionSupported(String version) {
return version.equals("1.1");
} // versionSupported(String): boolean
| protected boolean versionSupported(String version) {
return (version.equals("1.1") || version.equals("1.0"));
} // versionSupported(String): boolean
|
public boolean getVisible () {
checkWidget();
return (state & HIDDEN) == 0;
}
boolean hasBorder () {
return (style & SWT.BORDER) != 0;
}
boolean hasFocus () {
return (view.window().firstResponder().id == view.id);
}
int /*long*/ hitTest (int /*long*/ id, int /*long*/ sel, NSPoint point) {
if ((state & DISABLED)... | public boolean getVisible () {
checkWidget();
return (state & HIDDEN) == 0;
}
boolean hasBorder () {
return (style & SWT.BORDER) != 0;
}
boolean hasFocus () {
return (view.window().firstResponder().id == view.id);
}
int /*long*/ hitTest (int /*long*/ id, int /*long*/ sel, NSPoint point) {
if ((state & DISABLED)... |
public void setInputSource(XMLInputSource inputSource) throws IOException {
fEntityManager.setEntityHandler(this);
fEntityManager.startDocumentEntity(inputSource);
fDocumentSystemId = fEntityManager.expandSystemId(inputSource.getSystemId());
} // setInputSource(XMLInputSource)
| public void setInputSource(XMLInputSource inputSource) throws IOException {
fEntityManager.setEntityHandler(this);
fEntityManager.startDocumentEntity(inputSource);
//fDocumentSystemId = fEntityManager.expandSystemId(inputSource.getSystemId());
} // setInputSource(XMLInputSource)
|
protected void executeTest(final Class<? extends Page> pageClass, final String filename) throws Exception
{
System.out.println("=== " + pageClass.getName() + " ===");
tester.startPage(pageClass);
assertEquals(pageClass, tester.getLastRenderedPage().getClass());
// Validate the document
String document = ... | protected void executeTest(final Class<? extends Page> pageClass, final String filename) throws Exception
{
System.out.println("=== " + pageClass.getName() + " ===");
tester.startPage(pageClass);
assertEquals(pageClass, tester.getLastRenderedPage().getClass());
// Validate the document
String document = ... |
public Rectangle getBounds(int start, int end) {
checkLayout();
NSAutoreleasePool pool = null;
if (!NSThread.isMainThread()) pool = (NSAutoreleasePool) new NSAutoreleasePool().alloc().init();
try {
computeRuns();
int length = text.length();
if (length == 0) return new Rectangle(0, 0, 0, 0);
if (start > end)... | public Rectangle getBounds(int start, int end) {
checkLayout();
NSAutoreleasePool pool = null;
if (!NSThread.isMainThread()) pool = (NSAutoreleasePool) new NSAutoreleasePool().alloc().init();
try {
computeRuns();
int length = text.length();
if (length == 0) return new Rectangle(0, 0, 0, 0);
if (start > end)... |
public Rectangle computeTrim (int x, int y, int width, int height) {
checkWidget ();
NSBox widget = (NSBox)view;
int border = (int)Math.ceil (widget.borderWidth ());
NSSize margins = widget.contentViewMargins();
NSRect frame = contentView.frame();
width += (margins.width + border) * 2;
height += (margins.height ... | public Rectangle computeTrim (int x, int y, int width, int height) {
checkWidget ();
NSBox widget = (NSBox)view;
int border = (int)(0.5f + widget.borderWidth ());
NSSize margins = widget.contentViewMargins();
NSRect frame = contentView.frame();
width += (margins.width + border) * 2;
height += (margins.height + b... |
public void selectAll () {
checkWidget ();
if ((style & SWT.SINGLE) != 0) return;
NSTableView widget = (NSTableView)view;
ignoreSelect = true;
widget.selectAll(null);
ignoreSelect = false;
}
void sendDoubleSelection() {
postEvent (SWT.DefaultSelection);
}
boolean sendKeyEvent (NSEvent nsEvent, int type) {
bo... | public void selectAll () {
checkWidget ();
if ((style & SWT.SINGLE) != 0) return;
NSTableView widget = (NSTableView)view;
ignoreSelect = true;
widget.selectAll(null);
ignoreSelect = false;
}
void sendDoubleSelection() {
postEvent (SWT.DefaultSelection);
}
boolean sendKeyEvent (NSEvent nsEvent, int type) {
bo... |
public TableItem (Table parent, int style, int index) {
this (parent, style, index, true);
}
TableItem (Table parent, int style, int index, boolean create) {
super (parent, style);
this.parent = parent;
if (create) parent.createItem (this, index);
}
static Table checkNull (Table control) {
if (control == null) S... | public TableItem (Table parent, int style, int index) {
this (parent, style, index, true);
}
TableItem (Table parent, int style, int index, boolean create) {
super (parent, style);
this.parent = parent;
if (create) parent.createItem (this, index);
}
static Table checkNull (Table control) {
if (control == null) S... |
public TreeItem (TreeItem parentItem, int style, int index) {
this (checkNull (parentItem).parent, parentItem, style, checkIndex (index), true);
}
TreeItem (Tree parent, TreeItem parentItem, int style, int index, boolean create) {
super (parent, style);
this.parent = parent;
this.parentItem = parentItem;
if (crea... | public TreeItem (TreeItem parentItem, int style, int index) {
this (checkNull (parentItem).parent, parentItem, style, checkIndex (index), true);
}
TreeItem (Tree parent, TreeItem parentItem, int style, int index, boolean create) {
super (parent, style);
this.parent = parent;
this.parentItem = parentItem;
if (crea... |
public ContainerConfigurationResult getResult() {
return wizard.getResult();
}
| public ContainerConfigurationResult getResult() {
return wizard.getContainerConfigurationResult();
}
|
public Pattern createPattern(String pattern)
{
try
{
Perl5Compiler comp = new Perl5Compiler();
return comp.compile(pattern);
}
catch (Exception exception)
{
exception.printStackTrace();
return null;
}
}
| public Pattern createPattern(String pattern)
{
try
{
Perl5Compiler comp = new Perl5Compiler();
return comp.compile(pattern, Perl5Compiler.READ_ONLY_MASK);
}
catch (Exception exception)
{
exception.printStackTrace();
return n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.