__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/7293808
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void TestParse() { String arg = "0.0"; DecimalFormat format = new DecimalFormat("00"); double aNumber = 0l; try { aNumber = format.parse(arg).doubleValue(); } catch (java.text.ParseException e) { System.out.println(e); } logln("parse(" + arg + ") = " + aNumber); } COM: <s> do rudimentary testing of parsing </s>
funcom_train/16565307
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void insert(double d, int index) { if (index < 0 || index > size) throw new IllegalArgumentException("required: (index >= 0 && index <= size) but: (index = " + index + ", size = " + size + ")"); ensureCapacity(size + 1); for (int i = size; i > index; i--) value[i] = value[i-1]; value[index] = d; size++; } COM: <s> inserts the value at the specified index location </s>
funcom_train/7615780
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setName(String name) { String oldName; toolkit.lockAWT(); try { autoName = false; oldName = this.name; this.name = name; } finally { toolkit.unlockAWT(); } firePropertyChange("name", oldName, name); //$NON-NLS-1$ } COM: <s> sets the name of the component </s>
funcom_train/36168661
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean get(int pos) { if (pos < 0) { // Negative index specified throw new IndexOutOfBoundsException(("K0006")); //$NON-NLS-1$ } int arrayPos = pos >> OFFSET; if (arrayPos < actualArrayLength) { return (bits[arrayPos] & TWO_N_ARRAY[pos & RIGHT_BITS]) != 0; } return false; } COM: <s> retrieves the bit at index </s>
funcom_train/3289044
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Expire getExpire() { try { if ( this.expire == null ) { this.expire = (FileWatchExpire)ExpireFactory .getExpire( this, ExpireFactory.FILE_WATCH_EXPIRE ); this.expire.setURL( this.getPortletConfig().getURL() ); } return this.expire; } catch ( JetspeedException e ) { Log.error( e ); return null; } } COM: <s> expire this portlet if its url changes on disk </s>
funcom_train/48535874
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getTotalFiles() { int totalFiles = -3; if (this.totalFiles == -2) { totalFiles = 0; // Recursively get the subfolder's total files for (SFolder folder : subFolders) { totalFiles += folder.getTotalFiles(); } for (SFile file : allFiles) { totalFiles++; } if (totalFiles == 0){ totalFiles = -1; } } return totalFiles; } COM: <s> gets the total files recursively looks at all subfolder and files </s>
funcom_train/45109426
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setCheckBox(ContainerOperator operator,Object identifier,boolean enable){ JCheckBoxOperator checkBox = getCheckBoxOperator(operator, identifier); String check = enable? "check" : "uncheck"; if (!checkOperator(checkBox, identifier, "Check box is disabled!", identifier+"\nTried to "+check)){ return; } checkBox.setSelected(enable); } COM: <s> check uncheck a checkbox </s>
funcom_train/32633763
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Expression getValueBySlot(int slot) { slot--; // skip this parameter (not an outer value) for (int i=0; i < headCount; i++) { if (slot == 0) { Expression expr = head[i]; if (i >= headMinCount) headMinCount = i; return expr; } slot -= head[i].getType().stackSize(); } return null; } COM: <s> get the outer value corresponding to a given slot </s>
funcom_train/32097113
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void reinitTIglobalSwitches() { /* reinitTIglobalSwitches */ makeTestsIntersectionTableFlag= false; testsToDoTblFile= null; filterTestField= null; filterTestsList= null; filterDataField= null; filterDataList= null; addFCrangesForTestsIntersectionTableFlag= false; addRangeOfMeansToTItableFlag= false; } /* reinitTIglobalSwitches */ COM: <s> reinit tiglobal switches reinitialize tests intersection global switches </s>
funcom_train/51572262
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testTokenDefRepl() throws Exception { String script = "token = value\ntoken2=${token}"; UncleScriptBuilder builder = parseScript(script); Map<String, String> tokens = builder.getTokens(""); assertEquals(2, tokens.size()); assertEquals("value", tokens.get("token")); assertEquals("value", tokens.get("token2")); } COM: <s> test token replacement in a token definition </s>
funcom_train/41821474
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void save() { //Create a file chooser JFileChooser fc = new JFileChooser(); File defFile = new File("MyPosition"+DT_FMT.format(today)+".html"); fc.setSelectedFile(defFile); //In response to a button click: int returnVal = fc.showSaveDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fc.getSelectedFile(); saveFile(file); } } COM: <s> save the report </s>
funcom_train/43471353
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String properCase(String pstrValue) { StringBuffer properCase = new StringBuffer(pstrValue.length()); properCase.append(Character.toUpperCase(pstrValue.charAt(0))); if (StringUtil.len(pstrValue) > 1) { properCase.append(pstrValue.substring(1).toLowerCase()); } return properCase.toString(); } COM: <s> give string first character as capital all others lower case </s>
funcom_train/49338333
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setVisited(boolean visited) { HiperGpxExtensionType hiperExtension = null; for (int i = 0; i < extensions.size(); i++) { if (extensions.get(i) instanceof HiperGpxExtensionType) { hiperExtension = (HiperGpxExtensionType) extensions.get(i); } } hiperExtension.setVisited(visited); } COM: <s> set whether or not the site has been visited </s>
funcom_train/44780462
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void reset() { fieldDisplayMode = MODE_EDIT; disabledAsBoolean = false; if ( jspReadonly != null ) { readonly = jspReadonly.booleanValue(); jspReadonly = null; } styleClass = jspStyleClass; style = jspStyle; property = jspProperty; mode = jspMode; jspStyleClass = null; jspStyle = null; jspProperty = null; jspMode = null; } COM: <s> reset the tag after is has been processed </s>
funcom_train/14602444
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setTextAttribute(String key, RGB rgb, int style) { if (textAttributeKeyToValueMap == null) { textAttributeKeyToValueMap = new HashMap(); } textAttributeKeyToValueMap.put(key + ELBEUIConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, rgb); textAttributeKeyToValueMap.put(key + ELBEUIConstants.PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX, new Integer(style)); } COM: <s> overwrites the style set in preference store </s>
funcom_train/51423835
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected double tanimoto(BitSet bs1, BitSet bs2) { int b1 = 0, bc = 0, b2= bs2.cardinality(); double t = 0; if (bs1 != null) { //System.out.println(bs.toString()); b1 = bs1.cardinality(); bs1.and(bs2); bc = bs1.cardinality(); //t = 1- (double) bc / ( (double) (b1+b2-bc)); t = (double) bc / ( (double) (b1+b2-bc)); } else { return Double.NaN; } return t; } COM: <s> returns 1 tanimoto distance where </s>
funcom_train/10348242
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void disconnectFromServer() { if (serverConnection.isConnected()) { System.out.println("Disconnect!"); try { Protocol.instance.serializeMessageString(serverConnection.getOutputStream(), ProtocolCommand.Disconnect, ProtocolMessageType.Request, "Disconnect"); serverConnection.close(); } catch (IOException e) { // TODO: Auto-generated catch block e.printStackTrace(); } } } COM: <s> closes the ssl connection to the server </s>
funcom_train/39379185
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean onSecurityCheck() { String pagePath = getContext().getPagePath(getClass()); if (form.onSubmitCheck(this, pagePath)) { return true; } else { getContext().setFlashAttribute("error", getMessage("invalid.form.submit")); return false; } } COM: <s> perform a form submission check to ensure the form was not double posted </s>
funcom_train/28232768
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JEditorPane getOutermostJEditorPane() { View parent = getParent(); FrameSetView frameSetView = null; while (parent != null) { if (parent instanceof FrameSetView) { frameSetView = (FrameSetView)parent; } parent = parent.getParent(); } if (frameSetView != null) { return (JEditorPane)frameSetView.getContainer(); } return null; } COM: <s> finds the outermost frame set view </s>
funcom_train/17206912
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void triggerAsyncCollection(int why) { Plan.setCollectionTriggered(); if (Options.verbose.getValue() >= 1) { if (why == INTERNAL_PHASE_GC_TRIGGER) { System.err.print("[Async-Phase GC]"); } else { System.err.print("[Async GC]"); } } Collector.triggerGC(why); } COM: <s> trigger an asynchronous collection checking for memory </s>
funcom_train/48184923
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void printLfChunks() { List<BitSet> chunks = edgeFactory.lfChunks; for (int i = 0; i < chunks.size(); i++) { BitSet chunk = chunks.get(i); out.println("chunk[" + i + "]: " + Edge.toString(chunk)); } out.flush(); } COM: <s> prints the lf chunks </s>
funcom_train/888211
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void doTreeLayout(){ //now adjust all the constraints Component[] nodes = getComponents(); GridBagLayout layout = (GridBagLayout)getLayout(); for(int i = 0; i < nodes.length; i++){ FreeNode n = (FreeNode)nodes[i]; GridBagConstraints gbc = (GridBagConstraints)layout.getConstraints(n); if(i == nodes.length-1) gbc.weighty=1.0; else gbc.weighty=0.0; layout.setConstraints(n, gbc); } revalidate(); } COM: <s> arrange the nodes in this tree </s>
funcom_train/41708105
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void onHitRobot(HitRobotEvent e) { double bearing = e.getBearing(); if (-10.0D < bearing && bearing < 10.0D) { fire(3); if (e.isMyFault()) { turnRight(10); } } else { shoot(normalRelativeAngle(e.getBearing() + (getHeading() - getRadarHeading())), 3.0D); } } COM: <s> on hit robot </s>
funcom_train/39051682
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String createDirectory() throws IOException { String name = getClass().getName(); int dot = name.lastIndexOf('.'); if (dot > 0) { name = name.substring(dot + 1); } File dir = File.createTempFile(name, "dbdir"); if (!dir.delete()) { throw new RuntimeException("Problem deleting file: " + dir); } if (!dir.mkdir()) { throw new RuntimeException( "Failed to create directory: " + dir); } directory = dir.getPath(); return directory; } COM: <s> creates a per test directory </s>
funcom_train/16795710
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void convertToHSB() { if (type!=ImagePlus.COLOR_RGB) throw new IllegalArgumentException("Image must be RGB"); //convert to hue, saturation and brightness //IJ.showProgress(0.1); ColorProcessor cp; if (imp.getType()==ImagePlus.COLOR_RGB) cp = (ColorProcessor)imp.getProcessor(); else cp = new ColorProcessor(imp.getImage()); ImageStack stack = cp.getHSBStack(); imp.trimProcessor(); imp.setStack(null, stack); imp.setDimensions(3, 1, 1); //IJ.showProgress(1.0); } COM: <s> converts an rgb image to a hsb hue saturation and brightness stack </s>
funcom_train/16784774
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addNewDataLifeCycleAnnotations(long eventInternalID, List<Annotation> annotationList, Connection connection) throws SQLException, IngestException { addAnnotations("exe_data_lifecycle_annotation", "event_id", eventInternalID, annotationList, connection); } COM: <s> add annotations of execution level data lifecycle to db </s>
funcom_train/20309803
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean test(Statement s) { return (subject == null || subject.equals(s.getSubject())) && (predicate == null || predicate.equals(s.getPredicate())) && (object == null || object.equals(s.getObject())) && selects(s); } COM: <s> test whether a statement should be included in a selection </s>
funcom_train/38556888
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public NSArray orderedVisiblePages() { NSMutableArray myArray = new NSMutableArray(orderedChildren()); int i = myArray.count(); for (i = myArray.count(); i >= 0; --i) { C_FeaturePage myPage = (C_FeaturePage) myArray.objectAtIndex(i); if (myPage.appearsInIndex().intValue() == 0) { myArray.removeObjectAtIndex(i); } } return myArray; } COM: <s> computes the subarray of children which are visible </s>
funcom_train/29567275
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private DataSource getDataSourceSpring(String name, JvConfigurationWrapper configWrapper) { DataSource ds = null; try { ds = (DataSource)configWrapper.lookupBean(name); } catch(Exception e) { throw new JavalidDbException("Failed to load spring datasource with beanname=" + name,e); } return ds; } COM: <s> attempts to lookup the data source under given bean name in spring and </s>
funcom_train/5511087
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getBody() { if (rawDoc == null) { return null; } String body = ""; NodeList nl = rawDoc.getElementsByTagName("body"); if (nl.getLength() > 0) { body = getBodyText(nl.item(0)); } return body; } COM: <s> gets the body text attribute of the </s>
funcom_train/16086515
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int currentSegment(float[] coords) { if (index >= getPolygon().numVertices()) { return SEG_CLOSE; } Point2D p = getPolygon().getVertex(index); coords[0] = (float)p.getX(); coords[1] = (float)p.getY(); if (getTransform() != null) { getTransform().transform(coords, 0, coords, 0, 1); } return (index == 0 ? SEG_MOVETO : SEG_LINETO); } COM: <s> returns the coordinates and type of the current path segment in </s>
funcom_train/19324080
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Class loadClass(String className) throws ClassNotFoundException { if (classCache.containsKey(className)) { return (Class) classCache.get(className); } else { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); Class result = classLoader.loadClass(className); classCache.put(className, result); return result; } } COM: <s> load class with given name </s>
funcom_train/31102077
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void synchronizeData() { // no need to sync in the future needsSyncData(false); // fluff data DeferredDocumentImpl ownerDocument = (DeferredDocumentImpl) this.ownerDocument(); target = ownerDocument.getNodeName(fNodeIndex); data = ownerDocument.getNodeValueString(fNodeIndex); baseURI = ownerDocument.getNodeURI(fNodeIndex); } // synchronizeData() COM: <s> synchronizes the data </s>
funcom_train/50920907
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int calculateOverlap(String s1, String s2) { int index = -1; if (s1 != null && s2 != null) { int len = Math.min(s1.length(), s2.length()); // Find the index for the end of overlapping part for (int i = len; i > 0; i--) { String substring = s2.substring(0, i); if (s1.endsWith(substring)) { index = i; break; } } } return index; } COM: <s> found on stack overflow and tweaked </s>
funcom_train/22718457
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void writeForeignKey(ForeignKey key) throws IOException { writeStartElement(FileOpener.XML_ELEMENT_FOREIGN_KEY, FileOpener.ATTRIBUTE_FK_NAME, key.getName()); writeKeyConnection(key.getConnection1()); writeKeyConnection(key.getConnection2()); writeEndElement(FileOpener.XML_ELEMENT_FOREIGN_KEY); } COM: <s> write out the given foreign key in xml format </s>
funcom_train/13257080
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean checkTrafficRequirements() { int count = 0; for (int i = 0; i < names.size(); i++) { if (((Boolean) selected.get(i)).booleanValue()) { if (!types.get(i).equals(JWatVariableInputTable.VarTypes[2]) || count > 0) { return false; } count++; } } if (count == 0) { return false; } return true; } COM: <s> traffic analysis control </s>
funcom_train/8323814
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addFK(final MondrianDef.AggForeignKey fk) { if (this.foreignKeyMap == Collections.EMPTY_MAP) { this.foreignKeyMap = new HashMap<String, String>(); } this.foreignKeyMap.put(fk.getFactFKColumnName(), fk.getAggregateFKColumnName()); } COM: <s> add foreign key mapping entry maps from fact table foreign key </s>
funcom_train/19417171
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testCreationWithBeginIndexLowerZero() throws Exception { try { new SimpleAnnotation(-1, 2, "x", "y", 100, new Attribute[] {}, this.annotionHandler); fail("Oops... must throw IndexOutOfBoundsException"); } catch (final IndexOutOfBoundsException e) { ; } } COM: <s> test the creation with code begin index lt 0 code </s>
funcom_train/10769596
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean contains(CorrelationKey correlationKey) { Iterator<CorrelationKey> e = correlationKeys.iterator(); if (correlationKey == null) { while (e.hasNext()) if (e.next() == null) return true; } else { while (e.hasNext()) { if (correlationKey.equals(e.next())) return true; } } return false; } COM: <s> returns true if this correlation key set contains the give correlation key </s>
funcom_train/23747735
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getMethodName(String gestureName) { if(gestureName.equalsIgnoreCase("Logon")) { return names[0]; } else if(gestureName.equalsIgnoreCase("Add New Entry")) { return names[1]; } else if(gestureName.equalsIgnoreCase("Settings")) { return names[2]; } return ""; } COM: <s> this method returns the string containing the gesuture eg shake to a </s>
funcom_train/36558718
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void dispatchKeyEvent(AWTEvent e) { AWTEventListener l = null; synchronized (keyListeners) { for (int i=0; i<keyListeners.size(); i++) { l = (AWTEventListener) keyListeners.get(i); l.eventDispatched(e); } } worldManager.triggerAWTEvent(); } COM: <s> an internal method to make dispatching easier </s>
funcom_train/17117061
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: static public Contact constructFromBundle(Bundle bundle) { long id = bundle.getLong(EXTRAS_PERSON_ID); // No contact object bundled if (id == 0L) { return null; } String name = bundle.getString(EXTRAS_PERSON_NAME); String phoneNumber = bundle.getString(EXTRAS_PERSON_PHONENUMBER); Bitmap photo = bundle.getParcelable(EXTRAS_PERSON_PHOTO); return new Contact(id, name, phoneNumber, photo); } COM: <s> constructs a contact from a bundle </s>
funcom_train/39786631
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void consoleWrite(String message) { if (console == null) { console = new ConsoleWindowPane(); getDefaultWindow().getContent().add(console); } else if (console.getParent() == null) { getDefaultWindow().getContent().add(console); } console.writeMessage(message); } COM: <s> writes a message to a pop up debugging console </s>
funcom_train/29372325
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public JCheckBox getChkForceVector() { if (chkForceVector == null) { chkForceVector = new JCheckBox(); chkForceVector.setText("Force show Vector"); chkForceVector.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent e) { dc.setBooleanSetting(DisplayConfiguration.DISP_VECTOR_FORCE, chkForceVector.isSelected()); } }); } return chkForceVector; } COM: <s> this method initializes chk force vector </s>
funcom_train/27817242
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testParseAnInvalidSlashdotXML() { NewsParserSlashdot slashdotParser = new NewsParserSlashdot(); Vector returnVector = slashdotParser.parse(invalidReader); assertNotNull("Invalid XML should not result in null", returnVector); assertEquals("Invalid XML should result in empty vector", 0, returnVector.size()); } COM: <s> see if the buffer behaves nicely when theres an invalid xml document given </s>
funcom_train/31802577
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean isBlocked(ECPAddress peer) { ECPAddress blockedPeer; int blockedCount = Integer.parseInt(Utils.getProperty(ECPProtocol.easter_blocked_address_count,"0")); for (int i = 0; i < blockedCount; i++) { blockedPeer = getSavedPeer(Utils.getECPProperties(), i, ECPProtocol.easter_blocked_address); if ((blockedPeer.equals("*@*"))|| (blockedPeer.equals(peer))) { return true; // this is a blocked peer } } return false; } COM: <s> returns true if this peer has been blocked by the user </s>
funcom_train/885046
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int getIntAttr(HTML.Attribute name, int dflt) { AttributeSet attrSet = getElement().getAttributes(); int i = dflt; if (attrSet.isDefined(name)) { // does not check parents! String val = (String) attrSet.getAttribute(name); if (val != null) { try { i = Math.max(0, Integer.parseInt(val)); } catch (NumberFormatException x) { // ignore } } } return i; } COM: <s> look up an integer valued attribute </s>
funcom_train/42949488
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addRightDecoration(JComponent decoration) { if (right != null) topPanel.remove(right); right = decoration; if (right != null) { topPanel.add(decoration, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); } } COM: <s> adds the given jcomponent as a decoration on the right of the title </s>
funcom_train/28362624
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void execute( final AlgorithmStrategy strategy ) { if ( strategy != null ) { _eventProxy.strategyWillExecute( this, strategy, _solver.getScoreBoard() ); strategy.execute( this, _solver.getScoreBoard() ); _eventProxy.strategyExecuted( this, strategy, _solver.getScoreBoard() ); } } COM: <s> execute the specified strategy </s>
funcom_train/34565034
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String number(final Cmd cmd) throws QueryException { consumeWS(); final TokenBuilder tb = new TokenBuilder(); if(curr() == '-') tb.add(consume()); while(digit(curr())) tb.add(consume()); return finish(cmd, tb); } COM: <s> parses and returns a number </s>
funcom_train/18845018
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public XORSplitDataBased createGatewaySplitXORDataBased(String nodeID, String nodeLabel, int xPosition, int yPosition, PrivateProcessPoolLane lane) { XORSplitDataBased cn = new XORSplitDataBased(); cn.setNodeID(nodeID); cn.setNodeLabel(nodeLabel); cn.setXPosition(xPosition); cn.setYPosition(yPosition); cn.setProcessPoolLane(lane); return cn; } COM: <s> create gateway split </s>
funcom_train/1448699
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String createBannerAccount() throws Exception { if (logger.isDebugEnabled()) { logger.debug("createBannerAccount() - start"); //$NON-NLS-1$ } try { BannerAccountsServiceDelegator.inserBannerAccount(bannerAccount); } catch (HibernateException e) { return INPUT; } if (logger.isDebugEnabled()) { logger.debug("createBannerAccount() - end"); //$NON-NLS-1$ } return SUCCESS; } COM: <s> creates the banner account </s>
funcom_train/3350939
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getYear() { final int control = cmos.getRegister(RTC_CONTROL); int year = cmos.getRegister(CMOS_RTC_YEAR); if ((control & RTC_DM_BINARY) == 0) { year = BCDUtils.bcd2bin(year); } year += 1900; if (year < 1970) { year += 100; } return year; } COM: <s> gets the current year </s>
funcom_train/47515928
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void initChartPersistence(String filename){ if(!chartPersistence.containsFile(filename)){ chartPersistence.addNewFile(filename); ArrayList<ArrayList<JFreeChart>> panels = chartPersistence.getCharts(filename); panels.add(new ArrayList<JFreeChart>()); // tab 1 'combined dataset' panels.add(new ArrayList<JFreeChart>()); // tab 2 'subject dataset' panels.get(0).add(null); panels.get(1).add(null); } } COM: <s> initialize persistence for a single file </s>
funcom_train/31402827
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void transform() { super.transform(); Package p = getNameInfo().createPackage(newName); PackageReference pr = PackageKit.createPackageReference(getProgramFactory(), p); for (int i = refs.size() - 1; i >= 0; i--) { PackageReference ref = refs.get(i); replace(ref, pr.deepClone()); } } COM: <s> locally renames all package references collected in the analyzation </s>
funcom_train/34649427
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void run() { Display display = new Display(); Shell shell = new Shell(display); shell.setText("TreeExample"); createContents(shell); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } COM: <s> runs the application </s>
funcom_train/47281099
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public MungeStep getMungeStep(Class<? extends MungeStep> create) { try { return create.newInstance(); } catch (Throwable t) { throw new RuntimeException("Error generating munge step: " + create.getName() + ". " + "Possibly caused by an error thrown in the constructor.", t); } } COM: <s> creates a new instance of the given class wrapping any possible </s>
funcom_train/1753112
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public GMFolder updateFolder(final GMFolder folderUpdate) { GMFolder folder = (GMFolder)folders.get(folderUpdate.getFullName()); if (folder == null) { folder = folderUpdate; folders.put(folderUpdate.getFullName(), folder); } else { // apply new info folder.applyUpdate(folderUpdate); } return folder; } COM: <s> apply update to the primary instance for a gmfolder </s>
funcom_train/11102034
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testPutCalled() throws Exception { AltHashtable.lastKey = null; AltHashtable.lastValue = null; LogFactory.getLog(AltHashtableTestCase.class); ClassLoader contextLoader = Thread.currentThread().getContextClassLoader(); assertEquals(contextLoader, AltHashtable.lastKey); assertNotNull(AltHashtable.lastValue); } COM: <s> verify that when log factory sees a context classloader for the </s>
funcom_train/50863758
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private VehicleMission getMissionNeedingUnloading() { VehicleMission result = null; List<Mission> unloadingMissions = getAllMissionsNeedingUnloading(person.getSettlement()); if (unloadingMissions.size() > 0) { int index = RandomUtil.getRandomInt(unloadingMissions.size() - 1); result = (VehicleMission) unloadingMissions.get(index); } return result; } COM: <s> gets a random vehicle mission unloading at the settlement </s>
funcom_train/28425979
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void valueChanged(TreeSelectionEvent e) { TreePath path = e.getPath(); if(path != null) { DefaultMutableTreeNode node = (DefaultMutableTreeNode)path.getLastPathComponent(); File dir = (File)node.getUserObject(); dirText.setText(dir.getAbsolutePath()); } } COM: <s> write the dir selection in the text field </s>
funcom_train/22655930
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected File getFile(FileItem fileItem, MojoInfo mojoInfo) { // Get the base directory File projectDir = mojoInfo.getProject().getBasedir(); String sourceName = fileItem.getSource(); File file = new File (sourceName); if (!file.exists()) { file = new File (projectDir, sourceName); } return file; } COM: <s> gets the names of the selected files </s>
funcom_train/45622853
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addContinueOnErrorPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_TaskType_continueOnError_feature"), getString("_UI_PropertyDescriptor_description", "_UI_TaskType_continueOnError_feature", "_UI_TaskType_type"), MSBPackage.eINSTANCE.getTaskType_ContinueOnError(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the continue on error feature </s>
funcom_train/17157641
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void setupContextMenu() { this.ui.commitmentsTableWidget .setContextMenuPolicy(ContextMenuPolicy.CustomContextMenu); contextMenu.addAction(this.ui.actionNewCommitment); contextMenu.addAction(this.ui.actionEditCommitment); contextMenu.addAction(this.ui.actionRemoveCommitment); contextMenu.addAction(this.ui.actionManageAssociations); } COM: <s> setup a context menu for commitment table widget </s>
funcom_train/48231078
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getCountOfStudySets(){ int count = 0; try { PreparedStatement ps = dbConnection.prepareStatement("select count(*) from STUDY_SETS"); ResultSet rs = ps.executeQuery(); rs.next(); count = rs.getInt("count(*)"); return count; } catch (SQLException e) { e.getStackTrace(); return count; } } COM: <s> retrieves count of the study sets </s>
funcom_train/36510833
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public SipProfile getAccount(long accountId){ if(accountId <0){ return new SipProfile(); } try { Cursor c = db.query(ACCOUNTS_TABLE_NAME, SipProfile.full_projection, SipProfile.FIELD_ID + "=" + accountId, null, null, null, null); int numRows = c.getCount(); if(numRows > 0){ c.moveToFirst(); SipProfile account = new SipProfile(); account.createFromDb(c); c.close(); return account; } c.close(); } catch (SQLException e) { Log.e("Exception on query", e.toString()); } return null; } COM: <s> get the corresponding account for a give id id is database id </s>
funcom_train/43275992
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addServiceLocation(final String wsdlRoot, final File directory) { synchronized (serviceLocations) { Collection locations = (Collection) serviceLocations.get(wsdlRoot); if (locations == null) { locations = new LinkedList(); serviceLocations.put(wsdlRoot, locations); } LOGGER.debug("Adding service location for WSDL '" + wsdlRoot + "': " + directory); locations.add(directory); } } COM: <s> add a services location all services that are in this directory or its </s>
funcom_train/18209377
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void cancelExtractionQuery() { // Sets the default option to cancelin the extraction and exiting String defaultOption = "Cancel and exit"; String[] options = { defaultOption, "No" }; // Queries the user int choice = JOptionPane.showOptionDialog( getThis(), "The extraction cannot continue without acceptance of the license." + NEWLINE + "Would you like to exit the extraction?", "Extraction cancellation", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, defaultOption); // Exits if default option taken switch (choice) { case 0: exit(); break; case 1: default: } } COM: <s> asks user whether the extraction should be cancel and exited </s>
funcom_train/3881760
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getUse() { XSDConcreteComponent comp = _attDecl.getContainer(); if (comp instanceof XSDAttributeUse) { XSDAttributeUseCategory useCat = ((XSDAttributeUse) comp).getUse(); return useCat.getName(); } else if (comp instanceof XSDSchema) { return "optional"; } return "optional"; } COM: <s> get the use of this attribute </s>
funcom_train/40505957
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void confirmExit() { int choice = JOptionPane.showConfirmDialog(frame, "Do you really want to quit?", "Quit the level editor", JOptionPane.YES_NO_OPTION); if (choice == JOptionPane.YES_OPTION) { if (project != null) { project.close(); } System.exit(0); } } COM: <s> presents an are you sure dialog and exits the application if the user </s>
funcom_train/21112901
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void actionPerformed(ActionEvent evt) { if (evt.getSource().equals(this.closeButton)) { /* * removed the tab from the tab list in the TabWidget */ this.pane.getAllTabs().remove(ClosableTab.this); /* * Removes the tab from the panel */ this.pane.remove(this.pane.indexOfTabComponent(ClosableTab.this)); } } COM: <s> contols the close action when the close button is clicked </s>
funcom_train/21439457
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Set getMissed(int maxMessageId) { Set missed = new TreeSet(); for (int id = lowMessageId + 1; id <= maxMessageId; id++) { missed.add(new Integer(id)); } //remove ids for messages we do have for (Entry k = first; k != null; k = k.next) { missed.remove(new Integer(k.messageId)); } return missed; } COM: <s> returns a set containing all the ids we </s>
funcom_train/1339033
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setImage(BufferedImage image) { if (image.getWidth() != this.image.getWidth() || image.getHeight() != this.image.getHeight()) { throw new IllegalArgumentException("Dimensions must match! " + image + ":" + this.image); } this.image = new WrappedBufferedImage(image); } COM: <s> replace the current image with an image that is the same size </s>
funcom_train/38293014
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void validateSlots(AbsObject abs, Ontology onto) throws OntologyException { // Validate all the attributes in the abstract descriptor String[] slotNames = getNames(); for (int i = 0; i < slotNames.length; ++i) { AbsObject slotValue = abs.getAbsObject(slotNames[i]); CaseInsensitiveString ciName = new CaseInsensitiveString(slotNames[i]); validate(ciName, slotValue, onto); } } COM: <s> for each slot </s>
funcom_train/25797127
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean seek(INotifiableManager manager, SeekType type, int progress) { if (type.compareTo(SeekType.absolute) == 0) return mConnection.getBoolean(manager, "SeekPercentage", String.valueOf(progress)); else return mConnection.getBoolean(manager, "SeekPercentageRelative", String.valueOf(progress)); } COM: <s> seeks to a position </s>
funcom_train/22155874
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void propertyChange(PropertyChangeEvent evt) { Color[] colors = tabPanel.getTabColors(); /* Set the tabColors property (attribute) to the new value. */ tabPanel.setTabColors(tabPanel.getSelectedTabNum(), ((ColorSelector)evt.getSource()).getSelectedColor()); firePropertyChange("tabColors", null, tabPanel.getTabColors()); invalidate(); if (tabPanel.isVisible()) tabPanel.repaint(); } COM: <s> method to handle events for the property change listener interface </s>
funcom_train/22359087
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setCoordinateTranslation(EntityID otherFaction, CoordinateID usedTranslation) { Map<Integer, CoordinateID> layerMap = coordinateTranslations.get(otherFaction); if (layerMap == null) { layerMap = new LinkedHashMap<Integer, CoordinateID>(); coordinateTranslations.put(otherFaction, layerMap); } layerMap.put(usedTranslation.getZ(), usedTranslation); } COM: <s> sets the coordinate translation of code other faction code to the owner faction </s>
funcom_train/37062156
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void receiveChangeDiagram( Graphics2D g2d, int index, int type ) { LOGGER.debug( "receiveChangeDiagram" ); // switch to continuous graph-drawing prop.setFilledDiagram( false ); if ( index == prop.getDiagramIndex() && prop.getDiagramType() == IDiagramPanel.PROFILE_GRAPH ) prop.setDiagramType( IDiagramPanel.LINE_GRAPH ); } COM: <s> listener method to change diagram </s>
funcom_train/13427401
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setDecoratingGraph(GraphDecorator decoratingGraph) { /* David 06/06/2006: Here we allow the setting of a null decoratingVertex */ if (decoratingGraph != null && decoratingGraph.getDecoratedIGraph() != this) { throw new InvalidIVertexException( "Error occured in syncornisation of the decorators of the edge " + this.getName()); } this.decoratingGraph = decoratingGraph; } COM: <s> sets decorating graph as the current igraphs upper decorator level </s>
funcom_train/41344403
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void matchNode(RenderThemeCallback renderThemeCallback, List<Tag> tags, byte zoomLevel) { for (int i = 0, n = this.rulesList.size(); i < n; ++i) { this.rulesList.get(i).matchNode(renderThemeCallback, tags, zoomLevel); } } COM: <s> matches a node with the given parameters against this render theme </s>
funcom_train/29781798
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ReturnCode cvsTag(String dir, String tag) { ReturnCode exitVal = ReturnCode.CVS_OK; try { List<String> command = new ArrayList<String>(); command.add("tag"); command.add(tag); exitVal = executeCvsCommand(command, dir); } catch (Throwable t) { t.printStackTrace(); } return(exitVal); } COM: <s> runs cvs tag on a file in a given drectory or file </s>
funcom_train/22896053
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void waitUntilInitialized() { synchronized(this.hasInitialized) { if (false == this.hasInitialized[0]) { try { log.debug("must wait in waitUntilInitialized"); this.hasInitialized.wait(); log.debug("woke up in waitUntilInitialized"); } catch (InterruptedException e) { // XXX Is this sufficient handling? log.warn("Interrupted ignored in waitUntilInitialized: "); e.printStackTrace(); } } } } COM: <s> suspend caller thread until script has been initialized </s>
funcom_train/25099398
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addKindPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_BindingTime_kind_feature"), getString("_UI_PropertyDescriptor_description", "_UI_BindingTime_kind_feature", "_UI_BindingTime_type"), FeaturemodelingPackage.Literals.BINDING_TIME__KIND, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the kind feature </s>
funcom_train/21018338
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addDataSet(int index, DataSet dataSet) { requireNotNull(dataSet, "@require (dataSet != null)"); requireTrue(index >= 0, "@require (index >= 0)"); if (index > _dataSeries.size()) { index = _dataSeries.size(); } _dataSeries.add(index, dataSet); fireDataSetAdded(dataSet); } COM: <s> adds a data set to the data series at the given index </s>
funcom_train/27789419
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected boolean askPortFromUser() { BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); System.out.print("Give a port number where to run " + "OpenMDV: "); try { port = Integer.parseInt(stdin.readLine()); } catch (Exception e) { return false; } return isPortFree(port); } COM: <s> asks a port number for tomcat and checks its </s>
funcom_train/2807115
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public double getShippableWeight() { double weight = 0.0; Iterator i = iterator(); while (i.hasNext()) { ShoppingCartItem item = (ShoppingCartItem) i.next(); if (item.shippingApplies()) { weight += (item.getWeight() * item.getQuantity()); } } return weight; } COM: <s> returns the total shippable weight in the cart </s>
funcom_train/46788631
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void initializeOXPDb() throws SQLException { if (propXobjTableInitialized) return; propXobjTableInitialized = true; try{ conn.createStatement().execute("CREATE TEXT TABLE objectsXproperties " + "(worblehat_id INTEGER, prop_id INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 0) PRIMARY KEY )"); } catch (SQLException ex) {} conn.createStatement().execute("SET TABLE objectsXproperties SOURCE \"metadata.objectsxproperties;encoding=UTF-8\""); } COM: <s> initializes the objects xproperties table </s>
funcom_train/43294370
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean addProcessDefinitions(List processDefinitions) { synchronized (m_ProcessDefinitionsLock) { //valid? if (processDefinitions == null) { //couldn't add return false; } // successful boolean successful = true; // iterator over all items Iterator iterator = processDefinitions.iterator(); // temporary variables ProcessDefinition currentProcessDefinition; String name; // iterate while (iterator.hasNext()) { // get current process definition currentProcessDefinition = (ProcessDefinition) iterator.next(); // add process definition successful = successful && addProcessDefinition(currentProcessDefinition); } //successful? return successful; } } COM: <s> p add process definitions p </s>
funcom_train/8170067
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int getFunctionArgs(String name) { for(int i=Environment_stack.size()-1; i>=0; i--) { if(((Environment_scope)Environment_stack.elementAt(i)).functions.containsKey(name)) { return ((Environment_scope)Environment_stack.elementAt(i)).functions.get(name); } } return -1; } COM: <s> retrieve excepted function arguments </s>
funcom_train/45875437
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ILocationCtx pushPreInclusion(char[] buffer, int offset, boolean isMacroFile) { assert fCurrentContext instanceof LocationCtxContainer; int sequenceNumber = getSequenceNumberForOffset(offset); fCurrentContext = new LocationCtxContainer((LocationCtxContainer) fCurrentContext, buffer, offset, offset, sequenceNumber); fLastChildInsertionOffset = 0; return fCurrentContext; } COM: <s> starts an artificial context that can be used to include files without </s>
funcom_train/3279493
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setActiveEditor(IEditorPart part){ super.setActiveEditor(part); ITextEditor editor = null; if (part instanceof ITextEditor){ editor = (ITextEditor) part; } fContentAssistProposal.setAction( getAction(editor, "ContentAssistProposal.") ); fContentFormatProposal.setAction( getAction(editor, "ContentFormatProposal.") ); fContentAssistTip.setAction( getAction(editor, "ContentAssistTip.") ); } COM: <s> sets the active editor to this contributor </s>
funcom_train/19073630
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean hasStepCounter() { Vector inputs = getAllInputs(); if (inputs == null){ return false; } for (int x = 0; x < inputs.size(); ++x) { if (inputs.elementAt(x) instanceof InputSynapse) { InputSynapse inp = (InputSynapse) inputs.elementAt(x); if (inp.isStepCounter()){ return true; } } } return false; } COM: <s> determine whether this layer has an input synapse attached </s>
funcom_train/3944224
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isEqual(Ray r) { if (r == null || !Ray.isValidRay(r)) { throw new IllegalArgumentException( "isEqual() called with Ray that is either null or not valid"); } return (start.isEqual(r.getStart()) && direction.isEqual(r .getDirection())); } COM: <s> test equality of rays </s>
funcom_train/9700647
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void init(IWorkbench workbench, IStructuredSelection _selection) { this.selection = _selection; mWorkbench=workbench; page2List=new Vector<BasicDBDefinitionPage>(); int counter = DBDefintionPage.classNames().size(); for (int i=0;i<counter;i++){ try { page2List.add(DBDefintionPage.getPage(i, this,dbPageImageURL)); } catch (Exception e) { logger.log(e); } } //setHelpAvailable(true); // not necessairily needed } COM: <s> we will accept the selection in the workbench to see if </s>
funcom_train/18742859
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String getActionName(GraphRole role) { GraphJGraph jGraph = getJGraph(); boolean isState = jGraph instanceof AspectJGraph && ((AspectJGraph) jGraph).isForState(); String type = isState ? "State" : role.getDescription(); return "Export " + type + " ..."; } COM: <s> returns the export action name for a given jgraph being saved </s>
funcom_train/8686592
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void add(ResourceCollection c) { checkChildrenAllowed(); if (c == null) { return; } if (union == null) { union = new Union(); union.setProject(getProject()); union.setCache(false); } union.add(c); setChecked(false); } COM: <s> add a nested code resource collection code </s>
funcom_train/38345496
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected Rule readRule(File f) { Rule r = null; JAXBContext context; try { context = JAXBContext.newInstance(Rule.class); Unmarshaller um = context.createUnmarshaller(); r = (Rule)um.unmarshal(f); } catch (JAXBException e) { e.printStackTrace(); } return r; } COM: <s> method reads the rule file and returns a rule object </s>
funcom_train/28752282
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setProcedurechargemodifier(Long newVal) { if ((newVal != null && this.procedurechargemodifier != null && (newVal.compareTo(this.procedurechargemodifier) == 0)) || (newVal == null && this.procedurechargemodifier == null && procedurechargemodifier_is_initialized)) { return; } this.procedurechargemodifier = newVal; procedurechargemodifier_is_modified = true; procedurechargemodifier_is_initialized = true; } COM: <s> setter method for procedurechargemodifier </s>
funcom_train/1201932
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testBug28256() throws Exception { try { this.conn.setReadOnly(true); this.stmt.execute("(SELECT 1) UNION (SELECT 2)"); this.conn.prepareStatement("(SELECT 1) UNION (SELECT 2)").execute(); ((com.mysql.jdbc.Connection) this.conn).serverPrepareStatement("(SELECT 1) UNION (SELECT 2)").execute(); } finally { this.conn.setReadOnly(false); } } COM: <s> tests fix for bug 28256 when connection is in read only </s>
funcom_train/40716626
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void appendAnonymousInterfaces() { for (Schema schema : anonymousSchemas) { appendLine(); appendLine("private abstract static class " + getAnonymousJavaType(schema)); appendLine(" extends GxpTemplate.AnonymousGxpClosure"); appendLine(" implements " + schema.getJavaType() + " {"); appendLine("}"); } } COM: <s> generates private abstract static classes for all the anonymous closures </s>