__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/34908024
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addVstupujiciSpojePropertyDescriptor(Object object) { itemPropertyDescriptors.add(createItemPropertyDescriptor( ((ComposeableAdapterFactory) adapterFactory) .getRootAdapterFactory(), getResourceLocator(), getString("_UI_Operace_vstupujiciSpoje_feature"), getString("_UI_Operace_vstupujiciSpoje_description"), GebzPackage.Literals.OPERACE__VSTUPUJICI_SPOJE, true, false, true, null, getString("_UI_SpojePropertyCategory"), null)); } COM: <s> this adds a property descriptor for the vstupujici spoje feature </s>
funcom_train/3408436
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean initialize (boolean quiet,ContextStack stack) { boolean result = false; // Go check it out and gather up the info we need... Vector directInterfaces = new Vector(); Vector directMethods = new Vector(); Vector directConstants = new Vector(); if (isConformingRemoteInterface(directInterfaces, directMethods, directConstants, quiet, stack)){ // We're ok, so pass 'em up... result = initialize(directInterfaces,directMethods,directConstants,stack,quiet); } return result; } COM: <s> initialize this instance </s>
funcom_train/34877750
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testInitNullValueTimeStyle(){ TestBean bean = new TestBean(); DateTime control = new DateTime( getComposite(), SWT.TIME ); Binders.getDateTimeBinder().bind( bean, TestBean.PROP_DATE, control ); assertEquals( 0, control.getHours() ); assertEquals( 0, control.getMinutes() ); assertEquals( 0, control.getSeconds() ); } COM: <s> null date displayed as 00 00 00 </s>
funcom_train/49404318
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int compareTo(final Interval that) { if (that == null) return -1; // nulls last int result = this.sequence.compareTo(that.sequence); if (result == 0) { if (this.start == that.start) { result = this.end - that.end; } else { result = this.start - that.start; } } return result; } COM: <s> sort based on sequence </s>
funcom_train/10268437
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getDecompID(String specID, String taskID) { try { TaskInformation taskinfo = getTaskInformation(specID, taskID, _sessionHandle); return taskinfo.getDecompositionID() ; } catch (IOException ioe) { _log.error("IO Exception in getDecompId ", ioe) ; return null ; } } COM: <s> gets a tasks decomposition id </s>
funcom_train/40944907
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public interface Viewer { /** * Sets the Item that serves as the data source of the viewer. * * @param newDataSource * The new data source Item */ public void setItemDataSource(Item newDataSource); /** * Gets the Item serving as the data source of the viewer. * * @return data source Item */ public Item getItemDataSource(); } COM: <s> interface implemented by viewer classes capable of using an item as a </s>
funcom_train/34999608
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void find(@Parameter(key = "tag") String tag) { try { tag = URLDecoder.decode(tag, URLTag.URL_ENCODE); } catch (UnsupportedEncodingException e) { } List<Topic> topics = this.tagService.search(tag, this.userSession.getRoleManager()); propertyBag.put("topics", topics); propertyBag.put("tag", tag); } COM: <s> find all topics that use the specified tag </s>
funcom_train/46038545
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void updateDefaultUI() { for (String preferenceName : store.keySet()) { if (String.class.equals(types.get(preferenceName))) { store.put(preferenceName, model.getDefault(preferenceName)); } else { store.put(preferenceName, model .getDefaultBoolean(preferenceName)); } } updateUI(); } COM: <s> restores the default value to observed swt controls </s>
funcom_train/45612170
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addComponent(Statistic<T> stat) { T oldVal = getValue(); pcSupport.addPropertyChangeListener(stat.getListener()); components.put(stat); T val = getValue(); if (!(val.compareTo(oldVal) == 0)) { pcSupport.firePropertyChange(VALUE_PROP, oldVal, val); } } COM: <s> adds a statistic to the vector on which this value is based </s>
funcom_train/3582722
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void paintEdge(Graphics g, Edge e, int x1, int y1, int x2, int y2) { this.tg2d.setDelegate((Graphics2D)g); paintEdge(tg2d, e, x1, y1, x2, y2); } COM: <s> overridded to wrap passed graphics in transforming graphics then call </s>
funcom_train/20900861
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setProgress(final int val) { try { SwingUtilities.invokeAndWait(new Thread() { public void run() { progressbar.setValue(val); progressbar.repaint(); } }); } catch (InterruptedException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } } COM: <s> sets the current progress indicator using the swing event execution </s>
funcom_train/35949306
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void broadcastGroup(Token aToken) { String lGroup = aToken.getString("group"); // if the group is not specified in the token then noone gets the // message: if (lGroup == null || lGroup.length() <= 0) { mLog.debug("Token '" + aToken + "' has no group specified..."); return; } broadcastFiltered(aToken, "group", lGroup); } COM: <s> broadcasts the passed token to all token based connectors of the </s>
funcom_train/42068180
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addSizePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_RIFFWave_size_feature"), getString("_UI_PropertyDescriptor_description", "_UI_RIFFWave_size_feature", "_UI_RIFFWave_type"), WavPackage.Literals.RIFF_WAVE__SIZE, false, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the size feature </s>
funcom_train/25118938
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Sprite getSprite(String path, GL gl) throws LoadResourceException { SpriteMeta meta; try { meta = metaCollection.getSpriteMeta(path, resourceSet); } catch (SetDoesNotExistException e) { throw new LoadResourceException(path, e); } catch (ResourceDoesNotExistException e) { throw new LoadResourceException(path, e); } catch (WrongResourceTypeException e) { throw new LoadResourceException(path, e); } return sprites.getResource(path, this, meta, gl); } COM: <s> get a sprite resource corresponding to a certain path </s>
funcom_train/1531795
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void lineTo(double x,double y) { if(uncommittedPoints.size()>0) { double[] last = (double[])uncommittedPoints.peek(); //are we adding the same point? if(Math.abs(last[0]-x)<TOLERANCE && Math.abs(last[1]-y)<TOLERANCE) return; } double[] f = doubleFactory.getArray(2); f[0] = x; f[1] = y; uncommittedPoints.push(f); } COM: <s> adds a line to x y </s>
funcom_train/19685382
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void checkTopologyConnections() throws ServerException { if (isTopologyConnected) for (int i = 0; i < server.controllerSockets.length; i++) { if (!server.controllerSockets[i].nodeSocket.isClosed()) try { ObjectOutputStream is = new ObjectOutputStream( server .controllerSockets[i] .nodeSocket .getOutputStream()); is.writeObject(new CheckConnectionEvent()); } catch (IOException e) { logger.fatal(DISCONNECT_ERROR + i, e); throw new ServerException(DISCONNECT_ERROR, e); } } } COM: <s> check if a connection to a node has been disconnected </s>
funcom_train/46105843
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean removeRow(int row) { try { if (this.canRemoveRow()) { this.fireTableEvent(row, row, TableListener.ALL_COLUMN, TableListener.DELETE); return this.table.removeRow(row); } else { return false; } } catch (Exception e) { throw new ObviousRuntimeException(e); } } COM: <s> removes a row from this table </s>
funcom_train/20351825
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean login(String user_id, String user_password) { this.domain = user_id.substring(user_id.indexOf("@")+1); this.username = user_id; findHostAndPort(); ConnectionConfiguration connConfig = new ConnectionConfiguration( host, port, domain ); this.conn = new XMPPConnection( connConfig ); try { this.conn.connect(); try { this.conn.login( user_id, user_password ); return true; } catch ( XMPPException e ) { return false; } } catch ( XMPPException e ) { return false; } } COM: <s> login to the server </s>
funcom_train/41165669
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void delete(CoResponseMchoiceE1 entity) { EntityManagerHelper.log("deleting CoResponseMchoiceE1 instance", Level.INFO, null); try { entity = getEntityManager().getReference(CoResponseMchoiceE1.class, entity.getId()); getEntityManager().remove(entity); EntityManagerHelper.log("delete successful", Level.INFO, null); } catch (RuntimeException re) { EntityManagerHelper.log("delete failed", Level.SEVERE, re); throw re; } } COM: <s> delete a persistent co response mchoice e1 entity </s>
funcom_train/2517883
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Date getActualFinish() { activate(ActivationPurpose.READ); int index = -1; for (int i = 0; i < profile.size(); i++) { TaskResourceActualsEntry entry = get(i); if (entry.getLeft() == 0) { index = i; break; } } // not finished yet if (index < 0) { return null; } return getDateForIndex(index, true); } COM: <s> returns the date on which the work was finished determined by the first </s>
funcom_train/51809391
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String addValue(String _sec, String _key, String _value) { if(_sec!=null&&_key!=null&&_sec!=""&&_key!="") { Hashtable hashtable; if(!sections_.containsKey(_sec)) sections_.put(_sec, hashtable = new Hashtable()); else hashtable = (Hashtable)sections_.get(_sec); return(String)hashtable.put(_key, _value); } else { return(null); } } COM: <s> assigns a value to a key in a section of the ini file </s>
funcom_train/36469981
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void tryRecordOrStop() { if(myLastTracer!=null) { if(myLastTracer.myStatus==PositionTracer.STATUS_RECORDING) { myLastTracer.setStatus(PositionTracer.STATUS_OFF); }else { myLastTracer.setStatus(PositionTracer.STATUS_RECORDING); } updateButtons(); } } COM: <s> start recording the track </s>
funcom_train/1653338
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testFormatSizeLong_WithIntermediateValues() { Long methodLong; String[] actualValue = {"1.0","1.25","1.5","1.75"}; for(int i = 1; i < valAndExpected.length; i++) { methodLong = Long.valueOf(valAndExpected[i][0]); for(int j = 0; j < 4; j++) assertEquals(SizeUtil.formatSize(methodLong.longValue()+(methodLong.longValue()*j/4)), actualValue[j]+" "+valAndExpected[i][1]); } } COM: <s> tests if format size long method </s>
funcom_train/6353129
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void initModule() throws SerialDataException { // set data component order for attitude int byteI = 0; _payload[byteI++] = 3; // ID count _payload[byteI++] = 5; // heading ID _payload[byteI++] = 24; // pitch ID _payload[byteI++] = 25; // roll ID sendCommand(3, _payload, byteI, _packet); } COM: <s> initializes the module for compatibility with the api </s>
funcom_train/27844466
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testModelSetValue() throws Exception { MockModelWrapper modelWrapper = new MockModelWrapper(); MockPointer pointer = new MockPointer("test"); String value = "value"; _threadSupport.modelSetValue(modelWrapper, pointer, value); assertEquals("value", modelWrapper.getValue(pointer)); } COM: <s> test for model set value </s>
funcom_train/14400428
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testServiceTypeCut() throws Exception { SLPOutputStream outStr = new SLPOutputStream(); outStr.write(SRV_TYPE); byte[] bytes = outStr.toByteArray(); for (int ln = bytes.length - 1; ln >= 0; --ln) { SLPInputStream inStr = new SLPInputStream(getHead(bytes, ln)); ServiceType srvType = inStr.readServiceType(); verify("null srvType is expected", srvType == null); } } COM: <s> test service type cut </s>
funcom_train/47302454
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean isSourceTreeSelectionValid() { if (sourceTree.isSelectionEmpty()) { return false; } else { for (TreePath path : sourceTree.getSelectionPaths()) { if (!(path.getLastPathComponent() instanceof SQLTable)) { return false; } } return true; } } COM: <s> returns true if the source db tree selections are valid for the copy </s>
funcom_train/13689786
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JButton getOkButton() { if (okButton == null) { okButton = new JButton(); okButton.setText(Helper.getMessage("general.btnOk")); okButton.setPreferredSize(new java.awt.Dimension(100,26)); okButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { //TODO frage senden dispose(); } }); } return okButton; } COM: <s> this method initializes ok button </s>
funcom_train/5245812
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: /* public void addEdge(ModelState s) { if (! current_path.isEmpty()) { Integer from = current_path.get(current_path.size() - 1); ModelEdge e = new ProbabilisticModelEdge(from, s.getNum()); if (model_edges.containsKey(from)) { model_edges.get(from).add(e); } else { HashSet<ModelEdge> edges = new HashSet<ModelEdge>(); edges.add(e); model_edges.put(from, edges); } } } */ COM: <s> add an edge to the model </s>
funcom_train/7660481
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testParkNanos() { Thread t = new Thread(new Runnable() { public void run() { try { LockSupport.parkNanos(1000); } catch(Exception e){ threadUnexpectedException(); } } }); try { t.start(); t.join(); } catch(Exception e) { unexpectedException(); } } COM: <s> park nanos times out if not unparked </s>
funcom_train/20083498
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void drawRotatedString(String text, int x, int y, float angle) { x += offset.getX(); y += offset.getY(); gl.pushMatrix(); gl.translateXY(x, y); gl.rotate(angle); drawString(text, -offset.getX(), -offset.getY()); gl.popMatrix(); } COM: <s> renders a string of text to the display </s>
funcom_train/18477810
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getHostname() { String osName = System.getProperty("os.name"); String[] cmd; //Look for windows OS - only works w/NT, 2000 if (osName.indexOf("Windows") != -1) { cmd = new String[3]; cmd[0] = "cmd.exe"; cmd[1] = "/C"; cmd[2] = " hostname "; } else { cmd = new String[1]; cmd[0] = "hostname"; } return this.processCmd(cmd); } COM: <s> get hostname of this box </s>
funcom_train/35714500
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private int getTableHeightHint(Table table, int rows) { if (table.getFont().equals(JFaceResources.getDefaultFont())) table.setFont(JFaceResources.getDialogFont()); int result= table.getItemHeight() * rows; if (table.getLinesVisible()) result+= table.getGridLineWidth() * (rows - 1); // TODO adjust to correct size. +4 works on windows, but not others // return result + 4; return result; } COM: <s> computes the table hight hint for code table code </s>
funcom_train/50532953
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Protocol ConnectProtocols(Vector protocol_list) { Protocol current_layer=null, next_layer=null; for(int i=0; i < protocol_list.size(); i++) { current_layer=(Protocol)protocol_list.elementAt(i); if(i+1 >= protocol_list.size()) break; next_layer=(Protocol)protocol_list.elementAt(i+1); current_layer.SetUpProtocol(next_layer); next_layer.SetDownProtocol(current_layer); } return current_layer; } COM: <s> creates a protocol stack by iterating through the protocol list and connecting </s>
funcom_train/6289555
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void startBrowser(StartupModes runMode) { if (runMode == StartupModes.IN_THE_SAME_THREAD) { startBrowser(); } else { // start in the new thread Runnable r = new Runnable() { public void run() { startBrowser(); } }; Thread t = new Thread(r); t.start(); } } COM: <s> shows the browser window </s>
funcom_train/24137971
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void sendMessageToAllClients(int sendMessageId, String sendData) throws IllegalArgumentException { Integer id = new Integer(sendMessageId); for (int i=0; i < handlers.size(); i++) { ClientConnectionHandler handler = (ClientConnectionHandler) handlers.elementAt(i); handler.queueMessageForSending( id, sendData.getBytes()); } } COM: <s> this function sends the message to clients </s>
funcom_train/36060907
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Cursor searchHop(String search) throws SQLException { String where = createWhere(search); Cursor mCursor = mDb .query(true, HOP_TABLE, new String[] { KEY_ID, KEY_NAME, KEY_DESCRIPTION, KEY_ALPHA_ACID, KEY_BETA_ACID, KEY_NOBLE }, where, null, null, null, null, null); if (mCursor != null) { mCursor.moveToFirst(); } return mCursor; } COM: <s> return a cursor for all hops that match a search pattern </s>
funcom_train/34998783
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void isAllowed(Avatar avatar) { this.applyCommonConstraints(avatar); boolean allowGallery = this.config.getBoolean(ConfigKeys.AVATAR_ALLOW_GALLERY); boolean allowUpload = this.config.getBoolean(ConfigKeys.AVATAR_ALLOW_UPLOAD); if (avatar.getAvatarType() == AvatarType.AVATAR_UPLOAD && !allowUpload || avatar.getAvatarType() == AvatarType.AVATAR_GALLERY && !allowGallery) { throw new ValidationException(avatar.getAvatarType() + "is not allowed!"); } } COM: <s> check the user can do this operation according to config </s>
funcom_train/39381246
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean onEditClick() { Integer id = editLink.getValueInteger(); if (id != null) { Department department = (Department) getDataObject(Department.class, id); DepartmentEditor departmentEditor = (DepartmentEditor) getContext().createPage(DepartmentEditor.class); departmentEditor.setDepartment(department); setForward(departmentEditor); } return false; } COM: <s> handle an edit department click forwarding to the </s>
funcom_train/34188733
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void set_server_stop() { if (udp_s != null) udp_s.setStop(true); this.server_state = false; try { server_thread.join(); } catch (InterruptedException iex) { event.core_message("UDP:E>" + iex.getLocalizedMessage()); } } COM: <s> softly stops server thread </s>
funcom_train/15401044
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected String getIndicatorString() { int rotationAngle = (int)Math.toDegrees(rotation); double rotationD = Math.toDegrees(rotation); if (rotationAngle < 0) { rotationAngle = 360 + rotationAngle; } String rotationString = new String("rotation angle " + rotationAngle); return rotationString; } COM: <s> formulates string output of rotation angle in degrees </s>
funcom_train/23632018
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String formatDate(final String date) { String nDate = new String(date); if (date.length() > 4) { nDate = date.substring(0, 4) + '-' + date.substring(4); if (date.length() > 6) { nDate = nDate.substring(0, 7) + '-' + nDate.substring(7); } } return nDate; } COM: <s> format the date that is received </s>
funcom_train/2731546
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public TupleValue visit(ProductDomain domain) throws InputMismatchException { scanner.scan("("); List<?> baseDomains = ((ProductDomain) domain).getDomains(); List<Value> collection = new ArrayList<Value>(); Iterator<?> it = baseDomains.iterator(); if (scanner.peekChar() != ')') { while (true) { Domain nextDomain = MDRConnector.toDomain(it.next()); Value elementValue = visit(nextDomain); collection.add(elementValue); if (scanner.peekChar() != ',') { break; } scanner.scan(","); } } scanner.scan(")"); return new TupleValue(collection); } COM: <s> converts the read input into a tuple value </s>
funcom_train/20499682
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void placeQueen(int x, int y, Queen q){ eqGame.getBoard().getGrid()[x][y].setPiece(q); eqGame.getBoard().getGrid()[x][y].getPiece().setPlayer(true); eqGame.getBoard().getGrid()[x][y].setOccupied(true); } COM: <s> helper method to assist in testing </s>
funcom_train/50116333
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void renderDiagram() { GraphFactory factory = new GraphFactory(); Object d = getDiagram(); if (d instanceof Diagram) { Diagram diagram = (Diagram) d; Iterator itr = diagram.getItemViews().iterator(); while (itr.hasNext()) { Object obj = itr.next(); if (obj instanceof RoseItemView) { RoseItemView view = (RoseItemView) obj; factory.addView(view); } else { System.out.println(obj.getClass()); } } getGraph().setModel(factory.getGraphModel()); getGraph().revalidate(); } } COM: <s> renders the diagram </s>
funcom_train/1856495
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private TextField getTextField01() { if (textField01 == null) { textField01 = new TextField(new DecimalDocument(8, 2)); // textField01 = new TextField( new IntegerDocument() ); textField01.setBounds(20, 100, 200, 30); textField01.setAlfaColor(0.5f, Color.BLUE); textField01.setForeground(Color.WHITE); // textField01.setFocusable( false ); } return textField01; } COM: <s> this method initializes text field01 </s>
funcom_train/17894554
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int getEventCount() { if (stopped) throw new IllegalStateException("Attempting to use a stopped persistence plugin."); EntityManager em = emf.createEntityManager(); Number result; try { Query query = em.createQuery("select count(e) from ServerEvent e"); result = (Number) query.getSingleResult(); } finally { em.close(); } return result.intValue(); } COM: <s> gives the number of events stored in the database </s>
funcom_train/50330297
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setMode(int mode) { int oldMode = _mode; // preserve this in case we need to go back if (mode != _mode) { notifyPropertyChange("Mode", _mode, mode); _mode = mode; } if (_mode != Programmer.PAGEMODE) { // attempt to switch to unsupported mode, switch back to previous _mode = oldMode; notifyPropertyChange("Mode", mode, _mode); } } COM: <s> note that zimo can now only do page mode </s>
funcom_train/9564697
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean importFont(String fontNr, String fontName) { RtfFont rtfFont = new RtfFont(fontName); rtfFont.setRtfDocument(this.rtfDoc); this.importFontMapping.put(fontNr, Integer.toString(this.rtfDoc.getDocumentHeader().getFontNumber(rtfFont))); return true; } COM: <s> imports a font </s>
funcom_train/15520561
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void putDate(String key, String param, String format) throws ParseException { if (param == null) put(key, param); else { SimpleDateFormat sdft = new SimpleDateFormat(format); Date value = sdft.parse(param); put(key, value); } } COM: <s> allows you to put a date parameter as a string </s>
funcom_train/17489623
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public double coordinate(int p, int i) { int p_base = dimensions * p; if ((i >= dimensions) || (i < 0)) throw new IllegalArgumentException("Coordinate index " + i + "must be in range [0, " + (dimensions-1) + "]."); if ((i % 1) == 1) return sin(points[p_base + i]); else return cos(points[p_base + i]); } COM: <s> i th coordinate of point p </s>
funcom_train/37557455
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getHash(String plaintext) { try { MessageDigest md = MessageDigest.getInstance("MD5"); byte[] b = md.digest(plaintext.getBytes()); String s = new String(b); return s; } catch (NoSuchAlgorithmException nsae) { System.out.println(nsae.toString()); System.out.println("A null string was returned."); return null; } } COM: <s> calculates the cryptographic hashvalue for a given plaintext </s>
funcom_train/34343143
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Command getMiEnvio() { if (miEnvio == null) {//GEN-END:|30-getter|0|30-preInit // write pre-init user code here miEnvio = new Command("Enviar", Command.OK, 0);//GEN-LINE:|30-getter|1|30-postInit // write post-init user code here }//GEN-BEGIN:|30-getter|2| return miEnvio; } COM: <s> returns an initiliazed instance of mi envio component </s>
funcom_train/1328771
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void execute() { preProcess(); try { performBuild(); } catch (BuildCityRuntimeException e) { log.error("Exception during build occurred: " + e.getMessage()); buildCtx.considerAsFailed(e); } catch (Exception e) { log.error("Fatal error during build occurred: " + e.getMessage(), e); buildCtx.considerAsFailed(e); } postProcess(); } COM: <s> executes chain of activities related to build depending on particular strategy </s>
funcom_train/8486764
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void print(){ Position currentPosition; ListIterator itr = linkedStones.listIterator(); while(itr.hasNext()){ currentPosition = (Position)itr.next(); System.out.print("["+currentPosition.getLine()+","+currentPosition.getColumn()+"] "); } System.out.println(""); } COM: <s> print the group </s>
funcom_train/18111892
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addPhonesPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ContactDetails_Phones_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ContactDetails_Phones_feature", "_UI_ContactDetails_type"), BioDBPackage.Literals.CONTACT_DETAILS__PHONES, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the phones feature </s>
funcom_train/20728385
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Class getColumnClass(int columnIndex) { // Log.log(Log.DEBUG,this,"getColumnClass columnIndex="+columnIndex); if (columnIndex == OUTFIELD_INCOMMINGAMOUNT || columnIndex == OUTFIELD_AMOUNT || columnIndex == OUTFIELD_OUTGOINGAMOUNT) { return Double.class; } else { return String.class; } }//}}} //{{{ +getColumnCount() : int COM: <s> returns the class of the data in the specified column </s>
funcom_train/2296974
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setValue( Object value ) { // 2008-07-09 JR commmented out IllegalArgumentException. // Numbers & Dates are valid custom field values. //if ((value == null) || (value instanceof String) || (value instanceof Collection)) { this.value = value; //} //else { // throw new IllegalArgumentException( "Field value must be either a String or Collection<String>." ); //} } COM: <s> sets the value for the field </s>
funcom_train/34973784
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public QueryRequest createTestQueryRequest(String docType) { final QueryRequest jeReq = new QueryRequest(); jeReq.setDocType(docType); jeReq.setRequestedAt((new JEUtils()).getGlobalTimestamp()); jeReq.setRequestedBy(TEST_USERNAME); return jeReq; } COM: <s> creates a test query request with a specified json document </s>
funcom_train/7745934
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private XMLManyMappingData getManyMappingDataForRelatedClass(XMLMappingData xmlMappingData, Class relatedClass) { XMLManyMappingData result = null; for (Iterator iter = xmlMappingData.getManyAssociations().iterator(); iter.hasNext();) { XMLManyMappingData manyMappingData = (XMLManyMappingData) iter.next(); if (manyMappingData.getClazz().equals(relatedClass.getName())) { result = manyMappingData; } } return result; } COM: <s> this method gets the mapping data for a given related class </s>
funcom_train/13275262
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void enableZoomActions() { PlanController planController = getPlanController(); float scale = planController.getScale(); HomeView view = getView(); view.setEnabled(HomeView.ActionType.ZOOM_IN, scale < planController.getMaximumScale()); view.setEnabled(HomeView.ActionType.ZOOM_OUT, scale > planController.getMinimumScale()); } COM: <s> enables zoom actions depending on current scale </s>
funcom_train/41381924
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void createFile(IContainer folder, String name, InputStream contents, boolean forceFlag) throws LPModelException { IFile file= folder.getFile(new Path(name)); try { file.create( contents, forceFlag ? IResource.FORCE | IResource.KEEP_HISTORY : IResource.KEEP_HISTORY, getSubProgressMonitor(1)); // this.setAttribute(HAS_MODIFIED_RESOURCE_ATTR, TRUE); } catch (CoreException e) { throw new LPModelException(e); } } COM: <s> convenience method to create a file </s>
funcom_train/50605642
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Builder followedByAtLeastNumChars (final int minChars) { if (minChars < 0) throw new IllegalArgumentException("minChars < 0"); return new Builder() { public Strings create (Strings next) { return Builder.this.create(newWildcard(minChars, next)); } }; } COM: <s> returns a builder whose resulting strings specification will require the at </s>
funcom_train/10660337
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Number parse(String string) throws ParseException { ParsePosition pos = new ParsePosition(0); Number number = parse(string, pos); if (pos.getErrorIndex() != -1 || pos.getIndex() == 0) { throw new ParseException(null, pos.getErrorIndex()); } return number; } COM: <s> parse a number from the specified string using the rules of this </s>
funcom_train/25332949
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testToString() { DBDatabase instance = new DBDatabaseImpl(); assertNotNull(instance.toString()); assertTrue(instance.toString().startsWith("release:")); instance.setBuild("bld"); instance.setDBVersion("dbv"); assertTrue(instance.toString().equals("release: dbv [genome build: bld]")); } COM: <s> test of to string method of class dbdatabase </s>
funcom_train/39397440
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected Date parseDate(String stringDate) { // date is in this format: dd.mm.yyyy hh:mm if (stringDate == null || "N/A".equals(stringDate)) { return new Date(); } try { synchronized (MAIL_TIME_FORMAT) { return MAIL_TIME_FORMAT.parse(stringDate); } } catch (Throwable e) { return new Date(); } } COM: <s> parses a given date string in spamato format into a real date object </s>
funcom_train/28261592
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void updatePalette() { colourModel = new IndexColorModel(8, 256, palette[RED], palette[GREEN], palette[BLUE]); // This requires the image to be redrawn on the canvas to reflect // changes in the colourmodel: this.updateImage(); } COM: <s> update the colour model used in the image </s>
funcom_train/43326837
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void readCWRecord(String buffer) throws IOException { char recordType = buffer.charAt(11); if ((type != recordType) && (Residue.isRes(recordType))) throw new IOException("RSCW record '"+ String.valueOf(recordType) + "' for residue " + String.valueOf(n)+ " doesn't match '" + String.valueOf(type) + "' in sequence"); weight = StringUtil.atod(buffer,12); } COM: <s> read cw record out of yapf file </s>
funcom_train/9140595
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int writeUnary( int x ) throws IOException{ if(x < 9 - bitOffset) return writeInCurrent(1, x); final int shift = 8 - bitOffset; x -= shift; dos.write( byteToWrite ); bitOffset = 0; byteToWrite = 0; int i = x -1 >> 3; byteOffset += i + 1; while( i-- != 0 ) dos.write( 0 ); writeInCurrent( 1, ( (x-1) & 7) + 1 ); return x + shift ; } COM: <s> writes an integer x using unary encoding </s>
funcom_train/5716301
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getExportFromLearningUnitViewManagerId() { for (int i = 0; i < installedLearningUnitViewManagersIdsAndTitles.length; i++) { if (radioButtons_learningUnitViewManagers[i].isSelected()) { return installedLearningUnitViewManagersIdsAndTitles[i][0]; } } return null; } COM: <s> return id of view manager from which the structure is to be exported </s>
funcom_train/437471
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void exit() { // Stores properties if (props.size() > 0) try { props.storeToXML("CleanSheets User Properties (" + DateFormat.getDateTimeInstance().format(new Date()) + ")"); } catch (IOException e) { System.err.println("An error occurred while saving properties."); } // Terminates the virtual machine System.exit(0); } COM: <s> exits the application </s>
funcom_train/15399352
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void applyPS(DICOMPresentationState ps) { if (dis instanceof DICOMImageSeries) { applyPS(ps,(DICOMImageSeries) dis); } else { DICOMImageStudy study=(DICOMImageStudy) dis; DICOMImageSeries[] ss=study.getAllSeries(); for (int i=0; i<ss.length; i++) { applyPS(ps,ss[i]); } } } COM: <s> applies presentation state to images in this group </s>
funcom_train/11381250
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public int size() { int size = 0; size += WritableUtils.getVIntSize(cumulativeCpuUsage); // long #1 size += WritableUtils.getVIntSize(virtualMemoryUsage); // long #2 size += WritableUtils.getVIntSize(physicalMemoryUsage); // long #3 size += WritableUtils.getVIntSize(heapUsage); // long #4 return size; } COM: <s> returns the size of the serialized data </s>
funcom_train/38339177
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Node compile(NotCondition condition, Rule rule, int conditionIndex) { Object o = condition.getNestedConditionalElement().get(0); AbstractCondition nested = (AbstractCondition) o; try { return nested.compile(this, rule, conditionIndex); } catch (Exception e) { engine.writeMessage(e.getMessage()); return null /* or LONG_OBJECT */; } } COM: <s> the method compiles a not condition </s>
funcom_train/21272597
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Dialog dialog() { Builder b = new AlertDialog.Builder(mCtx); b.setAdapter(mAdapter, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { mEditText.setText(mAdapter.getItem(whichButton)); } }); Dialog d = b.create(); return d; } COM: <s> dialog menu creation </s>
funcom_train/4289490
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addStrictPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_PropertyReferenceExpression_strict_feature"), getString("_UI_PropertyDescriptor_description", "_UI_PropertyReferenceExpression_strict_feature", "_UI_PropertyReferenceExpression_type"), RequirementsPackage.Literals.PROPERTY_REFERENCE_EXPRESSION__STRICT, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the strict feature </s>
funcom_train/3158653
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected Icon getXEditorIcon() { if (_xEditorIcon == null) { URL url = AbstractParamEditor.class.getResource("/org/esa/beam/resources/images/icons/Edit16.gif"); if (url != null) { _xEditorIcon = new ImageIcon(url); } } return _xEditorIcon; } COM: <s> gets the standard edit icon used for parameter editors </s>
funcom_train/48390663
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public HandlerRegistration addValueChangedHandler(com.smartgwt.client.widgets.events.ValueChangedHandler handler) { if(getHandlerCount(com.smartgwt.client.widgets.events.ValueChangedEvent.getType()) == 0) setupValueChangedEvent(); return doAddHandler(handler, com.smartgwt.client.widgets.events.ValueChangedEvent.getType()); } COM: <s> add a value changed handler </s>
funcom_train/14092870
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testInvalidTitle() { FrameFinder finder = new FrameFinder("Invalid Title"); JLabel label = new JLabel("Some Text"); JFrame frame = createJFrame(getName()); frame.getContentPane().add(label); packAndShow(frame); setWindow(frame); assertFalse("Finder is not working", finder.testComponent(frame)); } COM: <s> tests the test component method for invalid title </s>
funcom_train/45231288
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void connect() throws UnknownHostException, IOException { setSocket(new Socket(hostname, port)); setOutputStream(new DataOutputStream(new BufferedOutputStream(socket.getOutputStream()))); setInputStream(new DataInputStream(new BufferedInputStream(socket.getInputStream()))); } COM: <s> establish the connection to the host vsmapi without using ssl </s>
funcom_train/7581652
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JPanel getJContentPane() { if (jContentPane == null) { jContentPane = new JPanel(); jContentPane.setLayout(new BorderLayout()); jContentPane.add(getImportationResultsPane(), BorderLayout.CENTER); jContentPane.add(getButtonsPane(), BorderLayout.SOUTH); jContentPane.add(getImportationOptionsPane(), BorderLayout.NORTH); } return jContentPane; } COM: <s> this method initializes j content pane </s>
funcom_train/14093278
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testEvaluateMatchesString6() { String leftside = "ACAD"; String rightside = "A[BC]"; int operation = Operator.Operation.MATCH; boolean ignoreCase = true; boolean expectedReturn = true; boolean actualReturn = Operator.evaluate(leftside, rightside, operation, ignoreCase); assertEquals("return value", expectedReturn, actualReturn); } COM: <s> test match ignore case with re </s>
funcom_train/21828052
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected int scanTagName(char[] input, int offset, int end, int[] lineNr) throws XMLParseException { _tagName = scanIdentifier(input, offset, end); if (_tagName == null) { throw syntaxError("a tag name", lineNr[0]); } return offset + _tagName.length(); } COM: <s> scans the class tag name of the object </s>
funcom_train/4360255
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void close(DirContext context) { // Do nothing if there is no opened connection if (context == null) return; // Close our opened connection try { if (containerLog.isDebugEnabled()) containerLog.debug("Closing directory context"); context.close(); } catch (NamingException e) { containerLog.error(sm.getString("jndiRealm.close"), e); } this.context = null; } COM: <s> close any open connection to the directory server for this realm </s>
funcom_train/22232807
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void detach() { Group parent; if (isLiveOrCompiled()) { if(!this.getCapability(ALLOW_DETACH)) throw new CapabilityNotSetException(J3dI18N.getString("BranchGroup1")); if (((BranchGroupRetained)this.retained).parent != null) { parent = (Group)((BranchGroupRetained)this.retained).parent.source; if(!parent.getCapability(Group.ALLOW_CHILDREN_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("BranchGroup2")); } } ((BranchGroupRetained)this.retained).detach(); } COM: <s> detaches this branch group from its parent </s>
funcom_train/46450346
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public double getBaseCosts() { if (getActivity().isUsingBaselineValues() && getActivity().getBaselineVersion() != null) { OpAssignmentVersion assignmentVersion = this.getBaselineVersion(); if (assignmentVersion == null) { return 0; } else { return assignmentVersion.getBaseCosts(); } } return baseCosts; } COM: <s> gets the base personnel costs for this assignment </s>
funcom_train/29583349
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void updateCollections() throws HTTPMessageException { try { root = getCollections(); rootModel.setRoot(root); tree.setModel(rootModel); isWebDAVAvailable = true; // Update the tree view status setEnabled(this.isEnabled()); } catch(HTTPMessageException ex) { root=new DefaultMutableTreeNode(WebDAV_UNAVAILABLE); rootModel.setRoot(root); tree.setModel(rootModel); tree.setEnabled(false); isWebDAVAvailable = false; // Update the tree view status setEnabled(this.isEnabled()); throw ex; } } COM: <s> method to update the collections in the tree </s>
funcom_train/21879400
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean moduleExists(String maprefUri) { Model mod = getLockAccess().readlockModel(); try { Resource resource = mod.getResource(maprefUri); return getKnowledgeMap().entityExists(mod, resource) || getLockAccess().wasModifiedItem(resource); } finally { getLockAccess().unlockModel(); } } COM: <s> return true if a module with the mapref uri exists in the map </s>
funcom_train/44481211
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void updateSelection() { ListSelectionModel sm = table.getSelectionModel(); currentSelection.clear(); for (int i = sm.getMinSelectionIndex(); i <= sm.getMaxSelectionIndex(); i++) { if (sm.isSelectedIndex(i)) { currentSelection.add(JFSTable.getInstance().getViewElement(i)); } } } COM: <s> updates the vector of selected jfs elements based on the selection model </s>
funcom_train/4111421
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void resetElement(String token) { if (template.dataElementExists(token)) { if (!this.dataElementExists(token)) { setDataElement(token, template.getDataElement(token).clone()); } else { this.getDataElement(token).setContent(template.getDataElement(token).getContent()); } } } COM: <s> looks for the html element given by token in </s>
funcom_train/11751384
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setDateOfBirthString(String yearMonthDay) { if (yearMonthDay == null) { setDateOfBirth(null); } else { Date date; try { date = new SimpleDateFormat(DEFAULT_DATE_FORMAT) .parse(yearMonthDay); } catch (ParseException e) { throw new IllegalArgumentException( "A date argument must be in format '" + DEFAULT_DATE_FORMAT + "': " + yearMonthDay); } setDateOfBirth(date); } } COM: <s> sets date of birth using a string in format yyyy mmdd </s>
funcom_train/10589239
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object put(Object key, Object value) { String name = (String)key; if (lowerCase) name = name.toLowerCase(); Widget w = container.getChild(name); if (w != null) { return setValue(w, value); } else { throw new UnsupportedOperationException(container + " has no child named '" + key + "'"); } } COM: <s> put a value in a child widget </s>
funcom_train/25811320
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void doSwap2() { mGameState.incMoves(1); Cell c1 = mPrimarySelection; Cell c2 = mSecondarySelection; mPrimarySelection = null; mSecondarySelection = null; c1.mSprite.setAutoRotationY(0); c2.mSprite.setAutoRotationY(0); mActionThread.queueEvent(Events.CHECK); } COM: <s> end of swap action </s>
funcom_train/31625767
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isRowAllowed(String requestedFunction) throws DBException { if (User.isAdmin(getRequestingUid()) || SuperUser.SYSTEM_UID == getRequestingUid()) { return true; } NodeType nodeType = this.getParentEntity(); return nodeType.isRowAllowed(requestedFunction); } COM: <s> override to use permissions of parent node type </s>
funcom_train/18743125
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: final protected boolean confirmOverwriteGrammar(File grammarFile) { if (grammarFile.exists()) { int response = JOptionPane.showConfirmDialog(getFrame(), "Overwrite existing grammar?", null, JOptionPane.OK_CANCEL_OPTION); return response == JOptionPane.OK_OPTION; } else { return true; } } COM: <s> asks whether a given existing file should be overwritten by a new </s>
funcom_train/43425491
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private String prettifyMark(String mark) { if(mark.contains(".") || mark.contains(",")) { mark = mark.substring(0, Math.min(q.getScale().getSignificantDigits()+1, mark.length())); } else { mark = mark.substring(0, Math.min(q.getScale().getSignificantDigits(), mark.length())); } return mark; } COM: <s> make sure value only contains significant digits number of digits </s>
funcom_train/33839238
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void persistFiles() { HibernateFITSFileDao fileDao = new HibernateFITSFileDao(); for(int i = 1; i < this.counter; i++){ Integer intObj = new Integer(i); FITSFilePOJO f = (FITSFilePOJO) this.files.get(intObj); f.setSurvey(this.survey); // finally update the survey field; f.setDescription(this.description); fileDao.store(f); // persist the files into the database } } COM: <s> persist all files in the hash map into the database </s>
funcom_train/48415460
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void storageRemoveMetadata(Snip snip, File snipDir) { File metadataFile = new File(snipDir, getMetadataFileName()); Logger.debug(metadataFile + ": exists? " + metadataFile.exists()); if (metadataFile.exists()) { File backup = new File(metadataFile.getPath() + ".removed"); metadataFile.renameTo(backup); } } COM: <s> remove the metadata of snip from the storage </s>
funcom_train/19625009
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void shuffle() { if (!isEmpty()) { for (int i = 0; i < sb.size(); i++) { int j = rand.nextInt(sb.size()); T x = sb.set(j,sb.getFirst()); sb.set(0,x); } } } COM: <s> shuffle the elements of the bag </s>
funcom_train/18284597
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setDouble(int parameterIndex, double x) throws DAOException { try { parms.put("" + parameterIndex, "" + x); this.preparedStatement.setDouble(parameterIndex, x); } catch (SQLException e) { _log.error("Exception in setDouble() method", e); this.setTransactionRollbackOnly(); } } COM: <s> sets the designated parameter to double value </s>