__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/5524634
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void notifyChange (Vector v, int item) { KeyboardItem changed=(KeyboardItem)v.elementAt(item); String descr=changed.keyDescription(); for (int i=0; i<v.size(); i++) { if (i==item) continue; KeyboardItem k=(KeyboardItem)v.elementAt(i); if (k.keyDescription().equals(descr)) { v.setElementAt(new KeyboardItem(k.getMenuString(),"none"),i); } } if (changed.getMenuString().startsWith("command.")) { makeCommandChoice(); } } COM: <s> test on doublicate keys and undefine them </s>
funcom_train/17805105
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addTargetPatternNodePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_PatternNodeConnection_targetPatternNode_feature"), getString("_UI_PropertyDescriptor_description", "_UI_PatternNodeConnection_targetPatternNode_feature", "_UI_PatternNodeConnection_type"), CtbPackage.Literals.PATTERN_NODE_CONNECTION__TARGET_PATTERN_NODE, true, false, true, null, null, null)); } COM: <s> this adds a property descriptor for the target pattern node feature </s>
funcom_train/25365921
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addArmorTypePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Armor_armorType_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Armor_armorType_feature", "_UI_Armor_type"), LeveleditorPackage.Literals.ARMOR__ARMOR_TYPE, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the armor type feature </s>
funcom_train/15410832
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected PreparedStatement getPstmt(SpiTransaction t, String sql, boolean genKeys) throws SQLException { Connection conn = t.getInternalConnection(); if (genKeys) { // the Id generated is always the first column // Required to stop Oracle10 giving us Oracle rowId?? // Other jdbc drivers seem fine without this hint. int[] columns = {1}; return conn.prepareStatement(sql, columns); } else { return conn.prepareStatement(sql); } } COM: <s> check with use generated keys to get appropriate prepared statement </s>
funcom_train/45623388
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addProductVersionPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ALType_productVersion_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ALType_productVersion_feature", "_UI_ALType_type"), MSBPackage.eINSTANCE.getALType_ProductVersion(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the product version feature </s>
funcom_train/22234542
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public PickInfo pickAny () { PickInfo pickInfo = null; if (pickRootBG != null) { pickInfo = pickRootBG.pickAny(mode, flags, pickShape); } else if (pickRootL != null) { pickInfo = pickRootL.pickAny(mode, flags, pickShape); } return pickInfo; } COM: <s> select one of the nodes that intersect the pick shape </s>
funcom_train/8131865
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected String convertErrorLine(String msg, String prop, int row) { String newMsg = TextService.getString("general.line@Line", " " + (row + 1)); if (prop != null) { FormControl fc = getRowCompound().findElementByProperty(prop); if (fc.getDescribingLabel() != null) newMsg += " " + fc.getDescribingLabel().getText(); } newMsg += " " + TextService.getString(msg); return newMsg; } COM: <s> converting one error message into a string to be readable by the user </s>
funcom_train/29928282
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected String getInitialFilePath() { String defaultPath = null; if (sourceSet == null) { defaultPath = System.getProperty("user.home"); } else { defaultPath = sourceSet.getDir() + sourceSet.getRoot() + getInitialExtension(); } if (root == null) { return defaultPath; } else { return root.getAttribute("file", defaultPath); } } COM: <s> gets the initial file path </s>
funcom_train/6329655
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected String toString(Document document) throws Exception { StringWriter writer = new StringWriter(); XMLSerializer serializer = new XMLSerializer(writer, new OutputFormat("xml", "UTF-8", true)); serializer.serialize(document); writer.flush(); return writer.toString(); } COM: <s> convert a code document code into a string </s>
funcom_train/242042
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void assignCurrentDMY() { try { java.util.Date date = new java.util.Date(); java.text.Format formatterDate = new java.text.SimpleDateFormat( "yyyy/MM/dd"); String dateCurrent = formatterDate.format(date); currentYear = Integer.parseInt(dateCurrent.substring(0, 4)); currentMonth = Integer.parseInt(dateCurrent.substring(5, 7)); currentDate = Integer.parseInt(dateCurrent.substring(8, 10)); } catch (Exception expt) { System.out.println("Error " + expt); } } COM: <s> assigns the current date month and year </s>
funcom_train/36012154
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setReviewId(ReviewId reviewId) { setReviewId(reviewId.getReviewId()); setDescription(reviewId.getDescription()); setAuthor(reviewId.getAuthor()); setCreationDate(reviewId.getDate()); setDirectory(reviewId.getDirectory()); setReviewers(reviewId.getReviewers()); } COM: <s> sets the code review id code </s>
funcom_train/51357216
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ActionErrors validate(final ActionMapping arg0, final HttpServletRequest arg1) { ActionErrors errors = new ActionErrors(); checkForEmpty("Message", "error.mandatory", getMessage(), errors); checkForEmpty("Message Title", "error.mandatory", getMessageTitle(), errors); return errors; } COM: <s> check none of the fields are null </s>
funcom_train/7275608
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void sendUDPPings() { // We need the lock on this so that we can copy the set of endpoints. List<Endpoint> l; synchronized(this) { l = new ArrayList<Endpoint>(ENDPOINT_SET.size() + restoredHosts.size()); l.addAll(ENDPOINT_SET.keySet()); l.addAll(restoredHosts); } Collections.shuffle(l); rank(l); } COM: <s> sends udp pings to hosts read from disk </s>
funcom_train/5164876
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int compareTo(final Object a_other) { if (a_other == null) { return 1; } InversionOperator op = (InversionOperator) a_other; // Everything is equal. Return zero. // --------------------------------- return 0; } COM: <s> compares the given genetic operator to this genetic operator </s>
funcom_train/38628602
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public double getBatteryVoltage() { // The Analog bumper has a voltage divider on the battery source. // Vbatt *--/\/\/\--* Vsample *--/\/\/\--* Gnd // 680 Ohms 1000 Ohms return m_batteryChannel.getAverageVoltage() * (1680.0 / 1000.0); } COM: <s> read the battery voltage from the specified analog channel </s>
funcom_train/36951138
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void removeContext(IWorkbenchPage page) { if (fContextsByPage != null) { fContextsByPage.remove(page); if (fContextsByPage.isEmpty()) { System.setProperty(DEBUGGER_ACTIVE, "false"); //$NON-NLS-1$ System.setProperty(INSTANCE_OF_IRUBY_STACK_FRAME, "false"); //$NON-NLS-1$ } } } COM: <s> removes an evaluation context for the given page and determines if </s>
funcom_train/33717566
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void moveAnchors(AxedChar src, AxedChar dst) { assert src.line.text.htmlText == this; if (src.anchors == null) { return; } while (src.anchors.first != null) { Anchor a = (Anchor) src.anchors.first; removeAnchor(a); dst.line.text.htmlText.addAnchor(a, dst, a.getText()); } } COM: <s> moves the anchors of this char to another char </s>
funcom_train/48982960
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String list() { // validates the update performValidationList(); logger.log("\n\nValidade list finished"); // if it has some error if (hasActionErrors()) { logger.log("\n\nError on list"); return "edit"; } // retrieves the discipline object setDiscipline(disciplineRemote.get(discipline.getId())); // retrieves the list of units setUnitList(unitRemote.getByDiscipline(discipline.getId())); return "list"; } COM: <s> list all unit </s>
funcom_train/26245442
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Planet getWorld(String name, int distance, PlanetType type) { Planet planet = new Planet(factory, name, star, distance, type); planet.setRadius(type.getRadius()/2 + Die.die(type.getRadius())); planet.setTemperature(star.getOrbitTemperature(distance)); setDayLength(planet, 1.0); return defineWorld(planet); } COM: <s> get a world of the specific type </s>
funcom_train/4684066
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setVirtualAddress(int virtualAddress) throws IOException { if (getFileDescriptor().getVirtualAddress() != 0) { throw new IllegalStateException("File already has a virtual address"); } if (virtualAddress == getFileDescriptor().getVirtualAddress()) return; getFlashManager().validateVirtualAddress(virtualAddress); getFileDescriptor().setVirtualAddress(virtualAddress); getFileDescriptor().setLastModifiedMillis(System.currentTimeMillis()); } COM: <s> set the virtual address that the file gets mapped to </s>
funcom_train/5783507
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addQoSContractType(String identifier) { QosContractRepository.QosContractType qosContractType = repository.addQoSContractType(identifier); if (qosContractType != null) { QoSContractTypeNode someNode = new QoSContractTypeNode(qosContractType, repository); add(someNode); nodeStructureChanged(this); } } COM: <s> add qo scontract type to the repository </s>
funcom_train/15513317
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String formatBytes( long bytes, Localizer localizer ) { final double KILO = 1024; if( bytes < KILO ) return bytes + " byte"; double reduced = bytes / KILO; if( reduced < KILO ) return localizer.localize(reduced, 1) + " kB"; reduced = reduced / KILO; if( reduced < KILO ) return localizer.localize(reduced, 1) + " MB"; reduced = reduced / KILO; return localizer.localize(reduced, 1) + " GB"; } COM: <s> formats bytes in a human readable form as k b mb or gb </s>
funcom_train/43766455
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int lastIndexOf(String content, String needle, int offset) { int index; while ((index = content.lastIndexOf(needle, offset)) != -1) { String text = getLine(content, index).trim(); if (text.startsWith(needle) || text.endsWith(needle)) { break; } else { offset = index - 1; } } return index; } COM: <s> assume the needle will the found at the start end of the line </s>
funcom_train/42333045
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getIp() { String ip = (String)this.ipAddrBox.getSelectedItem(); if(ip.contains(".")) { String [] parts = ip.split ("\\."); for (String s : parts) { try { int i = Integer.parseInt(s); if (i < 0 || i > 254) { ip = "-1"; break; } } catch (Exception e) { ip = "-1"; } }//for }//if(ip.contains(".") return ip; } COM: <s> use this method to validate ip address from combobox </s>
funcom_train/9235455
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void updateAwayState(final String message) { awayMessage = message; if (message == null) { for (AwayStateListener listener : listeners.get(AwayStateListener.class)) { listener.onBack(); } } else { for (AwayStateListener listener : listeners.get(AwayStateListener.class)) { listener.onAway(message); } } } COM: <s> updates our away state and fires the relevant listeners </s>
funcom_train/51341637
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: final public boolean scanTail(final int nscan, final T ref) { if (nscan <= 0) throw new IllegalArgumentException(); if (ref == null) throw new IllegalArgumentException(); for (int n = 0, i = tail; n < nscan; n++) { if (ref == refs[i]) return true; i = (i + 1) % capacity; // update index. } return false; } COM: <s> return true iff the reference is found in the first n positions scanning </s>
funcom_train/19566468
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public double getFastDataDistance(int pos, int pos2) { if (this.rang_dist == null) this.fillRangDist(); if (pos == pos2) { return 0; } IntArrayList temp = rang_dist.get(pos); int rank = 0; for (int i = 0; i < temp.size(); i++) { if (temp.get(i) == pos2) { rank = i + 1; i = temp.size(); } } return rank; } COM: <s> calculates data distance by using the precalculated data distances </s>
funcom_train/21040534
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void pingPeerAuth(String strPeerMacId) { try { objActionStatus = lookf.getPeerAMS(strPeerMacId).pingResponse( strPeerMacId); } catch (Exception e) { logger.EventPrint("Exception Raised in pingPeerAuth : " + e.toString()); // this.bindPeerAMS(peerMacId); } } COM: <s> this method pings the thismachine name which is specified in the </s>
funcom_train/9532496
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addButtonRow(List<JButton> buttons) { JPanel buttonPanel = new JPanel(); for (JButton b : buttons) buttonPanel.add(b); GridBagConstraints constraints = getConstraintsNewRow(); constraints.gridwidth = 5; constraints.gridx = 1; // scoot it over a little? fieldPanel.add(buttonPanel,constraints); } COM: <s> for comparison add a row of just buttons </s>
funcom_train/31104980
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setSourceDir(String sourceDir) { File dir = new File(sourceDir); if (!dir.exists()) { System.err.println("Fatal Error: source directory " + sourceDir + " for hyphenation files doesn't exist."); System.exit(1); } this.sourceDir = dir; } COM: <s> sets the source directory </s>
funcom_train/22020364
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void updateTablePopup() { MailMessage[] msgs = mailbox.getSelectedMessages(); if (msgs != null) { MailMessage msg = mailbox.getSelectedMessages()[0]; if (msg.hasAttachments()) { mi_table_save_attach.setEnabled(true); } else { mi_table_save_attach.setEnabled(false); } } } COM: <s> method to tailor table popup menu to selected message </s>
funcom_train/40413613
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void prepareElements(int count) { // New lines if too few for (int i = elements.size(); i < count; i++) { Element div = DOM.createDiv(); elements.add(div); DOM.appendChild(getElement(), div); DOM.setInnerHTML(div, "&nbsp;"); } // Remove some lines if too many while (elements.size() > count) { Element div = (Element) elements.get(0); elements.remove(div); DOM.removeChild(getElement(), div); } } COM: <s> recalculates elements collection </s>
funcom_train/7750539
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Map processEvent(MatchResult result) { Map map = new HashMap(); // group zero is the entire match - process all other groups for (int i = 1; i < result.groupCount() + 1; i++) { Object key = matchingKeywords.get(i - 1); Object value = result.group(i); map.put(key, value); } return map; } COM: <s> convert the match into a map </s>
funcom_train/1529189
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void initConic(GeoConic macroConic, GeoConic conic) { List<GeoPoint> macroPoints = macroConic.getPointsOnConic(); if (macroPoints == null) return; int size = macroPoints.size(); List<GeoPoint> points = newArrayListWithCapacity(size); for (int i=0; i < size; i++) { points.add((GeoPoint) getAlgoGeo(macroPoints.get(i))); } conic.setPointsOnConic(points); } COM: <s> makes sure that all points on conic are </s>
funcom_train/43590576
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JMenuItem getAboutMenuItem() { if (aboutMenuItem == null) { aboutMenuItem = new JMenuItem(); aboutMenuItem.setText("About"); aboutMenuItem.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { ZensesApplication.getApplication().getZenses().getViewHandler().showAboutWindow(); } }); } return aboutMenuItem; } COM: <s> this method initializes about menu item </s>
funcom_train/44162959
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected boolean moveButDontAttack(Direction direction) { final Unit unit = getUnit(); if (direction != null && unit != null && unit.getMoveType(direction).isProgress()) { AIMessage.askMove(aiUnit, direction); } return getUnit() != null && !getUnit().isDisposed(); } COM: <s> move in a specified direction but do not attack </s>
funcom_train/41740728
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void injectAttributes(BeanDefinition definition, Object beanInstance) { Dependency[] dependencies = definition .getDependencies(DependencyTarget.Attribute); Object[] resolved = this.resolveDependencies(dependencies); ObjectProxy<Object> bean = Reflect.on(beanInstance); for (int i = 0; i < resolved.length; i++) { String property = dependencies[i].getPropertyName(); bean.field(property).set(resolved[i]); } } COM: <s> inject the attribute dependencies to the bean </s>
funcom_train/25306215
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getFromClause() { // List<Structure> structures = res.getStructures(); SitoolsStructure structure = res.getDataSet().getStructure(); RequestSql request = RequestFactory.getRequest(db.getDsModel().getDriverClass()); return request.getFromClauseAdvanced(structure); } COM: <s> get the result from clause </s>
funcom_train/48400909
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void displayAll() { //Only displays some, but doesnt matter since its for debug anyway! System.out.print("DataMgr:"); if (_objs != null) { System.out.print("objs:" + _objs.length); } if (_cols != null) { System.out.print("cols;" + _cols.length); } }//End of display() COM: <s> print the contents of the buffers to the screen </s>
funcom_train/28293130
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getDelimiterIndex(String iName) { int index = -1; if (mDelimiters != null) { // Look at all available delimiters for (int i = 0; i < mDelimiters.size(); i++) { RequestDelimiter del = (RequestDelimiter) mDelimiters.elementAt(i); if (del.getName().equals(iName)) { index = i; break; } } } return index; } COM: <s> provides the index of a requested delimiter </s>
funcom_train/44710514
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void stateChanged(ChangeEvent e) { PageState s = e.getPageState(); if ( e.getSource() == m_categories ) { m_addLink.setSelected(s, false); m_editLink.setSelected(s, false); m_linkLink.setSelected(s, false); m_deleteLink.setSelected(s, false); } } COM: <s> if another category is selected sets the links to be </s>
funcom_train/26269936
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected String getMessage() throws Exception { HtmlTable table = null; try { table = (HtmlTable) getElementById("messages_table"); } catch (com.gargoylesoftware.htmlunit.ElementNotFoundException ex) { return ""; } if (table.getRowCount() == 0) return ""; return table.getCellAt(0, 0).asText().trim(); } COM: <s> the first message </s>
funcom_train/51472510
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void switchOptions() { switch (switchMode) { case (SWITCH_RENDERER): { isIdle = true; if (buffer.usesRenderer(IRenderer.RENDERER_OPENGL)) { keyMapper.destroy(); buffer.disableRenderer(IRenderer.RENDERER_OPENGL); buffer.enableRenderer(IRenderer.RENDERER_SOFTWARE, IRenderer.MODE_OPENGL); openGL = false; if (fullscreen) { device.setFullScreenWindow(null); } frame.setVisible(false); frame.dispose(); initializeFrame(); } else { frame.setVisible(false); buffer.enableRenderer(IRenderer.RENDERER_OPENGL, IRenderer.MODE_OPENGL); buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE); openGL = true; keyMapper.destroy(); keyMapper = new KeyMapper(); } isIdle = false; break; } } switchMode = 0; } COM: <s> this is for switching settings </s>
funcom_train/3607687
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void close() throws IOException { IOException exception = null; for (int i = 0, end = writers_.length; i < end; ++i) { try { writers_[i].close(); } catch (IOException e) { exception = e; } } if (exception != null) { throw exception; } } COM: <s> close the stream flushing it first </s>
funcom_train/38588792
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int compareRadioNone(final SheetCompareObject master, final SheetCompareObject slave) { log.info("Compare all."); int minRow = 1; // always start from 1 int maxRow = master.getSheet().getLastRowNum(); log.debug("Min Row=" + minRow + " Max Row=" + maxRow); return compareRange(master, slave, minRow, maxRow); } COM: <s> compare all rows </s>
funcom_train/45545649
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int getIndentationLevel() { int start= getStart(); IDocument document= getDocument(); try { IRegion region= document.getLineInformationOfOffset(start); String lineContent= document.get(region.getOffset(), region.getLength()); IPreferenceStore store = JSCPlugin.getDefault().getCombinedPreferenceStore(); int tabWith = store.getInt(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH); return Strings.computeIndent(lineContent, tabWith); } catch (BadLocationException e) { return 0; } } COM: <s> get the indentation level at the position of code completion </s>
funcom_train/2290538
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void update(CmsPublishJobInfoBean publishJob) throws CmsException { if (OpenCms.getMemoryMonitor().requiresPersistency()) { CmsDbContext dbc = m_publishEngine.getDbContextFactory().getDbContext(); try { m_publishEngine.getDriverManager().writePublishJob(dbc, publishJob); } finally { dbc.clear(); } } } COM: <s> updates the given job in the list </s>
funcom_train/32632181
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testFromCalendarGregorianDate() { Calendar base = Calendar.getInstance(); Calendar c1 = new GregorianDate(base.get(Calendar.YEAR), base.get(Calendar.MONTH), base.get(Calendar.DAY_OF_MONTH)); Calendar c2 = new GregorianDate(base); assertDate(c1); assertDate(c2); assertEquals(c1, c2); } COM: <s> tests equality of calendars creates with different constuctors </s>
funcom_train/37017191
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected ImageIcon createImageIcon(String path) { java.net.URL imgURL = WorkSpaceWizardOwner.ContentWizardEditor.class.getResource(path); if (imgURL != null) { return new ImageIcon(imgURL); } else { logger.error("Couldn't find file: " + path); return null; } } COM: <s> returns an image icon or null if the path was invalid </s>
funcom_train/9834984
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Wire addsub(Wire a, Wire b, Wire ci, Wire add) { Wire s = wire(a.getWidth(), name("sum")); return addsub_o(a, b, ci, add, s, (String) null); } COM: <s> constructs a new adder subtractor with no carry out and with a </s>
funcom_train/24524851
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private float getCellStartWidth(final HtmlCell cell) { TableStyleValues cellStyleValues = cell.getCellValues(); // colspan - 1, because one horBorderSpacing has been added to // paddingLeft for all cells. int spacingMultiplier = cell.getColspan() - 1; float spacing = spacingMultiplier * cellStyleValues.getHorBorderSpacing(); return spacing + cell.getPaddingLeft() + cell.getPaddingRight() + 1; } COM: <s> calculates the start width of a cell </s>
funcom_train/10801493
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ClassMetaData getMetaData(Class<?> cls, ClassLoader envLoader, boolean mustExist) { if (_locking) { synchronized(this){ return getMetaDataInternal(cls, envLoader, mustExist); } } else { return getMetaDataInternal(cls, envLoader, mustExist); } } COM: <s> return the metadata for the given class </s>
funcom_train/14306853
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String getFileExtension(String fileName) { int dotIndex = fileName.lastIndexOf('.'); if (dotIndex == -1 || dotIndex == fileName.length() - 1) return fileName; return fileName.substring(dotIndex + 1); } //}}} //{{{ -_replaceString(String, String, String)_ : String COM: <s> returns the files extension or the file name if no extension can be </s>
funcom_train/29606797
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void selectColor() { Context ctx = getModel(); GUI gui = getView(); Color color = gui.showColorDialog(ctx.getSelectedNode().getColor()); if (color != null) { ctx.getSelectedNode().setColor(color); } ctx.setSticky(true); gui.getViewConfiguration().runNow(); return; } COM: <s> lets the user select a color for the currently selected node </s>
funcom_train/42776046
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void setSnapDistance(int distance){ //Snap is off if(distance < 0){ snapCombo.setSelectedIndex(0); return; } //Distance is 1 if(distance == PPQ_RESOLUTION){ snapCombo.setSelectedIndex(snapCombo.getItemCount() - 1); return; } //Find matching snap distance for(int i=16; i>1; --i){ if( (PPQ_RESOLUTION / i) == distance){ snapCombo.setSelectedIndex(17-i); return; } } MsgHandler.error("Cannot find snap combo index for snap distance: " + distance); } COM: <s> sets the combo to the specified snap distance </s>
funcom_train/37246541
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void print(String className) throws IOException { //try to load class through the current resources InputStream is = new FileInputStream(className); if (is == null) { throw new IOException("Couldn't find resource for name:"+ className); } //load class through classDescriptor DataInputStream dis = new DataInputStream(is); ClassDescriptor descriptor = new ClassDescriptor(dis); dis.close(); } COM: <s> print the content of a class onto the standard output stream </s>
funcom_train/7966083
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testRepalcement_wrongNode() throws Exception { EvDecisionTreeIndividual<Integer> node = create_fake(); node.setNodeForAnswer(EvAnswer.NO, create_fake()); EvDecisionTreeIndividual<Integer> result = node.replace(create_fake(),create_fake()); assertEquals(node,result); assertNotSame(node,result); } COM: <s> ensure that replace will just clone should there be given </s>
funcom_train/26318685
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getProtomechsLeft(int playerId) { Player player = getPlayer(playerId); int remaining = 0; for (Entity entity : entities) { if (player.equals(entity.getOwner()) && entity.isSelectableThisTurn() && (entity instanceof Protomech)) { remaining++; } } return remaining; } COM: <s> returns the number of remaining selectable protomechs owned by a player </s>
funcom_train/9978063
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void removeInterceptor() { Struts2InterceptorRef ref = getSelectedInterceptor(); if (ref != null) { projectContext.getProject().fireChangeEvent(ProjectChangeListener.EventType.NodeWillChange, action); int index = modelObject.interceptors.indexOf(ref); modelObject.interceptors.remove(index); interceptorListField.remove(index); projectContext.getProject().fireChangeEvent(ProjectChangeListener.EventType.NodeChanged, action); } } COM: <s> remove currently edited selector </s>
funcom_train/3360789
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String toString() { StringBuffer answer = new StringBuffer(attrID + ": "); if (values.size() == 0) { answer.append("No values"); } else { boolean start = true; for (Enumeration e = values.elements(); e.hasMoreElements(); ) { if (!start) answer.append(", "); answer.append(e.nextElement()); start = false; } } return answer.toString(); } COM: <s> generates the string representation of this attribute </s>
funcom_train/9431900
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public CharSequence getDescription(Action action) { final CharSequence actionHeader = action.getHeader(); final ResolveInfo info = getEntry(action).bestResolve; if (!TextUtils.isEmpty(actionHeader)) { return actionHeader; } else if (info != null) { return info.loadLabel(mPackageManager); } else { return null; } } COM: <s> find the best description for the given </s>
funcom_train/49720361
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setTimer(Object timer_id, long time_ms) { if (state == STOPPED || state == STARTING) throw new IllegalStateException("TCP_UnicastAdapter: tried to set Timer when adapter was not running."); if (IP_Timer == null) throw new IllegalStateException("TCP_UnicastAdapter: tried to set Timer when Timer is null."); IP_Timer.setTimer(timer_id, time_ms); } COM: <s> set a code timer code event </s>
funcom_train/42990867
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int getVisibility(BaseEntity entry) { if (entry != null) { if (entry instanceof Request) { return BaseConst.ENTRY_VISIBILITY_PRIVATE; } else { try { Field field = entry.getClass().getDeclaredField( BaseConst.PERMISSION_FIELD_NAME); if (field != null) { return field.getInt(entry); } } catch (Exception e) { // not necessary to catch the exception if (logger.isDebugEnabled()) { logger.debug("the entry " + entry.getClass().getSimpleName() + " has no permission field."); } } } } return PERMISSION_INVALID_VALUE; } COM: <s> only some entries can be set access permissions </s>
funcom_train/3743834
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public StringBuffer getContent() throws IOException { byte[] buffer = new byte[1024]; int read = 0; StringBuffer content = new StringBuffer(); InputStream in = new FileInputStream(getFile()); while ((read = in.read(buffer, 0, 1024)) >= 0) { content.append(new String(buffer, 0, read)); } return content; } COM: <s> reads the uploaded file and stores its content into a string buffer o </s>
funcom_train/8091535
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isOnBorder(PointInt location) { if (location.getX() == 0) return true; else if (location.getX() == width() - 1) return true; if (location.getY() == 0) return true; else if (location.getY() == height() - 1) return true; else return false; } COM: <s> checks whether the given location is on the border of the grid </s>
funcom_train/15604865
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void registerEditorForType(Class type, Class editor, String editorName, String protocol, boolean defaultEditorForType) throws Exception { if (FacadeManager.isProtocolRegistered(protocol)) Browser.registerEditorForType(type,editor,editorName,defaultEditorForType); } COM: <s> register the editor for this type but only under the specified protocol </s>
funcom_train/36003199
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void processAnt() throws Exception { AbstractCixsGenerator.generateFile("Test generator", "vlc/build-jbossesb2cixs-xml.vm", "antModel", mAntModel, getParameters(), mAntModel.getTargetAntDir(), "generate.xml"); checkAnt(); runAnt(mAntModel.getTargetAntDir(), "generate.xml"); } COM: <s> generate the ant script check it and run it </s>
funcom_train/1115896
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JButton getSaveButton() { if (saveButton == null) { saveButton = new JButton(); ResourceHelper.setText(saveButton, "Save"); saveButton.setIcon(new ImageIcon(getClass().getResource( "/resource/Save16.gif"))); saveButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveButtonClicked(evt); } }); } return saveButton; } COM: <s> this method initializes save button </s>
funcom_train/40339256
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void provideFilters(ITableCellProvider tableCellProvider){ if (hasFilters()) { for (Iterator iter = filterMap.entrySet().iterator(); iter.hasNext();) { Entry entry = (Entry) iter.next(); Integer key = (Integer) entry.getKey(); tableCellProvider.provideData(FILTER_ROW_INDEX, key.intValue(), entry.getValue()); tableCellProvider.provideStyle(FILTER_ROW_INDEX, FILTER_ROW_STYLE); } } } COM: <s> this method is reponsible for the filter row creation </s>
funcom_train/27779720
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setLocation(String location) { /* * I would verify if we do not stay in the same location * and leave cache-s as they are, but if the files are changed * we can have obsolete handles, thus it is cleaner to * reinitialize this object. -g- */ cache.clear(); fcache.clear(); super.setLocation(location); } COM: <s> open the data structure in the given location which must exist </s>
funcom_train/7779322
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String addBit() throws Exception { String flag = ERROR; if (bit.getWorker().getId()==null) { bit.setWorker(null); } if (bit.getId() == null) { try { bitManager.createBit(bit); flag = SUCCESS; } catch (Exception e) { System.out.println("Bit with this number already exists"); addFieldError("bit.bitNo", "Bit with this number already exists"); flag = INPUT; } } else { bitManager.updateBit(bit); flag = SUCCESS; } return flag; } COM: <s> to add and update bit information </s>
funcom_train/51193324
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object getTransferData( DataFlavor df, DataSource ds ) throws IOException { // use myDF.equals to be sure to get ActivationDataFlavor.equals, // which properly ignores Content-Type parameters in comparison if ( getDF().equals( df ) ) { return Base64.encodeBase64( (byte[]) getContent( ds ) ); } else { return null; } } COM: <s> return the transfer data of type data flavor from input stream </s>
funcom_train/48587963
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public NicknameEntry retrieveNickname(String nickname) throws AppsForYourDomainException, ServiceException, IOException { LOGGER.log(Level.INFO, "Retrieving nickname '" + nickname + "'."); URL retrieveUrl = new URL(domainUrlBase + "nickname/" + SERVICE_VERSION + "/" + nickname); return nicknameService.getEntry(retrieveUrl, NicknameEntry.class); } COM: <s> retrieves a nickname </s>
funcom_train/24448802
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void compareMetadata(Documento bean, Map<String, Object> metadata) throws Throwable { Map<String, Object> beanFields = PropertyUtils.describe(bean); Iterator it = metadata.entrySet().iterator(); while (it.hasNext()) { Map.Entry pairs = (Map.Entry)it.next(); String key = (String) pairs.getKey(); Object value = pairs.getValue(); assertEquals(beanFields.get(key), value); } } COM: <s> checks a document metadata against a map </s>
funcom_train/3423391
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String getType(XMLResourceIdentifier resourceIdentifier) { if (resourceIdentifier instanceof XMLGrammarDescription) { XMLGrammarDescription desc = (XMLGrammarDescription) resourceIdentifier; if (XMLGrammarDescription.XML_SCHEMA.equals(desc.getGrammarType())) { return XSD_TYPE; } } return XML_TYPE; } // getType(XMLResourceIdentifier):String COM: <s> determines the type of resource being resolved </s>
funcom_train/19408739
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void cmdWrite(String filename) throws NoSystemException { MSystem system = system(); PrintWriter out = null; try { if (filename == null) out = new PrintWriter(System.out); else { out = new PrintWriter(new BufferedWriter(new FileWriter( filename))); } out .println("-- Script generated by USE " + Options.RELEASE_VERSION); out.println(); system.writeUSEcmds(out); } catch (IOException ex) { Log.error(ex.getMessage()); } finally { if (out != null) { out.flush(); if (filename != null) out.close(); } } } COM: <s> prints commands executed so far </s>
funcom_train/46843551
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public PluginProperty getPluginProperty(String propertyName) { if (m_pluginProperties == null) { m_pluginProperties = new TreeMap<String, PluginProperty>(); } PluginProperty pluginProperty = m_pluginProperties.get(propertyName); if (pluginProperty == null) { if (m_baseElement != null) { pluginProperty = m_baseElement.getPluginProperty(propertyName); } } return pluginProperty; } COM: <s> returns property set by plugins </s>
funcom_train/9658908
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected CloudAdapter(MindMapNode target,FreeMindMain frame, String standardColorPropertyString, String standardStylePropertyString) { super(target, frame, standardColorPropertyString, standardStylePropertyString); NORMAL_WIDTH = 3; iterativeLevel = -1; if(listener == null) { listener = new LineAdapterListener(); Controller.addPropertyChangeListener(listener); } } COM: <s> for derived classes </s>
funcom_train/35646008
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void removeAllFrameOnTopOf(Frame frame) { synchronized (mutex) { LinkedFrame newTopLinkedFrame = getLinkedFrame(frame); if (newTopLinkedFrame != null) { LinkedFrame tmpLinkedFrame; for (LinkedFrame linkedFrame = newTopLinkedFrame.next; linkedFrame != null;) { tmpLinkedFrame = linkedFrame.next; internalLinkedFrameRemoveProcess(linkedFrame); linkedFrame = tmpLinkedFrame; } } } } COM: <s> remove all frames on top of the given code frame code </s>
funcom_train/51298631
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void getSpecificationForEdit(SpecificationSupplierPriceList sp) { tfName.set(sp.getGoods()); tfBarCode.setText("" + sp.getGoods().getBarcode()); tfCurrPrice.setText("" + sp.getSupplierPrice()); tfDiscount.setText("" + sp.getDiscount()); setIdEdit(sp.getId()); setEdit(true); } COM: <s> fill specs fields with specification supplier price list object data for </s>
funcom_train/17281350
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean accept(File f) { if(f != null) { // If there are no filters, always accept if (filters.size()==0) { return true; } if(f.isDirectory()) { return true; } String extension = getExtension(f); if(extension != null && filters.get(getExtension(f)) != null) { return true; }; } return false; } COM: <s> return true if this file should be shown in the directory pane </s>
funcom_train/31648522
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void reloadCombos(Iterator combos, Iterator mapEntry) { while (mapEntry.hasNext()) { Map.Entry element = (Map.Entry) mapEntry.next(); Combo combo = (Combo) combos.next(); String name = (String) element.getKey(); if (combo.indexOf(name) == -1) { combo.add(name); } combo.select(combo.indexOf(name)); logger.info("reloadingCombos: " + name); } } COM: <s> selects the combos </s>
funcom_train/9987720
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public AclEntry addAclRole(AclRole role, AclScope scope, String resourceId) throws Exception { if (role == null || scope == null || resourceId == null) { throw new DocumentListException("null passed in for required parameters"); } AclEntry entry = new AclEntry(); entry.setRole(role); entry.setScope(scope); URL url = buildUrl(URL_DEFAULT + URL_DOCLIST_FEED + "/" + resourceId + URL_ACL); return service.insert(url, entry); } COM: <s> add an acl role to an object </s>
funcom_train/28339463
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean checkSymmetry(CorrelationMatrix matCorr) { int i,j; //loop control variables for (i=0; i<7; i++) for (j=i+1; j<7; j++) { if (matCorr.getElem(i,j) != matCorr.getElem(j,i) ) return false; } return true; } COM: <s> check matrix for symmetry </s>
funcom_train/43093925
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object getMethod(String name) { for (Iterator i = obsoleteFeatures.iterator(); i.hasNext();) { Object mFeature = i.next(); if (Model.getFacade().isAMethod(mFeature) && name.equals(Model.getFacade().getName(mFeature))) { return mFeature; } } return null; } COM: <s> get a method from the current classifier not yet modeled </s>
funcom_train/13542007
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private ZipEntry createZipEntry(String name, byte bytes[], int method) { ZipEntry ze = new ZipEntry(name); ze.setMethod(method); ze.setSize(bytes.length); CRC32 crc = new CRC32(); crc.reset(); crc.update(bytes); ze.setCrc(crc.getValue()); ze.setTime(System.currentTimeMillis()); return ze; } COM: <s> creates a code zip entry code object based on the given params </s>
funcom_train/48357280
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private SensornetIncrementalAggregationOperator getIterate() throws CodeGenerationException { SensornetOperator input = op.getLeftChild(); while (input instanceof SensornetExchangeOperator) { input = input.getLeftChild(); } try { if (input instanceof SensornetAggrMergeOperator) { return (SensornetAggrMergeOperator) input; } else { return (SensornetAggrInitOperator) input; } } catch (Exception e) { throw new CodeGenerationException(e); } } COM: <s> retrieves the middle aggregate operator </s>
funcom_train/42012847
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JPanel getPanelSalir() { if (panelSalir == null) { panelSalir = new JPanel(); panelSalir.setLayout(new BoxLayout(getPanelSalir(), BoxLayout.X_AXIS)); panelSalir.setPreferredSize(new Dimension(371, 100)); panelSalir.add(getBotonSalir(), null); panelSalir.add(getScrollEstado(), null); } return panelSalir; } COM: <s> this method initializes panel salir </s>
funcom_train/43327897
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void drawMinorTic(Graphics g, Rectangle r, double y) { int pos = (int)(((y - min) / (max - min)) * (double)r.height); if (flipped) pos = r.height - pos; pos += r.y; g.drawLine(r.x+1,pos, r.x+2, pos); g.drawLine(r.x+r.width-1, pos, r.x+r.width-2, pos); } COM: <s> draw a minor tic at a given y position </s>
funcom_train/43523491
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testBug12104() throws Exception { if (versionMeetsMinimum(4, 1)) { createTable("testBug12104", "(field1 GEOMETRY)"); try { this.stmt.executeUpdate("INSERT INTO testBug12104 VALUES (GeomFromText('POINT(1 1)'))"); this.pstmt = this.conn.prepareStatement("SELECT field1 FROM testBug12104"); this.rs = this.pstmt.executeQuery(); assertTrue(this.rs.next()); System.out.println(this.rs.getObject(1)); } finally { } } } COM: <s> tests fix for bug 12104 geometry types not handled with </s>
funcom_train/10375840
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void toXML(OutputStream outputStream) throws IOException { List parents = new ArrayList(); clearNulls(parents); try { super.toXML(outputStream); } finally { for (int i = 0; i < parents.size(); i++) { Object parent = parents.get(i); ConfigHolder instance = (ConfigHolder) parent; instance.reconfigure(); } } } COM: <s> a little trickery on a save event temporarily remove any config property setting </s>
funcom_train/13258521
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void initData(Distribution initial) { this.initial = initial; this.target = initial; if (initial != null) { this.current = initial.clone(); } else { this.current = new Exponential(); // Default distribution if nothing // is selected } // If distributions is not already set, sets it! if (distributions == null) { distributions = findDistributions(); } if (allowedNestedDistributions == null && recursive) { allowedNestedDistributions = findNestedDistributions(); } } COM: <s> initialize this dialog data structures </s>
funcom_train/48365250
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Event calculateChanges(RequestContext context) throws Exception { DeleteHostUICmd cmd = (DeleteHostUICmd) getFormObject(context); log.trace("computing changes for host"); BaseCompositeCommand result = commandDispatcherRegistry .expandCommand(cmd); MutableAttributeMap requestScope = context.getRequestScope(); requestScope.put("changeResult", result); log.trace("got changes" + result); return success(); } COM: <s> calculates the change set for this action and fills the changes into the </s>
funcom_train/40684606
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testASimpleMotionChart() { loadApi(new Runnable() { public void run() { DataTable data = createDataTable(); MotionChart.Options options = MotionChart.Options.create(); options.setSize(600, 200); RootPanel.get().add(new MotionChart(data, options)); } }, true, MOTION_CHART_ASYNC_DELAY_MS); } COM: <s> this test case will try creating a simple motion chart </s>
funcom_train/25074406
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean accept(File aDirectory, String aFilename) { boolean isFileOK = true; if (name != null) { isFileOK &= aFilename.startsWith(name); } if (extensions != null) { boolean matched = false; for(String extension:extensions){ if(aFilename.toUpperCase().endsWith(new String('.' + extension).toUpperCase()))matched = true; } isFileOK &= matched; } return isFileOK; } COM: <s> todo franzi tobi is param a directory necessary information </s>
funcom_train/41762797
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void load() { Context C = MeemiDroidApplication.getContext(); // Use MODE_WORLD_READABLE and/or MODE_WORLD_WRITEABLE to grant access to other applications SharedPreferences P = C.getSharedPreferences(MEEMI_CREDENTIALS_PREFS, Context.MODE_PRIVATE); UserName = P.getString(MEEMI_USERNAME, ""); Password = P.getString(MEEMI_PASSWORD, ""); HashedPassword = P.getString(MEEMI_HASHED_PASSWORD, ""); } COM: <s> this method retrieves the current credentials from the shared preferences </s>
funcom_train/51556764
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setSpringconfigLocation(final String location) { String newLocation = location; if (newLocation.startsWith("\\")) { newLocation = newLocation.substring(1); } if (!location.startsWith("/")) { newLocation = "/" + newLocation; } this.springconfigLocation = newLocation; } COM: <s> set the springconfig location </s>
funcom_train/27793362
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addCurrentTokenToParseTree() throws TokenStreamException { if (inputState.guessing>0) { return; } ParseTreeRule root = (ParseTreeRule)currentParseTreeRoot.peek(); ParseTreeToken tokenNode = null; if ( LA(1)==Token.EOF_TYPE ) { tokenNode = new ParseTreeToken(new antlr.CommonToken("EOF")); } else { tokenNode = new ParseTreeToken(LT(1)); } root.addChild(tokenNode); } COM: <s> this adds lt 1 to the current parse subtree </s>
funcom_train/31683160
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Date getCheckinDate() { Date date = null; PropertyValue prop = getProp("DAV:checkin-date"); if (prop != null) { Text pcdata = (Text) prop.value.getFirstChild(); if (pcdata != null) { String dateString = pcdata.getData(); try { date = (new SimpleISO8601DateFormat()).parse(dateString); } catch (ParseException exc) { System.err.println("Invalid date format for creationdate in " + getResource()); } } } return date; } COM: <s> the date the resource revision was checked in </s>
funcom_train/43288743
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addModelPart(final String id, final ModelPart modelPart) { synchronized (modelParts) { modelParts.put(modelPart, id); getChildren().add(modelPart); } final ModelEvent event = new ModelEvent(ModelEvent.E_ADDED, this, modelPart); modelPart.get_RootPart().addModelListener(this); notifyModelListeners(event); } COM: <s> add a model part </s>