buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public Object convert( final Object object, final Context context )
throws ConverterException
{
try
{
return new Integer( (String)object );
}
catch( final NumberFormatException nfe )
{
final String message = REZ.getString( "convert.bad-inte... | public Object convert( final Object object, final Object context )
throws ConverterException
{
try
{
return new Integer( (String)object );
}
catch( final NumberFormatException nfe )
{
final String message = REZ.getString( "convert.bad-integ... |
public Object convert( final Object object, final Context context )
throws ConverterException
{
try
{
return new Long( (String)object );
}
catch( final NumberFormatException nfe )
{
final String message = REZ.getString( "convert.bad-long.er... | public Object convert( final Object object, final Object context )
throws ConverterException
{
try
{
return new Long( (String)object );
}
catch( final NumberFormatException nfe )
{
final String message = REZ.getString( "convert.bad-long.err... |
public Object convert( final Object object, final Context context )
throws ConverterException
{
try
{
return new Short( (String)object );
}
catch( final NumberFormatException nfe )
{
final String message = REZ.getString( "convert.bad-short.... | public Object convert( final Object object, final Object context )
throws ConverterException
{
try
{
return new Short( (String)object );
}
catch( final NumberFormatException nfe )
{
final String message = REZ.getString( "convert.bad-short.e... |
public Object convert( final Object object, final Context context )
throws ConverterException
{
try
{
return new URL( (String)object );
}
catch( final MalformedURLException mue )
{
final String message = REZ.getString( "convert.bad-url.erro... | public Object convert( final Object object, final Object context )
throws ConverterException
{
try
{
return new URL( (String)object );
}
catch( final MalformedURLException mue )
{
final String message = REZ.getString( "convert.bad-url.error... |
protected Object convert( Object original, Context context )
throws ConverterException
{
/*
String path = (String)original;
TaskContext taskContext = (TaskContext)context;
Path retval = new Path( path );
retval.setBaseDirectory( taskContext.getBaseDirectory() );
... | protected Object convert( Object original, Object context )
throws ConverterException
{
/*
String path = (String)original;
TaskContext taskContext = (TaskContext)context;
Path retval = new Path( path );
retval.setBaseDirectory( taskContext.getBaseDirectory() );
... |
public IMarkupSettings getMarkupSettings()
{
checkSettingsAvailable();
if (markupSettings == null)
{
markupSettings = new MarkupSettings(this);
}
return markupSettings;
}
| public IMarkupSettings getMarkupSettings()
{
checkSettingsAvailable();
if (markupSettings == null)
{
markupSettings = new MarkupSettings();
}
return markupSettings;
}
|
protected abstract void setChild(MarkupContainer parent, int index, Component child);
/**
* Reconstructs the component
*
* @param parent
* parent of the component
* @param index
* position in parent's children
* @return reconstructed component
*/
Component reconstruct(MarkupCo... | protected abstract void setChild(MarkupContainer parent, int index, Component child);
/**
* Reconstructs the component
*
* @param parent
* parent of the component
* @param index
* position in parent's children
* @return reconstructed component
*/
Component reconstruct(MarkupCo... |
private static final long serialVersionUID = 1L;
};
};
| private static final long serialVersionUID = 1L;
};
}
|
public Boolean put(String key, Boolean value)
{
// add the key to the hash map. Do not replace existing once
Boolean rtn = super.putIfAbsent(key, value);
// If found, than remove it from the fifo list and ...
if (rtn != null)
{
fifo.remove(key);
}
// append it at the end of the list
fi... | public Boolean put(String key, Boolean value)
{
// add the key to the hash map. Do not replace existing once
Boolean rtn = super.putIfAbsent(key, value);
// If found, than remove it from the fifo list and ...
if (rtn != null)
{
fifo.remove(key);
}
// append it at the end of the list
fi... |
public IResource getResource()
{
return resource;
}
};
| public IResource getResource()
{
return resource;
}
}
|
private void internalRenderJavaScriptReference(String url, String id)
{
if (Strings.isEmpty(url))
{
throw new IllegalArgumentException("url cannot be empty or null");
}
if (!closed)
{
List<String> token1 = Arrays.asList("javascript", url);
List<String> token2 = (id != null) ? Arrays.asList("javascr... | private void internalRenderJavaScriptReference(String url, String id)
{
if (Strings.isEmpty(url))
{
throw new IllegalArgumentException("url cannot be empty or null");
}
if (!closed)
{
List<String> token1 = Arrays.asList("javascript", url);
List<String> token2 = (id != null) ? Arrays.asList("javascr... |
public final void putAll(Map<? extends String, ? extends Object> map)
{
for (Object o : map.keySet())
{
String key = (String)o;
checkIdAttribute(key);
}
super.putAll(map);
}
}
| public final void putAll(Map<? extends String, ?> map)
{
for (Object o : map.keySet())
{
String key = (String)o;
checkIdAttribute(key);
}
super.putAll(map);
}
}
|
public void write(byte[] array)
{
if (textResponse != null)
{
throw new IllegalStateException("Text response has already been initiated.");
}
if (binaryResponse == null)
{
binaryResponse = new ByteArrayOutputStream();
}
try
{
binaryResponse.write(array);
}
catch (IOException yeahRight)
... | public void write(byte[] array)
{
if (textResponse != null)
{
throw new IllegalStateException("Text response has already been initiated.");
}
if (binaryResponse == null)
{
binaryResponse = new ByteArrayOutputStream();
}
try
{
binaryResponse.write(array);
}
catch (IOException ignored)
{
... |
public int hashCode()
{
return Objects.hashCode(getPageId(), getSessionId());
}
};
| public int hashCode()
{
return Objects.hashCode(getPageId(), getSessionId());
}
}
|
public boolean isCookiesEnabled()
{
if (!cookiesEnabled && RequestCycle.get() != null)
{
Collection<Cookie> cookies = ((WebRequest)RequestCycle.get().getRequest()).getCookies();
cookiesEnabled = cookies != null ? cookies.size() > 0 : false;
}
return cookiesEnabled;
}
| public boolean isCookiesEnabled()
{
if (!cookiesEnabled && RequestCycle.get() != null)
{
Collection<Cookie> cookies = ((WebRequest)RequestCycle.get().getRequest()).getCookies();
cookiesEnabled = cookies != null && cookies.size() > 0;
}
return cookiesEnabled;
}
|
public SessionData[] getLiveSessions()
{
final SessionData[] sessions = liveSessions.values().toArray(new SessionData[0]);
Arrays.sort(sessions);
return sessions;
}
| public SessionData[] getLiveSessions()
{
final SessionData[] sessions = liveSessions.values().toArray(new SessionData[liveSessions.values().size()]);
Arrays.sort(sessions);
return sessions;
}
|
public void putAll(Map<? extends String, ? extends Object> m)
{
throw new UnsupportedOperationException();
}
} | public void putAll(Map<? extends String, ?> m)
{
throw new UnsupportedOperationException();
}
} |
protected static String encodeResourceReferenceAttributes(
ResourceReference.UrlAttributes attributes)
{
if (attributes == null ||
(attributes.getLocale() == null && attributes.getStyle() == null && attributes.getVariation() == null))
{
return null;
}
else
{
StringBuilder res = new StringBuilder(... | protected static String encodeResourceReferenceAttributes(
ResourceReference.UrlAttributes attributes)
{
if (attributes == null ||
(attributes.getLocale() == null && attributes.getStyle() == null && attributes.getVariation() == null))
{
return null;
}
else
{
StringBuilder res = new StringBuilder(... |
public enum ContentDisposition {
/**
* Inline resources are usually displayed within the browser window
*/
INLINE,
/**
* For attachment resources the browser should display a save dialog
*/
ATTACHMENT;
}
| public enum ContentDisposition {
/**
* Inline resources are usually displayed within the browser window
*/
INLINE,
/**
* For attachment resources the browser should display a save dialog
*/
ATTACHMENT
}
|
private final static Method findGetter(Class<?> clz, String expression)
{
String name = Character.toUpperCase(expression.charAt(0)) + expression.substring(1);
Method method = null;
try
{
method = clz.getMethod("get" + name, (Class[])null);
}
catch (Exception e)
{
}
if (method == null)
{
try
... | private final static Method findGetter(Class<?> clz, String expression)
{
String name = Character.toUpperCase(expression.charAt(0)) + expression.substring(1);
Method method = null;
try
{
method = clz.getMethod("get" + name, (Class[])null);
}
catch (Exception ignored)
{
}
if (method == null)
{
... |
public void onLinkClicked()
{
PageParametersNg params = new PageParametersNg();
params.setNamedParameter("color", "red");
RequestCycle.get().setResponsePage(TestPage4.class, params);
};
};
l6.setLabel("Link 6 - Goto Test Page 4 - stateless, with mounted parameters");
add(l6);
}
| public void onLinkClicked()
{
PageParametersNg params = new PageParametersNg();
params.setNamedParameter("color", "red");
RequestCycle.get().setResponsePage(TestPage4.class, params);
}
};
l6.setLabel("Link 6 - Goto Test Page 4 - stateless, with mounted parameters");
add(l6);
}
|
public void onCancel()
{
};
| public void onCancel()
{
}
|
public static Url parse(String url, Charset charset)
{
Args.notNull(url, "url");
Url result = new Url(charset);
// the url object resolved the charset, use that
charset = result.getCharset();
String segments;
String query;
int qIndex = url.indexOf('?');
if (qIndex == -1)
{
segments = url;
... | public static Url parse(String url, Charset charset)
{
Args.notNull(url, "url");
Url result = new Url(charset);
// the url object resolved the charset, use that
charset = result.getCharset();
String segments;
String query;
int qIndex = url.indexOf('?');
if (qIndex == -1)
{
segments = url;
... |
private final String getBeanNameOfClass(final ApplicationContext ctx, final Class<?> clazz)
{
// get the list of all possible matching beans
List<String> names = new ArrayList<String>(
Arrays.asList(BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ctx, clazz)));
// filter out beans that are not candidate... | private final String getBeanNameOfClass(final ApplicationContext ctx, final Class<?> clazz)
{
// get the list of all possible matching beans
List<String> names = new ArrayList<String>(
Arrays.asList(BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ctx, clazz)));
// filter out beans that are not candidate... |
private final String getBeanNameOfClass(ApplicationContext ctx, Class<?> clazz)
{
// get the list of all possible matching beans
List<String> names = new ArrayList<String>(
Arrays.asList(BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ctx, clazz)));
// filter out beans that are not candidates for autowi... | private final String getBeanNameOfClass(ApplicationContext ctx, Class<?> clazz)
{
// get the list of all possible matching beans
List<String> names = new ArrayList<String>(
Arrays.asList(BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ctx, clazz)));
// filter out beans that are not candidates for autowi... |
public static String[] stringToArray(final String value)
{
BufferedReader reader = new BufferedReader(new StringReader(value));
List<String> l = new LinkedList<String>();
String s;
try
{
while ((s = reader.readLine()) != null)
{
l.add(s);
}
}
catch (java.io.IOException e)
{
}
return l... | public static String[] stringToArray(final String value)
{
BufferedReader reader = new BufferedReader(new StringReader(value));
List<String> l = new LinkedList<String>();
String s;
try
{
while ((s = reader.readLine()) != null)
{
l.add(s);
}
}
catch (java.io.IOException ignored)
{
}
re... |
public void track(String path, Object marker)
{
track(path, marker, (FileDeleteStrategy)null);
}
| public void track(String path, Object marker)
{
track(path, marker, null);
}
|
public static boolean remove(final java.io.File file)
{
// Delete current file
if (!file.delete())
{
// NOTE: fix for java/win bug. see:
// http://forum.java.sun.com/thread.jsp?forum=4&thread=158689&tstart=
// 0&trange=15
System.gc();
try
{
Thread.sleep(100);
}
catch (InterruptedExce... | public static boolean remove(final java.io.File file)
{
// Delete current file
if (!file.delete())
{
// NOTE: fix for java/win bug. see:
// http://forum.java.sun.com/thread.jsp?forum=4&thread=158689&tstart=
// 0&trange=15
System.gc();
try
{
Thread.sleep(100);
}
catch (InterruptedExce... |
public String toString()
{
// Result buffer
final StringBuilder buffer = new StringBuilder();
// For each occurrences of "${"or "$$"
int start;
int pos = 0;
while ((start = lowerPositive(string.indexOf("$$", pos), string.indexOf("${", pos))) != -1)
{
// Append text before possible variable
buffe... | public String toString()
{
// Result buffer
final StringBuilder buffer = new StringBuilder();
// For each occurrences of "${"or "$$"
int start;
int pos = 0;
while ((start = lowerPositive(string.indexOf("$$", pos), string.indexOf("${", pos))) != -1)
{
// Append text before possible variable
buffe... |
private static enum Action {
CONTINUE, CONTINUE_BUT_DONT_GO_DEEPER, STOP;
}
| private static enum Action {
CONTINUE, CONTINUE_BUT_DONT_GO_DEEPER, STOP
}
|
public String toString() {
StringBuffer sb = new StringBuffer("XMLRPCID["); //$NON-NLS-1$
sb.append(getName()).append("]"); //$NON-NLS-1$
return sb.toString();
}
| public String toString() {
StringBuffer sb = new StringBuffer("XmlRpcId["); //$NON-NLS-1$
sb.append(getName()).append("]"); //$NON-NLS-1$
return sb.toString();
}
|
public ITagElement resolve(
final IFaceletTagResolvingStrategy.TLDWrapper elementDecl)
{
// final IProjectFacetVersion version = JSFAppConfigUtils
// .getProjectFacet(_project);
// final String versionAsString = version.getVersionString();
// final JSFVersion jsfVersi... | public ITagElement resolve(
final IFaceletTagResolvingStrategy.TLDWrapper elementDecl)
{
// final IProjectFacetVersion version = JSFAppConfigUtils
// .getProjectFacet(_project);
// final String versionAsString = version.getVersionString();
// final JSFVersion jsfVersi... |
private ITagElement createFromTypeInfo(final TagIdentifier tagId,
final TypeInfo typeInfo)
{
final MetadataAttributeAdvisor advisor =
new MetadataAttributeAdvisor(tagId, _viewLoader);
if (typeInfo instanceof ComponentTypeInfo)
{
return new ComponentTag... | private ITagElement createFromTypeInfo(final TagIdentifier tagId,
final TypeInfo typeInfo)
{
final MetadataAttributeAdvisor advisor =
new MetadataAttributeAdvisor(tagId, _viewLoader);
if (typeInfo instanceof ComponentTypeInfo)
{
return new ComponentTag... |
public boolean munge(BcelClassWeaver weaver) {
ContextToken tok = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.MUNGING_WITH, this);
boolean changed = false;
boolean worthReporting = true;
if (munger.getKind() == ResolvedTypeMunger.Field) {
changed = mungeNewField(weaver, (NewFi... | public boolean munge(BcelClassWeaver weaver) {
ContextToken tok = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.MUNGING_WITH, this);
boolean changed = false;
boolean worthReporting = true;
if (munger.getKind() == ResolvedTypeMunger.Field) {
changed = mungeNewField(weaver, (NewFi... |
protected XSAttributeUse traverseLocal(Element attrDecl,
XSDocumentInfo schemaDoc,
SchemaGrammar grammar) {
// General Attribute Checking
Object[] attrValues = fAttrChecker.checkAttributes(attrDecl, false, schemaD... | protected XSAttributeUse traverseLocal(Element attrDecl,
XSDocumentInfo schemaDoc,
SchemaGrammar grammar) {
// General Attribute Checking
Object[] attrValues = fAttrChecker.checkAttributes(attrDecl, false, schemaD... |
public void setVisible (boolean visible) {
checkWidget ();
if (OS.IsWinCE) return;
if (visible == getVisible ()) return;
if (item == null) {
int hwnd = parent.handle;
TOOLINFO lpti = new TOOLINFO ();
lpti.cbSize = TOOLINFO.sizeof;
lpti.uId = id;
lpti.hwnd = hwnd;
int hwndToolTip = hwndToolTip ();
if (... | public void setVisible (boolean visible) {
checkWidget ();
if (OS.IsWinCE) return;
if (visible == getVisible ()) return;
if (item == null) {
int hwnd = parent.handle;
TOOLINFO lpti = new TOOLINFO ();
lpti.cbSize = TOOLINFO.sizeof;
lpti.uId = id;
lpti.hwnd = hwnd;
int hwndToolTip = hwndToolTip ();
if (... |
public String toString () {
String string = "*Disposed*"; //$NON-NLS-1$
if (!isDisposed ()) {
string = "*Wrong Thread*"; //$NON-NLS-1$
if (isValidThread ()) string = getNameText ();
}
return getName () + " {" + string + "}"; //$NON-NLS-1$ //$NON-NLS-2$
}
LRESULT wmCaptureChanged (int hwnd, int wParam, int lPar... | public String toString () {
String string = "*Disposed*"; //$NON-NLS-1$
if (!isDisposed ()) {
string = "*Wrong Thread*"; //$NON-NLS-1$
if (isValidThread ()) string = getNameText ();
}
return getName () + " {" + string + "}"; //$NON-NLS-1$ //$NON-NLS-2$
}
LRESULT wmCaptureChanged (int hwnd, int wParam, int lPar... |
protected final void validate()
{
// Redirect back to result to avoid postback warnings. But we turn
// redirecting on as the first thing because the user's handleSubmit
// implementation may wish to redirect somewhere else. In that case,
// they can simply call setRedirect(false) in handleSubmit.
getReques... | protected final void validate()
{
// Redirect back to result to avoid postback warnings. But we turn
// redirecting on as the first thing because the user's handleSubmit
// implementation may wish to redirect somewhere else. In that case,
// they can simply call setRedirect(false) in handleSubmit.
setRedire... |
public void onClick()
{
// Set page source's page as response page
getRequestCycle().setResponsePage(pageLink.getPage());
}
| public void onClick()
{
// Set page source's page as response page
setResponsePage(pageLink.getPage());
}
|
public void onClick()
{
// We do not need to redirect
getRequestCycle().setRedirect(false);
super.onClick();
}
| public void onClick()
{
// We do not need to redirect
setRedirect(false);
super.onClick();
}
|
public void onClick()
{
// We do not need to redirect
getRequestCycle().setRedirect(false);
super.onClick();
}
| public void onClick()
{
// We do not need to redirect
setRedirect(false);
super.onClick();
}
|
public boolean execute()
throws TaskException
{
getLogger().debug( "Using classic compiler" );
Commandline cmd = setupJavacCommand( true );
OutputStream logstr = new LogOutputStream( m_attributes, Project.MSG_WARN );
try
{
// Create an instance of the... | public boolean execute()
throws TaskException
{
getLogger().debug( "Using classic compiler" );
Commandline cmd = setupJavacCommand( true );
OutputStream logstr = new LogOutputStream( m_attributes.hackGetLogger(), true );
try
{
// Create an instance of... |
public void modifyTestElement(TestElement element) {
// Fetch data from screen fields
if (customizer instanceof GenericTestBeanCustomizer) {
GenericTestBeanCustomizer gtbc = (GenericTestBeanCustomizer) customizer;
gtbc.saveGuiFields();
}
configureTestElement(e... | public void modifyTestElement(TestElement element) {
// Fetch data from screen fields
if (customizer instanceof GenericTestBeanCustomizer) {
GenericTestBeanCustomizer gtbc = (GenericTestBeanCustomizer) customizer;
gtbc.saveGuiFields();
}
configureTestElement(e... |
private Result doDecode(BinaryBitmap image, Hashtable hints) throws NotFoundException {
int width = image.getWidth();
int height = image.getHeight();
BitArray row = new BitArray(width);
int middle = height >> 1;
boolean tryHarder = hints != null && hints.containsKey(DecodeHintType.TRY_HARDER);
... | private Result doDecode(BinaryBitmap image, Hashtable hints) throws NotFoundException {
int width = image.getWidth();
int height = image.getHeight();
BitArray row = new BitArray(width);
int middle = height >> 1;
boolean tryHarder = hints != null && hints.containsKey(DecodeHintType.TRY_HARDER);
... |
public void testUpdateReplicatedObjects() {
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
String[] names = {"USA", "India", "China"};
long[] population = {300,1200,1400};
for (int i = 0; i < names.length; i++) {
Country country = new Coun... | public void testUpdateReplicatedObjects() {
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
String[] names = {"USA", "India", "China"};
long[] population = {300,1200,1400};
for (int i = 0; i < names.length; i++) {
Country country = new Coun... |
public void setWidth (int width) {
checkLayout();
if (width < -1 || width == 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
if (this.wrapWidth == width) return;
freeRuns();
this.wrapWidth = width;
}
boolean shape (int /*long*/ hdc, StyleItem run, char[] chars, int[] glyphCount, int maxGlyphs) {
int hr = OS.ScriptShap... | public void setWidth (int width) {
checkLayout();
if (width < -1 || width == 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
if (this.wrapWidth == width) return;
freeRuns();
this.wrapWidth = width;
}
boolean shape (int /*long*/ hdc, StyleItem run, char[] chars, int[] glyphCount, int maxGlyphs) {
int hr = OS.ScriptShap... |
protected void init()
{
// Disable creation of javascript which jWebUnit (test only)
// doesn't handle properly
getPageSettings().setAutomaticMultiWindowSupport(false);
// mount single bookmarkable pages
mountBookmarkablePage("/the/homepage/path", Home.class);
mountBookmarkablePage("/a/nice/path/to/the/f... | protected void init()
{
// Disable creation of javascript which jWebUnit (test only)
// doesn't handle properly
getPageSettings().setAutomaticMultiWindowSupport(false);
// mount single bookmarkable pages
mountBookmarkablePage("/the/homepage/path", Home.class);
mountBookmarkablePage("/a/nice/path/to/the/f... |
protected void handleErrorFlush(String output) {
if (redirector.getErrorStream() != null) {
redirector.handleErrorFlush(output);
} else {
super.handleErrorOutput(output);
}
}
| protected void handleErrorFlush(String output) {
if (redirector.getErrorStream() != null) {
redirector.handleErrorFlush(output);
} else {
super.handleErrorFlush(output);
}
}
|
protected void explain()
{
String html = "<a wicket:id=\"pageLinkWithArgs\">go to our bookmarkable page passing a message argument</a>";
String code = " // Note that any arguments are passed as request parameters, and should thus be strings\n"
+ "  ... | protected void explain()
{
String html = "<a wicket:id=\"pageLinkWithArgs\">go to our bookmarkable page passing a message argument</a>";
String code = " // Note that any arguments are passed as request parameters, and should thus be strings\n"
+ "  ... |
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 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<Void>("customLoadingPageLink", PageWithCustomLoading.class));
}
|
public LeftFrame(BodyFrame index)
{
add(new ChangeFramePageLink("linkToPage1", index, Page1.class));
add(new ChangeFramePageLink("linkToPage2", index, Page2.class));
BookmarkablePageLink link = new BookmarkablePageLink("directLink", Home.class);
add(link);
| public LeftFrame(BodyFrame index)
{
add(new ChangeFramePageLink("linkToPage1", index, Page1.class));
add(new ChangeFramePageLink("linkToPage2", index, Page2.class));
BookmarkablePageLink<?> link = new BookmarkablePageLink<Void>("directLink", Home.class);
add(link);
|
public Home(final PageParameters parameters)
{
getSession().bind();
final String word = parameters.get("word").toOptionalString();
if (word == null)
{
getGame().newGame(5, new WordGenerator());
}
else
{
getGame().newGame(5, new WordGenerator(new String[] { word }));
}
add(new BookmarkablePageL... | public Home(final PageParameters parameters)
{
getSession().bind();
final String word = parameters.get("word").toOptionalString();
if (word == null)
{
getGame().newGame(5, new WordGenerator());
}
else
{
getGame().newGame(5, new WordGenerator(new String[] { word }));
}
add(new BookmarkablePageL... |
public void onClick()
{
tree.getTreeState().collapseAll();
}
});
add(new BookmarkablePageLink("ajaxTreeLink", SimpleTreePage.class));
}
| public void onClick()
{
tree.getTreeState().collapseAll();
}
});
add(new BookmarkablePageLink<Void>("ajaxTreeLink", SimpleTreePage.class));
}
|
public Page1(PageParameters parameters)
{
add(new BookmarkablePageLink("homeLink", Home.class));
}
| public Page1(PageParameters parameters)
{
add(new BookmarkablePageLink<Void>("homeLink", Home.class));
}
|
public Page3(PageParameters parameters)
{
add(new BookmarkablePageLink("homeLink", Home.class));
}
| public Page3(PageParameters parameters)
{
add(new BookmarkablePageLink<Void>("homeLink", Home.class));
}
|
public Page4(PageParameters parameters)
{
add(new BookmarkablePageLink("homeLink", Home.class));
}
| public Page4(PageParameters parameters)
{
add(new BookmarkablePageLink<Void>("homeLink", Home.class));
}
|
public HomePage()
{
add(new BookmarkablePageLink("annot-link", AnnotPage.class));
}
| public HomePage()
{
add(new BookmarkablePageLink<Void>("annot-link", AnnotPage.class));
}
|
public SimplePage_12()
{
add(new BookmarkablePageLink("link", SimplePage_3.class));
}
| public SimplePage_12()
{
add(new BookmarkablePageLink<Void>("link", SimplePage_3.class));
}
|
public SimplePage_2()
{
add(new Label("amount", new Model<String>("$5.00")).setRenderBodyOnly(true));
add(new BookmarkablePageLink("link", SimplePage_1.class));
}
| public SimplePage_2()
{
add(new Label("amount", new Model<String>("$5.00")).setRenderBodyOnly(true));
add(new BookmarkablePageLink<Void>("link", SimplePage_1.class));
}
|
public MockPageParameterPage(PageParameters pageParameters)
{
add(new BookmarkablePageLink("link", MockPageParameterPage.class,
new PageParameters("id=1")));
add(new Label("label", pageParameters.get("id").toString()));
}
| public MockPageParameterPage(PageParameters pageParameters)
{
add(new BookmarkablePageLink<Void>("link", MockPageParameterPage.class,
new PageParameters("id=1")));
add(new Label("label", pageParameters.get("id").toString()));
}
|
public ViewBook(Book book)
{
add(new Label("id", new PropertyModel(book, "id")));
add(new Label("name", new PropertyModel(book, "name")));
add(new BookmarkablePageLink("link", CreateBook.class));
}
| public ViewBook(Book book)
{
add(new Label("id", new PropertyModel(book, "id")));
add(new Label("name", new PropertyModel(book, "name")));
add(new BookmarkablePageLink<Void>("link", CreateBook.class));
}
|
public void handleEvent(Event event) {
if((event.detail & SWT.SELECTED) != 0) {
GC gc = event.gc;
Rectangle area = tree.getClientArea();
/*
* If you wish to paint the selection beyond the end of
* last column, you must change the clipping region.
*/
int columnCount = tree.getColum... | public void handleEvent(Event event) {
if((event.detail & SWT.SELECTED) != 0) {
GC gc = event.gc;
Rectangle area = tree.getClientArea();
/*
* If you wish to paint the selection beyond the end of
* last column, you must change the clipping region.
*/
int columnCount = tree.getColum... |
public void addTestString(String testString)
{
getTestStrings().addProperty(new StringProperty(testString,testString));
}
| public void addTestString(String testString)
{
getTestStrings().addProperty(new StringProperty(String.valueOf(testString.hashCode()),testString));
}
|
boolean value; //TODO: should these be private?
boolean savedValue;
| boolean value; //TODO: should these be private?
transient boolean savedValue;
|
public void setAppend(boolean append) {
redirector.setAppend(append);
incompatibleWithSpawn = true;
}
| public void setAppend(boolean append) {
redirector.setAppend(append);
incompatibleWithSpawn |= append;
}
|
public Caret getCaret () {
checkWidget();
return caret;
}
int kEventControlDraw (int nextHandler, int theEvent, int userData) {
int [] theControl = new int [1];
OS.GetEventParameter (theEvent, OS.kEventParamDirectObject, OS.typeControlRef, null, 4, null, theControl);
boolean isFocus = theControl [0] == handle ... | public Caret getCaret () {
checkWidget();
return caret;
}
int kEventControlDraw (int nextHandler, int theEvent, int userData) {
int [] theControl = new int [1];
OS.GetEventParameter (theEvent, OS.kEventParamDirectObject, OS.typeControlRef, null, 4, null, theControl);
boolean isFocus = theControl [0] == handle ... |
public void layout (Control [] changed) {
checkWidget ();
if (changed == null) error (SWT.ERROR_INVALID_ARGUMENT);
for (int i=0; i<changed.length; i++) {
Control control = changed [i];
if (control == null) error (SWT.ERROR_INVALID_ARGUMENT);
if (control.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
bool... | public void layout (Control [] changed) {
checkWidget ();
if (changed == null) error (SWT.ERROR_INVALID_ARGUMENT);
for (int i=0; i<changed.length; i++) {
Control control = changed [i];
if (control == null) error (SWT.ERROR_INVALID_ARGUMENT);
if (control.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
bool... |
public boolean isEnabled () {
return getEnabled () && parent.isEnabled ();
}
int keyGlyph (int key) {
switch (key) {
case SWT.BS: return OS.kMenuDeleteLeftGlyph;
case SWT.CR: return OS.kMenuReturnGlyph;
case SWT.DEL: return OS.kMenuDeleteRightGlyph;
case SWT.ESC: return OS.kMenuEscapeGlyph;
case SWT.LF: re... | public boolean isEnabled () {
return getEnabled () && parent.isEnabled ();
}
int keyGlyph (int key) {
switch (key) {
case SWT.BS: return OS.kMenuDeleteLeftGlyph;
case SWT.CR: return OS.kMenuReturnGlyph;
case SWT.DEL: return OS.kMenuDeleteRightGlyph;
case SWT.ESC: return OS.kMenuEscapeGlyph;
case SWT.LF: re... |
public int indexOf (TabItem item) {
checkWidget ();
if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
int count = OS.GetControl32BitMaximum (handle);
for (int i=0; i<count; i++) {
if (items [i] == item) return i;
}
return -1;
}
Point minimumSize (int wHint, int hHint, boolean flushCache) {
Control [] childre... | public int indexOf (TabItem item) {
checkWidget ();
if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
int count = OS.GetControl32BitMaximum (handle);
for (int i=0; i<count; i++) {
if (items [i] == item) return i;
}
return -1;
}
Point minimumSize (int wHint, int hHint, boolean flushCache) {
Control [] childre... |
public int indexOf (ToolItem item) {
checkWidget();
if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
if (item.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
for (int i=0; i<itemCount; i++) {
if (items [i] == item) return i;
}
return -1;
}
void invalidateChildrenVisibleRegion (int control) {
super.invalida... | public int indexOf (ToolItem item) {
checkWidget();
if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
if (item.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
for (int i=0; i<itemCount; i++) {
if (items [i] == item) return i;
}
return -1;
}
void invalidateChildrenVisibleRegion (int control) {
super.invalida... |
public Rectangle computeTrim (int x, int y, int width, int height) {
checkWidget();
Rectangle trim = super.computeTrim(x, y, width, height);
NSRect rect = new NSRect ();
rect.x = trim.x;
rect.y = trim.y;
rect.width = trim.width;
rect.height = trim.height;
if (window != null) {
if (!fixResize()) {
rect = wi... | public Rectangle computeTrim (int x, int y, int width, int height) {
checkWidget();
Rectangle trim = super.computeTrim(x, y, width, height);
NSRect rect = new NSRect ();
rect.x = trim.x;
rect.y = trim.y;
rect.width = trim.width;
rect.height = trim.height;
if (window != null) {
if (!fixResize()) {
rect = wi... |
public int add (Image image) {
int count = OS.ImageList_GetImageCount (handle);
int index = 0;
while (index < count) {
if (images [index] != null) {
if (images [index].isDisposed ()) images [index] = null;
}
if (images [index] == null) break;
index++;
}
if (count == 0) {
Rectangle rect = image.getBoun... | public int add (Image image) {
int count = OS.ImageList_GetImageCount (handle);
int index = 0;
while (index < count) {
if (images [index] != null) {
if (images [index].isDisposed ()) images [index] = null;
}
if (images [index] == null) break;
index++;
}
if (count == 0) {
Rectangle rect = image.getBoun... |
private Collection<JMeterProperty> cloneCollection() {
try {
@SuppressWarnings("unchecked") // value is of type Collection<JMeterProperty>
Collection<JMeterProperty> newCol = value.getClass().newInstance();
PropertyIterator iter = iterator();
while (iter.hasNe... | private Collection<JMeterProperty> cloneCollection() {
try {
@SuppressWarnings("unchecked") // value is of type Collection<JMeterProperty>
Collection<JMeterProperty> newCol = value.getClass().newInstance();
PropertyIterator iter = iterator();
while (iter.hasNe... |
public Reader _createReader(InputStream in) {
return super.createReader(in);
}
};
| public Reader _createReader(InputStream in) {
return super.createReader(in);
}
}
|
void checkProxyClass(Class<?> proxyClass);
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache L... | void checkProxyClass(Class<?> proxyClass);
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache L... |
extends Component, Loggable, Contextualizable, Runnable
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE file.
*/
package o... | extends Component, Loggable, Contextualizable, Runnable
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE file.
*/
package o... |
private void doClassicCompile() throws BuildException {
Commandline cmd = setupJavahCommand();
// Use reflection to be able to build on all JDKs
/*
// provide the compiler a different message sink - namely our own
sun.tools.javac.Main compiler =
new sun.tools... | private void doClassicCompile() throws BuildException {
Commandline cmd = setupJavahCommand();
// Use reflection to be able to build on all JDKs
/*
// provide the compiler a different message sink - namely our own
sun.tools.javac.Main compiler =
new sun.tools... |
protected IRequestCycleProcessor getDefaultRequestCycleProcessor()
{
return null;
}
};
IStringResourceLoader loader = new ApplicationStringResourceLoader(app);
Assert.assertNull("Unknown resource should return null", loader.loadStringResource(component,
"test.string", Locale.getDefault(), null))... | protected IRequestCycleProcessor getDefaultRequestCycleProcessor()
{
return null;
}
};
IStringResourceLoader loader = new ApplicationStringResourceLoader(app);
Assert.assertNull("Unknown resource should return null", loader.loadStringResource(component.getClass(),
"test.string", Locale.getDefaul... |
private boolean validating = false;
DocumentBuilderImpl(DocumentBuilderFactory dbf)
throws ParserConfigurationException
{
this.dbf = dbf;
domParser = new DOMParser();
try {
// Validation
validating = dbf.isValidating();
String validation... | private boolean validating = false;
DocumentBuilderImpl(DocumentBuilderFactory dbf)
throws ParserConfigurationException
{
this.dbf = dbf;
domParser = new DOMParser();
try {
// Validation
validating = dbf.isValidating();
String validation... |
private static Vector jrePackages;
static {
// Determine the Java version by looking at available classes
// java.lang.Readable was introduced in JDK 1.5
// java.lang.CharSequence was introduced in JDK 1.4
// java.lang.StrictMath was introduced in JDK 1.3
// java.lang.... | private static Vector jrePackages;
static {
// Determine the Java version by looking at available classes
// java.lang.Readable was introduced in JDK 1.5
// java.lang.CharSequence was introduced in JDK 1.4
// java.lang.StrictMath was introduced in JDK 1.3
// java.lang.... |
public static void initializeClass(Class theClass) {
// ***HACK*** We ask the VM to create an instance
// by voluntarily providing illegal arguments to force
// the VM to run the class' static initializer, while
// at the same time not running a valid constructor.
final Cons... | public static void initializeClass(Class theClass) {
// ***HACK*** We ask the VM to create an instance
// by voluntarily providing illegal arguments to force
// the VM to run the class' static initializer, while
// at the same time not running a valid constructor.
final Cons... |
+ " does not define a public constructor"
+ " that takes in a Reader as its "
+ "single argument.");
}
final Reader[] rdr = {instream};
... | + " does not define a public constructor"
+ " that takes in a Reader as its "
+ "single argument.");
}
final Reader[] rdr = {instream};
... |
private static void performSetCompressedSize(ZipEntry ze, long size) {
Long[] s = {new Long(size)};
try {
setCompressedSizeMethod.invoke(ze, s);
} catch (InvocationTargetException ite) {
Throwable nested = ite.getTargetException();
throw new RuntimeExcepti... | private static void performSetCompressedSize(ZipEntry ze, long size) {
Long[] s = {new Long(size)};
try {
setCompressedSizeMethod.invoke(ze, (Object[])s);
} catch (InvocationTargetException ite) {
Throwable nested = ite.getTargetException();
throw new Runt... |
public void setTabList (Control [] tabList) {
checkWidget ();
if (tabList != null) {
for (int i=0; i<tabList.length; i++) {
Control control = tabList [i];
if (control == null) error (SWT.ERROR_INVALID_ARGUMENT);
if (control.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
if (control.parent != this) e... | public void setTabList (Control [] tabList) {
checkWidget ();
if (tabList != null) {
for (int i=0; i<tabList.length; i++) {
Control control = tabList [i];
if (control == null) error (SWT.ERROR_INVALID_ARGUMENT);
if (control.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
if (control.parent != this) e... |
public Point getPreferredSize () {
checkWidget ();
int index = parent.indexOf (this);
if (index == -1) return new Point (0, 0);
int hwnd = parent.handle;
REBARBANDINFO rbBand = new REBARBANDINFO ();
rbBand.cbSize = REBARBANDINFO.sizeof;
rbBand.fMask = OS.RBBIM_CHILDSIZE | OS.RBBIM_IDEALSIZE;
OS.SendMessage (hwn... | public Point getPreferredSize () {
checkWidget ();
int index = parent.indexOf (this);
if (index == -1) return new Point (0, 0);
int hwnd = parent.handle;
REBARBANDINFO rbBand = new REBARBANDINFO ();
rbBand.cbSize = REBARBANDINFO.sizeof;
rbBand.fMask = OS.RBBIM_CHILDSIZE | OS.RBBIM_IDEALSIZE;
OS.SendMessage (hwn... |
private void cat() {
OutputStream os = null;
Reader reader = null;
char[] buffer = new char[BUFFER_SIZE];
try {
PrintWriter writer = null;
if (outputWriter != null) {
writer = new PrintWriter(outputWriter);
} else {
... | private void cat() {
OutputStream os = null;
Reader reader = null;
char[] buffer = new char[BUFFER_SIZE];
try {
PrintWriter writer = null;
if (outputWriter != null) {
writer = new PrintWriter(outputWriter);
} else {
... |
protected void validateAttributes() throws BuildException {
if (file == null && filesets.size() == 0) {
throw new BuildException("Specify at least one source "
+ "- a file or a fileset.");
}
if (destFile != null && destDir != null) {
... | protected void validateAttributes() throws BuildException {
if (file == null && filesets.size() == 0) {
throw new BuildException("Specify at least one source "
+ "- a file or a fileset.");
}
if (destFile != null && destDir != null) {
... |
protected void extractFile(FileUtils fileUtils, File srcF, File dir,
InputStream compressedInputStream,
String entryName, Date entryDate,
boolean isDirectory, FileNameMapper mapper)
throws IOE... | protected void extractFile(FileUtils fileUtils, File srcF, File dir,
InputStream compressedInputStream,
String entryName, Date entryDate,
boolean isDirectory, FileNameMapper mapper)
throws IOE... |
protected void validateAttributes() throws BuildException {
if (file != null && file.isDirectory()) {
if ((destFile != null && destDir != null)
|| (destFile == null && destDir == null)) {
throw new BuildException("One and only one of tofile and todir "
... | protected void validateAttributes() throws BuildException {
if (file != null && file.isDirectory()) {
if ((destFile != null && destDir != null)
|| (destFile == null && destDir == null)) {
throw new BuildException("One and only one of tofile and todir "
... |
private void ensureDirectoryFor(File targetFile)
throws BuildException {
File directory = fileUtils.getParentFile(targetFile);
if (!directory.exists()) {
if (!directory.mkdirs()) {
throw new BuildException("Unable to create directory: "
... | private void ensureDirectoryFor(File targetFile)
throws BuildException {
File directory = targetFile.getParentFile();
if (!directory.exists()) {
if (!directory.mkdirs()) {
throw new BuildException("Unable to create directory: "
... |
public void executeMain() throws BuildException {
if (baseDir == null && filesets.size() == 0
&& groupfilesets.size() == 0 && "zip".equals(archiveType)) {
throw new BuildException("basedir attribute must be set, "
+ "or at least "
... | public void executeMain() throws BuildException {
if (baseDir == null && filesets.size() == 0
&& groupfilesets.size() == 0 && "zip".equals(archiveType)) {
throw new BuildException("basedir attribute must be set, "
+ "or at least "
... |
protected boolean load(FetchConfiguration fetch, int loadMode,
BitSet exclude, Object sdata, boolean forWrite) {
if (!forWrite && (!isPersistent() || isNew() || isDeleted()))
return false;
// if any fields being loaded, do state transitions for read
BitSet fields = getUn... | protected boolean load(FetchConfiguration fetch, int loadMode,
BitSet exclude, Object sdata, boolean forWrite) {
if (!forWrite && (!isPersistent() || (isNew() && !isFlushed()) || isDeleted()))
return false;
// if any fields being loaded, do state transitions for read
Bi... |
public org.osgi.service.remoteserviceadmin.EndpointDescription[] readEndpointDescriptions(
InputStream input) throws IOException {
// First create parser
EndpointDescriptionParser parser = new EndpointDescriptionParser();
// Parse input stream
parser.parse(input);
// Get possible endpoint descriptions
L... | public org.osgi.service.remoteserviceadmin.EndpointDescription[] readEndpointDescriptions(
InputStream input) throws IOException {
// First create parser
EndpointDescriptionParser parser = new EndpointDescriptionParser();
// Parse input stream
parser.parse(input);
// Get possible endpoint descriptions
L... |
protected final void unbind(String applicationKey, String sessionId)
{
onUnbind(applicationKey, sessionId);
ISessionStore sessionStore = getSessionStore(sessionId);
sessionStore.destroy();
}
| protected final void unbind(String applicationKey, String sessionId)
{
onUnbind(applicationKey, sessionId);
ISessionStore sessionStore = (ISessionStore)sessionIdToSessionStore.remove(sessionId);
sessionStore.destroy();
}
|
private String getChatRoomSecondaryID(ID roomID) {
try {
URI aURI = roomID.toURI();
String auth = aURI.getAuthority();
String path = aURI.getPath();
return auth + "/" + path;
} catch (URISyntaxException e) {
return null;
}
}
| private String getChatRoomSecondaryID(ID roomID) {
try {
URI aURI = roomID.toURI();
String auth = aURI.getAuthority();
String path = aURI.getPath();
return auth + path;
} catch (URISyntaxException e) {
return null;
}
}
|
private String getFilterPath(String string, InputStream in)
{
try
{
return new WebXmlFile().getFilterPath(string, in);
}
catch (ParserConfigurationException ex)
{
throw new RuntimeException(ex);
}
catch (SAXException ex)
{
throw new RuntimeException(ex);
}
catch (IOException ex)
{
th... | private String getFilterPath(String string, InputStream in)
{
try
{
return new WebXmlFile().getFilterPath(false, string, in);
}
catch (ParserConfigurationException ex)
{
throw new RuntimeException(ex);
}
catch (SAXException ex)
{
throw new RuntimeException(ex);
}
catch (IOException ex)
... |
public void testFullpathDiffersInCaseScanningInsensitive() {
DirectoryScanner ds = new DirectoryScanner();
ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
ds.setIncludes(new String[] {
"alpha/beta/gamma/gamma.XML",
"alpha/beta/gamma/GAMMA.XML"
});
... | public void testFullpathDiffersInCaseScanningInsensitive() {
DirectoryScanner ds = new DirectoryScanner();
ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
ds.setIncludes(new String[] {
"alpha/beta/gamma/gamma.xml",
"alpha/beta/gamma/GAMMA.XML"
});
... |
private void parse() throws BuildException {
try {
SAXParser saxParser = getParserFactory().newSAXParser();
parser = saxParser.getParser();
saxParser.parse(buildFile, new RootHandler());
}
catch(ParserConfigurationException exc) {
throw new Bui... | private void parse() throws BuildException {
try {
SAXParser saxParser = getParserFactory().newSAXParser();
parser = saxParser.getParser();
saxParser.parse(buildFile, new RootHandler());
}
catch(ParserConfigurationException exc) {
throw new Bui... |
public Widget getItem(int x, int y) {
if (control instanceof Table) {
return getItem((Table) control, x, y);
}
if (control instanceof Tree) {
return getItem((Tree) control, x, y);
}
return null;
}
Widget getItem(Table table, int x, int y) {
Point coordinates = new Point(x, y);
coordinates = ... | public Widget getItem(int x, int y) {
if (control instanceof Table) {
return getItem((Table) control, x, y);
}
if (control instanceof Tree) {
return getItem((Tree) control, x, y);
}
return null;
}
Widget getItem(Table table, int x, int y) {
Point coordinates = new Point(x, y);
coordinates = ... |
public Object clone() {
try {
TestElement clonedElement = (TestElement) this.getClass().newInstance();
PropertyIterator iter = propertyIterator();
while (iter.hasNext()) {
clonedElement.setProperty((JMeterProperty) iter.next().clone());
}
... | public Object clone() {
try {
TestElement clonedElement = this.getClass().newInstance();
PropertyIterator iter = propertyIterator();
while (iter.hasNext()) {
clonedElement.setProperty((JMeterProperty) iter.next().clone());
}
cloned... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.