__key__
stringlengths 16
21
| __url__
stringclasses 1
value | txt
stringlengths 183
1.2k
|
---|---|---|
funcom_train/3391842 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeClassHeader(ClassDoc nestedClass, boolean isFirst) {
if (! isFirst) {
writer.printMemberHeader();
writer.println("");
}
writer.anchor(nestedClass.name());
writer.dl();
writer.h3();
writer.print(nestedClass.name());
writer.h3End();
}
COM: <s> write the nested class header for the given nested class </s>
|
funcom_train/3604540 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createComposite1() {
composite1 = new Composite(composite, SWT.NONE);
composite1.setLayout(new GridLayout());
label1 = new Label(composite1, SWT.NONE);
label1.setText("* Tabs with twin panels");
label2 = new Label(composite1, SWT.NONE);
label2.setText("* File details displayed");
label3 = new Label(composite1, SWT.NONE);
label3.setText("* Panel trees hidden");
label = new Label(composite1, SWT.NONE);
label.setText("* Button bar for fast file operations");
}
COM: <s> this method initializes composite1 </s>
|
funcom_train/46823502 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long getIntegerTagType(short tagType) {
long result = 0;
for (Iterator<Ed2kTag> tmp = tagList.iterator(); tmp.hasNext();) {
Ed2kTag next = tmp.next();
if (next.getName() == tagType) {
result = ((Ed2kIntegerTag) next).getValue();
break;
}
}
return result;
}
COM: <s> gets a integer tag identified by the tag type </s>
|
funcom_train/31503777 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Date getLatestEnd() {
Date res = null;
Iterator it = selectedTasks.iterator();
while (it.hasNext()) {
Task task = (Task) it.next();
Date d = task.getEnd().getTime();
if (res == null) {
res = d;
continue;
}
if (d.after(res))
res = d;
}
return res;
}
COM: <s> returns the latest end date </s>
|
funcom_train/37834281 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void step_1() {
npc.add(ConversationStates.ATTENDING,
Arrays.asList("Blordrough","blordrough","blordroughs"),
null,
ConversationStates.ATTENDING,
"My Mithrilbourgh army have great losses in battles with Blordrough soldiers. They coming from side of Ados tunnels.",
null);
npc.add(ConversationStates.ATTENDING,
ConversationPhrases.QUEST_MESSAGES,
null,
ConversationStates.ATTENDING,
null,
new QuestAction());
}
COM: <s> add quest state to npcs fsm </s>
|
funcom_train/21320159 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void tryToFire() {
// check that we have waiting long enough to fire
if (System.currentTimeMillis() - lastFire < firingInterval) {
return;
}
// if we waited long enough, create the shot entity, and record the time.
lastFire = System.currentTimeMillis();
ShotEntity shot = new ShotEntity(this,"sprites/shot.gif",ship.getX()+10,ship.getY()-30);
entities.add(shot);
}
COM: <s> attempt to fire a shot from the player </s>
|
funcom_train/36960898 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Button getChangeControl(Composite parent) {
if (fBrowseButton == null) {
assertCompositeNotNull(parent);
fBrowseButton= new Button(parent, SWT.PUSH);
fBrowseButton.setText(fBrowseButtonLabel);
fBrowseButton.setEnabled(isEnabled() && fButtonEnabled);
fBrowseButton.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
changeControlPressed();
}
public void widgetSelected(SelectionEvent e) {
changeControlPressed();
}
});
}
return fBrowseButton;
}
COM: <s> creates or returns the created buttom widget </s>
|
funcom_train/22402059 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void print( PrintWriter out) {
if( out != null) {
Iterator it = nodes.keySet().iterator();
while( it.hasNext()) {
KeyCache key = (KeyCache)it.next();
NodeCache node = (NodeCache)nodes.get( key);
out.println( key + NodeCache.separatorKeyValue + node.getName());
}
}
}
COM: <s> todo make a test for this method </s>
|
funcom_train/9523377 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean next() {
ArrayList<Cell> list = findNextSteps(current);
if (list.size() == 0)
return false;
for (Cell cell : list) {
ArrayList<Cell> list2 = findNextSteps(cell);
cell.nexts = list2.size();
}
int min = Integer.MAX_VALUE;
int m = -1;
for (int i = 0; i < list.size(); i++)
if (list.get(i).nexts < min) {
min = list.get(i).nexts;
m = i;
}
current = list.get(m);
board[current.row][current.col] = '*';
return true;
}
COM: <s> true if there is next false otherwise </s>
|
funcom_train/2972195 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean hasKey( K key ) {
int hashIndex = hash( key );
for ( Node<K, V> hashed = cast( buckets[ hashIndex ] );
hashed != null;
hashed = hashed.nextNode ) {
if ( areEqual( key, hashed.key() ) )
return true;
}
return false;
}
COM: <s> tells whether the given key is present in this container </s>
|
funcom_train/43221316 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void fireAdditionEvent(Element newel) {
MutationEvent mutevt = (MutationEvent) ((DocumentEvent) getElement()
.getOwnerDocument()).createEvent("MutationEvent");
mutevt.initMutationEvent("MutationEvent", true, false, newel, "", "",
"", MutationEvent.ADDITION);
((EventTarget) getElement()).dispatchEvent(mutevt);
}
COM: <s> fires a mutation event indicating that the new element was added </s>
|
funcom_train/48933162 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addClassChangeUpdates(ArrayList<Class_Structure_I> upsOld, ArrayList<Class_Structure_I> upsNew){
if(upsOld.size() == upsNew.size()){
for (int i = 0; i < upsOld.size(); i++) {
ClassUpdate_I xu = Class_Update.createClassChangeUpdate(upsOld.get(i), upsNew.get(i));
getClassUpdates().add(xu);
}
}
}
COM: <s> create a change update if both collections are of same size </s>
|
funcom_train/23453121 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addValueSpecifierPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Binding_valueSpecifier_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Binding_valueSpecifier_feature", "_UI_Binding_type"),
ProcessPackage.Literals.BINDING__VALUE_SPECIFIER,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the value specifier feature </s>
|
funcom_train/43245328 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSetECTwoRelationship() {
System.out.println("setECTwoRelationship");
String eCTwoRelationship = "";
EmergencyContactDG4Object instance = new EmergencyContactDG4Object();
instance.setECTwoRelationship(eCTwoRelationship);
// 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 ectwo relationship method of class org </s>
|
funcom_train/9890593 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void updateDecisionCheckStates() {
IPreferenceStore store = HorenPlugin.getInstance().getPreferenceStore();
for(int i = 0; i < m_Decisions.length; i++) {
m_DecisionList.setChecked(m_Decisions[i], store.getInt(m_Decisions[i]) != IPreferenceConstants.DECISION_NOT_SET);
}
}
COM: <s> checks the decisions in the decision list depending on their preference </s>
|
funcom_train/48184133 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String countNgrams(int foldNum) {
String cmd = "fngram-count -nonull -write-counts -lm " +
((unk) ? "-unk " : "") +
"-factor-file " + filename(foldNum) + " " +
"-text " + trainingfile(foldNum) + " " +
"-debug " + debugLevel;
return cmd;
}
COM: <s> returns the command for making an ngram model </s>
|
funcom_train/8104353 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void init(JTable table) {
assert(null != wb);
syn_table = table;
rows = new ArrayList<SynonymRow>();
// init columns width
TableColumn column = null;
for (int i = 0; i < preferred_width.length; i++) {
column = table.getColumnModel().getColumn(i);
column.setPreferredWidth(preferred_width[i]);
}
}
COM: <s> initialize parameters table column width </s>
|
funcom_train/18865413 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void add(final int index, final Transaction element) {
if (index > size || index < 0) {
throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size);
}
ensureCapacity(size + 1);
System.arraycopy(transactions, index, transactions, index + 1, size - index);
transactions[index] = element;
size++;
}
COM: <s> inserts the specified element at the specified position in this </s>
|
funcom_train/21005435 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void parseArticleTitles(String s) {
SAXBuilder builder = new SAXBuilder();
Element root = null;
try {
Reader i = new StringReader(s);
Document doc = builder.build(new InputSource(i));
root = doc.getRootElement();
} catch (JDOMException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
if (root != null)
findContent(root);
}
COM: <s> picks the article name from a media wiki api response </s>
|
funcom_train/36239305 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getValue() throws BuildException {
// check values
if ( user == null || password == null )
{
throw new NullPointerException("NULL USER OR PASSWORD");
}
if ( user.equals("") || password.equals("") )
{
throw new NullPointerException("EMPTY USER OR PASSWORD");
}
return user + ":" + password;
}
COM: <s> returns user password </s>
|
funcom_train/324662 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void makeMarkedClickList() {
if (markedClicks == null) {
markedClicks = new ArrayList<ClickDetection>();
}
else {
markedClicks.clear();
}
if (zoomer == null) {
return;
}
PamDataBlock<ClickDetection> cdb = clickControl.getClickDataBlock();
ListIterator<ClickDetection> clickIterator = cdb.getListIterator(0);
ClickDetection click;
while (clickIterator.hasNext()) {
click = clickIterator.next();
if (shouldPlot(click) == false || clickInMarkedArea(click) == false) {
continue;
}
markedClicks.add(click);
}
}
COM: <s> called when a zoom polygon has been completed and </s>
|
funcom_train/18479153 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void write(char[] buf, int off, int len) throws java.io.IOException {
String str = new String(buf,off,len) ;
try {
text.getDocument().insertString(text.getDocument().getLength(),str,null) ;
}
catch(javax.swing.text.BadLocationException ex) {
}
}
COM: <s> writes a buffer of bytes </s>
|
funcom_train/46742558 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setImagePath(String imagePath) {
if (Converter.isDifferent(this.imagePath, imagePath)) {
String oldimagePath= null;
oldimagePath = this.imagePath;
this.imagePath = imagePath;
setModified("imagePath");
firePropertyChange(String.valueOf(APPLICATIONCONTROLLOGS_IMAGEPATH), oldimagePath, imagePath);
}
}
COM: <s> file path from resources images </s>
|
funcom_train/46619065 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object createDynamicElement(String name) throws BuildException {
if (macroDef.getElements().get(name) == null) {
throw new BuildException("unsupported element " + name);
}
if (elements.get(name) != null) {
throw new BuildException("Element " + name + " already present");
}
Element ret = new Element();
elements.put(name, ret);
return ret;
}
COM: <s> add an element </s>
|
funcom_train/2910948 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String guessFileExtension (String contentType, String extension) {
if (contentType.equalsIgnoreCase(uploadedIcon.getContentType()))
return extension;
int fnLengh = uploadedIcon.getFileName().length();
int extLength = extension.length();
if (fnLengh > extLength) {
String uploadedExt = uploadedIcon.getFileName().substring (fnLengh - extLength);
if (extension.equalsIgnoreCase(uploadedExt))
return extension;
}
return null;
}
COM: <s> tries to guess extension by 1 </s>
|
funcom_train/46982135 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean findServerDependency(String serverNames[]){
String dependentServerNames = null;
for(int i=0;i<serverNames.length;i++)if(findServerDependency(serverNames[i]))dependentServerNames=serverNames[i]+":";
return dependentServerNames!=null;
}
COM: <s> find the dependecies of the array servers </s>
|
funcom_train/47887029 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void radFlippersCountStateChanged(ChangeEvent evt) {
if (radFlippers.getSelection().equals(radFlippersCount.getModel()))
spinFlippers.setModel(spinFlippersCountModel);
else
spinFlippers.setModel(spinFlippersDuringModel);
tfEyes = ((javax.swing.JSpinner.DefaultEditor)spinFlippers.getEditor())
.getTextField();
tfEyes.setEditable(false);
}
COM: <s> event flippers radio button </s>
|
funcom_train/37650612 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Button buildDeselectWorkingSetButton(final Composite parent) {
final Button button = newPushButton(parent, StringKeys.PROPERTY_BUTTON_DESELECT_WORKINGSET);
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
deselectWorkingSet();
}
});
return button;
}
COM: <s> build the working set deselect button </s>
|
funcom_train/18738283 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void test_missingCtorInIntroducedClass() {
File testBase = new File(baseDir, "TestA");
runSourceAndBinaryTestcase(testBase, new String[] { "Top4.java", "Middle4.java", "Bottom4.java" },
new String[] { "AspectX4.java" }, true, false);
}
COM: <s> three classes top4 middle4 bottom4 </s>
|
funcom_train/37519353 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel createOutputPanel() {
JPanel outputPanel = new JPanel(new BorderLayout());
outputTextArea.setEditable(false);
JScrollPane scrollPane = new JScrollPane(outputTextArea);
outputPanel.add(scrollPane, BorderLayout.CENTER);
return outputPanel;
}
COM: <s> create the output panel that holds the compilation results </s>
|
funcom_train/4515310 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private DigitalClock getDigitalClock() {
if (digitalClock == null) {
// To create a digital-type clock with dark
// red foreground and black background.
digitalClock = new DigitalClock(":", "'", new Font("Comic Sans MS",
Font.BOLD, 20), Color.GREEN.darker(), Color.BLACK
.brighter(), Locale.ENGLISH);
}
return digitalClock;
}
COM: <s> this method shows how to create a digital type clock </s>
|
funcom_train/40376047 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Double scoreFit(int j1, int j2, Double[] params, Double[][] values) {
int channel = 0;
NormalDistribution nd = new NormalDistribution(params[0], params[1]);
Double sum = Math.log(1.0-probSplit);
for(int j = j1; j < j2; j++) {
double value = values[channel][j];
double logp = nd.calcLogProbability(value);
sum += logp;
}
Double score = sum - varPenalty * params[1];
return score;
}
COM: <s> scores a potential fit on the region j1 j2 of the data </s>
|
funcom_train/10924679 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void passScoreAfterParsing(Text url, Content content, Parse parse) {
if (urlMetaTags == null || content == null || parse == null)
return;
for (String metatag : urlMetaTags) {
String metaFromContent = content.getMetadata().get(metatag);
if (metaFromContent == null)
continue;
parse.getData().getParseMeta().set(metatag, metaFromContent);
}
}
COM: <s> takes the metadata which was lumped inside the content and replicates it </s>
|
funcom_train/50396906 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean isTopLevelWorkflowStillRunning()throws Exception{
ModelBase ag=(ModelBase)action.getAjd();
String workflowID=ag.getWorkflowID();
ProcessState ps=PEConfig.getInstance().getProcessEngine().getProcessState(workflowID);
return ProcessState.RUNNING.equals(ps) || ProcessState.HELD.equals(ps) ;
}
COM: <s> check whether the parent workflow is still running </s>
|
funcom_train/22509381 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setInputMode(int inputMode) {
this.inputMode = inputMode;
//#if tmp.directInput
//#if polish.TextField.showInputInfo != false
if (this.isFocused) {
updateInfo();
}
//#endif
if (this.caretChar != this.editingCaretChar) {
insertCharacter();
}
if (inputMode == MODE_FIRST_UPPERCASE) {
this.nextCharUppercase = true;
} else {
this.nextCharUppercase = false;
}
//#endif
}
COM: <s> sets the input mode for this text field </s>
|
funcom_train/20548563 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void init( ServletContext servletContext, Map<String, String> globalParameters, DataSourceConfiguration dataSourceConfig ) throws DataSourceException {
this.svCon = servletContext;
this.globalParameters = globalParameters;
this.config = dataSourceConfig;
this.applicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
}
COM: <s> this method is called by the mydas servlet class at servlet initialisation </s>
|
funcom_train/29680023 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setServersView(ServersView serversView) {
this.serversView = serversView;
this.serversView.getTreeViewer().addSelectionChangedListener(
new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
GridExplorerAction.this.selectionChanged(event);
}
});
}
COM: <s> sets the server view where this action is going to work </s>
|
funcom_train/2446555 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void restore(final int delay) {
final Component c = getLastFocusedComponent();
if (c != null) {
if (delay <= 0) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
c.requestFocusInWindow();
}
});
} else {
FocusUtils.requestFocusLater(c, delay);
}
}
}
COM: <s> makes a best effort to restoring focus to the last focused component </s>
|
funcom_train/19165709 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void checkName(String name) throws IllegalArgumentException{
boolean nameExists=false;
for(int i=0; i<mappingFields.length; i++) {
if(mappingFields[i].equals(name) || mappingFields[i].equals(StringUtils.capitalise(name))) {
nameExists=true;
break;
}
}
if(!nameExists) {
throw new IllegalArgumentException("name must be a property of this bean");
}
}
COM: <s> helper method to check the name of a field </s>
|
funcom_train/8631335 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getInt(int columnIndex) throws SQLException {
Object o = get(columnIndex);
if (o != null && !(o instanceof Number)) {
o = Integer.decode(o.toString());
}
return o == null ? 0 : ((Number) o).intValue();
}
COM: <s> returns the value as an int </s>
|
funcom_train/20622935 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void processWindowEvent (WindowEvent e) {
super.processWindowEvent (e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
if (this.mainMenu.okayToClose) {
dtsEditorApp.endApp();
ServerConnection sc = dtsEditorApp.getServerConn();
if (sc != null) {
dtsEditorApp.closeConnection();
}
System.exit (0);
}
}
}
COM: <s> overridden so we can exit when window is closed </s>
|
funcom_train/18514094 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void nextHistory() {
ObjectInputStream in = null;
if (simHistory != null) {
if (history < simHistory.size())
history++;
try {
ByteArrayInputStream bis = new ByteArrayInputStream(
(byte[]) simHistory.get(history));
in = new CustomObjectInputStream(bis, JarClassLoader
.getJarClassLoader());
info.setModel(in.readObject());
} catch (ClassNotFoundException ex) {
} catch (IOException ex) {
} finally {
try {
if (in != null) {
in.close();
}
} catch (IOException ex) {
}
}
}
}
COM: <s> moves to the next step in the simulation history </s>
|
funcom_train/10820147 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getApplicableTag(String extension, Path path) {
Set<String> tags = extensionTagsMap.get(extension);
String applicableTag = null;
if (tags != null) {
String fullPathName = path.toUri().toString();
for (String tag : tags) {
if (fullPathName.contains(tag)) {
applicableTag = tag;
break;
}
}
} else {
applicableTag = "";
}
return applicableTag;
}
COM: <s> searches in the path for the first occurrence of the tags associated with </s>
|
funcom_train/13364879 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private GridLayout getTabPageGridLayout(final int columns) {
final GridLayout gridLayout = new GridLayout(columns, false);
// allow more margin space, default is only 5 pixels
gridLayout.marginHeight = 15;
gridLayout.marginWidth = 15;
gridLayout.horizontalSpacing = 15;
gridLayout.verticalSpacing = 15;
return gridLayout;
}
COM: <s> gets the tab page grid layout </s>
|
funcom_train/39812948 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void limitOrder(Position pos, Price price, Quantity quantity, User user) throws DuplicateOrderException {
if (getMarketClosed()) {
warnMarketClosed(pos, price, quantity, user);
return;
}
buyOrAddBookOrder(pos, price, quantity, user);
}
COM: <s> buy totalquantity of coupons while not raising the price above price </s>
|
funcom_train/3155436 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setRequests(Vector requests) {
Guardian.assertNotNull("requests", requests);
if (requests.size() > 0) {
Request request = (Request) requests.elementAt(0);
_requestFile = request.getFile();
setInputFile(request);
setOutputFile(request);
setParameter(request);
} else {
setDefaultRequests();
}
}
COM: <s> sets a new request to be edited </s>
|
funcom_train/3543855 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private User getUser() throws Exception {
/* The result user */
User user = null;
if (getModeType() == ModeType.CREATE) {
/* Create mode. Creating a new user */
user = SecurityGate.createUser();
/* Setting a new user key */
setKey((UserPK) user.getPrimaryKey());
} else {
/* EDIT/REVIEW mode. Getting the current role */
UserPK userPK = getKey();
user = SecurityGate.getUser(userPK);
}
/* The result user */
return user;
}
COM: <s> returns a user object for the current view </s>
|
funcom_train/10512752 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean compile(Javah javah) throws BuildException {
Commandline cmd = setupGcjhCommand(javah);
try {
Execute.runCommand(javah, cmd.getCommandline());
return true;
} catch (BuildException e) {
if (e.getMessage().indexOf("failed with return code") == -1) {
throw e;
}
}
return false;
}
COM: <s> performs the actual compilation </s>
|
funcom_train/47948319 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Variable getGeoXAxisAsLon(Product product) throws MotuException, NetCdfVariableNotFoundException {
CoordinateAxis coord = getGeoXAxis();
if (coord == null) {
return null;
}
ParameterMetaData parameterMetaData = findLongitudeIgnoreCase();
if (parameterMetaData == null) {
return null;
}
return product.findVariable(parameterMetaData.getName());
}
COM: <s> finds longitude variable associated to x axis </s>
|
funcom_train/4748093 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testValueOf() {
System.out.println("valueOf");
String name = "LOGIN_USERNAME";
SessionCookieKeys expResult = SessionCookieKeys.LOGIN_USERNAME;
SessionCookieKeys result = SessionCookieKeys.valueOf(name);
System.out.println("result="+result.name());
assertEquals(expResult, result);
}
COM: <s> test of value of method of class session cookie keys </s>
|
funcom_train/13288104 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getCommand(Request request) {
if (request instanceof ReconnectRequest) {
Object view = ((ReconnectRequest) request).getConnectionEditPart()
.getModel();
if (view instanceof View) {
Integer id = new Integer(
org.one_project.one_neg_mod.factory.information.diagram.part.InformationModelVisualIDRegistry
.getVisualID((View) view));
request.getExtendedData().put(VISUAL_ID_KEY, id);
}
}
return super.getCommand(request);
}
COM: <s> extended request data key to hold editpart visual id </s>
|
funcom_train/46458641 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public BufferedImage getFilteredImage(BufferedImage image) {
if (!isEnabled()) return image;
Iterator it = filters.iterator();
while (it.hasNext()) {
Filter filter = (Filter)it.next();
image = filter.getFilteredImage(image);
}
if (postFilter != null) {
image = postFilter.getFilteredImage(image);
}
return image;
}
COM: <s> returns the current filtered image </s>
|
funcom_train/12561539 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void clear(int num) {
if (num == 0) {
if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
Logging.report(Logging.INFORMATION, LogChannels.LC_HIGHUI,
"WARNING: BasicTextInput.clear calld with 0");
}
return;
}
textComponent.clear(num);
}
COM: <s> clear the particular number of symbols </s>
|
funcom_train/22742259 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getNumRecords() throws IOException{
RecordStore db = null;
int records;
try {
db = RecordStore.openRecordStore(STORE_NAME,false);
records = db.getNumRecords();
db.closeRecordStore();
return records;
} catch (RecordStoreException ex) {
throw new IOException("Error accessing record store," + ex.getMessage());
}
}
COM: <s> return the number of records for this store </s>
|
funcom_train/17397367 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int writeFromReader(Reader reader, boolean append) throws IOException {
int charsWritten = 0;
final Writer writer = newWriter(false, append);
try {
char[] buffer = new char[getBufferSize()];
while (true) {
int charsRead = reader.read(buffer);
if (charsRead < 1) {
break;
}
writer.write(buffer, 0, charsRead);
charsWritten += charsRead;
}
} finally {
reader.close();
}
return charsWritten;
}
COM: <s> write the to this file from the given reader </s>
|
funcom_train/18028789 | /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 (!(o instanceof DatumRange)) {
return false;
}
if ( !this.getUnits().isConvertableTo( ((DatumRange)o).getUnits() ) ) {
return false;
} else {
return ( this==o ) || 0==compareTo(o);
}
}
COM: <s> returns true if the two endpoints are equal </s>
|
funcom_train/21974084 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void pan() {
Rectangle r = getVisibleRect();
int w = r.width;
int h = r.height;
int x = (int)(mousePoint.x - w/2);
int y = (int)(mousePoint.y - h/2);
System.out.println("EdaDrawingPane.pan offset: "+x+", "+y);
//scrollRectToVisible(new Rectangle(x,y,w,h));
//repaint();
scrollRectToVisible(new Rectangle(x,y,w,h));
revalidate();
}
COM: <s> centers the panel on the point </s>
|
funcom_train/17679875 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean appendUpdate(CharBuf s, State state) {
s.append(col.name);
s.append('=');
if (oracleStyleLOB) {
if (state.isNull(stateFieldNo)) {
s.append("null");
} else {
s.append(oracleStyleLOBNotNullString);
}
return true;
} else {
s.append('?');
return false;
}
}
COM: <s> append part of an update statement for us to s e </s>
|
funcom_train/46845968 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void validateSource(String source) {
// validate fixed portion of format
if ( source != null ) {
if (source.charAt(2) != ':' || source.charAt(5) != ':') {
throw new NumberFormatException("Invalid time");
}
if (source.length() < 8) {
throw new NumberFormatException("Invalid time");
}
}
}
COM: <s> validate the source </s>
|
funcom_train/42295784 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isContained() {
boolean isContained = true;
for (int i = 0; i < lowLevelComponents.size(); i++) {
isContained = LinearAlgebra2D.contains(highLevelComponent, lowLevelComponents.get(i));
if (isContained == false) {
return false;
}
}
return isContained;
}
COM: <s> checks if the give polygon is inside the high level component </s>
|
funcom_train/1653544 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGet() {
LRUHashtable<Object, Object> methodLRUht = createSampleHashTable(sampleElemsNumber);
assertNull(methodLRUht.get(new Object()));
Object methodSampleKey = new Object();
Object methodSampleValue = new Object();
methodLRUht.push(methodSampleKey,methodSampleValue);
assertEquals(methodLRUht.get(methodSampleKey),methodSampleValue);
}
COM: <s> tests get object method </s>
|
funcom_train/37515773 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JStatement blockCall() {
if (initBlockCallNeeded) {
JNameExpression ident =
new JNameExpression( getTokenReference(), JAV_INIT );
JExpression expr =
new JMethodCallExpression( getTokenReference(), ident,
JExpression.EMPTY );
return new JExpressionStatement( getTokenReference(),
expr, null );
} else {
return null;
}
}
COM: <s> this lame accessor method is provided for jml visitor code </s>
|
funcom_train/44493143 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void assertSelectFieldOptionTextValuesEqual(final String fieldName, final List textValues) {
String msg = "assertSelectFieldOptionTextValuesEqual: " + fieldName;
int assertLevel = AssertLevel.NO_LEVEL;
assertSelectFieldOptionTextValuesEqual(msg, fieldName, textValues, assertLevel);
}
COM: <s> checks that the given select field has the provided displayed text values selected </s>
|
funcom_train/14227585 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void callInvalid(final CallId id, final int cause) {
// define action block
EventHandler eh = new EventHandler() {
public void process(Object o) {
// find, but don't create, the call and invalidate it.
FreeCall call = ((GenericProvider)o).getCallMgr().getCachedCall(id);
if (call != null) {
// unHook the call
call.toInvalid(cause);
}
}
};
// dispatch for processing
this.getEventPool().put(eh);
}
COM: <s> receive and queue up a call invalid notification event </s>
|
funcom_train/45466643 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int compareElements(final Element node1, final Element node2) {
int diffCount = compareAttributes(node1, node2);
if (_strictChildOrder) {
diffCount += compareElementsStrictOrder(node1, node2);
} else {
diffCount += compareElementsLooseOrder(node1, node2);
}
return diffCount;
}
COM: <s> compares the two xmlnodes both of which must be of type xmlnode </s>
|
funcom_train/8228752 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isPasswordCorrect(char[] inputPassword, char[] dbPassword) {
boolean isCorrect = true;
//Checks if the passwords match each other
if (inputPassword.length != dbPassword.length) {
isCorrect = false;
} else {
isCorrect = Arrays.equals(inputPassword, dbPassword);
}
//Zero out the password.
Arrays.fill(dbPassword,'0');
return isCorrect;
}
COM: <s> method compares the password entered by the user against the password from </s>
|
funcom_train/31689713 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public StatusData createShortcut(String sShortcutName, String sFromFullPath) {
VFSStatus retnStatus = new VFSStatus();
retnStatus.setMethodName(METHOD_SHORTCUT);
StatusData vfsStatus = this.m_vfs.createShortcut(sFromFullPath, this.getFullPath() + "/" + sShortcutName);
retnStatus.addStatusData(vfsStatus);
if(retnStatus.isOK()) {
this.fireVirtualFileEvent(VirtualFileEvent.FILE_MEMBERS_CHANGED);
}
return retnStatus;
}
COM: <s> creates a new shortcut to a specified file with a specified name within </s>
|
funcom_train/4013840 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public OptionDef getOptionWithId(int id){
if(parentToChildOptions == null)
return null;
Iterator<Entry<Integer,List<OptionDef>>> iterator = parentToChildOptions.entrySet().iterator();
while(iterator.hasNext()){
OptionDef optionDef = getOptionWithId(iterator.next().getValue(),id);
if(optionDef != null)
return optionDef;
}
return null;
}
COM: <s> gets an option with a particular id </s>
|
funcom_train/38350234 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean visit(IResourceDelta delta) {
IResource res = delta.getResource();
if (res.getType() == IResource.FILE || res.getType() == IResource.FOLDER) {
return JAXBPlugin.instance().getModel(res.getProject()).processDelta(delta);
} else {
return true;
}
}
COM: <s> passes the event onto the jaxbmodel object for the attached project </s>
|
funcom_train/43212883 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void finish() {
if (isFinished) {
return;
}
isFinished = true;
// Write summary
this.aftDiagnosticsLog.printSummary(this.out);
this.rtsDiagnosticsLog.printSummary(this.out);
try {
this.out.flush();
} catch (Exception e) { /* */ }
try {
this.out.close();
} catch (Exception e) { /* */ }
this.sendEmailAndDeleteFile();
}
COM: <s> p write summary flush and close resource </s>
|
funcom_train/31689847 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void clearRow(List columnsToLeave) {
for (int i = 0; i < m_currentrow.size(); i++) {
String sCol = (String) m_colNames.get(i);
if (columnsToLeave.contains(sCol) == false) {
m_currentrow.set(i,null);
}
}
}
COM: <s> clears the current row except for the specified columns </s>
|
funcom_train/5574744 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Vector getClasses(Model umlModel) {
Vector<Class> classes = new Vector();
EList members = umlModel.getOwnedMembers();
for (int x=0;x<members.size();x++) {
try {
if (members.get(x) instanceof Class) {
classes.add((Class)members.get(x));
}
} catch (ClassCastException ce) {
}
}
return classes;
}
COM: <s> method returns a vector object which contains the classes of the uml model </s>
|
funcom_train/35220021 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected JPanel createCalendarSelectionPanel(Collection<Calendar> calendars) {
JPanel topPanel = new JPanel();
topPanel.setLayout(new BorderLayout());
topPanel.setBorder(GUIFactory.createPaddedTitledBorder("Calendars", 5));
calendarCheckboxes = new CalendarCheckBoxList();
topPanel.add(calendarCheckboxes, BorderLayout.CENTER);
return topPanel;
}
COM: <s> create the file selection area on the top side of the window </s>
|
funcom_train/22607087 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void tagMeta(Attributes attrs) throws SAXException {
changeState(TAG_META, (attrs != null), TAG_ENTRY);
if (attrs != null) {
metaKey = attrs.getValue("name");
textBuffer.setLength(0);
} else {
meta.setProperty(metaKey, textBuffer.toString());
}
}
COM: <s> handles the em meta em tag </s>
|
funcom_train/19408624 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void cmdGenVCG(String filename) throws NoSystemException {
MSystem system = system();
PrintWriter out = null;
try {
if (filename == null)
out = new PrintWriter(System.out);
else {
out = new PrintWriter(new BufferedWriter(new FileWriter(
filename)));
}
ModelToGraph.write(out, system.model());
} catch (IOException ex) {
Log.error(ex.getMessage());
} finally {
if (out != null) {
out.flush();
if (filename != null)
out.close();
}
}
}
COM: <s> writes a vcg file for a class diagram of the model </s>
|
funcom_train/36764420 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getBitCode(String parameter, int length){
String temp = Integer.toBinaryString(Integer.valueOf(parameter));
if(temp.length()>length){
temp = temp.substring(temp.length()-length);
}
while (temp.length() < length ){
temp = "0".concat(temp);
}
return temp;
}
COM: <s> convert an n type decimal parameter to the binary string equivalent that </s>
|
funcom_train/31652168 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String nextToken( ){
if(s.indexOf(token,offset+1)<0){
moreTokens=false;
return s.substring(offset+1,s.length( ));
}
String t = s.substring(offset+1, s.indexOf(token,offset+1));
offset = s.indexOf(token, offset+1);
return t;
}
COM: <s> gets the value of the next token </s>
|
funcom_train/4237390 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testIsCellEditable() {
System.out.println("isCellEditable");
int row = 0;
int col = 0;
ModeloTablaPiso instance = new ModeloTablaPiso();
boolean expResult = false;
boolean result = instance.isCellEditable(row, col);
assertEquals(expResult, result);
}
COM: <s> test of is cell editable method of class restaurante </s>
|
funcom_train/37648649 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testRenderReportCmdNullArg1() throws CommandException {
try {
RenderReportCmd cmd = new RenderReportCmd();
cmd.setProject(null);
cmd.registerRenderer(new HTMLRenderer(new Properties()), PMDRuntimeConstants.HTML_REPORT_NAME);
cmd.performExecute();
fail();
} catch (UnsetInputPropertiesException e) {
// yes cool
}
}
COM: <s> test robustness 1 </s>
|
funcom_train/21530950 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JLabel getJLabel5() {
if (jLabel5 == null) {
jLabel5 = new JLabel();
jLabel5.setBounds(91, 7, 82, 15);
jLabel5.setText("Symbol");
jLabel5.setFont(new java.awt.Font("Arial", 1, 10));
jLabel5.setHorizontalAlignment(SwingConstants.RIGHT);
}
return jLabel5;
}
COM: <s> this method initializes j label5 </s>
|
funcom_train/7627773 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void sendDispositionHeader(OutputStream out) throws IOException {
LOG.trace("enter sendDispositionHeader(OutputStream out)");
out.write(CONTENT_DISPOSITION_BYTES);
out.write(QUOTE_BYTES);
out.write(EncodingUtils.getAsciiBytes(getName()));
out.write(QUOTE_BYTES);
}
COM: <s> write the content disposition header to the specified output stream </s>
|
funcom_train/37518838 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean declaredOutsideOfLoop(JLocalVariable var) {
// Recursion terminates at the first loop context encountered,
// so if the recursion reaches this context there was no inner
// loop context. If this context declares the var then return
// false, otherwise recurse to outer context.
if (declares(var)) {
return false;
} else {
return super.declaredOutsideOfLoop(var);
}
}
COM: <s> indicates whether this context is enclosed in a loop and the given variable </s>
|
funcom_train/24409286 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void saveManifestToDisk(ManifestType manifest, String filename) throws JAXBException {
messageText = "";
JAXBElement je = new JAXBElement<ManifestType>(new QName("http://www.imsglobal.org/xsd/imscp_v1p1", "manifest"),
ManifestType.class, manifest);
imsmanifestMarshaller.marshal(je, new File(filename));
}
COM: <s> saves a manifest out to disk </s>
|
funcom_train/49421134 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initialize() {
this.setSize(762, 396);
this.setContentPane(getJContentPane());
this.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
System.err.println("Closing window and exiting...");
Runtime.getRuntime().exit(0);
}
});
this.setTitle("JFrame");
}
COM: <s> this method initializes this </s>
|
funcom_train/36924737 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String parseText(byte[] bframes, int offset, int size, int skip) {
String value = null;
try {
String enc = ENC_TYPES[0];
if (bframes[offset] >= 0 && bframes[offset] < 4) {
enc = ENC_TYPES[bframes[offset]];
}
value = new String(bframes, offset + skip, size - skip, enc);
value = chopSubstring(value, 0, value.length());
} catch (UnsupportedEncodingException e) {
system.error("ID3v2 Encoding error: " + e.getMessage());
}
return value;
}
COM: <s> parse text frames </s>
|
funcom_train/31659859 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String process(String text) {
Interpreter interpreter = new Interpreter();
try {
return String.valueOf(interpreter.eval(text));
} catch (EvalError evalError) {
logger.log(Level.SEVERE, evalError.getMessage(), evalError);
return "???" + evalError.getMessage() + "???";
}
}
COM: <s> process the given text as a beanshell expression and return a string </s>
|
funcom_train/36247661 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Text newText(Composite composite, String s) {
Text text = new Text(composite, SWT.READ_ONLY | SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
text.setText(s);
GridData data = new GridData(GridData.FILL_BOTH);
data.minimumHeight = 80;
data.heightHint = 100;
data.minimumWidth = 100;
data.widthHint = 250;
text.setLayoutData(data);
return text;
}
COM: <s> utility method for creating a text widget </s>
|
funcom_train/38628886 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Vector toVector () {
final Vector vector = new Vector(size);
// TODO: There should be a better way to do this
for (int i = 0; i < size; ++i) {
vector.addElement(elements[i]);
} // for()
return vector;
} // toVector()
COM: <s> returns a vector containing all elements in the buffer </s>
|
funcom_train/40386589 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void call(MvcEvent event) {
if (couldHandleUserEvent(event)) {
handleUserEvent(event);
} else {
boolean eventHandledByChild = handleUserActionByChildren(event);
if (!eventHandledByChild) {
throw new UnavailableActionException(
"You have tried to use an action anavailable at this level of the controller's tree :" + this
+ " with this event :" + event);
}
}
}
COM: <s> manages user gestures and browser events </s>
|
funcom_train/44287223 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setWidth(int size, int col) {
if (size > 0) {
getColumnModel().getColumn(col).setMaxWidth(size);
getColumnModel().getColumn(col).setWidth(size);
getColumnModel().getColumn(col).setResizable(false);
}
}
COM: <s> defines a width to the given column </s>
|
funcom_train/31651590 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ArrayList getResources() throws SQLException,IOException{
ArrayList resc = new ArrayList();
for (int i=0;i<resources.size();i++) {
Integer id = (Integer)resources.get(i);
resc.add(ResourceFactory.findByOID(id.intValue()));
}
return resc;
}
COM: <s> returns a list of all resources in the role </s>
|
funcom_train/45596866 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run(){
layerBrickList component= null;
int blocksMerged = 0;
//get component if still left
synchronized(components){
if (!components.isEmpty()){
component = components.remove(0);
}
}
//while there is work to be done do it.
while (component != null){
//merge the bricks together
mergeBricks(component);
blocksMerged++;
//check if still more work.
synchronized(components){
if (!components.isEmpty()){
component = components.remove(0);
}
else{
component = null;
}
}
}
//System.out.println("Components merged : " + blocksMerged);
}
COM: <s> this is the main function that starts when the thread is initialised </s>
|
funcom_train/2576347 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setTimeZone(TimeZone zone) {
if (zone == null) {
throw new IllegalArgumentException("Null 'zone' argument.");
}
this.timeZone = zone;
this.calendar = Calendar.getInstance(zone, this.locale);
this.first.peg(this.calendar);
this.last.peg(this.calendar);
notifyListeners(new AxisChangeEvent(this));
}
COM: <s> sets the time zone that is used to convert the time periods into </s>
|
funcom_train/9564044 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public InputStream extractRevision(String aFileName, byte[] aPassword, String aSignatureName) throws IOException {
final PdfReader tmpReader = PdfUtils.getPdfReader(aFileName, aPassword);
final AcroFields tmpAcroFields = tmpReader.getAcroFields();
return tmpAcroFields.extractRevision(aSignatureName);
}
COM: <s> returns input stream which contains extracted revision pdf which was </s>
|
funcom_train/17210089 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Node addNode(String name, Node ref){
Node tmpNode;
if (!nTable.containsKey(name)){
float rnd = ((float)Math.random()-0.5f)*0.3f;
float rnd2 = ((float)Math.random()-0.5f)*0.3f;
float rnd3 = ((float)Math.random()-0.5f)*0.3f;
nTable.put(name,tmpNode=addNode(name, ref.getPos().x+rnd,ref.getPos().y+rnd2,ref.getPos().z+rnd3));
nTableID.put(tmpNode.getId(), tmpNode);
} else tmpNode=nTable.get(name);
return tmpNode;
}
COM: <s> add a new node in proximity to an existing one </s>
|
funcom_train/37841901 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void open() throws KeyRingException {
try {
InputStream fileInput = getClass().
getResourceAsStream(keystoreName);
if(fileInput == null) {
throw new KeyRingException("Can't open keystore: "+keystoreName);
} else {
keystore.load(fileInput, storePass.toCharArray());
isOpen = true;
}
} catch (Exception e) {
e.printStackTrace();
throw new KeyRingException();
}
}//end open()
COM: <s> initializes the key ring for operations </s>
|
funcom_train/23949378 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getSwitchListPanel(){
JPanel panel = new JPanel();
JList switchList = new JList();
JScrollPane scroll = new JScrollPane( switchList,
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED );
scroll.setPreferredSize( new Dimension( 200, 300 ) );
panel.add( scroll );
return panel;
}
COM: <s> builds the switch list </s>
|
funcom_train/50085096 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private float getLengthOfVector(float[] vector) {
float sumOfAllSquaredComponents = 0;
try {
for (int i = 0; i < vector.length; i++) {
sumOfAllSquaredComponents += vector[i] * vector[i];
}
if (sumOfAllSquaredComponents == 0) {
return 0;
} else {
return (float)(Math.sqrt(sumOfAllSquaredComponents));
}
} catch (Exception exception) {
throw new RuntimeException("Unable to calculate the length of the vector!", exception);
}
}
COM: <s> calculates the length of the vector </s>
|
funcom_train/36775997 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getOpCode(){
String hex = Integer.toHexString(reg);
// In case the hex string began with 0's, in which case they were cut off
while (hex.length() < 8) {
String temp = new String(hex);
hex = new String("0" + temp);
}
return Integer.parseInt(hex.substring(0,2), 16);
}
COM: <s> gets the opcode or first eight bits of the value of the register </s>
|
funcom_train/44779762 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addMenuComponent( int in_index, MenuComponent in_menuComponent ) {
menuComponents.add( in_index, in_menuComponent );
String lc_id = in_menuComponent.getId();
if ( lc_id != null ) {
children.put( lc_id, in_menuComponent );
}
}
COM: <s> add a child menu at the specfied index </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.