__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/37570789
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public User findUserByUsername(String username) throws ModelException { try { EJBUser user = m_userHome.findByUsername(username); return user.toVO(); } catch (FinderException exception) { return null; } catch (Exception exception) { throw new ModelException("The EJBUserFacadeBean did not find a User entity bean for the name: " + username + "."); } } COM: <s> find and return a user object by its username </s>
funcom_train/19911430
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void removeTopSong() { int length = displayedSongs.length; for (int j = 0; j < length - 1; j++) { displayedSongs[j] = displayedSongs[j + 1]; } displayedSongs[length - 1] = null; if (updateListener != null) { updateListener.onDisplayedSongsChanged(); } changeSong(); notifySongRemoved(); } COM: <s> removes the top song </s>
funcom_train/35838807
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public NodeSummary getDeletedNodeSummaryId(PCSession session, String sNodeID) throws SQLException { // DBConnection dbcon = getDatabaseManager().requestConnection(session.getModelName()) ; // // NodeSummary node = DBNode.getDeletedNodeSummaryId(dbcon, sNodeID, session.getUserID()); // // getDatabaseManager().releaseConnection(session.getModelName(),dbcon); return null; } COM: <s> returns the node marked for deletion with the given node id </s>
funcom_train/37518448
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public CodeInfo getCodeInfo() { CodeInfo codeInfo; codeInfo = new CodeInfo(buildInstructionArray(), handlers, buildLineNumberInfo(), localVariables); // replace instruction handles by actual instructions try { AccessorTransformer transformer = new AccessorTransformer() { public InstructionAccessor transform(InstructionAccessor accessor, AccessorContainer container) { // the only accessors to resolve are instruction handles return ((InstructionHandle)accessor).getInstruction(); } }; codeInfo.transformAccessors(transformer); } catch (BadAccessorException e) { throw new RuntimeException(e.getMessage()); //!!!! } return codeInfo; } COM: <s> returns a new optimized code info structure </s>
funcom_train/44992352
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void restoreValues(){ IResource resource = extractSelection(selection); // check if resource was selected if(resource == null){ System.out.println("null resource!!!!!!!!!"); return; } //get the project containing the resource IProject project = resource.getProject(); GeneratorRunner g = GeneratorRunner.getGeneratorRunner(); String[] arr = g.getProperties(project); if (arr[0].equals("-1")){ //give some generic values initialize(); }else{ //print the properties for(int i = 0; i<arr.length; i++) strutsConfigText.setText(arr[0]); outputFileText.setText(arr[1]); fileText.setText(arr[2]); } } COM: <s> stores current selection of values </s>
funcom_train/42036052
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public float setGameSize(float width, float height) { Graphics.determine(this); float aspect = width / height; gameWidth = width; gameHeight = height; if(Graphics.getAspectRatio() < aspect) { Debug.print("Thinner than expected"); } else if(Graphics.getAspectRatio() > aspect) { Debug.print("Wider than expected"); } gameWidth = Graphics.getAspectRatio() * gameHeight; return gameWidth; } COM: <s> sets the game width and height of the open gl surface </s>
funcom_train/20376863
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void waitForPhaseComplete(String jobID, String phase, int minimumTasks) { logger.debug("wait for " + phase + " phase to complete"); // check jobManager to see if all Reducers have completed while (!isPhaseComplete(jobID, phase, minimumTasks)) { // wait for reduce phase to complete try { Thread.sleep((new Random()).nextInt(4000) + 2000); } catch (Exception e) { } } } COM: <s> waits for a phase to complete </s>
funcom_train/5373072
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setSelection (Point selection) { checkWidget (); if (selection == null) error (SWT.ERROR_NULL_ARGUMENT); /* int start = selection.x, end = selection.y; if (!OS.IsUnicode && OS.IsDBLocale) { start = wcsToMbcsPos (start); end = wcsToMbcsPos (end); } int bits = start | (end << 16); OS.SendMessage (handle, OS.CB_SETEDITSEL, 0, bits); */ } COM: <s> sets the selection in the receivers text field to the </s>
funcom_train/45249380
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String getCurrentPresentationClassName() { // update the current selection (used to look for changes on apply) String currentPresentationFactoryId = PrefUtil.getAPIPreferenceStore() .getString( IWorkbenchPreferenceConstants.PRESENTATION_FACTORY_ID); // Workbench.getInstance().getPresentationId(); AbstractPresentationFactory factory = WorkbenchPlugin.getDefault() .getPresentationFactory(currentPresentationFactoryId); if (factory == null) factory = WorkbenchPlugin.getDefault().getPresentationFactory( IWorkbenchConstants.DEFAULT_PRESENTATION_ID); return factory.getClass().getName(); } COM: <s> get the name of the current presentation class name </s>
funcom_train/10508631
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testResolveConflictFromPoms() throws Exception { ResolveReport report = ivy.resolve(new File("test/repositories/2/mod17.1/ivy-1.0.xml") .toURL(), getResolveOptions(new String[] {"*"})); assertNotNull(report); assertFalse(report.hasError()); } COM: <s> test ivy 618 </s>
funcom_train/15610219
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Set getAvailableGenomeVersions() { Set<GenomeVersion> versions=getGenomeVersions(); Set<GenomeVersion> rtnVersions=new HashSet<GenomeVersion>(); GenomeVersion version; for (Object version1 : versions) { version = (GenomeVersion) version1; if (version.isAvailable()) rtnVersions.add(version); } return rtnVersions; } COM: <s> returns all genome versions that are marked is available </s>
funcom_train/31907618
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object get(Object o1, Object o2) { int hash = hashCode(o1, o2) & 0x7FFFFFFF; int index = hash % table.length; for (Entry e = table[index]; e != null; e = e.next) { if ((e.hash == hash) && e.match(o1, o2)) { return e.value; } } return null; } COM: <s> gets the value of an entry </s>
funcom_train/42090986
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addPoolSizePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Component_poolSize_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Component_poolSize_feature", "_UI_Component_type"), C2Package.Literals.COMPONENT__POOL_SIZE, true, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the pool size feature </s>
funcom_train/7667015
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void setEnabledProtocols(String[] protocols) { if (protocols == null) { throw new IllegalArgumentException("Provided parameter is null"); } for (int i=0; i<protocols.length; i++) { if (!ProtocolVersion.isSupported(protocols[i])) { throw new IllegalArgumentException("Protocol " + protocols[i] + " is not supported."); } } enabledProtocols = protocols; } COM: <s> sets the set of available protocols for use in ssl connection </s>
funcom_train/46057304
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void archive(String archivFilePath) { if (isToolEnabled(CollaborationTools.TOOL_FORUM)) { archiveForum(this.ores, archivFilePath); } if (isToolEnabled(CollaborationTools.TOOL_WIKI)) { archiveWiki(this.ores, archivFilePath); } if (isToolEnabled(CollaborationTools.TOOL_FOLDER)) { archiveFolder(this.ores, archivFilePath); } } COM: <s> it is assumed that this is only called by an administrator </s>
funcom_train/48360798
/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 ("IotomessagePort".equals(portName)) { setIotomessagePortEndpointAddress(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/11729385
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetVersion() throws RepositoryException { Version v = versionManager.checkin(versionableNode.getPath()); Version v2 = vHistory.getVersion(v.getName()); assertTrue("VersionHistory.getVersion(String versionName) must return the version that is identified by the versionName specified, if versionName is the name of a version created by Node.checkin().", v.isSame(v2)); } COM: <s> test version history </s>
funcom_train/47394021
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); IWorkbenchPage page = window.getActivePage(); try { page.openEditor(new MyEditorInput(), "org.eclipse.ui.DefaultTextEditor"); } catch (PartInitException e) { // TODO Auto-generated catch block e.printStackTrace(); } MessageDialog.openInformation( window.getShell(), "PortletPLugin Plug-in", "Hello, Eclipse world"); return null; } COM: <s> the command has been executed so extract extract the needed information </s>
funcom_train/9924951
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void readUsers(final Element curSelect) { final NodeList userOptionNodes = curSelect.getElementsByTagName(OPTION_EL); for (int i = 0; i < userOptionNodes.getLength(); i++) { final Element optionEl = (Element) userOptionNodes.item(i); final String value = optionEl.getAttribute(VALUE_ATTR); if (value.length() > 0) { userInfo.add(value); } } } COM: <s> read information about users from child options of cur select </s>
funcom_train/45622627
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addExcludePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_SimpleItemType_exclude_feature"), getString("_UI_PropertyDescriptor_description", "_UI_SimpleItemType_exclude_feature", "_UI_SimpleItemType_type"), MSBPackage.eINSTANCE.getSimpleItemType_Exclude(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the exclude feature </s>
funcom_train/29920549
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void createControl(Composite parent) { // Special treatment for property pages if (isPropertyPage()) { // Cache the page id pageId = getPageId(); // Create an overlay preference store and fill it with properties overlayStore = new PropertyStore( ((IResource) getElement()).getProject(), //(IResource) getElement(), super.getPreferenceStore(), pageId); // Set overlay store as current preference store } super.createControl(parent); // Update state of all subclass controls if (isPropertyPage()) updateFieldEditors(); } COM: <s> we override the create control method </s>
funcom_train/16178041
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public IntrospectPanel getModelParameterPanel() { IntrospectPanel modelPanel = null; try { modelPanel = new IntrospectPanel(model, model.getInitParam(), ALPHA_ORDER); ProbeUtilities.addModelProbePanel(modelPanel); } catch (Exception ex) { SimUtilities.showError("Unable to create model parameter panel", ex); ex.printStackTrace(); System.exit(0); } return modelPanel; } COM: <s> creates an introspect panel that contains the parameters this abstract guicontrollers </s>
funcom_train/29524081
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void ObtainNodePositionsForEntireSimulation() { nodePositions = new NodeCheckPoint[accessPoints.Size()][GetSimulationTime() + 1]; allAddresses = new MobilityVectors(this, accessPoints, minSpeed, maxSpeed, pause); allAddresses.ObtainNodePositionsForEntireSimulation(accessPoints); } COM: <s> move each node the covered distance in one second </s>
funcom_train/65144
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getTextPreview() { String retVal; if (this.text.length() > 120) { retVal = this.text.substring(0, 60); retVal += "..."; retVal += this.text.substring(this.text.length() - 60 - 1, this.text.length() - 1); } else { retVal = this.text; } return retVal; } COM: <s> get abstract of this text </s>
funcom_train/28753072
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setCost(Long newVal) { if ((newVal != null && this.cost != null && (newVal.compareTo(this.cost) == 0)) || (newVal == null && this.cost == null && cost_is_initialized)) { return; } this.cost = newVal; cost_is_modified = true; cost_is_initialized = true; } COM: <s> setter method for cost </s>
funcom_train/25419109
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setSelectedSort(String selectedSort) { Exception exception = null; try { OptionsSort.valueOf(selectedSort); } catch(IllegalArgumentException e) { exception = e; } catch(NullPointerException e) { exception = e; } if(exception != null ) { LOG.log(Level.WARNING, "Unknown Sort option has been posted " + ": Recieved Sort Option = " + selectedSort ); } this.selectedSort = selectedSort; } COM: <s> sets the selected sort method </s>
funcom_train/37616478
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void prepareShadingState(ShadingState state) { geometry.prepareShadingState(state); if (state.getNormal() != null && state.getGeoNormal() != null) state.correctShadingNormal(); // run modifier if it was provided if (state.getModifier() != null) state.getModifier().modify(state); } COM: <s> prepare the shading state for shader invocation </s>
funcom_train/22430274
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean paramAppend(StringBuffer sb, String name, String value) { String param = name; boolean isEdited = false; if (name != null) { sb.append(name); isEdited = true; } if (value != null) { sb.append('='); sb.append(value); isEdited = true; } return isEdited; } COM: <s> set the name value pair into the string buffer </s>
funcom_train/24379272
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Node getTypeAsNode(Node node, PrintedVariableType type){ if (type != null) { QName qname = new QName("http://www.imsglobal.org/xsd/imsqti_v2p1", "printedVariable"); JAXBElement<PrintedVariableType> jaxbe = new JAXBElement<PrintedVariableType>(qname, PrintedVariableType.class, type); node = getNode(node, jaxbe); } return node; } COM: <s> gets the printed variable type as a dom node </s>
funcom_train/3985409
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public PVector mult(PVector source, PVector target) { if (target == null) { target = new PVector(); } target.x = m00*source.x + m01*source.y + m02; target.y = m10*source.x + m11*source.y + m12; return target; } COM: <s> multiply the x and y coordinates of a pvector against this matrix </s>
funcom_train/17859450
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void createIcon() { String iconResourceClass = getClass().getName(); int iconResourcePos = iconResourceClass.lastIndexOf('.') + 1; String iconResource = iconResourceClass.substring(iconResourcePos).toLowerCase()+"_icon"; ResourceManager rm = DefaultResourceManager.getDefaultResourceManager(); ResourceManager irm = rm.getNestedResourceManager("icon_resources"); setIcon(irm.getImageIcon(iconResource)); } COM: <s> called when icon should be created and get icon returns null at the </s>
funcom_train/7809166
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void start(BundleContext context) { m_context = context; Hashtable dict = new Hashtable(); dict.put(SimpleShape.NAME_PROPERTY, "Square"); dict.put(SimpleShape.ICON_PROPERTY, new ImageIcon(this.getClass().getResource("square.png"))); m_context.registerService(SimpleShape.class.getName(), new Square(), dict); } COM: <s> implements the tt bundle activator </s>
funcom_train/982552
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void gluPerspective (double fovy, double aspect, double zNear, double zFar) { double xmin, xmax, ymin, ymax; ymax = zNear * Math.tan (fovy * Math.PI / 360.0 ); ymin = -ymax; xmin = ymin * aspect; xmax = ymax * aspect; JavaGL.glFrustum ((float)xmin, (float)xmax, (float)ymin, (float)ymax, (float)zNear, (float)zFar); } COM: <s> glvoid glu perspective gldouble fovy gldouble aspect gldouble z near gldouble z far </s>
funcom_train/39912788
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetRh12() { System.out.println("getRh12"); Page1 instance = new Page1(); TextField expResult = null; TextField result = instance.getRh12(); assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); } COM: <s> test of get rh12 method of class timesheetmanagement </s>
funcom_train/21114849
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void sendToAnyListeners(Album a) { try { if (listeners != null) { synchronized(listeners) { for (int i=0; i < listeners.size(); i++) { ((AlbumListener) listeners.get(i)).handleAlbum(a); } } } } catch (Exception e) { } } COM: <s> send the event to all the listeners </s>
funcom_train/40347653
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void renderToFile(ITextConverter converter, String filename) throws IOException { File file = new File(filename); File parent = file.getParentFile(); if (parent != null && !parent.exists()) { parent.mkdirs(); } Writer fw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8")); try { render(converter, fw); } finally { fw.close(); } } COM: <s> render the given wikipedia texts into an html file for the given converter </s>
funcom_train/21465404
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean update(Object sensorData) { //prevent null data if(sensorData == null){ //TODO: see how to erase previous data return false; } // create a new array list without the old information from this sensor List<Object> newPerception = new ArrayList<Object>(); for (Object obj : perception) { if (!obj.getClass().isInstance(sensorData)) { newPerception.add(obj); } } // add the new sensorData newPerception.add(sensorData); // replace old perception this.perception = newPerception; return true; } COM: <s> adds sensor data to this perception </s>
funcom_train/33839304
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testCopyArray() { System.out.println("copyArray"); double[] start = new double[] {1,2,3,4,5,6}; double[] finish = new double[6]; ArrayFuncs.copyArray(start, finish); assertTrue(ArrayFuncs.arrayEquals(start,finish)); } COM: <s> test of copy array method of class nom </s>
funcom_train/2624929
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setKeyboardFocus(final PInputEventListener eventHandler) { final PInputEvent focusEvent = new PInputEvent(this, null); if (keyboardFocus != null) { dispatchEventToListener(focusEvent, FocusEvent.FOCUS_LOST, keyboardFocus); } keyboardFocus = eventHandler; if (keyboardFocus != null) { dispatchEventToListener(focusEvent, FocusEvent.FOCUS_GAINED, keyboardFocus); } } COM: <s> set the node that should receive key events </s>
funcom_train/44694965
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void movetoAbs(float x, float y) { if (x == posX && y == posY && !segments.isEmpty()) { //++ignoredMoves; } else { if (last == MOVE) // last move was redundant replaceLast("M" + x + " " + y); else { last = MOVE; emit("M" + x + " " + y); } posX = x; posY = y; } } COM: <s> invoked when an absolute moveto command has been parsed </s>
funcom_train/14460303
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean sendToAll(Message msg){ Iterator itx = clients.keySet().iterator(); while(itx.hasNext()){ MessageListener ml = (MessageListener)clients.get(itx.next()); ml.addMessageToQueue(key, msg); } return true; } COM: <s> send a message to all listening clients </s>
funcom_train/22131558
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int append(FA add) { int relocation; int idx; relocation = used; ensureCapacity(used + add.used); for (idx = 0; idx < add.used; idx++) { states[relocation + idx] = new State(add.states[idx], relocation); } used += add.used; return relocation; } COM: <s> adds a copy of all states and transitions from the automaton </s>
funcom_train/41302662
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void pan(int dx, int dy) { if (dx != 0 || dy != 0) { RectangleViewPort bounds = getViewportBounds(); double x = bounds.getCenterX() + dx; double y = bounds.getCenterY() + dy; setCenter(new Point2D.Double(x, y)); } //parent.objectsPan(dx, dy); } COM: <s> move the map by dx pixels horizontally and dy pixels vertically </s>
funcom_train/39973682
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public TriangleMesh loadBinary(String fileName) { TriangleMesh mesh = null; try { mesh = loadBinary(new FileInputStream(fileName), fileName .substring(fileName.lastIndexOf('/') + 1)); } catch (FileNotFoundException e) { e.printStackTrace(); } return mesh; } COM: <s> attempts to load an stl model from the given file path </s>
funcom_train/1957859
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setSimulation(boolean b) { simulate = b; if (scanPanel != null) { scanPanel.setEnabled(! b); configElements.setEnabledAt(configElements.indexOfComponent(scanPanel), ! b); } if (!trPanel.isActive()) { trPanel.setEnabled(! b); configElements.setEnabledAt(configElements.indexOfComponent(trPanel), ! b); } } COM: <s> tell the panel whether network sniffing is simulated </s>
funcom_train/3168392
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public XnRegion inverseOfAll(XnRegion reg) { return ((Dsp) inverse()).ofAll(reg); /* udanax-top.st:29149:Dsp methodsFor: 'deferred transforming'! {XnRegion} inverseOfAll: reg {XnRegion} "Inverse transform a region. A simple region must yield a simple region. a->inverseOfAll(b) ->isEqual (a->inverseAll()->of(b))" ^(self inverse cast: Dsp) ofAll: reg! */ } COM: <s> inverse transform a region </s>
funcom_train/29271701
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void moveCard(Card card, int toIndex) { int fromIndex; fromIndex = cards.indexOf(card); if (fromIndex == -1) { for (Card c : cards) { if (c.equals(card)) { fromIndex = cards.indexOf(c); break; } } } Card tmp = cards.get(toIndex); cards.set(toIndex, card); cards.set(fromIndex, tmp); } COM: <s> moves a card c to position i </s>
funcom_train/11730303
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetString() throws RepositoryException { Value val = PropertyUtil.getValue(prop); String str = val.getString(); String otherStr = Double.toString(val.getDouble()); assertEquals("Conversion from Double value to String value is not correct.", str, otherStr); } COM: <s> tests the conversion from a double to a string value </s>
funcom_train/23710649
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private IContributionItem createFileMenu() { MenuManager menu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE); //$NON-NLS-1$ menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START)); menu.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT)); menu.add(new Separator()); menu.add(newExplorerAction); menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END)); menu.add(new Separator()); menu.add(getAction(ActionFactory.QUIT.getId())); return menu; } COM: <s> creates and returns the file menu </s>
funcom_train/12561081
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void paintBody(Graphics g) { g.clipRect(viewport[X], viewport[Y], viewport[WIDTH], viewport[HEIGHT]); g.translate(viewport[X] - lf.viewable[X], viewport[Y] - lf.viewable[Y]); lf.lPaintElements(g, bounds[WIDTH], viewable[HEIGHT]); g.translate(-viewport[X] + lf.viewable[X], -viewport[Y] + lf.viewable[Y]); } COM: <s> paints the content area of choice group popup </s>
funcom_train/4505295
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void stop() { // Remove Server to Server Statistic statisticsManager.removeStatistic(SERVER_2_SERVER_SESSIONS_KEY); // Remove Active Session Statistic statisticsManager.removeStatistic(SESSIONS_KEY); // Remove Packet Traffic Statistic statisticsManager.removeStatistic(TRAFFIC_KEY); statisticsManager = null; // Remove the packet listener. InterceptorManager.getInstance().removeInterceptor(packetInterceptor); packetInterceptor = null; packetCount = null; } COM: <s> remove all registered statistics </s>
funcom_train/7510823
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JPanel getJPanelControlButtons() { if (jPanelControlButtons == null) { jPanelControlButtons = new JPanel(); jPanelControlButtons.setLayout(new FlowLayout()); jPanelControlButtons.add(getJButtonAdd(), null); jPanelControlButtons.add(getJButtonRemove(), null); jPanelControlButtons.add(getJButtonUp(), null); jPanelControlButtons.add(getJButtonDown(), null); } return jPanelControlButtons; } COM: <s> this method initializes j panel control buttons </s>
funcom_train/28902294
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void loadEndpoints() { javaEndpointClasses.clear(); File endpointDir = new File(ENDPOINT_DIR); File[] endpointFiles = endpointDir.listFiles(); if (endpointFiles != null && endpointFiles.length != 0) { for (File file : endpointFiles) { findEndpoints(file); } } else { logger.warn("No endpoints in the endpoints directory ({})", ENDPOINT_DIR); } logger.debug("Loaded available endpoints from '{}'.", ENDPOINT_DIR); } COM: <s> load endpoints from platform endpoints </s>
funcom_train/45809157
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void add(Object[][] newdata, int length) { if (length < 1) return; // Add to query matches ensureCapacity(last + length + 2); System.arraycopy(newdata, 0, data, last+1, length); last += length; } COM: <s> experimental adds input array to this table </s>
funcom_train/37078738
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public GuiCurationState getCurStateForCurName(String curationName) { // dont think we need a hash for this for (int i=0; i<numberOfCurations(); i++) { if (getCurationState(i).getCurationName().equals(curationName)) return getCurationState(i); } logger.error("Programmer error: no cur set with name "+curationName); return null; } COM: <s> returns null if no cur state with curation name shouldnt happen </s>
funcom_train/6203693
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void loadConfig() { if (!this.configFile.exists()) { config = new Filters(); return; } try { Unmarshaller unm = CONFIG_CTX.createUnmarshaller(); config = (Filters) unm.unmarshal(configFile); } catch (Exception e) { Log.logErrorRB("FILTERMASTER_ERROR_LOADING_FILTERS_CONFIG"); Log.log(e); config = new Filters(); } } COM: <s> loads information about the filters from an xml file </s>
funcom_train/39467078
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void saveToPNG(String path, Dimension dim, BufferedImage bufferedImage) { try { Graphics2D graphics2d = bufferedImage.createGraphics(); graphics2d.setColor(backgroundColor); graphics2d.fillRect(0, 0, this.getPreferredSize().width, this.getPreferredSize().height); this.setSize(dim); graphics2d = (Graphics2D) paintThis(graphics2d); ImageIO.write(bufferedImage, "PNG", new File(path)); } catch (Exception e) { e.printStackTrace(); } } COM: <s> saves to a png file </s>
funcom_train/37558615
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setClipping (int x, int y, int width, int height) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); int hRgn = OS.CreateRectRgn (x, y, x + width, y + height); OS.SelectClipRgn (handle, hRgn); OS.DeleteObject (hRgn); } COM: <s> sets the area of the receiver which can be changed </s>
funcom_train/16380623
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addCorrectPropertyDescriptor(Object object) { itemPropertyDescriptors.add (new UnsettablePropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_GapDefType_correct_feature"), getString("_UI_PropertyDescriptor_description", "_UI_GapDefType_correct_feature", "_UI_GapDefType_type"), CTEPackage.Literals.GAP_DEF_TYPE__CORRECT, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the correct feature </s>
funcom_train/25312559
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setFlow(int flow) { int currentFlow = flowOffset + arc.sister.capacity; assert (flowOffset <= flow); assert (flow <= currentFlow + arc.capacity); int delta = flow - currentFlow; if (delta != 0) { arc.capacity -= delta; arc.sister.capacity += delta; arc.tail().deltaBalance -= delta; arc.head.deltaBalance += delta; arc.tail().balance += delta; arc.head.balance -= delta; } } COM: <s> forces the flow to a given value within capacity bounds </s>
funcom_train/27806466
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void viewAcceptedPaperButton_clicked(ActionEvent e) { System.out.println("\nviewAcceptedPaperButton_clicked(ActionEvent e) called."); int index = papersAcceptedList.getSelectedIndex(); IPaper paper = allAcceptedPapersList.get(index); titleText.setText(paper.getAbstract().getPaperTitle()); abstractText.setText(paper.getAbstract().getAbstract()); uriText.setText(paper.getPaperURI()); tabbedPanel.setSelectedIndex(1); } COM: <s> action to perform when the view accepted paper button is clicked </s>
funcom_train/39538746
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setUnselectableDates(long[] unselectableDates) { SortedSet<Date> unselectableSet = new TreeSet<Date>(); if (unselectableDates != null) { for (long unselectableDate : unselectableDates) { unselectableSet.add(new Date(cleanupDate(unselectableDate))); } } getSelectionModel().setUnselectableDates(unselectableSet); repaint(); } COM: <s> an array of longs defining days that should be unselectable </s>
funcom_train/22210280
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void performAction(){ ProviderReference ref = baseTmr.getProviderReference(); TMNav.closeTopicMap(baseTmr); String path = baseTmr.getSource(); if (baseTmr.getMetaData().getRetrievalType() == TopicMapRefMetaData.HARVESTER) { TMNav.harvestMapWithProvider(path, ref); } else { TMNav.loadMapWithProvider(path, ref); } } COM: <s> triggers the reloading </s>
funcom_train/22347782
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected boolean isStandAlone(String what) { // When at least 2 characters & match if ((what.length() > 1) && (what.substring(0,2).equalsIgnoreCase(TyMsg.getText(59)))) { // is standalone return true; } // endif // not standalone return false; } // end-method COM: <s> look for a standalone argument </s>
funcom_train/2763546
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public DeskElem detach(DeskElem elem) { if (this.equals(elem)) { return null; } boolean removed = remove(elem); if (!removed) return null; //If the group became empty, we remove it if (members.size() == 0) { if (parent != null) { parent.remove(this); } } //If the group has only one element left, we explode it else if (members.size() == 1) { explode(); } return elem; } COM: <s> detaches the element given by the path from this group </s>
funcom_train/44010105
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void run() { Lib.assertit(!simulationStarted); simulationStarted = true; riders = new RiderState[numRiders]; ridersVector.toArray(riders); if (enableGui) { privilege.doPrivileged(new Runnable() { public void run() { initGui(); } }); } for (int i=0; i<numRiders; i++) riders[i].initialize(); manager.initialize(); for (int i=0; i<numRiders; i++) riders[i].run(); manager.run(); for (int i=0; i<numRiders; i++) riders[i].join(); manager.join(); simulationStarted = false; } COM: <s> run a simulation </s>
funcom_train/45422842
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JTabbedPane getJTabbedPaneResults() { if (jTabbedPaneResults == null) { jTabbedPaneResults = new JTabbedPane(); jTabbedPaneResults.addTab("results", null, getScrollTablePane(), null); jTabbedPaneResults.addTab("result content", null, getScrollPane(), null); } return jTabbedPaneResults; } COM: <s> this method initializes j tabbed pane results </s>
funcom_train/36182176
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public IEventMgr getEventMgr() throws GroupingException { try { IEventMgr eventMgrService = (IEventMgr) eventMgrTracker.getService(); if (null == eventMgrService) { throw new GroupingException("Error: could not get instance of IEventMgr service"); } return eventMgrService; } catch (Throwable t) { throw new GroupingException("Couldn't get Event Manager service", t); } } COM: <s> gets an event manager service </s>
funcom_train/44598621
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void test4() { try { p.setSource(" i ? #"); p.parseExpressionTest(); p.setSource(" i ? 2 #"); p.parseExpressionTest(); assertEquals( 2, JUnitProblemRequestor.req.numberOfErrors()); } catch (Exception e) { e.printStackTrace(); fail("TEST FAILED WITH EXCEPTION: " + e); } } COM: <s> smoke test of problem reporting </s>
funcom_train/45192443
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void sendSetChecked(boolean checked) { StringBuilder out = openScriptBuffer(); if (out != null) { out.append("wa.setChecked('"); out.append(elementId); out.append("',"); out.append(checked ? "true" : "false"); out.append(");\n"); } } COM: <s> send a set checked command to the browser </s>
funcom_train/22178680
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void setExpandedState(Segment segment) { Date startTime = new Date(); segment.setExpanded(treeViewer.getExpandedState(segment)); for (int i=0; i<segment.getChilds().size(); i++) { setExpandedState(segment.getChilds().get(i)); } if (logger.isTraceEnabled()) { logger.trace("Duration: " + StringUtils.getDuration(startTime, new Date())); } } COM: <s> sets the expanded state for the given segment and its childs recursively </s>
funcom_train/9160235
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void notifyWatches(ForumThread thread) { //If watches are turned on. if (!emailNotifyEnabled) { return; } //Create a new email watch update task that will send out emails to //any users that have watches on the updated thread. EmailWatchUpdateTask task = new EmailWatchUpdateTask(this, factory, thread); TaskEngine.addTask(task); } COM: <s> notifies watches that a thread has been updated </s>
funcom_train/26505772
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public MessageSession getMessageSession(String nick) { for (int i = 0; i < messageSessions.size(); i++) { MessageSession ms = (MessageSession) messageSessions.get(i); if (ms.getName().equals(nick)) { return ms; } } MessageSession ms = new MessageSession(nick, false); messageSessions.add(ms); return ms; } COM: <s> gets the message session attribute of the dchub object </s>
funcom_train/3419620
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void engineInit(int keysize, SecureRandom random) { if ((keysize < 512) || (keysize > 1024) || (keysize % 64 != 0)) { throw new InvalidParameterException("Keysize must be multiple " + "of 64, and can only range " + "from 512 to 1024 " + "(inclusive)"); } this.primeSize = keysize; this.random = random; } COM: <s> initializes this parameter generator for a certain keysize </s>
funcom_train/22659535
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getResolveName(File file) { if (mainDir == null) { return this.toString(); } else { File par = mainDir.getParentFile(); String path = file.toString(); String mask = par.toString(); assert path.startsWith(mask) : "path does not start with mask: " + path; return path.substring(mask.length() + 1); } } COM: <s> prints the pathname of the file relative to the default resolve </s>
funcom_train/19978004
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int add(Enum enum){ enumList.add(enum); array = null; byString = null; if (enumList.size() == 1){ return 0; } else { return ((Enum)enumList.get(enumList.size() - 2)).intValue() + 1; } } COM: <s> called automatically by the enum constructor </s>
funcom_train/36784964
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public PhysicalHUDComponent createHUDComponent(int level) { PhysicalHUDComponent component = new PhysicalHUDComponent(hud, level, new AbsolutePosition(0,0), new AbsoluteSize(0,0), 0, 0, 0, 0, 0);//, hudBG); BranchGroup bg = new BranchGroup(); bg.addChild(((PhysicalHUDComponent) component).getShape()); branchGroups[level].addChild(bg); return component; } COM: <s> creates a hud component based on the requested specifications </s>
funcom_train/33006207
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void removeIMCall(String callId) { Iterator it = imCalls.iterator(); while (it.hasNext() ) { Call c = (Call) it.next(); IMCall call; if (c instanceof IMCall) { call = (IMCall) c; } else { continue; } if (call.getCallee().equals(callId) ) it.remove(); if (call.getDialog() != null) { call.getDialog().delete(); } } } COM: <s> remove an im call given its id </s>
funcom_train/18787761
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void processPackage(MetaPackage source, MdrUmlModel context) { assert (source != null) && (context != null); MdrUmlPackage mPackage = findPackageQualified(context, source.getName()); for (MetaClass item : source.getClasses()) { extractClass(item, mPackage); } } COM: <s> process package elements </s>
funcom_train/13814309
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean setMinimumPreferredSize( int minWidth, int minHeight ) { boolean needsReload = ( correctedImage == null ); if ( minWidth*2 > width || minHeight*2 > height ) { dcraw.setHalfSize( false ); if ( rawIsHalfSized ) { needsReload = true; rawImage = null; correctedImage = null; } } else { dcraw.setHalfSize( true ); } return needsReload; } COM: <s> set the preferred minimum size for the resulting image </s>
funcom_train/35321160
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void fireIndexedPropertyChange(String propertyName, int index, int oldValue, int newValue) { if (oldValue != newValue) { fireIndexedPropertyChange(propertyName, index, Integer.valueOf(oldValue), Integer.valueOf(newValue)); } } COM: <s> reports an integer bound indexed property update to listeners </s>
funcom_train/22742296
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void nextButton(boolean left) { int idx = btnSelSprite.getFrame(); if (left) { if (idx == 0) { idx = 4; } else { --idx; } } else { if (idx == 4) { idx = 0; } else { idx++; } } this.setButton(idx); } COM: <s> set the next player button </s>
funcom_train/44797955
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void actionPerformed(final ActionEvent evt) { if (evt.getSource() instanceof JComponent) { KeyStrokeUtil.listKeyBindings((JComponent)evt.getSource()); } else { LOG.warn("Cannot show key bindings of non-JComponent class '" + evt.getSource().getClass().getName()); } } COM: <s> handle action and check for delegate actions </s>
funcom_train/39105375
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Properties getProperties(String filename) throws IOException { Properties newProperties = (Properties)propertiesCache.get(filename); if (newProperties==null) { newProperties = new Properties(); BufferedInputStream inStream = null; try { inStream = new BufferedInputStream(new FileInputStream(filename)); newProperties.load(inStream); inStream.close(); } catch (IOException e) { e.printStackTrace(); } finally { } cacheProperties(filename,newProperties); } return newProperties; } COM: <s> if we previously loaded this properties file return the cached version </s>
funcom_train/7426887
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void updateBoundsFromLine() { if (lineShape.getPointCount() == 0) { resetBounds(); } else { final Rectangle2D b = getLineBoundsWithStroke(); super.setBounds(b.getX(), b.getY(), b.getWidth(), b.getHeight()); } } COM: <s> recalculates the bounds when a change to the underlying line occurs </s>
funcom_train/34474258
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean setModel(SdaiModel model) throws SdaiException { if(!model.getUnderlyingSchemaString().equals("MAPPING_SCHEMA")) return false; this.model = model; schemaInstance = null; mappingDomain = new ASdaiModel(); mappingDomain.addByIndex(1, model, null); refreshData(); return true; } COM: <s> setter for property model </s>
funcom_train/32040618
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addHrefPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_StaffType_href_feature"), getString("_UI_PropertyDescriptor_description", "_UI_StaffType_href_feature", "_UI_StaffType_type"), ImsldPackage.eINSTANCE.getStaffType_Href(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the href feature </s>
funcom_train/18446609
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void selectItem(final I item, final boolean scroll) { if (item != null) { TreePath path = item.getTreePath(); setSelectionPath(path); if (scroll) { // NOTE: modified "scrollPathToVisible" makeVisible(path); Rectangle bounds = getPathBounds(path); MScrollPane.scrollToNextItem(this, bounds); if ((bounds != null) && (accessibleContext != null)) accessibleContext.firePropertyChange(AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY, false, true); } } } COM: <s> view selects an item </s>
funcom_train/9206741
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void sendPDU() { ResponseEvent event = null; try { event = snmp.send(pdu, target); //snmp. } catch(IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } responsePDU = event.getResponse(); if (responsePDU == null) { clearStatement(); return ; } setStatement(responsePDU); } COM: <s> send a pdu to the agent </s>
funcom_train/23278684
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void smallerComparison(int j, List<FundsWrapper> funds){ FundsWrapper tmp = funds.get(j); FundsWrapper tmp2 = funds.get(j+1); funds.remove(j); funds.remove(j); funds.add(j,tmp2); funds.add(j+1,tmp); } COM: <s> method used for sort funds method </s>
funcom_train/49792410
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public List getNewMoves() { if(numFinalMoves >= movesPlayed) { return null; } List newMoves = new ArrayList(); for(int i = numFinalMoves; i < movesPlayed; i++) { AbstractCommand move = (AbstractCommand)moves.get(i); newMoves.add(move.getLocation()); } return newMoves; } COM: <s> returns the new moves that have been made </s>
funcom_train/40731714
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void getRoster() throws IOException { this.writer.startTag("iq"); this.writer.attribute("id", "roster"); this.writer.attribute("type", "get"); this.writer.startTag("query"); this.writer.attribute("xmlns", "jabber:iq:roster"); this.writer.endTag(); // query this.writer.endTag(); // iq this.writer.flush(); } COM: <s> sends a roster query </s>
funcom_train/41878242
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int countBitsPerTransition() { int sizeBeta = Enviroment.outAlphabet.getSizeOfAlphabet(); int bitsPerOutput = (int) Math.round(Math.log(sizeBeta) / Math.log(2)); if (sizeBeta <= Math.pow(2, bitsPerOutput)) { return bitsPerOutput; } else return bitsPerOutput + 1; } COM: <s> counting number of bits for storing transition </s>
funcom_train/42930283
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected String getWhereClauseForSelect() { String whereClause = null; switch (this) { case DATE: whereClause = String.format("year_v = ? and month_v = ? and day_v = ? and day_of_week_v = ?"); break; case TIME: whereClause = String.format("hh = ? and mm = ? and ss = ?"); break; case LOCATION: default: whereClause = this.getTableName() + " = " + "?"; break; } return whereClause; } COM: <s> produces the required where clause for this dimension </s>
funcom_train/18549913
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void insertEvent(int type, String summary, String content, String username, Throwable e) throws BusinessException { try { EventTO eto = this.getEvent(type, summary, content, username, e); dao.insert(eto); } catch (DataAccessException ei) { throw new BusinessException("error saving log into data base: " + ei); } } COM: <s> insert a new event record into data base </s>
funcom_train/8485195
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private NATMethod makeTestMethod(String nam, NATTable pars) { try { return new NATMethod(AGSymbol.jAlloc(nam), pars, new AGBegin(NATTable.atValue(new ATObject[] { Evaluator.getNil() })), NATTable.EMPTY); } catch (InterpreterException e) { fail("unexpected exception while creating test fixture: " + e.getMessage()); return null; } } COM: <s> given a name and parameters returns a method </s>
funcom_train/22782587
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private BufferedImage getImageFromCache(ImageKey key, ImageQuality quality) { // clear old invalid references (randomly, not allways) if (Math.random() < .1) { cleanCache(); } // get image from cache ImageStore store = cache.get(key); // check if result is valid if (store != null) { return store.getImage(quality); } // no such element in cache return null; } COM: <s> get the image from the cache </s>
funcom_train/3099777
/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 instanceof UUID)) return false; if (((UUID)obj).variant() != this.variant()) return false; UUID id = (UUID)obj; return (mostSigBits == id.mostSigBits && leastSigBits == id.leastSigBits); } COM: <s> compares this object to the specified object </s>
funcom_train/4922226
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testStream_SkipEmptyStream() throws IOException { InputStream inputStream = this.input.getInputStream(); assertEquals("Should not skip if negative", 0, inputStream.skip(-1)); assertEquals("No effect if skip zero", 0, inputStream.skip(0)); assertEquals("Should not skip if empty", 0, inputStream.skip(10)); } COM: <s> ensure skip of empty stream works as likely override default skip </s>
funcom_train/12160242
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean isContainedIn(String item) { String[] listItems = list.getItems(); Arrays.sort(listItems, String.CASE_INSENSITIVE_ORDER); int index = Arrays.binarySearch(listItems, item, String.CASE_INSENSITIVE_ORDER); return index >= 0; } COM: <s> checks that an item is present in the dialog list builder </s>