__key__ stringlengths 16 21 | __url__ stringclasses 1 value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/46975033 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String jdomToString(Document JDOMIn) throws JDOMException {
StringWriter strWriter = new StringWriter();
XMLOutputter outputter = new XMLOutputter(" ", true);
try {
outputter.output(JDOMIn, strWriter);
} catch (IOException e) {
throw new JDOMException("Error converting JDOM to String");
}
return strWriter.toString();
}
COM: <s> returns a jdom document as a string </s>
|
funcom_train/18358136 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Mission getMissionForID(String missionID) {
Mission retVal = null;
assert(missionList != null);
Iterator anIt = missionList.values().iterator();
while (anIt.hasNext()) {
Mission aMission = (Mission) anIt.next();
// if the eva is in the mission exec then return the mission
if (aMission.getMissionId() == new Long(missionID).longValue()) {
retVal = aMission;
}
}
return retVal;
}
COM: <s> returns the mission for the given mission id or null </s>
|
funcom_train/32060147 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public HullShape getHullShape(int index, StarshipSize shipsize) {
Err.argcheckLessThanZero(index, "index");
Vector<StandardHullShape> standardshapes = StandardHullShape.getAllOfSize(shipsize);
int count = standardshapes.size();
Err.argcheckGreater(index, "index", count - 1, "count - 1");
String hullshapename = standardshapes.get(index).getResourceName();
return getHullShape(hullshapename);
}
COM: <s> returns a hull shape instance referenced by the index </s>
|
funcom_train/17049496 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void readFullNode(XmlInputStream inputStream, Tree<Data> tagNode) throws IOException {
if (tagNode != null) {
final XmlLite.Tag tag = tagNode.getData().asTag();
if (!tag.isSelfTerminating()) {
readText(inputStream, new StringBuilder(), false, null, false, tagNode);
}
}
}
COM: <s> read the full xml node after having read its open tag </s>
|
funcom_train/51340779 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean rangeCheckSpannedTupleIndex(final int entryIndex) {
final int nentries = data.getSpannedTupleCount();
if (entryIndex < 0)
throw new IndexOutOfBoundsException("negative: " + entryIndex);
if (entryIndex >= nentries) {
throw new IndexOutOfBoundsException("too large: entryIndex="
+ entryIndex + ", but nentries=" + nentries);
}
return true;
}
COM: <s> range check an index into the keys of the node </s>
|
funcom_train/51556933 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeOtherLocales() {
List<Locale> availableLocales = content.getLocales();
for (Locale availableLocale : availableLocales) {
if (!availableLocale.equals(this.locale)) {
try {
content.removeLocale(availableLocale);
} catch (CmsXmlException e) {
// Cannot happen: this Locale must exist, but maybe something else goes wrong
throw new IllegalStateException(e);
}
}
}
}
COM: <s> remove all other locales </s>
|
funcom_train/4865043 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean setBufferData(int bufIndex, DecodeInfo info, byte [] data, int bytesRead) {
boolean result = false;
if (data != null) {
/* populate the buffer */
alBufferData( getBuffer(bufIndex)
, toALFormat(info.getFormat())
, ByteBuffer.wrap(data, 0, bytesRead)
, info.getRate());
result = true;
}
return result;
}
COM: <s> sets the buffer data for the given buffer </s>
|
funcom_train/44898474 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void assertTypesPresent(Map map, ComponentKind kind) throws Exception {
Object val = map.get(kind);
assertNotNull("Some types of kind " + kind + " are present", val);
assertTrue("Count is an Integer", val instanceof Integer);
Integer integer = (Integer) val;
assertTrue("Count is greater than 0", integer.intValue() > 0);
}
COM: <s> assert that the map contains a nonzero count value for the given kind </s>
|
funcom_train/28664195 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Bar setBarStandardSettings(Bar rawBar) {
rawBar.setGC(gc);
if (rawBar.getColorMainBar() == null)
rawBar.setColorMainBar(barColor);
if (rawBar.getWidth() == -1)
rawBar.setWidth(barWidth);
return rawBar;
}
COM: <s> ensures that a bar when added to a graph has all needed properties </s>
|
funcom_train/47674247 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getIcon(Class p_class, String p_elementType, IconSizeEnum p_size) {
if (nameHelper == null) {
return DEFAULT_HELPER.getIcon(getElementName(p_class), p_elementType, p_size);
} else {
return nameHelper.getIcon(getElementName(p_class), p_elementType, p_size);
}
}
COM: <s> this method gets an icon for a specified class </s>
|
funcom_train/44138002 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeAllLines() {
Iterator it = m_LineList.iterator();
while(it.hasNext()) {
OSMSlideBodyLine line = (OSMSlideBodyLine)it.next();
line.setElement(null);
}
m_LineList.clear();
removeAll();
}
COM: <s> to remove all lines of the body </s>
|
funcom_train/9727380 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void write(PrintStream out, String[] translator, int tabs) throws IOException {
StringBuffer sb = new StringBuffer(tabs);
for (int i = 0; i < tabs; i++)
sb.append('\t');
String s = sb.toString();
out.print(s);
}
COM: <s> write out this primitive </s>
|
funcom_train/8342757 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getMaskForString(final String mask, final String value) {
String maskForString;
if (getNumberNumericDigits(value) < getMinimumDigits()) {
maskForString = getMask(mask, getNumberOfOccurances(mask, '*')
- getMinimumDigits());
}
else {
maskForString = getMask(mask, getNumberOfOccurances(mask, '*')
- (getNumberNumericDigits(value)));
}
return maskForString;
}
COM: <s> gets the mask to use for the given string </s>
|
funcom_train/9805822 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isAttached(EdifCellInstance cell) {
Iterator i = getConnectedPortRefs().iterator();
while (i.hasNext()) {
EdifPortRef epr = (EdifPortRef) i.next();
if (epr.getCellInstance() == cell)
return true;
}
return false;
}
COM: <s> this method will examine the edif port ref objects connected to this net </s>
|
funcom_train/8636755 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void close(final DirContext context) {
// Do nothing if there is no opened connection
if (context == null) {
return;
}
// Close our opened connection
try {
if (this.containerLog.isDebugEnabled()) {
this.containerLog.debug("Closing directory context");
}
context.close();
} catch (final NamingException e) {
this.containerLog.error(RealmBase.sm.getString("jndiRealm.close"),
e);
}
this.context = null;
}
COM: <s> close any open connection to the directory server for this realm </s>
|
funcom_train/38871671 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Fold getDeepestOpenFoldContaining(int offs) {
Fold deepestFold = null;
if (offs>-1) {
for (int i=0; i<folds.size(); i++) {
Fold fold = getFold(i);
if (fold.containsOffset(offs)) {
if (fold.isCollapsed()) {
return null;
}
deepestFold = fold.getDeepestOpenFoldContaining(offs);
break;
}
}
}
return deepestFold;
}
COM: <s> returns the deepest open fold containing the specified offset </s>
|
funcom_train/18641024 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void editItem() {
if (isEditItemAvailable()) {
getContainer().open(new EditTask(selectedItem) {
public void onClose(Object returnCtx) {
if (returnCtx != null) {
onEditAccepted();
} else {
onEditCancelled();
}
}
});
followPath(EDIT_ITEM_PATH);
}
}
COM: <s> handler for edit item user event </s>
|
funcom_train/31702105 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ISwingControllerPlugin getInteractionPlugin(int interactionModus) {
switch (interactionModus) {
case ZOOM_MODE :
return zoomPlugin;
case MARK_MODE :
return markPlugin;
case SCISSOR_MODE :
return scissorPlugin;
case ALIGN_MODE :
return alignPlugin;
default :
throw new NullPointerException("There is no plugin for interaction mode " + interactionModus);
}
}
COM: <s> returns the plugin for the given interaction mode </s>
|
funcom_train/44438109 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void flush() {
if ( _doc != null ) {
try {
if ( !_doc.isDeleted() ) {
_doc.save();
_messages.recycle();
_messages = null;
_doc.recycle();
_doc = null;
}
} catch ( NotesException e ) {
StringWriter sw = new StringWriter();
e.printStackTrace( new PrintWriter( sw ) );
LogLog.error( "Error while saving log document to Domino: " + e.text + "\n" + sw.toString() );
}
}
}
COM: <s> flushes the log changes by saving the document to the database </s>
|
funcom_train/49409323 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String write() throws TutorialException {
String out;
try {
out = didl.getXML();
out = format(out);
date = DateUtil.date2UTC(new Date());
log.debug("Date: " + date);
} catch (Exception e) {
throw new TutorialException(
"Error occurred attempting to serialize didl to xml: "
+ e.getMessage());
}
return out;
}
COM: <s> serializes processed document to xml string format </s>
|
funcom_train/7623369 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean isFieldUpdated(int columnIndex) {
if (mRowIdColumnIndex != -1 && mUpdatedRows.size() > 0) {
Map<String, Object> updates = mUpdatedRows.get(mCurrentRowID);
if (updates != null && updates.containsKey(getColumnNames()[columnIndex])) {
return true;
}
}
return false;
}
COM: <s> this function returns true if the field has been updated and is </s>
|
funcom_train/1600729 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run(){
GUI gui = (GUI)registeredObject;
GPane pane = gui.getTopPane();
pane.setMode(GPane.DRAGGING_MODE);
super.setSelected(true);
gui.getNotifier().firePaneEvent(this);
gui.getProgressMeter().getPanel().repaint();
}
COM: <s> method to perform the necessary tasks for the button action </s>
|
funcom_train/7646320 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void schedule(TimerTask task, Date when, long period) {
if (period <= 0 || when.getTime() < 0) {
throw new IllegalArgumentException();
}
long delay = when.getTime() - System.currentTimeMillis();
scheduleImpl(task, delay < 0 ? 0 : delay, period, false);
}
COM: <s> schedule a task for repeated fixed delay execution after a specific time </s>
|
funcom_train/3717914 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setData(Vector data) {
clearSelection();
int size = data.size() - 1;
for (int i=0; i < size; i++) {
setSelectedValue(data.get(i), false);
}
// scroll only to the last element, scrolling for each would be to slow
setSelectedValue(data.lastElement(), true);
}
COM: <s> sets the lists selected items </s>
|
funcom_train/49429649 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Group addWidget(Widget w) {
if(w.getParent() != getDialogLayout()) {
getDialogLayout().add(w);
}
WidgetSpring s = widgetSprings.get(w);
if(s == null) {
throw new IllegalStateException("WidgetSpring for Widget not found: " + w);
}
addSpring(s);
return this;
}
COM: <s> adds a widget to this group </s>
|
funcom_train/51483562 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void putFile(String name, String filename, String contentType, byte[] data) {
FileParameter entry = new FileParameter();
entry.name = name;
entry.filename = filename;
entry.contentType = contentType;
entry.data = data;
parameters.put(name, entry);
}
COM: <s> adds a file parameter to the form </s>
|
funcom_train/12560574 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void onDisplayBackgroundProcessed(int displayId) {
synchronized (this) {
if (preemptionDoneCalled && preemptingDisplay != null &&
preemptingDisplay.getDisplayId() == displayId) {
displayContainer.removeDisplay(
preemptingDisplay.getNameOfOwner());
preemptingDisplay = null;
preemptionDoneCalled = false;
// A midlet may be waiting to preempt
this.notify();
}
}
}
COM: <s> called by display to notify display event handler that </s>
|
funcom_train/25471293 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private double getScore() {
double sum = 0;
for (int j = 0; j < crypto_digrams.length; j++)
for (int k = 0; k < crypto_digrams.length; k++)
sum += Math.abs(crypto_digrams[j][k] - english_digrams[d_key[j]][d_key[k]]);
// sum += Math.abs(crypto_digrams[d_key[j]][d_key[k]] - english_digrams[j][k]);
return sum;
}
COM: <s> computes the current score of the decryption as the sum of </s>
|
funcom_train/973579 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JSONObject put(String key, Object value) throws JSONException {
if (key == null) {
throw new JSONException("Null key.");
}
if (value != null) {
testValidity(value);
this.map.put(key, value);
} else {
remove(key);
}
return this;
}
COM: <s> put a key value pair in the jsonobject </s>
|
funcom_train/14245100 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public MActor buildActor(MNamespace ns) {
if (ns == null) return buildActor();
MActor actor = createActor();
actor.setNamespace(ns);
actor.setLeaf(false);
actor.setRoot(false);
actor.setName("newActor");
return actor;
}
COM: <s> builds an actor in the given namespace </s>
|
funcom_train/35725320 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public FieldElement check(int[] position) {
if (position[0] > 0 && position[0] < size + 1 && position[1] > 0 && position[1] < size + 1) {
return( elements[(position[0]-1)][(position[1]-1)] );
} else {
return( (new Stone(this)).setNomap() );
}
}
COM: <s> checks field element in a given position </s>
|
funcom_train/12075980 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setText(String text1) {
sortedElemsList.removeAllElements();
lineFragments.removeAllElements();
focusableElems.removeAllElements();
widthUsed = -1;
heightUsed = -1;
if (text1.startsWith("<html>")) {
text = "";
XHTMLLoader loader = new XHTMLLoader();
loader.gotResult( this, text1 );
}
else {
text = text1;
}
}
COM: <s> like swing this method is thread safe </s>
|
funcom_train/49758436 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Client getRandomIdleClient() {
//Random random = new Random();
List<Client> idleClients;
idleClients = this.getIdleClients();
if ( ! idleClients.isEmpty() ) {
int index = this.randomNumber.nextInt(idleClients.size());
logger.debug("Client found: Client-"+ index);
idleClients.get(index).preAllocate();
return idleClients.get(index);
}
return null;
}
COM: <s> finds an idle client </s>
|
funcom_train/43317809 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean wantsToModify(final String name, final long bundleId) {
if (cache != null) {
final Bundle bundle = context.getBundle(bundleId);
final String bundleVersion = (String) bundle.getHeaders().get(
Constants.BUNDLE_VERSION);
final String bundleName = bundle.getSymbolicName() + UNDERSCORE
+ bundleVersion;
return !cache.remainsUnchanged(name, bundleName);
}
return true;
}
COM: <s> does the service want to modify the given class from the given bundle </s>
|
funcom_train/48630798 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetDistanceRestante() {
System.out.println("getDistanceRestante");
Itineraire instance = new Itineraire();
int expResult = 0;
int result = instance.getDistanceRestante();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
COM: <s> test of get distance restante method of class itineraire </s>
|
funcom_train/19417648 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public MessageCollection applyFilter(MessageCollection messagesIn) {
MessageCollection msgsRsl = (MessageCollection)messagesIn.clone();
Iterator msgIt = msgsRsl.iterator();
Message currentMessage;
while (msgIt.hasNext()) {
currentMessage = (Message)msgIt.next();
if (! filterIsApplicable(currentMessage)) {
msgIt.remove();
}
}
return msgsRsl;
}
COM: <s> applies this filter to a message collection </s>
|
funcom_train/41765899 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean isEditingTrigger(int keyCode) {
if(isQwertyInput()) {
return keyCode > 0 || (Display.getInstance().getGameAction(keyCode) == Display.GAME_FIRE);
}
return (keyCode >= '0' && keyCode <= '9') ||
(Display.getInstance().getGameAction(keyCode) == Display.GAME_FIRE);
}
COM: <s> indicates whether the given key code should be ignored or should trigger </s>
|
funcom_train/43096188 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Object buildNewCallAction(String s) {
Object a =
Model.getCommonBehaviorFactory().createCallAction();
Object ae =
Model.getDataTypesFactory().createActionExpression("Java", s);
Model.getCommonBehaviorHelper().setScript(a, ae);
Model.getCoreHelper().setName(a, "anon");
return a;
}
COM: <s> this builds a call action with default attributes </s>
|
funcom_train/15637286 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void closingAction(){
///System.out.println("close app"+ we.getSource().toString());
if (askForConfirmation("Close current window?", StringManager.get(StringManager.CONFIRMATION_FRAME_CLOSE_TITLE))){
dispose();
}
}
COM: <s> a method to be overridden by subclasses </s>
|
funcom_train/10299401 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Map getCombinedMap() {
if (combinedMap == null) {
combinedMap = new TryMap();
if (map != null) {
combinedMap.add(map); // the local map
}
for (Enumeration e = helpsets.elements();
e.hasMoreElements(); ) {
HelpSet hs = (HelpSet) e.nextElement();
combinedMap.add(hs.getCombinedMap());
}
}
return combinedMap;
}
COM: <s> the map for this help set </s>
|
funcom_train/9232999 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setLargeMapControlVisible(boolean on) {
if (on) {
execute("map.largeMapControl = new GLargeMapControl(); map.addControl(map.largeMapControl);");
} else {
execute("if(map.largeMapControl) {map.removeControl(map.largeMapControl); delete map.largeMapControl;}");
}
}
COM: <s> shows hieds the large pan zoom map control </s>
|
funcom_train/28114460 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void onFocus(){
draw(true);
inf.draw(true);
if(!drawn) return;
g.setColor(Color.black);
g.setXORMode(Color.red);
g.drawRect(rect.x,rect.y,rect.width,rect.height);
}
COM: <s> defines what the ann will do if it gets focus </s>
|
funcom_train/43245519 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetSpEmpStreetAddr3() {
System.out.println("getSpEmpStreetAddr3");
EmploymentDataDG2Object instance = new EmploymentDataDG2Object();
String expResult = "";
String result = instance.getSpEmpStreetAddr3();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
COM: <s> test of get sp emp street addr3 method of class org </s>
|
funcom_train/32081825 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void getTransform(Transform transform) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (transform == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (transform.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
if (data.transform != 0) {
OS.MatrixTransform_Matrix(transform.handle, data.transform);
} else {
transform.setElements(1, 0, 0, 1, 0, 0);
}
}
COM: <s> sets the parameter to the transform that is currently being </s>
|
funcom_train/51524737 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setTypeParts(String[] parts) {
this.typeFull = parts[0];
this.typeRaw = parts[1];
this.typeGenericName = parts[2] != null ? parts[2] : "";
this.typeGenericExtends = parts[3] != null ? parts[3] : "";
}
COM: <s> sets the bean type </s>
|
funcom_train/2903839 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void init(XMLTag spec){
if(spec.tag.compareTo("keycode")==0){
try{
int kc = Integer.parseInt(spec.value.toString());
keys.add(new Integer(kc));
}
catch(Exception e){
new JXError(getClass(), "Invalid key code tag parsing", e.getStackTrace());
}
}
else if(spec.tag.compareTo("Command")==0){
exec = new ZCommand(spec);
}
}
COM: <s> initialize keys with a single property tag </s>
|
funcom_train/4644632 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addCommandPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_AttachmentType_command_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_AttachmentType_command_feature", "_UI_AttachmentType_type"),
TassooPackage.Literals.ATTACHMENT_TYPE__COMMAND,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the command feature </s>
|
funcom_train/15918381 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private StmtSeq flattenThrow(Throw stmt) {
List<Stmt> stmts = new ArrayList<Stmt>();
Expr primary = getPrimaryAndStatements(stmt.expr(), stmts);
stmts.add(stmt.expr(primary));
return syn.createStmtSeq(stmt.position(), stmts);
}
COM: <s> flatten a throw statement </s>
|
funcom_train/14653164 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setColumnNames(String[] colNames) {
int max = colNames.length;
for (int index = 0; index < max; index++) {
table.getColumnModel().getColumn(index).setHeaderValue(
colNames[index]);
}
int diff = columnNames.length - colNames.length;
for (int index = 0; index < diff; index++) {
table.getColumnModel().getColumn(colNames.length + index)
.setHeaderValue("");
}
table.getTableHeader().repaint();
}
COM: <s> set the column names </s>
|
funcom_train/17205146 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean LT(Address addr2) {
if (VM.VerifyAssertions && VM.runningVM) VM._assert(VM.NOT_REACHED);
if (value >= 0 && addr2.value >= 0) return value < addr2.value;
if (value < 0 && addr2.value < 0) return value < addr2.value;
if (value < 0) return false;
return true;
}
COM: <s> return true if this </s>
|
funcom_train/3076985 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void saveProject(com.luntsys.luntbuild.facades.lb12.ProjectFacade projectFacade) {
Project project = Luntbuild.getDao().loadProject(projectFacade.getId());
project.setFacade(projectFacade);
project.validate();
Luntbuild.getDao().saveProject(project);
Luntbuild.getSchedService().rescheduleBuilds();
}
COM: <s> update properties of a project based on its facade object </s>
|
funcom_train/25457327 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JCheckBox getCBAverage() {
if (CBAverage == null) {
CBAverage = new JCheckBox();
CBAverage.addItemListener(new java.awt.event.ItemListener()
{
public void itemStateChanged(java.awt.event.ItemEvent e)
{
ProbDetect.setEnabled(!CBAverage.isSelected());
ProbAverageDetect.setEnabled(CBAverage.isSelected());
}
});
}
return CBAverage;
}
COM: <s> this method initializes cbaverage </s>
|
funcom_train/37817326 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private ByteArrayOutputStream serialize() {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try {
ObjectOutputStream serializedObjects = new ObjectOutputStream(
outputStream);
serializedObjects.writeInt(getEditingMode());
serializedObjects.writeObject(getGraph());
serializedObjects.close();
}
catch (IOException IOExc) {
java.lang.System.err.println(IOExc);
throw new InternalErrorException(IOExc.getMessage());
}
return outputStream;
}
COM: <s> get the graph to cast it in a byte array output stream </s>
|
funcom_train/13717966 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetEnd() {
System.out.println("testGetEnd");
Assert.assertEquals(A12A12.getEnd(),A12);
Assert.assertEquals(A12B11.getEnd(),SourceLocation.getSourceLocation("B",1,1,0,0));
Assert.assertEquals(A12Empty.getEnd(), null);
}
COM: <s> test of get end method of class be </s>
|
funcom_train/36108791 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void setBeginningState() {
Iterator<Processor> iterator = getListOfProcessors().iterator();
while (iterator.hasNext()) {
Processor processor = iterator.next();
if (processor.getTimeStep() == minEstSyncWaiterTime) //Equal or greater, nothing else.
processor.setState(Processor.PAUSE);
else if (processor instanceof SynchronizedProcessor &&
((SynchronizedProcessor)processor).isReadyToStart()) {
processor.setState(Processor.PAUSE);
}
}
}
COM: <s> defining initial state of processors </s>
|
funcom_train/43221228 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeNotify() {
((EventTarget) document).removeEventListener("MutationEvent", this,
false);
javaModel.stopListening();
srcModel.stopListening();
xmlModel.stopListening();
tblModel.stopListening();
super.removeNotify();
}
COM: <s> remove all dom listeners before this view is removed </s>
|
funcom_train/31100165 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long readInt() throws IOException {
int i = inStream.readInt();
// Change byte order
int i1 = (i & 0xFF000000) >>> 24;
int i2 = (i & 0x00FF0000) >>> 8;
int i3 = (i & 0x0000FF00) << 8;
int i4 = (i & 0x000000FF) << 24;
return i1 + i2 + i3 + i4;
}
COM: <s> parses a four byte value out of the stream </s>
|
funcom_train/50178912 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean hasInfo() {
if (deletedOids.size() > 0) {
return true;
}
if (modifiedOids.size() > 0) {
return true;
}
if (listInvalidators.size() > 0) {
return true;
}
if (queryCacheInvalidatedTableNames.size() > 0) {
return true;
}
return false;
}
COM: <s> determine if there is anything in the cache info object </s>
|
funcom_train/23618108 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CPhrase copy(){
CPhrase cp;
Vector tempVect = new Vector();
cp = new CPhrase( this.title + " copy", this.startTime, this.instrument);
Enumeration enumr = this.phraseList.elements();
while(enumr.hasMoreElements()){
Phrase ph = ((Phrase) enumr.nextElement()).copy();
tempVect.addElement(ph);
}
cp.setPhraseList(tempVect);
cp.setAppend(this.append);
cp.setLinkedPhrase(this.linkedPhrase);
return (CPhrase)cp;
}
COM: <s> returns a copy of the cphrase </s>
|
funcom_train/45108563 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void selectLink(String linkName) throws Exception {
try{
selenium.click("link=" + linkName);
}catch(Exception e){
try{
selenium.selectWindow("testList");
}catch(Exception ex){
log.info("couldn't find a link "+linkName+" and the testList frame!!!");
throw ex;
}
try{
selenium.click("Expand All");
}catch(Exception ex2){
log.info("found frame testList, failed pressing the \"Expand All\" link.");
throw ex2;
}
}
selenium.waitForPageToLoad("2000");
}
COM: <s> this method open link by is link name </s>
|
funcom_train/46055950 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public OLATResourceableListeningWrapperController createMainLayoutResourceableListeningWrapperController(OLATResourceable res, UserRequest ureq, WindowControl wControl, VFSContainer rootContainer, boolean showMenu, boolean activateFirstPage, String initialUri) {
MainLayout3ColumnsController layoutCtr = createMainLayoutController(ureq, wControl, rootContainer, showMenu, activateFirstPage, initialUri, null);
return new OLATResourceableListeningWrapperController(wControl, res, layoutCtr, ureq.getIdentity());
}
COM: <s> creates a main layout controller that is wrapped with a resource listener </s>
|
funcom_train/36696075 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addEvent(DomainEvent event) {
if (eventListener.canHandle(event.getClass())) {
final Object policy = eventSequencingPolicy.getSequenceIdentifierFor(event);
if (policy == null) {
executorService.submit(new SingleEventHandlerInvocationTask(eventListener, event));
} else {
scheduleEvent(event, policy);
}
}
}
COM: <s> adds an event to the relevant scheduler </s>
|
funcom_train/42678515 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void saveToFile(File file, long level, long version) throws IOException {
long oldlevel = document.getLevel();
long oldversion = document.getVersion();
document.setLevelAndVersion(level, version);
FileWriter fw = new FileWriter(file);
fw.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
fw.write(document.toSBML());
fw.flush();
fw.close();
document.setLevelAndVersion(oldlevel, oldversion);
}
COM: <s> saves the current code sbmlnetwork code to a sbml file with given </s>
|
funcom_train/35164322 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeLibe(JOMaterial[] mtls, String filename) {
try {
PrintWriter mtlfile = new PrintWriter(new FileWriter(filename));
writeLibe(mtls, mtlfile);
mtlfile.close();
} catch (IOException e) {
System.out.println("JOMaterialLib.writeLibe(): IOException:" + e);
}
}
COM: <s> write an array of jomaterial objects to a </s>
|
funcom_train/37537306 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Collection getCategoriesForEntry(long id) {
HashSet list = new HashSet();
HashSet catlist = (HashSet)categoryMap.get(new Long(id));
if ( catlist == null )
return new HashSet();
for (Iterator i = catlist.iterator(); i.hasNext(); )
list.add(categories.get(i.next()));
return list;
}
COM: <s> return a collection of geekblog </s>
|
funcom_train/31689699 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public StatusData mkDir(String sDirname) {
VFSStatus retnStatus = new VFSStatus();
retnStatus.setMethodName(METHOD_MKDIR);
StatusData vfsStatus = this.m_vfs.createVirtualDirectory( this.getFullPath() + "/" + sDirname);
retnStatus.addStatusData(vfsStatus);
if(retnStatus.isOK()) {
this.refreshChildren();
this.fireVirtualFileEvent(VirtualFileEvent.FILE_MEMBERS_CHANGED);
}
return retnStatus;
}
COM: <s> creates a new directory with the current one </s>
|
funcom_train/12760725 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void add(String title, CellRange range) {
bringToFront();
if (!isVisible())
show();
TabPanel newTab = new TabPanel(model, range, this, tab);
tab.addTab(title, null, newTab, range.toString());
tab.setSelectedIndex(tab.getTabCount()-1);
newTab.getOptions(true); // first time
}
COM: <s> add a histogram to the tab panel </s>
|
funcom_train/37776275 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initTag() {
m_securityContextSet = false;
m_url = null;
m_dateTime = new DateTime();
m_guardedHtmlLocation = null;
m_guardedButtonPresent = false;
m_headerCache = new HashMap();
m_footerCache = new HashMap();
m_htmlName = null;
m_htmlIdPrefix = null;
m_oldForm = null;
}
COM: <s> reset any valued cached by the tag on construction or re use </s>
|
funcom_train/18497434 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void fullySort() {
/*
* go through the list and fully sort it. Should
* never be called during gameplay, just between levels and such
*/
Comparator<Actor> comp = null;
if (sorting == X_SORTING) {
comp = xComp;
} else {
comp = yComp;
}
Collections.sort(playerList, comp);
Collections.sort(enemyList, comp);
Collections.sort(neutralList, comp);
}
COM: <s> fully sort the list of objects </s>
|
funcom_train/39363882 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setTXYSampleRates(double[] sampleRates) {
if (_timeDomainSampleRate == null)
_timeDomainSampleRate = new double[3];
_timeDomainSampleRate[0] = sampleRates[0];
_timeDomainSampleRate[1] = sampleRates[1];
_timeDomainSampleRate[2] = sampleRates[2];
}
COM: <s> sets sample rates in time domain could actually be depth domain </s>
|
funcom_train/47109278 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Properties getSystemProperties() {
InputStream in = null;
Properties p = new Properties();
try {
ExternalContext ext = FacesContext.getCurrentInstance().getExternalContext();
URL resource = ext.getResource("/WEB-INF/classes/system.properties");
if (resource == null) {
logger.warn("No system.properties file found in classpath");
return p;
}
in = resource.openStream();
p.load(in);
return p;
} catch (Exception ex) {
logger.error("Failed to read system properties", ex);
return p;
} finally {
IOUtils.closeQuietly(in);
}
}
COM: <s> reads and returns the content of the global tt system </s>
|
funcom_train/3158899 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Class loadClass(String className) {
try {
return _classLoader.loadClass(className);
} catch (Throwable e) {
String message = "PlugInLoader: failed to load class " + className + ": " + e.getMessage();
_logger.fine(message);
Debug.trace(message);
}
return null;
}
COM: <s> loads the class for the given class name </s>
|
funcom_train/25658758 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testDBAccessFromWorkbatch() {
Workbatch workbatch = new WorkbatchHibernate(sf.getCurrentSession());
WorkItem wi = new WorkItem("");
workbatch.getWorkitems().add(wi);
Processor proc = new ProcessorDoDBStuff();
workbatch.getProcessors().add(proc);
BLoMoResult result = workbatch.execute();
assertTrue(result.getType().equals(BLoMoResultType.okay));
Session session = sf.getCurrentSession();
session.beginTransaction();
try {
session.delete(session.load(Person.class, pid));
session.getTransaction().commit();
assertTrue(true);
} catch ( HibernateException e ) {
session.getTransaction().rollback();
assertTrue(false);
}
}
COM: <s> can the database be accessed by the workbatch </s>
|
funcom_train/32720359 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void fireIncrementCounter(CounterEvent event) {
if (counterListeners != null) {
Vector listeners = counterListeners;
int count = listeners.size();
for (int i = 0; i < count; i++) {
((CounterListener) listeners.elementAt(i)).incrementCounter(event);
}
}
}
COM: <s> fires a counter incrementation event </s>
|
funcom_train/51193313 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isBinaryType( String contentType ) {
if (contentType != null) {
contentType = contentType.toLowerCase().trim();
MimeMapping tempMimeMapping = (MimeMapping) mimeMappings.get( contentType );
if ( tempMimeMapping != null ) {
if (!tempMimeMapping.dataHandler.equalsIgnoreCase( binary_base64.class.getName() ) ) {
return false;
}
}
}
return true;
}
COM: <s> used to determine if a given content type is of type binary </s>
|
funcom_train/33608382 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setWeight(V x, V y, E value) {
if (parent.adjacent(x, y)) {
weights.get(x).put(y, value);
if (!isDirected()) weights.get(y).put(x, value);
}
}
COM: <s> sets the value associated with specified edge provided the edge exists </s>
|
funcom_train/9810219 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean exceeds() {
for (int i = 0; i < dimensionNames.size(); i++) {
String name = (String) dimensionNames.elementAt(i);
try {
short eventLevel = getRatingLevel(name);
short receiverLevel = getReceiverRatingLevel(name);
if (receiverLevel == -1) {
;
} else if (receiverLevel < eventLevel) {
return true;
}
} catch (Exception e) {
;
}
}
return false;
}
COM: <s> compares the current rating value with the user specified </s>
|
funcom_train/51812353 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testReadByteArray() throws Exception {
ByteArrayResource resource = new ByteArrayResource( "Hello World".getBytes() );
String s = IOUtils.toString( resource.getInputStream() );
assertEquals("String not preserved", "Hello World", s);
}
COM: <s> tests that you can read from byte array </s>
|
funcom_train/2624662 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void pan(final PInputEvent event) {
final PCamera c = event.getCamera();
final Point2D l = event.getPosition();
if (c.getViewBounds().contains(l)) {
final PDimension d = event.getDelta();
c.translateView(d.getWidth(), d.getHeight());
}
}
COM: <s> pans the camera in response to the pan event provided </s>
|
funcom_train/37649999 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setPriorityFilterListFromString(String newList, String splitter) {
if (newList != null) {
final String[] newArray = newList.split(splitter);
final List<Integer> priorities = new ArrayList<Integer>(newArray.length);
for (String element : newArray) {
priorities.add(Integer.valueOf(element)); // NOPMD by Sven on 13.11.06 11:53
}
priorityList = priorities;
}
}
COM: <s> loads a priority list out of a string e </s>
|
funcom_train/3170864 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isSwitchedOnBy(RegionDelta delta) {
return !(match(delta.before())) && (match(delta.after()));
/*
udanax-top.st:66208:Filter methodsFor: 'filtering'!
{BooleanVar} isSwitchedOnBy: delta {RegionDelta}
"Whether the change switches the state of the filter from off to on. (I.E. Whether the old region was outside the filter and the new region inside.)"
^(self match: delta before) not and: [self match: delta after]!
*/
}
COM: <s> whether the change switches the state of the filter from off to on </s>
|
funcom_train/18052025 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Element addJdxFolder(IFolder folder) {
Element out = null;
String path = folder.toString();
StringTokenizer tok = new StringTokenizer(path, File.separator);
Element node = getJdxFolderNode();
while (tok.hasMoreElements()) {
String token = tok.nextToken();
if (!tok.hasMoreElements()){
out = addFolder(node, token);
}
else{
Element child = getChildFolder(node, token);
if (child == null){
//if this folder does not exist -> create it
node = addFolder(node, token);
}
}
}
return out;
}
COM: <s> adds the jdx folder </s>
|
funcom_train/43363479 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private CharSequence convertChunk(StringBuilder toConvert) {
CharSequence kana;
for (int i = 4; i > 0; i--) {
if (toConvert.length() >= i) {
kana = convertChunk(toConvert.subSequence(0, i));
if (kana != null) {
toConvert.delete(0, i);
return kana;
}
}
}
return null;
}
COM: <s> converts as much of to convert romaji into converted hiragana as </s>
|
funcom_train/49409113 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testRemoveStatement() {
System.out.println("removeStatement");
StatementType statement = new Statement();
Descriptor instance = new Descriptor();
instance.addStatement(statement);
StatementType result = instance.removeStatement(statement);
assertTrue(result == statement);
assertTrue(instance.getStatements().size() == 0);
}
COM: <s> test of remove statement method of class info </s>
|
funcom_train/1676630 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public K append(V value) {
boolean doAutoCommit = beginAutoCommit();
try {
Object[] key = new Object[1];
view.append(value, key, null);
commitAutoCommit(doAutoCommit);
return (K) key[0];
} catch (Exception e) {
throw handleException(e, doAutoCommit);
}
}
COM: <s> appends a given value returning the newly assigned key </s>
|
funcom_train/14597468 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean addForeLink(BaseNode dtn, boolean mirror) {
int oldCount = foreLinks.length();
foreLinks = foreLinks.baseNodeUnion(dtn);
if (mirror) {
dtn.addBackLink(this, false);
}
return oldCount != foreLinks.length();
}
COM: <s> adds a forelink to this node </s>
|
funcom_train/14014402 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void execute(FacesContext context) throws FacesException {
logger.debug("Executing view post back lifecycle");
for (int p = PhaseId.APPLY_REQUEST_VALUES.getOrdinal(); p <= PhaseId.INVOKE_APPLICATION.getOrdinal(); p++) {
PhaseId phaseId = (PhaseId) PhaseId.VALUES.get(p);
if (!skipPhase(context, phaseId)) {
invokePhase(context, phaseId);
}
}
}
COM: <s> executes apply request values through invoke application </s>
|
funcom_train/495119 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Shape3D generateCigarBand(Appearance cigarBandAppearance, float xPosition) {
// Establish the radius.
float outerRadius = Constants.YT + 0.02f; // Outside will reach beyond the outer surface of all solids.
float innerRadius = Constants.YB - 0.02f; // Inside will be just lower than the inner surface of all solids.
return generateCigarBand(cigarBandAppearance, xPosition, innerRadius, outerRadius);
}
COM: <s> create a single cigar band annular ring whose x position is that given </s>
|
funcom_train/36909328 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setId(String id) throws CrosswordException{
//Checking wheter the id is in the right format
//TODO: Note that thi id actually accepts 0 as a valid id
if (!Pattern.matches("\\d{1,2}_\\d{1,2}_[ad]", id))
throw new CrosswordException("Invalid id for entriy. The id was: " + id);
else{
_id = id;
}
}
COM: <s> set the id of an entry </s>
|
funcom_train/27754899 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void chooseFileType(String filename){
int count = getDocument().getLength();
if (count > 300) count = 300;
try{
String fline = getText(0, count-1);
baseEditor.chooseFileType(filename);
}catch(BadLocationException e){};
};
COM: <s> selects and installs coloring style filetype according </s>
|
funcom_train/30245596 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addDaemons(Daemon[] daemons) {
if(_daemons==null) {
setDaemons(daemons);
}
else {
Daemon[] nd = new Daemon[_daemons.length+daemons.length];
System.arraycopy(_daemons, 0, nd, 0, _daemons.length);
System.arraycopy(daemons, 0, nd, _daemons.length, daemons.length);
setDaemons(nd);
}
}
COM: <s> adds some daemons to this brain </s>
|
funcom_train/42307834 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int queued_msgs (InetSocketAddress peer) {
Connection conn = (Connection) conns.get (peer);
if (conn == null)
return 0;
else
return conn.retry_q.size () + conn.send_q.size () +
conn.probe_q.size () + conn.inf.size ();
}
COM: <s> returns the number of messages waiting to be sent or currently in </s>
|
funcom_train/3935910 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void enableInspectorPopup(boolean inIsEnabled) {
if (inIsEnabled) {
if (popupState == PopupState.ENABLED_BOTH) return;
}
else {
if (popupState == PopupState.DISABLED) return;
}
popupState = inIsEnabled ? PopupState.ENABLED_BOTH : PopupState.DISABLED;
fireSourceChanged(ISources.WORKBENCH, STATE_INSPECTOR_POPUP, popupState.value);
}
COM: <s> sets the inspector save contributions enable state </s>
|
funcom_train/4561 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void outputResultToFile(){
try{
PrintStream output = new PrintStream(new File("Results-" + testID + ".txt"));
output.println("[" + getTime() + "]: Results:\n");
output.println(getReportString());
output.close();
}catch(IOException e){
System.out.println("Result File Creation Error");
}
}
COM: <s> outputs results of the running the performance test to a text file </s>
|
funcom_train/3411421 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean postProcessKeyEvent(KeyEvent e) {
if (!e.isConsumed()) {
Component target = e.getComponent();
Container p = (Container)
(target instanceof Container ? target : target.getParent());
if (p != null) {
p.postProcessKeyEvent(e);
}
}
return true;
}
COM: <s> this method will be called by code dispatch key event code </s>
|
funcom_train/25637132 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Content getPackageTreeHeader() {
String title = packagedoc.name() + " " +
configuration.getText("doclet.Window_Class_Hierarchy");
Content bodyTree = getBody(true, getWindowTitle(title));
addTop(bodyTree);
addNavLinks(true, bodyTree);
return bodyTree;
}
COM: <s> get the package tree header </s>
|
funcom_train/40359377 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testEquals() {
MockRepositoryDateTime d1 = new MockRepositoryDateTime(10);
MockRepositoryDateTime d2 = new MockRepositoryDateTime(10);
Assert.assertEquals(d1, d2);
Assert.assertFalse(d1 == d2);
Assert.assertEquals(d1.hashCode(), d2.hashCode());
}
COM: <s> tests equals and hash code </s>
|
funcom_train/4124290 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Element highScores(Connection connection, Element element) {
ServerPlayer player = getFreeColServer().getPlayer(connection);
Element reply = Message.createNewRootElement("highScoresReport");
for (HighScore score : getFreeColServer().getHighScores()) {
reply.appendChild(score.toXMLElement(player, reply.getOwnerDocument()));
}
return reply;
}
COM: <s> handles a high scores message </s>
|
funcom_train/25505807 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JRadioButton getDefaultLButton() {
if (defaultLButton == null) {
defaultLButton = new JRadioButton();
defaultLButton.setText(LocalizationData.get("PreferencesDialog.Localization.defaultLanguage")); //$NON-NLS-1$
defaultLButton.setToolTipText(LocalizationData.get("PreferencesDialog.Localization.defaultLanguage.toolTip")); //$NON-NLS-1$
defaultLButton.addItemListener(basicItemListener);
}
return defaultLButton;
}
COM: <s> this method initializes default lbutton </s>
|
funcom_train/45230024 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JSONArray getOutputArgumentsArray() {
JSONArray outputArgumentsArray = null;
JSONObject functionObject = getFunctionObject();
if (functionObject != null) {
JSONValue outputArgumentsValue = functionObject.get("output_arguments");
if (outputArgumentsValue != null) {
outputArgumentsArray = outputArgumentsValue.isArray();
}
}
return outputArgumentsArray;
}
COM: <s> gets the output arguments array attribute of the response parser object </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.