__key__
stringlengths 16
21
| __url__
stringclasses 1
value | txt
stringlengths 183
1.2k
|
---|---|---|
funcom_train/9442770 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean inputDataCheck(View v) {
/* return false if the length of the string exceeds the limit. */
if ((((TextView)v).getTextSize()) > MAX_TEXT_SIZE) {
showDialog(DIALOG_CONTROL_OVER_MAX_TEXT_SIZE);
Log.e("OpenWnn", "inputDataCheck() : over max string length.");
return false;
}
return true;
}
COM: <s> check the input string </s>
|
funcom_train/27863692 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void servrfbSetPixelFormat() throws IOException{
readCard8();// msg type
readCard8(); // bitsPerPixel
readCard8(); // depth
readCard8(); // bigEndian
readCard8(); // trueColour
readCard16(); // redMax
readCard16(); // greenMax
readCard16(); // blueMax
readCard8(); // redShift
readCard8(); // greenShift
readCard8(); // blueShift
}
COM: <s> handles the pixel format message sent by the client to the zvtm server </s>
|
funcom_train/3834437 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean overlaps( HyperBoundingBox box ) {
boolean intersect = true;
for ( int i = 0; i < getDimension(); i++ ) {
if ( ( pMin.getCoord( i ) > box.getPMax().getCoord( i ) ) ||
( pMax.getCoord( i ) < box.getPMin().getCoord( i ) ) ) {
intersect = false;
break;
}
}
return intersect;
}
COM: <s> tests if this and the given hyper bounding box overlaps </s>
|
funcom_train/21612029 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testDeclarationValidationInIfPositiveStatement() {
try {
interpreter.process( " P1(v1) : if( Cond(v1), P1(vX), P2(v1) ); " );
fail("Expected failure");
} catch (InterpreterException ie) {
assertTrue( "Unespected cause.", ie.getCause() instanceof ValidationException );
}
}
COM: <s> tests validation in if positive statement with undefined variables </s>
|
funcom_train/44573420 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void setRefinementLinks() {
JmlSourceField self = (JmlSourceField) getField();
if (refinedDecl == null) {
// has NOT already been set
// compute and then set the refined field
JmlSourceClass ownerClass = (JmlSourceClass) self.owner();
JmlSourceField refinedSrc = ownerClass.lookupRefinedField(self);
if (refinedSrc != null) {
JmlMemberDeclaration refinedField = refinedSrc.getAST();
refinedDecl = refinedField;
refinedField.setRefiningMember(this);
}
}
}
COM: <s> determines the field refined by this field if there is one </s>
|
funcom_train/8135874 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeMethodHeader(MethodDoc method, boolean isFirst) {
if (! isFirst) {
writer.printMemberHeader();
}
writer.println();
String erasureAnchor;
if ((erasureAnchor = getErasureAnchor(method)) != null) {
writer.anchor(erasureAnchor);
}
writer.anchor(method);
writer.h3();
writer.print(method.name());
writer.h3End();
}
COM: <s> write the method header for the given method </s>
|
funcom_train/20842957 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void checkNamespace(NamedObject no) {
if (no != null) {
QName name = no.getName();
if (name != null) {
String namespace = name.getNamespace();
String localPart = name.getLocalPart();
String prefix = name.getPrefix();
int priority = name.getPriority();
if ("".equals(namespace)) {
namespace = this.name.getNamespace();
name = new QName(localPart, namespace, prefix, priority);
no.setName(name);
checkSubs(no);
}
}
}
}
COM: <s> sets a default namespace if no one is set </s>
|
funcom_train/14233557 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addPhrase(String name, String message, int hotkey) throws SQLException{
c.createStatement().executeUpdate("INSERT INTO phrases(name, message, hotkey) VALUES ('"+cleanUp(name)+"', '"+cleanUp(message)+"', '"+hotkey+"')");
}
COM: <s> adds a phrase to the database </s>
|
funcom_train/4744811 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void resetLists() {
this.runnableApplicationsMap = null;
this.allApplicationsMap = null;
this.ratings.clear();
this.costs.clear();
this.sortCriteriaMapAll.clear();
this.sortCriteriaMapRunnable.clear();
this.createAppCache.clear();
this.launchAppViewQuota = null;
createApplicationData.reset();
startApplicationData.reset();
}
COM: <s> resets the two lists of applications </s>
|
funcom_train/21483909 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String generateKey(Object object) {
String key = null;
if (object != null) {
key = regionHash + "-" + getHash(object.getClass().getName().hashCode()) + "-" + Integer.toHexString(object.hashCode());
}
return key;
}
COM: <s> in current implementation we just emulating default to string </s>
|
funcom_train/27822909 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSelectionModel(ListSelectionModel listSelectionModel) {
if (listSelectionModel==DUMMY_SELECTION_MODEL) {
super.setSelectionModel(listSelectionModel);
return;
}
throw new UnsupportedOperationException("Call JTreeTable.setSelectionModel(ListSelectionModel) is not allowed - use JTreeTable.setTreeSelectionModel() instead.");
}
COM: <s> overridden to disallow setting list selection model </s>
|
funcom_train/48045954 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long totalNanos() {
if (this == ZERO) {
return 0;
}
long secs = ((hours * 60L + minutes) * 60L + seconds); // will not overflow
long otherNanos = MathUtils.safeMultiply(secs, 1000000000L);
return MathUtils.safeAdd(otherNanos, nanos);
}
COM: <s> gets the total number of nanoseconds represented by this period using standard </s>
|
funcom_train/15743377 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void updateCurrentLocalAtomicOperation(Operation newMRO) {
if (currentLocalCompositeOperation == null) {
currentLocalCompositeOperation = currentLocalAtomicOperation;
} else if (currentLocalAtomicOperation != null)
currentLocalCompositeOperation = new SplitOperation(
currentLocalCompositeOperation, currentLocalAtomicOperation);
currentLocalAtomicOperation = newMRO;
}
COM: <s> integrates the current local atomic operation in the current local </s>
|
funcom_train/40885267 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void drawPixmap (Pixmap pixmap, int x, int y, int srcx, int srcy, int srcWidth, int srcHeight) {
this.pixmap.drawPixmap(pixmap.pixmap, srcx, srcy, x, y, srcWidth, srcHeight);
}
COM: <s> draws an area form another pixmap to this pixmap </s>
|
funcom_train/21612016 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addWordReader(WordReader wr) {
if( wr == null ) {
throw new NullPointerException();
}
WordReader[] newReaders = new WordReader[ readers.length + 1 ];
System.arraycopy( readers, 0, newReaders, 0, readers.length );
newReaders[ readers.length ] = wr;
readers = newReaders;
}
COM: <s> adds a word reader to the parser </s>
|
funcom_train/2288948 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean match(String vfsName) {
boolean match = false;
for (int j = 0; j < m_vfsFolders.size(); j++) {
Pattern pattern = (Pattern)m_vfsFolders.get(j);
match = pattern.matcher(vfsName).matches();
if (match) {
break;
}
}
return match;
}
COM: <s> checks if a vfs name matches the given static export folders </s>
|
funcom_train/51622753 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Group createButtonGroup(Composite composite, String title) {
Group buttonComposite = new Group(composite, SWT.NONE);
buttonComposite.setText(title);
buttonComposite.setFont(composite.getFont());
FormLayout layout = new FormLayout();
layout.marginWidth = 2;
layout.marginHeight = 2;
buttonComposite.setLayout(layout);
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
| GridData.GRAB_HORIZONTAL);
buttonComposite.setLayoutData(data);
return buttonComposite;
}
COM: <s> create a composite that for creating the tab toggle buttons </s>
|
funcom_train/30070056 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String createService(){
FacesContext facesContext=FacesContext.getCurrentInstance();
Application application = facesContext.getApplication();
CreateServiceBean bean = new CreateServiceBean();
bean.setServiceName(objectName);
beanObject = (CreateServiceBean) bean;
ValueBinding valueBinding = application.createValueBinding("#{createServiceBean}");
valueBinding.setValue(facesContext, beanObject);
return ServiceConstants.CREATE_SERVICE;
}
COM: <s> create service instance </s>
|
funcom_train/36941011 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void handleInputElements(Eventable eventable) {
List<FormInput> formInputs = eventable.getRelatedFormInputs();
for (FormInput formInput : formHandler.getFormInputs()) {
if (!formInputs.contains(formInput)) {
formInputs.add(formInput);
}
}
eventable.setRelatedFormInputs(formInputs);
formHandler.handleFormElements(formInputs);
}
COM: <s> enters the form data </s>
|
funcom_train/39949462 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Enumeration getExceptDates() {
return new Enumeration() {
private int index = 0;
/**
* @see java.util.Enumeration#hasMoreElements()
*/
public boolean hasMoreElements() {
return index < exceptDates.size();
}
/**
* @see java.util.Enumeration#nextElement()
*/
public Object nextElement() {
if(index >= exceptDates.size())
throw new NoSuchElementException();
Object next = exceptDates.elementAt(index);
index++;
return next;
}
};
}
COM: <s> returns the dates for which this repeat rule should not occur </s>
|
funcom_train/4364279 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setCompressableMimeTypes(String compressableMimeTypes) {
if (compressableMimeTypes != null) {
this.compressableMimeTypes = null;
StringTokenizer st = new StringTokenizer(compressableMimeTypes, ",");
while (st.hasMoreTokens()) {
addCompressableMimeType(st.nextToken().trim());
}
}
}
COM: <s> set compressable mime type list </s>
|
funcom_train/17713980 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setCenteredToScreen() {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
double x = (screenSize.getWidth() - getWidth()) / 2;
double y = (screenSize.getHeight() - getHeight()) / 2;
setLocation((int) (x), (int) (y));
}
COM: <s> this operation will set the frame position to the center of screen </s>
|
funcom_train/48211604 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public UnmodifiableItemPNode getItemPNode(Object item) {
Item itemInModel = model.getItem(item);
if (itemInModel == null) {
logger.debug("Item " + item + " not in model.");
return null;
}
for (UnmodifiableItemPNode itemNode : containedItems) {
if (itemInModel.getItem() == itemNode.getItem().getItem()) {
return itemNode;
}
}
return null;
}
COM: <s> returns the item pnode that represents the item that contains the object </s>
|
funcom_train/11023492 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testAddProperty2() {
dynaClass.add(testProperty, String.class);
DynaProperty dynaProperty = dynaClass.getDynaProperty(testProperty);
assertEquals("name is correct", testProperty, dynaProperty.getName());
assertEquals("type is correct", String.class, dynaProperty.getType());
}
COM: <s> test add name type method </s>
|
funcom_train/38868271 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isIntersection(DateInterval d) {
if (!d.isValid() || !isValid())
return false;
return !(dateTo.getDayId() < d.dateFrom.getDayId() ||
dateFrom.getDayId() > d.dateTo.getDayId());
};
COM: <s> returns true if the interval has non empty intersection with another one </s>
|
funcom_train/37657490 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void locationListInit() {
LOGGER.entering(getClass().getName(), "locationListInit");
assert locationList == null : "locationList already initalized.";
locations = new Vector();
locationList = new JList(locations);
LOGGER.exiting(getClass().getName(), "locationListInit");
}
COM: <s> initializes the location list </s>
|
funcom_train/37836249 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Sprite getQuantitySprite(T entity) {
int quantity;
String label;
quantity = entity.getQuantity();
if (quantity <= 1) {
return null;
} else if (isContained() && (quantity > 9999999)) {
label = (quantity / 1000000) + "M";
} else if (isContained() && (quantity > 9999)) {
label = (quantity / 1000) + "K";
} else {
label = Integer.toString(quantity);
}
return TextSprite.createTextSprite(label, Color.WHITE);
}
COM: <s> get the appropriate quantity sprite </s>
|
funcom_train/41725794 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeMenuItemAt(int index) {
if (index < 0 || index >= itemCount) {
throw new IndexOutOfBoundsException("You have specified a invalid item index" + index);
}
// in case no more items in menu, do nothing.
if (itemCount == 0) {
return;
}
composite.getLayoutManager().removeCellAt(index);
if (getSelectedItemIndex() >= index) {
selectedItemIndex--;
}
setSelectedItem(selectedItemIndex, true);
itemCount--;
setNeedLayout();
}
COM: <s> remove an item into menu with specified index </s>
|
funcom_train/21883524 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void clearContext() {
objectInContext = null;
clearObjectViewPane();
setBoolean(find("tabbedPane"), "enabled", false); // disable the Tabs
setBoolean(find("instanceDirExplorer"), "enabled", false);
setBoolean(find("moduleEditor"), "enabled", false);
}
COM: <s> reinitializes the console to starting state </s>
|
funcom_train/3405133 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Loader createItemUnmarshaller(UnmarshallerChain chain, RuntimeTypeRef typeRef) {
if(PropertyFactory.isLeaf(typeRef.getSource())) {
final Transducer xducer = typeRef.getTransducer();
return new TextLoader(xducer);
} else {
return refs.get(typeRef).getLoader(chain.context,true);
}
}
COM: <s> creates a loader handler that unmarshals the body of the item </s>
|
funcom_train/40460471 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JTextField getJTF_ID() {
if (jTF_ID == null) {
jTF_ID = new JTextField();
jTF_ID.setPreferredSize(new Dimension(100, 20));
jTF_ID.setBackground(new Color(204, 255, 255));
jTF_ID.setHorizontalAlignment(JTextField.LEADING);
}
return jTF_ID;
}
COM: <s> this method initializes j tf id </s>
|
funcom_train/51783158 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JCheckBoxMenuItem createCheckBoxMenuItem(JMenu menu, String name) {
String prefix = "menuitem." + name;
JCheckBoxMenuItem menuitem =
new JCheckBoxMenuItem(getResourceString(prefix + ".name"));
addMenuItemInformation(menuitem, prefix);
menu.add(menuitem);
return menuitem;
}
COM: <s> creates a checkbox menu item </s>
|
funcom_train/2294675 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public I_CmsResourceType getResourceType(int typeId) throws CmsLoaderException {
I_CmsResourceType result = m_configuration.getResourceTypeById(typeId);
if (result == null) {
throw new CmsLoaderException(Messages.get().container(
Messages.ERR_UNKNOWN_RESTYPE_ID_REQ_1,
new Integer(typeId)));
}
return result;
}
COM: <s> returns the initialized resource type instance for the given id </s>
|
funcom_train/7757560 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected RouteAdvertisement getRoute(EndpointAddress pId, boolean seekRoute) {
// check if we have a valid route
RouteAdvertisement route = null;
synchronized (this) {
route = (RouteAdvertisement) routedRoutes.get(pId);
}
if (route != null || !seekRoute) { // done
return route;
}
return null;
}
COM: <s> get the routed route if any for a given peer id </s>
|
funcom_train/21730955 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private ResultSet doSelect(String sQuery) {
ResultSet oResult;
Statement oStatement;
oResult = null;
try {
oStatement = oConnection.createStatement();
oResult = oStatement.executeQuery(sQuery);
} catch (SQLException e) {
printSQLException(e);
}
return oResult;
}
COM: <s> performs a select sql query </s>
|
funcom_train/1749320 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void process() {
boolean result=true;
ImportResult allImportResult = new ImportResult();
//First stage running
result = process(DEFAULT_MODULE1,DB_IMPORT_TABLE1);
allImportResult.add(importResult);
//Second stage running
result &= process(DEFAULT_MODULE2,DB_IMPORT_TABLE2);
allImportResult.add(importResult);
//Third stage running
result &= process(DEFAULT_MODULE3,DB_IMPORT_TABLE3);
allImportResult.add(importResult);
/*Write summary result into log without DB logging table updating
* using result and allImportResult values
*/
log.setModule(DEFAULT_MODULE);
log.setModuleStep(DEFAULT_MODULE_STEP);
log.finishProcess(result, allImportResult, null);
}
COM: <s> method to sequential running data import stage </s>
|
funcom_train/42659541 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createSShell() {
GridLayout gridLayout = new GridLayout();
gridLayout.makeColumnsEqualWidth = false;
gridLayout.numColumns = 2;
// sShell = new Shell(display, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
// sShell = new Shell(display, SWT.RESIZE | SWT.SHELL_TRIM);
sShell = new Shell(display, SWT.RESIZE | SWT.SHELL_TRIM);
sShell.setText("Shell");
sShell.setLayout(gridLayout);
createCmpLeft();
createCmpRight();
// sShell.setSize(new Point(653, 436));
}
COM: <s> this method initializes s shell </s>
|
funcom_train/19242758 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addWs(final String ws) {
final String[] lines = StringUtility.split(ws, "\n");
for (int i = 0; i < lines.length; i++) {
if (i > 0) {
println();
}
addWsWithoutCR(lines[i]);
}
}
COM: <s> add whitespace to output </s>
|
funcom_train/19780060 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initGet(String remoteFile) throws IOException, FTPException {
// set up data channel
data = control.createDataSocket(connectMode);
data.setTimeout(timeout);
// send the retrieve command
String reply = control.sendCommand("RETR " + remoteFile);
// Can get a 125 or a 150
String[] validCodes1 = { "125", "150" };
lastValidReply = control.validateReply(reply, validCodes1);
}
COM: <s> request to the server that the get is set up </s>
|
funcom_train/7615406 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void add(int px, int py) {
int x1 = Math.min(x, px);
int x2 = Math.max(x + width, px);
int y1 = Math.min(y, py);
int y2 = Math.max(y + height, py);
setBounds(x1, y1, x2 - x1, y2 - y1);
}
COM: <s> enlarges the rectangle to cover the specified point </s>
|
funcom_train/44626247 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testJmlTypes3() {
helpTCF("A.java","import org.jmlspecs.annotation.*; public class A { @Ghost int i; } ",
"/A.java:1: A Java declaration (not within a JML annotation) may not be either ghost or model",64);
}
COM: <s> wrong position model or ghost modifier </s>
|
funcom_train/25567584 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean editCellAt(int row, int column, EventObject e){
if(!super.editCellAt(row, column, e))return false;
TableCellEditor editor = getCellEditor();
if(editor instanceof javax.swing.DefaultCellEditor){
((javax.swing.DefaultCellEditor)editor).getComponent().repaint();
}
return true;
}
COM: <s> overriden to repaint editor component after its installing </s>
|
funcom_train/19977549 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setRendererTo(int column) {
TableColumn col = t.getColumnModel().getColumn(t.getColumnModel().getColumnIndex(t.getModel().getColumnName(column)));
col.setCellEditor(new TableCellEditorForDezimal(new JFormattedTextField()));
col.setCellRenderer(this);
}
COM: <s> set this renderer to the given column editor </s>
|
funcom_train/4699165 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void printTree(Node node, String prefix, int depth) {
if (node == null)
return;
System.out.println(depth + ":\t" + prefix + "--" + node);
printTree(node.child[0], " |" + prefix, depth + 1);
printTree(node.child[1], " |" + prefix, depth + 1);
}
COM: <s> recursively prints placement tree starting from given node </s>
|
funcom_train/3332575 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected TaskList getTaskList() {
IWorkbenchPage page = getActivePage();
if (page != null) {
IViewReference refs[] = page.getViewReferences();
for (int i = 0; i < refs.length; i++) {
IViewPart part = refs[i].getView(false);
if (part instanceof TaskList) {
return (TaskList) part;
}
}
}
return null;
}
COM: <s> fetches the task list if it is amoung the open views </s>
|
funcom_train/14237057 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void adjustSize(Dimension amount) {
this.size.width += amount.width;
this.size.height += amount.height;
if(this.size.width < minimumSize.width)
this.size.width = minimumSize.width;
if(this.size.height < minimumSize.height)
this.size.height = minimumSize.height;
if(this.size.width > maximumSize.width)
this.size.width = maximumSize.width;
if(this.size.height > maximumSize.height)
this.size.height = maximumSize.height;
}
COM: <s> adjust size by the given amount which may be positive or </s>
|
funcom_train/45692169 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addModDestPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_PartWithCommon_modDest_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_PartWithCommon_modDest_feature", "_UI_PartWithCommon_type"),
EsxPackage.Literals.PART_WITH_COMMON__MOD_DEST,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the mod dest feature </s>
|
funcom_train/25504466 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected int getIntProperty(LogManager lm, String key, int defaultProperty) {
final String property = getProperty(lm, key, null);
int intProperty = defaultProperty;
if (property != null) {
try {
intProperty = Integer.parseInt(property.trim());
} catch (final Exception e) {
errorMessage(e, "Error while parsing int property {0} = \"{1}\".", key, property);
}
}
return intProperty;
}
COM: <s> get an int property from the logging configuration </s>
|
funcom_train/1735740 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void drawAlive(Graphics g) {
g.setColor(Color.BLACK);
g.fillRect(this.getPosition().getX() * CellGrid.CELL_SIDE, this.getPosition().getY() * CellGrid.CELL_SIDE, CellGrid.CELL_SIDE - 1, CellGrid.CELL_SIDE - 1);
}
COM: <s> paints black live cell </s>
|
funcom_train/4918190 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testEnsureOfficeFloorHomeSet() throws Throwable {
// Clear the OFFICE_FLOOR_HOME (so not specified)
System.clearProperty(Bootstrap.OFFICE_FLOOR_HOME);
try {
// Should not Bootstrap as require OFFICE_FLOOR_HOME
Bootstrap.main();
fail("Should not be successful");
} catch (Error ex) {
assertEquals(
"Incorrect cause",
"Exit: ERROR: OFFICE_FLOOR_HOME not specified. Must be an environment variable pointing to the OfficeFloor install directory.",
ex.getMessage());
}
}
COM: <s> ensure issue if </s>
|
funcom_train/3868775 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void paint(Graphics g) {
URL imgURL = getClass().getResource("/icons/splash.jpg");
Toolkit tk = Toolkit.getDefaultToolkit();
Image img = null;
try {
MediaTracker m = new MediaTracker(this);
img = tk.getImage(imgURL);
m.addImage(img, 0);
m.waitForAll();
} catch (Exception e) {
e.printStackTrace();
}
/** Draw the image on the Panel */
g.drawImage(img, 0, 0, this);
}
COM: <s> display a jpg in the panel </s>
|
funcom_train/28768847 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void handleResponse(MessageContext messageContext) throws IOException {
if (!interceptors.isEmpty())
{
boolean hasFault = hasFault(messageContext);
for (EndpointInterceptor interceptor:interceptors)
{
try {
if (!hasFault)
{
if (!interceptor.handleResponse(messageContext, null)) return;
}
else
{
if (!interceptor.handleFault(messageContext, null)) return;
}
} catch (Exception e) {
throw new IOException("Unexpected exception",e);
}
}
}
}
COM: <s> processes response using interceptors </s>
|
funcom_train/786398 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getUniqueCount() {
accessCheck();
if ( m_unique == -1 && m_dynamic ) {
Index idx = m_table.getIndex(m_field);
if ( idx != null ) {
m_unique = idx.uniqueCount();
} else {
m_unique = DataLib.uniqueCount(m_table.tuples(), m_field);
}
}
return m_unique;
}
COM: <s> get the number of unique values in the column </s>
|
funcom_train/9860682 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JScrollPane getJScrollPane() {
if (aJScrollPane == null) {
aJScrollPane = new JScrollPane();
aJScrollPane.setViewportView(getJTable());
aJScrollPane.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
}
return aJScrollPane;
}
COM: <s> this method initializes j scroll pane </s>
|
funcom_train/14025647 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int indexOf(Object obj) {
if (getData() == null) {
return -1;
}
int index = -1;
for (int i = 0; (index == -1) && (i < getRowCount()); i++) {
if (getObjectAt(i).equals(obj)) {
index = i;
}
}
return index;
}
COM: <s> returns the index of the given object relative to what would be visible </s>
|
funcom_train/12119247 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void connEtoC76(java.awt.event.ActionEvent arg1) {
try {
// user code begin {1}
// user code end
this.filtroJMenuItem_ActionPerformed(arg1);
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
COM: <s> conn eto c76 filtro jmenu item </s>
|
funcom_train/4917288 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testRemoveFirst() {
Entry first = new Entry();
Entry middle = new Entry();
Entry last = new Entry();
this.assertNotLast(this.linkedList.removeEntry(first));
this.validateList(middle, last);
// Ensure state of entry is reset
assertNull("Entry next should be cleared", first.getNext());
assertNull("Entry prev should be cleared", first.getPrev());
}
COM: <s> ensure remove first entry of many entries </s>
|
funcom_train/15920884 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Node typeCheck(ContextVisitor tc) {
TypeSystem ts = tc.typeSystem();
if (! ts.isSubtype(cond.type(), ts.Boolean(), tc.context())) {
Errors.issue(tc.job(),
new Errors.IfStatementMustHaveBooleanType(cond.type(), cond.position()),
this);
}
return this;
}
COM: <s> type check the if statement </s>
|
funcom_train/28975830 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public DataFile createListVsListMatrix(int[] binIdsA, int[] binIdsB) {
Collection<Bin> bins = new Vector<Bin>();
Collection<Bin> bins2 = new Vector<Bin>();
for (int id : binIdsA) {
bins.add(getBin(id));
}
for (int id : binIdsB) {
bins2.add(getBin(id));
}
return createListVsListMatrix(bins, bins2);
}
COM: <s> generates a datafile which compares these two lists </s>
|
funcom_train/22548532 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void handleConnect() {
boolean stillOpen = completeConnectionInitialization(connection, true);
processConnectionHeaders(connection);
_lastSuccessfulConnect = System.currentTimeMillis();
_catcher.doneWithConnect(endpoint, true);
if(_pref)
_needPref = false;
try {
if(stillOpen)
startConnection(connection);
} catch(IOException ignored) {}
}
COM: <s> callback that handshaking has succeeded and were all connected and ready </s>
|
funcom_train/1905054 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void setUp() throws Exception {
try {
if (metacatConnectionNeeded) {
debug("setUp() - Testing Metacat Url: " + metacatUrl);
m = MetacatFactory.createMetacatConnection(metacatUrl);
}
} catch (MetacatInaccessibleException mie) {
System.err.println("Metacat is: " + metacatUrl);
fail("Metacat connection failed." + mie.getMessage());
}
}
COM: <s> establish a testing framework by initializing appropriate objects </s>
|
funcom_train/47827738 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean deleteDir(final File dir) {
if (dir.isDirectory()) {
String[] children = dir.list();
for (int i = 0; i < children.length; i++) {
boolean success = deleteDir(new File(dir, children[i]));
if (!success) {
return false;
}
}
}
return dir.delete();
}
COM: <s> deletes a directory and all its contents </s>
|
funcom_train/23280433 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean hasDaoQueries(Map<String, Object> params) {
for(String entry : params.keySet())
{
StringTokenizer st = new StringTokenizer(entry,".");
String className = st.nextToken();
if(className.equals("project") || className.equals("contact") || className.equals("fund"))
return true;
}
return false;
}
COM: <s> method to determine if there are any dao related queries project contact funding </s>
|
funcom_train/4755650 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public RealVector add(RealVector v) {
RealVector result = v.copy();
Iterator<Entry> it = sparseIterator();
Entry e;
while (it.hasNext() && (e = it.next()) != null) {
final int index = e.getIndex();
result.setEntry(index, e.getValue() + result.getEntry(index));
}
return result;
}
COM: <s> compute the sum of this vector and </s>
|
funcom_train/20311043 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean langTagCompatible(LiteralLabel value1, LiteralLabel value2) {
if (value1.language() == null) {
return (value2.language() == null || value2.language().equals(""));
} else {
return value1.language().equalsIgnoreCase(value2.language());
}
}
COM: <s> helper function to compare language tag values </s>
|
funcom_train/35504116 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void init(HttpState httpState) {
for (Credential credential : this.credentials) {
AuthScope authScope = new AuthScope(credential.getHost(),
credential.getPort(), credential.getRealm(),
credential.getScheme());
UsernamePasswordCredentials usernamePasswordCredentials = new UsernamePasswordCredentials(
credential.getUsername(), credential.getPassword());
httpState.setCredentials(authScope, usernamePasswordCredentials);
}
}
COM: <s> initializes the commons httpclient state using the credentials stores in </s>
|
funcom_train/1904873 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: static public Object createObject(String className) throws Exception {
Object object = null;
try {
Class classDefinition = Class.forName(className);
object = classDefinition.newInstance();
} catch (InstantiationException e) {
throw e;
} catch (IllegalAccessException e) {
throw e;
} catch (ClassNotFoundException e) {
throw e;
}
return object;
}
COM: <s> instantiate a class using the name of the class at runtime </s>
|
funcom_train/31751461 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void validateDataBlock() {
if (getDataBlock() != null) {
List<ValidationResult> validationResults = getDataBlock().validate(getStruct());
if (getValidationResultManager() != null)
getValidationResultManager().setValidationResults(validationResults);
} else
logger.warn(this.getClass().getName() + ".validateDataBlock() called before setData()"); //$NON-NLS-1$
}
COM: <s> validates the data in the </s>
|
funcom_train/3903961 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addAttemptLimitPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_LimitConditionsType_attemptLimit_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_LimitConditionsType_attemptLimit_feature", "_UI_LimitConditionsType_type"),
ImsssPackage.Literals.LIMIT_CONDITIONS_TYPE__ATTEMPT_LIMIT,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the attempt limit feature </s>
|
funcom_train/2546980 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setWorkingDir(String workingDir) {
//disconnect control files to change working dir
if(workingDir.equals(this.workingDir))
return;
Iterator iter = targetConnections.iterator();
while (iter.hasNext()) {
ConnectionModel conn = (ConnectionModel) iter.next();
if (conn.getSource() instanceof ActivityControlFileModel) {
conn.disconnect();
}
}
this.workingDir = workingDir;
}
COM: <s> sets the working directory of the activity </s>
|
funcom_train/29322258 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void close(DataOutputStream out, DataInputStream in, Socket socket) {
try {
if (out != null) {
out.close();
}
}
catch (IOException e) {
}
try {
if (in != null) {
in.close();
}
}
catch (IOException e) {
}
try {
if (socket != null && !socket.isClosed()) {
socket.close();
}
}
catch (IOException e) {
}
}
COM: <s> closes the streams and sockets </s>
|
funcom_train/3718259 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getMemberName() {
String memberName = getAccessorName().substring(3, 4).toLowerCase() + getAccessorName().substring(4);
if (!Character.isJavaIdentifierStart(memberName.charAt(0)))
memberName = "_" + memberName;
return memberName;
}
COM: <s> returns the member name </s>
|
funcom_train/27753273 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setWordWrap(boolean wrap) {
checkWidget();
if (wrap != wordWrap) {
ScrollBar horizontalBar = getHorizontalBar();
wordWrap = wrap;
if (wordWrap) {
logicalContent = content;
content = new WrappedContent(renderer, logicalContent);
}
else {
content = logicalContent;
}
calculateContentWidth();
caretLine = content.getLineAtOffset(caretOffset);
horizontalScrollOffset = 0;
if (horizontalBar != null) {
horizontalBar.setVisible(!wordWrap);
}
setScrollBars();
setCaretLocation();
super.redraw();
}
}
COM: <s> sets whether the widget wraps lines </s>
|
funcom_train/42442333 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Cookie setupEncryptedCookie( String CookieName, String CookieValue, int Expires, String DesKey, syslogLogger logger ){
// Encrypt the value
cryptoMagic cm = new cryptoMagic();
String EncryptedCookieValue = cm.DES( DesKey, CookieValue, "encrypt", logger );
Cookie userCookie = new Cookie( CookieName, EncryptedCookieValue );
userCookie.setMaxAge(Expires);
return userCookie;
}
COM: <s> setup an encrypted cookie with expiry and return a cookie object </s>
|
funcom_train/29290112 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean checkTypeIdAndSurveyId(Integer survey_type_id, String survey_id) throws EJBException {
boolean check = false;
try {
Collection coll = getSurveyCMPLocalHome().findCheckTypeIdAndSurveyId(survey_type_id, survey_id);
if(coll.size() >0)
check = true;
} catch (FinderException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return check;
}
COM: <s> check type id of survey id is true or false </s>
|
funcom_train/1549980 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addMapping(int hashIndex, int hashCode, K key, V value) {
modCount++;
HashEntry<K, V> entry = createEntry(data[hashIndex], hashCode, key, value);
addEntry(entry, hashIndex);
size++;
checkCapacity();
}
COM: <s> adds a new key value mapping into this map </s>
|
funcom_train/4197292 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int findDataElementIndex(final Object anItem) {
if (anItem == null) {
throw new NullPointerException("Item to find must not be null"); //$NON-NLS-1$
}
for (int i = 0; i < data.size(); i++) {
final ComboBoxItemPair datacon = (ComboBoxItemPair) data.get(i);
if (anItem.equals(datacon.getKey())) {
return i;
}
}
return -1;
}
COM: <s> searches an element by its data value </s>
|
funcom_train/8685917 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isSelected(File basedir, String filename, File file) {
init();
setSelected(true);
this.file = file;
this.basedir = basedir;
this.filename = filename;
runner.addBean("basedir", basedir);
runner.addBean("filename", filename);
runner.addBean("file", file);
runner.executeScript("ant_selector");
return isSelected();
}
COM: <s> method that each selector will implement to create their selection </s>
|
funcom_train/30254185 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: GridCellListenerAdapter statusListener = new GridCellListenerAdapter() {
public void onCellClick(Grid grid, int rowIndex, int colIndex, EventObject e) {
Record record = grid.getStore().getAt(rowIndex);
disableButton.setText( (record.getAsBoolean( TableWidgetInitializer.customerTablecolumnModel.getDataIndex(1)))?"Disable":"Enable" );
}
};
COM: <s> add button enabled disabled click listener </s>
|
funcom_train/7756607 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
//Add new voices, with name and icon, to Activity Menu
menu.add(0, 0,0, "Network Info").setIcon(R.drawable.network_48);
menu.add(1, 1, 1, "Network Graph").setIcon(R.drawable.graph_48);
menu.add(2,2, 2, "Peer List").setIcon(R.drawable.network_48);
return true;
}
COM: <s> called when the options menu was created </s>
|
funcom_train/12176380 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private URI stripFragmentComponent(URI uri) {
try {
// Use the constructor, which takes scheme, scheme-specific part and
// fragment components, providing all but fragment component.
return new URI(uri.getScheme(), getURISchemeSpecificPart(uri), null);
} catch (URISyntaxException e) {
// This should never happen
throw new IllegalStateException("Can not strip fragment component from URI.");
}
}
COM: <s> strips the fragment component from the uri </s>
|
funcom_train/31658967 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addFormModelInVelocityContext(Context ctx) {
FormModel fm = getFormModel();
ctx.put("formModel", fm);
if (getIsViewState()) {
ctx.put("walker", new FormModelTreeWalkerSimple(fm, communicator
.getLanguage()));
} else {
ctx.put("walker", new FormModelTreeWalkerSimple(fm));
}
}
COM: <s> adds the form model in velocity context </s>
|
funcom_train/801670 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object getAdapter(Class key) {
if (key.equals(IContentOutlinePage.class)) {
return showOutlineView() ? getContentOutlinePage() : null;
}
else if (key.equals(IPropertySheetPage.class)) {
return getPropertySheetPage();
}
else if (key.equals(IGotoMarker.class)) {
return this;
}
else {
return super.getAdapter(key);
}
}
COM: <s> this is how the framework determines which interfaces we implement </s>
|
funcom_train/45622993 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addTargetTypePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CscType_targetType_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_CscType_targetType_feature", "_UI_CscType_type"),
MSBPackage.eINSTANCE.getCscType_TargetType(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the target type feature </s>
|
funcom_train/46815557 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSave() {
fail("Not yet implemented");
IClosure<IAppClass> closure=new IClosure<IAppClass>(){
public Object run(IAppClass appClass) {
IAppObject appObject = getDataFacade().newAppObject(appClass);
appObject.saveToObject();
getDataFacade().save(appObject);
return appObject;
}};
this.testAll(closure);
}
COM: <s> caution changes data </s>
|
funcom_train/2888113 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ModulesManager getModulesManager() throws ModuleCreationException{
if( null == helper ){
throw new ModuleCreationException("Xindice Database not Initialized");
}
if( repository == null ){
try{
Collection col = helper.getCollection(MODULES_COLNAME);
if ( null == col){
// create a new collection if it doesnt exist when running first time..
col = helper.createCollection("/", MODULES_COLNAME);
}
repository = new ModulesManagerImpl(col);
}catch(DBException e){
log.error(e);
throw new ModuleCreationException(e);
}
}
return repository ;
}
COM: <s> returns avalanche repository if required database collection doesnt exist it creates it </s>
|
funcom_train/40440161 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean isTimeValid(long timestamp) {
if (timestamp == -1)
return false;
Calendar cal = Calendar.getInstance();
if (logger.isDebugEnabled())
logger.debug("Time: server=" + cal.getTimeInMillis() + ", client=" + timestamp);
// Ignore the request if the timestamp is too far off.
if (Math.abs(timestamp - cal.getTimeInMillis()) > getConfiguration().getInt("timeSkew", 600000))
return false;
return true;
}
COM: <s> a helper method that checks if the timestamp of the request </s>
|
funcom_train/2302686 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void draw(Graphics2D g, Dimension2D size) {
if (!valid) revalidate();
g = (Graphics2D) g.create();
// Draw the nodes.
g.setFont(g.getFont().deriveFont(10.0f));
g.setColor(Color.black);
draw(g, (TreeNode) tree.getRoot(), size, null);
g.dispose();
}
COM: <s> draws the tree in the indicated amount of space </s>
|
funcom_train/46628586 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void closeAccount(String username, String password) throws ValidationFailedException, UserException {
// This will validate that the user credentials are valid.
String token = requestToken(username, password);
User user = userService.getByUsername(username);
// Set the user inactive
user.setActive(false);
userService.save(user);
// Close the previously opened session.
closeSession(token);
}
COM: <s> this will set a user account to inactive </s>
|
funcom_train/51172242 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setMappedComponentClass (String className) throws XForgeException {
try {
this.mappedObject = Class.forName(className).newInstance();
} catch (Exception ex) {
throw new XForgeException("An error ha occured while instantiating mapped object: "
+ className + " Error occured: " + ex.getMessage());
}
}
COM: <s> sets the class that is mapped </s>
|
funcom_train/20144487 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void getObjects(S3Bucket bucket, S3Object[] objects) {
String[] objectKeys = new String[objects.length];
for (int i = 0; i < objects.length; i++) {
objectKeys[i] = objects[i].getKey();
}
getObjects(bucket, objectKeys);
}
COM: <s> retrieves multiple objects details and data from a bucket and sends </s>
|
funcom_train/43245177 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSetEmployer() {
System.out.println("setEmployer");
String employer = "";
EmploymentDataDG1Object instance = new EmploymentDataDG1Object();
instance.setEmployer(employer);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
COM: <s> test of set employer method of class org </s>
|
funcom_train/5893324 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public static Class<?> getClass(Type type) {
if (type instanceof Class<?>) return (Class<?>) type;
else if (type instanceof ParameterizedType)
return getClass(((ParameterizedType) type).getRawType());
else if (type instanceof GenericArrayType) {
Class<?> c =
getClass(((GenericArrayType) type).getGenericComponentType());
if (c != null) return Array.newInstance(c, 0).getClass();
}
return null;
}
COM: <s> return the class representing the given type </s>
|
funcom_train/941391 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void endDocument() throws SAXException {
try {
// Open the connection
openConnection(connectionUrl);
// Populate the records table
//populateRecords();
} catch (ConnectorException ex) {
// Throw a SAXException encapsulating the SQLException
throw new SAXException("Could not parse configuration file.",
ex);
}
}
COM: <s> called when the end of the document has been reached </s>
|
funcom_train/17290788 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean checkCompatible(LockRequest request, LockMode mode) {
boolean iscompatible = true;
/* Check if there are other holders */
for (LockRequest other : getQueue()) {
if (other == request)
continue;
else if (other.status == LockRequestStatus.WAITING)
break;
else {
if (!mode.isCompatible(other.mode)) {
iscompatible = false;
break;
}
}
}
return iscompatible;
}
COM: <s> checks whether the specified lock request is compatible with the granted group </s>
|
funcom_train/14372836 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean userSaysRevert() {
ftf.selectAll();
Object[] options = {"Edit",
"Revert"};
int answer = JOptionPane.showOptionDialog(
SwingUtilities.getWindowAncestor(ftf),
"The value must be an integer between "
+ minimum + " and "
+ maximum + ".\n"
+ "You can either continue editing "
+ "or revert to the last valid value.",
"Invalid Text Entered",
JOptionPane.YES_NO_OPTION,
JOptionPane.ERROR_MESSAGE,
null,
options,
options[1]);
if (answer == 1) { //Revert!
ftf.setValue(ftf.getValue());
return true;
}
return false;
}
COM: <s> lets the user know that the text they entered is </s>
|
funcom_train/10804903 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int readDocType(char[] buf, int off, int len) throws IOException {
if (_docType == null)
return 0;
int read = _docType.read(buf, off, len);
if (read < len)
_docType = null;
if (read == -1)
read = 0;
return read;
}
COM: <s> read from the doc type declaration to the given array returning the </s>
|
funcom_train/8077038 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object clone() throws CloneNotSupportedException {
AlgVector v = (AlgVector)super.clone();
v.m_Elements = new double[numElements()];
for (int i = 0; i < numElements(); i++) {
v.m_Elements[i] = m_Elements[i];
}
return v;
}
COM: <s> creates and returns a clone of this object </s>
|
funcom_train/34428100 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setDefaultModule(Element appElement) throws WebItemNotAvailableException, InvalidXMLElementException {
String defaultModuleName;
defaultModuleName = super.getAttribute(appElement, ATT_DEFAULT_MODULE, true);
this.defaultModule = (WebModule) this.getModule(defaultModuleName);
}
COM: <s> setting the default module of this application </s>
|
funcom_train/1963409 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JScrollPane getJScrollPaneDepartments() {
if (jScrollPaneDepartments == null) {
jScrollPaneDepartments = new JScrollPane();
//jScrollPaneDepartments.setBounds(new Rectangle(14, 256, 597, 297));
jScrollPaneDepartments.setViewportView(getJListDepartments());
jScrollPaneDepartments.setBounds(new Rectangle(18, 78, 284, 114));
}
return jScrollPaneDepartments;
}
COM: <s> this method initializes j scroll pane departments </s>
|