__key__ stringlengths 16 21 | __url__ stringclasses 1
value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/15490920 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getNextChoice() {
if (choice==null)
return "";
Choice thisChoice = (Choice)(choice.elementAt(choiceIndex));
String item = thisChoice.getSelectedItem();
if (macro) {
String label = (String)labels.get((Object)thisChoice);
item = Macro.getValue(macroOptions, label, item);
//IJ.write("getNextChoice: "+label+" "+item);
}
if (Recorder.record)
recordOption(thisChoice, item);
choiceIndex++;
return item;
}
COM: <s> returns the selected item in the next popup menu </s>
|
funcom_train/21952564 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setAllProperties(Properties properties) {
for (String propertyName: properties.stringPropertyNames()) {
String propertyValue = properties.getProperty(propertyName);
internSetProperty(propertyName, propertyValue, false);
}
for (String propertyName: properties.stringPropertyNames()) {
fireValueChanged(propertyName);
}
}
COM: <s> sets a group of properties at once not firing any value changed events </s>
|
funcom_train/36108992 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object createParameter(int idBlock, boolean isLooselyCoupled) {
BridgeParameter newPrameter = new DefaultBridgeParameter(getParameterModelID());
newPrameter.setId(newPrameter.hashCode());
Object id = newPrameter.getModelId();
parameterMap.put(id, newPrameter);
if (isLooselyCoupled) addLooselyCoupledParameter(idBlock, id);
addFictitiousParameter(idBlock, id);
return newPrameter.getModelId();
}
COM: <s> creation and putting parameter into parameter map </s>
|
funcom_train/35976237 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void characters(char[] buf, int start, int count) throws SAXParseException {
if (parentWrapper == null) {
try {
ProjectHelper.addText(helperImpl.project, child, buf, start, count);
} catch (BuildException exc) {
throw new SAXParseException(exc.getMessage(), helperImpl.locator, exc);
}
} else {
childWrapper.addText(buf, start, count);
}
}
COM: <s> adds text to the element using the wrapper if one is </s>
|
funcom_train/24313626 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void add(String username, WfResourceInternal res) throws Exception {
synchronized(this) {
//if (cache.get(res.resource_key())!=null) System.err.println("Warning - already have res "+res+" in cache!!!");
cache.put(username, res);
}
}
COM: <s> adds resource to the resource cache </s>
|
funcom_train/26401833 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String convert(LoggingEvent event) {
if (event == null) return null;
if (event.getThrowableInformation() == null) return null;
String[] results = event.getThrowableStrRep();
if (results != null && results.length > 0) {
StringBuffer result = new StringBuffer();
result.append(results[0]);
for (int i = 1; i < results.length; i++) {
result.append("\n");
result.append(results[i]);
}
return result.toString();
} else return null;
}
COM: <s> writing the stack trace of the throwable contained in </s>
|
funcom_train/43989283 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ComponentValueModel getBufferedComponentModel(String propertyName) {
ComponentValueModel bufferedComponentModel =
bufferedComponentModels.get(propertyName);
if (bufferedComponentModel == null) {
AbstractValueModel model = getBufferedModel(propertyName);
bufferedComponentModel = new ComponentValueModel(model);
bufferedComponentModels.put(propertyName, bufferedComponentModel);
}
return bufferedComponentModel;
}
COM: <s> looks up or creates a buffered component adapter to the read write </s>
|
funcom_train/42570908 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addTextPropertyDescriptor(Object object) {
itemPropertyDescriptors.add(createItemPropertyDescriptor(
((ComposeableAdapterFactory) adapterFactory)
.getRootAdapterFactory(), getResourceLocator(),
getString("_UI_StaticTextTransformator_text_feature"),
getString("_UI_PropertyDescriptor_description",
"_UI_StaticTextTransformator_text_feature",
"_UI_StaticTextTransformator_type"),
DescPackage.Literals.STATIC_TEXT_TRANSFORMATOR__TEXT, true,
false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null,
null));
}
COM: <s> this adds a property descriptor for the text feature </s>
|
funcom_train/2861822 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deleteDatabaseFromDbList(String dbName) {
String method = "ZUserData.deleteDatabaseFromDbList()";
defaultDbList = false;
if (dbName == null)
return;
ZDb localzdb;
localzdb = (ZDb)zDbList.get(dbName);
if (localzdb == null && !localzdb.isDbGroupDefinition()) {
removeDbfromList(localzdb);
}
}
COM: <s> deletes the dbname from the users list of valid databases </s>
|
funcom_train/38352403 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void updateStatus() {
boolean useMapper = cbUseMapper.isSelected();
listMapper.setEnabled(useMapper && (!scheduleStarted));
if (useMapper) {
listMapper.setSelectedIndex(lastSelectedIndex);
} else {
lastSelectedIndex = listMapper.getSelectedIndex();
listMapper.getSelectionModel().clearSelection();
}
buConfigMapper.setEnabled(useMapper && schedule.getMapper() instanceof Configurable);
taDescrMapper.setEnabled(useMapper);
}
COM: <s> updates the display and enabled disabled status of the controls </s>
|
funcom_train/3926667 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void attemptOptimization( Node n ) {
Node ifs = n;
n = n.getNodeParent();
if ( n instanceof DEFUSENode ) {
n = n.getNodeParent();
}
if ( n != null ) {
replaceRange( n.getFirstTokenOffset(), n.getLastTokenOffset(), n );
}
}
COM: <s> always replace the entire containing shape node </s>
|
funcom_train/27811112 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void createPlayer(Player player) {
playerDao.createPlayer(player);
List<Transcoding> transcodings = transcodingService.getAllTranscodings();
List<Transcoding> defaultActiveTranscodings = new ArrayList<Transcoding>();
for (Transcoding transcoding : transcodings) {
if (transcoding.isDefaultActive()) {
defaultActiveTranscodings.add(transcoding);
}
}
transcodingService.setTranscodingsForPlayer(player, defaultActiveTranscodings);
}
COM: <s> creates the given player and activates all transcodings </s>
|
funcom_train/44163395 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getAvailableSpace(Transportable t) {
UnitType type = (t.getTransportLocatable() instanceof Unit)
? ((Unit)t.getTransportLocatable()).getType()
: null;
return getAvailableSpace(type, t.getTransportSource(),
t.getTransportDestination());
}
COM: <s> returns the available space for the given code transportable code </s>
|
funcom_train/5312045 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void datasetChanged(DatasetChangeEvent e) {
// TODO: by coding the event with some information about what changed
// in the dataset, we could make the recalculation of the interval
// more efficient in some cases...
if (this.autoWidth) {
this.autoIntervalWidth = recalculateInterval();
}
}
COM: <s> handles events from the dataset by recalculating the interval if </s>
|
funcom_train/2714158 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addDocumentType(IDocumentType docType) {
if (!this.documentTypes.contains(docType)) {
this.documentTypes.add(docType);
if (this.docTypeExtnMap != null) {
this.docTypeExtnMap.put(docType, new Vector<String>(1));
}
}
}
COM: <s> adds a document type to the list </s>
|
funcom_train/8569409 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void reset() {
Iterator iter = allNeurons.iterator();
while (iter.hasNext()) {
Neuron n = (Neuron) iter.next();
n.reset();
}
iter = recurrentConns.iterator();
while (iter.hasNext()) {
CacheNeuronConnection c = (CacheNeuronConnection) iter.next();
c.reset();
}
}
COM: <s> clear all memory in network including neurons and recurrent connections </s>
|
funcom_train/34999161 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Pagination forSearch(int totalRecords) {
this.recordsPerPage = this.config.getInt(ConfigKeys.TOPICS_PER_PAGE);
this.totalRecords = totalRecords;
this.totalPages = this.calculeTotalPages();
this.thisPage = this.calculeThisPage(this.start);
this.start = this.calculeStart(this.start, this.recordsPerPage);
this.baseUrl = String.format("/%s/%s", Domain.SEARCH, Actions.EXECUTE);
this.id = 0;
return this;
}
COM: <s> create pagination for search </s>
|
funcom_train/4529131 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void startDistributedUpgradeIfNeeded() throws IOException {
UpgradeManagerDatanode um = DataNode.getDataNode().upgradeManager;
assert um != null : "DataNode.upgradeManager is null.";
if(!um.getUpgradeState())
return;
um.setUpgradeState(false, um.getUpgradeVersion());
um.startUpgrade();
return;
}
COM: <s> start distributed upgrade if it should be initiated by the data node </s>
|
funcom_train/802733 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addFullNamePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CvLookupType_fullName_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_CvLookupType_fullName_feature", "_UI_CvLookupType_type"),
MzdataPackage.Literals.CV_LOOKUP_TYPE__FULL_NAME,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the full name feature </s>
|
funcom_train/3913199 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void toXmlBody(PrintWriter result) {
super.toXmlBody(result);
// check if there was any role to monitor. Default is SELF indicated by a
// null value of roleToMonitor
if (roleToMonitor != null) {
result.write("<role-to-monitor>" + roleToMonitor + "</role-to-monitor>");
}
}
COM: <s> adds the xml representation of the data part of this property to a </s>
|
funcom_train/9713787 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public AxisModule getModule(String moduleName, String moduleVersion) {
if (moduleVersion == null || moduleVersion.trim().length() == 0) {
moduleVersion = getDefaultModuleVersion(moduleName);
}
return (AxisModule) allModules.get(Utils.getModuleName(moduleName, moduleVersion));
}
COM: <s> return the module having name module name version module version </s>
|
funcom_train/18747644 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void createEdge(Node src, Node tgt) {
if (src != null && tgt != null) {
this.createEdge(src, "",tgt);
} else {
System.out.println("createEdge(a,b): Cannot create edge: " + src
+ " --> " + tgt);
}
}
COM: <s> creates a non labeled edge from source node to target node </s>
|
funcom_train/45247613 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JNumberFloatField getJNumberFloatFieldRelacaoJC69() {
if (jNumberFloatFieldRelacaoJC69 == null) {
jNumberFloatFieldRelacaoJC69 = new JNumberFloatField();
jNumberFloatFieldRelacaoJC69.setLocation(new Point(345, 90));
jNumberFloatFieldRelacaoJC69.setFont(new Font("Arial", Font.PLAIN,
12));
jNumberFloatFieldRelacaoJC69.setSize(new Dimension(65, 20));
}
return jNumberFloatFieldRelacaoJC69;
}
COM: <s> this method initializes j number float field relacao jc69 </s>
|
funcom_train/17675806 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List findNonPCClassNames() {
ArrayList a = new ArrayList();
int n = classes.length;
for (int i = 0; i < n; i++) {
if (!classes[i].isPersistenceCapable()) a.add(classes[i].qname);
}
return a;
}
COM: <s> return a list of all classes that are not persistence capable i </s>
|
funcom_train/25705744 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JTextArea getTAtranslation() {
if( TAtranslation == null ) {
TAtranslation = new JTextArea();
TAtranslation.setPreferredSize(new java.awt.Dimension(0,16));
TAtranslation.setLineWrap(true);
TAtranslation.setWrapStyleWord(true);
}
return TAtranslation;
}
COM: <s> this method initializes j text area </s>
|
funcom_train/32191625 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String generateModelURIFromAlias(String modelAlias) throws ZOntologyUtilsException {
if (!modelAlias.equals(MAIN_BASE_MODEL_NAME) && !modelAlias.equals(MAIN_MODEL_NAME)
&& !aliasURLMap.containsKey(modelAlias)) {
throw new ZOntologyUtilsException("\"" + modelAlias
+ "\" isn't the main model or any other model in the database");
}
return "<" + MODEL_PREFIX + modelAlias + ">";
}
COM: <s> generate a model uri from its alias </s>
|
funcom_train/36909901 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Node nextNode() {
if (currentNode == null)
return null;
Node result = getFirstChild(currentNode);
if (result != null) {
currentNode = result;
return result;
}
result = getNextSibling(currentNode);
if (result != null) {
currentNode = result;
return result;
}
// return parent's 1st sibling.
Node parent = getParentNode(currentNode);
while (parent != null) {
result = getNextSibling(parent);
if (result != null) {
currentNode = result;
return result;
} else {
parent = getParentNode(parent);
}
}
// end , return null
return null;
}
COM: <s> return the next node from the current node after applying filter </s>
|
funcom_train/2844891 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isGold(String path) {
ProjectItemTreeNode node = (ProjectItemTreeNode) nodeMap.get(path);
if (node != null)
return ((ProjectItem) node.getUserObject()).isGold();
System.err.println("Project: Can't determine isGold value for " + path);
return false;
}
COM: <s> returns the current gold state of the specifed specified file path </s>
|
funcom_train/51222857 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void registerToolBarGroup(ToolBarButtonGroup group) {
group.addActionListener(new ActionListener() {
@Override public void actionPerformed(ActionEvent event) {
AbstractButton button = (AbstractButton) event.getSource();
DiagramController.this.selectedAction = DiagramAction.values()[button.getMnemonic()];
DiagramController.this.statusPanel.setLeftMessage(
button.getToolTipText());
}
});
}
COM: <s> registers the tool bar group </s>
|
funcom_train/44011597 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetPrice() {
System.out.println("getPrice");
RevenueSourceBO instance = new RevenueSourceBO();
double expResult = 0.0;
double result = instance.getPrice();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
COM: <s> test of get price method of class edu </s>
|
funcom_train/50862883 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getMaintenanceProbability(String entityName) {
if (entityName == null) {
throw new IllegalArgumentException("name is null");
}
int result = 0;
Iterator<MaintenanceEntity> i = maintenanceEntities.iterator();
while (i.hasNext()) {
MaintenanceEntity entity = i.next();
if (entity.name.equalsIgnoreCase(entityName)) {
result = entity.probability;
}
}
return result;
}
COM: <s> gets the percentage probability of a part being needed by an maintenance entity </s>
|
funcom_train/17699288 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void filter(BufferedImageOp op)
{
if (image == null) return;
BufferedImage filteredImage
= new BufferedImage(image.getWidth(), image.getHeight(), image.getType());
op.filter(image, filteredImage);
image = filteredImage;
repaint();
}
COM: <s> apply a filter and repaint </s>
|
funcom_train/24590561 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JTextField getJNumberOfBacklogItemsTextField() {
if (jNumberOfBacklogItemsTextField == null) {
jNumberOfBacklogItemsTextField = new JTextField();
jNumberOfBacklogItemsTextField.setName("product_numberofbacklogitems_textfield");
jNumberOfBacklogItemsTextField.setBounds(new Rectangle(310, 15, 100, 20));
jNumberOfBacklogItemsTextField.setEditable(false);
}
return jNumberOfBacklogItemsTextField;
}
COM: <s> this method initializes j number of backlog items text field </s>
|
funcom_train/36108868 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void retrieveFile() throws ExternalException {
try {
Writer texfileWriter = new FileWriter(filePath);
BufferedWriter writer = new BufferedWriter(texfileWriter);
for (int i = 0; i < offset; i++) {
writer.write(fileOffset[i]);
writer.newLine();
}
Iterator iterator = file.iterator();
while(iterator.hasNext()) {
writer.write((String)iterator.next());
writer.newLine();
}
writer.close();
} catch (IOException e) {
throw new ExternalException("IO-error during reading text file.\nIOException: " + e.getMessage());
}
}
COM: <s> to store list in file </s>
|
funcom_train/41248042 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testBug10630() throws Exception {
Connection conn2 = null;
Statement stmt2 = null;
try {
conn2 = getConnectionWithProps((String)null);
stmt2 = conn2.createStatement();
conn2.close();
stmt2.getWarnings();
fail("Should've caught an exception here");
} catch (SQLException sqlEx) {
assertEquals("08003", sqlEx.getSQLState());
} finally {
if (stmt2 != null) {
stmt2.close();
}
if (conn2 != null) {
conn2.close();
}
}
}
COM: <s> tests fix for bug 10630 statement </s>
|
funcom_train/39549938 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setBaseTransform(AffineTransform t) {
if ((baseTransform != t) &&
((baseTransform == null) || (!baseTransform.equals(t))))
// new Display transform so events are not where user
// thinks they were.
eventQueue.clear();
baseTransform = t;
}
COM: <s> sets the base transform applied to mouse event coordinates prior </s>
|
funcom_train/19538203 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void handleMetaTag(String name, String content) {
if (actionListeners != null) {
if (log.isDebugEnabled()) {
log.debug("metaTag found: name='" + name + "' content='" + content + "'");
}
actionListeners.actionPerformed(new MetaTagActionEvent(name, content));
}
}
COM: <s> handle any meta tag information in the html </s>
|
funcom_train/51604552 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getJPanel5() {
if (jPanel5 == null) {
jPanel5 = new JPanel();
jPanel5.setVisible(false);
jPanel5.setLayout(new BorderLayout());
jPanel5.add(getJToolBar3(), BorderLayout.WEST);
}
return jPanel5;
}
COM: <s> this method initializes j panel5 </s>
|
funcom_train/31679133 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean addAll(Collection <? extends E> c) {
if (c instanceof FastCollection)
return addAll((FastCollection) c);
boolean modified = false;
Iterator <? extends E> itr = c.iterator();
int pos = c.size();
while (--pos >= 0) {
checkCanceled();
if (add(itr.next())) {
modified = true;
}
}
return modified;
}
COM: <s> appends all of the values in the specified collection to the end of </s>
|
funcom_train/23867553 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void pushRelationalExpression(final String column, final RelationalOperator operator, final Object value) {
CDebug.checkParameterNotEmpty(column, "column");
CDebug.checkParameterNotNull(operator, "operator");
if (value != null && (!(value instanceof String) || ((String)value).length() > 0)) {
push(column + operator + createPositionalParameter(value));
}
}
COM: <s> pushes a relational expression constructed from the supplied column </s>
|
funcom_train/9365016 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void getMetrics(DisplayMetrics outMetrics) {
outMetrics.widthPixels = getWidth();
outMetrics.heightPixels = getHeight();
outMetrics.density = mDensity;
outMetrics.densityDpi = (int)((mDensity*DisplayMetrics.DENSITY_DEFAULT)+.5f);
outMetrics.scaledDensity= outMetrics.density;
outMetrics.xdpi = mDpiX;
outMetrics.ydpi = mDpiY;
}
COM: <s> initialize a display metrics object from this displays data </s>
|
funcom_train/2294183 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String dialogButtonRow(int segment) {
if (segment == HTML_START) {
return "<!-- button row start -->\n<div class=\"dialogbuttons\" unselectable=\"on\">\n";
} else {
return "</div>\n<!-- button row end -->\n";
}
}
COM: <s> builds the button row under the dialog content area without the buttons </s>
|
funcom_train/11079470 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
if (component instanceof SupportsMarkup) {
final SupportsMarkup supportsMarkup = (SupportsMarkup) component;
Markup markup = ComponentUtils.updateMarkup(component, supportsMarkup.getMarkup());
supportsMarkup.setCurrentMarkup(markup);
}
}
COM: <s> hook to e </s>
|
funcom_train/47509462 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void save(Om entity) {
EntityManagerHelper.log("saving Om instance", Level.INFO, null);
try {
getEntityManager().persist(entity);
EntityManagerHelper.log("save successful", Level.INFO, null);
} catch (RuntimeException re) {
EntityManagerHelper.log("save failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> perform an initial save of a previously unsaved om entity </s>
|
funcom_train/21079924 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void enqueueDownload(XmlOrganisation org, XmlModule mod, XmlCategory category, String[] folderNames) throws Exception {
for (Iterator iter = category.getExtensions().iterator(); iter.hasNext();) {
XmlExtension ext = (XmlExtension) iter.next();
enqueueDownload(org, mod, category, ext, folderNames);
}
}
COM: <s> handle a category for a given module and organisation </s>
|
funcom_train/48338605 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Object readResolve() throws ObjectStreamException {
// Check for the dummy environment.
if (null == id) {
return DUMMY;
}
// Resolve to actual environment.
Environment env = (Environment)((Map)serializationSet.get()).get(id);
if (null == env) {
// Signal an inconsistent check-point.
throw new CheckPointException("Undeclared environment in check-point" +
" (" + id + ")");
}
return env;
}
COM: <s> resolve this environment reference during deserialization </s>
|
funcom_train/1710375 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton initOpenBut() {
JButton open = new JButton();
open.setIcon(new ImageIcon(getClass().getResource("/org/jpedal/examples/simpleviewer/res/open.gif"))); //$NON-NLS-1$
open.setText("Open");
open.setToolTipText("Open a file");
open.setBorderPainted(false);
open.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
selectFile();
}
});
return open;
}
COM: <s> returns the open button with listener </s>
|
funcom_train/34849246 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void add(String id, List values) {
List al = null;
if (allResults.containsKey(id)) {
al = (List) allResults.get(id);
} else {
al = new java.util.ArrayList();
allResults.put(id, al);
}
al.addAll(values);
if (valuesFromUser) {
userSpecifiedIDs.add(id);
}
}
COM: <s> adds the specified values to any existing values already associated with </s>
|
funcom_train/23997204 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean prepare() {
final int currentNetworkCount = Cytoscape.getNetworkSet().size();
if (currentNetworkCount != 0) {
// Show warning
final String warning = "Current session will be lost.\nDo you want to continue?";
final int result = JOptionPane.showConfirmDialog(Cytoscape.getDesktop(), warning,
"Caution!", JOptionPane.YES_NO_OPTION,
JOptionPane.WARNING_MESSAGE, null);
if (result == JOptionPane.YES_OPTION) {
return true;
} else {
return false;
}
} else {
return true;
}
}
COM: <s> before loading the new session we need to clean up current session </s>
|
funcom_train/44490845 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public VersionMap getVersionsByPropertyValue(String propertyName, Object testValue) {
VersionMap resultMap = new VersionMapImpl();
Iterator iter = this.versionsByResource.values().iterator();
while (iter.hasNext()) {
Version ver = (Version)(iter.next());
if (ver.hasProperty(propertyName)) {
Object propVal = ver.getProperty(propertyName);
if (propVal != null && propVal.equals(testValue)) {
resultMap.put(ver.getId(), ver);
}
}
}
return resultMap;
}
COM: <s> returns the set of versions that exhibit the specified value for the </s>
|
funcom_train/50894632 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(SignatureType other) {
if (this == other)
return true;
return (this.type == other.getType()
&& ((this.arrayType == null && other.arrayType == null) || arrayMatch(other)) && ((this.listContents == null && other.listContents == null) || listMatch(other)));
}
COM: <s> the standard code equals code method of the java </s>
|
funcom_train/17848752 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JMenuItem getItem(int pos) {
if (pos < 0) {
throw new IllegalArgumentException("index less than zero.");
}
JMenuItem menuItem = null;
Component component = getMenuComponent(pos);
if (component instanceof JMenuItem) {
menuItem = (JMenuItem) component;
}
return menuItem;
}
COM: <s> returns the code jmenu item code at the specified position </s>
|
funcom_train/11005750 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setCharTextPropVal(String propName, int val) {
// Ensure we have the StyleTextProp atom we're going to need
if(characterStyle == null) {
parentRun.ensureStyleAtomPresent();
// characterStyle will now be defined
}
TextProp tp = fetchOrAddTextProp(characterStyle, propName);
tp.setValue(val);
}
COM: <s> sets the value of the given paragraph text prop add if required </s>
|
funcom_train/35951143 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean addProduct(String name, short quantity) {
if (name != null && name.length() > 0 && quantity > -1) {
// Create the product
Product product = new Product(this);
product.setName(name);
product.setQuantity(quantity);
// Add to the shopList
int newSize = addItem(PRODUCTS_PROPERTY, product);
if (newSize != -1) {
setNumProducts(newSize);
}
return true;
}
return false;
}
COM: <s> create a new product and add it to shop list and list </s>
|
funcom_train/2760019 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Converter createFromEnumConverter(final Class fromType, final Class toType) {
return new Converter() {
public Class getFromClass() {
return fromType;
}
public Class getToClass() {
return toType;
}
public boolean init(net.sf.mapifier.core.conv.TypeConverter converter, Class fromClass, Class toClass) {
return false;
}
public Object convert(Object enumObj) {
return enumObj.toString();
}
};
}
COM: <s> creates an enum converter that converts from the enum value to the </s>
|
funcom_train/21644597 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenuItem getHelpRobocodeRepositoryMenuItem() {
if (helpRobocodeRepositoryMenuItem == null) {
helpRobocodeRepositoryMenuItem = new JMenuItem();
helpRobocodeRepositoryMenuItem.setText("Robocode Repository");
helpRobocodeRepositoryMenuItem.setMnemonic('p');
helpRobocodeRepositoryMenuItem.setDisplayedMnemonicIndex(11);
helpRobocodeRepositoryMenuItem.addActionListener(eventHandler);
}
return helpRobocodeRepositoryMenuItem;
}
COM: <s> return the help robocode repository menu item </s>
|
funcom_train/45612089 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addAll( A[] targets ){
int ofx;
for(int x=0; x<targets.length; x++){
ofx=stats.size()+x;
stats.add(ofx, targets[x]);
propsup.fireIndexedPropertyChange("stat", ofx, null, targets[x]);
}
}
COM: <s> adds an array of stats to be processed </s>
|
funcom_train/31438213 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setImage(PlanarImage pImage) {
//
// Change the image, reinitialise the canvas and then redraw
// it.
//
final PlanarImage oldImage = mSource;
mSource = pImage;
initialize();
revalidate();
repaint();
//
// Inform interested parties of the change
//
firePropertyChange(IMAGE_PROPERTY, oldImage, pImage);
}
COM: <s> updates the image being displayed by the canvas </s>
|
funcom_train/3475163 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public MouseEventRecordable () {
this(null, 0, "", "", 0, 0, "", "", 0, 0, false, 0, 0, 0, 0, 0, false);
}
COM: <s> creates a mouse event recordable with default values and no environment </s>
|
funcom_train/16401388 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Environment withClientSocketFactory(SocketFactory sf) {
if (mSelector != null) {
throw new IllegalStateException("Cannot combine socket factory and selector");
}
return new Environment(mExecutor, mIOExecutor, mCloseableSet, mClosed,
sf, mServerSocketFactory, null);
}
COM: <s> returns an environment instance which connects using the given client </s>
|
funcom_train/19408221 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void undo() throws CannotUndoException {
// the CommandProcessor should prevent us from being called
// without a successful prior execute, just be safe here
if (fObjects == null)
throw new CannotUndoException("no undo information");
VarBindings varBindings = fSystemState.system().varBindings();
Iterator it1 = fObjects.iterator();
Iterator it2 = fVarNames.iterator();
while (it1.hasNext()) {
fSystemState.deleteObject((MObject) it1.next());
String varname = (String) it2.next();
varBindings.remove(varname);
}
}
COM: <s> undo effect of command </s>
|
funcom_train/51360202 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int rawX() {
// discharge cap
CPU.writePin(xPotPin, true);
CPU.delay(10);
// read pot
// -- timeout ~20 mS (200K * 0.1uF = 1TC)
// -- cap *should* charge to 63% in 1TC
// -- threshold is 50%
return CPU.rcTime(2304, xPotPin, false);
}
COM: <s> reads raw x value from joystick </s>
|
funcom_train/42760634 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object parameterValue(String parameter) {
// This javadoc is copied verbatim in
// Action.java.tmplt. If you change this,
// consider update the template.
if (parameter.compareTo("actionID") == 0)
return "" + getActionID();
else if (parameter.compareTo("playerID") == 0)
return getPlayerID();
if (parameter.compareTo("entityID") == 0)
return getEntityID();
else
return null;
} // parameterValue
COM: <s> returns a parameter value by its name </s>
|
funcom_train/19454543 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Vector retrieveAllObjects(StrataObject anObject) {
String aKey = anObject.getClass().getName();
Vector results = null;
if (getCache().inCache(aKey)) {
results = getCache().getObjects(aKey);
} else {
results = factory().produce();
if (results == null) {
results = new Vector();
}
getCache().add(aKey, results);
}
return copyOfVector(results);
}
COM: <s> returns a vector of objects matching a given code strata object code </s>
|
funcom_train/18514181 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void prepareExport() {
expType = CESE.getEnvironment().getModelManager().getExpType();
builder = CESE.getEnvironment().getModelManager().getRecordBuilder();
if ((model.getsteps() <= 0) || (model.getdt() <= 0))
throw new IllegalArgumentException();
createChannels();
if (expType == CLAMP_EXPERIMENT)
builder.buildRecord(model);
}
COM: <s> prepares export to the top new tt results view tt window based on </s>
|
funcom_train/40945062 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addRoot(File root) {
if (root != null) {
final File[] newRoots = new File[roots.length + 1];
for (int i = 0; i < roots.length; i++) {
newRoots[i] = roots[i];
}
newRoots[roots.length] = root;
roots = newRoots;
}
}
COM: <s> adds new root file directory </s>
|
funcom_train/33551086 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ResourceTO getResourceByCode(String resourceCode) throws SQLException {
logger.fine("getResource(String resourceCode) method is called");
ResourceTO resource = null;
Session session = HibernateUtil.currentSession();
Transaction tx = session.beginTransaction();
Query query = session.createQuery(" from ResourceTO where resourceCode=:rc");
query.setParameter("rc", resourceCode);
List list = query.list();
if (!list.isEmpty()) {
resource = (ResourceTO) list.get(0);
}
tx.commit();
HibernateUtil.closeSession();
return resource;
}
COM: <s> locates and returns a code resource to code from the persistent </s>
|
funcom_train/26365494 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Division read(Division aDiv) {
try {
Entry aReadEntry = aJavaSpace.read(aDiv, null, JavaSpace.NO_WAIT);
return (Division)aReadEntry;
} catch (Exception e) {
// PENDING: Better error handling required
e.printStackTrace();
return null;
}
}
COM: <s> read a division using the supplied template </s>
|
funcom_train/34620098 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private TokenNode convertTokenString(String name, ASTNode node) {
String string = new String(input, node.getStartPosition(), node.getLength());
Token token = new Token(string, convertPosition(node.getStartPosition(), getEndPosition(node)));
TokenNode result = new TokenNode(name, token);
return result;
}
COM: <s> converts an astnode that represents a token to a token node </s>
|
funcom_train/46857254 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void BrowseForExportPath() {
JFileChooser f = new JFileChooser();
f.setDialogTitle("Select export path");
f.setAcceptAllFileFilterUsed(false);
// f.setFileFilter(new FolderFileFilter());
f.setMultiSelectionEnabled(false);
f.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
if (f.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
txtExportPath.setText(f.getSelectedFile().getAbsolutePath());
}
}
COM: <s> displays the folder selection dialog </s>
|
funcom_train/31801840 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String encodeECPAddress() {
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(getAddress());stringBuffer.append(',');
stringBuffer.append(getVersion());stringBuffer.append(',');
stringBuffer.append(getFileSeparator());stringBuffer.append(',');
stringBuffer.append(getMaxPacketSize());stringBuffer.append(',');
stringBuffer.append(getNotUsed());
return stringBuffer.toString();
}
COM: <s> generate a string encoding all the information in this address </s>
|
funcom_train/16446540 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void stateChanged(ChangeEvent e) {
if (e.getSource() instanceof JCheckBoxMenuItem) {
active = ((JCheckBoxMenuItem) e.getSource()).isSelected();
} else if (e.getSource() instanceof JCheckBox) {
active = ((JCheckBox) e.getSource()).isSelected();
}
}
COM: <s> changes the state of active if the jcheck box is selected </s>
|
funcom_train/38413867 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void closeSocket(){
try{
socket.getInputStream().close();
socket.getOutputStream().close();
socket.close();
}
catch(IOException e) {
// socket probably already closed...
// be just to be sure...
try{
socket.close();
}
catch(IOException ioe ) {}
}
}
COM: <s> method to close the socket connection </s>
|
funcom_train/12652179 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getPatientHistoryMarshaled() {
if (patientHistory == null)
return null;
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(256);
XMLEncoder encoder = new XMLEncoder(outputStream);
encoder.writeObject(patientHistory);
encoder.close();
try {
return outputStream.toString(UTF8);
} catch (UnsupportedEncodingException unsupportedEncodingException) {
// Should never happen; use platform's charset
return outputStream.toString();
}
}
COM: <s> marshals the patient history into an utf 8 string </s>
|
funcom_train/17769080 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void move() {
Graphics g = panel.getGraphics();
Polygon p = new Polygon();
asteroid.setDirection(asteroid.getDirection() + Math.PI / 180);
if (!paused) {
moveAsteroid(asteroid);
}
showAsteroid(g, Color.BLACK, asteroid);
}
COM: <s> coordinates the asteroids movement </s>
|
funcom_train/26617417 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setCurrentNodeName(String newName) {
currentSelectedNode.setNodeName(newName);
//the line below visually deselects the tree node
tree.updateUI();
//treeModel.reload(currentSelectedNode.getParent()); //refreshes node to display new name
//Reselect the tree node and update its display name
//TreePath specPath = new TreePath( treeModel.getPathToRoot(currentSelectedNode) );
//tree.setSelectionPath(specPath);
}
COM: <s> sets the current node name </s>
|
funcom_train/37503291 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSetQuestion() {
String q1 = "q1";
Decision d1 = new Decision("d1");
d1.setQuestion(q1);
assertEquals("getQuestion equals", q1, d1.getQuestion());
String q2 = "q2";
d1.setQuestion(q2);
assertEquals("getQuestion equals", q2, d1.getQuestion());
}
COM: <s> test of set question method of class saga </s>
|
funcom_train/11737980 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void currentProcedureChanged(ProcedureDisplayEvent e) {
Application.getInstance().getActionManager().getAction(
RemoveProcedureParameterAction.class).setEnabled(false);
if (e.getProcedure() == null)
setVisible(false);
else {
if (e.isTabReset()) {
this.setSelectedIndex(0);
}
this.setVisible(true);
}
}
COM: <s> invoked when currently selected procedure object is changed </s>
|
funcom_train/28753118 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setCardinality(Long newVal) {
if ((newVal != null && this.cardinality != null && (newVal.compareTo(this.cardinality) == 0)) ||
(newVal == null && this.cardinality == null && cardinality_is_initialized)) {
return;
}
this.cardinality = newVal;
cardinality_is_modified = true;
cardinality_is_initialized = true;
}
COM: <s> setter method for cardinality </s>
|
funcom_train/9890436 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void readExtensions() {
ExtensionHelper.getExtensionObjects(EXTENSION_POINT, new ClassExtensionHandler<Comparator>(Comparator.class) {
@Override
public void handleConfigurationElement(IConfigurationElement extension, Comparator extensionObject) {
try {
Class<?> objectClass = Class.forName(extension.getAttribute("objectClass"));
m_Comparators.put(objectClass, extensionObject);
}
catch(ClassNotFoundException e) {
WorkbenchErrorHandler.logException(e);
}
}
});
}
COM: <s> gets all comparators registered to the extension point </s>
|
funcom_train/22755120 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void paintComponent(Graphics g) {
if (!component.isShowing() || !this.isVisible())
return;
Graphics g2 = g.create();
g2.translate(-originOffset.x, -originOffset.y);
AbstractComponentDecorator.this.paint(g2);
g2.dispose();
}
COM: <s> delegate to the containing decorator to perform the paint </s>
|
funcom_train/3527107 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean mustCheckoutAutoVersionedVCR(String resourceUri) throws SlideException {
NodeRevisionDescriptors vcrRevisionDescriptors = content.retrieve(sToken,resourceUri);
NodeRevisionDescriptor vcrRevisionDescriptor = content.retrieve( sToken, vcrRevisionDescriptors);
return mustCheckoutAutoVersionedVCR(vcrRevisionDescriptors, vcrRevisionDescriptor);
}
COM: <s> indicates if the vcr reource be checked out prior to modifying it </s>
|
funcom_train/21981827 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Vector getVector( String name ) {
Vector v = new Vector();
int i = 0;
while( true ) {
String prop = getProperty( name + "." + i );
//terminate the while loop if we have no more variables.
if ( prop == null) {
break;
}
Logger.debug( "Found vector prop: " + prop + " for name: " + name );
v.addElement( prop );
++i;
}
return v;
}
COM: <s> get a property but assume it is multivalued </s>
|
funcom_train/36242295 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean waitForCardAbsent(long timeout) throws CardException {
long startTime = System.currentTimeMillis();
if (CARD_CHECK_SLEEP_TIME > timeout) {
return !isCardPresent();
}
try {
while (isCardPresent()) {
if (System.currentTimeMillis() - startTime > timeout) {
break;
}
Thread.sleep(CARD_CHECK_SLEEP_TIME);
}
} catch (InterruptedException ie) {
/* NOTE: Exit on interrupt. */
}
return !isCardPresent();
}
COM: <s> waits for a card to be present </s>
|
funcom_train/10255796 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void saveRow(CachedObject row) {
writeLock.lock();
try {
copyShadow(row);
setFileModified();
saveRowNoLock(row);
} catch (Throwable e) {
database.logger.logSevereEvent("saveRow failed", e);
throw Error.error(ErrorCode.DATA_FILE_ERROR, e);
} finally {
writeLock.unlock();
}
}
COM: <s> writes out the specified row </s>
|
funcom_train/49456831 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isPeopleInGroups(Db db) throws Exception {
PreparedStatement pst = db.prepareStatement("SELECT g.e_group_id FROM e_company_group g "+
" LEFT JOIN e_group_to_people gtp ON gtp.e_group_id = g.e_group_id "+
" WHERE gtp.e_people_id = ?");
pst.setInt(1, peopleId);
return (! DbHelper.noRows(pst));
}
COM: <s> returns true if the people is linked to groups </s>
|
funcom_train/11725064 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testMovedReferenceable() throws RepositoryException, NotExecutableException {
String uuid = moveNode.getUUID();
//move the node
doMove(moveNode.getPath(), destinationPath);
assertEquals("After successful moving a referenceable node node, the uuid must not have changed.", uuid, moveNode.getUUID());
}
COM: <s> test if a moved referenceable node still has the same uuid </s>
|
funcom_train/44876106 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testCancelledStatus() throws Exception {
File[] jars = jarFinder.findJarsUnderDir( ROOT_DIR, new JarFinderJobStatus() {
public boolean isCancelled() {
return true;
}
});
assertTrue("jars found " + jars.length, jars.length == 0);
}
COM: <s> test that makes sure a cancelled status short circuits execution </s>
|
funcom_train/9277016 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testTwiceCommited() throws SQLException {
commit();
insertIntoTestTable(1001, 999);
commit();
assertShutdownOK();
Statement st = createStatement();
JDBC.assertSingleValueResultSet(st.executeQuery("select " + "count(*) "
+ "from " + "TEST_TABLE "), "1999");
st.close();
}
COM: <s> tests shutdown with the transaction was committed and next transaction was committed </s>
|
funcom_train/43097991 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeReception(Object handle, Object reception) {
if (handle instanceof MSignal && reception instanceof MReception) {
((MSignal) handle).removeReception((MReception) reception);
return;
}
throw new IllegalArgumentException("handle: " + handle
+ " or reception: " + reception);
}
COM: <s> remove a given reception from a given signal </s>
|
funcom_train/47219978 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void startApp() {
textbox = new TextBox("USBTest", "", 8000, 0);
textbox.addCommand(startCommand);
textbox.addCommand(exitCommand);
textbox.setCommandListener(this);
display.setCurrent(textbox);
openUSBConnection();
}
COM: <s> start up the midlet by creating the text box and associating </s>
|
funcom_train/7899762 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private File assertExists(File dir, String fileName) {
File file = new File(dir, fileName);
assertTrue(fileName + " does not exist." +
" These are the contents of " + dir.getAbsolutePath() + ":\n" +
Arrays.toString(dir.list()),
file.exists());
return file;
}
COM: <s> assert that filename exists in the specified directory </s>
|
funcom_train/17047637 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getSourceType() {
String result = "";
if (inputIsFile) {
result = "file";
}
if (inputIsXml) {
if (inputIsHtml) {
result = "html" + result;
}
else {
result = "xml" + result;
}
}
else {
if (inputIsFile) {
result = "flat" + result;
}
else {
result = "string" + result;
}
}
return result;
}
COM: <s> source types xmlfile htmlfile flatfile xml string </s>
|
funcom_train/10839816 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void add(Entry[] paths) {
if ( paths != null && paths.length > 0 ) {
final Entry[] copy = new Entry[this.entries.length + paths.length];
System.arraycopy(this.entries, 0, copy, 0, this.entries.length);
System.arraycopy(paths, 0, copy, this.entries.length, paths.length);
this.entries = copy;
}
}
COM: <s> add new entries from parsing </s>
|
funcom_train/15396293 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void remove(DipState state) {
assert((loc_.getOccupier() == this) ^ (loc_.getDislodgedUnit() == this));
if (loc_.getOccupier() == this) {
loc_.setOccupier(null);
} else {
loc_.setDislodgedUnit(null);
}
nation_.removeOwnedUnit(this);
state.removeUnit(this);
}
COM: <s> removes all references to the unit from the state </s>
|
funcom_train/3466206 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getFieldIndex(String name, String descriptor) throws InvalidByteCodeException {
for (int i = 0; i < fields.length; i++) {
FieldInfo field = fields[i];
if (field.getName().equals(name) && field.getDescriptor().equals(descriptor)) {
return i;
}
}
return -1;
}
COM: <s> get the index of a field for given field name and signature </s>
|
funcom_train/31249218 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Class getColumnClass(int col) {
//We must create sacrificial dummy classes, because I am not
//cool enough at java to know the right way of doing this, and
//I am too lazy to look it up:
if (col == 0) {
return "".getClass();
} else {
Boolean bool = new Boolean(true);
return bool.getClass();
}
}
COM: <s> returns the type of data contained in the specified column </s>
|
funcom_train/46455567 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void bufferStrategyShow() {
if((strategy)==null) {
createBufferStrategy();
}
if(isIconified()||!isShowing()) {
return;
}
Graphics g = strategy.getDrawGraphics();
paintComponents(g);
g.dispose();
strategy.show();
}
COM: <s> shows repaints the frame useing the current buffer strategy </s>
|
funcom_train/1111266 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void edit(Object[] cells, Map attributes) {
if (attributes != null && cells != null && cells.length > 0) {
Map nested = new Hashtable();
for (int i = 0; i < cells.length; i++)
nested.put(cells[i], attributes);
edit(nested, null, null, null);
}
}
COM: <s> applies the code attributes code to all code cells code by </s>
|
funcom_train/38538670 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isInDomainZ(Number val) {
if (currentNz != null) return currentNz.isInDomain(val);
// check if node is within Z of the modified range
for (int i=0; i<currentGz.getNodeCount(); i++){
if (currentGz.getNode(i).isInDomain(val))
return true;
}
return false;
}
COM: <s> returns true if value is in any z variable domain </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.