__key__
stringlengths
16
21
__url__
stringclasses
1 value
txt
stringlengths
183
1.2k
funcom_train/12270488
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setBootstrap( int i ) { if ( i < 0 && i != BOOTSTRAP_DEFAULT ) { bootstrap = 0; System.err.print( "Node: setBootstrap( int ): WARNING: Negative " ); System.err.println( "bootstrap has been replaced by bootstrap 0!\n" ); } else { bootstrap = i; } } COM: <s> sets the bootstrap value of this node to i int </s>
funcom_train/19167082
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean promptAbandonProjectYesNoCancel(final String message) { if (projectChanged) { switch (platform.getUI().sendMessage( message, CoreMessages.getString("ProbeMakerPlugIn.TITLE_SAVE_CHANGES"), PlatformUI.YES_NO_CANCEL_QUERY)) { //$NON-NLS-1$ case PlatformUI.YES_OPTION: saveProject(false); return true; case PlatformUI.NO_OPTION: return true; case PlatformUI.CANCEL_OPTION: return false; } } return true; } COM: <s> prompt the user to save a changed project proceed without saving or cancelling </s>
funcom_train/42645743
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Action getAction() { // grab the action attribute if (action == null) { Object obj = library.getObject(entries, "A"); if (obj instanceof Hashtable) { action = new org.icepdf.core.pobjects.actions.Action(library, (Hashtable) obj); } } return action; } COM: <s> gets the action associated with this outline item </s>
funcom_train/12867671
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Object getCached(Class class1) { return null; // Commented out, just allow the objects to be created by the factories and let // the GC take care of removing them // List cache = (List) reuseMap.get(class1); // Object result= null; // if (cache!=null && !cache.isEmpty()) { // result = cache.remove(0); // addCached(class1, result); // } // // return result; } COM: <s> a factory calls this method to return an object that was cached </s>
funcom_train/41278919
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isPresent(String url) { try { CachedResource res=getStore().getCachedResourceReference(url); if(res==null) { // never been present in cache return(false); } if(res.getFile()==null || !res.getFile().exists()) { // We have seen this before, but has since been deleted return(false); } return(true); } catch(Exception e) { e.printStackTrace(); } return(false); } COM: <s> true iff url is present in cache </s>
funcom_train/2371436
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void initialize() { JPanel content = new JPanel(new GridLayout(game.getPlayers().size(), 1)); JScrollPane spane = new JScrollPane(content); for (Player curr : game.getPlayers()) { content.add(new PlayersCards(curr, game)); } this.add(spane, BorderLayout.CENTER); this.setBorder(new TitledBorder("The cards of the players.")); } COM: <s> creates the gui components </s>
funcom_train/17029906
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addRecordVariable(RecordVariable recordVariable) { // Check for an empty argument if (recordVariable != null) { // First check to see if there is a RecordDescription if (this.recordDescription == null) { this.recordDescription = new RecordDescription(); try { this.recordDescription.setRecordType(new Long(0)); } catch (MetadataException e) { } } // Now add it this.recordDescription.addRecordVariable(recordVariable); } } COM: <s> this method will add a code record variable code to the collection of </s>
funcom_train/10517503
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void assertMapped(JspMangler mangler, String filename, String classname) { String mappedname = mangler.mapJspToJavaName(new File(filename)); assertTrue(filename+" should have mapped to "+classname +" but instead mapped to "+mappedname, classname.equals(mappedname)); } COM: <s> assert our mapping rules </s>
funcom_train/43393481
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean getFiles(boolean localMode) throws Exception { // remote work for debug // localMode = false; // // System.out.println("FileGetter local mode : " + localMode); // System.out.println("FileGetter fileRenameHash : " + fileRenameHash); // remote work for debug if (localMode) { return getLocalFiles(); } else { return getRemoteFiles(); } } COM: <s> gets the files indicated by the parameters from the storage </s>
funcom_train/46439567
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void doPreEventPhases() { final List<Phase> phases = preEventPhaseList; for (Phase phase : phases) { context.setCurrentPhaseId(phase.getName()); feedJobManager.startPhaseStats(phase, context); phase.execute(); feedJobManager.endPhaseStats(phase, context); } } COM: <s> iterates and executes the list of pre event phases </s>
funcom_train/44627901
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: @Test public void testHarness5() { helpFailure("pos for token 0 expected:<1> but was:<0>", "A",new Enum<?>[]{IDENTIFIER,EOF},new int[]{1,2,3,4},0); } COM: <s> this tests that the test harness records if wrong start position is given </s>
funcom_train/23168675
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public ClassAttribute findAttribute(String attrName) { Enumeration e = elements(); while (e.hasMoreElements()) { ClassAttribute attr = (ClassAttribute) e.nextElement(); if (attr.attrName().asString().equals(attrName)) return attr; } return null; } COM: <s> look for an attribute of a specific name </s>
funcom_train/18874854
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void paintField(Graphics g, int x, int y, HexMapModel.Field field) { if(field.getLandscapeImage()==null){ field.setLandscapeImage(load(field.getLandscape())); } g.drawImage(field.getLandscapeImage(),x,y,this); if(field.getMUnit()!=null){ g.drawImage(field.getMUnitImage(),x,y,this); } if(field.getMForegoundImage()!=null){ g.drawImage( field.getMForegoundImage() , x , y , this); } } COM: <s> method paint field </s>
funcom_train/41095991
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void upload(String s) {correct = false; StringTokenizer st=new StringTokenizer(s,","); String n=""; int pos; try {sizex=Integer.parseInt(st.nextToken()); sizey=Integer.parseInt(st.nextToken()); n=st.nextToken(); circ=new int[sizex][sizey]; for(int y=0;y<sizey;y++) for(int x=0;x<sizex; x++) {pos=y*sizex+x; circ[x][y]=Integer.parseInt(n.substring(pos,pos+1)); } correct=true; setstart(); dographics(); }catch(Exception e) {} } COM: <s> sets the circuit to the given string </s>
funcom_train/20727588
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void initialize() { sessionCollector = new TreeParent(new Session("SessionCollector", "", null, null, false, false)); invisibleRoot = new TreeParent(new Session("", "", null, null, false, false)); invisibleRoot.addChild(sessionCollector); sessionList = conInfo.getSessionList(); for (int i = 0; i < sessionList.size(); i++) { sessionCollector.addChild(addSession(sessionList.get(i))); } } COM: <s> this method initializes the status in the session view </s>
funcom_train/37731269
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void selectionChanged(SelectionChangedEvent event) { debugln("GUIControl: notified of selection Changes"); if (event.getAddedObjects().size() > 0) { selectedObjects.addAll(event.getAddedObjects()); } if (event.getRemovedObjects().size() > 0) { selectedObjects.removeAll(event.getRemovedObjects()); } } COM: <s> implements selection change listener </s>
funcom_train/39381220
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean onDeleteClick() { Integer id = deleteLink.getValueInteger(); if (id != null) { DataObject dataObject = getDataObject(Person.class, id); // handle stale links if (dataObject != null) { getDataContext().deleteObject(dataObject); getDataContext().commitChanges(); } setForward("persons-viewer.htm"); } return false; } COM: <s> handle an delete person click forwarding to the </s>
funcom_train/47624270
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void saveApplicationProperties() { try { // Create the file output streams and save the configuration FileOutputStream out = new FileOutputStream(intProps.getProperty(Application.PROPNAME_CONFIGURATION_APPLICATIONFILEPATH)); appProps.store(out, intProps.getProperty(Application.PROPNAME_APPLICATION_NAME) + " " + intProps.getProperty(Application.PROPNAME_APPLICATION_VERSION)); } catch (IOException e) { // Show a console message System.out.println("Couldn't save application properties"); System.out.println(e.getMessage()); } } COM: <s> save the application properties by using the specified file paths to the default </s>
funcom_train/39846577
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Map getSession(String sessionId) { Session s = sessions.get(sessionId); // return null if no session exists now if (s == null) return null; // Accessed, so "touch" the session to prevent // expiry for another timeout period. s.touch(); return s.getMap(); } COM: <s> get the current session </s>
funcom_train/22278015
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: //- public void processEvent(Event event) { //- if (event instanceof ApplicationEvent) { //- if (event.type == ApplicationEvent.APPLET_STOPPED) { //- appletStopped(); //- } else if (event.type == ApplicationEvent.APPLET_STARTED) { //- appletStarted(); //- } //- } //- } COM: <s> processes application specific events </s>
funcom_train/50848428
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetStatement() throws Exception { ResultSet rs = newFOROJdbcResultSet(); Statement result = rs.getStatement(); assertNotNull(result); rs.close(); try { rs.getStatement(); fail("Allowed getStatement() after close()"); } catch (SQLException ex) { assertEquals( "error code", ex.getErrorCode(), -ErrorCode.X_24501); } } COM: <s> test of get statement method of interface java </s>
funcom_train/42068217
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addHighNotePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ChunkInstrument_highNote_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ChunkInstrument_highNote_feature", "_UI_ChunkInstrument_type"), WavPackage.Literals.CHUNK_INSTRUMENT__HIGH_NOTE, true, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); } COM: <s> this adds a property descriptor for the high note feature </s>
funcom_train/20324527
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isOnScreen(WordNode n) { if (n.position().x() > topLeftX && n.position().x() < bottomRightX && n.position().y() > topLeftY && n.position().y() < bottomRightY) { return true; } return false; } COM: <s> checks if a given word node is on screen </s>
funcom_train/1143315
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean booleanAuthenticate(String username, String password) { AccessManager ac = new AccessManager(); String acStr; try { acStr = ac.validateUser(username,password); } catch (Exception e) { e.printStackTrace(); return false; } System.out.println("acStr:"+acStr); if (acStr.equals(Constants.VALID_USER)) { return true; }else return false; } COM: <s> authenticate a user </s>
funcom_train/43768186
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean contains(T x) { acquire(x); try { int h0 = hash0(x) % capacity; if(table[0][h0].contains(x)) { return true; } else { int h1 = hash1(x) % capacity; if(table[1][h1].contains(x)) { return true; } } return false; } finally { release(x); } } COM: <s> is item in the set </s>
funcom_train/34526203
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected Element buildStylesRootElement(OdtResource odtResource) throws DocumentException { Element el = null; try { String content = new String(odtResource.getResource(STYLES_FILENAME), "UTF-8"); el = XmlHelper.parseDocument(content).getDocumentElement(); } catch(Exception ex) { String msg = "Unable to parse the ODT document's styles."; throw new DocumentException(msg, ex); } return el; } COM: <s> reads the styles root element from the odt resource </s>
funcom_train/43894485
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Geometry create(GeometryFactory geometryFactory) { Coordinate[] coords = (Coordinate[]) coordinateList.toArray(new Coordinate[coordinateList .size()]); LineString lineString = geometryFactory.createLineString(coords); lineString.setUserData(getSRS()); lineString.setSRID(getSRID()); return lineString; } COM: <s> create the line string </s>
funcom_train/50385845
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean doSync() { if (isValid()) { if (!needsSync()) return true; // do nothing else if (STATE_NEW.equals(state)) { System.err.println("Do creating user in xUUDB..."); xuudb.add(this); } else { // sync System.err.println("Do syncing..."); xuudb.update(this); } // do sync with DB resetNeedsSync(); //take new cert and gcid as refereers for nex sync dbCert = cert; dbGcId = gcId; return true; } return false; } COM: <s> synncronizes the changes with x uudb </s>
funcom_train/34283144
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void add(int index, int[] intArray) { if (index>size) { throwException2(index); } int addCount = intArray.length; ensureCapacity(size+addCount); int moveCount = size - index; if (moveCount>0) System.arraycopy(data,index, data,index+addCount, moveCount); System.arraycopy(data,index, intArray,0, moveCount); size += addCount; } COM: <s> inserts all code int code s in the specified array into this array </s>
funcom_train/1300543
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getWord() { if (_word != null) return _word; final int nchars = getNumChars(); StringBuilder builder = new StringBuilder(); int curPos = bytePos + numMarkerBytes + 2; for (int i = 0; i < nchars; ++i) { builder.append((char)bytes[curPos++]); } final String result = builder.toString(); _word = result; return result; } COM: <s> get the word at the current pointer position </s>
funcom_train/48580553
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void publish(X _entry) { if(write) { logger.info("Publishing from " + this.toString() + ": " + _entry.toString()); try { out.write(_entry.toString().getBytes()); out.write(delimiter.getBytes()); } catch (IOException e) { logger.severe("FilePublisher " + this.toString() + " couldn't write to " + filename); write = false; } } } COM: <s> publish an entry </s>
funcom_train/14317926
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void writeHeader(String header, String value) throws IOException { // do not write empty headers if (value != null && value.length() > 0) { write(header); write(": "); write(MimeUtility.encodeText(value, "UTF-8", null)); writeLn(); } } COM: <s> write mime header </s>
funcom_train/18551684
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String resolveTypeName(String pName) { if (pName.indexOf("class") == 0) pName = pName.substring(6, pName.length()); if (pName.indexOf(":") > 0) { String[] splitName = pName.split(":"); pName = splitName[0]; } return pName; } COM: <s> resolves the type names i </s>
funcom_train/35931079
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void adjustAvailableItem(TradeItem item) { for (L2ItemInstance adjItem: _items) { if (adjItem.getItemId() == item.getItem().getItemId()) { item.setObjectId(adjItem.getObjectId()); item.setEnchant(adjItem.getEnchantLevel()); if (adjItem.getCount() < item.getCount()) item.setCount(adjItem.getCount()); return; } } item.setCount(0); } COM: <s> adjust trade item according his status in inventory </s>
funcom_train/8077136
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected int rangeSingle(String single) { if (single.toLowerCase().equals("first")) { return 0; } if (single.toLowerCase().equals("last")) { return m_Upper; } int index = Integer.parseInt(single) - 1; if (index < 0) { index = 0; } if (index > m_Upper) { index = m_Upper; } return index; } COM: <s> translates a single string selection into its internal 0 based equivalent </s>
funcom_train/3939543
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String convert(String str, boolean html) { if (html) { str = convertHTML(str); } for (int i = 0; i < TCVN3_char.length; i++) { str = str.replace(TCVN3_char[i], Unicode_char[i]); } return replaceString(str, TCVN3_cap, Unicode_cap); } COM: <s> converts tcvn3 to unicode </s>
funcom_train/3002503
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void indent(int levelAdjustment) throws SAXException { char[] indent = new char[(indentLevel + levelAdjustment) * indentAmount + 1]; indent[0] = '\n'; for(int i = 1; i < indent.length; i++) { indent[i] = indentChar; } super.characters(indent, 0, indent.length); } COM: <s> output white space to reflect the current indentation level </s>
funcom_train/14654537
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void suspendRhythmSimulation() { JMenuItem pause_simulation = M_Menu .getJMenuItem(MainMenu.PAUSE_SIMULATION); if (loaders != null) { int max = loaders.length; for (int index = 0; index < max; index++) { loaders[index].getActor().getRhythm().requestSuspend(); } } network.getEnvironment().getRhythm().requestSuspend(); pause_simulation.setText(MainMenu.RESUME_ENVIRONMENT); pause_simulation.setName(MainMenu.C_0_0); } COM: <s> suspends rhythm all clients </s>
funcom_train/27866369
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addKeyStoreFile(String keyFile, String type, char[] password) { if (keyFile != null) { File f = new File(keyFile); if (f != null && f.exists()) { addKeyStoreFile(f, type, password); } } } COM: <s> adds a keystore file to the keystore management pool </s>
funcom_train/27975581
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setAddress(final String value) { synchronized ( addressLock ) { if ( address != null ) { if ( address.equals( value ) ) { return; } throw new IllegalStateException( "The address property cannot be changed once it has been set" ); } if ( value == null ) { throw new IllegalArgumentException( "The address property cannot be set to null" ); } address = value; getPropertyChangeSupport().firePropertyChange( "address", null, value ); } } COM: <s> sets the address of this code gate code </s>
funcom_train/9994008
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JMenu getFileMenu() { if (fileMenu == null) { fileMenu = new JMenu(); fileMenu.setText("File"); JMenuItem exitMenuItem = new JMenuItem(); exitMenuItem.setText("Exit"); exitMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.exit(0); } }); fileMenu.add(exitMenuItem); } return fileMenu; } COM: <s> this method initializes j menu </s>
funcom_train/24644176
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void showAllReachable(){ Vector nodestack = buildNodeStack(); System.out.println("Nodes connected to "+ this.name); for (int i=0;i<nodestack.size();i++){ System.out.println(((BNNode)nodestack.elementAt(i)).name); } } COM: <s> prints names of all nodes connected to this one </s>
funcom_train/37821801
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testGetP() { Map<Event, Double> expResult = p; Map<Event, Double> result = instance.getP(); for (Event event : expResult.keySet()){ assertEquals(expResult.get(event), result.get(event)); } } COM: <s> test of get p method of class emdata </s>
funcom_train/47820778
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void createAndInitAIPlayers(int nbOfPlayersInitialized, int initialcash) { List<ICity> cities = game.getMap().getCities(); int cityIndex=0; for (int i = nbOfPlayersInitialized; i < players.length; i++) { players[i] = GameFactory.createAIPlayer(cities.get(cityIndex++),initialcash); } } COM: <s> create the remaining players as artificial players </s>
funcom_train/12175150
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getTransformerName() { Class thisClass = getClass(); Package thisPackage = thisClass.getPackage(); String packageName = ""; if (null != thisPackage) { packageName = thisPackage.getName(); } String className = thisClass.getName(); int period = 0; if (packageName.length() > 0) { period = 1; } return className.substring(packageName.length() + period); } COM: <s> return the name of the transformer used primarily for logging </s>
funcom_train/45258458
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void savePerspectiveAs(IPerspectiveDescriptor newDesc) { Perspective persp = getActivePerspective(); if (persp == null) { return; } IPerspectiveDescriptor oldDesc = persp.getDesc(); // Always unzoom. if (isZoomed()) { zoomOut(); } persp.saveDescAs(newDesc); window.firePerspectiveSavedAs(this, oldDesc, newDesc); } COM: <s> saves the perspective </s>
funcom_train/33600399
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Integer getEventTypeId() { if (marketPath != null) { String[] marketPathArray = marketPath.split("/"); if (marketPathArray.length < 2) { throw new BotException("Wrong market path."); } else { String eventTypeId = marketPathArray[1]; try { return Integer.parseInt(eventTypeId); } catch (NumberFormatException e) { throw new BotException("Event type id is not a number: " + eventTypeId + "."); } } } else { return null; } } COM: <s> first event id from the market path </s>
funcom_train/19297021
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setModelType(ModelTypes newModelType) { if (modelType != ModelTypes.SVAR && modelType != ModelTypes.SVEC) throw new IllegalArgumentException(newModelType + " not valid."); modelType = newModelType; if (modelType == ModelTypes.SVEC) USE_DECOMP_DEFAULT = false; else USE_DECOMP_DEFAULT = true; setDefaults(); } COM: <s> sets the svar model type for the optimization settings which affects the </s>
funcom_train/41445718
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String toString() { StringBuffer buf = new StringBuffer(); buf.append("Property[").append(name).append(':').append(type).append('=').append(value).append(']'); return buf.toString(); } COM: <s> get a string representation of this property object </s>
funcom_train/12590764
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void updateUserProps(User u, String prefix, Map paramMap) throws Exception { Iterator keyIt = paramMap.keySet().iterator(); while (keyIt.hasNext()) { String key = (String) keyIt.next(); ((com.dec.avw.core.User)u).removeProperty(prefix + key); ((com.dec.avw.core.User)u).setProperty(prefix + key, (String) paramMap.get(key)); } } COM: <s> save property map in user properties which are defined in </s>
funcom_train/445862
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testRuleHeadEqual() throws Exception { createAxiomDef("a = b"); WsmlRuleValidator v = new WsmlRuleValidator(leFactory); v.isValid(ontology, errors, warnings); ValidationError ve = errors.firstElement(); // printWarning(warnings); // printError(errors); assertTrue(ve.getReason().startsWith(ValidationErrorImpl.AX_HEAD_ERR)); } COM: <s> this test checks the validity of an rule logic programming rule </s>
funcom_train/8008952
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public HtmlSubmitImage getBrowseImage() { //try { /** get the index of the browse image so we can replace it */ /*int browseIndex = _componentsVec.indexOf(_browseImageHandle); if (browseIndex != -1) { return (HtmlSubmitImage) _componentsVec.elementAt(browseIndex);*/ return _browseImage; //} /*} catch (Exception e) { MessageLog.writeErrorMessage("getBrowseImage", e, this); } return null;*/ } COM: <s> this method returns the browse image </s>
funcom_train/12179527
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testAudioPrefixURL() throws Exception { RuntimeProject project = createNewProject(baseURLString, false); MarinerURL url = project.getPrefixURL(VariantType.AUDIO); assertNotNull("URL should exist", url); assertEquals("Project and test URLs should match", url, new MarinerURL(audioPrefixString)); } COM: <s> test that the audio prefix url is set correctly </s>
funcom_train/34505166
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void putProperty(ConfigurationKeys key, Color c) { putProperty(key.getKey()+".r", c.getRed()); putProperty(key.getKey()+".g", c.getGreen()); putProperty(key.getKey()+".b", c.getBlue()); } COM: <s> puts the given color as property into the </s>
funcom_train/44623826
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void visitJmlTypeClauseDecl(JmlTypeClauseDecl tree) { JavaFileObject old = log.useSource(tree.source); boolean prevAllowJML = jmlresolve.setAllowJML(true); try { attribStat(tree.decl,env); } finally { jmlresolve.setAllowJML(prevAllowJML); log.useSource(old); } } COM: <s> attributes a declaration within a jml annotation that is a </s>
funcom_train/10802609
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void setInto(Configuration conf, Log log) { if (log != null && log.isTraceEnabled()) log.trace(_loc.get("conf-load", getProperties())); if (_props != null) conf.fromProperties(_props); } COM: <s> set properties into configuration </s>
funcom_train/7982440
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private boolean blackListed(String url) { for (int i = 0; i < blacklist.length; i++) { blacklist[i] = blacklist[i].toLowerCase(); url = url.toLowerCase(); if (url.matches(".*" + blacklist[i] + ".*")) { return true; } } return false; } COM: <s> chack if the given url comes from a blacklisted server </s>
funcom_train/9278910
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected Connection newConnection_() throws SQLException { DataSource ds = JDBCDataSource.getDataSource(); // make sure the database is created when running the test // standalone JDBCDataSource.setBeanProperty(ds, "connectionAttributes", "create=true"); return ds.getConnection(); } COM: <s> creates a new connection using a code data source code </s>
funcom_train/5658796
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void valueChanged(TreeSelectionEvent evt) { DefaultMutableTreeNode node = (DefaultMutableTreeNode)tree .getLastSelectedPathComponent(); if(node == null){return;} Object obj = node.getUserObject(); if((obj != null) && (obj instanceof InfoProvider)) { textArea.setText(((InfoProvider)obj).getInfo()); } } COM: <s> method used to update the text area in response to a tree event </s>
funcom_train/26227057
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void constructSSAForm() { SSAVar.init(); findUsedVar(); //process each variables for (int i = 0; i < varUsed.size(); ++i) { if (varUsed.get(i)) { //construct SSAConstructorInfo SSAConstructorInfo varInfo = new SSAConstructorInfo(this, i); findUses(varInfo); //place phi functions placePhiFunctions(varInfo); //renaming renameVariable(varInfo); //add phi in basic block verifyPhiTypes(varInfo); insertPhiFunctions(varInfo); } } } COM: <s> compute the ssa form </s>
funcom_train/18741235
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void addMatchToConflictSet(ReteSimpleMatch m) { Collection<ReteSimpleMatch> c; if (this.conflictSetSearchTree == null) { c = this.conflictSet; } else { c = this.conflictSetSearchTree.getStorageFor(m); } assert !c.contains(m); c.add(m); m.addContainerCollection(c); m.addDominoListener(this); } COM: <s> adds the given match to the conflict set either the plain list </s>
funcom_train/18178887
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean isValid() { StringBuffer buff = new StringBuffer(); //The list of source paths must contain at least one element if (sources.isEmpty()) { buff.append("The list of source paths is null or empty."); this.addErrorMessage(buff.toString()); buff.setLength(0); } //If there are errors, returns false return getErrorMessages().isEmpty()? true: false; } COM: <s> validates this configuration </s>
funcom_train/37646096
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Chatter request(String host, int port) { InstantMessenger im = null; try { im = new InstantMessenger(host, port, this, _activityCallback); // insert the newly created InstantMessager into the list _chatsInProgress.add(im); //_activityCallback.acceptChat(im); im.start(); } catch (IOException e) { } // catch (ConnectException ce) { // } return im; } COM: <s> request a chat connection from the host specified </s>
funcom_train/25749794
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public FileWrapper getFileWrapperDeep(File file) { if (UtilFile.getParentFile(file).equals(this.file)) { if (ParserRegistry.isHTMLFile(getRootScope(), file)) { for (HTMLPair candidate : subHTMLPairs) if (candidate.getFile().equals(file)) return candidate; } else for (FileWrapper candidate : subFiles) if (candidate.getFile().equals(file)) return candidate; } else for (Scope subScope : subScopes) if (subScope.contains(file)) return subScope.getFileWrapperDeep(file); return null; } COM: <s> returns the object under this tt scope tt that represents the given </s>
funcom_train/48337658
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean equals(Object o) { if (this == o) return true; if (! (o instanceof SimpleMacro)) return false; SimpleMacro other = (SimpleMacro)o; return ( (name.equals(other.name)) && (opcode == other.opcode) && (minArgs == other.minArgs) && (maxArgs == other.maxArgs)); } COM: <s> determine whether this simple macro form equals the specified </s>
funcom_train/27762313
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Image getSelectedImage() { if (this.getSelectedItem() == null) { this.setSelectedIndex(0); } ImageIcon tmpIcon = (ImageIcon) ((JLabel) this.getSelectedItem()).getIcon(); return (tmpIcon.getImage()); } COM: <s> returns the icon selected </s>
funcom_train/29268000
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public XSSchema parse(InputSource pSource) throws ParserConfigurationException, SAXException, IOException { XSContext myData = getContext(); parser.set(this); try { return newXSLogicalParser().parse(pSource); } finally { myData.setCurrentContentHandler(null); parser.set(null); } } COM: <s> p parses the given xml schema and returns a logical representation </s>
funcom_train/51533487
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void hookSkin(final Document doc) { selectItemAnim = (SVGAnimationElement) doc.getElementById("selectItem"); backToListAnim = (SVGAnimationElement) doc.getElementById("backToList"); scrollBar.hookSkin(doc); svgList.hookSkin(doc); contactDetails.hookSkin(doc); } COM: <s> hooks the specified sking to the application </s>
funcom_train/2870941
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected String trim(String content) { if (content == null) { return null; } StringBuffer filteredContent = new StringBuffer(""); for (int i = 0; i < content.length(); i++) { char c = content.charAt(i); if (!Character.isWhitespace(c)) { filteredContent.append(c); } } return filteredContent.toString(); } COM: <s> helper method to trim a string of its whitespace including spaces newlines etc </s>
funcom_train/3843699
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void addReferences(ArrayList vlist, IVirtualReference ref) { IVirtualReference elem = null; boolean exist = false; for (int i = 0; i < vlist.size(); i++) { elem = (IVirtualReference) vlist.get(i); if (elem.getReferencedComponent().getName().equalsIgnoreCase( ref.getReferencedComponent().getName())) { exist = true; break; } } if (!exist) { vlist.add(ref); } } COM: <s> check if archive component already exists but how to tell if two </s>
funcom_train/10634130
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testSerializationCompatibility() throws Exception { log.setMethod("testSerializationCompatibility()"); try { ObjectInputStream in = new ObjectInputStream(getClass() .getResourceAsStream( "/serialization/javax/naming/CompositeName.ser")); CompositeName name = (CompositeName) in.readObject(); assertEquals(new CompositeName("a/b/c/d"), name); in.close(); } catch (Exception e) { log.log(e); throw e; } } COM: <s> test serialization compatibility </s>
funcom_train/18458965
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void copy(Animation other) throws SizeConsistencyException { for (int i = 0; i < other.frames.size(); i++) { AnimationFrameManager.getInstance().remove(other.frames.get(i)); } other.frames.clear(); for (int i = 0; i < frames.size(); i++) { AnimationFrame frame = AnimationFrameManager.getInstance() .createEmptyFrame(other); frames.get(i).copy(frame); other.frames.put(i, frame); } other.currentFrame = currentFrame; other.previousTime = previousTime; other.type = type; other.step = step; } COM: <s> makes a distinct copy of the animation into an existing object </s>
funcom_train/18746819
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addPostErrors(GraphState state, Set<PostApplicationError> errors) { Set<PostApplicationError> old = this.postErrors.get(state); if (old == null) { this.postErrors.put(state, errors); } else { errors.addAll(old); } } COM: <s> adds a set of </s>
funcom_train/16510918
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public String getCheckedFolder() { if (isCancelled) return null; Pattern p = Pattern.compile("/"); String[] items = p.split(localPathField.getText()); String folderName = items[items.length - 1]; return localPathField.getText() + System.getProperty("file.separator") + folderName; } COM: <s> returns the checked folders path </s>
funcom_train/1710518
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void createThumbnail(BufferedImage page, int i,boolean highLightThumbnail) { i--; //convert from page to array if(page!=null){ /**add a border*/ Graphics2D g2=(Graphics2D) page.getGraphics(); g2.setColor(Color.black); g2.draw(new Rectangle(0,0,page.getWidth()-1,page.getHeight()-1)); /**scale and refresh button*/ ImageIcon pageIcon=new ImageIcon((Image)page); pageButton[i].setIcon(pageIcon); buttonDrawn[i] = true; } } COM: <s> setup a thumbnail button in outlines </s>
funcom_train/8907406
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public boolean hasNext () { for (; !queue.isEmpty() && ((Candidate)queue.peek()).parentLevel!=targetLevel;) { Candidate candidate = (Candidate)queue.dequeue(); Node node = ((IndexEntry)candidate.entry()).get(true); if (node.level>=targetLevel){ Queues.enqueueAll(queue, expand(candidate, node)); } } return !queue.isEmpty(); } COM: <s> checks whether there exists a next result </s>
funcom_train/34146500
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void placeInnerWidgetHorizontally(double sliderValue) { if (this.verticalBarOnLeft) { int k = 0; if (displayVerticalScrollBar && showScrollbars) k = verticalScrollBar.getMinWidth(); innerWidget.setX(-(int) (sliderValue * getHorizontalScrollSpace()) + k); } else { innerWidget.setX(-(int) (sliderValue * getHorizontalScrollSpace())); } } COM: <s> called by mouse event listeners in scroll bars </s>
funcom_train/28473595
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private JPanel getTypeWeightPanel() { if (typeWeightPanel == null) { typeWeightLabel = new JLabel(); typeWeightLabel.setText("Weight:"); typeWeightLabel.setPreferredSize(new Dimension(180, 16)); typeWeightPanel = new JPanel(); typeWeightPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); typeWeightPanel.add(typeWeightLabel, null); typeWeightPanel.add(getTypeWeightTextField(), null); } return typeWeightPanel; } COM: <s> this method initializes type weight panel </s>
funcom_train/11314988
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void ensureCapacity(int mincap) { incrModCount(); if(mincap > _data.length) { int newcap = (_data.length * 3)/2 + 1; double[] olddata = _data; _data = new double[newcap < mincap ? mincap : newcap]; System.arraycopy(olddata,0,_data,0,_size); } } COM: <s> increases my capacity if necessary to ensure that i can hold at </s>
funcom_train/3543802
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void initTree(Map<Integer, TreeSecurityItem> modelData) { String textColumn = Main.getString("fina2.returns"); Icon branchIcon = Main.getIcon("folder.gif"); Icon leafIcon = Main.getIcon("return_table.gif"); /* Data model for tree */ TreeViewModel model = new TreeViewModel(modelData, textColumn, false); super.initTree(model, branchIcon, leafIcon); } COM: <s> inits the returns tree </s>
funcom_train/18350038
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public CapContext logon(Session session) { //return logon(session.getCapUser().getName(), session.getCapUser().getPassword(), session.getSessionType()); CapUser capUser = session.getCapUser(); return createSessionCapContext(capUser, session.getSessionType(), null); } COM: <s> performs user logon using an existing sessions cap user as the source </s>
funcom_train/2844353
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void setTree(JTree newTree) { if(tree != newTree) { if(tree != null) { tree.removeTreeSelectionListener(this); tree.removeMouseListener(this); } tree = newTree; if(tree != null) { tree.addTreeSelectionListener(this); tree.addMouseListener(this); } if(timer != null) { timer.stop(); } } } COM: <s> sets the tree currently editing for </s>
funcom_train/14327390
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setDataFolder(File dataFolder) throws FileNotFoundException { if (onepointHome == null) { throw new IllegalStateException("OnepointHome not initialized, doe that first!"); } if (!dataFolder.isAbsolute()) { dataFolder = new File(getOnepointHome(), dataFolder.getPath()); } ensureDir(dataFolder); this.dataFolder = dataFolder; } COM: <s> sets the application data folder path of the application </s>
funcom_train/16905337
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void addComponent(){ ArrayList<String> s = new ArrayList<String>(); int i = 0; for(TextBox tb: textBoxes){ s.add(tb.getText().trim()); tb.setText(""); // This is for debugging purposes: //System.out.println(s.get(i)); // Also, remember to do some data validation! i++; } //kate's database code should go here blarg. //she should have an ArrayList called s that contains all the data within the textboxes } COM: <s> this should add the contents of the textboxes to the database </s>
funcom_train/37557656
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setWorkData(Vector data) { Vector theDataVector = ModelHelpers.filteringVectorCopyWithRequiredProperty(data, BaseModel.startTime); extraInfoLabel.setText("Diagram showing " + theDataVector.size() + " of " + data.size() + " supplied resources. (The diagram only shows resources that have a starttime.)"); pointDiagram.setWorkData(theDataVector); } COM: <s> filters and then forwards data to the point diagram </s>
funcom_train/39281588
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public IBatchDescr nextBatch(int timeout) throws InterruptedException { final List buffer = new ArrayList(); int num; // XXX JM: should it be 'if (timeout <= 0)' ? if (timeout == 0) { num = source.dequeueAll(buffer); } else { num = source.blockingDequeueAll(buffer, timeout); } if (num == 0) return null; else return new IBatchDescr() { public List getBatch() { return buffer; } public void batchDone() { buffer.clear(); } }; } COM: <s> returns a single batch for processing by the stages event handler </s>
funcom_train/17847691
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void removePlugin(PluginProxy plugin) throws TvBrowserException { PluginListItem item = getItemForPlugin(plugin); if (item != null) { if (item.getState() == ACTIVATED_STATE) { deactivatePlugin(item, true); } mPluginList.remove(item); mPluginMap.remove(plugin.getId()); mActivatedPluginCache = null; mAllPluginCache = null; } } COM: <s> deactivates a plugin and removes it from the plugin list </s>
funcom_train/14401186
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void setAvailableMode(boolean pIsAvailable) { if (!pIsAvailable) { iToolBar.setEnabled(false); iTreeViewer.getControl().setBackground( iTreeViewer.getControl().getDisplay().getSystemColor( SWT.COLOR_WIDGET_LIGHT_SHADOW)); } else { iToolBar.setEnabled(true); iTreeViewer.getControl().setBackground( iTreeViewer.getControl().getDisplay().getSystemColor( SWT.COLOR_WHITE)); } } COM: <s> disable the toolbar when the root element is unavailable or enable it </s>
funcom_train/25421582
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void parse(String parameter, String field, String delimiter, boolean forceUpper, boolean forceLike) { String parameterType = HttpExpressionBinder.PARAMETERTYPE_STRING; List<Object> bindings = this.getObjectValues(parameter,delimiter,parameterType); if (bindings != null) { this.addBindings(field,bindings.toArray(new String[0]),forceUpper,forceLike); } } COM: <s> parses the http resquest binding parameter values to an sql field </s>
funcom_train/4880340
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Command getItemCommand1 () { if (itemCommand1 == null) {//GEN-END:|38-getter|0|38-preInit // write pre-init user code here itemCommand1 = new Command ("Item", Command.ITEM, 0);//GEN-LINE:|38-getter|1|38-postInit // write post-init user code here }//GEN-BEGIN:|38-getter|2| return itemCommand1; } COM: <s> returns an initiliazed instance of item command1 component </s>
funcom_train/50864258
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void modifyStress(Person person, double time) { double stressModifier = 0D; Iterator<Person> i = person.getLocalGroup().iterator(); while (i.hasNext()) stressModifier-= ((getOpinionOfPerson(person, i.next()) - 50D) / 50D); stressModifier = stressModifier * BASE_STRESS_MODIFIER * time; PhysicalCondition condition = person.getPhysicalCondition(); condition.setStress(condition.getStress() + stressModifier); } COM: <s> modifies the persons stress based on relationships with local people </s>
funcom_train/20997808
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void setCoordinates(int x, int y) { //Logger.print(d_ID() + ".setCoordinates(" + x + ", " + y + ")"); Logger.begin(this, x + ", " + y, true); setX(x); setY(y); Logger.end(this, x + ", " + y); } COM: <s> sets the coordinates of the vector </s>
funcom_train/9873888
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void initMenu() { menu = new JPopupMenu(); JMenuItem saveItem = new JMenuItem("Save History to File", GUIFactory.getIcon("save16.gif")); saveItem.setActionCommand("save"); saveItem.addActionListener(new HistoryListener()); menu.add(saveItem); } COM: <s> initializes the code jpopup menu code </s>
funcom_train/12644636
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public Dimension getMinimumSize() { /* Avoid grabbing the lock if a reasonable cached size value * is available. */ Dimension dim = minSize; if (dim != null && isValid()) { return dim; } synchronized (getTreeLock()) { minSize = isDisplayable() ? new Dimension(1, 1) : getSize(); return minSize; } } COM: <s> gets the mininimum size of this component </s>
funcom_train/40360015
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public void testRenamedProperties() throws Exception { Map<String, List<Value>> expectedProps = createProperties(); expectedProps.put("foo", expectedProps.get(PROP1)); expectedProps.put("bar", expectedProps.get(PROP3)); expectedProps.remove(PROP1); expectedProps.remove(PROP3); checkDocument(createFilter(), expectedProps); } COM: <s> test renames should return all the values of the original property </s>
funcom_train/25921160
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private void displayArea(Area display) { int x = 250; while (x > 100) { try { display.setAlpha(255 - x); Thread.sleep(300); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } x -= 5; } display.setAlpha(255); try { if(display.equals(Screen.getScreen().getBackground())) Screen.getScreen().setActive(Active.BACKGROUND); else Screen.getScreen().setActive(Active.FOREGROUND); } catch (SDLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } COM: <s> function setting transparency coefficient to surface </s>
funcom_train/2883773
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: private Object getStub(String host) throws Exception { Prim reg = null; Rebind stub = null; /** * Get the remote register - if this works increment the count. */ reg = (Prim) SFProcess.getRootLocator().getRootProcessCompound( InetAddress.getByName(host)); /** * Get the component - if this works clear the count. */ stub = (Rebind) reg.sfResolve(name); if (stub instanceof RemoteRebind) { stub = (Rebind) ((RemoteRebind) stub).getDirectObject(); } return stub; } COM: <s> attempts to bind to the given host name </s>
funcom_train/49604173
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: public QuadArea buildHouseRandom(int floors, float ratio) { QuadArea newBuild; do { newBuild = getPolygon().getInsideArea((1 - ratio) * 0.1 + Util.rm.nextGaussian() / 15); } while (!isBuildable(newBuild)); Logger.append(Logger.LAND,"Found a place!"); buildings.add(new Building(newBuild, floors*3, newBuild.getArea()/5)); return newBuild; } COM: <s> takes 60 of the available land to look for a new house </s>
funcom_train/38318248
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected void init (int nPacketID) { byte[] abHeader= new byte[] { (byte)(START_BYTE & 0xff), // magic (byte) (byte)(nPacketID & 0xff), // id (byte) (byte)(0), (byte)(0) // packet size (word) }; // Using super.insert() to modify header. super.insert(abHeader, 0); } COM: <s> initializes the packet </s>
funcom_train/32761287
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
TDAT: protected Transferable createTransferable( final JComponent component ) { final JTable table = (JTable)component; final int[] rows = table.getSelectedRows(); if ( rows.length >= 0 ) { final List<File> files = new ArrayList<File>( rows.length ); for ( final int row : rows ) { final File file = FILE_TABLE_MODEL.getFile( row ); files.add( file ); } return ImageEntry.getTransferable( files ); } else { return null; } } COM: <s> transfer files from the files list to image entries </s>