__key__ stringlengths 16 21 | __url__ stringclasses 1
value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/14168611 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CustomerLocal getCustomer(Integer customerId) {
Context context = null;
CustomerLocal customer = null;
try {
context = new InitialContext();
CustomerLocalHome customerHome = (CustomerLocalHome) context
.lookup(CustomerLocalHome.JNDI_NAME);
customer = customerHome.findByPrimaryKey(customerId);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
context.close();
} catch (NamingException e) {
e.printStackTrace();
}
}
return customer;
}
COM: <s> get a specific customer via their unique id </s>
|
funcom_train/8346786 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Scroll getScroll() {
if (dom == XDOM.getBody() || dom == XDOM.getDocument()) {
return new Scroll(XDOM.getBodyScrollLeft(), XDOM.getBodyScrollTop());
} else {
return new Scroll(getScrollLeft(), getScrollTop());
}
}
COM: <s> returns the body elements current scroll position </s>
|
funcom_train/16627493 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getSectionForTool(String T) {
int i;
for (i = 0; i < _tb.size(); i++) {
int j;
toolbarSection sec = _tb.get(i);
for (j = 0; j < sec.size()
&& (sec.getName(j) == null || !sec.getName(j).equals(T)); j++)
;
if (j < sec.size()) {
return sec.name();
}
}
return null;
}
COM: <s> returns the section for a tool t or null if tool doesnt exists </s>
|
funcom_train/23704047 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSelectionMode(int mode) throws IllegalArgumentException {
if (mode != SINGLE_SELECTION && mode != MULTIPLE_SELECTION &&
mode != WEEK_SELECTION && mode != NO_SELECTION) {
throw new IllegalArgumentException(mode +
" is not a valid selection mode");
}
_selectionMode = mode;
}
COM: <s> set the selection mode for this jxmonth view </s>
|
funcom_train/42644342 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void componentResized(ComponentEvent e) {
Object src = e.getSource();
if (src == null)
return;
// we need to update the document view, if fit width of fit height is
// selected we need to adjust the zoom level appropriately.
if (src == documentViewScrollPane) {
setFitMode(getFitMode());
}
}
COM: <s> swing controller takes awt swing events and maps them to its own events </s>
|
funcom_train/46837584 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JCheckBox getJCheckSave() {
if (jCheckSave == null) {
jCheckSave = new JCheckBox();
jCheckSave.setBounds(new Rectangle(13, 23, 115, 20));
jCheckSave.setText(EBIPGFactory.getLANG("EBI_LANG_SAVE"));
}
return jCheckSave;
}
COM: <s> this method initializes j check save </s>
|
funcom_train/44710299 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Node getCurrentCell() {
Node cell = m_currentCell;
NodeList nl = cell.getChildNodes();
for (int i = 0; i < nl.getLength(); i++) {
// return the first Element child of the current cell
if (nl.item(i) instanceof Element) {
return nl.item(i);
}
}
return null;
}
COM: <s> returns the contents of current list cell </s>
|
funcom_train/46394863 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Document wrapHTMLtoXHTML() throws IOException{
Document doc = null;
Tidy tidy = new Tidy(); // obtain a new Tidy instance
tidy.setQuiet(true);
tidy.setXHTML(true); // set desired config options using tidy setters
tidy.setAltText("none");
tidy.setOnlyErrors(true);
tidy.setShowWarnings(false);
tidy.setInputEncoding("utf-8");
doc = tidy.parseDOM(url.openStream(), null);
return doc;
}
COM: <s> get url html source and convert it to xhtml </s>
|
funcom_train/10805101 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testChangeValue() {
if (JavaVersions.VERSION >= 5)
return;
Object held = new Integer(1);
assertTrue(_coll.remove(held));
assertTrue(_coll.add(held));
System.gc();
System.gc();
// run a mutator to clear expired references
_coll.add("foo");
assertTrue(_coll.contains(held));
}
COM: <s> test that values that have been replaced arent expired </s>
|
funcom_train/22278297 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public DragDestination acceptsDrag(DragSession session, int x, int y) {
String type = session.dataType();
if (isEditable() && hasSelection() &&
(Color.COLOR_TYPE.equals(type) ||
Image.IMAGE_TYPE.equals(type))) {
return this;
} else {
return null;
}
}
COM: <s> overridden to let text views accepts drags of colors and images </s>
|
funcom_train/48552959 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void renderAndSend(){
LoadBalancer lb = new LoadBalancer(1,1);
lb.setPieces(pieces);
int[][] segments = lb.getUniformSegments(threads);
rt = new RayTracer(scene, 5);
rt.render(pieces, segments, threads, pw);
}
COM: <s> starts the render job on this node </s>
|
funcom_train/41164669 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void save(CoParagraphTeacher entity) {
EntityManagerHelper.log("saving CoParagraphTeacher 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 paragraph teacher </s>
|
funcom_train/18594241 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Element toXML() {
Element el = new Element(TAG_COMPONENT);
Iterator iter = new TreeMap(attributes).keySet().iterator();
while (iter.hasNext()) {
String key = (String)iter.next();
String value = getAttribute(key);
if (value != null)
el.setAttribute(key, value);
}
return el;
}
COM: <s> generate an xml representation of this object </s>
|
funcom_train/17202943 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean branchIfUnordered() {
switch (value) {
case CMPL_EQUAL:
case CMPL_GREATER:
case CMPG_LESS:
case CMPL_GREATER_EQUAL:
case CMPG_LESS_EQUAL:
return false;
case CMPL_NOT_EQUAL:
case CMPL_LESS:
case CMPG_GREATER_EQUAL:
case CMPG_GREATER:
case CMPL_LESS_EQUAL:
return true;
default:
throw new OptimizingCompilerException("invalid condition " + this);
}
}
COM: <s> will this floating point compare branch if the results are </s>
|
funcom_train/3595659 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double alphaNominal(DistanceMetric dist){
double denominator = Dchance(dist);
if (denominator==0.0){
System.out.println("WARNING: CoincidenceMatrix.alphaNominal could not be computed since Dchance equals 0.0. returned 0.0 instead");
return 0.0;
}
double dobs = Dobserved(dist);
double alpha = 1.0 - ( dobs /denominator);
//System.out.println("D_OBS :"+ dobs);
//System.out.println("D_CHA :"+ denominator);
//System.out.println("alpha :"+alpha);
return alpha;
}
COM: <s> computes alpha for nominal values using the given distance metric br </s>
|
funcom_train/32961126 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void verifyUserPassword(char[] password) {
String principal = null;
try {
principal = (String)TolvenSessionWrapperFactory.getInstance().getPrincipal();
this.ldapBean.verifyPassword(principal, password);
} catch (Exception e) {
throw new RuntimeException("Error changing password for " + principal, e );
}
}
COM: <s> remote friendly method to verify the users password </s>
|
funcom_train/13276072 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getNodeText(JTree tree, Object node) {
TreeCellRenderer renderer = tree.getCellRenderer();
Component childLabel = renderer.
getTreeCellRendererComponent(tree, node,
false, true, false, 0, false);
return ((JLabel)childLabel).getText();
}
COM: <s> returns the label text of code node code in code tree code </s>
|
funcom_train/18953299 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setFormat(final HTMLFormat formatParam) {
if (logger.isDebugEnabled()) {
logger.debug("setFormat(HTMLFormat formatParam = " + formatParam
+ ") - start");
}
this.format = formatParam;
if (logger.isDebugEnabled()) {
logger.debug("setFormat(HTMLFormat) - end");
}
}
COM: <s> p set the </s>
|
funcom_train/26085919 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createCancelButton(Composite parent) {
this.cancelButton = new Button(parent, SWT.NONE);
this.cancelButton.setText(Messages.CANCEL);
this.cancelButton.setImage(ArchieActivator.getImage(ArchieActivator.IMG_CANCEL));
this.cancelButton.addListener(SWT.MouseDown, new Listener() {
public void handleEvent(Event event) {
ProviderManager manager = ProviderManager.getInstance();
if (manager.hasProvider()) {
manager.getProvider().cancel();
}
}
});
}
COM: <s> create the cancel button </s>
|
funcom_train/47366309 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getButVerificaSoS() {
if (ButVerificaSoS == null) {
ButVerificaSoS = new JButton();
ButVerificaSoS.setBounds(new Rectangle(15, 105, 361, 31));
ButVerificaSoS.setText("Verifica una formula tramite le regole SOS");
ButVerificaSoS.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
buttonAction(4);
}
});
}
return ButVerificaSoS;
}
COM: <s> this method initializes but verifica so s </s>
|
funcom_train/13273261 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Rectangle2D getItemsBounds(Graphics g, Collection<? extends Selectable> items) {
Rectangle2D itemsBounds = null;
for (Selectable item : items) {
if (itemsBounds == null) {
itemsBounds = getItemBounds(g, item);
} else {
itemsBounds.add(getItemBounds(g, item));
}
}
return itemsBounds;
}
COM: <s> returns the bounds of the given collection of code items code </s>
|
funcom_train/46825055 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void receiveObject (XMLElement message) {
String messageType = message.getName();
if (messageType.equals (CommOctagonsMakeMove.XML_NAME)) {
// Decode the message into a move
CommOctagonsMakeMove theMove = new CommOctagonsMakeMove (message);
// Make the move
model.make_play(theMove.getLoc(),theMove.getPlayerId());
}
}
COM: <s> handle receiving objects from the server </s>
|
funcom_train/33313824 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public BufferedImage rotate(File origFile, File bckFile, int rotation) {
BufferedImage origImage = AwtImageUtil.readImage(origFile);
BufferedImage newImage = AwtImageUtil.rotate(origImage, rotation);
ImageManipUtil.saveBackup(origFile, bckFile);
AwtImageUtil.store(newImage, origFile, 75); // Quality arg doesn't matter since this isn't jpeg
return newImage;
}
COM: <s> rotate and store the file </s>
|
funcom_train/14607438 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getRowCount() throws Exception {
Number rowCount = (Number) getContext().getAttribute(getPath() + ".rowCount");
if (rowCount == null)
throw new Exception("Adapter.getRowCount() must be called after AdapterTable.getPageRows()");
return rowCount.intValue();
}
COM: <s> returns number of rows of data </s>
|
funcom_train/2008160 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected State toDomainFromDataMap(StateDm stateDm, TypeHandlerTransaction transaction) throws Exception {
State state = getStatePrototypeFactory().createPrototype(stateDm.getId().toString());
state.setAbbreviation(stateDm.getAbbreviation());
state.setName(stateDm.getName());
return state;
}
COM: <s> copy attributes from data layer to domain object </s>
|
funcom_train/46056966 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean matches(Publisher p, SubscriptionContext subscriptionContext) {
// if the publisher has been deleted in the meantime, return no match
if (!isPublisherValid(p)) return false;
boolean ok = (p.getResName().equals(subscriptionContext.getResName()) && p.getResId().equals(subscriptionContext.getResId()) && p
.getSubidentifier().equals(subscriptionContext.getSubidentifier()));
return ok;
}
COM: <s> no match if a not the same publisher b a deleted publisher </s>
|
funcom_train/38284010 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void rcpt(Address address) throws IOException, SMTPException {
sendCommand("RCPT", new String[] { "TO:" + address.getCanonicalMailAddress() });
SMTPResponse response = in.readSingleLineResponse();
if( response.isERR() ) throw new SMTPException(response.getMessage());
}
COM: <s> sends a rcpt command which specifies a recipient of the mail started by </s>
|
funcom_train/37072297 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void removeAddArticleFromSession (HttpServletRequest request ){
HttpSession session = request.getSession(false);
if (session == null) {
throw new RuntimeException("User session time out");
}
String session_key = user_id+"_"+request.getParameter("sourcename")+"_addarticle";
if ( session.getAttribute( session_key ) != null ){
session.removeAttribute(session_key );
}
}
COM: <s> remove add article infor from user session </s>
|
funcom_train/17535957 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getPrezzo(){
Tag t = getFirstTag("904");
if(t==null)return "";
Field f = t.getField("p");
if(f==null)return "";
String r = f.getContent();
if(r==null)r ="";
return r;
}
COM: <s> use unimarc get availibility and or price </s>
|
funcom_train/21850354 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setValue(Object prop) {
if (prop instanceof ListItemProperty) {
ListItemProperty lip = (ListItemProperty) prop;
m_label = lip.m_label;
if (m_icon_property == null)
m_icon_property = new IconProperty();
m_icon_property.setValue(lip.m_icon_property);
} else if (prop instanceof String) {
m_icon_property.setValue(null);
m_label = (String) prop;
}
}
COM: <s> sets this property to that of another list item property or string object </s>
|
funcom_train/40945234 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public interface ReadOnlyStatusChangeNotifier {
/**
* Registers a new read-only status change listener for this Property.
*
* @param listener
* the new Listener to be registered
*/
public void addListener(Property.ReadOnlyStatusChangeListener listener);
/**
* Removes a previously registered read-only status change listener.
*
* @param listener
* listener to be removed
*/
public void removeListener(
Property.ReadOnlyStatusChangeListener listener);
}
COM: <s> the interface for adding and removing </s>
|
funcom_train/5893467 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void alert(String m) {
// brought from GenericAutowireComposer
try {
if (_alert == null) {
final Class<?> mboxcls =
Classes.forNameByThread("org.zkoss.zul.Messagebox");
_alert = mboxcls.getMethod("show", new Class[] {String.class});
}
_alert.invoke(null, m);
} catch (InvocationTargetException e) {
throw UiException.Aide.wrap(e);
} catch (Exception e) {
//ignore
}
}
COM: <s> shortcut to call messagebox </s>
|
funcom_train/3474788 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public WindowOpened (Environment env, StructureElement[] children) {
super(env, children);
for (int i = 0; i < children.length; i++) {
if (children[i] instanceof WindowEventRecordable) {
this.windowName = ((WindowEventRecordable) children[i]).getWindowName ();
this.windowTitle = ((WindowEventRecordable) children[i]).getWindowTitle ();
break;
}
}
}
COM: <s> creates a new window opened structure element </s>
|
funcom_train/3294309 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Vector reverse(Vector v) {
Vector rev = new Vector();
int index= 0;
int size = v.size();
for (int i=1;i<=size;i++) {
index = size - i; // index=size - offset
rev.addElement(v.elementAt(index));
}
return rev;
}
COM: <s> reverses the elementorder in a vector </s>
|
funcom_train/21116867 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGosterimListProgram() throws Exception {
System.out.println("gosterimListProgram");
int programId = 12;
GosterimDao instance = GosterimDao.getInstance();
List result = instance.gosterimListProgram(programId);
for (Object elem : result) {
System.out.println(elem);
}
}
COM: <s> test of gosterim list program method of class persistence </s>
|
funcom_train/46281706 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void handleRequest(IQ request) throws OmmsException {
try {
OmmsAction action = createAction(request);
action.setId(request.getID());
if ( !ommsManager().handleAction(action) ) {
throw new OmmsException(ErrorCondition.internal_server_error, "Unable to handle request");
}
} catch ( PermissionException e) {
e.printStackTrace();
throw new OmmsException(e);
}
}
COM: <s> takes care of the request </s>
|
funcom_train/10748737 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testInvocationTargetExceptionCause() throws Exception {
try {
this.getClass().getMethod("doFail").invoke(null);
} catch (InvocationTargetException e) {
Throwable cause = e.getCause();
assertTrue("Unexpected cause: " + cause,
cause instanceof MyException);
}
}
COM: <s> tests that correct cause of reflection error is provided </s>
|
funcom_train/38389068 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void fillTypesViewerContextMenu(PenumbraHierarchyViewer viewer, IMenuManager menu) {
JavaPlugin.createStandardGroups(menu);
menu.appendToGroup(IContextMenuConstants.GROUP_SHOW, new Separator(GROUP_FOCUS));
// viewer entries
viewer.contributeToContextMenu(menu);
fActionGroups.setContext(new ActionContext(getSite().getSelectionProvider().getSelection()));
fActionGroups.fillContextMenu(menu);
fActionGroups.setContext(null);
}
COM: <s> creates the context menu for the hierarchy viewers </s>
|
funcom_train/46764831 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenuItem getOptionsMenuItem() {
if (optionsMenuItem == null) {
optionsMenuItem = new JMenuItem();
optionsMenuItem.setText(Resources.getString("menu_extras_properties"));
optionsMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
createChatWindowPropertyDialog();
}
});
}
return optionsMenuItem;
}
COM: <s> this method initializes options menu item </s>
|
funcom_train/22046438 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object generateInstance(Class<?> type) throws TypeNotSupportedException {
Object r = null;
// preconditions
if (type == null) {
throw new IllegalArgumentException("Input parameter type cannot be null.");
}
if (checkSupport(type)) {
long ts = generateDateMillis();
r = generate(type, ts);
return r;
} else {
throw new TypeNotSupportedException(type.getName(), "generateInstance");
}
}
COM: <s> create an instance for the given class </s>
|
funcom_train/10929669 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected VersionedDocument getVersionedDocumentOfObjectId(StoredObject so) {
VersionedDocument verDoc;
if (so instanceof DocumentVersion) {
// get document the version is contained in to c
verDoc = ((DocumentVersion) so).getParentDocument();
} else {
verDoc = (VersionedDocument) so;
}
return verDoc;
}
COM: <s> we allow checkin cancel checkout operations on a single version as well </s>
|
funcom_train/18071842 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getJmapButton() {
if (jmapButton == null) {
jmapButton = new JButton();
jmapButton.setText("GMap");
jmapButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
setGMapMode(!gmapMode);
}
});
}
return jmapButton;
}
COM: <s> this method initializes jmap button </s>
|
funcom_train/37074842 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean descendsFrom(SeqFeatureI sf) {
if (this == sf) return true;
// Does the top level feature have a null ref?
// If we are at the top then we failed to find ancestor equality
if (getRefFeature() == null) return false;
return getRefFeature().descendsFrom(sf);
}
COM: <s> this is the opposite of contains </s>
|
funcom_train/22606028 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String autodetectDots() {
autodetectedDotLocation = null;
String paths = System.getenv("PATH");
for (String path : paths.split(File.pathSeparator)) {
File directory = new File(path);
File[] matchingFiles = directory.listFiles(new ExecutableFinder(DOT_FILE_NAME));
if (matchingFiles != null && matchingFiles.length > 0) {
File found = matchingFiles[0];
autodetectedDotLocation = found.getAbsolutePath();
break;
}
}
return autodetectedDotLocation;
}
COM: <s> this routine browses through the users path looking for dot executables </s>
|
funcom_train/48147162 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getCount(int x, int n){
if (x < 1) x = 1; else if (x > 6) x = 6;
if (n < 0) n = 0; else if (n > dieCount) n = dieCount;
int count = 0;
for (int i = 0; i < n; i++) if (die[i].getValue() == x) count++;
return count;
}
COM: <s> this method returns the count for score x among the first n dice </s>
|
funcom_train/46261571 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void drawOval(int x, int y, int width, int height) {
int ovalX = x;
int ovalY = y;
int ovalWidth = width;
int ovalHeight = height;
if (width < 0) {
ovalX = x + width;
ovalWidth = -width;
}
if (height < 0) {
ovalY = y + height;
ovalHeight = -height;
}
Graphics iBGraphics = canvas.getImageBufferGraphics();
iBGraphics.drawOval(ovalX, ovalY, ovalWidth, ovalHeight);
canvas.repaint();
}
COM: <s> draw an oval at position x y with supplied height and width </s>
|
funcom_train/3704370 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected List getByLatLon(String[] strFields, double lat, double lon) {
List listFields = Arrays.asList(strFields);
String strField = MiniGisLib.getHighestPrecisionField(listFields);
return (getByLatLon(strField, lat, lon));
} // of method
COM: <s> get all we can about the highest precision field in the </s>
|
funcom_train/44308246 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean createRule(Concept subConcept,Concept superConcept) throws KAONException {
if (!subConcept.equals(superConcept) && !subConcept.isSubConceptOf(superConcept)) {
m_associationRules.getAssociationRule(subConcept,superConcept);
return true;
}
else
return false;
}
COM: <s> creates a rule between two concepts if this is possibile </s>
|
funcom_train/28345656 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Element getDownstreamDrift() {
double len=getEffLength()*0.5;
double position=getPosition();
if(Math.abs(len) < Lattice.EPS) {
return new Marker(position);
} else {
position=position+len*0.5;
return new Drift(position,len);
}
}
COM: <s> return the downstream drift space of a slim element </s>
|
funcom_train/11085746 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void unmarshal(OutputStream os, Source content) throws TransformerException, IOException {
SourceTransformer transform = new SourceTransformer();
XStream xstream = new XStream(new DomDriver());
String result = transform.toString(content);
logger.debug("Remote invocation result: {}", result);
Object obj = xstream.fromXML(result);
ObjectOutputStream oos = new ObjectOutputStream(os);
oos.writeObject(obj);
}
COM: <s> unmarshal the xml content to the specified output stream </s>
|
funcom_train/21435712 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setRingStart(int position) throws MonosaccharideException {
if(isCheckPositionsOnTheFly()) {
if(position < -1 || position > this.getSize()) {
throw new MonosaccharideException("Ring start out of range: " + position);
}
}
this.getBasetype().setRingStart(position);
}
COM: <s> set the ring start carbonyl position of the monosaccharide </s>
|
funcom_train/27824404 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected JPanel getMessagePanel(String messageID) {
JPanel panel=new JPanel(new BorderLayout());
JLabel label=m_oimodelerViewable.getModule().getAppDriver().getLocalizationManager().getLabel(messageID);
label.setHorizontalAlignment(JLabel.CENTER);
panel.add(label,BorderLayout.CENTER);
return panel;
}
COM: <s> creates the panel with given message </s>
|
funcom_train/42181140 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setIconYaw(float iconYaw) {
if (iconYaw != this.iconYaw) {
float oldIconYaw = this.iconYaw;
this.iconYaw = iconYaw;
this.propertyChangeSupport.firePropertyChange(Property.ICON_YAW.toString(), oldIconYaw, iconYaw);
}
}
COM: <s> sets the yaw angle of the piece icon </s>
|
funcom_train/44223167 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deleteAllGroup()throws Exception{
Node firstChild = null;
if(this.groupEntryNode == null){
return;
}
while( (firstChild = this.groupEntryNode.getFirstChild()) != null ){
this.groupEntryNode.removeChild(firstChild);
}
this.renewUI();
}
COM: <s> delete all group nodes from the reference dom tree </s>
|
funcom_train/1724564 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private PointsToAliasContext putLiteral(LoadInstruction instr, Object literal, PointsToAliasContext value) {
ObjectLabel label = knownLiterals.get(literal);
PointsToAliasContext newValue = value.clone();
if (label == null) { //we haven't done this literal yet
label = new LiteralLabel(literal, instr.getTarget().resolveType());
knownLiterals.put(literal, label);
newValue.addLabel(label);
}
newValue.addPointsTo(instr.getTarget(), label);
return newValue;
}
COM: <s> handles literal labels </s>
|
funcom_train/2577530 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setBackgroundImage(Image image) {
if (this.backgroundImage != null) {
if (!this.backgroundImage.equals(image)) {
this.backgroundImage = image;
fireChartChanged();
}
}
else {
if (image != null) {
this.backgroundImage = image;
fireChartChanged();
}
}
}
COM: <s> sets the background image for the chart and sends a </s>
|
funcom_train/19273650 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void updateSelection() {
int newSelection = this.spinner.getSelection();
if (((newSelection == 0) && (this.selection == this.spinner.getMaximum()))
|| (this.selection == 0) && (newSelection == this.spinner.getMaximum())) {
this.spinner.setSelection(this.selection);
} else {
setSelection(newSelection);
}
}
COM: <s> this method updates the selection made via the spinner </s>
|
funcom_train/15715062 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void stop() {
setStatus(PresenceProtocol.OFFLINE);
mProcessor.sendStatusUpdate(getStatus());
sc.stopIt();
sc.interrupt();
queue.stopIt();
wCon.disConnect();
start = false;
memCollection.clear(); //.removeAll();
presService = null;
if (LOG.isEnabledFor(Level.INFO)) {
LOG.info(" PresenceService stoped ");
}
}
COM: <s> stop the service </s>
|
funcom_train/32353603 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected GPXEmail parseEmail(final XMLNode node) {
if (node != null) {
final String nodeName = node.getName();
if (nodeName.equals(TAGNAME_EMAIL)) {
final String id = node.getNodeSubNodeValue(TAGNAME_ID);
final String domain = node.getNodeSubNodeValue(TAGNAME_DOMAIN);
final GPXEmail email = new GPXEmail(id, domain);
return email;
}
}
return null;
}
COM: <s> parse the email tag </s>
|
funcom_train/33143118 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isAcceptedValue(String fieldValue) {
boolean okay;
fieldValue = fieldValue.trim();
okay = false;
for (int value = 0; value < getNumAcceptedValues(); ++value) {
if (fieldValue.equals(getAcceptedValue(value).getValue())) {
okay = true;
break;
}
}
return okay;
}
COM: <s> checks the value against the list of accepted values </s>
|
funcom_train/50747252 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Map getSentMessages() throws ServiceException, RemoteException {
Call call = getCall();
log.debug("Getting the list of messages sent by the engine");
call.setOperationName("getSentMessages");
Map result = (Map) call.invoke(new Object[]{});
log.debug("Got the list of messages sent by the engine");
return result;
}
COM: <s> returns all messages that have been sent by the engine to other services </s>
|
funcom_train/44876143 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testVerifyNonJarFile() {
ClassStore classStore = new ZipFileClassStore( new File(AbstractClassPathHelperTest.TEST_LIB + ".project"), sessionCache);
try {
classStore.verifyClassStore();
fail("Class store verified with non existant zip file.");
}
catch (Exception e) {
// expected.
}
}
COM: <s> test that verfies that a file that is not a properly formatted </s>
|
funcom_train/28465822 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public IQueryTokenizer getQueryTokenizer() {
if (tokenizer == null) {
// No tokenizer has been set by any installed plugin. Go ahead and
// give the default tokenizer.
tokenizer = new QueryTokenizer(_props.getSQLStatementSeparator(),
_props.getStartOfLineComment(),
_props.getRemoveMultiLineComment());
}
return tokenizer;
}
COM: <s> returns the iquery tokenizer implementation to use for tokenizing scripts </s>
|
funcom_train/4494163 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createAnnotationStore() throws CompilerException {
Map<String,Map<String,String>> annotations = new HashMap<String,Map<String,String>>();
// local annotations
for (KnowledgeElement e:this.kb.getElements()) {
annotations.put(e.getId(),e.getAnnotations());
}
// global annotations
annotations.put(GLOBAL_ANNOTATION_KEY,kb.getAnnotations());
XMLEncoder e = new XMLEncoder(location.getResourceOut(packageName,ANNOTATION_STORE));
e.writeObject(annotations);
e.close();
}
COM: <s> create the annotations store i </s>
|
funcom_train/30190806 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean close( AWTEvent e ) {
TNVUIManager.clearUI();
this.setTitle( "TNV" );
try {
TNVDbUtil.getInstance().closeConnection();
}
catch ( SQLException ex ) {
TNVErrorDialog.createTNVErrorDialog(this.getClass(), "SQL error removing tables", ex);
return false;
}
if ( ! destroyDB() )
return false;
return true;
}
COM: <s> close the current data set </s>
|
funcom_train/49199329 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addLinkedModulePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ModuleElement_linkedModule_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ModuleElement_linkedModule_feature", "_UI_ModuleElement_type"),
VspacemapsPackage.Literals.MODULE_ELEMENT__LINKED_MODULE,
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the linked module feature </s>
|
funcom_train/15884915 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run() {
try {
while (true) {
if (protocolFactory != null) {
Protocol protocol = protocolFactory.createProtocol();
new ProtocolThread(connectionServer.accept(protocol)).start();
} else {
throw new ProtocolException("protocol factory is not set");
}
}
} catch (ProtocolException e1) {
e1.printStackTrace();
return;
}
}
COM: <s> the run method that continuosly listens for incoming connections </s>
|
funcom_train/20238560 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public RatioGroupCollection getITraqRatioGroupCollection(Flamable aFlamable, double aThreshold){
Mdf_iTraqReader lReader = new Mdf_iTraqReader(iOriginalDatFile, iMergeFile, aFlamable);
lReader.setThreshold(aThreshold);
return lReader.getRatioGroupCollection();
}
COM: <s> getter for the ratio group collection </s>
|
funcom_train/44136886 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void notifyStartRecording() {
OSMSoundEvent evt = new OSMSoundEvent(this);
for(int i = 0;i < m_ClientList.size();i++) {
OSMSoundListener lster = (OSMSoundListener)m_ClientList.get(i);
lster.onStartRecording(evt);
}
}
COM: <s> to notify all the osmsound listener that a sound is started recording </s>
|
funcom_train/17463888 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addProduct() throws Throwable {
KernelController kernelController = kernel.getController();
ControllerContext controllerContext =
kernelController.getInstalledContext(STOCK_SERVICE);
StockService stockService = (StockService) controllerContext.getTarget();
Product product = new Product();
product.setName("Alcohol x 250 ml");
product.setDescription("Alcohol x 250 ml for medical purposes.");
product.setPrice(3);
stockService.addNewProduct(product, 20);
}
COM: <s> add a product </s>
|
funcom_train/33281292 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String jsxGet_href() {
final HtmlAnchor anchor = (HtmlAnchor) getDomNodeOrDie();
final String hrefAttr = anchor.getHrefAttribute();
if (hrefAttr == DomElement.ATTRIBUTE_NOT_DEFINED) {
return "";
}
try {
return getUrl().toString();
}
catch (final MalformedURLException e) {
return hrefAttr;
}
}
COM: <s> returns the value of this links tt href tt property </s>
|
funcom_train/42259566 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean atItem(final int itemID, final String txt) {
if (!methods.isLoggedIn() || !isOpen()) {
return false;
}
final int[] itemArray = getItemArray();
for (int off = 0; off < itemArray.length; off++) {
if (itemArray[off] == itemID) {
methods.clickMouse(getItemPoint(off), 5, 5, false);
return methods.atMenu(txt);
}
}
return false;
}
COM: <s> performs a given action on the specified item id </s>
|
funcom_train/37822227 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void removePartition() {
if (partitionList.getSelectedValues() != null) {
for (Object o : partitionList.getSelectedValues()) {
Partition p = (Partition) o;
p.remove();
observations.remove(p);
}
PartitionListModel lm = ((PartitionListModel) partitionList
.getModel());
lm.setElements(observations);
((PartitionTableModel) table.getModel()).fireTableDataChanged();
bFill.setEnabled(true);
bNew.setEnabled(true);
}
}
COM: <s> removes the selected in the list partitions from the current </s>
|
funcom_train/41997860 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void runMultiple(int cnt) {
try {
log.debug("**** Running runMultiple().. " + cnt);
PoolWorker[] poolArr = new PoolWorker[cnt];
for (int i = 0; i < cnt; i++) {
poolArr[i] = new PoolWorker(this.getPool(), i);
new Thread(poolArr[i]).start();
}
log.debug("*** Finished runMultiple ");
} catch (Exception e) {
log.error("", e);
}
}
COM: <s> run multiple simulates multiple threads executing the sample work task </s>
|
funcom_train/8554763 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testMain() {
System.out.println("main from linux");
String[] args = new String[2];
args[0] = "139"; // iOntoID
args[1] = "/mnt/win_e/all/projects/java/edoc.addon/for_101.text_only/"; // sPath
Relevances.main(args);
}
COM: <s> test of main method of class dirindex </s>
|
funcom_train/34527044 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setParameter(String parameterName, Object parameterValue) {
Map<String,Object> parameters = getParameters(parameterName);
if (parameters == null) {
paramStack.add(parameters = new HashMap<String,Object>());
}
parameters.put(parameterName, parameterValue);
}
COM: <s> sets the value of the specified parameter </s>
|
funcom_train/37836556 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Direction calculateZoneChangeDirection(Point2D point) {
StaticGameLayers layers = StendhalClient.get().getStaticGameLayers();
double x = point.getX();
double y = point.getY();
double width = layers.getWidth();
double height = layers.getHeight();
if (x < 0.333) {
return Direction.LEFT;
}
if (x > width - 0.333) {
return Direction.RIGHT;
}
if (y < 0.333) {
return Direction.UP;
}
if (y > height - 0.4) {
return Direction.DOWN;
}
return null;
}
COM: <s> calculates whether the click was close enough to a zone border to trigger </s>
|
funcom_train/41807194 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: static public void showWarning(String title, String message, Exception e) {
if (title == null) title = "Warning";
if (commandLine) {
System.out.println(title + ": " + message);
} else {
JOptionPane.showMessageDialog(new Frame(), message, title,
JOptionPane.WARNING_MESSAGE);
}
if (e != null) e.printStackTrace();
}
COM: <s> non fatal error message with optional stack trace side dish </s>
|
funcom_train/8484883 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ATClosure magic_select(ATObject receiver, ATSymbol selector) throws InterpreterException {
//return super.meta_select(receiver, selector);
if (selector.isAssignmentSymbol()) {
return super.impl_selectMutator(receiver, selector.asAssignmentSymbol());
} else {
return super.impl_selectAccessor(receiver, selector);
}
}
COM: <s> tt select tt deviates from the default super calling behaviour because </s>
|
funcom_train/25924090 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addAllLayers(HashMap<String, Layer> newLayers) {
for(Layer l : newLayers.values()){
l.setParentCategory(this);
}
//add all to layerHashMap, but merge if some already exist under its key
for (String s : newLayers.keySet()){
if(layerHashMap.containsKey(s)){
Layer l = layerHashMap.get(s);
l.getItems().addAll(newLayers.get(s).getItems());
}else{
layerHashMap.put(s, newLayers.get(s));
}
}
}
COM: <s> adds all layers to this category </s>
|
funcom_train/27823610 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addURL(String url,String parentURL,boolean decrement) {
URLStruct us=(URLStruct)m_urlMap.get(parentURL);
int depth=us.getDepth();
if (decrement)
depth--;
if (depth>=0)
addURL(url,parentURL,depth);
}
COM: <s> this method is used to add to the urllist if </s>
|
funcom_train/34637667 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void updateLatestRevision(Project project) {
int maxRevision = 0;
for (Fragment frag : repository.getFragments(project, FragmentFilter.CODEFILE_FILTER)) {
for (int rev : getRevisionIndexes((CodeFile)frag)) {
if (rev > maxRevision) {
maxRevision = rev;
}
}
}
latestRevisionMap.put(project.getUUID(), maxRevision);
}
COM: <s> scans through all revisions from all code files of a project to find </s>
|
funcom_train/27864480 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void showFirstOrderPanWidget(int jpx, int jpy){
fopw_x = jpx - FIRST_ORDER_PAN_WIDGET.getWidth(null)/2;
fopw_y = jpy - FIRST_ORDER_PAN_WIDGET.getHeight(null)/2;
sfopw = true;
parent.repaint();
}
COM: <s> show the icon representing first order of control panning </s>
|
funcom_train/9644594 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeTarget() {
UndoableSubgroupEdit undo = new UndoableSubgroupEdit(
"vikamine.currentSG.undoable.removeTarget");
getSubgroup().setTarget(null);
getSubgroup().setSGDescription(new SGDescription());
recreateSubgroupStatistics();
root.setUserObject(null);
root.removeAllChildren();
fireTreeStructureChanged(this, new Object[] { getRoot() }, null, null);
getEventForwarder().fireStructureChangedEvent();
undo.storeNewSG();
fireUndoableEditEvent(undo);
}
COM: <s> removes the target </s>
|
funcom_train/26335550 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void checkResponse( UserInteractDialog dialog ) {
if( !dialog.isCancelled() && dialog.getResponseChar() == 'y' ) {
GameCharacter player = this.engine.getWorld().getPlayer();
MoveDirectionGameAction move = new MoveDirectionGameAction(
this.engine, player, this.dX, this.dY, this.moveUntil );
player.doGameAction( move );
}
}
COM: <s> response listener for hitting a friendly npc </s>
|
funcom_train/4833789 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void initEntertainments(){
for(int auction = TACAgent.MIN_ENTERTAINMENT; auction <= TACAgent.MAX_ENTERTAINMENT; auction++)
{
// initialize auction
entAuctionList.add(new EntertainmentAuction(auction));
// initialize owned tickets
int own = owner.getAgent().getOwn(auction);
for(int i = 0; i < own; i++){
ownedEntTickets.add(new EntertainmentInfo(TACAgent.getAuctionType(auction)+2,
TACAgent.getAuctionDay(auction),true));
}
}
}
COM: <s> create instances for existing tickets and for entertainment auction instances </s>
|
funcom_train/8291335 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void dispatch(Peer sender, MethodExecution execution){
Object object = idToObject.get(execution.getObjectId());
if(object == null){
logger.warning("no object found: " + execution.getObjectId());
return;
}
dispatching.set(true);
currentSender.set(sender);
try{
execution.execute(object);
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
} finally{
currentSender.set(null);
dispatching.set(false);
}
}
COM: <s> dispatche method execution </s>
|
funcom_train/6343825 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void initNew() {
try {
this.isNew = true;
sessInfo = new SessionInfo();
session_id = SessionIdGenerator.createSessionId();
// key, group, value
sessCache.putG( session_id, session_id, sessInfo );
} catch( Exception e ) {}
log.info( "createUserSession " + this);
}
COM: <s> initialization for a new session </s>
|
funcom_train/7518281 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ProcessoDados update(ProcessoDados entity) {
EntityManagerHelper.log("updating ProcessoDados instance", Level.INFO,
null);
try {
ProcessoDados result = getEntityManager().merge(entity);
EntityManagerHelper.log("update successful", Level.INFO, null);
return result;
} catch (RuntimeException re) {
EntityManagerHelper.log("update failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> persist a previously saved processo dados entity and return it or a copy </s>
|
funcom_train/23900040 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void handleContainerBrowse() {
final ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), ResourcesPlugin.getWorkspace()
.getRoot(), false, "Select Test File Folder");
dialog.showClosedProjects(false);
if (dialog.open() == Window.OK) {
final Object[] result = dialog.getResult();
if (result.length == 1)
fContainer.setText(((Path) result[0]).toOSString());
}
}
COM: <s> uses the standard container selection dialog to choose the new value for </s>
|
funcom_train/17028512 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int countFindAllGroupNames() throws MetadataAccessException {
// The count to return
int count = 0;
// Create the query and run it
try {
Long integerCount = (Long) getSession().createQuery(
"select count(distinct userGroup.groupName) from "
+ "UserGroup userGroup").uniqueResult();
if (integerCount != null)
count = integerCount.intValue();
} catch (HibernateException e) {
throw new MetadataAccessException(e);
}
// Return the count
return count;
}
COM: <s> this method returns a count of all the group names available </s>
|
funcom_train/18028800 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetProperties_QDataSet_Map() {
System.out.println("getProperties");
QDataSet ds = null;
Map def = null;
Map expResult = null;
Map result = DataSetUtil.getProperties(ds, def);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
COM: <s> test of get properties method of class data set util </s>
|
funcom_train/11651794 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean replaceExtension(String text) {
int pt = text.indexOf(this.OLDEXT);
if (pt > -1) {
int extsize = this.OLDEXT.length();
this.NEWFILE = text.substring(0, pt) + this.NEWEXT + text.substring(pt + extsize);
return true;
} else {
return false;
}
}
COM: <s> method uses index of to replace the old extension with the new extesion </s>
|
funcom_train/1441398 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public User leave(String id) throws ApiException {
assert (id != null);
requireCredentials();
String url = String.format(
"http://twitter.com/notifications/leave/%s.json", id);
PostMethod method = new PostMethod(url);
String response = execute(method);
return User.newFromJsonString(response);
}
COM: <s> disables notifications for updates from the specified user to the </s>
|
funcom_train/16522023 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addCasMap(int first, int last) {
// System.out.println("addcas "+first+" :: "+last);
for (int i = first; i < last; i++) {
cas.put((String) table.getXMLValueAt(i, 5), (String) table.getXMLValueAt(i, 6));
}
}
COM: <s> add cas map </s>
|
funcom_train/23703518 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setUpperBoundOfRangeAxis(double bound){
if (bound == 0.0){
plot.getRangeAxis().setAutoRange(true);
}
else {
plot.getRangeAxis().setAutoRange(false);
plot.getRangeAxis().setUpperBound(bound*this.maxCpu);
}
}
COM: <s> set upper bound of range axis </s>
|
funcom_train/32303340 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int score(HCodeElement hce, Set interset) {
assert defUseMap.containsKey(hce);
int provides = ((Set)defUseMap.get(hce)).size();
int prevents = 0;
for(Object interO : interset) {
HCodeElement inter = (HCodeElement) interO;
prevents += ((Set)defUseMap.get(inter)).size();
}
return provides - prevents;
}
COM: <s> the score is the number of tag checks this reference </s>
|
funcom_train/2676247 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getObjectPath(String id, String name) {
// The format of the object id is <type>/<path>/<objectName>
id = id.substring(id.indexOf('/') + 1);
if (id.charAt(0) == '/') {
id = id.substring(1);
}
if (id.lastIndexOf(name) <= 0) {
return id;
}
return id.substring(0, id.lastIndexOf(name)-1);
}
COM: <s> get object path for given id and name </s>
|
funcom_train/41556313 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getMatrixSizeCommand() {
if (matrixSizeCommand == null) {//GEN-END:|30-getter|0|30-preInit
// write pre-init user code here
matrixSizeCommand = new Command("Matrix Size", Command.ITEM, 0);//GEN-LINE:|30-getter|1|30-postInit
// write post-init user code here
}//GEN-BEGIN:|30-getter|2|
return matrixSizeCommand;
}
COM: <s> returns an initiliazed instance of matrix size command component </s>
|
funcom_train/41612100 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public File getFileToUpload() throws MojoExecutionException {
File file = project.getArtifact().getFile();
// Check the validity.
if (file == null || file.isDirectory()) {
throw new MojoExecutionException(
"The packaging for this project did not assign a file to the build artifact");
}
getLog().info("File to upload: " + file.getPath());
return file;
}
COM: <s> gets the file to upload </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.