buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
protected void createParents(FTPClient ftp, String filename)
throws IOException, BuildException {
File dir = new File(filename);
if (dirCache.contains(dir)) {
return;
}
Vector parents = new Vector();
String dirname;
while ((dirname = d... | protected void createParents(FTPClient ftp, String filename)
throws IOException, BuildException {
File dir = new File(filename);
if (dirCache.contains(dir)) {
return;
}
Vector parents = new Vector();
String dirname;
while ((dirname = d... |
public static void error (int code, Throwable throwable, String detail) {
/*
* This code prevents the creation of "chains" of SWTErrors and
* SWTExceptions which in turn contain other SWTErrors and
* SWTExceptions as their throwable. This can occur when low level
* code throws an exception past a point where a h... | public static void error (int code, Throwable throwable, String detail) {
/*
* This code prevents the creation of "chains" of SWTErrors and
* SWTExceptions which in turn contain other SWTErrors and
* SWTExceptions as their throwable. This can occur when low level
* code throws an exception past a point where a h... |
public void setCommand(Commandline cmdl) {
log("The command attribute is deprecated. "
+ "Please use the executable attribute and nested arg elements.",
Project.MSG_WARN);
this.cmdl = cmdl;
}
| public void setCommand(Commandline cmdl) {
log("The command attribute is deprecated.\n"
+ "Please use the executable attribute and nested arg elements.",
Project.MSG_WARN);
this.cmdl = cmdl;
}
|
public void run(final IProgressMonitor monitor) {
editorPart.doSave(monitor);
}
};
try {
PlatformUI.getWorkbench().getProgressService().runInUI(XSTUIPlugin.getActiveWorkbenchWindow... | public void run(final IProgressMonitor monitor) {
editorPart.doSave(monitor);
}
};
try {
PlatformUI.getWorkbench().getProgressService().runInUI(XSTUIPlugin.getActiveWorkbenchWindow... |
public void doubleClick(final DoubleClickEvent event) {
VerificationResult result = getSelectedItem();
if (result != null) {
Verification.showVerificationResult(result, getSite().getShell());
}
}
});
}
| public void doubleClick(final DoubleClickEvent event) {
VerificationResult result = getSelectedItem();
if (result != null) {
Verification.showVerificationResult(result);
}
}
});
}
|
public boolean performTest(String arg) {
boolean passed = true;
try {
DOMWriter writer = new DOMWriter(false);
DOMParser parser = new DOMParser();
if (!arg.equals("delete2") && !arg.equals("insert2")) {
System.out.println("\n*************** Test == "+a... | public boolean performTest(String arg) {
boolean passed = true;
try {
DOMWriter writer = new DOMWriter(false);
DOMParser parser = new DOMParser();
if (!arg.equals("delete2") && !arg.equals("insert2")) {
System.out.println("\n*************** Test == "+a... |
public void addAdvices(String advice) {
addAdvice(advice);
}
| public void addAdvices(String advice) {
addAdvices(advice);
}
|
public void run(ITextSelection selection) {
String selectedText = selection.getText();
IXtendXpandProject project = getXtendXpandProject();
ISearchQuery query = createSearchQuery(selectedText, project);
NewSearchUI.runQuery(query);
}
| public void run(ITextSelection selection) {
String selectedText = selection.getText();
IXtendXpandProject project = getXtendXpandProject();
ISearchQuery query = createSearchQuery(selectedText, project);
NewSearchUI.runQueryInBackground(query);
}
|
public static void main(String[] argv) {
String pattern = null;
try {
String options = "";
String target = null;
if( argv.length == 0 ) {
System.out.println( "Error:Usage: java REUtil -i|-m|-s|-u|-w|-X regularExpression String" );
S... | public static void main(String[] argv) {
String pattern = null;
try {
String options = "";
String target = null;
if( argv.length == 0 ) {
System.out.println( "Error:Usage: java REUtil -i|-m|-s|-u|-w|-X regularExpression String" );
S... |
public String urlFor(final String pageMapName, final Class pageClass,
final PageParameters parameters)
{
final WebRequestCycle cycle = getWebRequestCycle();
final StringBuffer buffer = urlPrefix(cycle);
if (pageMapName == null)
{
appendPageMapName(buffer);
}
else
{
buffer.append("?pagemap=");
... | public String urlFor(final String pageMapName, final Class pageClass,
final PageParameters parameters)
{
final WebRequestCycle cycle = getWebRequestCycle();
final StringBuffer buffer = urlPrefix(cycle);
if (pageMapName == null)
{
appendPageMapName(buffer);
}
else
{
buffer.append("?pagemap=");
... |
protected void zipFile(InputStream in, ZipOutputStream zOut, String vPath,
long lastModified, File fromArchive, int mode)
throws IOException {
// fromArchive is used in subclasses overriding this method
if (entries.contains(vPath)) {
if (duplicate.equ... | protected void zipFile(InputStream in, ZipOutputStream zOut, String vPath,
long lastModified, File fromArchive, int mode)
throws IOException {
// fromArchive is used in subclasses overriding this method
if (entries.containsKey(vPath)) {
if (duplicate.... |
public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
// check 3.2.17.c0 must: URI (rfc 2396/2723)
try {
if( content.length() != 0 ) {
// Support for relative URLs
// According to Java 1.1: URLs may ... | public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
// check 3.2.17.c0 must: URI (rfc 2396/2723)
try {
if( content.length() != 0 ) {
// Support for relative URLs
// According to Java 1.1: URLs may ... |
public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
String decoded = Base64.decode(content);
if (decoded == null)
throw new InvalidDatatypeValueException("Value '"+content+"' is not encoded in base64");
return decoded;
... | public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
String decoded = Base64.decode(content);
if (decoded == null)
throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "base64Binary"});
... |
public Object getActualValue(String content) throws InvalidDatatypeValueException {
try{
return parse(content, null);
} catch(Exception ex){
throw new InvalidDatatypeValueException("not a valid date");
}
}
| public Object getActualValue(String content) throws InvalidDatatypeValueException {
try{
return parse(content, null);
} catch(Exception ex){
throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "date"});
}
}
|
public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
try{
return parse(content, null);
} catch(Exception ex){
throw new InvalidDatatypeValueException("not a valid dataTime");
}
}
| public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
try{
return parse(content, null);
} catch(Exception ex){
throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "dateTime"});
... |
public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
try{
return parse(content, null);
} catch(Exception ex){
throw new InvalidDatatypeValueException("not a valid day");
}
}
| public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
try{
return parse(content, null);
} catch(Exception ex){
throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "gDay"});
... |
public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
String decoded = HexBin.decode(content);
if (decoded == null)
throw new InvalidDatatypeValueException("Value '"+content+"' is not encoded in Hex");
return decoded;
... | public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
String decoded = HexBin.decode(content);
if (decoded == null)
throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "hexBinary"});
r... |
public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
if (!XMLChar.isValidNCName(content)) {
throw new InvalidDatatypeValueException("Value '"+content+"' is not a valid ID");
}
return content;
}
| public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
if (!XMLChar.isValidNCName(content)) {
throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "NCName"});
}
return content;
}
|
public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException{
try{
return parse(content, null);
} catch(Exception ex){
throw new InvalidDatatypeValueException("not a valid month");
}
}
| public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException{
try{
return parse(content, null);
} catch(Exception ex){
throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "gMonth"});
... |
public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
try{
return parse(content, null);
} catch(Exception ex){
throw new InvalidDatatypeValueException("not a valid monthDay");
}
}
| public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
try{
return parse(content, null);
} catch(Exception ex){
throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "gMonthDay"});
... |
public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException{
try{
return parse(content, null);
} catch(Exception ex){
throw new InvalidDatatypeValueException("not a valid time");
}
}
| public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException{
try{
return parse(content, null);
} catch(Exception ex){
throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "time"});
}... |
public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException{
try{
return parse(content, null);
} catch(Exception ex){
throw new InvalidDatatypeValueException("not a valid year");
}
}
| public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException{
try{
return parse(content, null);
} catch(Exception ex){
throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "gYear"});
... |
public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException{
try{
return parse(content, null);
} catch(Exception ex){
throw new InvalidDatatypeValueException("not a valid yearMonth");
}
}
| public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException{
try{
return parse(content, null);
} catch(Exception ex){
throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "gYearMonth"});
... |
private void traverseSimpleContent(Element simpleContentElement,
XSComplexTypeDecl typeInfo,
XSDocumentInfo schemaDoc,
SchemaGrammar grammar)
throws ComplexTypeRecoverableError {
String... | private void traverseSimpleContent(Element simpleContentElement,
XSComplexTypeDecl typeInfo,
XSDocumentInfo schemaDoc,
SchemaGrammar grammar)
throws ComplexTypeRecoverableError {
String... |
private XSSimpleType traverseSimpleTypeDecl(Element simpleTypeDecl, Object[] attrValues,
XSDocumentInfo schemaDoc,
SchemaGrammar grammar, boolean isGlobal) {
String nameProperty = (String)attrValues[XSAttribute... | private XSSimpleType traverseSimpleTypeDecl(Element simpleTypeDecl, Object[] attrValues,
XSDocumentInfo schemaDoc,
SchemaGrammar grammar, boolean isGlobal) {
String nameProperty = (String)attrValues[XSAttribute... |
public void addSelectionListener (SelectionListener listener) {
checkWidget ();
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener (listener);
addListener (SWT.Selection,typedListener);
addListener (SWT.DefaultSelection,typedListener);
}
int callWindowProc (int ... | public void addSelectionListener (SelectionListener listener) {
checkWidget ();
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener (listener);
addListener (SWT.Selection,typedListener);
addListener (SWT.DefaultSelection,typedListener);
}
int callWindowProc (int ... |
protected void runStatements( Reader reader, PrintStream out )
throws SQLException, IOException, TaskException
{
String sql = "";
String line = "";
BufferedReader in = new BufferedReader( reader );
try
{
while( ( line = in.readLine() ) != null )
... | protected void runStatements( Reader reader, PrintStream out )
throws SQLException, IOException, TaskException
{
String sql = "";
String line = "";
BufferedReader in = new BufferedReader( reader );
try
{
while( ( line = in.readLine() ) != null )
... |
public final void renderHead(final IHeaderResponse headResponse)
{
Response response = headResponse.getResponse();
final WebRequestCycle cycle = (WebRequestCycle)RequestCycle.get();
final IRequestTarget target = cycle.getRequestTarget();
// we don't want to render this for stateless pages
if (webPag... | public final void renderHead(final IHeaderResponse headResponse)
{
Response response = headResponse.getResponse();
final WebRequestCycle cycle = (WebRequestCycle)RequestCycle.get();
final IRequestTarget target = cycle.getRequestTarget();
// we don't want to render this for stateless pages
if (webPag... |
protected static Logger testLog = LoggingManager.getLoggerForClass();
}
| protected static final Logger testLog = LoggingManager.getLoggerForClass();
}
|
protected void handleStartElement(QName element, XMLAttributes attributes) throws XNIException {
// REVISIT: Here are current assumptions about validation features
// given that XMLSchema validator is in the pipeline
//
// http://xml.org/sax/features/validation = true
... | protected void handleStartElement(QName element, XMLAttributes attributes) throws XNIException {
// REVISIT: Here are current assumptions about validation features
// given that XMLSchema validator is in the pipeline
//
// http://xml.org/sax/features/validation = true
... |
public TableColumn getColumn (int index) {
checkWidget();
if (!(0 <= index && index < columnCount)) error (SWT.ERROR_CANNOT_GET_ITEM);
return columns [index];
}
| public TableColumn getColumn (int index) {
checkWidget();
if (!(0 <= index && index < columnCount)) error (SWT.ERROR_INVALID_RANGE);
return columns [index];
}
|
public TreeColumn getColumn (int index) {
checkWidget();
if (!(0 <= index && index < columnCount)) error (SWT.ERROR_CANNOT_GET_ITEM);
return columns [index];
}
| public TreeColumn getColumn (int index) {
checkWidget();
if (!(0 <= index && index < columnCount)) error (SWT.ERROR_INVALID_RANGE);
return columns [index];
}
|
public boolean resolve(final MarkupContainer container, final MarkupStream markupStream,
final ComponentTag tag)
{
// Usually you add child components to Border instead of Body. Hence
// we need to help Body to properly resolve the children.
String id = tag.getId();
if (!id.equals(BODY_ID))
{
... | public boolean resolve(final MarkupContainer container, final MarkupStream markupStream,
final ComponentTag tag)
{
// Usually you add child components to Border instead of Body. Hence
// we need to help Body to properly resolve the children.
String id = tag.getId();
if (!id.equals(BODY_ID))
{
... |
private void writeJavaClass() {
try {
File sourceFile = new File((getLocationName() + ".java"));
verbose("Write collector class to '" + sourceFile.getAbsolutePath() + "'");
if (!sourceFile.delete()) {
throw new IOException("could not delete " + sourceFile... | private void writeJavaClass() {
try {
File sourceFile = new File((getLocationName() + ".java"));
verbose("Write collector class to '" + sourceFile.getAbsolutePath() + "'");
if (sourceFile.exists() && !sourceFile.delete()) {
throw new IOException("could no... |
public boolean resolve(final MarkupContainer container, final MarkupStream markupStream,
final ComponentTag tag)
{
if ((tag instanceof WicketTag) && ((WicketTag)tag).isEnclosureTag())
{
CharSequence wicketId = tag.getString("wicket:id");
String id = null;
if (wicketId != null)
{
id = wicketId.to... | public boolean resolve(final MarkupContainer< ? > container, final MarkupStream markupStream,
final ComponentTag tag)
{
if ((tag instanceof WicketTag) && ((WicketTag)tag).isEnclosureTag())
{
CharSequence wicketId = tag.getString("wicket:id");
String id = null;
if (wicketId != null)
{
id = wicket... |
public boolean resolve(final MarkupContainer container, final MarkupStream markupStream,
final ComponentTag tag)
{
// If <wicket:...>
if (tag instanceof WicketTag)
{
final WicketTag wTag = (WicketTag)tag;
// If <wicket:fragment ...>
if (wTag.isFragementTag())
{
// skip the markup associated ... | public boolean resolve(final MarkupContainer< ? > container, final MarkupStream markupStream,
final ComponentTag tag)
{
// If <wicket:...>
if (tag instanceof WicketTag)
{
final WicketTag wTag = (WicketTag)tag;
// If <wicket:fragment ...>
if (wTag.isFragementTag())
{
// skip the markup associ... |
public boolean resolve(final MarkupContainer container, final MarkupStream markupStream,
final ComponentTag tag)
{
// this is only here so we register wicket:container tag, this resolver
// does not actually do anything special to the tag
return false;
}
} | public boolean resolve(final MarkupContainer< ? > container, final MarkupStream markupStream,
final ComponentTag tag)
{
// this is only here so we register wicket:container tag, this resolver
// does not actually do anything special to the tag
return false;
}
} |
List<IComponentResolver> getComponentResolvers();
/*
* 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 Apach... | List<IComponentResolver> getComponentResolvers();
/*
* 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 Apach... |
Map<String, ? extends Property> getProperties (ExecutionContext ctx);
/*
Copyright (c) 2008 Arno Haase.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/... | Map<String, ? extends Property> getProperties (ExecutionContext ctx);
/*
Copyright (c) 2008 Arno Haase.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/... |
public Property getProperty (BackendType t, String name) {
return t.getProperties().get (name);
}
| public Property getProperty (BackendType t, String name) {
return t.getProperties(_ctx).get (name);
}
|
private StringType () {
super ("String", "{builtin}String");
register (new BuiltinProperty (this, this, "length", ReflectionHelper.getKnownMethod (CharSequence.class, "length"), null));
}
| private StringType () {
super ("String", "{builtin}String");
register (new BuiltinProperty (this, "length", ReflectionHelper.getKnownMethod (CharSequence.class, "length"), null));
}
|
private void printHead(PrintWriter out, Enumeration tasks,
Enumeration types) {
out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
out.println("<!ENTITY % boolean \"(true|false|on|off|yes|no)\">");
out.print("<!ENTITY % tasks \"");
boolean first =... | private void printHead(PrintWriter out, Enumeration tasks,
Enumeration types) {
out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
out.println("<!ENTITY % boolean \"(true|false|on|off|yes|no)\">");
out.print("<!ENTITY % tasks \"");
boolean first =... |
public int getBottomMargin() {
checkWidget();
return bottomMargin;
}
Rectangle getBoundsAtOffset(int offset) {
int lineIndex = content.getLineAtOffset(offset);
int lineOffset = content.getOffsetAtLine(lineIndex);
String line = content.getLine(lineIndex);
Rectangle bounds;
if (line.length() != 0) {
int offsetIn... | public int getBottomMargin() {
checkWidget();
return bottomMargin;
}
Rectangle getBoundsAtOffset(int offset) {
int lineIndex = content.getLineAtOffset(offset);
int lineOffset = content.getOffsetAtLine(lineIndex);
String line = content.getLine(lineIndex);
Rectangle bounds;
if (line.length() != 0) {
int offsetIn... |
public void setTopIndex (int index) {
checkWidget();
checkItems (false);
int itemHeight = getItemHeight ();
int [] top = new int [1], left = new int [1];
OS.GetDataBrowserScrollPosition (handle, top, left);
top [0] = Math.max (0, Math.min (itemHeight * itemCount - getClientArea ().height, index * itemHei... | public void setTopIndex (int index) {
checkWidget();
checkItems (false);
int itemHeight = getItemHeight ();
int [] top = new int [1], left = new int [1];
OS.GetDataBrowserScrollPosition (handle, top, left);
top [0] = Math.max (0, Math.min (itemHeight * itemCount + getHeaderHeight () - getClientArea ().he... |
public Object createDataType(String typeName) throws BuildException {
Class c = (Class) dataClassDefinitions.get(typeName);
if (c == null)
return null;
try {
java.lang.reflect.Constructor ctor = null;
boolean noArg = false;
// DataType can ha... | public Object createDataType(String typeName) throws BuildException {
Class c = (Class) dataClassDefinitions.get(typeName);
if (c == null)
return null;
try {
java.lang.reflect.Constructor ctor = null;
boolean noArg = false;
// DataType can ha... |
public void run(IAction action) {
Check64CompilationParticipant.Enabled = action.isChecked();
}
| public void run(IAction action) {
Check64CompilationParticipant.setEnabled(action.isChecked());
}
|
public void addText(String msg) {
message +=
ProjectHelper.replaceProperties(project, msg, project.getProperties());
}
| public void addText(String msg) {
message +=
ProjectHelper.replaceProperties(project, msg);
}
|
public void addText(String msg) {
message +=
ProjectHelper.replaceProperties(project, msg, project.getProperties());
}
| public void addText(String msg) {
message +=
ProjectHelper.replaceProperties(project, msg);
}
|
protected void addProperties(Properties props) {
resolveAllProperties(props);
Enumeration e = props.keys();
while (e.hasMoreElements()) {
String name = (String) e.nextElement();
String value = (String) props.getProperty(name);
String v = ProjectHelper.rep... | protected void addProperties(Properties props) {
resolveAllProperties(props);
Enumeration e = props.keys();
while (e.hasMoreElements()) {
String name = (String) e.nextElement();
String value = (String) props.getProperty(name);
String v = ProjectHelper.rep... |
protected void initWriteBehindCallback() {
WriteBehindCache cache = _conf.getWriteBehindCacheManagerInstance().getSystemWriteBehindCache();
if (cache != null) {
if (_conf.getDataCacheManagerInstance().getSystemDataCache() == null ||
_conf.getWriteBehindCallbackInsta... | protected void initWriteBehindCallback() {
WriteBehindCache cache = _conf.getWriteBehindCacheManagerInstance().getSystemWriteBehindCache();
if (cache != null) {
if (_conf.getDataCacheManagerInstance().getSystemDataCache() == null ||
_conf.getWriteBehindCallbackInsta... |
private NamedElement getNamedElementRec(final NamedElement[] elements, final String name) {
final String[] frags = name.split(SyntaxConstants.NS_DELIM);
final String firstFrag = frags[0];
for (final NamedElement ele : elements) {
if (ele.getName() != null && ele.getName().equals(firstFrag)) {
if (fr... | private NamedElement getNamedElementRec(final NamedElement[] elements, final String name) {
final String[] frags = name.split(SyntaxConstants.NS_DELIM);
final String firstFrag = frags[0];
for (final NamedElement ele : elements) {
if (ele.getName() != null && ele.getName().equals(firstFrag)) {
if (fr... |
public void drawPolygon(int[] pointArray) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
checkGC(DRAW);
drawPolyLineSegment(pointArray, true, true);
}
void drawPolyLineSegment(int[] pointArray, boolean closed, boolean stroked) {
if (pointArray... | public void drawPolygon(int[] pointArray) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
checkGC(DRAW);
drawPolyLineSegment(pointArray, true, true);
}
void drawPolyLineSegment(int[] pointArray, boolean closed, boolean stroked) {
if (pointArray... |
protected void populateItem(final ListItem listItem)
{
final Access access = (Access)listItem.getModelObject();
IPageMapEntry entry = pageMap.getEntry(access.getId());
PageParameters parameters = new PageParameters();
parameters.put("pageId", "" + entry.getNumericId());
Link link = new Bookmar... | protected void populateItem(final ListItem listItem)
{
final Access access = (Access)listItem.getModelObject();
IPageMapEntry entry = pageMap.getEntry(access.getId());
PageParameters parameters = new PageParameters();
parameters.put("pageId", "" + entry.getNumericId());
Link link = new Bookmar... |
public int size;
}
}
| public long size;
}
}
|
// We do not look for a public FIELD because
// that is not good programming with beans patterns
throw new WicketRuntimeException(
"No get method defined for class: " + clz + " expression: " +
exp);
}
}
else
{
getAndSetter = new MethodGetAndSet(... | // We do not look for a public FIELD because
// that is not good programming with beans patterns
throw new WicketRuntimeException(
"No get method defined for class: " + clz + " expression: " +
exp);
}
}
else
{
getAndSetter = new MethodGetAndSet(... |
public void setVisible (boolean visible) {
checkWidget ();
if (drawCount != 0) {
if (((state & HIDDEN) == 0) == visible) return;
} else {
if (visible == OS.IsWindowVisible (handle)) return;
}
/*
* Feature in Windows. When ShowWindow() is called used to hide
* a window, Windows attempts to give focus to th... | public void setVisible (boolean visible) {
checkWidget ();
if (drawCount != 0) {
if (((state & HIDDEN) == 0) == visible) return;
} else {
if (visible == OS.IsWindowVisible (handle)) return;
}
/*
* Feature in Windows. When ShowWindow() is called used to hide
* a window, Windows attempts to give focus to th... |
public void handleMessageEvent(IIMMessageEvent event) {
if (event instanceof IChatRoomMessageEvent) {
IChatRoomMessageEvent roomEvent = (IChatRoomMessageEvent) event;
IChatRoomMessage message = roomEvent.getChatRoomMessage();
List commands = bot.getCommands();
for(int i = 0; i < commands.size(); i++) {
... | public void handleMessageEvent(IIMMessageEvent event) {
if (event instanceof IChatRoomMessageEvent) {
IChatRoomMessageEvent roomEvent = (IChatRoomMessageEvent) event;
IChatRoomMessage message = roomEvent.getChatRoomMessage();
List commands = bot.getCommands();
for(int i = 0; i < commands.size(); i++) {
... |
public void setBackgroundImage (Image image) {
checkWidget ();
if (image != null && image.isDisposed ()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
if (image == backgroundImage) return;
this.backgroundImage = image;
if (backgroundImage != null) {
setBackgroundPixmap (backgroundImage.pixmap);
redrawWidget (0, 0, 0,... | public void setBackgroundImage (Image image) {
checkWidget ();
if (image != null && image.isDisposed ()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
if (image == backgroundImage) return;
this.backgroundImage = image;
if (backgroundImage != null) {
setBackgroundPixmap (backgroundImage.pixmap);
redrawWidget (0, 0, 0,... |
public void setBidiColoring(boolean mode) {
checkWidget();
bidiColoring = mode;
}
/**
* Moves the Caret to the current caret offset.
*/
void setCaretLocation() {
int lineIndex = getCaretLine();
String line = content.getLine(lineIndex);
int lineOffset = content.getOffsetAtLine(lineIndex);
int offsetInLine = care... | public void setBidiColoring(boolean mode) {
checkWidget();
bidiColoring = mode;
}
/**
* Moves the Caret to the current caret offset.
*/
void setCaretLocation() {
int lineIndex = getCaretLine();
String line = content.getLine(lineIndex);
int lineOffset = content.getOffsetAtLine(lineIndex);
int offsetInLine = care... |
private static void checkVersion(Class clazz, String expected) {
String actual = "*NONE*"; // $NON-NLS-1$
try {
actual = (String) clazz.getMethod("getVersion", null).invoke(null, null);
actual = extractVersion(actual);
} catch (Exception ignored) {
// Not needed
}
if (0 != actual.compareTo(expected... | private static void checkVersion(Class clazz, String expected) {
String actual = "*NONE*"; // $NON-NLS-1$
try {
actual = (String) clazz.getMethod("getVersion", null).invoke(null, null);
actual = extractVersion(actual);
} catch (Exception ignored) {
// Not needed
}
if (0 != actual.compareTo(expected... |
public String getString(final String key, final Component component, final IModel model,
final String defaultValue) throws MissingResourceException
{
final IResourceSettings resourceSettings = Application.get().getResourceSettings();
boolean addedToPage = (component != null && null != component.findParent(Pag... | public String getString(final String key, final Component component, final IModel model,
final String defaultValue) throws MissingResourceException
{
final IResourceSettings resourceSettings = Application.get().getResourceSettings();
boolean addedToPage = (component != null && null != component.findParent(Pag... |
private ListenerList<ISelectionChangedListener, SelectionChangedEvent> listeners =
new ListenerList<ISelectionChangedListener, SelectionChangedEvent>();
| private ListenerList<ISelectionChangedListener, SelectionChangedEvent> listeners =
new ListenerList<ISelectionChangedListener, SelectionChangedEvent>(ISelectionChangedListener.class);
|
private ListenerList<IVexEditorListener, VexEditorEvent> vexEditorListeners =
new ListenerList<IVexEditorListener, VexEditorEvent>();
| private ListenerList<IVexEditorListener, VexEditorEvent> vexEditorListeners =
new ListenerList<IVexEditorListener, VexEditorEvent>(IVexEditorListener.class);
|
private ListenerList<IVexEditorListener, VexEditorMultiPageEvent> vexEditorListeners =
new ListenerList<IVexEditorListener, VexEditorMultiPageEvent>();
| private ListenerList<IVexEditorListener, VexEditorMultiPageEvent> vexEditorListeners =
new ListenerList<IVexEditorListener, VexEditorMultiPageEvent>(IVexEditorListener.class);
|
public void run()
{
try
{
threadContext = JMeterContextService.getContext();
threadContext.setVariables(threadVars);
threadContext.setThreadNum(getThreadNum());
testTree.traverse(compiler);
running = true;
//listeners = cont... | public void run()
{
try
{
threadContext = JMeterContextService.getContext();
threadContext.setVariables(threadVars);
threadContext.setThreadNum(getThreadNum());
testTree.traverse(compiler);
running = true;
//listeners = cont... |
public Object find(Object oid, ValueMapping vm,
JDBCFetchState fetchState);
| public Object find(Object oid, ValueMapping vm,
JDBCFetchConfiguration fetch);
|
public void initialize(OpenJPAStateManager sm, PCState state,
FetchState fetchState)
throws Exception;
| public void initialize(OpenJPAStateManager sm, PCState state,
FetchConfiguration fetch)
throws Exception;
|
public IClasspathEntry[] getClasspathEntries() {
if (cxfLibraryVersion != getCxfRuntimeVersion()) {
classpathEntries = new ArrayList<IClasspathEntry>();
cxfLibraryLocation = getCxfRuntimeLocation();
cxfLibraryVersion = getCxfRuntimeVersion();
cxfLibraryEdition = ... | public IClasspathEntry[] getClasspathEntries() {
if (!cxfLibraryVersion.equals(getCxfRuntimeVersion())) {
classpathEntries = new ArrayList<IClasspathEntry>();
cxfLibraryLocation = getCxfRuntimeLocation();
cxfLibraryVersion = getCxfRuntimeVersion();
cxfLibraryEdit... |
public Image getImage(Object element) {
if (element instanceof SourceMethod) {
if (methodMap == null || annotationKey == null || type == null) {
return null;
}
IMethod method = (SourceMethod) element;
if (annotationKey == CXFModelUtils.WEB_PA... | public Image getImage(Object element) {
if (element instanceof SourceMethod) {
if (methodMap == null || annotationKey == null || type == null) {
return null;
}
IMethod method = (SourceMethod) element;
if (annotationKey.equals(CXFModelUtils.WE... |
private List<ICompletionProposal> computeCompletionProposals(JavaContentAssistInvocationContext context) {
CompletionContext completionContext = context.getCoreContext();
int tokenStart = completionContext.getTokenStart();
ICompilationUnit source = context.getCompilationUnit();
try {
IJava... | private List<ICompletionProposal> computeCompletionProposals(JavaContentAssistInvocationContext context) {
CompletionContext completionContext = context.getCoreContext();
int tokenStart = completionContext.getOffset();
ICompilationUnit source = context.getCompilationUnit();
try {
IJavaElem... |
public int compare(Viewer viewer, Object obj1, Object obj2) {
if (obj1 instanceof Class) {
return AnnotationsManager.getAnnotationDefinitionForClass(obj1).getAnnotationClassName().
compareTo(AnnotationsManager.getAnnotationDefinitionForClass(obj2).
... | public int compare(Viewer viewer, Object obj1, Object obj2) {
if (obj1 instanceof Class<?>) {
return AnnotationsManager.getAnnotationDefinitionForClass(obj1).getAnnotationClassName().
compareTo(AnnotationsManager.getAnnotationDefinitionForClass(obj2).
... |
import org.apache.wicket.ng.resource.PackageResource;
/*
* 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 A... | import org.apache.wicket.ng.resource.PackageResource;
/*
* 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 A... |
protected CharSequence getCallbackScript()
{
return generateCallbackScript("wicketAjaxGet('" + getCallbackUrl(onlyTargetActivePage()) +
"'");
}
| protected CharSequence getCallbackScript()
{
return generateCallbackScript("wicketAjaxGet('" + getCallbackUrl() +
"'");
}
|
protected final CharSequence getEventHandler()
{
return generateCallbackScript(new AppendingStringBuffer("wicketAjaxPost('").append(
getCallbackUrl(true)).append(
"', wicketSerializeForm(document.getElementById('" + getComponent().getMarkupId() +
"',false))"));
}
| protected final CharSequence getEventHandler()
{
return generateCallbackScript(new AppendingStringBuffer("wicketAjaxPost('").append(
getCallbackUrl()).append(
"', wicketSerializeForm(document.getElementById('" + getComponent().getMarkupId() +
"',false))"));
}
|
protected final CharSequence getEventHandler()
{
return generateCallbackScript(new AppendingStringBuffer("wicketAjaxPost('").append(
getCallbackUrl(false)).append(
"', wicketSerialize(Wicket.$('" + getComponent().getMarkupId() + "'))"));
}
| protected final CharSequence getEventHandler()
{
return generateCallbackScript(new AppendingStringBuffer("wicketAjaxPost('").append(
getCallbackUrl()).append(
"', wicketSerialize(Wicket.$('" + getComponent().getMarkupId() + "'))"));
}
|
protected CharSequence getEventHandler()
{
final String formId = getForm().getMarkupId();
final CharSequence url = getCallbackUrl(true);
AppendingStringBuffer call = new AppendingStringBuffer("wicketSubmitFormById('").append(
formId).append("', '").append(url).append("', ");
if (getComponent() instanceof... | protected CharSequence getEventHandler()
{
final String formId = getForm().getMarkupId();
final CharSequence url = getCallbackUrl();
AppendingStringBuffer call = new AppendingStringBuffer("wicketSubmitFormById('").append(
formId).append("', '").append(url).append("', ");
if (getComponent() instanceof IFo... |
public final void onResourceRequested()
{
Attributes a = new Attributes(RequestCycle.get().getRequest(), RequestCycle.get()
.getResponse(), getLocale(), getStyle(), getVariation(), null);
resource.respond(a);
onClick();
}
| public final void onResourceRequested()
{
Attributes a = new Attributes(RequestCycle.get().getRequest(), RequestCycle.get()
.getResponse(), null);
resource.respond(a);
onClick();
}
|
public void respond(final RequestCycle requestCycle)
{
IResource.Attributes a = new IResource.Attributes(requestCycle.getRequest(),
requestCycle.getResponse(), locale, style, variation, pageParameters);
resource.respond(a);
}
| public void respond(final RequestCycle requestCycle)
{
IResource.Attributes a = new IResource.Attributes(requestCycle.getRequest(),
requestCycle.getResponse(), pageParameters);
resource.respond(a);
}
|
public void testExpirePage()
{
tester.startPage(TestExpirePage.class);
String document = tester.getServletResponse().getDocument();
assertTrue(document.contains("Click me to get an error"));
AjaxLink link = (AjaxLink)tester.getComponentFromLastRenderedPage("link");
// Clear the session to remove the pages... | public void testExpirePage()
{
tester.startPage(TestExpirePage.class);
String document = tester.getServletResponse().getDocument();
assertTrue(document.contains("Click me to get an error"));
AjaxLink link = (AjaxLink)tester.getComponentFromLastRenderedPage("link");
// Clear the session to remove the pages... |
protected ICompletionProposal[] internalComputeCompletionProposals(final ITextViewer viewer,
final int documentOffset) {
try {
final String txt = viewer.getDocument().get().substring(0, documentOffset);
XpandDefinition[] defs = new XpandDefinition[0];
final IFile file = getFile();
final IXpandResourc... | protected ICompletionProposal[] internalComputeCompletionProposals(final ITextViewer viewer,
final int documentOffset) {
try {
final String txt = viewer.getDocument().get().substring(0, documentOffset);
XpandDefinition[] defs = new XpandDefinition[0];
final IFile file = getFile();
final IXpandResourc... |
public final Markup loadMarkup(final MarkupContainer container,
final MarkupResourceStream markupResourceStream, final IMarkupLoader baseLoader,
final boolean enforceReload) throws IOException, ResourceStreamNotFoundException
{
IMarkupLoader loader = new InheritedMarkupMarkupLoader();
return loader.loadMark... | public final Markup loadMarkup(final MarkupContainer< ? > container,
final MarkupResourceStream markupResourceStream, final IMarkupLoader baseLoader,
final boolean enforceReload) throws IOException, ResourceStreamNotFoundException
{
IMarkupLoader loader = new InheritedMarkupMarkupLoader();
return loader.loa... |
Markup loadMarkup(final MarkupContainer< ? > container,
/*
* 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... | Markup loadMarkup(final MarkupContainer< ? > container,
/*
* 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... |
public final Markup loadMarkup(final MarkupContainer container,
final MarkupResourceStream markupResourceStream, final IMarkupLoader baseLoader,
final boolean enforceReload) throws IOException, ResourceStreamNotFoundException
{
return Application.get().getMarkupSettings().getMarkupParserFactory().newMarkupPar... | public final Markup loadMarkup(final MarkupContainer< ? > container,
final MarkupResourceStream markupResourceStream, final IMarkupLoader baseLoader,
final boolean enforceReload) throws IOException, ResourceStreamNotFoundException
{
return Application.get().getMarkupSettings().getMarkupParserFactory().newMark... |
private void startConnection(ConnectionDetails details) throws Exception {
CollabClient client = new CollabClient();
ClientPlugin.log("ECF: Autostarting containerType="+details.getContainerType()+",uri="+details.getTargetURI()+",nickname="+details.getNickname());
client.createAndConnectClient(details.getContaine... | private void startConnection(ConnectionDetails details) throws Exception {
CollabClient client = new CollabClient();
//ClientPlugin.log("ECF: Autostarting containerType="+details.getContainerType()+",uri="+details.getTargetURI()+",nickname="+details.getNickname());
client.createAndConnectClient(details.getContai... |
public void dispose () {
/*
* Note: It is valid to attempt to dispose a widget
* more than once. If this happens, fail silently.
*/
if (isDisposed ()) return;
if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
release (true);
}
void drawBackground (int control, int context) {
/* Do nothing */
}
... | public void dispose () {
/*
* Note: It is valid to attempt to dispose a widget
* more than once. If this happens, fail silently.
*/
if (isDisposed ()) return;
if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
release (true);
}
void drawBackground (int control, int context) {
/* Do nothing */
}
... |
protected IResourceStream getResourceStream()
{
return resource;
}
} | public IResourceStream getResourceStream()
{
return resource;
}
} |
public Event createEvent(String type)
throws DOMException {
if(type.equalsIgnoreCase("Events") || ("Event".equals(type))
return new EventImpl();
if(type.equalsIgnoreCase("MutationEvents") || "MutationEvent".equals(type))
return new MutationEventImpl();
else
throw new DOM... | public Event createEvent(String type)
throws DOMException {
if(type.equalsIgnoreCase("Events") || "Event".equals(type))
return new EventImpl();
if(type.equalsIgnoreCase("MutationEvents") || "MutationEvent".equals(type))
return new MutationEventImpl();
else
throw new DOME... |
public String getText () {
checkWidget ();
return text;
}
int kEventControlGetFocusPart (int nextHandler, int theEvent, int userData) {
return OS.noErr;
}
int kEventControlSetFocusPart (int nextHandler, int theEvent, int userData) {
int result = super.kEventControlSetFocusPart (nextHandler, theEvent, userData);
... | public String getText () {
checkWidget ();
return text;
}
int kEventControlGetFocusPart (int nextHandler, int theEvent, int userData) {
return OS.noErr;
}
int kEventControlSetFocusPart (int nextHandler, int theEvent, int userData) {
int result = super.kEventControlSetFocusPart (nextHandler, theEvent, userData);
... |
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
int width = 0, height = 0;
if ((style & SWT.HORIZONTAL) != 0) {
width += DEFAULT_WIDTH; height += 5;
} else {
width += 5; height += DEFAULT_HEIGHT;
}
if (wHint != SWT.DEFAULT) width = wHint;
if (hHint != SWT.DEFAULT) height = ... | public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
int width = 0, height = 0;
if ((style & SWT.HORIZONTAL) != 0) {
width += DEFAULT_WIDTH; height += 5;
} else {
width += 5; height += DEFAULT_HEIGHT;
}
if (wHint != SWT.DEFAULT) width = wHint;
if (hHint != SWT.DEFAULT) height = ... |
public void addSelectionListener(SelectionListener listener) {
checkWidget();
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener(listener);
addListener(SWT.Selection,typedListener);
addListener(SWT.DefaultSelection,typedListener);
}
static int checkStyle (int st... | public void addSelectionListener(SelectionListener listener) {
checkWidget();
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener(listener);
addListener(SWT.Selection,typedListener);
addListener(SWT.DefaultSelection,typedListener);
}
static int checkStyle (int st... |
protected void completing(
long totalWritten,
Throwable thrown) {
result.totalWritten = totalWritten;
result.thrown = thrown;
result.set = true;
}
};
// start it up
new Thread(pipe).start()... | protected void completing(
long totalWritten,
Throwable thrown) {
result.totalWritten = totalWritten;
result.thrown = thrown;
result.set = true;
}
};
// start it up
new Thread(pipe).start()... |
public final boolean isPaletteEnabled()
{
return isEnabled() && isEnableAllowed();
}
| public final boolean isPaletteEnabled()
{
return isEnabledInHierarchy();
}
|
protected void onComponentTag(final ComponentTag tag)
{
super.onComponentTag(tag);
// only add the event handler when the component is enabled.
Component myComponent = getComponent();
if (myComponent.isEnabled() && myComponent.isEnableAllowed())
{
tag.put(event, getEventHandler());
}
}
| protected void onComponentTag(final ComponentTag tag)
{
super.onComponentTag(tag);
// only add the event handler when the component is enabled.
Component myComponent = getComponent();
if (myComponent.isEnabledInHierarchy())
{
tag.put(event, getEventHandler());
}
}
|
protected final boolean isButtonEnabled()
{
return isEnabled() && isEnableAllowed();
}
| protected final boolean isButtonEnabled()
{
return isEnabledInHierarchy();
}
|
protected void onComponentTag(final ComponentTag tag)
{
tag.put("name", getInputName());
if (!isEnabled() || !isEnableAllowed())
{
onDisabled(tag);
}
| protected void onComponentTag(final ComponentTag tag)
{
tag.put("name", getInputName());
if (!isEnabledInHierarchy())
{
onDisabled(tag);
}
|
protected void onComponentTag(final ComponentTag tag)
{
// Default handling for component tag
super.onComponentTag(tag);
// must be attached to <input type="radio" .../> tag
checkComponentTag(tag, "input");
checkComponentTagAttribute(tag, "type", "radio");
final String value = getValue();
RadioGroup<... | protected void onComponentTag(final ComponentTag tag)
{
// Default handling for component tag
super.onComponentTag(tag);
// must be attached to <input type="radio" .../> tag
checkComponentTag(tag, "input");
checkComponentTagAttribute(tag, "type", "radio");
final String value = getValue();
RadioGroup<... |
protected final boolean isLinkEnabled()
{
return isEnabled() && isEnableAllowed();
}
| protected final boolean isLinkEnabled()
{
return isEnabledInHierarchy();
}
|
public void select (int index) {
checkWidget ();
int count = getItemCount ();
if (0 <= index && index < count) {
if ((style & SWT.READ_ONLY) != 0) {
((NSPopUpButton)view).selectItemAtIndex(index);
sendEvent (SWT.Modify);
} else {
((NSComboBox)view).selectItemAtIndex(index);
}
}
}
//boolean sendKeyE... | public void select (int index) {
checkWidget ();
int count = getItemCount ();
if (0 <= index && index < count) {
if ((style & SWT.READ_ONLY) != 0) {
((NSPopUpButton)view).selectItemAtIndex(index);
sendEvent (SWT.Modify);
} else {
((NSComboBox)view).selectItemAtIndex(index);
}
}
}
//boolean sendKeyE... |
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);
}
String parse (String string) {
int length =... | 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);
}
String parse (String string) {
int length =... |
private Filter createRemoteFilter() throws InvalidSyntaxException {
// This filter looks for IHello instances that have the
// 'service.imported' property set, as specified by OSGi 4.2
// remote services spec (Chapter 13)
return bundleContext.createFilter("(&("
+ org.osgi.framework.Constants.OBJECTCLASS +... | private Filter createRemoteFilter() throws InvalidSyntaxException {
// This filter looks for IHello instances that have the
// 'service.imported' property set, as specified by OSGi 4.2
// remote services spec (Chapter 13)
return bundleContext.createFilter("(|("
+ org.osgi.framework.Constants.OBJECTCLASS +... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.