__key__ stringlengths 16 21 | __url__ stringclasses 1
value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/46470631 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeLight(int index) {
Light newLights[] = new Light[this.lights.length - 1];
System.arraycopy(this.lights, 0, newLights, 0, index);
if (index != this.lights.length - 1) {
System.arraycopy(this.lights, index + 1, newLights, index, this.lights.length - (index + 1));
}
this.setLights(newLights);
}
COM: <s> removes the light object stored at the specified index from this scene object </s>
|
funcom_train/2289575 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CmsResource readDefaultFile(String resourceNameOrID) throws CmsException, CmsSecurityException {
CmsResource resource;
try {
resource = readResource(new CmsUUID(resourceNameOrID));
} catch (NumberFormatException e) {
resource = readResource(resourceNameOrID);
}
return m_securityManager.readDefaultFile(m_context, resource);
}
COM: <s> returns the default resource for the given folder </s>
|
funcom_train/17007788 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void registerProducer(int producerId, EventProducer producer) {
Integer key = new Integer(producerId);
if (producers.containsKey(key)) {
System.out.println(moduleName + "ProducerId [" + producerId
+ "] exists. This should not be the case! ");
return;
}
producers.put(key, producer);
numOfProducers++;
}
COM: <s> this method is used to register producers with the qo s manager </s>
|
funcom_train/2807654 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Assembly best(List v) {
Assembly best = null;
Enumeration e = Collections.enumeration(v);
while (e.hasMoreElements()) {
Assembly a = (Assembly) e.nextElement();
if (!a.hasMoreElements()) {
return a;
}
if (best == null) {
best = a;
} else {
if (a.elementsConsumed() > best.elementsConsumed()) {
best = a;
}
}
}
return best;
}
COM: <s> returns the most matched assembly in a collection </s>
|
funcom_train/7347977 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void putFileList (String fileName ) throws IllegalArgumentException{
//check that the file name is not null
if(fileName!=null){
// remoteProtocol.putFile(fileName);
Vector v = new Vector();
v.addElement(fileName);
rProtocol.start(new CommandEvent(this).UPLOAD_LIST, v);
// sendRemoteList(remoteProtocol.fileList(),remoteProtocol.getRemoteCurrentDir());
}
else{
throw new IllegalArgumentException("No name specified in put file");
}
return;
}
COM: <s> upload the specified file to the ftp server </s>
|
funcom_train/17201241 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void update(int whereFrom) {
if (VM.VerifyAssertions) VM._assert(AosEntrypoints.yieldCountListenerNumYieldsField!=null);
int yp = Synchronization.fetchAndAdd(this, AosEntrypoints.yieldCountListenerNumYieldsField.getOffset(), 1) + 1;
if (yp == yieldThreshold) {
totalYields += yp;
activateOrganizer();
}
}
COM: <s> this method is called when its time to record that a </s>
|
funcom_train/4574413 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int read(byte[] b, int off, int len) throws IOException {
if (closed) {
throw new FileItemStream.ItemSkippedException();
}
if (len == 0) {
return 0;
}
int res = available();
if (res == 0) {
res = makeAvailable();
if (res == 0) {
return -1;
}
}
res = Math.min(res, len);
System.arraycopy(buffer, head, b, off, res);
head += res;
total += res;
return res;
}
COM: <s> reads bytes into the given buffer </s>
|
funcom_train/7426782 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void cameraToLocal(final PCamera camera, final Point2D pt, final PNode node) {
if (node != null) {
if (descendsFromLayer(node)) {
final AffineTransform inverse = invertTransform(camera.getViewTransform());
inverse.transform(pt, pt);
}
node.globalToLocal(pt);
}
}
COM: <s> transforms the given point from camera coordinates to the nodes local </s>
|
funcom_train/22279161 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Range paragraphForIndex(int anIndex) {
Vector v;
Range pr = allocateRange(anIndex,0);
v = paragraphsForRange(pr);
recycleRange(pr);
if( v.count() > 0 )
return (Range)v.elementAt(0);
else
return allocateRange();
}
COM: <s> returns the paragraph range to which the character at b an index b </s>
|
funcom_train/16750059 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removePath(TreePath path) {
if (!pathValid(path)){
return;
}
Entry entry = (Entry) path.getLastPathComponent();
TreePath parentPath = path.getParentPath();
Node parent = (Node) parentPath.getLastPathComponent();
int removedIndex = parent.remove(entry);
int[] childIndices = new int[]{removedIndex};
for (TreeModelListener tml : listeners) {
TreeModelEvent e = new TreeModelEvent(this, parentPath, childIndices, null);
tml.treeNodesRemoved(e);
}
}
COM: <s> remove the denoted element from the model </s>
|
funcom_train/24592798 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void calculateWorldBaseWind(World theWorld) {
// calculate base wind on each tile
for(int i = 0; i < theWorld.getWidth(); i++) {
for(int j = 0; j < theWorld.getHeight(); j++) {
Coordinates here = new Coordinates(i, j);
calculateBaseWind(theWorld, here);
}
}
}
COM: <s> calculate the wind on each tile without concerning wind flow </s>
|
funcom_train/49817898 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initTimer() {
// Record Start Timestamp
startTime = new Date();
// Create Auto-Timer
timer = new Timer(TIME_INTERVAL,
new ActionListener() {
/**
* Update the Time Elapsed Field.
*
* @param e ActionEvent.
*/
public void actionPerformed(ActionEvent e) {
Date currentTime = new Date();
long timeElapsed = currentTime.getTime() - startTime.getTime();
timeElapsedValue.setText(StringUtils.getTimeString(timeElapsed));
}
});
timer.start();
}
COM: <s> initialize the timer object </s>
|
funcom_train/44602380 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void test_post_01() {
compileAndExecGivenStatementExpectRuntimeError(
"X.java",
"public class X {\n" +
" //@ ensures false;\n" +
" void m() {}\n" +
"}\n",
"new X().m()",
null,
JMLInternalNormalPostconditionError.class);
}
COM: <s> is normal postcondition checked </s>
|
funcom_train/21607035 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int registerBeanDefinitions(Document doc, Resource resource) throws BeanDefinitionStoreException {
// Read document based on new BeanDefinitionDocumentReader SPI.
BeanDefinitionDocumentReader documentReader = createBeanDefinitionDocumentReader();
int countBefore = getRegistry().getBeanDefinitionCount();
documentReader.registerBeanDefinitions(doc, createReaderContext(resource));
return getRegistry().getBeanDefinitionCount() - countBefore;
}
COM: <s> register the bean definitions contained in the given dom document </s>
|
funcom_train/37598616 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void showPopup() {
if (popup == null){
PopupFactory fac = new PopupFactory();
Point xy = getLocationOnScreen();
datePanel.setVisible(true);
popup = fac.getPopup(this, datePanel, (int) xy.getX(), (int) (xy.getY()+this.getHeight()));
popup.show();
}
}
COM: <s> called internally to popup the dates </s>
|
funcom_train/3382188 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int compare(Object obj1, Object obj2) {
String charset1 = null;
String charset2 = null;
if (order == SELECT_BEST) {
charset1 = (String)obj1;
charset2 = (String)obj2;
} else {
charset1 = (String)obj2;
charset2 = (String)obj1;
}
return compareCharsets(charset1, charset2);
}
COM: <s> compares two string objects </s>
|
funcom_train/43468260 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void appendFieldName(Field f, Object o, StringBuffer buf) {
if (f.getDeclaringClass() != o.getClass()) {
buf.append(StringUtil.stripPackageName(f.getDeclaringClass()));
buf.append('.');
}
buf.append(f.getName());
}
COM: <s> append field name to buffer </s>
|
funcom_train/39393267 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Figure findConnectableFigure(int x, int y, ConnectionFigure connection) {
// copied code from JHotDraw's ConnectionTool#findConnectableFigure(..)
FigureEnumeration k = drawing().figuresReverse();
while (k.hasNextFigure()) {
Figure figure = k.nextFigure();
if (!figure.includes(connection) && figure.canConnect() && figure.containsPoint(x, y)) {
return figure;
}
}
return null;
}
COM: <s> find a possible node figure as target for given connection at given </s>
|
funcom_train/51338145 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void GT(final byte[] a, final byte[] b) {
final int cmp = BytesUtil.compareBytes(a, b);
if (cmp > 0)
return;
fail("cmp=" + cmp + ", a=" + BytesUtil.toString(a) + ", b="
+ BytesUtil.toString(b));
}
COM: <s> succeeds iff a gt b </s>
|
funcom_train/1733773 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void retrieveKeywordMap(ConcurrentHashMap<String, Integer> record) throws DatabaseException{
String sql ="select * from keyword";
try{
PreparedStatement ps=aConn.prepareStatement(sql);
ResultSet rs=ps.executeQuery();
while(rs.next()){
record.put(rs.getString("keyword"), new Integer(rs.getInt("id")));
}
}catch(SQLException e){
throw new DatabaseException(e.toString());
}
return;
}
COM: <s> function to retrieve all of the keyword in the database into memory </s>
|
funcom_train/44011458 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSetTxLineID() {
System.out.println("setTxLineID");
String txLineID = "";
TransLineBO instance = new TransLineBO();
instance.setTxLineID(txLineID);
// 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 tx line id method of class edu </s>
|
funcom_train/20617694 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getEmailAddress(String macAddress) {
Connection con = db.iDisplayClientConnenction();
Statement stmt = null;
String eMailAddress = new String();
try {
stmt = con.createStatement();
String postgresqlQuery = "SELECT emailaddress FROM idisplayclientuser WHERE macaddress = '"
+ macAddress + "'";
ResultSet rSet = stmt.executeQuery(postgresqlQuery);
while (rSet.next()) {
eMailAddress = rSet.getString("emailaddress");
}
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
return (eMailAddress);
}
COM: <s> returns the e mail address of the user identified by the mac address </s>
|
funcom_train/16580700 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getPRectangular() {
if (pRectangular == null) {
pRectangular = new JPanel();
pRectangular.setLayout(new BorderLayout());
pRectangular.setPreferredSize(new Dimension(300,200));
pRectangular.add(getPNorth(), java.awt.BorderLayout.NORTH);
pRectangular.add(getPCenter(), java.awt.BorderLayout.CENTER);
}
return pRectangular;
}
COM: <s> this method initializes p rectangular </s>
|
funcom_train/3492714 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void handle(Throwable t) {
// if an ExecutionSecurityManager is not in use
if (security == null)
t.printStackTrace();
// check if executing program is attempting to exit VM
// and inform security manager
else if (
(t instanceof SecurityException)
&& (t.getMessage().equals("InsECT: Attempt to exit VM")))
security.setHasExited(true);
else
t.printStackTrace();
}
COM: <s> method to handle exceptions in awt swing programs </s>
|
funcom_train/1837693 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addWorksAtPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Personnel_worksAt_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Personnel_worksAt_feature", "_UI_Personnel_type"),
UniversityPackage.Literals.PERSONNEL__WORKS_AT,
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the works at feature </s>
|
funcom_train/38861749 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenuItem getPreferenceMenuItem() {
if (preferenceMenuItem == null) {
preferenceMenuItem = new JMenuItem();
preferenceMenuItem.setText("preference");
preferenceMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
PreferenceWindow pref;
pref = new PreferenceWindow();
pref.setVisible(true);
}
});
}
return preferenceMenuItem;
}
COM: <s> this method initializes preference menu item </s>
|
funcom_train/25063065 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void realize() {
_logger.debug("QuerySequenceChooserSystemTab.realize()");
if (isLoaded())
_table.clearHover(); // data's already retrieved, but we need to clear any residual hover artifacts
else
new LoadQuerySequencesTimer().schedule(1); // start the data retrieval
_table.clearSelect();
}
COM: <s> external notification that the data should be loaded </s>
|
funcom_train/47885924 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JTree getCollectionTree() {
Iterator<String> i = sortedCollection.iterator();
DefaultMutableTreeNode kdxc = new DefaultMutableTreeNode(
"The Kindle Collection");
if (i.hasNext()) {
Collection c = collections.get(i.next());
kdxc.add(c.getCollectionNode());
while (i.hasNext()) {
c = collections.get(i.next());
kdxc.add(c.getCollectionNode());
}
}
JTree tree = new JTree(kdxc);
tree.getSelectionModel().setSelectionMode(
TreeSelectionModel.SINGLE_TREE_SELECTION);
return tree;
}
COM: <s> get collection tree collections and their files </s>
|
funcom_train/7277310 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addDisallowedExactEntries(String field, List<String> values) {
List<String> list = disallowedExactFieldValues.get(field);
if (list == null) {
list = new ArrayList<String>(values);
disallowedExactFieldValues.put(field, list);
}
else {
list.addAll(values);
}
}
COM: <s> add disallowed field values </s>
|
funcom_train/43827768 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addVersionPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ToolInfo_version_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ToolInfo_version_feature", "_UI_ToolInfo_type"),
ModelPackage.Literals.TOOL_INFO__VERSION,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the version feature </s>
|
funcom_train/18352849 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addRowPair(RowPair rp) {
assert !rowPairList.contains(rp) : "New row pair is a duplicate";
// TO DO Consider a) not adding no effect row pairs
// and eliminating redundant changes e.g. if we have
// A->B and want to add B->C then we should just
// have A->C
rowPairList.add(rp);
// Maintain post number order
Collections.sort(rowPairList);
}
COM: <s> adding a code row pair code </s>
|
funcom_train/21606298 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public BeanDefinitionBuilder addDependsOn(String beanName) {
if (this.beanDefinition.getDependsOn() == null) {
this.beanDefinition.setDependsOn(new String[] {beanName});
}
else {
String[] added = (String[]) ObjectUtils.addObjectToArray(this.beanDefinition.getDependsOn(), beanName);
this.beanDefinition.setDependsOn(added);
}
return this;
}
COM: <s> append the specified bean name to the list of beans that this definition </s>
|
funcom_train/20274025 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected CompilerOptions getOptions() {
CompilerOptions options = new CompilerOptions();
if (this.acceptES5) {
options.setLanguageIn(LanguageMode.ECMASCRIPT5);
}
// This doesn't affect whether checkSymbols is run--it just affects
// whether variable warnings are filtered.
options.checkSymbols = true;
options.setWarningLevel(
DiagnosticGroups.MISSING_PROPERTIES, CheckLevel.WARNING);
options.setCodingConvention(getCodingConvention());
return options;
}
COM: <s> gets the compiler options to use for this test </s>
|
funcom_train/22113104 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testUpdates() throws Exception {
AvailabilityCache cache = getClearedCache();
DataPoint dp = new DataPoint(0, 0, 0);
int i = 0;
for (; i < 10; i++) {
for (int j = 0; j < 10; j++) {
cache.put(new Integer(i), dp);
}
}
assertEquals(i, cache.getSize());
}
COM: <s> test updates to the cache </s>
|
funcom_train/39124452 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setValue(float value) {
if (value < minimum) value = minimum; else if (value > maximum) value = maximum;
if (value != this.value) {
this.value = value;
slider.setValue(Math.round(value));
spinner.setValue(value);
changeListeners.notifyListeners(new ChangeEvent(this));
}
}
COM: <s> setter for property value </s>
|
funcom_train/7237911 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Lookahead look(int k, RuleEndElement end) {
if ( DEBUG_ANALYZER )
System.out.println("lookRuleBlockEnd("+k+"); noFOLLOW="+
end.noFOLLOW+"; lock is "+end.lock[k]);
if ( /*lexicalAnalysis ||*/ end.noFOLLOW ) {
Lookahead p = new Lookahead();
p.setEpsilon();
p.epsilonDepth = BitSet.of(k);
return p;
}
Lookahead p = FOLLOW(k,end);
return p;
}
COM: <s> if not locked or no follow set compute follow of a rule </s>
|
funcom_train/21944367 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void writePasswordFile () throws IOException {
if ( ! userValidated )
throw new IllegalStateException ( "User has not been validated" );
BasicTextEncryptor textEncryptor = new BasicTextEncryptor ();
textEncryptor.setPassword ( password );
String encryptedPassword = textEncryptor.encrypt ( key );
FileWriter fw = new FileWriter ( systemPasswordFile );
BufferedWriter bw = new BufferedWriter ( fw );
bw.write ( encryptedPassword + "\n" );
bw.close ();
fw.close ();
}
COM: <s> write an encrypted version of the system generated password this </s>
|
funcom_train/46979970 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void moveElement(MModelElement element, MModel to) {
MModel currentModel = element.getModel();
if (currentModel != to) {
if (element.getNamespace() != currentModel) { // handle packages
moveElement(element.getNamespace(), to);
} else {
element.setNamespace(to);
}
}
}
COM: <s> move a modelelement to a new namespace </s>
|
funcom_train/15396361 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void unique(HttpServletResponse response) {
//Gets the SAH
SessionAdministrationHandle sah = SingletonConnectionManager.getInstance().getSessionAdministrationHandle();
int roomid = 0;
// Uses SAH to to allocate a unique id for the room to aviod collisions
// with module id's in Marratech.
try {
roomid = sah.allocateRoomId();
} catch (RemoteException e) {
e.printStackTrace();
}
//Adds the the data to the response
response.addHeader("roomid",""+roomid);
}
COM: <s> method unique allocates a unique session key for the room and passes it </s>
|
funcom_train/18088740 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void commandAction(final Command c, final Displayable d) {
if (c == ok) {
// Update the contents of owning date box.
final Date date = dateField.getDate();
component.setDate(date);
}
// Return to the parent screen.
parent.show();
parent.repaint();
}
COM: <s> called when the user hits the ok or cancel button </s>
|
funcom_train/31931199 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String prefix(int number, int length, String suffix) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < length; i++) {
sb.append(" ");
}
sb.append(number);
String heading = sb.toString();
if (sb.length() > length) {
heading = heading.substring(heading.length() - length);
}
return heading + suffix;
}
COM: <s> compute and return a textual prefix based on the given code number code </s>
|
funcom_train/5079649 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void relocate(IFigure target) {
PointList points = getConnection().getPoints();
RotatableDecoration arrow = (RotatableDecoration)target;
arrow.setLocation(getLocation(points));
if (getAlignment() == SOURCE)
arrow.setReferencePoint(points.getPoint(1));
else if (getAlignment() == TARGET)
arrow.setReferencePoint(points.getPoint(points.size() - 2));
}
COM: <s> relocates the passed in figure which must be a </s>
|
funcom_train/17938072 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object getValueAt(int rowIndex, int columnIndex) {
NumberFormat nf = NumberFormat.getInstance();
nf.setMinimumFractionDigits(3);
nf.setMaximumFractionDigits(3);
switch (columnIndex) {
case 0:
return this.input.getKey(rowIndex);
default:
if (columnIndex == this.getColumnCount() - 1)
return this.clustering.get(rowIndex);
else
return this.input.getPoint(rowIndex, columnIndex - 1);
}
}
COM: <s> returns the values of each cell </s>
|
funcom_train/38287194 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deactivateCaret() {
if (propertyListener != null) {
// try {
((FigureCanvas) canvas).getViewport()
.removePropertyChangeListener(
propertyListener);
// } catch (NullPointerException npe) {
// }
}
hideCaret();
caretOffset = -1;
keeperUnderCaret = null;
}
COM: <s> deactivates and hides caret </s>
|
funcom_train/31702207 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void mouseMoved(MouseEvent evt) {
// Alt modifier means interaction modus change.
if (isAltDownInOS(evt)) {
return;
}
// Everything else is done by plugin.
else {
ISwingControllerPlugin plugin = getInteractionPlugin(currentInteractionModus);
plugin.interactionMove(evt.getX(), evt.getY(), isShiftDownInOS(evt), isControlDownInOS(evt));
}
}
COM: <s> custom reaction to mouse move </s>
|
funcom_train/2577164 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void setupNumberFmtObj() {
if (this.numberFormatterObj instanceof DecimalFormat) {
//setup for "1e#"-style tick labels or regular
// numeric tick labels, depending on flag:
((DecimalFormat) this.numberFormatterObj).applyPattern(
this.expTickLabelsFlag ? "0E0" : "0.###");
}
}
COM: <s> sets up the number formatter object according to the </s>
|
funcom_train/17611493 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addNamespace(String prefix, String namespaceURI) {
this.prefixToNsUriMap.put(prefix, namespaceURI);
if (this.nsUriToPrefixesMap.get(namespaceURI) == null) {
this.nsUriToPrefixesMap.put(namespaceURI, new HashSet<String>());
}
this.nsUriToPrefixesMap.get(namespaceURI).add(prefix);
}
COM: <s> add a custom mapping from prefix to a namespace </s>
|
funcom_train/50017161 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String generateRequestBody() {
Document doc = null;
try {
doc = reportRequest.createNewDocument(XMLUtils
.getDOMImplementation());
} catch (DOMValidationException domve) {
log.error("Error trying to create DOM from CalDAVPropfindRequest: ", domve);
throw new RuntimeException(domve);
}
return XMLUtils.toPrettyXML(doc);
}
COM: <s> generates a request body from the calendar query </s>
|
funcom_train/27747513 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void remove (int index) {
checkWidget();
if (!(0 <= index && index <= itemCount)) error (SWT.ERROR_ITEM_NOT_REMOVED);
OS.gtk_clist_remove (handle, index);
TableItem item = items [index];
System.arraycopy (items, index + 1, items, index, --itemCount - index);
items [itemCount] = null;
item.releaseWidget ();
}
COM: <s> removes the item from the receiver at the given </s>
|
funcom_train/25099442 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addCustomTypePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_FeatureLink_customType_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_FeatureLink_customType_feature", "_UI_FeatureLink_type"),
FeaturemodelingPackage.Literals.FEATURE_LINK__CUSTOM_TYPE,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the custom type feature </s>
|
funcom_train/31986558 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected JComponent createContents(StandardDrawingView view) {
createLeftComponent(view);
createRightComponent(view);
if ((getLeftComponent() == null) && (getRightComponent() == null)) {
return super.createContents(view);
}
else if (getLeftComponent() == null) {
return getRightComponent();
}
else if (getRightComponent() == null) {
return getLeftComponent();
}
else {
return createSplitPane(view);
}
}
COM: <s> opens the window and initializes its contents </s>
|
funcom_train/48630761 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetRoutes() {
System.out.println("getRoutes");
Itineraire instance = new Itineraire();
HashMap<Integer, Route> expResult = null;
HashMap<Integer, Route> result = instance.getRoutes();
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 routes method of class itineraire </s>
|
funcom_train/14027961 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
StringWriter sw = new StringWriter();
print(sw, new ILambda<String,Node<E>>() {
public String apply(Node<E> node) {
return node.getValue().toString();
}
}, _root, " ");
return sw.toString();
}
COM: <s> return a string representation of this tree </s>
|
funcom_train/22279718 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void grow(int capacity) {
int tableSize, power;
// Find the lowest power of 2 size for the table which will allow
// us to insert initialCapacity number of objects before having to
// grow.
tableSize = (capacity * 4) / 3;
power = 3;
while ((1 << power) < tableSize)
power++;
// Once shift is set, then grow() will do the right thing when
// called.
shift = 32 - power + 1;
grow();
}
COM: <s> grows the table to accommodate at least capacity number of elements </s>
|
funcom_train/21437253 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: static public boolean isUp(Rectangle f, Rectangle t) {
int d_x = midx(f)-midx(t);
int d_y = midy(f)-midy(t);
return(d_y<0 && Math.abs(d_y)>Math.abs(d_x));
}
COM: <s> return code true code if the first rectangle is above the </s>
|
funcom_train/31043130 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(Element.class)) {
case ModelPackage.ELEMENT__ELEMENT_NAME:
case ModelPackage.ELEMENT__EMPTY:
case ModelPackage.ELEMENT__CONTENT:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case ModelPackage.ELEMENT__ELEMENTS:
case ModelPackage.ELEMENT__ATTRIBUTES:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return;
}
super.notifyChanged(notification);
}
COM: <s> this handles model notifications by calling </s>
|
funcom_train/26415337 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public FourByteConstant readFourByteConstant(byte[] buf4) throws IOException {
if (4 != read(buf4, 0, 4))
throw new IOException("Did not read four bytes.");
return new FourByteConstant(buf4[0], buf4[1], buf4[2], buf4[3]);
}
COM: <s> utility to read four bytes using preallocated buffer </s>
|
funcom_train/22077822 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void test05Delete() throws MapperException {
ctxmock.expects(once()).method("modifyAttributes").with(same(cn),
modopCheck05());
/* input */
Personne input = new Personne();
input.setName("Naquin");
input.setSurname("Thierry");
/* operations */
this.mods = new ModificationsVariables(output);
mods.deleteAttribute("nom complet", new VariableString(
"${self.name} ${self.surname}"));
sm.setOperations(mods);
sm.modify(input, env);
}
COM: <s> test delete operation </s>
|
funcom_train/8096749 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String useAssociator(Instances data) throws Exception {
Associator associator = null;
try {
associator = AbstractAssociator.makeCopy(m_Associator);
}
catch (Exception e) {
e.printStackTrace();
fail("Problem setting up to use Associator: " + e);
}
associator.buildAssociations(data);
return associator.toString();
}
COM: <s> builds a model using the current associator using the given data and </s>
|
funcom_train/44622856 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JmlBinary makeJmlBinary(int pos, JmlToken op, JCExpression lhs, JCExpression rhs) {
JmlBinary e = factory.at(pos).JmlBinary(op,lhs,rhs);
e.type = syms.booleanType;
copyEndPosition(e,rhs);
return e;
}
COM: <s> makes a jml binary operator node with boolean result </s>
|
funcom_train/15607505 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void fireSequenceSelection(SequenceSelectionEvent e){
if (sequenceSelectionListeners != null) {
Vector listeners = sequenceSelectionListeners;
int count = listeners.size();
for (int i = 0; i < count; i++) {
((SequenceSelectionListener) listeners.elementAt(i)).selectionChanged(e);
}
}
}
COM: <s> notifies all code sequence selection listener code s that a sequence </s>
|
funcom_train/17745719 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CalcVector add(CalcVector input) {
if (input.size() != size()) {
throw new CalcDimensionException("Different dimensions in vector addition");
}
CalcObject[] inputElements = input.getAll();
for (int ii = 0; ii < elements.length; ii++) {
elements[ii] = CALC.ADD.createFunction(elements[ii], inputElements[ii]);
}
return this;
}
COM: <s> returns the sum of this vector and another vector </s>
|
funcom_train/823261 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isModifiedInput() throws Exception {
boolean isModified = false;
File[] files = getGeneratedFileList();
if (files == null) {
isModified = true;
} else {
long lastModified = input.lastModified();
for (int i = 0; i < files.length; i++) {
File f = files[i];
if (!f.exists() || f.lastModified() < lastModified) {
isModified = true;
break;
}
}
}
return isModified;
}
COM: <s> detects whether the input file has changed since the output was </s>
|
funcom_train/22213411 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addEvent(AbstractTimerEvent ate) {
synchronized(ate) {
TimerQueue tq = ate.getTimerQueue() ;
// is it somebody elses?
if ((tq!=null) && (tq != this)) {
// This will do the right thing...
ate.activateEvent() ;
} else {
// start processing of the event
timerQueueThread.addEvent(ate) ;
}
}
}
COM: <s> add an event to the queue </s>
|
funcom_train/12710101 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initializeMappingModelFor(Dialect aDialect) {
ConversionInfos theInfos = bindingInfo.getDefaultModel();
theInfos.setTargetDialect(aDialect);
theInfos.getTypeMapping().clear();
// Try to map the types
for (DataType theCurrentType : model.getUsedDataTypes()) {
theInfos.getTypeMapping().put(theCurrentType, aDialect.findClosestMatchingTypeFor(theCurrentType));
}
}
COM: <s> initialize the current mapping model for a target dialect </s>
|
funcom_train/26602349 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int returningType(DBStack stack) {
int max = stack.size();
if (stack.indexOf("|") != -1) {
if (max <= 2)
return STRINGPRODUCTIONRULE; // for "||"
return ORPRODUCTIONRULE; // for orproductionRule
}
if (max >= 1)
return checkingForUnion(stack);
return STRINGPRODUCTIONRULE;
}
COM: <s> returning type of object </s>
|
funcom_train/4283542 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setDisabledIcons( String icons ) {
StringTokenizer st = new StringTokenizer( icons, "," );
int n = st.countTokens();
for (int i = 0; i < n; i++) {
Attribute attr = new Attribute( "icon", st.nextToken() );
super.setDisabledIconAt( i, (ImageIcon) ImageIconConverter.conv( null, attr, null ) );
}
}
COM: <s> sets the disabled icon at code index code to code icon code </s>
|
funcom_train/6334304 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
StringBuffer buf = new StringBuffer("port: " + port + "\n" +
"hostName: " + hostName + "\n" +
"defaultZone: " + defaultZone +"\n" +
"bindAddress: " + bindAddress +"\n" +
"charsetName: " + charsetName);
for( ZoneConfiguration zone : zones ) {
buf.append( zone ).append( "\n" );
}
return buf.toString();
}
COM: <s> retuns a code string code representation of this </s>
|
funcom_train/32829806 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void loadCustomConfiguration(Properties properties) {
String customConfigurationFileName = getConfigurationFileName(PROPKEY_CUSTOM_CONFIGURATION, properties);
Properties customProperties = propertiesReader.loadPropertiesFileFromClasspath(customConfigurationFileName);
if (customProperties == null) {
logger.warn("No custom configuration file " + customConfigurationFileName + " found.");
} else {
properties.putAll(customProperties);
}
}
COM: <s> load the custom project level configuration file unitils </s>
|
funcom_train/45249976 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private TrimDescriptor findTrimDescription(Control trim) {
Iterator d = fTrimDescriptors.values().iterator();
while (d.hasNext()) {
TrimDescriptor desc = (TrimDescriptor) d.next();
if (desc.getTrim().getControl() == trim) {
return desc;
}
if (desc.getDockingCache() != null
&& desc.getDockingCache().getControl() == trim) {
return desc;
}
}
return null;
}
COM: <s> find the trim descriptor for this control </s>
|
funcom_train/23855084 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addComponent() {
TextAreaSaveDelete current = (TextAreaSaveDelete) addNewComboBox.getSelectedItem();
comments.add(current);
addNewComboBox.removeItem(current);
// disable addButton if there is no comment to add
if (addNewComboBox.getItemCount() == 0) {
addButton.setEnabled(false);
}
invalidate();
current.saveComment();
}
COM: <s> adds the selected </s>
|
funcom_train/33159019 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void stopMonitor(boolean waitForDone) {
synchronized (syncObj_) {
finished_ = true;
syncObj_.notifyAll();
if (waitForDone) {
while (!done_) {
try {
syncObj_.wait();
}
catch (InterruptedException e) {
// ignore this
}
}
}
}
}
COM: <s> tells the monitor to stop </s>
|
funcom_train/10210398 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void displayResult() {
// close the progress dialog
// progressDialog.setVisible(false);
// progressDialog.dispose();
// display the result
if (aborted) {
messageText = "Export canceled upon user request.";
}
if (exportSuccessful || aborted) {
userFeedbackDialogType = JOptionPane.INFORMATION_MESSAGE;
} else {
userFeedbackDialogType = JOptionPane.ERROR_MESSAGE;
}
JOptionPane.showMessageDialog(this, messageText, windowTitle, userFeedbackDialogType);
}
COM: <s> displays the export result success error </s>
|
funcom_train/39273694 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void cleanup() {
if (LOG.isDebugEnabled()) {
LOG.debug("cleanup: Cleaning up container for '" + mUsername + "'");
}
mCRUDService = null;
mQueryService = null;
mRunnerInfo = null;
EventManager.unregisterEventListener(EventManager.TYPE_OBJECT_SAVED,
this);
}
COM: <s> cleanup any resources used by this container </s>
|
funcom_train/19845404 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void clampTexture() {
if (GLContext.getCapabilities().GL_EXT_texture_mirror_clamp) {
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S,
EXTTextureMirrorClamp.GL_MIRROR_CLAMP_TO_EDGE_EXT);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T,
EXTTextureMirrorClamp.GL_MIRROR_CLAMP_TO_EDGE_EXT);
} else {
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S,
GL11.GL_CLAMP);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T,
GL11.GL_CLAMP);
}
}
COM: <s> clamp the loaded texture to its edges </s>
|
funcom_train/23855668 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Subset findSubset(Subset root, final int subsetId) {
Iterable<Subset> subsetIterable = Subsets.getSubsetTreeIterable(root);
return Iterables.find(subsetIterable, new Predicate<Subset>() {
@Override
public boolean apply(Subset input) {
return input.getId() == subsetId;
}
});
}
COM: <s> finds the subset corresponding to the given database id </s>
|
funcom_train/39559652 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSaveBookmarksToFile() {
BookmarksManager manager = new BookmarksManager();
final Category category = ModelsFactory.eINSTANCE.createCategory();
category.setDescription("SubCategory");
category.setName("Sub Cat-Name");
Category category2 = ModelsFactory.eINSTANCE.createCategory();
category2.setDescription("Category-Description222");
category2.setName("Cat-Name222");
category.getChildren().add(category2);
final Bookmark bookmark = ModelsFactory.eINSTANCE.createBookmark();
bookmark.setDescription("Bookmark-Description");
bookmark.setKeyword("Bookmark-Keyword");
category.getBookmarks().add(bookmark);
manager.addToRoot(category);
assertTrue(manager.saveBookmarksToFile(new File(
"test_out/bookmarks.xml")));
}
COM: <s> tests saving a bookmark to an existing file </s>
|
funcom_train/5422159 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int compareTo(ProfileMonitor other) {
if (this.getTotal() > other.getTotal()) {
return -1;
} else if (this.getTotal() == other.getTotal()) {
return other.getHits() - this.getHits();
} else {
return 1;
}
}
COM: <s> the profile monitor with the higher number of totals is conisidered as </s>
|
funcom_train/8981532 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenuItem getJMenuItemArmDocXML() {
if (jMenuItemArmDocXML == null) {
jMenuItemArmDocXML = new JMenuItem();
jMenuItemArmDocXML.setText("Armazenar Doc. XML");
jMenuItemArmDocXML.setIcon(new ImageIcon(getClass().getResource(
"/imgs/add-database_32x32.png")));
}
return jMenuItemArmDocXML;
}
COM: <s> this method initializes j menu item arm doc xml </s>
|
funcom_train/12640304 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int readInt() throws IOException {
int ch1 = read();
int ch2 = read();
int ch3 = read();
int ch4 = read();
if ((ch1 | ch2 | ch3 | ch4) < 0)
throw new EOFException();
return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + (ch4 << 0));
}
COM: <s> see the general contract of the code read int code </s>
|
funcom_train/2628330 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetCurrentWinID() {
System.out.println("getCurrentWinID");
GApplicationImpl instance = new GApplicationImpl();
instance.testNum = 3;
Set<String> result = instance.getCurrentWinID();
Set<String> expResult = (Set<String>) instance.expResult;
assertEquals(expResult, result);
}
COM: <s> test of get current win id method of class gapplication </s>
|
funcom_train/51615470 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected CubeDescriptor getDescriptor(DataRepresentation report_and_data, URLParser.Result url) throws ReadError, ObjectInstantiationError, CubeException {
// Note: need to do some re-engineering at some stage - it should be possible to get the descriptor
// before getting the cube...
return getCube(report_and_data, url).getDescriptor();
}
COM: <s> gets a descriptor for the cube specified by the bindings </s>
|
funcom_train/43889194 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private List getExpressions(List attributeMappings) {
List expressions = new ArrayList(attributeMappings.size());
AttributeMapping mapping;
Expression sourceExpression;
for (Iterator it = attributeMappings.iterator(); it.hasNext();) {
mapping = (AttributeMapping) it.next();
sourceExpression = mapping.getSourceExpression();
expressions.add(sourceExpression);
}
return expressions;
}
COM: <s> extracts the source expressions from a list of </s>
|
funcom_train/37476788 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void leaveNode(Node node, String userName) throws StorageException {
Logger.DEBUG("Leaving node: " + node.getName());
HistoryManager.create("NODE_LEAVE", node.getId(), getId(), userName, null);
node.deactivate();
}
COM: <s> leave a node </s>
|
funcom_train/9431589 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long findRawContactId() {
for (EntityDelta delta : this) {
final Long rawContactId = delta.getValues().getAsLong(RawContacts._ID);
if (rawContactId != null && rawContactId >= 0) {
return rawContactId;
}
}
return -1;
}
COM: <s> search all contained </s>
|
funcom_train/5344202 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void loadSettings() {
final int currentRevision = ++_revision;
if(LOG.isDebugEnabled())
LOG.debug("Starting new library revision: " + currentRevision);
LOADER.add(new Runnable() {
public void run() {
loadStarted(currentRevision);
loadSettingsInternal(currentRevision);
}
});
}
COM: <s> starts a new revision of the library ensuring that only items present </s>
|
funcom_train/37837189 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void reportClientInfo(long refreshTime, long lastFpsTime, int fps) {
if ((refreshTime - lastFpsTime) >= 1000L) {
logger.debug("FPS: " + fps);
final long freeMemory = Runtime.getRuntime().freeMemory() / 1024;
final long totalMemory = Runtime.getRuntime().totalMemory() / 1024;
logger.debug("Total/Used memory: " + totalMemory + "/"
+ (totalMemory - freeMemory));
}
}
COM: <s> write debugging data about the client memory usage and running speed </s>
|
funcom_train/22355989 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean match(String name, Collection<Pattern> patterns) {
if (name != null) {
if (!chkCase.isSelected()) {
name = name.toLowerCase();
}
for (Pattern p : patterns) {
if (p.matcher(name).matches())
return true;
}
}
return false;
}
COM: <s> returns true if one of the patterns matches name obeying the </s>
|
funcom_train/7718759 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String generateCommaSeperatedRow(Iterator<String> itr) {
String row = BasicConsts.EMPTY_STRING;
while (itr.hasNext()) {
row += BasicConsts.QUOTE + itr.next() + BasicConsts.QUOTE;
if (itr.hasNext()) {
row += BasicConsts.CSV_DELIMITER;
} else {
row += BasicConsts.NEW_LINE;
}
}
return row;
}
COM: <s> helper function used to create the comma separated row </s>
|
funcom_train/31651109 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void killProcess(String processId) throws Exception{
if(processInstances.containsKey(processId)){
SM.debug("Killing process: "+processId);
ProcessInstance pi = (ProcessInstance) processInstances.get(processId);
pi.abortProcess( );
}else{
throw new Exception("Process "+processId+" is not active, can't be killed");
}
}
COM: <s> notify a process that it should abort asap </s>
|
funcom_train/2324293 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void fetchNextBlock() {
if (n > 0) {
long last = buffer[bufferPosition];
sampler.nextBlock((int) Math.min(n, MAX_BUFFER_SIZE), buffer, 0);
skip = buffer[0] - last - 1;
bufferPosition = 0;
}
}
COM: <s> not yet commented </s>
|
funcom_train/17700423 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public FieldPoint next() {
if (currentPosition < 0) return null;
FieldPoint patternPoint = locatorPatterns[currentPosition];
FieldPoint next = new FieldPoint(center.getX() + patternPoint.getX(),
center.getY() + patternPoint.getY());
findNext();
return next;
}
COM: <s> returns a next peer point and find a next peer </s>
|
funcom_train/29618271 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JScrollPane getJSynonymUseScrollPane() {
if (jSynonymUseScrollPane == null) {
jSynonymUseScrollPane = new JScrollPane();
jSynonymUseScrollPane.setBounds(328, 24, 245, 101);
jSynonymUseScrollPane.setViewportView(getJSynonymUseList());
}
return jSynonymUseScrollPane;
}
COM: <s> this method initializes j synonym use scroll pane </s>
|
funcom_train/37009440 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int maxGreen() {
int m = Integer.MIN_VALUE;
for (int v = 0; v < getHeight(); v++)
{
for (int u = 0; u < getWidth(); u++)
{
if (green(u, v) > m) m = green(u, v);
}
}
return m;
}
COM: <s> returns the maximum green pixel value in band 1 </s>
|
funcom_train/26408656 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PreparedStatement prepareStatement(String sql) throws SQLException{
try{
return m_remote.getPreparedStatement();
}
catch(RemoteException l_re){
throw new SQLException(l_re.toString());
}
catch(Throwable th){
throw new SQLException(th.toString());
}
}
COM: <s> creates a code prepared statement code object for sending </s>
|
funcom_train/19752394 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isConnected() throws Exception {
try {
if (_commandSocket.isBound())
if (_commandSocket.isConnected())
if (!_commandSocket.isClosed())
if (!_commandSocket.isInputShutdown())
if (!_commandSocket.isOutputShutdown())
return true;
return false;
}
catch (Exception e) {
throw new Exception(ParseError.parseError("FtpPassiveClient.isConnected",e));
}
}
COM: <s> checks if the command socket is still connected </s>
|
funcom_train/36738063 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int getSlotIndex(String code) throws VendingMachineException {
if( code.equals(A_CODE)) {
return 0;
} else if ( code.equals(B_CODE)) {
return 1;
} else if ( code.equals(C_CODE)) {
return 2;
} else if ( code.equals(D_CODE)) {
return 3;
} else {
throw new VendingMachineException(VendingMachine.INVALID_CODE_MESSAGE);
}
}
COM: <s> gets the slot index given the code for that slot </s>
|
funcom_train/18739208 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void applyDelta(DeltaTarget target) {
if (this.rule.isModifying()) {
RuleEffect record = getEffect();
eraseEdges(record, target);
// either merge or erase the LHS nodes
mergeNodes(record, target);
eraseNodes(record, target);
createNodes(record, target);
createEdges(record, target);
eraseIsolatedValueNodes(target);
}
}
COM: <s> applies the rule to a given delta target </s>
|
funcom_train/9449433 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void put(String name, byte value) throws IllegalArgumentException {
ObjectSlot slot = findSlot(name, Byte.TYPE);
if (slot == null) {
throw new IllegalArgumentException("no byte field '" + name + "'");
}
slot.fieldValue = Byte.valueOf(value);
slot.defaulted = false; // No longer default value
}
COM: <s> find and set the byte value of a given field named </s>
|
funcom_train/24468743 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String extractFirstNumber(final String input) {
String number = "";
if (input != null) {
final Pattern pat = Pattern
.compile(
"[0-9]{1,}");
final Matcher match = pat.matcher(input);
try {
if (match.find()) { // Only takes the first hit...
number = input.substring(match.start(), match.end());
}
} catch (final Exception e) {
LOG.error("extractFirstNumber: " + input + "\040" + e.toString());
}
}
return number;
}
COM: <s> extracts the first number in a string </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.