__key__
stringlengths 16
21
| __url__
stringclasses 1
value | txt
stringlengths 183
1.2k
|
---|---|---|
funcom_train/50347807 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void windowClosing(java.awt.event.WindowEvent e) {
if (JOptionPane.showConfirmDialog(null,
rb.getString("MessageLongCloseWarning"),
rb.getString("MessageShortCloseWarning"),
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
handleQuit();
}
// if get here, didn't quit, so don't close window
}
COM: <s> closing the main window is a shutdown request </s>
|
funcom_train/35007193 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testProcessParams() {
System.out.println("processParams");
ListIterator args = null;//PluginsCMD.argsArrayToListIterator("--tcp-port 4444 --udp-port 4444".split(" "));
PerfMonAgentTool instance = new PerfMonAgentToolEmul();
int expResult = 0;
int result = instance.processParams(args);
assertEquals(expResult, result);
}
COM: <s> test of process params method of class perf mon agent tool </s>
|
funcom_train/4085834 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addVertexWidget( Vec2i loc, Widget widget, int thickness ) {
assert 0 <= loc.x && loc.x <= width : "The x coordinate must be a valid vertex coordinate.";
assert 0 <= loc.y && loc.y <= height : "The y coordinate must be a valid vertex coordinate.";
cells[loc.x][loc.y].addVertexWidget(widget, thickness);
}
COM: <s> adds a the widget to draw at a specific vertex </s>
|
funcom_train/2964379 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addNogood(IntDomainVar[] poslit, IntDomainVar[] neglit) {
if (nogoodStore == null) {
nogoodStore = new ClauseStore(getBooleanVariables(), environment);
postCut(nogoodStore);
}
nogoodStore.addNoGood(poslit, neglit);
propNogoodWorld = this.getWorldIndex();
nogoodStore.constAwake(false);
//put the nogood store last in the static list
}
COM: <s> add a nogood to the solver </s>
|
funcom_train/37012548 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ObjectPool getEffectPool(Class effectType) {
if ( pools.containsKey(effectType) ) {
return (ObjectPool)pools.get(effectType);
}
synchronized ( pools ) {
if ( pools.containsKey(effectType) ) {
return (ObjectPool)pools.get(effectType);
}
ImageEffectPoolableFactory poolableFactory = new ImageEffectPoolableFactory(
effectType);
ObjectPool pool = new StackObjectPool(poolableFactory);
pools.put(effectType,pool);
return pool;
}
}
COM: <s> get an object pool for an image effect class </s>
|
funcom_train/41077229 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getBandYLocation(Band b) {
int y = topMargin;
for (Iterator i = this.bands.iterator(); i.hasNext(); ) {
Band band = (Band) i.next();
if (band != b) {
y += band.getHeight();
} else {
break;
}
}
return y;
}
COM: <s> this function compute the y location of the band </s>
|
funcom_train/48583831 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void parseWith(PsiBuilder builder, PsiBuilder.Marker marker) {
builder.advanceLexer();
if (parseParameterList(builder, marker))
return; // TODO - This isn't correct - the var initialization expressions shouldn't be tagged as parameters!
parseExpression(builder, marker, WITH_BLOCK);
}
COM: <s> enter lexer is pointed at the with token </s>
|
funcom_train/4363678 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void put(Object o) {
synchronized( lock ) {
if( current < last ) {
current++;
pool[current] = o;
} else if( current < max ) {
// realocate
int newSize=pool.length*2;
if( newSize > max ) newSize=max+1;
Object tmp[]=new Object[newSize];
last=newSize-1;
System.arraycopy( pool, 0, tmp, 0, pool.length);
pool=tmp;
current++;
pool[current] = o;
}
if( debug > 0 ) log("put " + o + " " + current + " " + max );
}
}
COM: <s> add the object to the pool silent nothing if the pool is full </s>
|
funcom_train/136745 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void versionCBChanged() {
String versionName = (String) versionCB.getSelectedItem();
if (DEBUG_EVENTS) {
System.out.println("Selected version: " + versionName);
}
if (curGroup != null) {
gmodel.setSelectedSeqGroup(null);
gmodel.setSelectedSeq(null);
}
if (versionName.equals(SELECT_GENOME)) {
// Select the null group (and the null seq), if it's not already selected.
return;
}
setSelectedGroup(versionName);
}
COM: <s> the version name combo box changed </s>
|
funcom_train/4547828 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public MemoryArea getMemoryAreaStart(int startPos) {
MemoryArea ma = null;
int index = 0;
while (ma == null && index < this.getMemoryAreaCount()) {
if (this.getMemoryArea(index).getStartPos() == startPos)
ma = this.getMemoryArea(index);
index++;
}
return (MemoryArea) ma;
}
COM: <s> returns the memory area with a special starting position </s>
|
funcom_train/31346013 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public class LogoutAction extends ComposerAction implements ThreadSafe {
public Map act (Redirector redirector, SourceResolver resolver, Map objectModel, String src, Parameters par) throws Exception {
HashMap map = new HashMap(1);
Request request = (Request) objectModel.get(Constants.REQUEST_OBJECT);
Response response = (Response) objectModel.get(Constants.RESPONSE_OBJECT);
// TODO: log this action
if (Session.removeSession(request.getSession()))
map.put("result", "success");
else
map.put("result", "failure");
COM: <s> handles the users logging out of the system </s>
|
funcom_train/3834471 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean skippable( RandomAccessFile raf ) throws IOException {
try {
while ( true ) {
char ch = (char)raf.readByte();
if ( !Character.isWhitespace( ch ) ) {
System.out.println( "Char " + (int)ch + " @" + raf.getFilePointer() +
" is not a whitespace." );
return false;
}
}
} catch ( EOFException e ) {
return true;
}
}
COM: <s> checks if remaining chars can be skipped </s>
|
funcom_train/47314427 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getStopButton() {
if (stopButton == null) {
stopButton = new JButton();
stopButton.setText(localization
.getProperty("loc-SteeringTab-stopButton"));
stopButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
stopSuit();
}
});
}
return stopButton;
}
COM: <s> this method initializes stop button </s>
|
funcom_train/10790432 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isDroppable(Sequence seq) {
return _openjpaTables
|| (!DBIdentifier.toUpper(seq.getIdentifier()).getName().startsWith("OPENJPA_")
&& !DBIdentifier.toUpper(seq.getIdentifier()).getName().startsWith("JDO_")); // legacy
}
COM: <s> return true if the sequence is droppable </s>
|
funcom_train/48975881 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void restartAt(int imPosn) {
if (numImages != 0) {
if (imPosn < 0 || imPosn > numImages - 1) {
System.out.println("Out of range restart, starting at 0");
imPosn = 0;
}
imPosition = imPosn;
// calculate a suitable animation time
animTotalTime = (long) imPosition * showPeriod;
ticksIgnored = false;
}
}
COM: <s> start showing the images again starting with image number im posn </s>
|
funcom_train/1682505 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createDialog(final String prompt) {
dialog = new JFrame(prompt);
dialog.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
latch = new CountDownLatch(1);
labelUser = new JLabel("Username");
labelPass = new JLabel("Password");
user = new JTextField();
pass = new JPasswordField();
ok = new JButton("OK");
}
COM: <s> creates the dialog </s>
|
funcom_train/48103600 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String findLastestUserIdeas() {
idea.setIsShow(1);
int pageCount = this.ideaService.findSwdUserIdeaCount(idea);
Page page = new Page (curPage, 13, pageCount);
loger.debug("curPage is : " + curPage + " pageCount is : " + pageCount);
this.userIdeaList = this.ideaService.findSwdUserIdea(idea, page);
getRequest().setAttribute("page", page);
return "userIdeaList";
}
COM: <s> the user entry </s>
|
funcom_train/23071088 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Name getName() {
Name name;
name = getCurrentName();
if (referenceTimeChanged || name==null) {
name = new Name();
name.setFirst(getDetailValue(PersonDetailTypeConstant.NAME_FIRST));
name.setMiddle(getDetailValue(PersonDetailTypeConstant.NAME_MIDDLE));
name.setAlias(getDetailValue(PersonDetailTypeConstant.NAME_ALIAS));
name.setLast(getDetailValue(PersonDetailTypeConstant.NAME_LAST));
name.setSuffix(getDetailValue(PersonDetailTypeConstant.NAME_SUFFIX));
}
return name;
}
COM: <s> gets a populated name object with reference </s>
|
funcom_train/23031843 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public SComponent getComponent() {
if (component == null) {
layouter = createLayouter(createLayoutInstruction());
layouter.addVisibilityListener(this);
component = layouter.build(getComponentProvider());
environment.setContentPane(component);
installTools();
initializeForm();
if (object != null)
visibilityChanged(layouter.getVisibles());
}
return component;
}
COM: <s> lazily construct the wings component according to the provided </s>
|
funcom_train/4393431 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: // public int getNumberOfAssignedQueryNodes (List<String> qIDList) {
// int numberOfAssignedQueryNodes = 0;
// for (Assign ass : assigns) {
// if ((ass.getProcessNodeID() != null) && (qIDList.contains(ass.getQuerynodeID()))) {
// numberOfAssignedQueryNodes++;
// }
// }
// return numberOfAssignedQueryNodes;
// }
COM: <s> returns number of assigned query nodes which also appear in the given </s>
|
funcom_train/4404081 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void performInitialisation() {
try {
((InitialisationOperator_Element) this.getTemplate().getObjectProperty("ElementInitialisationOperator")).initialise(this);
} catch (NullPointerException e) {// "[\""+this.getName()+"\"]"+
Display.error("" + this.getClass().getName() + "::performInitialisation(.) - no operator available");
}
}
COM: <s> initialise this element this method may be overridden with an empty </s>
|
funcom_train/49076258 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void printQueueInfo(JobScheduler scheduler) throws JobScheduleError {
List<JobQueueInfo> info = scheduler.getAppliedQueuesInfo();
Iterator<JobQueueInfo> it = info.iterator();
logger.info("*** job sched. queue info update ***");
while(it.hasNext()) {
logger.info( it.next().toString() );
}
}
COM: <s> prints out queue information the given scheduler is monitoring </s>
|
funcom_train/32656749 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void saveAs(DataSource dataSource) throws Exception {
File file = null;
if(dataSource instanceof FileDataSource) {
FileDataSource fileDataSource = (FileDataSource)dataSource;
file = new File(fileDataSource.getFile().getPath());
}
else {
file = new File(dataSource.getName());
}
classTree.saveAsClassFile(file);
setTitle(dataSource.getName());
}
COM: <s> saves the content of the editor as external file </s>
|
funcom_train/22597208 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addArguments(String... args)
{ if(args.length % 2 == 1) throw new IllegalArgumentException(
"Argument number must be even, name or type missed");
for(int i=0; i<args.length; i+=2)
{ arguments.put(args[i+1], args[i]);
}
}
COM: <s> adds arguments to function arguments are type name type name </s>
|
funcom_train/27976458 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setMaterial (int material) {
this.material = material;
switch (material) {
case PAPER:
this.density = 2;
break;
case GLASS:
this.density = 1;
break;
case WOOD:
this.density = 5;
break;
case STONE:
this.density = 8;
break;
case IRON:
this.density = 10;
break;
}
// TODO: Notify observers.
}
COM: <s> change the material that this item is made of </s>
|
funcom_train/34341038 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getRetorna() {
if (Retorna == null) {//GEN-END:|18-getter|0|18-preInit
// write pre-init user code here
Retorna = new Command("Retornar", Command.EXIT, 0);//GEN-LINE:|18-getter|1|18-postInit
// write post-init user code here
}//GEN-BEGIN:|18-getter|2|
return Retorna;
}
COM: <s> returns an initiliazed instance of retorna component </s>
|
funcom_train/10016861 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean containsEvent(EventAbstract evt) {
String name = evt.getFullyQualifiedLongName();
boolean results = false;
if(!isTransitioned())
results = eventListOrderedNotTransitioned.contains(name);
else
results = eventListOrderedTransitioned.contains(name);
if(results)
evt.setRepeatFind(true);
else
evt.setRepeatFind(false);
return results;
}
COM: <s> is this event already been procesed </s>
|
funcom_train/1173743 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addManaToFloating(String manaStr, Card card) {
ArrayList<Mana> manaList = convertStringToMana(manaStr, card);
for (Mana m : manaList) {
addManaToPool(floatingMana, m);
}
AllZone.getGameAction().checkStateEffects();
}
COM: <s> p add mana to floating </s>
|
funcom_train/50697111 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void update(Object obj) throws HibernateException {
Session session = null;
try {
session = HibernateUtil.currentSession();
if (obj instanceof ModificationDatePersistableObject) {
((ModificationDatePersistableObject) obj).setModificationDate(new Date());
}
session.update(obj);
} catch (HibernateException e) {
log.log(Level.WARNING, "HibernateException caught.", e);
} finally {
HibernateUtil.closeSession();
}
}
COM: <s> add an object </s>
|
funcom_train/35893778 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
if ("UssdServices".equals(portName)) {
setUssdServicesEndpointAddress(address);
}
else
{ // Unknown Port Name
throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
}
}
COM: <s> set the endpoint address for the specified port name </s>
|
funcom_train/31125488 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void paintPath(Graphics2D g2d) {
Path path = model.getPath();
if(path != null) {
Iterator <Waypoint> path_iter = path.iterator();
Waypoint curWP = new Waypoint(model.getRobotPose());
g2d.setColor(colors[PATH_COLOR_INDEX]);
while(path_iter.hasNext()) {
Waypoint nextWP = path_iter.next();
Line line = new Line(getX(curWP.x), getY(curWP.y), getX(nextWP.x), getY(nextWP.y));
g2d.draw(line);
curWP = nextWP;
}
}
}
COM: <s> paint the path </s>
|
funcom_train/10793883 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setJoinable(Column col, Joinable joinable) {
// don't let non-pk override pk
Joinable join = (Joinable) _joinables.get(col);
if (join == null || (join.getFieldIndex() != -1
&& getField(join.getFieldIndex()).getPrimaryKeyIndex() == -1))
_joinables.put(col, joinable);
}
COM: <s> add the given column to joinable mapping </s>
|
funcom_train/21483655 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void assertIncludeHeadersSane(WebResponse response) {
String contentType = response.getHeaderField(CONTENT_TYPE);
assertTrue(contentType == null
|| contentType.startsWith("text/html")
|| contentType.startsWith("text/plain"));
String contentLength = response.getHeaderField(CONTENT_LENGTH);
//assertTrue(contentLength == null || contentLength.equals("0"));
assertNull(response.getHeaderField(CONTENT_ENCODING));
}
COM: <s> subtle problems can occur when headers disagree with the content </s>
|
funcom_train/5375085 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean isMethodNativeIgnored(MethodDeclaration node) {
if ((node.getModifiers() & Modifier.NATIVE) != 0) {
if (isDebugging() && getJ2SDocTag(node, "@j2sDebug") != null) {
return false;
}
if (getJ2SDocTag(node, "@j2sNative") != null) {
return false;
}
return true;
}
return true; // interface!
}
COM: <s> native method without j2s debug or j2s native tag should be ignored </s>
|
funcom_train/35845835 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void updateTabToDo() {
// TODO: TabToDo should listen for an event that this fires so that we
// can decouple from the ProjectBrowser. - tfm
TabToDo ttd =
(TabToDo) ProjectBrowser.getInstance().getTab(TabToDo.class);
JPanel ws = getWizard().getCurrentPanel();
if (ws instanceof WizStep) {
((WizStep) ws).setTarget(target);
}
ttd.showStep(ws);
}
COM: <s> set the target and make visible </s>
|
funcom_train/9395204 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String substring(int start) {
if (0 <= start && start <= count) {
if (start == count) {
return ""; //$NON-NLS-1$
}
// Remove String sharing for more performance
return new String(value, start, count - start);
}
throw new StringIndexOutOfBoundsException(start);
}
COM: <s> returns the string value of the subsequence from the </s>
|
funcom_train/14462495 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void initChartRecords() {
// Turn it into a static array initially to speed up random access
BiffRec[] bArr = new BiffRec[chartRecs.size()];
bArr = (BiffRec[])chartRecs.toArray(bArr);
this.initChartObject(this, bArr);
}
COM: <s> take the initial array of records for the chart and create a </s>
|
funcom_train/40841001 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean setEntries(CharSequence[] entry) {
Log.d(TAG, "setEntries()");
boolean updated = false;
if (this.entry == null) {
if (this.state == null) {
updated = true;
} else if (entry.length == this.state.length) {
updated = true;
}
} else if (entry.length == this.entry.length) {
updated = true;
}
if (updated) {
this.entry = entry;
}
return (updated);
}
COM: <s> set the entries to something new </s>
|
funcom_train/18875782 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void insertBeforeWaypoint(GpxWaypointRecord wpt1, GpxWaypointRecord wpt2) {
//if the file is not empty
if (points.size()>0){
//get the index of the active waypoint
int index = points.indexOf(wpt2);
//if it is the last one then add a waypoint
if (index == points.size()){
points.add(wpt1);
}else{
//insert a waypoint before the selected one
points.insertElementAt(wpt1, index);
}
}else{
//first point, just add at the end of the file
points.add(wpt1);
}
}
COM: <s> insert the wpt1 before wpt2 </s>
|
funcom_train/9218321 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String resolveAlias(String string) {
String key = null;
if(string != null)
key = string.toLowerCase();
String value = null;
if (typeAliases.containsKey(key)) {
value = (String) typeAliases.get(key);
} else {
value = string;
}
return value;
}
COM: <s> lookup an aliased class and return its real name </s>
|
funcom_train/40359979 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testMultipleFiltersSamePropertyNoMatch() throws Exception {
DocumentFilterChain chain = new DocumentFilterChain(factoryList(
newFactory(PROP1, "foobar", SPACE), newFactory(PROP3, "xyzzy", SPACE)));
checkDocument(chain.newDocumentFilter(createDocument()), createProperties());
}
COM: <s> test that multiple filters looking for non matching things </s>
|
funcom_train/44011681 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSetObjectAlreadyInDB() {
System.out.println("setObjectAlreadyInDB");
boolean objectAlreadyInDB = true;
BusinessObject instance = new BusinessObject();
instance.setObjectAlreadyInDB(objectAlreadyInDB);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
COM: <s> test of set object already in db method of class edu </s>
|
funcom_train/40477962 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initParams() {
glContext.viewport(0, 0, webGLCanvas.getOffsetWidth(), webGLCanvas.getOffsetHeight());
// Set the background color
glContext.clearColor(0.0f, 0.0f, 0.0f, 1.0f);
// Set the clear depth (everything is cleared)
glContext.clearDepth(1.0f);
// Activate depth test and set the depth function
glContext.enable(WebGLRenderingContext.DEPTH_TEST);
glContext.depthFunc(WebGLRenderingContext.LEQUAL);
checkErrors();
}
COM: <s> initialized the params of web gl </s>
|
funcom_train/1164921 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public User createFriendship(String id) throws WeiboException {
// return new User(http.post(getBaseURL() + "friendships/create/" + id + ".xml", new PostParameter[0], true), this);
return new User(http.post(getBaseURL() + "friendships/create/" + id + ".json", new PostParameter[0], true).asJSONObject());
}
COM: <s> befriends the user specified in the id parameter as the authenticating user </s>
|
funcom_train/8089665 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setNumInstances(Random r) {
if (m_MaxInstNum > m_MinInstNum)
m_numInstances = (int)(r.nextDouble()
* (m_MaxInstNum - m_MinInstNum) + m_MinInstNum);
else
m_numInstances = m_MinInstNum;
}
COM: <s> sets the real number of instances for this cluster </s>
|
funcom_train/28425818 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void refresh(IFtpConfig cfg) {
fonfig = cfg;
if (fonfig != null) {
IConnectionManager conManager = fonfig.getConnectionManager();
connections = conManager.getAllConnections();
conManager.setObserver(this);
}
else {
connections.clear();
}
fireTableChanged(new TableModelEvent(this));
}
COM: <s> reload the model </s>
|
funcom_train/3919682 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public RolePart findGlobalRolePart(String idref) {
RolePart rolePart = null;
if(idref != null) {
DataComponent dc = getMethod().getChildByIdentifer(idref, true);
if(dc instanceof RolePart) {
rolePart = (RolePart)dc;
}
}
return rolePart;
}
COM: <s> find a role part by its idref </s>
|
funcom_train/47275830 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int write(final Label theLabel) {
final int myWH = theLabel.getImage().width * theLabel.getImage().height;
for (int i = 0; i < myWH; i++) {
theLabel.getImage().pixels[i] = 0x00ffffff;
theLabel.getImageMask().pixels[i] = 0xff000000;
}
final int myHeight = writeCharacters(theLabel);
theLabel.getImage().mask(theLabel.getImageMask());
return myHeight;
}
COM: <s> write a label to the display window </s>
|
funcom_train/45622604 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addToolsVersionPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ProjectType_toolsVersion_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ProjectType_toolsVersion_feature", "_UI_ProjectType_type"),
MSBPackage.eINSTANCE.getProjectType_ToolsVersion(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the tools version feature </s>
|
funcom_train/45462542 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getItemCommand () {
if (itemCommand == null) {//GEN-END:|23-getter|0|23-preInit
// write pre-init user code here
itemCommand = new Command ("Calculate", Command.ITEM, 0);//GEN-LINE:|23-getter|1|23-postInit
// write post-init user code here
}//GEN-BEGIN:|23-getter|2|
return itemCommand;
}
COM: <s> returns an initiliazed instance of item command component </s>
|
funcom_train/20240210 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getCmdNovoTipoGR() {
if (cmdNovoTipoGR == null) {//GEN-END:|167-getter|0|167-preInit
// write pre-init user code here
cmdNovoTipoGR = new Command("Novo", Command.OK, 0);//GEN-LINE:|167-getter|1|167-postInit
// write post-init user code here
}//GEN-BEGIN:|167-getter|2|
return cmdNovoTipoGR;
}
COM: <s> returns an initiliazed instance of cmd novo tipo gr component </s>
|
funcom_train/1929508 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void step(Ant a) {
if (a.getHasFood() || a.getPosition().getFood() == 0)
a.setState(hasFoodAlready);
else {
a.getPosition().setFood(a.getPosition().getFood() -1);
a.setHasFood(true);
a.setState(newFood);
}
}
COM: <s> pick up food if possible </s>
|
funcom_train/21087570 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addAuthorPropertyDescriptor(Object object) {
itemPropertyDescriptors.add(createItemPropertyDescriptor(
((ComposeableAdapterFactory) adapterFactory)
.getRootAdapterFactory(), getResourceLocator(),
getString("_UI_SNI_Element_author_feature"),
getString("_UI_SNI_Element_author_description"),
SNI_Package.Literals.SNI_ELEMENT__AUTHOR, true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
getString("_UI_ElementPropertyCategory"), null));
}
COM: <s> this adds a property descriptor for the author feature </s>
|
funcom_train/9385477 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isJavaString(ITypeBinding type) {
for (; type != null; type = type.getSuperclass()) {
if (CLASS_JAVA_STRING.equals(type.getQualifiedName()) ||
CLASS_JAVA_CHAR_SEQUENCE.equals(type.getQualifiedName())) {
return true;
}
}
return false;
}
COM: <s> returns true if this type binding represents a string or char sequence type </s>
|
funcom_train/3668137 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getCategories() throws ToolBoxException {
List cat = new ArrayList();
IToolBox[] toolBoxes = ToolBoxManager.getInstance()
.getAvaliableToolboxes();
for (int i = 0; i < toolBoxes.length; i++) {
IToolBox box = toolBoxes[i];
ILibrary[] lib = box.getLibraries();
for (int j = 0; j < lib.length; j++) {
cat.addAll(Arrays.asList(lib[j].getCategories()));
}
}
return cat;
}
COM: <s> gets a list of all library categories </s>
|
funcom_train/7421494 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addSourceFor(Transition transition, Output output) {
if ((this.sourceFor.size() > 0) && (this.targetFor.size() > 1)) {
output.addError("This gateway " +
" is a merge gateway and can not have multiple"+
" outgoing transitions.", getId());
} else {
super.addSourceFor(transition, output);
}
}
COM: <s> checks if the gateway has already multiple incoming transitions </s>
|
funcom_train/45248224 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JNumberFloatField getJNumberFloatFieldTaxaGTR() {
if (jNumberFloatFieldTaxaGTR == null) {
jNumberFloatFieldTaxaGTR = new JNumberFloatField();
jNumberFloatFieldTaxaGTR.setLocation(new Point(345, 216));
jNumberFloatFieldTaxaGTR.setSize(new Dimension(65, 20));
}
return jNumberFloatFieldTaxaGTR;
}
COM: <s> this method initializes j number float field taxa gtr </s>
|
funcom_train/29870343 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenuItem getJMenuItemSaveAllNotes() {
if (jMenuItemSaveAllNotes == null) {
jMenuItemSaveAllNotes = new JMenuItem();
jMenuItemSaveAllNotes.setText("Save All Notes");
jMenuItemSaveAllNotes.setMnemonic(KeyEvent.VK_S);
jMenuItemSaveAllNotes.addActionListener(getJMenuListener());
}
return jMenuItemSaveAllNotes;
}
COM: <s> this method initializes j menu item save all notes </s>
|
funcom_train/43915972 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isURLEncoded(HttpServletRequest req) {
//Get the content type from the request
String contentType = req.getContentType();
//If there is no content type, then it is not multipart
if (contentType == null) {
return false;
}
//If it starts with multipart/ then it is multipart
return contentType.toLowerCase().startsWith(URLENCODED);
}
COM: <s> a method that decides if a request is a multipart request </s>
|
funcom_train/4160238 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Date toDate(int i) {
int dateOfMonth = i % 100;
i /= 100;
int month = i % 100;
i /= 100;
int year = i;
if (year < 1000)
year += 1900;
calendar.clear();
calendar.set(year, month - 1, dateOfMonth);
int parsedYear = calendar.get(Calendar.YEAR);
return calendar.getTime();
}
COM: <s> convert an integer yymmdd or yyymmdd or yyyymmdd to java </s>
|
funcom_train/28353517 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Connection getDatabaseConnection() {
if ( _databaseConnection == null ) {
final ConnectionDictionary dictionary = ConnectionDictionary.defaultDictionary();
final ConnectionDialog dialog = ConnectionDialog.getInstance( this, dictionary );
final DatabaseAdaptor adaptor = dictionary != null ? dictionary.getDatabaseAdaptor() : DatabaseAdaptor.getInstance();
_databaseConnection = dialog.showConnectionDialog( adaptor );
}
return _databaseConnection;
}
COM: <s> get the database connection creating a new one if necessary </s>
|
funcom_train/1602490 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean appointmentExists(int id) {
boolean aExists = false;
try {
Class.forName("org.sqlite.JDBC");
conn = DriverManager.getConnection("jdbc:sqlite:"+ databaseName);
prep = conn.prepareStatement("select * from APPOINTMENT where id = ?;");
prep.setInt(1, id);
rs = prep.executeQuery();
aExists = rs.next();
conn.close();
} catch (SQLException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
return aExists;
}
COM: <s> function to check if an appointment exists in the database </s>
|
funcom_train/35324075 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setLevel(int level) {
if ((level < 0 || level > 9) && level != DEFAULT_COMPRESSION) {
throw new IllegalArgumentException("invalid compression level");
}
synchronized (zsRef) {
if (this.level != level) {
this.level = level;
setParams = true;
}
}
}
COM: <s> sets the current compression level to the specified value </s>
|
funcom_train/27844175 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testClearConvertRule() throws Exception {
ConvertRule rule = new ConvertRule(TEST, TEST_LABEL);
_ruleConverter.addConvertRule(rule);
assertNotNull(_ruleConverter.getConvertRule(TEST));
_ruleConverter.clearConvertRule(TEST);
assertNull(_ruleConverter.getConvertRule(TEST));
}
COM: <s> method test clear convert rule is testing clear convert rule </s>
|
funcom_train/17902128 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int incrementHistoryNum() {
// for previous
Vector<String> history = getSqlCommandHistory();
if (!history.isEmpty()) {
int historyCount = history.size();
if (currentStatementHistoryIndex < historyCount - 1) {
currentStatementHistoryIndex++;
}
queryEditor.setHasNextStatement(true);
if (currentStatementHistoryIndex == historyCount - 1) {
queryEditor.setHasPreviousStatement(false);
}
}
return currentStatementHistoryIndex;
}
COM: <s> increments the history index value </s>
|
funcom_train/3080151 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ImagePeer getImagePeer(ImageReference imageRef) {
ImagePeer imagePeer = loadPeer(imageRef);
if (imagePeer == null) {
imagePeer = ImagePeerFactory.createImagePeer(imageRef);
storePeer(imageRef, imagePeer);
imagePeer.setId(instancePeer.generateId());
}
imagePeer.setRecency(++currentRecencyValue);
return imagePeer;
}
COM: <s> returns an image peer for the specified image </s>
|
funcom_train/10009447 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void adjustRemoveButton() {
boolean enabled = !eventList.isSelectionEmpty();
for (Object item : eventList.getSelectedValues()) {
EventWrapper wrapper = (EventWrapper) item;
if (wrapper.getEvent().isGenerated()) {
enabled = false;
break;
}
}
removeEventAction.setEnabled(enabled);
}
COM: <s> makes the remove event button enabled or disabled depending on if there </s>
|
funcom_train/46825686 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void paintComponent (Graphics g) {
g.setColor (color);
g.fillRect (0, 0, getWidth(), getHeight());
if (border) {
g.setColor (Color.black);
g.drawRect (0, 0, getWidth() - 1, getHeight() - 1);
g.setColor (Color.white);
g.drawRect (1, 1, getWidth() - 3, getHeight() - 3);
}
}
COM: <s> override the paint component to set the colour of the box </s>
|
funcom_train/48143078 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public DoubleMatrix mapElements(final Mapping f) {
final double array[]=new double[numRows];
array[0]=f.map(diag[0]);
for(int i=1;i<numRows;i++)
array[i]=f.map(diag[i]);
return new DoubleDiagonalMatrix(array);
}
COM: <s> applies a function on all the matrix elements </s>
|
funcom_train/6290045 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isContentRaw() {
if (getBodyPart().convertedContentMode()) {
return true;
} else {
return (bodyPart.getHeader().getEncoding() == BodyPart.ENC_BASE64 &&
bodyPart.getHeader().getCharSet() == BodyPart.CH_NORMAL) ?
true :
false;
}
}
COM: <s> returns true if the content stored in this storage is raw data </s>
|
funcom_train/47906322 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void paint(Graphics g) {
prepareComponent();
if (image == null) {
return;
}
// Draw picture;
int[] pos = {x + padding, y + padding - yOffset};
g.drawImage(image, pos[0], pos[1], Graphics.LEFT | Graphics.TOP);
}
COM: <s> paints the image box </s>
|
funcom_train/7856054 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
String full = "";
for (int i=0; i<size(); i++) {
full += this.get(i)+";";
}
//TODO: improve efficiency here by using if(i!=size()-1)
if (full.endsWith(";"))
full = full.substring(0, full.length()-1);
return full;
}
COM: <s> returns a string representation of this list </s>
|
funcom_train/46678807 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public SyncPoint makeCopy(){
SyncPoint result = new SyncPoint();
result.setID(this.getID());
result.setFormat(this.getFormat());
result.setOffset(this.getOffset());
result.setText(this.getText());
return result;
}
COM: <s> returns a copy of this object </s>
|
funcom_train/42907613 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String createNormalizedPath(String path) {
if (path == null) {
return null;
}
String p = path;
while (p.contains("//")) {
p = p.replace("//", "/");
}
try {
return URI.create(p).normalize().getPath();
} catch (IllegalArgumentException e) {
log.warn("Could not convert path to correct URI for #0", path);
return null;
}
}
COM: <s> performs the standard </s>
|
funcom_train/51252974 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void validateAndEnable () {
List<EditorValidationError> errors = this.editor.validateEditor();
setOkAllowed(errors.isEmpty());
if (!errors.isEmpty()) {
StringBuilder sb = new StringBuilder();
sb.append("<html><b>").append(resources.getString("error.title")).append("<ul>");
for (EditorValidationError e: errors) {
sb.append("<li>").append(e.getMessage()).append("</li>");
}
sb.append("</ul></html>");
setErrorText(sb.toString());
} else {
cleanError();
}
}
COM: <s> validates the editor and sets the ok buttons state accordingly </s>
|
funcom_train/925694 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public RadiusAttribute getAttribute(String type) {
if (type == null || type.length() == 0)
throw new IllegalArgumentException("type name is empty");
AttributeType t = dictionary.getAttributeTypeByName(type);
if (t == null)
throw new IllegalArgumentException("unknown attribute type name '" + type + "'");
return getAttribute(t.getVendorId(), t.getTypeCode());
}
COM: <s> returns a single radius attribute of the given type name </s>
|
funcom_train/18569928 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void xtestIsJoinPointExcludedTrue() {
// TODO: this test commented because it fails with a noclassdef found
// error when running the unit test under AspectJ
// TODO: this is currently hardcoded to excluded EasyMock
classType = TestCase.class;
boolean isExcluded =
aspectwerkzAspectUtils.isJoinPointExcluded(classType);
assertTrue(isExcluded);
}
COM: <s> test that the is join point excluded method returns true </s>
|
funcom_train/8528373 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean containsMimeType(Set<String> filenames, Map<String, String> mimetypes, String prefix) {
for (Iterator<String> it = filenames.iterator(); it.hasNext(); ) {
String filename = it.next();
//RD20080905: fixed an IndexOutOfBoundException
int i = filename.lastIndexOf('.');
if (i==-1){
continue;
}
String suffix = filename.substring(i);
String mime = mimetypes.get(suffix);
if (null == mime) {
continue;
}
if (mime.startsWith(prefix)) {
return true;
}
}
return false;
}
COM: <s> returns tt true tt if the set of files contains a file with </s>
|
funcom_train/26324693 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getAsInt() {
switch (_storedAs) {
case LONG:
return (int)_long;
case DOUBLE:
return (int)_double;
case OBJECT:
if (_object.toString().trim().equals("")) {
return 0;
} else {
return Integer.parseInt(_object.toString().trim());
}
default:
throw new NumberFormatException();
}
}
COM: <s> returns an int representation of this value </s>
|
funcom_train/38253130 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean trimUpdateRegion(Rectangle region) {
int imgWidth = offscreenImage.getWidth();
if (region.x + region.width > imgWidth) {
region.width = imgWidth - region.x;
}
int imgHeigth = offscreenImage.getHeight();
if (region.y + region.height > imgHeigth) {
region.height = imgHeigth - region.y;
}
return ((region.width == imgWidth) && (region.height == imgHeigth));
}
COM: <s> adjust the width and height of the region so that the </s>
|
funcom_train/40513199 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void listAllObjectRelations() {
allCurrentRelations = new HashMap<UMLClass, Integer>();
for(ObjectRelation objectRelation : objectDiagram.getObjectRelations()) {
if (objectRelation.getLeftObject().equals(umlObject)) {
UMLClass umlClass = objectRelation.getRightObject().getInstantiatedClass();
addOrIncrementNumberOfCurrentRelations(umlClass);
}
}
}
COM: <s> list all the relations the object currently has </s>
|
funcom_train/9497773 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: final public boolean isSpecificPossible() {
switch (type) {
case CONIC_CIRCLE :
case CONIC_DOUBLE_LINE :
case CONIC_INTERSECTING_LINES :
case CONIC_PARALLEL_LINES :
return true;
case CONIC_ELLIPSE :
case CONIC_HYPERBOLA :
// xy vanished
return kernel.isZero(matrix[3]);
case CONIC_PARABOLA :
// x\u00b2 or y\u00b2 vanished
return kernel.isZero(matrix[0]) || kernel.isZero(matrix[1]);
default :
return false;
}
}
COM: <s> returns whether specific equation representation is possible </s>
|
funcom_train/46434029 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setStream(XSizeInputStream stream) {
if (stream != null) {
if (stream.getSize() == XSizeInputStream.UNKNOW_STREAM_SIZE) {
stream.setSize(this.size); // if the stream doesn't have the sized set, use the persisted value
}
this.stream = stream;
}
}
COM: <s> sets the input stream to be written into the database </s>
|
funcom_train/15867416 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public OEAgent addAgent(String agName) throws MoiseException {
if (getAgent(agName) != null) {
throw new MoiseException("An agent named '"+agName+"' already exists in this OE!");
}
OEAgent ag = new OEAgent(agName);
agents.put(ag.getId(),ag);
ag.setOE(this);
return ag;
}
COM: <s> adds an agent in the oe </s>
|
funcom_train/4286206 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addDestinationOfPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Class_destinationOf_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Class_destinationOf_feature", "_UI_Class_type"),
UmlMMPackage.Literals.CLASS__DESTINATION_OF,
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the destination of feature </s>
|
funcom_train/43902500 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testAuthority() {
final Citation authority = factory.getAuthority();
assertNotNull(authority);
assertEquals("European Petroleum Survey Group", authority.getTitle().toString());
assertTrue(authority.getIdentifiers().contains("EPSG"));
assertFalse(authority.getIdentifiers().contains("ESRI"));
assertTrue(factory instanceof FactoryUsingWKT);
}
COM: <s> tests the authority code </s>
|
funcom_train/40736080 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setMailHost(String newVal) {
if ((newVal != null && mailHost != null && (newVal.compareTo(mailHost) == 0)) ||
(newVal == null && mailHost == null && mailHostIsInitialized)) {
return;
}
mailHost = newVal;
mailHostIsModified = true;
mailHostIsInitialized = true;
}
COM: <s> setter method for mail host </s>
|
funcom_train/32144848 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private long count(String table) throws Exception {
Connection con = getConnection(connectionInfo);
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select count(*) from " + table);
long count = 0;
while (rs.next()) {
count = rs.getLong(1);
}
rs.close();
stmt.close();
return count;
}
COM: <s> counts the rows of the table </s>
|
funcom_train/10204984 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addDefaultValueLiteralPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_MStructuralFeature_defaultValueLiteral_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_MStructuralFeature_defaultValueLiteral_feature", "_UI_MStructuralFeature_type"),
ClassDiagramPackage.Literals.MSTRUCTURAL_FEATURE__DEFAULT_VALUE_LITERAL,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the default value literal feature </s>
|
funcom_train/5236518 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void drawCellContent(GC gc, Rectangle rect, int row, int col) {
this.foreground = this.getDefaultForeground();
this.background = this.getDefaultBackground();
// initial color for current cell.
initialCellContentColor(row, col);
// Clear background.
clearCellContentRect(gc, rect);
// draw text and image in the given area.
doDrawCellContent(gc, rect, row, col);
}
COM: <s> draws the cell content </s>
|
funcom_train/48053655 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void saveDOM(final File file) {
saveAsAction.setEnabled(false);
saveAction.setEnabled(false);
DocumentSaveWorker worker = new DocumentSaveWorker(file);
MainWindow.getStatusBar().addWorker(worker);
worker.getPropertyChangeSupport().addPropertyChangeListener("state", saveWorkerListener);
worker.execute();
}
COM: <s> creates a xml dom tree and saves it in a file </s>
|
funcom_train/51298077 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSpecification(SpecificationSupplierPriceList sp) {
this.sp = sp;
tfBarCode.setText("" + sp.getGoods().getBarcode());
tfName.setText(sp.getGoods().getName());
tfCurrPrice.setText("" + sp.getSupplierPrice());
tfDiscount.setText("" + sp.getDiscount());
tfUnit.setText(sp.getStringMeasure());
}
COM: <s> sets specs info into textfields </s>
|
funcom_train/1150182 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public RMIMessage getRMIServer() throws RemoteException {
Registry registry = LocateRegistry.getRegistry(BREADBOX_SERVER_PORT);
RMIMessage server = null;
try {
server = (RMIMessage)registry.lookup("pastryServer");
} catch (NotBoundException e) {
System.err.println("Registry error: Registry not bound");
System.exit(1);
} catch (ConnectException e) {
System.err.println("Registry error: Connection failed");
System.exit(1);
}
// return the reference to the server for use by other client classes
return server;
}
COM: <s> sets up the rmi connection to the server </s>
|
funcom_train/11673816 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getPlugins(final Class pluginClass) {
synchronized (pluginMap) {
List pluginList = new ArrayList(pluginMap.size());
Iterator iter = pluginMap.values().iterator();
while (iter.hasNext()) {
Object plugin = iter.next();
if (pluginClass.isInstance(plugin)) {
pluginList.add(plugin);
}
}
return pluginList;
}
}
COM: <s> returns all the plugins for a given repository that are instances </s>
|
funcom_train/7580047 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void train(int building, int unitType) {
//System.out.println("Proxybot: TRAIN " + building + " " + unitType);
String response =
sendAndReceiveMessage("COMMAND " + building + " 3 " + unitType + " \n", true);
//System.out.println("Proxybot: response is: " + response);
}
COM: <s> train new units at barrack town hall etc </s>
|
funcom_train/25058017 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void launch(ProcessDef processDef, Long taskId) {
ProcessData processData = new ProcessData();
processData.putItem(IProcessData.PROCESS_ID, taskId);
processData.putItem(IProcessData.TASK, loadTask(taskId));
launch(processDef, processData);
}
COM: <s> launches code process def code for the supplied taskid </s>
|
funcom_train/33380807 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void procedures(PyObject qualifier, PyObject owner, PyObject procedure) {
clear();
try {
String q = qualifier == Py.None ? null : (String) qualifier.__tojava__(String.class);
String o = owner == Py.None ? null : (String) owner.__tojava__(String.class);
String p = procedure == Py.None ? null : (String) procedure.__tojava__(String.class);
create(this.connection.getMetaData().getProcedures(q, o, p));
} catch(SQLException e) {
throw zxJDBC.newError(e);
}
}
COM: <s> gets a description of the stored procedures available for the qualifier and owner </s>
|
funcom_train/44585920 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void offset(int offset) {
super.offset(offset);
offsetRange(fCloseBodyRange, offset);
offsetRange(fExtendsRange, offset);
offsetRange(fImplementsRange, offset);
offsetRange(fInterfacesRange, offset);
offsetRange(fOpenBodyRange, offset);
offsetRange(fSuperclassRange, offset);
offsetRange(fTypeRange, offset);
}
COM: <s> offsets all the source indexes in this node by the given amount </s>
|
funcom_train/38415399 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: static public void centerComponent(Component component) {
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
int x = (int) ((d.getWidth() - component.getWidth()) / 2);
int y = (int) ((d.getHeight() - component.getHeight()) / 2);
component.setLocation(x, y);
}
COM: <s> center a component on the screen </s>
|
funcom_train/28763217 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setCsslinkheadsfont(String newVal) {
if ((newVal != null && this.csslinkheadsfont != null && (newVal.compareTo(this.csslinkheadsfont) == 0)) ||
(newVal == null && this.csslinkheadsfont == null && csslinkheadsfont_is_initialized)) {
return;
}
this.csslinkheadsfont = newVal;
csslinkheadsfont_is_modified = true;
csslinkheadsfont_is_initialized = true;
}
COM: <s> setter method for csslinkheadsfont </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.