__key__
stringlengths 16
21
| __url__
stringclasses 1
value | txt
stringlengths 183
1.2k
|
---|---|---|
funcom_train/13851189 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void write(OutputStream out) throws IOException {
BufferedWriter bw = new BufferedWriter
(new OutputStreamWriter(out, "UTF8"));
/* write the specification header */
bw.write(HEADER_TITLE + "1.0\n");
bw.write(PREF_PREFIX + " " + defaultPreference + "\n\n");
/* write out most specific preferences first */
writeMap(completeNamePrefs, bw, "");
writeMap(packagePrefs, bw, "/*");
writeMap(namespacePrefs, bw, "/-");
bw.flush();
}
COM: <s> write the preferences to the specified output stream using the </s>
|
funcom_train/51581703 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testReadPacketWithNoEscapedData() throws Exception {
PacketReader packetReader = createPacketReader(createWellFormedPacket(10, 50));
int[] packet = packetReader.readPacket(10);
assertEquals(8, packet.length);
for (int i = 0; i < packet.length; i++) {
assertEquals(50, packet[i]);
}
}
COM: <s> the packet is read with no escaped data </s>
|
funcom_train/11701698 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createPear() throws PackageCreatorException {
//generates the PEAR packages with the given information
PackageCreator
.generatePearPackage(this.componentId, this.mainComponentDesc,
this.classpath, this.datapath, this.pearPackagingDir
.getAbsolutePath(), this.targetDir, this.props);
}
COM: <s> create a pear package with </s>
|
funcom_train/13515441 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean deleteValue(Key key, Object value) throws ChaiDBException {
switch (type) {
case IBTreeConst.HYPER_BTREE:
return ((IDuplicatedKeyBTree) btree).delete(key, value, kc);
default:
break;
}
throw new ChaiDBException(ErrorCode.INVALID_INDEX_TYPE);
}
COM: <s> delete a value of the key </s>
|
funcom_train/50429636 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void add(String name) {
varnames.add(name);
varvalues.add(new Double(0.0));
if(num<rows) {
values[num][0] = 0.0;
} else {
double tmp[][] = new double[2*rows][columns];
for(int i=0;i<rows;i++) {
for(int j=0;j<columns;j++) {
tmp[i][j] = values[i][j];
}
}
for(int z=0;z<numcolumns;z++) {
tmp[num][z] = 0.0;
}
values = tmp;
rows*=2;
}
num++;
}
COM: <s> adds a new state to the node </s>
|
funcom_train/16769550 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private long pendingVideoMessages() {
OOBControlMessage pendingRequest = new OOBControlMessage();
pendingRequest.setTarget("ConnectionConsumer");
pendingRequest.setServiceName("pendingVideoCount");
msgOut.sendOOBControlMessage(this, pendingRequest);
if (pendingRequest.getResult() != null) {
return (Long) pendingRequest.getResult();
} else {
return 0;
}
}
COM: <s> get number of pending video messages </s>
|
funcom_train/38736775 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setClickTime(float clickTime, int elementNumber) {
if (isStartAnimationRunning()) {
return;
}
if (logger.isTraceEnabled()) {
logger.trace("Click animation " + "clickTime=" + clickTime + ", elementNumber=" + elementNumber);
}
ComputorInDataImpl in = ins[elementNumber];
in.setClickTime(clickTime);
changed(elementNumber);
}
COM: <s> called when click animator generated new code click time code value </s>
|
funcom_train/4628771 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected ISourceViewer createSourceViewer(Composite parent,IVerticalRuler ruler, int styles) {
ISourceViewer viewer= new ProjectionViewer(parent, ruler, fOverviewRuler, true, styles);
getSourceViewerDecorationSupport(viewer);
viewer.getTextWidget().addVerifyListener(softTabListener);
return viewer;
}
COM: <s> override to make use of soft tabs </s>
|
funcom_train/8079280 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TableEntry getEntry(double key) {
TableEntry [] table = m_Table;
int hash = hashCode(key);
int index = (hash & 0x7FFFFFFF) % table.length;
for (TableEntry e = table[index] ; e != null ; e = e.next) {
if ((e.hash == hash) && (Math.abs(e.key - key) < EPSILON)) {
return e;
}
}
return null;
}
COM: <s> returns the table entry to which the specified key is mapped in </s>
|
funcom_train/9667280 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setColumnWidths() {
TableColumn column = null;
for (int i = 0; i <= 7; i++) {
column = jTable8.getColumnModel().getColumn(i);
if (i == 0) {
column.setPreferredWidth(50); //first column is smaller as it just has a 4 digit id
}
else {
column.setPreferredWidth(100);
}
}
}
COM: <s> sets the widths of the columns in the tables to appropriate sizes </s>
|
funcom_train/15624478 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void newNode(@NotNull final String path) {
if (log.isDebugEnabled()) {
log.debug("newNode(" + path + ")");
}
if (!values.containsKey(path)) {
values.put(path, new TreeMap<String, String>());
}
}
COM: <s> make sure a node exists </s>
|
funcom_train/3340667 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void remove(int index) {
//save this just in case
Component selected = (Component) _tabComponents.elementAt(0);
_tabComponents.remove(index);
super.remove((Component) _tabs.elementAt(index));
_tabs.remove(index);
if (getSelectedIndex() == index) {
if (index - 1 < 0) {
if (getTabCount() > 0) {
setSelectedIndex(0);
} else { //nothing left, this causes exception
_selectedIndex = -1;
super.remove(selected);
super.validate();
}
} else {
setSelectedIndex(index - 1);
}
}
if (isDisplayed()) {
repaint();
}
}
COM: <s> removes the tab and component which corresponds to the specified </s>
|
funcom_train/42398078 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public NewConcreteType newConcreteType(final String name) {
Checker.notEmpty("parameter:name", name );
NewConcreteTypeImpl type = null;
final PrintWriter printWriter = this.tryCreateTypePrintWriter(name);
if (null != printWriter) {
type = new NewConcreteTypeImpl();
type.setGeneratorContext(this);
type.setName(name);
type.setPrintWriter(printWriter);
type.setSuperType(this.getObject());
type.setVisibility(Visibility.PUBLIC);
this.addNewType(type);
}
return type;
}
COM: <s> factory method which creates a new concrete type </s>
|
funcom_train/42114586 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ESValue getUTC(int element) {
if (date == null) {
return new ESNumber(Double.NaN);
} else {
Calendar cal = Calendar.getInstance(TimeZone.getDefault());
cal.setTime(date);
long t = cal.get(element);
// EcmaScript has SUNDAY=0, java SUNDAY=1 - converted in
// DatePrototype
if (element == Calendar.DAY_OF_WEEK)
t--;
return new ESNumber((double) t);
}
}
COM: <s> get an element of the date in utc time zone </s>
|
funcom_train/10254115 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public interface ConnectionPool {
/**
* Returns a physical <tt>Connection</tt> to an underlying pool. <p>
*
* @param connection The physical connection object being returned to
* the pool.
* @param statementPool The implementation originally provided
* by the pooling implementation to facilitate statement reuse
* against the given <tt>Connection</tt> object.
*/
void checkIn(Connection connection, StatementPool statementPool);
}
COM: <s> interface required to cooperate with a tt connection tt pool </s>
|
funcom_train/29381156 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void nextAccount()
{
// PATCH_UP
// int selRow = summaryTable.getSelectedRow() + 1;
// summaryTable.setSelectedRow( selRow );
// Long selection = (Long)((XTablePojoModelAdapter)summaryTable.getModel()).getValueAt( selRow, 21 );
// soas.setSelectedNodeId( selection.longValue(), null );
//
// updateNavButtons();
// updateBoundComponentValues();
}
COM: <s> navigate to the next account </s>
|
funcom_train/32216741 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public GaWorkloadGeneratorStub getWorkloadGeneratorStub() {
Stereotype stereotype = activity.getApplicableStereotype(GaWorkloadGeneratorDecorator.QUALIFIED_NAME);
GaWorkloadGeneratorDecorator decorator = null;
try {
decorator = (GaWorkloadGeneratorDecorator) getFactory().getDecorator(stereotype);
} catch (ClassNotFoundException e) {} // cannot happen
catch (InvalidContextException e) {} // cannot happen
return (GaWorkloadGeneratorStub) decorator.getStub(activity);
}
COM: <s> gets the stub for the ga workload generator stereotype </s>
|
funcom_train/8405676 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deregister() {
converters.clear();
registerPrimitives(false);
registerStandard(false, false);
registerOther(true);
registerArrays(false, 0);
register(BigDecimal.class, new BigDecimalConverter());
register(BigInteger.class, new BigIntegerConverter());
}
COM: <s> remove all registered </s>
|
funcom_train/37654216 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isRef(ASTFieldDeclaration fieldDeclaration, ASTVariableDeclarator variableDeclarator) {
Node type = fieldDeclaration.jjtGetChild(0).jjtGetChild(0);
if (type instanceof ASTReferenceType) {
// Reference type, array or otherwise
return true;
} else {
// Primitive array?
return ((ASTVariableDeclaratorId) variableDeclarator.jjtGetChild(0)).isArray();
}
}
COM: <s> checks if a field declaration is a reference type includes arrays </s>
|
funcom_train/49214549 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testFetchRow() throws CeleritasException {
String table = "test_table";
String pk = "test_pk";
String pVal = "1001";
HashMap<String, String> row = DBHelper.fetchRow(table, pk, pVal);
assertEquals(row.size(), 3);
assertEquals(row.get("test_field1"), "test val 1");
}
COM: <s> test of fetch row method of class dbhelper </s>
|
funcom_train/47967470 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeXML(Document document, String filePath) {
try {
BufferedWriter bw = new BufferedWriter(new FileWriter(filePath));
OutputFormat of = new OutputFormat("XML","utf-8",true);
of.setIndent(1);
of.setIndenting(true);
XMLSerializer serializer = new XMLSerializer(bw,of);
serializer.asDOMSerializer();
serializer.serialize(document);
bw.close();
} catch (Exception ex) {
ex.printStackTrace();
System.err.println("error: write modified XML failed");
System.exit(1);
}
}
COM: <s> this method serialize a document object to a disk file </s>
|
funcom_train/26168665 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int compare (Object o1, Object o2) {
if (this.getArea().getParent() != null) {
if (this.getArea().getParent().getWedgeOrder() == PieChart.DESCENDING_ORDER) {
return this.compareDescending(o1, o2);
}
}
// otherwise sort default to ASCENDING
return this.compareAscending(o1, o2);
}
COM: <s> compares two objects against each other by checking to see which </s>
|
funcom_train/11678569 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private HttpProcessor getHttpProcessor() {
BasicHttpProcessor httpProcessor = new BasicHttpProcessor();
httpProcessor.addInterceptor(new RequestContent());
httpProcessor.addInterceptor(new RequestTargetHost());
httpProcessor.addInterceptor(new RequestConnControl());
httpProcessor.addInterceptor(new RequestUserAgent());
httpProcessor.addInterceptor(new RequestExpectContinue());
return httpProcessor;
}
COM: <s> return the http processor for requests </s>
|
funcom_train/18719009 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void SocketEventPerformed(String message) {
//System.out.println("Socket Event: " + message);
if (chatField != null)
chatField.setText(message);
try {
//System.out.println("NetSIM Message:" + message);
MyParser.parse(message);
} catch (Exception exc) {
System.out.println("Error: in SocketEventPerformed:"
+ exc.getMessage());
}
}
COM: <s> is called if a input has been made from the textfield </s>
|
funcom_train/138496 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int compareTo(GenericServer gServer) {
if (this.isEnabled() != gServer.isEnabled()) {
return Boolean.valueOf(this.isEnabled()).compareTo(Boolean.valueOf(gServer.isEnabled()));
}
if (!(this.serverName.equals(gServer.serverName))) {
return this.serverName.compareTo(gServer.serverName);
}
return this.serverType.compareTo(gServer.serverType);
}
COM: <s> order by enabled disabled then server name then das2 das quickload </s>
|
funcom_train/35659904 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isKeyword(String token) {
// Compare the passed token against the provided keyword list, or their
// lowercase form
for (int i = 0; i < KunderaQuery.SINGLE_STRING_KEYWORDS.length; i++) {
if (token.equalsIgnoreCase(KunderaQuery.SINGLE_STRING_KEYWORDS[i])) {
return true;
}
}
return false;
}
COM: <s> method to detect whether this token is a keyword for jpql single string </s>
|
funcom_train/4658265 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String checkNamespace(String namespaceUri) {
// Walk the stack from the top to find an element with this ns declaration.
for (int i = elementStack.size() - 1; i >= 0; --i) {
Element element = elementStack.get(i);
for (Namespace ns: element.nsDecls) {
if (ns.alias != null && ns.uri.equals(namespaceUri)) {
return ns.alias;
}
}
}
return null;
}
COM: <s> determines if the specified namespace is declared at the current scope </s>
|
funcom_train/43328030 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void rescale() {
if (autoscaleMinX)
minX = calcMinX();
if (autoscaleMaxX)
maxX = calcMaxX();
if (autoscaleMinY)
minY = calcMinY();
if (autoscaleMaxY)
maxY = calcMaxY();
if (XScale != null) {
XScale.setMin(minX);
XScale.setMax(maxX);
}
if (YScale != null) {
YScale.setMin(minY);
YScale.setMax(maxY);
}
}
COM: <s> rescale if autoscaling </s>
|
funcom_train/19419055 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isDuplicateFileName(final String fileName) {
final int size = aoList.size();
for (int i = 0; i < size; i++) {
final AttachObj attachObj = (AttachObj)aoList.get(i);
if (fileName.equals(attachObj.getFileName()))
return true;
}
return false;
}
COM: <s> is the file name duplicated in our list of attach objs </s>
|
funcom_train/1712819 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void resetForNonPDFPage() {
displayScaling=null;
/** set hires mode or not for display */
currentDisplay.setHiResImageForDisplayMode(false);
fontsInFile = "";
pageCount = 1;
hasOutline = false;
if (formsAvailable) {
if (currentFormRenderer != null)
currentFormRenderer.removeDisplayComponentsFromScreen(this);
if ((currentAnnotRenderer != null) && (showAnnotations))
currentAnnotRenderer.removeDisplayComponentsFromScreen(this);
//invalidate();
}
// reset page data
this.pageData = new PdfPageData();
}
COM: <s> used for non pdf files to reset page </s>
|
funcom_train/37018080 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getFileName(){
String fileName= Language.labelMgt[18] + getTitle();
if(getURL() != null){
fileName= getURL().getFile();
fileName= fileName.substring(fileName.lastIndexOf("/") + 1);
}
return fileName;
}
COM: <s> get the file name to the window title </s>
|
funcom_train/32354747 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void createProperty(Item item, String property) {
CreateProperty createProp = new CreateProperty();
createProp.setItem(item);
createProp.addProperty(property);
try {
stub.createProperty(createProp);
} catch (RemoteException e) {
logger.error(e.getMessage());
} catch (GeneralFault e) {
logger.error(e.getMessage());
} catch (AuthorizationFault e) {
logger.error(e.getMessage());
} catch (ExistenceFault e) {
logger.error(e.getMessage());
}
}
COM: <s> creates a property with the provided name for the item </s>
|
funcom_train/39069584 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public IMylarStructureBridge getStructureBridge(String contentType) {
if (!CoreExtensionPointReader.extensionsRead) CoreExtensionPointReader.initExtensions();
IMylarStructureBridge adapter = bridges.get(contentType);
if (adapter != null) {
return adapter;
} else if (defaultBridge != null) {
return defaultBridge;
} else {
return DEFAULT_BRIDGE;
}
}
COM: <s> todo performance issue </s>
|
funcom_train/1540850 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void dispose() {
try {
// Swing sometimes calls dispose several times for a given
// graphics object. Ensure that the grestore is only written
// once if this happens.
if (doRestoreOnDispose) {
writeGraphicsRestore();
doRestoreOnDispose = false;
}
} catch (IOException e) {
handleException(e);
}
}
COM: <s> disposes of the graphics context </s>
|
funcom_train/28297343 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void interrupt() {
// if we're not running, there's nothing to interrupt
if (!running) {
return;
}
// iterate over threads, calling interrupt() on each
for (Iterator i = threads.iterator(); i.hasNext();) {
((Thread) i.next()).interrupt();
}
// we're no longer running
running = false;
}
COM: <s> interrupt all threads in the pool </s>
|
funcom_train/18543253 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getRedirectLocation(GetMethod method) throws Exception {
String redirectLocation;
Header locationHeader = method.getResponseHeader("location");
if (locationHeader != null) {
redirectLocation = locationHeader.getValue();
return redirectLocation;
} else {
throw new Exception("Method failed: " + method.getStatusLine());
}
}
COM: <s> gets a redirect header </s>
|
funcom_train/17976660 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getJButtonSave() {
if (jButtonSave == null) {
jButtonSave = new JButton();
jButtonSave.setText("Save");
jButtonSave.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
if(listener != null){
listener.save();
}
}
});
}
return jButtonSave;
}
COM: <s> this method initializes j button save </s>
|
funcom_train/3749038 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object getSystemSetting(final String key) {
if (logger.isDebugEnabled()) {
logger.debug("getSystemSetting(String key = " + key + ") - start");
}
Object returnObject = systemSettings.get(key);
if (logger.isDebugEnabled()) {
logger.debug("getSystemSetting(String) - end - return value = "
+ returnObject);
}
return returnObject;
}
COM: <s> p get the value of a system wide setting requiring administrator </s>
|
funcom_train/40621056 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeItem(FastTreeItem item) {
// Validate.
if (children == null || !children.contains(item)) {
return;
}
// Orphan.
item.clearTree();
// Physical detach.
if (state != TREE_NODE_INTERIOR_NEVER_OPENED) {
DOM.removeChild(childElems, item.getElement());
}
// Logical detach.
item.setParentItem(null);
children.remove(item);
}
COM: <s> removes an item from the tree </s>
|
funcom_train/43790522 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testValueOfDoublePos2() {
double a = 12321237576.98788767;
BigDecimal result = BigDecimal.valueOf(a);
String res = "12321237576.987888";
int resScale = 6;
assertEquals("incorrect value", res, result.toString());
assertEquals("incorrect scale", resScale, result.scale());
}
COM: <s> create a big decimal from a positive double value </s>
|
funcom_train/37585131 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void runGCUntil(Condition done) {
int gcCount = 0;
while (!done.isTrue() && gcCount < MAX_GC_COUNT) {
System.runFinalization();
System.gc();
gcCount++;
}
if (gcCount >= MAX_GC_COUNT) {
fail("Too many GCs required.");
}
}
COM: <s> asks the system to gc until done p returns </s>
|
funcom_train/29829074 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void handleError(InfoQuery iq, BSRegState task) {
BSCore.logEvent(name, "error " + iq.getErrorCode() + ": " + iq.getErrorText());
setState(task.jid, BSRegState.NOT_REGISTERED, null);
fireError(iq, iq.getIdentifier());
}
COM: <s> handles code info query code packet if it does contain an error </s>
|
funcom_train/7426883 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Element drillDownFromRoot(final int pos, final Element rootElement) {
// Before each pass, start at the root
Element curElement = rootElement;
// Now we descend the hierarchy until we get to a leaf
while (!curElement.isLeaf()) {
curElement = curElement.getElement(curElement.getElementIndex(pos));
}
return curElement;
}
COM: <s> returns the first leaf encountered by drilling into the document for the </s>
|
funcom_train/7510781 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void registerSearchRowsButton(JButton button) {
if (searchButton != null) {
throw new IllegalStateException("'searchButton' button already registered ("
+ searchButton.getText() + ").");
}
if (button == null) {
throw new IllegalStateException("Internal error. Parameter 'button' must be not null.");
}
this.searchButton = button;
button.setActionCommand("search");
button.setName("search");
Utils.addCheckedListener(button, this);
}
COM: <s> register search rows button on dialog </s>
|
funcom_train/2878897 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void keyReleased(KeyEvent e) {
switch (e.getKeyCode()) {
case (KeyEvent.VK_DOWN):
player.keyDownReleased();
break;
case (KeyEvent.VK_UP):
player.keyUpReleased();
break;
case (KeyEvent.VK_LEFT):
player.keyLeftReleased();
break;
case (KeyEvent.VK_RIGHT):
player.keyRightReleased();
break;
}
}
COM: <s> key released event </s>
|
funcom_train/9758424 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String escapeTabs(String string) {
StringBuffer buffer= new StringBuffer();
int begin= 0;
int end= string.indexOf('\t', begin);
while (end >= 0) {
buffer.append(string.substring(begin, end));
buffer.append(TAB);
begin= end + 1;
end= string.indexOf('\t', begin);
}
buffer.append(string.substring(begin));
return buffer.toString();
}
COM: <s> translates all tab characters into a proper status line presentation </s>
|
funcom_train/28346868 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void checkIfEverConnected( final String methodName ) throws ConnectionException {
if ( !hasEverBeenConnected() ) {
throw new ConnectionException( this, "Channel::" + methodName + " - The channel \"" + m_strId + "\" must be connected at least once in the past to use this feature.");
}
}
COM: <s> checks if this channel has ever been connected </s>
|
funcom_train/18049160 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void notify_observers(String key) {
if (this.subscriptions.containsKey(key)) {
ArrayList observers = (ArrayList) this.subscriptions.get(key);
for (int i=0; i<observers.size(); i++) {
PreferencesObserver pref_obs = (PreferencesObserver) observers.get(i);
pref_obs.preference_changed(key);
}
}
}
COM: <s> notifies all preferences observers which have subscribed to the </s>
|
funcom_train/8399980 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void increaseCapacity() {
int currentCapacity = this.storedObjects.length;
int newCapacity = currentCapacity + ((currentCapacity * this.growthFactor) / 100);
if (newCapacity == currentCapacity ) {
newCapacity++;
}
Object[] newStore = new Object[ newCapacity ];
System.arraycopy( this.storedObjects, 0, newStore, 0, this.size );
this.storedObjects = newStore;
}
COM: <s> increases the capacity of this list </s>
|
funcom_train/16799638 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isNextCharacterEscapedQuote(String nextLine, boolean inQuotes, int i) {
return inQuotes // we are in quotes, therefore there can be escaped quotes in here.
&& nextLine.length() > (i+1) // there is indeed another character to check.
&& nextLine.charAt(i+1) == quotechar;
}
COM: <s> precondition the current character is a quote or an escape </s>
|
funcom_train/10912443 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void resolveIDRef(String id, PageViewport pv) {
if (idRef.equals(id) && pv != null) {
resolved = true;
Trait.InternalLink iLink = new Trait.InternalLink(pv.getKey(), idRef);
area.addTrait(Trait.INTERNAL_LINK, iLink);
}
}
COM: <s> resolve by adding an internal link trait to the area </s>
|
funcom_train/3986556 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void endCamera() {
if (!manipulatingCamera) {
throw new RuntimeException("Cannot call endCamera() " +
"without first calling beginCamera()");
}
// reset the modelview to use this new camera matrix
modelview.set(camera);
modelviewInv.set(cameraInv);
// set matrix mode back to modelview
forwardTransform = modelview;
reverseTransform = modelviewInv;
// all done
manipulatingCamera = false;
}
COM: <s> record the current settings into the camera matrix and set </s>
|
funcom_train/1443372 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void resetAll(int infotyp) {
if (infotyp == Info.TYPE_SENSE) {
// collisions remain for whole cycle
for (BOOLEANS b : BOOLEANS.values())
this.booleanMap.put(b, BOOLEAN_UNKNOWN);
}
for (DOUBLES d : DOUBLES.values())
this.doubleMap.put(d, DOUBLE_UNKNOWN);
for (VEKTORS v : VEKTORS.values())
this.vektorMap.put(v, VEKTOR_UNKNOWN);
for (PLAYERS p : PLAYERS.values())
this.playerMap.put(p, PLAYER_UNKNOWN);
}
COM: <s> resets the memory </s>
|
funcom_train/4231259 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Map createEdgeAttributes() {
Map map = new Hashtable();
// Add a Line End Attribute
GraphConstants.setLineEnd(map, GraphConstants.ARROW_SIMPLE);
// Add a label along edge attribute
GraphConstants.setLabelAlongEdge(map, true);
// Adds a parallel edge router
GraphConstants.setLineStyle(map, GraphConstants.STYLE_SPLINE);
GraphConstants.setFont(map, GraphConstants.DEFAULTFONT.deriveFont(10f));
return map;
}
COM: <s> hook from graph ed to set attributes of a new edge </s>
|
funcom_train/43231043 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void removeRoleFromPerson(final Person person, final List<Role> roles) {
try {
this.beginTransaction();
for (final Role role : roles) {
final PersonRemoveRoleCommand command = new PersonRemoveRoleCommand(person, role);
this.doCommand(command);
}
this.commitTransaction();
} catch (final IPScrumGeneralException e) {
this.toastMessage(e.getMessage());
this.rollbackTransaction();
}
}
COM: <s> this method opens the function to remove roles from a person </s>
|
funcom_train/47491087 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean sendToPlatform(Message message, Platform platform) {
try {
connectionOfOuts.get(platform).send(message.toString());
} catch (ConnectException e) {
System.out.println("not connected, can't send");
e.printStackTrace();
return false;
} catch (IOException e) {
System.out.println("IO error, can't send");
e.printStackTrace();
return false;
}
return true;
}
COM: <s> will send the message </s>
|
funcom_train/25283199 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void moveShape(final Shape shp, final int x, final int y) {
moving = true;
SnapResults snp_res;
snp_res = snapper.prepareSnapPosition(shp_selected, x, y,
cursor_pos_in_shp_x, cursor_pos_in_shp_y);
if (!snp_res.snapped_x)
shp.setX(x - cursor_pos_in_shp_x);
if (!snp_res.snapped_y)
shp.setY(y - cursor_pos_in_shp_y);
refreshDrawingArea();
}
COM: <s> moves the selected shape according to the cursor movement taking </s>
|
funcom_train/32113585 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void initGuiInventory(String ititle, Inventory inventory, int mode, boolean showWeight) {
setTitle(ititle);
this.inv = inventory;
this.index = 0;
this.pageIndex = 0;
this.page = 0;
// If in pickup mode, remove chosen item from target inventory
this.mode = mode;
if (mode==GuiInventory.PICK)
removeItemFromInventory = true;
else
removeItemFromInventory = false;
this.showWeight = showWeight;
initGuiInventory();
}
COM: <s> initialize inventory gui </s>
|
funcom_train/43326930 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeYAPFAtom(Printf outfile) throws IOException {
if ((monomers == null) || (outfile == null)) return;
// write Atom records
Monomer tr;
for (tr=(Monomer)monomers.head(); tr != null; tr=tr.next)
tr.writeYAPFAtom(outfile,Character.toUpperCase(chainID));
}
COM: <s> write yapf atom records for this polymer </s>
|
funcom_train/125055 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void execute() {
try {
firePCallEvent(EvtTypes.QUEUED);
setPriority(Thread.MIN_PRIORITY);
getExecutor().execute(this);
} catch (InterruptedException ex) {
log.error("Execution of " + getName() + " failed.", ex);
success = false;
firePCallEvent(EvtTypes.FINISHED);
}
}
COM: <s> puts this call object in the worker thread queue </s>
|
funcom_train/43374530 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void setCurrentUri(HttpServletRequest httpRequest){
String path=httpRequest.getServletPath();
String param=httpRequest.getQueryString();
if(param!=null &&! param.equals("")){
path=path+"?"+param;
}
Map queue=(Map)httpRequest.getSession().getAttribute("current_uri");
if(queue==null){
queue=new HashMap();
}
String cur=(String)queue.get("current");
if(cur!=null && ! cur.equals("")){
queue.put("previous",cur);
}
queue.put("current",path);
httpRequest.getSession().setAttribute("current_uri",queue);
}
COM: <s> p request uri is stored in session for ui transfer p </s>
|
funcom_train/20043971 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void _getDestArea(){
log.println("testing getDestArea()");
boolean bResult = false;
oORAdd = oObj.getDestArea();
if (!(oORAdd == null)){ bResult = true; }
tRes.tested("getDestArea()", bResult) ;
}
COM: <s> just calls the method and checks the value returned </s>
|
funcom_train/36533552 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void buildTarget(String name) throws MissingTargetException {
using(Loggers.class).verbose().log("Building target: " + name);
BuildTarget target = targets().get(name);
if (target == null) throw new MissingTargetException(name);
called.add(name);
for (String pre : target.dependencies()) {
if (!called.contains(pre)) buildTarget(pre);
}
using(TargetEvents.class).targetStarting(target);
try {
target.execute();
} finally {
using(TargetEvents.class).targetFinished(target);
}
}
COM: <s> builds the specified target and its dependencies </s>
|
funcom_train/33901370 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setFather(FamilyMember person) throws FamilyException {
if ( person == null ) {
throw new FamilyNullException("A father can't be a null value.");
}
else if ( person == this ) {
throw new FamilyRelationException("Family member can't be it's own" +
"father.");
}
_father = person;
person.addChild(this);
}
COM: <s> sets family members father </s>
|
funcom_train/18999404 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Image getIcon (int icon)
{
Image image = null;
switch (icon) {
case BeanInfo.ICON_MONO_16x16:
case BeanInfo.ICON_COLOR_16x16:
image = loadImage ("LineLayoutFormPanel16.gif");
break;
case BeanInfo.ICON_MONO_32x32:
case BeanInfo.ICON_COLOR_32x32:
image = loadImage ("LineLayoutFormPanel32.gif");
break;
}
return image;
}
COM: <s> returns an image for the icon </s>
|
funcom_train/45739302 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Entity toEntity(){
Entity output=new Entity(this.id,this.category,this.expected);
for (String snp:this.dataset.listSNPs()){
output.put(snp,dataset.getNumeric(id,snp));
}
return output;
}
COM: <s> converts this sample into an entity of a numeric dataset </s>
|
funcom_train/10822623 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initBlock(int blockIndex) throws IOException {
klen = -1;
if (blkReader != null) {
try {
blkReader.close();
} finally {
blkReader = null;
}
}
blkReader = reader.getBlockReader(blockIndex);
currentLocation.set(blockIndex, 0);
}
COM: <s> load a compressed block for reading </s>
|
funcom_train/22470498 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean hasRole(String roledescription) {
if (roledescription == null) {
return false;
}
GrantedAuthority[] authorities = getAuthorities();
for (int i = 0; i < authorities.length; i++) {
if (roledescription.equalsIgnoreCase(authorities[i].getAuthority())) {
return true;
}
}
return false;
}
COM: <s> returns whether or not this user has a certain role </s>
|
funcom_train/1602459 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initialiseJComponents() {
ImageIcon icon = null;
URL urlIconSearch = null;
urlIconSearch = getClass().getClassLoader().getResource("pics/searchicon.png");
menuBar = new JMenuBar();
viewSwitcher = new JMenu("View");
menu = new JMenu("Bestand");
searchField = new JTextField();
try {
icon = new ImageIcon(urlIconSearch);
} catch(NullPointerException x) {
}
searchBtn = new JButton(icon);
extra = new JMenu("Extra");
}
COM: <s> initialising the jcomponents </s>
|
funcom_train/3372422 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r) {
if (r == null) {
r = new SizeRequirements();
}
float pref = layoutPool.getPreferredSpan(axis);
float min = layoutPool.getMinimumSpan(axis);
// Don't include insets, Box.getXXXSpan will include them.
r.minimum = (int)min;
r.preferred = Math.max(r.minimum, (int) pref);
r.maximum = Integer.MAX_VALUE;
r.alignment = 0.5f;
return r;
}
COM: <s> calculate equirements along the minor axis </s>
|
funcom_train/4194061 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void onTransTimeout(TransactionClient transaction)
{ if (transaction.getTransactionMethod().equals(SipMethods.REGISTER))
{
if (listener==null)
printLog("Registration failure: No response from server.");
else
printLog("Registration failure: No response from server.");
lastRegFailed=true;
regInprocess=false;
if (listener!=null) listener.onUaRegistrationFailure(this,target,contact,"Timeout");
}
}
COM: <s> callback function called when client expires timeout </s>
|
funcom_train/10912171 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addSubData(BookmarkData sub) {
subData.add(sub);
if (sub.pageRef == null) {
putUnresolved(sub.getIDRef(), sub);
String[] ids = sub.getIDRefs();
for (String id : ids) {
putUnresolved(id, sub);
}
}
}
COM: <s> add a child bookmark data object </s>
|
funcom_train/45692241 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addArpeggiatorScalePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Pattern_arpeggiatorScale_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Pattern_arpeggiatorScale_feature", "_UI_Pattern_type"),
EsxPackage.Literals.PATTERN__ARPEGGIATOR_SCALE,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the arpeggiator scale feature </s>
|
funcom_train/9433402 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean initEventCursor() {
if ((mEventCursor == null) || (mEventCursor.getCount() == 0)) {
return true;
}
mEventCursor.moveToFirst();
mEventId = mEventCursor.getInt(EVENT_INDEX_ID);
String rRule = mEventCursor.getString(EVENT_INDEX_RRULE);
mIsRepeating = (rRule != null);
return false;
}
COM: <s> initializes the event cursor which is expected to point to the first </s>
|
funcom_train/22981475 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setFields(List<Type> fields) {
ArrayList<String> typesAsStrings = new ArrayList<String>(fields.size());
for (Type type : fields) {
if (type != null)
typesAsStrings.add(type.toMobileDB());
else
typesAsStrings.add("");
}
setInternalFields(typesAsStrings);
}
COM: <s> sets the fields </s>
|
funcom_train/37721248 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPopupMenu getPopup() {
if (popup == null) {
popup = new JPopupMenu();
JMenuItem mi = new JMenuItem("Add Table Column");
mi.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
table.addColumn();
}
});
popup.add(mi);
}
return popup;
}
COM: <s> returns the popup menu </s>
|
funcom_train/15676090 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addListener(ChangeListener listener) {
modelListeners = (LinkedList<ChangeListener>)modelListeners.clone();
modelListeners.add(listener);
DataEntity entity = copy();
listener.handleUpdate(new ChangeListener.ChangeEvent(entity, createInstance(), entity));
}
COM: <s> adds a listener to this core </s>
|
funcom_train/18862454 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void correctAction(ActionType action, int versionID) {
if (versionID == Version.VERSION_10) {
action.getExceptions().clear();
action.setRoles(null);
}
List forwards = action.getForwards();
for (Iterator iter = forwards.iterator(); iter.hasNext();) {
correctForward((ForwardType) iter.next(), versionID);
}
}
COM: <s> corrects the action element to only contain valid attributes and child </s>
|
funcom_train/2888302 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void nextMessage(){
try{
MonitoringEvent event = listener.receive();
// pass on to handlers.
// DB status update handler
// log handler
Object o = handlers.get(event.getMessageType()) ;
if( null != o){
System.out.println("Received message from JMS .");
List lst = (List)o;
Iterator itor = lst.iterator();
while(itor.hasNext()){
EventHandler h = (EventHandler)itor.next();
h.handleEvent(event) ;
}
}
}catch(Exception e){
// log and continue for now
e.printStackTrace();
}
}
COM: <s> blocking call on jms </s>
|
funcom_train/13775119 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String maskToString() {
String res = "(";
boolean first = true;
for (int i = 0; i < names.length; ++i) {
if ((type() & (1 << i)) != 0) {
if (!first) {
res += " | ";
}
res += names[i];
first = false;
}
}
res += ")";
return res;
}
COM: <s> returns a string representation of the mask of this event </s>
|
funcom_train/18745089 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TypeNode addNode(TypeLabel label) {
assert label.isNodeType() : String.format(
"Label %s is not a node type", label);
TypeNode result = this.typeNodeMap.get(label);
if (result == null) {
result = getFactory().createNode(label);
addNode(result);
}
return result;
}
COM: <s> adds a type node with a given node type label </s>
|
funcom_train/46332166 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Color getColor(int numstrikes) {
if (numstrikes==0) {
return Color.black;
}
float red = 1.0f;
float blue = 0.0f;
if (numstrikes>10) {
numstrikes=10;
}
float green = (float)(1.0 - (numstrikes/10.0));
return new Color(red, green, blue);
}
COM: <s> get an appropriate colour for the specified strike intensity </s>
|
funcom_train/43256885 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public InputStream getResourceAsStream( String name ){
if (zfile==null || hasChanged()) {
update();
}
try {
if (zfile == null) return null;
ZipEntry e = zfile.getEntry(name);
if (e != null)
return zfile.getInputStream(e);
} catch(Exception e) {
if (verbose) System.err.println("RJavaClassLoader$UnixJarFile: exception: "+e.getMessage());
}
return null;
}
COM: <s> get an input stream for a resource contained in the jar file </s>
|
funcom_train/50485894 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean insertImmediate() {
if (!rowChangeSupport.fireConfirmInsert())
return false;
rowChangeSupport.fireBeforeInsert();
boolean returnValue = select.insert();
rowChangeSupport.fireAfterInsert(returnValue);
if (returnValue) {
select.restorePosition();
cancelUpdate();
}
refreshControllers();
return returnValue;
}
COM: <s> insert a new record into the database from the bindings </s>
|
funcom_train/19371899 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void compare( final TestEntity entity1, final TestEntity entity2) {
Assert.assertNotNull( entity1);
Assert.assertNotNull( entity2);
Assert.assertEquals( entity1.getDescription(), entity2.getDescription());
Assert.assertEquals( entity1.getKey(), entity2.getKey());
Assert.assertEquals( entity1.getParentKey(), entity2.getParentKey());
Assert.assertEquals( entity1.getTitle(), entity2.getTitle());
}
COM: <s> compare the properties of the two 2 specified </s>
|
funcom_train/2886944 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void copyPropertiesToPrim(Prim target) throws SmartFrogRuntimeException, RemoteException {
for (Map.Entry<String, String> entry : this) {
String key = entry.getKey();
String value = entry.getValue();
addSFAttributeIfNeeded(target, key, value);
}
}
COM: <s> copy all new properties to the target prim as attributes </s>
|
funcom_train/7386161 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object connectCell(Object edge, Object terminal, boolean source) {
model.beginUpdate();
try {
cellConnected(edge, terminal, source);
fireEvent(new mxEventObject(mxEvent.CONNECT_CELL, "edge", edge,
"terminal", terminal, "source", source));
}
finally {
model.endUpdate();
}
return edge;
}
COM: <s> connects the specified end of the given edge to the given terminal </s>
|
funcom_train/26400768 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Node getFirstTextChild(Node parent) {
NodeList children = parent.getChildNodes();
int len = (children != null) ? children.getLength() : 0;
for (int i = 0; i < len; i++) {
Node node = children.item(i);
if (node.getNodeType() == Node.TEXT_NODE) return node;
}
return null;
}
COM: <s> find the first child node that holds </s>
|
funcom_train/10804346 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private SQLException wrap(SQLException sqle, Statement stmnt, String sql, int indexOfFailedBatchObject) {
ReportingSQLException toReturn = null;
if (sqle instanceof ReportingSQLException) {
toReturn = (ReportingSQLException) sqle;
} else {
toReturn = new ReportingSQLException(sqle, stmnt, sql);
}
toReturn.setIndexOfFirstFailedObject(indexOfFailedBatchObject);
return toReturn;
}
COM: <s> include sql in exception </s>
|
funcom_train/3102131 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void handleTabChanged() {
Assertion.valid(fConfiguration);
final String[] types= fConfiguration.getConfiguredContentTypes(this);
String[] prefixes= null;
for (int i= 0; i < types.length; i++) {
prefixes= fConfiguration.getIndentPrefixes(this, types[i]);
if (prefixes != null && prefixes.length > 0) {
setIndentPrefixes(prefixes, types[i]);
}
}
}
COM: <s> handles the tab changed event </s>
|
funcom_train/19849363 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setLocation(Location location) throws Exception {
if (currentEvent == null) {
Log.e(Alibi.TAG, "setLocation: no current event");
throw new Exception("setLocation: no current event");
}
assert currentEventId >= 0; // if we have event, should have valid ID
currentEvent.setLocation(location);
updateCurrentEventDb();
}
COM: <s> sets the location of the current user event </s>
|
funcom_train/12189604 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetHeadProcessEmptyPipeline() throws Exception {
// get hold of a XMLPipelineProcess
XMLPipelineProcess pipeline =
(XMLPipelineProcessImpl)createTestableProcess();
IllegalStateException ise = null;
try {
pipeline.getHeadProcess();
} catch (IllegalStateException e) {
ise = e;
}
assertNull("getHeadProcess() should throw an IllegalStateException" +
" if the pipeline is empty", ise);
}
COM: <s> test that ensures the get head process method throws an </s>
|
funcom_train/35947363 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Text trim() {
int first = 0; // First character index.
int last = length() - 1; // Last character index.
while ((first <= last) && (charAt(first) <= ' ')) {
first++;
}
while ((last >= first) && (charAt(last) <= ' ')) {
last--;
}
return subtext(first, last + 1);
}
COM: <s> returns a copy of this text with leading and trailing </s>
|
funcom_train/31692849 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getClassName() {
StringBuffer id = new StringBuffer("InterleaveFilter");
for( int i=0; i<_subAutomata.length; i++ ) {
id.append('_');
id.append(_subAutomata[i].getIndex());
}
return id.toString();
}
COM: <s> gets the name of the interleave filter implementation class </s>
|
funcom_train/12868366 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private File resolvePath(File path) {
if (!path.isAbsolute()) {
path = new File(project.getBasedir(), path.getPath());
}
if (path.isDirectory()) {
String name = path.getName();
if (!name.endsWith(File.separator)) {
path = new File(path.getPath() + File.separator);
}
}
return path;
}
COM: <s> resolve the given path </s>
|
funcom_train/11009629 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setFontStyle(boolean italic, boolean bold){
_font.setIArray(null);
_font.setBArray(null);
if(italic) _font.addNewI().setVal(true);
if(bold) _font.addNewB().setVal(true);
}
COM: <s> set font style options </s>
|
funcom_train/22542415 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setLocalNodeID(KUID localNodeID) {
RouteTable routeTable = getRouteTable();
synchronized (routeTable) {
// Change the Node ID
getLocalNode().setNodeID(localNodeID);
routeTable.rebuild();
assert(getLocalNode().equals(routeTable.get(localNodeID)));
}
}
COM: <s> rebuilds the route table with the given local node id </s>
|
funcom_train/20282413 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSimpleFunction() {
Context cx = Context.enter();
try {
Object result = cx.evaluateString(global, "f(7) + 1",
"test source", 1, null);
assertEquals(15.0, result);
} finally {
Context.exit();
}
}
COM: <s> simple test call f defined above </s>
|
funcom_train/19000135 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toHexString(int groupsize, String separator) {
StringWriter out = new StringWriter();
for (int x = 0; x < data.length; x++) {
if ((x != 0) && (groupsize > 0) && (x % groupsize == 0))
out.write(separator);
out.write(byteAsHex(x));
}
return out.toString();
}
COM: <s> returns a hex string representing the bit buf </s>
|
funcom_train/10519321 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void doExecute() throws BuildException {
Enumeration elems = getFiles().elements();
log("Processing " + files.size() + " elements...");
while ( elems.hasMoreElements() ){
execute(options, (CCFile)elems.nextElement());
}
}
COM: <s> the core processing </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.