buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public QueryStatistics getStatistics();
}
| public QueryStatistics<String> getStatistics();
}
|
private boolean preExecute(Map params) {
PreparedQueryCache cache = _em.getPreparedQueryCache();
if (cache == null) {
return false;
}
FetchConfiguration fetch = _query.getFetchConfiguration();
Boolean registered = cache.register(_id, _query, fetch);
boolea... | private boolean preExecute(Map params) {
PreparedQueryCache cache = _em.getPreparedQueryCache();
if (cache == null) {
return false;
}
FetchConfiguration fetch = _query.getFetchConfiguration();
Boolean registered = cache.register(_id, _query, fetch);
boolea... |
private static final long serialVersionUID = 1L;
MetaDataKey key;
Serializable object;
| private static final long serialVersionUID = 1L;
MetaDataKey<?> key;
Serializable object;
|
public static HashTree loadTree(InputStream reader) throws Exception
{
if (!reader.markSupported())
{
reader = new BufferedInputStream(reader);
}
reader.mark(Integer.MAX_VALUE);
ScriptWrapper wrapper = null;
try
{
wrapper = (ScriptWrapper) saver.fromXML(... | public static HashTree loadTree(InputStream reader) throws Exception
{
if (!reader.markSupported())
{
reader = new BufferedInputStream(reader);
}
reader.mark(Integer.MAX_VALUE);
ScriptWrapper wrapper = null;
try
{
wrapper = (ScriptWrapper) saver.fromXML(... |
public LSParser createLSParser(short mode, String schemaType)
throws DOMException {
if (mode != DOMImplementationLS.MODE_SYNCHRONOUS || (schemaType !=null &&
!"http://www.w3.org/2001/XMLSchema".equals(schemaType) &&
!"http://www.w3.org/TR/REC-xml".equals(schemaType))) {
String msg =
DOMMessageFor... | public LSParser createLSParser(short mode, String schemaType)
throws DOMException {
if (mode != DOMImplementationLS.MODE_SYNCHRONOUS || (schemaType !=null &&
!"http://www.w3.org/2001/XMLSchema".equals(schemaType) &&
!"http://www.w3.org/TR/REC-xml".equals(schemaType))) {
String msg =
DOMMessageFor... |
public Home(final PageParameters parameters)
{
add(new NavigationPanel("mainNavigation", "Helloworld example"));
add(new SelectForm("selectform"));
}
| public Home(final PageParameters parameters)
{
add(new NavigationPanel("mainNavigation", "Select tag example"));
add(new SelectForm("selectform"));
}
|
public boolean isTransparentResolver()
{
return true;
}
};
component.autoAdded();
// Yes, we handled the tag
return true;
}
// We were not able to handle the tag
return false;
}
| public boolean isTransparentResolver()
{
return true;
}
};
component.render(markupStream);
// Yes, we handled the tag
return true;
}
// We were not able to handle the tag
return false;
}
|
public void testNotExist() {
String query = "SELECT DISTINCT o.name FROM CompUser o WHERE NOT EXISTS"
+ " (SELECT s FROM CompUser s WHERE s.address.country = "
+ "o.address.country)";
CriteriaQuery<String> q = cb.createQuery(String.class);
Root<CompUser> o = ... | public void testNotExist() {
String query = "SELECT DISTINCT o.name FROM CompUser o WHERE NOT EXISTS"
+ " (SELECT s FROM CompUser s WHERE s.address.country = "
+ "o.address.country)";
CriteriaQuery<String> q = cb.createQuery(String.class);
Root<CompUser> o = ... |
public IdentifiableType<? super X> getSupertype() {
return (IdentifiableType<? super X>) model.type(meta
.getPCSuperclassMetaData().getDescribedType());
}
| public IdentifiableType<? super X> getSupertype() {
return (IdentifiableType<? super X>) model.managedType(meta
.getPCSuperclassMetaData().getDescribedType());
}
|
public void activated(ID[] others) {
super.activated(others);
if (localGUI == null) {
try {
if (!getContext().isGroupServer())
destroySelfLocal();
} catch (Exception e) {
debugdump(e, "Unable to check whether we are server instance");
destroySelfLocal();
}
}
}
| public void activated(ID[] others) {
super.activated(others);
if (localGUI == null) {
try {
if (!getContext().isGroupManager())
destroySelfLocal();
} catch (Exception e) {
debugdump(e, "Unable to check whether we are server instance");
destroySelfLocal();
}
}
}
|
public boolean isServer() {
ISharedObjectContext context = getContext();
if (context != null) {
return getContext().isGroupServer();
} else return false;
| public boolean isServer() {
ISharedObjectContext context = getContext();
if (context != null) {
return getContext().isGroupManager();
} else return false;
|
public void run() {
boolean isServer = false;
if (ClientPlugin.getDefault().getPluginPreferences().getBoolean(ClientPlugin.PREF_CONFIRM_FILE_RECEIVE)) {
MessageDialog dialog = new MessageDialog(ClientPlugin.getDefault().getActiveShell(), "File Receive Confirmation", null, "Accept file?", MessageDialog.Q... | public void run() {
boolean isServer = false;
if (ClientPlugin.getDefault().getPluginPreferences().getBoolean(ClientPlugin.PREF_CONFIRM_FILE_RECEIVE)) {
MessageDialog dialog = new MessageDialog(ClientPlugin.getDefault().getActiveShell(), "File Receive Confirmation", null, "Accept file?", MessageDialog.Q... |
public void activated(ID [] others)
{
debug("activated()");
try {
if (!getContext().isGroupServer() || includeServer.equals(Boolean.TRUE)) {
startup();
} else {
debug("Not executing commands because is server");
}
} catch (... | public void activated(ID [] others)
{
debug("activated()");
try {
if (!getContext().isGroupManager() || includeServer.equals(Boolean.TRUE)) {
startup();
} else {
debug("Not executing commands because is server");
}
} catch ... |
private void handleJoined(ID containerID) {
if (config.getContext().isGroupServer()) // TODO how about isGroupManager()?
agent.doBootstrap(containerID);
}
| private void handleJoined(ID containerID) {
if (config.getContext().isGroupManager())
agent.doBootstrap(containerID);
}
|
public void execute() {
if (subTarget == null) {
throw new BuildException("Attribute target is required.",
location);
}
delegate.setDir(".");
delegate.setAntfile(project.getProperty("ant.file"));
delegate.setTarget(su... | public void execute() {
if (subTarget == null) {
throw new BuildException("Attribute target is required.",
location);
}
delegate.setDir(project.getBaseDir());
delegate.setAntfile(project.getProperty("ant.file"));
dele... |
public Class getType() {
return Object.class;
}
| public Class getType() {
return _key.getType();
}
|
public void queryQualifiedId(boolean inMemory) throws Exception {
EntityManager em = emf.createEntityManager();
String query = "select KEY(e) from Department d, " +
" in (d.emps) e order by d.deptId, e.empId";
Query q = em.createQuery(query);
if (inMemory)
se... | public void queryQualifiedId(boolean inMemory) throws Exception {
EntityManager em = emf.createEntityManager();
String query = "select KEY(e) from Department d, " +
" in (d.emps) e order by d.deptId, e.empId";
Query q = em.createQuery(query);
if (inMemory)
se... |
public double getDoubleValue()
{
return (double)value;
}
| public double getDoubleValue()
{
return value;
}
|
private void sortData(String column, int start, int end)
{
int x = start, y = end - 1;
String basis =
((List) data.get(column)).get((int) ((x + y) / 2)).toString();
if (x == y)
{
return;
}
while (x <= y)
{
while (x < en... | private void sortData(String column, int start, int end)
{
int x = start, y = end - 1;
String basis =
((List) data.get(column)).get((x + y) / 2).toString();
if (x == y)
{
return;
}
while (x <= y)
{
while (x < end
... |
public TreeItem (TreeItem parentItem, int style, int index) {
this (checkNull (parentItem).parent, parentItem.handle, style, checkIndex (index), true);
}
TreeItem (Tree parent, int /*long*/ parentIter, int style, int index, boolean create) {
super (parent, style);
this.parent = parent;
if (create) {
parent.creat... | public TreeItem (TreeItem parentItem, int style, int index) {
this (checkNull (parentItem).parent, parentItem.handle, style, checkIndex (index), true);
}
TreeItem (Tree parent, int /*long*/ parentIter, int style, int index, boolean create) {
super (parent, style);
this.parent = parent;
if (create) {
parent.creat... |
public UnresolvedType parameterize(Map typeBindings) {
throw new UnsupportedOperationException("resolve this type first");
}
| public UnresolvedType parameterize(Map typeBindings) {
throw new UnsupportedOperationException("unable to parameterize unresolved type: " + signature);
}
|
protected final void checkValidators()
{
final int size = validators_size();
int i = 0;
IValidator validator = null;
try
{
for (i = 0; i < size; i++)
{
validator = validators_get(i);
validator.validate(this);
if (!isValid())
{
break;
}
}
}
catch (Exception e)
{
th... | protected final void checkValidators()
{
final int size = validators_size();
int i = 0;
IValidator validator = null;
try
{
for (i = 0; i < size; i++)
{
validator = validators_get(i);
validator.validate(this);
if (!isValid())
{
break;
}
}
}
catch (Exception e)
{
th... |
public Map getBulkUpdateValues() {
Column[] cols = vers.getColumns();
Map map = new HashMap(cols.length);
Date d = new Date();
for (int i = 0; i < cols.length; i++)
map.put(cols[i], d);
return map;
}
| public Map getBulkUpdateValues() {
Column[] cols = vers.getColumns();
Map map = new HashMap(cols.length);
Object d = nextVersion(null);
for (int i = 0; i < cols.length; i++)
map.put(cols[i], d);
return map;
}
|
package org.apache.myrmidon.interfaces.property;
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org... | package org.apache.myrmidon.interfaces.property;
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org... |
public String getClassLoaderName() {
return ((loader!=null)?loader.getClass().getName()+"@"+loader.hashCode():"null");
}
| public String getClassLoaderName() {
return ((loader!=null)?loader.getClass().getName()+"@"+Integer.toHexString(loader.hashCode()):"null");
}
|
protected void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag)
{
replaceComponentTagBody(markupStream, openTag, "\n<param name=\"component\" value=\""
+ urlFor(IResourceListener.class) + "\"/>"
+ "\n<param name=\"appletInitializerClassName\" value=\""
+ appletInitializerC... | protected void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag)
{
replaceComponentTagBody(markupStream, openTag, "\n<param name=\"modelUrl\" value=\""
+ urlFor(IResourceListener.class) + "\"/>"
+ "\n<param name=\"appletInitializerClassName\" value=\""
+ appletInitializerCl... |
public void init(Container container, Object model)
{
container.setBackground(Color.white);
container.setLayout(new FlowLayout());
container.add(new JButton("Button 1"));
container.add(new JButton("Button 2"));
container.add(new JButton("Button 3"));
}
| public void init(Container container, Object model)
{
container.setBackground(Color.white);
container.setLayout(new FlowLayout());
container.add(new JButton(model.toString()));
container.add(new JButton("Button 2"));
container.add(new JButton("Button 3"));
}
|
public void updateGui(RunningSample s);
} | void updateGui(RunningSample s);
/*
* 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, Versio... |
private Object getObjectId(ClassMapping cls, JDBCStore store, Result res,
ForeignKey fk, boolean subs, Joins joins)
throws SQLException {
if (!isPrimaryKeyObjectId(true))
return getPCSuperclassMapping().getObjectId(cls, store, res, fk,
subs, joins);
if (ge... | private Object getObjectId(ClassMapping cls, JDBCStore store, Result res,
ForeignKey fk, boolean subs, Joins joins)
throws SQLException {
if (!isPrimaryKeyObjectId(true))
return getPCSuperclassMapping().getObjectId(cls, store, res, fk,
subs, joins);
if (ge... |
public Object getPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk,
Joins joins)
throws SQLException;
| public Object getPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk,
JDBCStore store, Joins joins)
throws SQLException;
|
public Object getPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk,
Joins joins)
throws SQLException {
Column col;
Object val = null;
if (cols.length == 1) {
col = cols[0];
if (fk != null)
col = fk.getColumn(col);
val... | public Object getPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk,
JDBCStore store, Joins joins)
throws SQLException {
Column col;
Object val = null;
if (cols.length == 1) {
col = cols[0];
if (fk != null)
col = fk.getColumn(col)... |
public Object getPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk,
Joins joins)
throws SQLException {
Column col = cols[0];
if (fk != null)
col = fk.getColumn(col);
long id = res.getLong(col);
if (id == 0 && res.wasNull())
return null;
... | public Object getPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk,
JDBCStore store, Joins joins)
throws SQLException {
Column col = cols[0];
if (fk != null)
col = fk.getColumn(col);
long id = res.getLong(col);
if (id == 0 && res.wasNull())
... |
public Object getPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk,
Joins joins)
throws SQLException {
Column col = cols[0];
if (fk != null)
col = fk.getColumn(col);
return res.getString(col, joins);
}
| public Object getPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk,
JDBCStore store, Joins joins)
throws SQLException {
Column col = cols[0];
if (fk != null)
col = fk.getColumn(col);
return res.getString(col, joins);
}
|
protected void refreshInternal(Collection objs, OpCallbacks call) {
List exceps = null;
try {
// collect instances that need a refresh
Collection load = null;
StateManagerImpl sm;
Object obj;
for (Iterator itr = objs.iterator(); itr.hasNext... | protected void refreshInternal(Collection objs, OpCallbacks call) {
List exceps = null;
try {
// collect instances that need a refresh
Collection load = null;
StateManagerImpl sm;
Object obj;
for (Iterator itr = objs.iterator(); itr.hasNext... |
public Class getHomePage()
{
return Captcha.class;
}
| public Class getHomePage()
{
return Index.class;
}
|
public Rectangle computeTrim (int x, int y, int width, int height) {
checkWidget();
Rectangle trim = super.computeTrim(x, y, width, height);
NSRect rect = new NSRect ();
rect.x = trim.x;
rect.y = trim.y;
rect.width = trim.width;
rect.height = trim.height;
rect = NSWindow.static_frameRectForContentRect_styleMask... | public Rectangle computeTrim (int x, int y, int width, int height) {
checkWidget();
Rectangle trim = super.computeTrim(x, y, width, height);
NSRect rect = new NSRect ();
rect.x = trim.x;
rect.y = trim.y;
rect.width = trim.width;
rect.height = trim.height;
rect = NSWindow.static_frameRectForContentRect_styleMask... |
private Markup loadMarkup(final Application application, final String key,
final Resource markupResource) throws ParseException, IOException,
ResourceNotFoundException
{
final Markup markup = application.getMarkupParser().read(markupResource);
markupCache.put(key, markup)... | private Markup loadMarkup(final Application application, final String key,
final Resource markupResource) throws ParseException, IOException,
ResourceNotFoundException
{
final Markup markup = application.getMarkupParser(getPage()).read(markupResource);
markupCache.put(key... |
public String toString()
{
return "InterfaceRequestTarget@" + hashCode() + "{" + component + "}";
}
| public String toString()
{
return "[InterfaceRequestTarget@" + hashCode() + " " + component + "]";
}
|
public String toString()
{
return "WebExternalResourceRequestTarget@" + hashCode() + "{" + url + "}";
}
| public String toString()
{
return "[WebExternalResourceRequestTarget@" + hashCode() + " " + url + "]";
}
|
public String toString()
{
return "StringRequestTarget@" + hashCode() + "{" + string + "}";
}
| public String toString()
{
return "[StringRequestTarget@" + hashCode() + " " + string + "]";
}
|
public String toString()
{
return "ComponentRequestTarget@" + hashCode() + "{" + component + "}";
}
| public String toString()
{
return "[ComponentRequestTarget@" + hashCode() + " " + component + "]";
}
|
public String toString()
{
return "PageRequestTarget@" + hashCode() + "{page=" + page + "}";
}
| public String toString()
{
return "[PageRequestTarget@" + hashCode() + " page=" + page + "]";
}
|
public String toString()
{
return "SharedResourceRequestTarget@" + hashCode() + "{" + resourceKey + "}";
}
| public String toString()
{
return "[SharedResourceRequestTarget@" + hashCode() + " " + resourceKey + "]";
}
|
public boolean isVisible () {
checkWidget ();
return getVisible ();
}
void redraw () {
if (!isVisible ()) return;
if ((style & SWT.BAR) != 0) {
display.addBar (this);
} else {
update ();
}
}
void releaseChild () {
super.releaseChild ();
if (cascade != null) cascade.releaseMenu ();
if ((style & SWT.BAR) !... | public boolean isVisible () {
checkWidget ();
return getVisible ();
}
void redraw () {
if (!isVisible ()) return;
if ((style & SWT.BAR) != 0) {
display.addBar (this);
} else {
update ();
}
}
void releaseChild () {
super.releaseChild ();
if (cascade != null) cascade.releaseMenu ();
if ((style & SWT.BAR) !... |
public void execute() throws BuildException {
if (dir == null) {
throw new BuildException("dir attribute is required", location);
}
if (dir.isFile()) {
log("Warning: Specified directory is a file: " + dir.getAbsolutePath());
}
if (!dir.exists()) {
... | public void execute() throws BuildException {
if (dir == null) {
throw new BuildException("dir attribute is required", location);
}
if (dir.isFile()) {
throw new BuildException("Unable to create directory as a file already exists with that name: " + dir.getAbsolutePa... |
public String open () {
String fullPath = null;
fileNames = new String [0];
int /*long*/ method = 0;
int /*long*/ methodImpl = 0;
Callback callback = null;
if ((style & SWT.SAVE) != 0) {
NSSavePanel savePanel = NSSavePanel.savePanel();
panel = savePanel;
if (!overwrite) {
callback = new Callback(this, "_... | public String open () {
String fullPath = null;
fileNames = new String [0];
int /*long*/ method = 0;
int /*long*/ methodImpl = 0;
Callback callback = null;
if ((style & SWT.SAVE) != 0) {
NSSavePanel savePanel = NSSavePanel.savePanel();
panel = savePanel;
if (!overwrite) {
callback = new Callback(this, "_... |
private static Map _expressionParsers = new HashMap();
static {
// Load and cache all the query languages available in the system.
Class[] classes = Services.getImplementorClasses(
ExpressionParser.class, QueryLanguages.class.getClassLoader());
for (int i = 0; i < classes.len... | private static Map _expressionParsers = new HashMap();
static {
// Load and cache all the query languages available in the system.
Class[] classes = Services.getImplementorClasses(
ExpressionParser.class, ExpressionParser.class.getClassLoader());
for (int i = 0; i < classes.l... |
public void addSelectionListener(SelectionListener listener) {
checkWidget ();
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener(listener);
addListener(SWT.Selection,typedListener);
addListener(SWT.DefaultSelection,typedListener);
}
int callWindowProc (int msg,... | public void addSelectionListener(SelectionListener listener) {
checkWidget ();
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener(listener);
addListener(SWT.Selection,typedListener);
addListener(SWT.DefaultSelection,typedListener);
}
int callWindowProc (int msg,... |
private void failIncorrectLicenceHeaders(List<File> files)
{
if (files.size() > 0)
{
StringBuffer failString = new StringBuffer();
failString.append("The following files didn't have a correct license header:\n");
for (File file : files)
{
failString.append(file.getAbsolutePath()).append(LINE_END... | private void failIncorrectLicenceHeaders(List<File> files)
{
if (files.size() > 0)
{
StringBuffer failString = new StringBuffer();
failString.append("The following files("+files.size()+") didn't have a correct license header:\n");
for (File file : files)
{
failString.append(file.getAbsolutePath(... |
public Cursor(Device device, int style) {
super(device);
switch (style) {
case SWT.CURSOR_HAND: handle = NSCursor.pointingHandCursor(); break;
case SWT.CURSOR_ARROW: handle = NSCursor.arrowCursor(); break;
case SWT.CURSOR_WAIT: handle = NSCursor.crosshairCursor(); break;
case SWT.CURSOR_CROSS: han... | public Cursor(Device device, int style) {
super(device);
switch (style) {
case SWT.CURSOR_HAND: handle = NSCursor.pointingHandCursor(); break;
case SWT.CURSOR_ARROW: handle = NSCursor.arrowCursor(); break;
case SWT.CURSOR_WAIT: handle = NSCursor.arrowCursor(); break;
case SWT.CURSOR_CROSS: handle ... |
public SampleResult sample(Entry e) {
SampleResult res = new SampleResult();
boolean isOK = false; // Did sample succeed?
res.setSampleLabel(getName());
/*
* Perform the sampling
*/
res.sampleStart(); // Start timing
try {
// Create empty properties
Properties props = new Properties();
// ... | public SampleResult sample(Entry e) {
SampleResult res = new SampleResult();
boolean isOK = false; // Did sample succeed?
res.setSampleLabel(getName());
/*
* Perform the sampling
*/
res.sampleStart(); // Start timing
try {
// Create empty properties
Properties props = new Properties();
// ... |
private WebApplication createApplication(ApplicationContext ac, String beanName)
{
if (beanName != null)
{
WebApplication application = (WebApplication)ac.getBean(beanName);
if (application == null)
{
throw new IllegalArgumentException(
"Unable to find WebApplication bean with name [" + beanNam... | private WebApplication createApplication(ApplicationContext ac, String beanName)
{
if (beanName != null)
{
WebApplication application = (WebApplication)ac.getBean(beanName);
if (application == null)
{
throw new IllegalArgumentException(
"Unable to find WebApplication bean with name [" + beanNam... |
private final String getBeanNameOfClass(ApplicationContext ctx, Class< ? > clazz)
{
// get the list of all possible matching beans
List<String> names = new ArrayList<String>(Arrays.asList(BeanFactoryUtils
.beanNamesForTypeIncludingAncestors(ctx, clazz)));
// filter out beans that are not candidates for aut... | private final String getBeanNameOfClass(ApplicationContext ctx, Class< ? > clazz)
{
// get the list of all possible matching beans
List<String> names = new ArrayList<String>(Arrays.asList(BeanFactoryUtils
.beanNamesForTypeIncludingAncestors(ctx, clazz)));
// filter out beans that are not candidates for aut... |
public boolean execute() throws BuildException {
attributes.log("Using jikes compiler", Project.MSG_VERBOSE);
Path classpath = new Path(project);
// Jikes doesn't support bootclasspath dir (-bootclasspath)
// so we'll emulate it for compatibility and convenience.
if (bootcl... | public boolean execute() throws BuildException {
attributes.log("Using jikes compiler", Project.MSG_VERBOSE);
Path classpath = new Path(project);
// Jikes doesn't support bootclasspath dir (-bootclasspath)
// so we'll emulate it for compatibility and convenience.
if (bootcl... |
public boolean execute() throws BuildException {
attributes.log("Using jvc compiler", Project.MSG_VERBOSE);
Path classpath = new Path(project);
// jvc doesn't support bootclasspath dir (-bootclasspath)
// so we'll emulate it for compatibility and convenience.
if (bootclassp... | public boolean execute() throws BuildException {
attributes.log("Using jvc compiler", Project.MSG_VERBOSE);
Path classpath = new Path(project);
// jvc doesn't support bootclasspath dir (-bootclasspath)
// so we'll emulate it for compatibility and convenience.
if (bootclassp... |
public void setToolTipText (String string) {
checkWidget();
super.setToolTipText (string);
toolTipText = string;
}
void traversal(Event event) {
switch (event.detail) {
case SWT.TRAVERSE_ESCAPE:
case SWT.TRAVERSE_RETURN:
case SWT.TRAVERSE_TAB_NEXT:
case SWT.TRAVERSE_TAB_PREVIOUS:
event.doit = true;
br... | public void setToolTipText (String string) {
checkWidget();
super.setToolTipText (string);
toolTipText = string;
}
void traversal(Event event) {
switch (event.detail) {
case SWT.TRAVERSE_ESCAPE:
case SWT.TRAVERSE_RETURN:
case SWT.TRAVERSE_TAB_NEXT:
case SWT.TRAVERSE_TAB_PREVIOUS:
event.doit = true;
br... |
public Page convertToPage(Object page)
{
if (page instanceof Page)
{
return (Page)page;
}
else if (page instanceof SerializedPageWithSession)
{
SerializedPageWithSession serialized = (SerializedPageWithSession)page;
if (serialized.page == null ||
serialized.page.get() != SerializedPageWithSess... | public Page convertToPage(Object page)
{
if (page instanceof Page)
{
return (Page)page;
}
else if (page instanceof SerializedPageWithSession)
{
SerializedPageWithSession serialized = (SerializedPageWithSession)page;
if (serialized.page == null ||
serialized.page.get() != SerializedPageWithSess... |
private void buildWebsphereJar(File sourceJar, File destJar) {
try {
if (ejbdeploy) {
Java javaTask = (Java) getTask().getProject().createTask("java");
// Set the JvmArgs
javaTask.createJvmarg().setValue("-Xms64m");
javaTask.createJ... | private void buildWebsphereJar(File sourceJar, File destJar) {
try {
if (ejbdeploy) {
Java javaTask = new Java(getTask());
// Set the JvmArgs
javaTask.createJvmarg().setValue("-Xms64m");
javaTask.createJvmarg().setValue("-Xmx128m");... |
public DatatypeValidator createDatatypeValidator(String typeName,
DatatypeValidator base, Hashtable facets, boolean list );
}
| public DatatypeValidator createDatatypeValidator(String typeName,
DatatypeValidator base, Hashtable facets, boolean list ) throws InvalidDatatypeFacetException;
}
|
public void postCreationCallback() {
if (_conf.isInitializeEagerly()) {
newBroker(_conf.getConnectionUserName(), _conf.getConnectionPassword(),
_conf.isConnectionFactoryModeManaged(), _conf.getConnectionRetainModeConstant(), false).close();
}
// Don't catch any ex... | public void postCreationCallback() {
if (_conf.isInitializeEagerly()) {
newBroker(_conf.getConnectionUserName(), _conf.getConnectionPassword(),
_conf.isConnectionFactoryModeManaged(), _conf.getConnectionRetainModeConstant(), false).close();
}
// Don't catch any ex... |
private void registerService(String serviceType1, String serviceName1, String updateSiteName1, String servicePath1) throws Exception {
try {
serviceInfo = new ServiceInfo(null, getServicePort(), ServiceIDFactory.getDefault().createServiceID(discovery.getServicesNamespace(), serviceType1, serviceName1), new Servic... | private void registerService(String serviceType1, String serviceName1, String updateSiteName1, String servicePath1) throws Exception {
try {
serviceInfo = new ServiceInfo(UPDATE_SITE_SERVICE_TYPE, null, getServicePort(), ServiceIDFactory.getDefault().createServiceID(discovery.getServicesNamespace(), serviceType1,... |
protected void doSiteCommand(FTPClient ftp, String theCMD)
throws IOException, BuildException {
boolean rc;
String[] myReply = null;
log("Doing Site Command: " + theCMD, Project.MSG_VERBOSE);
rc = ftp.sendSiteCommand(theCMD);
if (!rc) {
log("Failed to i... | protected void doSiteCommand(FTPClient ftp, String theCMD)
throws IOException, BuildException {
boolean rc;
String[] myReply = null;
log("Doing Site Command: " + theCMD, Project.MSG_VERBOSE);
rc = ftp.sendSiteCommand(theCMD);
if (!rc) {
log("Failed to i... |
protected void matched(String content, DatatypeValidator val, boolean isNil) throws Exception {
super.matched(content, val, isNil);
if(isNil) {
fStore.reportNilError(fIdentityConstraint);
}
fStore.addValue(Field.this, new IDValue(content, val));
... | protected void matched(String content, DatatypeValidator val, boolean isNil) {
super.matched(content, val, isNil);
if(isNil) {
fStore.reportNilError(fIdentityConstraint);
}
fStore.addValue(Field.this, new IDValue(content, val));
// once... |
public void onTestFailure(TestRunEvent evt) {
String type = evt == evt.getType() == TestRunEvent.TEST_FAILURE ? FAILURE : ERROR;
Element nested = doc.createElement(type);
Element currentTest = (Element) testElements.get(evt.getName());
currentTest.appendChild(nested);
String... | public void onTestFailure(TestRunEvent evt) {
String type = evt.getType() == TestRunEvent.TEST_FAILURE ? FAILURE : ERROR;
Element nested = doc.createElement(type);
Element currentTest = (Element) testElements.get(evt.getName());
currentTest.appendChild(nested);
String[] args... |
public boolean isEqualNode(Node arg) {
if (!super.isEqualNode(arg)) {
return false;
}
// there are many ways to do this test, and there isn't any way
// better than another. Performance may vary greatly depending on
// the implementations involved. This one should... | public boolean isEqualNode(Node arg) {
if (!super.isEqualNode(arg)) {
return false;
}
// there are many ways to do this test, and there isn't any way
// better than another. Performance may vary greatly depending on
// the implementations involved. This one should... |
public OleControlSite(Composite parent, int style, String progId) {
super(parent, style);
try {
// check for licensing
appClsid = getClassID(progId);
if (appClsid == null) OLE.error(OLE.ERROR_INVALID_CLASSID);
int /*long*/ licinfo = getLicenseInfo(appClsid);
if (licinfo == 0) {
// Open a storage ... | public OleControlSite(Composite parent, int style, String progId) {
super(parent, style);
try {
// check for licensing
appClsid = getClassID(progId);
if (appClsid == null) OLE.error(OLE.ERROR_INVALID_CLASSID);
int /*long*/ licinfo = getLicenseInfo(appClsid);
if (licinfo == 0) {
// Open a storage ... |
public static void initializeClass(Class theClass) {
// ***HACK*** We ask the VM to create an instance
// by voluntarily providing illegal arguments to force
// the VM to run the class' static initializer, while
// at the same time not running a valid constructor.
final Cons... | public static void initializeClass(Class theClass) {
// ***HACK*** We ask the VM to create an instance
// by voluntarily providing illegal arguments to force
// the VM to run the class' static initializer, while
// at the same time not running a valid constructor.
final Cons... |
protected final void renderComponentTag(ComponentTag tag)
{
final ApplicationSettings settings = getApplication().getSettings();
if (!(tag instanceof ComponentWicketTag) || !settings.getStripWicketTag())
{
// Apply attribute modifiers
if ((attributeModifiers != null) && (tag.getType() != XmlTag.CLOS... | protected final void renderComponentTag(ComponentTag tag)
{
final ApplicationSettings settings = getApplication().getSettings();
if (!(tag instanceof ComponentWicketTag) || !settings.getStripWicketTags())
{
// Apply attribute modifiers
if ((attributeModifiers != null) && (tag.getType() != XmlTag.CLO... |
public void configure(ApplicationSettings settings)
{
this.componentNameAttribute = settings.getComponentNameAttribute();
this.stripWicketTag = settings.getStripWicketTag();
this.stripComments = settings.getStripComments();
this.compressWhitespace = settings.getCompressWhitespace();
... | public void configure(ApplicationSettings settings)
{
this.componentNameAttribute = settings.getComponentNameAttribute();
this.stripWicketTag = settings.getStripWicketTags();
this.stripComments = settings.getStripComments();
this.compressWhitespace = settings.getCompressWhitespace();
... |
public double getValue(SamplingStatCalculator stat) {
if (this.getXAxis().equals(AbstractTable.REPORT_TABLE_50_PERCENT)) {
return stat.getPercentPoint(.50).doubleValue();
} else if (this.getXAxis().equals(AbstractTable.REPORT_TABLE_90_PERCENT)){
return stat.getPercentPoint(.9... | public double getValue(SamplingStatCalculator stat) {
if (this.getXAxis().equals(AbstractTable.REPORT_TABLE_50_PERCENT)) {
return stat.getPercentPoint(.50).doubleValue();
} else if (this.getXAxis().equals(AbstractTable.REPORT_TABLE_90_PERCENT)){
return stat.getPercentPoint(.9... |
public String getText () {
checkWidget ();
return new String (getText (0, -1));
}
char [] getText (int start, int end) {
int result;
int [] ptr = new int [1];
if ((style & SWT.READ_ONLY) != 0) {
int index = OS.GetControlValue (handle) - 1;
result = OS.CopyMenuItemTextAsCFString (menuHandle, (short)(index+1),... | public String getText () {
checkWidget ();
return new String (getText (0, -1));
}
char [] getText (int start, int end) {
int result;
int [] ptr = new int [1];
if ((style & SWT.READ_ONLY) != 0) {
int index = OS.GetControlValue (handle) - 1;
result = OS.CopyMenuItemTextAsCFString (menuHandle, (short)(index+1),... |
private static void checkVersion(Class clazz, String expected) {
String actual = "*NONE*"; // $NON-NLS-1$
try {
actual = (String) clazz.getMethod("getVersion", null).invoke(null, null);
actual = extractVersion(actual);
} catch (Exception ignored) {
// Not needed
}
if (0 != actual.compareTo(expected... | private static void checkVersion(Class clazz, String expected) {
String actual = "*NONE*"; // $NON-NLS-1$
try {
actual = (String) clazz.getMethod("getVersion", null).invoke(null, null);
actual = extractVersion(actual);
} catch (Exception ignored) {
// Not needed
}
if (0 != actual.compareTo(expected... |
public String getStringValue()
{
return Boolean.toString(value);
}
| public String getStringValue()
{
return value ? "true" : "false";
}
|
public void setAttribute(Request request, String name, Object value)
{
// Do some extra profiling/ debugging. This can be a great help
// just for testing whether your webbapp will behave when using
// session replication
if (log.isDebugEnabled())
{
String valueTypeName = (value != null ? value.getClass(... | public void setAttribute(Request request, String name, Object value)
{
// Do some extra profiling/ debugging. This can be a great help
// just for testing whether your webbapp will behave when using
// session replication
if (Application.get().getDebugSettings().getSerializeSessionAttributes())
{
String ... |
public final void setModelValue(final String value)
{
Collection selectedValues = (Collection)getModelObject();
if (selectedValues == null)
{
selectedValues = new ArrayList();
setModelObject(selectedValues);
}
else
{
selectedValues.clear();
}
final IChoiceList choices = getChoices();
for (f... | public final void setModelValue(final String value)
{
Collection selectedValues = (Collection)getModelObject();
if (selectedValues == null)
{
selectedValues = new ArrayList();
setModelObject(selectedValues);
}
else
{
selectedValues.clear();
}
final IChoiceList choices = getChoices();
for (f... |
protected void onRenderHeadInitContribution(final Response response)
{
final IAjaxSettings settings = Application.get().getAjaxSettings();
writeJsReference(response, JAVASCRIPT);
if (settings.isAjaxDebugModeEnabled())
{
JavascriptUtils.writeJavascript(response, "wicketAjaxDebugEnable=true;");
writeJsR... | protected void onRenderHeadInitContribution(final Response response)
{
final IAjaxSettings settings = Application.get().getAjaxSettings();
writeJsReference(response, JAVASCRIPT);
if (settings.isAjaxDebugModeEnabled())
{
JavascriptUtils.writeJavascript(response, "wicketAjaxDebugEnable=true;", "wicket-ajax... |
private static final String protoPrefix = "org.apache.jmeter.protocol.tcp.sampler."; //$NON-NLS-1$
private Class getClass(String className) {
Class<?> c = null;
try {
c = Class.forName(className, false, Thread.currentThread().getContextClassLoader());
} catch (ClassNotFoundE... | private static final String protoPrefix = "org.apache.jmeter.protocol.tcp.sampler."; //$NON-NLS-1$
private Class<?> getClass(String className) {
Class<?> c = null;
try {
c = Class.forName(className, false, Thread.currentThread().getContextClassLoader());
} catch (ClassNotFou... |
public void testShareMode(){
JMeterContext jmcx = JMeterContextService.getContext();
jmcx.setVariables(new JMeterVariables());
JMeterVariables threadVars = jmcx.getVariables();
threadVars.put("b", "value");
CSVDataSetBeanInfo cbi = new CSVDataSetBeanInfo(); // needs ... | public void testShareMode(){
JMeterContext jmcx = JMeterContextService.getContext();
jmcx.setVariables(new JMeterVariables());
JMeterVariables threadVars = jmcx.getVariables();
threadVars.put("b", "value");
new CSVDataSetBeanInfo(); // needs to be initialised
... |
public void testFunction() throws Exception {
JMeterContext jmctx = JMeterContextService.getContext();
Map variables = new HashMap();
ReplaceStringWithFunctions transformer = new ReplaceStringWithFunctions(new CompoundVariable(), variables);
jmctx.setVariables(new... | public void testFunction() throws Exception {
JMeterContext jmctx = JMeterContextService.getContext();
Map<?, ?> variables = new HashMap<Object, Object>();
ReplaceStringWithFunctions transformer = new ReplaceStringWithFunctions(new CompoundVariable(), variables);
... |
public void testSetHTTPFileArgs() throws Exception {
List newHTTPFileArgs = new LinkedList();
newHTTPFileArgs.add(new HTTPFileArg("hede"));
HTTPFileArgs files = new HTTPFileArgs();
files.setHTTPFileArgs(newHTTPFileArgs);
assertEquals(1, files.getHTTPFileArgCount());
a... | public void testSetHTTPFileArgs() throws Exception {
List<HTTPFileArg> newHTTPFileArgs = new LinkedList<HTTPFileArg>();
newHTTPFileArgs.add(new HTTPFileArg("hede"));
HTTPFileArgs files = new HTTPFileArgs();
files.setHTTPFileArgs(newHTTPFileArgs);
assertEquals(1, files.getHTTP... |
public void testAdd1() throws Exception {
Logger log = LoggingManager.getLoggerForClass();
Collection treePath = Arrays.asList(new String[] { "1", "2", "3", "4" });
HashTree tree = new HashTree();
log.debug("treePath = " + treePath);
tree.add(treePath,... | public void testAdd1() throws Exception {
Logger log = LoggingManager.getLoggerForClass();
Collection<String> treePath = Arrays.asList(new String[] { "1", "2", "3", "4" });
HashTree tree = new HashTree();
log.debug("treePath = " + treePath);
tree.add(t... |
public void handleEvent(IContainerEvent event) {
Activator activator = Activator.getDefault();
if (activator == null)
return;
final IContainerManager containerManager = activator.getContainerManager();
if (containerManager == null)
return;
IContainer container = containerManager.getContainer(ev... | public void handleEvent(IContainerEvent event) {
Activator activator = Activator.getDefault();
if (activator == null)
return;
final IContainerManager containerManager = activator.getContainerManager();
if (containerManager == null)
return;
IContainer container = containerManager.getContainer(ev... |
public boolean killedProcess() {
return timedOut;
}
} | public synchronized boolean killedProcess() {
return timedOut;
}
} |
protected File getSpecFile() {
return new File("../tests/src/org/aspectj/systemtest/ajc150/ataspectj/atajc150.xml");
}
| protected File getSpecFile() {
return new File("../tests/src/org/aspectj/systemtest/ajc150/ataspectj/annotationgen.xml");
}
|
public void performCompilation(List files) {
if (progressListener != null) {
compiledCount = 0;
sourceFileCount = files.size();
progressListener.setText("compiling source files");
}
//System.err.println("got files: " + files);
String[] filenames = new String[files.size()];
String[] encodings = new S... | public void performCompilation(List files) {
if (progressListener != null) {
compiledCount = 0;
sourceFileCount = files.size();
progressListener.setText("compiling source files");
}
//System.err.println("got files: " + files);
String[] filenames = new String[files.size()];
String[] encodings = new S... |
public Canvas (Composite parent, int style) {
super (parent, style);
}
| public Canvas (Composite parent, int style) {
super (parent, checkStyle (style));
}
|
public ExpandBar getParent () {
checkWidget();
if (parent == null) error (SWT.ERROR_WIDGET_DISPOSED);
return parent;
}
int /*long*/ gtk_activate (int /*long*/ widget) {
Event event = new Event ();
event.item = this;
int type = OS.gtk_expander_get_expanded (handle) ? SWT.Expand :SWT.Collapse;
parent.sendEvent (t... | public ExpandBar getParent () {
checkWidget();
if (parent == null) error (SWT.ERROR_WIDGET_DISPOSED);
return parent;
}
int /*long*/ gtk_activate (int /*long*/ widget) {
Event event = new Event ();
event.item = this;
int type = OS.gtk_expander_get_expanded (handle) ? SWT.Collapse : SWT.Expand;
parent.sendEvent (... |
private void cat(ResourceCollection c) {
OutputStream os = null;
char[] buffer = new char[BUFFER_SIZE];
try {
PrintWriter writer = null;
if (outputWriter != null) {
writer = new PrintWriter(outputWriter);
} else {
if (dest... | private void cat(ResourceCollection c) {
OutputStream os = null;
char[] buffer = new char[BUFFER_SIZE];
try {
PrintWriter writer = null;
if (outputWriter != null) {
writer = new PrintWriter(outputWriter);
} else {
if (dest... |
public void setText (String string) {
checkWidget ();
if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
if ((style & SWT.ARROW) != 0) return;
text = string;
/* This code is intentionally commented */
// if (OS.COMCTL32_MAJOR < 6) {
// if (text.length () == 0 && image != null) {
// _setImage (image);
// ret... | public void setText (String string) {
checkWidget ();
if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
if ((style & SWT.ARROW) != 0) return;
text = string;
/* This code is intentionally commented */
// if (OS.COMCTL32_MAJOR < 6) {
// if (text.length () == 0 && image != null) {
// _setImage (image);
// ret... |
public void setSpacing (int spacing) {
checkWidget ();
if (spacing < 0) return;
if (spacing == this.spacing) return;
this.spacing = spacing;
RECT rect = new RECT ();
OS.GetClientRect (handle, rect);
int width = Math.max (0, (rect.right - rect.left) - spacing * 2);
for (int i = 0; i < itemCount; i++) {
Expan... | public void setSpacing (int spacing) {
checkWidget ();
if (spacing < 0) return;
if (spacing == this.spacing) return;
this.spacing = spacing;
RECT rect = new RECT ();
OS.GetClientRect (handle, rect);
int width = Math.max (0, (rect.right - rect.left) - spacing * 2);
for (int i = 0; i < itemCount; i++) {
Expan... |
public static void convertSubTree(HashTree tree) {
Iterator<?> iter = new LinkedList(tree.list()).iterator();
while (iter.hasNext()) {
Object o = iter.next();
if (o instanceof TestElement) {
TestElement item = (TestElement) o;
if (item.isEnable... | public static void convertSubTree(HashTree tree) {
Iterator<Object> iter = new LinkedList<Object>(tree.list()).iterator();
while (iter.hasNext()) {
Object o = iter.next();
if (o instanceof TestElement) {
TestElement item = (TestElement) o;
if (... |
public void run() {
log.info("Running the test!");
running = true;
SearchByClass testPlan = new SearchByClass(TestPlan.class);
test.traverse(testPlan);
Object[] plan = testPlan.getSearchResults().toArray();
if (plan.length == 0) {
System.err.println("Coul... | public void run() {
log.info("Running the test!");
running = true;
SearchByClass testPlan = new SearchByClass(TestPlan.class);
test.traverse(testPlan);
Object[] plan = testPlan.getSearchResults().toArray();
if (plan.length == 0) {
System.err.println("Coul... |
public CompoundVariable getFunction() {
CompoundVariable func = new CompoundVariable();
func.compiledComponents = (LinkedList) compiledComponents.clone();
func.rawParameters = rawParameters;
return func;
}
| public CompoundVariable getFunction() {
CompoundVariable func = new CompoundVariable();
func.compiledComponents = (LinkedList<Object>) compiledComponents.clone();
func.rawParameters = rawParameters;
return func;
}
|
private static void cloneChildren(JMeterTreeNode to, JMeterTreeNode from) {
Enumeration enumFrom = from.children();
while (enumFrom.hasMoreElements()) {
JMeterTreeNode child = (JMeterTreeNode) enumFrom.nextElement();
JMeterTreeNode childClone = (JMeterTreeNode) child.clone();... | private static void cloneChildren(JMeterTreeNode to, JMeterTreeNode from) {
Enumeration<?> enumFrom = from.children();
while (enumFrom.hasMoreElements()) {
JMeterTreeNode child = (JMeterTreeNode) enumFrom.nextElement();
JMeterTreeNode childClone = (JMeterTreeNode) child.clone... |
protected void dumpStack(String msg, Throwable e) {
if (Trace.ON && debug != null) {
debug.dumpStack(e, msg + ":" + container.getID());
}
}
ID[] getSharedObjectIDs() {
return getActiveKeys();
}
synchronized boolean addMember(Member m) {
debug("addMember(... | protected void dumpStack(String msg, Throwable e) {
if (Trace.ON && debug != null) {
debug.dumpStack(e, msg + ":" + container.getID());
}
}
ID[] getSharedObjectIDs() {
return getActiveKeys();
}
synchronized boolean addMember(Member m) {
debug("addMember(... |
public void testTaskCase() {
expectBuildExceptionContaining("taskcase",
"Task names are case sensitive",
"Could not create task or type of type: ecHO");
}
| public void testTaskCase() {
expectBuildExceptionContaining("taskcase",
"Task names are case sensitive",
"Problem: failed to create task or type ecHO");
}
|
private final MarkupContainer container;
Remove(final Component component)
{
this.component = component;
this.container = component.getParent();
}
void undo()
{
container.add(component);
}
| private final MarkupContainer container;
Remove(final Component component)
{
this.component = component;
this.container = component.getParent();
}
void undo()
{
container.internalAdd(component);
}
|
private static final String CONTAINER_FACTORY_EPOINT = ECFNAMESPACE
+ CONTAINER_FACTORY_NAME;
| private static final String CONTAINER_FACTORY_EPOINT = ECFNAMESPACE
+ "." + CONTAINER_FACTORY_NAME;
|
public void connect() throws IOException {
// open the event port and start listening for events
fEventThread = new Thread(fEventListener, "Sausalito Debugging Engine: Event Listener");
fEventThread.setDaemon(true);
fEventThread.start();
// make sure the listening port is li... | public void connect() throws IOException {
// open the event port and start listening for events
fEventThread = new Thread(fEventListener, "Sausalito Debugging Engine: Event Listener");
fEventThread.setDaemon(true);
fEventThread.start();
// make sure the listening port is li... |
String ROLE = Configurer.class.getName();
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.... | String ROLE = Configurer.class.getName();
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.