__key__ stringlengths 16 21 | __url__ stringclasses 1
value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/13491287 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object perform(Term[] parameter,Session session) throws IllegalArgumentException, UnsupportedOperationException {
Object target = parameter[0].resolve(session);
try {
return method.invoke (target, propertyNameArray);
} catch(Throwable x) {
throw new UnsupportedOperationException ("Perform failed for DynaBeanFunction with method " + method + " and property " + propertyNameArray[0]);
}
}
COM: <s> perform the function or predicate using an array of terms as parameters </s>
|
funcom_train/4717184 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getPattern() {
String buffer = "";
if (subId == null) {
buffer += String.format("/SYN/ID%s", id);
} else {
buffer += String.format("/SYN/ID%s.%s", id, subId);
}
return buffer;
}
COM: <s> returns the osc address pattern of this synth </s>
|
funcom_train/22092780 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Iterator sonsIterator() {
if (_sons == null)
return new Iterator() {
public boolean hasNext() { return false; };
public Object next() { throw new NoSuchElementException("no sons in composite"); };
public void remove() {throw new IllegalStateException("empty sons composite iterator"); }
};
else return _sons.iterator();
};
COM: <s> method to iterate on sons </s>
|
funcom_train/44701768 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Assembly loadCurrent() throws SQLException {
Assembly current = null;
Statement statement = connection.createStatement(
ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
String query = "SELECT * FROM " + ASSEMBLIES + " ORDER BY "
+ ASSEMBLY_ID + " DESC LIMIT 1";
try {
Assembly[] assemblies = parseResult(statement.executeQuery(query));
if (assemblies.length > 0) {
current = assemblies[0];
}
} catch (SQLException e) {
throw e;
} finally {
statement.close();
}
return current;
} //load()
COM: <s> loads the current assembly from the database </s>
|
funcom_train/38308674 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void trimContentHead() {
if (content == null) {
// no sense to go on!
return;
}
int length = content.length();
for (int i = 0; i < length; i++) {
if (!Character.isWhitespace(content.charAt(i))) {
if (i > 0) {
content.delete(0, i);
}
break;
}
}
}
COM: <s> trims off the heading white spaces of the content buffer </s>
|
funcom_train/11011736 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testNonAlphaFormula() {
Ptg[] ptgs = parseFormula("\"TOTAL[\"&F3&\"]\"");
confirmTokenClasses(ptgs, StringPtg.class, RefPtg.class, ConcatPtg.class, StringPtg.class, ConcatPtg.class);
assertEquals("TOTAL[", ((StringPtg)ptgs[0]).getValue());
}
COM: <s> bug reported by xt jens </s>
|
funcom_train/36125159 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getApplicationAbsolutePath() {
String result;
Request request = Environment.get().getRequest();
try {
URL url = new URL(request.getScheme(), request.getServerName(),
request.getServerPort(), getApplicationPath());
result = url.toExternalForm();
} catch (MalformedURLException e) {
Application.logger().error("Malformed URL:", e);
result = null;
}
return result;
}
COM: <s> the application absolute path getter </s>
|
funcom_train/37076189 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private AnnotatedFeatureI getGeneLevelAnnot(SeqFeatureI sf) {
while (sf != null && !holder.getFeatures().contains(sf))
sf = sf.getParent();
if (sf!=null && sf.hasAnnotatedFeature())
return sf.getAnnotatedFeature();
else
return null;
}
COM: <s> return ancestor of sf that is a gene or analogous to gene </s>
|
funcom_train/36948805 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Node getNodeAtOffset(Node rootNode, int offset) {
if ( rootNode == null ) { return null; }
locatedNode = null;
this.offset = offset;
// Traverse to find closest node
rootNode.accept(this);
// Refine the node, if possible, to an inner node not covered by the visitor
// (Why? Nodes such as ArgumentNode don't like being visited, so they must be handled here.)
locatedNode = refine(locatedNode);
// Return the node
return locatedNode;
}
COM: <s> gets the most closely spanning node of the requested offset </s>
|
funcom_train/17800551 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Vigneron findByPK(String id) {
Vigneron vigneron = new Vigneron();
vigneron.setId(id);
List druideDB_resultat = find(vigneron);
if ( druideDB_resultat != null && druideDB_resultat.size() == 1) {
return (Vigneron)druideDB_resultat.get(0);
}
return null;
}
COM: <s> this method is used to find a vigneron with its pk s </s>
|
funcom_train/48910116 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getBtMenos() {
if (btMenos == null) {
btMenos = new JButton();
btMenos.setMargin(new Insets(0,0,0,0));
btMenos.setBounds(new Rectangle(40, 136, 25, 20));
btMenos.setText("-");
btMenos.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
liberarEmpleadoDeLaMaquina();
}
});
}
return btMenos;
}
COM: <s> this method initializes bt menos </s>
|
funcom_train/14460335 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean sendMessageToOthers(Object sessionId, Message msg)throws MessageFormatException{
/*
Message m;
if (this.getMessagingType() == this.MESSAGE_TYPE_JSON) {
m = new JSONMessage(msg);
}else {
m = new GenericMessage();
m.setMessage(msg);
}
*/
this.getMessageSession(sessionId).sendToOthers(this, msg);
return true;
}
COM: <s> sends the message to all the other listeners ie does </s>
|
funcom_train/9146280 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TokenStream tokenStream(String fieldName, Reader reader) {
TokenStream result = new ChineseTokenizer_IRDut(reader);
// TokenStream result = new IRTokenizer(reader);
//CJKAnalyzer analyzer = new CJKAnalyzer();
//TokenStream result = analyzer.tokenStream(reader);
result = new ChineseFilter(result);
return result;
}
COM: <s> creates a token stream which tokenizes all the text in the provided reader </s>
|
funcom_train/50428262 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double getScore(int curNode, int candidate, Set[] parentTable) {
double score = 0;
// Ignore curNode and candidate
int max = parentTable.length;
for (int i = 0; i < max; i++) {
score += baseScore.getScore(i, NO_CANDIDATES, parentTable);
}
return score;
}
COM: <s> basic structure score </s>
|
funcom_train/14362725 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isVariant1(final AccountCode accountCode) {
int len = accountCode.getRealLength();
boolean variant1 = false;
if (len == 6 && MathHelper.isInRange(accountCode.getDigitAtPos(4), 1, 8)) {
variant1 = true;
} else if (len == 9 && MathHelper.isInRange(accountCode.
getDigitAtPos(1), 1, 8)) {
variant1 = true;
}
return variant1;
}
COM: <s> returns true if the account code matches variant 1 </s>
|
funcom_train/3703479 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setToLikely(String strField) {
//// 0. Ensure valid.
MiniGisLib.checkValidField(strField);
//// 1. Set our value.
String strVal = getLikely(strField);
clearValues();
setDataFormat(strField);
addValue(strVal);
//// 2. Update the internal locationTuple.
locationTuple = new LocationTuple(strField, strVal);
} // of method
COM: <s> this permanently degrades the quality of information </s>
|
funcom_train/47311712 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void updateEntry(IPropertySheetEntry entry, TreeItem item) {
// ensure that backpointer is correct
item.setData(entry);
// update the name and value columns
item.setText(0, entry.getDisplayName());
item.setText(1, entry.getValueAsString());
Image image = entry.getImage();
if (item.getImage(1) != image)
item.setImage(1, image);
// update the "+" icon
updatePlus(entry, item);
}
COM: <s> update the given entry but not its children or parent </s>
|
funcom_train/45186715 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void moveEntryDown(int index) {
if (index == (entries.size() - 1)) return;
Object nextFile = entries.get(index + 1);
Object file = entries.get(index);
entries.set(index + 1, file);
entries.set(index, nextFile);
}
COM: <s> moves archive entry down to tail of archive </s>
|
funcom_train/31079115 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int addEntry(Object key, Entry entry) {
entry.setPool(this);
_entries.add(entry);
entry.setIndex(_entries.size());
_lookup.put(key, entry);
if (entry.isWide())
_entries.add(null);
return entry.getIndex();
}
COM: <s> add an entry to the pool using the given key </s>
|
funcom_train/37588204 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void _writerDelay() {
synchronized(_writerLock) {
try {
// Wait to prevent being flooded with println's
_writerLock.wait(_writeDelay);
}
catch (EditDocumentException e) { throw new UnexpectedException(e); }
catch (InterruptedException e) { /* Not a problem. continue */}
}
}
COM: <s> waits for a small amount of time on a shared writer lock </s>
|
funcom_train/19381459 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void pageRequestEnd(PageEvent p) {
try {
Iterator it = errorComp.iterator();
while (it.hasNext()) {
HtmlErrorCompContainer compCont = (HtmlErrorCompContainer) it.next();
compCont.getHtmlComponent().setClassName(compCont.getClassName());
}
} catch (Exception ex) {
MessageLog.writeErrorMessage(ex, this);
}
}
COM: <s> resets the classname of all the components with error </s>
|
funcom_train/21343967 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getScaleName(int i){
switch(i){
case 0:
return "ionian";
case 1:
return "dorian";
case 2:
return "phrygian";
case 3:
return "lydian";
case 4:
return "mixolydian";
case 5:
return "aeolian";
case 6:
return "locrian";
case 7:
return "melodic minor";
case 8:
return "harmonic minor";
default:
return "error";
}
}
COM: <s> get the name associated with the scale with given index </s>
|
funcom_train/46277712 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void generate() throws IOException {
setGenerators();
if (interfaceWriter != null) {
interfaceWriter.generate();
}
if (stubWriter != null) {
stubWriter.generate();
}
if (skelWriter != null) {
skelWriter.generate();
}
if (implWriter != null) {
implWriter.generate();
}
} // generate
COM: <s> write all the binding bindings stub skeleton and impl </s>
|
funcom_train/23234986 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void insertHeader(String header) {
Document doc = textPane.getDocument();
try {
if (header.length() > 0) {
doc.insertString(doc.getLength(), "<" + header + "> ", textPane.getStyle("header"));
}
} catch (BadLocationException ble) {
System.err.println("Couldn't insert initial text.");
}
}
COM: <s> insert a header </s>
|
funcom_train/24428494 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: /*
* public boolean isActive() { Calendar cal = Calendar.getInstance(); Date
* startDate = getStartDateAsDate(); Calendar cal2 = Calendar.getInstance();
* cal2.setTime(startDate); cal2.add(Calendar.SECOND, (int)getDuration());
* boolean before = cal.before(cal2); return before; }
COM: <s> if recording is active </s>
|
funcom_train/46824681 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean checkGameOver () {
// check for game over or draw
CheckersPieceMover pieceMover = checkersModel.getPieceMover();
// Rule 1 - if opponents has no pieces left then its game over.
int opponent = JogreUtils.invert (getSeatNum());
int count = pieceMover.getPlayerCount (opponent);
if (count == 0) {
CommGameOver commGameOver = new CommGameOver (IGameOver.WIN);
conn.send(commGameOver);
return true;
}
return false; // game still in progress
}
COM: <s> check to see if the game is over </s>
|
funcom_train/6328880 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void removeUnassignedUsers(GroupItem gItem, Vector users) {
if (gItem != null) {
Vector originalUsers = gItem.getAssignedUsers();
Iterator it = originalUsers.iterator();
while (it.hasNext()) {
Object user = it.next();
if (!users.contains(user)) {
unassign(gItem.getUser((String) user));
}
}
}
}
COM: <s> this method gets rid of all the users belonging to a group </s>
|
funcom_train/36932915 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private CCColor colorFromBuffer(IntBuffer theBuffer, int theIndex) {
int[] myColorChannels = new int[_myPixelFormat.numberOfChannels];
for(int i = 0; i < _myPixelFormat.numberOfChannels;i++) {
myColorChannels[i] = theBuffer.get(theIndex + _myPixelFormat.offsets[i]);
}
return new CCColor(myColorChannels);
}
COM: <s> read color from int buffer </s>
|
funcom_train/48945122 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addContact(String serviceName, String domain, String regType, int ifIndex){
try {
Contact contact = new Contact(serviceName, domain, regType, ifIndex);
contactList.put(serviceName, contact); // add to the list
} catch (DNSSDException e) {
System.out.println("Failed to add: "+ serviceName);
e.printStackTrace();
}
}
COM: <s> add a contact to the list of known services </s>
|
funcom_train/18672446 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void add(final Object obj) {
this.checkConcurrentModification();
if (this.filter.matches(obj)) {
this.last = this.cursor + 1;
ContentList.this.add(this.last, obj);
} else {
throw new IllegalAddException("Filter won't allow add of "
+ (obj.getClass()).getName());
}
this.expected = ContentList.this.getModCount();
this.lastOperation = ADD;
}
COM: <s> inserts the specified element into the list </s>
|
funcom_train/7268947 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void error(Throwable problem, String msg) {
// ThreadDeath must NOT be caught, or a thread will be left zombied
if(problem instanceof ThreadDeath)
throw (ThreadDeath)problem;
else {
Runnable doWorkRunnable = new Error(problem, msg);
GUIMediator.safeInvokeLater(doWorkRunnable);
}
}
COM: <s> displays the error to the user with a specific message </s>
|
funcom_train/2447770 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setCheckedNodes(KongaTreeNode[] nodes) {
final Set<KongaTreeNode> lookup = Sets.newHashSet(nodes);
visitAllCheckBoxNodes(new AllNodesVisitor() {
@Override
public void visit(CheckBoxNode node) {
boolean selected = lookup.contains(node);
node.setSelected(selected);
}
});
tree.repaint();
fireOverallCheckStateChanged();
}
COM: <s> sets the nodes that should be checked </s>
|
funcom_train/11373290 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void concat(Path trg, Path [] psrcs) throws IOException {
String [] srcs = new String [psrcs.length];
for(int i=0; i<psrcs.length; i++) {
srcs[i] = getPathName(psrcs[i]);
}
statistics.incrementWriteOps(1);
dfs.concat(getPathName(trg), srcs);
}
COM: <s> this is dfs only operations it is not part of file system </s>
|
funcom_train/43059020 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ASTNode getAncestor(int id) {
ASTNode ret = null;
IASTNode pNode = parent;
while(pNode != null) {
if(pNode.getId() == id) {
ret = (ASTNode)pNode;
break;
}
pNode = pNode.getParent();
}
return ret;
}
COM: <s> get specified type ancestor node </s>
|
funcom_train/7544934 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object getGetterOrSetter(String name, int index, boolean isSetter) {
if (name != null && index != 0)
throw new IllegalArgumentException(name);
Slot slot = getSlot(name, index, SLOT_QUERY);
if (slot == null)
return null;
if (slot instanceof GetterSlot) {
GetterSlot gslot = (GetterSlot) slot;
Object result = isSetter ? gslot.setter : gslot.getter;
return result != null ? result : Undefined.instance;
} else
return Undefined.instance;
}
COM: <s> get the getter or setter for a given property </s>
|
funcom_train/15407209 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public BeanProperty findSubTypeProperty(String propertyName) {
BeanProperty prop = null;
for (int i = 0, x=children.size(); i < x; i++) {
InheritInfo childInfo = children.get(i);
// recursively search this child bean descriptor
prop = childInfo.getBeanDescriptor().findBeanProperty(propertyName);
if (prop != null){
return prop;
}
}
return null;
}
COM: <s> get the bean property additionally looking in the sub types </s>
|
funcom_train/32138315 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public IGraph getGraph() {
LogManager.logDebug("Start getGraph", this);
IViewPart ivp = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(GraphSelectorView.ID);
IGraph g = null;
GraphDisplaySet gds = ((GraphSelectorView)ivp).getActiveDisplaySet();
if(null != gds)
g = gds.getActiveGraph();
LogManager.logDebug("End getGraph", this);
return g;
}
COM: <s> this method retreives the active graph from the graph selector view </s>
|
funcom_train/28254352 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void test_2_1() {
Element aaa1 = root.getElement("aaa", "1") ;
assertEquals("ccc", aaa1.getElement("ccc").getElementName()) ;
assertEquals("ddd", aaa1.getElement("ddd").getElementName()) ;
assertEquals("a1Value", aaa1.getAttribute("a1")) ;
}
COM: <s> tests the extending of an element </s>
|
funcom_train/50576565 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getStats(int seconds) {
StringBuffer sb = new StringBuffer("Thread [");
sb.append(getName());
sb.append("] failed ");
sb.append(failures);
sb.append(" out of ");
sb.append(runs);
sb.append(" runs ");
sb.append("in ");
sb.append(seconds);
sb.append(" seconds, averaging ");
sb.append(runs / seconds);
sb.append(" runs per second.");
return sb.toString();
}
COM: <s> i return a string containing the statistics for this thread </s>
|
funcom_train/31821852 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private WorkspaceDomainObject findRallyObject(long objID, String objType)throws RemoteException {
QueryResult rallyObjResult = service.query(WORKSPACE, rallyProject,
false, false, objType, "(ObjectID = \"" + objID + "\")", "",
false, 0, pageSize);
long numRec = rallyObjResult.getTotalResultCount();
if (numRec != 0) {
return (WorkspaceDomainObject) rallyObjResult.getResults()[0];
}
return null;
}
COM: <s> find a rally object by its id </s>
|
funcom_train/1807161 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initializeCommands() {
buttonReverse.setCommand(new ReverseTurnCommand());
buttonForward.setCommand(new ForwardTurnCommand());
buttonPlayingHistory.setCommand(new PlayForwardTurnCommand());
buttonStopPlayingHistory.setCommand(new StopForwardTurnCommand());
buttonBackToMenu.setCommand(new BackToMainCommand());
}
COM: <s> this function initialize the commands for the gui elements </s>
|
funcom_train/37777525 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void validate() throws ValidationException, FrameworkException {
Object value = getValue();
if (value == null ||
(value instanceof String && ((String) value).trim().length() == 0) ) {
MandatoryFieldException e = new MandatoryFieldException(getLabelToken());
log.error(null, e);
throw e;
}
}
COM: <s> the rules engine will invoke this method to perform the field validation </s>
|
funcom_train/32056876 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetToolComponent() {
GPGraphpad gp = new GPGraphpad();
AbstractActionRadioButtonImpl aa = new AbstractActionRadioButtonImpl(gp,"",(Icon)null);
JRadioButton button = (JRadioButton)(aa.getToolComponent("Edit"));
assertTrue( button.getActionCommand() == "Edit" );
}
COM: <s> test of get tool component method of class abstract action radio button </s>
|
funcom_train/22205654 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Collection getSubjectIndicators(boolean includeMergedTopics) {
if (m_provider.isTransactionOpen()) {
return getSubjectIndicators(m_provider.getOpenTransaction(),
includeMergedTopics);
} else {
ProviderTransaction txn = m_provider.openTransaction();
Collection ret = getSubjectIndicators(txn, includeMergedTopics);
txn.rollback();
return ret;
}
}
COM: <s> returns the subject indicators for this topic and optionally for all merged topics </s>
|
funcom_train/37192643 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void previousPanel() {
final Vector fakeContainer = formReportEditor.getFakeContainer();
final int fakeContainerIndex = formReportEditor.getFakeContainerIndex();
if(fakeContainerIndex > 0) {
formReportEditor.setContentPane((Container)(fakeContainer.get(fakeContainerIndex - 1)));
formReportEditor.setFakeContainerIndex(fakeContainerIndex - 1);
}
}
COM: <s> moves to the previous panel of a form report editor object </s>
|
funcom_train/3272878 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void match(String goal) throws IOException, MultiplayerException {
Token current = pop();
if (current.type != Token.STRING) {
throwException("String expected: type found = " + current, current);
}
if (!current.value.equals(goal)) {
throwException("\"" + goal + "\" expected, \"" + current.value + "\" found",
current);
}
}
COM: <s> match the specified string in the stream </s>
|
funcom_train/37573934 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setFromTimestamp(Timestamp from) {
this.from = from;
if (null==from) {
setFromYear(null);
setFromMonth(null);
setFromDay(null);
}
else {
String[] s = Utils.parseTimestamp(from.toString());
setFromYear(s[0]);
setFromMonth(s[1]);
setFromDay(s[2]);
}
}
COM: <s> sets the thru timestamp property </s>
|
funcom_train/3096442 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run() {
byte[] repBuf = new byte[1];
DatagramPacket reply = new DatagramPacket(repBuf, repBuf.length);
try {
while (true) {
socket.receive(reply);
if (repBuf[0] == packetNumber) {
timeMeasured = System.currentTimeMillis() - sendTime;
pingListenThread = null;
return;
}
}
} catch (Exception e) {
pingListenThread = null;
}
return;
}
COM: <s> run method for the listener thread </s>
|
funcom_train/48215565 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testLoadResourceFromMissingJar() throws Exception {
JDBCDataSourceType dsType = new JDBCDataSourceType();
dsType.addJdbcJar("builtin:does/not/exist.jar");
JDBCClassLoader jdbcClassLoader = (JDBCClassLoader) dsType.getJdbcClassLoader();
jdbcClassLoader.findResources("my_resource");
// test passes if previous statement doesn't throw NPE
}
COM: <s> regression test when theres a classpath entry for a built in resource </s>
|
funcom_train/8608728 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void broadcastToLegionMembers(final Player player) {
if (player.isLegionMember()) {
Legion legion = player.getLegion();
for (Player onlineLegionMember : legion.getOnlineLegionMembers()) {
PacketSendUtility.sendPacket(onlineLegionMember, new SM_MESSAGE(player, message, type));
}
}
}
COM: <s> sends message to all legion members </s>
|
funcom_train/38381965 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getURL(UIGraph graph, Object cell) {
if (cell instanceof DefaultGraphCell) {
final Object userObject = ((DefaultGraphCell) cell).getUserObject();
if (userObject instanceof UIUserObject) {
Object url = ((UIUserObject) userObject).getProperty(UIUserObject.keyURI);
if (url != null)
return url.toString();
}
}
return cell.toString();
}
COM: <s> override or implement to map from cells to urls </s>
|
funcom_train/41101469 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeLocalSubscriber(IEventSubscriber s) {
RemoveLocalSubscriberCommand rls = new RemoveLocalSubscriberCommand();
try {
RequestSender myRequestSender = RequestSender.lookup("EventManager");
rls.setSubscriber(s);
ReplyEnvelope reply = myRequestSender.send(rls);
reply.checkForRuntimeException();
} catch (Exception e) {
e.printStackTrace();
}
}
COM: <s> unregister a subscriber from the event bus </s>
|
funcom_train/862991 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean stopPlugins() {
if (isBusy())
return false;
Iterator it = _plugins.iterator();
while (it.hasNext()) {
Plugin plugin = (Plugin) it.next();
if (plugin.isRunning()) {
// _logger.info("Stopping " + plugin.getPluginName());
plugin.stop();
// _logger.info("Done");
} else {
_logger.warning(plugin.getPluginName() + " was not running");
}
}
return true;
}
COM: <s> stops all the plugins in the framework </s>
|
funcom_train/36660232 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String nextServiceBoundName(String name) {
if (name == null) {
try {
return first();
} catch (NoSuchElementException e) {
return null;
}
} else {
Iterator<String> iter = tailSet(name).iterator();
if (iter.hasNext()) {
String n = iter.next();
if (!n.equals(name)) {
return n;
} else if (iter.hasNext()) {
return iter.next();
}
}
return null;
}
}
COM: <s> get the next name from the set </s>
|
funcom_train/20885158 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testImplicitSimpleListItem() {
check("<a><i>valid</i></a>", ImplicitSimpleListItemTestDTO.class, VALID);
check("<a>not valid</a>", ImplicitSimpleListItemTestDTO.class, INVALID);
check("<a>not valid</a>", ImplicitSimpleListItemTestDTO.class, VALIDATION_OFF);
}
COM: <s> tests validation for a implicit simple list item value </s>
|
funcom_train/28109002 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setAlarm(ServiceObject so, int alarmValue) {
/* if (alarmValue == 1) {*/
// set Alarm thread
athread = new AlarmThread( so );
athread.start( );
/* } else {
// delete Alarm
State state = so.getState( STATE_ALARM );
state.setValue("0");
if ( athread != null ) athread.interrupt();
}*/
}
COM: <s> set the alarm for the controlled illumination device </s>
|
funcom_train/50911847 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public IntRange getRange() throws ArrayIndexOutOfBoundsException {
if (nelem == 0) {
throw new ArrayIndexOutOfBoundsException();
}
IntRange r = new IntRange();
for (int i = 0; i < nelem; i++) {
r.add(array[i]);
}
return r;
}
COM: <s> range of array </s>
|
funcom_train/2697402 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void init(IWorkbench workbench) {
foregroundColorImage = new Image(Display.getDefault(),
SET_COLOR_BUTTON_IMAGE_WIDTH,
SET_COLOR_BUTTON_IMAGE_HEIGHT);
backgroundColorImage = new Image(Display.getDefault(),
SET_COLOR_BUTTON_IMAGE_WIDTH,
SET_COLOR_BUTTON_IMAGE_HEIGHT);
}
COM: <s> extra initialization code here </s>
|
funcom_train/43501251 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public VariableResolver getResolver(String name, VariableType type) {
VariableResolver resolver = this._byname.get(name);
// try to find a resolver by type
if (resolver == null && type != null)
resolver = this._bytype.get(type.getName());
// fall back on the default otherwise
return resolver != null? resolver : DEFAULT_RESOLVER;
}
COM: <s> returns the resolver used for the variable of the specified name or type </s>
|
funcom_train/50310727 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals("content")) {
String s = ((SplashContentModel)evt.getNewValue()).getConsoleText();
if (s != null) {
System.out.println(s);
}
}
}
COM: <s> this method gets called when a bound property is changed </s>
|
funcom_train/21701593 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void saveAppointmentsByWizard(Exam exam, Date startDate, String place, int count, long minutes, long breakMinutes) {
Appointment app;
Date date = startDate;
for( int i = 0; i < count; i++ ) {
app = new AppointmentImpl();
app.setDuration((int)minutes);
app.setDate(date);
app.setExam(exam);
app.setPlace(place);
this.saveAppointment(app);
date = new Date( date.getTime() + ( minutes * 60 * 1000) + ( breakMinutes * 60 * 1000 ));
}
}
COM: <s> persists a whole set of appointments </s>
|
funcom_train/11296921 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setCache(int size) {
// since the cache is only used during parse, use same sync object
synchronized (parser) {
if (size <= 0) {
cache = null;
} else if (cache == null || cache.size() != size) {
cache = new SoftCache<String, ASTJexlScript>(size);
}
}
}
COM: <s> sets a cache for expressions of the defined size </s>
|
funcom_train/51639535 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private IProblemRequestorExtension getProblemRequestorExtension() {
IDocumentProvider p= fEditor.getDocumentProvider();
if (p == null) {
// work around for https://bugs.eclipse.org/bugs/show_bug.cgi?id=51522
p= JavaPlugin.getDefault().getCompilationUnitDocumentProvider();
}
IAnnotationModel m= p.getAnnotationModel(fEditor.getEditorInput());
if (m instanceof IProblemRequestorExtension)
return (IProblemRequestorExtension) m;
return null;
}
COM: <s> returns the problem requestor for the editors input element </s>
|
funcom_train/437475 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void load(File file) throws IOException, ClassNotFoundException {
Codec codec = new CodecFactory().getCodec(file);
if (codec != null) {
FileInputStream stream = null;
Workbook workbook;
try {
// Reads workbook data
stream = new FileInputStream(file);
workbook = codec.read(stream);
} finally {
try {
if (stream != null)
stream.close();
} catch (IOException e) {}
}
// Loads the workbook
workbooks.put(workbook, file);
fireSpreadsheetAppEvent(workbook, file, SpreadsheetAppEvent.Type.LOADED);
} else
throw new IOException("Codec could not be found");
}
COM: <s> loads a workbook from the given file </s>
|
funcom_train/15411437 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int nextEmptySlot() {
// search forward
while(++pos < slots.length) {
if (slots[pos] == null){
return pos;
}
}
// search from beginning
pos = -1;
while(++pos < slots.length) {
if (slots[pos] == null){
return pos;
}
}
// not expecting this
throw new RuntimeException("No Empty Slot Found?");
}
COM: <s> return the position of the next empty slot </s>
|
funcom_train/48898639 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void destroySession() {
Socket s=getSocket();
if (s!=null) {
try {
s.close();
}
catch (IOException ioe) {
server.getLogger().warning("Unable to close client socket: "+ioe.getMessage());
}
} //s!=null
} //destroySession
COM: <s> destroys the user session object </s>
|
funcom_train/14028071 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setProjectInWindowTitle(final String project) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
if (project.equals("")) {
_frame.setTitle("Record");
}
else {
_frame.setTitle("Record - "+project);
}
}
});
}
COM: <s> sets the project name in the window title </s>
|
funcom_train/48414457 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void lastAccess() {
this.lastAccess = new Timestamp(new java.util.Date().getTime());
//Logger.debug(this.login+" hashcode: "+((Object) this).hashCode());
//Logger.debug("Set lastAccess() "+this.login+" "+lastAccess);
}
COM: <s> last access sets the time when the user </s>
|
funcom_train/13314703 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void visit(NadicRelationUnion n, A argu) {
n.nodeToken.accept(this, argu);
n.nodeOptional.accept(this, argu);
n.nodeToken1.accept(this, argu);
n.relationExpCommalist.accept(this, argu);
n.nodeToken2.accept(this, argu);
}
COM: <s> node token union </s>
|
funcom_train/6446480 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void checkAuthorization(MethodInvocation methodInvocation) throws org.openejb.OpenEJBException{
DeploymentInfo deployInfo = methodInvocation.getDeploymentInfo();
boolean authorized = OpenEJB.getSecurityService().isCallerAuthorized(methodInvocation.getPrincipal(), deployInfo.getAuthorizedRoles(methodInvocation.getMethod()));
if ( !authorized )
throw new org.openejb.ApplicationException(new RemoteException("Unauthorized Access by Principal Denied"));
}
COM: <s> checks the authorization of the client requesting access to the ri server </s>
|
funcom_train/17006478 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run() {
// sleep for 1 seconds
try {
this.sleep(1000);
} catch(InterruptedException ie) {
System.out.println("Exception during thread sleep");
}
while(true) {
try {
this.sleep(1000);
} catch(InterruptedException ie) {
System.out.println("Exception during thread sleep");
}
if ((numberGenerator1.nextFloat() * 10) > 4) {
manageNodes();
} else {
manageLinks();
}
screen.display();
}
}
COM: <s> overrides run of the code thread code class </s>
|
funcom_train/9577240 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Gene getGene(String id) {
// check the easy solution
if (genes.containsKey(id)) {
return genes.get(id);
}
// ok, if it's not in the simple solution
if (this.aliasList.containsKey(id)) {
String st = aliasList.get(id);
if (genes.containsKey(st)) {
return genes.get(st);
}
}
return null;
}
COM: <s> gets the specified gene using the locus or the </s>
|
funcom_train/15721289 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void closeProject(IPath projectPath) {
checkAssertion("a workspace must be open", this.isOpen); //$NON-NLS-1$
try {
getJavaProject(projectPath).getProject().close(null);
} catch (CoreException e) {
e.printStackTrace();
}
}
COM: <s> close a project from the workspace </s>
|
funcom_train/18869060 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CurrencyNode getCurrency(final String symbol) {
ReadLock commodityReadLock = commodityLock.readLock();
commodityReadLock.lock();
try {
CurrencyNode rNode = null;
for (CurrencyNode node : getCurrencies()) {
if (node.getSymbol().equals(symbol)) {
rNode = node;
break;
}
}
return rNode;
} finally {
commodityReadLock.unlock();
}
}
COM: <s> returns a currency node given the symbol </s>
|
funcom_train/42095726 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createOneWall(Polygon polygon, int height, int length, int side) {
polygon.addPoint(0, height);
for (int k = 0; k < length; k = k + 50) {
polygon.addPoint(k,(int)( height + side * ((RISE_COEFICIENT * k) + (Math.random() * 45) - 45)));
}
polygon.addPoint(length, height);
}
COM: <s> creates one wall according to the coeficients given </s>
|
funcom_train/32739168 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public float getReferenceSize(int idx){
int imgId= m_viewModel.getReferenceImgId();
Image img = m_viewModel.getImage(imgId);
int dim =img.getDimensions().length;
float[] referenceSize = {0,0,0};
for (int i = 0; i < dim; i++)
referenceSize[i] = img.getPixelSpacing(i) * img.getDimension(i);
return referenceSize[idx];
}
COM: <s> returns the reference image size </s>
|
funcom_train/2289923 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeResourceFromProject(String resourcename) throws CmsException {
// TODO: this should be also possible if the resource has been deleted
CmsResource resource = readResource(resourcename, CmsResourceFilter.ALL);
getResourceType(resource).removeResourceFromProject(this, m_securityManager, resource);
}
COM: <s> removes a resource from the current project of the user </s>
|
funcom_train/11735611 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testMultiValuedReferenceJoin() throws Exception {
String join = "SELECT a.*, b.*"
+ " FROM [nt:unstructured] AS a"
+ " INNER JOIN [nt:unstructured] AS b ON a.[jcr:uuid] = b.testref";
checkResult(qm.createQuery(join, Query.JCR_SQL2).execute(), 3);
}
COM: <s> test case for a </s>
|
funcom_train/17386585 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void unknownException(Exception e) {
Enumeration<ErrorPlugin> enumeration = errorPlugins.elements();
while (enumeration.hasMoreElements()) {
ErrorPlugin plugin = (ErrorPlugin) enumeration.nextElement();
((ErrorCallback) plugin.getCallback()).unknownException(e, plugin.getData());
}
}
COM: <s> this is called if an exception makes it to the top level </s>
|
funcom_train/25203914 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void readPairs(List<T2CharString> stack) {
int n = stack.size();
pairs = new T2PairNumber[n / 2];
for (int i = 0; i < n; i += 2) {
T2Number v1 = (T2Number) stack.get(i);
T2Number v2 = (T2Number) stack.get(i + 1);
T2PairNumber pn = new T2PairNumber(v1, v2);
pairs[i / 2] = pn;
}
}
COM: <s> reads the pairs </s>
|
funcom_train/14070879 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void x10Sleep() {
// Give it a bit to actually do something (remember, it's *SLOW*)
// this is a "hit-or-miss" number that seems to work
try { Thread.sleep(X10_SLEEP); } catch (InterruptedException e) { /* nada */ }
// TODO other option is to check memory address 0x0166, bit 0 - if "1" wait, "0" you're good to go
}
COM: <s> snooze between sending x10 commands since theyre b i slow i b </s>
|
funcom_train/10865312 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testExclude() throws IOException {
Set<String> exclusionSet = new HashSet<String>();
exclusionSet.add("studenta");
Analyzer a = new PolishAnalyzer(TEST_VERSION_CURRENT,
PolishAnalyzer.getDefaultStopSet(), exclusionSet);
checkOneTermReuse(a, "studenta", "studenta");
checkOneTermReuse(a, "studenci", "student");
}
COM: <s> test use of exclusion set </s>
|
funcom_train/37518159 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void add( CSourceField field ) {
assertTrue( expandable );
// !FIXME!function this is a hack to suppress errors on
// multiple generic functions in a single collection
String id = field.ident();
if( hashed.containsKey( id ) ) {
id = id + uniquifier;
uniquifier++;
}
field.setIndex( hashed.size() );
hashed.put( id, field );
}
COM: <s> adds a field </s>
|
funcom_train/29925158 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void loadInboundMessageSettings() throws IOException{
// Open and read properties file
File inputFile = new File(inboundMessageIniFile);
FileInputStream in = new FileInputStream(inputFile);
Properties p = new Properties();
p.load(in);
in.close();
inboundMessageProps = p;
}
COM: <s> loads the setting for </s>
|
funcom_train/32765712 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Connection getConnection(String urlSpec, String user, String password) throws DatabaseException {
try {
return DriverManager.getConnection(urlSpec, user, password);
}
catch(SQLException exception) {
Logger.getLogger("global").log( Level.SEVERE, "Error connecting to the database at URL: \"" + urlSpec + "\" as user: " + user , exception );
throw new DatabaseException("Exception connecting to the database.", this, exception);
}
}
COM: <s> get a new database connection </s>
|
funcom_train/12652581 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setOther(String other) {
// Empty strings are set to null
if (other != null) {
other = other.trim();
if (other.length() == 0)
other = null;
}
if ((cachedOther == other) || ((cachedOther != null) && cachedOther.equals(other)))
return;
attributeCharacteristicHolder.setString(characteristicCode, other);
cachedOther = other;
}
COM: <s> sets a not otherwise specified attribute for this characteristic </s>
|
funcom_train/169244 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addMatch(MatchDetail matchDetail, boolean showUnavailable) {
for (Iterator iter = matchDetail.getPerformances().iterator(); iter.hasNext();) {
addPerformance((PlayerPerformance) iter.next(), showUnavailable);
}
addRating(matchDetail.getRating());
addStars(matchDetail.getStars());
matchNumber++;
}
COM: <s> add a match to the report </s>
|
funcom_train/46930801 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testIfWithArithmeticExpression() throws Exception {
Expression e = ExpressionFactory.createExpression("if ((x * 2) + 1 == 5) true;");
Map jc = new HashMap();
jc.put("x", new Integer(2));
Object o = e.evaluate(jc);
assertEquals("Result is not true", Boolean.TRUE, o);
}
COM: <s> test the if statement evaluates arithmetic expressions correctly </s>
|
funcom_train/18740036 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public DFAState addState(Set<RegNode> nodes, boolean isFinal) {
DFAState result =
new DFAState(this.stateMap.size(), nodes, false, isFinal);
DFAState oldState = this.stateMap.put(nodes, result);
assert oldState == null;
return result;
}
COM: <s> adds a normalised state corresponding to a given set of regular automaton nodes </s>
|
funcom_train/22403242 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getTeamScore(PloyPieceState pieceState, PloyPlayerTeam team) {
int ret = 0;
Iterator ployPlayerIterator = getPloyPlayerIterator();
while (ployPlayerIterator.hasNext()) {
PloyPlayer player = (PloyPlayer) ployPlayerIterator.next();
if (player.getTeam() == team) {
ret += getPlayerScore(pieceState, ployPlayers.indexOf(player));
}
}
return ret;
}
COM: <s> computes the total current score for the provided team in the given state </s>
|
funcom_train/47948192 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ParameterMetaData findLatitudeIgnoreCase() {
ParameterMetaData parameterMetaData = null;
for (String name : NetCdfReader.LATITUDE_NAMES) {
parameterMetaData = getParameterMetaDatas(name);
if (parameterMetaData != null) {
break;
}
parameterMetaData = getParameterMetaDataFromStandardName(name);
if (parameterMetaData != null) {
break;
}
}
return parameterMetaData;
}
COM: <s> finds parameter meta data corresponding to a latitude name </s>
|
funcom_train/34313999 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean removeChildNode(LabelNode node) {
if (node == null) {
throw new ArgumentNullException("node");
}
if (childrenNodes.contains(node)) {
for (LabelNode item : childrenNodes) {
if (item.equals(node)) {
((LabelNodeImpl) item).setParent(null);
break;
}
}
}
return childrenNodes.remove(node);
}
COM: <s> removes the specified </s>
|
funcom_train/26563581 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testList() {
choose = new List("Choose Items", Choice.MULTIPLE);
choose.setTicker(new Ticker("listTest"));
choose.addCommand(backCommand);
choose.setCommandListener(this);
choose.append("Item 1", null);
choose.append("Item 2", null);
choose.append("Item 3", null);
display.setCurrent(choose);
currentMenu = "list";
}
COM: <s> test the list component </s>
|
funcom_train/4422441 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setWaypointType(final Spinner typeRef, Waypoint pt) {
String type;
switch (typeRef.getSelectedItemPosition()) {
case 0:
type = "Final Location";
break;
case 1:
type = "Parking Area";
break;
case 2:
type = "Question to Answer";
break;
case 3:
type = "Reference Point";
break;
case 4:
type = "Stages of a Multicache";
break;
case 5:
type = "Trailhead";
break;
default:
type = "Other";
break;
}
pt.setType("Waypoint|" + type);
pt.setSymbol(type);
}
COM: <s> sets the right waypoint type from the type spinner </s>
|
funcom_train/11663622 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void updateDocument(Object docKey, Document document) throws DBException {
if (log.isInfoEnabled()) {
log.info(debugHeader() + "Update document: " + docKey);
}
putDocument(createNewKey(docKey), document, ACTION_UPDATE);
}
COM: <s> update document updates existing document in a xindice collection </s>
|
funcom_train/38289583 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Point transform(Point p) {
Rectangle2D rect = new Rectangle(p.x, p.y, 0, 0);
rect = this.matrixStack.peek().transform(rect);
// TODO conversion check
p.x = (int) Math.round(rect.getX());
p.y = (int) Math.round(rect.getY());
return p;
}
COM: <s> transforms point into coordinate system of actual viewport </s>
|
funcom_train/28351013 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private double getInterpVal(double[] arr_x, double[] arr_y, int nP, double x) {
int ind0 = getInd0(arr_x, nP, x);
int ind1 = ind0 + 1;
return arr_y[ind0] + (arr_y[ind1] - arr_y[ind0]) * (x - arr_x[ind0]) / (arr_x[ind1] - arr_x[ind0]);
}
COM: <s> returns the interpolated value of y x </s>
|
funcom_train/27757795 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void callClosure(String event, String signal) {
if (closure != null) {
Element eV = new ElementObject(event);
eV.setAttribute(Keywords.DX_REASON, signal);
eV.setAttribute(Keywords.DX_WHEN, Long.toString(when));
signalEvent(eV);
}
}
COM: <s> when a button is pressed menu item selected etc </s>
|
funcom_train/31486197 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testEncodePublicData() throws Exception {
//Must test for the following parameters!
//PGPDataOutputStream;
FileOutputStream fos = new FileOutputStream(new File(testdir, "TestDSA1.out"));
dsa.encodePublicData(new PGPWrapperDataOutputStream(fos));
fos.close();
assertTrue(true);
}
COM: <s> test method void encode public data pgpdata output stream </s>
|
funcom_train/26453715 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setType(String type) {
TYPE = type;
for (int i=0; i<observers.size(); i++) {
SensorObserver observer = (SensorObserver)observers.get(i);
if (observer != null) {
observer.sensorUpdated(getHostName(), this);
} else {
observers.remove(i);
}
}
}
COM: <s> sets the sensors type </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.