__key__ stringlengths 16 21 | __url__ stringclasses 1
value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/20891454 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JComboBox getJComboBoxYAxis2() {
if ((jComboBoxYAxis2 == null) || (this.reconstruct)) {
if (this.yAxes != null) {
jComboBoxYAxis2 = new JComboBox(this.yAxes);
jComboBoxYAxis2.setSelectedIndex(0);
} else {
jComboBoxYAxis2 = new JComboBox();
}
}
return jComboBoxYAxis2;
}
COM: <s> this method initializes j combo box yaxis2 </s>
|
funcom_train/43569866 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private ZapTextArea getTxtProxyChainSkipName() {
if (txtProxyChainSkipName == null) {
txtProxyChainSkipName = new ZapTextArea();
txtProxyChainSkipName.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN, 11));
txtProxyChainSkipName.setMinimumSize(new java.awt.Dimension(0,32));
txtProxyChainSkipName.setRows(2);
}
return txtProxyChainSkipName;
}
COM: <s> this method initializes txt proxy chain skip name </s>
|
funcom_train/27940474 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean hasWarpTo(Location here, Location there){
if(!(here instanceof Room) || !(there instanceof Room)){
return false;
}else{
Room r = (Room)here;
if(!r.hasWormhole()){
return false;
}else{
return r.getWarpDestination().equals(there);
}
}
}
COM: <s> returns a boolean indicating if a warp exists between two locations </s>
|
funcom_train/7693240 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deleteMeet (Meet meet) {
// a Meet has a list of Judges that need to be deleted also
for (Judge judge : meet.getJudges()) {
deleteJudge(judge);
}
// a Meet has a list of Clubs that need to be deleted also
for (Club club : meet.getClubs()) {
deleteClub(club);
}
// a Meet has a list of Events that need to be deleted also
for (Event event : meet.getEvents()) {
deleteEvent(event);
}
meetDao.delete(meet);
}
COM: <s> delete the given meet object from the database </s>
|
funcom_train/22000560 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void reqAccountUpdates(Portfolio portfolio, boolean start) {
String portfolioName = portfolio.getName();
if (start) {
if (!reqAccountUpdatesPortfolioNames.contains(portfolioName))
reqAccountUpdatesPortfolioNames.add(portfolioName);
if (!onConnect())
return;
eClientSocket.reqAccountUpdates(true,
"");
} else {
if (reqAccountUpdatesPortfolioNames.contains(portfolioName))
reqAccountUpdatesPortfolioNames.remove(portfolioName);
if (!onConnect())
return;
if (reqAccountUpdatesPortfolioNames.size() == 0)
eClientSocket.reqAccountUpdates(false,
"");
}
}
COM: <s> a portfolio requires account updates </s>
|
funcom_train/13389933 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void deleteJarFile(String jarName) {
File fileToDelete = new File(getJarRepoName() + File.separatorChar + jarName);
if (!fileToDelete.delete()) {
logger.warning("unable to delete the target file:" + fileToDelete);
} else {
logger.info(fileToDelete + " deleted");
}
}
COM: <s> delete a named jar fiel form the repo </s>
|
funcom_train/43284000 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private TableItem getItem(final ModelPart part) {
if (tableViewer != null && tableViewer.getTable() != null) {
final TableItem[] items = tableViewer.getTable().getItems();
TableItem item;
for (int i = 0; i < items.length; i++) {
item = items[i];
if (item.getData() == part) {
return item;
}
}
}
return null;
}
COM: <s> get the table item for a certain part </s>
|
funcom_train/4289081 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addAliasPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ModelImport_alias_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ModelImport_alias_feature", "_UI_ModelImport_type"),
NfpsPackage.Literals.MODEL_IMPORT__ALIAS,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the alias feature </s>
|
funcom_train/15513807 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testFindByName() {
System.out.println("findByName");
String _name = "";
WeatherMain instance = new WeatherMain();
Node expResult = null;
Node result = instance.findByName(_name);
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 find by name method of class gui </s>
|
funcom_train/3369079 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getIndexAtPoint(Point p) {
AccessibleText at = getEditorAccessibleText();
if (at != null && sameWindowAncestor(JSpinner.this, editor)) {
// convert point from the JSpinner bounds (source) to
// editor bounds (destination)
Point editorPoint = SwingUtilities.convertPoint(JSpinner.this,
p,
editor);
if (editorPoint != null) {
return at.getIndexAtPoint(editorPoint);
}
}
return -1;
}
COM: <s> given a point in local coordinates return the zero based index </s>
|
funcom_train/25792285 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ProcessTreeNode getTree(String instanceName) {
if (m_item != null
&& m_item.getProcessInstanceName().equals(instanceName)) {
return this;
}
for (int i = 0; i < getChildCount(); i++) {
ProcessTreeNode child = (ProcessTreeNode) getChildAt(i);
ProcessTreeNode search = child.getTree(instanceName);
if (search != null) {
return search;
}
}
return null;
}
COM: <s> get the first process tree with an item which matches the given </s>
|
funcom_train/19239667 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Dimension minimumLayoutSize(Container parent) {
Dimension d = new Dimension();
for(int componentIndex=0; componentIndex<parent.getComponents().length; componentIndex++){
Component c = parent.getComponents()[componentIndex];
d.height += c.getMinimumSize().height;
d.width = Math.max(c.getMinimumSize().width, d.width);
}
return d;
}
COM: <s> find the minimum dimension for the </s>
|
funcom_train/4916678 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testZeroMonitorOfficeInterval() {
// Record negative monitor office interval
this.recordReturn(this.configuration,
this.configuration.getOfficeName(), OFFICE_NAME);
this.recordReturn(this.configuration,
this.configuration.getMonitorOfficeInterval(), 0);
this.record_issue("Monitor office interval must be greater than zero");
// Construct the office
this.replayMockObjects();
this.constructRawOfficeMetaData(false);
this.verifyMockObjects();
}
COM: <s> ensure issue if zero monitor </s>
|
funcom_train/7893320 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void doDependencyInjection() {
for (Field field : getFieldsToDependencyInject()) {
try {
boolean isFieldAccessible = field.isAccessible();
if (!isFieldAccessible) {
field.setAccessible(true);
}
field.set(this, WebApplicationContextUtils.getWebApplicationContext(getServletContext()).getBean(
field.getName()));
if (!isFieldAccessible) {
field.setAccessible(false);
}
} catch (IllegalArgumentException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
}
COM: <s> carries out dependency injection </s>
|
funcom_train/31556465 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addCopy() {
// copy: put all data unto clipboard in 2-column format
JMenuItem copy = Builder.makeMenuItem("copy");
copy.addActionListener(new AbstractAction() {
public void actionPerformed(ActionEvent e) {
CopyDialog d = new CopyDialog(editor, sample.range);
if(d.isOk())
TextClipboard.copy(asTwoColumn(d.getChosenRange()));
// copy the sample to the clipboard, as 2-column
//TextClipboard.copy(asTwoColumn());
}
});
add(copy);
}
COM: <s> add a copy menuitem that copies this sample to the clipboard </s>
|
funcom_train/25562889 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addStopper(Stopper stopper) {
//Only one stopper link solver will have.
Stopper realStopper = getRealStopper();
if (realStopper == null) realStopper/*this.stopper*/ = stopper;
else {
setParent(realStopper, stopper);
realStopper = stopper;
}
((Manageable)getSolver()).setStopper(realStopper); //this.stopper is latest in chain one.
getStopper().setStopper(realStopper); //To be sure that manager has link to some stopper.
}
COM: <s> add external stopper to solver </s>
|
funcom_train/16696465 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void unregisterBean(String beanName) {
logger.debug("BSFManager:unregisterBean");
// System.err.println("<<< thread=["+Thread.currentThread().getName()+"]: ["+this+"] BSFManager.unregisterBean(\""+beanName+"\")" );
// System.err.flush();
objectRegistry.unregister(beanName);
}
COM: <s> unregister a previously registered bean </s>
|
funcom_train/37444840 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Element createHydrogenium() {
System.out.println("Creating Hydrogenium...");
final Element hydrogenium = new Element(1, "H", "Hydrogenium", 1.0F);
try {
periodicTable.persist(hydrogenium);
return hydrogenium;
} catch (final EJBException exception) {
System.out.println(exception);
return null;
}
}
COM: <s> creates the element hydrogenium in the periodic table </s>
|
funcom_train/19318211 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeShort(short value) throws JMSException {
if(!isBodyModifiable()) {
throw new MessageNotWriteableException("BytesMessage read_only");
}
try {
getOutputStream().writeShort((int) value);
}
catch(IOException e) {
throw new JMSException(e.getMessage());
}
}
COM: <s> writes a code short code to the bytes message stream as two bytes </s>
|
funcom_train/14177815 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getHighscoreList(int id) {
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
Transaction tx = null;
List result = null;
try {
tx = session.beginTransaction();
Query q = session.createQuery("from Highscore where HIGHSCOREID like :un");
q.setInteger("un", id);
result = q.list();
tx.commit();
} catch (HibernateException he) {
if (tx != null) {
tx.rollback();
}
throw he;
}
return result;
}
COM: <s> returns the highscore list for a given highscore id </s>
|
funcom_train/43100234 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeSourceFlow(Object handle, Object flow) {
if (handle instanceof MModelElement
&& flow instanceof MFlow) {
((MModelElement) handle).removeSourceFlow((MFlow) flow);
return;
}
throw new IllegalArgumentException("handle: " + handle
+ " or flow: " + flow);
}
COM: <s> remove a source flow from a model element </s>
|
funcom_train/11696775 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void updateScaleOut(int value) {
if (currentMetaDataObject instanceof AEDeploymentMetaData) {
((AEDeploymentMetaData) currentMetaDataObject).setNumberOfInstances(value);
// Set CAS pool size to the number of instances
multiPageEditor.getOverviewPage().setCasPoolSize(value);
}
masterPart.refresh();
multiPageEditor.setFileDirty();
}
COM: <s> update the number of instances </s>
|
funcom_train/3784936 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean showStatusProcessModule(String pipelineName)
{ /* showStatusProcessModule */
DbProcess p= DbProcess.lookupProcessByPipelineName(pipelineName);
String msg= "\n*** Process ["+pipelineName+"] status ***\n";
msg += p.toString()+"\n";
Util.appendPRmsg(msg);
return(true);
} /* showStatusProcessModule */
COM: <s> show status process module show status of the running process module </s>
|
funcom_train/9921096 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeBuddy(AIMBuddy buddy) {
if(buddy == null) {
return;
}
if(getBuddy(buddy.getName()) == null) {
return;
}
removeBuddy(buddy.getName());
//logger.info("Removed buddy from hash");
buddyHash.remove(buddy.getName().toLowerCase());
}
COM: <s> remove a single budy </s>
|
funcom_train/41367484 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void updateDatabase_Location(int inLocation_ID, int inLocation_X, int inLocation_Y) {
updateDatabase("UPDATE Location SET " +
"Location_X='" + inLocation_X + "' " +
"Location_Y='" + inLocation_Y + "' " +
"WHERE Location_ID='" + inLocation_ID + "'");
}
COM: <s> update an entry in location database </s>
|
funcom_train/47142836 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Display attach (Display d) {
synchronized (getDisplayLock()) {
Display dOld = m_dDisplay;
m_dDisplay = d;
synchronized (getSalesPointLock()) {
if ((m_spCurrent != null) && (m_spCurrent.getCurrentCustomer() == this)) {
m_spCurrent.attach (m_dDisplay);
}
else {
setDefaultSheets();
}
}
return dOld;
}
}
COM: <s> attach a display to the customer </s>
|
funcom_train/37518072 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void accumAllTypeSignatures(/*@non_null@*/ ArrayList accum) {
accum.add(getCClass());
Iterator iter = inners.iterator();
while (iter.hasNext()) {
JTypeDeclarationType t = (JTypeDeclarationType) iter.next();
t.accumAllTypeSignatures(accum);
}
}
COM: <s> adds the signature csource class of this and of all nested </s>
|
funcom_train/32780346 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void transporterArrival() {
// get the current process that sends the message to the crane control
SimProcess currentProcess = currentSimProcess();
// add the transporter to the cranes system
this.cs.addTransporter(currentProcess);
// interrupt this crane control
this.interrupt(this.transporterArrival);
if (currentlySendTraceNotes())
currentProcess.sendTraceNote("waits for his unloading and/or loading");
// skip trace note
currentProcess.skipTraceNote();
// passivate the transporter
currentProcess.passivate();
}
COM: <s> this method is used by a transporter external internal to send the </s>
|
funcom_train/13969342 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run () {
while (true) {
// Update the buttons we control.
try {
if (repaint) {
PROGRESSBAR.paint(PROGRESSBAR.getGraphics());
WINDOW.paint(WINDOW.getGraphics());
}
// Sleep a while.
sleep(300);
} catch (Exception e) {
e.printStackTrace();
// may be unvisible, not harmful
}
}
}
COM: <s> repaints the progress bar every 300 ms </s>
|
funcom_train/3099946 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void handleRequest(Conversation conv) {
DIAGNOSTICS.println( "Received request", diagnosticLevel);
if (conv.getProtocol().equals(FIPACONSTANTS.FIPA_REQUEST))
newTask(new AgreeInformTask(conv), conv);
else
DIAGNOSTICS.println( "Ignored request", diagnosticLevel);
}
COM: <s> handles a new conversation whose first message is a request performative </s>
|
funcom_train/36019044 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Serializable getObject() throws IOException {
try {
// Create object from byte array
ByteArrayInputStream bin = new ByteArrayInputStream(value);
ObjectInputStream oin = new ObjectInputStream(bin);
Serializable o = (Serializable) oin.readObject();
oin.close();
return o;
} catch (ClassNotFoundException e) {
throw new IOException(e.toString());
}
}
COM: <s> returns the value as an object </s>
|
funcom_train/32001071 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ArrayList getYears() {
final int CURRENT_YEAR = getYear();
yearList = new ArrayList();
for (int counter = 0, j = 0; counter < 20; counter++, j++) {
yearList.add(counter, new Integer(CURRENT_YEAR - j));
}
return yearList;
}
COM: <s> stores the curret years and 20 years past </s>
|
funcom_train/41417211 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void playerChallenge(Event e) {
if (m2state.canJoin()) {
Byte id = m2state.newPlayer();
if (id != null) {
// send positive news back to caller
e.setComplex(id);
algo.acknowledge(e);
// broadcast the change
// algo.sendEvent(Event.create(Event.PLAYER_CONNECTED, id,
// Event.PRIORITY_HIGH));
return;
}
}
algo.reject(e);
}
COM: <s> handle a player challenge return the player id in the payload </s>
|
funcom_train/22210650 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean removeChildrenWithUserObject(Object lookup) {
if (children == null) {
return false;
}
Iterator ch = children.iterator();
boolean deleted = false;
while (ch.hasNext()) {
Object o = ch.next();
if (o instanceof NodeWithChildren && (((NodeWithChildren) o).getUserObject() == lookup)) {
ch.remove();
deleted = true;
}
}
return deleted;
}
COM: <s> removes all children of this node which store </s>
|
funcom_train/44473376 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Object findByPrimaryKey(Serializable primaryKey) throws PersistenceException {
Object result = null;
try {
result = getSession().get(domainClass, primaryKey);
} catch (HibernateException e) {
throw new DAOException("findByPrimaryKey", e);
}
if (result == null) {
throw new ObjectNotFoundException(domainClass, primaryKey);
}
return result;
}
COM: <s> returns a pojo of the specified type by its primary key </s>
|
funcom_train/6464458 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setComparator(IComparator comparator) {
if(comparator == null) {
AILibException e = new AILibException(this.getClass(), "setComparator(IComparator)", Messages.get("null.argument"));
this.comparator = new NoComparator();
} else
this.comparator = comparator;
}
COM: <s> sets the comparison handler of this genome </s>
|
funcom_train/37583607 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run(Runnable r, T1 arg1, T2 arg2, T3 arg3, T4 arg4, int threshold) {
if (!contains(arg1, arg2, arg3, arg4, threshold)) {
push(arg1, arg2, arg3, arg4);
try { r.run(); }
finally { pop(arg1, arg2, arg3, arg4); }
}
}
COM: <s> run the given runnable unless </s>
|
funcom_train/36956305 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void fireLabelProviderChanged(final LabelProviderChangedEvent event) {
Object[] listeners = fListeners.getListeners();
for (int i = 0; i < listeners.length; ++i) {
final ILabelProviderListener l = (ILabelProviderListener) listeners[i];
Platform.run(new SafeRunnable() {
public void run() {
l.labelProviderChanged(event);
}
});
}
}
COM: <s> fires a label provider changed event to all registered listeners </s>
|
funcom_train/9147074 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void prune(int minCount) {
Iterator<Map.Entry<E,Counter>> it = entrySet().iterator();
while (it.hasNext())
if (it.next().getValue().value() < minCount)
it.remove(); // remove this entry
}
COM: <s> removes all entries in this counter that have less than </s>
|
funcom_train/39468109 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void logImpl(final Level level, final Throwable t, final String message) {
final LogEntry<Level> logEntry = new LogEntry<Level>(level, message, t);
System.err.format("%s:%d: %s: %s %s", logEntry.getFilename(), logEntry.getLineNumber(), level, t, message);
}
COM: <s> format and print a log message </s>
|
funcom_train/46857385 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private SimTimeEdit getSteTimeClosing() {
if (steTimeClosing == null) {
steTimeClosing = new SimTimeEdit();
steTimeClosing.setPreferredSize(new Dimension(166, 45));
steTimeClosing.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent e) {
currentSchool.setTimeClosing(steTimeClosing.getValue());
}
});
}
return steTimeClosing;
}
COM: <s> this method initializes ste time closing </s>
|
funcom_train/35038614 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void StartTrafficMeter(){
for(int i=0; i< devices.length; i++){
try {
final int j = i;
jpcapMeter[j] = JpcapCaptor.openDevice(devices[j], 68, false, 10);
startTrafficMeterThread(j);
} catch (IOException ex) {
}
}
}
COM: <s> start capture all packets of the computers network interfaces </s>
|
funcom_train/25565147 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean setData(DataWrapper newData) {
DataWrapper oldData = this.data;
if(!super.setData(newData)) return false;//here this.data is replaced to newData
if(newData==null)return true;
if(shouldUpdateLinks(oldData, newData)){
putDataLinks(newData);
linksDelegate.updateLinksView();
putCurrentChildren();
putCurrentLinks();
}
shouldUpdateLinks = false;
return true;
}
COM: <s> overriden to put data links will be used by listener in data changing </s>
|
funcom_train/25928601 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
if ("RepositoryService".equals(portName)) {
setRepositoryServiceEndpointAddress(address);
}
else
{ // Unknown Port Name
throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
}
}
COM: <s> set the endpoint address for the specified port name </s>
|
funcom_train/49469107 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Long getNumberValueForSql(Long l) throws Exception {
switch(restrictionType){ //NOPMD don't bother me with breaks, i have returns
case Filter.IS_NULL :
case Filter.IS_NOT_NULL :
return null;
case Filter.EQUALS :
case Filter.DIFFERENT :
case Filter.LOWER :
case Filter.LOWER_OR_EQUALS :
case Filter.HIGHER :
case Filter.HIGHER_OR_EQUALS :
return l;
default:
throw new Exception("Unknown comparison type");
}
}
COM: <s> generate the sql number that will be put in the prepared statement </s>
|
funcom_train/1012153 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void normal3f(GL gl, float x, float y, float z) {
float mag;
mag = (float)Math.sqrt(x * x + y * y + z * z);
if (mag > 0.00001F) {
x /= mag;
y /= mag;
z /= mag;
}
glNormal3f(gl, x, y, z);
}
COM: <s> call gl normal3f after scaling normal to unit length </s>
|
funcom_train/25707426 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void finished() {
try {
deactivateGlassPane();
doUIUpdateLogic();
} catch (RuntimeException e) {
// Do nothing, simply cleanup below
logger.log(Level.SEVERE, "SwingWorker error", e);
} finally {
// Allow original component to get the focus
if (getAComponent() != null) {
getAComponent().requestFocus();
}
}
}
COM: <s> called on the event dispatching thread not on the worker thread </s>
|
funcom_train/18058706 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getHeaderIndexByPN(int index) {
for(int i=0; i<titleStrings.length; i++)
if (titleStrings[i].index == index) {
for(int j=0; j<titles.length; j++)
if (titles[j].equals(titleStrings[i].title))
return j;
break;
}
return -1;
}
COM: <s> get the column index for the d </s>
|
funcom_train/17210045 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void exportNet(String filename, boolean tab, boolean _view) {
Net export;
if (_view) export = view; else export = global;
if (!tab){
loader.saveNet(filename, export);
loader.saveNodeData(filename+".n", export);
} else {
loader.saveNetTab(filename, export);
loader.saveNodeDataTab(filename+".n", export);
}
}
COM: <s> export the view in sema space formats </s>
|
funcom_train/33768628 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void nodesWereInserted(Object parent, Object[] parentPath, int[] childIndices){
Object[] children = new Object[childIndices.length];
for (int i = 0; i < children.length; i++)
children[i] = getChild(parent, childIndices[i]);
fireTreeNodesInserted(this, parentPath, childIndices, children);
}
COM: <s> invoke this method after youve inserted some tree nodes </s>
|
funcom_train/49608668 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public GuestPathology updateGuestPathology(String username,EntityManager em,GuestPathology vo) throws Throwable {
try {
return (GuestPathology)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 guest pathology </s>
|
funcom_train/41070546 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void newFilter() {
RowFilter<MyTableModel, Object> rf = null;
//If current expression doesn't parse, don't update.
try {
rf = RowFilter.regexFilter(filterText.getText());
} catch (java.util.regex.PatternSyntaxException e) {
return;
}
sorter.setRowFilter(rf);
}
COM: <s> update the row filter regular expression from the expression in </s>
|
funcom_train/46694836 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testBuildingStatus() {
System.out.println("buildingStatus");
ActorByProperty instance = new ActorByProperty();
assertEquals(State.UNINITIALIZED,instance.buildingStatus());
instance.buildQuery("", false, new NullPropertyQuery());
assertEquals(State.READY,instance.buildingStatus());
}
COM: <s> test of building status method of class actor by property </s>
|
funcom_train/35951148 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getCmdBroadcast() {
if (cmdBroadcast == null) {//GEN-END:|32-getter|0|32-preInit
// write pre-init user code here
cmdBroadcast = new Command("Broadcast", Command.ITEM, 0);//GEN-LINE:|32-getter|1|32-postInit
// write post-init user code here
}//GEN-BEGIN:|32-getter|2|
return cmdBroadcast;
}
COM: <s> returns an initiliazed instance of cmd broadcast component </s>
|
funcom_train/28992840 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String add() {
Product product = new Product();
product.setName("-- Product --");
product.setDescription("-- Description --");
product.setCode("CODE");
product.setType(Product.TYPE_CONTACT);
product.setPrice(new BigDecimal(0).setScale(2,
BigDecimal.ROUND_HALF_EVEN));
product.save();
return product.getId();
}
COM: <s> creates and saves a new product object containg </s>
|
funcom_train/25129614 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ARINCWidgetRenderer createLFRenderer(ServerWidget widget, String arincID) throws ServerRuntimeException {
ARINCUIManager.getInstance().setCurrentLookAndFeel();
ARINCWidgetRenderer rdr = createRenderer(widget, arincID);
try {
ARINCUIManager.getInstance().resetDefaultLookAndFeel();
} catch (UIException ex) {
throw new ServerRuntimeException("Look and Feel Exception", ex);
}
return rdr;
}
COM: <s> create a renderer instance associated with a particular arinc widget id enclosing it </s>
|
funcom_train/29618378 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private MgisTextField getJSynonymNameField() {
if (jSynonymNameField == null) {
jSynonymNameField = new MgisTextField();
jSynonymNameField.setBounds(new java.awt.Rectangle(10,39,205,19));
jSynonymNameField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
jAddModifySynonymNameButton.setEnabled(true);
}
});
}
return jSynonymNameField;
}
COM: <s> this method initializes j new synonym field </s>
|
funcom_train/2852122 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getStatusChar(){
String[] statC = {"R", "E", "A", "P", "S", "N", "F"};
if (status<statC.length)
return statC[status];
return("ERR");
}
COM: <s> returns current status as a char </s>
|
funcom_train/22639512 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private GraphNode getNode(String fullName) {
if (!treeIndex.containsKey(fullName)) {
XmlvmResource resource = loadResource(fullName);
if (resource != null) {
insertResource(resource);
} else {
Log.error("Couldn't create node for " + fullName);
}
}
return treeIndex.get(fullName);
}
COM: <s> get the graph node of an xmlvm resource </s>
|
funcom_train/9503635 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: final public GeoLine Tangent(String label, GeoPoint P, GeoFunction f) {
AlgoTangentFunctionPoint algo = new AlgoTangentFunctionPoint(cons, label,
P, f);
GeoLine t = algo.getTangent();
t.setToExplicit();
t.update();
notifyUpdate(t);
return t;
}
COM: <s> tangent to f in x x p </s>
|
funcom_train/51773831 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getNDeployedServces(int days) {
try {
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select count(event) from log where application='SeCSERegistry' AND event LIKE 'Deployed Service id%' AND DATE_SUB(CURDATE(),INTERVAL " + days + " DAY) <= start");
if (rs.next())
return rs.getInt(1);
} catch (Exception e) {
e.printStackTrace();
}
return 0;
}
COM: <s> it returns the number of service deployments in the specified period </s>
|
funcom_train/5725451 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(Object object) {
if (this == object) {
return true;
}
if (!(object instanceof CourseTypeInfo)) {
return false;
}
final CourseTypeInfo that = (CourseTypeInfo) object;
if (this.id == null || that.getId() == null || !this.id.equals(that.getId())) {
return false;
}
return true;
}
COM: <s> returns code true code if the argument is an course type info instance </s>
|
funcom_train/51296060 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public NamedId getType() {
if (type == null) {
type = new NamedId(getTypeId(), "");
ResultSet res = null;
try {
res = DBAccessor.getInstance().makeSelect(
"SELECT alias FROM pos_type WHERE id = " + getTypeId());
if (res.next())
type.setName(res.getString("alias"));
} catch (SQLException e) {
e.printStackTrace();
} finally {
DBAccessor.getInstance().releaseConnection(res);
}
}
return type;
}
COM: <s> returns pos type </s>
|
funcom_train/50501287 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void childBeanRemoved(Object parentBean, Object child) {
if(propagateChildChanges) {
synchronized(listeners) {
Iterator iter = listeners.iterator();
while(iter.hasNext()) {
IBeanListener l = (IBeanListener) iter.next();
l.childBeanRemoved(parentBean, child);
}
}
}
}
COM: <s> fires a child bean removed event to all registered listeners </s>
|
funcom_train/34110184 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void getAllGroups() {
GWTDocument gwtDocument = Main.get().mainPanel.browser.fileBrowser.getDocument();
// if (gwtDocument!= null) {
// ServiceDefTarget endPoint = (ServiceDefTarget) propertyGroupService;
// endPoint.setServiceEntryPoint(Config.OKMPropertyGroupService);
// propertyGroupService.getAllGroups(gwtDocument.getPath(), callbackGetAllGroups);
// }
}
COM: <s> gets all property groups </s>
|
funcom_train/1213564 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initValues(ExcelFileInputConfig config) {
String s;
s = config.getEndRow();
if (s != null) {
endRow.setText(s);
}
s = config.getSheet();
if (s != null) {
sheet.setText(s);
}
s = config.getStartRow();
if (s != null) {
startRow.setText(s);
}
}
COM: <s> initialize the values of the graphical components </s>
|
funcom_train/8688292 | /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("\n");
int size = entries.size();
for (int i = 0; i < size; ++i) {
sb.append("[" + i + "] = " + getEntry(i) + "\n");
}
return sb.toString();
}
COM: <s> dump the constant pool to a string </s>
|
funcom_train/10448741 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setAttribute(String name, Object value) {
if (getLog().isTraceEnabled()) {
getLog().trace(sm.getString("abstractProtocolHandler.setAttribute",
name, value));
}
attributes.put(name, value);
}
COM: <s> generic property setter called when a property for which a specific </s>
|
funcom_train/22279344 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Size preferredLayoutSize(View target) {
Size minSize = target.minSize();
if(minSize.width != 0 || minSize.height != 0)
return minSize;
Rect aRect = containedRect(target);
return new Size(aRect.x+aRect.width, aRect.y+aRect.height);
}
COM: <s> this is the primative method that determines what the right size is </s>
|
funcom_train/10912607 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getReferenceAreaIPD() {
LayoutManager lm = getParent();
while (lm != null) {
if (lm.getGeneratesReferenceArea()) {
return lm.getContentAreaIPD();
}
lm = lm.getParent();
}
LOG.error("No parent LM found");
return 0;
}
COM: <s> find the first ancestor area that is a reference area </s>
|
funcom_train/27785750 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(Object object) {
if(object instanceof ShareAccount) {
ShareAccount account = (ShareAccount)object;
return(account.getName().equals(getName()) &&
account.getCurrency().equals(getCurrency()) &&
account.getStockHoldings().equals(getStockHoldings()));
}
else
return false;
}
COM: <s> compares this share account to another </s>
|
funcom_train/47820579 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void initWares() {
// TODO initialize the wares in a more controlled way
Random rnd = new Random(System.nanoTime());
for (EWare ware : EWare.values()) {
boolean hasWare = rnd.nextInt(7)%7!=0;
if (hasWare){
int amount = rnd.nextInt(159)+1; // 1..150
addNewWare(ware, amount);
}
}
}
COM: <s> init the amount of wares available in the city </s>
|
funcom_train/50427944 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TableSet getAdjacencyList() {
TableSet adjacencyListTable = new TableSet();
for (Iterator i = getNodes().iterator(); i.hasNext(); ) {
Node n = (Node) i.next();
List l = n.getChildren();
if (l == null) l = new LinkedList();
adjacencyListTable.putAll(n, l);
}
return adjacencyListTable;
}
COM: <s> construct the adjacency list table for a particular graph </s>
|
funcom_train/43150732 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException {
try {
debugCode("setUnicodeStream("+parameterIndex+", x, "+length+");");
throw Message.getUnsupportedException("unicodeStream");
} catch (Exception e) {
throw logAndConvert(e);
}
}
COM: <s> not supported this feature is deprecated and not supported </s>
|
funcom_train/18183789 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: @Test public void testEqualsNotEqual() {
assertThat(createObjectWithPropertiesSet().equals(createObjectWithPropertiesNull()), is(false));
assertThat(createObjectWithPropertiesNull().equals(createObjectWithPropertiesSet()), is(false));
}
COM: <s> asserts that objects differ </s>
|
funcom_train/23246585 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addStatisticalTime(final long startTime, final String functionName) {
Long sum = mystatistics.get(functionName);
if (sum == null) {
sum = (System.currentTimeMillis() - startTime);
} else {
sum += (System.currentTimeMillis() - startTime);
}
mystatistics.put(functionName, sum);
}
COM: <s> add runtimes to </s>
|
funcom_train/25084410 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JSONObject getJSONObject(int index) throws JSONException {
Object o = get(index);
if (o instanceof JSONObject) {
return (JSONObject)o;
}
throw new JSONException("JSONArray[" + index +
"] "+ExceptionMessage.IS_NOT_A_JSONOBJECT.toString());
}
COM: <s> get the jsonobject associated with an index </s>
|
funcom_train/22238106 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Hashtable getCredentials(LSIDAuthority authority) {
String lsidkey = "urn:lsid:" + authority;
try {
Iterator it = conf.getLsidMap();
while (it.hasNext()) {
CredentialMap cm = (CredentialMap)it.next();
if (cm.getMapKey().equals(lsidkey)) {
return getBasicAuth(cm.getCredentials());
}
}
} catch (JastorException e) {
e.printStackTrace();
} catch (LSIDException e) {
e.printStackTrace();
}
return new Hashtable();
}
COM: <s> lookup the credentials to use for a given authority </s>
|
funcom_train/14433643 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isCellWithinBounds(int column, int row) {
boolean isCellWithinBounds = true;
if(column < 0 || row < 0 || column > this.getNumberColumns() - 1 || row > this.getNumberRows() - 1) {
isCellWithinBounds = false;
}
return isCellWithinBounds;
}
COM: <s> p check if a target cell located at coordinates code column code </s>
|
funcom_train/26279410 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getLayerPosition(JGimpLayer layer) throws JGimpException, JGimpInvalidLayerException {
JGimpLayer[] layers = this.getLayers();
for (int i = 0; i < layers.length; i++) {
JGimpLayer thisLayer = layers[i];
if (thisLayer.equals(layer)) {
return i;
}
}
throw new JGimpInvalidLayerException(layer.getID());
}
COM: <s> returns the position index of the given layer within </s>
|
funcom_train/634574 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Object createInstance(String classname) throws OvConfigException {
Object obj = null;
try {
obj = Class.forName(classname).newInstance();
} catch (Exception e) {
String errorMessage = "Error creating instance of class '" + classname + "'";
if (log.isErrorEnabled()) {
log.error(errorMessage, e);
}
throw new OvConfigException(errorMessage, e);
}
return obj;
}
COM: <s> creates an instance of a class </s>
|
funcom_train/10912019 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int convertTTFUnit2PDFUnit(int n) {
int ret;
if (n < 0) {
long rest1 = n % upem;
long storrest = 1000 * rest1;
long ledd2 = (storrest != 0 ? rest1 / storrest : 0);
ret = -((-1000 * n) / upem - (int)ledd2);
} else {
ret = (n / upem) * 1000 + ((n % upem) * 1000) / upem;
}
return ret;
}
COM: <s> convert from truetype unit to pdf unit based on the </s>
|
funcom_train/3698589 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isAllowedToSpeak(User user) throws IRCException{
try {
Rights rights = getRights(user.getNickName());
if(rights.isOperator() ||!isTypeModerated() || rights.isAbleToSpeakIfModerated()){
return true;
}
} catch (IRCException e){
if(!isTypeClientInsideOnly()){
return true;
}
}
throw new IRCException(Replies.ERR_CANNOTSENDTOCHAN,new String[]{getName()});
}
COM: <s> to know if the user is allowed to speak on the channel </s>
|
funcom_train/19774718 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void moveTo(float x, float y, float z) {
this.x = x;
this.y = y;
this.z = z;
for (int i = 0; i < pieces.size(); i++) {
Piece piece = (Piece) pieces.elementAt(i);
piece.moveTo(x, y, z);
}
}
COM: <s> moving a brush </s>
|
funcom_train/22209511 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void getSettings(final TMNavSettings settings) throws ConfigurationException {
final String file = getTMNavSettingsFilename();
parseConfigResource(file,
new ParseAction() {
public Object parse() throws Exception {
// Digesting abstractor, renderer, provider context
FileInputStream is = new FileInputStream(file);
digester.parseSettings(settings, is);
return null; // do need the return value
}
});
}
COM: <s> parses the tmnav settings file in user dir </s>
|
funcom_train/50304088 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CmsTask createProject(String projectname, int projectType, String roleName, long timeout, int priority) throws CmsException {
return m_rb.createProject(m_context.currentUser(), projectname, projectType, roleName, timeout, priority);
}
COM: <s> creates a new project for task handling </s>
|
funcom_train/44136460 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deleteOralNotesFile() {
String absoluteFilename = this.getElement().getDocument().getMediasPath();
absoluteFilename += (File.separator + getOralNotesFilename());
File f = new File(absoluteFilename);
f.delete();
setOralNotesFilename(new String());
m_Element.getDocument().setModified(true);
}
COM: <s> to delete the oral notes file </s>
|
funcom_train/44125699 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void init() {
/* Obtain the hostname and set it in the GUI */
if(hostname.length() > 0) {
/* Set the host parameter as the host to connect to */
tfGobServer.setText(hostname);
} else {
/* Else just default to localhost */
tfGobServer.setText("localhost");
}
/* Focus on the username textfield */
tfUserName.requestFocusInWindow();
}
COM: <s> the method first executed after the object has been initiated </s>
|
funcom_train/39565326 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object clone() {
Border newborder = new Border();
newborder.type = type;
newborder.border = border;
newborder.topMargin = topMargin;
newborder.leftMargin = leftMargin;
newborder.bottomMargin = bottomMargin;
newborder.rightMargin = rightMargin;
newborder.minMargin = minMargin;
newborder.maxMargin = maxMargin;
newborder.borderThickness = borderThickness;
return newborder;
}
COM: <s> returns a clone of this border </s>
|
funcom_train/43410825 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public RespostaString putDestinatariosPorLista(String lg, String listaID, List<String> siglasDestinatarios) {
EntidadesService entidades = new EntidadesService(lg);
entidades.getConnectionDB();
RespostaString result = null;
result = entidades.putDestinatariosPorLista(listaID, siglasDestinatarios);
entidades.closeConnectionDB();
return result;
}
COM: <s> add entities to a personalizaed list </s>
|
funcom_train/46158393 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setPositionRelative(double position, double offset) {
if (playerReady()) {
// calculate the position and normalize it to media bounds:
// 0.0 - media duration
double absolute = getPositionRelative(position, offset);
LOGGER.info(((offset > 0) ? "fast forwarding" : "rewinding") + " to: " + absolute + "s");
setPosition(absolute);
}
}
COM: <s> sets the play position offset from a specific time </s>
|
funcom_train/3091331 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void print(String message) {
Iterator consoleIterator = consoles.iterator();
while(consoleIterator.hasNext()){
ConsoleHandler next = (ConsoleHandler)consoleIterator.next();
if (next.getDefaultLevel().compareTo(next.getMaximumLevel()) <= 0) {
next.print(message);
}
}
log(message, defaultLevel);
}
COM: <s> prints the given message at the default level in all contained </s>
|
funcom_train/12868195 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getProjectRelativePath(File file) {
String path = file.getAbsolutePath();
String prefix = project.getBasedir().getAbsolutePath();
if (path.startsWith(prefix)) {
path = path.substring(prefix.length() + 1);
}
if (File.separatorChar != '/') {
path = path.replace(File.separatorChar, '/');
}
return path;
}
COM: <s> returns the path of given file relative to the enclosing maven project </s>
|
funcom_train/12158170 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public AttributeGroupDefinition addAttributeGroupDefinition (String name) {
if (attributeGroupDefinitions.containsKey (name)) {
throw new IllegalStateException ("AttributeGroup " + name
+ " already defined in scope "
+ this);
}
AttributeGroupDefinition definition
= createAttributeGroupDefinition (name);
attributeGroupDefinitions.put (name, definition);
return definition;
}
COM: <s> create and add a new code attribute group definition code to the scope </s>
|
funcom_train/23245806 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PreparedStatement prepareStatementForStreaming(final String sql) {
try {
PreparedStatement statement;
// Create a statement for returning streaming results.
statement = getConnection().prepareStatement(sql,
ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
statement.setFetchSize(Integer.MIN_VALUE);
return statement;
} catch (SQLException e) {
throw new OsmosisRuntimeException(
"Unable to create streaming resultset statement.\nSQL=" + sql, e);
}
}
COM: <s> creates a new database statement that is configured so that any result </s>
|
funcom_train/24937155 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Location shiftAndCorrelate(Location loc, int delta) {
// First, inform the Locaiton that the underlying
// allocation may have been moved. All Allocations
// potentially apply to this location.
for (Iterator it = old2NewAlloc.keySet().iterator(); it.hasNext();) {
loc.chopStart((Location) it.next(), delta);
}
// Now correlate it back to the new allocation.
return Variable.getCorrelatedLocation(old2NewAlloc, loc);
}
COM: <s> returns a location that has been shifted by delta as necessary and </s>
|
funcom_train/19974133 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double getVideoRatio() throws QTException
{
if (movie == null){
return 0;
} else {
return (double)(movie.getIndTrackType (1, StdQTConstants.visualMediaCharacteristic,
StdQTConstants.movieTrackCharacteristic).getSize().getWidth())
/ (double)(movie.getIndTrackType (1, StdQTConstants.visualMediaCharacteristic,
StdQTConstants.movieTrackCharacteristic).getSize().getHeight());
}
}
COM: <s> calculate the ratio of the movie </s>
|
funcom_train/23411233 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addArcIDPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Arc_arcID_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Arc_arcID_feature", "_UI_Arc_type"),
OMPackage.Literals.ARC__ARC_ID,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the arc id feature </s>
|
funcom_train/37519380 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean setOptionField(String longname, Object value) {
for (int i = 0; i < optionsFactoryArray.size(); i++) {
if (((OptionsFactory)(optionsFactoryArray.get(i)))
.setOptionField(longname, value)) {
return true;
}
}
return false;
}
COM: <s> checks through each option set to see if either of them can be </s>
|
funcom_train/18743153 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void paintBackground(Graphics2D g, Shape shape) {
Paint oldPaint = g.getPaint();
Paint newPaint =
JAttr.createPaint(shape.getBounds(), getBackground());
g.setPaint(newPaint);
g.fill(shape);
g.setPaint(oldPaint);
}
COM: <s> paints the background with a given shape </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.