__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/42443232
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String replacePercentU(String value) { int pos; while ((pos = value.indexOf("%u")) != -1) { value = value.substring(0, pos) + (char) (Integer.valueOf( value.substring(pos + 2, pos + 6), 16).intValue()) + value.substring(pos + 6); } return value; } COM: <s> replaces u nnnn encodings with the real unicode characters </s>
funcom_train/32769955
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JMenuItem getMenuItemPoint() { if (menuItemPoint == null) { menuItemPoint = new JMenuItem(); menuItemPoint.setText(OpenJCADLanguage.getString("_point_")); // Generated menuItemLine.addActionListener(new OpenJCADDraw2DPointAction(this.tabbedPane)); } return menuItemPoint; } COM: <s> this method initializes menu item point </s>
funcom_train/16785379
/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) { GridLayout gridLayout1 = new GridLayout(); gridLayout1.setRows(4); jPanel = new JPanel(); jPanel.setLayout(gridLayout1); jPanel.add(getJPanel2(), null); jPanel.add(getJPanel1(), null); jPanel.add(getJPanel3(), null); // jPanel.add(getJPanel5(), null); jPanel.add(getJPanel42(), null); } return jPanel; } COM: <s> this method initializes j panel </s>
funcom_train/22901800
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testCommitWriteTake() throws Exception { TransactionManager transactionManager = new MockTransactionManager(); Transaction transactionA = TransactionFactory.create(transactionManager, TEN_MINUTES).transaction; javaSpace.write(new TestEntry(), transactionA, TEN_MINUTES); assertNotNull(javaSpace.take(new TestEntry(), transactionA, JavaSpace.NO_WAIT)); transactionA.commit(); assertNull("Not written to space", javaSpace.readIfExists(new TestEntry(), null, JavaSpace.NO_WAIT)); } COM: <s> tests writing then taking an entry under a transaction then committing </s>
funcom_train/18037172
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getElementNamespaceUri(Object object) { if (debugging) { System.out.println("getElementNamespaceUri() :" + ((XMLEvent) object).toString()); } if (isElement(object)) { String uri = ((StartElement) object).getName().getNamespaceURI(); if (uri == null) { uri = ""; } return uri; } else { return null; } } COM: <s> get the namespace uri of an element </s>
funcom_train/19318151
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int readBytes(byte[] value) throws JMSException { if(isBodyModifiable()) { throw new MessageNotReadableException("BytesMessage write_only"); } try { return this.getInputStream().read(value); } catch(IOException e) { throw new JMSException(e.getMessage()); } } COM: <s> reads a byte array from the bytes message stream </s>
funcom_train/33264078
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getRowIndexFromArg( Object arg ) { synchronized(getTreeLock()) { int count = getItemCount(); for ( int i = 0; i < count; i++ ) { Object rowarg = getRow(i).getArg(); if ( rowarg == arg ) { return i; } } return -1; } } COM: <s> get row index from arg </s>
funcom_train/3710126
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void selectSection() { Integer tt, bt; String txtt = top_text.getText(); String txtb = bottom_text.getText(); try { tt = new Integer (txtt); bt = new Integer (txtb); } catch (NumberFormatException e) { return; } top = tt.intValue(); bottom = bt.intValue(); goRead(); } COM: <s> selects lines from the two input widgets </s>
funcom_train/10204903
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addMReferenceTypePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_MReference_mReferenceType_feature"), getString("_UI_PropertyDescriptor_description", "_UI_MReference_mReferenceType_feature", "_UI_MReference_type"), ClassDiagramPackage.Literals.MREFERENCE__MREFERENCE_TYPE, false, false, false, null, null, null)); } COM: <s> this adds a property descriptor for the mreference type feature </s>
funcom_train/31056695
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Color makePastel( Color c ) { // uhm - maybe this makes the colors pastel? nelson said it // would :) float[] hsb = Color.RGBtoHSB( c.getRed(), c.getGreen(), c.getBlue(), null ); hsb[1] = (float)0.4; hsb[2] = (float)0.95; return Color.getHSBColor( hsb[0], hsb[1], hsb[2] ); } COM: <s> a magic function i really dont know how to make colors </s>
funcom_train/22274563
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void actionPerformed(ActionEvent ae) { if (ae.getSource().getClass().toString().equals("class javax.swing.JButton")) { buttonEvent(ae, (JButton) ae.getSource()); } else { System.err.println("DiaDetails.actionPerformed() called with \"bad\" source object class: "+ae.getSource().getClass().toString()); } } COM: <s> reacts on actions and performs something </s>
funcom_train/51617144
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setMinCountToAccept( final int minCountToAccept ) throws IllegalArgValException { if( numResultsToCheck < 1 ) throw new IllegalArgValException( "The number of matches to trigger must be at least 1" ); this.minCountToAccept = minCountToAccept; if( numResultsToCheck < minCountToAccept ) this.minCountToAccept = numResultsToCheck; } COM: <s> sets the minimum number of successful comparisons to accept i </s>
funcom_train/35811824
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean closeSession(SyslogSession session) { boolean result = false; if (session != null) { if (!session.isClosed()) { session.close(); try { SyslogSessionMapper mapper = new SyslogSessionMapper(db); if (mapper.save(session)) { result = true; } } catch (Exception e) { e.printStackTrace(); } } else { // session is already closed result = true; } } return result; } COM: <s> closes given session and saves it into database </s>
funcom_train/42709739
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void validate() { DataException.verifyNotBlank(this.relationshipFile, "'relationshipFile' attribute is mandatory"); DataException.verifyNotNull(this.traits, "'traits' attribute is mandatory"); DataException.verifyNotNull(this.weights, "'weights' attribute is mandatory"); } COM: <s> perform simple validation </s>
funcom_train/11793391
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int size() { int size = 0; for (int i = 0; i < tables.length; i++) { SubTable entry = tables[i]; while (entry != null) { size += ((Map) entry.getValue()).size(); entry = entry.next; } } return size; } COM: <s> return the number of mappings </s>
funcom_train/23012168
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public MessageHeader nextPart() { if(endOfPart) { if(nextPartHeader != null) { endOfPart = false; currentPartHeader = nextPartHeader; currentPartName = nextPartName; nextPartHeader = null; nextPartName = null; return currentPartHeader; } else { return null; } } else { return null; } } COM: <s> begins reading the next part </s>
funcom_train/3167513
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setAgeBlock(AgeBlock ageBlock) throws java.beans.PropertyVetoException { AgeBlock oldAgeBlock = this.ageBlock; vetoableChangeSupport.fireVetoableChange("ageBlock", oldAgeBlock, ageBlock); this.ageBlock = ageBlock; propertyChangeSupport.firePropertyChange("ageBlock", oldAgeBlock, ageBlock); } COM: <s> setter for property age block </s>
funcom_train/43245298
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetStreetAddr2() { System.out.println("getStreetAddr2"); FamilyDemographicDependentObject instance = new FamilyDemographicDependentObject(); String expResult = ""; String result = instance.getStreetAddr2(); assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); } COM: <s> test of get street addr2 method of class org </s>
funcom_train/12165061
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ReusableStringBuffer allocateObject() { if (next < pool.size()) { return (ReusableStringBuffer) pool.get(next++); } else { // expand the pool by the initialSize for (int i = 0; i < initialSize; i++) { pool.add(createObject()); } return (ReusableStringBuffer) pool.get(next++); } } COM: <s> allocate an object in the pool </s>
funcom_train/38556550
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean hasRoleWithName(String aName) { Enumeration e = roles().objectEnumerator(); while (e.hasMoreElements()) { U_Role myRole = (U_Role) e.nextElement(); if (myRole.name() != null && myRole.name().equals(aName)) { return true; } } return false; } COM: <s> determine if this actor is associated with the named role </s>
funcom_train/181997
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void drawObjects(Graphics g){ /* get the current environment */ Environment env = ClientGUIEngine.getEnvironment(); /* draw all the objects in the environment */ if (field.isDrawingObjects()) { for (int i = 0; i < env.numberOfObjects(); i++) { BaseObject curr = env.getObject(i); GUIFunctionFactory.getSmallDrawFunction(curr.getClass()).execute(curr, g); } } } COM: <s> draws all the objects in the environment </s>
funcom_train/15801830
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void initKeys() throws IOException { LineNumberReader in = null; try { in = new LineNumberReader( new FileReader(fidx)); ArrayList k = new ArrayList(50000); String s; int i = 0; while ((s=in.readLine()) != null) { if (++i != 0 && i % 4000 == 0) Thread.currentThread().yield(); k.add(new Key(s)); } keys = new KeyList(k.toArray()); } finally { if (in != null) in.close(); } } COM: <s> reads the index into memory </s>
funcom_train/16721055
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int SmpFrqIndex(final int sample_freq, final LameGlobalFlags gpf) { switch (sample_freq) { case 44100: gpf.version = 1; return 0; case 48000: gpf.version = 1; return 1; case 32000: gpf.version = 1; return 2; case 22050: gpf.version = 0; return 0; case 24000: gpf.version = 0; return 1; case 16000: gpf.version = 0; return 2; case 11025: gpf.version = 0; return 0; case 12000: gpf.version = 0; return 1; case 8000: gpf.version = 0; return 2; default: gpf.version = 0; return -1; } } COM: <s> convert samp freq in hz to index </s>
funcom_train/25374593
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean equals(Object other) { if (!(other instanceof AssociationRule)) { return false; } AssociationRule otherRule = (AssociationRule)other; boolean result = getPremise().equals(otherRule.getPremise()) && getConsequence().equals(otherRule.getConsequence()) && (getPrimaryMetricValue() == otherRule.getPrimaryMetricValue()); return result; } COM: <s> return true if this rule is equal to the supplied one </s>
funcom_train/36035599
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean selectionIsFile() { if (fileTree != null) { if (fileTree.getSelectionCount() == 1) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) fileTree.getSelectionPath().getLastPathComponent(); return (!node.getAllowsChildren()); } } return false; } COM: <s> determine wether a single file has been selected in the file tree </s>
funcom_train/18358306
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void makeButtons(String[] buttonNames) { if (buttonNames == null) { return; } for (int i = 0; i < buttonNames.length; i++ ) { String bn = buttonNames[i]; JButton aButton = new JButton(bn); aButton.setName(bn); buttons.add(aButton); aButton.addActionListener(this); aButton.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE)); this.add(aButton); } } COM: <s> sets up the buttons on the form </s>
funcom_train/23410460
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addComputedInputPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_CompositeProcess_computedInput_feature"), getString("_UI_PropertyDescriptor_description", "_UI_CompositeProcess_computedInput_feature", "_UI_CompositeProcess_type"), ProcessPackage.Literals.COMPOSITE_PROCESS__COMPUTED_INPUT, true, false, true, null, null, null)); } COM: <s> this adds a property descriptor for the computed input feature </s>
funcom_train/31930846
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JPanel createPropertyFileRootPathPane() { JPanel p = boxPanel(BoxLayout.X_AXIS); p.add(m_propertyFileRootPathField); p.add(narrowSpacer()); p.add(createPropertyFileRootPathBrowseButton()); return createComponentPane("Property File Root Path", p, false); } COM: <s> create a pane for the property file root path complete with a browse </s>
funcom_train/35812005
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean deleteBelow(long count) { boolean result = false; try { PreparedStatement pr = null; try { Connection conn = db.getConnection(); pr = conn.prepareStatement("delete from syslog where id < " + "(select min(id) from (select id " + "from syslog order by id desc limit ?))"); pr.setLong(1, count); pr.executeUpdate(); result = true; } catch (Exception e) { e.printStackTrace(); } finally { db.Cleanup(pr); } } catch (Exception e) { e.printStackTrace(); } return result; } COM: <s> leaves only given number of latest syslog messages in database and </s>
funcom_train/50081177
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setup(IAtomContainer atomContainer, Rectangle screen) { this.setScale(atomContainer); Rectangle2D bounds = calculateBounds(atomContainer); this.modelCenter = new Point2d(bounds.getCenterX(), bounds.getCenterY()); this.drawCenter = new Point2d(screen.getCenterX(), screen.getCenterY()); this.setup(); } COM: <s> setup the transformations necessary to draw this atom container </s>
funcom_train/43605492
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Writer outputWriter(File outputFile) throws IOException { if (Report.should_report(Report.frontend, 2)) Report.report(2, "Opening " + outputFile + " for output."); if (outputStdout) { return new UnicodeWriter(new PrintWriter(System.out)); } if (! outputFile.getParentFile().exists()) { File parent = outputFile.getParentFile(); parent.mkdirs(); } return new UnicodeWriter(new FileWriter(outputFile)); } COM: <s> open a writer to the output file </s>
funcom_train/47159027
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void toggleSelection(Figure figure) { Set<Figure> oldSelection = new HashSet<Figure>(selectedFigures); if (selectedFigures.contains(figure)) { selectedFigures.remove(figure); } else { selectedFigures.add(figure); } Set<Figure> newSelection = new HashSet<Figure>(selectedFigures); fireSelectionChanged(oldSelection, newSelection); invalidateHandles(); repaint(); } COM: <s> if a figure isnt selected it is added to the selection </s>
funcom_train/8147233
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public List getIncomingAdjacentVertices( Vertex v ) { List adjacentVertices = new ArrayList( 10 ); int index = this.vertices.indexOf( v ); for (int i=0; i<admatrix[index].length; i++) if ( admatrix[i][index] ) adjacentVertices.add( this.vertices.get(i) ); return adjacentVertices; } COM: <s> returns the vertices adjacent to the specified vertex where the connecting </s>
funcom_train/46379082
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getHostname() { // first, see if the Darkstar server has a public hostname we should // be giving out instead of the internal one String hostname = publicAddress; if (hostname == null) { // fall back to the internal address, which is guaranteed to be set hostname = System.getProperty(Constants.WEBSERVER_HOST_PROP); } return hostname; } COM: <s> get the darkstar server name for clients to connect to </s>
funcom_train/50053605
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void glRender(GL2 gl, GLU glu, Camera camera, GameModel gameModel) throws GLSLErrorException { // Use additive blending. gl.glEnable(GL.GL_BLEND); gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE); gl.glDepthMask(false); gl.glPushMatrix(); for (ParticleControllerEngine engine : controllerEngines) { gl.glLoadIdentity(); engine.draw(gl, glu, camera, gameModel); } gl.glPopMatrix(); gl.glDisable(GL.GL_BLEND); gl.glDepthMask(true); } COM: <s> renders the particles </s>
funcom_train/13364234
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getStringConfig(int fieldIndex){ // Using try-catch to support old services and optionality of the parameter try{ String cfg = serviceStringTokenized[fieldIndex]; if (cfg == null) { return ""; } else { return cfg; } } catch (ArrayIndexOutOfBoundsException e){ return ""; } } COM: <s> retrieves a configuration element of this service as string </s>
funcom_train/9774849
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: final public GeoPoint3D Point3D(String label, Path path, double x, double y, double z) { AlgoPoint3DOnPath algo = new AlgoPoint3DOnPath(cons, label, path, x, y, z); GeoPoint3D p = algo.getP(); //p.setLabel(label); //p.setObjColor(ConstructionDefaults.colPathPoint); return p; } COM: <s> point3 d on a 1 d path with cartesian coordinates x y z </s>
funcom_train/10592723
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void handleExpression(char[] chars, int start, int length) throws SAXException { super.startElement(markupURI, "expr", markupPrefix + ":expr", XMLUtils.EMPTY_ATTRIBUTES); super.characters(chars, start, length); super.endElement(markupURI, "expr", markupPrefix + ":expr"); } COM: <s> wrap expressions in xsp expr tags </s>
funcom_train/27936209
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void eval(JXTestCase jXTestCase) throws java.lang.Throwable { if (indirect) { JXProperties props = jXTestCase.getProperties(); value = (String)props.get(value); } webConversation.addCookie(name, value); System.out.println("Added cookie '" + name + "' with value '" + value + "'"); } COM: <s> overrides parent code eval code method </s>
funcom_train/49469352
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ProbeDetail getProbeDetail(String probeName) throws Exception, RaciException{ Db db = dbRO(); try{ _logger.info("Probes : getProbeDetail - "+probeName); checkUserCanAccess(db, getCurrentUser()); return DbProbes.getProbeDetail(db, probeName); } catch (Exception e) { store(e); throw e; } finally { db.safeClose(); } } COM: <s> get the details for a probe </s>
funcom_train/21892558
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String toString() { StringBuffer result = new StringBuffer(name); result.append(": "); int index = 0; for (Type type : argumentTypes){ if (index++>0) result.append(" x "); result.append(type); } return result.toString(); } COM: <s> returns a string representation of this predicate </s>
funcom_train/33601521
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void weakAcceptReceived(Round round, int a, byte[] value) { int eid = round.getExecution().getId(); Logger.println("(Acceptor.weakAcceptReceived) WEAK from " + a + " for consensus " + eid); round.setWeak(a, value); computeWeak(eid, round, value); } COM: <s> called when a weak message is received </s>
funcom_train/8147214
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void removeEdge( Edge edge ) throws Exception { Vertex v1, v2; v1 = edge.getVertexA(); v2 = edge.getVertexB(); int index1 = vertices.indexOf(v1); int index2 = vertices.indexOf(v2); this.admatrix[index1][index2] = false; if ( !isDirected ) this.admatrix[index2][index1] = false; } COM: <s> removes the specified edge from the graph </s>
funcom_train/24372964
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: final public GeoNumeric Integral(String label, GeoFunction f, NumberValue a, NumberValue b) { AlgoIntegralDefinite algo = new AlgoIntegralDefinite(cons, label, f, a, b); GeoNumeric n = algo.getIntegral(); this.processCreateCommand(n); //VMT modification return n; } COM: <s> definite integral of function f from x a to x b </s>
funcom_train/22189419
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ModuleEditorInput (Module i_Module) { super (new String[] { TEEditor.ID, IFEditor.ID, FCEditor.ID }, new IEditorInput[] { new FileEditorInput (i_Module.getTEFile ()), new FileEditorInput (i_Module.getIFFile ()), new FileEditorInput (i_Module.getFCFile ()) } ); m_Module = i_Module; } COM: <s> setup the editor input </s>
funcom_train/20642391
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getInfo(String msgId) { ApelMsg am = getApelMsg(msgId); if (am == null) { return "Internal Error: Message info is not found for ID : " + msgId; } if (am.getInfo() == null) { return DEFAULT_INFO; } return am.getInfo(); } COM: <s> returns info for the message id </s>
funcom_train/43885669
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void execute() throws IOException { final SeQuery seQuery = getSeQuery(); session.issue(new Command/*<Void>*/() { //@Override public Object execute(ISession session, SeConnection connection) throws SeException, IOException { seQuery.execute(); return null; } }); } COM: <s> tells the server to execute a stream operation </s>
funcom_train/35045658
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int compareTo(Address other) { UUID val=(UUID)other; return (this.mostSigBits < val.mostSigBits ? -1 : (this.mostSigBits > val.mostSigBits ? 1 : (this.leastSigBits < val.leastSigBits ? -1 : (this.leastSigBits > val.leastSigBits ? 1 : 0)))); } COM: <s> compares this uuid with the specified uuid </s>
funcom_train/7757379
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void replaceHeader(String name, byte [] value) { Iterator eachHeader = getHeaders(); while(eachHeader.hasNext()) { Header aHeader = (Header) eachHeader.next(); if(aHeader.getName().equalsIgnoreCase(name)) headers.remove(aHeader); } headers.add(new Header(name, value)); } COM: <s> replace a header </s>
funcom_train/4192978
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void onTimeout(Timer to) { try { if (to.equals(clearing_to)) { printLog("Clearing timeout expired",LogLevel.HIGH); sip_provider.removeSipProviderListener(transaction_id); changeStatus(STATE_TERMINATED); transaction_listener=null; //clearing_to=null; } } catch (Exception e) { printException(e,LogLevel.HIGH); } } COM: <s> method derived from interface timer listener </s>
funcom_train/43486780
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getType(int i) { if (i > size) return VirtualMachine.TYPE_UNDEFINED; Object o = objects[i]; if (o == Boolean.TRUE || o == Boolean.FALSE) { return VirtualMachine.TYPE_BOOLEAN; } if (o == null) { return VirtualMachine.TYPE_UNDEFINED; } if (o == VMUtils.EMPTY_OBJECT) { return VirtualMachine.TYPE_NULL; } if (o instanceof Double) { return VirtualMachine.TYPE_NUMBER; } if (o instanceof String) { return VirtualMachine.TYPE_STRING; } if (o instanceof FunctionObject) { return VirtualMachine.TYPE_FUNCTION; } return VirtualMachine.TYPE_OBJECT; } COM: <s> returns the element type for the given index one of type xxx constants </s>
funcom_train/44164647
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Transferable createTransferable(JComponent comp) { if (comp instanceof UnitLabel) { return new ImageSelection((UnitLabel)comp); } else if (comp instanceof GoodsLabel) { return new ImageSelection((GoodsLabel)comp); } else if (comp instanceof MarketLabel) { return new ImageSelection((MarketLabel)comp); } return null; } COM: <s> creates a transferable an image selection to be precise of the </s>
funcom_train/24009392
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public User logon(String username) throws Exception { Users u = usersDao.get(username); if (u == null) throw new Exception("User not Found!"); //Translates the User to something useful for client //TODO: better using dozer? User user = new User(); user.setId(u.getId()); user.setName(u.getUsername()); Hotel h = getHotel(u.getHotelid()); if (h != null) user.setHotel(h); return user; } COM: <s> logs a user if something goes wrong throws an exception </s>
funcom_train/3370073
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setHorizontalScrollBar(JScrollBar horizontalScrollBar) { JScrollBar old = getHorizontalScrollBar(); this.horizontalScrollBar = horizontalScrollBar; if (horizontalScrollBar != null) { add(horizontalScrollBar, HORIZONTAL_SCROLLBAR); } else if (old != null) { remove(old); } firePropertyChange("horizontalScrollBar", old, horizontalScrollBar); revalidate(); repaint(); } COM: <s> adds the scrollbar that controls the viewports horizontal view </s>
funcom_train/44793770
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean isStraightLine(GM_LineString line) { IDirectPositionList coords = line.coord(); for (int i = 1; i < coords.size() - 1; i++) { if (Angle.angleTroisPoints(coords.get(i - 1), coords.get(i), coords.get(i + 1)) != Angle.anglePlat) { return false; } } return true; } COM: <s> returns true if the line string is straight false otherwise </s>
funcom_train/19636915
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testRandomListSort() { Comparator comparator = makeComparator(); List randomList = getComparableObjectsOrdered(); randomizeObjects(randomList); sortObjects(randomList,comparator); List orderedList = getComparableObjectsOrdered(); /* debug Iterator i = randomList.iterator(); while (i.hasNext()) { System.out.println(i.next()); } */ assertTrue("Comparator did not reorder the List correctly", orderedList.equals(randomList)); } COM: <s> test sorting a random list </s>
funcom_train/38293950
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void takeDown() { if(gui != null) { gui.disposeAsync(); } DFAgentDescription dfd = new DFAgentDescription(); dfd.setName(getAID()); Iterator it = parents.iterator(); while(it.hasNext()) { AID parentName = (AID)it.next(); try { DFService.deregister(this, parentName, dfd); } catch(FIPAException fe) { fe.printStackTrace(); } } } COM: <s> cleanup em df em on exit </s>
funcom_train/4126004
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean canAdd(Locatable locatable) { if (locatable == this) { return false; } else if (locatable instanceof Unit && canCarryUnits()) { return getSpaceLeft() >= locatable.getSpaceTaken(); } else if (locatable instanceof Goods) { Goods g = (Goods) locatable; return (getLoadableAmount(g.getType()) >= g.getAmount()); } else { return false; } } COM: <s> checks wether or not the specified locatable may be added to this </s>
funcom_train/22526565
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean askUserDeletePlay(IPlayModel play) { // Confirmation dialog return MessageDialog.openQuestion( Display.getDefault().getActiveShell(), Messages.DeletePlayOperation_0, Messages.DeletePlayOperation_1 + play.getTitle() + "'?"); //$NON-NLS-1$ } COM: <s> ask the user whether they wish to delete the given object </s>
funcom_train/36679351
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addTextField(String labelText, String textFieldText) { checkIfLabelAlreadyTaken(labelText); JLabel label = new JLabel(labelText); JTextField textField = new JTextField(textFieldText); label.setLabelFor(textField); components.add(label); components.add(textField); fieldValues.put(labelText.toLowerCase(), textField); } COM: <s> add a label and textfield row to this dialog </s>
funcom_train/32866963
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean weAreOriginator(Message msg){ try { String id = msg.getChild("funcdata").getChild("pop").getChild("stack").getChild("conn_id").getContent(); } catch( NoSuchElementException ex ){ return(true); } return(false); } COM: <s> this needs a redesign to do something meaningful </s>
funcom_train/50576155
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void selectionButtons(boolean b) { upItem.setEnabled(b); downItem.setEnabled(b); long len = 0; try { len = contents.getLength(); } catch (Exception ex) { Tuneology.logException(ex, "selectionButtons"); } deleteItem.setEnabled((len == 0) ? false : b); } COM: <s> enable or disable the selection buttons </s>
funcom_train/9806682
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: final public EdifCell cellNameDef(EdifLibrary lib) throws ParseException { EdifNameable name; EdifCell cell; name = nameDef(); try { cell = new EdifCell(lib, name); } catch(EdifNameConflictException e) { {if (true) throw new ParseException("Duplicate cell definition: " + name);} } {if (true) return cell;} throw new Error("Missing return statement in function"); } COM: <s> this method parses the name of a cell and creates a new </s>
funcom_train/3373815
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void calculateLongestLine() { Component c = getContainer(); font = c.getFont(); metrics = c.getFontMetrics(font); Document doc = getDocument(); Element lines = getElement(); int n = lines.getElementCount(); int maxWidth = -1; for (int i = 0; i < n; i++) { Element line = lines.getElement(i); int w = getLineWidth(line); if (w > maxWidth) { maxWidth = w; longLine = line; } } } COM: <s> iterate over the lines represented by the child elements </s>
funcom_train/44215419
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testOpen() throws Exception { Player player = PlayerFactory.buildSpeedy("pounder/accpt/TestOpenSave - 1.pnd"); TestOpenConduit c = (TestOpenConduit)player.play(); assertEquals("javax.swing.JButton", c.instance.frame.getPounderPanel().getSetupPanel().getTestClassComboBox().getSelectedItem()); } COM: <s> after this script is played the class combo box should have </s>
funcom_train/43486454
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void add(int index, CalendarEvent e) { if (e == null) throw new NullPointerException("CalendarEvent cannot be null!"); _list.add(index, e); fireEvent(CalendarDataEvent.INTERVAL_ADDED, e.getBeginDate(), e.getEndDate()); } COM: <s> adds the calendar event to the specified index of the list </s>
funcom_train/3028558
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void addJavaLibraries() { Vector packages= new Vector(); //FIXME: JavaEnvUtils.getJrePackages(); Enumeration e=packages.elements(); while(e.hasMoreElements()) { String packageName=(String)e.nextElement(); addSystemPackageRoot(packageName); } } COM: <s> add any libraries that come with different java versions </s>
funcom_train/36147618
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Hashtable nextHashtable() { String str = readString(); if (str == null || "".equals(str)) { return null; } char sep1 = StringUtils.nextCharacterSeparator(getBuffer().getDelimiter()); StringTokenizer stk = new StringTokenizer(str, sep1); stk.next(); String value = stk.next(); return (Hashtable) getObject(Hashtable.class.getName(), value, sep1); } COM: <s> gets the next hashtable object </s>
funcom_train/8001540
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private List parseMissingDependenciesFromFormattedMessage(String target, String message) { final Pattern pattern = Pattern.compile("^\\d+\\) (.*)", Pattern.MULTILINE); final Matcher matcher = pattern.matcher(message); final List artifacts = new ArrayList(); while (matcher.find()) { final String missingArtifact = matcher.group(1); artifacts.add(new AntEventSummary( Constants.MESSAGE_LOGGED, null, target, null, "Missing artifact " + missingArtifact, 0, "pom.xml", null, null)); } return artifacts; } COM: <s> because multiple artifacts not found exception does not provde the actual list </s>
funcom_train/39548641
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Interpreter createInterpreter(Document document, String language) { InterpreterFactory factory = (InterpreterFactory)factories.get(language); Interpreter interpreter = null; if (factory != null) interpreter = factory.createInterpreter (((SVGOMDocument)document).getURLObject()); if (document != null) { interpreter.bindObject(BIND_NAME_DOCUMENT, document); } return interpreter; } COM: <s> creates a new interpreter for the specified document and </s>
funcom_train/18229204
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Enumeration services(final Class clazz) { class IsInstance implements org.openide.util.Enumerations.Processor { public Object process(Object obj, java.util.Collection ignore) { return clazz.isInstance(obj) ? obj : null; } } return org.openide.util.Enumerations.filter(services(), new IsInstance()); } COM: <s> get all available services that are assignable to the given superclass </s>
funcom_train/7638678
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public UiElementNode appendNewUiChild(ElementDescriptor descriptor) { UiElementNode ui_node; ui_node = descriptor.createUiNode(); mUiChildren.add(ui_node); ui_node.setUiParent(this); ui_node.invokeUiUpdateListeners(UiUpdateState.CREATED); return ui_node; } COM: <s> creates a new </s>
funcom_train/25750693
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void updateSelectedIndexes(boolean doRebuild) { RootScope[] selRootScopes = getExistingRootSelection(); if (selRootScopes.length == 0) return; IndexingDialog indexingDialog = DocFetcher.getInstance().getIndexingDialog(); for (RootScope scope : selRootScopes) indexingDialog.addJob(new Job(scope, false, doRebuild)); indexingDialog.open(); } COM: <s> performs an index update for all selected tt root scope tt s </s>
funcom_train/3022631
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void runRefactoring(Refactoring refactoring) { try { refactoring.run(); } catch (RefactoringException re) { JOptionPane.showMessageDialog(null, re.getMessage(), "Refactoring Exception", JOptionPane.ERROR_MESSAGE); } catch (Throwable thrown) { ExceptionPrinter.print(thrown, true); } } COM: <s> update the code </s>
funcom_train/45241214
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public LEADService createToolService(ToolConfigurationProperties conf, boolean isOwn, int actualStepNumber,final Composite parent, boolean showArtifacts) { final RTSharedEditorService service = new RTSharedEditorService(getName(), isOwn, conf, actualStepNumber); //Not show services to the teacher when are private if (!service.isPrivate()){ RTSharedEditorComposite panel = new RTSharedEditorComposite(parent, service, showArtifacts); service.setPanel(panel); } return service; } COM: <s> instance the service layer </s>
funcom_train/22578444
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void updateHTTP(URL url) throws IOException { URLConnection conn = url.openConnection(); long lastModified = conn.getHeaderFieldDate("last-modified", -1L); if (lastModified == -1L) { throw new IOException("Last-Modified: header missing"); } url2meta.put(url, new Long(lastModified)); } COM: <s> retrieve the last modified date for a given http url </s>
funcom_train/33914131
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void repaintCards() { Object[] handCards = null; this.removeAll(); try { handCards = frame.getGameManager().getClient() .getPlayerHandCards().toArray(); } catch (RemoteException e) { // connection problem e.printStackTrace(); } for (int i = 0; i < handCards.length; i++) { this.add(getHandCardButton((CityCard) handCards[i], i)); } this.validate(); this.repaint(); } COM: <s> repaints the handcards of the player </s>
funcom_train/13260665
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: static public void add(SimEntity e) { SimEvent evt; if (running()) { /* Post an event to make this entity */ evt = new SimEvent(SimEvent.CREATE, clock, e.getId(), 0, 0, e); future.add(evt); } else { if (e.getId() == -1) { //-1 is the default value written by the constructor. // Now a new ID is set // Only add once! e.setId(entities.size()); entities.add(e); } } } COM: <s> adds a new entity to the simulation </s>
funcom_train/7421606
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean isReplyServiceTask(SendTask task, ServiceTask service) { List<MessageFlow> flows = this.diagram.getMessageFlowsWithSource(service.getId()); for (Iterator<MessageFlow> it = flows.iterator(); it.hasNext();) { MessageFlow flow = it.next(); if (flow.getTarget().getParentSwimlane().getId() != task.getParentSwimlane().getId()) { return false; } } return true; } COM: <s> checks if all message flows emanating from the service task </s>
funcom_train/46759637
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public MedModel getMed(final long medId, final ServiceCall call) throws Exception { IBeanMethod method = new IBeanMethod() { public Object execute() throws Exception { if (call.isStoreAudit()) { BaseData.getSecurity().storeAudit(call.getUserRefId(), medId, "Viewed Med", call); } return MedData.getMed(medId, call); }}; return (MedModel) call(method, call); } COM: <s> return the single med model for the primary key </s>
funcom_train/16750776
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void close() throws IOException { logger.debug("closing database"); if (recordsAdded > 0) { if (currentBlock.getRecordParts().size() > 0) writeCurrentBlock(); } raf.close(); if (recordsAdded > 0) { logger.debug("writing index"); logger.debug("number of blocks: " + getIndex().getEntries().size()); ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(fileIndex)); oos.writeObject(getIndex()); oos.close(); } } COM: <s> close the database after writing </s>
funcom_train/10531387
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getRecord() { // System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++"); // System.out.println("getRecord on BeanContextRecorderImpl invoked"); // System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++"); return event_log; } COM: <s> returns the event log </s>
funcom_train/316337
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getEncodedString(String key) throws Exception { String result = getString(key); return result; /* System.out.println("1:"+ result); byte[] resultBytes = result.getBytes(); result = new String(resultBytes,requestedEncoding); System.out.println("2:" +result); return result;*/ } COM: <s> return the string from the property file </s>
funcom_train/15742953
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ILineRange getCurrentViewport(SPath path) { // TODO We need to find a way to identify individual editors on the // client and not only paths. for (IEditorPart editorPart : getEditors(path)) { ILineRange viewport = editorAPI.getViewport(editorPart); if (viewport != null) return viewport; } return null; } COM: <s> return the viewport for one of the editor parts it is undefined which </s>
funcom_train/22718162
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void showAddFieldWindow() { AddFieldWindow addField = new AddFieldWindow(this); TableField field = addField.getField(); if (field != null) { if (field.isPrimaryKey()) { parentTable.getFields().add(0, field); } else { parentTable.getFields().add(field); } populateListData(); } } COM: <s> displays the window for entering a new field to the table </s>
funcom_train/9545780
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void collect() { System.gc(); Runtime run = Runtime.getRuntime(); double used = run.totalMemory() / MemoryUsageAnalyzer.MEGABYTE; double free = run.freeMemory() / MemoryUsageAnalyzer.MEGABYTE; this.maxused = Math.max(this.maxused, used); this.maxfree = Math.max(this.maxfree, free); this.avgused += used; this.avgfree += free; this.count++; } COM: <s> collect new java virtual memory usage information and return current </s>
funcom_train/35674914
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public CoxbGenModel createModel(final String schemaName) { String packageName = JAXB_PKG_PFX + "." + schemaName; CoxbGenModel coxbContext = new CoxbGenModel(); coxbContext.setJaxbPackageName(packageName); coxbContext.setCoxbPackageName(packageName + ".bind"); coxbContext.setCoxbSrcDir(GEN_SRC_DIR); return coxbContext; } COM: <s> create a common set of parameters </s>
funcom_train/4630836
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Serializable readMessage() throws IOException, ClassNotFoundException { byte[] headerBytes = consumeHeader(); MessageHeader header = MessageHeader.readHeader(headerBytes); int payloadLength = header.getPayloadLength(); byte[] payloadBytes = consumePayload(payloadLength); ByteBuffer completeMessage = ByteBuffer.allocate(headerBytes.length + payloadBytes.length); completeMessage.put(headerBytes).put(payloadBytes); return unmarshal(completeMessage.array()); } COM: <s> tries to read a complete message from the underlying stream and to retrieve </s>
funcom_train/3561608
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void treeNodesInserted(javax.swing.event.TreeModelEvent treeModelEvent) { javax.swing.tree.TreePath tempPath; tempPath = treeModelEvent.getTreePath(); ((javax.swing.tree.DefaultTreeModel) tree.getModel()). reload((javax.swing.tree.TreeNode) tempPath.getLastPathComponent()); } COM: <s> called when nodes have been inserted </s>
funcom_train/38310575
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGlobalAttributeAliases() throws Exception { Map<String, Object> styleMap = new HashMap<String, Object>(); assertEquals(1, styleParser.parseStyle(documentHandler.locator(), "align:center", supportedStyleAttributeMap, styleMap)); assertEquals(new Integer(Element.ALIGN_CENTER), styleMap.get("halign")); } COM: <s> testing global attribute alias support </s>
funcom_train/29915899
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public JButton getUnlockAndSetPIN() { if (unlockAndSetPIN == null) { unlockAndSetPIN = new JButton(); unlockAndSetPIN.setBounds(new Rectangle(387, 242, 277, 45)); unlockAndSetPIN.setText(UIHelper.getText("otheractions.unlockthecard")); unlockAndSetPIN.setHorizontalAlignment(SwingConstants.LEFT); unlockAndSetPIN.setIcon(UIHelper.getImage("locked_card.gif")); } return unlockAndSetPIN; } COM: <s> this method initializes unlock and set pin </s>
funcom_train/21422970
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public SmilClock getDuration() { if(mDuration==null) { //TODO here we parse all SmilFiles, could use //an iterator without statecheck long sum = 0; for(SmilFile sf : this) { SmilClock sc; try{ sc = sf.getDuration(); }catch (Exception e) { continue; } sum+=sc.millisecondsValue(); } mDuration = new SmilClock(sum); } return mDuration; } COM: <s> get the duration of the smil presentation as a whole </s>
funcom_train/10520480
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected ArrayList testClassNameFromFile(String[] classFileNames) { ArrayList tests = new ArrayList(classFileNames.length); for (int i = 0; i < classFileNames.length; i++) { String file = classFileNames[i]; if (isTestClass(file)) { String classname = classNameFromFile(file); tests.add(classname); } } return tests; } COM: <s> transform a set of file into their matching classname </s>
funcom_train/10344338
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Double getDoubleProperty(String key) throws ConfigurationException{ String v = getProperty(key); Double r = null; try { if (StringUtils.hasValue(v)) r = new Double(v); } catch (NumberFormatException e) { throw new ConfigurationException("Conversion of " + v +" to Double failed."); } return (r); } COM: <s> get the property as doube value </s>
funcom_train/1601736
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public SingleExpression GetSingle() { if (termList.size() != 1) { return null; } Term term = termList.get(0); Factor singleFactor = term.GetSingleFactor(); if (singleFactor == null) { return null; } SingleExpression single = new SingleExpression(singleFactor, (operatorList.get(0) == TermOperator.SUBTRACT) ? true : false); return single; } COM: <s> if this expression represents a single factor return it </s>
funcom_train/11728592
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testWritePrivilege() throws RepositoryException, NotExecutableException { Privilege w = acMgr.privilegeFromName(Privilege.JCR_WRITE); assertTrue("Write privilege must be an aggregate privilege.", w.isAggregate()); String expected = getJCRName(Privilege.JCR_WRITE, superuser); assertEquals("The name of the write privilege must be " + expected, expected, w.getName()); } COM: <s> test the jcr write privilege </s>
funcom_train/47166194
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getString(Locale l, String key) { String res = key; Map<String,String> keyMap = table.get(l); if(keyMap != null) { String tmp = keyMap.get(key); if(tmp != null) { res = tmp; } } return res; } COM: <s> get a translation </s>
funcom_train/9702499
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private IFormSubmitButton createSubmitButton(Element elem, int elemCounter) { IFormSubmitButtonBuilder submitB = (IFormSubmitButtonBuilder) ModelBuilderFactory.newBuilder(IFormSubmitButton.class); submitB.visible(true); initElement(elem, elemCounter, submitB); if (elem.getAttributeValue("value")!=null){ //$NON-NLS-1$ submitB._default(elem.getAttributeValue("value")); //$NON-NLS-1$ } return (IFormSubmitButton) submitB.build(); } COM: <s> create a new submit button </s>
funcom_train/17918877
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public IColumn addAttribute(String levelName, String attributeName, String inputName, String attributeType) { LevelNode n = (LevelNode) getColumnsOfType(IColumn.ColumnTypes.level).getColumn(levelName); Column column = new Column(inputName); column.setColumnType(IColumn.ColumnTypes.valueOf(attributeType)); n.addAttribute(attributeName, column); return column; } COM: <s> adds an attribute to an existing level node </s>
funcom_train/51413220
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void deleteMethod(Row methodRow, boolean deleteBindings) { if(deleteBindings) { Row[] bindRows = MAspectRoleBinding.getAllBindingsOfMethod(methodRow.getPrimaryKey()); for(int i=0; i<bindRows.length; i++) { bindRows[i].delete(); } } try { MAspectRoleMethod.deleteMethod(methodRow.getPrimaryKey()); } catch (CMExceptionTable e) { GUITools.showException(e); } } COM: <s> deletes the selected method </s>