__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/17547184
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object getService() { synchronized(this) { if (theDiscoverer == null) { try { theDiscoverer = new LookupDiscovery(LookupDiscovery.ALL_GROUPS); theDiscoverer.addDiscoveryListener(this); } catch (IOException anIOE) { System.err.println("Failed to init lookup"); anIOE.printStackTrace(System.err); } } } return waitForProxy(); } COM: <s> having created a lookup which means it now knows what type of service </s>
funcom_train/29921893
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addHeader(String headerName, String headerValue, SOAPElement nodeToAddTo){ try { SOAPElement headers = nodeToAddTo.addChildElement("Header"); headers.addChildElement("Name").addTextNode(headerName); headers.addChildElement("HeaderValue").addTextNode(headerValue); } catch (SOAPException ex) { ex.printStackTrace(); } } COM: <s> add a header branch to soap message body see code email gate way </s>
funcom_train/31818195
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void deleteBacklog(long id) { AsyncCallback callback = new AsyncCallback() { public void onSuccess(Object result) { try { BacklogWeb backlog = (BacklogWeb)result; rootproject.setBacklog(null); lookup.remove(new Long(backlog.getId())); listener.deletedBacklog(backlog); } catch(Exception e) { e.printStackTrace(); } } public void onFailure(Throwable caught) { caught.printStackTrace(); } }; aps.deleteBacklog(id, callback); } COM: <s> deletes project backlog </s>
funcom_train/22126243
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void publishZKResources() throws PluginLifecycleException { ExtensionPoint toolExtPoint = pluginManager.getRegistry(). getExtensionPoint("org.integratedmodelling.thinkcap.core", "zk"); for (Iterator<Extension> it = toolExtPoint.getConnectedExtensions().iterator(); it.hasNext(); ) { Extension ext = it.next(); pluginManager.activatePlugin(ext.getDeclaringPluginDescriptor().getId()); } } COM: <s> bypass zks rigid handling of resource finding by </s>
funcom_train/27840163
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void writeDataToPrefs() { Prefs prefs = Prefs.getInstance(); prefs.set("user", "name", getName()); prefs.set("user", "email", getEMail()); prefs.set("user", "company", getCompany()); prefs.save(); } COM: <s> writes the name and e mail address of the user to the preferences </s>
funcom_train/1053194
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean playback() { if (playing()) return true; debugMsg("playback(): stream all buffers"); for (int i = 0; i < NUM_BUFFERS; i++) { if (!stream(buffers[i])) return false; } debugMsg("playback(): queue all buffers & play source"); al.alSourceQueueBuffers(source[0], NUM_BUFFERS, buffers, 0); al.alSourcePlay(source[0]); return true; } COM: <s> play the ogg stream </s>
funcom_train/28654296
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void createSashFormRequestResponse() { sashFormRequestResponse = new SashForm(top, SWT.NONE); createGroupRequest(); createGroupResponse(); GridData gridData5 = new GridData(); gridData5.horizontalSpan = 4; gridData5.horizontalAlignment = GridData.FILL; gridData5.verticalAlignment = GridData.FILL; gridData5.grabExcessVerticalSpace = true; gridData5.grabExcessHorizontalSpace = true; sashFormRequestResponse.setLayoutData(gridData5); } COM: <s> this method initializes sash form request response </s>
funcom_train/15724796
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void writeTEXTElement(Element e, String tagValue) { NodeList nl = e.getChildNodes(); for (int i = 0; i < nl.getLength(); i++) { e.removeChild(nl.item(i)); } Text textNode = XMLDocument.createTextNode(tagValue); e.appendChild(textNode); } COM: <s> sets the content of an element containting a text node </s>
funcom_train/6339290
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void run() { log.info(toString() + " is accepting connections."); while (!shuttingDown) { try { final Socket soc = serverSocket.accept(); log.info(toString() + " accepted a connection from: " + soc.getInetAddress()); new PlayerLoader(soc); } catch (IOException e) { log.warn("Incoming connection failed: " + e.getLocalizedMessage()); } } log.info(toString() + " is shutting down."); } COM: <s> server accepts connections from player clients </s>
funcom_train/4961881
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: static public String printInt(int toprint, int width, String fill) { String intStr = String.valueOf(toprint); int i = width - intStr.length(); if (i>=0) { String filler = fill.substring(0,i+1); return new String(filler + intStr); } else return intStr; } COM: <s> similar to above but fills with a string </s>
funcom_train/32870042
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setRedefineAdvice(Method advice, Object cut, int priority) { if(null != advice) { RedefineAdviceListEntry newEntry = new RedefineAdviceListEntry(advice, cut, priority); addRedefineAdvice(newEntry); } else if(!redefineAdvices.isEmpty()) { removeRedefineAdvice(cut); } modified = true; } COM: <s> redefine the method in this weaver </s>
funcom_train/12656180
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public TagInfo getTagInfo(String location) { if (Utilities.startWithProtocol(location)) { try { return getTagInfo(new URL(location)); } catch (MalformedURLException ex) { logger.debug(ex.getMessage(), ex); return null; } } else { return getTagInfo(new File(location)); } } COM: <s> return tag info from a given string </s>
funcom_train/40648146
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void handle(Exception exception) { IPluginEvent event = null; if(exception instanceof PluginException) { event = new PluginEvent(CommonEvents.EXCEPTION_EVENT, ((PluginException) exception).getPlugin(), new String[] {"exception"}, new Object[] {exception}); } else { event = new PluginEvent(CommonEvents.EXCEPTION_EVENT, new String[] {"exception"}, new Object[] {exception}); } dispatch(event); } COM: <s> methods handles exceptions from plug ins </s>
funcom_train/43827631
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addTimedPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_CPNType_timed_feature"), getString("_UI_PropertyDescriptor_description", "_UI_CPNType_timed_feature", "_UI_CPNType_type"), CpntypesPackage.Literals.CPN_TYPE__TIMED, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the timed feature </s>
funcom_train/626927
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void outAOclExpression(AOclExpression node) { Type evalType = this.annotatedType(node.getExpression()); if (this.curStereotype != null && !evalType.conforms(Type.ABoolean)) { Token location = NodeTokenizer.tokenize(node.getExpression())[0]; String msg = "Type mismatch: The type of the constraint (" + evalType + ") does not conform to type Boolean"; throw new TypeConformanceException(location, msg); } } COM: <s> checks whether invariants pre and postcondition evaluate to </s>
funcom_train/7276737
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void validateDownload() { if(shouldValidate()) { if(getSha1Urn() != null) { contentManager.request(getSha1Urn(), new ContentResponseObserver() { public void handleResponse(URN urn, ContentResponseData response) { if(response != null && !response.isOK()) { invalidated = true; stop(); } } }, 5000); } } } COM: <s> validates the current download </s>
funcom_train/13398784
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void init_rule_chooser(InferenceSystem system) { /* initialize the rule chooser, preserve previous location if possible*/ Point location; if (ruleChooser != null) { location = ruleChooser.getLocation(); } else { location = frame.getLocation(); location.translate(frame.getWidth(),0); } ruleChooser = new RuleChooser(frame, location, system); this.system = system; } COM: <s> initializes the rule chooser dialog </s>
funcom_train/37711256
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testCompleteDate() { jdatef.setText("2005-5-20"); Date date; try { date = jdatef.getEarly(); java.sql.Date pdate = new java.sql.Date(date.getTime()); String answer = pdate.toString(); assertEquals("Simple date not recovered", "2005-05-20", answer); } catch (Exception e) { e.printStackTrace(); assertTrue("Exception testCompleteDate", false); } } COM: <s> retrieve the date 2000 5 20 </s>
funcom_train/49789464
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testLogoutOperation() throws Exception { root = loadAndInfer(LoginHandlerInstance.class); Session session = assertHasSession(root, "my session"); Frame logout = assertHasFrame(root, "Logout Successful"); assertGenerated(logout); Operation op = assertHasOperation(session, "do logout"); Event access = logout.getOnAccess(); // no wires { ECARule run = assertHasRunAction(session, access, op); assertGenerated(run); } } COM: <s> the logout page should execute the do logout operation </s>
funcom_train/2517780
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean renameResource(Resource resource, String newName) { activate(ActivationPurpose.WRITE); if (groups.containsKey(resource.getName())) { groups.remove(resource.getName()); resource.setName(newName); addResource(resource); return true; } else { if (individuals.containsKey(resource.getName())) { individuals.remove(resource.getName()); resource.setName(newName); addResource(resource); return true; } return false; } } COM: <s> renames the supplied resource to new name and updates entries in map </s>
funcom_train/8373485
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setItemState(int brandIndex, boolean active) { DrinksStore drinksStore = (DrinksStore) this.transactionController .getMainController().getStoreController().getStore(Store.PRODUCT); DrinksStoreItem drinkStoreItem = (DrinksStoreItem) drinksStore .getStoreItem(brandIndex); setState(brandIndex, active); this.items.get(brandIndex).setItemState( drinkStoreItem.getQuantity() > 0); } COM: <s> this operation activates or deactivates the drink selection buttons on </s>
funcom_train/16451446
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void actionPerformed(ActionEvent event) { if(showStatisticsUpperPanel.isVerseSelected()) { showStatisticsUpperPanel.selectSelectedVerse(); } else { JOptionPane.showMessageDialog(showStatisticsUpperPanel.getParent(), BibleStudy.getMessages().getString("noverseselectederror"), BibleStudy.getMessages().getString("noverseselectederrortitle"), JOptionPane.INFORMATION_MESSAGE); } } COM: <s> this method is called when the action is invoked </s>
funcom_train/24492975
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getCommentStatusByID(int ID) { String status = "Status not found!"; if (ID < 0 || ID >= this.commentStates.length) { throw new RuntimeException(ID + " no valid StatusID!"); } else { status = this.commentStates[ID]; } return status; } COM: <s> returns a comment status value defined in the properties according to its id </s>
funcom_train/46402511
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void assocUserToRole(UserRole ur) { if (ur.getRoleId() == null) throw new IllegalArgumentException("roleId is null"); if (ur.getServiceId() == null) throw new IllegalArgumentException("domainId object is null"); if (ur.getUserId() == null) throw new IllegalArgumentException("userId object is null"); ur.setUserRoleId(null); userRoleDao.add(ur); } COM: <s> adds a user to a role using the user role object </s>
funcom_train/9827857
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void setDTBListening( DynamicTestBench dtb ) { dtb.addClockScheduleListener( this ); _clockScheduleView.setText( dtb.getClockSchedule() ); dtb.addConstructorListener( this ); dtb.addConstructorParamListener( this ); dtb.addParamListener( this ); dtb.addParamTypesListener( this ); dtb.addPortSettingsListener( this ); } // end method setDTBListening COM: <s> sets up this gui to listen for changes to the data model as </s>
funcom_train/33598579
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public TextField getLogin() { if (login == null) {//GEN-END:|26-getter|0|26-preInit // write pre-init user code here login = new TextField("login", "enter your login", 32, TextField.ANY);//GEN-LINE:|26-getter|1|26-postInit // write post-init user code here }//GEN-BEGIN:|26-getter|2| return login; } COM: <s> returns an initiliazed instance of login component </s>
funcom_train/15680019
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setSelection( final int index ) { if( isSetSelectionEnabled && getTreeViewer() != null ) { Tree tree = getTreeViewer().getTree(); if( index >= 0 && index < tree.getItemCount() ) { tree.setSelection( tree.getItem( index ) ); tree.showSelection(); } else { tree.deselectAll(); } } } COM: <s> sets the selected item in the outline programmatically to the given index </s>
funcom_train/39408087
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JTextField getJTextFieldRounding() { if (jTextFieldRounding == null) { jTextFieldRounding = new JTextField(); jTextFieldRounding.setPreferredSize(new Dimension(50,20)); jTextFieldRounding.setMinimumSize(new Dimension(50,20)); jTextFieldRounding.setToolTipText("Afronding"); jTextFieldRounding.addKeyListener(new KeyListener(false, true, 2)); } return jTextFieldRounding; } COM: <s> this method initializes j text field rounding </s>
funcom_train/8358557
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void fillTableModels() { for (OrderedItem item : order.getItems()) { if (item.isLiquid()) { if (item.isAlcohol()) { tableModelAlcohol.getItems().add(item); } else { tableModelSoftDrink.getItems().add(item); } } else { if (item.isBar()) { tableModelSoftDrink.getItems().add(item); } else { tableModelFood.getItems().add(item); } } } updateTotalSum(); } COM: <s> filling table models with items from order </s>
funcom_train/35281544
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void add(Geometry g) { if (size == geometries.length) { Geometry[] temp = new Geometry[size * 2]; System.arraycopy(geometries, 0, temp, 0, size); geometries = temp; // original list replaced by double-size list geometries2 = new Geometry[size * 2]; } geometries[size++] = g; } COM: <s> adds a geometry to the list </s>
funcom_train/25664349
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public double getPythagoreanDistance(final Coordinate<?, ?, ?> point) { final int xDist = this.x - point.x; final int yDist = this.y - point.y; final int zDist = this.z - point.z; return (int) (Math.sqrt(xDist * xDist + yDist * yDist + zDist * zDist)); } COM: <s> gets the distance from this coordinate to another coordinate as measured by pythagorass </s>
funcom_train/1910989
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getParamInt(int index, int alternative) { try { if(params != null && index >= 0 && index < params.length && params[index].trim().length() != 0) return Integer.parseInt(params[index]); else return alternative; } catch(NumberFormatException e) { return alternative; } } COM: <s> helper get integer params without exception </s>
funcom_train/37903827
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public HashMap getCollectionDesc(String rootCollection) throws EXistException, PermissionDeniedException { try { return getCollectionDesc((rootCollection==null)?XmldbURI.ROOT_COLLECTION_URI:XmldbURI.xmldbUriFor(rootCollection)); } catch (Throwable e) { handleException(e); } return null; } COM: <s> the method code get collection desc code </s>
funcom_train/12803777
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void startup() throws IOException { String theFilename = buildTempFile(); Runtime rt = Runtime.getRuntime(); // if the build worked and a filename is returned if ( theFilename != null ) { String[] callAndArgs = { "javaws", theFilename }; try { Process child = rt.exec( callAndArgs ); } catch ( Exception e ) { System.out.println( e.toString() ); } } } COM: <s> start the web application </s>
funcom_train/38975627
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Properties replaceEnvironmentParameters(final Properties properties) { assert (properties != null); // now check all Systemproperties ... final Properties newProps = new Properties(); for (final Enumeration<?> keys = properties.keys(); keys.hasMoreElements();) { final String key = (String) keys.nextElement(); final String value = properties.getProperty(key).trim(); final String newValue = replaceEnvironmentInString(value); newProps.put(key, newValue); } return newProps; } COM: <s> replaces environment variables all occurence of </s>
funcom_train/2903217
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void add(Component c){ /*if(container.size() > 0){ container.remove(c); int found = findPosition(c, 0, container.size()); Component mc = (Component)container.get(found); int sv = getMeasuringParam(c); int tv = getMeasuringParam(mc); int ft = 0; if(sv > tv){ ft = found + 1; } else{ ft = found - 1; if(ft < 0){ ft = 0; } } container.insertElementAt(c, ft); if(ft > 0){ adjust(ft-1); } else{ adjust(ft); } } else{*/ container.add(c); //} } COM: <s> add a component to be managed </s>
funcom_train/19746302
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected Integer getNumberOfTopics(Long forumId) { String hql = new StringBuffer("select count(topic) from Topic as topic ") .append("where topic.forum.id = ? ") .toString(); return findUniqueIntegerResult(hql, new Object[]{forumId}); } COM: <s> returns number of topics in a forum </s>
funcom_train/16792503
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Resource createPendingRecording(Resource system, int slot) { String uri = this.buildPendingRecordingUri(system.getURI(), slot); Resource timer = this.model.createResource(uri, TMSNet.PendingRecording); timer.addProperty(TMSNet.recorder, system); return timer; } COM: <s> create a timer description </s>
funcom_train/49929126
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String getDicDir() { String wDir = null; if (System.getProperties().containsKey("root")) { wDir = System.getProperty("root"); } if ((wDir == null || wDir.isEmpty()) && CPlatform.isMacOs()) wDir = new File(CPlatform.getUserHome(), "Library/Spelling") .getAbsolutePath(); if (wDir == null || wDir.isEmpty()) wDir = "/home/ff/projects/hunspell"; return wDir; } COM: <s> the state of open source spell checking on mac os x </s>
funcom_train/4923297
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testImmediateFailureToGenerateSessionId() throws Throwable { final Exception failure = new Exception("Generate Session Id failure"); // Record creating HTTP session this.record_sessionIdCookie(null); this.record_generate_failedToGenerateSessionId(failure); // Load the managed object this.replayMockObjects(); HttpSessionManagedObject mo = this.createHttpSessionManagedObject(); this.startCoordination(mo); this.verifyFailure(mo, failure); } COM: <s> ensure able to handle failure in generating the session id </s>
funcom_train/18229786
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public interface Popup extends Presenter { /** Get a menu item that can present this action in a {@link javax.swing.JPopupMenu}. * If your menu content is dynamic in nature, consider using <a href="@org-openide-awt@/org/openide/awt/DynamicMenuContent.html">DynamicMenuContent</a> * @return the representation for this action */ public JMenuItem getPopupPresenter(); } COM: <s> the presenter interface for presenting an action in a popup menu </s>
funcom_train/39911050
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetT_date() { System.out.println("getT_date"); timesheet instance = new timesheet(); String expResult = ""; String result = instance.getT_date(); 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 t date method of class buissness </s>
funcom_train/48404897
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public HandlerRegistration addMouseOutHandler(com.smartgwt.client.widgets.events.MouseOutHandler handler) { if(getHandlerCount(com.smartgwt.client.widgets.events.MouseOutEvent.getType()) == 0) setupMouseOutEvent(); return doAddHandler(handler, com.smartgwt.client.widgets.events.MouseOutEvent.getType()); } COM: <s> add a mouse out handler </s>
funcom_train/123095
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void lock() { Thread caller = Thread.currentThread(); synchronized (this) { if (caller == _owner) { _count++; } else { try { while (_owner != null) { this.wait(); } _owner = caller; _count = 1; } catch (InterruptedException exception) { return; } } } } COM: <s> acquires the lock </s>
funcom_train/48667120
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void fireNewEntity(LogRepositoryInfo logRepositoryInfo, HostId hid, AgentId aid, EntityDescriptor entity) { synchronized(fScanListeners) { for(ScanListener listener : fScanListeners) { try { listener.newEntity(logRepositoryInfo, hid, aid, entity); }catch(Exception ex) { logger.error(ex); } } } } COM: <s> fires new entity </s>
funcom_train/41108930
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void removePublisher(Long id) { if(id == null){ throw new NullPointerException("publisher's id"); } Publisher publisher = em.find(Publisher.class, id); if(publisher == null){ throw new IllegalStateException("The given publisher doesn't exist"); } em.remove(publisher); } COM: <s> it removes a publisher </s>
funcom_train/19536297
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public WaitState getState() { String state = (String)getCustomProperties().get(STATE_PROP_NAME); if (state == null || state.isEmpty()) return null; WaitState value = state != null ? InitToolGameSettings.getInstance().getWaitState(state) : null; if (value == null) { value = WaitState.DEFAULT_STATE; } return value; } COM: <s> get the state for this creature item </s>
funcom_train/21015387
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public QuitAction ( ) { super( "Quit" ); putValue ( SHORT_DESCRIPTION, "Quit ESPRO" ); putValue ( MNEMONIC_KEY, new Integer( KeyEvent.VK_Q ) ); putValue ( ACCELERATOR_KEY, KeyStroke.getKeyStroke ( KeyEvent.VK_Q, ActionEvent.CTRL_MASK ) ); } COM: <s> quits the application </s>
funcom_train/2697334
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void setDocumentContent(IDocument document, Reader reader) throws IOException { Reader in= new BufferedReader(reader); try { StringBuffer buffer= new StringBuffer(512); char[] readBuffer= new char[512]; int n= in.read(readBuffer); while (n > 0) { buffer.append(readBuffer, 0, n); n= in.read(readBuffer); } document.set(buffer.toString()); } finally { in.close(); } } COM: <s> reads in document content from a reader and fills code document code </s>
funcom_train/35486346
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void schedule(Frontier f) { // if (_seenRound != null) { // if (!(f instanceof DiskFrontier)) { // f.removeAll(_seenRound); // } // } // if (_urisRound != null) { // uris // } // _seenRound = Collections.synchronizedSet(new HashSet<URI>()); // _redirsRound = Collections.synchronizedSet(new HashSet<URI>()); } COM: <s> schedule uris in frontier i </s>
funcom_train/48749440
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testXML() throws Exception { Document d = getXMLDoc(); Output newOutput = getOutput(d); assertTrue("getOutput returned null", newOutput != null); assertTrue("Proper Display Length", newOutput.getDisplayLength() == 30); assertTrue("Proper Name", newOutput.getName().equals(outputName)); assertTrue("Proper Content", newOutput.getContent() .equals(outputContent)); } COM: <s> test basic output xml output serialization </s>
funcom_train/8311986
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String stringValueOf(Object node) throws JaxenException { Context context = getContext(node); Object result = selectSingleNodeForContext(context); if (result == null) { return ""; } return org.jaxen.function.StringFunction.evaluate(result, context.getNavigator()); } COM: <s> evaluating this xpath expression when evaluated against the specified </s>
funcom_train/13441064
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void connect(int soTimeoutMsecs) throws IOException { if (iStreams_ != null) { throw new IllegalStateException("Already obtained response."); } socket_ = new Socket(proxyHost_ == null ? host_ : proxyHost_, proxyHost_ == null ? port_ : proxyPort_); if (soTimeoutMsecs > 0) { socket_.setSoTimeout(soTimeoutMsecs); } } // COM: <s> connects with a given timeout msecs </s>
funcom_train/50911066
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Real2Array format(int places) { double[] xarray = xarr.getArray(); double[] yarray = yarr.getArray(); for (int i = 0; i < nelem; i++) { xarray[i] = Util.format(xarray[i], places); yarray[i] = Util.format(yarray[i], places); } return this; } COM: <s> round to decimal places </s>
funcom_train/7669942
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void validateFormat(char format) { int index = patternChars.indexOf(format); if (index == -1) { // text.03=Unknown pattern character - '{0}' throw new IllegalArgumentException(Messages.getString( "text.03", format)); //$NON-NLS-1$ } } COM: <s> validates the format character </s>
funcom_train/37765522
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void preprocess(UOW uow, AttachmentMaintenanceUpdateInDto input) throws FrameworkException, ApplicationExceptions { // .//GEN-END:_preprocessUpdate_1_be // Add custom code //GEN-FIRST:_preprocessUpdate_1 // .//GEN-LAST:_preprocessUpdate_1 // .//GEN-BEGIN:_preprocessUpdate_2_be } COM: <s> preprocess the input for the update method </s>
funcom_train/43448144
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void initialize(ExtInstances dataset, int capacity) { if (capacity < 0) capacity = 0; // Strings only have to be "shallow" copied because // they can't be modified. m_ClassIndex = dataset.numAttributes() - 1; m_RelationName = dataset.m_RelationName; m_Attributes = dataset.m_Attributes; classes = dataset.classes; constraints = dataset.constraints; type = dataset.type; ext_Instances = new ArrayList<ExtInstance>(); } COM: <s> initializes with the header information of the given dataset and sets the </s>
funcom_train/8632844
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void logWrongJDK() { if ((this.tagBits & Logger.XML) != 0) { this.parameters.put(Logger.MESSAGE, this.main.bind("configure.requiresJDK1.2orAbove")); //$NON-NLS-1$ printTag(Logger.ERROR, this.parameters, true, true); } this.printlnErr(this.main.bind("configure.requiresJDK1.2orAbove")); //$NON-NLS-1$ } COM: <s> print the usage of wrong jdk </s>
funcom_train/3364725
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Rectangle getBounds(Rectangle rv) { if (rv == null) { return new Rectangle(getX(), getY(), getWidth(), getHeight()); } else { rv.setBounds(getX(), getY(), getWidth(), getHeight()); return rv; } } COM: <s> stores the bounds of this component into return value </s>
funcom_train/3048986
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Configuration addResource(String path, ClassLoader classLoader) throws MappingException { log.info( "Reading mappings from resource: " + path ); InputStream rsrc = classLoader.getResourceAsStream( path ); if ( rsrc == null ) { throw new MappingException( "Resource: " + path + " not found" ); } try { return addInputStream( rsrc ); } catch (MappingException me) { throw new MappingException( "Could not read mappings from resource: " + path, me ); } } COM: <s> read mappings from an application resource </s>
funcom_train/14123764
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void load() { Iterator iterator = loaders.iterator(); while (iterator.hasNext()) { MacroLoader loader = (MacroLoader) iterator.next(); loader.setRepository(this); log.debug("Loading from: " + loader.getClass()); loader.loadPlugins(this); } } COM: <s> loads macros from all loaders into plugins </s>
funcom_train/12804024
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addScrollPane( JScrollPane aScrollPane, int aHeight) { layout.setConstraint( aScrollPane, new FrameConstraint( 0.0, x, 0.0, y, 1.0, 0, 0.0, y += aHeight)); add( aScrollPane ); positionToNextLine(); } COM: <s> add the scroll pane to our canvas with the given height </s>
funcom_train/7621814
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean removeCallbacks(Runnable action) { Handler handler; if (mAttachInfo != null) { handler = mAttachInfo.mHandler; } else { // Assume that post will succeed later ViewRoot.getRunQueue().removeCallbacks(action); return true; } handler.removeCallbacks(action); return true; } COM: <s> removes the specified runnable from the message queue </s>
funcom_train/12768551
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public WaypointCollection getWaypointCollection() { Waypoint[] waypoints = root.getAllWaypoints(); WaypointCollection waypointCollection = new WaypointCollection(); for (int i = 0; i < waypoints.length; i++) { String wpID = waypoints[i].getKeyword() + waypoints[i].getLineNumber(); waypointCollection.addWaypoint(wpID, waypoints[i]); } return waypointCollection; } COM: <s> gets all the waypoints as a waypoint collection object </s>
funcom_train/50080741
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public CMLCml getCML(Connection dbconn) throws CMLException, Exception { CMLCml cml=new CMLCml(); cml.appendChild(new Convertor(true,null).cdkMoleculeToCMLMolecule(getAsCDKMoleculeAsEntered(setid,dbconn))); ((Element) cml.getChildCMLElements("molecule").get(0)).addAttribute(new Attribute("id", "nmrshiftdb"+getMoleculeId())); return (cml); } COM: <s> gets this molecule as cml </s>
funcom_train/17620259
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setTaskRunning(boolean b) { if (b == false) { statusAnimationLabel.setIcon(new ImageIcon(getClass().getResource(RES + "task-idle.png"))); } else { statusAnimationLabel.setIcon(new ImageIcon(getClass().getResource(RES + "task-busy.gif"))); } } COM: <s> tells main form whether it should display task busy icon </s>
funcom_train/8264626
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void invalidated(NodeImpl node) { ArrayList listenersList = this.documentNotificationListeners; int size; synchronized(listenersList) { size = listenersList.size(); } // Traverse list outside synchronized block. // (Shouldn't call listener methods in synchronized block. // Deadlock is possible). But assume list could have // been changed. for(int i = 0; i < size; i++) { try { DocumentNotificationListener dnl = (DocumentNotificationListener) listenersList.get(i); dnl.invalidated(node); } catch(IndexOutOfBoundsException iob) { // ignore } } } COM: <s> this is called when the node has changed but </s>
funcom_train/33817291
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Command getOkCommand () { if (okCommand == null) {//GEN-END:|21-getter|0|21-preInit // write pre-init user code here okCommand = new Command ("Envia", Command.OK, 0);//GEN-LINE:|21-getter|1|21-postInit // write post-init user code here }//GEN-BEGIN:|21-getter|2| return okCommand; } COM: <s> returns an initiliazed instance of ok command component </s>
funcom_train/28350433
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setPrimarySource( final OrbitSource primarySource ) { try { _busyLock.lock(); _orbit = null; if ( _primarySource != null ) { _primarySource.removeOrbitSourceListener( this ); } _primarySource = primarySource; if ( primarySource != null ) { primarySource.setSequence( getSequence(), getBpmAgents() ); primarySource.addOrbitSourceListener( this ); } } finally { _busyLock.unlock(); } } COM: <s> set the new primary source </s>
funcom_train/21619885
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testSetPhone() { System.out.println("setPhone"); assertEquals(false, store.isDirty()); String phone = "555-5555"; store.setPhone(phone); assertEquals(phone, store.getPhone()); assertEquals(true, store.isDirty()); } COM: <s> test of set phone method of class edu </s>
funcom_train/20397250
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void updateChips(){ player1_pos = myEngine.getPlayerPosition(this.player_uid[P_ONE]); player2_pos = myEngine.getPlayerPosition(this.player_uid[P_TWO]); time_left = myEngine.getTimeLeft(); chips_left = myEngine.getChipsLeft(); game_state = myEngine.getGameState(); } COM: <s> gets the current position of the player on the board the time left </s>
funcom_train/42642949
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addAuthorsPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_IText_authors_feature"), getString("_UI_PropertyDescriptor_description", "_UI_IText_authors_feature", "_UI_IText_type"), DigitalHPSPackage.Literals.ITEXT__AUTHORS, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the authors feature </s>
funcom_train/44283868
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getPatchName(Patch p,int patchNum) { int nameStart=getPatchStart(patchNum); nameStart+=0; //offset of name in patch data try { StringBuffer s= new StringBuffer(new String(((Patch)p).sysex,nameStart, 10,"US-ASCII")); return s.toString(); } catch (UnsupportedEncodingException ex) { return "-"; } } COM: <s> gets the patch name </s>
funcom_train/8689800
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int replace() { int found = inputBuffer.toString().indexOf(token); int pos = -1; while (found >= 0) { inputBuffer.replace(found, found + token.length(), replaceValue); pos = found + replaceValue.length(); found = inputBuffer.toString().indexOf(token, pos); ++replaceCount; } return pos; } COM: <s> performs the replace operation </s>
funcom_train/17624343
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void restore() { for (int i = 0; i < maxX; i++) { for (int j = 0; j < maxY; j++) { bricks[i][j] = bricksBackup[i][j]; bricks[i][j].setOrientation(Orientation.NONE); } } list.clear(); list.addAll(listBackup); } COM: <s> restores bricks from copy </s>
funcom_train/47489968
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean waitRunning(String id) { try { System.out.print("Waiting for " + id + ":"); int i = 0; while (!isRunning(id)) { if (i == 10000) { System.out.println("Error with " + id); return false; } if (i % 10 == 0) { System.out.print("#"); } i++; } System.out.println(""); // end of line } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return true; } COM: <s> waits for an instance to be running </s>
funcom_train/50846175
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testUnwrap() throws Exception { ParameterMetaData pmd = getMetaData(); Class<?> wcls = getExpectedWrappedClass(); Object wobj = getExpectedWrappedObject(pmd, wcls); assertEquals("pmd.unwrap(" + wcls + ")", wobj, pmd.unwrap(wcls)); } COM: <s> test of unwrap method of interface java </s>
funcom_train/36429534
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean get(long lid, long sid, long ldid) { if (ArkDirConstants.isIdUniqueKO(lid) || ArkDirConstants.isIdUniqueKO(sid) || ArkDirConstants.isIdUniqueKO(ldid)) { return false; } this.lid = lid; this.sid = sid; this.ldid = ldid; try { select(); } catch (GoldenGateDatabaseException e) { return false; } return true; } COM: <s> get the stor interval object from db </s>
funcom_train/44709253
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void fireActionEvent(PageState data) { Iterator i=m_listeners.getListenerIterator(ActionListener.class); ActionEvent e = null; while (i.hasNext()) { if ( e == null ) { e = new ActionEvent(this, data); } ((ActionListener) i.next()).actionPerformed(e); } } COM: <s> notifies listeners that some part of the tree was clicked by the </s>
funcom_train/17805048
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addPatternNamePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_PatternNode_PatternName_feature"), getString("_UI_PropertyDescriptor_description", "_UI_PatternNode_PatternName_feature", "_UI_PatternNode_type"), CtbPackage.Literals.PATTERN_NODE__PATTERN_NAME, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the pattern name feature </s>
funcom_train/24378521
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void callGetMQTemplateInline(TemplateInlineType templateInlineType) { MQMain.logger.debug("callGetMQTemplateInline"); String templateInlineContent; templateInlineContent = mathqurateObjectFactory.getTypeAsXML(templateInlineType); MQTemplateInline templateInlineHelper = new MQTemplateInline(templateInlineType, templateInlineContent); firePropertyChange(DefaultController.GET_MQTEMPLATEINLINE_PROPERTY, "", templateInlineHelper); } COM: <s> calls the get mq template inline </s>
funcom_train/17921704
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addEmail(Email email) { if (email == null) { return; } if (emails == null) { emails = new ArrayList(); } int pos = emails.indexOf(email); //if (pos < 0) { emails.add(email); //} else { // emails.set(pos, email); //} } COM: <s> adds a new email address </s>
funcom_train/15724808
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void closeSubFolders(Folder folder) throws MessagingException { if (folder.isOpen()) { folder.close(false); } Folder[] folders = folder.list(); for (int i = 0; i < folders.length; i++) { closeSubFolders(folders[i]); } } COM: <s> makes sure all folders under the passed argument are closed </s>
funcom_train/8907011
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void displayThing(Graphics2D g, Thing thing, int x, int y) { Image image = ImageLibrary.getImage(thing.getType()); Point p = getThingImagePositionInTile(image, x, y); g.drawImage(image, p.x, p.y, null); } COM: <s> displays the given thing onto the given graphics2 d object at the location </s>
funcom_train/17359577
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public StringBuilder getFulltext() { StringBuilder sb = new StringBuilder(1024).append(getId()).append("\n") .append(getTitle()).append("\n").append(getType()); if (properties != null) { for (Property property : properties) { if (property != null) { sb.append("\n").append(property.getName()).append("\n") .append(property.toString()); } } } return sb; } COM: <s> returns a fulltext representation of the content as string builder so </s>
funcom_train/25880061
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void click(String name) { int tabIndex = 0; boolean hasFound = false; for (String element : names) { if (element.equalsIgnoreCase(name)) { hasFound = true; break; } tabIndex++; } if (hasFound) { click(tabIndex + 1); } else { System.err.println("Nao ha aba com esse nome! " + name); throw new EnvException("Não foi encontrada a tab com o nome: " + name + ". Verifique o nome bla"); } } COM: <s> click on a tab </s>
funcom_train/23703879
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public double getSysdate() { currentDate = new Date(); double sysdate = 0.0; double sysdateLocal = (new Long(currentDate.getTime()).doubleValue()); if (sysdateDeltaDouble == null) { try { sysdateDeltaDouble = this.model.getSysdate() - sysdateLocal; } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); sysdateDeltaDouble = null; } sysdate = sysdateLocal + sysdateDeltaDouble; } else { sysdate = sysdateLocal + sysdateDeltaDouble; } return sysdate; } COM: <s> gets the database sysdate </s>
funcom_train/6220856
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setParagraphGapSize(ConstantSize paragraphGapSize) { RowSpec rowSpec = FormFactory.createGapRowSpec(paragraphGapSize); // No longer supported in version 1.0.4/1.0.5 which are the oldest available versions in maven // central repo // //this.paragraphGapSpec = rowSpec.asUnmodifyable(); this.paragraphGapSpec = rowSpec; } COM: <s> sets the size of gaps between paragraphs using the given </s>
funcom_train/27779458
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String readMessage(BufferedReader reader) throws IOException { StringBuffer buffer = new StringBuffer(); boolean done = false; while (!done) { // Read a line and add it to the buffer String line = readLine(reader, preferences.getInt("maxLineLength", 1000)); if (line.equals(".\r\n") || (buffer.length() > preferences.getInt("maxLineLength", 1000))) { // end of buffer done = true; } else if (line.startsWith(".")) { buffer.append(line.substring(1)); } else { buffer.append(line); } } return (buffer.toString()); } COM: <s> reads a single message from the given reader halting when the </s>
funcom_train/14261309
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getSynopsis() { if(this.consumes) return "[" + arg + "..." + "]"; if(!this.required && !isIndexed) return ""; if(arg.length() == 0) return ""; String syn = getOptionName() + ' ' + arg; if(!required) syn = "[" + syn.trim() + "]"; return syn; } COM: <s> generate this options contribution to the programs synopsis message </s>
funcom_train/16593364
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JButton getBotSave() { if (botSave == null) { botSave = new JButton(); botSave.setName("botSave"); botSave.setToolTipText(PluginServices.getText(this, "save_selected_resources_and_exit")); botSave.setText(PluginServices.getText(this, "ok")); botSave.setActionCommand("Accept"); botSave.addActionListener(this); } return botSave; } COM: <s> this method initializes bot save </s>
funcom_train/48868926
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JToggleButton getStateButton() { if (stateButton == null) { stateButton = new JToggleButton("State",new ImageIcon("resources/images/state.png")); stateButton.setToolTipText("State"); group.add(stateButton); stateButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { setSelectedButton(STATE); } }); } return stateButton; } COM: <s> this method initializes state button </s>
funcom_train/3887447
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addIndexClassPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_IndexType_indexClass_feature"), getString("_UI_PropertyDescriptor_description", "_UI_IndexType_indexClass_feature", "_UI_IndexType_type"), ImsldV1p0Package.Literals.INDEX_TYPE__INDEX_CLASS, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the index class feature </s>
funcom_train/3409866
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getHostAddress() { String s = numericToTextFormat(ipaddress); if (scope_ifname_set) { /* must check this first */ s = s + "%" + scope_ifname.getName(); } else if (scope_id_set) { s = s + "%" + scope_id; } return s; } COM: <s> returns the ip address string in textual presentation </s>
funcom_train/22579429
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Vector getInactiveInterfaces(long devID) { Vector devIfs = null; String sqlString = null; // Create the SQL statement string to retrieve all inactive DeviceInterface records. sqlString = new String ("SELECT * FROM "+I_TBL_NAME + " WHERE deviceID="+devID+" AND active='false'"); System.out.println("\nDbDeviceInterface.getRemovedInterfaces:\n sqlString = "+sqlString); return getRecords(sqlString); } COM: <s> retrieve all the inactive device interfaces for a specific device </s>
funcom_train/16511156
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void jumptoFile(FileAbstract ref) { try { LicenseTreeNode node = licenseTree.findNode(ref); if (node instanceof FileAbstract) { FileAbstract file = (FileAbstract) node; if(openTabs.containsKey(file)) switchFile(file); } } catch (Exception e) { JOptionPane.showMessageDialog(this, "File not found", "File cannot be shown", JOptionPane.ERROR_MESSAGE); } } COM: <s> jump to a given file in a tree </s>
funcom_train/46792136
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected Encoding createEncoding() { COSObject encoding = cosGetField(PDFont.DK_Encoding); if (encoding.isNull()) { return createDefaultEncoding(); } if (encoding instanceof COSName) { return Encoding.createNamed((COSName) encoding); } if (encoding instanceof COSDictionary) { return DifferenceEncoding.create((COSDictionary) encoding, this); } throw new IllegalArgumentException("encoding not supported"); } COM: <s> create the encoding for the font </s>
funcom_train/18320593
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void showCurrentEditValue(DirectEditRequest request) { IWorkbenchWindow window = UIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow(); String msg = request.getCellEditor().getErrorMessage(); if (window instanceof WorkbenchWindow) { WorkbenchWindow w = (WorkbenchWindow) window; w.getStatusLineManager().setErrorMessage(msg); } } COM: <s> used to output error message </s>
funcom_train/4440862
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void onAddRelation(IRelation rel) { // incremental inference - 'rel' has been added already to memStore // TODO CLEANUP Was this required for HKW in any way??? it seems, rather // not. // if (!rel.asURI().equals(ICdsModel.HAS_RELATED)) { this.onAddBidiTriple(rel.asURI(), ICdsModel.IS_SUB_TYPE_OF, ICdsModel.HAS_SUB_TYPE, ICdsModel.HAS_RELATED); // } } COM: <s> infer rel is sub typeof has related </s>
funcom_train/34129260
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addDirectory( File dir, boolean isStartup) { // add the folder... BaseNode node = getSelectedNode(); if ( !dir.isDirectory()) { dir = dir.getParentFile(); } if ( node instanceof FolderNode) { FolderNode folder = (FolderNode)node; FolderProperties props = folder.getProperties(); props.addFolderProperties( new FolderProperties( dir)); folder.update(isStartup); nodeChanged( folder); properties.save(); } } COM: <s> adds a directory to the current selected folder project </s>