__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/1550278
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int totalSize() { int total = 0; Collection<Collection<V>> values = internalMap.values(); for (Iterator<Collection<V>> it = values.iterator(); it.hasNext();) { Collection<V> coll = it.next(); total += coll.size(); } return total; } COM: <s> gets the total size of the map by counting all the values </s>
funcom_train/18846984
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String createPrivateProcessNotFoundException(String tscToken, String processID) { PropertyMap propertyMap = new PropertyMap(); DiagnosticsListCreator edg; edg = new DiagnosticsListCreator(); String severityType = DiagnosticsCodes.getErrorDiagnosticsCode(); String exceptionID = "80031"; propertyMap.addPropertyValuePair("processID", processID); String serExMsg = edg.constructErrorDocOneItemParam(tscToken, componentID, severityType, subSystemCode, exceptionID, propertyMap); return serExMsg; } COM: <s> construct private process not found exception message </s>
funcom_train/21417600
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JMenuItem getJMenuItem4() { if (jMenuItem4 == null) { jMenuItem4 = new JMenuItem("Irakasle Gatazkatsuenak"); jMenuItem4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { irakGatazk.setVisible(true); } }); } return jMenuItem4; } COM: <s> this method initializes j menu item4 </s>
funcom_train/22654930
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void clearCurrentModel(){ resetPresentations(); getCurrentLogEventModel().clear(); if(getCurrentLogEventModel().getPreviousLogEventModel() != null){ this.currentLogEventModel = getCurrentLogEventModel().getPreviousLogEventModel(); this.currentLogEventModel.clearSearchResults(); // Load the first page of the model this.currentLogEventModel.getPageSet().loadPageByNumber(1); firePageChanged(); } else { // take the buttons to the start state actionPerformed(IAction.STARTUP); } } COM: <s> clears the current event model </s>
funcom_train/47308365
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void validateSourceImageSize() throws InvalidSourceImageSizeException { if (srcImage == null) throw new InvalidSourceImageSizeException("The source image was null."); // Source must be smaller or equal than the destination image if (srcImage.getWidth() > destImage.getWidth() || srcImage.getHeight() > destImage.getHeight()) { throw new InvalidSourceImageSizeException("The source image MUST be smaller than the destination image."); } } COM: <s> validate source image correctness </s>
funcom_train/36558088
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public BinaryHeadExporterParams setAnimationFiles(Iterable<String> animations) { facialAnimationFilePaths.clear(); for (String animation : animations) // NPE if null { if (animation == null) throw new IllegalArgumentException("Null string encountered!"); else facialAnimationFilePaths.add(animation); } return this; } COM: <s> clear the existing contents of the internal list and fill it with the </s>
funcom_train/3946161
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addMaxtimeallowedPropertyDescriptor(Object object) { itemPropertyDescriptors.add (new ItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_DocumentRoot_maxtimeallowed_feature"), getString("_UI_PropertyDescriptor_description", "_UI_DocumentRoot_maxtimeallowed_feature", "_UI_DocumentRoot_type"), AdlcpRootv1p2Package.eINSTANCE.getDocumentRoot_Maxtimeallowed(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); } COM: <s> this adds a property descriptor for the maxtimeallowed feature </s>
funcom_train/22267838
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void stopTransfer() { // we are now again in idle mode this.iecMode = 0; this.isLastChar = false; // no timeouts are active this.timeoutCycle = -1; this.timeoutType = 0; // clear a partially received byte this.currentByte.delete(0, this.currentByte.length()); } COM: <s> stop an ongoing transfer </s>
funcom_train/44714082
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ACSObject getContainer() { BigDecimal id = getRefersTo(); if ( id != null ) { OID oid = new OID(ACSObject.BASE_DATA_OBJECT_TYPE,id); try { return (ACSObject) DomainObjectFactory.newInstance(oid); } catch (DataObjectNotFoundException ex) { // fall through to the failure case at the bottom } } return null; } COM: <s> returns the container for this message </s>
funcom_train/2580094
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void datasetChanged(DatasetChangeEvent event) { if (this.domainAxis != null) { this.domainAxis.configure(); } if (this.rangeAxis != null) { this.rangeAxis.configure(); } if (this.colorBar != null) { this.colorBar.configure(this); } super.datasetChanged(event); } COM: <s> receives notification of a change to the plots dataset </s>
funcom_train/3414378
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean containsNullValue() { Entry<K,V>[] tab = getTable(); for (int i = tab.length; i-- > 0;) for (Entry<K,V> e = tab[i]; e != null; e = e.next) if (e.value==null) return true; return false; } COM: <s> special case code for contains value with null argument </s>
funcom_train/4809480
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean tick() throws SOTSException{ if(!buildingQueue.isEmpty()){ buildingQueue.peek().decBuildTime(); if(buildingQueue.peek().getBuildTime() <= 0){ make(buildingQueue.dequeue()); } } return super.tick(); } COM: <s> continues the construction of a unit and executes the next command </s>
funcom_train/13557886
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void todo_FileSelectedAfterRestart() throws CardServiceException { traceApdu = true; try { byte[] b = service.sendReadBinary(null, 0, 10, false); int sw = getLastSW(); if (sw == ISO7816.SW_NO_ERROR || sw != ISO7816.SW_END_OF_FILE || sw != ISO7816.SW_LESS_DATA_RESPONDED_THAN_REQUESTED) { fail("Weird: we can read a file before selecting one"); } } catch (CardServiceException e) { } } COM: <s> if access control is done when processing select file rather than when </s>
funcom_train/12663685
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void saveProperties(){ try { properties.save(); setButtonsEnabled(false); } catch (IOException e) { VJP.logError("Could not save file.", e); } catch (CoreException e) { VJP.logError("Could not save file.", e); } } COM: <s> saves the properties being modified to the configuration file </s>
funcom_train/7881122
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void add(String bin) { // TO DO Nick int r1 = Integer.parseInt(bin.substring(8, 11), 2); int r2 = Integer.parseInt(bin.substring(11, 14), 2); int r3 = Integer.parseInt(bin.substring(14, 17), 2); try { int temp = twosCompliment(getBinReg(r2)) + twosCompliment(getBinReg(r3)); setReg(r1, temp); } catch (NumberFormatException e) { // overflow occurs } } COM: <s> description adds the values of two registers if their values are valid </s>
funcom_train/18311538
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setLabel( String label ) { if (label == null) lines = null; StringTokenizer t = new StringTokenizer(label, "\n"); lines = new String[t.countTokens()]; int index = 0; while (t.hasMoreTokens()) { lines[index++] = t.nextToken(); } } COM: <s> set the label of this node to the string tt label tt </s>
funcom_train/14265310
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public List randomPics(int number) { // Cloning is a bit of a waste cuz all photos is generated on the fly // but its cheap and I don't want to assume I can shuffle List copy = (Vector) getAllPhotos().clone(); Collections.shuffle(copy); if(copy.size() > number) copy = copy.subList(0, number); return copy; } COM: <s> get a random set of photos from the set </s>
funcom_train/51295020
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setDefaultWindowParams() { paramsMap.put(WindowParams.WIDTH, 600); paramsMap.put(WindowParams.HEIGHT, 400); paramsMap.put(WindowParams.WINx, 100); paramsMap.put(WindowParams.WINy, 100); paramsMap.put(WindowParams.EXTENDED_STATE, 0); paramsMap.put(WindowParams.SELECTED_OBJECT_ID, 0); } COM: <s> set dafault window params </s>
funcom_train/32014114
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void handleImportDirectory(ActionEvent e) { JFileChooser fc = new JFileChooser(); fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); int returnVal = fc.showOpenDialog(mainFrame.getFrame()); IngestionController ingestionController = new IngestionController(); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fc.getSelectedFile(); ingestionController.addDirectory(file); } ingestionController.ingest(); } COM: <s> handle condition where import directory was just selected </s>
funcom_train/44586120
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected DOMField getLastFieldDeclaration() { DOMField field = this; while (field.isVariableDeclarator() || field.hasMultipleVariableDeclarators()) { if (field.fNextNode instanceof DOMField && ((DOMField)field.fNextNode).isVariableDeclarator()) { field= (DOMField)field.fNextNode; } else { break; } } return field; } COM: <s> returns the last field document fragment in this muli declarator statement </s>
funcom_train/781306
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object getNext() { if (iteration < offset + maxItems && iterator.hasNext()) { Object obj = iterator.next(); iteration++; pageContext.setAttribute(id, obj); placeNextAttributes(obj); return obj; } else { pageContext.setAttribute(id, null); return null; } } COM: <s> retrieves the next element from the iterator and places the resulting </s>
funcom_train/28343084
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public double getBeamCurrent(String bcm) { double current = 20; for (int i = 0; i < css.length; i++) { if (css[i].getPV().indexOf(bcm) > -1 && css[i].getPV().indexOf(":currentMax") > -1) { current = css[i].getValue()[0]; return current; } } return current; } COM: <s> get the beam current in m a use the bcm specified here </s>
funcom_train/27757602
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setArg(int index, Object val) throws MachineException { int pos = arg + index; if(index < 0 || pos >= fp) throw new MachineException("argument index out of range"); if(Opcode.MTRACE) System.out.println("A[" + index + "] = " + val); set(pos,val); } COM: <s> sets an argument to the specified value </s>
funcom_train/18596725
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Element isXmlInCache(String uri) throws CacheException { JeevesJCS xmlCache = JeevesJCS.getInstance(XMLRESOLVER_JCS); Element xml = (Element) xmlCache.get(uri.toLowerCase()); if (xml == null) { Log.info(Log.XML_RESOLVER, "cache MISS on "+uri.toLowerCase()); } else { Log.info(Log.XML_RESOLVER, "cache HIT on "+uri.toLowerCase()); } return xml; } COM: <s> resolves an xlink </s>
funcom_train/51197344
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testgetColRightStart() { System.out.println("nColRightStart"); int expectedResult = 9; try { int result = instance.getColRightStart(); assertEquals(expectedResult, result); } catch (Exception ex) { ex.printStackTrace(); fail(ex.toString() + " thrown"); } } COM: <s> test of n col right start method of class jjil </s>
funcom_train/19149241
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getGraData() { int i; String nl = new String("* "+myGrid+"\n"); nl = nl + connections.toString(); for (i=1;i<=elCount;i++) { String x = components[i].toString(); nl = nl+x+"\n"; } return nl; } COM: <s> a method to get a graphics data out of the current schematic </s>
funcom_train/13271501
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Dimension getUserScreenSize() { Dimension screenSize = getToolkit().getScreenSize(); Insets screenInsets = getToolkit().getScreenInsets(getGraphicsConfiguration()); screenSize.width -= screenInsets.left + screenInsets.right; screenSize.height -= screenInsets.top + screenInsets.bottom; return screenSize; } COM: <s> returns the screen size available to user </s>
funcom_train/22615460
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object getFacade() { if (!inited) { throw new NotInitializedException( "SITConfigurer is not initialized. " + "Have you called the init() method?"); } ServiceInvocationProxy proxy = new ServiceInvocationProxy(this); return Proxy.newProxyInstance(getFacadeType().getClassLoader(), new Class<?>[] { getFacadeType() }, proxy); } COM: <s> return the facade </s>
funcom_train/36639842
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Individual selectIndividual() { if (currentIndividual >= populationSize || currentRandomNumber >= populationSize) { throw new IllegalArgumentException("No more individuals available to select"); } while (randomNumbers[currentRandomNumber] > cumulativeFitness[currentIndividual]) { currentIndividual++; } currentRandomNumber++; return population[currentIndividual]; } COM: <s> pick parents randomly but proportional to fitness </s>
funcom_train/18595054
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testCatchException() throws Throwable { new Catcher().install(); Catcher.throwable = null; EventQueue.invokeLater(new Runnable() { public void run() { throw new RuntimeException("Test exception for " + getName()); } }); EventQueue.invokeAndWait(empty); assertNotNull("No exception caught", Catcher.throwable); } COM: <s> ensure we can install an instance and catch an exception </s>
funcom_train/49800130
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetLifetime() throws Exception { System.out.println("getLifetime"); Certificate instance = new Certificate(new File("/tmp"+File.separator+"x509up_u13386")); GSSCredential gss = instance.getCredential(); new Certificate(gss); assertEquals("Dns should be the same",TestConstants.USER_DN, instance.getDn()); } COM: <s> test of get lifetime method of class uk </s>
funcom_train/23246806
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object getProperty(final GpsTrack gpsTrack, final String property) { if (props.containsKey(gpsTrack) && props.get(gpsTrack).containsKey(property)) { return props.get(gpsTrack).get(property); } if (defaultProperties.containsKey(property)) { return defaultProperties.get(property); } return null; } COM: <s> return given property of given track </s>
funcom_train/19765554
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Command getMapCommand() { if (mapCommand == null) {//GEN-END:|53-getter|0|53-preInit // write pre-init user code here mapCommand = new Command("\u5730\u56FE", Command.SCREEN, 0);//GEN-LINE:|53-getter|1|53-postInit // write post-init user code here }//GEN-BEGIN:|53-getter|2| return mapCommand; } COM: <s> returns an initiliazed instance of map command component </s>
funcom_train/29672385
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String interpretURI(String namespaceURI) throws YaxomException { if ("".equals(namespaceURI)) namespaceURI = MAPPER_NAMESPACE_URI; try { URL url = new URL(namespaceURI); if (!"http".equals(url.getProtocol())) throw new MalformedURLException( "Invalid protocol: " + url.getProtocol()); return url.getPath().substring(1); } catch (MalformedURLException e) { throw new YaxomException( "'" + namespaceURI + "': Namespace URIs need have the form http://www.<domain>/<package>", e); } } COM: <s> method interpret uri </s>
funcom_train/19627014
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int read() throws IOException { int i = -1; if (current < streams.length) { // if we have not exhausted all the streams,read from the current // one i = streams[current].read(); if (i == -1) { // if we have exhausted the current stream, try the next one current++; return read(); } } return i; } COM: <s> obeys the general contract of read </s>
funcom_train/41683648
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addSubRole(Role r, DependencySet ds) { if (PelletOptions.USE_TRACING && explainSub.get(r.getName()) == null) explainSub.put(r.getName(), ds); subRoles = SetUtils.add( r, subRoles ); explainSub.put(r.getName(), ds); } COM: <s> add sub role with depedency set </s>
funcom_train/27849388
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void initialize(Stat Level, AbilityScore Constitution, int BaseHP){ myLevel = Level; myStat = BaseHP; myAdj = 0; mySubdual = 0; myTemporary = 0; myStatName = "Hit Points"; myStatAbbrev = "HP"; myCon = Constitution; // This only matters if the character is dying. So we set it // to false by default. isStable = false; } COM: <s> initializes the values for this code hit point code object </s>
funcom_train/257198
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getKeyAt(int row) { if (this.singleRowMap < 0) if (this.rowMap == null) return this.dataSet.getKeyAt(row); else return this.dataSet.getKeyAt(((Integer) rowMap.get(row)) .intValue()); else return this.dataSet.getKeyAt(singleRowMap); } COM: <s> get the unique requirements key at the specified row </s>
funcom_train/36105394
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public StringItem getStringItem() { if (stringItem == null) {//GEN-END:|45-getter|0|45-preInit // write pre-init user code here stringItem = new StringItem("Account :", getMemory("last_op"));//GEN-LINE:|45-getter|1|45-postInit // write post-init user code here }//GEN-BEGIN:|45-getter|2| return stringItem; } COM: <s> returns an initiliazed instance of string item component </s>
funcom_train/38464100
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Connection connect(String anUrl, String anUser, String aPassword) throws SQLException { try { Class.forName(driverClass); } catch(Exception e) { SQLException se = new SQLException("Error loading driver: " + driverClass); se.initCause(e); throw se; } return DriverManager.getConnection(anUrl,anUser,aPassword); } COM: <s> connects to the database </s>
funcom_train/24162678
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void handleResponse(BufferedInputStream stream) throws Exception { String response = new String(SocketData.read(stream)); if (response.startsWith("[ERROR]")) { // Error occurred on Server, throw an exception throw new Exception(response); } else { // Successful if (verbose) { System.out.println(response); } } } COM: <s> handle responses from the server if there are any </s>
funcom_train/28500862
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public NodeIterator getExpireNodes( QueryManager pQM, Calendar pTime ) throws InvalidQueryException, RepositoryException { String qu = "SELECT * FROM jecars:root WHERE jecars:ExpireDate<= TIMESTAMP '" + ISO8601.format(pTime) + "'"; Query q = pQM.createQuery( qu, Query.SQL ); QueryResult qr = q.execute(); return qr.getNodes(); } COM: <s> get expire nodes </s>
funcom_train/34260344
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void expandTree() { int rowCount = workspaceNavigatorTree.getRowCount(); int treeRow = 0; while (treeRow < rowCount) { workspaceNavigatorTree.expandRow(treeRow++); rowCount = workspaceNavigatorTree.getRowCount(); // new nodes are visible, so rowCount goes up } } COM: <s> expands every node in the tree </s>
funcom_train/11104201
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void encodeBegin(Node node, ElementBean target, ComponentBean root) { super.encodeBegin(node, target, root); AttributeBean valueAttr = target.getAttribute("value"); StringBuffer comment = new StringBuffer(valueAttr.getValue()); captureComment(node, comment); valueAttr.setValue(comment.toString()); valueAttr.setBindingType(AttributeBean.BINDING_TYPE_NONE); } COM: <s> p the super implementation is invoked to build a target </s>
funcom_train/34282994
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object clone() { SyntaxScheme shcs = null; try { shcs = (SyntaxScheme)super.clone(); } catch (CloneNotSupportedException cnse) { // Never happens cnse.printStackTrace(); return null; } shcs.styles = new Style[Token.NUM_TOKEN_TYPES]; for (int i=0; i<Token.NUM_TOKEN_TYPES; i++) { Style s = styles[i]; if (s!=null) { shcs.styles[i] = (Style)s.clone(); } } return shcs; } COM: <s> returns a deep copy of this color scheme </s>
funcom_train/124805
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setBorder(Border border) { Border oldBorder = getBorder(); if (oldBorder == null) super.setBorder(border); else super.setBorder(new CompoundBorder(border, borderTableBorder)); ((AbstractBorder) getBorder()).getBorderInsets(this, _insets); } COM: <s> reimplements super method such that the code border table border code </s>
funcom_train/41163937
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void save(CoSingleText3 entity) { EntityManagerHelper.log("saving CoSingleText3 instance", Level.INFO, null); try { getEntityManager().persist(entity); EntityManagerHelper.log("save successful", Level.INFO, null); } catch (RuntimeException re) { EntityManagerHelper.log("save failed", Level.SEVERE, re); throw re; } } COM: <s> perform an initial save of a previously unsaved co single text3 entity </s>
funcom_train/37587113
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setActiveCompiler(CompilerInterface compiler) { if (_compilers.isEmpty() && compiler.equals(NoCompilerAvailable.ONLY)) { // _active should be set correctly already } else if (_compilers.contains(compiler)) { _active = compiler; _notifier.activeCompilerChanged(); } else { throw new IllegalArgumentException("Compiler is not in the list of available compilers: " + compiler); } } COM: <s> sets which compiler is the active compiler </s>
funcom_train/14169934
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void replace(T oldItem, T newItem, boolean modifySource) { synchronized (this) { // if (logger.isDebugEnabled()) logger.debug("Enqueuing replace // request."); actionList.add(Actions.replace); itemsToReplace.push(new Triple<Boolean, T, T>(modifySource, oldItem, newItem)); } } COM: <s> use this method to replace an item with another </s>
funcom_train/5579550
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int sendBuffer() throws IOException { int numBytes = writeBuffer.position(); //System.out.println("Sending ["+numBytes+"] bytes"); writeBuffer.rewind(); int bytesSent = sock.write(writeBuffer); //System.out.println("Sent ["+bytesSent+"] bytes"); writeBuffer = null; return numBytes; } COM: <s> sends the data in the write buffer </s>
funcom_train/25877828
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public PhoneEntry removeEntry(String phoneNumber) { PhoneEntry entryToRemove = null; PhoneEntry nextEntry = null; for (Iterator<PhoneEntry> iter = _pbook.values().iterator(); iter.hasNext();) { nextEntry = iter.next(); if (phoneNumber.equalsIgnoreCase(nextEntry.getPhone())) { entryToRemove = nextEntry; } } if (entryToRemove != null) _pbook.remove(phoneNumber); return entryToRemove; } COM: <s> remove entry removes a contact from the phonebook based on provided phone number </s>
funcom_train/18112114
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addHusbandInPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Person_HusbandIn_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Person_HusbandIn_feature", "_UI_Person_type"), BioDBPackage.Literals.PERSON__HUSBAND_IN, true, false, true, null, null, null)); } COM: <s> this adds a property descriptor for the husband in feature </s>
funcom_train/47433998
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void report(IFolder targetFolder, StringBuffer report, IProgressMonitor monitor) throws CoreException { if (report.length() > 0) { Resources.appendFile(targetFolder, new Path(reportName), report.toString(), monitor); System.out.println(report.toString()); } } COM: <s> reports an error in the log </s>
funcom_train/14457282
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void visit(SetMessage m) throws ParentException { ClientConnection conn = connectToServer(); conn.write(m.toString()); Message retMessage; try { retMessage = parser.parse(conn.read()); retMessage.accept(this); } catch (MessageParserException e) { throw new WebAppException("Invalid message", e); } catch (IOException e) { throw new WebAppException("Connection to serialServer failed.", e); } } COM: <s> writes the set message to the network and waits for response </s>
funcom_train/50208942
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void createListViewer(Composite parent, int width, int height) { listViewer = CheckboxTableViewer.newCheckList(parent, SWT.BORDER); listViewer.setUseHashlookup(true); GridData data = new GridData(GridData.FILL_BOTH); data.widthHint = width; data.heightHint = height; listViewer.getTable().setLayoutData(data); listViewer.setContentProvider(listContentProvider); listViewer.setLabelProvider(listLabelProvider); listViewer.addCheckStateListener(listCheckStateListener); } COM: <s> creates this groups list viewer </s>
funcom_train/37864338
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getNodeValueSeparated() { DBBroker broker = null; try { broker = doc.getBrokerPool().get(null); return broker.getNodeValue(new StoredNode(this), true); } catch (EXistException e) { //TODO : raise an exception here ! } finally { doc.getBrokerPool().release(broker); } return ""; } COM: <s> the method code get node value separated code </s>
funcom_train/26020141
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String readParameter(String key) { String result = null; Cursor c = cr.query(databaseUri, null, RcsSettingsData.KEY_KEY + "='" + key + "'", null, null); if ((c != null) && (c.getCount() > 0)) { if (c.moveToFirst()) { result = c.getString(2); } c.close(); } return result; } COM: <s> read a parameter </s>
funcom_train/36062567
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Form getGroupEditForm( ){ Form form = new Form(); form.addField( new Field("Name", new PatternValidator(Pattern.compile("[-A-Z0-9a-z_ .]{1,32}", Pattern.CASE_INSENSITIVE), "Group name is not valid")) ); form.addField( new Field("Description") ); return form; } COM: <s> get a form that can validate the group </s>
funcom_train/31795370
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addNGrams(StringBuffer word, int n){ NGramEntry nge; StringBuffer sb; int i; // System.out.println(word); for(i=0;i <= word.length()-n;i++){ CharSequence cs = word.subSequence(i,i+n); if(ngrams.containsKey(cs)){ nge = (NGramEntry) ngrams.get(cs); } else { nge=new NGramEntry(cs); } nge.inc(); ngrams.put(cs,nge); } } COM: <s> add ngram from word n is submitted </s>
funcom_train/38258896
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void removeNode(Node nodeToBeRemoved) { for (int i= 0;i<lenght;i++){ if (nodes[i] == nodeToBeRemoved) { // move all for(int j = i; j<lenght-1;j++) { nodes[j] = nodes[j+1]; } // delete last nodes[lenght-1] = null; lenght--; return; } } } COM: <s> removes a node from the mergepath </s>
funcom_train/31056212
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int indexOfMenuElement( String name ) { int count = 0; Enumeration e = getMenuItems(); while( e.hasMoreElements() ) { MenuElement me = (MenuElement)e.nextElement(); if( ( me instanceof MenuObject ) && ( ((MenuObject)me).getName().equals( name ) ) ) return count; count++; } return -1; } COM: <s> return which index menu element has this given name </s>
funcom_train/12160457
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void fireSelectionEvent(SelectionEvent selectionEvent) { Object[] interested = listeners.getListeners(); for (int i = 0; i < interested.length; i++) { if (interested[i] != null) { ((SelectionListener) interested[i]).widgetSelected(selectionEvent); } } } COM: <s> fires a selection event event to all registered listeners </s>
funcom_train/44850648
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void handle(Context inContext, Throwable inThrowable) { if (inThrowable instanceof VException) { DefaultExceptionHandler.instance().handle(inThrowable); } else if(inThrowable instanceof VRuntimeException) { DefaultRuntimeExceptionHandler.instance().handle(inThrowable); } else if(inThrowable instanceof VError) { DefaultErrorHandler.instance().handle(inThrowable); } else { DefaultErrorHandler.instance().handle(inThrowable); } } COM: <s> handling of errors and exceptions </s>
funcom_train/3945957
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean validateNewSchemaversionType_Enumeration(String newSchemaversionType, DiagnosticChain diagnostics, Map context) { boolean result = NEW_SCHEMAVERSION_TYPE__ENUMERATION__VALUES.contains(newSchemaversionType); if (!result && diagnostics != null) reportEnumerationViolation(AdlcpRootv1p2Package.eINSTANCE.getNewSchemaversionType(), newSchemaversionType, NEW_SCHEMAVERSION_TYPE__ENUMERATION__VALUES, diagnostics, context); return result; } COM: <s> validates the enumeration constraint of em new schemaversion type em </s>
funcom_train/22028536
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getTime() { selectedDateTime = (String) DateTimeList.getSelectedValue(); String time = null; if (selectedDateTime != null) { int i = selectedDateTime.indexOf("/"); if (i > 0) { time = selectedDateTime.substring(i+1).trim(); } } return time; } COM: <s> get the time of the selected image </s>
funcom_train/10980962
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetSimpleBoolean() { Object value = dynaForm.get("booleanProperty"); assertNotNull("Got a value", value); assertTrue("Got correct type", (value instanceof Boolean)); assertTrue("Got correct value", ((Boolean) value).booleanValue() == true); } COM: <s> test get simple property on a boolean property </s>
funcom_train/35251978
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private MethodVisitor invokeVisitMethodOnAdapter(String targetParameter) { adapter.visit(V1_3, ACC_PUBLIC, J2meClassNames.ALERT, null, targetParameter, interfaces); return adapter.visitMethod(ACC_PUBLIC, LcduiDecoratorClassAdapter.COMMAND_ACTION, "(L" + J2meClassNames.COMMAND + ";" + "L"+ targetParameter + ";)V", null, null); } COM: <s> starts the visiting process and returns the opportune </s>
funcom_train/50392338
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void extractNotBefore(){ JobDefinitionDocument jd=(JobDefinitionDocument)((JobDefinitionDocument)action.getAjd()); JobIdentificationType ji=jd.getJobDefinition().getJobDescription().getJobIdentification(); if(ji!=null){ for(String s: ji.getJobAnnotationArray()){ if(s.startsWith("notBefore") || s.startsWith("scheduledStartTime")){ try{ long time=JSDLUtils.extractDateTime(s); action.setNotBefore(time); }catch(Exception ex){} break; } } } } COM: <s> extract the not before tag </s>
funcom_train/33264161
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void setParent( ContainerGadget parent, boolean invalidateParent) { GadgetShell shell = getShell(); super.setParent(parent,invalidateParent); if (shell == null) { shell = getShell(); } if (shell != null) { if (parent == null ) { shell.setWaitingForMouseUp(false); } else { shell.setWaitingForMouseUp(true); } } } COM: <s> sets the parent of the component </s>
funcom_train/18322097
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void e3() { for (int currentPrisoner = 0; currentPrisoner < Prison.PRISONERS_NUMBER; currentPrisoner++) { Event e3 = new Event( E3, new Parameter[]{ Prison.createCurrentPrisonerParameter(currentPrisoner), Prison.createCurrentDayParameter(currentDay), }); engine.getEventManager().handle(e3, createContext()); } } COM: <s> executes every prisoner </s>
funcom_train/34260273
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private FMSCheckBox getEnableInstantCollaborationCheckBox() { if(enableInstantCollaborationCheckBox == null) { this.enableInstantCollaborationCheckBox = new FMSCheckBox(this.getCollaborationPreference(), "getEnableInstantCollaboration", "setEnableInstantCollaboration", true); this.enableInstantCollaborationCheckBox.setEnabled(true); } return this.enableInstantCollaborationCheckBox; } COM: <s> builds the enable instant collaboration check box </s>
funcom_train/16913368
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean confirmOverwrite(final File file) { String message = "The file \"" + file.getName() + "\" already exists. Overwrite?"; Object[] options = { "OK", "Cancel" }; return JOptionPane.YES_OPTION == JOptionPane.showOptionDialog(null, message, "Warning", JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]); } COM: <s> ask user whether to overwrite the give existing file </s>
funcom_train/22045545
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void pushHistory(){ java.util.LinkedList<PObject> list = parser.getList(); if( list.size() == 0 ) return; history.add( 0, new HistoryItem( list, getAngleType(), getBase(), getNotation() ) ); while( history.size() > HISTORY_SIZE ) history.removeElementAt( HISTORY_SIZE ); // Once we have added an item, we want to return to end of history list historyPosition = -1; } COM: <s> this is called by equals button and its subclasses and stores an expression </s>
funcom_train/11733230
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected NodeStateEx getNodeStateEx(NodeId nodeId) throws RepositoryException { if (!stateMgr.hasItemState(nodeId)) { return null; } try { return new NodeStateEx( stateMgr, ntReg, (NodeState) stateMgr.getItemState(nodeId), null); } catch (ItemStateException e) { throw new RepositoryException(e); } } COM: <s> returns the node state for the given node id </s>
funcom_train/21087597
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addRacinePropertyDescriptor(Object object) { itemPropertyDescriptors.add(createItemPropertyDescriptor( ((ComposeableAdapterFactory) adapterFactory) .getRootAdapterFactory(), getResourceLocator(), getString("_UI_SNI_racine_feature"), getString( "_UI_PropertyDescriptor_description", "_UI_SNI_racine_feature", "_UI_SNI_type"), SNI_Package.Literals.SNI__RACINE, true, false, true, null, null, null)); } COM: <s> this adds a property descriptor for the racine feature </s>
funcom_train/29771215
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetFile() { System.out.println("getFile"); ExcelFile instance = new ExcelFile(); File expResult = null; File result = instance.getFile(); 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 file method of class names </s>
funcom_train/4821747
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isUtf8Url(String text) { text = text.toLowerCase() ; int p = text.indexOf("%") ; if (p != -1 && text.length() - p > 9) { text = text.substring(p, p + 9) ; } return Utf8codeCheck(text) ; } COM: <s> hash utf8 url code </s>
funcom_train/26273738
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void write_u_long(long v) throws IOException { targetStream_.write((byte) (v >>> 24)); targetStream_.write((byte) (v >>> 16)); targetStream_.write((byte) (v >>> 8)); targetStream_.write((byte) (v >>> 0)); } COM: <s> writes an unsigned int in a message </s>
funcom_train/25764000
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int index(Object obj) { if (obj == null) return indexForNull(); // From here on we know obj to be non-null final int hash = hash(obj) & 0x7fffffff; int index = hash % _set.length; Object cur = _set[index]; if (cur == FREE) { return -1; } if (cur == obj || equals(obj, cur)) { return index; } return indexRehashed(obj, index, hash, cur); } COM: <s> locates the index of tt obj tt </s>
funcom_train/39350407
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean objectReferenceBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) { // Either: bulk copy is supported and this is overridden, or // write barriers are not used and this is never called if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false); return false; } COM: <s> a number of references are about to be copied from object </s>
funcom_train/34483316
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void characters(char charArray[], int start, int length) throws SAXException { try { ctxHandlerStack[ctxTop].characters(charArray, start, length); } catch(SdaiException e) { //e.printStackTrace(); SAXException wrapper = new SAXException(e.toString()); wrapper.initCause(e); throw wrapper; } } COM: <s> accepts notification about character events </s>
funcom_train/40655877
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void removeEmptyColumnsFromRight() { int colsToRemove = 0; for (int c=getColumnCount()-1; c>=minCols; c--) { if (!isColEmpty(c)) { break; } colsToRemove++; } if (colsToRemove > 0) { resizeColumns(getColumnCount() - colsToRemove); } } COM: <s> removes empty columns to the right of the table </s>
funcom_train/11017920
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected EmbeddedObjectRefSubRecord findObjectRecord() { Iterator<SubRecord> subRecordIter = _record.getSubRecords().iterator(); while (subRecordIter.hasNext()) { Object subRecord = subRecordIter.next(); if (subRecord instanceof EmbeddedObjectRefSubRecord) { return (EmbeddedObjectRefSubRecord)subRecord; } } throw new IllegalStateException("Object data does not contain a reference to an embedded object OLE2 directory"); } COM: <s> finds the embedded object ref sub record or throws an </s>
funcom_train/8608323
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void changeLevel(Legion legion, int newLevel, boolean save) { legion.setLegionLevel(newLevel); PacketSendUtility.broadcastPacketToLegion(legion, new SM_LEGION_EDIT(0x00, legion)); PacketSendUtility.broadcastPacketToLegion(legion, SM_SYSTEM_MESSAGE.LEGION_LEVEL_UP(newLevel)); if (save) storeLegion(legion); } COM: <s> this method will change the legion level and send update to online members </s>
funcom_train/20948453
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int findNextNumber(int number) { if (numbers.contains(number)) { return number; } else { // find minimum number bigger then this int mbn = 100; for (Iterator<Integer> iter = numbers.iterator(); iter.hasNext();) { int n = iter.next(); if (n > number && n < mbn) { mbn = n; } } // can't find bigger number, return minimum number if (mbn == 100) { return numbers.get(0); } else { return mbn; } } } COM: <s> returns this number if its in list next bigger number or minimum number </s>
funcom_train/33974579
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void delete(T entity) { // todo: add logger try { entity = getEntityManager().getReference(entityClass, entity.getId()); getEntityManager().remove(entity); EntityManagerHelper.log("delete successful", Level.INFO, null); } catch (RuntimeException ex) { EntityManagerHelper.log("delete failed", Level.SEVERE, ex); throw ex; } } COM: <s> delete a persistent entity </s>
funcom_train/22401268
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void reverseDirection() { // have to remove the edge reference from the nodes first as setStart and // setEnd call addEdge start.removeEdge(this); end.removeEdge(this); Node n = start; setStart(end); setEnd(n); // have to recalculate the multi Edge offsets taking into account // the new direction of this edge recalculateMultiEdgeOffsets(); } COM: <s> swap the start and end nodes so that the edge effectively reverses </s>
funcom_train/14464396
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setFontColor(int t) { // 20070827 KSC // see if can find font with this, if not, duplicate it Font f= cloneFont(myxf.getFont()); f.setFontColor(t); updateFont(f); // 20071010 KSC: update font for this FormatHandle + handing all necessary links ... /* // 20070820 KSC myfont.setFontColor(t); */ } COM: <s> set the font color for this format </s>
funcom_train/10792586
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void orderRelation(Select sel, ClassMapping elem, Joins joins) { JDBCOrder[] orders = (JDBCOrder[]) getOrders(); for (int i = 0; i < orders.length; i++) if (orders[i].isInRelation()) orders[i].order(sel, elem, joins); } COM: <s> add ordering to the given select for all relation based values </s>
funcom_train/28756433
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setCaptureid(Long newVal) { if ((newVal != null && this.captureid != null && (newVal.compareTo(this.captureid) == 0)) || (newVal == null && this.captureid == null && captureid_is_initialized)) { return; } this.captureid = newVal; captureid_is_modified = true; captureid_is_initialized = true; } COM: <s> setter method for captureid </s>
funcom_train/25828684
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String readXMLFile(File file) { try { InputStreamReader streamReader = new InputStreamReader( new FileInputStream(file), "UTF8"); BufferedReader fileReader = new BufferedReader(streamReader); String line = ""; String result = ""; while ((line = fileReader.readLine()) != null) { result += line + "\n"; } fileReader.close(); // return the content of the string writer return result; } catch (IOException e) { e.printStackTrace(); } // necessary, since return values are always required return ""; } COM: <s> load the content of a given xml file </s>
funcom_train/7625098
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public XmlResourceParser loadXmlMetaData(PackageManager pm, String name) { if (metaData != null) { int resid = metaData.getInt(name); if (resid != 0) { return pm.getXml(packageName, resid, null); } } return null; } COM: <s> load an xml resource attached to the meta data of this item </s>
funcom_train/11677044
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void handleException(String msg, MessageContext msgContext) { log.error(msg); if (msgContext.getServiceLog() != null) { msgContext.getServiceLog().error(msg); } if (shouldTrace(msgContext.getTracingState())) { trace.error(msg); } throw new SynapseException(msg); } COM: <s> perform an error log message to all logs </s>
funcom_train/13381486
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void createComposite() { GridData gridData3 = new GridData(); gridData3.horizontalSpan = 2; composite = new Composite(top, SWT.NONE); composite.setLayout(new RowLayout()); composite.setLayoutData(gridData3); label1 = new Label(composite, SWT.NONE); label1.setText("In sketch mode, display "); radioTitle = new Button(composite, SWT.RADIO); radioTitle.setText("title"); radioContent = new Button(composite, SWT.RADIO); radioContent.setText("text."); radioContent.setSelection(true); } COM: <s> this method initializes composite </s>
funcom_train/36753621
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected boolean isShadowed(Scene scene, Light light, IntersectionRecord record) { Ray shadowRay = new Ray(); // Setup the shadow ray to start at surface and end at light shadowRay.origin.set(record.location); shadowRay.direction.sub(light.position, record.location); //Set the ray to end at the light shadowRay.makeOffsetSegment(1.0); shadowRay.update(); return scene.getAnyIntersection(shadowRay); } COM: <s> utility method to compute shadows </s>
funcom_train/3514698
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void doTest(final String wildCard, final String regExp) { String result = RegExpCreator.getRegExp(wildCard); log.debug("Wildcard: "+wildCard); log.debug("regExp: "+regExp); log.debug("result: "+result); assertEquals(regExp, result); } COM: <s> do the tests donkey work </s>
funcom_train/11319795
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void init() { Form form = getForm(); // TODO: this wont work, as table control links have unique name form.add(new HiddenField(PAGE, String.class)); form.add(new HiddenField(COLUMN, String.class)); form.add(new HiddenField(ASCENDING, String.class)); // If Form is internal add it to table if (useInternalForm) { add(form); } } COM: <s> initialize the form table </s>
funcom_train/50697244
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Message getChild(Message parent, int index) { Message message = null; Iterator children = parent.getReplyMessages().iterator(); while (children.hasNext() && index > 0) { index--; children.next(); } if (index == 0) { message = (Message) children.next(); } return message; } COM: <s> returns the child of parent at index index in the parents child array </s>
funcom_train/2897910
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void fireRelationOverEvent(VisibleRelationEvent e) { Object[] listeners = myEventListenerList.getListenerList(); for (int i = listeners.length - 2; i >= 0; i -= 2) { if (listeners[i] == VisibleRelationEventListener.class) { ((VisibleRelationEventListener) listeners[i + 1]).onRelationOver(e); } } } COM: <s> fires an code visible relation event code by calling on relation over </s>
funcom_train/35747953
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void startMusic(float pitch, float volume, boolean loop) { if (currentMusic != null) { currentMusic.stop(); currentMusic.fireMusicSwapped(this); } currentMusic = this; if (volume < 0.0f) volume = 0.0f; if (volume > 1.0f) volume = 1.0f; sound.playAsMusic(pitch, volume, loop); playing = true; setVolume(volume); if (requiredPosition != -1) { setPosition(requiredPosition); } } COM: <s> play or loop the music at a given pitch and volume </s>