buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public RemoteServiceEndpointDescriptionImpl(IServiceInfo serviceInfo) {
super(((ServiceProperties) serviceInfo.getServiceProperties())
.asProperties());
this.serviceId = serviceInfo.getServiceID();
// create the endpoint id
IServiceProperties serviceProperties = serviceInfo
.getServiceProperties();
... | public RemoteServiceEndpointDescriptionImpl(IServiceInfo serviceInfo) {
super(((ServiceProperties) serviceInfo.getServiceProperties())
.asProperties());
this.serviceId = serviceInfo.getServiceID();
// create the endpoint id
IServiceProperties serviceProperties = serviceInfo
.getServiceProperties();
... |
package wicket.extensions.markup.html.repeater.refreshing;
/*
* $Id$
* $Revision$
* $Date$
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obta... | package wicket.extensions.markup.html.repeater.refreshing;
/*
* $Id$
* $Revision$
* $Date$
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obta... |
public String getDataEncodingWithDefault() {
if (getDataEncodingNoDefault() == null && getContentType().startsWith("text/html")){ // $NON-NLS-1$
byte[] bytes=getResponseData();
// get the start of the file
// TODO - charset?
String prefix = new String(bytes,0,... | public String getDataEncodingWithDefault() {
if (getDataEncodingNoDefault() == null && getContentType().startsWith("text/html")){ // $NON-NLS-1$
byte[] bytes=getResponseData();
// get the start of the file
// TODO - charset?
String prefix = new String(bytes,0,... |
private static void load(String file, GenericHttpParams params){
log.info("Reading httpclient parameters from "+file);
File f = new File(file);
InputStream is = null;
Properties props = new Properties();
try {
is = new FileInputStream(f);
props.load(is... | private static void load(String file, GenericHttpParams params){
log.info("Reading httpclient parameters from "+file);
File f = new File(file);
InputStream is = null;
Properties props = new Properties();
try {
is = new FileInputStream(f);
props.load(is... |
public boolean munge(BcelClassWeaver weaver) {
boolean changed = false;
boolean worthReporting = true;
if (munger.getKind() == ResolvedTypeMunger.Field) {
changed = mungeNewField(weaver, (NewFieldTypeMunger)munger);
} else if (munger.getKind() == ResolvedTypeMunger.Method) {
changed = mungeNewMethod(w... | public boolean munge(BcelClassWeaver weaver) {
boolean changed = false;
boolean worthReporting = true;
if (munger.getKind() == ResolvedTypeMunger.Field) {
changed = mungeNewField(weaver, (NewFieldTypeMunger)munger);
} else if (munger.getKind() == ResolvedTypeMunger.Method) {
changed = mungeNewMethod(w... |
public Node renameNode(Node n,String namespaceURI,String name)
throws DOMException{
if (n.getOwnerDocument() != this) {
String msg = DOMMessageFormatter.formatMessage(
DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
throw new DOMException(DOMException.WR... | public Node renameNode(Node n,String namespaceURI,String name)
throws DOMException{
if (n.getOwnerDocument() != this && n != this) {
String msg = DOMMessageFormatter.formatMessage(
DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
throw new DOMException(DO... |
public Node insertBefore(Node newChild, Node refChild)
throws DOMException {
// Tail-call; optimizer should be able to do good things with.
return internalInsertBefore(newChild, refChild, false);
} // insertBefore(Node,Node):Node
/** NON-DOM INTERNAL: Within DOM actions,we som... | public Node insertBefore(Node newChild, Node refChild)
throws DOMException {
// Tail-call; optimizer should be able to do good things with.
return internalInsertBefore(newChild, refChild, false);
} // insertBefore(Node,Node):Node
/** NON-DOM INTERNAL: Within DOM actions,we som... |
private void renderFragment(final MarkupStream providerMarkupStream, final ComponentTag openTag)
{
// remember the current position in the markup. Will have to come back
// to it.
int currentIndex = providerMarkupStream.getCurrentIndex();
// Find the markup fragment
int index = providerMarkupStream.findCom... | private void renderFragment(final MarkupStream providerMarkupStream, final ComponentTag openTag)
{
// remember the current position in the markup. Will have to come back
// to it.
int currentIndex = providerMarkupStream.getCurrentIndex();
// Find the markup fragment
int index = providerMarkupStream.findCom... |
public static final Object CONTENTS[][] = {
// Internal message formatter messages
{ "BadMajorCode", "The majorCode parameter to createMessage was out of bounds." },
{ "FormatFailed", "An internal error occurred while formatting the following message:\n " },
{ "NoValidatorFor", "No validato... | public static final Object CONTENTS[][] = {
// Internal message formatter messages
{ "BadMajorCode", "The majorCode parameter to createMessage was out of bounds." },
{ "FormatFailed", "An internal error occurred while formatting the following message:\n " },
{ "NoValidatorFor", "No validato... |
public static final String[] fgMessageKeys = {
"BadMajorCode", // 0, "The majorCode parameter to createMessage was out of bounds."
"FormatFailed", // 1, "An internal error occurred while formatting the following message:"
"NoValidatorFor", //... | public static final String[] fgMessageKeys = {
"BadMajorCode", // 0, "The majorCode parameter to createMessage was out of bounds."
"FormatFailed", // 1, "An internal error occurred while formatting the following message:"
"NoValidatorFor", //... |
public void testAdd1() throws Exception
{
ActionPermissions permissions = new ActionPermissions();
Action mambo = new Action("mambo");
permissions.authorize(mambo, "jonathan");
permissions.authorize(mambo, "johan");
permissions.authorize(mambo, "maurice");
permissions.authorize(mambo, "eelco");
assertEq... | public void testAdd1() throws Exception
{
ActionPermissions permissions = new ActionPermissions();
Action mambo = new Action("mambo");
permissions.authorize(mambo, "jonathan");
permissions.authorize(mambo, "johan");
permissions.authorize(mambo, "maurice");
permissions.authorize(mambo, "eelco");
assertEq... |
public double getRange()
{
return (double) 0;
}
| public double getRange()
{
return 0;
}
|
public static void main (String[] args) {
new C().get();
throw new Error("expected compiler error");
}
}
class C {
Object get() {return null;}
}
privileged aspect A {
Observable observable = new Observable();
after() returning (Object o ) :
execution(Object C.get()) {
... | public static void main (String[] args) {
new C().get();
throw new Error("expected compiler error");
}
}
class C {
Object get() {return null;}
}
privileged aspect A {
Observable observable = new Observable();
after() returning (Object o ) :
execution(Object C.get()) {
... |
public void renderHead(final IHeaderResponse response)
{
super.renderHead(response);
response.renderJavaScriptReference(WicketEventReference.INSTANCE);
response.renderJavaScriptReference(WicketAjaxReference.INSTANCE);
response.renderJavaScriptReference(JS);
ResourceReference css = getCss();
if (css != nul... | public void renderHead(final IHeaderResponse response)
{
super.renderHead(response);
response.renderJavaScriptReference(WicketEventReference.INSTANCE);
response.renderJavaScriptReference(WicketAjaxReference.INSTANCE);
response.renderJavaScriptReference(JS);
ResourceReference css = getCss();
if (css != nul... |
private static final String SUGGESTED_EXCLUSIONS =
JMeterUtils.getPropDefault("proxy.excludes.suggested", ".*\\.js;.*\\.css;.*\\.swf;.*\\.gif;.*\\.png;.*\\.jpg;.*\\.jpeg;.*\\.bmp;.*\\.ico;.*\\.woff"); // $NON-NLS-1$
| private static final String SUGGESTED_EXCLUSIONS =
JMeterUtils.getPropDefault("proxy.excludes.suggested", ".*\\.(bmp|css|js|gif|ico|jpe?g|png|swf|woff)"); // $NON-NLS-1$
|
public void onEndRequest(Request request)
{
pages.set(null);
}
| public void onEndRequest(Request request)
{
pages.remove();
}
|
public boolean isEnabled () {
checkWidget();
return getEnabled () && parent.isEnabled ();
}
boolean isEnabledCursor () {
return isEnabled ();
}
boolean isEnabledModal () {
//NOT DONE - fails for multiple APP MODAL shells
Shell [] shells = display.getShells ();
for (int i = 0; i < shells.length; i++) {
Shell m... | public boolean isEnabled () {
checkWidget();
return getEnabled () && parent.isEnabled ();
}
boolean isEnabledCursor () {
return isEnabled ();
}
boolean isEnabledModal () {
//NOT DONE - fails for multiple APP MODAL shells
Shell [] shells = display.getShells ();
for (int i = 0; i < shells.length; i++) {
Shell m... |
public boolean isEnabled () {
checkWidget ();
return getEnabled () && parent.isEnabled ();
}
boolean isFocusAncestor (Control control) {
while (control != null && control != this) {
control = control.parent;
}
return control == this;
}
| public boolean isEnabled () {
checkWidget ();
return getEnabled () && parent.isEnabled ();
}
boolean isFocusAncestor (Control control) {
while (control != null && control != this && !(control instanceof Shell)) {
control = control.parent;
}
return control == this;
}
|
public boolean isEnabled () {
checkWidget();
return getEnabled () && parent.isEnabled ();
}
boolean isFocusAncestor (Control control) {
while (control != null && control != this) {
control = control.parent;
}
return control == this;
}
| public boolean isEnabled () {
checkWidget();
return getEnabled () && parent.isEnabled ();
}
boolean isFocusAncestor (Control control) {
while (control != null && control != this && !(control instanceof Shell)) {
control = control.parent;
}
return control == this;
}
|
public boolean isFocusControl () {
checkWidget ();
Control focusControl = display.focusControl;
if (focusControl != null && !focusControl.isDisposed ()) {
return this == focusControl;
}
return hasFocus ();
}
boolean isFocusAncestor (Control control) {
while (control != null && control != this) {
control = co... | public boolean isFocusControl () {
checkWidget ();
Control focusControl = display.focusControl;
if (focusControl != null && !focusControl.isDisposed ()) {
return this == focusControl;
}
return hasFocus ();
}
boolean isFocusAncestor (Control control) {
while (control != null && control != this && !(control inst... |
public void setUp() {
if (supportsSymlinks) {
configureProject("src/etc/testcases/taskdefs/optional/symlink.xml");
executeTarget("setup");
}
}
| public void setUp() {
if (supportsSymlinks) {
configureProject("src/etc/testcases/taskdefs/optional/unix/symlink.xml");
executeTarget("setup");
}
}
|
protected void setUp() throws Exception {
super.setUp();
inputFile = new File("test.txt");
outputFile = new URL("efs:file://c:/ECFtest.txt");
}
| protected void setUp() throws Exception {
super.setUp();
inputFile = new File("test.txt");
outputFile = File.createTempFile("ECFTest", "").toURL();
}
|
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 void testWordGenerator() throws Exception
{
WordGenerator wg = new WordGenerator();
int wordCount = wg.size();
Set words = new HashSet();
log.info("First iteration...");
for (int i = 0; i < wordCount; i++)
{
Word word = wg.next();
log.info("Word found: " + word);
Assert.assertFalse("Word s... | public void testWordGenerator() throws Exception
{
WordGenerator wg = new WordGenerator();
int wordCount = wg.size();
Set<Word> words = new HashSet<Word>();
log.info("First iteration...");
for (int i = 0; i < wordCount; i++)
{
Word word = wg.next();
log.info("Word found: " + word);
Assert.assertF... |
public void mouseMove(MouseEvent e) {
if (isDragging) {
gc.drawImage(image, 0, 0);
gc.setForeground(blackColor);
gc.drawRectangle(downX, downY, e.x - downX, e.y - downY);
gc.setForeground(whiteColor);
gc.drawRectangle(downX - 1, downY - 1, e.x - downX + 2, e.y - downY + 2);
}... | public void mouseMove(MouseEvent e) {
if (isDragging) {
gc.drawImage(image, 0, 0);
gc.setForeground(blackColor);
gc.drawRectangle(downX, downY, e.x - downX, e.y - downY);
gc.setForeground(whiteColor);
gc.drawRectangle(downX - 1, downY - 1, e.x - downX + 2, e.y - downY + 2);
}... |
public static final String PLUGIN_ID = "org.eclipse.ecf.provider.msn"; //$NON-NLS-1$
static final String NAMESPACE_ID = "ecf.msn.gokigenyou"; //$NON-NLS-1$
| public static final String PLUGIN_ID = "org.eclipse.ecf.provider.msn"; //$NON-NLS-1$
static final String NAMESPACE_ID = "ecf.msn.msnp"; //$NON-NLS-1$
|
protected final void onEvent(final AjaxRequestTarget target)
{
final FormComponent formComponent = getFormComponent();
formComponent.registerNewUserInput();
formComponent.validate();
if (formComponent.hasErrorMessage())
{
formComponent.invalid();
}
else
{
formComponent.valid();
formComponent.... | protected final void onEvent(final AjaxRequestTarget target)
{
final FormComponent formComponent = getFormComponent();
formComponent.inputChanged();
formComponent.validate();
if (formComponent.hasErrorMessage())
{
formComponent.invalid();
}
else
{
formComponent.valid();
formComponent.updateMo... |
private String adaptToPlatform(String s) {
String ret = s.replace(';',File.pathSeparatorChar);
ret = ret.replace(':',File.pathSeparatorChar);
return ret;
}
| private String adaptToPlatform(String s) {
String ret = s.replace(';',File.pathSeparatorChar);
//ret = ret.replace(':',File.pathSeparatorChar);
return ret;
}
|
if(current[0] != '$' && current[0] != ',' && current[0] != '\\')
/*
* Created on Jul 25, 2003
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package org.apache.jmeter.engine.util;
import java.io.IOException;
import java.io.StringReader;
imp... | if(current[0] != '$' && current[0] != ',' && current[0] != '\\')
/*
* Created on Jul 25, 2003
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package org.apache.jmeter.engine.util;
import java.io.IOException;
import java.io.StringReader;
imp... |
public static JFileChooser promptToSaveFile(String filename, String[] extensions) {
if (lastJFCDirectory == null) {
String start = System.getProperty("user.dir", "");
if (!start.equals("")) {
jfc = new JFileChooser(new File(start));
}
lastJFCDi... | public static JFileChooser promptToSaveFile(String filename, String[] extensions) {
if (lastJFCDirectory == null) {
String start = System.getProperty("user.dir", "");
if (!start.equals("")) {
jfc = new JFileChooser(new File(start));
}
lastJFCDi... |
protected void onClearSubmit(Button button) {
button.getForm().setModelObject(originalState);
}
| protected void onClearSubmit(Button button) {
button.getForm().setModelObject(Objects.clone(originalState));
}
|
private void runNonGui(String testFile, String logFile, boolean remoteStart, String remote_hosts_string) {
FileInputStream reader = null;
try {
File f = new File(testFile);
if (!f.exists() || !f.isFile()) {
println("Could not open " + testFile);
... | private void runNonGui(String testFile, String logFile, boolean remoteStart, String remote_hosts_string) {
FileInputStream reader = null;
try {
File f = new File(testFile);
if (!f.exists() || !f.isFile()) {
println("Could not open " + testFile);
... |
protected ID getHomeID() {
return getSharedObject().getHomeID();
}
| protected ID getHomeID() {
return getSharedObject().getPrimaryContainerID();
}
|
public String getText () {
checkWidget ();
return text;
}
int kEventAccessibleGetNamedAttribute (int nextHandler, int theEvent, int userData) {
int code = OS.CallNextEventHandler (nextHandler, theEvent);
int [] stringRef = new int [1];
OS.GetEventParameter (theEvent, OS.kEventParamAccessibleAttributeName, OS.type... | public String getText () {
checkWidget ();
return text;
}
int kEventAccessibleGetNamedAttribute (int nextHandler, int theEvent, int userData) {
int code = OS.CallNextEventHandler (nextHandler, theEvent);
int [] stringRef = new int [1];
OS.GetEventParameter (theEvent, OS.kEventParamAccessibleAttributeName, OS.type... |
public void disassembleTest(String name) throws IOException {
BcelWorld world = new BcelWorld("../weaver/bin");
world.setFastDelegateSupport(false);
world.addPath(WeaveTestCase.classDir);
LazyClassGen clazz = new LazyClassGen(BcelWorld.getBcelObjectType(world.resolve(name)));
... | public void disassembleTest(String name) throws IOException {
BcelWorld world = new BcelWorld("../weaver/bin");
// world.setFastDelegateSupport(false);
world.addPath(WeaveTestCase.classDir);
LazyClassGen clazz = new LazyClassGen(BcelWorld.getBcelObjectType(world.resolve(name)... |
public BcelWorld world = new BcelWorld();
{
world.addPath(classDir);
// Some of the tests in here rely on comparing output from dumping the delegates - if
// we are using ASM delegates we don't know the names of parameters (they are irrelevant...)
// and are missing from the dumpin... | public BcelWorld world = new BcelWorld();
{
world.addPath(classDir);
// Some of the tests in here rely on comparing output from dumping the delegates - if
// we are using ASM delegates we don't know the names of parameters (they are irrelevant...)
// and are missing from the dumpin... |
protected CharSequence getDefaultChoiceMarkup(final Object selected)
{
// Is null a valid selection value?
if (isNullValid())
{
// Null is valid, so look up the value for it
final String option = getDefaultChoiceText();
// The <option> tag buffer
final AppendingStringBuffer buffer = new AppendingSt... | protected CharSequence getDefaultChoiceMarkup(final Object selected)
{
// Is null a valid selection value?
if (isNullValid())
{
// Null is valid, so look up the value for it
final String option = getDefaultChoiceText();
// The <option> tag buffer
final AppendingStringBuffer buffer = new AppendingSt... |
public MarkupContainer(MarkupContainer parent, final String id, IModel<T> model)
{
super(parent, id, model);
}
/**
* Adds a child component to this container.
* <p>
* Be careful when overriding this method, if not implemented properly it
* may lead to a java component hierarchy which no longer matches th... | public MarkupContainer(MarkupContainer parent, final String id, IModel<T> model)
{
super(parent, id, model);
}
/**
* Adds a child component to this container.
* <p>
* Be careful when overriding this method, if not implemented properly it
* may lead to a java component hierarchy which no longer matches th... |
private static synchronized PrintWriter getFileWriter(String filename, SampleSaveConfiguration saveConfig)
throws IOException {
if (filename == null || filename.length() == 0) {
return null;
}
PrintWriter writer = (PrintWriter) files.get(filename);
boolean trimmed = true;
if (writer == null) {
if (... | private static synchronized PrintWriter getFileWriter(String filename, SampleSaveConfiguration saveConfig)
throws IOException {
if (filename == null || filename.length() == 0) {
return null;
}
PrintWriter writer = (PrintWriter) files.get(filename);
boolean trimmed = true;
if (writer == null) {
if (... |
protected String getIndentationString() {
return " ";
}
| protected String getIndentationString() {
return " ";
}
|
public WordGenerator()
{
try
{
final IResourceStream resource = new ResourceStreamLocator().locate(null,
"org/apache/wicket/examples/hangman/WordList", null, null, Locale.getDefault(),
".txt");
final String wordlist = Streams.readString(resource.getInputStream());
words = Arrays.asList(wordlist.s... | public WordGenerator()
{
try
{
final IResourceStream resource = new ResourceStreamLocator().locate(null,
"org/apache/wicket/examples/hangman/WordList", null, null, Locale.getDefault(),
".txt", false);
final String wordlist = Streams.readString(resource.getInputStream());
words = Arrays.asList(wor... |
public IResourceStream getMarkupResourceStream(final MarkupContainer container,
Class<?> containerClass)
{
// Get locator to search for the resource
final IResourceStreamLocator locator = Application.get()
.getResourceSettings()
.getResourceStreamLocator();
String style = container.getStyle();
String... | public IResourceStream getMarkupResourceStream(final MarkupContainer container,
Class<?> containerClass)
{
// Get locator to search for the resource
final IResourceStreamLocator locator = Application.get()
.getResourceSettings()
.getResourceStreamLocator();
String style = container.getStyle();
String... |
private MarkupStream findMarkupStream(final Component owner)
{
final String markupType = getMarkupType(owner);
// TODO we need to expose this functionality for any class not just for
// markupcontainers in markupcache so we don't have to replicate this
// logic here
// Get locator to search for the resour... | private MarkupStream findMarkupStream(final Component owner)
{
final String markupType = getMarkupType(owner);
// TODO we need to expose this functionality for any class not just for
// markupcontainers in markupcache so we don't have to replicate this
// logic here
// Get locator to search for the resour... |
public final String toString()
{
return key;
}
| public final String toString()
{
return "unique key:" + key;
}
|
public ResourceNameIterator(final String path, final String style, final String variation,
final Locale locale, final String extensions, boolean strict)
| private ExtensionResourceNameIterator extensionsIterator;
/**
* Construct.
*
* @param path
* The path of the resource. In case the parameter 'extensions' is null, the path
* will be checked and if a filename extension is present, it'll be used instead.
* @param style
* ... |
private MarkupResourceStream newMarkupResourceStream(final IResourceStreamLocator locator,
final Class c, final String style, final String variation, final Locale locale,
final String extension)
{
IResourceStream resource = locator.locate(c, c.getName().replace('.', '/'), style,
variation, locale, extension)... | private MarkupResourceStream newMarkupResourceStream(final IResourceStreamLocator locator,
final Class c, final String style, final String variation, final Locale locale,
final String extension)
{
IResourceStream resource = locator.locate(c, c.getName().replace('.', '/'), style,
variation, locale, extension,... |
public void handleEvent(Event event) {
if (event instanceof ISharedObjectMessageEvent) {
ISharedObjectMessageEvent e = (ISharedObjectMessageEvent) event;
Object[] data = (Object[]) e.getData();
Integer type = (Integer) data[0];
switch (type.intValue()) {
... | public void handleEvent(Event event) {
if (event instanceof ISharedObjectMessageEvent) {
ISharedObjectMessageEvent e = (ISharedObjectMessageEvent) event;
Object[] data = (Object[]) e.getData();
Integer type = (Integer) data[0];
switch (type.intValue()) {
... |
public static final SSLManager getInstance() {
if (null == SSLManager.manager) {
return new JsseSSLManager(SSLManager.sslProvider);
// if (SSLManager.isSSLSupported) {
// String classname = null;
// classname = "org.apache.jmeter.util.JsseSSLManager"; // $NON-NLS-1$
//
// try {
// Class clazz = Cla... | public static final SSLManager getInstance() {
if (null == SSLManager.manager) {
SSLManager.manager = new JsseSSLManager(SSLManager.sslProvider);
// if (SSLManager.isSSLSupported) {
// String classname = null;
// classname = "org.apache.jmeter.util.JsseSSLManager"; // $NON-NLS-1$
//
// try {
// Cla... |
* public static void prettyPrint(JoinPoint.StaticPart jp) {
* ...
* }
* }
*
* aspect Logging {
* before(): ... { LoggingUtils.prettyPrint(thisJoinPointStaticPart); }
* }
* </pre>
*
* @see JoinPoint#getStaticPart()
*/
public interface St... | * public static void prettyPrint(JoinPoint.StaticPart jp) {
* ...
* }
* }
*
* aspect Logging {
* before(): ... { LoggingUtils.prettyPrint(thisJoinPointStaticPart); }
* }
* </pre>
*
* @see JoinPoint#getStaticPart()
*/
public interface St... |
private static boolean setParams(QueryKey key, QueryContext q,
Object[] args) {
if (args == null || args.length == 0)
return true;
// Create a map for the given parameters, and convert the
// parameter list into a map, using the query's parameter
// declaration t... | private static boolean setParams(QueryKey key, QueryContext q,
Object[] args) {
if (args == null || args.length == 0)
return true;
// Create a map for the given parameters, and convert the
// parameter list into a map, using the query's parameter
// declaration t... |
public Map<Object, Parameter<?>> getDeclaredParameters() {
if (_declaredParams == null) {
_declaredParams = new HashMap<Object, Parameter<?>>();
OrderedMap<Object,Class<?>> paramTypes = _query.getParameterTypes();
for (Object key : paramTypes.keySet()) {
P... | public Map<Object, Parameter<?>> getDeclaredParameters() {
if (_declaredParams == null) {
_declaredParams = new HashMap<Object, Parameter<?>>();
OrderedMap<Object,Class<?>> paramTypes = _query.getOrderedParameterTypes();
for (Object key : paramTypes.keySet()) {
... |
public OrderedMap<Object, Class<?>> getParameterTypes() {
collectParameters(new CriteriaExpressionVisitor.ParameterVisitor(this));
return _params == null ? StoreQuery.EMPTY_PARAMS : _params;
}
| public OrderedMap<Object, Class<?>> getParameterTypes() {
collectParameters(new CriteriaExpressionVisitor.ParameterVisitor(this));
return _params == null ? StoreQuery.EMPTY_ORDERED_PARAMS : _params;
}
|
public boolean doit = true;
static final long serialVersionUID = 4121132532906340919L; // TODO
| public boolean doit = true;
static final long serialVersionUID = -8322331206780057921L;
|
public AjState(AjBuildManager buildManager) {
this.buildManager = buildManager;
}
void successfulCompile(AjBuildConfig config) {
buildConfig = config;
lastSuccessfulBuildTime = currentBuildTime;
}
/**
* Returns false if a batch build is needed.
*/
boolean prepareForNextBuild(AjBuildConfig newBuildCo... | public AjState(AjBuildManager buildManager) {
this.buildManager = buildManager;
}
void successfulCompile(AjBuildConfig config) {
buildConfig = config;
lastSuccessfulBuildTime = currentBuildTime;
}
/**
* Returns false if a batch build is needed.
*/
boolean prepareForNextBuild(AjBuildConfig newBuildCo... |
protected ReferenceTypeDelegate resolveIfBootstrapDelegate(ReferenceType ty) {
// first check for anything available in the bootstrap loader: these types are just defined from that without allowing nondelegation
String name = ty.getName();
Reference bootRef = (Reference)bootstrapTypes.get(name)... | protected ReferenceTypeDelegate resolveIfBootstrapDelegate(ReferenceType ty) {
// first check for anything available in the bootstrap loader: these types are just defined from that without allowing nondelegation
String name = ty.getName();
Reference bootRef = (Reference)bootstrapTypes.get(name)... |
private void mergeJoinColumn(MetaDataContext context, String prefix,
Column given, Object[][] joins, int idx, Table table, ClassMapping cls,
ClassMapping rel, ForeignKeyDefaults def, boolean inversable,
boolean adapt, boolean fill) {
// default to the primary key column name if this ... | private void mergeJoinColumn(MetaDataContext context, String prefix,
Column given, Object[][] joins, int idx, Table table, ClassMapping cls,
ClassMapping rel, ForeignKeyDefaults def, boolean inversable,
boolean adapt, boolean fill) {
// default to the primary key column name if this ... |
public void testSelectionBehaviour() {
SizeSelector s;
String results;
SizeSelector.ByteUnits kilo = new SizeSelector.ByteUnits();
kilo.setValue("K");
SizeSelector.ByteUnits kibi = new SizeSelector.ByteUnits();
kibi.setValue("Ki");
SizeSelector.ByteUnits tibi... | public void testSelectionBehaviour() {
SizeSelector s;
String results;
SizeSelector.ByteUnits kilo = new SizeSelector.ByteUnits();
kilo.setValue("K");
SizeSelector.ByteUnits kibi = new SizeSelector.ByteUnits();
kibi.setValue("Ki");
SizeSelector.ByteUnits tibi... |
protected final void synchronizeChildren(AttrImpl a, int nodeIndex) {
// we don't want to generate any event for this so turn them off
boolean orig = getMutationEvents();
setMutationEvents(false);
// no need to sync in the future
a.needsSyncChildren(false);
// crea... | protected final void synchronizeChildren(AttrImpl a, int nodeIndex) {
// we don't want to generate any event for this so turn them off
boolean orig = getMutationEvents();
setMutationEvents(false);
// no need to sync in the future
a.needsSyncChildren(false);
// crea... |
public Object component(final Component component)
{
// Get form component
FormComponent formComponent = (FormComponent)component;
// Validate form component
formComponent.validate();
// If component is not valid (has an error)
if (!formComponent.isValid())
{
// tell c... | public Object component(final Component component)
{
// Get form component
final FormComponent formComponent = (FormComponent)component;
// Validate form component
formComponent.validate();
// If component is not valid (has an error)
if (!formComponent.isValid())
{
// ... |
public String toString()
{
return "[required]";
}
| public String toString()
{
return "[RequiredValidator]";
}
|
protected Map messageModel(final FormComponent component, final String input,
final ConversionException e)
{
final Map model = super.messageModel(component, input);
model.put("type", type);
final Locale locale = e.getLocale();
if (locale != null)
{
model.put("locale", locale);
}
model.put("excepti... | protected Map messageModel(final FormComponent component, final String input,
final ConversionException e)
{
final Map model = super.messageModel(component, input);
model.put("type", type);
final Locale locale = e.getLocale();
if (locale != null)
{
model.put("locale", locale);
}
model.put("excepti... |
public void execute() throws BuildException {
if ("javadoc2".equals(taskType)) {
log("!! javadoc2 is deprecated. Use javadoc instead. !!");
}
if (sourcePath == null) {
String msg = "sourcePath attribute must be set!";
throw new BuildException(msg);
... | public void execute() throws BuildException {
if ("javadoc2".equals(taskType)) {
log("!! javadoc2 is deprecated. Use javadoc instead. !!");
}
if (sourcePath == null) {
String msg = "sourcePath attribute must be set!";
throw new BuildException(msg);
... |
protected void logAndAddFilesToCompile(Commandline cmd) {
attributes.log("Compilation args: " + cmd.toString(),
Project.MSG_VERBOSE);
StringBuffer niceSourceList = new StringBuffer("File");
if (compileList.length != 1) {
niceSourceList.append("s");
}
... | protected void logAndAddFilesToCompile(Commandline cmd) {
attributes.log("Compilation " + cmd.describeArguments(),
Project.MSG_VERBOSE);
StringBuffer niceSourceList = new StringBuffer("File");
if (compileList.length != 1) {
niceSourceList.append("s");
}
... |
protected void logAndAddFilesToCompile(Commandline cmd) {
int n = 0;
log("Compilation args: " + cmd.toString(),
Project.MSG_VERBOSE);
StringBuffer niceClassList = new StringBuffer();
if (cls != null) {
StringTokenizer tok = new StringTokenizer(cls, ",", false... | protected void logAndAddFilesToCompile(Commandline cmd) {
int n = 0;
log("Compilation " + cmd.describeArguments(),
Project.MSG_VERBOSE);
StringBuffer niceClassList = new StringBuffer();
if (cls != null) {
StringTokenizer tok = new StringTokenizer(cls, ",", fa... |
public void execute() throws BuildException {
Commandline commandLine = new Commandline();
Project aProj = getProject();
int result = 0;
// build the command line from what we got the format
// as specified in the CCM.EXE help
commandLine.setExecutable(getCcmCommand(... | public void execute() throws BuildException {
Commandline commandLine = new Commandline();
Project aProj = getProject();
int result = 0;
// build the command line from what we got the format
// as specified in the CCM.EXE help
commandLine.setExecutable(getCcmCommand(... |
private void buildBorlandStubs(Iterator ithomes, Hashtable files) {
Execute execTask = null;
execTask = new Execute(this);
Project project = getTask().getProject();
execTask.setAntRun(project);
execTask.setWorkingDirectory(project.getBaseDir());
Commandline ... | private void buildBorlandStubs(Iterator ithomes, Hashtable files) {
Execute execTask = null;
execTask = new Execute(this);
Project project = getTask().getProject();
execTask.setAntRun(project);
execTask.setWorkingDirectory(project.getBaseDir());
Commandline ... |
public void execute() throws BuildException {
// load command line with optional attributes
Enumeration iter = optionalAttrs.keys();
while (iter.hasMoreElements()) {
String name = (String) iter.nextElement();
Object value = optionalAttrs.get(name);
cmdl.... | public void execute() throws BuildException {
// load command line with optional attributes
Enumeration iter = optionalAttrs.keys();
while (iter.hasMoreElements()) {
String name = (String) iter.nextElement();
Object value = optionalAttrs.get(name);
cmdl.... |
public int executeAsForked(CommandlineJava commandline,
ExecuteWatchdog watchdog) throws BuildException {
// if not set, auto-create the ClassPath from the project
createClasspath();
// not sure whether this test is needed but cost nothing to put.
// h... | public int executeAsForked(CommandlineJava commandline,
ExecuteWatchdog watchdog) throws BuildException {
// if not set, auto-create the ClassPath from the project
createClasspath();
// not sure whether this test is needed but cost nothing to put.
// h... |
private int executeAsForked(JUnitTest test, ExecuteWatchdog watchdog)
throws BuildException {
CommandlineJava cmd = (CommandlineJava) commandline.clone();
cmd.setClassname("org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner");
cmd.createArgument().setValue(test.getName()... | private int executeAsForked(JUnitTest test, ExecuteWatchdog watchdog)
throws BuildException {
CommandlineJava cmd = (CommandlineJava) commandline.clone();
cmd.setClassname("org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner");
cmd.createArgument().setValue(test.getName()... |
protected void execute0(ExecuteStreamHandler handler) throws BuildException {
final Execute process = new Execute(handler);
log(cmdl.toString(), Project.MSG_VERBOSE);
process.setCommandline(cmdl.getCommandline());
try {
if (process.execute() != 0) {
throw ... | protected void execute0(ExecuteStreamHandler handler) throws BuildException {
final Execute process = new Execute(handler);
log(cmdl.describeCommand(), Project.MSG_VERBOSE);
process.setCommandline(cmdl.getCommandline());
try {
if (process.execute() != 0) {
... |
protected void _execute(ExecuteStreamHandler handler) throws BuildException {
// target has been checked as a .jj, see if there is a matching
// java file and if it is needed to run to process the grammar
String pathname = target.getAbsolutePath();
int pos = pathname.length() - ".jj"... | protected void _execute(ExecuteStreamHandler handler) throws BuildException {
// target has been checked as a .jj, see if there is a matching
// java file and if it is needed to run to process the grammar
String pathname = target.getAbsolutePath();
int pos = pathname.length() - ".jj"... |
protected void execP4Command(String command, P4Handler handler) throws BuildException {
try {
Commandline commandline = new Commandline();
commandline.setExecutable("p4");
//Check API for these - it's how CVS does it...
if (P4Port != null && P4Port.length() ... | protected void execP4Command(String command, P4Handler handler) throws BuildException {
try {
Commandline commandline = new Commandline();
commandline.setExecutable("p4");
//Check API for these - it's how CVS does it...
if (P4Port != null && P4Port.length() ... |
public void execute() throws org.apache.tools.ant.BuildException {
Project aProj = getProject();
int result = 0;
if (repository == null || repository.trim().equals("")) {
throw new BuildException("Required argument repository not specified");
}
// Check workspac... | public void execute() throws org.apache.tools.ant.BuildException {
Project aProj = getProject();
int result = 0;
if (repository == null || repository.trim().equals("")) {
throw new BuildException("Required argument repository not specified");
}
// Check workspac... |
public void execute() throws BuildException {
checkOptions();
File paramfile = createParamFile();
try {
Commandline cmdl = new Commandline();
cmdl.setExecutable(new File(home, "jpcovmerge").getAbsolutePath());
if (verbose) {
cmdl.createArg... | public void execute() throws BuildException {
checkOptions();
File paramfile = createParamFile();
try {
Commandline cmdl = new Commandline();
cmdl.setExecutable(new File(home, "jpcovmerge").getAbsolutePath());
if (verbose) {
cmdl.createArg... |
public void execute() throws BuildException {
checkOptions();
try {
Commandline cmdl = new Commandline();
// we need to run Coverage from his directory due to dll/jar issues
cmdl.setExecutable(new File(home, "jpcovreport").getAbsolutePath());
String[] ... | public void execute() throws BuildException {
checkOptions();
try {
Commandline cmdl = new Commandline();
// we need to run Coverage from his directory due to dll/jar issues
cmdl.setExecutable(new File(home, "jpcovreport").getAbsolutePath());
String[] ... |
public void execute() throws BuildException {
File paramfile = null;
// if an input file is used, all other options are ignored...
if (inputFile == null) {
checkOptions();
paramfile = createParamFile();
} else {
paramfile = inputFile;
}
... | public void execute() throws BuildException {
File paramfile = null;
// if an input file is used, all other options are ignored...
if (inputFile == null) {
checkOptions();
paramfile = createParamFile();
} else {
paramfile = inputFile;
}
... |
protected void logAndAddFilesToCompile(Commandline cmd) {
Vector compileList = attributes.getCompileList();
attributes.log("Compilation args: " + cmd.toString(),
Project.MSG_VERBOSE);
StringBuffer niceSourceList = new StringBuffer("File");
if (compileList.siz... | protected void logAndAddFilesToCompile(Commandline cmd) {
Vector compileList = attributes.getCompileList();
attributes.log("Compilation " + cmd.describeArguments(),
Project.MSG_VERBOSE);
StringBuffer niceSourceList = new StringBuffer("File");
if (compileList.... |
public WidgetDataEvents addControls(final Composite parent, final Listener statusListener) {
final Composite mainComposite = new Composite(parent, SWT.NONE);
GridLayout gridLayout = new GridLayout(1, false);
mainComposite.setLayout(gridLayout);
GridData gridData = new GridData(SWT.F... | public WidgetDataEvents addControls(final Composite parent, final Listener statusListener) {
final Composite mainComposite = new Composite(parent, SWT.NONE);
GridLayout gridLayout = new GridLayout(1, false);
mainComposite.setLayout(gridLayout);
GridData gridData = new GridData(SWT.F... |
public String resolveTableName(ClassMapping mapping, Table table) {
String sName = mapping.getTable().getSchemaName();
String tableName;
if (sName == null)
tableName = table.getFullName();
else
tableName = sName + "." + table.getFullName();
return tabl... | public String resolveTableName(ClassMapping mapping, Table table) {
String sName = mapping.getTable().getSchemaName();
String tableName;
if (sName == null)
tableName = table.getFullName();
else
tableName = sName + "." + table.getName();
return tableNam... |
public Index()
{
// normal link instead of an autolink as it looks a bit weird to refer
// to PageWithCustomLoading.html while the template has got a very
// different name (CustomLoadedTemplate.html)
add(new BookmarkablePageLink(this, "customLoadingPageLink", PageWithCustomLoading.class));
}
| public Index()
{
// normal link instead of an autolink as it looks a bit weird to refer
// to PageWithCustomLoading.html while the template has got a very
// different name (CustomLoadedTemplate.html)
add(new BookmarkablePageLink("customLoadingPageLink", PageWithCustomLoading.class));
}
|
public ConcretePage()
{
add(new MyPanel(this, "panel"));
}
| public ConcretePage()
{
add(new MyPanel("panel"));
}
|
public ConcretePage2()
{
add(new MyPanel2(this, "panel"));
}
| public ConcretePage2()
{
add(new MyPanel2("panel"));
}
|
public AbstractMeldingPage()
{
add(new Label(this, "foo", "FooBar"));
}
| public AbstractMeldingPage()
{
add(new Label("foo", "FooBar"));
}
|
public AbstractSecurePage()
{
add(new Label(this, "username", "Pietje Puk"));
}
| public AbstractSecurePage()
{
add(new Label("username", "Pietje Puk"));
}
|
import org.apache.tools.ant.taskdefs.optional.Native2Ascii;
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.... | import org.apache.tools.ant.taskdefs.optional.Native2Ascii;
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.... |
protected void invokeInternal2 (WorkflowContext wfContext, ProgressMonitor monitor, Issues issues) {
// set up the execution context
XpandExecutionContextImpl executionContext = new XpandExecutionContextImpl (getOutput(), null, getGlobalVars (wfContext), null, getNullEvaluationHandler());
... | protected void invokeInternal2 (WorkflowContext wfContext, ProgressMonitor monitor, Issues issues) {
// set up the execution context
XpandExecutionContextImpl executionContext = new XpandExecutionContextImpl (getOutput(), null, getGlobalVars (wfContext), null, getNullEvaluationHandler());
... |
public static void testJavaEncodingName(String name) throws UnsupportedEncodingException {
final byte [] bTest = {'v', 'a', 'l', 'i', 'd'};
String s = new String(bTest, name);
}
| public static void testJavaEncodingName(String name) throws UnsupportedEncodingException {
final byte [] bTest = {(byte)'v', (byte)'a', (byte)'l', (byte)'i', (byte)'d'};
String s = new String(bTest, name);
}
|
private List checkCache(QueryKey qk) {
if (qk == null)
return null;
FetchConfiguration fetch = getContext().getFetchConfiguration();
if (!fetch.getQueryCache())
return null;
if (fetch.getReadLockLevel() > LockLevels.LOCK_NONE)
return null;
... | private List checkCache(QueryKey qk) {
if (qk == null)
return null;
FetchConfiguration fetch = getContext().getFetchConfiguration();
if (!fetch.getEnlistInQueryCache())
return null;
if (fetch.getReadLockLevel() > LockLevels.LOCK_NONE)
return null;
... |
protected void fireEvent(Object event, Object listener) {
try {
BrokerFactoryEvent e = (BrokerFactoryEvent) event;
((BrokerFactoryListener) listener).afterBrokerFactoryCreate(e);
} catch (Exception e) {
_conf.getLog(OpenJPAConfiguration.LOG_RUNTIME).warn(
... | protected void fireEvent(Object event, Object listener) {
try {
BrokerFactoryEvent e = (BrokerFactoryEvent) event;
((BrokerFactoryListener) listener).eventFired(e);
} catch (Exception e) {
_conf.getLog(OpenJPAConfiguration.LOG_RUNTIME).warn(
_loc.g... |
public void afterBrokerFactoryCreate(BrokerFactoryEvent event);
} | public void eventFired(BrokerFactoryEvent event);
} |
private RemoteCommitEvent createRemoteCommitEvent(TransactionEvent event) {
Broker broker = (Broker) event.getSource();
int payload;
Collection persIds = null;
Collection addClassNames = null;
Collection updates = null;
Collection deletes = null;
if (broker.i... | private RemoteCommitEvent createRemoteCommitEvent(TransactionEvent event) {
Broker broker = (Broker) event.getSource();
int payload;
Collection persIds = null;
Collection addClassNames = null;
Collection updates = null;
Collection deletes = null;
if (broker.i... |
public Rectangle computeTrim (int x, int y, int width, int height) {
checkWidget();
int trimX = x - marginWidth - highlight_margin - borderLeft;
int trimWidth = width + borderLeft + borderRight + 2*marginWidth + 2*highlight_margin;
if (minimized) {
int trimY = onBottom ? y - borderTop : y - highlight_header - tab... | public Rectangle computeTrim (int x, int y, int width, int height) {
checkWidget();
int trimX = x - marginWidth - highlight_margin - borderLeft;
int trimWidth = width + borderLeft + borderRight + 2*marginWidth + 2*highlight_margin;
if (minimized) {
int trimY = onBottom ? y - borderTop : y - highlight_header - tab... |
public void itsAFoo(Object f, int x) {
}
} | public void itsAFoo(int x, Object f) {
}
} |
public Component getComponentFromLastRenderedPage(String path)
{
final Component component = getLastRenderedPage().get(path);
if (component == null)
{
fail("path: '" + path + "' does no exist for page: "
+ Classes.simpleName(getLastRenderedPage().getClass()));
return component;
}
| public Component getComponentFromLastRenderedPage(String path)
{
final Component component = getLastRenderedPage().get(path);
if (component == null)
{
fail("path: '" + path + "' does not exist for page: "
+ Classes.simpleName(getLastRenderedPage().getClass()));
return component;
}
|
protected void initializeTableModel() {
tableModel = new ObjectTableModel(new String[] { "Library" },
new Functor[0] , new Functor[0] , // i.e. bypass the Functors
new Class[] { String.class });
}
| protected void initializeTableModel() {
tableModel = new ObjectTableModel(new String[] { "Library" },
new Functor[0] , new Functor[0] , // i.e. bypass the Functors
new Class[] { String.class }, false);
}
|
public int getIntegerQueryTimeout() {
int timeout = 0;
try {
if(StringUtils.isNumeric(query)) {
timeout = Integer.parseInt(queryTimeout);
}
} catch (NumberFormatException nfe) {
timeout = 0;
}
return timeout;
}
| public int getIntegerQueryTimeout() {
int timeout = 0;
try {
if(StringUtils.isNumeric(queryTimeout)) {
timeout = Integer.parseInt(queryTimeout);
}
} catch (NumberFormatException nfe) {
timeout = 0;
}
return timeout;
}
|
private FileSet getRef(Project p) {
if (!checked) {
Stack stk = new Stack();
stk.push(this);
dieOnCircularReference(stk, p);
}
Object o = ref.getReferencedObject(p);
if (!(o instanceof FileSet)) {
String msg = ref.getRefId()+" ... | protected FileSet getRef(Project p) {
if (!checked) {
Stack stk = new Stack();
stk.push(this);
dieOnCircularReference(stk, p);
}
Object o = ref.getReferencedObject(p);
if (!(o instanceof FileSet)) {
String msg = ref.getRefId()+... |
public Object evaluateInternal(final ExecutionContext ctx) {
return new Long(getLiteralValue().getValue());
}
| public Object evaluateInternal(final ExecutionContext ctx) {
return new BigInteger(getLiteralValue().getValue());
}
|
public PropertyModel(final IModel model, final String expression)
{
super(null);
checkModelNotNull(model);
this.model = model;
this.expression = expression;
this.applyFormatting = false;
// PropertyModel might be used while RequestCycle.get() ha... | public PropertyModel(final IModel model, final String expression)
{
super(null);
checkModelNotNull(model);
this.model = model;
this.expression = expression;
this.applyFormatting = false;
// PropertyModel might be used while RequestCycle.get() ha... |
private void expandZip(IFile file) {
try {
URI zipURI = new URI(ZipFileSystem.SCHEME_ZIP, null, "/", file.getLocationURI().toString(), null);
IFolder link = file.getParent().getFolder(new Path(file.getName()));
link.createLink(zipURI, IResource.REPLACE_RESOURCE, null);
} catch (Exception e) {
MessageDi... | private void expandZip(IFile file) {
try {
URI zipURI = new URI(ZipFileSystem.SCHEME_ZIP, null, "/", file.getLocationURI().toString(), null);
IFolder link = file.getParent().getFolder(new Path(file.getName()));
link.createLink(zipURI, IResource.REPLACE, null);
} catch (Exception e) {
MessageDialog.open... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.