__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/21847418
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void updateToolTip() { ExtEditorUI ui = extEditorUI; if (ui == null) return; JTextComponent comp = ui.getComponent(); if (comp == null) return; BaseKit kit = Utilities.getKit(comp); if (kit != null) { Action a = kit.getActionByName(ExtKit.buildToolTipAction); if (a != null) { a.actionPerformed(new ActionEvent(comp, 0, "")); // NOI18N } } } COM: <s> update the tooltip by running corresponding action </s>
funcom_train/25069590
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getFeatures(){ features =""; Iterator<Map.Entry<String, String>> it = featuresMap.getFeaturesMap().entrySet().iterator(); while (it.hasNext()) { Map.Entry<String,String> pairs = it.next(); features = features + (pairs.getKey() + "=" + pairs.getValue() + " | "); } return features; } COM: <s> getter method for annotations features </s>
funcom_train/14331574
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void repo(ProgramConfig programConfig, String controllerName) { ControllerRegistration reg = mgr.registerRepository(programConfig, null, controllerName); LOG.info(LogHelper.format(programConfig.getProgramDefinition().getId(), "Registration with repository controller " + reg.getObjectName().getCanonicalName() + " successful")); } COM: <s> register the program in repository mode </s>
funcom_train/51357552
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void attributeRemoved(final HttpSessionBindingEvent event) { log.info("Attribute Removed: " + event.getName()); if (event.getName().equals(USER_KEY)) { String username = (String) event.getValue(); log.info("User Logged Out: " + username); removeUsername(event.getValue()); } } COM: <s> when users logout remove their name from the hash map </s>
funcom_train/44152463
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void iterate(IterativeState state) throws NumericException { state.initialize(); do { state.iterate(); } while (state.getIterations() < getMaximumIterations() && Math.abs(state.getRelativeError()) > getMaximumRelativeError()); if (state.getIterations() >= getMaximumIterations()) { throw new ConvergenceException( "Iterative method failed to converge."); } } COM: <s> perform the iterative evaluation </s>
funcom_train/41093380
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void hideMessageLayer() { if (messageLayer != null && messageLayer.isShowing()) { Animator animator = new Animator(500, new PropertySetter( messageAlpha, "alpha", messageAlpha.getAlpha(), 0.0f) { public void end() { remove(messageLayer); revalidate(); } }); animator.setStartDelay(300); animator.setAcceleration(.2f); animator.setDeceleration(.5f); animator.start(); } } COM: <s> fades out and removes the current message component </s>
funcom_train/1316581
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void createGroundItem(Player player, Item item) { final FloorItem floor = FloorItem.createPlayerDroppedItem(player, item); items.add(floor); refresh(floor); World.getInstance().registerEvent(new Event(60000) { @Override public void execute() { floor.setPlayer(null); refresh(floor); if(!floor.isDestroyed()) { World.getInstance().registerEvent(new Event(60000) { @Override public void execute() { items.remove(floor); refresh(floor); this.stop(); } }); } else { if(items.contains(floor)) { items.remove(floor); } } this.stop(); } }); } COM: <s> called when a player drops an item onto the floor </s>
funcom_train/10532975
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testToObjectArray() { org.apache.beehive.controls.runtime.webcontext.ControlBeanContextSupport cbcs = getContext(); ControlBeanContextChildSupport child = new ControlBeanContextChildSupport(); assertTrue(cbcs.add(child)); Object[] array = cbcs.toArray(); assertEquals(1, array.length); assertEquals(child, array[0]); } COM: <s> test to array collection api </s>
funcom_train/23032434
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setOperator(Operator operatorToBeSelected){ // iterate over all operators in the combo-box... for (int i = 0; i < operatorCombo.getItemCount(); i++) { Operator controllerOp = (Operator) operatorCombo.getItemAt(i); // ...until we find the one that matches... if (controllerOp.equals(operatorToBeSelected)) // ...and make it the selected item in the combo-box. operatorCombo.setSelectedIndex(i); } } COM: <s> sets the operator </s>
funcom_train/17592815
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private FileFilter getJFileFilter() { if (jFileFilter == null) { jFileFilter = new FileFilter() { public boolean accept(File f) { return f.isDirectory() || f.getName().endsWith(".datalog"); } public String getDescription() { return "Datalog files (.datalog)"; } }; } return jFileFilter; } COM: <s> this method initializes j file filter </s>
funcom_train/6260413
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void startExceptionGenerator(Namespace p) { try { for (Iterator k = p.getContents().iterator(); k.hasNext();) { Object o = k.next(); if (o instanceof MofException) { if(generateJmiInterfaces) new GenMMImplException(this, jmi, (MofException)o); } } } catch (Exception ex) { ex.printStackTrace(); } } COM: <s> look up exception elements in specified packages contents </s>
funcom_train/40655854
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Action getSaveClickedAction() { // In the Save mode, we can use a SelectPathAction because only a single // file can be saved (multiselection disabled). Action action = new SelectPathAction() { @Override protected File getSelectedPath() { if (saveDialogPanel != null) { return saveDialogPanel.getFilename(); } return null; } }; action.putValue(Action.NAME, getApproveButtonText(getFileChooser())); action.putValue(Action.MNEMONIC_KEY, getMnemonic("Stock label|_Save")); return action; } COM: <s> action when the button save is pressed to approve the selection </s>
funcom_train/15921111
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected StmtExpr_c reconstruct(List<Stmt> statements, Expr result) { if (! CollectionUtil.allEqual(statements, this.statements) || result != this.result) { StmtExpr_c n = (StmtExpr_c) copy(); n.statements = TypedList.copyAndCheck(statements, Stmt.class, true); n.result = result; return n; } return this; } COM: <s> reconstruct the statement expression </s>
funcom_train/48876734
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void createNewChild(final Child parent1, final Child parent2){ try { final Child child = new Child(parent1, parent2); if(Generation.this.children.size() < Generation.GENERATION_SIZE) //Creating a child takes some time, so better check again before adding Generation.this.children.add(child); } catch (final DistributionException e) { Generation.log.error("Caught distribution exception trying to create new child: " + e.getMessage(), e.getCause()); e.printStackTrace(); } } COM: <s> create a new child based on two parents </s>
funcom_train/38865267
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void init() { this.stn=null; this.obsdate=null; this.ursi=null; this.release = "all"; this.releaseDate=null; this.ionosonde=null; this.ionosondeID=0; this.scaling=0f; this.offset=0; this.Nobs=0; this.obsList=null; this.latlon=null; } COM: <s> reset to empty values </s>
funcom_train/18959537
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void displayMenu() { if(menuOn) { gm.setVisible(false); pp.addMouseListener(mapListener); pp.addMouseMotionListener(mapListener); menuOn=false; } else { pp.removeMouseListener(mapListener); pp.removeMouseMotionListener(mapListener); if (myrisk.getGame().getCurrentPlayer()!=null) { AutoEndGo.setSelected( myrisk.getAutoEndGo() ); AutoDefend.setSelected( myrisk.getAutoDefend() ); } gm.setVisible(true); menuOn=true; } } COM: <s> displays the menu </s>
funcom_train/43072348
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int newNamespaceID() { //Random r = new Random(); Random r = BFTRandom.getRandom(); r.setSeed(FSNamesystem.now()); int newID = 0; while(newID == 0) newID = r.nextInt(0x7FFFFFFF); // use 31 bits only return newID; } COM: <s> generate new namespace id </s>
funcom_train/5723043
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String showStable() throws ApplicationException { // reloadWikiSiteInfo(); WikiSiteContentInfo site = wikiService.getNewestStableWikiSiteContent(siteVersionInfo.getWikiSiteId()); if (site == null) { site = wikiService.getNewestWikiSiteContent(siteVersionInfo.getWikiSiteId()); } siteVersionInfo = site; setBean(Constants.WIKI_CURRENT_SITE_VERSION, siteVersionInfo); return Constants.WIKI_MAIN_PAGE; } COM: <s> returns the stable version of a site </s>
funcom_train/14012284
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void processComponentAdd(Component parent, Component child) { if (isFullRefreshRequired()) { return; } if (!child.isRenderVisible()) { return; } if (isAncestorBeingAdded(child)) { return; } ServerComponentUpdate update = createComponentUpdate(parent); update.addChild(child); } COM: <s> processes the addition of a component to the hierarchy </s>
funcom_train/3412846
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String toString() { return new String("IndexColorModel: #pixelBits = "+pixel_bits + " numComponents = "+numComponents + " color space = "+colorSpace + " transparency = "+transparency + " transIndex = "+transparent_index + " has alpha = "+supportsAlpha + " isAlphaPre = "+isAlphaPremultiplied ); } COM: <s> returns the code string code representation of the contents of </s>
funcom_train/4471871
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected boolean isValid(String [] fields_required){ for (int i=0; i< fields_required.length; i++){ String field = fields_required[i]; String location = getProperty(field); if (ToolSafe.isEmpty(location)){ getLogger().warning("value of a property not specified: "+field); return false; } if (field.startsWith("dir_")){ File f = new File(location); if (!f.exists()){ getLogger().warning("the directory does not exist:"+ f.getAbsolutePath()); return false; } } } return true; } COM: <s> check if the settings is valid </s>
funcom_train/31487618
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public JGridBagConstraints getConstraints(Component comp) { JGridBagConstraints constraints = (JGridBagConstraints)comptable.get(comp); if (constraints == null) { setConstraints(comp, defaultConstraints); constraints = (JGridBagConstraints)comptable.get(comp); } return (JGridBagConstraints)constraints.clone(); } COM: <s> gets the constraints for the specified component </s>
funcom_train/44075136
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void signInForTest() { UserDao userDao = new UserDao(((BwhRequestCycle) RequestCycle.get()) .getHibernateSession()); User user = userDao.findUser("test"); BwhSession bwhSession = ((BwhSession) Session.get()); userDao.evict(user); // disconnect object from // session bwhSession.setUser(user); bwhSession.setVenue(user.anyVenue()); } COM: <s> signs in for testing purposes </s>
funcom_train/4014577
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void initPreview(){ tabs.add(scrollPanelPreview, LocaleText.get("preview")); previewView.setWidth("100%"); //1015"+PurcConstants.UNITS previewView.setHeight("700"+PurcConstants.UNITS); //707"+PurcConstants.UNITS previewView.setSubmitListener(this); previewView.setDesignSurface(designSurfaceView); previewView.setCenterPanel(this); scrollPanelPreview.setWidget(previewView); } COM: <s> sets up the preview surface tab </s>
funcom_train/23050383
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected Layouter initLayout(Instruction instruction) { if (instruction instanceof Page) { return documentLook ? new DocumentLayouter((Page)instruction) : new FormLayouter((Page)instruction); } else if (instruction instanceof PageSet) { return documentLook ? new DocumentLayouter((PageSet)instruction) : new FormLayouter((PageSet)instruction); } throw new IllegalArgumentException("Page or PageSet expected"); } COM: <s> construct a descriptive layout specification </s>
funcom_train/43244905
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testReturnConnection() { System.out.println("returnConnection"); VistAConnection conn = null; Session instance = new Session(); instance.returnConnection(conn); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); } COM: <s> test of return connection method of class org </s>
funcom_train/31160254
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void inputFieldKeyReleased(KeyEvent event) { int code = event.getKeyCode(); if (code == 38) // up arrow inputField.setText(history.previous()); else if (code == 40) // down arrow inputField.setText(history.next()); } COM: <s> listen to the keys pressed in the input field to provide an intuitive </s>
funcom_train/9201167
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String parseStreetName(String resp) throws JSONException { JSONObject jsonObj = new JSONObject(resp); int code = jsonObj.getJSONObject("Status").getInt("code"); if (code == 200) { return extendShorts(jsonObj.getJSONArray("Placemark").getJSONObject(0).getString("address")); } return null; } COM: <s> parses the json response to extract the street name </s>
funcom_train/3709205
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addJNDIName(String jndiName){ Hashtable ep = System.getProperties(); //Context.INITIAL_CONTEXT_FACTORY try{ InitialContext ct = new InitialContext(ep); DataSource myConnector = null; ct.bind("java:comp/env/jdbc/"+jndiName,myConnector); }catch(NamingException error){ logger.error("Error : "+error.getMessage()); } } COM: <s> lame attempt at creating a jndiname dynamically </s>
funcom_train/31105810
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String toString () { ITerm[] values = getValues(); StringBuffer buf = new StringBuffer(256); buf.append("[Binding]:"); for ( int i = 0; i < mValue.length; i++ ) { if ( values[i] != null ) { buf.append(" "); buf.append(mVariableBundle.getVariable(i).toString()); buf.append(" <- "); buf.append(values[i].toString()); } } return new String(buf); } COM: <s> describe a binding </s>
funcom_train/25058011
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void launch(String processDefName, Long taskId) { ProcessDef processDef; try { processDef = loadProcessDef(processDefName); } catch (RuntimeException re) { // record error in task recordProcessLaunchError(taskId, re); throw re; } launch(processDef, taskId); } COM: <s> launches code process def name code for the supplied taskid </s>
funcom_train/3368987
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void setModelToViewFromViewToModel(boolean unsetFirst) { int i; if (unsetFirst) { for (i = modelToView.length - 1; i >= 0; i--) { modelToView[i] = -1; } } for (i = viewToModel.length - 1; i >= 0; i--) { modelToView[viewToModel[i].modelIndex] = i; } } COM: <s> refreshes the model to view mapping from that of view to model </s>
funcom_train/26461838
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String getExt(String userAgent) { Iterator i = map.keySet().iterator(); while (i.hasNext()) { String curr = (String)i.next(); if (userAgent.indexOf(curr) > -1) return (String)map.get(curr); } return null; } COM: <s> get extention for user agent </s>
funcom_train/3173764
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void parse(Property root, Property property, NestedBlockLayout descriptor, Set<String> beanifiedTags) { setLayout(descriptor); // fill cells with beans for (NestedBlockLayout.Cell cell : descriptor.getCells()) { JComponent comp = createComponent(root, property, cell, beanifiedTags); if (comp!=null) add(comp, cell); } // done } COM: <s> parse descriptor for beans into panel </s>
funcom_train/26318074
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getLiveCommandersOwnedBy(Player player) { int count = 0; for (Entity entity : entities) { if (entity.getOwner().equals(player) && !entity.isDestroyed() && entity.isCommander() && !entity.isOffBoard() && !entity.isCaptured()) { count++; } } return count; } COM: <s> returns the number of non destroyed deployed entities owned by the </s>
funcom_train/35096689
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean isOneReverse() throws InvalidRangeException { return (((this.firstAddress instanceof Inet4Address) && ((this.getPrefix() % 8) == 0)) || ((this.firstAddress instanceof Inet6Address) && ((this .getPrefix() % 4) == 0))); } COM: <s> determines if the network contains only one reverse </s>
funcom_train/41445661
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object clone() { ConfigProperties clone = new ConfigProperties(); for (Iterator i=properties.values().iterator(); i.hasNext(); ) { Property property = (Property)i.next(); clone.addProperty(new Property(property.getName(), property.getType(), property.getValue())); } return clone; } COM: <s> creates and returns a deep copy of this code config properties code object </s>
funcom_train/4745630
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void createGroup(String name, String description){ Cloud42BaseFunctions bf = new Cloud42BaseFunctions(); boolean result = false; AwsCredentials cred = userManager.getCurrentCredentials(); if (cred!=null){ bf.setCredentials(cred); result = bf.createSecurityGroup(name, description); if (result) this.resetGroupList(); } if (!result){ facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_ERROR, "msg_groupNotCreated"); } else { facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_INFO, "msg_groupCreated",new Object[]{name}); } } COM: <s> create a new security group </s>
funcom_train/51638808
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void reloadExtensions() { IExtensionRegistry registry= Platform.getExtensionRegistry(); Map map= new HashMap(); IConfigurationElement[] elements= registry.getConfigurationElementsFor(JavaPlugin.getPluginId(), EXTENSION_POINT); for (int i= 0; i < elements.length; i++) { JavaFoldingStructureProviderDescriptor desc= new JavaFoldingStructureProviderDescriptor(elements[i]); map.put(desc.getId(), desc); } synchronized(this) { fDescriptors= Collections.unmodifiableMap(map); } } COM: <s> reads all extensions </s>
funcom_train/43118765
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void write(String data) { try { // Point writer to file being manipulated Writer output = new BufferedWriter(new FileWriter(_ioFile)); // Write new file to disk output.write(data); // Close file stream output.close(); } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } } COM: <s> overwrite entire file with new data </s>
funcom_train/26411518
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getAuditPercent() { double percentage = (((double)auditCount / (double)fileCount) * 100.0); NumberFormat numberFormat = NumberFormat.getInstance(); numberFormat.setMaximumFractionDigits(2); numberFormat.setMinimumFractionDigits(2); numberFormat.setMinimumIntegerDigits(2); numberFormat.setMaximumIntegerDigits(2); return numberFormat.format(percentage); } COM: <s> get the number of files in the system that have been audited </s>
funcom_train/3834366
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setSelectedMapOperation(String name) { MapOperation[] mss = getOfferedMapOperations(); for (int i = 0; i < mss.length; i++) { if ( name.equals( mss[i].getName() ) ) { mss[i].setSelected( true ); } else { mss[i].setSelected( false ); } } } COM: <s> sets the submitted operation as selected </s>
funcom_train/1805388
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void reverseAllEntries() throws IOException, ServiceException { ListQuery query = new ListQuery(listFeedUrl); query.setReverse(true); ListFeed feed = service.query(query, ListFeed.class); for (ListEntry entry : feed.getEntries()) { printAndCacheEntry(entry); } } COM: <s> lists all rows in the spreadsheet in reverse order </s>
funcom_train/3908559
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setActivityStructure(ActivityStructure as) { _as = as; // Lazily set the DataModel if(getDataModel() == null) { setDataModel(as.getDataModel()); } // Set Model ((ActivityStructureSelectorTreeModel)getEditor_TreeModel()).setActivityStructure(as); } COM: <s> set the activity structure component </s>
funcom_train/12758728
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void viewTypeChanged() { if (summaryRadioButton.isSelected()) { summaryScrollPane.setSize(displayArea.getSize()); displayArea.setLayer(summaryScrollPane, 2); displayArea.setLayer(expansionTreeScollPane, 1); } else if (configureRadioButton.isSelected()) { expansionTreeScollPane.setSize(displayArea.getSize()); displayArea.setLayer(summaryScrollPane, 1); displayArea.setLayer(expansionTreeScollPane, 2); } } COM: <s> method view type changed </s>
funcom_train/13271981
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setNavigationPanelVisible(boolean navigationPanelVisible) { if (this.navigationPanelVisible != navigationPanelVisible) { this.navigationPanelVisible = navigationPanelVisible; this.propertyChangeSupport.firePropertyChange(Property.NAVIGATION_PANEL_VISIBLE.name(), !navigationPanelVisible, navigationPanelVisible); } } COM: <s> sets whether the navigation panel should be displayed or not </s>
funcom_train/9646278
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void subtractTo(Rectangle2D r) { r.setRect( r.getX() + getLeft(), r.getY() + getTop(), r.getWidth() - getLeft() - getRight(), r.getHeight() - getTop() - getBottom() ); } COM: <s> subtracts the current insets to the specified rectangle2 d making the </s>
funcom_train/11792746
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Option createEprOutOption() { Option eprOption = OptionBuilder.create("o"); eprOption.setDescription(Messages.getString("Client.EPROutOptionText")); logger.debug("EPR out option description: " + Messages.getString("Client.EPROutOptionText")); eprOption.setArgName("file"); eprOption.setArgs(1); eprOption.setLongOpt("eprOut"); return eprOption; } COM: <s> creates the cli code option code of the epr out option </s>
funcom_train/29722666
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JPanel getJPanel() { if (jPanel == null) { jLabel11 = new JLabel(); jLabel11.setFont(new Font("Dialog", Font.PLAIN, 12)); jLabel11.setText("Apply find and replace and send output"); jLabel11.setVisible(true); jPanel = new JPanel(); jPanel.setLayout(new GridBagLayout()); } return jPanel; } COM: <s> this method initializes j panel </s>
funcom_train/49653166
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void updateList() { if (D) Log.e(TAG,"method updateList called"); lastIndex[0] = foodItemList.size() - 1; previousSearchString = null; clear(); for (int index = 0;index < foodItemList.size();index++) { add(foodItemList.get(index).toString()); } ((HelpDiabetes)callingContext).triggerSearching(); } COM: <s> updates the activitylist should be called from uithread br </s>
funcom_train/14034291
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String encrypt(String unencryptedString) throws EncryptionException { if (unencryptedString == null || unencryptedString.trim().length() == 0) throw new IllegalArgumentException( "unencrypted string was null or empty"); try { SecretKey key = keyFactory.generateSecret(keySpec); cipher.init(Cipher.ENCRYPT_MODE, key); byte[] cleartext = unencryptedString.getBytes(UNICODE_FORMAT); byte[] ciphertext = cipher.doFinal(cleartext); BASE64Encoder base64encoder = new BASE64Encoder(); return base64encoder.encode(ciphertext); } catch (Exception e) { throw new EncryptionException(e); } } COM: <s> encrypt a code string code </s>
funcom_train/15550350
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void run(IAction action) { shell = new Shell(); IResource res = (IResource) selection.getFirstElement(); // TODO Save File or check if file Saved String file = res.getRawLocation().toOSString(); String filename = res.getName().toString(); String[] path = res.getProjectRelativePath().removeLastSegments(1) .toOSString().split("/"); sendtoPrinter(filename, file, path); } COM: <s> this method is called when the menu item is selected </s>
funcom_train/5166642
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getMoveCount() { int moves = 0; for (int antIndex = 0; antIndex < m_popSize; antIndex++) { if (getAnts()[antIndex] != null) { moves = getAnts()[antIndex].getMoves(); } } return moves; } COM: <s> asks each ant for the number of moves and sums up the result </s>
funcom_train/11418193
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Conduit getConduit(Message message) throws IOException { Exchange exchange = message.getExchange(); EndpointReferenceType target = exchange.get(EndpointReferenceType.class); Conduit conduit = exchange.getDestination().getBackChannel(message, null, target); exchange.setConduit(conduit); return conduit; } COM: <s> this method retrieves creates the conduit for the response </s>
funcom_train/44710210
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String toString() { String newLine = System.getProperty("line.separator"); String foo = super.toString() + " = {" + newLine + "m_action = \"" + m_action + "\"" + newLine + "m_formData = " + m_formData + newLine + "}"; return foo; } COM: <s> converts to a string </s>
funcom_train/11643783
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testInitExecutor() { ExecutorService exec = Executors.newSingleThreadExecutor(); CallableBackgroundInitializer<Integer> init = new CallableBackgroundInitializer<Integer>( new TestCallable(), exec); assertEquals("Executor not set", exec, init.getExternalExecutor()); } COM: <s> tests whether the executor service is correctly passed to the super </s>
funcom_train/18224430
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setParameters(Hashtable newParameters) { this.parameters = new Hashtable(); Enumeration enum = newParameters.keys(); while (enum.hasMoreElements()) { String eachName = (String) enum.nextElement(); String[] values = (String[]) newParameters.get(eachName); for (int i = 0; i < values.length; i++) { String eachValue = values[i]; this.addParameter(eachName, eachValue); } } } COM: <s> replace existing parameters </s>
funcom_train/13783516
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void initRootFolderPath() { if (needToExtract()) { for (String folderName : folderNames) { int ind = folderName.indexOf('/'); if (ind > 0) { rootName = folderName.substring(0, ind + 1); return; } } } } COM: <s> inits the root folder name is exists from the set of folder names </s>
funcom_train/51107808
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void deleteTestData() throws Exception { Iterator it = domain.getDataNodes().iterator(); while (it.hasNext()) { DataNode node = (DataNode) it.next(); deleteTestData(node, (DataMap) node.getDataMaps().iterator().next()); } } COM: <s> deletes all data from the database tables mentioned in the data map </s>
funcom_train/3923381
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void updateScene( boolean forceUpdate ) throws VRObjectException { try { if ( scene != null ) { // scene may be null for some clients in some cases (Gate, Bots...) scene.update( forceUpdate ); } } catch ( Throwable e ) { Logger.logError( "Could not update scene", e ); throw new VRObjectException( "Could not update scene - " + e.toString() ); } } COM: <s> update the scene </s>
funcom_train/47922329
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Collection getAllChildrenNodeIds() { Collection nodeIds=new LinkedList(); if( children!=null ) { for( Iterator iter=children.iterator(); iter.hasNext(); ) { Node child=(Node) iter.next(); nodeIds.add( new Integer( child.getId() ) ); getAllChildrenNodeIds( nodeIds, child ); } } return nodeIds; } COM: <s> get all children nodes cascade exclude this node </s>
funcom_train/10482541
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public List listSubscribed(String mailbox, String pattern) throws MessagingException { IMAPCommand command = new IMAPCommand("LSUB"); // construct the command, encoding the tokens as required by the content. command.appendEncodedString(mailbox); command.appendEncodedString(pattern); sendCommand(command); // pull out the ones we're interested in return extractResponses("LSUB"); } COM: <s> send an lsub command to the imap server returning all lsub </s>
funcom_train/48340401
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void run() { int tmp = -1; //while (tmp != 0) { // error : leaving out the negation while (tmp != 0) { //corrected tmp = input.take(); if (tmp == 0) break; output.add(tmp+1); } output.stop(); assert(PipeInttest.stopCalled); } } COM: <s> post proper exit pipe inttest </s>
funcom_train/3410072
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isMimeTypeEqual(String mimeType) { // JCK Test DataFlavor0117: if 'mimeType' is null, throw NPE if (mimeType == null) { throw new NullPointerException("mimeType"); } if (this.mimeType == null) { return false; } try { return this.mimeType.match(new MimeType(mimeType)); } catch (MimeTypeParseException mtpe) { return false; } } COM: <s> returns whether the string representation of the mime type passed in </s>
funcom_train/36202101
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void registerConstraintModule(int pos, ConstraintModule<T> cm) { List<ConstraintModule<T>> modules; if (cm.OPERATOR.equals(Operator.DONT_COMPILE_IF_VIOLATED)) { modules = constraintModulesDONT; } else { modules = constraintModulesDO; } if (pos > modules.size() || pos < 0) { modules.add(cm); } else { modules.add(pos, cm); } } COM: <s> registers the given constraint to the handler at a certain position in </s>
funcom_train/8811716
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private ContentPanel createAmendmentBox() { // Creates the panel final VBoxLayout vBoxLayout = new VBoxLayout(); vBoxLayout.setVBoxLayoutAlign(VBoxLayout.VBoxLayoutAlign.STRETCH); vBoxLayout.setPadding(new Padding(4)); final ContentPanel amendmentPanel = new ContentPanel(vBoxLayout); amendmentPanel.setHeading(I18N.CONSTANTS.amendmentBoxTitle()); return amendmentPanel; } COM: <s> creates the amendment box to be displayed at the top of this view </s>
funcom_train/22571701
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void setCompletedLabel() { // added by hvo fixing bug #155, 05-07-2006 fLinkCompleted.setText(fPlan.isCompleted() ? Messages.CompetencePlanEditor_3 : Messages.CompetencePlanEditor_10); fLinkCompleted.setUnderlined(!fPlan.isCompleted()); fLinkCompleted.setEnabled(!fPlan.isCompleted()); fLinkCompleted.getParent().layout(); } COM: <s> set the text of the completed link </s>
funcom_train/8715867
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void setColorKeyMask(PDFObject maskArrayObject) throws IOException { PDFObject[] maskObjects = maskArrayObject.getArray(); colorKeyMask = null; int[] masks = new int[maskObjects.length]; for (int i = 0; i < masks.length; i++) { masks[i] = maskObjects[i].getIntValue(); } colorKeyMask = masks; } COM: <s> set the color key mask </s>
funcom_train/3370635
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void add(Component component, Object constraints) { if (!(component instanceof UIResource)) { if (constraints instanceof String) { addTab((String)constraints, component); } else if (constraints instanceof Icon) { addTab(null, (Icon)constraints, component); } else { add(component); } } else { super.add(component, constraints); } } COM: <s> adds a code component code to the tabbed pane </s>
funcom_train/3631622
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void engage(int value) { context().setQuantity((context().inputDouble())); context().clearInput(); setPromptText(context().posParameters().getString("EnterItem")); context().operPrompt().update(this); } COM: <s> get the quantity from the input line and set the </s>
funcom_train/16851440
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public T save( T persistedObj ){ if( persistedObj != null ){ PersistenceManager pm = PersistenceManagerFactoryWrapper.get().getPersistenceManager(); Transaction tx = pm.currentTransaction(); try { tx.begin(); log.debug( "persisting " + persistedObj.getClass().getName() ); pm.makePersistent( persistedObj ); tx.commit(); } catch (Exception e) { tx.rollback(); e.printStackTrace(); //throw new CmsPersistenceException( e.getCause().getMessage(), persistedObj ); } finally { pm.close(); } } return persistedObj; } COM: <s> saves any object which implements persisted object </s>
funcom_train/9912029
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int _hashCode() { int hashCode = 0; int count = 1; Object o; for (String element : keys) { o = element; hashCode += (o == null) ? 0 : o.hashCode() * count++; } if (hashCode == 0)// fix degenerate case { hashCode = 0xFEED; } return hashCode; } COM: <s> calculates a hash code by summing the hash code of all keys </s>
funcom_train/18744450
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private AlgebraFamily getFamily() { AlgebraFamily result; SystemProperties properties = getGrammar() == null ? null : getGrammar().getProperties(); if (properties == null) { result = AlgebraFamily.getInstance(); } else { result = AlgebraFamily.getInstance(properties.getAlgebraFamily()); } return result; } COM: <s> extracts the algebra family from a possibly </s>
funcom_train/12304581
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void printStackTrace(java.io.PrintWriter pw) { if ( exception != null ) { String superString = getLocalMessage(); synchronized (pw) { pw.print(superString); pw.print((superString.endsWith(".") ? " Caused by " : ". Caused by ")); exception.printStackTrace( pw ); } } else { super.printStackTrace( pw ); } } COM: <s> prints this exceptions stack trace to a print writer </s>
funcom_train/27683058
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: synchronized protected void logString(Log log, int loggingLevel, String logString) { // If the log is dated and we rolled over a date, must close and // reopen the log to switch dates! if (isDatedLog() && hasDateRolledOver()) { rollLogOver(); } printStream.println(loggingPrefix(log, loggingLevel) + logString); printStream.flush(); } COM: <s> logs a string to print stream complete with a descriptive prefix so viewers </s>
funcom_train/17196645
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public User createUser(String name, String pass) { checkStartup(); try { ClosableIterator<? extends Statement> it = mainModel .findStatements(Variable.ANY, org.ontoware.semversion.impl.generated.User.NAME, new PlainLiteralImpl(name)); if (it.hasNext()) throw new RuntimeException("User " + name + " already exists"); return new UserImpl(mainModel, mainModel.newRandomUniqueURI(), name, pass); } catch (Exception e) { throw new RuntimeException(e); } } COM: <s> admin taks create a new user account </s>
funcom_train/257218
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int add(String token) { // Must check if it exists, otherwise the id will be unnecessarily incremented if (!tokens.containsKey(token)) { // Insert new token tokens.put(token, new Integer(nextUnusedKey)); addedCount++; return nextUnusedKey++; } else { // Fetch id return ((Integer) tokens.get(token)).intValue(); } } COM: <s> adds a token to the set of tokens </s>
funcom_train/25492802
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void init() { if (trafficLight) { // set all traffic lights to red Iterator<RoadEdge> it = getInEdges().iterator(); while (it.hasNext()) { RoadEdge road = it.next(); // set traffic lights to red road.setTrafficLight(true); } RoadEdge greenRoad = getInEdges().get(greenLight); greenRoad.setTrafficLight(false); currentSlice = slices[greenLight]; counter = 0; } } COM: <s> initializes the intersection for the simulation </s>
funcom_train/44165685
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Element playerReady(Element element) { Game game = getFreeColClient().getGame(); Player player = game .getFreeColGameObject(element.getAttribute("player"), Player.class); boolean ready = Boolean.valueOf(element.getAttribute("value")) .booleanValue(); player.setReady(ready); gui.refreshPlayersTable(); return null; } COM: <s> handles a player ready message </s>
funcom_train/23199748
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public SignalSegment save(SignalSegment entry) { CorpusFileEntry fileEntry = null; if (!(entry instanceof CorpusFileEntry)) { if (entry.getId() == null) { fileEntry = new CorpusFileEntry(); fileEntry.setName(entry.getName()); fileEntry.putAll(entry); } else { throw new ProcessingException("Not implemented"); } } else { fileEntry = (CorpusFileEntry) entry; } CorpusFileEntry file = saveOrUpdateFile((CorpusFileEntry) fileEntry); return file; } COM: <s> save and reset repo </s>
funcom_train/48211907
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void removeSelectedDsType() { JDBCDataSourceType type = (JDBCDataSourceType) dsTypeList.getSelectedValue(); if (type != null) { ((DefaultListModel) dsTypeList.getModel()).removeElement(type); dataSourceCollection.removeDataSourceType(type); } } COM: <s> removes the selected data source type from the list </s>
funcom_train/37565403
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void sort(String inFile, String outFile) throws IOException { this.inFile = inFile; this.outFile = outFile; File file = new File(outFile); if (file.exists()) throw new IOException("already exists: " + file); int segments = sortPass(); int pass = 1; while (segments > 1) { segments = mergePass(pass, segments <= factor); pass++; } } COM: <s> perform a file sort </s>
funcom_train/35192675
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public List readTxtFile(String path) throws IOException { List arr = new ArrayList(); BufferedReader br = null; try { br = new BufferedReader(new FileReader(path)); String line; while ((line = br.readLine()) != null) { arr.add(line); } } finally { if (br != null) { br.close(); } } return arr; } COM: <s> read a text file given as parameter and separates it to </s>
funcom_train/3141256
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Font getScaledFont(Point2D scale) { double maxScale = Math.max(scale.getX(), scale.getY()); Font font = null; if (maxScale > scale1) font = font1; if (maxScale <= scale1 && maxScale > scale2) font = font2; if (maxScale <= scale2 && maxScale > scale3) font = font3; if (maxScale <= scale3) font = font4; return font; } COM: <s> returns the font that has a size that corresponds to the distortion </s>
funcom_train/32790972
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void handleAddPlus(String codeSrcExp, List<String> args, StringBuffer rule, StringBuffer spec) { assert(args.size() == 1) : "Additive expression + needs exactly one argument"; codeAgent.setArgument("mult_exp_1", codeSrcExp); codeAgent.setArgument("mult_exp_2", args.get(0)); rule.append("additive_expression_tail"); spec.append("plus"); } COM: <s> parameterizes the code agent for a plus operation </s>
funcom_train/11701209
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isContaining(Span containingSpan) { boolean isStartContaining = getStart() <= containingSpan.getStart(); if (!isStartContaining) { return false; } boolean isEndContaining = getEnd() >= containingSpan.getEnd(); if (!isEndContaining) { return false; } return true; } COM: <s> returns true if the given span is a subset of this span </s>
funcom_train/3082995
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setModel(CalendarSelectionModel newModel) { if (newModel == null) throw new IllegalArgumentException("The CalendarSelectionModel mus be non null!"); CalendarSelectionModel oldModel = getModel(); if (oldModel != newModel) { if (oldModel != null) oldModel.removeListener(modelChangeForwarder); newModel.addListener(modelChangeForwarder); } setProperty(PROPERTY_MODEL, newModel); } COM: <s> sets a new code calendar selection model code model into the </s>
funcom_train/27720219
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void privmsg(String to, String msg) { // Do we have an appropriate channel listener? if (to.startsWith("#")) { Channel chan = (Channel)channels.get(to.toLowerCase()); chan.onMessageReceived(msg); return; } // Or an appropriate user to send the message to? User u = (User)users.get(to); u.onMessageReceived(msg); } COM: <s> handles a privmsg private message command </s>
funcom_train/51162744
/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; if (!(obj instanceof ItemReferrence)) return false; ItemReferrence ir = (ItemReferrence) obj; return (item == null ? ir.item == null : item.equals(ir.item)) && (comboBox == ir.comboBox || (comboBox != null && comboBox.equals(ir.comboBox))); } COM: <s> compares this code item referrence code to the specified object </s>
funcom_train/2415462
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JsonSession getSession(JsonSessionCredentials credentials) throws EngineSessionException { JsonSession session = sessions.getSession(credentials.getSessionId(), credentials.getUserName(), credentials.getMd5Pwd()); if (session == null) { String msg = missingSessionErrorMessage(credentials); throw new EngineSessionException(msg); } return session; } COM: <s> returns the bulk load session identified by the given credentials </s>
funcom_train/18022130
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public DataSet getPlanarView(String planeID) { int index = -1; for (int i = 0; i < planeIDs.length; i++) { if (planeIDs[i].equals(planeID)) { index = i; break; } } if (index == -1) { return null; } else { return new PlanarViewDataSet(index); } } COM: <s> returns a code data set code with the specified view as the primary </s>
funcom_train/35742210
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public SrdiHandlerMetric getSrdiHandlerMetric(String handlerName) { for (Iterator i = srdiHandlerMetrics.iterator(); i.hasNext();) { SrdiHandlerMetric srdiHandlerMetric = (SrdiHandlerMetric) i.next(); if (handlerName.equals(srdiHandlerMetric.getHandlerName())) { return srdiHandlerMetric; } } return null; } COM: <s> get srdi handler metrics for the corresponding handler </s>
funcom_train/36612942
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getColumnTypes(String table){ String s = ""; try { ResultSetMetaData rsmd = stmt.executeQuery ("SELECT * FROM " + table).getMetaData(); for(int i = 1; i <= rsmd.getColumnCount(); i++) s += rsmd.getColumnTypeName(i) + " "; } catch (SQLException e) { System.out.println("Get header error: " + e.getMessage()); } return s; } COM: <s> method to get the column types </s>
funcom_train/11024501
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testListIndexedWriteMethod() { try { IndexedPropertyDescriptor descriptor = (IndexedPropertyDescriptor)propertyUtilsBean.getPropertyDescriptor(bean, "stringList"); assertNotNull("No List Indexed Write Method", descriptor.getIndexedWriteMethod()); } catch(Exception e) { fail("Threw exception " + e); } } COM: <s> test indexed write method for a list </s>
funcom_train/20885354
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testPrimitiveBooleanXML() { PrimitiveBooleanDTO dto = new PrimitiveBooleanDTO(); dto.primitiveBooleanField = false; assertTrue(JSefaTestUtil.serialize(XML, dto).indexOf("false") >= 0); JSefaTestUtil.assertRepeatedRoundTripSucceeds(XML, dto); } COM: <s> tests primitive boolean xml </s>
funcom_train/39543752
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public float getHKern(int glyphCode1, int glyphCode2) { if (glyphCode1 < 0 || glyphCode1 >= glyphUnicodes.length || glyphCode2 < 0 || glyphCode2 >= glyphUnicodes.length) { return 0f; } float ret; ret = hKerningTable.getKerningValue(glyphCode1, glyphCode2, glyphUnicodes[glyphCode1], glyphUnicodes[glyphCode2]); return ret*scale; } COM: <s> returns the horizontal kerning value for the specified glyph pair </s>
funcom_train/12868209
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String getJavaExecutable() throws MojoExecutionException { Toolchain tc = toolchainManager.getToolchainFromBuildContext("jdk", session); if (tc != null) { if (isVerbose() || getLog().isDebugEnabled()) { getLog().info("Toolchain: " + tc); } String javaExecutable = tc.findTool("java"); if (javaExecutable != null) { return javaExecutable; } else { throw new MojoExecutionException( "Unable to find 'java' executable for toolchain: " + tc); } } return "java"; } COM: <s> returns path to the java executable via mavens toolchain api </s>
funcom_train/8081329
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected String getClustererSpec() { Clusterer c = getClusterer(); if (c instanceof OptionHandler) { return c.getClass().getName() + " " + Utils.joinOptions(((OptionHandler)c).getOptions()); } return c.getClass().getName(); } COM: <s> gets the clusterer specification string which contains the class name of </s>
funcom_train/42710033
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public JButton getJButtonUpdateCustomer() { if (jButtonUpdateCustomer == null) { jButtonUpdateCustomer = new JButton(); jButtonUpdateCustomer.setBounds(new Rectangle(140, 320, 121, 21)); jButtonUpdateCustomer.setText("Update"); jButtonUpdateCustomer.setActionCommand("UpdateCustomer"); } return jButtonUpdateCustomer; } COM: <s> this method initializes j button update customer </s>
funcom_train/31480498
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean equals(SPKIHash h) { if ((null == this.value) || (null == h)) return false; byte [] _b = h.getValue(); if (this.value.length != _b.length) return false; for(int _i = 0; _i < _b.length; _i++) { if (this.value[_i] != _b[_i]) return false; } return true; } COM: <s> compare this object with the specified object </s>