__key__ stringlengths 16 21 | __url__ stringclasses 1 value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/22783247 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void valueChanged(ListSelectionEvent e) {
if (e.getValueIsAdjusting()) {
return;
}
for (int i = e.getFirstIndex(); i <= e.getLastIndex(); i++) {
WheelListItem<T> item = map.get(i);
if (item != null) {
item.setSelected(selectionModel.isSelectedIndex(i));
}
}
setFocusIndex(selectionModel.getMinSelectionIndex());
}
COM: <s> selected values have changed </s>
|
funcom_train/11016937 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Record cloneViaReserialise() {
// Do it via a re-serialization
// It's a cheat, but it works...
byte[] b = serialize();
RecordInputStream rinp = new RecordInputStream(new ByteArrayInputStream(b));
rinp.nextRecord();
Record[] r = RecordFactory.createRecord(rinp);
if(r.length != 1) {
throw new IllegalStateException("Re-serialised a record to clone it, but got " + r.length + " records back!");
}
return r[0];
}
COM: <s> clone the current record via a call to serialize </s>
|
funcom_train/48103846 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String findUserVoucherList() {
voucher.setUserId(this.getSessionUser().getUserId());
voucher.setDisplay(3);
int maxRow = this.voucherService.findCountBySwdVoucher(voucher);
Page page = new Page(curPage,10,maxRow);
voucherList = this.voucherService.findSwdVoucher(voucher, page, "changeTime Desc");
return "userVoucherList";
}
COM: <s> find users voucher list user by user </s>
|
funcom_train/11727751 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testRemoveBooleanPropertySession() throws Exception {
testNode.setProperty(propertyName1, true);
superuser.save();
testNode.setProperty(propertyName1, (Value) null);
superuser.save();
assertFalse("Removing boolean property with Node.setProperty(String, null) and Session.save() not working",
testNode.hasProperty(propertyName1));
}
COM: <s> tests if removing a code boolean code property with </s>
|
funcom_train/13286542 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getAddBtn() {
if (addBtn == null) {
addBtn = new JButton();
addBtn.setText(">>");
addBtn.setBounds(new Rectangle(182, 57, 60, 31));
addBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
addGenre();
}
});
}
return addBtn;
}
COM: <s> this method initializes add btn </s>
|
funcom_train/15529792 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void rebind(){
try {
if (registry.lookup(REMOTE_REFERENCE) != null){
//System.out.print("+");
}else{
System.out.print("-");
}
} catch (NotBoundException nbe){
try {
registry.rebind(REMOTE_REFERENCE, object);
System.out.print("rebound object...");
} catch (Exception e){
System.err.println("rebind failed: " + e.getMessage());
}
} catch (RemoteException e){
System.err.println("lookup failed: " + e.getMessage());
}
}
COM: <s> only used when rebind is called from the servers main loop </s>
|
funcom_train/38538018 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
if (needsRecalc) recalc();
StringBuffer buf = new StringBuffer();
buf.append("[");
buf.append(min);
if (min != max) {
buf.append("..");
buf.append(max);
}
buf.append("]");
return buf.toString();
}
COM: <s> returns string representation of domain </s>
|
funcom_train/2903621 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void changeText(String text){
ZDrawable d = data.getDrawableData();
if((text!=null) && (text.length()>0)){
setText(text);
d.setLabel(text);
}
else if(text != null){
setText("");
d.setLabel(null);
}
data.setDrawableData(d);
Dimension pd = getPreferredSize();
setBounds(getX(), getY(), (int)pd.getWidth(), (int)pd.getHeight());
revalidate();
}
COM: <s> change the text label </s>
|
funcom_train/31986653 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeErrorReceiver(MessageReceiver msgRec) {
if ( msgRec==null) {
sendWarning (
"Can not remove receiver to experiment! Command ignored.",
"Experiment '"+getName()+"', Method 'void removeErrorReceiver"+
"(MessageReceiver msgRec)'",
"The parameter 'msgRec' passed was a null reference.",
"Make sure to give a valid MessageReciever reference before removing it "+
"from the experiment's messaging system.");
return; // do nothing
}
messMan.deRegister(msgRec, errormessage);
}
COM: <s> removes a messagereceiver for errormessages from the </s>
|
funcom_train/14637137 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getHost() {
char[] host_terminators = {':', ';', '?'};
Parser par = new Parser(m_URL);
int begin = par.indexOf('@'); // skip "sip:user@"
if (begin < 0) {
begin = 4;
} // skip "sip:"
else {
begin++;
} // skip "@"
par.setPos(begin);
int end = par.indexOf(host_terminators);
if (end < 0) {
return m_URL.substring(begin);
} else {
return m_URL.substring(begin, end);
}
}
COM: <s> gets host of sip url </s>
|
funcom_train/1045535 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setDataFilename(String s) {
ds_datname = s;
if (ds_is_nii) {
if (!ds_datname.endsWith(NI1_EXT))
ds_datname = ds_datname + NI1_EXT;
} else {
if (!ds_datname.endsWith(ANZ_DAT_EXT))
ds_datname = ds_datname + ANZ_DAT_EXT;
}
return;
}
COM: <s> set the filename for the dataset data file </s>
|
funcom_train/9186875 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getLine(int pos) {
try {
if (!findLine(pos))
return null;
int lineEnd = lineStart;
while (lineEnd < bufLen && buf[lineEnd] != CR && buf[lineEnd] != LF)
lineEnd++;
if (lineEnd - lineStart == 0)
return null;
return new String(buf, lineStart, lineEnd - lineStart);
} finally {
buf = null;
}
}
COM: <s> return the content of the line containing a given pos </s>
|
funcom_train/41385579 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JRadioButton getRButonUsuario() {
if (rButonUsuario == null) {
rButonUsuario = new JRadioButton();
rButonUsuario.setBounds(new Rectangle(5, 85, 20, 20));
rButonUsuario.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
seleccionaCualquiera(rButonUsuario, rButonAdministrador);
}
});
}
return rButonUsuario;
}
COM: <s> this method initializes r buton usuario </s>
|
funcom_train/2862140 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void increaseHeight(Element el){
el = getElement(el, "MANTIS:height");
String str = getValue(el, "RDF:Value");
if(str==null || str.equals(""))
str = "4";
setValue(el, "" + (Integer.parseInt(str) + 2));
}//enlargeTextArea
COM: <s> increase the value of an elements mantis height tag </s>
|
funcom_train/31013331 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public HttpSession getSession(String sessionId, HttpServletRequest request) {
HttpSession session = null;
if (this.useSessionManager()) {
if (sessionId != null) {
session = (HttpSession) this.getSessions().get(sessionId);
}
if ((session == null) && (request != null)) {
session = request.getSession();
this.getSessions().put(session.getId(), session);
}
} else {
session = request.getSession();
}
return session;
}
COM: <s> get a session by session id and the request </s>
|
funcom_train/31416163 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setWhenChanged(Object vo, java.util.Date whenChanged) {
try {
FieldItem fi = findMapping(vo.getClass()).getWhenChangedField();
if(fi!=null)
PropertyUtils.setProperty(vo, fi.getJavaFieldName(), whenChanged);
} catch(Exception ex) {
}
}
COM: <s> sets the when changed field for an object </s>
|
funcom_train/35838033 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isMenuComponent(Component c) {
if (!super.isMenuComponent(c)) {
// Are we in the scrolllist
int count = listitems.size();
for (int i = 0 ; i < count; i++) {
Component comp = (Component)listitems.elementAt(i);
if (comp == c)
return true;
if (comp instanceof JMenu) {
JMenu subMenu = (JMenu) comp;
if (subMenu.isMenuComponent(c))
return true;
}
}
}
return false;
}
COM: <s> returns true if the specified component exists in the </s>
|
funcom_train/51657501 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private ILineDiffer getDiffer(ISourceViewer viewer) {
IAnnotationModel model= viewer.getAnnotationModel();
if (model == null)
return null;
if (model instanceof IAnnotationModelExtension) {
IAnnotationModel diffModel= ((IAnnotationModelExtension)model).getAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID);
if (diffModel != null)
model= diffModel;
}
if (model instanceof ILineDiffer)
return (ILineDiffer)model;
return null;
}
COM: <s> extracts the line differ if any from the viewers documents annotation model </s>
|
funcom_train/42097448 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void assertTimestampsEqualWithEpsilon(long expected, long actual, int epsilon, String desc) {
assertTrue("Expected a "+desc+" time within "+epsilon+"ms of "+ expected
+ " but got " + actual,
Math.abs(actual - expected) < epsilon);
}
COM: <s> kinda like the junit asserts for doubles which allows an epsilon </s>
|
funcom_train/21837892 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenu getJMenuAjuda() {
if (jMenuAjuda == null) {
jMenuAjuda = new JMenu();
jMenuAjuda.setPreferredSize(new Dimension(50, 5));
jMenuAjuda.setText("Ajuda");
jMenuAjuda.setLocation(new Point(120, 0));
jMenuAjuda.add(getJMenuItemSobre());
}
return jMenuAjuda;
}
COM: <s> this method initializes j menu ajuda </s>
|
funcom_train/2801031 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setLogger(ILogger pLogger) throws IllegalStateException, ResourceNotFoundException {
mConfigurableManager.isAssignable(ILogger.PTY_LOGGER, pLogger);
if (pLogger == null) {
super.setLogger(CoreHelper.getLog());
} else {
super.setLogger(pLogger);
}
}
COM: <s> assigns the logger to the component </s>
|
funcom_train/28552591 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void sendMessage(String message) {
byteArrToSend = message.getBytes();
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream localDos = new DataOutputStream(baos);
localDos.writeInt(byteArrToSend.length);
localDos.write(byteArrToSend);
localDos.close();
byteArrToSend = baos.toByteArray();
baos.close();
dos.write(byteArrToSend, 0, byteArrToSend.length);
dos.flush();
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
}
COM: <s> we use this method to send a message to rcssserver3d </s>
|
funcom_train/22400436 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setOriginPosition(Vector3f position) {
target.getTransform(targetMatrix);
targetMatrix.get(trans);
dx = - (position.x + trans.x) * elapsedTime / durationX;
dy = - (position.y + trans.y) * elapsedTime / durationX;
dz = - ((position.z + trans.z) - 1f) * elapsedTime / durationZ;
}
COM: <s> sets the origin position to the specified position </s>
|
funcom_train/13814556 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void sortCollection() {
sortedPhotos = new ArrayList( origCollection.getPhotoCount() );
for ( int n = 0; n < origCollection.getPhotoCount(); n++ ) {
PhotoInfo p = origCollection.getPhoto( n );
sortedPhotos.add( p );
}
Collections.sort( sortedPhotos, comparator );
notifyListeners();
}
COM: <s> actual sorting of the collection is done by this method </s>
|
funcom_train/8631882 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setInDoubtTransactionState(int sessionId, int pageId, boolean commit) throws SQLException {
boolean old = database.isReadOnly();
try {
database.setReadOnly(false);
log.setInDoubtTransactionState(sessionId, pageId, commit);
} finally {
database.setReadOnly(old);
}
}
COM: <s> commit or rollback a prepared transaction after opening a database with </s>
|
funcom_train/4615609 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String extractNameOfFileThatCouldntBeFound(Exception e) {
String s = e.getMessage();
if (s==null) {
return null;
}
// will only succeed on Windows -- perhaps I will make it work on other platforms later
return s.replaceFirst(".*CreateProcess: ", "").replaceFirst(" .*", "");
}
COM: <s> try to extract the name of the file whose absence caused the exception </s>
|
funcom_train/7274306 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean processReadHeader(String line) {
if(line.equals(""))
return false;
int i = line.indexOf(':');
if (i > 0) {
String key = line.substring(0, i);
String value = line.substring(i + 1).trim();
readHeaders.put(key, value);
}
return true;
}
COM: <s> process a single read header </s>
|
funcom_train/15452308 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void close() throws ChatException {
Set chats = currentChats.entrySet();
Iterator chatsIterator = chats.iterator();
while (chatsIterator.hasNext()) {
Map.Entry entry = (Entry) chatsIterator.next();
Chat chat = (Chat) entry.getValue();
try {
chat.finalize();
} catch (Throwable e) {
throw new ChatException(
ErrorConstraints.CLOSING_CHAT_EXCEPTION, e);
}
chatsIterator.remove();
}
xmppConnection.close();
usedChats.clear();
}
COM: <s> close the server connection </s>
|
funcom_train/45245567 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JNumberFloatField getJNumberFloatFieldGamaDCMut() {
if (jNumberFloatFieldGamaDCMut == null) {
jNumberFloatFieldGamaDCMut = new JNumberFloatField();
jNumberFloatFieldGamaDCMut.setLocation(new Point(345, 265));
jNumberFloatFieldGamaDCMut.setSize(new Dimension(65, 20));
}
return jNumberFloatFieldGamaDCMut;
}
COM: <s> this method initializes j number float field gama dcmut </s>
|
funcom_train/31931706 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void execute(String fileName) {
if (PreferenceOps.consoleClearBeforeRunValue().equalsIgnoreCase(Constant.YES)) {
m_console.clearTextPane();
}
final String[] args = new String[] { "-e", fileName };
parseAndExecute(args, fileName);
}
COM: <s> execute the test identified by code file name code </s>
|
funcom_train/11024034 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSetPropertyConvertToString() {
try {
BeanUtils.setProperty(bean, "stringProperty", testUtilDate);
} catch (Throwable t) {
fail("Threw " + t);
}
assertEquals("java.util.Date --> String", testUtilDate.toString(), bean.getStringProperty());
}
COM: <s> test code set property code converting to a string </s>
|
funcom_train/268451 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isReadOnly() throws java.sql.SQLException {
if (Driver.TRACE) {
Object[] args = new Object[0];
Debug.methodCall(this, "isReadOnly", args);
Debug.returnValue(this, "isReadOnly", new Boolean(this.readOnly));
}
return this.readOnly;
}
COM: <s> tests to see if the connection is in read only mode </s>
|
funcom_train/3784648 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setZoom(int zoomFactor)
{ /* setZoom */
si.zoomValue= zoomFactor;
si.resizeImageCanvas((float) zoomFactor);
curPixHeight= si.curPixHeight;
curPixWidth= si.curPixWidth;
repaint();
si.repaint();
System.gc();
} /* setZoom */
COM: <s> set zoom set the image size zoom and create a new </s>
|
funcom_train/13997752 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createPasteOption(JMenu edit) {
JMenuItem mi;
mi = (JMenuItem) edit.add(new JMenuItem("Paste", createImageIcon(
"images/paste.gif", "Paste")));
mi.setMnemonic('v');
mi.getAccessibleContext().setAccessibleName("Paste Menu");
mi.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// do something
}
});
}
COM: <s> creates the paste option </s>
|
funcom_train/33058336 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getParameter(String name) {
Object value = parameters.get(name);
if (value == null)
return (null);
else if (value instanceof String[])
return (((String[]) value)[0]);
else if (value instanceof String)
return ((String) value);
else
return (value.toString());
}
COM: <s> override the code get parameter code method of the wrapped request </s>
|
funcom_train/28672830 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addDependencyCheckPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_BeanType_dependencyCheck_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_BeanType_dependencyCheck_feature", "_UI_BeanType_type"),
BeansPackage.Literals.BEAN_TYPE__DEPENDENCY_CHECK,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the dependency check feature </s>
|
funcom_train/4210356 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void appendOpenInlinedQuoteTag(String style) {
StringBuilder sb = new StringBuilder("<q");
if (style != null) {
sb.append(" style=\"");
sb.append(style);
sb.append("\"");
}
sb.append(">");
text.append(sb.toString());
}
COM: <s> appends a tag that indicates that an inlined quote section begins </s>
|
funcom_train/34636705 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setPositions(IDocument document, OutlineNode outlineNode) {
if (outlineNode.hasChildren()) {
for (TreeNode node : outlineNode.getChildren()) {
setPositions(document, (OutlineNode) node);
}
} else {
try {
Position pos = outlineNode.getPosition();
document.addPosition(SEGMENTS,
new org.eclipse.jface.text.Position(pos.getOffset(),
pos.getLength()));
} catch (Exception e) {
Logger.log(Status.ERROR, "Could not set position.", e);
}
}
}
COM: <s> helper method to set all positions in a given document </s>
|
funcom_train/50029286 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void mk_xy2pix() {
long k, ip, id;
for (int i = 1; i <= xmax; i++) {
long j = i - 1;
k = 0;
ip = 1;
while (j != 0) {
id = (long) BitManipulation.MODULO(j, 2);
j /= 2;
k += ip * id;
ip *= 4;
}
x2pix[i] = k;
y2pix[i] = 2 * k;
}
}
COM: <s> fills arrays x2pix and y2pix giving the number of the pixel laying in </s>
|
funcom_train/18070511 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setType(short t) {
short old = getType();
short oldSub = getSubtype();
this.type = t;
if (old != this.type) {
if (old == 2 || old == 0)
changePlacData(old, oldSub, -1);
if (this.type == 2 || this.type == 0)
changePlacData(this.type, this.subtype, 1);
}
}
COM: <s> when create new object changing type will cause two count up </s>
|
funcom_train/46694910 | /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");
AllGraphs instance = new AllGraphs();
assertEquals(State.UNINITIALIZED,instance.buildingStatus());
instance.buildQuery();
assertEquals(State.READY, instance.buildingStatus());
}
COM: <s> test of building status method of class all graphs </s>
|
funcom_train/46761111 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public EnvironmentModel getEnvironment(final long environmentId, final IChainStore chain, final ServiceCall call) throws Exception {
IBeanMethod method = new IBeanMethod() { public Object execute() throws Exception {
return SystemData.getEnvironment(environmentId, chain, call);
}}; return (EnvironmentModel) call(method, call);
}
COM: <s> same transaction return the single environment model for the primary key </s>
|
funcom_train/46376617 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setLocalTranslation(final Vector3f trans) {
ClientContextJME.getWorldManager().addRenderUpdater(new RenderUpdater() {
public void update(Object arg0) {
if (localToCellNode != null) {
setLocalTranslationNoUpdater(trans);
ClientContextJME.getWorldManager().addToUpdateList(localToCellNode);
}
}
}, null);
}
COM: <s> sets the local to cell translation of this component </s>
|
funcom_train/37832052 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Item getNearestFood(final double range) {
// This way we save several sqrt operations
double squaredDistance = range * range;
Item chosen = null;
for (final Item item : getZone().getItemsOnGround()) {
if (canEat(item) && (this.squaredDistance(item) < squaredDistance)) {
chosen = item;
squaredDistance = this.squaredDistance(item);
}
}
return chosen;
}
COM: <s> returns the pet food that is nearest to the pets current position </s>
|
funcom_train/8528224 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void save(File file) throws TransformerException, IOException {
try {
logger.info("Saving xml document to file :"
+ file.getAbsolutePath());
OutputStreamWriter out = new OutputStreamWriter(
new FileOutputStream(file), "UTF-8");
this.save(out);
} catch (IOException ioe) {
logger.log(Level.SEVERE, null, ioe);
throw ioe;
}
}
COM: <s> save the xml to a file </s>
|
funcom_train/12180322 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getFieldName(Element field) {
// the name is specified via the name attribute
String fieldName = field.getAttributeValue(
DeviceRepositorySchemaConstants.
POLICY_NAME_ATTRIBUTE);
if (fieldName == null) {
throw new IllegalStateException("Field element must have a name");
}
return fieldName;
}
COM: <s> returns the name of a field given a field element </s>
|
funcom_train/28993185 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean removeBBSPostTransaction(String postId) {
boolean successful = false;
Transactionable tx = null;
try {
tx = transactionBegin();
successful = removeBBSPost(postId);
if (successful = true) {
transactionCommit(tx);
} else {
transactionRollback(tx, null, null);
}
} catch (Exception e) {
transactionRollback(tx, e, null);
}
return successful;
}
COM: <s> start a transaction then delegates to the remove bbspost transtion method </s>
|
funcom_train/6347887 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addTile(String filename, String mapCode, boolean transparent) {
Imagry imagry = null;
try {
imagry = (Imagry) getEnhancer("Imagry");
} catch (EnhancerNotFoundException enfe) {
JOptionPane.showConfirmDialog(null, "An Enhancer is missing:"
+ enfe);
System.exit(-1);
} // catch
imagry.addImageBlock(filename, mapCode, transparent);
}// addTile(String filename, String mapCode, boolean transparent)
COM: <s> adds a tile </s>
|
funcom_train/46440546 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void trafficLightInit() throws IOException {
for (Lane lane : laneManager.getLanes()) {
lane.getLight().setState(RED);
// set all bus lights to red lyk zomgzgomg.
if (lane.getVehicleType() == Vehicle.BUS) {
for (BusTrafficLight light : lane.getLight().getSublights()) {
light.setState(RED);
}
}
}
laneManager.synchronizeLights();
}
COM: <s> sets all trafficlights in the simulator to a default state </s>
|
funcom_train/36242880 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ResponseAPDU sendVerifyCHV(byte id, byte[] chv) throws CardServiceException {
if (chv == null || chv.length > 8) {
throw new CardServiceException("Invalid CHV length");
}
byte[] data = new byte[8];
Arrays.fill(data, 0, 8, (byte) 0xFF);
System.arraycopy(chv, 0, data, 0, chv.length);
CommandAPDU capdu = new CommandAPDU(GSM1111.CLA_GSM, GSM1111.INS_VERIFY_CHV,
(byte) 0x00, id, data);
return transmit(capdu);
}
COM: <s> sends a verify chv instruction </s>
|
funcom_train/3985539 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void checkAlpha() {
if (pixels == null) return;
for (int i = 0; i < pixels.length; i++) {
// since transparency is often at corners, hopefully this
// will find a non-transparent pixel quickly and exit
if ((pixels[i] & 0xff000000) != 0xff000000) {
format = ARGB;
break;
}
}
}
COM: <s> check the alpha on an image using a really primitive loop </s>
|
funcom_train/24152987 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testEditable() {
System.out.println("editable");
CalendarPanel calendar = new CalendarPanel();
calendar.setEditable(true);
assertTrue("editable must be true.", calendar.isEditable());
calendar.setEditable(false);
assertFalse("editable must be false.", calendar.isEditable());
}
COM: <s> test of property editable of class com </s>
|
funcom_train/44809864 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String format(Phone phone) {
if (!validator.isValid(phone)) {
return getEmptyString();
}
StringBuffer buf = new StringBuffer();
String phoneCode = phone.getPhoneCode();
if (!isEmpty(phoneCode)) {
buf.append("(" + phoneCode + ")");
buf.append(" ");
}
buf.append(phone.getPhoneNumber());
return buf.toString();
}
COM: <s> format address string </s>
|
funcom_train/44622850 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JCBinary makeBinary(int pos, int optag, @Nullable Symbol opSymbol, JCExpression lhs, JCExpression rhs) {
JCBinary tree = factory.at(pos).Binary(optag, lhs, rhs);
tree.operator = opSymbol;
tree.type = optag == JCTree.EQ ? syms.booleanType : tree.operator.type.getReturnType();
copyEndPosition(tree,rhs);
return tree;
}
COM: <s> make an attributed binary expression </s>
|
funcom_train/18653385 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void handleDaemon(Element configuration) {
String isDaemon = configuration.elementText("isDaemon");
logger.info("Daemon set is :" + isDaemon);
if (StringUtil.toboolean(isDaemon, false) == false)
return;
this.waiter = new EndlessWaiter();
(new Thread(waiter)).start();
}
COM: <s> if the element is daemon is true it will create a thread </s>
|
funcom_train/25637541 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addClassInfo(ClassDoc cd, Content contentTree) {
contentTree.addContent(getResource("doclet.in",
Util.getTypeName(configuration, cd, false),
getPackageLinkString(cd.containingPackage(),
Util.getPackageName(cd.containingPackage()), false)));
}
COM: <s> add the classkind class interface exception error of the class </s>
|
funcom_train/8013143 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getColumnDatabaseName(int col) throws DataStoreException {
if (col < 0 || _desc.getColumnCount() == 0)
throw new DataStoreException("Specified column (" + col + ") does not exist.");
DSColumnDescriptor d = _desc.getColumn(col);
String table = d.getTable();
if (table == null)
table = _desc.getDefaultTable();
if (table == null)
return d.getColumn();
else
return table + "." + d.getColumn();
}
COM: <s> this method returns the database name of the column in the data store </s>
|
funcom_train/46836608 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getJButtonOk() {
if (jButtonOk == null) {
jButtonOk = new JButton();
jButtonOk.setBounds(new Rectangle(249, 133, 111, 29));
jButtonOk.setText(EBIPGFactory.getLANG("EBI_LANG_OK"));
jButtonOk.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
checkRoot();
}
});
}
return jButtonOk;
}
COM: <s> this method initializes j button ok </s>
|
funcom_train/9560318 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getVariablesAsString() {
StringBuffer b = new StringBuffer();
for (int i = 0; variables != null && i < variables.length; i++) {
String p = variables[i];
b.append(p);
if (i < variables.length - 1) {
b.append(",");
}
}
return b.toString();
}
COM: <s> gets the binding parameters of the sql statement as comma separated </s>
|
funcom_train/21656442 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getBtAgregarCronologias() {
if (btAgregarCronologias == null) {
btAgregarCronologias = new JButton();
btAgregarCronologias.setBounds(new Rectangle(494, 129, 43, 25));
btAgregarCronologias.setText("+");
btAgregarCronologias.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
ControladorPrincipal.mostrarAgregarCronologia();
}
});
}
return btAgregarCronologias;
}
COM: <s> this method initializes bt agregar cronologias </s>
|
funcom_train/10278770 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setAttribute(String name, String value){
if( name.compareToIgnoreCase("framecount") == 0){
frameCount = Integer.parseInt( value.trim() );
}
if( name.compareToIgnoreCase("fps") == 0){
fps = Integer.parseInt( value.trim() );
}
if(name.compareTo("xmlinterpolator") == 0){
XMLinterpolator = value;
}
}
COM: <s> sets class variables from attributes in the xml document </s>
|
funcom_train/3427663 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Type typeCheck(SymbolTable stable) throws TypeCheckError {
final Type tselect = _select.typeCheck(stable);
// If the sort data-type is not set we use the natural data-type
// of the data we will sort
if (!(tselect instanceof StringType)) {
_select = new CastExpr(_select, Type.String);
}
_order.typeCheck(stable);
_caseOrder.typeCheck(stable);
_dataType.typeCheck(stable);
return Type.Void;
}
COM: <s> run type checks on the attributes expression must return a string </s>
|
funcom_train/15370572 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getVisibleTypes() {
List types = getTypes();
new PrimitiveTotalPredicate() {
public boolean eval(Object o) {
return !((Type)o).is(new Private()) &&
!((Type)o).is(new Protected());
}
}.filter(types);
if(types.size() > 0) {
return types;
}
else {
return null;
}
}
COM: <s> get all the visisble types </s>
|
funcom_train/33796859 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int deleteAllTypeForUser(Long userID) throws DAOException {
log.debug("Entering :: UserTypeDAOImpl:getUserRoleList()");
try{
String hql = "delete UserType where User_InfoID = :userId";
Query query = getCurrentSession().createQuery(hql);
query.setLong("userId",userID);
int rowCount= query.executeUpdate();
flushSession();
return rowCount;
}
catch(HibernateException he){
log.error(he, he);
throw new DAOException(he);
}
}
COM: <s> delete all user type entry for given user </s>
|
funcom_train/22638748 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public RegisterSet writesObj() throws DataConversionException {
if (isWrite) {
for (Attribute key : typeIsObj.keySet()) {
for (String s : possibleWrites) {
if (key.getName().equals(s)) {
if (typeIsObj.get(key)) {
return RegisterSet.from(key.getIntValue());
}
}
}
}
}
return RegisterSet.none();
}
COM: <s> returns the registers which this instruction writes objects into </s>
|
funcom_train/44706692 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void editItem(PageState s, ContentItem item) {
ContentSection sec = getContentSection(s);
String nodeURL = URL.getDispatcherPath() + sec.getPath() + "/";
String target = ContentItemPage.getItemURL
(nodeURL, item.getID(), ContentItemPage.AUTHORING_TAB);
throw new RedirectSignal(target, true);
}
COM: <s> forward to the item editing ui </s>
|
funcom_train/3377233 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Resource getResource(String name, boolean check) {
if (DEBUG) {
System.err.println("URLClassPath.getResource(\"" + name + "\")");
}
Loader loader;
for (int i = 0; (loader = getLoader(i)) != null; i++) {
Resource res = loader.getResource(name, check);
if (res != null) {
return res;
}
}
return null;
}
COM: <s> finds the first resource on the url search path which has the specified </s>
|
funcom_train/13749523 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int executeInstruction(int[] instruction, int pc) {
int[] register = new int[3];
for (int i = 1; i < instruction.length; i++)
register[i] = instruction[i];
if (instruction[0] == BSR) return bsr(register, pc);
if (instruction[0] == JSR) return jsr(register, pc);
else return ERR;
}
COM: <s> instruction for bsr and jsr need besides the instruction array also the current </s>
|
funcom_train/38310689 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testYesterday() throws Exception {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, -1);
String strYesterday = df.format(cal.getTime());
Date yesterday = df.parse(strYesterday);
assertEquals(yesterday, DateUtils.yesterday());
}
COM: <s> tests the yesterday method </s>
|
funcom_train/42476861 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getMessage(final String notes) {
StringBuffer buffer = new StringBuffer();
buffer.append("<html>");
buffer.append(notes);
buffer.append("<br><p>Highlight each hero you wish ");
buffer.append("to hire, and then click the ");
buffer.append("<strong>Hire</strong> button ");
buffer.append("to complete the transaction.</p>");
buffer.append("</html>");
return buffer.toString();
}
COM: <s> gets the message displayed to the player </s>
|
funcom_train/13427215 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setGraph(IGraph initGraph) {
super.setGraph(initGraph);
if (initGraph != null) {
this.matrixSize = getGraph().getVerticesNumber();
this.cost = new double[this.matrixSize][this.matrixSize];
this.predecessor = new int[this.matrixSize][this.matrixSize];
this.verticesAssociationMatrix = new IVertex[this.matrixSize];
this.init();
}
}
COM: <s> sets the init graph as this algorithms initial graph </s>
|
funcom_train/18321166 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean x1(StateMachineContext context) {
Message m = (Message) context.getEventContext().getParameter(Parameters.Event.MESSAGE);
String res = UserDatabaseModel.getUserDatabase().authenticate(m.getSender());
if (res != null) {
context.getEventContext().setParameter(
Parameters.Event.LOGIN_DENIED_REASON, res);
return false;
} else {
return true;
}
}
COM: <s> return true if user authenticated by server </s>
|
funcom_train/17917361 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public IProcessor getProcessor(String query, int lines) throws RuntimeException {
try {
lock.lock();
query = query.replace(NamingUtil.internalDatastoreName(), getTablename());
IProcessor result = getConnectionObject().getProcessor(query, false, lines);
if (result != null)
return result;
else
throw new RuntimeException("Query is not valid for datastore "+getLocator()+": "+query);
}
catch (Exception e) {
throw new RuntimeException(e);
}
finally {
lock.unlock();
}
}
COM: <s> gets a processor on this datastore which conforms to the given query </s>
|
funcom_train/42636143 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isWorkingTime(double time){
int day = getDay(time);
WorkerCalendar specific = getForDay(day);
if(specific!=null) return specific.isWorkingTime(time);
double t = getLocalTime(time, day);
if(!isWorkday()) return false;
if(t<getWorkdayStart() || t>=getWorkdayFinish()) return false;
if(t>=getBreakStart() && t<getBreakFinish()) return false;
return true;
}
COM: <s> checks if the given time is working </s>
|
funcom_train/15620856 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initPredictionColumns() throws M4Exception, M4CompilerError {
Feature[] predFeatures = this.getThePredictingAttributes();
if (predFeatures == null || predFeatures.length == 0) {
throw new M4CompilerError("Operator 'ModelApplier': Empty set of PredictingAttributes!");
}
this.predictionColumns.clear();
for (int i=0; i<predFeatures.length; i++) {
Collection col = this.findInputColumnForFeature(predFeatures[i]);
this.predictionColumns.addAll(col);
}
}
COM: <s> helper method initializing the field code prediction columns code </s>
|
funcom_train/44329242 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public GetTransactionDetailsResponseType getTransactionDetails(GetTransactionDetailsRequestType _request) throws RemoteException, ServiceException {
validateRequest(_request);
GetTransactionDetailsReq request = new GetTransactionDetailsReq();
request.setGetTransactionDetailsRequest(_request);
GetTransactionDetailsResponseType response = getPayPalInterface(getApiUrl(), getApiTimeout()).getTransactionDetails(request);
processResponse(response);
return response;
}
COM: <s> performs a pay pal get transaction details api call using the passed </s>
|
funcom_train/46943566 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private CheckBoxList getJListParentalRatingCountries() {
if (jListParentalRatingCountries == null) {
jListParentalRatingCountries = new CheckBoxList();
jListParentalRatingCountries.setVisibleRowCount(5);
jListParentalRatingCountries.setSize(new Dimension(158, 80));
DefaultListModel countryNames = new DefaultListModel();
jListParentalRatingCountries.setModel(countryNames);
for (String s : countries.getCountryNames())
countryNames.addElement(new JCheckBox(s));
}
return jListParentalRatingCountries;
}
COM: <s> this method initializes j list parental rating countries </s>
|
funcom_train/13849578 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object getAdmin() {
// TBD - pass capability object instead?
if (operationsLogger.isLoggable(Level.FINER)) {
operationsLogger.entering(MultiLogManager.class.getName(),
"getAdmin");
}
if (operationsLogger.isLoggable(Level.FINER)) {
operationsLogger.exiting(MultiLogManager.class.getName(),
"getAdmin", this);
}
return (MultiLogManagerAdmin)this;
}
COM: <s> retrieves the administration interface for the </s>
|
funcom_train/50925782 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CMLScalar createStringScalar(String name, String value) {
EntryTool.checkEmptyName(name);
if (failOnError) {
// this.checkValueAgainstEnumerations(value);
this.checkPattern(value);
}
CMLScalar scalar = createScalar(name);
scalar.setDataType(XSD_STRING);
scalar.setXMLContent(value);
return scalar;
}
COM: <s> add scalar string to a cmlelement </s>
|
funcom_train/43041528 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void searchAcync(Query query, TwitterListener listener) {
getDispatcher().invokeLater(new AsyncTask(SEARCH, listener, new Object[]{query}) {
public void invoke(TwitterListener listener, Object[] args) throws TwitterException {
listener.searched(search((Query) args[0]));
}
});
}
COM: <s> returns tweets that match a specified query </s>
|
funcom_train/12670981 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSetAntColor() {
System.out.println("setAntColor");
Color antColor = null;
AntImpl instance = new AntImpl();
instance.setAntColor(antColor);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
COM: <s> test of set ant color method of class engine </s>
|
funcom_train/41162776 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void save(AgStatus entity) {
EntityManagerHelper.log("saving AgStatus 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 ag status entity </s>
|
funcom_train/20924405 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean put(ValueNode node, T newValue) {
if (mValueMap.containsKey(node)) {
T oldValue=mValueMap.get(node);
if (oldValue==newValue
|| oldValue!=null && newValue!=null && newValue.equals(oldValue))
return false; // no change
}
mValueMap.put(node, newValue);
return true;
}
COM: <s> associates node with a value </s>
|
funcom_train/45460137 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void internalAddFileToPlaylist(String playlistName, String fileName, boolean isRemovable, int insertionIndex) {
Playlist playlist = _items.get(playlistName);
if (insertionIndex == -1) {
playlist.addAudioItem(new AudioItem(fileName, true, isRemovable));
} else {
playlist.insertAudioItem(new AudioItem(fileName, true, isRemovable), insertionIndex);
}
}
COM: <s> internal method add the specified file to the specified playlist </s>
|
funcom_train/51099069 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public DataMapDefaults getDataMapPreferences(String nameSuffix) {
DataMap map = getCurrentDataMap();
if (map == null) {
throw new CayenneRuntimeException("No DataMap selected");
}
if (nameSuffix == null) {
nameSuffix = "";
}
return (DataMapDefaults) getPreferenceDomainForDataDomain().getDetail(
map.getName() + nameSuffix,
DataMapDefaults.class,
true);
}
COM: <s> returns preferences object for the current data map </s>
|
funcom_train/46745651 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setContentTypeRef(DisplayModel contentTypeRef) {
if (Converter.isDifferent(this.contentTypeRef, contentTypeRef)) {
DisplayModel oldcontentTypeRef= new DisplayModel(this);
oldcontentTypeRef.copyAllFrom(this.contentTypeRef);
this.contentTypeRef.copyAllFrom(contentTypeRef);
setModified("contentTypeRef");
firePropertyChange(String.valueOf(FILES_CONTENTTYPEREFID), oldcontentTypeRef, contentTypeRef);
}
}
COM: <s> content type of file e </s>
|
funcom_train/39305476 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addOrUpdateRow(CustomTableRow row) {
logger.debug("Adding/updating new table row");
// get the index of the object if it exists
int index = data.indexOf(row);
if (index == -1) {
// add new data
data.add(row);
}
else {
// update existing data
data.set(index, row);
}
// notify listeners that data has been added
fireTableDataChanged();
}
COM: <s> add or update a row in the status table </s>
|
funcom_train/4403288 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void preparePaint() {
this.setVisible(true);
// inTop = this.getInsets().top;
// inLeft = this.getInsets().left;
this.setSize(this.getInsets().left + _width, this.getInsets().top + _height);
this.setTitle("Image viewer");
this.setBackground(Color.black);
this.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
}
COM: <s> display the image in a frame </s>
|
funcom_train/45742292 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getSourcePropertyNameLabelAux() {
// TODO: implement this method
// Ensure that you remove @generated or mark it @generated NOT
if (getSource().size() > 0) {
if (getSource().get(0) instanceof Property)
return ((Property) getSource().get(0)).getName();
else
return "";
}
else
return "";
//throw new UnsupportedOperationException();
}
COM: <s> begin user doc </s>
|
funcom_train/4124288 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void showStartGamePanel(Game game, Player player, boolean singlePlayerMode) {
closeMenus();
if (game != null && player != null) {
startGamePanel.initialize(singlePlayerMode);
addAsFrame(startGamePanel);
startGamePanel.requestFocus();
} else {
logger.warning("Tried to open 'StartGamePanel' without having 'game' and/or 'player' set.");
}
}
COM: <s> displays the code start game panel code </s>
|
funcom_train/1938107 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getLeastMaximum(int field) {
switch (field) {
case WEEK_OF_YEAR:
return 52;
case WEEK_OF_MONTH:
return 4;
case DATE:
return 28;
case DAY_OF_YEAR:
return 365;
case DAY_OF_WEEK_IN_MONTH:
return 4;
default:
return this.getMaximum(field);
}
}
COM: <s> gets the least maximum value that the field may ever have </s>
|
funcom_train/39362038 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void update(Observable observed, Object info) {
MessageConnection connection = null;
if (observed instanceof MessageConnection) {
connection = (MessageConnection) observed;
// Incoming Message
if (info instanceof Message) {
processMessage(connection, (Message)info);
}
// Connection status changed
else if (info instanceof Connection.Status){
Connection.Status status = (Connection.Status) info;
if (status == Connection.Status.CLOSED) {
connection.deleteObserver(this);
}
}
}
}
COM: <s> react to changes of the observed message connection obejcts </s>
|
funcom_train/12173542 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addTrElementCapabilities() {
DeviceElementCapability dec =
manager.getDeviceElementCapability("tr", true);
dec.addSupportedStyleProperty(StylePropertyDetails.VERTICAL_ALIGN,
getSupportLevel(DeviceCapabilityConstants.TR_VERTICAL_ALIGN));
dec.addSupportedAttribute("valign",
getSupportLevel(DeviceCapabilityConstants.TR_ATTRIBUTE_VALIGN));
manager.addDeviceElementCapability(dec);
}
COM: <s> add a device element capability for the tr element </s>
|
funcom_train/36936117 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void update(final CCAgent theAgent,final float theDeltaTime) {
update(theDeltaTime);
for (CCForce myBehavior : _myBehaviors) {
if (!myBehavior.isActive(theAgent)){
continue;
}
_mySteering.set(0,0,0);
myBehavior.apply(theAgent, _mySteering, theDeltaTime);
_mySteering.normalize();
_mySteering.scale(myBehavior.weight());
_mySteering.scale(theDeltaTime * CCSimulation.TARGET_FRAMERATE);
theAgent.applyForce(_mySteering);
}
}
COM: <s> calculates the forces based on internal data </s>
|
funcom_train/40949570 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void loguearUsuario(String nombre, String password) {
ClienteServer.getInstance().mandarMensaje(Mensaje.LOGIN, new UsuarioDto(null, nombre, "", password));
IUsuario iUsuario = (IUsuario) ClienteServer.getInstance().getObjeto();
RolUsuario.getInstance().setUsuario(iUsuario);
}
COM: <s> busca logear a un usuario a la aplicacion </s>
|
funcom_train/33173626 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setUseapplet(boolean newUseapplet) {
boolean oldUseapplet = useapplet;
useapplet = newUseapplet;
boolean oldUseappletESet = useappletESet;
useappletESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DxlPackage.DATACONNECTION__USEAPPLET, oldUseapplet, useapplet, !oldUseappletESet));
}
COM: <s> begin user doc </s>
|
funcom_train/49720327 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getJPanelsequset() {
if (jPanelsequset == null) {
jPanelsequset = new JPanel();
jPanelsequset.setLayout(new FlowLayout());
jPanelsequset.setPreferredSize(new Dimension(900, 140));
jPanelsequset.setName("jPanelsequset");
jPanelsequset.add(getJPanel6(), null);
jPanelsequset.add(getJPanel1(), null);
}
return jPanelsequset;
}
COM: <s> this method initializes j panelsequset </s>
|
funcom_train/3927591 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void moveToFront(Component c) {
if (c == hScrollComponent || c == vScrollComponent || c == holder) {
return;
} else if (c != holder.getComponent(0)) {
holder.remove(c);
holder.add(c, 0);
holder.repaint();
}
}
COM: <s> the scrollers should always be in front </s>
|
funcom_train/3123869 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean addRoute(CInetRoute route){
// check if we already have this item
CInetRoute[] inr = getRoutes();
for (int i = 0; i<inr.length; i++){
if (inr[i].equals(route)){
return false;
}
}
routes.addElement(route);
return true;
}
COM: <s> add a route </s>
|
funcom_train/8074536 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void printIndexClusters() throws Exception {
for (int j = 0; j < m_NumClusters; j++) {
System.out.println("Cluster " + j);
for (int i=0; i<m_Instances.numInstances(); i++) {
System.out.println("Point: " + i + ", prob: " + m_ClusterDistribution[i][j]);
}
}
}
COM: <s> outputs the current clustering </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.