__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/923030
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String replaceFileName(String originalName) { char eachChar; int asciiValue; StringBuffer newFileName = new StringBuffer(); for (int i = 0; i < originalName.length(); i++) { eachChar = originalName.charAt(i); asciiValue = (int) eachChar; newFileName.append(Integer.toHexString(asciiValue)); } newFileName.append("__"); newFileName.append(originalName); return newFileName.toString(); } COM: <s> because windows os doesnt differentiate letter case in file name each of </s>
funcom_train/4094925
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addTypifyPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_IncrementEconomicEventType_typify_feature"), getString("_UI_PropertyDescriptor_description", "_UI_IncrementEconomicEventType_typify_feature", "_UI_IncrementEconomicEventType_type"), ReamodelPackage.Literals.INCREMENT_ECONOMIC_EVENT_TYPE__TYPIFY, true, false, true, null, null, null)); } COM: <s> this adds a property descriptor for the typify feature </s>
funcom_train/41116872
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Result visit(final Object o) { // TODO your job // Check the object for null. // Make sure to visit each object only once in-depth. // Don't visit the visitor itself, in case this happens. // If the object is an array, visit each array element // recursively using the root visitor. // Otherwise, visit all declared non-static fields // recursively using the root visitor, then check superclass. return handler.onNull(); } COM: <s> performs a depth first traversal of the object graph </s>
funcom_train/9813089
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void destroyXlet(boolean unconditional) throws XletStateChangeException { /* The run() method will stop executing now. */ partyOn = false; /* Release the HScene we are using. */ HSceneFactory.getInstance().dispose(myHScene); /* We may have been loaded but not init'd, so check whether we * have an XletContext object. */ if (xletContext != null) { xletContext.notifyDestroyed(); } } COM: <s> this method gets called when we are to stop executing </s>
funcom_train/13995972
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testUnsubscribeDelete() { eventBroker.unsubscribeDelete(getMockKey(IDS[0], TYPES[0]), deleteSubscribers[1]); eventBroker.publishDelete(getMockKey(IDS[0], TYPES[0])); assertNotification(true, deleteSubscribers[0]); assertNotification(false, deleteSubscribers[1]); assertNotification(false, deleteSubscribers[2]); assertNotification(false, deleteSubscribers[3]); } COM: <s> tests unsubscribe mechanism for delete subscribers </s>
funcom_train/19062110
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void actionPerformed(ActionEvent evt) { // get selected stuff IMailFolderCommandReference r = ((MailFrameMediator) getFrameMediator()) .getTableSelection(); // get active charset - necessary to decode msg for saving Charset charset = ((CharsetOwnerInterface) getFrameMediator()) .getCharset(); SaveMessageBodyAsCommand c = new SaveMessageBodyAsCommand(r, charset); CommandProcessor.getInstance().addOp(c); } COM: <s> called for activation of the save message body as action </s>
funcom_train/11658703
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void trimStartWhitespace() { int index = 0; for ( int length = text.length(); index < length; index++ ) { char ch = text.charAt(index); if (!Character.isWhitespace(ch)) { break; } } if ( index > 0 ) { this.text = text.substring(index); } } COM: <s> trims whitespace from the start of the text </s>
funcom_train/25914126
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference){ String title = (String) preference.getTitle(); if(title.equals(getString(R.string.setting_clearhistory))){ clearSearchHistory(); return true; } else if(title.equals(getString(R.string.setting_about))){ showDialog(R.id.AboutDlg); return true; } return false; } COM: <s> on preference tree click handler </s>
funcom_train/36982341
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int indexOf(byte[] opcodes, int fromIndex) { for (int i = fromIndex; i < instructions.size(); i++) { Instruction ins = instructions.get(i); short opCode = ins.getOpcode(); for (int j = 0; j < opcodes.length; j++) { if (opcodes[j] == opCode) { return i; } } } return -1; } COM: <s> scans this instruction list for opcodes </s>
funcom_train/376230
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void setSize(int size) { if (!owner) { throw new IllegalAccessError( "object not owner of the memory block. Can not change size," + " must use peer() to change rereference properties"); } if (size < 0 || size > physicalSize) { throw new IllegalArgumentException( "size is out of bounds (physical size=" + physicalSize + ", requested size=" + size); } this.size = size; } COM: <s> changes the size of this memory block </s>
funcom_train/7821481
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected String createList(String[] items){ StringBuffer sb = new StringBuffer(); for (int i = 0; i < items.length; i++) { if(i>0){ sb.append(File.pathSeparatorChar); } sb.append(items[i]); } return sb.toString(); } COM: <s> combines the given list of items into a single string </s>
funcom_train/15569250
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void registerObjectListener(int _index, ObjectListener _lis) throws NException{ if (type.getObjectNameList()[_index]==null) throw new DataModelException(DataModelException.VALUE_NOT_DEFINED,getClass(),"registerObjectListener",storage); HashSet _listeners; Object _o = objectListener.get(_index); if (_o==null) { _listeners=new HashSet(); objectListener.put(_index,_listeners); } else _listeners = (HashSet)_o; _listeners.add(_lis); } COM: <s> code register object listener code registers a new object listener </s>
funcom_train/33294725
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object scan(String str, FormatPosition pos) { Object resultObj = null; switch (m_parameterType) { case TYPE_SHORT: resultObj = new Short((short) pos.getIndex()); break; case TYPE_INTEGER: resultObj = new Integer(pos.getIndex()); break; case TYPE_LONG: resultObj = new Long((long) pos.getIndex()); break; } if (m_scanSuppress) { return null; } return resultObj; } COM: <s> method doesnt read any character or change the state </s>
funcom_train/51617111
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int getSelectedPossValue( Object value ) { //get the permitted values AbstractList permittedValues = d.getBinding().getValue(); //there are restrictions: ensure the value is valid int indexOn = 0; for( Object permittedValue : permittedValues ) { if( value.equals( permittedValue ) ) return indexOn; indexOn += 1; } //not found return -1; } COM: <s> gets the index of the possible value which is selected </s>
funcom_train/40679162
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void connect(final PREROLL_HANDOFF listener) { connect(PREROLL_HANDOFF.class, listener, new GstAPI.GstCallback() { @SuppressWarnings("unused") public void callback(BaseSink sink, Buffer buffer, Pad pad) { listener.prerollHandoff(sink, buffer, pad); } }); } COM: <s> add a listener for the code preroll handoff code signal </s>
funcom_train/2324717
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: static public double i0e(double x) throws ArithmeticException { double y; if (x < 0) x = -x; if (x <= 8.0) { y = (x / 2.0) - 2.0; return (DoubleArithmetic.chbevl(y, A_i0, 30)); } return (DoubleArithmetic.chbevl(32.0 / x - 2.0, B_i0, 25) / Math.sqrt(x)); } COM: <s> returns the exponentially scaled modified bessel function of order 0 of </s>
funcom_train/41327319
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testAdd() { double alpha = Math.random(); for (MatrixEntry e : A) { A.add(e.row(), e.column(), alpha); A.add(e.row(), e.column(), -alpha); } assertEquals(Ad, A); } COM: <s> test additions using iterators </s>
funcom_train/11644838
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testSubstitutetDefaultProperties(){ String org = "${doesnotwork}"; System.setProperty("doesnotwork", "It work's!"); // create a new Properties object with the System.getProperties as default Properties props = new Properties(System.getProperties()); assertEquals("It work's!",StrSubstitutor.replace(org, props)); } COM: <s> test the replace of a properties object </s>
funcom_train/42519892
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Player getWeightedRandom(double total, HashMap<Player, Double> weightedPlayers) { double reboundIndex = rnd.nextDouble() * total; double checkedWeight = 0; for (Player player:weightedPlayers.keySet()) { checkedWeight += weightedPlayers.get(player); if (reboundIndex <= checkedWeight) { return player; } } return null; } COM: <s> calculate the weighted random of a number of players </s>
funcom_train/4300828
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object get(int index) { if (index >= elementCount) { throw new IndexOutOfBoundsException("Index out of bounds: " + index + " >= " + elementCount); } if (index < 0) { throw new IndexOutOfBoundsException("Index out of bounds: " + index + " < 0"); } return elementData[index]; } COM: <s> gets the element at given position </s>
funcom_train/10687893
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean setLastModified(long time) { if (time < 0) { throw new IllegalArgumentException(Messages.getString("luni.B2")); //$NON-NLS-1$ } SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkWrite(path); } return (setLastModifiedImpl(properPath(true), time)); } COM: <s> sets the time this file was last modified measured in milliseconds since </s>
funcom_train/28340556
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void setColors(int deleteIndex){ for(int i = 0, n = measuredValuesV.size(); i < n; i++){ MeasuredValue mv_tmp = (MeasuredValue) measuredValuesV.get(i); mv_tmp.setColor(IncrementalColor.getColor(i)); } graphScan.refreshGraphJPanel(); } COM: <s> set colors of raw data scans </s>
funcom_train/6457280
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public View create(Element elem) { Object o = elem.getAttributes().getAttribute(StyleConstants.NameAttribute); if (o instanceof HTML.Tag) { HTML.Tag kind = (HTML.Tag) o; if (kind == HTML.Tag.IMG) { URL url; if ((url = getSourceURL(elem)) != null) { SwingForumApplet.this.showImage(url); } return (new ObjectView(elem)); } } return (mHtmlfact.create(elem)); } COM: <s> creates a view from an element </s>
funcom_train/8901477
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public double falsePositiveRate(int positiveClass) { double incorrect = 0, total = 0; for (int i = 0; i < numClasses; i++) { if (i != positiveClass) { for (int j = 0; j < numClasses; j++) { if (j == positiveClass) { incorrect += confusionMatrix[i][j]; } total += confusionMatrix[i][j]; } } } if (total == 0) { return 0; } return incorrect / total; } COM: <s> calculate the false positive rate with respect to a particular class </s>
funcom_train/24461365
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean destroyNode(){ unsetParents(); if(childPEs.size() == 0){ for(Buffer b: buffers) { b.getViewSubscriber().stopRunning(); b.deleteObservers(); } buffers = null; parentPEs = null; childPEs = null; view = null; if(trigger != null) { trigger.cancel(); trigger = null; } return true; } else { logger.log(Level.INFO, "Cannot destroy node because it still has children! Use destroyTree() to stop the whole subtree."); return false; } } COM: <s> destroys this node </s>
funcom_train/24926956
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void isKilledCommand(String uuid, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { RemoteClient client = getRemoteClientManager(request).getRemoteClient(uuid); response.setContentType("text/html"); if (client != null && client.isKilled()) { response.getWriter().print("1"); } else { response.getWriter().print("0"); } } COM: <s> produces a text response with a 1 if the manager is killed </s>
funcom_train/23853423
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JPanel getButtonPanel() { JButton profileOK = new JButton(okAction); JButton profileCancel = new JButton(cancelAction); getRootPane().setDefaultButton(profileOK); JPanel buttonPanel = ButtonBarFactory.buildOKCancelBar(profileOK, profileCancel); buttonPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); return buttonPanel; } COM: <s> creates the panel that holds the buttons </s>
funcom_train/24120847
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void write(OutputStream out) throws IOException { int size = this.getSize(); WMFConstants.writeLittleEndian(out, size); WMFConstants.writeLittleEndian(out, WMFConstants.WMF_RECORD_OFFSETWINDOWORG); WMFConstants.writeLittleEndian(out, this.yOffset); WMFConstants.writeLittleEndian(out, this.xOffset); } COM: <s> writes the content of the offset window org record to a stream </s>
funcom_train/5722272
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String resendActivationCode() { try { UserInfo user = securityService.getUserByName(username); if (user == null) { addError("User does not exist"); return Constants.FAILURE; } String activationCode = registrationService.generateActivationCode(user); sendVerificationEmail(user, activationCode); return MessageBox.showDefaultMessage(i18n("user_email_verification_resend_message"), i18n("user_email_verification_resend_message_title")); } catch (RegistrationException e) { logger.error(e); // TODO should be localized addError("Error: Couldn't send activation code", e.getMessage()); return Constants.FAILURE; } } COM: <s> resends a new activation code to the user </s>
funcom_train/14227583
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void callActive(final CallId id, final int cause) { // define action block EventHandler eh = new EventHandler() { public void process(Object o) { // Fetch or create the call FreeCall call = ((GenericProvider)o).getCallMgr().getLazyCall(id); // Update the call state call.toActive(cause); } }; // dispatch for processing this.getEventPool().put(eh); } COM: <s> receive and queue up a call active notification event </s>
funcom_train/16082461
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setStatus(int statusCode) { if (statusCode != OFFLINE && statusCode != CONNECTING && statusCode != AVAILABLE && statusCode != AWAY && statusCode != INVISIBLE) { throw new IllegalArgumentException( "Invalid status code: " + statusCode); } setStatus(statusCode, STATUS_MESSAGES[statusCode]); } COM: <s> sets the status code </s>
funcom_train/10977719
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getOnreset() { if (this.onreset != null) { return (this.onreset); } ValueBinding vb = getValueBinding("onreset"); if (vb != null) { return ((String) vb.getValue(getFacesContext())); } else { return (null); } } COM: <s> p return the java script to execute on form reset </s>
funcom_train/19617690
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private MeandreServerProxy findExecutingServer(Job job) { workersLock.lock(); try { for (MeandreServerProxy server : workers) { if (job.getHost().equals( server.getConfig().getHost()) && job.getPort().equals( server.getConfig().getPort())) { return server; } } } finally { workersLock.unlock(); } return null; } COM: <s> find the server that is executing the given </s>
funcom_train/8688523
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getFileTimeStamp() { if (timestamp == null) { return ""; } else if (timestamp.getValue().equals(TIME_MODIFIED)) { return FLAG_FILETIME_MODIFIED; } else if (timestamp.getValue().equals(TIME_UPDATED)) { return FLAG_FILETIME_UPDATED; } else { return FLAG_FILETIME_DEF; } } COM: <s> gets the value set for the file time stamp </s>
funcom_train/22233668
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setEnable(boolean state) { if (isLiveOrCompiled()) if(!this.getCapability(ALLOW_ENABLE_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Sound10")); if (this instanceof BackgroundSound) ((SoundRetained)this.retained).setEnable(state); else // instanceof PointSound or ConeSound ((PointSoundRetained)this.retained).setEnable(state); } COM: <s> enable or disable sound </s>
funcom_train/37421670
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addFacet(String facetName, Vector value, boolean fixed) throws PmtException { if (msInterpretAttr) { msAttrToAdd.addFacet(facetName, value, fixed); } else { msMdToAdd.addFacet(facetName, value, fixed); } COM: <s> method add facet </s>
funcom_train/32158785
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ByteBuffer readSingleByteBufferByLength(int length) throws IOException, BufferUnderflowException { if (length <= 0) { if (length == 0) { return ByteBuffer.allocate(0); } else { throw new IllegalArgumentException("length has to be positive"); } } int savedLimit = data.limit(); int savedPosition = data.position(); data.limit(data.position() + length); ByteBuffer sliced = data.slice(); data.position(savedPosition + length); data.limit(savedLimit); return sliced; } COM: <s> read a byte buffer by using a length defintion </s>
funcom_train/722
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: static private boolean isOutsideClip(int x, int y, int xlen, int ylen, Rectangle clip) { // Non-existing rectangle stands for the complete plane => nothing is outside of the complete plane. // We are "outside" of "clip", if we do not intersect with it. return clip != null && ! clip.intersects(x, y, xlen, ylen); } COM: <s> computes and returns whether the rectangle given by the left upper corner </s>
funcom_train/32239035
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected MJButton getNewCustomerButton() { if (newCustomerButton == null) { newCustomerButton = new MJButton(); newCustomerButton.setText("Add"); newCustomerButton.setMnemonic(KeyEvent.VK_A); newCustomerButton.setToolTipText("Opens New Customer window"); newCustomerButton.setPreferredSize(new Dimension(100, 26)); } return newCustomerButton; } COM: <s> this method initializes button add customer </s>
funcom_train/31026099
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void saveBlockedList() { int size = listModel.size(); StringBuffer sb = new StringBuffer(); for(int i=0; i<size;i++) { String s = (String) listModel.elementAt(i); sb.append(s).append('\n'); } CallBlocker.prefs.put("blockList", sb.toString()); } COM: <s> saves the list to the prefs </s>
funcom_train/50923337
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setDirFilter(String dirFilterS) { if (dirFilterS == null) { throw new RuntimeException("null directory filter"); } if (dirFilterS.length() > 0 ) { LOG.info("Assuming wildcard directory filter " + dirFilterS ); dirFilter = new WildcardFileFilter(dirFilterS) ; this.setDirFilter(dirFilter) ; } } COM: <s> sets the directory filter based on the wild card string for the individual </s>
funcom_train/7607575
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setMass(float m) { mass = m; if (mass < INFINITE_MASS) { invMass = 1.0f / mass; //I = mass * (size.x * size.x + size.y * size.y) / 12.0f; I = (mass * shape.getSurfaceFactor()) / 12.0f; invI = 1.0f / I; } else { invMass = 0.0f; I = INFINITE_MASS; invI = 0.0f; } } COM: <s> set the mass of the body </s>
funcom_train/7720081
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testPreparedStatementExecute1() throws Exception { java.sql.PreparedStatement stmt = con.prepareStatement("INSERT INTO foo ('a', 'b') VALUES ('?', '?');"); stmt.setInt(1, 12345); stmt.setInt(2, 67890); try { stmt.execute(); } catch (SQLException e) { return; } } COM: <s> construct a prepared statement populate one of the two fields and try </s>
funcom_train/3526803
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setWorkspaceProperty( String rUri, NodeRevisionDescriptor rNrd ) { UriHandler rUh = UriHandler.getUriHandler( rUri ); String wsUri = rUh.getAssociatedWorkspaceUri(); if( wsUri != null ) { rNrd.setProperty( new NodeProperty(P_WORKSPACE, pHelp.createHrefValue(wsUri)) ); } else { rNrd.removeProperty(P_WORKSPACE); } } COM: <s> set the workspace property if needed </s>
funcom_train/32631252
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private List getList(final Object object) throws MappingException { Class[] parameterTypes = {}; try { Method method = object.getClass().getMethod(mGetName, parameterTypes); Object[] args = {}; return (List) method.invoke(object, args); } catch (Exception e) { throw new MappingException("Cannot get list attribute " + mAttributeName, e); } } COM: <s> returns the list attribute defined by the getter method as defined in the </s>
funcom_train/44838992
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void close(java.sql.ResultSet rs) { try { if (null != rs) rs.close(); } catch (SQLException sx) { LogFactory.getLog(JdbcDomain.class).error("Failure to close JDBC RecordSet.",sx); sx.printStackTrace(); } } COM: <s> utility method to better encapsulate close logic error handeling </s>
funcom_train/45554588
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void removeFromView() { if (!isInView()) return; synchronized( viewLock ) { Vector<GVObject> lp = getLoosePieces(); for(GVObject p : lp){ p.removeFromView(); //note how this should recursively remove everyone. } getView().remove(this); } gridView = null; } COM: <s> hook called to remove this from a world </s>
funcom_train/50346756
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: static public void addDefaultInfo(Element root) { String content = "Written by JMRI version "+jmri.Version.name() +" on "+(new java.util.Date()).toString() +" $Id: XmlFile.java 18985 2011-10-31 05:24:36Z rhwood $"; Comment comment = new Comment(content); root.addContent(comment); } COM: <s> add default information to the xml before writing it out </s>
funcom_train/21954179
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void itemStateChanged(java.awt.event.ItemEvent e) { String selectedString = (String)(manager.getLabelToPropertyMap().get(searchFieldCombo.getSelectedItem())); String selectedType = Pooka.getProperty(selectedString + ".type", ""); layout.show(selectionPanel, selectedType); } COM: <s> this handles the switch of the selection panel when the search field combo </s>
funcom_train/29018598
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setRectangles (Rectangle [] rectangles) { checkWidget (); if (rectangles == null) error (SWT.ERROR_NULL_ARGUMENT); this.rectangles = new Rectangle [rectangles.length]; for (int i = 0; i < rectangles.length; i++) { Rectangle current = rectangles [i]; if (current == null) error (SWT.ERROR_NULL_ARGUMENT); this.rectangles [i] = new Rectangle (current.x, current.y, current.width, current.height); } proportions = computeProportions (rectangles); } COM: <s> specifies the rectangles that should be drawn expressed relative to the parent </s>
funcom_train/9990128
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object apply(Context context, Object arg) { Object result = null; if (arg == null) { throw new NullArgument("Null argument to sqrt()"); } if (arg instanceof Number) { result = new Double(Math.sqrt(((Number) arg).doubleValue())); } else { throw new TypeError("Wrong argument type to sqrt()"); } return result; } COM: <s> returns the positive square root of the argument </s>
funcom_train/40852358
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getMaxIndex() { int index = 0; double value = java.lang.Double.NEGATIVE_INFINITY; for(int i = 0;i<this.size();i++){ if(get(i).doubleValue()>value){ index = i; value = get(i).doubleValue(); } } return index; } COM: <s> return index of maximal value of list </s>
funcom_train/44286546
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void diffMax(Duration o1, Duration o2, int hoursPerDay) { diff(o1, o2, hoursPerDay); if (duration < 0) { duration = o1.duration; durationType = o1.durationType; } else { duration = o2.duration; durationType = o2.durationType; } normalize(hoursPerDay); } COM: <s> calculates the maximum between 2 durations </s>
funcom_train/42709486
/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:|16-getter|0|16-preInit // write pre-init user code here stringItem = new StringItem("Bienvenido", "Elija un modo de entrenamiento", Item.PLAIN);//GEN-LINE:|16-getter|1|16-postInit // write post-init user code here }//GEN-BEGIN:|16-getter|2| return stringItem; } COM: <s> returns an initiliazed instance of string item component </s>
funcom_train/37608916
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getHighPhase() { String tst1 = phxlt.get(0); String tst2 = ""; for (int kkk = 1; kkk < phxlt.size(); kkk++ ) { tst2 = phxlt.get(kkk); if (tst1.length() == tst2.length()) tst1 = (tst1.compareTo(tst2) > 0) ? tst1 : tst2 ; else if (tst1.length() < tst2.length()) tst1 = tst2; // shorter is less } return tst1; } COM: <s> gets the highest phase string </s>
funcom_train/9449436
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void put(String name, char value) throws IllegalArgumentException { ObjectSlot slot = findSlot(name, Character.TYPE); if (slot == null) { throw new IllegalArgumentException("no char field '" + name + "'"); } slot.fieldValue = Character.valueOf(value); slot.defaulted = false; // No longer default value } COM: <s> find and set the char value of a given field named </s>
funcom_train/550197
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void reorderColumns() { if (columnNames == null) return; for (int i = 0; i < columnNames.size(); i++) { String name = (String) columnNames.get(i); int index = getIndex(name, -1); if (index == -1) { removeColumn(name); } else { addColumn(name); } } publishColumnChange(); } COM: <s> reorders columns in the order of the list of visible columns </s>
funcom_train/21461482
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private EntityUser makeFakeUser(String userId, String eid) { if (eid == null) { eid = userId; } EntityUser eu = new EntityUser(eid, eid+"@dev.null", "First Last-"+userId, eid, null, "fake"); eu.setId(userId); return eu; } COM: <s> creates a fake user based on the user id </s>
funcom_train/825240
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void modifyShapeAppearance(){ Enumeration en = ogre.getShapeBG().getAllChildren(); while (en.hasMoreElements()){ Object oShp = en.nextElement(); if (oShp instanceof Shape3D){ Shape3D shp = (Shape3D) oShp; shp.getAppearance().getTextureAttributes().setTextureMode(TextureAttributes.MODULATE); } } } COM: <s> force the texture mode to modulate so lighting works </s>
funcom_train/17771423
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Cache getWptCache() { if (wpt.getCache()==null || wpt.getCache().size()==0) { return null; } //TODO figure out how to make the jxb make this the right Generic Cache cache=(Cache)((List<Object>)wpt.getCache()).get(0); if (cache==null) { return null; } return cache; } COM: <s> get cache associated with this waypoint </s>
funcom_train/12844106
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void loadLastSavedPreferences() { String templateName = Activator.getDefault().getPreferenceStore().getString(""); if ((templateName == null) || (templateName.length() == 0)) { fLastSelectedTemplateName = ""; //$NON-NLS-1$ fUseTemplateButton.setSelection(false); } else { fLastSelectedTemplateName = templateName; fUseTemplateButton.setSelection(true); } enableTemplates(); } COM: <s> load the last template name used in new xml file wizard </s>
funcom_train/32234187
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void setFocus() { if (clientText.isEnabled() && clientText.getText().equals("")) { //$NON-NLS-1$ clientText.setFocus(); } else if (userText.isEnabled() && userText.getText().equals("")) { //$NON-NLS-1$ userText.setFocus(); } else { passwordText.setFocus(); } } COM: <s> sets the focus to the first element that requires input </s>
funcom_train/51827138
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getChoiceIndex(int index, int value) { IConfigurationElement option[] = options.getChildren(); IConfigurationElement choices[] = option[index].getChildren("choices"); IConfigurationElement choice[] = choices[0].getChildren(); int l0 = 0; while ((l0 < choice.length) && (Integer.parseInt(choice[l0].getAttribute("value")) != value)) { l0++; } if (l0 < choice.length) { return l0; } else { return -1; } } COM: <s> gets the index of a combobox entry for a given value </s>
funcom_train/38320530
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void createRSSItem(String title, String text, String link, Project project, List affectedObjects) { RSSItemCreatedEvent event = new RSSItemCreatedEvent(title); event.setCreateDate(new Date()); event.setItemText(text); event.setLink(link); event.setProject(project); event.setOrigin(getRSSOrigin()); event.setCreator(getModuleDisplayName()); event.setAffectedObjects(affectedObjects); publishEvent(event); } COM: <s> create an rss item originating from this module </s>
funcom_train/44396981
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected String getSelectFieldsString(Metadata metadata) { Field[] fields = metadata.getLoadableFields(); StringBuffer res = new StringBuffer(); for (int i = 0; i < fields.length; i++) { res.append(fields[i].getName()); if (i < (fields.length - 1)) { res.append(','); } } return res.toString(); } COM: <s> makes the select fields string as a comma separated list </s>
funcom_train/50446458
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void forwardToken(Token token) { if (!token.getContext().equals(lastTokenContext)) { classifiers = pr.getTokenProcessors(token.getContext()); lastTokenContext = token.getContext(); } if (classifiers != null) { for (int i = 0; i < classifiers.length; ++i) { classifiers[i].processToken(token); } } } COM: <s> forwards the specified token to all appropriate plugins </s>
funcom_train/14372686
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void startTimer() { if (this.updateTimer == null) this.updateTimer = new Timer("UpdateTimer"); else { this.updateTimer.cancel(); this.updateTimer = new Timer("UpdateTimer"); } final TimerTask task = new DataTimerTask(); this.updateTimer.schedule(task, getRefreshRate() * 1000, getRefreshRate() * 1000); Util.dprint("Scheduled timer!"); } COM: <s> starts the timer object running </s>
funcom_train/26454866
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testNeedsRefresh() { // Set the entry content so it shouldn't need refresh // Invoke needsRefresh with no delay, so it should return true. // Then invoke it with a big delay, so it should return false assertTrue(entry.needsRefresh(REFRESH_NEEDED)); assertTrue(!entry.needsRefresh(NO_REFRESH_NEEDED)); } COM: <s> verify that the freshness detection function properly </s>
funcom_train/42110800
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void normaliseArgs() { Map<String, String> replacements = new HashMap<String, String>(); int i = 0; for (String arg : fact_.getArguments()) { if (!replacements.containsKey(arg)) replacements.put(arg, StateSpec.createGoalTerm(i++)); } fact_.replaceArguments(replacements, false, false); } COM: <s> shifts the variables of the goal condition fact arguments such that they </s>
funcom_train/11673633
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void fireSocketClosedEvent(final Exception listenerException) { synchronized (listenerList) { for (Iterator iter = listenerList.iterator(); iter.hasNext();) { SocketNodeEventListener snel = (SocketNodeEventListener) iter.next(); if (snel != null) { snel.socketClosedEvent(listenerException); } } } } COM: <s> notifies all registered listeners regarding the closing of the socket </s>
funcom_train/21619998
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetEmpLoginDate() { System.out.println("getEmpLoginDate"); Session instance = Session.getInstance(); Date expResult = null; Date result = instance.getEmpLoginDate(); 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 emp login date method of class edu </s>
funcom_train/13803021
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean lessThan(MetricValue otherMetric) { int i = 0; boolean compare = true; double[] otherMetricValue = (double[]) otherMetric.getValue(); while (compare && (i < dimension) ) { compare = (value[i] == otherMetricValue[i]); i++; } return (value[i] < otherMetricValue[i]); } COM: <s> compares to vector of doubles lexicographically </s>
funcom_train/15931526
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean resumeAllSpares() { WaitQueueNode q; while ( (q = spareStack) != null) { if (casSpareStack(q, null)) { do { updateRunningCount(1); q.signal(); } while ((q = q.next) != null); return true; } } return false; } COM: <s> pop and resume all spare threads </s>
funcom_train/23278792
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addIspfFund(Ispf ispf, IspfOtherFunding ispfFund){ if(!validateClass(ispf)) throw new ARISException("Invalid ISPF"); if(!validateClass(ispfFund)) throw new ARISException("Invalid ISPF"); getHibernateTemplate().save(ispfFund); getHibernateTemplate().update(ispf); } COM: <s> adds the other fund to the database and updates the ispf </s>
funcom_train/43472784
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void parseEntityGroups(String pstrPattern) { digester.addObjectCreate(pstrPattern, ArrayList.class); digester.addObjectCreate(pstrPattern + "/entitygroup", Tuple.class); digester.addBeanPropertySetter(pstrPattern + "/entitygroup/entity", "name"); digester.addBeanPropertySetter(pstrPattern + "/entitygroup/group", "value"); digester.addSetNext(pstrPattern + "/entitygroup", "add"); } COM: <s> same as parse tags </s>
funcom_train/36060417
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void validateMetaDataForClass(AbstractClassMetaData acmd, ClassLoaderResolver clr) { // Only validate each meta data once if (validatedClasses.add(acmd.getFullClassName())) { new MetaDataValidator(acmd, getMetaDataManager(), clr).validate(); } } COM: <s> perform appengine specific validation on the provided meta data </s>
funcom_train/37775891
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addImage(String key, byte[] imageContents, String mimeType) { if (m_imageContents == null) m_imageContents = new HashMap(); Object[] image = new Object[] {imageContents, mimeType}; m_imageContents.put(key, image); } COM: <s> adds the image and its mime type to the user session </s>
funcom_train/41662043
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void renumber() { this.map=new HashMap<Integer,LinkedChar>(); int position=0; LinkedChar currentChar=this.list; while (currentChar.hasMoreChars()) { currentChar.position=position; map.put(new Integer(position),currentChar); currentChar=currentChar.getNext(); position+=1; } currentChar.position=position; map.put(new Integer(currentChar.position),currentChar); } COM: <s> re number all elements starting at 0 </s>
funcom_train/42359344
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void logoutUser() { NotificationFactory.glassDarken(this); userManager.addUserManagerListener(new IUserManagerListener() { @Override public void userChanged(ScadUser newUser) { } @Override public void userPersistationDone() { userManager.removeUserManagerListener(this); userManager.showLogin(ScadMain.this); NotificationFactory.removeGlass(ScadMain.this); } @Override public void logout() { } }); try { userManager.logout(); } catch (CommandException e) { e.printStackTrace(); } } COM: <s> shows login dialog </s>
funcom_train/18743867
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void updateCleared() { if (this.holder != null) { synchronized (this.holder) { if (this.holder.getCacheReference() == this) { this.holder.setCacheReference(getNullInstance(this.strong, this.incarnation)); cacheClearCount++; } } } } COM: <s> callback method that sets the reference in the holder to the appropriate </s>
funcom_train/42068117
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addNumberOfChannelsPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ChunkFormat_numberOfChannels_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ChunkFormat_numberOfChannels_feature", "_UI_ChunkFormat_type"), WavPackage.Literals.CHUNK_FORMAT__NUMBER_OF_CHANNELS, false, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the number of channels feature </s>
funcom_train/40487364
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: @Override public boolean equals(@Nullable Object object) { if (object instanceof Multiset.Entry) { Multiset.Entry<?> that = (Multiset.Entry<?>) object; return this.getCount() == that.getCount() && Objects.equal(this.getElement(), that.getElement()); } return false; } COM: <s> indicates whether an object equals this entry following the behavior </s>
funcom_train/12665346
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void notify(Throwable e) { if (e instanceof GwtSessionExpiredException) { GlobalEventRegistry.fireEvent(Events.ON_ERROR_SESSION_EXPIRED, this, e.getLocalizedMessage()); } else if (e instanceof GwtSecurityException) { GlobalEventRegistry.fireEvent(Events.ON_SECURITY_WARNING, this, e.getLocalizedMessage()); } else if(false){}// ...more exceptions } COM: <s> notify listeners of exception handler </s>
funcom_train/24231308
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void setOkButton(Partner partner, String host, String portStr, String partnerName, String oftpId) { int port = -1; try { port = Integer.valueOf(port).intValue(); } catch (Exception e) { //nop } this.setOkButton(partner, host, port, partnerName, oftpId); } COM: <s> sets the ok button depending on the partner settings </s>
funcom_train/8690650
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected boolean scanDir(File srcDir, String[] files) { SourceFileScanner sfs = new SourceFileScanner(this); FileNameMapper mapper = getMapper(); File dir = srcDir; if (mapperElement == null) { dir = null; } return sfs.restrict(files, srcDir, dir, mapper).length == 0; } COM: <s> scan a directory for files to check for up to date ness </s>
funcom_train/26228161
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void genCastTo(CNumericType dest, GenerationContext context) { CodeSequence code = context.getCodeSequence(); if (dest != this) { switch (dest.type) { case TID_BYTE: code.plantNoArgInstruction(opc_i2b); break; case TID_CHAR: code.plantNoArgInstruction(opc_i2c); break; case TID_SHORT: code.plantNoArgInstruction(opc_i2s); break; case TID_LONG: code.plantNoArgInstruction(opc_i2l); break; case TID_FLOAT: code.plantNoArgInstruction(opc_i2f); break; case TID_DOUBLE: code.plantNoArgInstruction(opc_i2d); break; default: throw new InconsistencyException(); } } } COM: <s> generates a bytecode sequence to convert a value of this type to the </s>
funcom_train/15927279
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String formatArgs(List<LocalDef> args) { StringBuilder result = new StringBuilder(); result.append("("); int idx = 0; for (LocalDef argDef: args) { String typeAndName = argDef.type() + " " + argDef.name(); typeAndName = removeJavaLang(typeAndName); if (idx++ > 0) { result.append(", "); } result.append(typeAndName); } result.append(")"); return result.toString(); } COM: <s> given a list of string args format them with commas between </s>
funcom_train/46937751
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JMenuBar getjMenuBar() { if (jMenuBar == null) { jMenuBar = new JMenuBar(); jMenuBar.setPreferredSize(new Dimension(0, 25)); jMenuBar.add(getJMenuFile()); jMenuBar.add(getJMenuExport()); jMenuBar.add(getJMenuDomainOntologies()); jMenuBar.add(getJMenuTools()); jMenuBar.add(getJMenuOptions()); jMenuBar.add(getJMenuHelp()); } return jMenuBar; } COM: <s> this method initializes j menu bar </s>
funcom_train/20439846
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addInterfacePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_SequentialSchedule_interface_feature"), getString("_UI_PropertyDescriptor_description", "_UI_SequentialSchedule_interface_feature", "_UI_SequentialSchedule_type"), CM3Package.Literals.SEQUENTIAL_SCHEDULE__INTERFACE, true, false, true, null, null, null)); } COM: <s> this adds a property descriptor for the interface feature </s>
funcom_train/22930066
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public VBindingDomain extendBindingDomain(VBinding binding, VBindingDomain domain) { EnabledRuleExtension existingEnabledExt = domain.getExtension(EnabledRuleExtension.class); if (existingEnabledExt != null) { VBindingDomain copy = new VBindingDomain(domain); EnabledRuleExtension modifiedEnabledExt = new EnabledRuleExtension( new CompoundEnabledCallback(existingEnabledExt.enabledCallback, globalEnabledCallback)); copy.replaceExtension(existingEnabledExt, modifiedEnabledExt); return copy; } return new VBindingDomain(domain, new EnabledRuleExtension(globalEnabledCallback)); } COM: <s> implementation installs or extens existing instances of enabled rule extension with the </s>
funcom_train/2859016
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void close() { try { if (statsLogFileOpen) { Log.out.println("JaSSIUserStats.close()", "Normal shutdown of Stats Log."); statsLog.close(); } } catch (Exception e) { e.printStackTrace(); } statsLogFileOpen = false; statsLog = null; } COM: <s> closes the stats log </s>
funcom_train/36489937
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Point2i getPositionInBlocks() { int x = Math.round((this.position.x * BEACON_GRID_SIZE - this.parcoursBlockSizeInMM / 2.0f) / this.parcoursBlockSizeInMM); int y = Math.round((this.position.y * BEACON_GRID_SIZE - this.parcoursBlockSizeInMM / 2.0f) / this.parcoursBlockSizeInMM); return new Point2i(x, y); } COM: <s> errechnet die parcours block koordinaten der landmarke </s>
funcom_train/41621237
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void processTransform() { MD5Importer instance = MD5Importer.getInstance(); Quaternion parentOrien = null; Vector3f parentTrans = null; if(this.parent >= 0) { parentOrien = instance.getJoint(this.parent).getOrientation(); parentTrans = instance.getJoint(this.parent).getTranslation(); } else { parentOrien = new Quaternion(); parentTrans = new Vector3f(); } this.orientation.set(parentOrien.inverse().multLocal(this.orientation)); this.translation.subtractLocal(parentTrans); parentOrien.inverse().multLocal(this.translation); if(this.parent < 0) { this.orientation.set(MD5Importer.base.mult(this.orientation)); } } COM: <s> process the translation and orientation of this joint into local space </s>
funcom_train/16769029
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void onOOBControlMessage(IMessageComponent source, IPipe pipe, OOBControlMessage oobCtrlMsg) { if ("ClientBroadcastStream".equals(oobCtrlMsg.getTarget())) { if ("chunkSize".equals(oobCtrlMsg.getServiceName())) { chunkSize = (Integer) oobCtrlMsg.getServiceParamMap().get("chunkSize"); notifyChunkSize(); } } } COM: <s> out of band control message handler </s>
funcom_train/7745977
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public IRelationMapper getRelationMapperForClasses(Class subjectClass, Class targetClass) { IRelationMapper result = null; String relationMapperName = subjectClass.getName() + "-" + targetClass.getName(); if (loadedRelationMappers.get(relationMapperName) != null) { result = (IRelationMapper)loadedRelationMappers.get(relationMapperName); } else { result = new RelationMapper(subjectClass, targetClass); loadedRelationMappers.put(relationMapperName, result); } return result; } COM: <s> this method gets the domain object relation object for the given classes </s>
funcom_train/669687
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void incrementDisplayBeanOrdinals(List<DisplayItemGroupBean> displayItemGroupBeans, int startOrdinal, int incrementByNumber) { int tempOrdinal = 0; for (DisplayItemGroupBean displayItemGroupBean : displayItemGroupBeans) { tempOrdinal = displayItemGroupBean.getOrdinal(); if (tempOrdinal <= startOrdinal) continue; displayItemGroupBean.setOrdinal(displayItemGroupBean.getOrdinal() + incrementByNumber); } } COM: <s> this method takes a list of display item group beans and increases the </s>
funcom_train/39380346
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void setErrorMessage(String key, Object value) { Object[] args = new Object[] { getErrorLabel(), value }; String msg = getMessage(getName() + "." + key, args); if (msg == null) { msg = getMessage(key, args); } setError(msg); } COM: <s> set the error with the a label and value formatted message specified by </s>
funcom_train/1479278
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getItemDescription(int itemId) { if (itemId == -1 || itemId >= maxListedItems) { return new String("An item."); } if (itemLists[itemId] != null) { return (itemLists[itemId].itemDescription); } return new String("Item " + itemId); } COM: <s> returns the description of item id </s>
funcom_train/31125206
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void deconfigure() throws CoreException { BypassedTestsPlugin.logDebug("Entered BypassedTestsNature.deconfigure()"); //$NON-NLS-1$ // de-register builder & nature removeFromBuildSpec(BUILDER_ID, NATURE_ID); BypassedTestsPlugin.logDebug("Finished BypassedTestsNature.deconfigure()"); //$NON-NLS-1$ } COM: <s> configure the project to exclude the nature and associated builder </s>
funcom_train/49658508
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void onMessage(Message message) { if (message instanceof TextMessage) { TextMessage msg = (TextMessage) message; try { System.out.println( "SUBSCRIBER: " + "Processing message: " + msg.getText()); } catch (JMSException e) { System.err.println( "Exception in " + "onMessage(): " + e.toString()); } } else { monitor.allDone(); } } COM: <s> casts the message to a text message and displays </s>