buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
private void setUpRedirect(final RequestCycle cycle)
{
Session session = Session.get();
if (session.isTemporary())
{
session.bind();
}
// The intercept continuation URL should be saved exactly as the
// original request specified.
interceptContinuationURL = cycle.getRequest().getPath();
| private void setUpRedirect(final RequestCycle cycle)
{
Session session = Session.get();
if (session.isTemporary())
{
session.bind();
}
// The intercept continuation URL should be saved exactly as the
// original request specified.
interceptContinuationURL = "/" + cycle.getRequest().getURL();
|
public void testRenderHomePage_4() throws Exception
{
//executeTest(HeaderSectionPage_4.class, "HeaderSectionPageExpectedResult_4.html");
}
| public void testRenderHomePage_4() throws Exception
{
executeTest(HeaderSectionPage_4.class, "HeaderSectionPageExpectedResult_4.html");
}
|
public Url getBaseUrl()
{
return new Url(url.getSegments(), Collections.<QueryParameter> emptyList());
}
} | public Url getClientUrl()
{
return new Url(url.getSegments(), Collections.<QueryParameter> emptyList());
}
} |
private String getAbsoluteURL(String url)
{
if (url.startsWith("http://") || url.startsWith("https://"))
{
return url;
}
else if (url.startsWith("/"))
{
return getAbsolutePrefix() + url;
}
else
{
HttpServletRequest httpServletRequest = webRequest.getHttpServletRequest();
Charset charset = ... | private String getAbsoluteURL(String url)
{
if (url.startsWith("http://") || url.startsWith("https://"))
{
return url;
}
else if (url.startsWith("/"))
{
return getAbsolutePrefix() + url;
}
else
{
HttpServletRequest httpServletRequest = webRequest.getHttpServletRequest();
Charset charset = ... |
protected UrlRenderer newUrlRenderer()
{
// All URLs will be rendered relative to current request (can be overriden afterwards)
return new UrlRenderer(getRequest().getBaseUrl());
}
| protected UrlRenderer newUrlRenderer()
{
// All URLs will be rendered relative to current request (can be overriden afterwards)
return new UrlRenderer(getRequest().getClientUrl());
}
|
public void setTablength(int tlength) throws BuildException {
if (tlength < 2 || (tlength & (tlength-1)) == 0) {
throw new BuildException("tablength must be a positive power of 2",
location);
}
tablength = tlength;
}
| public void setTablength(int tlength) throws BuildException {
if (tlength < 2 || (tlength & (tlength-1)) != 0) {
throw new BuildException("tablength must be a positive power of 2",
location);
}
tablength = tlength;
}
|
public static boolean run(JDBCConfiguration conf, String[] args,
Flags flags, ClassLoader loader)
throws IOException, SQLException {
// default action based on whether the mapping defaults fills in
// missing info
if (flags.action == null) {
if (conf.getMappingDef... | public static boolean run(JDBCConfiguration conf, String[] args,
Flags flags, ClassLoader loader)
throws IOException, SQLException {
// default action based on whether the mapping defaults fills in
// missing info
if (flags.action == null) {
if (conf.getMappingDef... |
public Object getActualValue(String content, ValidationContext context)
throws InvalidDatatypeValueException {
// "prefix:localpart" or "localpart"
// get prefix and local part out of content
String prefix, localpart;
int colonptr = content.indexOf(":");
if (colonptr... | public Object getActualValue(String content, ValidationContext context)
throws InvalidDatatypeValueException {
// "prefix:localpart" or "localpart"
// get prefix and local part out of content
String prefix, localpart;
int colonptr = content.indexOf(":");
if (colonptr... |
public String getTypeName() {
if (fDeclaration !=null && fDeclaration.fType !=null) {
return fDeclaration.fType.getXSTypeName();
}
return null;
}
| public String getTypeName() {
if (fDeclaration !=null && fDeclaration.fType !=null) {
return fDeclaration.fType.getTypeName();
}
return null;
}
|
protected ID getIDFromArg(Object arg) throws IDCreateException {
if (arg == null)
throw new IDCreateException(Messages.getString("GenericContainerInstantiator.ID_Cannot_Be_Null")); //$NON-NLS-1$
String val = null;
if (arg instanceof StringID)
return (ID) arg;
else if (arg instanceof GUID)
val = ((GUID... | protected ID getIDFromArg(Object arg) throws IDCreateException {
if (arg == null)
throw new IDCreateException("id cannot be null"); //$NON-NLS-1$
String val = null;
if (arg instanceof StringID)
return (ID) arg;
else if (arg instanceof GUID)
val = ((GUID) arg).getName();
else if (arg instanceof URIID... |
private static JUnitTest createDummyTestForBatchTest(JUnitTest test) {
JUnitTest t = (JUnitTest) test.clone();
int index = test.getName().indexOf('.');
// make sure test looks as if it was in the same "package" as
// the last test of the batch
String pack = index > 0 ? test.g... | private static JUnitTest createDummyTestForBatchTest(JUnitTest test) {
JUnitTest t = (JUnitTest) test.clone();
int index = test.getName().lastIndexOf('.');
// make sure test looks as if it was in the same "package" as
// the last test of the batch
String pack = index > 0 ? te... |
public static DecoratingDataSource installDBDictionary(DBDictionary dict,
DecoratingDataSource ds, final JDBCConfiguration conf,
boolean factory2) {
DataSource inner = ds.getInnermostDelegate();
if (inner instanceof DriverDataSource)
((DriverDataSource) inner).initDBDicti... | public static DecoratingDataSource installDBDictionary(DBDictionary dict,
DecoratingDataSource ds, final JDBCConfiguration conf,
boolean factory2) {
DataSource inner = ds.getInnermostDelegate();
if (inner instanceof DriverDataSource)
((DriverDataSource) inner).initDBDicti... |
((XSObjectListImpl)annotations).addXSObject (annotation);
/*
* 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 t... | ((XSObjectListImpl)annotations).addXSObject (annotation);
/*
* 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 t... |
notation.fPublicId = publicAttr;
notation.fSystemId = systemAttr;
//check content
Element content = DOMUtil.getFirstChildElement(elmNode);
XSAnnotationImpl annotation = null;
if (content != null && DOMUtil.getLocalName(content).equals(SchemaSymbols.ELT_A... | notation.fPublicId = publicAttr;
notation.fSystemId = systemAttr;
//check content
Element content = DOMUtil.getFirstChildElement(elmNode);
XSAnnotationImpl annotation = null;
if (content != null && DOMUtil.getLocalName(content).equals(SchemaSymbols.ELT_A... |
((XSObjectListImpl) annotations).addXSObject(annotation);
/*
* 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 t... | ((XSObjectListImpl) annotations).addXSObject(annotation);
/*
* 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 t... |
protected final void onAttach()
{
super.onBeforeRender();
// TODO after the constructor change we can do this in the constructor
// of either this class or the button form
getForm().setDefaultButton(this);
}
} | protected final void onBeforeRender()
{
super.onBeforeRender();
// TODO after the constructor change we can do this in the constructor
// of either this class or the button form
getForm().setDefaultButton(this);
}
} |
public boolean isEnabled(Component component)
{
return component.isEnabled();
}
| public boolean isEnabled(Component component)
{
return true;
}
|
public void addExisting(Path source) {
String[] list = source.list();
for (int i=0; i<list.length; i++) {
File f = null;
if (getProject() != null) {
f = getProject().resolveFile(list[i]);
}
else {
f = new File(list[i]);
... | public void addExisting(Path source) {
String[] list = source.list();
for (int i=0; i<list.length; i++) {
File f = null;
if (getProject() != null) {
f = getProject().resolveFile(list[i]);
}
else {
f = new File(list[i]);
... |
public void setStrip(int num) throws BuildException {
if (strip < 0) {
throw new BuildException("strip has to be >= 0", location);
}
strip = num;
}
| public void setStrip(int num) throws BuildException {
if (num < 0) {
throw new BuildException("strip has to be >= 0", location);
}
strip = num;
}
|
protected WebApplication createApplication(final String applicationClassName)
{
try
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
if (loader == null)
{
loader = getClass().getClassLoader();
}
final Class applicationClass = loader.loadClass(applicationClassName);
if (... | protected WebApplication createApplication(final String applicationClassName)
{
try
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
if (loader == null)
{
loader = getClass().getClassLoader();
}
final Class<?> applicationClass = loader.loadClass(applicationClassName);
i... |
public void testSubmitLinkBySubmittingForm()
{
tester.startPage(HomePage.class);
tester.assertRenderedPage(HomePage.class);
HomePage home = (HomePage)tester.getLastRenderedPage();
tester.setParameterForNextRequest("form:text", "Hello");
// Pretend we clicked on "link"
tester.getParametersForNextRequest().... | public void testSubmitLinkBySubmittingForm()
{
tester.startPage(HomePage.class);
tester.assertRenderedPage(HomePage.class);
HomePage home = (HomePage)tester.getLastRenderedPage();
tester.setParameterForNextRequest("form:text", "Hello");
// Pretend we clicked on "link"
tester.getParametersForNextRequest().... |
package org.apache.xerces.xs;
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 2001, 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are m... | package org.apache.xerces.xs;
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 2001, 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are m... |
public final Form getForm()
{
if (form == null)
{
form = getForm();
}
return form;
}
| public final Form getForm()
{
if (form == null)
{
form = super.getForm();
}
return form;
}
|
private void determineBaseDirs() throws ExecutionException {
if (isDataValueSet(MagicProperties.BASEDIR)) {
baseDir
= new File(getDataValue(MagicProperties.BASEDIR).toString());
} else {
URL projectURL = project.getSourceURL();
if (projectURL.getP... | private void determineBaseDirs() throws ExecutionException {
if (isDataValueSet(MagicProperties.BASEDIR)) {
baseDir
= new File(getDataValue(MagicProperties.BASEDIR).toString());
} else {
URL projectURL = project.getSourceURL();
if (projectURL.getP... |
protected void _init(BuildHelper helper) {
helper.setProperty("src.dir", "src");
helper.setProperty("lib.dir", "lib");
helper.setProperty("java.dir", "${src.dir}/java");
helper.setProperty("bin.dir", "bin");
helper.setProperty("dist.dir", "dist");
helper.setProperty("... | protected void _init(BuildHelper helper) {
helper.setProperty("src.dir", "src");
helper.setProperty("lib.dir", "lib");
helper.setProperty("java.dir", "${src.dir}/java");
helper.setProperty("bin.dir", "bin");
helper.setProperty("dist.dir", "dist");
helper.setProperty("... |
protected void build_lib(BuildHelper helper) {
helper.mkdir("${bin.dir}/antlibs/${libset}");
helper.mkdir("${distlib.dir}/antlibs");
helper.createPath("classpath.antlibs");
helper.addPathElementToPath("classpath.antlibs", "${distlib.dir}/common/common.jar");
helper.addPathToP... | protected void build_lib(BuildHelper helper) {
helper.mkdir("${bin.dir}/antlibs/${libset}");
helper.mkdir("${distlib.dir}/antlibs");
helper.createPath("classpath.antlibs");
helper.addPathElementToPath("classpath.antlibs", "${distlib.dir}/common/common.jar");
helper.addPathToP... |
public UnresolvedType getReturnType() {
if (kind == ConstructorCall) return getSignature().getDeclaringType();
else if (kind == FieldSet) return ResolvedType.VOID;
return getSignature().getReturnType();
}
| public UnresolvedType getReturnType() {
if (kind == ConstructorCall) return getSignature().getDeclaringType();
else if (kind == FieldSet) return ResolvedType.VOID;
return getResolvedSignature().getGenericReturnType();
}
|
protected IContainer createContainer(ServiceReference serviceReference,
ContainerTypeDescription containerTypeDescription)
throws ContainerCreateException {
IContainerFactory containerFactory = getContainerFactory();
Object containerFactoryArguments = serviceReference
.getProperty(RemoteConstants.EXPOR... | protected IContainer createContainer(ServiceReference serviceReference,
ContainerTypeDescription containerTypeDescription)
throws ContainerCreateException {
IContainerFactory containerFactory = getContainerFactory();
Object containerFactoryArguments = serviceReference
.getProperty(RemoteConstants.SERVI... |
public void testEndpointListenerNotification() throws Exception {
Properties props = new Properties();
props.put(org.osgi.service.remoteserviceadmin.EndpointListener.ENDPOINT_LISTENER_SCOPE,"("+RemoteConstants.ENDPOINT_ID+"=*)");
ServiceRegistration endpointListenerRegistration = Activator.getContext().registerS... | public void testEndpointListenerNotification() throws Exception {
Properties props = new Properties();
props.put(org.osgi.service.remoteserviceadmin.EndpointListener.ENDPOINT_LISTENER_SCOPE,"("+RemoteConstants.ENDPOINT_ID+"=*)");
ServiceRegistration endpointListenerRegistration = Activator.getDefault().getContex... |
private void deleteResources() {
List oldResources = new ArrayList();
oldResources.addAll(resources);
// note - this deliberately ignores resources in jars as we don't yet handle jar changes
// with incremental compilation
for (Iterator i = buildConfig.getInpath().iterator(); i.hasNext(); ) {
File inPa... | private void deleteResources() {
List oldResources = new ArrayList();
oldResources.addAll(resources);
// note - this deliberately ignores resources in jars as we don't yet handle jar changes
// with incremental compilation
for (Iterator i = buildConfig.getInpath().iterator(); i.hasNext(); ) {
File inPa... |
public static Properties getProperties(String file)
{
Properties p = new Properties(System.getProperties());
try
{
File f = new File(file);
p.load(new FileInputStream(f));
}
catch (Exception e)
{
try
{
p.load(
JMeterUtils.class.getClassLoader().getSystemResourceAsStream(
"org/ap... | public static Properties getProperties(String file)
{
Properties p = new Properties(System.getProperties());
try
{
File f = new File(file);
p.load(new FileInputStream(f));
}
catch (Exception e)
{
try
{
p.load(
ClassLoader.getSystemResourceAsStream(
"org/apache/jmeter/jmeter.prop... |
public void testAddObjectAndTree() throws Exception
{
ListedHashTree tree = new ListedHashTree("key");
ListedHashTree newTree = new ListedHashTree("value");
tree.add("key", newTree);
assertEquals(tree.list().size(), 1);
assertEquals("key",tree.getArray()[0]);
assertEquals(1,tree.getTree("key").lis... | public void testAddObjectAndTree() throws Exception
{
ListedHashTree tree = new ListedHashTree("key");
ListedHashTree newTree = new ListedHashTree("value");
tree.add("key", newTree);
assertEquals(tree.list().size(), 1);
assertEquals("key",tree.getArray()[0]);
assertEquals(1,tree.getTree("key").lis... |
public static Document createEmptyDoc()
{
return new Tidy().createEmptyDocument();
}
| public static Document createEmptyDoc()
{
return Tidy.createEmptyDocument();
}
|
public void handleEvent(Event e) {
FontDialog fontDialog = new FontDialog(fontSelectButton.getShell());
fontDialog.setText("Choose Font Options");
double[] currentColor = new double[4];
GL.glGetDoublev(GL.GL_CURRENT_COLOR, currentColor);
fontDialog.setRGB(
new RGB(
(int) currentColor[0... | public void handleEvent(Event e) {
FontDialog fontDialog = new FontDialog(fontSelectButton.getShell());
fontDialog.setText("Choose Font Options");
double[] currentColor = new double[4];
GL.glGetDoublev(GL.GL_CURRENT_COLOR, currentColor);
fontDialog.setRGB(
new RGB(
(int) currentColor[0... |
List getStringResourceLoaders();
package wicket.settings;
import java.util.List;
import java.util.Locale;
import wicket.IResourceFactory;
import wicket.Localizer;
import wicket.model.IModel;
import wicket.resource.IPropertiesFactory;
import wicket.resource.loader.IStringResourceLoader;
import wicket.util.file.IResou... | List getStringResourceLoaders();
package wicket.settings;
import java.util.List;
import java.util.Locale;
import wicket.IResourceFactory;
import wicket.Localizer;
import wicket.model.IModel;
import wicket.resource.IPropertiesFactory;
import wicket.resource.loader.IStringResourceLoader;
import wicket.util.file.IResou... |
public void verify() {
TypeVariable[] tvs = genericType.getTypeVariables();
TypePattern[] typeParamPatterns = typeParameters.getTypePatterns();
if (typeParameters.areAllExactWithNoSubtypesAllowed()) {
for (int i = 0; i < tvs.length; i++) {
UnresolvedType ut = typeParamPatterns[i].getExactType();
... | public void verify() {
TypeVariable[] tvs = genericType.getTypeVariables();
TypePattern[] typeParamPatterns = typeParameters.getTypePatterns();
if (typeParameters.areAllExactWithNoSubtypesAllowed()) {
for (int i = 0; i < tvs.length; i++) {
UnresolvedType ut = typeParamPatterns[i].getExactType();
... |
@javax.persistence.metamodel.StaticMetamodel
/**
* Generated by OpenJPA MetaModel Generator Tool.
**/
package org.apache.openjpa.persistence.criteria;
@javax.persistence.metamodel.TypesafeMetamodel
(value=org.apache.openjpa.persistence.criteria.Contractor.class)
public class Contractor_ extends Person_ {
} | @javax.persistence.metamodel.StaticMetamodel
/**
* Generated by OpenJPA MetaModel Generator Tool.
**/
package org.apache.openjpa.persistence.criteria;
@javax.persistence.metamodel.StaticMetamodel
(value=org.apache.openjpa.persistence.criteria.Contractor.class)
public class Contractor_ extends Person_ {
} |
@javax.persistence.metamodel.StaticMetamodel
/**
* Generated by OpenJPA MetaModel Generator Tool.
**/
package org.apache.openjpa.persistence.criteria;
@javax.persistence.metamodel.TypesafeMetamodel
(value=org.apache.openjpa.persistence.criteria.FemaleUser.class)
public class FemaleUser_ extends CompUser_ {
} | @javax.persistence.metamodel.StaticMetamodel
/**
* Generated by OpenJPA MetaModel Generator Tool.
**/
package org.apache.openjpa.persistence.criteria;
@javax.persistence.metamodel.StaticMetamodel
(value=org.apache.openjpa.persistence.criteria.FemaleUser.class)
public class FemaleUser_ extends CompUser_ {
} |
@javax.persistence.metamodel.StaticMetamodel
/**
* Generated by OpenJPA MetaModel Generator Tool.
**/
package org.apache.openjpa.persistence.criteria;
@javax.persistence.metamodel.TypesafeMetamodel
(value=org.apache.openjpa.persistence.criteria.MaleUser.class)
public class MaleUser_ extends CompUser_ {
} | @javax.persistence.metamodel.StaticMetamodel
/**
* Generated by OpenJPA MetaModel Generator Tool.
**/
package org.apache.openjpa.persistence.criteria;
@javax.persistence.metamodel.StaticMetamodel
(value=org.apache.openjpa.persistence.criteria.MaleUser.class)
public class MaleUser_ extends CompUser_ {
} |
@javax.persistence.metamodel.StaticMetamodel
/**
* Generated by OpenJPA MetaModel Generator Tool.
**/
package org.apache.openjpa.persistence.criteria;
@javax.persistence.metamodel.TypesafeMetamodel
(value=org.apache.openjpa.persistence.criteria.Transaction.class)
public class Transaction_ {
} | @javax.persistence.metamodel.StaticMetamodel
/**
* Generated by OpenJPA MetaModel Generator Tool.
**/
package org.apache.openjpa.persistence.criteria;
@javax.persistence.metamodel.StaticMetamodel
(value=org.apache.openjpa.persistence.criteria.Transaction.class)
public class Transaction_ {
} |
private List<MatchResult> processMatches(Pattern pattern, String regex, SampleResult result, int matchNumber, JMeterVariables vars) {
if (log.isDebugEnabled()) {
log.debug("Regex = " + regex);
}
Perl5Matcher matcher = JMeterUtils.getMatcher();
List<MatchResult> matches =... | private List<MatchResult> processMatches(Pattern pattern, String regex, SampleResult result, int matchNumber, JMeterVariables vars) {
if (log.isDebugEnabled()) {
log.debug("Regex = " + regex);
}
Perl5Matcher matcher = JMeterUtils.getMatcher();
List<MatchResult> matches =... |
public void setOrientation (int orientation) {
checkWidget();
if (OS.IsWinCE) return;
if (OS.WIN32_VERSION < OS.VERSION (4, 10)) return;
int flags = SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT;
if ((orientation & flags) == 0 || (orientation & flags) == flags) return;
style &= ~flags;
style |= orientation & flags;
int... | public void setOrientation (int orientation) {
checkWidget();
if (OS.IsWinCE) return;
if (OS.WIN32_VERSION < OS.VERSION (4, 10)) return;
int flags = SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT;
if ((orientation & flags) == 0 || (orientation & flags) == flags) return;
style &= ~flags;
style |= orientation & flags;
int... |
public void setVisible (boolean visible) {
checkWidget ();
if (OS.IsWinCE) return;
if (visible == getVisible ()) return;
if (item == null) {
int hwnd = parent.handle;
TOOLINFO lpti = new TOOLINFO ();
lpti.cbSize = TOOLINFO.sizeof;
lpti.uId = id;
lpti.hwnd = hwnd;
int hwndToolTip = hwndToolTip ();
if (... | public void setVisible (boolean visible) {
checkWidget ();
if (OS.IsWinCE) return;
if (visible == getVisible ()) return;
if (item == null) {
int hwnd = parent.handle;
TOOLINFO lpti = new TOOLINFO ();
lpti.cbSize = TOOLINFO.sizeof;
lpti.uId = id;
lpti.hwnd = hwnd;
int hwndToolTip = hwndToolTip ();
if (... |
private void setCache(String lastModified, String cacheControl, String expires, String etag, String url, String date) {
if (log.isDebugEnabled()){
log.debug("setCache("
+ lastModified + ","
+ cacheControl + ","
+ expires + ","
... | private void setCache(String lastModified, String cacheControl, String expires, String etag, String url, String date) {
if (log.isDebugEnabled()){
log.debug("setCache("
+ lastModified + ","
+ cacheControl + ","
+ expires + ","
... |
protected void setupProxy(Proxy proxy) {
if (proxy.getType().equals(Proxy.Type.HTTP)) {
final ProxyAddress address = proxy.getAddress();
getHostConfiguration().setProxy(HttpClientRetrieveFileTransfer.getHostFromURL(address.getHostName()), address.getPort());
final String proxyUsername = proxy.getUsername();... | protected void setupProxy(Proxy proxy) {
if (proxy.getType().equals(Proxy.Type.HTTP)) {
final ProxyAddress address = proxy.getAddress();
getHostConfiguration().setProxy(address.getHostName(), address.getPort());
final String proxyUsername = proxy.getUsername();
final String proxyPassword = proxy.getPassw... |
protected void setupProxy(Proxy proxy) {
if (proxy.getType().equals(Proxy.Type.HTTP)) {
final ProxyAddress address = proxy.getAddress();
getHostConfiguration().setProxy(getHostFromURL(address.getHostName()), address.getPort());
final String proxyUsername = proxy.getUsername();
final String proxyPassword ... | protected void setupProxy(Proxy proxy) {
if (proxy.getType().equals(Proxy.Type.HTTP)) {
final ProxyAddress address = proxy.getAddress();
getHostConfiguration().setProxy(address.getHostName(), address.getPort());
final String proxyUsername = proxy.getUsername();
final String proxyPassword = proxy.getPassw... |
public void widgetSelected (SelectionEvent e) {
System.out.println ("Calendar date selected (MM/DD/YYYY) = " + (calendar.getMonth () + 1) + "/" + calendar.getDay () + "/" + calendar.getYear ());
System.out.println ("Date selected (MM/YYYY) = " + (date.getMonth () + 1) + "/" + date.getYear ());
System... | public void widgetSelected (SelectionEvent e) {
System.out.println ("Calendar date selected (MM/DD/YYYY) = " + (calendar.getMonth () + 1) + "/" + calendar.getDay () + "/" + calendar.getYear ());
System.out.println ("Date selected (MM/YYYY) = " + (date.getMonth () + 1) + "/" + date.getYear ());
System... |
public void addRelationship(
ResolvedType onType,
ResolvedTypeMunger munger,
ResolvedType originatingAspect) {
if (!AsmManager.isCreatingModel()) return;
String sourceHandle = "";
if (munger.getSourceLocation()!=null) {
sourceHandle = AsmManager.getDefault().getHandleProvider().createHandleIdentifier(... | public void addRelationship(
ResolvedType onType,
ResolvedTypeMunger munger,
ResolvedType originatingAspect) {
if (!AsmManager.isCreatingModel()) return;
String sourceHandle = "";
if (munger.getSourceLocation()!=null && munger.getSourceLocation().getOffset()!=-1) {
sourceHandle = AsmManager.getDefault... |
public void validate(IValidatable<Z> validatable)
{
Z value = validatable.getValue();
final Z min = getMinimum();
final Z max = getMaximum();
if (value.compareTo(min) < 0 || value.compareTo(max) > 0)
{
ValidationError error = new ValidationError();
error.addMessageKey("RangeValidator");
error.setVa... | public void validate(IValidatable<Z> validatable)
{
Z value = validatable.getValue();
final Z min = getMinimum();
final Z max = getMaximum();
if ((min != null && value.compareTo(min) < 0) || (max != null && value.compareTo(max) > 0))
{
ValidationError error = new ValidationError();
error.addMessageKey... |
public void checkConfigurationInternal (final Issues issues) {
super.checkConfiguration(issues);
if (_genPath == null && getInitializedOutlets().isEmpty())
issues.addError(this, "You need to configure at least one outlet!");
if ((_genPath != null || _srcPath != null) && !_outle... | public void checkConfigurationInternal (final Issues issues) {
super.checkConfigurationInternal(issues);
if (_genPath == null && getInitializedOutlets().isEmpty())
issues.addError(this, "You need to configure at least one outlet!");
if ((_genPath != null || _srcPath != null) &&... |
public void checkConfigurationInternal (Issues issues) {
super.checkConfiguration (issues);
// Try to create detailed error message (see Bug#172567)
String compPrefix = getId()!=null ? getId()+": " : "";
if (_invokeExpression == null || _invokeExpression.trim().leng... | public void checkConfigurationInternal (Issues issues) {
super.checkConfigurationInternal (issues);
// Try to create detailed error message (see Bug#172567)
String compPrefix = getId()!=null ? getId()+": " : "";
if (_invokeExpression == null || _invokeExpression.tri... |
public int addAttDef(QName elementDecl, QName attributeDecl,
int attType, boolean attList, int enumeration,
int attDefaultType, int attDefaultValue, boolean isExternal)
throws Exception {
/****
System.out.println("---add attr--- "+attribut... | public int addAttDef(QName elementDecl, QName attributeDecl,
int attType, boolean attList, int enumeration,
int attDefaultType, int attDefaultValue, boolean isExternal)
throws Exception {
/****
System.out.println("---add attr--- "+attribut... |
protected int addElementDecl(QName eltQName, int enclosingScope, int scopeDefined,
int contentSpecType, int contentSpecIndex,
int attrListHead, DatatypeValidator dv){
int elementDeclIndex = getElementDeclIndex(eltQName.localpart, enclosingS... | protected int addElementDecl(QName eltQName, int enclosingScope, int scopeDefined,
int contentSpecType, int contentSpecIndex,
int attrListHead, DatatypeValidator dv){
int elementDeclIndex = getElementDeclIndex(eltQName, enclosingScope);
... |
public MethodConfigUserObject(Class type, String value)
throws MethodConfigUserObjectException
{
if(type == null || value == null)
{
throw new MethodConfigUserObjectException(
"Parameters of MethodConfigUserObject constructor cannot be null");
}
this.type = type;
// ensure that the class... | public MethodConfigUserObject(Class type, String value)
throws MethodConfigUserObjectException
{
if(type == null || value == null)
{
throw new MethodConfigUserObjectException(
"Parameters of MethodConfigUserObject constructor cannot be null");
}
this.type = type;
// ensure that the class... |
public SampleResult sample(Entry e)
{
log.info("Start : sample1");
boolean reflectionStatus = false;
// There is a row of ifs condition which may be executed depending on the
// state of the MethodConfig state. During reflection only one of these
// condition should be become true. However, on... | public SampleResult sample(Entry e)
{
log.info("Start : sample1");
boolean reflectionStatus = false;
// There is a row of ifs condition which may be executed depending on the
// state of the MethodConfig state. During reflection only one of these
// condition should be become true. However, on... |
public void removeSelectionListener(SelectionListener listener) {
checkWidget ();
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
if (eventTable == null) return;
eventTable.unhook (SWT.Selection, listener);
eventTable.unhook (SWT.DefaultSelection,listener);
}
void setBackgroundImage (int hImage) {
super.... | public void removeSelectionListener(SelectionListener listener) {
checkWidget ();
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
if (eventTable == null) return;
eventTable.unhook (SWT.Selection, listener);
eventTable.unhook (SWT.DefaultSelection,listener);
}
void setBackgroundImage (int hImage) {
super.... |
public void addTreeListener(TreeListener listener) {
checkWidget ();
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener (listener);
addListener (SWT.Expand, typedListener);
addListener (SWT.Collapse, typedListener);
}
int borderHandle () {
return hwndParent !=... | public void addTreeListener(TreeListener listener) {
checkWidget ();
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener (listener);
addListener (SWT.Expand, typedListener);
addListener (SWT.Collapse, typedListener);
}
int borderHandle () {
return hwndParent !=... |
public void onSelectionChanged()
{
convert();
updateModel();
onSelectionChanged(getModelObject());
}
| public void onSelectionChanged()
{
convertInput();
updateModel();
onSelectionChanged(getModelObject());
}
|
public final void onSelectionChanged()
{
convert();
updateModel();
onSelectionChanged((Collection)getModelObject());
}
| public final void onSelectionChanged()
{
convertInput();
updateModel();
onSelectionChanged((Collection)getModelObject());
}
|
public final void onSelectionChanged()
{
convert();
updateModel();
onSelectionChanged(getModelObject());
}
| public final void onSelectionChanged()
{
convertInput();
updateModel();
onSelectionChanged(getModelObject());
}
|
private IRequestHandler processListener(PageComponentInfo pageComponentInfo,
Class<? extends IRequestablePage> pageClass, PageParameters pageParameters)
{
PageInfo pageInfo = pageComponentInfo.getPageInfo();
ComponentInfo componentInfo = pageComponentInfo.getComponentInfo();
Integer renderCount = null;
Requ... | private IRequestHandler processListener(PageComponentInfo pageComponentInfo,
Class<? extends IRequestablePage> pageClass, PageParameters pageParameters)
{
PageInfo pageInfo = pageComponentInfo.getPageInfo();
ComponentInfo componentInfo = pageComponentInfo.getComponentInfo();
Integer renderCount = null;
Requ... |
public IRequestHandler mapRequest(Request request)
{
Url url = request.getUrl();
if (urlStartsWith(url, getContext().getNamespace(), getContext().getPageIdentifier()))
{
PageComponentInfo info = getPageComponentInfo(url);
if (info != null && info.getPageInfo().getPageId() != null)
{
Integer renderC... | public IRequestHandler mapRequest(Request request)
{
Url url = request.getUrl();
if (urlStartsWith(url, getContext().getNamespace(), getContext().getPageIdentifier()))
{
PageComponentInfo info = getPageComponentInfo(url);
if (info != null && info.getPageInfo().getPageId() != null)
{
Integer renderC... |
private String urlForBehavior(IBehavior behaviorUnderTest)
{
int index = page.container.getBehaviorsRawList().indexOf(behaviorUnderTest);
String enabledBehaviorUrl = tester.urlFor(
new ListenerInterfaceRequestHandler(new PageAndComponentProvider(page, page.container),
IBehaviorListener.INTERFACE, index)).t... | private String urlForBehavior(IBehavior behaviorUnderTest)
{
int index = page.container.getBehaviorId(behaviorUnderTest);
String enabledBehaviorUrl = tester.urlFor(
new ListenerInterfaceRequestHandler(new PageAndComponentProvider(page, page.container),
IBehaviorListener.INTERFACE, index)).toString();
ret... |
public Component setModel(final IModel model)
{
// Detach current model
if (this.model != null)
{
this.model.detach();
}
// Change model
if (this.model != model)
{
addStateChange(new ComponentModelChange(this.model));
this.model = model;
}
// If a compound model is explicitly set on this ... | public Component setModel(final IModel model)
{
// Detach current model
if (this.model != null)
{
this.model.detach();
}
// Change model
if (this.model != model)
{
addStateChange(new ComponentModelChange(this.model));
this.model = model;
}
// If a compound model is explicitly set on this ... |
public Rectangle getBounds () {
checkWidget ();
return getBounds (true);
}
Rectangle getBounds (boolean checkData) {
if (checkData && !parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
int x = getTextX (0);
int width = textWidths [0] + 2 * MARGIN_TEXT;
if (parent.columns.length > 0) {
TableColum... | public Rectangle getBounds () {
checkWidget ();
return getBounds (true);
}
Rectangle getBounds (boolean checkData) {
if (checkData && !parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
int x = getTextX (0);
int width = textWidths [0] + 2 * MARGIN_TEXT;
if (parent.columns.length > 0) {
TableColum... |
public Rectangle getBounds () {
checkWidget ();
return getBounds (true);
}
Rectangle getBounds (boolean checkData) {
if (checkData && !parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
if (!isAvailable ()) return new Rectangle (0, 0, 0, 0);
TreeColumn[] orderedColumns = parent.getOrderedColumns ();... | public Rectangle getBounds () {
checkWidget ();
return getBounds (true);
}
Rectangle getBounds (boolean checkData) {
if (checkData && !parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
if (!isAvailable ()) return new Rectangle (0, 0, 0, 0);
TreeColumn[] orderedColumns = parent.getOrderedColumns ();... |
protected void runExec(Execute exe) throws BuildException {
exe.setCommandline(cmdl.getCommandline());
try {
runExecute(exe);
} catch (IOException e) {
if (failIfExecFails) {
throw new BuildException("Execute failed: ",e, location);
} else ... | protected void runExec(Execute exe) throws BuildException {
exe.setCommandline(cmdl.getCommandline());
try {
runExecute(exe);
} catch (IOException e) {
if (failIfExecFails) {
throw new BuildException("Execute failed: "+e.toString(),e, location);
... |
protected void init() {
if(fValidation) {
super.init();
// now overwrite some entries in parent:
try {
fValID = fDatatypeValidatorFactory.getBuiltInDV("XML11ID");
fValIDRef = fDatatypeValidatorFactory.getBuiltInDV("XML11IDREFS");
... | protected void init() {
if(fValidation || fDynamicValidation) {
super.init();
// now overwrite some entries in parent:
try {
fValID = fDatatypeValidatorFactory.getBuiltInDV("XML11ID");
fValIDRef = fDatatypeValidatorFactory.getBuil... |
public void setXmlVersion(String value) {
if(version.equals("1.0") || version.equals("1.1"){
version = value;
}
else{
//NOT_SUPPORTED_ERR: Raised if the vesion is set to a value that is not supported by
//this document
//we dont support any oth... | public void setXmlVersion(String value) {
if(version.equals("1.0") || version.equals("1.1")){
version = value;
}
else{
//NOT_SUPPORTED_ERR: Raised if the vesion is set to a value that is not supported by
//this document
//we dont support any ot... |
public void error(FormComponent fc, final String resourceKey, Map vars)
{
if (fc == null)
{
throw new IllegalArgumentException("Argument [[fc]] cannot be null");
}
if (vars == null)
{
throw new IllegalArgumentException("Argument [[vars]] cannot be null");
}
if (resourceKey == null)
{
throw ne... | public void error(FormComponent fc, final String resourceKey, Map vars)
{
if (fc == null)
{
throw new IllegalArgumentException("Argument [[fc]] cannot be null");
}
if (vars == null)
{
throw new IllegalArgumentException("Argument [[vars]] cannot be null");
}
if (resourceKey == null)
{
throw ne... |
public interface IErrorMessageSource
/*
* 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, Ve... | public interface IErrorMessageSource
/*
* 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, Ve... |
String getErrorMessage(IErrorMessageSource messageSource);
/*
* 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 ... | String getErrorMessage(IErrorMessageSource messageSource);
/*
* 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 ... |
public void error(final IValidatable validatable, final String resourceKey,
Map vars)
{
if (validatable == null)
{
throw new IllegalArgumentException("Argument [[validatable]] cannot be null");
}
if (vars == null)
{
throw new IllegalArgumentException("Argument [[vars]] cannot be null");
}
if (r... | public void error(final IValidatable validatable, final String resourceKey,
Map vars)
{
if (validatable == null)
{
throw new IllegalArgumentException("Argument [[validatable]] cannot be null");
}
if (vars == null)
{
throw new IllegalArgumentException("Argument [[vars]] cannot be null");
}
if (r... |
private final void step()
{
try
{
switch (currentStep)
{
case PREPARE_REQUEST : {
// prepare the request
prepare();
break;
}
case RESOLVE_TARGET : {
// resolve the target of the request using the request
// parameters
final IRequestTarget target = processor.resolve(... | private final void step()
{
try
{
switch (currentStep)
{
case PREPARE_REQUEST : {
// prepare the request
prepare();
break;
}
case RESOLVE_TARGET : {
// resolve the target of the request using the request
// parameters
final IRequestTarget target = processor.resolve(... |
public CharSequence encodeURL(CharSequence url)
{
return currentResponse.encodeURL(url);
}
};
redirectResponse.setCharacterEncoding(currentResponse.getCharacterEncoding());
// redirect the response to the buffer
setResponse(redirectResponse);
// render the page into the buffer... | public CharSequence encodeURL(CharSequence url)
{
return currentResponse.encodeURL(url);
}
};
redirectResponse.setCharacterEncoding(currentResponse.getCharacterEncoding());
// redirect the response to the buffer
setResponse(redirectResponse);
// render the page into the buffer... |
protected final void renderApplicationLevelHeaders(final HtmlHeaderContainer headerContainer)
{
Args.notNull(headerContainer, "headerContainer");
if (renderHeadListeners != null)
{
for (IHeaderContributor listener : renderHeadListeners)
{
listener.renderHead(headerContainer.getHeaderResponse());
}... | protected final void renderApplicationLevelHeaders(final HtmlHeaderContainer headerContainer)
{
Args.notNull(headerContainer, "headerContainer");
if (renderHeadListeners != null)
{
for (IHeaderContributor listener : renderHeadListeners)
{
listener.renderHead(headerContainer, headerContainer.getHeader... |
public boolean canCallListenerInterface()
{
if (!isEnabled() || !determineVisibility())
{
return false;
}
else if (getParent() != null)
{
return getParent().canCallListenerInterface();
}
else
{
return false;
}
}
} | public boolean canCallListenerInterface()
{
if (!isEnabledInHierarchy() || !determineVisibility())
{
return false;
}
else if (getParent() != null)
{
return getParent().canCallListenerInterface();
}
else
{
return false;
}
}
} |
public final void invoke(final IRequestableComponent component)
{
if (!component.isEnabledInHierarchy() || !component.isVisibleInHierarchy())
{
// just return so that we have a silent fail and just re-render the
// page
log.info("component not enabled or visible; ignoring call. Component: " + component);... | public final void invoke(final IRequestableComponent component)
{
if (!component.canCallListenerInterface())
{
// just return so that we have a silent fail and just re-render the
// page
log.info("component not enabled or visible; ignoring call. Component: " + component);
return;
}
try
{
//... |
protected void optimisticLockInternal(OpenJPAStateManager sm, int level,
int timeout, Object sdata, boolean postLockVersionCheck) {
super.optimisticLockInternal(sm, level, timeout, sdata,
postLockVersionCheck);
if (postLockVersionCheck) {
if (level >= MixedLockLevels.... | protected void optimisticLockInternal(OpenJPAStateManager sm, int level,
int timeout, Object sdata, boolean postLockVersionCheck) {
super.optimisticLockInternal(sm, level, timeout, sdata,
postLockVersionCheck);
if (postLockVersionCheck) {
if (level >= MixedLockLevels.... |
protected void appendParameters(AppendingStringBuffer url, Map parameters)
{
if (parameters != null)
{
Iterator entries = parameters.entrySet().iterator();
while (entries.hasNext())
{
Map.Entry entry = (Entry)entries.next();
if (entry.getValue() != null)
{
String escapedValue = urlEncode... | protected void appendParameters(AppendingStringBuffer url, Map parameters)
{
if (parameters != null && parameters.size() > 0)
{
Iterator entries = parameters.entrySet().iterator();
while (entries.hasNext())
{
Map.Entry entry = (Entry)entries.next();
if (entry.getValue() != null)
{
String... |
public void resolve(World inSomeWorld) {
if (isResolved) throw new IllegalStateException("already resolved!");
upperBound = upperBound.resolve(inSomeWorld);
if (lowerBound != null) lowerBound = lowerBound.resolve(inSomeWorld);
for (int i = 0; i < additionalInterfaceBounds.length; i++) {
additionalInte... | public void resolve(World inSomeWorld) {
if (isResolved) return;
upperBound = upperBound.resolve(inSomeWorld);
if (lowerBound != null) lowerBound = lowerBound.resolve(inSomeWorld);
for (int i = 0; i < additionalInterfaceBounds.length; i++) {
additionalInterfaceBounds[i] = additionalInterfaceBounds[i].... |
private IModel originalModel;
/**
* Construct.
*
* @param component
* subject of the change
*/
ModelChange(final Component component)
{
if (component == null)
{
throw new IllegalArgumentException("argument component must be not null");
}
// Save component
this.component = compon... | private IModel originalModel;
/**
* Construct.
*
* @param component
* subject of the change
*/
ModelChange(final Component<?> component)
{
if (component == null)
{
throw new IllegalArgumentException("argument component must be not null");
}
// Save component
this.component = com... |
public Page getTestPage()
{
return new ChoicePage(Arrays.asList(books));
}
});
formTester = application.newFormTester("choiceForm");
}
| public Page getTestPage()
{
return new ChoicePage<Book>(Arrays.asList(books));
}
});
formTester = application.newFormTester("choiceForm");
}
|
public SimpleTestPage()
{
SimpleTestPanel panel = new SimpleTestPanel(this,"testPanel");
add(panel);
}
| public SimpleTestPage()
{
SimpleTestPanel panel = new SimpleTestPanel("testPanel");
add(panel);
}
|
public ComponentCreateTag_3()
{
// <wicket:component> are treated as anonymous because they not
// accessible nor available right now. Thus you do not add
// the label contained in <wicket:component> to that specific
// component. You rather add it to its parent, which in this
// case is the... | public ComponentCreateTag_3()
{
// <wicket:component> are treated as anonymous because they not
// accessible nor available right now. Thus you do not add
// the label contained in <wicket:component> to that specific
// component. You rather add it to its parent, which in this
// case is the... |
public MarkupInheritanceExtension_10()
{
super();
add(new Label(this,"label3", "extension label"));
}
| public MarkupInheritanceExtension_10()
{
super();
add(new Label("label3", "extension label"));
}
|
public MarkupInheritanceExtension_11()
{
super();
add(new Label(this,"label5", "extension label"));
}
| public MarkupInheritanceExtension_11()
{
super();
add(new Label("label5", "extension label"));
}
|
public MarkupInheritanceExtension_12()
{
add(new Label(this,"label3", "extension label"));
}
| public MarkupInheritanceExtension_12()
{
add(new Label("label3", "extension label"));
}
|
public MarkupInheritanceExtension_2()
{
super();
add(new Label(this,"label3", "extension label"));
}
| public MarkupInheritanceExtension_2()
{
super();
add(new Label("label3", "extension label"));
}
|
public MarkupInheritanceExtension_4()
{
add(new Label(this,"label3", "extension label"));
}
| public MarkupInheritanceExtension_4()
{
add(new Label("label3", "extension label"));
}
|
public MarkupInheritanceExtension_5()
{
add(new Label(this,"label3", "extension label"));
}
| public MarkupInheritanceExtension_5()
{
add(new Label("label3", "extension label"));
}
|
public MarkupInheritancePage_6()
{
add(new MarkupInheritanceExtensionPanel_6(this,"panel"));
}
| public MarkupInheritancePage_6()
{
add(new MarkupInheritanceExtensionPanel_6("panel"));
}
|
public MarkupInheritancePage_9()
{
add(new MarkupInheritanceExtensionPanel_9(this,"panel"));
}
| public MarkupInheritancePage_9()
{
add(new MarkupInheritanceExtensionPanel_9("panel"));
}
|
public WicketNamespace_1()
{
add(new Label(this,"label", "my label test"));
}
| public WicketNamespace_1()
{
add(new Label("label", "my label test"));
}
|
public WicketNamespace_2()
{
add(new Label(this,"label", "my label test"));
}
| public WicketNamespace_2()
{
add(new Label("label", "my label test"));
}
|
public WicketNamespace_3()
{
add(new Label(this,"label", "my label test"));
}
| public WicketNamespace_3()
{
add(new Label("label", "my label test"));
}
|
public WicketNamespace_4()
{
add(new Label(this,"label", "my label test"));
}
| public WicketNamespace_4()
{
add(new Label("label", "my label test"));
}
|
public WicketNamespace_5()
{
add(new Label(this,"label", "my label test"));
}
| public WicketNamespace_5()
{
add(new Label("label", "my label test"));
}
|
public WicketNamespace_6()
{
add(new Label(this,"label", "my label test"));
}
| public WicketNamespace_6()
{
add(new Label("label", "my label test"));
}
|
public LabelWithEscapeMarkupPage()
{
Label label = new Label(this,"label", "test:'\"");
label.setEscapeModelStrings(true);
add(label);
}
| public LabelWithEscapeMarkupPage()
{
Label label = new Label("label", "test:'\"");
label.setEscapeModelStrings(true);
add(label);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.