__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/6268311
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void time(Calendar calendar) throws ParseException { try { String s = lexer.number(); int hour = Integer.parseInt(s); calendar.set(Calendar.HOUR_OF_DAY, hour); lexer.match(':'); s = lexer.number(); int min = Integer.parseInt(s); calendar.set(Calendar.MINUTE, min); lexer.match(':'); s = lexer.number(); int sec = Integer.parseInt(s); calendar.set(Calendar.SECOND, sec); } catch (Exception ex) { throw createParseException("error processing time "); } } COM: <s> set the time field </s>
funcom_train/35838772
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public NodeSummary getNodeSummary(PCSession session, String sNodeID) throws SQLException { // DBConnection dbcon = getDatabaseManager().requestConnection(session.getModelName()) ; // // NodeSummary node = DBNode.getNodeSummary(dbcon, sNodeID, session.getUserID()); // // getDatabaseManager().releaseConnection(session.getModelName(),dbcon); return null; } COM: <s> returns a node given its id </s>
funcom_train/14090769
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void commence(ServletRequest request, ServletResponse response, AuthenticationException authException) throws IOException, ServletException { logger.debug("X509 entry point called. Rejecting access"); HttpServletResponse httpResponse = (HttpServletResponse)response; httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN, "Access Denied"); } COM: <s> returns a 403 error code to the client </s>
funcom_train/44161900
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ArrayList getParentFields(String reportname, String queryname) { ArrayList arl = new ArrayList(); Collection col; try { col = prepareCollection(reportname); XMLResource document = (XMLResource)col.getResource(reportname); Document doc = makeDocument(document); arl = this.queryMethods.getParentFields(doc, reportname, queryname); if (col != null) { col.close(); } } catch (Exception e) { e.printStackTrace(); } return arl; } COM: <s> get parent fields gets parent fields </s>
funcom_train/43753296
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private CellPanel getTargetParent() { Widget t = target.getParent(); while(t != null && !isTargetable(t)) { t = t.getParent(); } if (t == null) { throw new IllegalStateException("No targetable parent found " + "for current target"); } return (CellPanel)t; } COM: <s> obtain the first targetable parent of the current target </s>
funcom_train/26221543
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Object runPrivilegedService(final Method service, final Object[] paramArray) throws IllegalAccessException, InvocationTargetException, PrivilegedActionException { PrivilegedExceptionAction<Object> exceptionAction = new PrivilegedExceptionAction<Object>() { public Object run() throws Exception { return service.invoke(AbstractServiteur.this, paramArray); } }; return AccessController.doPrivileged(exceptionAction); } COM: <s> runs a service the privileged way this is necessary because serviteurs </s>
funcom_train/5526415
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void position (String line, Tool t) { FilePosition p=t.getPosition(line); if (p==null) return; if (!matchShow(p.getName())) return; int n=p.getLine(),pos=p.getPos(); if (currentEP()==null) return; if (t.emacs()) currentEP().TD.gotoTabLine(n-1,pos-1,8); else currentEP().TD.gotoLine(n-1,pos-1); toFront(); focus(); } COM: <s> this is called from execute frame </s>
funcom_train/26574206
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setUnit(boolean metric) { Quantity old = new Quantity(distance); if (metric) { distance.toUnit(unitKM); averageSpeed.toUnit(unitKMPerHour); } else { distance.toUnit(unitMiles); averageSpeed.toUnit(unitMilesPerHour); } fireChangeEvent("DISTANCE", old, distance); } COM: <s> switch between metric and non metric units e </s>
funcom_train/37820702
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void centerHorizontalScrollbar(){ graphComponent.zoomAndCenter(); graphComponent.getHorizontalScrollBar().setValue( (int) (((1-(graphComponent.getWidth()/(graphComponent.getPageFormat().getWidth() *flowChartGraph.getView().getScale())))*graphComponent.getHorizontalScrollBar().getMaximum())/2)); } COM: <s> centers the horizontal scrollbar </s>
funcom_train/51129076
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void currentPuckChainAdd(Player player) { // Check if player does not allready exist in chain, or is null (after goal) if (player == null || player.equals(currentPuckChain[0]) || player.equals(currentPuckChain[1])) { return; } currentPuckChain[1] = currentPuckChain[0]; currentPuckChain[0] = currentPuckHolder; } COM: <s> current puck chain add </s>
funcom_train/5725367
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof CourseInfo)) { return false; } final CourseInfo that = (CourseInfo) object; if (this.id == null || that.getId() == null || !this.id.equals(that.getId())) { return false; } return true; } COM: <s> returns code true code if the argument is an course info instance and </s>
funcom_train/49328123
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void stopAll() { if (dataSource != null) { System.out.println("stopping"); Thread t = new Thread() { public void run() { DataSource ds = dataSource; try { ds.stop(); } catch (Exception e) { log.error("Problems on stopping datasource"); } } }; t.setDaemon(true); t.start(); } } COM: <s> stops the device with a daemon doesnt works very well </s>
funcom_train/13914101
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetCharacterEncoding() { System.out.println("getCharacterEncoding"); ProxymaFacade proxyma = new ProxymaFacade(); ProxymaContext context = proxyma.getContextByName("default"); ProxymaServletRequest instance = new ProxymaServletRequest(request, context); String expResult = request.getCharacterEncoding(); String result = instance.getCharacterEncoding(); assertEquals(expResult, result); } COM: <s> test of get character encoding method of class proxyma servlet request </s>
funcom_train/38464063
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String writeFieldList(List fields) { StringBuffer buffer = new StringBuffer(); buffer.append('('); for(int i = 0; i < fields.size(); ++i) { if(i > 0) { buffer.append(','); } buffer.append((String)fields.get(i)); } buffer.append(')'); return buffer.toString(); } COM: <s> produces a string with field names between parenthesys separated by commas </s>
funcom_train/45017857
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void updateScaleMenus(Combo m) { int dim = 0; menu = m; int sel = m.getSelectionIndex(); m.removeAll(); if (modes[dim] != null) { for (int i = 0; i < modes.length; i++) { m.add(modes[i].getName()); } } dim++; m.select(sel != -1 ? sel : 0); } COM: <s> updates the contents of the scale menus </s>
funcom_train/34589789
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void setScoringModel(Connection conn, ApplicationType app) throws SQLException, XmlException { ScoringModelDAO dao = new ScoringModelDAO(); ScoringModel[] modelArray = dao.select(conn, app.getId()); if (modelArray.length > 0) { ScoringModels models = ScoringModels.Factory.newInstance(); models.setScoringModelArray(modelArray); app.setScoringModels(models); } } COM: <s> retrieve the scoring models for this app from the database </s>
funcom_train/167348
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void calculate(double t) { for (int i = 0, n = rbcs.size(); i < n; i++) { ((Reactor) rbcs.get(i)).setValue(0); } for (int i = 0, n = size(); i < n; i++) { ((Reactor) get(i)).calculate(t); } } COM: <s> clear value of all reactors and call calculate of all reactors </s>
funcom_train/374273
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String formatMacAddress(byte[] address) { String f = FormatUtils.mac(address).toLowerCase(); if (resolveAddresses && ouiPrefixResolver.canBeResolved(address)) { String prefix = ouiPrefixResolver.resolve(address); String s = prefix + "_" + FormatUtils.asStringZeroPad(address, ':', 16, 3, 3) .toLowerCase(); return s + " (" + f + ")"; } return f; } COM: <s> format mac address </s>
funcom_train/17576779
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JButton getJButtonCancel() { if (jButtonCancel == null) { jButtonCancel = new JButton(); jButtonCancel.setBounds(new java.awt.Rectangle(264,294,81,22)); jButtonCancel.setText("Cancel"); jButtonCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { buttons.clear(); ((JDialog) getParent().getParent().getParent()).dispose(); } }); } return jButtonCancel; } COM: <s> this method initializes j button cancel </s>
funcom_train/4514624
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setIconDimension(int dimension) { this.currDimension = dimension; this.currState = CommandButtonDisplayState.FIT_TO_ICON; for (List<AbstractCommandButton> buttonList : this.buttons) { for (AbstractCommandButton button : buttonList) { button.updateCustomDimension(dimension); } } this.revalidate(); this.doLayout(); this.repaint(); } COM: <s> sets the new dimension for the icons in this panel </s>
funcom_train/10925911
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testManageAccessControlList() throws Exception { checkACLCapability(true); EntryTree folderTree = fixture.createTestTree("testManageAccessControlList", 1, 1, null, null); folderTree.walkTree(new ManageAccessControlListVisitor(client, model)); } COM: <s> tests managing the access control lists of a folder and a document </s>
funcom_train/27780416
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Token newText(String name, String text) { Token nt = new Token(); nt.text = text; nt.name = name; nt.lineS = lineS; nt.lineE = lineE; nt.colS = colS; nt.colE = colE; nt.weight = weight; nt.reloffset = 0; return nt; } COM: <s> clones this objects with a new name and text and sets reloffset to </s>
funcom_train/3272843
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void transmitActionData(List actionQueue) throws Exception{ Action scheduledAction = null; // Start streaming a block of Actions startActionBlock(); for(ListIterator actions = actionQueue.listIterator(); actions.hasNext();){ // Get the next Action that needs to be transmitted. scheduledAction = ((Action) actions.next()); // Stream the Action into the XmlProcessor scheduledAction.ToXml(this); } // Close the Action block endElement(); transmitActionBlockEnd(); } COM: <s> transmit the turn data collected in this xml processor </s>
funcom_train/43620556
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int convertModelToColumn(int index) { int size = getElementCount(); if ((index < 0) || (index >= size)) { return -1; } if (layoutOrientation != JList.VERTICAL && rowsPerColumn > 0 && columnCount > 1) { if (layoutOrientation == JList.VERTICAL_WRAP) { return index / rowsPerColumn; } return index % columnCount; } return 0; } COM: <s> returns the column that the model index code index code will be </s>
funcom_train/23928617
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String fileToId(File file) throws Exception { if (file == null) { throw new IllegalArgumentException("Fle is not valid!"); } if (fRoot.equals(file)) { return ROOT_ID; } // get path String path = getRepositoryPath(file); return new String(Base64.encodeBase64(path.getBytes("UTF-8")), "ISO-8859-1"); } COM: <s> creates a file object from an id </s>
funcom_train/7442045
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ClientResource getParent() throws ResourceException { ClientResource result = null; if (getReference().isHierarchical()) { result = new ClientResource(this); result.setReference(getReference().getParentRef()); } else { throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST, "The resource URI is not hierarchical."); } return result; } COM: <s> returns the parent resource </s>
funcom_train/42761508
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected int getBestGain() { int indexOfBestAttribute = 0; double bestGainSofar = 0.0; // Loop through attributes2 array for (int index=1;index<attributes2.length;index++) { // If attribute not part of existing rule check gain if ((int) attributes2[index][0] == 0) { if (attributes2[index][1]>bestGainSofar) { indexOfBestAttribute = index; bestGainSofar = attributes2[index][1]; } } } return(indexOfBestAttribute); } COM: <s> process attributes array to identify the best gain </s>
funcom_train/14421933
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void select() { if (log.isDebugEnabled()) log.debug("Selecting " + SWTUtils.toString(widget)); assertEnabled(); if (isChecked()) { if (log.isDebugEnabled()) log.debug("Widget " + SWTUtils.toString(widget) + " already selected, not selecting again."); return; } asyncExec(new VoidResult() { public void run() { if (log.isDebugEnabled()) log.debug("Selecting " + widget); ((Button) widget).setSelection(true); } }); notifyListeners(); } COM: <s> select the checkbox </s>
funcom_train/13272030
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setText(String text) { if (text != this.text || (text != null && !text.equals(this.text))) { String oldText = this.text; this.text = text; this.propertyChangeSupport.firePropertyChange(Property.TEXT.name(), oldText, text); } } COM: <s> sets the text of this label </s>
funcom_train/43096127
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void updateReference() { Object text = null; try { text = Model.getFacade().getReferenceState(getOwner()); } catch (Exception e) { } if (text != null) { referenceFig.setText((String) text); } else { referenceFig.setText(""); } calcBounds(); setBounds(getBounds()); damage(); } COM: <s> update the reference text </s>
funcom_train/17203915
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Operand asReg(Instruction s, Operator movop, Operand op) { if (op.isRegister()) { return op; } RegisterOperand tmp = regpool.makeTemp(op); EMIT(CPOS(s, MIR_Move.create(movop, tmp, op))); return tmp.copy(); } COM: <s> move op into a register operand if it isnt one already </s>
funcom_train/46770701
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public UserTemplateModel getUserTemplate(final long userTemplateId, final IChainStore chain, final ServiceCall call) throws Exception { IBeanMethod method = new IBeanMethod() { public Object execute() throws Exception { return SecurityData.getUserTemplate(userTemplateId, chain, call); }}; return (UserTemplateModel) call(method, call); } COM: <s> same transaction return the single user template model for the primary key </s>
funcom_train/27727264
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setOrbit(double sqrta, double e, double i, double raan, double w, double m0){ this.sqrtA = sqrta; this.ecc = e; this.inc = i; this.omega = raan; this.argp = w; this.ma = m0; } COM: <s> set the orbit elements </s>
funcom_train/10237985
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void adjustCameraView(ShapeGeneric newShape3D){ float newDistance = newShape3D.getShapeBiggestDimension(); //adjust the camera //OR //adjust the scale. //TODO add a standard CAD scale. if(newDistance>defaultViewZPos)newShape3D.setScale((float)1/(int)((newDistance/defaultViewZPos)+1)); System.out.println("shape size="+newDistance); } COM: <s> adjust the camera view based on the shapes size </s>
funcom_train/34339600
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Command getEnviarMensaje() { if (EnviarMensaje == null) {//GEN-END:|24-getter|0|24-preInit // write pre-init user code hereEnviarCobro1(); EnviarMensaje = new Command("Send Message", Command.OK, 0);//GEN-LINE:|24-getter|1|24-postInit // write post-init user code here String quepaso = comprobacion() ; }//GEN-BEGIN:|24-getter|2| return EnviarMensaje; } COM: <s> returns an initiliazed instance of enviar mensaje component </s>
funcom_train/9920847
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected int getValueOfBestHand(){ int valueBestHand = -1; for (int i=0; i<player.length; i++){ if ((player[i] != null) && (player[i].active)){ if (getPlayerHandValue(i) > valueBestHand ){ valueBestHand = getPlayerHandValue(i); } } } return valueBestHand; } COM: <s> returns the value of the best hand among still active players </s>
funcom_train/33161670
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void populateLayoutConstraint(LayoutConstraint constraint) { if ( constraint instanceof LabelLayoutConstraint ) { LabelLayoutConstraint labelConstraint = (LabelLayoutConstraint) constraint; labelConstraint.label = realObject.toString(); labelConstraint.pointSize = 18; } else if ( constraint instanceof BasicEntityConstraint ) { // noop } else if ( constraint instanceof EntityPriorityConstraint ) { EntityPriorityConstraint priorityConstraint = (EntityPriorityConstraint) constraint; priorityConstraint.priority = Math.random() * 10 + 1; } } COM: <s> populate the specified layout constraint </s>
funcom_train/16786056
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected Page overwriteCurrentRowPage(String rowHeadline) throws RQLException { Page pageToOverwrite = currentRowPage; // it is assumed that method firstRow() was called before // check, if create or update if (overwrittenRowsCounter < existingRowsSize) { // update at least given row headline setCurrentRowHeadline(rowHeadline); // only navigation, element update in subclass nextRow(); } else { // create new row page pageToOverwrite = createRow(rowHeadline); } overwrittenRowsCounter++; return pageToOverwrite; } COM: <s> overwrites the current row always update the given headline </s>
funcom_train/785145
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void init(Visualization vis, String group, Schema schema) { setVisualization(vis); setGroup(group); addColumns(schema); if ( canGetBoolean(VisualItem.VISIBLE) ) index(VisualItem.VISIBLE); if ( canGetBoolean(VisualItem.STARTVISIBLE) ) index(VisualItem.STARTVISIBLE); if ( canGetBoolean(VisualItem.VALIDATED) ) index(VisualItem.VALIDATED); } COM: <s> initialize this visual table </s>
funcom_train/27740726
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void init() { // listens for the TorrentEvent FIRST_CHUNK_VERIFIED to start publishing torrentManager.get().addEventListener(new TorrentEventListenerForPublisher()); // listens for the DHTEvent CONNECTED to re-attempt publishing dhtManager.get().addEventListener(new DHTEventListenerForPublisher()); } COM: <s> adds a code torrent event listener code to code torrent manager code </s>
funcom_train/20307510
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void checkForCompletions() { ArrayList contexts = new ArrayList(activeInterpreters.size()); for (Iterator i = activeInterpreters.iterator(); i.hasNext(); ) { LPInterpreter interpreter = (LPInterpreter)i.next(); if (interpreter.getContext() instanceof Generator) { contexts.add(interpreter.getContext()); } } Generator.checkForCompletions(contexts); } COM: <s> check all known interpeter contexts to see if any are complete </s>
funcom_train/14434610
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: @Test public void testGetNoteValue() { HashSet<Integer> values = new HashSet<Integer>(); for(int i = 0; i < 100; i++) values.add(new Integer(new Melody().getNoteValue(32))); for(int i = 0; i < Math.log(32)/Math.log(2); i++) assertTrue(values.contains(new Integer((int)Math.pow(2, i)))); } COM: <s> we would expect that with 100 test cases we would have </s>
funcom_train/48940052
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public JTabbedPane getMainTabs() { if (mainTabs == null) { mainTabs = new JTabbedPane(); mainTabs.addTab("Movies", getMoviesTab()); //mainTabs.addTab("Statistics", getStatisticsTabBeans()); //mainTabs.addTab("Payments", getPaymentsTab()); } return mainTabs; } COM: <s> this method initializes main tabs </s>
funcom_train/7746182
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testFindInheritanc() { UnitOfWork.newCurrent(); Dog dog = (Dog)PersistenceManager.getInstance().find(InheritanceTest.idDog, Dog.class); assertTrue("Wrong dog name retrived.", dog.getName().equals("Juan Dog")); assertTrue("Wrong dog color retrived.", dog.getColor().equals("white")); UnitOfWork.getCurrent().commit(); } COM: <s> this method tests the find operation </s>
funcom_train/38542910
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addBatch() throws SQLException { try { ((PreparedStatement) this.realStatement).addBatch(); this.batchRequests.add(this.currentParams); this.currentParams = new Object[this.currentParams.length]; } catch (SQLException e) { throw generateException(e); } } COM: <s> adds a set of parameters to this code prepared statement code </s>
funcom_train/26391322
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void createCategory() throws IOException{ name = nameText.getText(); description = descriptionText.getText(); cat = new Category(repository, name, description); applyb.setEnabled(false); categories.add(cat); listModel.removeAllElements(); getListOfCategories(); nameText.setText(""); descriptionText.setText(""); pack(); } COM: <s> creates a new category </s>
funcom_train/51061729
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void add( QuickSerializable datum ) { data.ensureCapacity( index + 1 ); if( data.size() <= index ) { data.add( index, datum ); } else { data.set( index, datum ); } index++; // if we've filled up our data, start again at // the beginning if( index >= windowSize ) { index = 0; } } COM: <s> add this object to the window </s>
funcom_train/37143698
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void updateTimeZone() { TimeZone old = getTimeZone(); TimeZone tz = model.getTimeZone(); cal.setTimeZone(tz); anchor.setTimeZone(tz); setFirstDisplayedDay(anchor.getTime()); updateTodayFromCurrentTime(); updateDatesAfterTimeZoneChange(old); firePropertyChange("timeZone", old, getTimeZone()); } COM: <s> callback from changing timezone in model </s>
funcom_train/18483526
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int whichSide(Point2 t0, Point2 t1) { double v = (t1.getY() - t0.getY()) * getX() - (t1.getX() - t0.getX()) * getY() - t1.getY() * t0.getX() + t0.getY() * t1.getX(); return GeomUtils.cmp(v, 0); } COM: <s> returns which side this point falls on between the line segment defined </s>
funcom_train/37651136
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int countResourceElement(IResource resource) { if (resource instanceof IFile) { return isSuitable((IFile)resource) ? 1 : 0; } final CountVisitor visitor = new CountVisitor(); try { resource.accept(visitor); } catch (CoreException e) { logError("Exception when counting elements of a project", e); } return visitor.count; } COM: <s> count the number of sub resources of a resource </s>
funcom_train/3371324
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void updateLeadIndex() { if(leadPath != null) { if(selection == null) { leadPath = null; leadIndex = leadRow = -1; } else { leadRow = leadIndex = -1; for(int counter = selection.length - 1; counter >= 0; counter--) { // Can use == here since we know leadPath came from // selection if(selection[counter] == leadPath) { leadIndex = counter; break; } } } } else { leadIndex = -1; } } COM: <s> updates the lead index instance variable </s>
funcom_train/25326990
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getAllEntries() { StringBuilder result = new StringBuilder(); try { bindingsLock.readLock().lock(); for (Map.Entry<String, String> entry : getAllTraceFileBindings() .entrySet()) { result.append(entry.getKey() + " " + entry.getValue() + "\n"); } } finally { bindingsLock.readLock().unlock(); } return result.toString(); } COM: <s> convenience method to obtain all entries of the properties file </s>
funcom_train/10662892
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String toString(Tag tag) { String ret = ""; if (tag.text()!= null && tag.text().length() > 0){ ret = String.format("<DT><B>%s</B><DD><ul>%s</ul>", HEADER,format(tag)); } return ret; } COM: <s> given the code tag code representation of this custom </s>
funcom_train/10344637
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void fireSubmitEvent(SubmitEvent event) { EventListener[] listeners = list.getListeners(CommandRuntimeStatusLI.class); // Process the listeners last to first, notifying if (listeners != null) { for (int i = listeners.length - 1; i >= 0; i--) { ((CommandRuntimeStatusLI) listeners[i]).commandSubmitted(event); } } } COM: <s> the code fire submit event code method notifies all interested listeners that </s>
funcom_train/26645157
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ServletResponseItem filter(FilterItem<ServletResponseItem> filterItem, Map<String, Object> params) { log.debug("Clearing " + caches.size() + " caches"); clearCaches(); ServletResponseItem ret = filterItem.callNextFilter(params); if(ret==null ) { ret = new ErrorResponseItem(HttpServletResponse.SC_NO_CONTENT); } return ret; } COM: <s> cleans up the plugged in filters </s>
funcom_train/3561489
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setArgumentHelpText(String argName, String helpText) { int pos; pos = getArgumentPos(argName); if (pos >= 0) { try { setArgumentHelpText(pos, helpText); } catch (IndexOutOfBoundsException e) { System.out.println("Not fatal: argument not correctly defined"); } } } COM: <s> sets help text for an argument whose name is specified </s>
funcom_train/21844438
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void defineMessage(final String code, final String text) { synchronized( session ) { if (messages == null) { try { initMessages(); } catch (JBasicException e) { System.out.println("Unable to load message file!"); } } /* * Message is a enclosed object in Status. So we have to create a new * instance of a status object to invoke it's new method to create a * sub-object of Message. Yuck. */ messages.put(code, new Message(code, text)); } } COM: <s> store a message string in the in memory message table </s>
funcom_train/27834988
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void load() { if ((this._table != null) && (this._table.getValueAt(_row, _field) != null) && (this._field != null)) { this.setText(this._table.getValueAt(_row, _field).toString()); } else { this.setText(""); } } COM: <s> loads the data for the textfield from database </s>
funcom_train/18377449
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addSelectionTool(Palette owner) { // Add the default Selection tool... new PaletteItem( owner, name, "Selection", ImageDescriptor.createFromFile(Palette.class, "icons/arrow.gif"), "Selection tool"); new ToolItem(toolbar, SWT.SEPARATOR); } COM: <s> method add selection tool </s>
funcom_train/3923668
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void stop() { active = false; //thread.notify(); thread.interrupt(); while ( thread.isAlive() ) { try { thread.join(); } catch (InterruptedException e) { } } try { restart(); writer.close(); } catch ( Throwable t ) { Logger.logError(t); } } COM: <s> stops the logging </s>
funcom_train/22896896
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void testPropertiesValid() { T bean = null; try { bean = beanClass.newInstance(); } catch (Exception e) { String msg = "Bean cannot be instantiated without arguments"; LOGGER.fatal(msg, e); throw new UncheckedModelException(msg, e); } for (IBeanProperties<T> property : beanProperties) { if (!PropertyUtils.isReadable(bean, property.getName())) { String msg = "Error: Property" + property + " is not readable"; LOGGER.fatal(msg); throw new IllegalStateException(msg); } } } COM: <s> tests weather the properties entered exist on the given class </s>
funcom_train/43345795
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setBeingLoaded(boolean mBeingLoaded) { this.mBeingLoaded = mBeingLoaded; if (mBeingLoaded) { setLoadingText(mResources.getString("gui.image.display.container.loading.label.loading.text")); } else { setLoadingText(mResources.getString("gui.image.display.container.loading.label.finished.text")); } } COM: <s> sets the being loaded </s>
funcom_train/5003198
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Subcorpus createSubcorpus(String name, SelectionResult selectionResult) throws CqiClientException { Subcorpus sub = createSubcorpus(this.getStructuralUnit("text"), this.getStructuralUnit("text").getProperty("id"), selectionResult, name); sub.setSelectionResult(selectionResult); return sub; } COM: <s> creates the subcorpus </s>
funcom_train/44586049
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean hasSource() { // look if any source folder on the classpath // no need for resolved path given source folder cannot be abstracted IClasspathEntry[] entries; try { entries = this.getRawClasspath(); } catch (JavaModelException e) { return true; // unsure } for (int i = 0, max = entries.length; i < max; i++) { if (entries[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) { return true; } } return false; } COM: <s> answers true if the project potentially contains any source </s>
funcom_train/37421089
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void go(){ if(GoTServer.DEBUG) { System.out.println("Message-handler: "); System.out.println("ConversationID: "); System.out.println(conversationId); System.out.println("From: " + from); } Conversation.getConversation( conversationId).publish( from, Cleaner.cleanseString(body)); } COM: <s> publishes a message in a conversation </s>
funcom_train/8525979
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public JAMDtoFieldAnnotation findByGetterAnnotation(String annotationName) { for (JAMDtoFieldAnnotation each : getDtoFieldAnnotations()) { JAMDtoMethod m = getMethod(each.getGetterName()); if (m != null) { JAMAnnotation a = m.getAnnotation(annotationName); if (a != null) return each; } } return null; } COM: <s> find first annotated element with method annotation of given type </s>
funcom_train/22402430
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void del( Arg selection) { if(selection == null) throw new NullPointerException( "Can't execute Selection.del with a null argument"); if(selection.getType() != Arg.STRING) throw new IllegalArgumentException( "Can't execute Selection.del with a non STRING argument"); main.remSelection( selection.getStringValue()); //TODO test the removal of a selection; } COM: <s> destroyes the selection </s>
funcom_train/5395391
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testSetName() { System.out.println("setName"); String pName = ""; TableAttribute instance = null; instance.setName(pName); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); } COM: <s> test of set name method of class org </s>
funcom_train/41381557
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getGoalString() { String res = getName(); /** * If the simple has children, it is his params * we add therefore a parenthesis */ if (hasChildren()) { res += "("; } Iterator it = getChildren().iterator(); while (it.hasNext()) { Object obj = it.next(); if (obj instanceof LPASTParam) { LPASTParam param = (LPASTParam)obj; res += param.getName(); if (it.hasNext()) res += ", "; } } if (hasChildren()) { res += ")"; } return res; } COM: <s> returns the entire goals its name with the parameters </s>
funcom_train/25437001
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void onHandle(Message m) { Bundle bundle = m.getData(); if(bundle.containsKey("sound")) { GalaxyDomination.PlayPlanetSound(bundle.getInt("sound")); } else{ String text = bundle.getString("text"); if (text == "win" || text == "lost") { this.activity.gameEnded(text == "win"); } else { this.textView.setVisibility((text.length() > 0 ? 1 : 0)); this.textView.setText(text); } } } COM: <s> executed on the gui thread </s>
funcom_train/32824330
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void handleChangedResources() { if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) { editingDomain.getCommandStack().flush(); for (Iterator i = changedResources.iterator(); i.hasNext(); ) { Resource resource = (Resource)i.next(); if (resource.isLoaded()) { resource.unload(); try { resource.load(Collections.EMPTY_MAP); } catch (IOException exception) { MyEditorPlugin.INSTANCE.log(exception); } } } } } COM: <s> handles what to do with changed resources on activation </s>
funcom_train/21408396
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void getUserSettings(Display display, Displayable prevScreen, String name, String password){ this.prevScreen = prevScreen; conSettings.setDisplay(display); conSettings.setPrevScreen(prevScreen); conSettings.setTitle(MenuText.CONNECTION_SETTINGS()); conSettings.getUserSettings(display, prevScreen,conType,conTypes,conParams,this,name,password,connectionParameters); } COM: <s> displays a screen for the user to select a connection type </s>
funcom_train/32778747
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected int getPriority() { // get the current process SimProcess currentProcess = currentSimProcess(); if (currentProcess == null) { sendWarning("The current process of a cooperation is not found. " + "Zero is returned as priority!", "ProcessCoop: " + getName() + " Method: getPriority()", "The current process is only a null pointer.", "Make sure that only real SimProcesses are cooperating."); return 0; } return currentProcess.getQueueingPriority(); } COM: <s> returns the priority of the current sim process usually the master </s>
funcom_train/42201840
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void sendTeamInfo(StringBuilder output, Team team) { output.append(team.getNumber()); output.append(','); output.append(team.getName()); output.append(','); output.append(team.getRating()); output.append(','); output.append(team.getPoints()); output.append(','); output.append(team.getTeamPoints()); output.append(','); output.append(team.getWins()); output.append(','); output.append(team.getLosses()); output.append(','); output.append(team.getTies()); output.append(','); output.append(team.getType()); Iterator<Integer> it = team.getData().iterator(); while (it.hasNext()) { output.append(','); output.append(it.next()); } output.append('\n'); } COM: <s> sends the given team in an ajax format </s>
funcom_train/32057419
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testCancelEditing() { System.out.println("testCancelEditing"); JGraph jg=new JGraph(); BasicGraphUI x = new BasicGraphUI(); GraphLayoutCache g = new GraphLayoutCache( new DefaultGraphModel(),jg ); x.installUI(jg); x.cancelEditing(jg); } COM: <s> test of cancel editing method of class basic graph ui </s>
funcom_train/11010051
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object clone(){ CTXf xf = (CTXf)_cellXf.copy(); int xfSize = _stylesSource._getStyleXfsSize(); int indexXf = _stylesSource.putCellXf(xf); return new XSSFCellStyle(indexXf-1, xfSize-1, _stylesSource, _theme); } COM: <s> make a copy of this style </s>
funcom_train/18808134
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void mapDatasetToRangeAxis(int index, int axisIndex) { this.rangeAxisMap.set(index, new Integer(axisIndex)); // fake a dataset change event to update axes... datasetChanged(new DatasetChangeEvent(this, getDataset(index))); } COM: <s> maps a dataset to a particular range axis </s>
funcom_train/42710581
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Matrix clone() { double[][] newd = new double[ data.length][]; for(int i = 0; i < newd.length; i++) { newd[i] = Arrays.copyOf(data[i], data[i].length); } Matrix matrix = new Matrix(); matrix.setMatrix(newd); return matrix; } COM: <s> construct a deep copy of this object </s>
funcom_train/27674199
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void reportCulprit( final Culprit culprit ) { System.err.print( culprit.getType().toUpperCase() ); System.err.print( " : " ); // TODO - This needs to be kept short depending on the output target. // This used to be done in MillScript using it's Output class. System.err.println( culprit.getValue() ); } COM: <s> reports the specified culprit </s>
funcom_train/34282509
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void paintMarginLine(Graphics g, Rectangle visibleRect) { if (textArea.isMarginLineEnabled()) { g.setColor(textArea.getMarginLineColor()); Insets insets = textArea.getInsets(); int marginLineX = textArea.getMarginLinePixelLocation() + (insets==null ? 0 : insets.left); g.drawLine(marginLineX,visibleRect.y, marginLineX,visibleRect.y+visibleRect.height); } } COM: <s> draws the margin line if enabled </s>
funcom_train/26219197
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void sendMessageServer() throws IOException { DataOutputStream _data_stream = new DataOutputStream(_mainOutputStream); BufferedReader d = new BufferedReader(_mainInputStreamReader); // ;; Write XML Message ;; mainXMLRequest += "\r\n"; byte _getData[] = mainXMLRequest.getBytes(_Encoding); _data_stream.write(_getData); _data_stream.flush(); String _final_response = getReadline(d); finalXMLResponse = _final_response.trim(); } // end of the method ... COM: <s> send a xml based message to the server </s>
funcom_train/13907753
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Iterator completeSessionName(final String partialSession) { Iterator result = null; if (_sessions != null) { final NameCompleter completer = new NameCompleter(getSessionNames()); Logger.debug("[SessionManager.completeSessionName] created completer for sessionnames '%s'", getSessionNames().toString()); result = completer.getAlternatives(partialSession); } return result; } COM: <s> used from several commands that need session name completion </s>
funcom_train/1590630
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int compareTo(ReadableInstant instant) { if (instant == null) { throw new IllegalArgumentException("The instant must not be null"); } int thisValue = get(); int otherValue = instant.get(getFieldType()); if (thisValue < otherValue) { return -1; } else if (thisValue > otherValue) { return 1; } else { return 0; } } COM: <s> compare this field to the same field on another instant </s>
funcom_train/17711778
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JPanel getJContentPane() { if (jContentPane == null) { jContentPane = new JPanel(); jContentPane.setLayout(new BorderLayout()); jContentPane.add(getStatusBar(), BorderLayout.SOUTH); jContentPane.add(getToolBar_Main(), BorderLayout.NORTH); jContentPane.add(getSplitPane_Main(), BorderLayout.CENTER); } return jContentPane; } COM: <s> this method initializes j content pane </s>
funcom_train/40769045
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setUi(int uiType) { this.uiType = uiType; if (uiType == LOGIN_HORIZONTAL) { loginUiH = new LoginUiHorizontal(); pWidget.add(loginUiH); } else if (uiType == LOGIN_VERTICAL) { loginUiV = new LoginUiVertical(); pWidget.add(loginUiV); } // observe the accounts/session ui for changes setObserver(); } COM: <s> what type of ui are we going to use </s>
funcom_train/28672874
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addValuePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_MetaType_value_feature"), getString("_UI_PropertyDescriptor_description", "_UI_MetaType_value_feature", "_UI_MetaType_type"), BeansPackage.Literals.META_TYPE__VALUE, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the value feature </s>
funcom_train/40324478
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addString(String rdfString, RDFFormat format) { try { RepositoryConnection con = theRepository.getConnection(); try { StringReader sr = new StringReader(rdfString); con.add(sr, "", format); } finally { con.close(); } } catch (Exception ex) { log.log(Level.WARNING, "Error while connecting to local repository.", ex); } } COM: <s> import rdf data from a string </s>
funcom_train/29630386
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean atSpecialInventoryItem(int itemID, int invIndex, int actionIndex) { if (actionIndex < 1 || actionIndex > 3) return false; else { int id = -1; switch (actionIndex) { case 1: id = ActionConstants.AtInventorySpecial1; break; case 2: id = ActionConstants.AtInventorySpecial2; break; case 3: id = ActionConstants.AtInventorySpecial3; break; } if (id != -1) { setMousePosInv(invIndex); rawPacket(id, itemID, invIndex, Constants.ACT_SPECIAL_INVENTORY); return true; } else return false; } } COM: <s> performs a special action on an inventory item by index br </s>
funcom_train/9163987
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Task newTask(Task newTask, boolean addToWorkQueue){ WeakReference<Task> existingTask = _allTasks.get(newTask); if (existingTask == null){ // Saving the task in the cache _allTasks.put(newTask, new WeakReference<Task>(newTask)); if (addToWorkQueue){ addTask(newTask); } if (newTask.isPrimary){ ++_primaryTasksLeft; } return newTask; }else{ return existingTask.get(); } } COM: <s> sort of a getter for the single instance of the new task </s>
funcom_train/43214335
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void fireFinishedFile(File file, String relativeName, BigHash fileHash) { fire(new AddFileToolEvent(AddFileToolEvent.ACTION_FINISHED, AddFileToolEvent.TYPE_FILE, file, relativeName, fileHash, null, null)); } COM: <s> p notifies listeners that a file was uploaded </s>
funcom_train/18594266
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void save() throws IOException { File file = getFile(); Log.debug("Saving script to '" + file + "' " + hashCode()); OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(file), "UTF-8"); save(new BufferedWriter(writer)); writer.close(); lastSaved = getHash(); } COM: <s> write the script to file </s>
funcom_train/32308159
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean equals(Object obj) { ConstPointer ptr; if (this==obj) return true; if (null==obj) return false; if (this==NULL_POINTER || obj==NULL_POINTER) return false; try { ptr = (ConstPointer)obj; } catch (ClassCastException e) { return false; } return ((Label)getBase()).toString(). equals(((Label)ptr.getBase()).toString()); } COM: <s> returns true if code obj code is a code const pointer code which </s>
funcom_train/12804459
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void onMessage(javax.jms.Message aMessage) { // Cast the message as a text message. javax.jms.TextMessage textMessage = (javax.jms.TextMessage) aMessage; try { String string = textMessage.getText(); System.out.println("[Incoming message] " + string); } catch(JMSException e) { e.printStackTrace(); } } COM: <s> handle an incoming message </s>
funcom_train/43097915
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testRoleAddedSetClass() { Model.getPump().addClassModelEventListener(listener, elem.getClass(), new String[] { "parameter", }); Model.getCoreHelper().addParameter( elem, Model.getCoreFactory().createParameter()); Model.getPump().flushModelEvents(); assertTrue(eventcalled); } COM: <s> tests if a listener that registred for a role added event on the </s>
funcom_train/48401214
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void saveDatabase() { try { database = new Database(nameField.getText(), driverField.getText(), urlField.getText()); setVisible(false); } catch(NullPointerException f) { // Databases throw NullPointerException if any of the fields are nulls (e.g. User Error) JOptionPane.showMessageDialog(this, f.getMessage(), "Error", JOptionPane.ERROR_MESSAGE); } } COM: <s> called when the user presses enter or clicks save </s>
funcom_train/25471265
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String stripString (String s) { StringBuffer sb = new StringBuffer(); for (int k = 0; k < s.length(); k++) if (Character.isLetter(s.charAt(k))) sb.append(s.charAt(k)); return sb.toString(); } COM: <s> removes all but alphabetic characters </s>
funcom_train/4390119
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: static public JMenuItem newJMenuItem(String title, int what, boolean shift) { JMenuItem menuItem = new JMenuItem(title); int modifiers = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); if (shift) modifiers |= ActionEvent.SHIFT_MASK; menuItem.setAccelerator(KeyStroke.getKeyStroke(what, modifiers)); return menuItem; } COM: <s> a software engineer somewhere needs to have his abstraction taken away </s>
funcom_train/39309444
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void unregister(Reloadable toUnregister){ while(_registeredClasses.contains(toUnregister.getClass().getName())){ _registeredClasses.remove(toUnregister.getClass().getName()); log.info("Unregistered Class "+ toUnregister.getClass().getName() +" from Reload Manager"); } } COM: <s> with this function a reloadable class can unregister itself in the manager </s>
funcom_train/3703914
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected JComponent createMainContentArea() { JSplitPane splitPane; selfDisplay = createSelfDisplay(); otherDisplay = createFriendsDisplay(); splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, selfDisplay, otherDisplay); splitPane.setOneTouchExpandable(true); splitPane.setDividerLocation(150); // 150 is arbitrary return (splitPane); } // of method COM: <s> create the content that goes in the main area </s>
funcom_train/1440642
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void notestIsServerStopped() throws RemoteException { System.out.println("isServerStopped"); try { ServerSideFacadeImpl instance = new ServerSideFacadeImpl(config); boolean expResult = true; boolean result = instance.isServerStopped(); assertEquals(expResult, result); } catch (Exception e) { fail("Exception"); } } COM: <s> test of is server stopped method of class server side facade impl </s>