__key__
stringlengths 16
21
| __url__
stringclasses 1
value | txt
stringlengths 183
1.2k
|
---|---|---|
funcom_train/16613488 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int hashCode() {
if (hash == -1) {
hash = 17;
if (name != null) {
hash = 37 * hash * (name.hashCode()+1);
}
if (version != null) {
hash = 37 * hash * (version.hashCode()+1);
}
}
return hash;
}
COM: <s> generate a hash code since were overriding equals </s>
|
funcom_train/2639425 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void reset() {
super.reset();
/* SHA-256 initial hash value
* The first 32 bits of the fractional parts of the square roots
* of the first eight prime numbers
*/
H1 = 0x6a09e667;
H2 = 0xbb67ae85;
H3 = 0x3c6ef372;
H4 = 0xa54ff53a;
H5 = 0x510e527f;
H6 = 0x9b05688c;
H7 = 0x1f83d9ab;
H8 = 0x5be0cd19;
xOff = 0;
for (int i = 0; i != X.length; i++) {
X[i] = 0;
}
}
COM: <s> reset the chaining variables </s>
|
funcom_train/35840931 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public UmlClass copyClass(Object source, Object ns) {
if (!(source instanceof UmlClass && ns instanceof Namespace)) {
throw new IllegalArgumentException("source: " + source + ",ns: "
+ ns);
}
UmlClass c = createClass();
((Namespace) ns).getOwnedElement().add(c);
doCopyClass(source, c);
return c;
}
COM: <s> copies a class and its features </s>
|
funcom_train/3576591 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JPanel getPanelVisualizador() {
if (ivjPanelVisualizador == null) {
try {
ivjPanelVisualizador = new JPanel();
ivjPanelVisualizador.setName("PanelVisualizador_");
ivjPanelVisualizador.setBorder(new EtchedBorder());
ivjPanelVisualizador.setLayout(new BorderLayout());
getPanelVisualizador().add(getImagen(), BorderLayout.CENTER);
} catch (Throwable ivjExc) {
handleException(ivjExc);
}
}
return ivjPanelVisualizador;
}
COM: <s> return the panel visualizador property value </s>
|
funcom_train/22307663 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Test getTestForClass( final Class clazz ) {
try {
final Method method = clazz.getDeclaredMethod( "suite", new Class[0] );
return (Test)method.invoke( null, new Object[0] );
}
catch( final NoSuchMethodException e ) {
// Fall through
}
catch( final Exception e ) {
e.printStackTrace();
}
return new TestSuite( clazz );
}
COM: <s> return a test suite containing all the tests for the specified class </s>
|
funcom_train/17478960 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void disconnect() {
try {
Folder fold = (Folder)pop3Folders.get(auth.getUsername());
if (fold != null) {
fold.close(true);
}
try {
if (handler.getMbox() != null) {
handler.getMbox().close(true);
}
} catch (Exception e) {}
try {
if (handler.getStore() != null) {
handler.getStore().close();
}
} catch (Exception e) {}
} catch (Exception e) {
}
pop3Folders.put(auth.getUsername(), null);
}
COM: <s> disconnects the previously opened data connection if </s>
|
funcom_train/7982411 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected double getPageScore(XMLParser p) {
String text = p.getText();
//stop the text
text = stp.stopString(text);
if (stemmer) {
Stemmer st = new Stemmer();
text = st.stem(text);
st = new Stemmer();
query = st.stem(query);
}
double score = Helper.getSim(query, text);
return score;
}
COM: <s> overrides the base class method that gets the score for a page </s>
|
funcom_train/48183570 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void printTypes() {
System.out.println("types:");
for (int i=0; i < indexToType.size(); i++) {
SimpleType st = indexToType.get(i);
System.out.println(i + ": " + st.getName() + " subtypes: " + st.getBitSet());
}
System.out.println();
}
COM: <s> prints the types and their subtypes to system </s>
|
funcom_train/13869761 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addHeaderPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_FieldValue_header_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_FieldValue_header_feature", "_UI_FieldValue_type"),
SmartGenPackage.Literals.FIELD_VALUE__HEADER,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the header feature </s>
|
funcom_train/33974052 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void changeFlexagonOrder() {
int n = orderChoices.getSelectedIndex();
if (n < 0) {
return;
}
int selection = Integer.valueOf(orderChoices.getModel().getElementAt(n).toString());
if (selection != flexagon.getOrder()) {
flexagon = new HexaFlexagon(selection);
hexagonPanel.setCurrentFlexagon(flexagon);
setTitle(TITLE + " - Current Order: " + selection);
reset();
}
}
COM: <s> changes the order of the current flexagon and resets the display </s>
|
funcom_train/47164092 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getConstantName(String rawName) {
String name = rawName.toUpperCase();
name = name.replace("ß", "ss");
name = name.replace("Ä", "AE");
name = name.replace("Ö", "OE");
name = name.replace("Ü", "UE");
name = name.replaceAll("[^A-Z0-9]", "_");
return name;
}
COM: <s> changes a name into the name of a constant </s>
|
funcom_train/48959865 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setComponents(Set<DefaultModule> components) {
if (CollectionUtils.isNotEmpty(this.components)) {
this.components.clear();
}
this.components = components;
if (components != null) {
for (DefaultModule component : components) {
component.setParentModule(this);
}
}
}
COM: <s> clears the current collection of components and attaches a new one </s>
|
funcom_train/9190139 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addEndNodePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Flow_endNode_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Flow_endNode_feature", "_UI_Flow_type"),
FlowPackage.Literals.FLOW__END_NODE,
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the end node feature </s>
|
funcom_train/13479549 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setBuyConstruction() {
controller.checkStatus(Controller.STATUS_RUNNING);
// FIXME[todo]: access?
Construction construction = getConstruction();
if (construction == null)
return; // FIXME: Exception?
// FIXME[todo]: check, if we have cash
_buyConstruction = true;
if (controller.getStatus() == Controller.STATUS_CLIENT_RUNNING) {
//FIXME[todo]: add turn command
// ((ClientController)controller).addTurnCommand().
// setColonyBuyConstruction(this);
}
}
COM: <s> tell the colonists that the remaining parts of the current </s>
|
funcom_train/16619261 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addButtonNoLink(String imageFile, String altText) {
contents.add("<img style=\"border:0\" src=\"" + StringEscapeUtils.escapeHtml(imageFile) + "\" alt=\"" + StringEscapeUtils.escapeHtml(altText) + "\" />" + newline);
}
COM: <s> adds an image of a button to this cgview htmldocument </s>
|
funcom_train/46328019 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void showDlgApplications() {
// Reset the chosen action data if left over from a previous run.
RuleBuilder.instance().resetActionPath();
// Launch the activity chain for adding an action.
// We check if the user completed an action in onActivityResult.
Intent intent = new Intent();
intent.setClass(getApplicationContext(), ActivityDlgApplications.class);
startActivityForResult(intent, REQUEST_ADD_ACTION);
}
COM: <s> starts up the initial activity for adding a new action </s>
|
funcom_train/10298977 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setHelpSetSpec(String spec) {
URL url;
HelpSet hs;
ClassLoader loader = this.getClass().getClassLoader();
try {
url = new URL(spec);
hs = new HelpSet(loader, url);
} catch (Exception ex) {
System.err.println("Trouble setting HelpSetSpec to spec |"+spec+"|");
System.err.println(" ex: "+ex);
hs = null;
}
contentViewer.setModel(new DefaultHelpModel(hs));
setModel(contentViewer.getModel());
updateUI();
}
COM: <s> set the url to the help set </s>
|
funcom_train/22115082 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public RemoteInputStream getRemoteStream() {
// remove any registered buffers that haven't been touched in 30 minutes
ageOutOldBuffersFromRegistry(30*60000);
String streamId = UID.asString();
_streamBufferRegistry.put(streamId, new RegisteredStreamBuffer(_clock, _timeout));
return new RemoteInputStream(streamId);
}
COM: <s> retrieve the remote stream to send to the remote client </s>
|
funcom_train/33481183 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeWayPoint(int index) {
if (wayPoints.size() == 2) {
for (WayPointOverlay wayPointOverlay : wayPoints) {
if (wayPointOverlay != null) {
MapPanel.getInstance().removeOverlay(wayPointOverlay);
}
}
MapPanel.getInstance().removeOverlay(this);
wayPoints.clear();
return;
}
if (getWaypoint(index) == null) {
return;
}
deleteVertex(index);
WayPointOverlay point = wayPoints.get(index);
MapPanel.getInstance().removeOverlay(point);
wayPoints.remove(index);
}
COM: <s> remove a vertex of the track point overlay </s>
|
funcom_train/22020852 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object getPropertyValue(Object propertyId) {
// check if propertyId is a String
if (!(propertyId instanceof String)) {
throw new IllegalArgumentException();
}
// return caption of dependency
if (CAPTION_PROP.equals(propertyId)) {
if (uml2Dependency != null){
return uml2Dependency.getName();
}
else{
return "";
}
}
// no corresponding property description was found
else {
throw new IllegalArgumentException("unknown property: "
+ propertyId.toString());
}
}
COM: <s> return the value here caption as a string corresponding to property </s>
|
funcom_train/25622592 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setExtra(byte[] extra) throws RuntimeException {
try {
ZipExtraField[] local = ExtraFieldUtils.parse(extra, true);
mergeExtraFields(local, true);
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
}
COM: <s> throws an exception if extra data cannot be parsed into extra fields </s>
|
funcom_train/23671845 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setAction(IAction<A> action) {
boolean state = isEnabled();
if(this.action != null)
this.action.removePropertyListener(propertyLIstener);
this.action = action;
if(this.action != null)
this.action.addPropertyListener(propertyLIstener);
if(state != isEnabled())
notifyPropertyChangeListeners();
}
COM: <s> set action to be proxed </s>
|
funcom_train/24262095 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testAssociateSourceVariableE3() {
try {
ArrayList<Variable> sourceVariables
= new ArrayList<Variable>();
sourceVariables.add(derivedVariable1);
curationService.associateSourceVariables(demoUser,
derivedVariable2,
sourceVariables);
curationService.associateSourceVariables(demoUser,
derivedVariable2,
sourceVariables);
fail();
}
catch(MacawException exception) {
int totalNumberOfErrors
= exception.getNumberOfErrors();
assertEquals(1, totalNumberOfErrors);
int numberOfErrors
= exception.getNumberOfErrors(MacawErrorType.DUPLICATE_VARIABLE_ASSOCIATION);
assertEquals(1, numberOfErrors);
}
}
COM: <s> associate a source variable with a derived variable where the </s>
|
funcom_train/45246601 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JNumberFloatField getJNumberFloatFieldProporcaoDCMut() {
if (jNumberFloatFieldProporcaoDCMut == null) {
jNumberFloatFieldProporcaoDCMut = new JNumberFloatField();
jNumberFloatFieldProporcaoDCMut.setLocation(new Point(345, 106));
jNumberFloatFieldProporcaoDCMut.setSize(new Dimension(65, 20));
}
return jNumberFloatFieldProporcaoDCMut;
}
COM: <s> this method initializes j number float field proporcao dcmut </s>
|
funcom_train/1006049 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Point2D getStartPoint() {
double angle = Math.toRadians(-getAngleStart());
double x = getX() + (Math.cos(angle) * 0.5 + 0.5) * getWidth();
double y = getY() + (Math.sin(angle) * 0.5 + 0.5) * getHeight();
return new Point2D.Double(x, y);
}
COM: <s> returns the starting point of the arc </s>
|
funcom_train/14008692 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected File getBlogCategoryDirectory(String categoryName) {
File blogCategory = new File(_blog.getBlogHome() + BlojsomUtils.removeInitialSlash(categoryName));
if (blogCategory.exists() && blogCategory.isDirectory()) {
return blogCategory;
} else {
return new File(_blog.getBlogHome() + "/");
}
}
COM: <s> get the blog category </s>
|
funcom_train/18007835 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setPageAction(PdfName actionType, PdfAction action) throws PdfException {
if (!actionType.equals(PAGE_OPEN) && !actionType.equals(PAGE_CLOSE))
throw new PdfException("Invalid page additional action type: " + actionType.toString());
pdf.setPageAction(actionType, action);
}
COM: <s> sets the open and close page additional action </s>
|
funcom_train/36994547 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Number getValueAt(final double location) {
final BigDecimal minDec = new BigDecimal(getMinimum().toString());
final BigDecimal maxDec = new BigDecimal(getMaximum().toString());
BigDecimal locDec = new BigDecimal(location);
locDec = locDec.multiply(maxDec.subtract(minDec));
locDec = locDec.add(minDec);
return locDec;
}
COM: <s> returns a new code number code object that falls at a specific point </s>
|
funcom_train/18228904 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long getSize() {
initialize();
try {
return len == -1 ? // URI or not
new URL(uri).openConnection().getContentLength() : // len from URI
len; // len from dump
} catch (Exception e) {
System.err.println("exception in getSize() on " + name + ": " + e);
return 0;
}
}
COM: <s> get the size of the file </s>
|
funcom_train/18790266 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setHomeAddress(Address homeAddress) {
if (((this.homeAddress != null) && !this.homeAddress.equals(homeAddress)) ||
((this.homeAddress == null) && (homeAddress != null))) {
this.homeAddress = homeAddress;
setModified(true);
}
}
COM: <s> sets the new value of the simple property home address </s>
|
funcom_train/41958106 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void calculateXP(long currExp) {
int lvl;
long summation = 0;
long levelExp = 0;
boolean done = false;
for (lvl = 1; (!done); lvl++) {
// summation to get experience for a level
summation += Math.floor(lvl + 300 * Math.pow(2, lvl / 7.));
levelExp = (long) Math.floor(summation / 4);
if (levelExp > currExp) {
done = true;
setRemainingExp(levelExp - currExp);
}
}
}
COM: <s> calculate xp difference to next level using summation formula </s>
|
funcom_train/369695 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String resolve(Formula sourceFormula, WorkbookCellFinder cellFinder) {
String resolvedFormula;
if( sourceFormula.containsListRanges() ){
resolvedFormula = replaceListRanges( sourceFormula );
}
else{
resolvedFormula = sourceFormula.getActualFormula();
// resolvedFormula = replaceTransformedCells( sourceFormula, cellFinder );
}
return resolvedFormula;
}
COM: <s> this implementation first checks are there any list ranges in the source formula </s>
|
funcom_train/26391412 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean read_text_area_from_file(File f, int encoding) {
boolean result = false;
String text = read_text_from_file(f, encoding);
if (null != text) {
get_edit_text_area().setText(text);
result = true;
}
return result;
}
COM: <s> if file is readable read text into area from it </s>
|
funcom_train/4755160 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void checkPositive(double[] in) {
for (int i = 0; i < in.length; i++) {
if (in[i] <= 0) {
throw new MathIllegalArgumentException(
LocalizedFormats.NOT_POSITIVE_ELEMENT_AT_INDEX,
i, in[i]);
}
}
}
COM: <s> check all entries of the input array are strictly positive </s>
|
funcom_train/51708069 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getQueryResults(QueryRequest query_request, DPQueryType typeOfSearch, int timeout) {
if(typeOfSearch == DPQueryType.ADVANCED_DATAFILE){
return getQueryDatafilesResults(query_request, typeOfSearch, timeout);
}else {
return getQueryInvestigationResults(query_request, typeOfSearch, timeout);
}
}
COM: <s> mydata search makes the dp show a different message if no results </s>
|
funcom_train/11038124 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void checkActivateWarning(String methodname) {
if (needsToBeReconciled) {
if (DEBUG_ENABLED && log.isWarnEnabled()) {
log.warn(getLogIDString() + ":" + methodname + "(): ****WARNING**** " + myClassName +
".activate(configurationContext) needs to be invoked.");
}
}
}
COM: <s> trace a warning message if needed indicating that this </s>
|
funcom_train/3651057 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getKeyForText(String val) {
Iterator iter = entrySet().iterator();
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry)iter.next();
if (entry.getValue().equals(val)) {
return (String)entry.getKey();
}
}
return null;
}
COM: <s> does the reverse mapping finds the key associated with the </s>
|
funcom_train/21306020 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getJButton2() {
if (jButton2 == null) {
jButton2 = new JButton(new ImageIcon(getClass().getResource("/irudiak/g4.png")));
jButton2.setBackground(Color.blue);
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
if (jButton2.getBackground()==Color.blue)
jButton2.setBackground(Color.yellow);
else
jButton2.setBackground(Color.blue);
}
});
}
return jButton2;
}
COM: <s> this method initializes j button2 </s>
|
funcom_train/50034245 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean setProjetAsDeleted(final String projectName) throws HibouTechnicalException {
Transaction tr = null;
Session session = null;
ProjectSchedulerManager manager = new ProjectSchedulerManager();
try {
session = HibernateUtil.openSession();
tr = session.beginTransaction();
Project project = (Project)session.get(Project.class,projectName);
project.setDeleted(true);
session.update(project);
tr.commit();
manager.createRemovedProject(projectName);
} catch (Exception e) {
if(tr != null) {
tr.rollback();
}
throw new HibouTechnicalException(e);
} finally {
session.close();
}
return true;
}
COM: <s> set a project as deleted </s>
|
funcom_train/22155789 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void paint(Graphics g) {
Dimension d = getSize();
g.setColor(getBackground());
g.draw3DRect(2,2,d.width-5, d.height-5, true);
g.draw3DRect(3,3,d.width-7, d.height-7, false);
}
COM: <s> draw an etched border around the contained component </s>
|
funcom_train/44588419 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void initializeDefaultPosition() {
IType parentElement = getType();
try {
IJavaElement[] elements = parentElement.getInitializers();
if (elements != null && elements.length > 0) {
this.numberOfInitializers = elements.length;
createAfter(elements[elements.length - 1]);
} else {
elements = parentElement.getChildren();
if (elements != null && elements.length > 0) {
createBefore(elements[0]);
}
}
} catch (JavaModelException e) {
// type doesn't exist: ignore
}
}
COM: <s> by default the new initializer is positioned after the last existing initializer </s>
|
funcom_train/20535159 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getBoton4() {
if (boton4 == null) {
boton4 = new JButton();
boton4.setBounds(new Rectangle(200, 187, 140, 30));
boton4.setText("Curso Franja");
boton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
control.pedirArchivo("cursofranja");
}
});
}
return boton4;
}
COM: <s> this method initializes boton4 </s>
|
funcom_train/3908242 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void update() {
DataComponent component = null;
DweezilTreeNode selNode = getTree().getSelectedNode();
if(selNode != null) {
component = (DataComponent)selNode.getUserObject();
}
if(component != null) {
Element element = component.getElement();
url = ((LD_DataModel)getDataModel()).getLearningDesign().getAbsoluteURL(element);
if(url != null) {
setEnabled(true);
addListener();
}
else {
clear();
}
}
else {
clear();
}
}
COM: <s> add ourselves as proxy listener and set enabled </s>
|
funcom_train/49603989 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Appearance createAppearance(String filename) {
Appearance appear = new Appearance();
TextureLoader loader = null;
try {
loader = new TextureLoader(new URL(filePath + filename), null);
} catch (MalformedURLException e) {
System.out.println("load failed for texture: " + filename);
}
ImageComponent2D image = loader.getImage();
Texture2D texture = new Texture2D(Texture.BASE_LEVEL, Texture.RGBA, image
.getWidth(), image.getHeight());
texture.setImage(0, image);
appear.setTexture(texture);
return appear;
}
COM: <s> creates a default appearance with the texture found in the specified image file </s>
|
funcom_train/25011758 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ResultSet read_Modified_min(int mod, int min) throws SQLException{
PreparedStatement esq = (PreparedStatement) conn.prepareStatement("select sequence, hit, seq_id from test_sequence where mod_id = ? and seq_id > ?");
esq.setInt(1, mod);
esq.setInt(2, min);
ResultSet rset = esq.executeQuery();
return rset;
}
COM: <s> return modified sequence which id is greater than a given int </s>
|
funcom_train/45538054 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setFilter(String filterId, boolean state) {
// Renew filter id in LRU stack
fLRUFilterIdsStack.remove(filterId);
fLRUFilterIdsStack.add(0, filterId);
FilterItem item= (FilterItem) fFilterItems.get(filterId);
if (item != null) {
item.enabled= state;
storeViewDefaults();
updateViewerFilters();
}
}
COM: <s> sets the enable state of the given filter </s>
|
funcom_train/49640824 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addInstance(int subcategoryID, SaveCategoryInstance sci) {
loadSubCategories();
if (!subcategories.containsKey(subcategoryID)) {
subcategories.put(subcategoryID, new LinkedList<SaveCategoryInstance>());
}
subcategories.get(subcategoryID).add(sci);
}
COM: <s> p adds a save category instance to the map of subcategories </s>
|
funcom_train/29286385 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run() {
GraphicalViewer viewer = (GraphicalViewer)part.getAdapter(GraphicalViewer.class);
if (viewer != null) {
Collection c = viewer.getEditPartRegistry().values();
List selection = new ArrayList();
for(Iterator iter=c.iterator(); iter.hasNext();) {
EditPart part = (EditPart) iter.next();
if(part != viewer.getRootEditPart() && !viewer.getRootEditPart().getChildren().contains(part))
selection.add(part);
}
viewer.setSelection(new StructuredSelection(selection));
}
}
COM: <s> selects all edit parts in the active workbench part </s>
|
funcom_train/7284765 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int interrestOps() {
if (isUndef()) {
return SelectionKey.OP_READ;
} else if (isDaapConnection()) {
int op = SelectionKey.OP_READ;
if (!writer.isEmpty())
op |= SelectionKey.OP_WRITE;
return op;
} else {
// isAudioStream
return SelectionKey.OP_WRITE;
}
}
COM: <s> what do you do next </s>
|
funcom_train/9147109 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public E peekMax() {
return
( mNextFreeIndex == 1
? null
: (mNextFreeIndex == 2
? mHeap[1]
: (mNextFreeIndex == 3
? mHeap[2]
: ( mHeap[2].score() > mHeap[3].score()
? mHeap[2]
: mHeap[3] ) ) ) );
}
COM: <s> returns the maximum element in the heap or code null code </s>
|
funcom_train/26509079 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setStart(Node node) {
if (endNode.getGraph() != node.getGraph())
throw new IllegalArgumentException("trying to start an edge " +
"in an alien graph");
startNode.outEdges.remove(this);
startNode = node;
startNode.outEdges.add(this);
}
COM: <s> sets the starting code node code of this edge </s>
|
funcom_train/5424757 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void doDeleteemails(RunData data, Context ctx) throws Exception {
String toBeRemoved[] = data.getParameters().getStrings("emailList");
if (toBeRemoved == null) {
data.setMessage("Nothing removed, no addresses selected");
}
else {
for (int i = 0; i < toBeRemoved.length; i++) {
Factory.getConfiguration().removeEmailAddress(toBeRemoved[i]);
}
Factory.makeConfigurationPersistent();
}
}
COM: <s> deletes the email names from the notification list </s>
|
funcom_train/2292175 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String button(String href, String target, String image, String label, int type, boolean useCustomImage) {
if (useCustomImage) {
// search the picture in the "custom pics" folder
return button(href, target, image, label, type, getPicsUri());
} else {
// search the picture in the common "buttons" folder
return button(href, target, image, label, type);
}
}
COM: <s> generates a button for the open cms editor </s>
|
funcom_train/48528719 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void receiveMessage(Message msg) {
assertLocalNode();
Map<String, Object> options = new HashMap<String, Object>(1);
options.put(PriorityTransportLayer.OPTION_PRIORITY, msg.getPriority());
getLocalNode().send(this, msg,null, options);
}
COM: <s> called to send a message to the node corresponding to this handle </s>
|
funcom_train/39849221 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getSortingColumns() {
List sortingColumns = new ArrayList();
for(int c = 0; c < recentlyClickedColumns.size(); c++) {
ColumnClickTracker clickedColumn = (ColumnClickTracker)recentlyClickedColumns.get(c);
sortingColumns.add(new Integer(clickedColumn.getColumn()));
}
return sortingColumns;
}
COM: <s> get the columns that the table comparator chooser is sorting by </s>
|
funcom_train/10191155 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getString() {
int begin = m_nIndex;
while (begin < m_strString.length() && !isChar(m_strString.charAt(begin))) {
begin++;
}
int end = begin;
while (end < m_strString.length() && isChar(m_strString.charAt(end))) {
end++;
}
m_nIndex = end;
return m_strString.substring(begin, end);
}
COM: <s> gets a continuous string of char and go to the next char </s>
|
funcom_train/31928936 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void fillAllRegisters() {
for (int r = 0; r < 32; r++) {
fillGPRegister(r);
}
for (int r = 0; r < 32; r++) {
fillFPRegister(r);
}
for (int crf = 0; crf < 8; crf++) {
fillCRRegister(crf);
}
fillCTRRegister();
fillXERRegister();
fillLRRegister();
fillFPSCRRegister();
}
COM: <s> fill all the registers from the ppc process space </s>
|
funcom_train/27811304 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String guessAlbum(File file, String artist) {
File parent = file.getParentFile();
String album = isRoot(parent) ? null : parent.getName();
if (artist != null && album != null) {
album = album.replace(artist + " - ", "");
}
return album;
}
COM: <s> guesses the album for the given file </s>
|
funcom_train/18896626 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setUp() {
interpreter = new ItqlInterpreterBean();
boolean exceptionOccurred = true;
try {
Project project = new Project();
project.init();
load = new RDFLoad();
load.init();
load.setProject(project);
exceptionOccurred = false;
} finally {
if (exceptionOccurred) tearDown();
}
}
COM: <s> set up for tests </s>
|
funcom_train/13769841 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public BooleanContent checkBooleanContent() {
try {
BoolEval first = (BoolEval) _values[0][0];
for (int i = 0; i < _values.length; i++) {
for (int j = 0; j < _values[i].length; j++) {
if (first.equals(_values[i][j])) {
return BooleanContent.MIXED;
}
}
}
if (first.getBooleanValue()) {
return BooleanContent.ONLY_TRUE;
}
return BooleanContent.ONLY_FALSE;
} catch (Exception e) {
return BooleanContent.MIXED;
}
}
COM: <s> check if content of boolean array only false only true or mixed </s>
|
funcom_train/2893645 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addDBObjects(DBManager dbManager, String indexPath, String vaultPath, List objects) throws BaseException {
if (objects == null || indexPath == null)
return;
for (Iterator i = objects.iterator(); i.hasNext(); ) {
DBObject object = (DBObject) i.next();
addDBObject(dbManager, indexPath, vaultPath, object, true);
}
}
COM: <s> add a list of dbobject instances to index </s>
|
funcom_train/3439738 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(Object ob) {
if (ob == this)
return true;
if (!(ob instanceof VirtualMachineDescriptor))
return false;
VirtualMachineDescriptor other = (VirtualMachineDescriptor)ob;
if (other.provider() != this.provider()) {
return false;
}
if (!other.id().equals(this.id())) {
return false;
}
return true;
}
COM: <s> tests this virtual machine descriptor for equality with another object </s>
|
funcom_train/43245598 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetTypeOfDisposition() {
System.out.println("getTypeOfDisposition");
ApplicationObject instance = new ApplicationObject();
String expResult = "";
String result = instance.getTypeOfDisposition();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
COM: <s> test of get type of disposition method of class org </s>
|
funcom_train/5896261 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setModel(ListModel<?> model) {
if (model != null) {
if (!(model instanceof Selectable))
throw new UiException(model.getClass() + " must implement "+Selectable.class);
if (_model != model) {
if (_model != null) {
_model.removeListDataListener(_dataListener);
}
_model = model;
initDataListener();
postOnInitRender();
}
} else if (_model != null) {
_model.removeListDataListener(_dataListener);
_model = null;
invalidate();
}
}
COM: <s> sets the list model associated with this selectbox </s>
|
funcom_train/34889551 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getText() throws GeneralException {
switch (this.code) {
case LANG_ERROR:
return Texts.TE_LANGUAGE_FILE_ERROR;
case FILE_NOT_FOUND:
return Texts.TE_FILE_NOT_FOUND;
case NOT_UTF:
return Texts.TE_NOT_UTF;
default:
throw new GeneralException(GeneralException.INVALID_EXC_DESC);
}
}
COM: <s> returns the exception text in the user selected language </s>
|
funcom_train/5550819 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected double populationStandardDeviation(double[] v) {
double mean = new Mean().evaluate(v);
double sum = 0;
for (int i = 0; i < v.length; i++) {
sum += (v[i] - mean) * (v[i] - mean);
}
return Math.sqrt(sum / (double) v.length);
}
COM: <s> definitional formula for population standard deviation </s>
|
funcom_train/31929379 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void ensureMapped(int startAddr, int endAddr) throws MemoryMapException {
startAddr = truncateToPage(startAddr);
endAddr = truncateToNextPage(endAddr);
for (;startAddr < endAddr; startAddr += getPageSize()) {
if (!isMapped(startAddr)) {
map(startAddr, getPageSize(), true, true, false);
}
}
}
COM: <s> ensure memory between start and end is mapped </s>
|
funcom_train/45623091 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addPlatformPathPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CodeAnalysisType_platformPath_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_CodeAnalysisType_platformPath_feature", "_UI_CodeAnalysisType_type"),
MSBPackage.eINSTANCE.getCodeAnalysisType_PlatformPath(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the platform path feature </s>
|
funcom_train/38976812 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean activate(String username, String activationToken){
if (logger.isDebugEnabled()) {
logger.debug("Trying to active user:" + username);
}
User user = this.userManager.getUserByUsername(username);
if( user!=null && user.getState()==UserState.INACTIVE && user.getActivationToken().equals(activationToken)){
user.setActivationToken("");
user.setState(UserState.ACTIVE);
user.setRole(Role.EDITOR);
this.userManager.updateUser(user);
return true;
} else {
return false;
}
}
COM: <s> tries to activate user with given activation token </s>
|
funcom_train/3340428 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void doClick() {
// This is required because our parent window will send the KeyEvent
// to the Container containing the component with the current focus.
// super.requestFocus();
getParent().setFocus(this); // Mustn't generate FocusEvents (?)
Toolkit.getDefaultToolkit().fireKeystroke(KeyEvent.VK_ENTER, this);
}
COM: <s> programmatically performs a click of this button </s>
|
funcom_train/35669715 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addBaseLNodePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_LNodeFragment_baseLNode_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_LNodeFragment_baseLNode_feature", "_UI_LNodeFragment_type"),
FragmentsPackage.Literals.LNODE_FRAGMENT__BASE_LNODE,
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the base lnode feature </s>
|
funcom_train/44481165 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void checkButtons() {
JTable table = historyTable.getJTable();
if (table.getModel().getRowCount() == 0) {
clearAllButton.setEnabled(false);
} else {
clearAllButton.setEnabled(true);
}
if (table.getSelectionModel().isSelectionEmpty()) {
clearButton.setEnabled(false);
} else {
clearButton.setEnabled(true);
}
}
COM: <s> checks buttons whether it makes sense to activate or deactivate them </s>
|
funcom_train/2428303 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public DeliveryMode getDeliveryMode() {
int i = getIntProperty(DELIVERY_MODE, DeliveryMode.NON_PERSISTENT.getJmsSpecValue());
try {
return DeliveryMode.fromJmsSpecValue(i);
} catch (IllegalArgumentException ex) {
// Return the default value.
}
return DeliveryMode.NON_PERSISTENT;
}
COM: <s> returns the delivery mode of this message </s>
|
funcom_train/37230940 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean matchIndex(String key) {
int nameIndex = key.indexOf(separator);
log(Level.DEBUG, "index split: found separator=\"%s\" in \"%s\" index=%s", separator, key, key);
if (nameIndex != -1) {
key = key.substring(0, nameIndex);
log(Level.DEBUG, "index split: new name=\"%s\"", key);
}
return super.matchIndex(key);
}
COM: <s> only compare with string found before </s>
|
funcom_train/15902401 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeToXMLFile(Writer inXMLFile) throws IOException {
inXMLFile.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
inXMLFile.write("<coverdata>\n");
if (!mModuleCoverData.isEmpty()) {
inXMLFile.write(" <modules>\n");
for (ModuleCoverData theModule : mModuleCoverData.values()) {
theModule.writeToXMLFile(inXMLFile, " ");
}
inXMLFile.write(" </modules>\n");
}
inXMLFile.write("</coverdata>\n");
}
COM: <s> write the data to an xml file </s>
|
funcom_train/22278192 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setState(boolean aState) {
state = aState;
if (foundationMenuItem instanceof FoundationCheckMenuItem) {
((FoundationCheckMenuItem)foundationMenuItem).setState(state);
if (state) {
setImage(checkedImage());
setSelectedImage(checkedImage());
} else {
setImage(uncheckedImage());
setSelectedImage(uncheckedImage());
}
}
}
COM: <s> sets the menu items state if this is a checkbox menu item </s>
|
funcom_train/12625621 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getCurrentTime() throws ATCommandFailedException{
String response = atCmd.send("AT+CCLK?\n");
if(response.indexOf("ERROR") >= 0)
return null;
else{
int i = response.indexOf(":") + 2;
int j = response.length() - 4;
return response.substring(i , j);
}
}
COM: <s> gets the current time from the real time clock </s>
|
funcom_train/11009626 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setUnderlineType(short underlineType){
_font.setUArray(null);
if(underlineType != U_NONE){
FontUnderline fenum = FontUnderline.valueOf(underlineType);
STUnderlineValues.Enum val = STUnderlineValues.Enum.forInt(fenum.getValue());
_font.addNewU().setVal(val);
}
}
COM: <s> set the type of underlining type for the font </s>
|
funcom_train/15401060 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void endElement(String uri, String localname, String qname) throws SAXException {
try {
if ((localname == null) || ("".equals(localname.trim()))) {
localname = qname;
} else if (localname.equals(ELEM_ACTIONCOLLECTION)) {
_actionCollections.add(_collection);
}
} catch(Exception exc) {
_Log.error(exc);
}
}
COM: <s> creates end element given attributes </s>
|
funcom_train/24009409 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Integer getCheckInToDo(Integer hotelId) {
String sql = "select count(*) from Booking\n"+
"where hotel =:hotelId\n"+
"and checkin = current_date()\n"+
"and checkindone is null";
Session session = getSession();
try {
Query query = session.createQuery(sql);
query.setInteger("hotelId", hotelId);
Long result = (Long)query.uniqueResult();
return result.intValue();
}
finally {
session.close();
}
}
COM: <s> gets todays check in to do </s>
|
funcom_train/35838710 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean restoreLink(PCSession session, String sViewID, String sLinkID) throws SQLException {
//
// DBConnection dbcon = getDatabaseManager().requestConnection(session.getModelName()) ;
//
// boolean added = DBViewLink.restore(dbcon, sViewID, sLinkID);
//
// getDatabaseManager().releaseConnection(session.getModelName(),dbcon);
return true;
}
COM: <s> restores the given link in this view </s>
|
funcom_train/34674192 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getExpandedSubTitle(Type local) {
if (getTitle()!=null) {
return expand(getSubTitle(), QuotationContext.getQuotation(), local);
}
// TODO Check getTitleBinding for backward compatibility only - remove for OQ2.0
else if (getSubTitleBinding()!=null) {
return local.xpathGet(getSubTitleBinding(), String.class);
}
else {
return null;
}
}
COM: <s> get the sub title with all variable references expanded </s>
|
funcom_train/10563941 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void registerConverter(ValueConverter<?> converter){
if(readonly){
throw new IllegalStateException("Unable to register an converter for a read only ValueConverter Factory!" +
"Do not use the static getInstance(..) Methods if you need to change the configuration.");
}
uri2converter.put(converter.getDataType(), converter);
}
COM: <s> registers a converter for the </s>
|
funcom_train/50911710 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void processSimpleContent(Map<String, CMLType> typeMap) {
if (extension != null) {
String base = extension.getAttributeValue("base");
if (base == null) {
throw new RuntimeException("No base given for extension in "+name);
}
simpleContentType = typeMap.get(base);
if (simpleContentType == null) {
throw new RuntimeException("No type found for: "+base);
}
}
}
COM: <s> process simple content </s>
|
funcom_train/3725086 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Stack initializeStack() throws Exception {
Stack stack = new Stack();
File root = new File(rootPath);
if (!root.isDirectory()) {
String msg = "Root path: "
+ rootPath
+ " is not actually a directory!";
System.err.println("FATAL: " + msg);
throw new Exception(msg);
}
stack.push(root);
return stack;
}
COM: <s> create a new stack and add the root directory to it </s>
|
funcom_train/3412009 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public VolatileImage createVolatileImage(int width, int height) {
ComponentPeer peer = this.peer;
if (peer instanceof LightweightPeer) {
if (parent != null) {
return parent.createVolatileImage(width, height);
}
else { return null;}
} else {
return (peer != null) ?
peer.createVolatileImage(width, height) : null;
}
}
COM: <s> creates a volatile off screen drawable image </s>
|
funcom_train/20885305 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testComplexFieldFLR() {
check(FLR, "valid foo ", ComplexElementTestDTO.class, VALID);
check(FLR, " valid foo ", ComplexElementTestDTO.class, VALID);
check(FLR, " foo ", ComplexElementTestDTO.class, INVALID);
check(FLR, " foo ", ComplexElementTestDTO.class, VALIDATION_OFF);
}
COM: <s> tests validation for a complex field value flr </s>
|
funcom_train/22572629 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void doNewPost() {
fPostType = POST_NEW;
setPostControlsEnabled(true);
setTreeControlsEnabled(false);
fTextTitle.setText(""); //$NON-NLS-1$
fTextContent.setText(""); //$NON-NLS-1$
}
COM: <s> new top level post </s>
|
funcom_train/28956988 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object jsFunction_getDateHeader(String name) {
long date = request.getDateHeader(name);
if (date == -1) {
return null;
} else {
return Context.getCurrentContext()
.newObject(getParentScope(), "Date", new Object[] {date});
}
}
COM: <s> returns the value of the specified request header as date object </s>
|
funcom_train/5587753 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addRole(String roleName, Role role) {
getElement().getRootElement().getApplication();
Element roleElement = role.getElement();
if (hasApplication(roleName)) {
throw new UnsupportedOperationException(
"a role by the same name is already present: " + roleName);
}
Link link = (Link) build(PERSISTENT_LINK, roleName);
String pathname = roleElement.getPathname();
link.setPathname(pathname);
}
COM: <s> add a link to a new role </s>
|
funcom_train/38856888 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void copyfile(String from, String to) {
try {
BufferedReader in = new BufferedReader(new FileReader(from));
BufferedWriter out = new BufferedWriter(new FileWriter(to));
String line;
while ((line = in.readLine()) != null) {
out.write(line);
out.newLine();
}
out.close();
in.close();
}
catch (IOException e) {
System.err.printf("Error: %s", e);
}
}
COM: <s> method to copy an ascii file </s>
|
funcom_train/21157273 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object format(Object value, Locale locale) {
if (value == null) return "";
if (value instanceof java.lang.Boolean) {
java.lang.Boolean b = (java.lang.Boolean)value;
return b.toString();
} else
if (value instanceof NativeBoolean) {
NativeBoolean nb = (NativeBoolean)value;
boolean b = nb.getBooleanValue();
return String.valueOf(b);
} else
// not a boolean - return value as a string
return String.valueOf(value);
}
COM: <s> formats booleans correctly </s>
|
funcom_train/1483438 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deleteDocuments(Term term) throws CorruptIndexException, IOException {
ensureOpen();
try {
boolean doFlush = docWriter.bufferDeleteTerm(term);
if (doFlush)
flush(true, false, false);
} catch (OutOfMemoryError oom) {
hitOOM = true;
throw oom;
}
}
COM: <s> deletes the document s containing code term code </s>
|
funcom_train/1045438 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int readIntCorrect() throws IOException {
int val;
val = readInt();
if (bigendian){
return(val);
}
else {
int byte0 = val & 0xff;
int byte1 = (val>>8) & 0xff;
int byte2 = (val>>16) & 0xff;
int byte3 = (val>>24) & 0xff;
// swap the byte order
return (byte0<<24) | (byte1<<16) | (byte2<<8) | byte3;
}
}
COM: <s> read int correct will return an int from the stream </s>
|
funcom_train/23261301 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void close() {
if (!connected) {
throw new RemoteException("Not connected");
}
listening = false;
try {
sender.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
reader.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
socket.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
COM: <s> close connection to server </s>
|
funcom_train/948684 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Serializable decrypt(byte[] cipherObject, AgentData sender) throws Exception {
if (!this.securityDatas.containsKey(sender.getAddress())) {
throw new Exception("Do not share any key with the sender. Decryption not possible");
}
SecretKey key = ((SecurityDatas) this.securityDatas.get(sender.getAddress())).secretKey;
return this.symmetricDecryption(cipherObject, key);
}
COM: <s> decrypts an encrypted content sent by the specific communication partner </s>
|
funcom_train/34333378 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ModelAndView wptHandler(HttpServletRequest request, HttpServletResponse response) {
Wpt wpt = this.clinic.loadWpt(RequestUtils.getStringParameter(request, "id", ""));
if (wpt == null) {
return new ModelAndView("findOwnersRedirect");
}
wpt.setDesc(ResultPageHelper.replaceImageLocation(wpt.getDesc(), "data/images/"));
return new ModelAndView("wptView", "wpt", wpt);
}
COM: <s> custom handler for owner display </s>
|
funcom_train/4628755 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Text createTextBox(Composite container, String setting) {
Label label;
GridData gd;
Text nameText;
label = new Label(container, SWT.NULL);
label.setText(setting);
nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
nameText.setLayoutData(gd);
nameText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
dialogChanged();
}
});
label = new Label(container, SWT.NULL);
label.setText("");
return nameText;
}
COM: <s> creates author text box </s>
|
funcom_train/22234992 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void incNodeComponentRefCount( int nodeID ) {
if (nodeID==0) return;
SymbolTableData symbol = getSymbol( nodeID );
((NodeComponentState)symbol.nodeState).addSubReference();
if (symbol.referenceCount==1)
sharedNodes.add( symbol );
symbol.referenceCount++;
}
COM: <s> update the reference count for the node component </s>
|
funcom_train/9758255 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setEnabled(RulerColumnDescriptor descriptor, boolean enabled) {
Assert.isLegal(descriptor != null);
String id= descriptor.getId();
String preference= fStore.getString(fKey);
Set marked= StringSetSerializer.deserialize(preference);
boolean shouldMark= enabled ^ descriptor.getDefaultEnablement();
boolean isMarked= marked.contains(id);
if (isMarked != shouldMark) {
if (shouldMark)
marked.add(id);
else
marked.remove(id);
fStore.setValue(fKey, StringSetSerializer.serialize(marked));
}
}
COM: <s> sets the enablement state of the given ruler contribution </s>
|