buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public Date convertDateNew(final String dateStr, final Integer hours, final Integer minutes,
final AM_PM amOrPm, final boolean use12HourFormat, final TimeZone tzClient)
throws ParseException
{
log.error(">>> convertDateNew()");
// This is what I get from field.getConvertedInput()
Date dateFieldInput = (date... | public Date convertDateNew(final String dateStr, final Integer hours, final Integer minutes,
final AM_PM amOrPm, final boolean use12HourFormat, final TimeZone tzClient)
throws ParseException
{
log.error(">>> convertDateNew()");
// This is what I get from field.getConvertedInput()
Date dateFieldInput = (date... |
public void removeSelectionListener(SelectionListener listener) {
checkWidget ();
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
if (eventTable == null) return;
eventTable.unhook (SWT.Selection, listener);
eventTable.unhook (SWT.DefaultSelection,listener);
}
TCHAR windowClass () {
return display.windowC... | public void removeSelectionListener(SelectionListener listener) {
checkWidget ();
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
if (eventTable == null) return;
eventTable.unhook (SWT.Selection, listener);
eventTable.unhook (SWT.DefaultSelection,listener);
}
TCHAR windowClass () {
return display.windowC... |
public void setSelection (int value) {
checkWidget ();
int [] max = new int [1], min = new int [1];
OS.SendMessage (hwndUpDown , OS.UDM_GETRANGE32, min, max);
value = Math.min (Math.max (min [0], value), max [0]);
setSelection (value, false);
}
void setSelection (int value, boolean notify) {
OS.SendMessage (hwnd... | public void setSelection (int value) {
checkWidget ();
int [] max = new int [1], min = new int [1];
OS.SendMessage (hwndUpDown , OS.UDM_GETRANGE32, min, max);
value = Math.min (Math.max (min [0], value), max [0]);
setSelection (value, false);
}
void setSelection (int value, boolean notify) {
OS.SendMessage (hwnd... |
public void test_4()
{
try
{
PageParameters parameters = new PageParameters("=test");
fail("Expected an exception: invalid URL parameter");
}
catch (IllegalArgumentException ex)
{
// ok; expected
}
}
| public void test_4()
{
try
{
new PageParameters("=test");
fail("Expected an exception: invalid URL parameter");
}
catch (IllegalArgumentException ex)
{
// ok; expected
}
}
|
public SimpleTestPage()
{
SimpleTestPanel panel = new SimpleTestPanel(this, "testPanel");
}
| public SimpleTestPage()
{
new SimpleTestPanel(this, "testPanel");
}
|
public PanelPage_1()
{
Panel panel = new SimplePanel_1(this, "myPanel");
}
| public PanelPage_1()
{
new SimplePanel_1(this, "myPanel");
}
|
public PanelPage_2()
{
Panel panel = new SimplePanel_2(this, "myPanel");
}
| public PanelPage_2()
{
new SimplePanel_2(this, "myPanel");
}
|
public PanelWithAttributeModifierPage()
{
Panel panel = new PanelWithAttributeModifier(this, "myPanel");
}
| public PanelWithAttributeModifierPage()
{
new PanelWithAttributeModifier(this, "myPanel");
}
|
public AbstractTreePage()
{
// create a list with sublists
List<Object> l1 = new ArrayList<Object>();
l1.add("test 1.1");
l1.add("test 1.2");
List<Object> l2 = new ArrayList<Object>();
l2.add("test 2.1");
l2.add("test 2.2");
l2.add("test 2.3");
List<Object> l3 = new ArrayList<Object>();
l3.add("te... | public AbstractTreePage()
{
// create a list with sublists
List<Object> l1 = new ArrayList<Object>();
l1.add("test 1.1");
l1.add("test 1.2");
List<Object> l2 = new ArrayList<Object>();
l2.add("test 2.1");
l2.add("test 2.2");
l2.add("test 2.3");
List<Object> l3 = new ArrayList<Object>();
l3.add("te... |
protected Object convert( Object original, Context context )
throws ConverterException
{
return new MyType1();
}
} | protected Object convert( Object original, Object context )
throws ConverterException
{
return new MyType1();
}
} |
public Object convert( Class destination, Object original, Context context )
throws ConverterException
{
return new TestType1();
}
} | public Object convert( Class destination, Object original, Object context )
throws ConverterException
{
return new TestType1();
}
} |
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
int width = DEFAULT_WIDTH;
int height = DEFAULT_HEIGHT;
if (wHint != SWT.DEFAULT) width = wHint;
if (hHint != SWT.DEFAULT) height = hHint;
int border = getBorderWidth ();
width += border * 2;
height += border * 2;
return new Poin... | public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
int width = DEFAULT_WIDTH;
int height = DEFAULT_HEIGHT;
if (wHint != SWT.DEFAULT) width = wHint;
if (hHint != SWT.DEFAULT) height = hHint;
int border = getBorderWidth ();
width += border * 2;
height += border * 2;
return new Poin... |
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
int width = DEFAULT_WIDTH;
int height = DEFAULT_HEIGHT;
if (wHint != SWT.DEFAULT) width = wHint;
if (hHint != SWT.DEFAULT) height = hHint;
int border = getBorderWidth ();
width += border * 2;
height += border * 2;
return new Poin... | public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
int width = DEFAULT_WIDTH;
int height = DEFAULT_HEIGHT;
if (wHint != SWT.DEFAULT) width = wHint;
if (hHint != SWT.DEFAULT) height = hHint;
int border = getBorderWidth ();
width += border * 2;
height += border * 2;
return new Poin... |
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
int width = DEFAULT_WIDTH;
int height = DEFAULT_HEIGHT;
if (wHint != SWT.DEFAULT) width = wHint;
if (hHint != SWT.DEFAULT) height = hHint;
int border = getBorderWidth ();
width += border * 2;
height += border * 2;
return new Poin... | public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
int width = DEFAULT_WIDTH;
int height = DEFAULT_HEIGHT;
if (wHint != SWT.DEFAULT) width = wHint;
if (hHint != SWT.DEFAULT) height = hHint;
int border = getBorderWidth ();
width += border * 2;
height += border * 2;
return new Poin... |
public void showSelection () {
checkWidget ();
int hItem = 0;
if ((style & SWT.SINGLE) != 0) {
hItem = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_CARET, 0);
if (hItem == 0) return;
int state = OS.SendMessage (handle, OS.TVM_GETITEMSTATE, hItem, OS.TVIS_SELECTED);
if ((state & OS.TVIS_SELECTED) == 0... | public void showSelection () {
checkWidget ();
int hItem = 0;
if ((style & SWT.SINGLE) != 0) {
hItem = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_CARET, 0);
if (hItem == 0) return;
int state = OS.SendMessage (handle, OS.TVM_GETITEMSTATE, hItem, OS.TVIS_SELECTED);
if ((state & OS.TVIS_SELECTED) == 0... |
public static void main(String[] args)
{
if (args != null & args.length > 0)
{
String strurl = args[0];
boolean addLink = true;
if (args.length == 2)
{
if (args[1].equals("f"))
{
addLink = false;
... | public static void main(String[] args)
{
if (args != null && args.length > 0)
{
String strurl = args[0];
boolean addLink = true;
if (args.length == 2)
{
if (args[1].equals("f"))
{
addLink = false;... |
package org.eclipse.ecf.tests.osgi.services.distribution;
/****************************************************************************
* Copyright (c) 2009 Jan S. Rellermeyer and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public Li... | package org.eclipse.ecf.tests.osgi.services.distribution;
/****************************************************************************
* Copyright (c) 2009 Jan S. Rellermeyer and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public Li... |
package org.eclipse.ecf.tests.osgi.services.distribution;
/****************************************************************************
* Copyright (c) 2009 Jan S. Rellermeyer and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public Li... | package org.eclipse.ecf.tests.osgi.services.distribution;
/****************************************************************************
* Copyright (c) 2009 Jan S. Rellermeyer and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public Li... |
public final void validate()
{
validateRequired();
if (isValid())
{
convertInput();
if (isRequired() && getConvertedInput() == null)
{
reportRequiredError();
}
if (isValid())
{
validateValidators();
}
}
| public final void validate()
{
validateRequired();
if (isValid())
{
convertInput();
if (isValid() && isRequired() && getConvertedInput() == null)
{
reportRequiredError();
}
if (isValid())
{
validateValidators();
}
}
|
public void testResultPropertyNonZero() {
executeTarget("testResultPropertyNonZero");
assertEquals("-1",project.getProperty("exitcode"));
}
| public void testResultPropertyNonZero() {
executeTarget("testResultPropertyNonZero");
assertEquals("2",project.getProperty("exitcode"));
}
|
protected final void onComponentTagBody(final MarkupStream markupStream,
final ComponentTag openTag)
{
// Iterate through choices
final List<? extends T> choices = getChoices();
// Buffer to hold generated body
final AppendingStringBuffer buffer = new AppendingStringBuffer(70 * (choices.size() + 1));
//... | protected final void onComponentTagBody(final MarkupStream markupStream,
final ComponentTag openTag)
{
// Iterate through choices
final List<? extends T> choices = getChoices();
// Buffer to hold generated body
final AppendingStringBuffer buffer = new AppendingStringBuffer(70 * (choices.size() + 1));
//... |
protected final void onComponentTagBody(final MarkupStream markupStream,
final ComponentTag openTag)
{
// Iterate through choices
final List<? extends T> choices = getChoices();
// Buffer to hold generated body
final AppendingStringBuffer buffer = new AppendingStringBuffer((choices.size() + 1) * 70);
//... | protected final void onComponentTagBody(final MarkupStream markupStream,
final ComponentTag openTag)
{
// Iterate through choices
final List<? extends T> choices = getChoices();
// Buffer to hold generated body
final AppendingStringBuffer buffer = new AppendingStringBuffer((choices.size() + 1) * 70);
//... |
public void addText( String msg )
throws TaskException
{
message += project.replaceProperties( msg );
}
| public void addText( String msg )
throws TaskException
{
message += getProject().replaceProperties( msg );
}
|
protected DirectoryScanner getDirectoryScanner( File baseDir )
throws TaskException
{
fileset.setDir( baseDir );
fileset.setDefaultexcludes( useDefaultExcludes );
return fileset.getDirectoryScanner( project );
}
| protected DirectoryScanner getDirectoryScanner( File baseDir )
throws TaskException
{
fileset.setDir( baseDir );
fileset.setDefaultexcludes( useDefaultExcludes );
return fileset.getDirectoryScanner( getProject() );
}
|
public void execute()
throws TaskException
{
try
{
Date d = new Date();
SimpleDateFormat dstamp = new SimpleDateFormat( "yyyyMMdd" );
setProperty( prefix + "DSTAMP", dstamp.format( d ) );
SimpleDateFormat tstamp = new SimpleDateFormat( "H... | public void execute()
throws TaskException
{
try
{
Date d = new Date();
SimpleDateFormat dstamp = new SimpleDateFormat( "yyyyMMdd" );
setProperty( prefix + "DSTAMP", dstamp.format( d ) );
SimpleDateFormat tstamp = new SimpleDateFormat( "H... |
protected Execute prepareExec()
throws TaskException
{
// default directory to the project's base directory
if( dir == null ) dir = getBaseDirectory();
// show the command
log( cmdl.toString(), Project.MSG_VERBOSE );
Execute exe = new Execute( createHandler(), cr... | protected Execute prepareExec()
throws TaskException
{
// default directory to the project's base directory
if( dir == null ) dir = getBaseDirectory();
// show the command
log( cmdl.toString(), Project.MSG_VERBOSE );
Execute exe = new Execute( createHandler(), cr... |
public Mapper createMapper()
throws TaskException
{
if( mapper != null )
{
throw new TaskException( "Cannot define more than one mapper" );
}
mapper = new Mapper( project );
return mapper;
}
| public Mapper createMapper()
throws TaskException
{
if( mapper != null )
{
throw new TaskException( "Cannot define more than one mapper" );
}
mapper = new Mapper( getProject() );
return mapper;
}
|
public void execute()
throws TaskException
{
Commandline toExecute = new Commandline();
toExecute.setExecutable( "rpm" );
if( topDir != null )
{
toExecute.createArgument().setValue( "--define" );
toExecute.createArgument().setValue( "_topdir" + t... | public void execute()
throws TaskException
{
Commandline toExecute = new Commandline();
toExecute.setExecutable( "rpm" );
if( topDir != null )
{
toExecute.createArgument().setValue( "--define" );
toExecute.createArgument().setValue( "_topdir" + t... |
public final void setCcmDir( String dir )
{
_ccmDir = project.translatePath( dir );
}
| public final void setCcmDir( String dir )
{
_ccmDir = getProject().translatePath( dir );
}
|
public final void setClearToolDir( String dir )
{
m_ClearToolDir = project.translatePath( dir );
}
| public final void setClearToolDir( String dir )
{
m_ClearToolDir = getProject().translatePath( dir );
}
|
public Path createClasspath()
throws TaskException
{
if( dependClasspath == null )
{
dependClasspath = new Path( project );
}
return dependClasspath.createPath();
}
| public Path createClasspath()
throws TaskException
{
if( dependClasspath == null )
{
dependClasspath = new Path( getProject() );
}
return dependClasspath.createPath();
}
|
public void setReferenceFiles( Path path )
throws TaskException
{
//demand create pathlist
if( _referenceFiles == null )
_referenceFiles = new Path( this.project );
_referenceFiles.append( path );
}
| public void setReferenceFiles( Path path )
throws TaskException
{
//demand create pathlist
if( _referenceFiles == null )
_referenceFiles = new Path( this.getProject() );
_referenceFiles.append( path );
}
|
public Path createClasspath()
throws TaskException
{
if( this.classpath == null )
{
this.classpath = new Path( project );
}
return this.classpath.createPath();
}
| public Path createClasspath()
throws TaskException
{
if( this.classpath == null )
{
this.classpath = new Path( getProject() );
}
return this.classpath.createPath();
}
|
public Path createClasspath()
{
if( config.classpath == null )
{
config.classpath = new Path( project );
}
return config.classpath.createPath();
}
| public Path createClasspath()
{
if( config.classpath == null )
{
config.classpath = new Path( getProject() );
}
return config.classpath.createPath();
}
|
public Path createClasspath()
{
if( classpath == null )
{
classpath = new Path( project );
}
return classpath.createPath();
}
| public Path createClasspath()
{
if( classpath == null )
{
classpath = new Path( getProject() );
}
return classpath.createPath();
}
|
private void translate()
throws TaskException
{
for( int i = 0; i < filesets.size(); i++ )
{
FileSet fs = (FileSet)filesets.elementAt( i );
DirectoryScanner ds = fs.getDirectoryScanner( project );
String[] srcFiles = ds.getIncludedFiles();
... | private void translate()
throws TaskException
{
for( int i = 0; i < filesets.size(); i++ )
{
FileSet fs = (FileSet)filesets.elementAt( i );
DirectoryScanner ds = fs.getDirectoryScanner( getProject() );
String[] srcFiles = ds.getIncludedFiles();
... |
protected void importFileset( FileSet fileset )
{
DirectoryScanner ds = fileset.getDirectoryScanner( this.project );
if( ds.getIncludedFiles().length == 0 )
{
return;
}
String[] includes = null;
String[] excludes = null;
// Hack to get includ... | protected void importFileset( FileSet fileset )
{
DirectoryScanner ds = fileset.getDirectoryScanner( this.getProject() );
if( ds.getIncludedFiles().length == 0 )
{
return;
}
String[] includes = null;
String[] excludes = null;
// Hack to get i... |
public void execute()
throws TaskException
{
// load command line with optional attributes
Enumeration iter = optionalAttrs.keys();
while( iter.hasMoreElements() )
{
String name = (String)iter.nextElement();
Object value = optionalAttrs.get( name ... | public void execute()
throws TaskException
{
// load command line with optional attributes
Enumeration iter = optionalAttrs.keys();
while( iter.hasMoreElements() )
{
String name = (String)iter.nextElement();
Object value = optionalAttrs.get( name ... |
public void execute()
throws TaskException
{
// load command line with optional attributes
Enumeration iter = optionalAttrs.keys();
while( iter.hasMoreElements() )
{
String name = (String)iter.nextElement();
Object value = optionalAttrs.get( name ... | public void execute()
throws TaskException
{
// load command line with optional attributes
Enumeration iter = optionalAttrs.keys();
while( iter.hasMoreElements() )
{
String name = (String)iter.nextElement();
Object value = optionalAttrs.get( name ... |
public Path createSearchpath()
{
if( searchPath == null )
{
searchPath = new Path( project );
}
return searchPath;
}
| public Path createSearchpath()
{
if( searchPath == null )
{
searchPath = new Path( getProject() );
}
return searchPath;
}
|
public Path createPath()
{
if( path == null )
{
path = new Path( project );
}
return path;
}
| public Path createPath()
{
if( path == null )
{
path = new Path( getProject() );
}
return path;
}
|
public void doMail()
throws MessagingException, AddressException, TaskException
{
Properties props = new Properties();
props.put( "mail.smtp.host", mailhost );
//Aside, the JDK is clearly unaware of the scottish 'session', which
//involves excessive quantities of alcohol... | public void doMail()
throws MessagingException, AddressException, TaskException
{
Properties props = new Properties();
props.put( "mail.smtp.host", mailhost );
//Aside, the JDK is clearly unaware of the scottish 'session', which
//involves excessive quantities of alcohol... |
public void execute()
throws TaskException
{
if( P4View != null )
{
addCmd = P4View;
}
P4CmdOpts = ( m_changelist > 0 ) ? ( "-c " + m_changelist ) : "";
StringBuffer filelist = new StringBuffer();
for( int i = 0; i < filesets.size(); i++ )
... | public void execute()
throws TaskException
{
if( P4View != null )
{
addCmd = P4View;
}
P4CmdOpts = ( m_changelist > 0 ) ? ( "-c " + m_changelist ) : "";
StringBuffer filelist = new StringBuffer();
for( int i = 0; i < filesets.size(); i++ )
... |
public Path createClasspath()
{
return cmdlJava.createClasspath( project ).createPath();
}
| public Path createClasspath()
{
return cmdlJava.createClasspath( getProject() ).createPath();
}
|
public static String fromURI(String uri) {
if (!uri.startsWith("file:")) {
throw new IllegalArgumentException("Can only handle file: URIs");
}
if (uri.startsWith("file://")) {
uri = uri.substring(7);
} else {
uri = uri.substring(5);
}
... | public static String fromURI(String uri) {
if (!uri.startsWith("file:")) {
throw new IllegalArgumentException("Can only handle file: URIs");
}
if (uri.startsWith("file://")) {
uri = uri.substring(7);
} else {
uri = uri.substring(5);
}
... |
public String toURI(String path) {
boolean isDir = (new File(path)).isDirectory();
StringBuffer sb = new StringBuffer("file:");
// catch exception if normalize thinks this is not an absolute path
try {
path = normalize(path).getAbsolutePath();
sb.append("//"... | public String toURI(String path) {
boolean isDir = (new File(path)).isDirectory();
StringBuffer sb = new StringBuffer("file:");
// catch exception if normalize thinks this is not an absolute path
try {
path = normalize(path).getAbsolutePath();
sb.append("//"... |
public JMeterTestCase(String name)
{
super(name);
}
/*
* If not running under AllTests.java, make sure that the properties
* (and log file) are set up correctly.
*
* N.B. In order for this to work correctly, the JUnit test must be started
* in the bin directory, an... | public JMeterTestCase(String name)
{
super(name);
}
/*
* If not running under AllTests.java, make sure that the properties
* (and log file) are set up correctly.
*
* N.B. In order for this to work correctly, the JUnit test must be started
* in the bin directory, an... |
public static void main(String[] args)
{
if (args.length < 1)
{
System.out.println(
"You must specify a comma-delimited list of paths to search " +
"for unit tests");
System.exit(0);
}
initializeLogging(args);
initia... | public static void main(String[] args)
{
if (args.length < 1)
{
System.out.println(
"You must specify a comma-delimited list of paths to search " +
"for unit tests");
System.exit(0);
}
initializeLogging(args);
initia... |
public void implementOn(Shadow s) {
hasMatchedAtLeastOnce=true;
BcelShadow shadow = (BcelShadow) s;
// remove any unnecessary exceptions if the compiler option is set to
// error or warning and if this piece of advice throws exceptions
// (bug 129282). This may be ex... | public void implementOn(Shadow s) {
hasMatchedAtLeastOnce=true;
BcelShadow shadow = (BcelShadow) s;
// remove any unnecessary exceptions if the compiler option is set to
// error or warning and if this piece of advice throws exceptions
// (bug 129282). This may be ex... |
protected boolean checkAccess()
{
// Is user signed in?
if (getLibrarySession().isSignedIn())
{
// okay to proceed
return true;
}
// Force sign in
redirectToInterceptPage(newPage(SignIn.class));
return false;
}
}
| public boolean checkAccess()
{
// Is user signed in?
if (getLibrarySession().isSignedIn())
{
// okay to proceed
return true;
}
// Force sign in
redirectToInterceptPage(newPage(SignIn.class));
return false;
}
}
|
protected boolean checkAccess()
{
// Is a user signed into this cycle's session?
boolean signedIn = getSignInSession().isSignedIn();
// If nobody is signed in
if (!signedIn)
{
// Redirect request to SignIn page
redirectToInterceptPage(newPage(Sign... | public boolean checkAccess()
{
// Is a user signed into this cycle's session?
boolean signedIn = getSignInSession().isSignedIn();
// If nobody is signed in
if (!signedIn)
{
// Redirect request to SignIn page
redirectToInterceptPage(newPage(SignIn.... |
protected boolean checkAccess()
{
// Is a user signed into this cycle's session?
boolean signedIn = getSignIn2Session().isSignedIn();
// If nobody is signed in
if (!signedIn)
{
// Redirect request to SignIn page
redirectToInterceptPage(newPage(Sig... | public boolean checkAccess()
{
// Is a user signed into this cycle's session?
boolean signedIn = getSignIn2Session().isSignedIn();
// If nobody is signed in
if (!signedIn)
{
// Redirect request to SignIn page
redirectToInterceptPage(newPage(SignIn... |
public abstract Component getComponent();
| Component getComponent();
/*
* $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 obtain a copy of
* the License ... |
public abstract String getResourceKey();
| String getResourceKey();
/*
* $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 obtain a copy of
* the Licens... |
protected boolean checkAccess()
{
setResponsePage(RedirectPage.class);
return false;
}
} | public boolean checkAccess()
{
setResponsePage(RedirectPage.class);
return false;
}
} |
protected boolean checkAccess()
{
setResponsePage(new RedirectPage());
return false;
}
} | public boolean checkAccess()
{
setResponsePage(new RedirectPage());
return false;
}
} |
public String toString() {
StringBuffer txt = new StringBuffer();
txt.append("stream:error (").append(code).append(")");
return txt.toString();
}
| public String toString() {
StringBuilder txt = new StringBuilder();
txt.append("stream:error (").append(code).append(")");
return txt.toString();
}
|
public String getChildElementXML() {
StringBuffer buf = new StringBuffer();
buf.append("<sharedgroup xmlns=\"http://www.jivesoftware.org/protocol/sharedgroup\">");
for (Iterator it=groups.iterator(); it.hasNext();) {
buf.append("<group>").append(it.next()).append("</group>");
... | public String getChildElementXML() {
StringBuilder buf = new StringBuilder();
buf.append("<sharedgroup xmlns=\"http://www.jivesoftware.org/protocol/sharedgroup\">");
for (Iterator it=groups.iterator(); it.hasNext();) {
buf.append("<group>").append(it.next()).append("</group>");
... |
public void create (Composite parent, int style) {
/*
* Note. Loading the webkit bundle on Jaguar causes a crash.
* The workaround is to detect any OS prior to 10.30 and fail
* without crashing.
*/
if (OS.VERSION < 0x1030) {
browser.dispose();
SWT.error(SWT.ERROR_NO_HANDLES);
}
/*
* Bug in Safari. For ... | public void create (Composite parent, int style) {
/*
* Note. Loading the webkit bundle on Jaguar causes a crash.
* The workaround is to detect any OS prior to 10.30 and fail
* without crashing.
*/
if (OS.VERSION < 0x1030) {
browser.dispose();
SWT.error(SWT.ERROR_NO_HANDLES);
}
/*
* Bug in Safari. For ... |
public void orderBy(Select sel, ExpContext ctx, ExpState state,
boolean asc) {
sel.orderBy(newSQLBuffer(sel, ctx, state), asc, false);
}
| public void orderBy(Select sel, ExpContext ctx, ExpState state,
boolean asc) {
sel.orderBy(newSQLBuffer(sel, ctx, state), asc, false, getSelectAs());
}
|
public AbstractDB2Dictionary() {
numericTypeName = "DOUBLE";
bitTypeName = "SMALLINT";
smallintTypeName = "SMALLINT";
tinyintTypeName = "SMALLINT";
longVarbinaryTypeName = "BLOB";
varbinaryTypeName = "BLOB";
// DB2-based databases have restrictions on having ... | public AbstractDB2Dictionary() {
numericTypeName = "DOUBLE";
bitTypeName = "SMALLINT";
smallintTypeName = "SMALLINT";
tinyintTypeName = "SMALLINT";
longVarbinaryTypeName = "BLOB";
varbinaryTypeName = "BLOB";
// DB2-based databases have restrictions on having ... |
public void dispose(ID containerID) {
config = null;
}
| public void dispose(ID containerID) {
System.out.println("");
}
|
public DOMParser(SymbolTable symbolTable, XMLGrammarPool grammarPool) {
super((XMLParserConfiguration)ObjectFactory.createObject(
"org.apache.xerces.xni.parser.XMLParserConfiguration",
"org.apache.xerces.parsers.XML11Configuration"
));
// set properties
f... | public DOMParser(SymbolTable symbolTable, XMLGrammarPool grammarPool) {
super((XMLParserConfiguration)ObjectFactory.createObject(
"org.apache.xerces.xni.parser.XMLParserConfiguration",
"org.apache.xerces.parsers.XIncludeAwareParserConfiguration"
));
// set proper... |
protected void onBeforeRenderChildren()
{
super.onBeforeRenderChildren();
try
{
// Loop through child components
final int size = children_size();
for (int i = 0; i < size; i++)
{
// Get next child
final Component child = children_get(i);
// Call begin request on the child
child.bef... | public Object component(Component component)
{
component.setFlag(FLAG_ATTACHING, false);
component.setFlag(FLAG_ATTACHED, true);
return IVisitor.CONTINUE_TRAVERSAL;
}
});
setFlag(FLAG_ATTACHING, false);
setFlag(FLAG_ATTACHED, true);
}
}
void detachChildren()
{
// Loop throug... |
public Activator() {
plugin = this;
}
void registerService(IPresenceService service) {
services.put(service, context.registerService(IPresenceService.class
.getName(), service, null));
}
void unregisterService(IPresenceService service) {
ServiceRegistration registration = (ServiceRegistration) services... | public Activator() {
plugin = this;
}
void registerService(IPresenceService service) {
services.put(service, context.registerService(IPresenceService.class
.getName(), service, null));
}
void unregisterService(IPresenceService service) {
ServiceRegistration registration = (ServiceRegistration) services... |
protected void onSessionAttach()
{
localizedImageResource.sessionAttach();
}
| protected void onSessionAttach()
{
localizedImageResource.bind();
}
|
public PageA(PageB page)
{
this.page = page;
//add(new AttributeModifier("test",new Model(page)));
}
| public PageA(PageB page)
{
this.page = page;
add(new AttributeModifier("test",new Model(page)));
}
|
public void setA(PageA a)
{
this.a = a;
//add(new AttributeModifier("test",new Model(a)));
}
| public void setA(PageA a)
{
this.a = a;
add(new AttributeModifier("test",new Model(a)));
}
|
public Date getObject()
{
return new Date();
}
}));
// add a label with a model that gets its display text from a resource
// bundle
// (which is in this case LabelPage.properties)
// We use key 'label.current.locale' and provide a the current locale
// for
// parameter substitution.
Strin... | public Date getObject()
{
return new Date();
}
}));
// add a label with a model that gets its display text from a resource
// bundle
// (which is in this case LabelPage.properties)
// We use key 'label.current.locale' and provide a the current locale
// for
// parameter substitution.
Strin... |
public void controlResized(ControlEvent e) {
setExampleWidgetSize ();
}
});
return tabFolderPage;
}
/**
* Gets the "Example" widget children.
*/
Widget [] getExampleWidgets () {
return new Widget [] {text};
}
/**
* Returns a list of set/get API method names (without the set/get prefix)
... | public void controlResized(ControlEvent e) {
setExampleWidgetSize ();
}
});
return tabFolderPage;
}
/**
* Gets the "Example" widget children.
*/
Widget [] getExampleWidgets () {
return new Widget [] {text};
}
/**
* Returns a list of set/get API method names (without the set/get prefix)
... |
private void modify(HTTPSamplerBase sampler, String value) {
if (isPathExtension()) {
if (isPathExtensionNoEquals()) {
sampler.setPath(sampler.getPath() + ";" + getArgumentName() + value);
} else {
sampler.setPath(sampler.getPath() + ";" + getArgumentName() + "=" + value);
}
} else {
sampler.ge... | private void modify(HTTPSamplerBase sampler, String value) {
if (isPathExtension()) {
if (isPathExtensionNoEquals()) {
sampler.setPath(sampler.getPath() + ";" + getArgumentName() + value);
} else {
sampler.setPath(sampler.getPath() + ";" + getArgumentName() + "=" + value);
}
} else {
sampler.ge... |
private void openDump () {
if (print != null) return;
Date now = new Date();
fileName = FILENAME_PREFIX + "."
+ new SimpleDateFormat("yyyyMMdd").format(now) + "."
+ new SimpleDateFormat("HHmmss.SSS").format(now) + "."
+ FILENAME_SUFFIX;
try {
print = new PrintStream(new FileOutputStream(fileName... | private void openDump () {
if (print != null) return;
Date now = new Date();
fileName = FILENAME_PREFIX + "."
+ new SimpleDateFormat("yyyyMMdd").format(now) + "."
+ new SimpleDateFormat("HHmmss.SSS").format(now) + "."
+ FILENAME_SUFFIX;
try {
print = new PrintStream(new FileOutputStream(fileName... |
List<String> getAttributeNames(Request request);
/*
* $Id: ISessionStore.java 3777 2006-01-14 14:49:01 -0800 (Sat, 14 Jan 2006)
* jonathanlocke $ $Revision: 3777 $ $Date: 2006-01-14 14:49:01 -0800 (Sat, 14
* Jan 2006) $
*
* ==============================================================================
* License... | List<String> getAttributeNames(Request request);
/*
* $Id: ISessionStore.java 3777 2006-01-14 14:49:01 -0800 (Sat, 14 Jan 2006)
* jonathanlocke $ $Revision: 3777 $ $Date: 2006-01-14 14:49:01 -0800 (Sat, 14
* Jan 2006) $
*
* ==============================================================================
* License... |
private void showVexWidget() {
if (this.vexWidget != null) {
return;
}
if (this.loadingLabel != null) {
this.loadingLabel.dispose();
this.loadingLabel = null;
}
GridLayout layout = new GridLayout();
layout... | private void showVexWidget() {
if (this.vexWidget != null) {
return;
}
if (this.loadingLabel != null) {
this.loadingLabel.dispose();
this.loadingLabel = null;
}
GridLayout layout = new GridLayout();
layout... |
public static synchronized TopicConnectionFactory getTopicConnectionFactory(
Context ctx, String fac){
while (factory == null){
try {
Object objfac = ctx.lookup(fac);
if (objfac instanceof TopicConnectionFactory){
factory = (TopicConnectionFactory)objfac;
}
} catch (NamingException e){
lo... | public static synchronized TopicConnectionFactory getTopicConnectionFactory(
Context ctx, String fac){
while (factory == null){
try {
Object objfac = ctx.lookup(fac);
if (objfac instanceof TopicConnectionFactory){
factory = (TopicConnectionFactory)objfac;
}
} catch (NamingException e){
lo... |
public final void onRequest()
{
AjaxRequestTarget target = new AjaxRequestTarget();
RequestCycle.get().setRequestTarget(target);
respond(target);
}
| public final void onRequest()
{
AjaxRequestTarget target = new AjaxRequestTarget(getComponent().getPage());
RequestCycle.get().setRequestTarget(target);
respond(target);
}
|
public static String rewriteToContextRelative(String url, RequestCycle requestCycle)
{
if (isRelative(url))
{
return requestCycle.getUrlRenderer().renderContextPathRelativeUrl(url);
}
else
{
return url;
}
}
| public static String rewriteToContextRelative(String url, RequestCycle requestCycle)
{
if (isRelative(url))
{
return requestCycle.getUrlRenderer().renderContextRelativeUrl(url);
}
else
{
return url;
}
}
|
public void respond(final IRequestCycle requestCycle)
{
final String location;
if (redirectUrl.startsWith("/"))
{
// context-absolute url
location = requestCycle.getUrlRenderer().renderContextPathRelativeUrl(redirectUrl);
}
else
{
// if relative url, servlet container will translate to absolute ... | public void respond(final IRequestCycle requestCycle)
{
final String location;
if (redirectUrl.startsWith("/"))
{
// context-absolute url
location = requestCycle.getUrlRenderer().renderContextRelativeUrl(redirectUrl);
}
else
{
// if relative url, servlet container will translate to absolute as
... |
public void setConverterProvider(Component component);
/*
* $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 obtain a... | public void setConverterProvider(Component component);
}
|
private ComponentTag handleNext(ComponentTag tag) throws ParseException
{
// Ignore all close tags. Wicket params tags must not be close tags
// and components preceding the param tag can not be close tags
// either.
if (tag.isClose())
{
return tag;
}
// Wicket component tags will have a component n... | private ComponentTag handleNext(ComponentTag tag) throws ParseException
{
// Ignore all close tags. Wicket params tags must not be close tags
// and components preceding the param tag can not be close tags
// either.
if (tag.isClose())
{
return tag;
}
// Wicket component tags will have a component n... |
public static String[] getAllFlags() {
return new String[]{"no_gen", "address", "const", "dynamic", "cpp", "new", "delete"};
}
| public static String[] getAllFlags() {
return new String[]{"no_gen", "address", "const", "dynamic", "jni", "cpp", "new", "delete"};
}
|
public ServiceEndpointDescriptionImpl(ID localContainerID,
IServiceInfo serviceInfo) {
this.serviceInfo = serviceInfo;
// add localContainerID to set of service properties exposed by this
this.serviceInfo.getServiceProperties().setProperty(
ECFServicePublication.CONTAINER_ID_PROP, localContainerID);
}
| public ServiceEndpointDescriptionImpl(ID localContainerID,
IServiceInfo serviceInfo) {
this.serviceInfo = serviceInfo;
// add localContainerID to set of service properties exposed by this
this.serviceInfo.getServiceProperties().setProperty(
ECFServicePublication.DISCOVERY_CONTAINER_ID_PROP, localContainer... |
public void validate(String content, ValidationContext context) throws InvalidDatatypeValueException {
StringTokenizer parsedList = new StringTokenizer(content);
int numberOfTokens = parsedList.countTokens();
if (numberOfTokens == 0) {
throw new InvalidDatatypeValueException("E... | public void validate(String content, ValidationContext context) throws InvalidDatatypeValueException {
StringTokenizer parsedList = new StringTokenizer(content," ");
int numberOfTokens = parsedList.countTokens();
if (numberOfTokens == 0) {
throw new InvalidDatatypeValueExceptio... |
public void hello(String from) {
System.out.println("Got hello() from "+from);
}
| public void hello(String from) {
System.out.println(this.getClass().getName()+".hello from="+from);
}
|
public void process() {
AnnotationTypeDeclaration annotationDeclaration = (AnnotationTypeDeclaration) environment
.getTypeDeclaration(SOAPBinding.class.getName());
Collection<Declaration> annotatedTypes = environment
.getDeclarationsAnnotatedWith(annotationDeclaration);
... | public void process() {
AnnotationTypeDeclaration annotationDeclaration = (AnnotationTypeDeclaration) environment
.getTypeDeclaration(SOAPBinding.class.getName());
Collection<Declaration> annotatedTypes = environment
.getDeclarationsAnnotatedWith(annotationDeclaration);
... |
public void doAction(ActionEvent e) {
GuiPackage guiPack = GuiPackage.getInstance();
JMeterTreeNode[] currentNodes = guiPack.getTreeListener().getSelectedNodes();
currentNodes = Copy.filterNodes(currentNodes);
Copy.setCopiedNodes(currentNodes);
for (int i = 0; i < currentNod... | public void doAction(ActionEvent e) {
GuiPackage guiPack = GuiPackage.getInstance();
JMeterTreeNode[] currentNodes = guiPack.getTreeListener().getSelectedNodes();
currentNodes = Copy.keepOnlyAncestors(currentNodes);
Copy.setCopiedNodes(currentNodes);
for (int i = 0; i < curr... |
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);
... |
public void doAction(ActionEvent e) {
JFileChooser chooser = FileDialoger.promptToOpenFile(new String[] { ".jmx" }); //$NON-NLS-1$
if (chooser == null) {
return;
}
File selectedFile = chooser.getSelectedFile();
if(selectedFile != null) {
boolean mergin... | public void doAction(ActionEvent e) {
JFileChooser chooser = FileDialoger.promptToOpenFile(new String[] { ".jmx" }); //$NON-NLS-1$
if (chooser == null) {
return;
}
File selectedFile = chooser.getSelectedFile();
if(selectedFile != null) {
boolean mergin... |
public void doAction(ActionEvent e) {
boolean merging = e.getActionCommand().equals("merge");
if (!merging) {
ReportActionRouter.getInstance().doActionNow(
new ActionEvent(e.getSource(), e.getID(), "close"));
}
JFileChooser chooser = ReportFileDialog... | public void doAction(ActionEvent e) {
boolean merging = e.getActionCommand().equals("merge");
if (!merging) {
ReportActionRouter.getInstance().doActionNow(
new ActionEvent(e.getSource(), e.getID(), "close"));
}
JFileChooser chooser = ReportFileDialog... |
public void drawImage(Image image, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight) {
if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (srcWidth == 0 || srcHeight == 0 || destWidth == 0 || destHeight == 0) return;
if (srcX < 0 || srcY < 0 || srcWidth ... | public void drawImage(Image image, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight) {
if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (srcWidth == 0 || srcHeight == 0 || destWidth == 0 || destHeight == 0) return;
if (srcX < 0 || srcY < 0 || srcWidth ... |
public void reset(XMLComponentManager componentManager) {
// set symbol table
fSymbolTable = (SymbolTable) componentManager.getProperty(SYMBOL_TABLE);
//set entity resolver
fEntityResolver = (XMLEntityResolver) componentManager.getProperty(ENTITY_MANAGER);
X... | public void reset(XMLComponentManager componentManager) {
// set symbol table
fSymbolTable = (SymbolTable) componentManager.getProperty(SYMBOL_TABLE);
//set entity resolver
fEntityResolver = (XMLEntityResolver) componentManager.getProperty(ENTITY_MANAGER);
X... |
public void testCreateAssociations() throws Exception {
// Create two GUIDs and store them in idStore
final ID guid1 = IDFactory.getDefault().createGUID();
final IIDEntry entry1 = idStore.store(guid1);
final ID guid2 = IDFactory.getDefault().createGUID();
final IIDEntry entry2 = idStore.store(guid2);
final... | public void testCreateAssociations() throws Exception {
// Create two GUIDs and store them in idStore
final ID guid1 = IDFactory.getDefault().createGUID();
final IIDEntry entry1 = idStore.store(guid1);
final ID guid2 = IDFactory.getDefault().createGUID();
final IIDEntry entry2 = idStore.store(guid2);
final... |
protected void init()
{
super.init();
addComponentInstantiationListener(new GuiceComponentInjector(this));
}
| protected void init()
{
super.init();
getComponentInstantiationListeners().add(new GuiceComponentInjector(this));
}
|
protected void init()
{
getDebugSettings().setDevelopmentUtilitiesEnabled(true);
// THIS LINE IS IMPORTANT - IT INSTALLS THE COMPONENT INJECTOR THAT WILL
// INJECT NEWLY CREATED COMPONENTS WITH THEIR SPRING DEPENDENCIES
addComponentInstantiationListener(new SpringComponentInjector(this));
}
| protected void init()
{
getDebugSettings().setDevelopmentUtilitiesEnabled(true);
// THIS LINE IS IMPORTANT - IT INSTALLS THE COMPONENT INJECTOR THAT WILL
// INJECT NEWLY CREATED COMPONENTS WITH THEIR SPRING DEPENDENCIES
getComponentInstantiationListeners().add(new SpringComponentInjector(this));
}
|
public void testBasicOperations() throws Exception
{
Application.get().addRequestCycleListener(new IncrementingListener());
RequestCycle cycle = newRequestCycle(false);
assertValues(0, 0, 0, 0, 0, 0, 0);
/*
* begins, ends, responses and detaches should increment by one because we have one listener
*
... | public void testBasicOperations() throws Exception
{
Application.get().getRequestCycleListeners().add(new IncrementingListener());
RequestCycle cycle = newRequestCycle(false);
assertValues(0, 0, 0, 0, 0, 0, 0);
/*
* begins, ends, responses and detaches should increment by one because we have one listener... |
public void setObjectValue(Object v) {
if (v instanceof Boolean) {
value = ((Boolean) v).booleanValue();
} else {
value = Boolean.valueOf(v.toString()).booleanValue();
}
}
| public void setObjectValue(Object v) {
if (v instanceof Boolean) {
value = ((Boolean) v).booleanValue();
} else {
value = Boolean.parseBoolean(v.toString());
}
}
|
public void removeShellListener(ShellListener listener) {
checkWidget();
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
if (eventTable == null) return;
eventTable.unhook(SWT.Activate, listener);
eventTable.unhook(SWT.Close, listener);
eventTable.unhook(SWT.Deactivate, listener);
eventTable.unhook(SWT.Ico... | public void removeShellListener(ShellListener listener) {
checkWidget();
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
if (eventTable == null) return;
eventTable.unhook(SWT.Activate, listener);
eventTable.unhook(SWT.Close, listener);
eventTable.unhook(SWT.Deactivate, listener);
eventTable.unhook(SWT.Ico... |
private static void write(BCClass bc, PCEnhancer enhancer,
Map<Class<?>, byte[]> map, Class<?> cls, List<Class<?>> subs, List<Class<?>> ints)
throws IOException {
if (bc == enhancer.getManagedTypeBytecode()) {
// if it was already defined, don't put it in the map,
//... | private static void write(BCClass bc, PCEnhancer enhancer,
Map<Class<?>, byte[]> map, Class<?> cls, List<Class<?>> subs, List<Class<?>> ints)
throws IOException {
if (bc == enhancer.getManagedTypeBytecode()) {
// if it was already defined, don't put it in the map,
//... |
private boolean isEnum() {
if (_enumField == null) {
Class<?> decl = getDeclaredType();
_enumField = JavaVersions.isEnumeration(decl)
? Boolean.TRUE : Boolean.FALSE;
}
return _enumField.booleanValue();
}
| private boolean isEnum() {
if (_enumField == null) {
Class<?> decl = getDeclaredType();
_enumField = Enum.class.isAssignableFrom(decl)
? Boolean.TRUE : Boolean.FALSE;
}
return _enumField.booleanValue();
}
|
protected void parseNewResource(Reader xml, String sourceName)
throws IOException {
if (_log != null && _log.isTraceEnabled())
_log.trace(_loc.get("start-parse", sourceName));
// even if we want to validate, specify that it won't happen
// if we have neither a DocType no... | protected void parseNewResource(Reader xml, String sourceName)
throws IOException {
if (_log != null && _log.isTraceEnabled())
_log.trace(_loc.get("start-parse", sourceName));
// even if we want to validate, specify that it won't happen
// if we have neither a DocType no... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.