__key__
stringlengths 16
21
| __url__
stringclasses 1
value | txt
stringlengths 183
1.2k
|
---|---|---|
funcom_train/50171408 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ArrayList validate(boolean highlightErrors) {
ArrayList alerts = new ArrayList();
label.setForeground(Color.black);
if ( editFieldValidationService == null) {
//no errors reported
return alerts;
} //end if ()
alerts.addAll(editFieldValidationService.validate(pedroFormContext,
getFieldValue()));
if ( alerts.size() > 0) {
if ( highlightErrors == true) {
label.setForeground(Color.red);
} //end if ()
} //end if ()
return alerts;
}
COM: <s> checks for errors in the field </s>
|
funcom_train/15581220 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void assertTextInElement(String elementID, String text) {
Element element = dialog.getElement(elementID);
Assert.assertNotNull("Unable to locate element with id \"" + elementID + "\"", element);
Assert.assertTrue("Unable to locate [" + text + "] in element \"" + elementID + "\"",
dialog.isTextInElement(element, text));
}
COM: <s> assert that a given element contains specific text </s>
|
funcom_train/29882256 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void createPclPagesJTree() {
mPosTree = new PosTree(this, mShortName);
mPosTree.addTreeSelectionListener();
mPosTree.setCellRenderer();
if (mOpenPCLViewer.getPosStartupOptions().getShowPagesTree()) {
mTreeJScrollPane.setViewportView(mPosTree.getPagesJTree());
openTreePanel(false);
}
}
COM: <s> make the pages jtree and show on the screen </s>
|
funcom_train/50582478 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void convert() {
try {
log.debug("Conversion started...");
Migrator.migrateUsers();
Migrator.migrateForums();
Migrator.migratePrivateMessageFolders();
Migrator.migratePrivateMessage();
log.debug("Conversion complete...");
} catch (Exception e) {
log.error("Exception during conversion", e);
}
}
COM: <s> performs conversion of vbulletin database to mvnforum database </s>
|
funcom_train/4008590 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void paint(Graphics g) {
g.setColor(0xffffff);
g.fillRect(0, 0, getWidth(), getHeight());
g.translate((getWidth() - rabbit.getWidth()) / 2,
(getHeight() - rabbit.getHeight()) / 2);
g.drawImage(rabbit, 0, 0, Graphics.TOP | Graphics.LEFT);
}
COM: <s> paints the screen </s>
|
funcom_train/16573467 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void defineDecimalFormat() {
String s1 = getScaleFormat( minscale );
String s2 = getScaleFormat( maxscale );
if (s1.length() < s2.length())
s1 += s2.substring( s1.length() );
parseFormater = new BigDecimalFormat( s1 );
if (firstInit) {
setCharSet( getCharSet()+getFormatChars() );
firstInit = false;
}
}
COM: <s> internal method for setting the decimal format </s>
|
funcom_train/50804990 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Integer getOwner() {
Integer ret = null;
int max = -1;
Iterator i = influences.keySet().iterator();
while (i.hasNext()) {
Integer h = (Integer)i.next();
if (max < getInfluence(h.intValue())) {
max = getInfluence(h.intValue());
ret = h;
}
}
return ret;
}
COM: <s> return the house with the most influence </s>
|
funcom_train/34960885 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public SchoolAddress update(SchoolAddress entity) {
EntityManagerHelper.log("updating SchoolAddress instance", Level.INFO,
null);
try {
SchoolAddress result = getEntityManager().merge(entity);
EntityManagerHelper.log("update successful", Level.INFO, null);
return result;
} catch (RuntimeException re) {
EntityManagerHelper.log("update failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> persist a previously saved school address entity and return it or a copy </s>
|
funcom_train/6226532 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) {
boolean isEnabled = (tabPane.isEnabledAt(tabIndex));
if(!tabPane.isEnabled()) isEnabled = false;
boolean isRollover = (rollover == tabIndex);
drawXpTabBorder(g, tabPlacement, x, y, w, h, isSelected, isEnabled, isRollover);
}
COM: <s> draws the border around each tab </s>
|
funcom_train/964873 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Dimension preferredLayoutSize(Container parent) {
Component label = getLabel(parent);
Dimension labelSize = label.getPreferredSize();
Insets insets = parent.getInsets();
int width = labelSize.width + insets.left + insets.right;
int height = labelSize.height + insets.top + insets.bottom;
return new Dimension(width, height);
}
COM: <s> computes and returns the preferred size dimensions </s>
|
funcom_train/1942662 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void folderExportResource(Folder folder) {
broadcaster.onResource(folder.getId(),
hostDomain + "/folderContent.spr?id=" + folder.getId() +
"&folderName=" +
folder.getName() +
"&mode=2&statistic=false");
}
COM: <s> exports a folder into the resources section of scorm </s>
|
funcom_train/25587201 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getLoadCommand() {
if (loadCommand == null) {//GEN-END:|21-getter|0|21-preInit
// write pre-init user code here
loadCommand = new Command("Load", Command.ITEM, 0);//GEN-LINE:|21-getter|1|21-postInit
// write post-init user code here
}//GEN-BEGIN:|21-getter|2|
return loadCommand;
}
COM: <s> returns an initiliazed instance of load command component </s>
|
funcom_train/20024006 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void loadCameraInitialPosition() {
Vector3f cameraPosition = new Vector3f(this.store.getFloat(PreferenceConst.CAMERA_DEFAULT_X), this.store.getFloat(PreferenceConst.CAMERA_DEFAULT_Y), this.store.getFloat(PreferenceConst.CAMERA_DEFAULT_Z));
this.worldContext.getDataHolder().setVector3Value(IWorldContext.CAMERA_INITIAL_POSITION, cameraPosition);
}
COM: <s> loads the camera initial position </s>
|
funcom_train/3176126 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public interface Iterator {
/** change value to iterate over */
public void setValue(String value);
/** relative level of indent (normaly 0) */
public int getIndent();
/** tag for line */
public String getTag();
/** value for line */
public String getValue();
/** set to next line */
public boolean next();
} //LineIterator
COM: <s> an iterator for reading multiple lines </s>
|
funcom_train/50899192 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public InvoiceLine getLine(JDCConnection oConn, int iPgLine) throws SQLException {
InvoiceLine oRetVal = new InvoiceLine();
if (oRetVal.load(oConn, new Object[]{getStringNull(DB.gu_invoice,null),new Integer(iPgLine)}))
return oRetVal;
else
return null;
} // getLine()
COM: <s> get invoice line by number </s>
|
funcom_train/50879164 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getNumPoints(){
int tempNumPoints = 0;
if (myPolygons != null){
for (int i=0; i<myPolygons.length; i++){
tempNumPoints = tempNumPoints + myPolygons[i].getNumPoints();
}
}
return tempNumPoints;
};
COM: <s> return the number of points in this shape </s>
|
funcom_train/1479263 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeGlobalItem(int id, int x, int y, int height) {
if (id < 0 || id >= maxListedItems) {
return;
}
for (Player p : engine.players) {
if (p == null) {
continue;
}
frames.removeGroundItem(p, id, x, y, height);
}
}
COM: <s> removes an item for everyone within distance </s>
|
funcom_train/11730205 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testInitialLocalNamespaceMappings() throws RepositoryException {
String[] uris = nsr.getURIs();
for (int i = 0; i < uris.length; i++) {
assertEquals(
"The initial local namespace prefix of \""
+ uris[i] + "\" must match the persistent registry mapping",
nsr.getPrefix(uris[i]),
session.getNamespacePrefix(uris[i]));
}
}
COM: <s> test case for the initial set of local namespace mappings as specified </s>
|
funcom_train/28776269 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String tojstring() {
Buffer sb = new Buffer();
sb.append( "(" );
for ( int i=1,n=narg(); i<=n; i++ ) {
if (i>1) sb.append( "," );
sb.append( arg(i).tojstring() );
}
sb.append( ")" );
return sb.tojstring();
}
COM: <s> convert the list of varargs values to a human readable java string </s>
|
funcom_train/4529198 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getStatusText(boolean details) {
return "Upgrade for version " + getVersion()
+ (upgradeStatus<100 ?
" is in progress. Status = " + upgradeStatus + "%" :
" has been completed."
+ "\nUpgrade is " + (finalized ? "" : "not ")
+ "finalized.");
}
COM: <s> get upgrade status data as a text for reporting </s>
|
funcom_train/8815159 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PhaseDTO getPhaseFromModel(PhaseModelDTO model) {
if (mappedPhases == null) {
mappedPhases = new HashMap<PhaseModelDTO, PhaseDTO>();
for (final PhaseDTO phase : getPhasesDTO()) {
mappedPhases.put(phase.getPhaseModelDTO(), phase);
}
}
return mappedPhases.get(model);
}
COM: <s> gets the phase which implements the given model for the current project </s>
|
funcom_train/24118214 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSingleton() {
final InGameConstantsManager manager =
InGameConstantsManager.getInstance();
assertNotNull("Instance is null", manager);
final InGameConstantsManager manager2 =
InGameConstantsManager.getInstance();
assertEquals("Instances not equals", manager, manager2);
}
COM: <s> test singleton pattern of the manager </s>
|
funcom_train/31396533 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addListener(HSSFListener lsnr, short sid) {
List list = null;
Object obj = records.get(new Short(sid));
if (obj != null) {
list = (List)obj;
} else {
list = new ArrayList(1); //probably most people will use one listener
list.add(lsnr);
records.put(new Short(sid),list);
}
}
COM: <s> add an event listener for a particular record type </s>
|
funcom_train/7621392 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean finishComposingText() {
if (DEBUG) Log.v(TAG, "finishComposingText");
final Editable content = getEditable();
if (content != null) {
beginBatchEdit();
removeComposingSpans(content);
endBatchEdit();
sendCurrentText();
}
return true;
}
COM: <s> the default implementation removes the composing state from the </s>
|
funcom_train/22208141 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setOutputStream(OutputStream newStream) {
OutputStream oldStream = getOutputStream();
outputStream = newStream;
try {
fireVetoableChange("outputStream", oldStream, newStream);
} catch (PropertyVetoException e) {
logVetoedChange(e);
outputStream = oldStream;
}
}
COM: <s> sets the output stream to which the merged result is serialized </s>
|
funcom_train/5711954 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetNumberOfControllers() throws Exception{
RCapi capi = new RCapi();
int nr = capi.getNumberOfControllers();
assertTrue("check number of controller not being 0", nr != 0);
System.out.println("Number of controllers: " + nr);
}
COM: <s> tests the retrieval of the number of controllers </s>
|
funcom_train/32830112 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public RowDifference compare(Row actualRow) {
RowDifference rowDifference = new RowDifference(this, actualRow);
compareColumns(primaryKeyColumns, actualRow, rowDifference);
compareColumns(columns, actualRow, rowDifference);
if (rowDifference.isMatch()) {
return null;
}
return rowDifference;
}
COM: <s> compares the row with the given actual row </s>
|
funcom_train/33280026 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String substringData(final int offset, final int count) {
final int length = data_.length();
if (count < 0 || offset < 0 || offset > length - 1) {
throw new IllegalArgumentException("offset: " + offset + " count: " + count);
}
final int tailIndex = Math.min(offset + count, length);
return data_.substring(offset, tailIndex);
}
COM: <s> extracts a substring from character data </s>
|
funcom_train/44313508 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getRawSize(boolean raw) {
if (raw) {
switch (systype) {
case DSPFConstants.OBJ_SYS_DATE :
return 8;
case DSPFConstants.OBJ_SYS_USER :
return 10;
case DSPFConstants.OBJ_SYS_TIME :
return 8;
case DSPFConstants.OBJ_SYS_SYSNAME :
return 8;
}
} else {
if (getCDE() != null) {
String s = getRawMessage(true);
return DSPFConstants.editCode(s, 0, getCDE()).length();
} else
return getRawSize(true);
}
return 0;
}
COM: <s> gets the raw cooked unformatted formatted size of the object </s>
|
funcom_train/42651817 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Class resolveClass(String name) throws ClassNotFoundException {
if(getUnitClassLoader() == null) {
throw new RuntimeException("getUnitClassLoader() returns null... is there a problem with the persistence connector?");
}
return getUnitClassLoader().loadClass(name);
}
COM: <s> uses the loader returned by </s>
|
funcom_train/35157250 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
return "mininum: (" + min.x + ", " + min.y + ", " + min.z + ") "
+ "maximum: (" + max.x + ", " + max.y + ", " + max.z + ")";
}
COM: <s> generates the string to represent a bounds object in a nice format for </s>
|
funcom_train/51812211 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void assertSetTest(SimpleTestService service) {
Set set = service.getSet();
assertNotNull("set is null", set);
assertTrue("Doesn't contain string", set.contains("bar"));
set.remove("bar");
assertTrue("Bean not created", set.toArray()[0] instanceof SimpleTestService);
}
COM: <s> common asserts for the code set code based tests </s>
|
funcom_train/3372657 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void preferenceChanged(View child, boolean width, boolean height) {
super.preferenceChanged(child, width, height);
if (TableView.this.multiRowCells && height) {
for (int i = rowIndex - 1; i >= 0; i--) {
RowView rv = TableView.this.getRow(i);
if (rv.multiRowCells) {
rv.preferenceChanged(null, false, true);
break;
}
}
}
}
COM: <s> this is called by a child to indicate its </s>
|
funcom_train/33725934 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void drawShadowText(String t, int x, int y, Color foreColor, Graphics g){
g.setColor(new Color(50, 50, 50));
g.drawString(t, ShiftEast(x, 2), ShiftSouth(y, 2));
//g.setColor(new Color(220, 220, 220));
//g.setColor(backColor);
g.setColor(foreColor);
g.drawString(t, x, y);
}
COM: <s> draw the text with shadow </s>
|
funcom_train/39540479 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected DocumentListener getSearchFieldListener() {
DocumentListener l = new DocumentListener() {
public void changedUpdate(DocumentEvent ev) {
// JW - really?? we've a PlainDoc without Attributes
refreshModelFromDocument();
}
public void insertUpdate(DocumentEvent ev) {
refreshModelFromDocument();
}
public void removeUpdate(DocumentEvent ev) {
refreshModelFromDocument();
}
};
return l;
}
COM: <s> create code document listener code for the search field that calls </s>
|
funcom_train/33398781 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void endOfMedia() throws ClockStoppedException {
synchronized (controllers) {
// Wait for all of the managed Controllers to stop or
// post an error. controllerUpdate() will catch such
// events and notify us.
// controllerError was reset when doSyncStart() was called
while (!areControllersStopped()) {
try {
controllers.wait();
} catch (InterruptedException e) {
}
}
}
super.endOfMedia();
}
COM: <s> indicates to the framework that the end of media has been reached </s>
|
funcom_train/41979921 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean login(String username) {
print("public boolean login(String username = " + username + ")");
if( ! validUsername(username)) {
if(usersBackup.containsKey(username)) {
LinkedList backup = usersBackup.get(username);
users.put(username, backup);
}
else {
users.put(username, new LinkedList<String>());
}
return true;
}
else {
return false;
}
}
COM: <s> p log in retrieving posts if previously logged out p </s>
|
funcom_train/6206541 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void updateStates() {
disposeStates();
List states = getWorkingCopy().getStates();
Iterator it = states.iterator();
// Create the initial list of states.
while (it.hasNext()) {
IProcessState state = (IProcessState) it.next();
IGaijinWebFlowState gaijinState = new GaijinWebFlowState(state, this);
getStateMap().put(gaijinState.getId(), gaijinState);
}
}
COM: <s> update the map of states from the working copy </s>
|
funcom_train/7660364 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testIterator() {
CopyOnWriteArraySet full = populatedSet(3);
Iterator i = full.iterator();
int j;
for(j = 0; i.hasNext(); j++)
assertEquals(j, ((Integer)i.next()).intValue());
assertEquals(3, j);
}
COM: <s> iterator returns an iterator containing the elements of the set </s>
|
funcom_train/18104512 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int readInt() throws IOException {
if (readBytes(intArray, 0, 4) < 4)
throw new IOException("malformed wave data");
return ((intArray[3] & 0xFF) << 24) |
((intArray[2] & 0xFF) << 16) |
((intArray[1] & 0xFF) << 8) |
(intArray[0] & 0xFF);
}
COM: <s> read an integer from source stream </s>
|
funcom_train/7821577 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean moveJob(int worker, int job, boolean update) {
unassign(job, update);
assignment[job] = worker;
if (update) {
workerTotalTime[worker] += settings.getTime(worker, job);
globalCost += settings.getCost(worker, job);
}
return workerTotalTime[worker] <= settings.getLimitTime(worker);
}
COM: <s> move the given job to the worker </s>
|
funcom_train/278386 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setXmlDbElementName(String xmlDbElementName) {
char[] chars = xmlDbElementName.toCharArray();
for (int i=0;i < chars.length; i++) {
if (!Character.isJavaIdentifierPart(chars[i])) {
addError("{0} is not a valid character in an xml element name", new Object[]{new Character(chars[i])});
}
}
this.xmlDbElementName = xmlDbElementName;
}
COM: <s> sets the xml db element name </s>
|
funcom_train/21503353 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addDefinitionPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_BlockInput_definition_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_BlockInput_definition_feature", "_UI_BlockInput_type"),
DMLPackage.Literals.BLOCK_INPUT__DEFINITION,
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the definition feature </s>
|
funcom_train/46680278 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Timeline makeCopy(){
Timeline result = new Timeline();
for (int pos=0; pos<getNumberOfTimelineItems(); pos++){
TimelineItem tli = getTimelineItemAt(pos);
result.addElement(tli.makeCopy());
}
result.updatePositions();
return result;
}
COM: <s> returns a copy of this timeline </s>
|
funcom_train/47545520 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setTopItem (TreeItem item) {
if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
if (item.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT);
if (item.parent != this) return;
int /*long*/ path = OS.gtk_tree_model_get_path (modelHandle, item.handle);
showItem (path, false);
OS.gtk_tree_view_scroll_to_cell (handle, path, 0, true, 0, 0);
OS.gtk_tree_path_free (path);
}
COM: <s> sets the item which is currently at the top of the receiver </s>
|
funcom_train/38464131 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createMap(ObjectFieldData data, StorableClass cls, JSOTransaction jsotx) throws SQLException, StorageException {
Map container = (Map)data.getData(cls.getContainerValueField());
JSOOID oid = JSOOID.safellyCast(data.getOID());
createMapEntries(oid,container.entrySet(),jsotx);
}
COM: <s> creates a map </s>
|
funcom_train/25011049 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void drawBottomRight(final GL2 gl) {
if (listMap.get(GemfireBorderSprite.BOTTOM_RIGHT) != null) {
gl.glPushMatrix();
gl.glColor4fv(super.getColor());
// move to bottom-right corner of sprite
double x = super.getPosition().getX();
x += super.getWidth();
x -= imageInsets.right;
gl.glTranslated(
x,
super.getPosition().getY(),
0d
);
gl.glCallList(listMap.get(GemfireBorderSprite.BOTTOM_RIGHT));
gl.glPopMatrix();
}
}
COM: <s> renders the bottom right corner </s>
|
funcom_train/29869884 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getJSearchResultPanel() {
if (jSearchResultPanel == null) {
jSearchResultLabel = new JLabel();
jSearchResultLabel.setText("Results");
jSearchResultPanel = new JPanel();
jSearchResultPanel.setLayout(new BorderLayout());
jSearchResultPanel.add(jSearchResultLabel, BorderLayout.NORTH);
jSearchResultPanel.add(getJSearchResultScrollPane(), BorderLayout.CENTER);
}
return jSearchResultPanel;
}
COM: <s> this method initializes j search result panel </s>
|
funcom_train/45911447 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Rectangle buildingRectangle(Building b) {
int a0 = b.location.x;
int b0 = b.location.y;
int x = surface().baseXOffset + Tile.toScreenX(a0, b0);
int y = surface().baseYOffset + Tile.toScreenY(a0, b0 - b.tileset.normal.height + 1) + 27;
return new Rectangle(x, y - b.tileset.normal.imageHeight, b.tileset.normal.imageWidth, b.tileset.normal.imageHeight);
}
COM: <s> returns the bounding rectangle of the building in non scaled screen coordinates </s>
|
funcom_train/35541520 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String genAntScriptAsString() throws Exception {
File resultFile = CodeGenUtil.getFile(GEN_ANT_DIR, "build.xml");
_model.generateBuild(resultFile);
String result = FileUtils.readFileToString(resultFile, "UTF-8");
if (_log.isDebugEnabled()) {
_log.debug(result);
}
return result;
}
COM: <s> generates an ant script from a vlc template </s>
|
funcom_train/20614709 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int doStartTag() throws JspException {
List posts = new ArrayList();
try {
posts = DeliciousCache.getInstance().getRecentPosts(username, password, count, tag, timeout);
} catch (DeliciousException de) {
// do nothing, the error has already been logged by the Delicious class
}
pageContext.setAttribute(var, posts, PageContext.PAGE_SCOPE);
return Tag.EVAL_BODY_INCLUDE;
}
COM: <s> called when the opening tag is encountered on the page </s>
|
funcom_train/49746388 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String pluralize( Object word ) {
if (word == null) return null;
String wordStr = word.toString().trim();
if (wordStr.length() == 0) return wordStr;
if (isUncountable(wordStr)) return wordStr;
for (Rule rule : this.plurals) {
String result = rule.apply(wordStr);
if (result != null) return result;
}
return wordStr;
}
COM: <s> returns the plural form of the word in the string </s>
|
funcom_train/24082277 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void postProcess() {
removeAuxiliaryObjectProperties();
this.objectPropertyHierarchy = new IntegerHierarchicalGraphImpl(
getObjectPropertyGraph());
this.status.deleteObjectPropertyGraph();
removeAuxiliaryClassesExceptNominals();
IntegerHierarchicalGraph hierarchicalGraph = new IntegerHierarchicalGraphImpl(
this.status.getClassGraph());
processNominals(hierarchicalGraph);
this.directTypes = computeDirectTypes(hierarchicalGraph);
this.sameIndividualMap = computeSameIndividualMap(hierarchicalGraph);
removeAuxiliaryNominals();
this.classHierarchy = new IntegerHierarchicalGraphImpl(
this.status.getClassGraph());
this.status.deleteClassGraph();
}
COM: <s> post processes the data after the classification phase </s>
|
funcom_train/18112121 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addCreatedWithPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Record_CreatedWith_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Record_CreatedWith_feature", "_UI_Record_type"),
BioDBPackage.Literals.RECORD__CREATED_WITH,
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the created with feature </s>
|
funcom_train/922984 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void loadDocContentsByURL(URL path, boolean isAddedToHistory) {
try {
synchronized(docContentEditorPane) {
docContentEditorPane.setPage(path);
}
//add the page to the visiting history
URLOrHTMLString page = new URLOrHTMLString();
page.setType(IndexTocPanelEvent.CONTENTS_BY_URL);
page.setUrl(path);
System.out.println(path);
if (isAddedToHistory) {
addVisitHistory(page);
}
} catch (Exception e) {
e.printStackTrace();
}
}
COM: <s> load the java doc page by url </s>
|
funcom_train/4962321 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Locator first(){
Locator before = InspectableOrderedDictionary.BOUNDARY_VIOLATION;
Position cur = tree_.root();
while (!tree_.isExternal(cur)){
// before = checkLocator(cur.element());
before = (RBTLocator)cur.element();
cur = tree_.leftChild(cur);
}
return before;
}
COM: <s> takes o log n time to traverse the height of the tree </s>
|
funcom_train/38949361 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void writeGetPropertyCount(final Class <?> clazz) {
Writer writer = getWriter();
// public int getPropertyCount()
writer.append(" public int getPropertyCount() {\n");
writer.append(" return " + (clazz.getDeclaredFields().length
- ignoredAttributes.length) + ";\n");
writer.append(" }\n\n");
}
COM: <s> outs the get property count method </s>
|
funcom_train/18953043 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getIdString() {
if (logger.isDebugEnabled()) {
logger.debug("getIdString() - start");
}
if (logger.isDebugEnabled()) {
logger.debug("getIdString() - end - return value = " + idString);
}
return idString;
}
COM: <s> unique identifier of the value object </s>
|
funcom_train/4461858 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Hashtable saveWidths() {
Hashtable widths = new Hashtable();
JTable j = table;
if(j == null)
return null;
// save all widths
TableColumnModel tcm = j.getColumnModel();
if(tcm == null)
return null;
Enumeration e = tcm.getColumns();
while(e.hasMoreElements()) {
TableColumn tc = (TableColumn) e.nextElement();
widths.put(tc.getIdentifier(), new Integer(tc.getWidth()));
}
return widths;
}
COM: <s> saves the column widths into a hashtable </s>
|
funcom_train/40620847 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void fire(AbstractEvent event) {
if (map != null) {
ArrayList<EventHandler> list = map.get(event.getEventClass());
if (list != null) {
for (EventHandler e : list) {
event.tryFire(e);
if (event instanceof HasCancel && ((HasCancel) event).isCanceled()) {
return;
}
}
}
}
return;
}
COM: <s> fires the event </s>
|
funcom_train/103884 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getKey(ITridas parentObject) {
XmlRootElement root = parentObject.getClass().getAnnotation(XmlRootElement.class);
TridasIdentifier identifier = parentObject.getIdentifier();
if(root != null)
return root.name() + ":" + identifier.toString();
else
return parentObject.getClass().getName() + ":" + identifier.toString();
}
COM: <s> gets a key for this parent object </s>
|
funcom_train/46857023 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getJContentPane() {
if (jContentPane == null) {
jContentPane = new JPanel();
jContentPane.setLayout(null);
jContentPane.add(getPnlIstruzioni(), null);
jContentPane.add(getPnlSouth(), null);
jContentPane.add(getPnlMp(), null);
}
return jContentPane;
}
COM: <s> this method initializes j content pane </s>
|
funcom_train/17701367 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void writeEOFRecord() throws IOException {
if (logger.isLoggable(Level.FINEST)) {
logger
.log(Level.FINEST,
"********************Writting end of file *************************");
}
for (int i = 0; i < this.recordBuf.length; ++i) {
this.recordBuf[i] = 0;
}
this.buffer.writeRecord(this.recordBuf);
}
COM: <s> write an eof end of archive record to the tar archive </s>
|
funcom_train/12661320 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void execute(final String[] args) throws SetupException {
final RequiredParams requiredParams = new RequiredParams();
requiredParams.parse(args);
validateInstall();
generatePreferences(args);
final AntProject project = new AntProject(setupBuildfile, frameworkPreferences, requiredParams);
// Fire the build
project.execute();
}
COM: <s> validates the install generates preference data and then invokes the admin cmd </s>
|
funcom_train/18052557 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenuItem getSvManageRemoveMenuItem() {
if (svManageRemoveMenuItem == null) {
svManageRemoveMenuItem = new JMenuItem();
svManageRemoveMenuItem.setText("Remove");
svManageRemoveMenuItem
.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
if (isSecretTableAnythingSelected())
removeSecretsAction();
else if (isCategoryListAnythingSelected())
removeCategoriesAction();
}
});
}
return svManageRemoveMenuItem;
}
COM: <s> this method initializes sv manage remove menu item </s>
|
funcom_train/11720988 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isLocked(DavResource res) {
ActiveLock lock = res.getLock(Type.WRITE, Scope.EXCLUSIVE);
if (lock == null) {
return false;
} else {
for (String sLockToken : session.getLockTokens()) {
if (sLockToken.equals(lock.getToken())) {
return false;
}
}
return true;
}
}
COM: <s> return true if this resource cannot be modified due to a write lock </s>
|
funcom_train/22571623 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setDescriptionText(String text) {
fDescriptionText.setEditable(fPlan.canEdit());
fDescriptionText.removeModifyListener(fTextModifyListener);
fDescriptionText.setText(text);
if(fPlan.canEdit()) {
fDescriptionText.addModifyListener(fTextModifyListener);
}
}
COM: <s> set the description text </s>
|
funcom_train/17936140 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getChartButtonsjPanel() {
if (chartButtonsjPanel == null) {
chartButtonsjPanel = new JPanel();
chartButtonsjPanel.setName("chartButtonsjPanel");
chartButtonsjPanel.add(getGenerateChartjButton(), null);
chartButtonsjPanel.add(getSaveChartjButton(), null);
chartButtonsjPanel.add(getAbortChartjButton(), null);
}
return chartButtonsjPanel;
}
COM: <s> this method initializes chart buttonsj panel </s>
|
funcom_train/7336020 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String appendExtension(String pathWoExt) {
String[] extensions = new String[] { ".png", ".gif", ".jpg" };
for (String ext : extensions) {
File file = new File(Config.getProperty(Config.DIR_DOCROOT) + pathWoExt + ext);
if (file.exists())
return pathWoExt + ext;
}
return null;
}
COM: <s> append extension to given base path </s>
|
funcom_train/31909907 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Element getRoot(Element svgRoot) {
svgRoot = domTreeManager.getRoot(svgRoot);
if (svgCanvasSize != null){
svgRoot.setAttributeNS(null, SVG_WIDTH_ATTRIBUTE,
"" + svgCanvasSize.width);
svgRoot.setAttributeNS(null, SVG_HEIGHT_ATTRIBUTE,
"" + svgCanvasSize.height);
}
return svgRoot;
}
COM: <s> this version of the get root method will append the input svg root </s>
|
funcom_train/12764499 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int getNextStep(ITour tour) {
int elementID = -1;
for (ITourElement element : tour.getElements()) {
if (element instanceof WaypointTourElement) {
WaypointTourElement wpElement = (WaypointTourElement) element;
if (wpElement.getElementID() > elementID) {
elementID = wpElement.getElementID();
}
}
}
return elementID+1;
}
COM: <s> get the next waypoint step id </s>
|
funcom_train/5427646 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean reportSyntaxError(String errorId, Object[] errorArgs) {
return termParser.append(new TermToken(Terms.SYNTAX_ERROR, phraseParser
.current().start(), phraseParser.current().start(), termParser
.sourceSystemId(), errorId, errorArgs));
}
COM: <s> report syntax error </s>
|
funcom_train/25638034 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void buildFieldsSummary(XMLNode node, Content memberSummaryTree) {
MemberSummaryWriter writer =
memberSummaryWriters[VisibleMemberMap.FIELDS];
VisibleMemberMap visibleMemberMap =
visibleMemberMaps[VisibleMemberMap.FIELDS];
addSummary(writer, visibleMemberMap, true, memberSummaryTree);
}
COM: <s> build the summary for the fields </s>
|
funcom_train/39169504 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Rule createNewRule(String ruleId) throws InvalidRuleException{
try{
String className = "hepple.postag.rules.Rule_" + ruleId;
Class ruleClass = Class.forName(className);
return (Rule)ruleClass.newInstance();
}catch(Exception e){
throw new InvalidRuleException("Could not create rule " + ruleId + "!\n" +
e.toString());
}
}
COM: <s> creates a new rule of the required type according to the provided id </s>
|
funcom_train/15915059 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getRowsNumber(){
l.entering("net.sourceforge.drpetrea.jsettings.FstabSettings","getRowsNumber");//$NON-NLS-1$//$NON-NLS-2$
if (this.values.size()==0) {
l.exiting("net.sourceforge.drpetrea.jsettings.FstabSettings","getRowsNumber", new Integer(0));//$NON-NLS-1$//$NON-NLS-2$
return 0;
}
l.exiting("net.sourceforge.drpetrea.jsettings.FstabSettings","getRowsNumber", new Integer(this.values.get(0).size()));//$NON-NLS-1$//$NON-NLS-2$
return this.values.get(0).size();
}
COM: <s> the method returns the number of rows stored </s>
|
funcom_train/46152493 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private ContentCollection getUserRoot() {
ContentRepositoryRegistry registry = ContentRepositoryRegistry.getInstance();
ContentRepository repo = registry.getRepository(loginInfo);
try {
return repo.getUserRoot();
} catch (ContentRepositoryException excp) {
logger.log(Level.WARNING, "Unable to find repository root", excp);
return null;
}
}
COM: <s> returns the content repository root for the current user or null upon </s>
|
funcom_train/3709505 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getToolTipText(MouseEvent e) {
Point p = e.getPoint();
int row_index = rowAtPoint(p);
int col_index = columnAtPoint(p);
TableModel model = getModel();
return (model.getValueAt(row_index, col_index)).toString();
}
COM: <s> gets tool tips for cells </s>
|
funcom_train/3156680 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean removeProduct(Product product) {
if (product != null) {
int index = _products.indexOf(product);
if (index >= 0) {
if (_products.remove(product)) {
_products.clearRemovedList();
product.resetRefNo();
removeProductManagerRef(product);
fireEvent(product, _PRODUCT_REMOVED);
return true;
}
}
}
return false;
}
COM: <s> removes the given product from this product manager if it exists </s>
|
funcom_train/44431168 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ChannelGroup reload(ChannelGroup group) throws ChannelBuilderException {
try {
getSession().load(group, new Long(group.getId()));
} catch (HibernateException e) {
throw new ChannelBuilderException("Unable to reload group: "
+ e.getMessage());
}
return group;
}
COM: <s> reloads group for use in new session </s>
|
funcom_train/43467167 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testPackageStripping() {
assertEquals("Integer", StringUtil.stripPackageName(Integer.class));
assertEquals("Map.Entry", StringUtil.stripPackageName(Map.Entry.class));
assertEquals("ToStringTest", StringUtil.stripPackageName(ToStringTest.class));
}
COM: <s> tests strip package name </s>
|
funcom_train/1369987 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createReader() {
try {
parser = XMLReaderFactory
.createXMLReader("org.apache.xerces.parsers.SAXParser");
} catch (SAXException e1) {
try {
parser = XMLReaderFactory.createXMLReader();
} catch (SAXException e2) {
throw new NoClassDefFoundError("No SAX parser is available");
// or whatever exception the method is declared to throw
}
}
}
COM: <s> create a parser object depending on which parser is available </s>
|
funcom_train/8495678 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getPreferredGuid(String taxonConceptGuid) throws Exception {
Query query = new TermQuery(new Term("guid", taxonConceptGuid));
TopDocs topDocs = identifierIdxSearcher.search(query, 1);
for(ScoreDoc scoreDoc: topDocs.scoreDocs){
Document doc = identifierIdxSearcher.doc(scoreDoc.doc);
return doc.get("preferredGuid");
}
return taxonConceptGuid;
}
COM: <s> retrieve the preferred guid for this taxon concept </s>
|
funcom_train/41747301 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addParentCategorySubtotalRow(StringBuffer sb, Map subtotalMap) {
sb.append("<tr><td><strong>Subtotal</strong></td>");
for (int i = 0; i < subtotalMap.size(); i++) {
long val = ((Long)subtotalMap.get(new Integer(i))).longValue();
sb.append("<td align=\"right\"><strong>"+getCurrencyStr(val,null)+"</strong></td>");
}
// sb.append("<td> </td>");
sb.append("</tr>");
}
COM: <s> parent category with subtotals row for parent category </s>
|
funcom_train/11320722 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String prepareCookieValue(String value) {
try {
if (StringUtils.isNotBlank(value)) {
value = URLDecoder.decode(value, "UTF-8");
value = trimStr(value, "\"");
}
} catch (UnsupportedEncodingException ignore) {
//ignore
}
return value;
}
COM: <s> does some preparation on the cookie value like </s>
|
funcom_train/14044671 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private XMLWriter getXMLWriter(XMLDatabaseKey key) {
java.io.File file = getXMLFile(key,true);
XMLWriter ret = null;
if (file != null) {
try {
ret = new XMLWriter(new java.io.FileWriter(file));
changed = true;
}
catch (IOException ioe) {
ioe.printStackTrace();
}
}
return ret;
}
COM: <s> gets the x mlwriter attribute of the xmldatabase file object </s>
|
funcom_train/11754420 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run() {
synchronized (processes) {
running = true;
Enumeration e = processes.elements();
while (e.hasMoreElements()) {
Process process = (Process) e.nextElement();
try {
process.destroy();
}
catch (Throwable t) {
System.err.println("Unable to terminate process during process shutdown");
}
}
}
}
COM: <s> invoked by the vm when it is exiting </s>
|
funcom_train/3730785 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public GraphAction (StmtRegistry reg, ClassAction classAct) {
if (reg == null || classAct == null) {
throw new IllegalArgumentException("null argument");
}
stmtReg = reg;
classAct_ = classAct;
setName(this.getClass().getName());
}
COM: <s> constructor used by stmt registry </s>
|
funcom_train/9368646 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setBrowserApplicationId(Intent intent) {
Uri data = intent.getData();
if (Intent.ACTION_VIEW.equals(intent.getAction()) && data != null) {
String scheme = data.getScheme();
if (scheme != null && scheme.startsWith("http")) {
intent.putExtra(Browser.EXTRA_APPLICATION_ID, data.toString());
}
}
}
COM: <s> if the intent is to open an http or https url we set </s>
|
funcom_train/34716829 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void activateArticle(int row, int col){
if (articles[row][col]!=null) {
ActivationChainReaction reaction = articles[row][col].getActivationChainReaction();
if(reaction.canActivate(row, col, this)){
activatedCount=reaction.react(row, col, this);
activated = true;
activatedRow = row;
activatedCol = col;
}
}
}
COM: <s> activates specified article </s>
|
funcom_train/2579751 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isSeriesVisibleInLegend(int series) {
boolean result = this.baseSeriesVisibleInLegend;
if (this.seriesVisibleInLegend != null) {
result = this.seriesVisibleInLegend.booleanValue();
}
else {
Boolean b = this.seriesVisibleInLegendList.getBoolean(series);
if (b != null) {
result = b.booleanValue();
}
}
return result;
}
COM: <s> returns code true code if the series should be shown in the legend </s>
|
funcom_train/18165744 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initialize() {
frame.setContentPane(getJContentPane());
frame.setJMenuBar(getAppMenuBar());
// just hide; don't destroy.
frame.addWindowListener(new WindowAdapter() {
public void windowClosed(WindowEvent e) {
GUILogger.this.setVisible(false);
}
public void windowClosing(WindowEvent e) {
GUILogger.this.setVisible(false);
}
});
}
COM: <s> this method initializes frame </s>
|
funcom_train/22045407 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean roundUp(){
int position = digits.size() - 1;
if( position == -1 ){
/* deal with case where we've rounded all the way to
* the beginning */
digits.add( 1 );
return false;
}
int digit = digits.get( position );
if( ++digit == baseInt( base ) ){
digits.remove( position );
return roundUp();
} // no further rounding
digits.set( position, digit );
return true;
}
COM: <s> the recursive rounding function </s>
|
funcom_train/31931007 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void applyChanges() {
Cursor cursor = getCursor();
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
Properties props = new Properties();
updateProperties(props);
displayChangeEffectMessage();
writeProperties(props);
replaceOriginalProperties(props);
copyProperties();
replaceOriginalCheckboxMask();
refreshControls();
setCursor(cursor);
}
COM: <s> check all the controls and move updated values into the properties sheet </s>
|
funcom_train/2695710 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean getMiddleChat() {
final String apath = "//suprasphere/ui/middle_chat";
try {
Element elem = (Element) this.getSupraSphereDocument1().selectObject(apath);
if (elem == null) {
logger.info("null element in getsystemname");
}
String value = elem.attributeValue("value");
if (value.equals("true")) {
return true;
}
} catch (ClassCastException npe) {
logger.info("class cast exception in getspheretype");
}
return false;
}
COM: <s> returns true if the middle chat is there false otherwise </s>
|
funcom_train/4922834 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testCaseInsensitiveSimpleProperty() {
this.isCaseSensitive = false;
this.recordReturn(this.object, this.object.getValue(), "UPPER");
this.recordReturn(this.object, this.object.getValue(), "lower");
this.doTest("VALUE", "UPPER", "value", "lower");
}
COM: <s> ensure can obtain simple property via case insensitive name </s>
|
funcom_train/41163531 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void delete(CoTechnical entity) {
EntityManagerHelper.log("deleting CoTechnical instance", Level.INFO, null);
try {
entity = getEntityManager().getReference(CoTechnical.class, entity.getTechnicalId());
getEntityManager().remove(entity);
EntityManagerHelper.log("delete successful", Level.INFO, null);
} catch (RuntimeException re) {
EntityManagerHelper.log("delete failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> delete a persistent co technical entity </s>
|
funcom_train/20826638 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String nextString() throws ShowFileException {
nextToken();
if( streamTokenizer.ttype != StreamTokenizer.TT_WORD ) {
if( streamTokenizer.ttype != '"' ) {
throwException("Expected string, found <" + tokenString() + ">");
}
}
return streamTokenizer.sval;
}
COM: <s> return next string in stream </s>
|
funcom_train/1675493 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long getFileNumber(byte[] bytes) {
if (hasStringKey(bytes)) {
try {
return Long.valueOf(new String(bytes, "UTF-8")).longValue();
} catch (UnsupportedEncodingException shouldNeverHappen) {
assert false: shouldNeverHappen;
return 0;
}
} else {
ByteBuffer buf = ByteBuffer.wrap(bytes);
return LogUtils.readIntMSB(buf) & 0xFFFFFFFFL;
}
}
COM: <s> convert a file summary ln key from a byte array to a long </s>
|
funcom_train/8022190 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSetDataBase() {
System.out.println("setDataBase");
String database = "";
Config instance = new Config();
instance.setDataBase(database);
// 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 data base method of class vgrabber </s>
|
funcom_train/22527933 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean canMoveItem(IItemType item, IItemTypeContainer parent) {
if(item == parent) { // Cannot drop onto itself
return false;
}
// Check that target is not a descendant of the source
while(parent instanceof IItemType && (parent = ((IItemType)parent).getParent()) != null) {
if(parent == item) {
return false;
}
}
return true;
}
COM: <s> figure out if we can move an item </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.