__key__ stringlengths 16 21 | __url__ stringclasses 1 value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/39314600 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testFormMouseClicked() {
System.out.println("testFormMouseClicked");
JPanel p=new JPanel();
MouseEvent myEvent = new MouseEvent( p, MouseEvent.MOUSE_CLICKED,0, 0, 10, 10, 1,false, MouseEvent.BUTTON1);
//Frame f=new Frame("hello");
splash s=new splash(f,true);
s.formMouseClicked(myEvent);
assertEquals(s.isVisible(),false);
//f.dispose();
s.dispose();
}
COM: <s> test of form mouse clicked method of class splash </s>
|
funcom_train/36012398 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void partActivated(IWorkbenchPart part) {
if (part instanceof ReviewEditorView) {
log.debug("part is activate.");
int type = ReviewEvent.TYPE_ACTIVATE;
int kind = ReviewEvent.KIND_EDITOR;
ReviewPlugin.getInstance().notifyListeners(type, kind);
}
}
COM: <s> notifies this listener that the given part has been activated </s>
|
funcom_train/12553865 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void setupTextArea(String text) {
this.textArea = new JTextArea(text, 25, 80);
JPanel panel = new JPanel();
panel.add(this.textArea);
JButton loadFile = new JButton("Load File");
panel.add(loadFile);
this.scrollPane = new TextJScrollPane(panel, this.textArea, loadFile);
}
COM: <s> set up the text area component with a default text value </s>
|
funcom_train/4515984 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initComponents() {
setBorder(BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
GroupLayout layout = new GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(layout.createParallelGroup(
GroupLayout.Alignment.LEADING).addGap(0, 398, Short.MAX_VALUE));
layout.setVerticalGroup(layout.createParallelGroup(
GroupLayout.Alignment.LEADING).addGap(0, 298, Short.MAX_VALUE));
}
COM: <s> this method is called from within the constructor to initialize the form </s>
|
funcom_train/4534640 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void rejectIncomingCall() {
// Close toaster if it's up.
if (toasterManager != null) {
toasterManager.close();
}
if (session != null) {
try {
session.terminate();
session = null;
}
catch (XMPPException e) {
Log.error(e);
}
}
if (ringing != null) {
ringing.stop();
}
}
COM: <s> called if an incoming jingle session is rejected </s>
|
funcom_train/45277685 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void bind(MainPanel frame, ViewModel viewModel) {
System.out.println("Binding..");
for(int i = 0; i < controllers.size(); i++){
System.out.print(i);
controllers.get(i).bind(frame, viewModel);
}
System.out.println("Done binding");
}
COM: <s> binds the controllers and panels together </s>
|
funcom_train/1060137 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addRadiusYPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Ellipse_radiusY_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Ellipse_radiusY_feature", "_UI_Ellipse_type"),
Di2Package.Literals.ELLIPSE__RADIUS_Y,
true,
false,
false,
ItemPropertyDescriptor.REAL_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the radius y feature </s>
|
funcom_train/24039425 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getNewestVersion() throws NumberFormatException, XPathExpressionException, MalformedURLException, SAXException, IOException, ParserConfigurationException{
short[] sVers = getNewestVersionShort();
return new String(sVers[0]+"."+sVers[1]+"."+sVers[2]);
}
COM: <s> get the latest version from the web </s>
|
funcom_train/45018381 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addExperimentIdentifierPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_NXentry_experimentIdentifier_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_NXentry_experimentIdentifier_feature", "_UI_NXentry_type"),
NexusPackageImpl.Literals.NXENTRY__EXPERIMENT_IDENTIFIER,
true,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the experiment identifier feature </s>
|
funcom_train/12556766 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Vector listRoots() {
Vector roots = new Vector();
String s = getMountedRoots();
if (s != null) {
String[] rs = com.sun.kvem.midp.pim.formats.FormatSupport
.split(s, '\n', 0);
for (int i = 0; i < rs.length; i++) {
roots.addElement(rs[i]);
}
}
return roots;
}
COM: <s> list filesystem roots available on the device </s>
|
funcom_train/3561128 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void commitClose() throws DbException {
Iterator it = databaseNameMap.keySet().iterator();
DbException te = null;
while (it.hasNext()) {
try {
DbDatabase db = (DbDatabase) it.next();
DbConnection con = db.getExistingThreadConnection();
if (con != null) {
con.commitClose();
}
} catch (DbException e) {
te = e;
}
}
if (te != null) {
throw te;
}
}
COM: <s> commit and close all connections associated with this database </s>
|
funcom_train/9663810 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TreeGridRow getGridRow(int parentIndex, int rowIndex) {
if (getModel() instanceof Composite) {
TreeGridRow parent = (TreeGridRow) getGridRow(parentIndex);
if (parent != null && getGridRows(parentIndex).length > rowIndex)
return ((Composite) getModel()).getRow(parent, rowIndex);
}
return null;
}
COM: <s> gets a tree grid row by parent and child row indexes </s>
|
funcom_train/16423085 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void explore(String path) throws Exception {
if (commandPrefix==null) throw new RuntimeException("can't find a good command; no "+nautilusPath+" and no "+konquerorPath);
if (!path.startsWith(File.separator)) path=File.separator+path;
Runtime r= Runtime.getRuntime();
Process p=null;
p=r.exec(commandPrefix+path);
p.waitFor();
}
COM: <s> launch the linux command to explore a directory </s>
|
funcom_train/17930271 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addPanelComponents () {
rubriquesCombo = new JComboBox(rubriquesTCM);
rubriquesCombo.setRenderer(new KeyNameComboRenderer());
rubriquesDP.addDataProviderListener(this);
add(SwingUtilities.createLabelComponentPanel(
"Rubriques:", rubriquesCombo));
quantiteField = new JFormattedTextField(
SwingUtilities.createFormatter("0123456789 ", 3));
quantiteField.setColumns(3);
add(SwingUtilities.createLabelComponentPanel(
"Quanit\u00E9:", quantiteField));
}
COM: <s> creates information panel </s>
|
funcom_train/49670692 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean loadJarLibrary(final String jarLib) {
final String tempLib = System.getProperty("java.io.tmpdir")
+ File.separator + jarLib;
boolean copied = IOUtils.copyFile(jarLib, tempLib);
if (!copied) {
return false;
}
System.load(tempLib);
return true;
}
COM: <s> loads native library located inside some jar in classpath </s>
|
funcom_train/45465810 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean removeElementDecl(ElementDecl elementDecl) {
if (elementDecl == null)
return false;
int position = _contentModel.indexOf(elementDecl);
if (position >= 0) {
_contentModel.removeElementAt(position);
if (!elementDecl.isReference()) {
String key = "element:"+elementDecl.getName();
_resolver.removeResolvable(key);
}
return true;
}
return false;
}
COM: <s> removes the given element decl from this content model group </s>
|
funcom_train/6406416 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public V remove(K key) {
expunge();
int hash = hash(key);
int index = index(hash, entries.length);
Entry<K,V> temp = entries[index];
Entry<K,V> previous = temp;
while (temp != null) {
Entry<K,V> next = temp.nextEntry;
if (hash == temp.hash && key == temp.get()) {
size--;
if (previous == temp)
entries[index] = next;
else
previous.nextEntry = next;
return temp.value;
}
previous = temp;
temp = next;
}
return null;
}
COM: <s> removes the value for this key </s>
|
funcom_train/49262475 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void traverse(final TreeItem item, final TraverseEvent event) {
boolean forward = (event.detail & SWT.TRAVERSE_TAB_NEXT) != 0;
boolean backward = (event.detail & SWT.TRAVERSE_TAB_PREVIOUS) != 0;
if (forward || backward) {
TreeItem next = getNextEditableItem(item, forward);
displayEditor(next);
event.doit = false;
}
}
COM: <s> processes the traverse event </s>
|
funcom_train/31936100 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getHourOfDay() {
String hourText= m_hour.getText();
if (hourText == null || hourText.length() <= 0)
return 12;
int hours= Integer.parseInt(hourText);
if (12 <= hours)
hours= 0;
if (m_ampm.getText().equals(PM))
hours+= 12;
return hours;
}
COM: <s> returns an hour value in the range 0 23 </s>
|
funcom_train/18964186 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("[ ");
for (int i = 0; i < getIdCount(); i++) {
sb.append(getIdentifier(i) + " ");
}
sb.append("]");
return new String(sb);
}
COM: <s> returns a string representation of this id group in the form of </s>
|
funcom_train/42773530 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void paintChildren(Graphics graphics) {
IFigure child;
Rectangle clip = Rectangle.SINGLETON;
for (Iterator<IFigure> i = children.iterator(); i.hasNext();) {
child = i.next();
if (child.isVisible() && child.intersects(graphics.getClip(clip))) {
graphics.clipRect(child.getBounds());
child.paint(graphics);
graphics.restoreState();
}
}
}
COM: <s> paints this figures children </s>
|
funcom_train/18849723 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void removeReqData() {
if (nodeRef != null) {
if (nodeRef.qtyReqs == 1 && reqQty == 1) {
nodeRef.usedClockFactor = 0;
nodeRef.usedMemFactor = 0;
nodeRef.qtyReqs = 0;
} else {
nodeRef.usedClockFactor -= reqClock;
nodeRef.usedMemFactor -= reqMem;
nodeRef.qtyReqs -= reqQty;
}
}
req = null;
nodeRef = null;
}
COM: <s> removes data about the requisition from the node reference </s>
|
funcom_train/45209742 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getSetButton() {
if (setButton == null) {
setButton = new JButton();
setButton.setName("setButton");
setButton.setText("Set");
setButton.setToolTipText("Set stone at current cursor position");
setButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals (setButton.getText())) {
grid.setStone();
}
}
});
}
return setButton;
}
COM: <s> return the set button property value </s>
|
funcom_train/49465833 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private R_A_C_I convertR_A_C_I(String _unit) throws IllegalArgumentException {
try {
return R_A_C_I.valueOf(_unit);
} catch (Exception e) {
IllegalArgumentException eOut = new IllegalArgumentException("Error in a rule ("+_unit+") is not a valid R A C I");
_logger.fatal(eOut);
throw eOut;
}
}
COM: <s> wrapper for r a c i </s>
|
funcom_train/50171036 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void clearForm() {
CannedQuery[] queries = cannedQueryFeature.getQueries();
int currentStartQueryFieldIndex = 0;
int currentStartMetaQueryFieldIndex = 0;
for ( int i = 0; i < queries.length; i++) {
clearQuery(queries[i],
currentStartQueryFieldIndex,
currentStartMetaQueryFieldIndex);
currentStartQueryFieldIndex
+= getNumberOfQueryFields(queries[i]);
currentStartMetaQueryFieldIndex
+= getNumberOfMetaQueryFields(queries[i]);
} // end for ()
}
COM: <s> clearing the form </s>
|
funcom_train/15723780 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: /*
* private void defineMyJarName() { String jarName = DEFAULT_JAR_NAME; File
* currentDir = new File(System.getProperty("user.dir")); for (File
* file:currentDir.listFiles()) { if (isMainJarFile(file)) { jarName =
* file.getAbsolutePath(); } } Tools.getTools().setMainJarName(jarName); }
COM: <s> tries to find in current directory programs jar file </s>
|
funcom_train/23011817 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setTool(byte tool) {
currentTool = tool;
setCursor(tool);
broadcastMessage(TPM_SET_TOOL, new Byte(tool));
/*
* if ((currentTool != TOOL_PAN) && (backImage != null)) {
* backImage.flush(); backImage=null; }
*/
}
COM: <s> sets active map tool to code tool code </s>
|
funcom_train/18504170 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean queryAhead(DataSetEvent e) {
// If there is no edit operation, we don't do anything
if (!isEditing()) {
return true;
}
// Otherwise we cancel the current editing operation
TableCellEditor ce = getCellEditor();
ce.cancelCellEditing();
return true;
}
COM: <s> when the dataset is going to query new rows from the database </s>
|
funcom_train/22442947 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void playFile(String inFilePath) {
if (getMediaPlayer()!=null){
stopFile();
getMediaPlayer().deallocate();
getJPanelPlaylist().remove(getMediaPlayer());
setMediaPlayer(null);
}
getJPanelPlaylist().add(getMediaPlayer(inFilePath), java.awt.BorderLayout.CENTER);
invalidate();
validate();
repaint();
getMediaPlayer().play();
}
COM: <s> play file at in file path </s>
|
funcom_train/45623229 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addCopyrightPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ALType_copyright_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ALType_copyright_feature", "_UI_ALType_type"),
MSBPackage.eINSTANCE.getALType_Copyright(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the copyright feature </s>
|
funcom_train/36012545 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createItemEntriesTabContent(TabFolder folder) {
TabItem itemEntriesTabItem = new TabItem(folder, SWT.NONE);
String itemEntriesLabel = ReviewI18n.getString("ReviewIdEditDialog.label.tab.itemEntries");
itemEntriesTabItem.setText(itemEntriesLabel);
itemEntriesTabItem.setControl(createItemEntriesFolder(folder));
}
COM: <s> creates the item entries tab content in the code tab folder code </s>
|
funcom_train/44844629 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int hashCode() {
int hashCode = 0;
if (_subject != null) {
hashCode |= _subject.hashCode() & 0xFF0000;
}
if (_predicate != null) {
hashCode |= _predicate.hashCode() & 0x00FF00;
}
if (_object != null) {
hashCode |= _object.hashCode() & 0x0000FF;
}
return hashCode;
}
COM: <s> returns hashcode of bmstatement </s>
|
funcom_train/49676723 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean upgradeFactory(WarriorProfile profile) {
if (this.factory.containsKey(profile)) {
// Old level
Level level = this.factory.get(profile);
this.factory.remove(profile);
// New level
Level nextLevel = level.getNextLevel();
this.factory.put(profile, nextLevel == null ? level : nextLevel);
return true;
}
return false;
}
COM: <s> upgrade level of an existing factory </s>
|
funcom_train/23385319 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getAsInteger() throws IllegalArgumentException {
if (type != TYPE_INT) {
throw new IllegalArgumentException("Setting-type incompatible with integer: " + name);
}
try {
return new Integer(value).intValue();
} catch (NumberFormatException e) {
throw new IllegalArgumentException("Cannot parse string as integer: " + name + ", value: " + value);
}
}
COM: <s> gets the value as integer </s>
|
funcom_train/85485 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void C011() throws T_Fail, StandardException {
Transaction t = t_util.t_startTransaction();
long cid = t_util.t_addContainer(t, 0);
t_util.t_commit(t);
ContainerHandle c1, c2;
c1 = t_util.t_openContainer(t, 0, cid, false);
c1 = t_util.t_openContainer(t, 0, cid, true);
t_util.t_dropContainer(t, 0, cid); // cleanup
t_util.t_commit(t);
t.close();
PASS("C011");
}
COM: <s> c011 create a container withina transaction commit and the re open </s>
|
funcom_train/51721420 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void hide_port(I_Port port) {
if (port.getSkin() == null) {
return;
}
if (java.util.Arrays.asList(jPanel2.getComponents()).indexOf(port.getSkin()) > 0) {
port.getSkin().setVisible(false);
jPanel2.remove(port.getSkin());
}
port.setSkin(null);
}
COM: <s> manage the port edting panel </s>
|
funcom_train/37206633 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeLinkedDataset(String datasetName) {
linkedDatasets.remove(datasetName);
if (query.containsDataset(datasetName)) {
Dataset dataset = query.getDataset(datasetName);
dataset.removeAllAttributes();
dataset.removeAllFilters();
query.removeDataset(dataset);
for (Link link : query.getLinks(datasetName)) {
removeLinkedDataset(link.getTarget());
}
}
if (query.containsLink(datasetName)) {
query.removeLink(query.getLink(datasetName));
}
}
COM: <s> removes a dataset and any datasets linked to it </s>
|
funcom_train/34262305 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void handleApplyButton() {
if (getPreferencesController().shouldContinue()) {
this.getFileExtensionPanelBuilder().setDirty(false);
this.editComplete();
FilePreference lFilePreferenceClone = (FilePreference)this.getCurrentFilePreference().clone();
this.setCurrentFilePreference(lFilePreferenceClone);
this.editComplete();
}
}
COM: <s> overridden method that is called when apply button pressed </s>
|
funcom_train/2844729 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean handlesAnnotation(Annotation a) {
if (handles != null) {
for (Iterator i = handles.iterator(); i.hasNext();) {
if (AnnotationTypes.match((String) i.next(), a.getType()))
return true;
}
return false;
}
//System.err.println("AnnotationScheme.handlesAnnotation(): shouldn't use default");
return true;
}
COM: <s> returns true if this annotationscheme is supposed to edit this annotation </s>
|
funcom_train/23245617 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void menuSelected(final MenuEvent arg0) {
if (getSubElements().length > 0) {
return;
}
synchronized (this) {
if (loadSubMenus == null) {
loadSubMenus = new SubMenuLoader(false);
Future<?> submited = SUBMENULOADEREXECUTOR.submit(loadSubMenus);
this.loadSubMenusFuture = submited;
add(isLoadingMenuItem);
}
}
}
COM: <s> populate the sub menus if needed </s>
|
funcom_train/49608753 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deleteRecommenders(String username,EntityManager em,List<Recommender> vos) throws Throwable {
try {
for(Recommender vo: vos) {
vo.setDeleted(Consts.FLAG_Y);
JPAMethods.merge(em, username, DefaultFieldsCallabacks.getInstance(), vo);
}
}
catch (Throwable ex) {
Logger.error(null, ex.getMessage(), ex);
throw ex;
}
}
COM: <s> delete logically a recommender </s>
|
funcom_train/3363059 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addImpl(Component comp, Object constraints, int index) {
super.addImpl(comp, constraints, index);
/// We are making sure the glassPane is on top.
if(glassPane != null
&& glassPane.getParent() == this
&& getComponent(0) != glassPane) {
add(glassPane, 0);
}
}
COM: <s> overridden to enforce the position of the glass component as </s>
|
funcom_train/46123550 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addUserToResponse(List<User> userDomainList, UserGetRequest request, UserGetResponse response) {
for(User user : userDomainList){
response.getUser().add(this.getUserWsModelFromUserDomain(user, request));
}
// We set the response-status' code to the response object
this.setResponseStatusIntoResponse(WsResponseCode.SUCCESS, null, response);
}
COM: <s> add a unique user into response object </s>
|
funcom_train/4866486 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initializeSystemTimer() throws Exception {
/* Frames per second */
float fps = cvars.getFloatValue("e_frequency");
if ( fps <= 0 ) {
fps = FRAMES_PER_SECOND;
}
this.dt.setTime(1.0f / fps); // freq~
this.fixedTimeStep = cvars.getCvar("e_fixedTimestep");
this.timer = createTimer();
this.notFixedTimeStep = new TimeStep(this.timer);
this.timeStep = new TimeStep(this.timer);
}
COM: <s> initializes the system timer </s>
|
funcom_train/31689101 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void fireContextEvent(ContextEvent ce) {
ContextType contextType = ce.CONTEXT_TYPE;
if(ce!=null && this.m_contexts.keySet().contains(contextType)) {
((Context)this.m_contexts.get(contextType)).fireContextEvent(ce);
((Context)this.m_contexts.get(contextType)).setLastEvent(ce);
}
if(contextType == ContextType.CONTEXT_SHUTDOWN ) {
System.exit(0);
}
}
COM: <s> fires a context event to the relevant context listeners </s>
|
funcom_train/18887555 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void dumpContext() {
for (int i = 0; i < context.length; i++) {
System.out.println("context[" + i + "] ==>" + context[i]);
}
try {
System.out.println(
"element name -->" + toRawString(getCurrentIndex()));
} catch (NavException e) {
System.out.println("toString exception condition occurred " + e);
}
}
COM: <s> this method print out the current state info of the navigation object </s>
|
funcom_train/42262335 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void stop() {
AVector2d initVel = new AVector2d(robot.getVelocity());
Point2d a = new Point2d(); // acceleration of the robot using standard axis
a.x = -initVel.x;
a.y = -initVel.y;
a = normalise(a, Robot.MAX_ACCELERATION);
robot.proposeNewVelocity(initVel.x + a.x*dt, initVel.y + a.y*dt);
}
COM: <s> stop movement of robot </s>
|
funcom_train/11765900 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void createPartControl(Composite parent) {
viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
viewer.setContentProvider(new ViewContentProvider());
viewer.setLabelProvider(new ViewLabelProvider());
viewer.setSorter(new NameSorter());
viewer.setInput(getViewSite());
// Create the help context id for the viewer's control
PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), TextConstants.HELP_ID);
}
COM: <s> this is a callback that will allow us </s>
|
funcom_train/37446999 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void checkForLocaleChange() {
final Cookie cookie = getCookie(COOKIE_LOCALE);
if (cookie != null) {
final Locale localeFromCookie = CLocale.valueOf(cookie.getValue());
if (!getLocale().equals(localeFromCookie)) {
setLocale(localeFromCookie);
}
}
}
COM: <s> this method checks for a change in locale made by another web </s>
|
funcom_train/13596359 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void replaceWordData(WordData newWordData) {
WordData oldWordData = getWord(newWordData.getWord());
int index = this.wordDataList.indexOf(oldWordData);
this.wordDataList.remove(index);
this.wordDataList.add(index, newWordData);
removeWordFromStatusMap(oldWordData, new Integer(oldWordData
.getStatus()));
addToWordStatusMap(newWordData, new Integer(newWordData.getStatus()));
}
COM: <s> replace a word data in the dictionary </s>
|
funcom_train/6253843 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void parseSource() throws ConfigurationException, IOException {
while (true) {
int t = st.nextToken();
if (t == StreamTokenizer.TT_EOF) {
break;
}
st.pushBack();
String val = token(
"keyword 'import', 'static' or 'private', or component");
if ("import".equals(val)) {
parseImport();
} else {
parseComponent(val);
}
}
}
COM: <s> parses imports and components from the source and stores the </s>
|
funcom_train/34314416 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void reset() {
final double max = 0.5;
final double min = -0.5;
final int inputsCount = inputDim + 1;
errorValue = 0;
neuronInput = 0;
neuronOutput = 0;
Arrays.fill(deltaValues, 0);
for (int i = 0; i < inputsCount; i++) {
inputWeights[i] = random.nextDouble() * (max - min) + min;
}
}
COM: <s> performs reset re initialization of the </s>
|
funcom_train/44489798 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setNamedPositions() {
coords=new String[tot];
int count=0;
while ( count<tot ) {
for ( int j=0; j<v; j++ )
for ( int i=0; i<h; i++ ) {
coords[count] = getColName ( i ) + "-" + getRowName ( j );
count++;
}
}
}
COM: <s> set names of the plate positions </s>
|
funcom_train/34083329 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addItem(String routeColumn,String destinationColumn, String destinationColumnSecondRow, String minutesColumn) {
HashMap<String,String> item = new HashMap<String,String>();
item.put( "routeColumn", routeColumn );
item.put( "destinationColumnFirstRow", destinationColumn );
item.put( "destinationColumnSecondRow", destinationColumnSecondRow);
item.put( "minutesColumn", minutesColumn );
mList.add( item );
}
COM: <s> this method is used to insert a row to the routes info list </s>
|
funcom_train/10290781 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void getInstances(Topic cls, VariableSet ret) throws TologProcessingException {
IndexUtils.updateIndex(m_tti);
Iterator it = m_tti.getTopicsByType(cls).iterator();
while (it.hasNext()) {
addResultsRow(ret, new Object[] {it.next(), cls});
}
}
COM: <s> adds a row to the results set code ret code </s>
|
funcom_train/11725067 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testAccessMovedReferenceableByUUID() throws RepositoryException, NotExecutableException {
String uuid = moveNode.getUUID();
//move the node
doMove(moveNode.getPath(), destinationPath);
Node n = superuser.getNodeByUUID(uuid);
assertTrue("After successful moving a referenceable node node, accessing the node by uuid must return the same node.", n.isSame(moveNode));
}
COM: <s> test if a moved referenceable node returns the same item than the moved </s>
|
funcom_train/25205362 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PlWriter addCharMetric(double val, String name) {
if (val != 0) {
plopen(name).addReal(val).plclose();
} else {
if (printZeroWidth && "CHARWD".equals(name)) {
plopen(name).addReal(0.0d).plclose();
}
}
return this;
}
COM: <s> add a char metric </s>
|
funcom_train/34008270 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void cancelPurchase(Long idPurchase) throws CommonException{
try {
this.getConfig().startTransaction();
this.getConfig().update("purchases.cancelPurchaseById", idPurchase);
this.getConfig().commitTransaction();
} catch (SQLException e) {
throw new CommonException(e);
} finally {
try {
this.getConfig().endTransaction();
} catch (SQLException e) {
e.printStackTrace();
throw new CommonException(e);
}
}
}
COM: <s> cancel a specific purchase </s>
|
funcom_train/14009150 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object set(Object array, int index, Object value) {
if (!this.isArray(array)) {
return null;
}
try {
Array.set(array, index, value);
return "";
} catch (IndexOutOfBoundsException e) {
// The index was wrong.
return null;
}
}
COM: <s> sets the specified element of an array </s>
|
funcom_train/12804268 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected BaseDomain baseFind(Serializable anId) throws DataAccessException {
if (anId == null) {
return null;
}
List results = baseFind(new Condition(ID, Condition.EQ, anId));
if (results.size() == 0) {
return null;
}
else {
return (BaseDomain) results.get(0);
}
}
COM: <s> read the domain object of the given id </s>
|
funcom_train/10628307 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testBitLengthNegative2() {
byte aBytes[] = {-128, 56, 100, -2, -76, 89, 45, 91, 3, -15, 35, 26};
int aSign = -1;
BigInteger aNumber = new BigInteger(aSign, aBytes);
assertEquals(96, aNumber.bitLength());
}
COM: <s> bit length of a negative number with the leftmost bit set </s>
|
funcom_train/32959825 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected NodeList findSections(Document insertTrim) {
NodeList sectionList;
try {
sectionList = (NodeList) xpath.evaluate("trim/act/relationship[@typeCode='COMP']/act/relationship[@typeCode='COMP']/act", insertTrim, XPathConstants.NODESET );
return sectionList;
} catch (Exception e) {
throw new RuntimeException( "Exception parsing Input Section", e);
}
}
COM: <s> look for each section in the document </s>
|
funcom_train/41165530 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void save(CoSingleText2 entity) {
EntityManagerHelper.log("saving CoSingleText2 instance", Level.INFO, null);
try {
getEntityManager().persist(entity);
EntityManagerHelper.log("save successful", Level.INFO, null);
} catch (RuntimeException re) {
EntityManagerHelper.log("save failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> perform an initial save of a previously unsaved co single text2 entity </s>
|
funcom_train/21917037 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ParsedPropertyCallExp getLastAppliedProperty(){
ParsedPropertyCallExp last = this.getAppliedProperty() ;
ParsedPropertyCallExp tmpPlusOne = this.getAppliedProperty() ;
while( tmpPlusOne != null ){
last = tmpPlusOne;
tmpPlusOne = last.getAppliedProperty();
}
return last;
}
COM: <s> get the last applied property at the end of the expression </s>
|
funcom_train/49790123 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testCreateAddRole1Logout() throws Exception {
// create a new user
IFile sitemap = createAddRole1();
gotoSitemapThenPage(sitemap, "logout", "Logout Successful");
assertNoProblem();
// we can't get back to role 1 page
gotoSitemapWithProblem(sitemap, "requires role 1");
assertProblem();
// so we login
doStandardLoginAsIgnore(sitemap, NEW_EMAIL, NEW_PASSWORD);
assertNoProblem();
gotoSitemapThenPage(sitemap, "requires role 1");
assertNoProblem();
}
COM: <s> once we have role 1 we can log out log </s>
|
funcom_train/17395751 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected int getMaxWriteSize() {
int bufReadPosCopy = bufReadPos, bufWritePosCopy = bufWritePos, bufMarkedPosCopy = bufMarkedPos;
int maxWritePos;
if (bufMarkedPosCopy != -1)
maxWritePos = bufMarkedPosCopy;
else
maxWritePos = bufReadPosCopy;
if (maxWritePos == 0)
maxWritePos = buf.length - 1;
else
maxWritePos--;
return getDistance(bufWritePosCopy, maxWritePos);
}
COM: <s> returns the maximum amount that can be written before blocking </s>
|
funcom_train/40614454 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void unlinkAtCommit(Value v) {
if (SysProperties.CHECK && !v.isLinked()) {
DbException.throwInternalError();
}
if (unlinkLobMap == null) {
unlinkLobMap = New.hashMap();
}
unlinkLobMap.put(v.toString(), v);
}
COM: <s> remember that the given lob value must be un linked disconnected from </s>
|
funcom_train/32800539 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addIntValuePropertyDescriptor(Object object) {
itemPropertyDescriptors.add(createItemPropertyDescriptor(
((ComposeableAdapterFactory) adapterFactory)
.getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_RealLiteralExpCS_intValue_feature"),
getString("_UI_PropertyDescriptor_description",
"_UI_RealLiteralExpCS_intValue_feature",
"_UI_RealLiteralExpCS_type"),
OclPackage.Literals.REAL_LITERAL_EXP_CS__INT_VALUE, true,
false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
null, null));
}
COM: <s> this adds a property descriptor for the int value feature </s>
|
funcom_train/46719040 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getResourceText (String name) {
String filepath = RESOURCE_PATH+name;
InputStream is = getClass().getResourceAsStream(filepath);
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
StringBuffer content = new StringBuffer();
String line;
try {
while ((line = reader.readLine()) != null) {
content.append(line);
content.append("\n");
}
} catch (IOException e) {
throw new RuntimeException("internal error - cannot load text resource: "+filepath,e);
}
return content.toString();
}
COM: <s> load a text string from a resource file </s>
|
funcom_train/19080789 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void paintNotification(Graphics g) {
g.drawImage(MagicUIComponents.targetTimer.byGifPictures[notificationCounter
% MagicUIComponents.targetTimer.byGifPictures.length], 15, 15, null);
g.setColor(Color.WHITE);
if (contentLength <= 0) {
g.drawString("? %", 15, 45);
} else {
g.drawString(String.valueOf(currentLength * 100 / contentLength) + "%",
15, 45);
}
}
COM: <s> paint the progress bar of the content download on the given graphics </s>
|
funcom_train/21336291 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initializeHex(Coords c) {
Hex hex = getHex(c.x, c.y);
if (hex == null) {
return;
}
hex.clearExits();
if (hex.getUnit() != null) {
hex.getUnit().setCoords(c);
}
}
COM: <s> initializes a hex in its surroundings </s>
|
funcom_train/8037715 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSuccessors() {
int iStart = 0;
int iEnd = getStoreSize() - 1;
CashStoreItem item0 = null;
CashStoreItem item1 = null;
for(int i=iStart; i<iEnd; i++) {
item0 = (CashStoreItem)getStoreItem(i );
item1 = (CashStoreItem)getStoreItem(i+1);
item0.setSuccessor(item1);
}
item1.setSuccessor(null);
}
COM: <s> set successors of store item to handle chain of responsibility </s>
|
funcom_train/7660868 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testToString() {
ReentrantLock lock = new ReentrantLock();
String us = lock.toString();
assertTrue(us.indexOf("Unlocked") >= 0);
lock.lock();
String ls = lock.toString();
assertTrue(ls.indexOf("Locked") >= 0);
}
COM: <s> to string indicates current lock state </s>
|
funcom_train/7661120 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSubmitRunnable() {
ExecutorService e = new ScheduledThreadPoolExecutor(2);
try {
Future<?> future = e.submit(new NoOpRunnable());
future.get();
assertTrue(future.isDone());
}
catch (ExecutionException ex) {
unexpectedException();
}
catch (InterruptedException ex) {
unexpectedException();
} finally {
joinPool(e);
}
}
COM: <s> completed submit of runnable returns successfully </s>
|
funcom_train/37586399 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int absOffset(TokenList.Iterator cursor) {
int off = cursor.getBlockOffset();
TokenList.Iterator it = cursor.copy();
if (! it.atStart()) it.prev();
while (! it.atStart()) {
off += it.current().getSize();
it.prev();
}
it.dispose();
return off;
}
COM: <s> absolute offset of the specified iterator </s>
|
funcom_train/28262013 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void execute() {
releaseStackBytes = cpu.getWordFromCode();
// Pop instruction pointer (offset) from top of stack into IP register
cpu.ip = cpu.getWordFromStack();
// Pop code segment from top of stack into CS register
cpu.cs = cpu.getWordFromStack();
// Increase the stack pointer by the given number of bytes
cpu.sp = Util.addWords(cpu.sp, releaseStackBytes, 0);
}
COM: <s> transfer control to return address located at top of stack release </s>
|
funcom_train/47867918 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Join join(MetaModel model, String alias, JoinType joinType) {
LOGGER.debug("Joining with the meta model - [" + model + "] using the alias - [" + alias + "] with join type - [" +
joinType + "] from the table - [" + this + "]");
Join join = createJoin(model, alias, joinType);
this.joins.add(join);
return join;
}
COM: <s> p join the given meta model with this table p </s>
|
funcom_train/38292345 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List amsSearch(AMSAgentDescription template, long maxResults) {
List results = new ArrayList();
AID[] ids = platformAgents.keys();
for (int i = 0; i < ids.length; ++i) {
try {
AMSAgentDescription amsd = getAMSDescription(ids[i]);
if (match(template, amsd)) {
results.add(amsd);
if (results.size() >= maxResults) {
break;
}
}
}
catch (NotFoundException nfe) {
// The agent disappeared while we were looping. Ignore it
}
}
return results;
}
COM: <s> searches the white pages for agents whose description matches a given </s>
|
funcom_train/7275713 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addToFreeSlotSet(ExtendedEndpoint host, Map<? super ExtendedEndpoint, ? super ExtendedEndpoint> hosts) {
synchronized(this) {
hosts.put(host, host);
// Also add it to the list of permanent hosts stored on disk.
addPermanent(host);
}
endpointAdded();
}
COM: <s> utility method for adding the specified host to the specified </s>
|
funcom_train/38745075 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean match(Class<?>[] declaredTypes, Class<?>[] actualTypes) {
if (declaredTypes.length == actualTypes.length) {
for (int i = 0; i < actualTypes.length; i++) {
if (!wrapper(declaredTypes[i]).isAssignableFrom(wrapper(actualTypes[i]))) {
return false;
}
}
return true;
}
else {
return false;
}
}
COM: <s> check whether two arrays of types match converting primitive types to </s>
|
funcom_train/3413282 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void firePropertyChange() {
java.util.Vector targets;
synchronized (this) {
if (listeners == null) {
return;
}
targets = (java.util.Vector) listeners.clone();
}
// Tell our listeners that "everything" has changed.
PropertyChangeEvent evt = new PropertyChangeEvent(source, null, null, null);
for (int i = 0; i < targets.size(); i++) {
PropertyChangeListener target = (PropertyChangeListener)targets.elementAt(i);
target.propertyChange(evt);
}
}
COM: <s> report that we have been modified to any interested listeners </s>
|
funcom_train/22237569 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected LSIDAuthority getAuthority(SOAPBodyElement bodyElt) throws AxisFault {
try {
Iterator it = bodyElt.getChildElements(new PrefixedQName(null, AUTHORITY_NAME_PART, null));
if (!it.hasNext())
throw AxisFaultBuilder.createFault(LSIDException.INVALID_METHOD_CALL, "Must specify LSID parameter");
MessageElement elt = (MessageElement) it.next();
return new LSIDAuthority(elt.getValue());
} catch (MalformedLSIDException e) {
throw AxisFaultBuilder.createFault(e);
}
}
COM: <s> get the lsid from the given body element </s>
|
funcom_train/34342883 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TextField getNumeroRecibo() {
if (NumeroRecibo == null) {//GEN-END:|40-getter|0|40-preInit
// write pre-init user code here
NumeroRecibo = new TextField("Numero Recibo", null, 5, TextField.ANY);//GEN-LINE:|40-getter|1|40-postInit
// write post-init user code here
}//GEN-BEGIN:|40-getter|2|
return NumeroRecibo;
}
COM: <s> returns an initiliazed instance of numero recibo component </s>
|
funcom_train/37229029 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setAssigningAuthorityName( String sNamespaceId ) {
HDElement e = new HDElement( iLevel + 1, this );
e.setNamespaceId( sNamespaceId );
e.setName( "CX.4" );
try {
setComponent( e, 4 );
} catch( MalformedFieldException mfe ) {
mfe.printStackTrace();
}
}
COM: <s> set just the namespace id of the assigning authority </s>
|
funcom_train/49608778 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Province updateProvince(String username,EntityManager em,Province vo) throws Throwable {
try {
return (Province)JPAMethods.merge(em, username, DefaultFieldsCallabacks.getInstance(), vo);
}
catch (Throwable ex) {
Logger.error(null, ex.getMessage(), ex);
throw ex;
}
finally {
em.flush();
}
}
COM: <s> update a province </s>
|
funcom_train/949710 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run2() {
int i=0;
while (running) {
long doneloops=0;
resetTimer();
startTimer();
while(new Date().getTime()-startTime.getTime()<200) {
for(int j=0; j<loops;j++) {
long dummy = (i%31+1)*(i%13+1)/((i++)%17+1);
}
doneloops+=loops;
try {
Thread.sleep(1);
} catch (InterruptedException e) {
System.err.println(e);
}
}
stopTimer();
lastValue=doneloops/time;
if (lastValue>maxValue) maxValue = lastValue;
try {
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
System.err.println(e);
}
}
}
COM: <s> test other meseasure methods </s>
|
funcom_train/11371532 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void checkState() {
Preconditions.checkNotNull(logs);
RemoteEditLog prev = null;
for (RemoteEditLog log : logs) {
if (prev != null) {
if (log.getStartTxId() != prev.getEndTxId() + 1) {
throw new IllegalStateException("Invalid log manifest:" + this);
}
}
prev = log;
}
}
COM: <s> check that the logs are contiguous and non overlapping </s>
|
funcom_train/42843296 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void propertyChange(PropertyChangeEvent event) throws RemoteException {
try {
final PropertyChangeEvent localEvent =
new PropertyChangeEvent(this, event.getPropertyName(), event.getOldValue(), event.getNewValue());
top.propertyChange(localEvent);
} catch (Exception e) {
throw new RemoteException("self propertyChange exception: " + e.getMessage(), e);
}
}
COM: <s> send any incoming events from outside to the expr </s>
|
funcom_train/27768692 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void _formatTree(Tree tree, OutputStream out) throws IOException {
Tree.Node root = tree.getRootNode();
Stack currentPath = new Stack();
for(Iterator it = root.children(); it != null && it.hasNext(); ){
Tree.Node subnode = (Tree.Node)it.next();
formatNode(subnode, out, currentPath);
}
}
COM: <s> format the configuration tree to the output stream </s>
|
funcom_train/45622655 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addFormatTypePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_FormatVersionType_formatType_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_FormatVersionType_formatType_feature", "_UI_FormatVersionType_type"),
MSBPackage.eINSTANCE.getFormatVersionType_FormatType(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the format type feature </s>
|
funcom_train/21483631 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testMixOfGoodAndBadMessages() throws Exception {
for (int i = 0; i < 2; i++) {
sendSerializableMessage();
//sendNonSerializableMessage();
}
//Wait for messages to be sent.
Thread.sleep(9000);
assertEquals(2, messages.size());
assertNoCommandsInCache();
}
COM: <s> tests that good messages still go through and in the right order </s>
|
funcom_train/16791725 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String displayObject(Object object) {
try {
Marshaller marshaller = this.context.createMarshaller();
StringWriter writer = new StringWriter(128);
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
marshaller.marshal(object, writer);
return writer.toString();
} catch (Exception ex) {
this.logger.info("Unable to marshal " + object, ex);
return object.toString();
}
}
COM: <s> build an xml representation of an object if we can </s>
|
funcom_train/8582834 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void paintMap(java.awt.Graphics2D g2) {
Map envMap = getMapEnv().getMap();
for (String l1 : envMap.getLocations()) {
Point2D pt1 = envMap.getPosition(l1);
List<String> linkedLocs = envMap.getLocationsLinkedTo(l1);
for (String l2 : linkedLocs) {
Point2D pt2 = envMap.getPosition(l2);
g2.setColor(Color.lightGray);
g2.drawLine(x(pt1), y(pt1), x(pt2), y(pt2));
}
}
}
COM: <s> represents roads by lines and locations by name labeled points </s>
|
funcom_train/6441358 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void senderWontEnableOption(int optionID) throws IOException {
println("WONT "+optionID);
TelnetOption option = getOption(optionID);
if ( option.hasBeenNegotiated() ) return;
if ( !option.isInNegotiation() ) {
negotiateOption(DONT, optionID);
}
option.disable();
}
COM: <s> client says i wont enable option x </s>
|
funcom_train/44823019 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PropertyDescriptor getPropertyDescriptorByName (String fieldName) {
for (int i=0; i<propertyDescriptors.size(); i++) {
PropertyDescriptor fdes = (PropertyDescriptor) propertyDescriptors.get(i);
if (fdes.getName() != null && fdes.getName().equals(fieldName)) {
return fdes;
}
}
return null;
}
COM: <s> get a property descriptors based on its name </s>
|
funcom_train/12847519 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void makeValidDate() {
double jd=swe_julday(this.year,this.month,this.day,this.hour,SE_GREG_CAL);
IDate dt=swe_revjul(jd,SE_GREG_CAL);
this.year=dt.year;
this.month=dt.month;
this.day=dt.day;
this.hour=dt.hour;
}
COM: <s> makes the date to be a valid date </s>
|
funcom_train/28116378 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testInvalidObject() throws Exception {
TestContext context = getContext();
StreamMessage message = (StreamMessage) context.getMessage();
try {
message.writeObject(new java.math.BigDecimal(0.0));
fail("StreamMessage.writeObject() should only support "
+ "objectified primitives");
} catch (MessageFormatException expected) {
// the expected behaviour
}
}
COM: <s> verifies that an invalid object being written using the write object </s>
|
funcom_train/4519196 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private RButton getRButton3113() {
if (RButton3113 == null) {
RButton3113 = new RButton(4);
RButton3113.setText("Hide");
RButton3113.setBounds(new Rectangle(300, 60, 60, 60));
RButton3113.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
(new TestHideColumnTable()).setVisible(true);
}
});
}
return RButton3113;
}
COM: <s> this method initializes rbutton3113 </s>
|
funcom_train/13966259 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ERXRestRequestNode childNamed(String name) {
ERXRestRequestNode matchingChildNode = null;
Enumeration childrenEnum = _children.objectEnumerator();
while (matchingChildNode == null && childrenEnum.hasMoreElements()) {
ERXRestRequestNode childNode = (ERXRestRequestNode) childrenEnum.nextElement();
if (name.equals(childNode.name())) {
matchingChildNode = childNode;
}
}
return matchingChildNode;
}
COM: <s> returns the first child named name </s>
|
funcom_train/49318445 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setImage(FITSImage fitsImage) {
_fitsImage = fitsImage;
float scale = _fitsImage.getScale();
if (scale < 1.0F) {
_scale = scale;
}
_prescaled = (_fitsImage.getSubsample() != 1);
setImage(PlanarImage.wrapRenderedImage(_fitsImage));
}
COM: <s> set the fits image to display </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.