__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/3320422
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String wrap4csv(String str) { // convert " to \" in str StringBuffer sb = new StringBuffer(); for(int i=0; i<str.length(); i++) { if (str.charAt(i)=='\"') { sb.append("\\"); sb.append("\""); sb.append("\\"); } else { sb.append(str.charAt(i)); } } return "\""+ sb.toString() +"\""; } COM: <s> convert str to str </s>
funcom_train/45813828
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void verifyQuery(String query) throws InvalidQueryException { // verify that we do not get any parse or query errors QueryResultIF result = processor.execute(query); try { assertTrue(result.next()); assertEquals(0, result.getWidth()); assertFalse(result.next()); } finally { result.close(); } } COM: <s> tests whether the given query returns a single row with no columns </s>
funcom_train/16603536
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void setKerning(int first, int second, int value) { HashMap secondMap = (HashMap) kerning.get(new Integer(first)); if (secondMap == null) { secondMap = new HashMap(); kerning.put(new Integer(first), secondMap); } secondMap.put(new Integer(second), new Integer(value)); } COM: <s> get kerning information for a particular character pair </s>
funcom_train/46737988
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setLocationRef(DisplayModel locationRef) { if (Converter.isDifferent(this.locationRef, locationRef)) { DisplayModel oldlocationRef= new DisplayModel(this); oldlocationRef.copyAllFrom(this.locationRef); this.locationRef.copyAllFrom(locationRef); setModified("locationRef"); firePropertyChange(String.valueOf(PERMISSIONS_LOCATIONREFID), oldlocationRef, locationRef); } } COM: <s> location permission applies to </s>
funcom_train/39887353
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean equals(Object object) { if (object == this) { return true; } if (!(object instanceof RuleBasedCollator)) { return false; } RuleBasedCollator rhs = (RuleBasedCollator) object; return getRules().equals(rhs.getRules()) && getStrength() == rhs.getStrength() && getDecomposition() == rhs.getDecomposition(); } COM: <s> checks if argument object is equals to this object </s>
funcom_train/36767079
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean addAll(Collection c) { boolean ret = super.addAll(c); Iterator it = c.iterator(); while( it.hasNext() ) { AbstractQueryImpl q = (AbstractQueryImpl)it.next(); this.element.appendChild(q.getElement()); } return ret; } COM: <s> adds query data objects from another collection </s>
funcom_train/48406361
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addLinkedActivityPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ProcessPerformer_linkedActivity_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ProcessPerformer_linkedActivity_feature", "_UI_ProcessPerformer_type"), SpemxtcompletePackage.eINSTANCE.getProcessPerformer_LinkedActivity(), true, false, true, null, null, null)); } COM: <s> this adds a property descriptor for the linked activity feature </s>
funcom_train/18837234
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String listDirectory(String path, boolean recursive) { StringBuffer listing = new StringBuffer(); File directory = new File(path); File[] files = directory.isDirectory() ? directory.listFiles() : directory.getParentFile().listFiles(); if(files != null) { for(int i=0; i < files.length; i++) { listing.append(files[i].isDirectory()).append(";"); listing.append(files[i]).append(";"); listing.append(files[i].length()); listing.append("\n"); } } return listing.toString(); } COM: <s> lists the content of directory </s>
funcom_train/44158102
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testCycleError() { LinkedObject a = new LinkedObject("a"); LinkedObject b = new LinkedObject("b"); LinkedObject c = new LinkedObject("c:red"); a.addAncestor(c); b.addAncestor(a); c.addAncestor(b); m_processor.expect( new Notification("markRed", "LinkedObject a"), new Notification("markRed", "LinkedObject b"), new Notification("visit", "LinkedObject c:red") ); m_walker.run(a); m_processor.validateAnyOrder(); } COM: <s> test a non tree graph with an error </s>
funcom_train/21990186
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void loadKeys() { log.debug("Loading access keys"); NodeList keys = configDoc.getElementsByTagName("Key"); for (int i = 0; i < keys.getLength(); i++) { Element key = (Element) keys.item(i); keySet.add(key.getTextContent()); } log.debug("Access keys loaded"); } COM: <s> load the access keys from the config xml document </s>
funcom_train/22606949
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Reference referenceFromURL(URL url) { CachedResource cr; for (Enumeration enum = cachedResources(); enum.hasMoreElements();) { cr = (CachedResource) enum.nextElement(); if (url.equals(cr.getReference().getURL())) { return cr.getReference(); } } return new Reference(url); } COM: <s> returns the reference to a url from the specified url object </s>
funcom_train/18040205
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ArrayList getResult() { result = new ArrayList(); result.add("Plugin: Jython " + PySystemState.version); result.add("Expression: "+ msg); if(!(pyresult==null))result.add("Result: "+ pyresult.toString()); else result.add("Result: null"); result.add("Number of Steps: Not Yet Implemented."); return result; } COM: <s> build the result array list needed by the evaluation view </s>
funcom_train/26492582
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String escapeSpaces(String s) { while (s.indexOf(" ")!=-1) { int i = s.indexOf(" "); s = s.substring(0, i) + "_" + s.substring(i+1, s.length()); } return s; } COM: <s> replace all spaces with </s>
funcom_train/50067281
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Command getExitCommand1() { if (exitCommand1 == null) {//GEN-END:|199-getter|0|199-preInit // write pre-init user code here exitCommand1 = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|199-getter|1|199-postInit // write post-init user code here }//GEN-BEGIN:|199-getter|2| return exitCommand1; } COM: <s> returns an initiliazed instance of exit command1 component </s>
funcom_train/18112191
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JButton getToolCollapseAllButton() { if (toolCollapseAllButton == null) { toolCollapseAllButton = new JButton(); toolCollapseAllButton.setIcon(new ImageIcon(getClass().getResource("/icons/collapseall.gif"))); toolCollapseAllButton.setPreferredSize(new java.awt.Dimension(20,20)); toolCollapseAllButton.setToolTipText("Collapse All"); toolCollapseAllButton.setDisabledIcon(new ImageIcon(getClass().getResource("/icons/collapseall_disabled.gif"))); toolCollapseAllButton.addActionListener(this); } return toolCollapseAllButton; } COM: <s> this method initializes tool collapse all button </s>
funcom_train/26645724
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public MacroItems getFrameMacroItems(int posn) { if( posn < 1 || posn>getNumberOfFrames() ) throw new IllegalArgumentException("A position between 1 and the number of frames must be requested."); if( frameItems[posn-1]==null ) frameItems[posn-1] = new MacroItems(); return frameItems[posn-1]; } COM: <s> gets the image frame macro item </s>
funcom_train/36604289
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void preorderHelper(TreeNode node) { if (node == null) { return; } System.out.printf("%d ", node.data); // output data preorderHelper(node.leftNode); // left traversal preorderHelper(node.rightNode); // right traversal } // end method preorderHelper COM: <s> conduct a recursive sequential traversal of our tree </s>
funcom_train/10284187
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setInitialKey(TagContent key) throws TagFormatException { if (key.getTextContent() == null || !checkMaxLength(key.getTextContent(), 3)) { throw new TagFormatException(); } (new TextFrameEncoding(id3v2, "TKEY", key, use_compression)).write(); } COM: <s> set initial key read from text content </s>
funcom_train/31295964
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void restart() { if ((Dialogic.debug & Dialogic.DEBUG_ISDN) != 0) System.out.println(new java.util.Date().toString().substring(11,19) +": Restart " + this); Dialogic.cc_Restart(device, Dialogic.EV_ASYNC); } COM: <s> restart bring firmware to state 0 any call to null state </s>
funcom_train/18656847
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void doActivateFrame(ActionEvent e){ try{ WindowsMenuItem SelectedItem=(WindowsMenuItem)e.getSource(); JInternalFrame SelectedFrame=SelectedItem.getTarget(); if(SelectedFrame.isIcon()==true) SelectedFrame.setIcon(false); SelectedFrame.setSelected(true); }catch(Exception e1){} return; } COM: <s> event handler for windows menu </s>
funcom_train/45255845
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void saveTreeSelection() { IStructuredSelection selection = (IStructuredSelection) tree .getViewer().getSelection(); Object element = selection.getFirstElement(); StringBuffer buffer = new StringBuffer(); appendMarkerToBuffer(buffer, element); if (buffer.length() > 0) { buffer.append(((IThemeElementDefinition) element).getId()); } getPreferenceStore().setValue(SELECTED_ELEMENT_PREF, buffer.toString()); } COM: <s> save the selection state of the tree </s>
funcom_train/8036590
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String concatFiles(final List inFilesList, final int prefixMode, final String prefix) { if (inFilesList == null) { return StringUtil.EMPTY; } return concatFiles((File [])inFilesList.toArray(new File [inFilesList.size()]), prefixMode, prefix); } COM: <s> routine concat files </s>
funcom_train/18032133
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void initRootNode(Connection jdbc) { PreparedStatement statement = null; try { statement = jdbc.prepareStatement(IStatement.SELECT_AVAILABLE_YEARS); ResultSet rs = statement.executeQuery(); while (rs.next()) { CalendarTreeNode subnode = new CalendarTreeNode( m_model, new Long(rs.getLong("YEAR")), //$NON-NLS-1$ Type.YEAR); add(subnode); m_children.add(subnode); } } catch (SQLException e) { LOG.log(Level.SEVERE, "Failed to init root node", //$NON-NLS-1$ e); } finally { try { statement.close(); } catch (Throwable t) { // Nothing to do } } } COM: <s> initializes this node if this is the root node </s>
funcom_train/8078673
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setDefaultOptions() { m_MinInstNum = 1; m_MaxInstNum = 50; m_MinRadius = 0.1; m_MaxRadius = Math.sqrt(2.0); m_Pattern = RANDOM; m_DistMult = 4; m_NumCycles = 4; m_InputOrder = RANDOMIZED; m_NoiseRate = 0.0; m_Seed = 1; } COM: <s> sets all options to their default values </s>
funcom_train/4527408
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testChooseRandomExcludedNode() { String scope = "~" + NodeBase.getPath(dataNodes[0]); Map<Node, Integer> frequency = pickNodesAtRandom(100, scope); for (Node key : dataNodes) { // all nodes except the first should be more than zero assertTrue(frequency.get(key) > 0 || key == dataNodes[0]); } } COM: <s> this test checks that choose random works for an excluded node </s>
funcom_train/9965151
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public double getCCNForProject( ProjectData projectData) { // Sum complexity for all packages Complexity act = new Complexity(); for( Iterator it = projectData.getPackages().iterator(); it.hasNext();) { PackageData packageData = (PackageData)it.next(); act.add( getCCNForPackageInternal( packageData)); } // Return average CCN for source files return act.averageCCN(); } COM: <s> computes ccn for all sources contained in the project </s>
funcom_train/17951961
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean contains(Article article) { DbIntList tmpChildCats = env.getDbChildArticles().retrieve(id) ; if (tmpChildCats == null || tmpChildCats.getValues() == null) return false ; return Collections.binarySearch(tmpChildCats.getValues(), article.getId()) >= 0 ; } COM: <s> returns true if the argument </s>
funcom_train/51648335
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object nativeToJava(TransferData transferData){ if (!isSupportedType(transferData) || transferData.data == null) return null; if (transferData.data.length == 0 || transferData.data[0].length == 0) return null; byte[] buffer = transferData.data[0]; char[] chars = new char[(buffer.length + 1) / 2]; OS.memcpy(chars, buffer, buffer.length); return new String(chars); } COM: <s> this implementation of code native to java code converts a platform specific </s>
funcom_train/2332235
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setSize(int newSize) { if (newSize < 0) throw new IndexOutOfBoundsException("newSize:" + newSize); int currentSize = size(); if (newSize != currentSize) { if (newSize > currentSize) beforeInsertDummies(currentSize, newSize - currentSize); else if (newSize < currentSize) removeFromTo(newSize, currentSize - 1); } } COM: <s> sets the size of the receiver </s>
funcom_train/22397536
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void validateThrowable(Throwable t) { boolean throwableOk = false; if ((t instanceof RuntimeException) || (t instanceof Error)) { throwableOk = true; } Class tClass = t.getClass(); for (int i = 0; i < this.throwableClasses.length; i++) { Class th = this.throwableClasses[i]; if (th.isAssignableFrom(tClass)) { throwableOk = true; } } if (!throwableOk) { throw new HammockException(this, INCORRECT_THROWABLE_CLASS); } } COM: <s> this method checks that an exception can be thrown by this method </s>
funcom_train/23872849
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object visit(TupleLiteralExp host, Object data) { String result = "Tuple {"; //--- add all properties --- Iterator i = host.getTuplePart().iterator(); while (i.hasNext()) { VariableDeclaration var = (VariableDeclaration) i.next(); result += (String)var.accept(this, data); if (i.hasNext()) result+=", "; } result+="}"; return result; } COM: <s> visit class tuple literal exp </s>
funcom_train/5376569
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void run() { try { while (true) { Queued item = getNextEvent(); if (item == null) { return; } EventManager.dispatchEvent(item.listeners, item.dispatcher, item.action, item.object); } } catch (RuntimeException e) { if (EventManager.DEBUG) { e.printStackTrace(); } throw e; } catch (Error e) { if (EventManager.DEBUG) { e.printStackTrace(); } throw e; } } COM: <s> this method pulls events from </s>
funcom_train/34353179
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void printClassTree() { TaxonomyPrinter printer = new TreeTaxonomyPrinter(); Writer writer = new StringWriter(); OutputFormatter out = new OutputFormatter(writer, false); printer.print(kb.getTaxonomy(), out); tempMessages.append("Building class tree:\n"); tempMessages.append(writer.toString()); } COM: <s> print the class tree to temp messages </s>
funcom_train/22552504
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testUDPPushFailover() throws Exception { requestPush(rfd1); try { serversocket.accept(); fail("tcp attempt was made"); }catch(IOException expected){} DatagramPacket push = new DatagramPacket(new byte[1000],1000); udpsocket.receive(push); ByteArrayInputStream bais = new ByteArrayInputStream(push.getData()); PushRequest pr = (PushRequest)MessageFactory.read(bais); assertEquals(rfd1.getIndex(),pr.getIndex()); Thread.sleep(5200); Socket s = serversocket.accept(); assertTrue(s.isConnected());s.close(); } COM: <s> tests the scenario where an udp push is sent but no </s>
funcom_train/12177626
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String stripLastPathComponent(String url) { // Get the index of the last /, if it comes before the start of the // path then this has reached the root of the path and therefore // must return null to indicate that. int index = url.lastIndexOf("/"); if (index < pathStart) { url = null; } else { url = url.substring(0, index); } return url; } COM: <s> strip the last path component and preceding from the input url </s>
funcom_train/50428200
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void subtract(BBNCPF cpt) { for (Enumeration e = cpf.keys(); e.hasMoreElements(); ) { Hashtable q = (Hashtable) e.nextElement(); BBNPDF pdf = (BBNPDF) cpf.get(q); pdf.subtract(new BBNConstant(cpt.get(q))); } } COM: <s> subtraction with another cpt </s>
funcom_train/17202734
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Register getSecondReg(Register reg) { Register otherHalf = _regPairs.get(reg); if (otherHalf == null) { otherHalf = getReg(reg); _regPairs.put(reg, otherHalf); if (reg.isLocal()) otherHalf.setLocal(); if (reg.isSSA()) otherHalf.setSSA(); } return otherHalf; } COM: <s> mir get the other half of the register pair that is </s>
funcom_train/51345189
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void showTestLoadingResults() { KbSpecification kb; System.out.println(); for (int i = 0; i < kbList_.size(); i++) { kb = (KbSpecification)kbList_.get(i); System.out.println("\t" + kb.id_ + "\t" + kb.duration + " seconds"); } } COM: <s> displays the loading test results </s>
funcom_train/7230885
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Node getNode(int index) throws NodeDoesNotExistException{ Node ndReturn = (Node)mvecNodes.get(index); if (ndReturn == null){ throw new NodeDoesNotExistException("The NodeList does not contain a Node at index: " + index + "."); } return ndReturn; } COM: <s> returns a node based on its index value </s>
funcom_train/776295
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void setAttribute(String attributeName, String aValue){ if(serverElement != null){ if ( aValue == null || aValue.length() == 0 ) { // remove attributes if they are not set serverElement.removeAttribute( attributeName ); }else { serverElement.setAttribute( attributeName, aValue ); } } } COM: <s> updates the sever element with the specified attribute and value </s>
funcom_train/27903852
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void evalExpression(Node node) { String value = node.getValue(); if(value.equals("expression")) { Node simpleExpression = node.getChild("simpleExpression"); Node optRelation = node.getChild("optRelation"); evalSimpleExpression(simpleExpression); evalOptRelation(optRelation); } else { syntaxError(node,"evalExpression()"); } } COM: <s> evaluates an expression </s>
funcom_train/5724825
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof MyUniDepartmentInfo)) { return false; } final MyUniDepartmentInfo that = (MyUniDepartmentInfo) object; if (this.id == null || that.getId() == null || !this.id.equals(that.getId())) { return false; } return true; } COM: <s> returns code true code if the argument is an my uni department info </s>
funcom_train/46660040
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void calculateNewSize(int width, int height) { int xscale = width / vic.getBorderWidth(); int yscale = height / vic.getBorderHeight(); scale = Math.max(Math.min(xscale, yscale), 1); setSize(new Dimension(vic.getBorderWidth() * scale, vic.getBorderHeight() * scale)); setPreferredSize(new Dimension(vic.getBorderWidth() * scale, vic.getBorderHeight() * scale)); } COM: <s> use the largest integer fraction that will just fill this area </s>
funcom_train/26626514
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void initialize(ActivityCallback ac) { if (fam == null) { // throw a runtime exception. We cannot call this method because // we really do need a FileAccessManager throw new UnsupportedOperationException("initialize"+ "(ActivityCallback) cannot be called before "+ "initFileAccessManager is called"); } else { initActivityCallback(ac); } } COM: <s> this method cannot be called before init file access manager is called </s>
funcom_train/5421109
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public URL getDoublet(final String name, final int nr) { Enumeration<URL> resources = getResources(name); for (int i = 0; resources.hasMoreElements(); i++) { URL url = resources.nextElement(); if (i == nr) { return url; } } return null; } COM: <s> gets the doublet </s>
funcom_train/42916910
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Command getHelpCommand2() { if (helpCommand2 == null) {//GEN-END:|53-getter|0|53-preInit // write pre-init user code here helpCommand2 = new Command("Help", Command.HELP, 0);//GEN-LINE:|53-getter|1|53-postInit // write post-init user code here }//GEN-BEGIN:|53-getter|2| return helpCommand2; } COM: <s> returns an initiliazed instance of help command2 component </s>
funcom_train/4929843
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void removeBlanks( List<?> values ) { if ( values == null ) return; Iterator<?> i = values.iterator(); while ( i.hasNext() ) { Object value = i.next(); if ( value == null || "".equals( value ) ) i.remove(); } } COM: <s> removes any blank string values from the list </s>
funcom_train/5724836
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof MyUniUniversityInfo)) { return false; } final MyUniUniversityInfo that = (MyUniUniversityInfo) object; if (this.id == null || that.getId() == null || !this.id.equals(that.getId())) { return false; } return true; } COM: <s> returns code true code if the argument is an my uni university info </s>
funcom_train/5711985
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void writeExternal(ObjectOutput out) throws IOException { out.writeInt(resolutionHorizontal); out.writeInt(resolutionVertical); out.writeInt(coding); out.writeInt(lineLength); out.writeInt(pageLength); out.writeInt(imageWidth); out.writeObject(rawMHData); } COM: <s> write the data of this instance to the given stream </s>
funcom_train/33532803
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected ImageIcon createImageIcon(String path, String description) { java.net.URL imgURL = getClass().getClassLoader().getResource(path); if (imgURL != null) { return new ImageIcon(imgURL, description); } else { System.err.println("Couldn't find file: " + path); return null; } } COM: <s> returns an image icon or null if the path was invalid </s>
funcom_train/37790456
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void setUp() { LookAndFeel.installColorsAndFont(this, "ToolTip.background", "ToolTip.foreground", "ToolTip.font"); setOpaque(true); Border b = BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(getForeground()), BorderFactory.createEmptyBorder(1, 4, 1, 4)); setBorder(b); } COM: <s> setup the label </s>
funcom_train/976982
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private double getDist(String doc) { inRex = new Regex(p.getProp("distRex")); inRex.search(doc); if (doc.indexOf("Here") >= 0) return (0); if (!inRex.didMatch()) return 0; if (MyLocale.getDigSeparator().equals(",")) return Convert.toDouble(inRex.stringMatched(1).replace('.', ',')); return Convert.toDouble(inRex.stringMatched(1)); } COM: <s> get the distance to the centre </s>
funcom_train/3362234
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public RoleList retrieveAllRoles() { RELATION_LOGGER.entering(RelationSupport.class.getName(), "retrieveAllRoles"); RoleList result; synchronized(myRoleName2ValueMap) { result = new RoleList(new ArrayList<Role>(myRoleName2ValueMap.values())); } RELATION_LOGGER.exiting(RelationSupport.class.getName(), "retrieveAllRoles"); return result; } COM: <s> returns all roles in the relation without checking read mode </s>
funcom_train/23271532
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setSourceFont(Font font) { if (font == null) { throw new IllegalArgumentException("Null 'font' argument."); } Font old = this.sourceSubtitle.getFont(); this.sourceSubtitle.setFont(font); firePropertyChange("sourceFont", old, font); } COM: <s> sets the font for the charts source subtitle and sends a </s>
funcom_train/37769305
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setUsePreparedStatements(boolean usePreparedStatements) { if (table == null) { String errorMsg = "JDBCAppender::setUsePreparedStatements(), Table-Option has to be set before !"; LogLog.error(errorMsg); errorHandler.error(errorMsg, null, 0); return; } this.usePreparedStatements = usePreparedStatements; } COM: <s> defines whether to use prepared statements instead of updateable result </s>
funcom_train/45770416
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setCellFormat(int row, int column, Format fmt) { Debug.log(Debug.TRACE,"bold : " + fmt.getAttribute(Format.BOLD) + ",Italic : " + fmt.getAttribute(Format.ITALIC) + ",Underline : " + fmt.getAttribute(Format.UNDERLINE)); } COM: <s> set a cells formatting options via a separately create </s>
funcom_train/10955075
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Element getRootElement() { if (rootElement != null) return rootElement; Node node = getAdapterFactory().adaptNode( this, getPropertyName(), getPropertyValue()); if (node instanceof Element) rootElement = (Element) node; else throw new StrutsException( "Document adapter expected to wrap an Element type. Node is not an element:" + node); return rootElement; } COM: <s> lazily construct the root element adapter from the value object </s>
funcom_train/51450413
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setComponent(DataComponent dataComponent) { super.setComponent(dataComponent); // Title getTitleLabel().setComponent(dataComponent); // Wrap the Act Element DataElement actElement = dataComponent.getDataElement(); // Identifier if(SHOW_IDENTIFIER) { _tfIdentifier.setElement(actElement); } // Completion Panel _actCompletionPanel.setComponent(dataComponent); // Metadata _metadataPanel.setMetadataType(((Act)dataComponent).getMetadataType()); } COM: <s> over ride to set sub panels </s>
funcom_train/48909928
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JPanel getJContentPane() { if (jContentPane == null) { imagen = new JLabel(); ImageIcon icono = new ImageIcon(getClass().getResource("imagenes/logo_iquircollo.jpg")); imagen.setIcon(icono); imagen.setBounds(new Rectangle(308, 67, 385, 93)); imagen.setText(""); jContentPane = new JPanel(); jContentPane.setLayout(null); jContentPane.setBackground(Color.white); jContentPane.add(getPanelDatos(), null); jContentPane.add(imagen, null); } return jContentPane; } COM: <s> this method initializes j content pane </s>
funcom_train/49051737
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void trimProperties(Properties properties) { // Have to do this iteration in a Java 5 compatible manner. no stringPropertyNames(). for (Map.Entry<Object, Object> entry : properties.entrySet()) { String propName = (String)entry.getKey(); properties.setProperty(propName, properties.getProperty(propName).trim()); } } COM: <s> ensures that the there is no leading or trailing whit20 </s>
funcom_train/29828568
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setErrorCode(String errorCode){ //this.errorCode=errorCode; if (error == null) { PacketErrorBuilder peb = new PacketErrorBuilder(); try {error = new PacketError(peb);} catch (InstantiationException e) {return;} } error.setCode(errorCode); } COM: <s> set the error type number </s>
funcom_train/6205749
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public IProjectLibrary create(Library library) throws UnresolvedLibraryException { String id = library.getId(); String version = library.getVersion(); IManagedLibrary reference = GaijinCore.getPluginManagedLibraryManager().resolve(id, version); if (reference != null) { int deployType = getDeploymentConstant(library); return create(reference, deployType); } else { return null; } } COM: <s> create an iproject library based on the given library data object </s>
funcom_train/15465482
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Vector readFromUserFile(String sourceFile) throws IOException { logger.debug("Opening and reading file named " + sourceFile) ; String sourceFileAsString = deriveFileFromClassPath(sourceFile); Vector identifiers = new Vector(); StringTokenizer st = new StringTokenizer(sourceFileAsString, "\n") ; while (st.hasMoreTokens()) { identifiers.add(st.nextToken()); } logger.debug("Successfully read " + sourceFile) ; return identifiers; } COM: <s> tokenize words from a user provided file </s>
funcom_train/2867350
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void showStandardSearch(Hashtable request, Hashtable response) throws RequestFormatException { //put the token back response.put("token", request.get("token") ); String selection=""; SearchScreen stdSearch = new SearchScreen((String)request.get("searchtitle"), (String)request.get("searchtext")); stdSearch.clearScreen(); stdSearch.print(); selection = stdSearch.printQuestion("Suchtext", "", selection); response.put("searchstring", selection); } COM: <s> print the standard search and return the users selection </s>
funcom_train/12168056
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void pushGeneratedResourcesEntryOnStack(Attributes saxAttributes) { GeneratedResourcesElement element = new GeneratedResourcesElement(); GeneratedResourcesAttributes attrs = new GeneratedResourcesAttributes(); attrs.setBaseDir(saxAttributes.getValue("base")); elementStackEntry = new MCSIElementStackEntry(element, attrs); elementStack.push(elementStackEntry); } COM: <s> push a generated resource element onto the top of our stack of elements </s>
funcom_train/23164777
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public JDOClass getRelatedJDOClass() { JavaType relatedType = getRelatedJavaType(); if (relatedType != null) { JDOClass myClass = getDeclaringField().getDeclaringClass(); String relatedTypeName = relatedType.getName(); if (relatedTypeName.equals(myClass.getName())) return myClass; return myClass.getDeclaringModel().getJDOClass(relatedTypeName); } return null; } COM: <s> get the jdoclass corresponding to the type or element of this </s>
funcom_train/50503473
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setEnabled(boolean val){ enabledBox.setEnabled(val); if(val && !securId.isEnabled()) val = false; super.setEnabled(val); Component[] comps = mainPanel.getComponents(); for (int i = 0; i < comps.length; i++) { comps[i].setEnabled(val); } } COM: <s> enables the components in this container due to the given value </s>
funcom_train/134235
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void scrollByUnit(int direction) { synchronized (slider) { int delta = 1 * ((direction > 0) ? POSITIVE_SCROLL : NEGATIVE_SCROLL); if (upperThumbSelected) { int oldValue = ((RangeSlider) slider).getHighValue(); ((RangeSlider) slider).setHighValue(oldValue + delta); } else { int oldValue = slider.getValue(); slider.setValue(oldValue + delta); } } } COM: <s> moves the selected thumb in the specified direction by a unit increment </s>
funcom_train/2952767
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Collection getValidItems(String type) { Collection allItems = this.getAllItems(type); List validItems = new ArrayList(); for (Iterator it = allItems.iterator(); it.hasNext();) { ConfigItem item = (ConfigItem) it.next(); if (item.isValid()) { validItems.add(item); } } return validItems; } COM: <s> returns all config items of the given type for which is valid returns </s>
funcom_train/11651798
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Pattern createPattern(String pattern) { try { return JMeterUtils.getPatternCache().getPattern(pattern, Perl5Compiler.READ_ONLY_MASK | Perl5Compiler.SINGLELINE_MASK); } catch (MalformedCachePatternException exception) { log.error("Problem with pattern: "+pattern,exception); return null; } } COM: <s> create a new pattern object from the string </s>
funcom_train/18743035
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public CancelEditAction getCancelEditAction(ResourceKind resource) { CancelEditAction result = this.cancelEditActionMap.get(resource); if (result == null) { this.cancelEditActionMap.put(resource, result = new CancelEditAction(this.simulator, resource)); result.refresh(); } return result; } COM: <s> lazily creates and returns the singleton instance of the </s>
funcom_train/8810346
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void saveSectionKeyQuestion(ProjectReportModelSection section,List<KeyQuestion> keyQuestions, EntityManager em){ for(KeyQuestion keyQuestion : keyQuestions){ keyQuestion.setSectionId(section.getId()); if(keyQuestion.getQualityCriterion()!=null){ saveKeyQuestionQualityCriterion(keyQuestion.getQualityCriterion(), em); } em.persist(keyQuestion); } section.setKeyQuestions(keyQuestions); } COM: <s> save the key questions of a section </s>
funcom_train/17724001
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void invoke() throws Throwable { try { result = method.invoke(target, arguments.toArray()); } catch (InvocationTargetException e) { thrown = e.getTargetException(); logger.debug(thrown.getMessage(), thrown); throw thrown; } catch (Throwable t) { thrown = t; logger.debug(t.getMessage(), t); throw t; } finally { invoked = true; } } COM: <s> invokes the specified method on the specified instance with the specified </s>
funcom_train/7443901
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ClientAdapter getAdapter() throws Exception { if (this.adapter == null) { String adapterClass = getHelpedParameters().getFirstValue( "adapter", "org.restlet.engine.http.adapter.ClientAdapter"); this.adapter = (ClientAdapter) Class.forName(adapterClass) .getConstructor(Context.class).newInstance(getContext()); } return this.adapter; } COM: <s> returns the adapter from uniform calls to http calls </s>
funcom_train/50499328
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void updateLaFRadio() { String lnfName = UIManager.getLookAndFeel().getClass().getName(); for( int index = 0; index < JDictProperties.getLaFCount(); index++ ) { if ( JDictProperties.getLaFClass( index ).equals( lnfName ) ) { preferencesLaFMenuItem[ index ].setSelected( true ); } } } COM: <s> update radio buttons indicating current look and feel </s>
funcom_train/51572160
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: // public void testSetGetSelfFingerprint() throws Exception { // LiveFingerprint fp = new LiveFingerprint(source); // fp.setUsesLength(true); // fp.scan(); // TargetSignature tSig = new TargetSignature(source); // tSig.setSelfFingerprint(fp); // // Fingerprint fp2 = tSig.getSelfFingerprint(); // FingerprintDelta delta = fp2.compareTo(fp); // assertFalse(delta.isAnyDifference()); // assertEquals(fp, fp2); // } COM: <s> test set and retrieve self fingerprint </s>
funcom_train/38184966
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getProvider(String name) throws IOException, ActiveJmsException { log.finer("getProvider called with name of '" + name + "'."); if (this.properties == null) { throw new ActiveJmsException("No active-jms.properties could be found."); } Provider provider = Provider.getProvider(this.properties, name); return this.addResource(provider); } COM: <s> creates a provider and loads its properties from the active jms </s>
funcom_train/40360178
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testEmptyConnectorName() { try { new StoreContext("", "test"); fail("failed to throw exception"); } catch (IllegalArgumentException e) { assertEquals("StoreContext.connectorName may not be null or empty.", e.getMessage()); } } COM: <s> tests if the exception is thrown correctly if the connector name is empty </s>
funcom_train/16383093
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ResultNode execute(ResultNode doc) throws ResourceUnavailableException { //Make the RecordSet Node ResultNode result = new ResultNode(null, params, this.getName()); //Loop through all the records for this record set for (Record record : rsfiles) { //add the subtree created by executing this record result.addChild(record.execute(patterns)); } doc.addChild(result); return doc; } COM: <s> main method of file record set </s>
funcom_train/16613440
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void registerAssembled(String seqRegionName, int chunk) { HashSet chunkIdSet; if (assembledRegistry.containsKey(seqRegionName)) { chunkIdSet = (HashSet) assembledRegistry.get(seqRegionName); } else { chunkIdSet = new HashSet(); assembledRegistry.put(seqRegionName, chunkIdSet); } chunkIdSet.add(new Integer(chunk)); } COM: <s> mark the given assembly chunk as registered in this assembly mapper </s>
funcom_train/24640389
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JButton getColorButton(JTextField textfield){ JButton button = new JButton("Color"); button.setActionCommand("Pick color"); final Component parent = this; final JTextField tField = textfield; button.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ Color newColor = JColorChooser.showDialog(parent,"Color",tField.getForeground()); tField.setForeground(newColor); } }); return button; } COM: <s> creates a color button for the given textfield </s>
funcom_train/1653661
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testToplevelKeyIterator() { SimpleFieldSet methodSFS = sfsFromSampleStringPairs(); Iterator itr = methodSFS.toplevelKeyIterator(); for(int i=0; i<3; i++) { assertTrue(itr.hasNext()); assertTrue(isAKey(SAMPLE_STRING_PAIRS, "", (String)itr.next())); } assertFalse(itr.hasNext()); } COM: <s> tests the toplevel iterator given for the </s>
funcom_train/2676646
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public IOnDemandStream getOnDemandStream(IScope scope, String name) { log.warn("This won't work until the refactoring of the streaming code is complete."); IOnDemandStreamService service = (IOnDemandStreamService) getScopeService( scope, IOnDemandStreamService.class, StreamService.class, false); return service.getOnDemandStream(scope, name); } COM: <s> returns vod stream with given name from specified scope </s>
funcom_train/11641557
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void init() { List<Rule> rulesList = parsePattern(); mRules = rulesList.toArray(new Rule[rulesList.size()]); int len = 0; for (int i=mRules.length; --i >= 0; ) { len += mRules[i].estimateLength(); } mMaxLengthEstimate = len; } COM: <s> p initializes the instance for first use </s>
funcom_train/8328053
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testFormatStringLocale() { checkLocale("es_ES", "1234.56", "1.234,6", true); checkLocale("es_MX", "1234.56", "1,234.6", true); checkLocale("en_US", "1234.56", "1,234.6", true); } COM: <s> tests that measures are formatted using the connections locale </s>
funcom_train/1653614
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testEncodeDecodeString_notSafeBaseChars() { String[] toEncode = { //safe chars URLEncoder.safeURLCharacters, prtblAscii, //triple % char, if badly encoded it will generate an exception "%%%", //no chars ""}; try { assertTrue(areCorrectlyEncodedDecoded(toEncode, true)); assertTrue(areCorrectlyEncodedDecoded(toEncode, false)); } catch (URLEncodedFormatException anException) { fail("Not expected exception thrown : " + anException.getMessage()); } } COM: <s> tests if urlencode </s>
funcom_train/3768006
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addPackage(Package pc) { Set set; Iterator iter; if (pc == null) { throw new IllegalArgumentException("Argument can't be null."); } set = pc.getProgramCodes(); iter = set.iterator(); while (iter.hasNext()) { ProgramCode pg = (ProgramCode) iter.next(); contents.put(pg.getName(), pg); } } COM: <s> add the given package to belong to this packet </s>
funcom_train/28505791
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ParkingLot getFreeLot(){ ParkingLot lot = null; for(int i = 0; i < lots.size(); i++){ if(lot==null && lots.get(i).checkState()==0){ lot = lots.get(i); } } return lot; } COM: <s> returns a free lot </s>
funcom_train/38330469
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void writeMessage(String msg, String output) { MessageRouter router = getMessageRouter(); router.postMessageEvent(new MessageEvent(MessageEvent.ENGINE, msg, "t" .equals(output) ? router.getCurrentChannelId() : output)); if (this.outputStreams.size() > 0) { Iterator itr = this.outputStreams.values().iterator(); while (itr.hasNext()) { PrintWriter wr = (PrintWriter)itr.next(); wr.write(msg); wr.flush(); } } } COM: <s> write message will create a message event and pass it along to any </s>
funcom_train/16514650
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int dbUpdate(String argument) { int returnvalue = -1; try { returnvalue = connection.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE).executeUpdate(argument); } catch (SQLException e) { System.out.println("dbUpdate(" + argument + ")"); e.printStackTrace(); throw new RuntimeException(); } return returnvalue; } COM: <s> executes an update statement on the database </s>
funcom_train/43585327
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setFieldValue(ZField field, Object value) { ZField idField = getMeta().getIdField(); if (!isNew() && (idField != null) && (idField == field)) { throw new ZormException( "Modification of the id field for non new persistent object is not permitted"); } field.validate(value); setFieldValueInternal(field, value); setFieldModified(field, true); } COM: <s> set the value of the specified field </s>
funcom_train/4514739
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void setGrid() { gridLayout = getGridLayout(); int monthCount = getMonthCount(calendar); switch (layout) { case HORIZONTAL: gridLayout.setColumns(monthCount); gridLayout.setRows(1); break; case VERTICAL: gridLayout.setColumns(1); gridLayout.setRows(monthCount); break; case SEMIYEAR: gridLayout.setColumns(monthCount / 2); gridLayout.setRows(monthCount % 2 == 0 ? 2 : 3); case QUARTER: default: gridLayout.setColumns(monthCount / 4); gridLayout.setRows(monthCount % 4 == 0 ? 4 : 5); } } COM: <s> sets the grids by layout scheme </s>
funcom_train/19417469
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void addExtensionsToXmiDocument() { if (roseExtension) { xmiDocument.createRoseExtensions(); System.out.println(">>> Rational Rose extensions added."); } if (mdrawExtension) { xmiDocument.createMagicDrawExtensions(); System.out.println(">>> Magic Draw extensions added."); } // else : nothing to add. } COM: <s> sets extensions definitively to generated xmi tree before saving it to file </s>
funcom_train/458748
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ResultSet dbQuery(String dbName) throws Exception { lstCommand = lastCommand = "dbQuery(" + dbName + ")"; if (sql.size() > 1) throw new Exception("Multi-line query; Use dbUpdates"); return Util.dbQuery(dbName, prepQuery(0)); } COM: <s> executes the query on the passed db name </s>
funcom_train/266192
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void initNames() { localInitialize = true; DateFormatSymbols dateFormatSymbols = new DateFormatSymbols(locale); String[] monthNames = dateFormatSymbols.getMonths(); if (comboBox.getItemCount() == 12) { comboBox.removeAllItems(); } for (int i = 0; i < 12; i++) { comboBox.addItem(monthNames[i]); } localInitialize = false; comboBox.setSelectedIndex(month); } COM: <s> initializes the locale specific month names </s>
funcom_train/22560399
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void saveKeyRing() { try { encryptData(); FileOutputStream fileOutStream = new FileOutputStream(getBackingFile()); ObjectOutputStream objOutStream = new ObjectOutputStream(fileOutStream); objOutStream.writeObject(cryptoTable); objOutStream.close(); } catch(IOException ex) { ex.printStackTrace(); } } COM: <s> save the keyring to file </s>
funcom_train/33610859
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void panLeft() { LineVisometry lv = (LineVisometry) visometry; double newMin = lv.getMinPointVisible(); double newMax = lv.getMaxPointVisible(); double shift = (newMax-newMin)/10.0; lv.setDesiredRange(newMin-shift, newMax-shift); } COM: <s> pans plot to the left </s>
funcom_train/2321485
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Remote installProxy(Object proxy) throws Exception { if (proxy instanceof MarshalledObject) proxy = ((MarshalledObject)proxy).get(); if (proxy instanceof RemoteInvoke) throw new IllegalArgumentException("Proxy must be local"); Remote ref = new Remote(proxy).clientScope(); Remote.invoke(proxy, "init", ref); return ref; } COM: <s> this remotely invokable method is called by remote clients to install </s>
funcom_train/21641830
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setColumns(int columns, int[] columnWidths) { int columnsRequired; columnsRequired = columns * 2; TableLayout tl = new TableLayout(columnsRequired); tl.setFullWidth(false); tl.setCellSpacing(10); if (columnWidths != null) { tl.setColumnWidths(columnWidths); } setLayout(tl); } COM: <s> sets the number of columns of form components that this form will have </s>
funcom_train/42979959
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JScrollPane getJScrollPane1() { if (jScrollPane1 == null) { jScrollPane1 = new JScrollPane(); jScrollPane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); jScrollPane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); jScrollPane1.setPreferredSize(new Dimension(500, 17)); jScrollPane1.setViewportView(getJTextArea()); } return jScrollPane1; } COM: <s> this method initializes j scroll pane1 </s>