__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/4204459
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void observe(Event event, List<IObservableValue> newValues) { myPreviousValueEvent = event; if (newValues.equals(myPreviousValues)) { return; } for (final IObservableValue v : myPreviousValues) { v.removeChangeListener(myObservedChangeListener); } myPreviousValues.clear(); for (final IObservableValue v : newValues) { v.addChangeListener(myObservedChangeListener); } myPreviousValues.addAll(newValues); } COM: <s> observes changes in the specified valuse with the associated event </s>
funcom_train/18194395
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getHistory(String map_id) throws CommandErrorWitrackException, CoreWitrackException { _network.send("get_history " + map_id); if (_network.receive().compareTo("HISTORY") != 0) throw new CommandErrorWitrackException(_error.getStringError("METHOD_NOT_FOUND"), "METHOD_NOT_FOUND"); return _network.getArg(0).toString(); } COM: <s> request history to the server </s>
funcom_train/31956179
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getString(String key) { try { ResourceBundle rb = ResourceBundle.getBundle(_baseName, _locale); String text = (String) rb.getString(key); return text != null ? text : key; } catch (Exception e) { e.printStackTrace(); return key; } } COM: <s> return the string for the specified key in the current locale </s>
funcom_train/17119056
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Hashtable getAttributes() { Hashtable hashtable = new Hashtable(); hashtable.put("label", this.label); hashtable.put("value", this.getValue()); hashtable.put("questionString", this.getQuestion()); hashtable.put("valid", "" + isValid()); hashtable.putAll(super.getAttributes()); return hashtable; } COM: <s> values of this object packed in a hashtable </s>
funcom_train/50593699
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Source resolve(String href, String base) throws TransformerException { try { String cheminXsl=xslFichiersBase+href; URLConnection urlConn=context.getResource(cheminXsl).openConnection(); urlConn.connect(); return new StreamSource(urlConn.getInputStream()); } catch(Exception ex) { ex.printStackTrace(); } return null; } COM: <s> reslove location of file </s>
funcom_train/42670903
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public TextField getFamilia() { if (Familia == null) {//GEN-END:|251-getter|0|251-preInit // write pre-init user code here Familia = new TextField("Fam\u00EDlia", null, 6, TextField.ANY);//GEN-LINE:|251-getter|1|251-postInit // write post-init user code here }//GEN-BEGIN:|251-getter|2| return Familia; } COM: <s> returns an initiliazed instance of familia component </s>
funcom_train/4124466
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Element updateMapGeneratorOptions(Element element) { Element mgoElement = (Element) element.getElementsByTagName(MapGeneratorOptions.getXMLElementTagName()).item(0); getFreeColClient().getPreGameController().getMapGeneratorOptions().readFromXMLElement(mgoElement); getFreeColClient().getCanvas().getStartGamePanel().updateMapGeneratorOptions(); return null; } COM: <s> handles an update map generator options message </s>
funcom_train/81112
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Connection getConnection(String dbUrl, Properties properties) { Connection conn = null; try { pw.println("[NsSampleWork] Thread id - "+thread_id + "; requests database connection, dbUrl ="+dbUrl); conn = DriverManager.getConnection(dbUrl, properties); } catch (Exception e) { System.out.println("[NsSampleWork] Thread id - "+ thread_id + "; failed to get database connection. Exception thrown:"); e.printStackTrace(); } return conn; } COM: <s> gets a database connection </s>
funcom_train/45623589
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addOverwritePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_WriteLinesToFileType_overwrite_feature"), getString("_UI_PropertyDescriptor_description", "_UI_WriteLinesToFileType_overwrite_feature", "_UI_WriteLinesToFileType_type"), MSBPackage.eINSTANCE.getWriteLinesToFileType_Overwrite(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the overwrite feature </s>
funcom_train/12841998
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void createAndAddDesignPage() { IDesignViewer designViewer = createDesignPage(); fDesignViewer = designViewer; // note: By adding the design page as a Control instead of an // IEditorPart, page switches will indicate // a "null" active editor when the design page is made active fDesignPageIndex = addPage(designViewer.getControl()); setPageText(fDesignPageIndex, designViewer.getTitle()); } COM: <s> create and add the design page using a registered factory </s>
funcom_train/1436130
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void scale(short[][] matrix) { if ((option & CUT_LOWER) == CUT_LOWER) cutLower(matrix); if ((option & CUT_UPPER) == CUT_UPPER) cutUpper(matrix); if ((option & ABS) == ABS) abs(matrix); if ((option & WRAP_UPPER) == WRAP_UPPER) wrapUpper(matrix); if ((option & SUB_MIN) == SUB_MIN) subMin(matrix); if ((option & SCALE_MAX) == SCALE_MAX) scaleMax(matrix); } COM: <s> scales a matrix of image data </s>
funcom_train/25093266
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JRadioButton getJRadioButtonOther(){ if(jRadioButtonOther == null){ jRadioButtonOther = new JRadioButton(); // jRadioButtonOther.setEnabled(false); jRadioButtonOther.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e){ fireAlgoChanged(); } }); } return jRadioButtonOther; } COM: <s> this method initializes j radio button other </s>
funcom_train/45750147
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addIsShareablePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Meronymic_isShareable_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Meronymic_isShareable_feature", "_UI_Meronymic_type"), OntoUMLPackage.Literals.MERONYMIC__IS_SHAREABLE, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the is shareable feature </s>
funcom_train/2758940
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected Class createArray(Class type, String namePrefix) { if("".equals(namePrefix)) { return type; } else if("[L".equals(namePrefix)) { return Array.newInstance(type, 1).getClass(); } else if("[[L".equals(namePrefix)) { return Array.newInstance(type, 1).getClass(); } throw new IllegalArgumentException("Invalid name prefix:" + namePrefix); } COM: <s> creates a new class that may represent an array </s>
funcom_train/24087501
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String saveLibrary() { /*TODO: dont forget to prepare changed entities e.g. set current user */ PrepareChangesForPersist prep = new PrepareChangesForPersist(user.getUsername()); selectedReqNode = null; selectedLibNode = null; libraryTree = em.merge(libraryTree); libraryTree.setName("mainlibrary"); em.persist(libraryTree); // TODO: handle deleted librarytree nodes return null; } COM: <s> persists the currently visible library </s>
funcom_train/35513136
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean step() { boolean cut = false; for ( int i = 0; i < 3; i++ ) { p[ i ] += v[ i ]; // Now we check if player left the land if ( p[ i ] < 0.0f ) { p[ i ] = 0.0f; if ( i < 2 ) cut = true; } if ( p[ i ] >= BOUNDARIES[ i ] ) { p[ i ] = BOUNDARIES[ i ]; if ( i < 2 ) cut = true; } } return cut; } COM: <s> steps the moving object </s>
funcom_train/1539786
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String centerApprox() { Complex<BigDecimal> c = getDecimalCenter(); StringBuffer s = new StringBuffer(); s.append("[ "); s.append(c.getRe().toString()); s.append(" i "); s.append(c.getIm().toString()); s.append(" ]"); return s.toString(); } COM: <s> approximation of center </s>
funcom_train/18460736
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testConstant_6() { Vector elements = new Vector(); Term element = new Term(1, "-D", 1, '*'); elements.add(element); String formula = getFormula(elements); double d = Double.parseDouble(formula.substring(5)); assertTrue(d<0); } COM: <s> the placeholder is expected to be replaced by a negative double </s>
funcom_train/19650430
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void stateChanged(ChangeEvent e) { int min = sliderModel.getMinimum(); int max = sliderModel.getMaximum(); double value = sliderModel.getDoubleValue(); NumberFormatter formatter = (NumberFormatter)textField.getFormatter(); formatter.setMinimum(new Double(min)); formatter.setMaximum(new Double(max)); textField.setValue(new Double(value)); } COM: <s> updates the text field when the main data model is updated </s>
funcom_train/2487204
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private ArrayList determinePackageNames(String fullName) { ArrayList packageList = new ArrayList(); StringTokenizer st = new StringTokenizer(fullName, ".", false); while (st.hasMoreTokens()) { packageList.add(st.nextToken()); } return packageList; } COM: <s> parse the given string and return an array list containing the packagenames </s>
funcom_train/22275873
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void remove(ValidValue validValue) throws ConveloException { // get the DAO from the map and use it to find all objects for the given subclass ValidValueDAO dao = validValueDAOs.get(validValue.getClass().getName()); if (dao == null) { throw new ConveloException("Valid value list does not exist for type "+validValue.getClass().getName()); } dao.remove(validValue); } COM: <s> removes the given valid value from the database </s>
funcom_train/3170219
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void remove(Position anIdx) { if (!(wipe(anIdx))) { throw new AboraRuntimeException(AboraRuntimeException.NOT_IN_TABLE); } /* udanax-top.st:47838:MuTable methodsFor: 'accessing'! {void} remove: anIdx {Position} "Remove a key->value association from the table. Blast if the key is not present." (self wipe: anIdx) ifFalse: [Heaper BLAST: #NotInTable]! */ } COM: <s> remove a key value association from the table </s>
funcom_train/3400499
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Result getWSDL(String filename) { URL url = createURL(filename); MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer(); xsb.setSystemId(url.toExternalForm()); concreteWsdlSource = SDDocumentSource.create(url,xsb); newDocs.add(concreteWsdlSource); XMLStreamBufferResult r = new XMLStreamBufferResult(xsb); r.setSystemId(filename); return r; } COM: <s> generates the concrete wsdl that contains service element </s>
funcom_train/43245167
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testSetOccupation() { System.out.println("setOccupation"); String occupation = ""; EmploymentDataDG1Object instance = new EmploymentDataDG1Object(); instance.setOccupation(occupation); // 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 occupation method of class org </s>
funcom_train/41857249
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String _getRestrictionDescription(Restriction restr) { final StringBuffer sb = new StringBuffer(); if ( restr.isSomeValuesFromRestriction() ) { sb.append("some ..."); } else if ( restr.isCardinalityRestriction() ) { sb.append("card ..."); } else if ( restr.isAllDifferent() ) { sb.append("allDif ..."); } else { sb.append("..."); } String descrip = "(Restr: " +sb+ ")"; return descrip; } COM: <s> gets a string representation of the given restriction </s>
funcom_train/38882057
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void init() throws Exception, OsidException { super.init(); org.osid.authentication.AuthenticationManager authenticationManager = (org.osid.authentication.AuthenticationManager)OsidUtil.getManager( "org.osid.authentication.AuthenticationManager", osidContext); authenticationManager.authenticateUser(AuthenticationComponent.getUserPasswordType()); assertTrue("User should be authenticated", authenticationManager.isUserAuthenticated(AuthenticationComponent.getUserPasswordType())); } COM: <s> creates a new context and initialises it with login information </s>
funcom_train/48391037
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public HandlerRegistration addNodeContextClickHandler(com.smartgwt.client.widgets.tree.events.NodeContextClickHandler handler) { if(getHandlerCount(com.smartgwt.client.widgets.tree.events.NodeContextClickEvent.getType()) == 0) setupNodeContextClickEvent(); return doAddHandler(handler, com.smartgwt.client.widgets.tree.events.NodeContextClickEvent.getType()); } COM: <s> add a node context click handler </s>
funcom_train/28993719
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void startProcessor() { try { if (server == null) { // server = ProcessorServer.getInstance(); server = ProcessorFactory.getInstance(); } } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } } COM: <s> method start processor </s>
funcom_train/12563783
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int setLevel(int ll) { int newl; if (ll < 0) { ll = 0; } else if (ll > 100) { ll = 100; } if (!muted) { newl = player.doSetLevel(ll); if (newl != level) { level = newl; player.sendEvent(PlayerListener.VOLUME_CHANGED, this); } } return level; } COM: <s> sets the level attribute of the audio renderer object </s>
funcom_train/10907375
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getMaximumRepeats() { if (maximumRepeats.getEnum() == EN_NO_LIMIT) { return INFINITE; } else { int mr = maximumRepeats.getNumeric().getValue(); if (mr < 0) { log.debug("negative maximum-repeats: " + this.maximumRepeats); mr = 0; } return mr; } } COM: <s> get the value of the code maximum repeats code property </s>
funcom_train/2292440
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void setEditorLabel(String label) { if (CmsStringUtil.isEmptyOrWhitespaceOnly(label)) { setValidConfiguration(false); LOG.error(Messages.get().getBundle().key(Messages.LOG_EDITOR_CONFIG_NO_LABEL_0)); } m_editorLabel = label; } COM: <s> sets the editor label key used for the localized nice name </s>
funcom_train/20079509
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean canHandle(AppEvent event) { if (events != null && events.contains(new Integer(event.type))) return true; if (children != null) { for (int i = 0; i < children.size(); i++) { Controller c = (Controller) children.get(i); if (c.canHandle(event)) return true; } } return false; } COM: <s> determines if the controller can handle the particular event </s>
funcom_train/43501774
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isValid(NetTicket ticket) { // Clean out expired tickets clean(); // Find the ticket MetaTicket metaTicket = findMetaTicket(ticket); // If ticket not found, validation failed if (metaTicket == null) { logger.info("ticket ["+metaTicket+"] not found"); return false; } // Otherwise remove the ticket tickets.remove(metaTicket); return true; } COM: <s> validates a ticket </s>
funcom_train/15622102
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Image getStepFigureImage(){ String img=null; if (op_name!=null) img=Resource.getString("ICON_OP_"+op_name.toUpperCase()); if ((img!=null)&&(img.equals("ICON_OP_"+op_name.toUpperCase()))){ img=Resource.getString("ICON_OP_GENERICOPERATOR"); } return (new ImageIcon(this.getClass().getResource(img))).getImage(); } COM: <s> gets the iamge of the code step figure code </s>
funcom_train/13692711
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void updateNodes(GuiNode node){ GuiNode tmpnode; for(Enumeration en = nodeVec.elements(); en.hasMoreElements();) { tmpnode = (GuiNode)en.nextElement(); if (tmpnode == null) continue; if (node.id == tmpnode.id) { tmpnode = node; } } setNodeVec(nodeVec); repaint(); } COM: <s> updates the nodes data </s>
funcom_train/21633654
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void saveCookies(final URLConnection http) { final StringBuilder str = new StringBuilder(); final Set<String> set = this.map.keySet(); for (final String key : set) { final String value = this.map.get(key); if (str.length() > 0) { str.append("; "); } str.append(key + "=" + value); } http.setRequestProperty("Cookie", str.toString()); } COM: <s> once you have loaded cookies with load cookies you can call save cookies </s>
funcom_train/3315763
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Date truncToDay(Date aDate) { Calendar b = Calendar.getInstance(); b.setTime(aDate); b.clear(Calendar.MILLISECOND); b.clear(Calendar.SECOND); b.clear(Calendar.MINUTE); b.clear(Calendar.HOUR); b.clear(Calendar.HOUR_OF_DAY); return new Date(b.getTime().getTime()); } COM: <s> truncs a date object to day </s>
funcom_train/3077200
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Project getProject(String name) { List projects = Luntbuild.getDao().loadProjects(); for (Iterator iter = projects.iterator(); iter.hasNext();) { Project p = (Project) iter.next(); if (p.getName().equals(name)) return p; } return null; } COM: <s> get project of this schedule </s>
funcom_train/46836594
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JLabel getJTextFieldAdded() { if (jTextFieldAdded == null) { jTextFieldAdded = new JLabel(); jTextFieldAdded.setBounds(new Rectangle(382, 5, 98, 20)); jTextFieldAdded.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10)); jTextFieldAdded.setOpaque(false); jTextFieldAdded.setFocusable(false); } return jTextFieldAdded; } COM: <s> this method initializes j text field added </s>
funcom_train/3556327
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj == null) { return false; } else if ( ! (obj instanceof EnvironmentKey)) { return false; } else { EnvironmentKey key = (EnvironmentKey)obj; if (_thread == key._thread && _class.equals(key._class)) { return true; } else { return false; } } } COM: <s> checking the equality of this instance to another </s>
funcom_train/7894603
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public CleanResults scan(String taintedHTML, File policyFile) throws ScanException, PolicyException { Policy policy = null; /* * Get or reload the policy document (antisamy.xml). We'll need to pass * that to the scanner so it knows what to look for. */ policy = Policy.getInstance(policyFile); return this.scan(taintedHTML, policy); } COM: <s> this method wraps code scan code using the policy file object passed </s>
funcom_train/1178077
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException { if ("CoordenadaGPS".equals(portName)) { setCoordenadaGPSEndpointAddress(address); } else { // Unknown Port Name throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName); } } COM: <s> set the endpoint address for the specified port name </s>
funcom_train/25529107
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: static public double KL_symmetric(Distribution p, Distribution q) { if(p.asTreeMap().size()==q.asTreeMap().size()) { return(0.5*(KL_asymmetric(p,q)+KL_asymmetric(q,p))); } else { return 0; } } COM: <s> the static method where the computation of symmetric kl is performed </s>
funcom_train/45110871
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testPublishEvent() throws Exception { report.report("Add test - testReportWithMessage"); jsystem.addTest("testReportWithMessage", "ReporterTests"); jsystem.addPublishResultEvent(); jsystem.setTestParameter(1, "General", "InitReporter", "false", true); jsystem.play(); //runs the test and wait jsystem.waitForRunEnd(); } COM: <s> test publish event </s>
funcom_train/50062439
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean close()throws HL7IOException { if (!this.isOpen()) { return true; } // if try { this.writer.close(); } catch (IOException ioEx) { throw new HL7IOException("HL7FileWriter.close:IOException", ioEx); } // try - catch this.statusValue = HL7FileWriter.CLOSED; return true; } // close COM: <s> closes the context stream writer </s>
funcom_train/40921069
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public LukePlugin getPlugin(String className) { for (int i = 0; i < plugins.size(); i++) { Object plugin = plugins.get(i); if (plugin.getClass().getName().equals(className)) return (LukePlugin)plugin; } return null; } COM: <s> get an already instantiated plugin or null if such plugin was </s>
funcom_train/15491359
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setColor(Color color) { int bestIndex = getBestIndex(color); if (bestIndex>0 && getMin()==0.0 && getMax()==0.0) { fillColor = bestIndex; setMinAndMax(0.0,255.0); } else if (bestIndex==0 && getMin()>0.0 && (color.getRGB()&0xffffff)==0) fillColor = 0f; else fillColor = (float)(min + (max-min)*(bestIndex/255.0)); } COM: <s> sets the foreground fill draw color </s>
funcom_train/10387606
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addNoCompressionUserAgent(String userAgent) { try { Pattern nRule = Pattern.compile(userAgent); noCompressionUserAgents = addREArray(noCompressionUserAgents, nRule); } catch (PatternSyntaxException pse) { getLog().error(sm.getString("http11processor.regexp.error", userAgent), pse); } } COM: <s> add user agent for which gzip compression didnt works </s>
funcom_train/36920804
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected boolean validateAll(String name, String parentPath, String hash) { if (!validateName(name)) throw new IllegalArgumentException("File name must be a non-empty string not containing '/'"); if (!validateParentPath(parentPath)) throw new IllegalArgumentException("invalid path"); if (!validateHash(parentPath)) throw new IllegalArgumentException("invalid hash"); return true; } COM: <s> called by constructor to validate that parameters are valid </s>
funcom_train/3440567
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void open() throws MidiUnavailableException { if (Printer.trace) Printer.trace("> AbstractMidiDevice: open()"); synchronized(this) { openRefCount = -1; doOpen(); } if (Printer.trace) Printer.trace("< AbstractMidiDevice: open() completed"); } COM: <s> open the device from an aplication program </s>
funcom_train/16218557
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public CollisionManager getCollisionGroup(SpriteGroup group) { for (int i = 0; i < this.collisions.length; i++) { if (this.collisions[i].getGroup1() == group || this.collisions[i].getGroup2() == group) { return this.collisions[i]; } } return null; } COM: <s> returns any collision group associated with specified sprite group </s>
funcom_train/18827387
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void init(Map attributes) throws TransformerException { if (wired != null) { throw new IllegalStateException(); } Direction flow = (Direction) attributes.get(DIRECTION); if (flow == null) { flow = Direction.FORWARD; } wired = flow; inBuffer.reset(); outBuffer.reset(); tail.init(attributes); // initialise tail first initDelegate(attributes); // initialise this instance } COM: <s> initialises the code transformer code for operation with specific </s>
funcom_train/18948532
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void loadPostProcessTextualTransforms( PropertySet pPropertySet ) { String classList = null; try { classList = pPropertySet.get( Property.lang_CodeWriterTransforms ); iCodeWriterTextualTransformManager.loadClasses( classList ); } catch( Exception e ) { throw ProcessException.CODE_post_proc_tran( new ValueSet( ValueCode.CLASSLIST, classList ), e ); } } COM: <s> get post processing text transforms </s>
funcom_train/40930636
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Command getMenuPrincipalCommand1() { if (menuPrincipalCommand1 == null) {//GEN-END:|334-getter|0|334-preInit // write pre-init user code here menuPrincipalCommand1 = new Command("Item", Command.ITEM, 0);//GEN-LINE:|334-getter|1|334-postInit // write post-init user code here }//GEN-BEGIN:|334-getter|2| return menuPrincipalCommand1; } COM: <s> returns an initiliazed instance of menu principal command1 component </s>
funcom_train/4971826
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void actionPerformed(ActionEvent evt) { // System.out.println("Event " + evt); String cmd; if ((cmd = evt.getActionCommand()) == null) statusBar.setText("You chose a menu shortcut"); else statusBar.setText("You chose " + cmd); Object cmp = evt.getSource(); // System.out.println("Source " + cmp); if (cmp == exitItem) System.exit(0); } COM: <s> handle action events </s>
funcom_train/48388541
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public HandlerRegistration addItemClickHandler(com.smartgwt.client.widgets.toolbar.events.ItemClickHandler handler) { if(getHandlerCount(com.smartgwt.client.widgets.toolbar.events.ItemClickEvent.getType()) == 0) setupItemClickEvent(); return doAddHandler(handler, com.smartgwt.client.widgets.toolbar.events.ItemClickEvent.getType()); } COM: <s> add a item click handler </s>
funcom_train/41367823
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private ResultSet getFromDatabase(String inStatement) { ResultSet outRS = null; try { outRS = database_statement.executeQuery(inStatement); } catch (Exception e) { if (e.getMessage() != null) { JOptionPane.showMessageDialog(null, e.getMessage(), "Error", 0); } e.printStackTrace(); } return outRS; } COM: <s> apply a specific statement that returns a result set to a database </s>
funcom_train/21955303
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: static public boolean isDebug() { if (getResources().getProperty("Pooka.debug", "true").equals("true")) return true; else if (Logger.getLogger("Pooka.debug").isLoggable(Level.FINE)) return true; else return false; } COM: <s> returns whether or not debug is enabled for this pooka instance </s>
funcom_train/34896970
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addMenu(final IMenu menu) { ScrollPanel scrollPanel = new ScrollPanel(); scrollPanel.setSize("100%", "100%"); if (menu instanceof Widget) { scrollPanel.add((Widget)menu); this.stackPanel.add(scrollPanel, menu.getMenuText()); } } COM: <s> adds a menu to the main menu </s>
funcom_train/32316400
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addSuperDataPropertyPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_SubDataPropertyOf_superDataProperty_feature"), getString("_UI_PropertyDescriptor_description", "_UI_SubDataPropertyOf_superDataProperty_feature", "_UI_SubDataPropertyOf_type"), OdmPackage.Literals.SUB_DATA_PROPERTY_OF__SUPER_DATA_PROPERTY, true, false, true, null, null, null)); } COM: <s> this adds a property descriptor for the super data property feature </s>
funcom_train/45622676
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addResolvedThumbprintPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ResolveKeySourceType_resolvedThumbprint_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ResolveKeySourceType_resolvedThumbprint_feature", "_UI_ResolveKeySourceType_type"), MSBPackage.eINSTANCE.getResolveKeySourceType_ResolvedThumbprint(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the resolved thumbprint feature </s>
funcom_train/35461220
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testStructureSingleBranch() { parseAndCheck( "Declare 1 Payroll, 4 Name, 5 Last char(20);", "(DATA_ITEM (LEVEL 1) (NAME Payroll)" + " (DATA_ITEM (LEVEL 4) (NAME Name)" + " (DATA_ITEM (LEVEL 5) (NAME Last) (STRING CHARACTER (LENGTH 20)))))" ); } COM: <s> test a structure with sigle branch </s>
funcom_train/46383286
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public interface ContentBrowserListener { /** * The user has selected "OK" on the content browser and has selected * the given uri. * * @param uri The URI selected on the content browser */ public void okAction(String uri); /** * The user has selected "Cancel" on the content browser. */ public void cancelAction(); } COM: <s> the listener interface to report the result of the action taken on the </s>
funcom_train/43095301
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getWidth(int gap) { int result = 0; for (Iterator i = nodes.iterator(); i.hasNext();) { result += ((ClassdiagramNode) i.next()).getSize().width + gap; } if (LOG.isDebugEnabled()) { LOG.debug("Width of row " + rowNumber + ": " + result); } return result; } COM: <s> get the width for this row using the given horizontal gap between </s>
funcom_train/46098468
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JTextField getnroAfiliadoIF() { if (nroAfiliadoIF == null) { nroAfiliadoIF = new IntegerField(); nroAfiliadoIF.setBounds(new Rectangle(16, 206, 151, 20)); nroAfiliadoIF.setBackground(new Color(204, 204, 204)); nroAfiliadoIF.setEditable(false); } return nroAfiliadoIF; } COM: <s> this method initializes nro afiliado if </s>
funcom_train/51338416
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void test_keyDecode_ASCII() { final Properties props = new Properties(); props.put(KeyBuilder.Options.COLLATOR,CollatorEnum.ASCII.toString()); final IKeyBuilder keyBuilder = new DefaultKeyBuilderFactory(props).getKeyBuilder(); assertFalse(keyBuilder.isUnicodeSupported()); doKeyDecodeTest(keyBuilder); } COM: <s> unit test verifies that we can correctly locate the start of the column </s>
funcom_train/19241422
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void queryNewResourceNameInline(IResource resource) { // Make sure text editor is created only once. Simply reset text // editor when action is executed more than once. Fixes bug 22269. if (textEditor == null) createTextEditor(resource); textEditor.setText(resource.getName()); textEditor.selectAll(); textEditor.setFocus(); } COM: <s> return the new name to be given to the target resource or </s>
funcom_train/24181484
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addNamePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_NamedElement_name_feature"), getString("_UI_PropertyDescriptor_description", "_UI_NamedElement_name_feature", "_UI_NamedElement_type"), ParallelJPackage.Literals.NAMED_ELEMENT__NAME, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the name feature </s>
funcom_train/38463608
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void lock(TID txid, OID oid, boolean exclusive, long timeout) throws TransactionTimeoutException { logger.finest("Locking object " + oid + ", exclusive=" + exclusive); Lock lock = (Lock)locks.get(oid); if(lock == null) { // No lock for oid. Create new one. lock = new Lock(); } lock.hold(txid,exclusive,timeout); locks.put(oid,lock); } COM: <s> tries to hold a lock for an object </s>
funcom_train/8528200
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setConvertedFileStatus(int mId, int status,FileType fileType) throws SQLException { String orderType = OrderTypeMapping.getDbOrderType(fileType); String sql = "update " + Tables.FILE_ORDERS + " set order_status = ? where file_id =? and order_type=?"; PreparedStatement stmt = this.getConnection().prepareStatement(sql); stmt.setInt(1, status); stmt.setInt(2, mId); stmt.setString(3, orderType); stmt.execute(); } COM: <s> sets the converted file status </s>
funcom_train/6433893
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getImmigrant(){ String immigrant = null; if (!isNotConnected){ try{ outStream.writeBytes("get string\n"); immigrant = inStream.readLine(); }catch (IOException e) {isNotConnected=true; currentStatus.lostHost(host); } } return immigrant; } COM: <s> gets an immigrant from the host and returns it </s>
funcom_train/43467415
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void setUpAppender(String config) throws Exception { Properties props = new Properties(); InputStream is = this.getClass().getClassLoader().getResourceAsStream(config); props.load(is); is.close(); PropertyConfigurator.configure(props); Enumeration appenders = Logger.getRootLogger().getAllAppenders(); appender = (TestAppender) appenders.nextElement(); } COM: <s> set up our custom appender </s>
funcom_train/262196
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int readComputerModel(int[] res) { for (int i = 0; i < COMPUTERMODEL_IDS.length; i++) { if (COMPUTERMODEL_IDS[i] == res[1980]) { LOGGER.fine("Ausgabe : " + res[1980]); return i; } } LOGGER.fine("Ausgabe : " + res[1980]); return -1; } COM: <s> check the computer model </s>
funcom_train/22497371
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void verifyKey(VerifyEvent event) { OutlineStyledText styledText = OutlineStyledText.this; // has tab or shift tab been pressed if (event.keyCode == 9) { if (event.stateMask == 0) { doIndent(styledText.getLineAtOffset(styledText .getCaretOffset())); event.doit = false; } else if (event.stateMask == SWT.SHIFT) { doUnindent(styledText.getLineAtOffset(styledText .getCaretOffset())); event.doit = false; } } } COM: <s> this method implements verify key in verify key listener </s>
funcom_train/46859122
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JMenuItem getMnuitmHelpAbout() { if (mnuitmHelpAbout == null) { mnuitmHelpAbout = new JMenuItem(); mnuitmHelpAbout.setText("About..."); mnuitmHelpAbout.setIcon(new ImageIcon(getClass().getResource("/resources/icons/clear.png"))); mnuitmHelpAbout.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { ShowHelpAbout(); } }); } return mnuitmHelpAbout; } COM: <s> this method initializes mnuitm help about </s>
funcom_train/37591050
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setDisplayInFrame(boolean b) { if (b) { _detach.run(this); setVisible(true); addWindowListener(_wa); } else { removeWindowListener(_wa); setVisible(false); getContentPane().removeAll(); _reattach.run(this); } } COM: <s> set whether the the tabbed pane is displayed in this frame </s>
funcom_train/10822347
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public KeyDistribution getKeyDistribution(int n, int nTables, BlockDistribution lastBd) throws IOException { if (firstValidCG >= 0) { // pick the largest CG as in the row split case return colGroups[getRowSplitCGIndex()].getKeyDistribution(n, nTables, lastBd); } return null; } COM: <s> collect some key samples and use them to partition the table </s>
funcom_train/32060493
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Taskforce getPlayerFirstSensorTaskforce() { Vector<Taskforce> tfs = sf.game.currentplayer.getAllPlayerTaskforces(sf.game); Taskforce sensortf = null; // Find a taskforce in the system with sensors. for(Taskforce tf : tfs) { if(tf.getSystem() == starsystem) { if(tf.getDetectionPower() > 0) { sensortf = tf; break; } } } return sensortf; } COM: <s> returns the players first taskforce in the star system that has sensor </s>
funcom_train/31079980
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object getValue() { if (_values == null) return getValue(_value); Object[] vals = new Object[_values.length]; for (int i = 0; i < vals.length; i++) vals[i] = getValue(_values[i]); return vals; } COM: <s> return the value of the property as its wrapper type </s>
funcom_train/1880077
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setFrogSleep(KFrogDataType time)throws NoSuchElementException { int frogSleepMillisecs = 0; if ((time instanceof KFrogDecimal)) frogSleepMillisecs = ((KFrogDecimal)time).getVariable(); else throw new RuntimeException("Illegal type: expression in " + "sleep statement must evaluate to a decimal value"); Frog lastFrog = getFrogIfActive(); lastFrog.sleep(frogSleepMillisecs); } COM: <s> sets the frog to sleep for the given amount of time </s>
funcom_train/50770908
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void processKeyEvent(KeyEvent evt) { int keyCode = evt.getKeyCode(); if (keyCode != KeyEvent.VK_TAB) getParent().dispatchEvent(evt); if (inputHandler == null) return; switch (evt.getID()) { case KeyEvent.KEY_TYPED : inputHandler.keyTyped(evt); break; case KeyEvent.KEY_PRESSED : inputHandler.keyPressed(evt); break; case KeyEvent.KEY_RELEASED : inputHandler.keyReleased(evt); break; } } COM: <s> forwards key events directly to the input handler </s>
funcom_train/50392613
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Action getNextActionForProcessing()throws InterruptedException,TimeoutException,PersistenceException { long start=System.currentTimeMillis(); QueueEntry q=queue.poll(QUEUE_DELAY,TimeUnit.MILLISECONDS); if(q==null)return null; String key=q.actionID; Action act=getForUpdate(key); float duration=System.currentTimeMillis()-start; meanReadTime.push(duration); if(act!=null)act.setWaiting(false); return act; } COM: <s> this method returns the next action for processing </s>
funcom_train/50607914
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private File findFile(String name) { File file = null; String dir = null; StringTokenizer st = new StringTokenizer(path, delimiter); while (st.hasMoreTokens()) { dir = st.nextToken(); //System.out.println("searching for '"+name+"' in '"+dir+"'"); file = new File(dir + File.separator + name); if (file.exists()) if (file.isFile()) if (file.canRead()) return file; } return file; } COM: <s> finds the a file in the local filesystem specified by the local </s>
funcom_train/35327775
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void exit() { if (group != null) { group.threadTerminated(this); group = null; } /* Aggressively null out all reference fields: see bug 4006245 */ target = null; /* Speed the release of some of these resources */ threadLocals = null; inheritableThreadLocals = null; inheritedAccessControlContext = null; blocker = null; uncaughtExceptionHandler = null; } COM: <s> this method is called by the system to give a thread </s>
funcom_train/12067676
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean extensionExists(String extensionName) { Map<String, String> glExtensions = new HashMap<String, String>(); String[] GLExtensions = gl.glGetString(GL2.GL_EXTENSIONS).split(" "); for (int i = 0; i < GLExtensions.length; i++) { glExtensions.put(GLExtensions[i].toUpperCase(), ""); } return (glExtensions.get(extensionName.toUpperCase()) != null); } COM: <s> return true if the open gl context supports the given open gl extension </s>
funcom_train/22205349
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Collection getParameters(boolean getAll) { if (!getAll) { return getParameters(); } else { if (m_provider.isTransactionOpen()) { return getAllParameters(m_provider.getOpenTransaction()); } else { ProviderTransaction txn = m_provider.openTransaction(); Collection ret = getAllParameters(txn); txn.rollback(); return ret; } } } COM: <s> returns the parameters of this variant and if so specified </s>
funcom_train/25914634
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private IOutputAwareFeedHandler makeFeedHandler(final MediaType mediaType) throws UnsupportedMediaTypeException { IOutputAwareFeedHandler handler = null; if (mediaType != null) { handler = FeedHandlerRegistry.createFeedHandler(mediaType); } if (handler == null) { throw new UnsupportedMediaTypeException("", FeedHandlerRegistry.getMediaTypes()); } return handler; } COM: <s> returns a feed handler based on the provided acceptable media types </s>
funcom_train/51299326
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void valueChanged(TreeSelectionEvent e) { try { DocumentTreeNode node = (DocumentTreeNode) e .getNewLeadSelectionPath().getLastPathComponent(); int docTypeId = node.getDocType().getId(); if (currId != docTypeId) { panelTable.setCurrDocTypeId(docTypeId); spSpecific.getViewport().removeAll(); currId = docTypeId; } } catch (Exception e1) { e1.printStackTrace(); } } COM: <s> handle tree node selection </s>
funcom_train/26324537
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void focusLost(FocusEvent e) { try { FCField target = (FCField)e.getComponent(); _currTarget = null; setProperty(CONTENTS, new FCValue(target.getContents())); setProperty(SCROLL, new FCValue(target.getScroll())); } catch (FCException ex) { getRuntime().reportInternalError(ex); } } COM: <s> receives notification when on of this fields displays loses </s>
funcom_train/36988022
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testElementMultipleAttributes() throws Exception { CharArrayWriter c = new CharArrayWriter(); ResponseWriterImplDecorated s = new ResponseWriterImplDecorated(c,"TEXT/HTML","UTF-8"); s.startElement("TEST",null); s.writeAttribute("a1","v1",null); s.writeAttribute("a2","v2",null); s.writeAttribute("a3","v3",null); s.writeText("content",null); s.endElement("TEST"); assertEquals("<TEST a1=\"v1\" a2=\"v2\" a3=\"v3\">\n\tcontent\n</TEST>\n",c.toString()); } COM: <s> verify multiple attributes </s>
funcom_train/324084
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void makeStorageArrays(int fftLength) { if (storedFFTArray == null || storedFFTArray.length != fftLength / 2) { storedFFTArray = Complex.allocateComplexArray(fftLength / 2); } if (fullFFTArray == null || fullFFTArray.length != fftLength) { fullFFTArray = Complex.allocateComplexArray(fftLength); } } COM: <s> make sure storage arrays are correctly allocated </s>
funcom_train/12861491
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void test_ManyToMany_side1() throws Exception{ parse(MagicDrawFilesPath+"EntityRelationTest1Impl.hbm.xml"); setSingelNode("/hibernate-mapping/class/set[@name='e']"); assertEquals(singelNode.valueOf("@cascade"), CASCADE_NONE); setSingelNode("/hibernate-mapping/class/set/many-to-many/column"); assertEquals(singelNode.valueOf("@name"), COLUMNNAME2); setSingelNode("/hibernate-mapping/class/set/key/column"); assertEquals(singelNode.valueOf("@name"), COLUMNNAME1); } COM: <s> the generation of many to many references is tested </s>
funcom_train/26095903
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addNetworkPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_NetworkActivation_network_feature"), getString("_UI_PropertyDescriptor_description", "_UI_NetworkActivation_network_feature", "_UI_NetworkActivation_type"), ArnePackage.Literals.NETWORK_ACTIVATION__NETWORK, true, false, true, null, null, null)); } COM: <s> this adds a property descriptor for the network feature </s>
funcom_train/31105643
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void invocationCopyBind () { // Creates a binding variable for each variable. The binding variables are used // by the invocation, and are unique for each invocation. for ( int i = 0; i < mVariables.size(); i++ ) { ((IVariable)mVariables.get(i)).invocationCopyBind(); } } COM: <s> calls invocation copy bind on all variables of this clause </s>
funcom_train/4887561
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setChat(String txt, boolean general) { String dat = ""; if (general) { dat = RegnumProtokoll.createAllChatData(main.getSettings().getSelectedCharName(), txt); } else { dat = RegnumProtokoll.createChatData(main.getSettings().getSelectedCharName(), txt); } readerThread.sendData(dat); } COM: <s> sends chat data to server </s>
funcom_train/39889571
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Command getCommandAbout() { if (commandAbout == null) {//GEN-END:|72-getter|0|72-preInit // write pre-init user code here commandAbout = new Command("Hakk\u0131nda", Command.OK, 3);//GEN-LINE:|72-getter|1|72-postInit // write post-init user code here }//GEN-BEGIN:|72-getter|2| return commandAbout; } COM: <s> returns an initiliazed instance of command about component </s>
funcom_train/15454491
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addContactRecommendation(User contact) { if(this.isConfirmedAccess()){ if (!this.getAllContacts().contains(contact)) { ContactRecommendation contactRecommendation = new ContactRecommendation(); contactRecommendation.setUser(contact); contactRecommendation.setOwner(this); contactRecommendation.setDate(new Date(System.currentTimeMillis())); this.addRecommedation(contactRecommendation); } } } COM: <s> creates and adds a contact recomendation based on user </s>
funcom_train/3076557
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void appendLoginInfo(Commandline cmdLine) { if (Luntbuild.isEmpty(getVssPassword())) cmdLine.createArgument().setValue("-Y" + getVssUser()); else { Commandline.Argument arg = cmdLine.createArgument(); arg.setValue("-Y" + getVssUser() + "," + getVssPassword()); arg.setDescriptiveValue("-Y" + getVssUser() + ",******"); } } COM: <s> append login information to specified commandline object </s>
funcom_train/14301756
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public InsertQuery addCustomPreparedColumns(Object... columnStrs) { SqlObject[] values = null; if(columnStrs != null) { values = new SqlObject[columnStrs.length]; Arrays.fill(values, QUESTION_MARK); } return addCustomColumns(columnStrs, values); } COM: <s> adds the given columns and an equal number of question mark values to </s>
funcom_train/7720453
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Class loadClass(String classname) throws Exception { if (classpath == null) { return Class.forName(classname); } else { loader = getProject().createClassLoader(classpath); loader.setThreadContextLoader(); Class c = Class.forName(classname, true, loader); return c; } } COM: <s> load named class either via the system classloader or a given </s>