__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/25653117
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setLookAt(Vector3f position) { Vector3f eye = new Vector3f(mouseViewpoint); Vector3f dir = Vector3f.sub(eye, position, null); //calculate heading float angle = (float) Math.atan(dir.x / dir.z); if (dir.z < 0) angle += Math.PI; eye.y = position.y; //set height setViewpoint(new Viewpoint(eye, angle, 0),1); } COM: <s> level and rotate the viewpoint to look at a specific position </s>
funcom_train/10684271
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void cacheIndexes() { for(int index=0; index < primaryArray.length; index++) { String key = primaryArray[index]; if(!primaryTable.containsKey(key)) { primaryTable.put(key, new ArrayList()); } ((ArrayList)primaryTable.get(key)).add(new Integer(index)); } } COM: <s> given a primary array cache its values in a hash map </s>
funcom_train/36831029
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean flushBuffer() throws IOException { byte[] buffer = lineBuffer.toByteArray(); int startPos = 0; int pos; boolean foundLineBreak = false; while ((pos = linebreakPatternSearch.indexAfter(buffer, startPos)) >= 0) { flushLine(buffer, startPos, pos - startPos); startPos = pos; foundLineBreak = true; } if (foundLineBreak) { lineBuffer.reset(); lineBuffer.write(buffer, startPos, buffer.length - startPos); } return false; } COM: <s> give out every complete line to underlying outputstream </s>
funcom_train/51542914
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void write_string16 (String s) { write_string16 (index, s); boolean odd = s.length() % 2 == 1; // If we have an odd number of characters, we have to add a padding of // 2. index += s.length() * 2 + (odd ? 2 : 0); } COM: <s> writes a field of type string16 into the data buffer </s>
funcom_train/48704976
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void execute(BstEntry context) { if (stack.size() < 2) { throw new VMException("Not enough operands on stack for operation >"); } Object o2 = stack.pop(); Object o1 = stack.pop(); if (!(o1 instanceof Integer && o2 instanceof Integer)) { throw new VMException("Can only compare two integers with >"); } if (o1 == o2) { stack.push(VM.FALSE); return; } stack.push(((Integer) o1).compareTo((Integer) o2) > 0 ? VM.TRUE : VM.FALSE); } COM: <s> pops the top two integer literals compares them and pushes </s>
funcom_train/45934102
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isActiveAtDate(final Date _date) { if (this.startDate == null && this.endDate == null) return true; if (_date == null) return false; NSTimeRange r = this.timeRange(); return r != null ? r.containsDate(_date) : true; } COM: <s> returns whether the objects time constraints match the given date </s>
funcom_train/11445329
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public PolicyAssertion buildCompatible(PolicyAssertion a, PolicyAssertion b) { if (knownElements.contains(a.getName()) && a.getName().equals(b.getName())) { return new PrimitiveAssertion(a.getName(), a.isOptional() && b.isOptional()); } return null; } COM: <s> if the two assertions are equal they are also compatible </s>
funcom_train/22024411
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Vector3 crossMe(Vector3 v) { float m0 = this.m[1] * v.m[2] - this.m[2] * v.m[1]; float m1 = this.m[2] * v.m[0] - this.m[0] * v.m[2]; this.m[2] = this.m[0] * v.m[1] - this.m[1] * v.m[0]; this.m[1] = m1; this.m[0] = m0; return(this); } COM: <s> calculates the crossproduct of this and v and saves the result in this </s>
funcom_train/28342614
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void shiftZDataSet() { for(int k = 0; k < zValues.length; k++) { for(int x = 0; x < zValues[k].length; x++) { if(x <= shiftFront) { zValues[k][x] = zValues[k][x + shiftBack]; } else { zValues[k][x] = holeValue; } } } startIndex = shiftFront+1; } COM: <s> shift the model data the distance of the shift front </s>
funcom_train/47826788
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean containsEdge(Edge<V> e) { boolean found = false; // takes the collection of edges attached to the head of the edge V head = (V) e.getHead(); try { VertexDirectedEdgesCollection<Edge<V>> collection = getEdgeCollection(head); found = collection.containsEdge(e); } catch (VertexNotFoundException e1) { found = false; } return found; } COM: <s> checks whether the graph contains the given edge </s>
funcom_train/7386960
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void removeTableStructure(final String tableName) { for (int i = 0; i < listeOpenTables.size(); i++) { Window window = (Window) listeOpenTables.get(i); ListGrid listGridTemp = (ListGrid) window.getItems()[0]; if (listGridTemp.getField(1).getName().equalsIgnoreCase(tableName)) { queryEditor.removeChild(window); listeOpenTables.remove(i); } } } COM: <s> remove a drag and drop table </s>
funcom_train/8439072
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Command getCmdSave() { if (cmdSave == null) {//GEN-END:|70-getter|0|70-preInit // write pre-init user code here cmdSave = new Command("\u0421\u043E\u0445\u0440.", Command.OK, 0);//GEN-LINE:|70-getter|1|70-postInit // write post-init user code here }//GEN-BEGIN:|70-getter|2| return cmdSave; } COM: <s> returns an initiliazed instance of cmd save component </s>
funcom_train/29375302
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void finalize() throws Throwable { this.attributes.removeAllElements(); this.attributes = null; this.children = null; this.fullName = null; this.name = null; this.namespace = null; this.content = null; this.systemID = null; this.parent = null; super.finalize(); } COM: <s> cleans up the object when its destroyed </s>
funcom_train/44585678
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void insertDeltaTree(IJavaElement element, JavaElementDelta delta) { JavaElementDelta childDelta= createDeltaTree(element, delta); if (!this.equalsAndSameParent(element, getElement())) { // handle case of two jars that can be equals but not in the same project addAffectedChild(childDelta); } } COM: <s> creates the delta tree for the given element and delta and then </s>
funcom_train/43882358
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected String makeInsertSql(Feature feature) throws IOException { FeatureTypeInfo ftInfo = queryData.getFeatureTypeInfo(); FeatureType featureType = ftInfo.getSchema(); AttributeType[] attributes = featureType.getAttributeTypes(); String insertSQL = this.sqlBuilder.makeInsertSql(attributes, feature); return (insertSQL); } COM: <s> generates the sql update statement </s>
funcom_train/22064364
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JPanel getLeftPanel() { if (leftPanel == null) { leftPanel = new JPanel(); leftPanel .setLayout(new BoxLayout(getLeftPanel(), BoxLayout.Y_AXIS)); leftPanel.add(getEvents(), null); leftPanel.add(getLanguages(), null); leftPanel.add(getNationality(), null); leftPanel.add(getSexpref(), null); } return leftPanel; } COM: <s> this method initializes j panel </s>
funcom_train/9922295
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void ensureCapacityHelper(int minCapacity) { int oldCapacity = elementData.length; Object oldData[] = elementData; int newCapacity = (capacityIncrement > 0) ? (oldCapacity + capacityIncrement) : (oldCapacity * 2); if (newCapacity < minCapacity) { newCapacity = minCapacity; } elementData = new Object[newCapacity]; System.arraycopy(oldData, 0, elementData, 0, elementCount); } COM: <s> this implements the unsynchronized semantics of ensure capacity </s>
funcom_train/45628551
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void containerSelectionChanged(IContainer container) { selectedContainer = container; if (allowNewContainerName) { if (container == null) { containerName = ""; } else { containerName = TextProcessor.process(container.getFullPath().makeRelative().toString()); } } // fire an event so the parent can update its controls if (listener != null) { Event changeEvent = new Event(); changeEvent.type = SWT.Selection; changeEvent.widget = this; listener.handleEvent(changeEvent); } } COM: <s> the container selection has changed in the tree view </s>
funcom_train/34535539
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addTree(OrgTree t1){ if ((t1 != null) && (t1.nodes!= null)) { for (int i=0; i<t1.nodes.toArray().length; i++) { if (!this.isNodeInTree(t1.nodes.get(i).getId())) this.nodes.add(t1.nodes.get(i)); } } } COM: <s> sums the nodes in t1 which do not exist in the current tree </s>
funcom_train/12194135
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testBooleanWrapper() throws Exception { BooleanWrapper wrapper = new BooleanWrapper(false); assertTrue("Expected BooleanWrapper to have a false value.", !wrapper.getValue()); wrapper = new BooleanWrapper(true); assertTrue("Expected BooleanWrapper to have a true value.", wrapper.getValue()); } COM: <s> test the constructor of boolean wrapper </s>
funcom_train/1238911
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public SOAPHeaderElement getHeader(String namespace, String partName) { for(int i=0;i<headers.size();i++) { SOAPHeaderElement header = (SOAPHeaderElement)headers.get(i); if(header.getNamespaceURI().equals(namespace) && header.getName().equals(partName)) return header; } return null; } COM: <s> get the header element </s>
funcom_train/44709501
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void respond(PageState state) throws ServletException { String event = state.getControlEventName(); if ( SELECT_EVENT.equals(event) ) { setSelectedKey(state, state.getControlEventValue()); } else { throw new ServletException("Unknown event '" + event + "'"); } fireActionEvent(state); } COM: <s> responds to a request in which this code list code was the targetted </s>
funcom_train/38326049
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void remove() { if (this.prev != null && this.next != null) { this.prev.setNext(this.next); } else if (this.prev != null && this.next == null) { this.prev.setNext(null); } else if (this.prev == null && this.next != null) { this.next.setPrevious(null); } this.prev = null; this.next = null; } COM: <s> remove the activation from the list and set the previous </s>
funcom_train/19399225
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void writeLeaf(SimpleLeafData leaf) throws IOException { ByteBuffer buf = nodeSer.putNodeOrLeaf( leaf ); // write the record final int nbytes = buf.limit(); final long addr = tmpStore.write(buf); addrs.add(addr); System.err.print(">"); // wrote a leaf. nleaves++; if( nbytes > maxLeafBytes ) { maxLeafBytes = nbytes; } } COM: <s> write the leaf onto the output channel </s>
funcom_train/39875140
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void startScroll(int startX, int startY, int dx, int dy, int duration) { mMode = SCROLL_MODE; mScrollerX.startScroll(startX, dx, duration); mScrollerY.startScroll(startY, dy, duration); } COM: <s> start scrolling by providing a starting point and the distance to travel </s>
funcom_train/13524296
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void resetAll() { gridX = 0; gridY = 0; gridWidth = 1; gridHeight = 1; insets = null; limitPolicy = HEED_MINIMUM_SIZE; shrinkX = 0.0; shrinkY = 0.0; stretchX = 0.0; stretchY = 0.0; resetFill(); resetAnchor(); } COM: <s> resets all values of this constraints object to their defaults </s>
funcom_train/39315738
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testLine3ActionPerformed() { System.out.println("testLine3ActionPerformed"); f.currentTool=f.toolLine; f.line3ActionPerformed(actionEvent); assertEquals(f.curLine,f.line3); t.currentTool=t.toolCurve; t.line3ActionPerformed(actionEvent); assertEquals(t.curCurve,t.line3); } COM: <s> test of line3 action performed method of class terp paint </s>
funcom_train/46617133
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JPanel getJPanel() { if (jPanel == null) { jPanel = new JPanel(); jPanel.setLayout(new FlowLayout()); jPanel.add(getSaveButton(), null); jPanel.add(getCancelButton(), null); } return jPanel; } COM: <s> this method initializes j panel </s>
funcom_train/33897940
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void insertElementAt(Object element, int index) { if (fElements.contains(element)) { return; } fElements.add(index, element); if (isOkToUse(fTreeControl)) { fTree.add(this, element); if (fTreeExpandLevel != -1) { fTree.expandToLevel(element, fTreeExpandLevel); } } dialogFieldChanged(); } COM: <s> adds an element at a position </s>
funcom_train/38327586
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean loadData(Rete engine) { if (log == null) { log = LogFactory.createLogger(ClipsInitialData.class); } boolean loaded = true; try { LoadFactsFunction load = (LoadFactsFunction)engine.findFunction(LoadFactsFunction.LOAD); Parameter[] parameters = new Parameter[1]; parameters[0] = new ValueParam(Constants.STRING_TYPE, cacheFile); load.executeFunction(engine, parameters); } catch (Exception e) { loaded = false; } return loaded; } COM: <s> the load process needs to be atomic so that in the event </s>
funcom_train/32060984
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void pickLine(int xco, int yco) { if (selectionmode == NONE) return; int pline = getLine(xco, yco); if (isLineSelected(pline)) { selectedlines.deleteValue(pline); } else { if (selectionmode == SINGLE) { selectedlines.clear(); } selectedlines.append(pline); } Events.fire(new SelectEvent(), this); setNeedsRepaint(); } COM: <s> selects or deselects a line of text according to the selection </s>
funcom_train/2800541
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public long getLong(String pProperty) throws RaccoonException, NumberFormatException { try { /** Try to return the value of the property */ return Long.parseLong(mProperties.getString(pProperty)); } catch (java.util.MissingResourceException e) { /** Property not found throwing exception */ throw new RaccoonException(ErrorCodes.RESOURCE_NOT_FOUND, getMissingPropertyMsg(pProperty), e); } } COM: <s> reads the value of the propery and converts it to a long </s>
funcom_train/626344
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private BigDecimal function(BigDecimal x, BigDecimal y) { // Sin only works on doubles! Write the sin for BigDecimal. Why aren't there math // libraries for BigDecimals?? double dX = x.doubleValue(); double dY = y.doubleValue(); double ans = dY * Math.sin(dX * dX / 6) * Math.sin(dY * dY / 6); return new BigDecimal(ans); } COM: <s> heres the actual function refactored out for easier changes </s>
funcom_train/19406769
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void destroyLink(Rule in_Rule) { SystemState left = in_Rule.getLeft(); SystemState right = in_Rule.getRight(); UnlinkProcessNode lu = left.createUnlinkProcessNode(); UnlinkProcessNode ru = right.createUnlinkProcessNode(); lu.setStatus("#active"); ru.setStatus("#finished"); in_Rule.addMapping(lu, ru); LinkNode ll = left.createLinkNode(); ll.mark(); } COM: <s> creates the detroy link rule from the transformation unit </s>
funcom_train/25187010
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetParser() throws Exception { System.out.println("getParser"); BigFactory instance = BigFactory.getInstance(); assertNull(instance.getParser(BigFactory.F_DUMP)); assertNotNull(instance.getParser(BigFactory.F_JSON)); assertNotNull(instance.getParser(BigFactory.F_XML)); } COM: <s> test of get parser method of class big factory </s>
funcom_train/42476986
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void repositionPanel(final JPanel panel) { int x = this.getPreferredSize().width; x -= panel.getPreferredSize().width; x /= 2; int y = this.getPreferredSize().height; y -= panel.getPreferredSize().height; y /= 2; panel.setBounds(x, y, panel.getPreferredSize().width, panel.getPreferredSize().height); } COM: <s> repositions a pop up panel in the center of the display </s>
funcom_train/50066938
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void init(Symtab syms, boolean definitive) { if (classes != null) return; if (definitive) { assert packages == null || packages == syms.packages; packages = syms.packages; assert classes == null || classes == syms.classes; classes = syms.classes; } else { packages = new Hashtable(); classes = new Hashtable(); } packages.put(syms.rootPackage.fullname, syms.rootPackage); syms.rootPackage.completer = this; packages.put(syms.emptyPackage.fullname, syms.emptyPackage); syms.emptyPackage.completer = this; } COM: <s> initialize classes and packages optionally treating this as the </s>
funcom_train/39886681
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String substring(int start) { if (0 <= start && start <= count) { if (start == count) { return ""; } // Remove String sharing for more performance return new String(value, start, count - start); } throw new StringIndexOutOfBoundsException(start); } COM: <s> returns the string value of the subsequence from the </s>
funcom_train/10616044
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testHashCode() { assertTrue(new CodeSigner(cpath, ts).hashCode() == (cpath.hashCode() ^ ts .hashCode())); assertTrue(new CodeSigner(cpath, null).hashCode() == cpath.hashCode()); } COM: <s> tests code signer </s>
funcom_train/45718780
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public T parseFeed() throws IOException, XmlPullParserException { boolean close = true; try { this.feedParsed = true; T result = ClassInfo.newInstance(this.feedClass); Xml.parseElement(this.parser, result, this.namespaceDictionary, Atom.StopAtAtomEntry.INSTANCE); close = false; return result; } finally { if (close) { close(); } } } COM: <s> parse the feed and return a new parsed instance of the feed type </s>
funcom_train/34534997
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private List buildEdges(List transitionsToShow) { List result=new ArrayList(); for (Iterator i=transitionsToShow.iterator(); i.hasNext(); ) { result.add(buildEdge((Transition)i.next())); } logger.fine("edge result contains "+result.size()+" entries"); return result; } COM: <s> builds a list of default edge one for each transition in </s>
funcom_train/32741617
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public FieldDefinition makeFieldOfType(String name, String type, String description) { return new FieldDefinitionImpl(name.replaceAll("__", "->"), type.replaceAll("__", "->"), description); } COM: <s> makes a field definition identical with the given one except for the name </s>
funcom_train/13812629
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String replaceChar(String source, char target, String substitute){ StringBuffer valbuf = new StringBuffer(1024); valbuf.append(source); int start = source.lastIndexOf(target); while(start != -1) { valbuf.delete(start, start+1); if(substitute.length() > 0) { valbuf.insert(start, substitute); } source = valbuf.toString(); start = source.lastIndexOf(target); } return valbuf.toString(); } COM: <s> replaces all occurrences of a single character in a string with a </s>
funcom_train/22367054
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private ImageIcon getArtistImageData(IAudioObject audioObject) { ImageIcon image = webServicesHandler.getArtistImage(audioObject.getArtist()); if (image != null) { image = ImageUtils.resize(image, Constants.ARTIST_IMAGE_SIZE, Constants.ARTIST_IMAGE_SIZE); } return image; } COM: <s> returns image for artist </s>
funcom_train/20893921
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setText(String arg0) { if (documentListener!=null) super.getDocument().removeDocumentListener(documentListener); try{ super.setText(arg0); }catch(Exception e){ // If the TextField is already modified, it is useless to update it } if (documentListener!=null) super.getDocument().addDocumentListener(documentListener); } COM: <s> disable the event handler of the textfield </s>
funcom_train/29550336
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetFolderUri() { String folderNcName = "testfolder"; String expectedFolderUri = "http://" + MindRaider.profile.getHostname() + "/e-mentality/folder#" + folderNcName; String actualFolderUri = MindRaiderVocabulary.getFolderUriSkeleton() + folderNcName; assertEquals("actualFolderUri" + actualFolderUri, expectedFolderUri, actualFolderUri); } COM: <s> the get folder uri test case </s>
funcom_train/7638080
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void parseFile() { try { SAXParser parser = sParserFactory.newSAXParser(); parser.parse(getFile().getContents(), new ValueResourceParser(this, isFramework())); } catch (ParserConfigurationException e) { } catch (SAXException e) { } catch (IOException e) { } catch (CoreException e) { } } COM: <s> parses the file and creates a list of </s>
funcom_train/12179388
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testFindGreatestCommonDenominatorWithNonZeroParameters() { DIAspectRatioFunction function = getFunction(); int gcd = function.findGreatestCommonDenominator(600, 450); assertEquals(150, gcd); gcd = function.findGreatestCommonDenominator(450, 600); assertEquals(150, gcd); gcd = function.findGreatestCommonDenominator(870, 420); assertEquals(30, gcd); } COM: <s> verify that attempting to find the gcd with two non zero parameters </s>
funcom_train/1784721
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void warning(final String method, final int key, final Object value) { final LogRecord record = Errors.getResources(getLocale()). getLogRecord(Level.WARNING, key, value); record.setSourceClassName(NetcdfMetadata.class.getName()); record.setSourceMethodName(method); warningOccurred(record); } COM: <s> convenience method for logging a warning </s>
funcom_train/32957773
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public PasswordPolicy getPasswordPolicy() { if (getResponseControls() == null) return null; for (int x = 0; x < getResponseControls().length; x++) { if (PASSWORD_POLICY_OID.equals(getResponseControls()[x].getID())) { return new PasswordPolicy(getResponseControls()[x]); } } return null; } COM: <s> return the control that specifies that the password is about to expire </s>
funcom_train/124672
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void register(ProjectDataHandler handler) { if (handler == null) throw new IllegalArgumentException("Argument was null."); if (handlerMap.containsKey(handler.getProjectDataType())) throw new IllegalStateException( "An instance of ProjectDataHandler for the type \"" + handler.getProjectDataType() + "\" has already been registered."); handlerMap.put(handler.getProjectDataType(), handler); } COM: <s> registers a project data handler with this manager class </s>
funcom_train/8420555
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void saveState(SharedPreferences outState) { Log.i(TAG, "save state"); currentBiblePage.saveState(outState); currentCommentaryPage.saveState(outState); currentDictionaryPage.saveState(outState); currentGeneralBookPage.saveState(outState); SharedPreferences.Editor editor = outState.edit(); editor.putString("currentPageCategory", currentDisplayedPage.getBookCategory().getName()); editor.commit(); } COM: <s> called during app close down to save state </s>
funcom_train/1823538
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public double getMaxSideLength() { return Math.max(Point2D.distance(p1.x, p1.y, p2.x, p2.y), Math.max(Point2D.distance(p2.x, p2.y, p3.x, p3.y), Point2D.distance(p3.x, p3.y, p1.x, p1.y))); } COM: <s> returns the length of this triangles longest side </s>
funcom_train/25707539
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JRadioButton getBoards_RBchosed() { if( boards_RBchosed == null ) { boards_RBchosed = new JRadioButton(); boards_RBchosed.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(final java.awt.event.ItemEvent e) { boards_RBitemStateChanged(); } }); } return boards_RBchosed; } COM: <s> this method initializes j radio button11 </s>
funcom_train/43424362
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void connect() throws IOException, MessageITException{ if(online())return; sock=new Socket(host,port); oos(); ois(); //we are connected. Now register. oos().writeObject(MSGIT_CLIENT+getClientID());//I'm a regular client, my name is ... int code=ois().readInt();//Is that good? if(code!=0){ disconnect(); throw new MessageITException("Conection failed: client ID already exists"); } mrt=new MessageReceiverThread(); new Thread(mrt).start(); } COM: <s> connects to the dispatcher </s>
funcom_train/23271548
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setSourcePaint(Paint paint) { if (paint == null) { throw new IllegalArgumentException("Null 'paint' argument"); } Paint old = this.sourceSubtitle.getPaint(); this.sourceSubtitle.setPaint(paint); firePropertyChange("sourcePaint", old, paint); } COM: <s> sets the paint for the charts source subtitle and sends a </s>
funcom_train/51633080
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void remember() { /* https://bugs.eclipse.org/bugs/show_bug.cgi?id=52257 * This method may be called inside an asynchronous call posted * to the UI thread, so protect against intermediate disposal * of the editor. */ ISourceViewer viewer= getSourceViewer(); if (viewer != null) { IRegion selection= getSignedSelection(viewer); int startOffset= selection.getOffset(); int endOffset= startOffset + selection.getLength(); fStartOffset.setOffset(startOffset); fEndOffset.setOffset(endOffset); } } COM: <s> remember current selection </s>
funcom_train/174226
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public EntityRef setName(String name) { // This can contain a colon so we use checkXMLName() // instead of checkElementName() String reason = Verifier.checkXMLName(name); if (reason != null) { throw new IllegalNameException(name, "EntityRef", reason); } this.name = name; return this; } COM: <s> this will set the name of this code entity ref code </s>
funcom_train/25488824
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JButton getDelete() { if (delete == null) { delete = new JButton(); delete.setText("Randomly Delete"); delete.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { deleteClicked(e); } }); } return delete; } COM: <s> this method initializes delete </s>
funcom_train/13391316
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ServiceResource getPrevious() throws NoSuchElementException { ServiceResource sr = null; if(list.size() == 0) throw new NoSuchElementException("Empty resource list"); synchronized(list) { sr = (ServiceResource)list.removeLast(); if(sr != null) list.addFirst(sr); } return (sr); } COM: <s> returns the previous code service resource code in the list of </s>
funcom_train/32628695
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Literal getValue() { NodeIterator i = null; try { i = getAll(); return (i == null || !i.hasNext()) ? null : ((Literal) i.nextNode()); } finally { if (i != null) { i.close(); } } } COM: <s> p answer the value of the encapsulated property </s>
funcom_train/47597633
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void sendMessage(String message) { /* Only send if connected to server */ if (!isConnected()) { System.out.println("Not Connected"); return; } /* Create Message payload and send */ sendPayload(new Payload<String>(Flag.CLIENT_MESSAGE, message, nickname, "Server")); } COM: <s> send message to server </s>
funcom_train/29922884
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Connection getConnection() { debug("getConnection()"); if (dataSource==null) { error("DataSource has not yet been looked up",null); return null; } try { return dataSource.getConnection(); } catch (SQLException e) { error("Could not retrieve Connection from DataSource",e); return null; } } COM: <s> get new connection from data source </s>
funcom_train/26402085
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void verifyType(Object value) { //make sure the object is not null before verifying it's type. if ( ! (null == value) ) { if( ! (value instanceof java.lang.Double ) ) { throw new IllegalArgumentException ("Value's type (" + value.getClass().getName() + ") is not an instance of class java.lang.Double"); } } } COM: <s> verifies that the specified value is an instanceof double </s>
funcom_train/47839980
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void createComboFrom() { GridData gridData3 = new GridData(); gridData3.horizontalAlignment = GridData.FILL; gridData3.verticalAlignment = GridData.CENTER; comboFrom = new Combo(top, SWT.NONE); comboFrom.setLayoutData(gridData3); comboFromViewer = new ComboViewer(comboFrom); comboFromViewer.setContentProvider(new AccountContentProvider()); comboFromViewer.setLabelProvider(new AccountLabelProvider()); comboFromViewer.setInput(Model.getInstance().getAccountRepository()); } COM: <s> this method initializes combo recipient </s>
funcom_train/48406934
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addSelectedStepPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_TaskUse_selectedStep_feature"), getString("_UI_PropertyDescriptor_description", "_UI_TaskUse_selectedStep_feature", "_UI_TaskUse_type"), SpemxtcompletePackage.eINSTANCE.getTaskUse_SelectedStep(), true, false, true, null, null, null)); } COM: <s> this adds a property descriptor for the selected step feature </s>
funcom_train/41490405
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void openFileForEditing(String fileName) { SmilDataSet openedDataSet; try { openedDataSet = SmilParser.getParsedDataSet(fileName); } catch (Exception e) { mDialogExceptionMessage = "Cannot open file."; showDialog(DIALOG_EXCEPTION_ID); return; } mEditingDataSet = openedDataSet; mEditingResource = null; mNewResourceType = null; mIsCreatingNewSmil = false; mIsCreatingNewResource = false; mIsSaved = true; refreshExistingResourcesList(); } COM: <s> loads a smil file into the composer for editing </s>
funcom_train/50346473
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void showAllFnButtons() { // should show all, or just the initial ones? for (int i=0; i < NUM_FUNCTION_BUTTONS; i++) { functionButton[i].setDisplay(true); if (i<3) functionButton[i].setVisible(true); } alt1Button.setVisible(true); alt2Button.setVisible(true); buttonActionCmdPerformed(); } COM: <s> make sure that all function buttons are being displayed </s>
funcom_train/16629727
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void insertImage(int offset,URL imageUrl,String description,XMLNoteImageIconSize size) throws BadLocationException, BadOperationException { XMLNoteImageIcon img; if (getXMLNoteImageIconProvider()!=null) { img=getXMLNoteImageIconProvider().getIcon(imageUrl,description,size); if (img==null) { return; } } else { img=new XMLNoteImageIcon(imageUrl,description,size); } insertImage(offset,img); } COM: <s> inserts a new xmlnote image icon at the given offset </s>
funcom_train/4359200
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void log(String message) { if ((mManager != null) && (mManager instanceof SimpleTcpReplicationManager)) { ((SimpleTcpReplicationManager) mManager).log.debug("ReplicatedSession: " + message); } else { System.out.println("ReplicatedSession: " + message); } } COM: <s> implements a log method to log through the manager </s>
funcom_train/46723295
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Transferable createTransferable(JComponent c) { try { JTree tree = (JTree)c; CLPTreeNode node = (CLPTreeNode)tree.getLastSelectedPathComponent(); CLPLogger.log(2,"createTransferable node : " + node); ObjectTreeMetadata otm = getNodeMetadata(tree,node); if (otm != null) { return new ObjectTreeTransferable(otm); } } catch (Exception e) { CLPLogger.log(e); } return null; } COM: <s> from the selected tree node generate the text string that </s>
funcom_train/51344244
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: synchronized public void shutdownNow() { if (!isOpen()) return; if (concurrencyManager != null) { concurrencyManager.shutdownNow(); // concurrencyManager = null; } if (localTransactionManager != null) { localTransactionManager.shutdownNow(); // localTransactionManager = null; } if (resourceManager != null) { resourceManager.shutdownNow(); // resourceManager = null; } super.shutdownNow(); } COM: <s> shutdown attempts to abort in progress requests and shutdown as soon as </s>
funcom_train/3368692
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void add(AbstractButton b) { if(b == null) { return; } buttons.addElement(b); if (b.isSelected()) { if (selection == null) { selection = b.getModel(); } else { b.setSelected(false); } } b.getModel().setGroup(this); } COM: <s> adds the button to the group </s>
funcom_train/18254950
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean remove(Object o) { for (Iterator it = this.iterator(); it.hasNext();) { Node agent = (Node) it.next(); ArrayList list = (ArrayList) adjacencyMap.get(agent); list.remove(o); } return super.remove(o); } COM: <s> removes the supplied object agent from this list </s>
funcom_train/15555100
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void expandCapacity() { capacity = count * 2; Object[] elements = new Object[capacity + 1]; double[] prioritys = new double[capacity + 1]; System.arraycopy(data, 0, elements, 0, data.length); System.arraycopy(value, 0, prioritys, 0, data.length); data = elements; value = prioritys; } COM: <s> this ensures that there is enough space to keep adding elements to the </s>
funcom_train/26483985
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected Selectable findSelectable(String idStr, String typeStr) { Selectable g = getReport().findSelectable(idStr, typeStr); if (g == null && !missingColumnSeen) { missingColumnSeen = true; ErrorHandler.error(I18N.get("ReportReader.the_column") + ' ' + idStr + " (" + typeStr + ") " + I18N.get("ReportReader.column_unknown")); } return g; } COM: <s> returns the selectable identified by its id and type </s>
funcom_train/3121945
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void updateList() { //// 1. If we are inconsistent with the table... if (flagDirty == true) { //// 1.1. Create a new list and then sort it. list = new LinkedList(table.entrySet()); Collections.sort(list, internalComp); flagDirty = false; } } // of method COM: <s> make the sorted list consistent </s>
funcom_train/27825135
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected PredicateInfo getPredicateInfo(Predicate predicate) { PredicateInfo predicateInfo=(PredicateInfo)m_predicateInfosByPredicate.get(predicate); if (predicateInfo==null) { predicateInfo=new PredicateInfo(predicate); m_predicateInfosByPredicate.put(predicate,predicateInfo); predicateInfo.initialize(); } return predicateInfo; } COM: <s> returns predicate info for given predicate </s>
funcom_train/12803780
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void initializeCommands( ) { //example //commandMgr.addAction(new ActionPerformer("cut", this)); //commandMgr.addAction(new ActionPerformer("copy", this)); //commandMgr.addAction(new ActionPerformer("paste", this)); //commandMgr.addAction(new ActionPerformer("delete", this)); } COM: <s> the command manager automatically creates actions for menu items and </s>
funcom_train/21002424
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Topic create_topic(String topic_name, EntityId topicId, String type_name, int dataLength, TopicQos qos, TopicListener a_listener) { try { TopicImpl newTopic = new TopicImpl(this,topicId,topic_name,type_name,dataLength,qos,new TopicProfile(),a_listener); _db.registerTopic(newTopic); return newTopic; } catch (RTjDDSException e) { return null; } } COM: <s> not standard to be modified lisher impl </s>
funcom_train/35744137
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setCredential(Credential localCredential) { if (localCredential == null) { this.localCredential = localCredential; } else { try { MembershipService membership = group.getMembershipService(); this.localCredential = membership.getDefaultCredential(); } catch (Exception failed) { this.localCredential = null; } } } COM: <s> sets our credential to be used by this socket connection </s>
funcom_train/49604270
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void connectMiddle(LinkedList<Point> ext, Point goal) { double dist = world.roadNetwork.averageRoadLength(); double dir = ext.getLast().direction(goal); Point p; while ( ! ext.getLast().equals(goal)) { if (ext.getLast().distance(goal) < dist * 1.5) { p = new Point(goal); } else { p = new Point(ext.getLast(), dir, dist); } ext.addLast(p); } } COM: <s> connect the middle between already built roads use last point in ext and </s>
funcom_train/36797654
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: { Iterator itr = MainPageControl.get().getEventsCollection().iterator(); while(itr.hasNext()) { OEvent check = (OEvent) itr.next(); EventSection[] sect = check.getEventInfo().getSections(); for(int i = 0; i < sect.length; i++) { String currentName = String.valueOf(sect[i].getPrice()); if(currentName.equals(name)) { PriceFilter.add(check); } } } runFilter(); } COM: <s> adds all events with price name to the price collection and then </s>
funcom_train/33437561
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public BigDecimal getTotalShipping() { BigDecimal tempShipping = BigDecimal.ZERO; Iterator shipIter = this.shipInfo.iterator(); while (shipIter.hasNext()) { CartShipInfo csi = (CartShipInfo) shipIter.next(); tempShipping = tempShipping.add(csi.shipEstimate); } return tempShipping; } COM: <s> returns the shipping amount from the cart object </s>
funcom_train/8326309
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void valueBound(HttpSessionBindingEvent ev) { String connectString = servletContext.getInitParameter("connectString"); LOGGER.debug("connectString: " + connectString); this.connection = DriverManager.getConnection( connectString, new ServletContextCatalogLocator(servletContext)); if (this.connection == null) { throw new RuntimeException( "No ROLAP connection from connectString: " + connectString); } } COM: <s> create a new connection to mondrian </s>
funcom_train/1928716
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void initBoundVars(Collection formals) { // we want a maximal fixpoint so for all final nodes the // starting value is the empty set // and for all other nodes it is the set of all formals for (Iterator edgeIter = getStateIterator(); edgeIter.hasNext(); ) { SMNode node = (SMNode) edgeIter.next(); if (node.isInitialNode()) node.boundVars = new LinkedHashSet(); else node.boundVars = new LinkedHashSet(formals); } } COM: <s> initialise the bound vars fields for the meet over all paths computation </s>
funcom_train/8048133
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public MTComponent getCreatedSvgComponents(SVGDocument svgDoc){ ArrayList<MTComponent> components = new ArrayList<MTComponent>(); opacityStack.push(1.0f); traverseSVGDoc(svgDoc, components); opacityStack.pop(); MTComponent[] comps = (MTComponent[])components.toArray(new MTComponent[components.size()]); //Only returning the 1st component, since this should be the top-level <svg> element and only 1!? return comps[0]; } COM: <s> creates and returns components of the provided svg document for displaying </s>
funcom_train/48497960
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public PublicHolidayDTO getUsersForPublicHoliday (PublicHolidayDTO holiday) { TimeManagementDAO dao = new TimeManagementDAO(); TimeDTO[] times = dao.selectTimesOfPublicHoliday(holiday.getDay()); if (times != null && times.length > 0) { String[] users = new String[times.length]; for (int i=0; i<times.length; i++) users[i] = times[i].getUser(); holiday.setUsers(users); } return holiday; } COM: <s> which users are assigned to a particular public holiday </s>
funcom_train/5502514
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected Dialog createDialog(Window owner) { Dialog dialog; if (owner instanceof Dialog) { dialog = new Dialog((Dialog) owner, "spin", true); } else if (owner instanceof Frame) { dialog = new Dialog((Frame) owner, "spin", true); } else { throw new Error("owner is no dialog or frame"); } dialog.setUndecorated(true); JProgressBar progressBar = new JProgressBar(); progressBar.setIndeterminate(true); dialog.add(progressBar); return dialog; } COM: <s> create a dialog for the given owner </s>
funcom_train/4470289
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setCurrentPage(int newPage) { if ( newPage > 0 && newPage <= size) { currentPage = newPage; generatePages(); if ( enabled) { NativeEvent event = Document.get().createChangeEvent(); DomEvent.fireNativeEvent(event, this); } } } COM: <s> sets the current page to select </s>
funcom_train/36787405
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Document getBehavior(String urlRequest) { if (mSendBehavior) { StringBuffer getBehavior = new StringBuffer("act=getbehavior"); getBehavior.append(urlRequest); byte[] bytes = sendPost(getBehavior.toString()); Common.streamToFile(bytes, mBehavior_XML, false); return createParseDocument(bytes, null); } else { return createParseDocument(null, new File(mBehavior_XML)); } } COM: <s> gets the behavior of an application </s>
funcom_train/11590852
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isShowTablesToolBox(){ if( isShowAllToolBoxes() ) return true; if (_showTablesToolBox != null) return _showTablesToolBox.booleanValue(); ValueBinding vb = getValueBinding("showTablesToolBox"); return vb != null ? ((Boolean)vb.getValue(getFacesContext())).booleanValue() : false; } COM: <s> show the tables tool box next to the text </s>
funcom_train/7355062
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void collectEvent(Object event) { synchronized(eventQueue) { if (! isCoalesce || ! eventQueue.contains(event)) { if (isLIFO) { eventQueue.addFirst(event); } else { eventQueue.addLast(event); } if (isAlive) startProcessor(); } } } COM: <s> collects an event and puts it into the event queue </s>
funcom_train/45808503
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public JDOVariable createJDOVariable(String prefix, Class type) { // NOTE: Make sure that the names don't collide with the proper // variables while (true) { // Create new variable name String varname = prefix + (vncounter++); // Check if name collides with variable name if (variables.containsKey(varname)) continue; variables.put(varname, type); return new JDOVariable(varname); } } COM: <s> internal create a temporary variable </s>
funcom_train/19887225
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testRead() throws Exception { System.out.println("read"); String id = ""; TransactionLine_DAO instance = null; TransactionLine expResult = null; TransactionLine result = instance.read(id); assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); } COM: <s> test of read method of class edu </s>
funcom_train/10498798
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testInitiateConnection(long sid) throws Exception { if (LOG.isDebugEnabled()) { LOG.debug("Opening channel to server " + sid); } Socket sock = new Socket(); setSockOpts(sock); sock.connect(self.getVotingView().get(sid).electionAddr, cnxTO); initiateConnection(sock, sid); } COM: <s> invokes initiate connection for testing purposes </s>
funcom_train/41724333
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void populateInstanceToNameMap() { Iterator<Field> iterator = fieldList.iterator(); while (iterator.hasNext()) { try { Field field = iterator.next(); Object fieldObject = field.get(null); if (fieldObject == null) continue; O instance = instanceClass.cast(fieldObject); String fieldName = field.getName(); instanceToNameMap.put(instance, fieldName); iterator.remove(); } catch (IllegalAccessException e) { // do nothing here - should never happen } } } COM: <s> populates the instance to name map as much as possible </s>
funcom_train/4228155
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object getPropertyValue(Object id) { if (id.equals(PROPERTY_DIRECTION)) { return new Integer(direction); } if (id.equals(PROPERTY_LABEL)) { return label; } if (id.equals(PROPERTY_SOURCE_TO_TARGET_LABEL)) { return sourceToTargetLabel; } if (id.equals(PROPERTY_TARGET_TO_SOURCE_LABEL)) { return targetToSourceLabel; } return super.getPropertyValue(id); } COM: <s> returns the line style as string for the property sheet </s>
funcom_train/47506307
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean canRead(String pCode) { /* * check if the code is empty or null */ if (StringUtils.isBlank(pCode)) { return false; } /* * search the access in the list and retrieve the can_read value */ for (UserAccess ua : mAccessList) { if (pCode.equals(ua.getAccess().getCode())) { return ua.isRead(); } } return false; } COM: <s> used to check if the user has access to a data </s>
funcom_train/28750887
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setPlatetype(Long newVal) { if ((newVal != null && this.platetype != null && (newVal.compareTo(this.platetype) == 0)) || (newVal == null && this.platetype == null && platetype_is_initialized)) { return; } this.platetype = newVal; platetype_is_modified = true; platetype_is_initialized = true; } COM: <s> setter method for platetype </s>