__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/21466269
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Actuator generateActuator(int maxElems) { List<Action> actions = new ArrayList<Action>(); int numActions = randomGenerator.nextInt(maxElems) + 1; for(int i = 0; i != numActions; ++i){ actions.add(new Action("A"+actionCount, null, "", null)); actionCount++; } return new Actuator("Actuator", actions); } COM: <s> generates actuators with a maximum number of actions </s>
funcom_train/39983693
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Set setupResource() throws URISyntaxException { HashSet resource = new HashSet(); // the resource being requested AnyURIAttribute value = new AnyURIAttribute(resourceIdValue); // create the resource using a standard, required identifier for // the resource being requested resource.add(new Attribute(new URI(EvaluationCtx.RESOURCE_ID), null, null, value)); return resource; } COM: <s> creates a resource specifying the resource id a required attribute </s>
funcom_train/11088452
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setMaxConcurrentConsumers(int maxConcurrentConsumers) { Assert.isTrue(maxConcurrentConsumers > 0, "'maxConcurrentConsumers' value must be at least 1 (one)"); synchronized (this.lifecycleMonitor) { this.maxConcurrentConsumers = (maxConcurrentConsumers > this.concurrentConsumers ? maxConcurrentConsumers : this.concurrentConsumers); } } COM: <s> specify the maximum number of concurrent consumers to create </s>
funcom_train/12646717
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void removeNotify() { synchronized (getTreeLock()) { int ncomponents = this.ncomponents; Component component[] = this.component; for (int i = 0; i < ncomponents; i++) { component[i].removeNotify(); } if (dispatcher != null) { dispatcher.dispose(); } super.removeNotify(); } } COM: <s> notifies this container and all of its subcomponents to remove </s>
funcom_train/863668
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int stringIndex( String value ) { if( value == null ) throw new RuntimeException( "Cannot add null string to constant pool" ); Integer index = stringIndices.get( value ); if( index == null ) { index = stringPool.size() + 1; stringPool.add( value ); stringIndices.put( value, index ); } return index; } COM: <s> get or create a string constant pool entry </s>
funcom_train/21845206
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Status compile(final CompileContext work) throws JBasicException { work.validate(1, 2); if( work.argumentCount == 2 ) { work.byteCode.add(ByteCode._SWAP ); } work.byteCode.add(ByteCode._CALLF, 1, "CRYPTSTR"); if( work.argumentCount == 2 ) { work.byteCode.add(ByteCode._SWAP ); } work.byteCode.add(ByteCode._CALLF, work.argumentCount, "DECIPHER"); return new Status(); } COM: <s> compile the decipher function </s>
funcom_train/21849661
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Insets getBorderInsets(Component c, Insets insets) { if (getRoundedCorners()) return super.getBorderInsets(c, insets); insets.left = (m_left ? thickness : 0); insets.top = (m_top ? thickness : 0); insets.right = (m_right ? thickness : 0); insets.bottom = (m_bottom ? thickness : 0); return insets; } COM: <s> reinitialize the insets parameter with this borders current insets </s>
funcom_train/986149
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void pickDevice(int _which) { RemoteDevice rd = (RemoteDevice) devicesFound.elementAt(_which); try { friendlyName = rd.getFriendlyName(false); System.out.println("Friendly Picked " + friendlyName); } catch (IOException e) { mainProgram.feedback(this, "Prob" + e); } System.out.println(rd + "Service Discovery on " + friendlyName); doServiceDiscovery(rd); // System.out.println(rd + "Service Discovery on " + friendlyName); } COM: <s> specifies which device of the ones discovered you want to connect to </s>
funcom_train/37790517
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected Component createComponent() { NakedValue value = (NakedValue)getObject(); oldText = value.title().toString(); textField = new JTextField(oldText); textField.addKeyListener(this); textField.addFocusListener(this); if (oldText.equals("")) textField.setPreferredSize(new java.awt.Dimension(100, 20)); textField.setEditable(canEdit()); return textField; } COM: <s> implement this method to initialize the renderer and make it available </s>
funcom_train/4233635
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void centerImageFromPanelPoint(Point panelPoint) { int newOriginX = (origin.x - panelPoint.x) + Math.round(getWidth() / 2f); int newOriginY = (origin.y - panelPoint.y) + Math.round(getHeight() / 2f); smoothScroll(newOriginX, newOriginY); } COM: <s> centers the image on the point specified in panel coordinates </s>
funcom_train/23332879
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean hasChanged(String flashCardName) { boolean bRet = false; String val1 = flashCardMap.get(flashCardName); String val2 = flashCardOrig; if ((val1 != null) && (val2 != null)) { if (!val1.equals(val2)) bRet = true; } return bRet; } COM: <s> returns true if specified flashcard has changed </s>
funcom_train/6144971
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String realGetClassLabel(Class klass) { String label = getProperty(toKey(klass)); if (label != null) return label; final Class c = klass.getSuperclass(); if (c != null) { label = realGetClassLabel(c); if (label != null) return label; } final Class[] infs = klass.getInterfaces(); if (infs != null) { for (int j = 0; j < infs.length; ++j) { label = realGetClassLabel(infs[j]); if (label != null) return label; } } return null; } COM: <s> returns the class label or null if not available </s>
funcom_train/42784799
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void initTimeRegulating() throws Exception { if (props.getProperty("TIME_REGULATING").equalsIgnoreCase("YES")) { HLATimeManager tm = model.getTimeManager(); HLALogicalTime ft = tm.getSimulationTime(); HLALogicalTimeInterval la = tm.getIntervalFactory() .parseTimeInterval(props.getProperty("LOOKAHEAD")); tm.enableTimeRegulation(ft, la); while (!tm.isTimeRegulationEnabled()) { model.getRtiAdapter().waitForTick(); } } } COM: <s> if the property time regulating is yes enable time regulating for this </s>
funcom_train/4233554
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void autoCenter() { Point oldOrigin = new Point(origin); // centers the image in the panel origin.x = (int) (getWidth() - getScaledImageWidth()) / 2; origin.y = (int) (getHeight() - getScaledImageHeight()) / 2; if (!origin.equals(oldOrigin)) { firePropertyChange(ORIGIN_PROPERTY, oldOrigin, origin); } } COM: <s> centers the image in the panel </s>
funcom_train/24595792
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void updateWorld() { ToClientPack pack; while((pack = world.getPackages().poll()) != null) { try { Socket[] to = pack.getTo(); if(to == null) to = getAuthenticatedArray(); Socket[] broken = sender.send(pack.getHeader(), pack.getData(), to); for(Socket s : broken) logouter.broken(s); } catch (Exception e) { System.out.println("<Update World> exception: " + e); } } } COM: <s> sends world changes to clients </s>
funcom_train/27944848
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public MonThreadMethodRef getMonThreadMethod(ThreadRef peer) { ListIterator itr = getMonThreadMethods().listIterator(); MonThreadMethodRef obj; while (itr.hasNext()) { obj = (MonThreadMethodRef) itr.next(); if ( obj.getThread().equals( peer ) ) return obj; } return null; } COM: <s> returns statistic data for given thread where this method was waiting </s>
funcom_train/26279663
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setSecretKeyInfo(SecretKey s, Cipher alg, SecureRandom prng) { if(sharedkey == null || !sharedkey.equals(s)) { if(sharedkey!=null) ciphertext=""; sharedkey=s; currentstringrep=""; } secretalgorithm=alg; secrandom=prng; //Log.lg("shared key is "+sharedkey, 2, "Command"); } COM: <s> sets the algorithm that will be used to encrypt the crypted </s>
funcom_train/20586155
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void insertVoteAnswer(VoteAnswer answer) throws SQLException{ try{ String sql = "insert into vote_answer (content,voteid) values (?,?)"; pstmt = con.prepareStatement(sql); pstmt.setString(1, answer.getContent()); pstmt.setLong(2, answer.getVote().getVoteId()); pstmt.executeUpdate(); }finally{ closeAll(null, pstmt); } } COM: <s> insert vote answer </s>
funcom_train/50463257
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Point getStoredLocation() { Preferences prefs = Preferences.userNodeForPackage(AppletEnvironment.class); int x = prefs.getInt(appletDesc.getUniqueID()+".x", -1); int y = prefs.getInt(appletDesc.getUniqueID()+".y", -1); return new Point(x,y); } COM: <s> store the current frame location </s>
funcom_train/51197002
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testgetWidth() { System.out.println("getWidth"); try { jjil.core.RgbImage instance = imageTest; int expectedResult = 30; int result = instance.getWidth(); assertEquals(expectedResult, result); } catch (Exception ex) { ex.printStackTrace(); fail(ex.toString() + " thrown"); } } COM: <s> test of get width method of class jjil </s>
funcom_train/5323689
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected boolean isWithinRangeEnsured(){ boolean rangeOK = true; if(!isWithinRange(initX) && !isWithinRange(finalX)) rangeOK = false; else if(!isWithinRange(initX)){ initX = scaleData.minX; } else if(!isWithinRange(finalX)){ finalX = scaleData.maxX; } return rangeOK; } COM: <s> determines if the range of the area selected for zooming </s>
funcom_train/20625330
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void checkForStatics() { if (this.equals(TermAttributeSetDescriptor.ALL_ATTRIBUTES)) { throw new RuntimeException( "Attempt to modify static TermAttributeSetDescriptor.ALL_ATTRIBUTES."); } if (this.equals(TermAttributeSetDescriptor.NO_ATTRIBUTES)) { throw new RuntimeException( "Attempt to modify static TermAttributeSetDescriptor.NO_ATTRIBUTES."); } } COM: <s> check that static code term attribute set descriptor code s are not </s>
funcom_train/5734568
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isCompatibleSampleModel(SampleModel sm) { if (sm instanceof ComponentSampleModel) { if (sm.getNumBands() != getNumComponents()) { return false; } if (sm.getDataType() != transferType) { return false; } return true; } else { return false; } } COM: <s> checks whether or not the specified code sample model code is </s>
funcom_train/15607695
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected GenomicProperty createWithPropsMgr(String propertyName, AlignableGenomicEntity entity, String initialValue) { if (initialValue == null) initialValue = ""; PropertyMgr propertyMgr = PropertyMgr.getPropertyMgr(); GenomicProperty baseProperty = createDefaultSettingsProperty(propertyName, initialValue); if (entity == null) return baseProperty; else return propertyMgr.handleProperty( baseProperty, PropertyMgr.NEW_ENTITY, entity); } // End method COM: <s> uses the properties manager to generate properties thus ensuring proper </s>
funcom_train/51536324
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void invokeAndWait(Runnable runnable) throws InterruptedException { if (runnable == null) { throw new NullPointerException(); } if (state == STATE_STOPPED) { throw new IllegalStateException(Messages.formatMessage(Messages.ERROR_INVALID_STATE, new Object[] { getClass().getName(), stateToString(), "invokeAndWait()", "paused, playing" })); } updateQueue.invokeAndWait(runnable, canvasManager); } COM: <s> invoke the runnable in the document update thread and </s>
funcom_train/32778019
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public P pred(P p) { if (p == null) { sendWarning( "Can not find predecessor of SimProcess in Queue!", "ProcessQueue : " + getName() + " Method: SimProcess pred(P p)", "The SimProcess 'p' given as parameter is a null reference!", "Check to always have valid references when querying for Entities"); return null; // no proper parameter } return _ql.pred(p); } COM: <s> returns the sim process enqueued directly before the given sim process in </s>
funcom_train/3371344
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void updateNodeSizes(boolean updateAll) { int aY, counter, maxCounter; TreeStateNode node; updateNodeSizes = false; for(aY = counter = 0, maxCounter = visibleNodes.size(); counter < maxCounter; counter++) { node = (TreeStateNode)visibleNodes.elementAt(counter); node.setYOrigin(aY); if(updateAll || !node.hasValidSize()) node.updatePreferredSize(counter); aY += node.getPreferredHeight(); } } COM: <s> resets the y origin of all the visible nodes as well as messaging </s>
funcom_train/46984558
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setup(ExternalLink source) { int size; setContent(source.getContent()); setHref(source.getHref()); setTarget(source.getTarget()); setUseParam(source.getUseParam()); setWidth(source.getWidth()); setHeight(source.getHeight()); setGadget(source.getGadget()); } COM: <s> initializes the code external link code by the external link code source code </s>
funcom_train/41331374
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int mapDirection(boolean isLeft) { if (isLeft) { if (splitPane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT) { return SwingConstants.WEST; } return SwingConstants.NORTH; } if (splitPane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT) { return SwingConstants.EAST; } return SwingConstants.SOUTH; } COM: <s> convert the orientation of the pane into compass points based on the pane </s>
funcom_train/25706770
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JRadioButton getDate_RBbetweenDates() { if( date_RBbetweenDates == null ) { date_RBbetweenDates = new JRadioButton(); date_RBbetweenDates.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(final java.awt.event.ItemEvent e) { date_RBitemStateChanged(); } }); } return date_RBbetweenDates; } COM: <s> this method initializes j radio button1 </s>
funcom_train/12854406
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void sort(String sortColumn) { if (sortColumn == null) { throw new IllegalArgumentException( "Argument sortColumn must not be null."); } if (sort.equals(sortColumn)) { //current sort equals new sortColumn -> reverse sort order ascending = !ascending; } else { //sort new column in default direction sort = sortColumn; ascending = isDefaultAscending(sort); } sort(sort, ascending); } COM: <s> sort the given column </s>
funcom_train/37141449
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected String getInputString(int row, int column) { Filter filter = getMappingFilter(); if (filter != null) { return filter.getStringAt(row, column); } if (adapter != null) { return adapter.getStringAt(row, column); } return null; } COM: <s> returns the string representation of cell at the specified row and column </s>
funcom_train/11693657
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public DenseVector hiddenToOutput(Vector hiddenActivation) { DenseVector activations = new DenseVector(numOutput); for (int i = 0; i < numOutput; i++) { activations.setQuick(i, outputWeights[i].dot(hiddenActivation)); } activations.assign(outputBias, Functions.PLUS); return activations; } COM: <s> feeds forward from hidden to output </s>
funcom_train/8009670
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getFormattedValue() { String sFormattedPhone = ""; if (isValid()) { if (_sAreaCode.length() == 3) sFormattedPhone = _sAreaCodeStart + _sAreaCode + _sAreaCodeEnd; sFormattedPhone += _sPhoneStart + _sPhoneSeparator + _sPhoneEnd; } return sFormattedPhone; } COM: <s> this method returns the formatted phone number provided that the component </s>
funcom_train/21015516
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void initialize ( ) { setSettings ( settings ); setData ( data ); addPropertyChangeListener ( "list", new PropertyChangeListener( ) { public void propertyChange ( final PropertyChangeEvent arg0 ) { final Item item = (Item) arg0.getNewValue ( ); if ( item != null ) { addSavedListener ( item ); } } } ); } COM: <s> this initializes the questionnaire </s>
funcom_train/45640967
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void injectDependencies() throws Exception { if (isPopulateProtectedVariables()) { if (this.managedVariableNames == null) { initManagedVariableNames(); } populateProtectedVariables(); } else if (getAutowireMode() != AUTOWIRE_NO) { getApplicationContext().getBeanFactory().autowireBeanProperties(this, getAutowireMode(), isDependencyCheck()); } } COM: <s> inject dependencies into this instance that is this test instance </s>
funcom_train/4786208
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected String shortenText(GC gc, String t, int width) { if (t == null) return null; int w = gc.textExtent(ELLIPSIS, DRAW_FLAGS).x; int l = t.length(); int s = l; while (s >= 0) { String s1 = t.substring(0, s); int l1 = gc.textExtent(s1, DRAW_FLAGS).x; if (l1+w < width) { t = s1 + ELLIPSIS; break; } s--; } return t; } COM: <s> shorten the given text code t code so that its length doesnt exceed </s>
funcom_train/35566934
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected boolean stillToUpdate(Updatable u) { if (this.m_currentUpdate != null) { Node n = (Node)this.m_pairs.get(u); return this.m_currentUpdate.stillToUpdate(n); } throw new IllegalStateException("No update in progress!"); } COM: <s> determines if a specified updatable object has still to be updated </s>
funcom_train/32891657
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void remAlphaLane(Drivelane l) throws InfraException { if (l == null) throw new InfraException("Parameter l is null"); int i = Arrayutils.findElement(alphaLanes, l); if (i == -1) throw new InfraException("Lane is not an alpha lane on this road"); alphaLanes = (Drivelane[])Arrayutils.remElement(alphaLanes, i); } COM: <s> removes a drivelane leading to the alpha node </s>
funcom_train/49789352
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int getNodeIndex(Element element) { Node n = element.getParentNode(); int count = 0; for (int i = 0; i < n.getChildNodes().getLength(); i++) { Node nn = n.getChildNodes().item(i); if (nn.getNodeName().equals(element.getNodeName())) { if (nn.equals(element)) return count; count++; } } // should never get this far throw new RuntimeException("Could not find frequency of node '" + element + "'"); } COM: <s> find the index of this node in its parent </s>
funcom_train/17119925
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void checkFile() throws DatafileException{ if (this.getSourceFile().isDirectory()) throw new DatafileException("Datafile can not be a directory."); if (!this.getSourceFile().canRead()) throw new DatafileException("Datafile can not be read"); } COM: <s> checks that the datafile is not a directoy and can be read </s>
funcom_train/48561418
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void sendRoom(UserObject user, JSONObject json) { JSONArray a = new JSONArray(); a.add("onMessageRoom"); JSONObject o = new JSONObject(); o.put("Username", user._username); o.put("Message", json.get("_message")); a.add(o); for (int i = 0; i < _threads.size(); i++) { synchronized (_threads) { ThreadHandler handler = (ThreadHandler) _threads.elementAt(i); handler.send(a); } } } COM: <s> sends a chat message to the room </s>
funcom_train/26226989
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addUse(int register, int index) { ListDefUse list = (ListDefUse) map.get(new Integer(register)); if (list != null && !list.isEmpty() && !list.lastActionIsRemove) { if (list.hasUse()) { //two use, so we remove it list.removeFirst(); list.lastActionIsRemove = true; } else { list.setUse(index); } } } COM: <s> add a use for a given variable </s>
funcom_train/17772259
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setKeys(Object[] headerKeys, Object[] blockKeys, Object[] footerKeys){ headerDataKeys = (headerKeys != null)? headerKeys : NULL_KEYS; blockDataKeys = (blockKeys != null)? blockKeys : NULL_KEYS; footerDataKeys = (footerKeys != null)? footerKeys : NULL_KEYS; } COM: <s> sets the keys for a specific implementation </s>
funcom_train/33852584
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void copyFrom(StateSet other) { this.isTop = other.isTop; this.isBottom = other.isBottom; this.stateMap.clear(); for (State state : other.stateMap.values()) { State dup = state.duplicate(); this.stateMap.put(dup.getObligationSet(), dup); } } COM: <s> make this state set an exact copy of the given state set </s>
funcom_train/2386405
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void sendConnectedNotification() { synchronized (connectListeners) { for (int i = 0; i < connectListeners.size(); i++) { WeakReference<ConnectListener> ref = connectListeners.get(i); ConnectListener listener = ref.get(); if (listener != null) { listener.onIChatConnected(); } } } } COM: <s> sends notification about our successfull connection to the server </s>
funcom_train/31520889
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void addNode(Document document, Node node, Article x, HashMap<IPerson, Integer> persons) { Element e = document.createElement(bib+"article"); addCommonData(document, e, x, persons); addString(document, e, "journal", x.getJournal()); addString(document, e, "volume", x.getVolume()); addString(document, e, "number", x.getNumber()); addString(document, e, "page", x.getPages()); node.appendChild(e); } COM: <s> adding an article </s>
funcom_train/25649338
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testSave() throws Exception { System.out.println("save"); try { Settings.load(PATH); Settings.setProperty(KEY, VALUE); Settings.save(); Settings.reset(); Settings.load(PATH); String result = Settings.getProperty(KEY); assertEquals(VALUE, result); } catch (Exception e) { fail("Properties saving failed"); } } COM: <s> test of save method of class com </s>
funcom_train/41852955
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void deviceDiscovered(RemoteDevice remoteDevice, DeviceClass deviceClass) { System.out.println("BlueToothManager::deviceDiscovered()=========================================================="); // this.remoteDevice = remoteDevice; if (discoveredDevices.indexOf(remoteDevice) == -1) { discoveredDevices.addElement(remoteDevice); parent.updateIndicator("Device discovered:" + remoteDevice.getBluetoothAddress(), false); } } COM: <s> implementation of discovery listener </s>
funcom_train/50816087
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void changeFocus(Pattern selected) { PatternState ps = this.matrix.getPatternState(selected); //NodeData fnd = this.patternNode.get(ps); //if (fnd == null) { // throw new IllegalArgumentException("Not a NodeData actor: " + selected); //} if (ps != this.focused) { this.focused = ps; updateNodes(); } } COM: <s> changes the currently displayed graph by switching the focused node to </s>
funcom_train/1575770
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void buildUpdatableVariables() { final GamaList<IVariable> updatableVars = new GamaList(); for ( final String s : description.getVarNames() ) { final IVariable v = variables.get(s); if ( v != null && v.isUpdatable() ) { updatableVars.add(v); } } updatableVariables = new IVariable[updatableVars.size()]; updatableVariables = updatableVars.toArray(updatableVariables); } COM: <s> builds the existing vars </s>
funcom_train/49330419
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void updateText() { if (model != null) { Unit unit = model.getCurrentUnit(); if (showValue) { setText(unit.toStringUnit(model.getValue())); } else { setText(unit.getUnit()); } } else if (unitGroup != null) { setText(currentUnit.getUnit()); } else { throw new IllegalStateException("Both model and unitGroup are null."); } } COM: <s> updates the text of the label </s>
funcom_train/887305
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private InputStream getFile(String fileName) throws IOException { // Search entry JarEntry entry = docFile.getJarEntry(fileName); if(entry == null) throw new IOException("Could not find entry \"" + fileName + "\" in \"" + docFile.getName() + "\"!"); // Return input stream return docFile.getInputStream(entry); } COM: <s> get an input stream for the given file inside the archive </s>
funcom_train/48168719
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: static public int swapInt(byte[] b, int offset) { // 4 bytes int accum = 0; for (int shiftBy = 0, i = offset; shiftBy < 32; shiftBy += 8, i++) { accum |= (b[i] & 0xff) << shiftBy; } return accum; } COM: <s> returns the int resulting from reversing 4 bytes at a specified </s>
funcom_train/22805646
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ActionMessages editCategory(Category category) throws DatabaseException { ActionMessages errors = new ActionMessages(); // Check inputs if (category.getName().isEmpty()) { errors.add("emptyName", new ActionMessage("blogs.categoryEdit.error.emptyName")); } if (!errors.isEmpty()) { return errors; } return categoryDao.editCategory(category); } COM: <s> edits site category </s>
funcom_train/37807516
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void invoke(CommandContext context) { Message m = context.getMessage(); if (m == null) { return; } ICommand command = (ICommand)commands.get(m.getCommand()); if (command != null) { command.invoke(context); } else { System.err.println("could not find command '" + m.getCommand() + "'"); } } COM: <s> lookup and invoke the right command given its context </s>
funcom_train/43665389
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addGModelPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_GPackage_gModel_feature"), getString("_UI_PropertyDescriptor_description", "_UI_GPackage_gModel_feature", "_UI_GPackage_type"), XmdlgenPackage.Literals.GPACKAGE__GMODEL, true, false, false, null, getString("_UI_GenerationModelPropertyCategory"), null)); } COM: <s> this adds a property descriptor for the gmodel feature </s>
funcom_train/23370361
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int cdDown(final int sel) { FileWrapper fw = contents_[sel]; if (setPath(fw)) { // do not allow cd to empty directories selectionStack_.push(new HistoryItem(sel,currentPath_,isRandom_)); return 0; /* the caller will use this return value to set the focus to the first item in the list widget */ } else { return -1; } } COM: <s> change directory cd to the current selection </s>
funcom_train/27822238
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Map getActionMap() { Map actionMap=new HashMap(11); Object[] keys=getKeys(); for (int i=keys.length-1;i>=0;--i) { Object value=getValue((String)keys[i]); if (value!=null) actionMap.put(keys[i],value); } return actionMap; } COM: <s> returns the action map of this action </s>
funcom_train/42785140
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public PolkaReflectedAttribute encode(HLAClass cls) { try { NDC.push(cls.getName()); HLAAttribute attr = cls.getAttribute(name); PolkaReflectedAttribute ra = new PolkaReflectedAttribute(); ra.setHandle((Integer) attr.handle); ra.setValue(attr.marshall(value)); ra.setOrderType(orderType); ra.setTransportType(transportType); return ra; } catch (UnknownAttribute e) { logger.error("", e); } finally { NDC.pop(); } return null; } COM: <s> encode a reflected attribute </s>
funcom_train/4900630
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setZoomButtonsVisible(boolean zoomButtonsVisible) { boolean old = this.isZoomButtonsVisible(); this.zoomButtonsVisible = zoomButtonsVisible; zoomInButton.setVisible(zoomButtonsVisible); zoomOutButton.setVisible(zoomButtonsVisible); firePropertyChange("zoomButtonsVisible",old,this.isZoomButtonsVisible()); } COM: <s> sets if the zoom buttons should be visible </s>
funcom_train/26400834
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void actionPerformed(ActionEvent e) { Object source = e.getSource(); handleEvents(e, source, e.getActionCommand()); if (source instanceof JTextField) { // we switch the focus to the next component Component next = ((JComponent) source).getNextFocusableComponent(); if (next != null && next.isEnabled()) { next.requestFocus(); } } } COM: <s> actions when a widget triggers an action </s>
funcom_train/22065330
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void loadPortalModes() { // Add the PortletModes supported by the portal to the // supportedPortletModesByPortal set. LOG.debug("Loading supported portal modes..."); Iterator modes = propertyService.getSupportedPortletModes().iterator(); while (modes.hasNext()) { String mode = (String) modes.next(); LOG.debug("Loading mode [" + mode + "]"); supportedPortletModesByPortal.add(new PortletMode(mode)); } LOG.debug("Loaded [" + supportedPortletModesByPortal.size() + "] supported portal modes"); } COM: <s> populates the supported portlet modes by portal set </s>
funcom_train/28297606
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int getClientIdOfMessage(String msg) { StringTokenizer st=new StringTokenizer(msg,TransBaseSettings.separate); String lastPart=""; while (st.hasMoreTokens()) { lastPart=st.nextToken(); } return TransBaseTools.toInt(lastPart); } COM: <s> returns the client id in the given message or 1 </s>
funcom_train/40866440
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected SyndEntry createSyndFeedEntry(SyndicationFeed feed, SyndicationFeedEntry entry) { SyndEntry syndEntry = new SyndEntryImpl(); SyndContent summary = new SyndContentImpl(); syndEntry.setUri(createUri(feed, entry)); syndEntry.setLink(entry.getLink()); syndEntry.setTitle(entry.getTitle()); summary.setValue(entry.getSummary()); syndEntry.setDescription(summary); syndEntry.setUpdatedDate(entry.getCreateDate().getTime()); return syndEntry; } COM: <s> creates a rome syndication feed entry from the given feed and entry beans </s>
funcom_train/34874484
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void moveBits(int from, int to) { // if (debug) { // System.out.println("Moving bits from " + from + " to " + to); // } if (black.get(from)) { black.clear(from); black.set(to); } else if (white.get(from)) { white.clear(from); white.set(to); } if (kings.get(from)) { kings.clear(from); kings.set(to); // // if (debug) { // System.out.println("Moving king " + from + "-" + to); // } } } COM: <s> move the bits in the bit fields </s>
funcom_train/8509129
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void centerAt(float x, float y) { /* * Adjust the bounding box (x,y,w,h) -> (x',y',w',h') as follows: * * x' = x - w * y' = y * w' = 2w * h' = h * */ this.setJustification(javax.swing.JLabel.CENTER_ALIGNMENT); this.setConstrainWidthToTextWidth(false); this.setX(x - this.getWidth()); this.setY(y); this.setWidth(this.getWidth()*2); } COM: <s> center the text at the x y coordinate specified </s>
funcom_train/24933444
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Problem createProblem(MModel model) { //First investigate the size of the LP matrix, by number of variables in the problem Collection<MClass> classes = model.classes(); Collection <MAssociation> associations = model.associations(); int classes_number = classes.size(); int associations_number = associations.size(); //create the problem with a size close to real one Problem problem = new Problem(classes_number + associations_number, classes_number + associations_number); createInequalities(model, problem); return problem; } COM: <s> method for creating the appropriate linear programming problem </s>
funcom_train/49798694
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String checkCountry() { Player playerHit = this.multiUserGame.checkCountry(this.getPlayer(), this.getCountry()); if (playerHit != null) { this.playerHitMessage.setRendered(true); this.multiUserGame.push(); } return null; } COM: <s> check suggested country for a hit in other players country lists </s>
funcom_train/7598130
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Set getEquivalents(ATermAppl c) { TaxonomyNode node = (TaxonomyNode) nodes.get( c ); if( node == null ) throw new RuntimeException( c + " is an unknown class!" ); if( node.isHidden() ) return SetUtils.EMPTY_SET; Set result = new HashSet( node.getEquivalents() ); result.remove( c ); return result; } COM: <s> returns all the classes that are equivalent to class c </s>
funcom_train/13313447
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String findMessage(Document doc) { Iterator i = doc.getDescendants(); while (i.hasNext()) { Object o = i.next(); if (o instanceof Element) { Element e = (Element) o; if (e.getName() == Message.OUTPUT) return e.getValue(); } } return ""; } COM: <s> extract the to print message from the server output </s>
funcom_train/26454864
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetLastUpdate() { // again. Then we ensure that the update time is between our timestamps long before = System.currentTimeMillis(); entry.setContent(CONTENT); long after = System.currentTimeMillis(); assertBetweenOrEquals(before, entry.getLastUpdate(), after); } COM: <s> verify that the last modification time is between the time before and </s>
funcom_train/12156752
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testSeparatorAtEnd() { byte[] array = { 0, 0, 0, 1, 2 }; byte[] separator = { 1, 2 }; byte[][] expectedResults = { { 0, 0, 0 }, { }, }; doTokenizationTest(array, separator, expectedResults); } COM: <s> test for the case where the separator appears at the end of the </s>
funcom_train/41020042
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JPanel getMainContainer() { if (mainContainer == null) { mainContainer = new JPanel(true); mainContainer.setOpaque(false); mainContainer.setBounds(new Rectangle(0, 0, getDlgParams().rect.width - 90, getDlgParams().rect.height - 90)); } return mainContainer; } COM: <s> this method initializes j radio button me </s>
funcom_train/21116647
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void readNotationTextField() { if (currentNotateFiles != null) { if (currentNotateFiles.length > 0) { String key = "pic." + currentNotateFiles[currentNotateThumbnailIndex].getName(); properties.put(key, notateTextArea.getText()); } } } COM: <s> read the annotation in the text field into the properties hashmap </s>
funcom_train/3913565
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public MonitorProperty getMonitorObject(Uol uol, Run run, User user, String propId) throws PropertyException { String key = getKey(uol, propId); MonitorProperty property = (MonitorProperty) fetchFromCache(key); if (property == null) { property = new MonitorProperty(uol, run, user, propId); addToCache(key, property); } return property; } COM: <s> return a monitor property based on the passed parameters </s>
funcom_train/1104216
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addBiricikPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Alan_biricik_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Alan_biricik_feature", "_UI_Alan_type"), HarzemliPackage.eINSTANCE.getAlan_Biricik(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, getString("_UI_validasyonPropertyCategory"), null)); } COM: <s> this adds a property descriptor for the biricik feature </s>
funcom_train/3362846
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void updateUI() { setUI((ToolBarUI)UIManager.getUI(this)); // GTKLookAndFeel installs a different LayoutManager, and sets it // to null after changing the look and feel, so, install the default // if the LayoutManager is null. if (getLayout() == null) { setLayout(new DefaultToolBarLayout(getOrientation())); } invalidate(); } COM: <s> notification from the code uifactory code that the l f has changed </s>
funcom_train/17489221
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Command getPlayCommand() { if (PlayCommand == null) {//GEN-END:|25-getter|0|25-preInit // write pre-init user code here PlayCommand = new Command("Play", "Play", Command.OK, 1);//GEN-LINE:|25-getter|1|25-postInit // write post-init user code here }//GEN-BEGIN:|25-getter|2| return PlayCommand; } COM: <s> returns an initiliazed instance of play command component </s>
funcom_train/18118530
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JTree getTopicTree() { if (topicTree == null) { topicTree = new JTree(); topicTree.setPreferredSize(new Dimension(180, 72)); if(model.getCurrentProject() != null) { topicTree.setModel(new TopicTreeModel(model.getCurrentProject())); } else { topicTree.setModel(new DefaultTreeModel(null)); } } return topicTree; } COM: <s> this method initializes topic tree </s>
funcom_train/9203538
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Vector2 solve(Vector2 b) { // get the determinant double det = this.determinant(); // check for zero determinant if (Math.abs(det) > Epsilon.E) { det = 1.0 / det; } Vector2 r = new Vector2(); r.x = det * (this.m11 * b.x - this.m01 * b.y); r.y = det * (this.m00 * b.y - this.m10 * b.x); return r; } COM: <s> solves the system of linear equations </s>
funcom_train/33403625
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void exchangeDeviceInRoutingTable (BluetoothDeviceAddress exchangeEntry, BluetoothDeviceAddress overNode){ this.distanceVector.remove(exchangeEntry.getAddress()); this.nextHop.remove(exchangeEntry.getAddress()); this.routeList.remove(exchangeEntry.getAddress()); this.directNeighbor.remove(exchangeEntry); this.addNewDeviceToRoutingTable(exchangeEntry, overNode); } COM: <s> this method is for update the routing table </s>
funcom_train/38809837
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void test_TCM__OrgJdomDocument_addContent_OrgJdomComment() { Element element = new Element("element"); Comment comment = new Comment("comment"); Comment comment2 = new Comment("comment 2"); Document doc = new Document(element); doc.addContent(comment); doc.addContent(comment2); List content = doc.getContent(); assertEquals("wrong number of comments in List", 3, content.size()); assertEquals("wrong comment", comment, content.get(1)); assertEquals("wrong comment", comment2, content.get(2)); } COM: <s> test the addition of comments to documents </s>
funcom_train/8096744
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testMissingClass() { int i; for (i = FIRST_CLASSTYPE; i <= LAST_CLASSTYPE; i++) { // does the Kernel support this type of class at all? if (!canPredict(i)) continue; // 20% missing checkMissingClass(i, 20, true); // 100% missing if (m_handleMissingClass[i]) checkMissingClass(i, 100, true); } } COM: <s> tests whether the kernel can handle missing class values 20 and </s>
funcom_train/41523755
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String accNewTask(){ List<ProcessDef> auxList = null; loadPossibleUsers(); Command cmd = getCommand(FindAllProcess.class); cmd = runCommand(cmd); auxList = ((FindAllProcess)cmd).getResult(); if(auxList != null) for(ProcessDef process : auxList) processes.add(new SelectItem(process.getCode(), process.getName())); return ActionBeanNames.CREATE_TASK; } COM: <s> prepare creation of a task </s>
funcom_train/14652483
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void createTables(@NotNull final Connection con) throws SQLException { try { final PreparedStatement stmt = con.prepareStatement("CREATE TABLE Server (id INT NOT NULL GENERATED ALWAYS AS IDENTITY, host VARCHAR(64), port INT, protocol VARCHAR(64))"); stmt.execute(); stmt.close(); } catch (final SQLException ignore) { // System.err.println(ignore); } } COM: <s> creates the tables if they dont exist </s>
funcom_train/12776357
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private MutableIntSet findOrCreateSparseSetForClass(IClass klass) { assert klass.getReference() != TypeReference.JavaLangObject; MutableIntSet result = class2InstanceKey.get(klass); if (result == null) { result = IntSetUtil.getDefaultIntSetFactory().make(); class2InstanceKey.put(klass, result); } return result; } COM: <s> keep this method private </s>
funcom_train/17975838
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JavoConfig unmarshallXML(File file) { JAXBContext jaxbContext = null; Unmarshaller unmarshaller = null; JavoConfig rootElement = null; try { jaxbContext = JAXBContext.newInstance( this.getJaxbContext() ); unmarshaller = jaxbContext.createUnmarshaller(); rootElement = (JavoConfig)unmarshaller.unmarshal( file ); } catch ( JAXBException e ) { Logger.getLogger(this.getClass()).fatal( e ); } if ( null == globalConfig ) { globalConfig = rootElement.getGlobalConfig(); } return rootElement; } COM: <s> unmarshalls the given xml file and returns the root element </s>
funcom_train/9924960
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void writeAutogeneratorJob(File wfDir, AutoGeneratorJob job) throws IOException { File genFile = new File(wfDir, job.getJobName() + "/" + "generator.object"); ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(genFile)); out.writeObject(job); out.close(); } COM: <s> write an object file for the autogenerator job </s>
funcom_train/3814570
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void makeVocabulary() { vocabulary = new HashSet<String>(); for (String name : classLM.getVocabulary()) { Set<String> wordsInClass = classMap.getWordsInClass(name); if (wordsInClass == null) { // 'name' not a class vocabulary.add(name); } else { vocabulary.addAll(wordsInClass); } } } COM: <s> converts a vocabulary of the class lm to a word vocabulary </s>
funcom_train/35323408
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private E firstDataItem() { for (Node p = head; p != null; p = succ(p)) { Object item = p.item; if (p.isData) { if (item != null && item != p) return this.<E>cast(item); } else if (item == null) return null; } return null; } COM: <s> returns the item in the first unmatched node with is data or </s>
funcom_train/37638234
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected int firstOfMonth(int month, int year) { int firstDayOfMonth = 0; Calendar c = Calendar.getInstance(); c.set(year, month, 1); c.setFirstDayOfWeek(Calendar.MONDAY); firstDayOfMonth = c.get(Calendar.DAY_OF_WEEK); int offset = firstDayOfMonth - Calendar.MONDAY; if (firstDayOfMonth < Calendar.MONDAY) { offset = 7 + offset; } return offset; } COM: <s> returns the column coord for the first day of the month </s>
funcom_train/10688402
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String toLowerCase(Locale locale) { String result = UCharacter.toLowerCase(locale, this); // Must return self if chars unchanged if (count != result.count) { return result; } for (int i = 0; i < count; ++i) { if (value[offset + i] != result.value[result.offset + i]) { return result; } } return this; } COM: <s> converts the characters in this string to lowercase using the specified </s>
funcom_train/31359254
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String transImportance(int importance){ switch (importance){ case PearlEvent.CRITICAL: return compModel.getResourceString("critical"); case PearlEvent.DEBUG: return compModel.getResourceString("debug"); case PearlEvent.IMPORTANT: return compModel.getResourceString("important"); case PearlEvent.INFORMATION: return compModel.getResourceString("information"); case PearlEvent.NORMAL: return compModel.getResourceString("normal"); default: return "" + importance; } } COM: <s> translates the importance as an int into text </s>
funcom_train/47395743
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addThread(Task command) { if (command.valid) { ++poolSize_; Worker worker = new Worker(command); Thread thread = new Thread(worker); command.setThread(thread); threads_.put(worker, thread); thread.setDaemon(true); thread.start(); } } COM: <s> create and start a thread to handle a new command </s>
funcom_train/44621852
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void deleteMarkersInSelection(ISelection selection, IWorkbenchWindow window, Shell shell) { List<IResource> list = getSelectedResources(selection,window,shell); if (list.isEmpty()) { showMessage(shell,"JML Plugin","Nothing appropriate to delete markers of"); return; } deleteMarkers(list,shell); return; } COM: <s> deletes all jml markers from the items selected right within the ui thread </s>
funcom_train/14233357
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addOnlineList(String title, int realm, int type, String data){ try{ PreparedStatement ps = c.prepareStatement("INSERT INTO lists(title,realm,type,data) VALUES('"+cleanUp(title)+"','"+realm+"','"+type+"','"+cleanUp(data)+"')"); ps.executeUpdate(); } catch (SQLException e){ e.printStackTrace(); } } COM: <s> add an online list to the database </s>
funcom_train/40531330
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void actionPerformed(ActionEvent e){ /* Get the current selected index */ SimpleBuildingVersion b = (SimpleBuildingVersion)destinationRecord.get(destinations.getSelectedIndex()); System.out.println("Point Inside building: " + b); CarPark p = out.getController().resolveToCarPark(b.getName()); RouteRequestMessage message = new RouteRequestMessage(out, p); out.messageRecieved(message); } COM: <s> this is called when the go here button is pressed </s>
funcom_train/47019992
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Command getCmdCancel() { if (cmdCancel == null) {//GEN-END:|53-getter|0|53-preInit // write pre-init user code here cmdCancel = new Command(getLocalizedString("Cancel"), Command.CANCEL, 1);//GEN-LINE:|53-getter|1|53-postInit // write post-init user code here }//GEN-BEGIN:|53-getter|2| return cmdCancel; } COM: <s> returns an initiliazed instance of cmd cancel component </s>
funcom_train/2770740
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean performCancel() { try { if (getBreakpoint().getMarker().getAttribute(ATTR_DELETE_ON_CANCEL) != null) { // if this breakpoint is being created, delete on cancel getBreakpoint().delete(); } } catch (CoreException e) { // JDIDebugUIPlugin.statusDialog(PropertyPageMessages.JavaBreakpointPage_9, e.getStatus()); } return super.performCancel(); } COM: <s> check to see if the breakpoint should be deleted </s>