__key__ stringlengths 16 21 | __url__ stringclasses 1
value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/28644608 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void executeCmd(String cmd) throws SQLException {
Connection conn = null;
Statement stmt = null;
try {
conn = getDataSource().getConnection();
stmt = conn.createStatement();
logger.debug("SQL cmd: " + cmd);
stmt.execute(cmd);
stmt.close();
conn.close();
}
catch (SQLException ex) {
logger.error("Could not run cmd: " + cmd, ex);
throw ex;
}
finally {
if (stmt != null) {
stmt.close();
}
if (conn != null) {
conn.close();
}
}
}
COM: <s> executes an specifig sql command </s>
|
funcom_train/18267859 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSingleRun() {
System.err.println("START: testSingleThread()");
Runner model = initializeModel();
model.open((SwingApplet) null, (String[]) null, false);
model.run(true);
System.err.println("END: testSingleThread()");
}
COM: <s> double check that we can run an ascape model normally </s>
|
funcom_train/43098172 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object buildClassifierRole(Object collaboration) {
if (!(collaboration instanceof MCollaboration)) {
throw new IllegalArgumentException(
"Argument is not a collaboration");
}
MClassifierRole classifierRole =
(MClassifierRole) createClassifierRole();
((MCollaboration) collaboration).addOwnedElement(classifierRole);
return classifierRole;
}
COM: <s> creates a classifierrole and adds it to the given collaboration </s>
|
funcom_train/47569657 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public XMLWriter tagged(String tag, long number) {
this.indent();
out.print('<');
out.print(tag);
out.print('>');
this.raw(String.valueOf(number));
out.print("</");
out.print(tag);
out.print('>');
if (pretty)
out.print('\n');
return this;
}
COM: <s> writes an long enclosed by a start and end tag </s>
|
funcom_train/22127376 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setOutput(String portID, Object payload) {
if (payload != null)
outputs.put(portID, payload);
/* send output available event if listened to */
if (Events.isListened(this, "onOutputAvailable", true))
Events.postEvent(new OutputAvailableEvent("onOutputAvailable", this, payload));
}
COM: <s> call this one to notify that output is available for a </s>
|
funcom_train/34257209 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TaskPackage getTaskPlan() {
//Happens on refresh after destroy
if(getTaskPlanWorkTaskLink() == null) {
// TODO - Returning null is dangerous, such as in Fmm.getBacklogTaskList()
// Further research needed. Does this ever happen? Are we at risk of a RTE ???
return null;
}
return this.getTaskPlanWorkTaskLink().getTaskPackage();
}
COM: <s> returns the task plan link </s>
|
funcom_train/18065015 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void createDatabase(String statement, Vector<String> statements) throws GnumlerException {
try {
Statement stm = connection.createStatement();
// stm.executeUpdate(statement);
Iterator<String> stIt = statements.iterator();
while(stIt.hasNext()) {
stm.executeUpdate(stIt.next());
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
COM: <s> create database will execute the ddlstatements </s>
|
funcom_train/41405887 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean relaxPriority(E key, double priority) {
Entry entry = getEntry(key);
if (entry == null) {
entry = makeEntry(key);
}
if (compare(priority, entry.priority) <= 0) {
return false;
}
entry.priority = priority;
heapifyUp(entry);
return true;
}
COM: <s> promotes a key in the queue adding it if it wasnt there already </s>
|
funcom_train/38993100 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String toHexColor(Color color) {
String r = Integer.toHexString(color.getRed());
if (r.length() == 1)
r = "0" + r;
String g = Integer.toHexString(color.getGreen());
if (g.length() == 1)
g = "0" + g;
String b = Integer.toHexString(color.getBlue());
if (b.length() == 1)
b = "0" + b;
return r + g + b;
}
COM: <s> converts a color to an html encoded color string ie 003322 </s>
|
funcom_train/1582534 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addItem(final NavigatorItemPreferences item) {
if (item == null) {
throw new IllegalArgumentException("item cannot be null");
}
if (this.getItems() == null) {
this.setItems(new ArrayList<NavigatorItemPreferences>());
}
if (!this.getItems().contains(item)) {
this.getItems().add(item);
}
}
COM: <s> adds a new navigator item preferences to this navigator </s>
|
funcom_train/23411313 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addModalityPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_DeonticStatement_modality_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_DeonticStatement_modality_feature", "_UI_DeonticStatement_type"),
OMPackage.Literals.DEONTIC_STATEMENT__MODALITY,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the modality feature </s>
|
funcom_train/23878462 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGet() {
SwagItem originalItem = Fixture.createSwagItem();
swagItemDao.save(originalItem);
SwagItem retrievedItem = swagItemDao.get(originalItem.getKey());
assertEquals(originalItem,retrievedItem);
//Image is lazy loaded but make sure it's available when we access it
SwagImage image = retrievedItem.getImage();
assertNotNull(image);
}
COM: <s> make sure all fields are saved and that owned one to many relationship </s>
|
funcom_train/32734213 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected StringBuffer logPropChange() {
StringBuffer lBuffer = new StringBuffer();
lBuffer.append(this.indentString + logMsg + " " + logMsgType + logParms[1] + " changed " + logParms[2] + " -> " + logParms[3] + "\n");
return lBuffer;
}
COM: <s> produces the logging output for a property change action </s>
|
funcom_train/18854342 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void createPartControl(Composite parent) {
tabFolder = new TabFolder(parent, SWT.NONE);
// showBug(1);
// showBug(2);
//original code
// viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
// viewer.setContentProvider(new ViewContentProvider());
// viewer.setLabelProvider(new ViewLabelProvider());
// viewer.setInput(ResourcesPlugin.getWorkspace());
makeActions();
contributeToActionBars();
}
COM: <s> this is a callback that will allow us </s>
|
funcom_train/18117746 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Date getDate() {
if (date == null) {
String datestring = getField(RFC822.DELIVERY_DATE);
//just double checking
if (datestring == null) {
datestring = getField(RFC822.DATE);
if (datestring == null) {
doDate();
datestring = getField(RFC822.DATE);
}
}
date = MailDecoder.parseDate(datestring);
}
return date;
}
COM: <s> i have moved the parsing logic from string to date to the maildecoder </s>
|
funcom_train/7520595 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void deliverPending() {
ListIterator it = pending.listIterator();
while (it.hasNext()) {
EventContainer cont = (EventContainer) it.next();
long[] VCx = cont.getVC();
if (canDeliver(VCx)) {
it.remove();
GroupSendableEvent ev = cont.getEvent();
try {
ev.go();
} catch (AppiaEventException e) {
e.printStackTrace();
}
VC[ev.orig]++;
if (!pending.isEmpty() && it.nextIndex() != 0)
it = pending.listIterator();
}
}
}
COM: <s> delivers pending messages that satisfy the causality order criteria </s>
|
funcom_train/44599362 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private BinaryNode insert(final int x, BinaryNode t) {
if (t == null) {
t = new BinaryNode(x, null, null);
} else if (x < t.element) {
t.left = insert(x, t.left);
} else if (x > t.element) {
t.right = insert(x, t.right);
} else {
// Duplicate; do nothing
}
return t;
}
COM: <s> internal method to insert into a subtree </s>
|
funcom_train/29514566 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void initialize(PluginInterface pluginInterface) throws PluginException {
SINGLETON = this;
this.azureus = pluginInterface;
// Listen for new downloads
azureus.getDownloadManager().addListener(downloadListener, true);
// Listen for shutdown
azureus.addListener(new PluginListener() {
public void initializationComplete() {
}
public void closedownInitiated() {
try {
unload();
} catch (PluginException e) {
e.printStackTrace();
}
}
public void closedownComplete() {
}
});
// Start Jetty
try {
startWebServer();
} catch (Exception e) {
throw new PluginException(e);
}
}
COM: <s> initialises the plugin </s>
|
funcom_train/15461378 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getCellLink(String i_dto_property) {
String cellLink = cellLinks.getProperty(i_dto_property);
if (cellLink == null || cellLink.matches(" *"))
return null;
if (cellLink.indexOf('?') >= 0 && cellLink.indexOf('=') >= 0)
return cellLink;
return cellLink + "?" + i_dto_property + "=";
}
COM: <s> gives the hyperlink if any has been specified to a table cell if </s>
|
funcom_train/36158600 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public VLAN createVlan(String inProviderVdcID,String name, boolean isPrivate) throws CloudException,InternalException{
try {
Vlan fVlan = service.createVLAN(Long.valueOf(inProviderVdcID), isPrivate);
VLAN dVlan = toVLAN(fVlan);
if(dVlan == null) throw new CloudException("Fail to create Vlan");
return dVlan;
} catch (NumberFormatException e) {
logger.error(e);
throw new InternalException(e);
} catch (RemoteException e) {
logger.error(e);
throw new CloudException(e);
}
}
COM: <s> this method is to create a vlan for a specific virtual data center </s>
|
funcom_train/47103824 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getImage(){
String image = "";
if(playerIndex > -1)
try {
image = GameWorld.getInstance().getPlayer(playerIndex).getImage();
} catch(NoPlayerException plrEx){
image = PlayerImages.I_00.getRightImage();
}
else if(enemy != null)
image = enemy.getImage();
else if(npc != null)
image = npc.getImage();
else if(item != null)
image = item.getImage();
else
image = type.getImage();
return image;
}
COM: <s> gets the image location for the street object </s>
|
funcom_train/48494661 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void readArgs(Method method) throws Exception {
Symbol symbol = scanner.peekToken();
if (symbol.id != sym.LBRACK)
return;
scanner.nextToken();
while (true) {
symbol = scanner.peekToken();
if (symbol.id == sym.RBRACK) {
scanner.nextToken();
break;
}
if (symbol.id != sym.IDENTIFIER)
throw new Exception("readArgs(): expected ']' or IDENTIFIER - "
+ symbol);
// TODO: no initialization allowed?
method.addArgument(parseVariableDeclaration(false));
}
}
COM: <s> reads methods arguments </s>
|
funcom_train/48493083 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addTransition(IState startingState, IEvent ev, IState nextState) {
ev.setStateEventListener(this);
System.out.println(this + "Adding a transition from " + startingState + " > " + ev + " = " + nextState);
states.addTransition(startingState, ev, nextState);
}
COM: <s> programs the engine with the allowable transactions </s>
|
funcom_train/39046255 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected EObject createInitialModel() {
EClass eClass = ExtendedMetaData.INSTANCE.getDocumentRoot(mindmapPackage);
EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(initialObjectCreationPage.getInitialObjectName());
EObject rootObject = mindmapFactory.create(eClass);
rootObject.eSet(eStructuralFeature, EcoreUtil.create((EClass)eStructuralFeature.getEType()));
return rootObject;
}
COM: <s> create a new model </s>
|
funcom_train/3914859 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean buildComponentModel(int uolId, MessageList messages) {
boolean result = true;
// buildComponentModel for all children
Iterator myIterator = children.iterator();
while (myIterator.hasNext()) {
IMSLDNode child = (IMSLDNode) myIterator.next();
result &= child.buildComponentModel(uolId, messages);
}
return result;
}
COM: <s> constucts the component model from the parser object model </s>
|
funcom_train/37227717 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getChildElementValue(MessageElement parent, String childName) {
Iterator it = parent.getChildElements();
while (it.hasNext()) {
MessageElement child = (MessageElement)it.next();
if (child.getElementName().getLocalName().equals(childName)) {
return child.getValue();
}
}
return null;
}
COM: <s> returns the value of the child element with the specified qname </s>
|
funcom_train/8085346 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TableCellEditor getCellEditor(int row, int column) {
TableCellEditor result;
// relational attribute?
if ( (getModel() instanceof ArffSortedTableModel)
&& (((ArffSortedTableModel) getModel()).getType(column) == Attribute.RELATIONAL) )
result = new RelationalCellEditor(row, column);
// default
else
result = super.getCellEditor(row, column);
return result;
}
COM: <s> returns the cell editor for the given cell </s>
|
funcom_train/36430372 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void start() {
synchronized (lastTime) {
if (monitorActive.get()) {
return;
}
lastTime.set(System.currentTimeMillis());
if (checkInterval.get() > 0) {
monitorActive.set(true);
timerTask = new TrafficMonitoringTask(trafficShapingHandler, this);
timeout =
timer.newTimeout(timerTask, checkInterval.get(), TimeUnit.MILLISECONDS);
}
}
}
COM: <s> start the monitoring process </s>
|
funcom_train/51526498 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void process(String trainFile,String testFile, String outputFile){
try{
train(trainFile);
// System.out.println("usage: svm_predict [options] test_file model_file output_file\n"
// +"options:\n"
// +"-b probability_estimates: whether to predict probability estimates, 0 or 1 (default 0); one-class SVM not supported yet\n");
predict(testFile, outputFile);
}catch(Exception e){
e.printStackTrace();
}
}
COM: <s> run full svm process train then predict </s>
|
funcom_train/37516477 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void test_addInputStream_method3() {
try {
establishLexers( SAMPLE_CLASS );
parsingController.addInputStream( mjLexer, "multijava" );
parsingController.addInputStream( docLexer, "multijava" );
fail( "Expected ParsingController.KeyException" );
} catch( ParsingController.KeyException e ) {
assertTrue( true );
}
}
COM: <s> should get an exception if we try to bind two input streams to </s>
|
funcom_train/3120622 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int getKeyCode(String line) {
int offset = 7; // offset to get to N in KeyCodeN
String keyString = line.substring(line.lastIndexOf("KeyCode")+offset,
line.indexOf("]"));
return Integer.parseInt(keyString);
}
COM: <s> parses and returns the key code for the key event of the line </s>
|
funcom_train/14378374 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getSide(Line2D.Float segment) {
if (this == segment) {
return COLLINEAR;
}
int p1Side = getSideThick(segment.x1, segment.y1);
int p2Side = getSideThick(segment.x2, segment.y2);
if (p1Side == p2Side) {
return p1Side;
} else if (p1Side == COLLINEAR) {
return p2Side;
} else if (p2Side == COLLINEAR) {
return p1Side;
} else {
return SPANNING;
}
}
COM: <s> gets the side of this line that the specified line segment is on </s>
|
funcom_train/42822539 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getDetailsExpensesCommand() {
if (detailsExpensesCommand == null) {//GEN-END:|88-getter|0|88-preInit
// write pre-init user code here
detailsExpensesCommand = new Command("Show Details", Command.SCREEN, 0);//GEN-LINE:|88-getter|1|88-postInit
// write post-init user code here
}//GEN-BEGIN:|88-getter|2|
return detailsExpensesCommand;
}
COM: <s> returns an initiliazed instance of details expenses command component </s>
|
funcom_train/6217683 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int doStartTag() throws JspException{
try{
FormTag form = (FormTag) this.findAncestorWithClass(this, FormTag.class);
ExtendedValidationHandler handler = (ExtendedValidationHandler)
form.getValidation().getHandler();
if (!form.isForward()){
String message = handler.getMessage();
if (message!=null)
pageContext.getOut().print(message);
}
}
catch (Exception e){
throw new JspException(e.getMessage());
}
return EVAL_BODY_INCLUDE;
}
COM: <s> show error message </s>
|
funcom_train/40622444 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void accept() {
// Check if we are ready to accept
if (!onAccept()) {
return;
}
// Get the value before hiding the editor
ColType cellValue = getValue();
// Hide the editor
hide();
// Send the new cell value to the callback
curCallback.onComplete(curCellEditInfo, cellValue);
curCallback = null;
curCellEditInfo = null;
}
COM: <s> accept the contents of the cell editor as the new cell value </s>
|
funcom_train/3083559 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setTabBorderStyle(int newValue) {
switch (newValue) {
case TAB_LINE_AND_CONTENT:
case TAB_LINE_ONLY:
case TAB_STRIP_AND_CONTENT:
case TAB_STRIP_ONLY:
break;
default:
throw new IllegalArgumentException(
"tabBorderStyle must one of TAB_LINE_AND_CONTENT, TAB_LINE_ONLY, TAB_STRIP_AND_CONTENT, TAB_STRIP_ONLY");
}
setProperty(PROPERTY_TAB_BORDER_STYLE, newValue);
}
COM: <s> sets the tab border style to use </s>
|
funcom_train/37586729 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testDoesNotStartWithPrefix() throws BadLocationException {
IndentRuleQuestion rule = new QuestionPrevLineStartsWith("*", null, null);
// Star in text, not starting line
_setDocText("foo(); *\nbar();\n");
assertTrue("line after star", !rule.testApplyRule(_doc, 10, Indenter.IndentReason.OTHER));
}
COM: <s> tests having text on a line before the prefix </s>
|
funcom_train/25763530 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setupOtherVals() {
double v = val;
if (v < 0.0) {
sign = -1;
v = -v;
} else {
sign = 1;
}
double dd = v + 0.0000000001; // WHY?
degrees = (int) dd;
double md = (dd - degrees) * 60.;
min = (int) md;
sec = (md - min) * 60.;
}
COM: <s> set from a decimal value and calculate h m s </s>
|
funcom_train/34898528 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void exportGraphToImageFileFormat(Graph2D graph, ImageOutputHandler ioh, String outFile, int height, int width) throws Exception{
Graph2DView originalView = replaceCurrentWithExportView(graph, ioh);
configureExportView((Graph2DView) graph.getCurrentView(), height, width);
// Writing out the graph using the given IOHandler.
ioh.write(graph, outFile);
restoreOriginalView(graph, originalView);
}
COM: <s> write to file </s>
|
funcom_train/20847013 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean hasBinaryType() {
if (getType().isBinaryType()) {
return true;
}
IDictionary dict = getType().getElements(true);
if (dict != null) {
Enumeration enu = dict.keys();
if (enu != null) {
for (; enu.hasMoreElements();) {
String element = (String) enu.nextElement();
ParameterType t = getType(element);
if (t.isBinaryType()) return true;
}
}
}
return false;
}
COM: <s> checks if this parameter holds a binary information </s>
|
funcom_train/9557895 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void moveEmailRows(long folderSrc, long folderDest, long emails[]) throws SQLException {
makeConnection();
try {
for (int i = 0; i < emails.length; i++) {
PreparedStatement ps = connection.prepareStatement(
"update emails set folderId = ? where emailId = ? and folderId = ?");
ps.setLong(1, folderDest);
ps.setLong(2, emails[i]);
ps.setLong(3, folderSrc);
ps.executeUpdate();
}
} finally {
releaseConnection();
}
}
COM: <s> moves mails between folders </s>
|
funcom_train/8327340 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testRollupPolicyGreatGrandchildInvisible() {
rollupPolicyGreatGrandchildInvisible(
Role.RollupPolicy.FULL, "266,773", "74,748");
rollupPolicyGreatGrandchildInvisible(
Role.RollupPolicy.PARTIAL, "266,767", "74,742");
rollupPolicyGreatGrandchildInvisible(
Role.RollupPolicy.HIDDEN, "", "");
}
COM: <s> tests where all children are visible but a grandchild is not </s>
|
funcom_train/48982900 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String list() {
// validates the update
performValidateList();
logger.log("\n\nValidade list finished");
// if it has some error
if (hasActionErrors()) {
logger.log("\n\nError on list");
return "edit";
}
// retrieves and sets the course object
setCourse(courseRemote.get(course.getId()));
// retrieves the list of disciplines
setDisciplineList(disciplineRemote.getByCourse(course.getId()));
return "list";
}
COM: <s> list all discipline </s>
|
funcom_train/5343579 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void handleMessage(String line) {
try {
ChatMessage msg;
if (_is02OrLater) {
msg = ChatMessage.readMessage(line);
//if (getChannelName() != null && msg.isFromMe())
// won't accept messages from self
//return;
} else {
msg = BasicChatMessage.createMessage("", _remoteAddress
.toString(), line);
}
super.handleMessage(msg);
if (msg instanceof PartChatMessage)
stop();
} catch (IOException ioe) {
// ignore
}
}
COM: <s> handles a message from the network and informs the message listener </s>
|
funcom_train/40312393 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testIsReadOnly_InvalidColumn2() {
try
{
ResultSetMetaData resMetaData = new DefaultResultSetMetaData(metaDataEntry);
resMetaData.isReadOnly(0);
fail("SQLException is expected.");
}
catch(SQLException e)
{
//ensure the SQLException is thrown by isReadOnly method.
assertEquals("The sqlstate mismatches", "22003", e.getSQLState());
}
}
COM: <s> tests is read only with column index equals to 0 </s>
|
funcom_train/44869158 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private WCMExpressionFunctionBean getFRestricted() {
if (fRestricted == null) {
fRestricted = new WCMExpressionFunctionBean();
fRestricted.setName("fr");
fRestricted.setDefinition("((x>=a & x<=b)|(x<=a & x>=b)?f(x))");
fRestricted.setVariable(getXVar());
fRestricted.setParser(getParser());
}
return fRestricted;
}
COM: <s> this method initializes f restricted </s>
|
funcom_train/374742 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void timeoutCacheOldest(int count) {
synchronized (cache) {
for (Iterator<AbstractResolver.TimeoutEntry> i = timeoutQueue.iterator(); i
.hasNext();) {
AbstractResolver.TimeoutEntry e = i.next();
if (count-- > 0) {
logger.finest(String.format("removed due to backoff %s \n",
cache.get(e.hash)));
cache.remove(e.hash);
i.remove();
} else {
break;
}
}
}
}
COM: <s> removes count oldest entries from the timeout cache presumably to make </s>
|
funcom_train/50077283 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void configure(ComponentConfiguration configuration) {
try {
this.config =
(UserManagerJmxAdapterConfiguration) configuration;
} catch (ClassCastException cce) {
throw new InvalidConfigurationException(
this.getClass(), configuration.getConfigurationName(),
"ComponentConfiguration",
"Specifed UserManagerJmxAdapterConfiguration does not "
+ "implement correct interface.",
cce);
}
}
COM: <s> configures the service </s>
|
funcom_train/3086879 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setBackgroundImageProperties(BackgroundImageProperties newValue) {
BackgroundImageProperties oldValue = backgroundImageProperties;
if (oldValue != null) {
oldValue.removePropertyChangeListener(propertyChangeForwarder);
}
if (newValue != null) {
newValue.addPropertyChangeListener(propertyChangeForwarder);
}
backgroundImageProperties = newValue;
firePropertyChange("backgroundImageProperties", oldValue, newValue);
}
COM: <s> sets the background image properties for this menu </s>
|
funcom_train/40358605 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void resetPaddings() {
Style s = type.getStyle();
if (s != null) {
leftPadding = s.getLeftPadding();
rightPadding = s.getRightPadding();
topPadding = s.getTopPadding();
bottomPadding = s.getBottomPadding() + 12; // (c) line
}
}
COM: <s> resets paddings to the values dictated by font transform object </s>
|
funcom_train/13814392 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testNullDate() {
FuzzyDate fd = new FuzzyDate( null, 0 );
Date maxDate = fd.getMaxDate();
assertNull( "maxDate", maxDate );
Date minDate = fd.getMinDate();
assertNull( "minDate", minDate );
String asStr = fd.format();
assertEquals( asStr, "" );
}
COM: <s> verify that fuzzy date behaves well if date is null </s>
|
funcom_train/47481813 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ResourceSet performQuery(String Query) throws Exception {
// Obtain the collection and launch the query, obtaining a set o results.
Collection col = DatabaseManager.getCollection(URI);
XQueryService service = (XQueryService) col.getService("XQueryService", "1.0");
Query qry = new Query();
qry.loadQuerys();
ResourceSet result = service.query(Query);
return result;
}
COM: <s> perform a query </s>
|
funcom_train/3907947 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setElement(Element element) {
super.setElement(element);
if(element != null) {
String val = element.getAttributeValue(CP_Core.TYPE);
if(val == null || "".equals(val)) {
element.setAttribute(CP_Core.TYPE, "webcontent");
}
}
}
COM: <s> over ride to ensure theres a type attribute </s>
|
funcom_train/45899465 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean hasEnoughLabs(ResearchType rt) {
PlanetStatistics ps = getPlanetStatistics();
if (ps.civilLab < rt.civilLab) {
return false;
}
if (ps.mechLab < rt.mechLab) {
return false;
}
if (ps.compLab < rt.compLab) {
return false;
}
if (ps.aiLab < rt.aiLab) {
return false;
}
if (ps.milLab < rt.milLab) {
return false;
}
return true;
}
COM: <s> is there enough labs to research the technology does </s>
|
funcom_train/9817754 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Serializable getData() {
state.width = width;
state.data = data;
state.read = read;
state.empty = empty;
state.addressBits = addressBits;
state.depth = depth;
state.chunkSize = chunkSize;
state.mask = mask;
state.shift = shift;
state.numberOfBlocks = numberOfBlocks;
state.chunkBitSize = chunkBitSize;
return state;
}
COM: <s> since generic memory is not a cell these functions will need to </s>
|
funcom_train/43245978 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSetEthinicity() {
System.out.println("setEthinicity");
String ethinicity = "";
PatientDataObject instance = new PatientDataObject();
instance.setEthnicity(ethinicity);
// 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 ethnicity method of class org </s>
|
funcom_train/10937563 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Serializable getIgnoreCase(String key) {
// shortcut for exact case match
if (contains(key)) {
return get(key);
}
// try all keys
for (String k : keySet()) {
if (key.equalsIgnoreCase(k)) {
return get(k);
}
}
return null;
}
COM: <s> returns the value to which the specified key is mapped or </s>
|
funcom_train/10276039 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public AbstractStringBuilder append(char str[]) {
int newCount = count + str.length;
if (newCount > value.length)
expandCapacity(newCount);
System.arraycopy(str, 0, value, count, str.length);
Arrays.fill(taint, count, newCount, String.CLEAN); // char[] does not come with any taint.
count = newCount;
return this;
}
COM: <s> appends the string representation of the code char code array </s>
|
funcom_train/45450253 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
StringBuilder result = new StringBuilder("Hierarchy(");
result.append("id=").append(getId()).append(",");
result.append("name=\"").append(name).append("\")");
return result.toString();
}
COM: <s> returns a string representation of this hierarchy </s>
|
funcom_train/3815611 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void growDelayedExpansionList() {
for (Token t : delayedExpansionList) {
CombineToken token = (CombineToken)t;
calculateCombinedScore(token);
}
if (doCombinePruning) {
delayedExpansionList =
combinedScorePruner.prune(delayedExpansionList);
}
for (Token t : delayedExpansionList) {
CombineToken token = (CombineToken)t;
token.setLastCombineTime(currentFrameNumber);
growCombineToken(token);
}
}
COM: <s> grow the delayed expansion list by first pruning it and then grow it </s>
|
funcom_train/25484487 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run(File file) throws ParseException {
try {
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser saxParser = factory.newSAXParser();
saxParser.parse(file, this);
}
catch (Exception e) {
throw new ParseException("Parsing Error: Illegal XML File\n" + e.getMessage() );
}
}
COM: <s> run the parser on a given file </s>
|
funcom_train/28702209 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isExpired() {
// Remember if the minutes to live is zero then it lives forever!
if (expirationDate != null) {
// date of expiration is compared.
if (expirationDate.before(new java.util.Date())) {
return true;
} else {
return false;
}
} else {
// This means it lives forever!
return false;
}
}
COM: <s> this is based on the minutes to live and will check the current </s>
|
funcom_train/45471297 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void registerHandlerFactory(FieldHandlerFactory factory) {
if (_handlerFactoryMap == null)
_handlerFactoryMap = new Hashtable();
Class[] types = factory.getSupportedTypes();
for (int i = 0; i < types.length; i++) {
_handlerFactoryMap.put(types[i], factory);
}
} //-- registerHandlerFactory
COM: <s> registers the supported class types for the given </s>
|
funcom_train/17984762 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getBackgroundColor() {
String color = BGColorString;
try {
String gbcolorfunc = topframe.getParameter("bgColorFunctionName");
if (gbcolorfunc.equals("")) {
return color;
}
String jsfunc = gbcolorfunc;
JSObject win = JSObject.getWindow(topframe);
color = (String)win.call(jsfunc,null);
} catch (Exception ignored) {color = BGColorString;}
return color;
}
COM: <s> get the proper background color for this applet from the html page </s>
|
funcom_train/25075809 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void handleEClassCheckedStateChanged(EClass eClass, boolean checked) {
// ClassFigure add
if (checked) {
ClassFigure classFigure = GraphdescFactory.eINSTANCE
.createClassFigure();
classFigure.setEClass(eClass);
getGvFigureDescription().getClassFigures().add(classFigure);
}
// ClassFigure removal
else {
ClassFigure classFigure = getGvFigureDescription().getClassFigure(
eClass);
getGvFigureDescription().getClassFigures().remove(classFigure);
}
}
COM: <s> handles a status change event on an eclass tree item </s>
|
funcom_train/46426627 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void generateINDEX(PClass pclass) {
@SuppressWarnings("unchecked")
List<Map<String, String>> entities=(List<Map<String, String>>) indexModel.get("entities");
if(entities==null){
entities=new ArrayList<Map<String,String>>();
}
Map<String, String> entity = new HashMap<String, String>();
entity.put("name", buildClassName(pclass));
entity.put("url","./"+buildClassName(pclass)+"/list.jsf");
entities.add(entity);
indexModel.put("entities", entities);
}
COM: <s> generate index page </s>
|
funcom_train/22444404 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void mpeg_decode_sequence_display_extension() {
in.getBits(3);
if (in.getTrueFalse()) {
in.getBits(24);
}
int width = in.getBits( 14 );
in.getTrueFalse();
int height = in.getBits( 14 );
in.getTrueFalse();
panScanWidth = 16 * width;
panScanHeight = 16 * height;
}
COM: <s> this packet is used for pan and scan </s>
|
funcom_train/30194954 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setProperties(JxplElement atom, int[] properties){
int[] a=(int[])atoms.get(atom);
for(int i=0; i<properties.length && i<a.length-1; i++)
a[i+1]=properties[i];
}
COM: <s> add special properties to an element </s>
|
funcom_train/1589314 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Period plusMonths(int months) {
if (months == 0) {
return this;
}
int[] values = getValues(); // cloned
getPeriodType().addIndexedField(this, PeriodType.MONTH_INDEX, values, months);
return new Period(values, getPeriodType());
}
COM: <s> returns a new period plus the specified number of months added </s>
|
funcom_train/25192449 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ServiceID readServiceID (String filename) throws IOException, ClassNotFoundException {
ServiceID id = null;
if (!isTerminated ()) {
ObjectInputStream ois = new ObjectInputStream (new FileInputStream (filename));
id = (ServiceID) ois.readObject ();
ois.close ();
}
return id;
}
COM: <s> read service id reads the service id from a file to reuse when </s>
|
funcom_train/19421602 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void update(String key, Object record) throws IllegalArgumentException {
if (!open) {
throw new IllegalArgumentException("Database \"" + databaseName + "\": Database is not open.");
}
if (!data.containsKey(key)) {
throw new IllegalArgumentException("Database \"" + databaseName + "\": Record not found; key=\"" + key + "\".");
}
data.put(key, record);
}
COM: <s> p updates an existing record identified by the specified key </s>
|
funcom_train/40359533 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testDetermineBatchSize() {
HostLoadManager hostLoadManager = newHostLoadManager(60);
BatchSize batchSize = hostLoadManager.determineBatchSize();
assertEquals(60, batchSize.getHint());
hostLoadManager.setBatchSize(40);
batchSize = hostLoadManager.determineBatchSize();
assertEquals(40, batchSize.getHint());
}
COM: <s> the new determine batch size logic treats both the hint and the load </s>
|
funcom_train/13985952 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSelectedPanelCheckBox(int checkBoxID) {
if(checkBoxID == JBroFuzzWindow.ID_PANEL_FUZZING) {
fuzzing.setEnabled(true);
}
if(checkBoxID == JBroFuzzWindow.ID_PANEL_GRAPHING) {
graphing.setEnabled(true);
}
if(checkBoxID == JBroFuzzWindow.ID_PANEL_PAYLOADS) {
payloads.setEnabled(true);
}
if(checkBoxID == JBroFuzzWindow.ID_PANEL_SYSTEM) {
system.setEnabled(true);
}
}
COM: <s> p method for checking which checkbox is set from the </s>
|
funcom_train/10688416 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toUpperCase(Locale locale) {
String result = UCharacter.toUpperCase(locale, this);
// Must return self if chars unchanged
if (count != result.count) {
return result;
}
for (int i = 0; i < count; i++) {
if (value[offset + i] != result.value[result.offset + i]) {
return result;
}
}
return this;
}
COM: <s> converts the characters in this string to uppercase using the specified </s>
|
funcom_train/6347785 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void drawOval(int x, int y, int w, int h) {
java.awt.Graphics graphics = screen.getGraphics();
graphics.drawOval(x, y, w, h);
} // drawOval(int x, int y, int w, int h)
COM: <s> draws an oval </s>
|
funcom_train/13392751 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private DirectoryWatcherTask createDirectoryWatcher(int period) throws Exception {
DirectoryWatcherTask dirWatch = new DirectoryWatcherTaskImpl(deploymentDirectroy);
((EventCapableService) dirWatch).setEventService(eventService);
dirWatch.setWatchPeriod(period);
dirWatch.start(taskEngine);
return dirWatch;
}
COM: <s> create a directory watcher </s>
|
funcom_train/3527823 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
if ( (namespaceURI == null) || (namespaceURI.length() == 0) ) {
namespaceURI = defaultNamespace.getURI();
qName = defaultNamespace.getPrefix() + ":" + qName;
}
super.endElement(namespaceURI, localName, qName);
}
COM: <s> overwrite code end element code in order to provide the </s>
|
funcom_train/29629836 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void notifyItemSpawn(Item item, int x, int y) {
if (eventListeners.get("itemSpawn") == null)
return;
if (eventQueue.get("itemSpawn") == null)
eventQueue.put("itemSpawn", new ArrayList());
ArrayList li = eventQueue.get("itemSpawn");
li.add(new ItemEvent(x, y, item));
}
COM: <s> invoked when an item spawns updates </s>
|
funcom_train/22001965 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run() {
try {
List quotes = YahooIDQuoteImport.importSymbols(symbols);
quoteCache.load(quotes);
// System.out.println("---------");
// for(Iterator iterator = quotes.iterator();
// iterator.hasNext();)
// System.out.println(iterator.next());
} catch (ImportExportException e) {
// If an error message is already up, then don't display the
// error.
// This prevents us spamming the user with error messages every
// sync period.
if (!DesktopManager.isDisplayingMessage())
DesktopManager.showErrorMessage(e.getMessage());
}
}
COM: <s> download the current intra day quotes </s>
|
funcom_train/19424013 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void logWarn(HttpServletRequest req, Object message, Throwable t) {
Object enhancedMessage = enhanceMessage(req, message);
if (log != null) {
if (t == null) {
log.warn(enhancedMessage);
} else {
log.warn(enhancedMessage, t);
}
} else {
System.out.println("Warn: " + enhancedMessage);
}
}
COM: <s> log an error with warn log level </s>
|
funcom_train/9190135 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addBeginNodePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Flow_beginNode_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Flow_beginNode_feature", "_UI_Flow_type"),
FlowPackage.Literals.FLOW__BEGIN_NODE,
false,
false,
false,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the begin node feature </s>
|
funcom_train/38543397 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object consumeItem() {
synchronized (this.itemsLists) {
final Object theItem = super.consumeItem();
final Iterator iter = this.itemsLists.values().iterator();
List current = null;
int count = 0;
while (iter.hasNext()) {
current = (List) iter.next();
synchronized (current) {
current.add(theItem);
current.notifyAll();
}
count++;
}
if (theItem != null) {
this.referenceCounts.put(theItem, new Integer(count));
}
return theItem;
}
}
COM: <s> consumes a new item </s>
|
funcom_train/9559477 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private DashboardXYChart getDashboardXYChart() {
IStructuredSelection selection = (IStructuredSelection) getSelection();
if (selection.size() != 1) {
return null;
}
if (!(selection.getFirstElement() instanceof ChartEditPart)) {
return null;
}
ChartEditPart chartEditPart = (ChartEditPart) selection
.getFirstElement();
AbstractDashboardChart dashboardChart = chartEditPart.getChart();
if (!(dashboardChart instanceof DashboardXYChart)) {
return null;
}
return (DashboardXYChart)dashboardChart;
}
COM: <s> get the selected chart if any or null otherwise </s>
|
funcom_train/5346114 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected List getKeyWords(){
List retList = new ArrayList();
Iterator docs;
synchronized(mainMap){
docs = mainMap.values().iterator();
while(docs.hasNext()){
LimeXMLDocument d = (LimeXMLDocument)docs.next();
retList.addAll(d.getKeyWords());
}
}
return retList;
}
COM: <s> gets a list of keywords from all the documents in this collection </s>
|
funcom_train/26549224 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void writeObject(java.io.ObjectOutputStream out) throws IOException {
if (this.tag.equals(Tag.NULL_TAG)) {
out.writeBoolean(false);
} else {
out.writeBoolean(true);
out.writeObject(this.tag);
}
out.writeBoolean(this.propagate);
}
COM: <s> writes code this code auth to the given code java </s>
|
funcom_train/40618629 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long getRandomLong() {
switch (random.nextInt(10)) {
case 0:
return Long.MAX_VALUE;
case 1:
return Long.MIN_VALUE;
case 2:
return random.nextLong();
case 3:
case 4:
return 0;
case 5:
return (int) (random.nextGaussian() * 20000) - 2000;
default:
return (int) (random.nextGaussian() * 200) - 50;
}
}
COM: <s> get a random long </s>
|
funcom_train/27843702 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setParent(Controller parent) {
assert ((parent == null) || (parent instanceof AbstractController));
if ((_parent == null) || !_parent.equals(parent)) {
// detach parent from this child
if (_parent != null) {
_parent.removeChild(this);
}
_parent = (AbstractController) parent;
if (_parent != null) {
_parent.addChild(this);
}
}
}
COM: <s> hook this controller into the chain of responsiblity as a child of the </s>
|
funcom_train/32156005 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int print(Graphics g, PageFormat formatMenu, int index) {
if (index > 0) {
return (NO_SUCH_PAGE);
} else {
Graphics2D g2d = (Graphics2D) g;
g2d.translate(formatMenu.getImageableX(), formatMenu.getImageableY());
RepaintManager manager1 = RepaintManager.currentManager(textArea);
manager1.setDoubleBufferingEnabled(false);
textArea.paint(g2d);
RepaintManager manager2 = RepaintManager.currentManager(textArea);
manager2.setDoubleBufferingEnabled(true);
return (PAGE_EXISTS);
}
}
COM: <s> this method opens a print dialog box parameters </s>
|
funcom_train/12309535 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long getLastModified() {
if (lastModified == 0) {
if (file != null)
lastModified = file.lastModified();
else if (url != null) {
if (response == null) {
try {
URL resolvedURL = URLEncoder.encode(url);
response = ConnectionFactory.get(resolvedURL);
} catch (MalformedURLException e) {
// return 0
} catch (IOException e) {
// return 0
}
}
lastModified = response.getLastModified();
}
}
return lastModified;
}
COM: <s> returns the timestamp when the content was last modified </s>
|
funcom_train/10463255 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void clear() throws IOException {
if (writer != null) {
throw new IOException();
} else {
nextChar = 0;
if (LIMIT_BUFFER && (cb.length > Constants.DEFAULT_TAG_BUFFER_SIZE)) {
cb = new char[Constants.DEFAULT_TAG_BUFFER_SIZE];
bufferSize = cb.length;
}
}
}
COM: <s> clear the contents of the buffer </s>
|
funcom_train/10681052 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void logLaunchCmd(String[] cmdLine, boolean debug) {
StringBuffer sBuff = new StringBuffer("Launching Harmony VM "); //$NON-NLS-1$
if (debug) {
sBuff.append("in debug mode "); //$NON-NLS-1$
}
sBuff.append(": "); //$NON-NLS-1$
sBuff.append(renderCommandLine(cmdLine));
HyLaunchingPlugin.getDefault().log(sBuff.toString());
}
COM: <s> write the launch invocation string to the platform log </s>
|
funcom_train/31979363 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void recycle() {
// Reset the instance variables associated with this Session
attributes.clear();
setAuthType(null);
creationTime = 0L;
expiring = false;
id = null;
lastAccessedTime = 0L;
maxInactiveInterval = -1;
accessCount = 1;
notes.clear();
setPrincipal(null);
isNew = false;
isValid = false;
manager = null;
deltaRequest.clear();
}
COM: <s> release all object references and initialize instance variables in </s>
|
funcom_train/50504646 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getInitAntTasks() {
List result = new LinkedList();
Element property = new Element("property");
JDOMHelper.setAttribute(property,"name", "ejb.apachesoap.dir");
JDOMHelper.setAttribute(property,"value", "${ejb.dir}");
result.add(property);
return result;
}
COM: <s> gets the attribute to be added to the init ant task </s>
|
funcom_train/12171045 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void checkEmpty(EmptyElementType type) {
if (type == null) {
throw new IllegalStateException(
"Empty element may not have a null empty element type");
}
if (hasChildren()) {
throw new IllegalArgumentException("Unable to access empty " +
"element type for element " + this + ", it has children");
}
}
COM: <s> convenience method to check for prerequisites for the empty type </s>
|
funcom_train/22430286 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Plugin probeNextPlugin() {
Plugin plugin = null;
int i=0;
while (plugin == null && i<listPending.size()) {
plugin = (Plugin) listPending.get(i);
if (isAllDependencyCompleted(plugin)) {
return plugin;
}
i++;
}
return null;
}
COM: <s> get next test ready to be run </s>
|
funcom_train/3543850 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JCheckBox createCheckBox(GridBagConstraints c, int row, int topPad, String labelKey) {
c.gridy = row;
c.insets.top = topPad;
/* Label */
String text = Main.getString(labelKey) + ":";
JLabel label = new JLabel(text);
label.setFont(ui.getFont());
add(label, c);
/* Checkbox */
JCheckBox checkBox = new JCheckBox();
checkBox.setHorizontalAlignment(SwingConstants.RIGHT);
add(checkBox, c);
return checkBox;
}
COM: <s> creates a checkbox </s>
|
funcom_train/51646750 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void redoTextChange() {
try {
if (fDocumentUndoManager.fDocument instanceof IDocumentExtension4)
((IDocumentExtension4) fDocumentUndoManager.fDocument).replace(fStart, fEnd - fStart, fText, fRedoModificationStamp);
else
fDocumentUndoManager.fDocument.replace(fStart, fEnd - fStart, fText);
} catch (BadLocationException x) {
}
}
COM: <s> re applies the change described by this change </s>
|
funcom_train/12674629 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public IDefinition getDefinition(String name, Occurrence location) {
Reference symbol = getSymbol(name, location);
//if (symbol != null) {
// System.out.println(" found " + name);
//}
//else {
// System.out.println(" !could not find " + name);
//}
return resolveDefinition(symbol);
}
COM: <s> gets the definition of the given symbol </s>
|
funcom_train/39001751 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void printEssential(){
System.out.print(hopLimit);
System.out.print(' ');
System.out.print(type);
System.out.print(' ');
System.out.print(sourceAddress);
System.out.print(' ');
System.out.print(destAddress);
System.out.print(' ');
}
COM: <s> prints the essential parts of a routing message which are the same for </s>
|
funcom_train/25665380 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String buildBackupFilename() {
Calendar calendar = Calendar.getInstance();
String timestamp = "" + calendar.get(Calendar.YEAR) + calendar.get(Calendar.MONTH)
+ calendar.get(Calendar.DAY_OF_MONTH);
String filename = BACKUP_FILE_NAME_BASE + "-" + timestamp + ".txt";
return filename;
}
COM: <s> filename for backup </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.