__key__ stringlengths 16 21 | __url__ stringclasses 1
value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/10357571 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public URLName getURLName() throws MessagingException {
URLName baseURL = store.getURLName();
return new URLName(baseURL.getProtocol(), baseURL.getHost(), baseURL.getPort(),
getFullName(), baseURL.getUsername(), null);
}
COM: <s> return the urlname for this folder which includes the location of the store </s>
|
funcom_train/50983317 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String localize( final String key, final String defaultValue ) {
if( resourceBundleValues_ != null ) {
final int valueCount = resourceBundleValues_.length;
for( int i=0; i<valueCount; i++ ) {
if( key.equals(resourceBundleValues_[i][0]) ) {
return resourceBundleValues_[i][1];
}
}
}
return super.localize(key, defaultValue);
}
COM: <s> return the localized string </s>
|
funcom_train/18899463 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setDocument(String document) throws JspTagException {
try {
this.document = new URL(document);
}
catch (MalformedURLException mue) {
// log the error
log.error("Invalid document URL in metadata tag");
// wrap it and re-throw!
throw new JspTagException("metadata: Invalid URL specified as document " +
"attribute value");
}
// try-catch
}
COM: <s> sets the url of the document to retrieve metadata for </s>
|
funcom_train/36685048 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void handleNewNetworkInput(long currentTime) {
List<EventObject> networkInput = myGameManager.getNetworkController().getUserInput();
int latestNetworkCount = networkInput.size();
if (latestNetworkCount > myNetworkInputCount) {
for (int i = myNetworkInputCount; i < latestNetworkCount; i++) {
EventObject input = networkInput.get(i);
myReplay.saveReplayObject(input, currentTime, true);
}
myNetworkInputCount = latestNetworkCount;
}
}
COM: <s> determines if any new network input has been made in the last iteration </s>
|
funcom_train/3316895 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getChildrenNames() {
if (children == null) return Arrays.asList(new Object[0]);
List list = new ArrayList(children.size());
for(int i = 0; i < children.size(); i++)
list.add(((PageInfo)children.get(i)).getName());
return list;
}
COM: <s> get the children </s>
|
funcom_train/36525619 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void openSelector(){
// LOG_READFROMBUFFER = false;
boolean connectionOpen = false;
while(!connectionOpen){
try {
s = Selector.open();
// s2 = Selector.open();
for (int i=0; i<n; i++) if (i!=id){
scs[i].register(s, SelectionKey.OP_READ, new WriteOperation(i, null));
numOpenChannels++;
// scs[i].register(s2, 0, new Integer(i));
}
connectionOpen = true;
} catch (IOException e) {
e.printStackTrace();
}
}
openedSelector = true;
}
COM: <s> opens a selector and submits all of the open channels to it </s>
|
funcom_train/26442046 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void sendConnectionRequest(String host,int port,KernelAddress requestingKernelID){
debug("broadcast request received by "+host+":"+port);
AgentAddress router=getAgentWithRole(community,group,"router");
Vector v=new Vector();
v.add(0,null); //let the Router agent create the socket if needed.
v.add(1,requestingKernelID);
v.add(2,new SocketKernel(host,port));
sendMessage(router,new NetworkMessage(NetworkMessage.CONNECT_KERNEL,v));
}
COM: <s> requests the router to connect to the distant kernel </s>
|
funcom_train/29608988 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addPortletName(String portletName) {
// Validate parameter
if (portletName == null)
throw new IllegalArgumentException("Parameter \"portletName\" cannot be NULL");
// Get current values
List<String> values = this.getElementValues(Constants.XML_DESCRIPTOR_ELEMENT_SECURITYCONSTRAINT_PORTLETS_NAME);
// Add value
values.add(portletName);
// Update list
this.setElementValues(Constants.XML_DESCRIPTOR_ELEMENT_SECURITYCONSTRAINT_PORTLETS_NAME, values);
}
COM: <s> add portlet name to the collection </s>
|
funcom_train/4780533 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public AccessRule findGroupAccessRule(Repository repository, String pathString, Group group) throws AppException {
if (accessRules == null) {
return null;
}
Path path = findPath(repository, pathString);
if (path == null || group == null || group.getAccessRules() == null) {
return null;
}
AccessRule foundRule = null;
for (AccessRule rule : group.getAccessRules()) {
if (rule.getPath() == path) {
foundRule = rule;
break;
}
}
return foundRule;
}
COM: <s> locates an access rules by repository path and group </s>
|
funcom_train/34557669 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setWidth(int width) {
if(!isRendered()) {
if(width == -1) {
setAttribute( "width", "auto", true);
} else {
setAttribute( "width", width, true);
}
} else {
setWidthRendered(width);
}
}
COM: <s> the component width </s>
|
funcom_train/49852541 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public DocList getDocList(Query query, Query filter, Sort lsort, int offset, int len) throws IOException {
List<Query> filterList = null;
if (filter != null) {
filterList = new ArrayList<Query>(1);
filterList.add(filter);
}
return getDocList(query, filterList, lsort, offset, len, 0);
}
COM: <s> returns documents matching both code query code and code filter code </s>
|
funcom_train/11345775 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private List getAvailableObjects() {
List list = new ArrayList();
ServiceReference[] refs = m_dependency.getServiceReferences();
if (refs != null) {
for (int i = 0; i < refs.length; i++) {
list.add(m_dependency.getService(refs[i]));
}
}
return list;
}
COM: <s> helper method creating a list of available service objects </s>
|
funcom_train/7336053 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void collectPictures(File dir, String relativePath, List<String> possibleSources) {
File[] files = dir.listFiles();
for (File file : files) {
String filename = file.getName();
if (file.isDirectory()) {
// recurse into directory
collectPictures(file, relativePath + filename + "/", possibleSources);
} else {
// file
Matcher m = PATTERN_PICTURE.matcher(filename);
if (m.matches())
possibleSources.add(relativePath + filename);
}
}
}
COM: <s> recursively collect all pictures from given directory </s>
|
funcom_train/8528639 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void downloadURL(URL url, File destination) throws IOException, FileNotFoundException{
DataInputStream dis = new DataInputStream(url.openStream());
OutputStream fos = new FileOutputStream(destination);
DataOutputStream dos = new DataOutputStream(fos);
// URL copy bytes to the output stream
byte[] buffer = new byte[1024];
int bytes_read;
while ((bytes_read = dis.read(buffer))!= -1){
dos.write(buffer, 0, bytes_read);
}
dis.close();
dos.close();
fos.close();
}
COM: <s> download the audio file through a url </s>
|
funcom_train/49790830 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testEditingFirst() throws Exception {
IFile sitemap = beginAtSitemapThenPage("Home");
assertContent1();
{
String id = getLabelIDForText("title");
setLabeledFormElementField(id, "New Title 1");
assertLabeledFieldEquals(id, "New Title 1");
}
clickButtonWithText("save current");
assertNoProblem();
assertNewContent1();
// next
clickButtonWithText("possibly next");
assertNoProblem();
assertContent2();
// previous
clickButtonWithText("possibly previous");
assertNoProblem();
assertNewContent1();
// reload the page
reloadPage(sitemap, "Home");
assertNoProblem();
assertNewContent1();
}
COM: <s> update the content of the first entry </s>
|
funcom_train/7646738 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean setLastModified(long time) {
if (time < 0) {
throw new IllegalArgumentException(Msg.getString("K006a")); //$NON-NLS-1$
}
SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkWrite(path);
}
return (setLastModifiedImpl(properPath(true), time));
}
COM: <s> sets the time this file was last modified measured in milliseconds since </s>
|
funcom_train/2893870 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testIncrementingPositions() throws Exception {
Analyzer analyzer = new WhitespaceAnalyzer();
TokenStream ts = analyzer.tokenStream("field",
new StringReader("one two three four five"));
while (true) {
Token token = ts.next();
if (token == null) break;
assertEquals(token.termText(), 1, token.getPositionIncrement());
}
}
COM: <s> basic analyzer behavior should be to keep sequential terms in one </s>
|
funcom_train/48908074 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void prepareStreams(Socket socket) throws IOException {
m_Input = new DataInputStream(
new BufferedInputStream(socket.getInputStream())
);
m_Output = new DataOutputStream(
new BufferedOutputStream(socket.getOutputStream())
);
m_ByteIn = new BytesInputStream(Modbus.MAX_MESSAGE_LENGTH);
}//prepareStreams
COM: <s> prepares the input and output streams of this </s>
|
funcom_train/47979682 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void sendServiceDiscovery( String namespace, int version, boolean requestMsdl ) {
final MobilisServiceDiscoveryBean bean = new MobilisServiceDiscoveryBean();
if ( null != namespace )
bean.serviceNamespace = namespace;
if ( version > 0 )
bean.serviceVersion = version;
bean.requestMSDL = requestMsdl;
bean.setTo( _controller.getSettings().getMobilisCoordinatorJid() );
bean.setType( XMPPBean.TYPE_GET );
sendXMPPBean( bean );
}
COM: <s> send service discovery </s>
|
funcom_train/10586289 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Property getMimeTypeProperty(Node node) throws RepositoryException {
Node contentNode = getContentNode(node);
ContentTypeInfo info = (ContentTypeInfo) getTypeInfo(contentNode);
String propName = info.mimeTypeProp;
if (propName != null && contentNode.hasProperty(propName)) {
return contentNode.getProperty(propName);
} else {
return null;
}
}
COM: <s> get the mime type property for a given node </s>
|
funcom_train/25365695 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addItemtakenPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_RoomEvent_itemtaken_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RoomEvent_itemtaken_feature", "_UI_RoomEvent_type"),
LeveleditorPackage.Literals.ROOM_EVENT__ITEMTAKEN,
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the itemtaken feature </s>
|
funcom_train/41164629 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public AgStatusExercises2 update(AgStatusExercises2 entity) {
EntityManagerHelper.log("updating AgStatusExercises2 instance", Level.INFO, null);
try {
AgStatusExercises2 result = getEntityManager().merge(entity);
EntityManagerHelper.log("update successful", Level.INFO, null);
return result;
} catch (RuntimeException re) {
EntityManagerHelper.log("update failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> persist a previously saved ag status exercises2 entity and return it or a </s>
|
funcom_train/50430147 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void reOrderNodes(){
Vector nodes = new Vector();
for (int i = 0; i < network.size(); i++){
nodes.addElement(null);
}
for (int i = 0; i < network.size(); i++){
nodes.setElementAt(network.getNodeAt(i), ((Integer) order.elementAt(i)).intValue());
}
network.setNodeList(nodes);
}
COM: <s> re order nodes will put the nodes back in the original order </s>
|
funcom_train/1443256 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void appendFreeform(String message) {
if (this.freeformMessages.isEmpty())
this.freeformMessages.add(message);
else if ((this.cwm.getSConf().SAY_COACH_MSG_SIZE - this.freeformMessages
.getLast().length()) > message.length()) {
message = this.freeformMessages.getLast() + message;
this.freeformMessages.removeLast();
this.freeformMessages.add(message);
} else
this.freeformMessages.add(message);
}
COM: <s> adds a new free form message to the corresponding list </s>
|
funcom_train/51782673 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void resizeNw(double diffx, double diffy) {
tmpPos.setLocation(node.getAbsoluteX1() + diffx,
node.getAbsoluteY1() + diffy);
tmpSize.setSize(node.getSize().getWidth() - diffx,
node.getSize().getHeight() - diffy);
new CornerSnap(editor.getDiagram(), tmpPos, tmpSize).snapLeftUpper();
}
COM: <s> resize using the nw handle </s>
|
funcom_train/15919186 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Expr makeFieldAccess(Position pos, Receiver r, Name name, Context context) throws SemanticException {
FieldInstance fi = xts.findField(r.type(), r.type(), name, context);
Expr result = xnf.Field(pos, r, xnf.Id(pos, name)).fieldInstance(fi)
.type(fi.type());
return result;
}
COM: <s> make a field access for r </s>
|
funcom_train/20309819 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void translateComplementClass(Element expr, OntClass cls, Model source ) {
// an anonymous complement of another class expression
Element not = addElement( expr, DIGProfile.NOT );
addClassDescription( not, cls.asComplementClass().getOperand(), source );
}
COM: <s> translate a complement class to a not element </s>
|
funcom_train/1904426 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getPackageId() {
final String packageId;
if (site == null) {
packageId = "";
}
else if (site.equals("SEV")) {
packageId = "sev.";
}
else {
packageId = "knb-lter-" + site.toLowerCase();
}
return packageId;
}
COM: <s> for a given site return the package id attribute search string for that </s>
|
funcom_train/44481336 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void modifyDateTimeStamps(boolean source, long ms) {
JFSConfig config = JFSConfig.getInstance();
for (JFSDirectoryPair pair : config.getDirectoryList()) {
String path;
if (source) {
path = pair.getSrc();
} else {
path = pair.getTgt();
}
JFSFileProducerManager pm = JFSFileProducerManager.getInstance();
JFSFileProducer factory = pm.createProducer(path);
JFSFile file = factory.getRootJfsFile();
traverse(file, ms);
file.flush();
pm.shutDownProducer(path);
}
}
COM: <s> modifies the date time stamps of source or target files </s>
|
funcom_train/50396771 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void reInit(final ProcessVariables vars)throws ProcessingException{
List<String>results=new ArrayList<String>();
try{
zip(results,vars.copy(),null,variableSets);
}catch(Exception ex){
throw new ProcessingException(ex);
}
values=results.toArray(new String[results.size()]);
if(logger.isDebugEnabled()){
StringBuilder sb=new StringBuilder();
sb.append("Iterating over the following values:\n");
for(String val: values){
sb.append(val+" ");
}
logger.debug(sb.toString());
}
}
COM: <s> re initialise the list of values from the defined variable sets </s>
|
funcom_train/16651766 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void queryDoicontacts(){
doicontacts = new ArrayList<Person>();
doicontacts = atarrabiQuery.fetchDoiContacts(doicontactsSearchString, doicontactsPage, PAGE_SIZE);
if(doicontacts != null){
setDoicontactsNextPageAvailable(doicontacts.size() > PAGE_SIZE);
setDoicontactsPrevPageAvailable(getDoicontactsPage() > 0);
if (isDoicontactsNextPageAvailable()) {
setDoicontacts(new ArrayList<Person>(doicontacts.subList(0,PAGE_SIZE)));
}
else {
setDoicontacts(doicontacts);
}
}
}
COM: <s> query for doi contacts </s>
|
funcom_train/48423818 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void notifyDisconnected() {
synchronized ( clients ) {
// Sending disconnect message to clients
for( RequestSenderIF sender : clients.values() ) {
try {
sender.disconnect();
} catch (ConnectionException e) {
LoggingSystem.getLogger().warning( "Could not notify disconnection" );
LoggingSystem.getLogger().throwing( this.getClass().getName(), "notifyDisconnected", e);
e.printStackTrace();
}
}
// Clearing clients map
clients.clear();
}
}
COM: <s> invoked to notify that the local request processor </s>
|
funcom_train/9066456 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void close() throws USBException {
if (usbDevHandle == 0) {
throw new USBException("invalid device handle");
}
release_interface(usbDevHandle, dev_interface);
if (LibusbJava.usb_close(usbDevHandle) < 0) {
usbDevHandle = 0;
throw new USBException("LibusbJava.usb_close: "
+ LibusbJava.usb_strerror());
}
usbDevHandle = 0;
maxPacketSize = -1;
logger.info("device closed");
}
COM: <s> release the claimed interface and close the opened device </s>
|
funcom_train/24137986 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void connectDB() throws Exception {
/* Load Java Driver For interfacing database*/
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
/* Create a connect to MS Acess DSN */
conn = DriverManager.getConnection("jdbc:odbc:drvCustomerDB","" ,"");
/* Create a statement from connection that will be a bridge in executing queries */
stat = conn.createStatement();
LOG("Successfully connected to database.");
}
COM: <s> function connect db connects to ms access databse </s>
|
funcom_train/40208851 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void readProcess(Map<String, String> map, String line) {
String name = find2ndWord(line);
if (line.contains(" drop")) {
map.put(name, "drop");
} else if (line.contains(" delay")) {
map.put(name, "delay");
} else if (line.contains(" duplicate")) {
map.put(name, "duplicate");
}
}
COM: <s> read a line from the configuration file </s>
|
funcom_train/3598104 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testPointerWithRole() {
try {
List results = engine.search(nom, "($w word)($n np):$w>'ANTECEDENT'$n");
results.remove(0); // remove list of vars
assertTrue(results.size()==1);
NOMElement r1 = (NOMElement)((List)results.get(0)).get(0);
NOMElement r2 = (NOMElement)((List)results.get(0)).get(1);
assertTrue(r1.getID().equals("w_7"));
assertTrue(r2.getID().equals("np_1"));
} catch (Throwable ex) {
ex.printStackTrace();
fail("Pointer with role failed!");
}
}
COM: <s> check pointers with roles are correctly returned </s>
|
funcom_train/26447842 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isElementDomainObject(String aCoreClassname) {
boolean isDomainObject = true;
try {
MetaInfoBroker
.getInstance()
.getDomainObjectMetaInfo(
NamespaceHelper
.getMetaInfoClassnameFromCoreClassname(aCoreClassname));
} catch (MetaInfoException e) {
// we can't get the meta info -> it's not a registered domain
// object's core name
isDomainObject = false;
}
return isDomainObject;
}
COM: <s> determines if the given name is the corename of a domain object </s>
|
funcom_train/12261502 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void saveBoxFile() {
try {
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(outputFolder, fileName + ".box")), "UTF8")); // save boxes
out.write(formatOutputString());
out.close();
} catch (Exception e) {
System.err.println(e.getMessage());
}
}
COM: <s> creates box file </s>
|
funcom_train/8047197 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void preDraw(PGraphics g) {
if (this.isDepthBufferDisabled()){
Tools3D.disableDepthBuffer(g);
}
g.pushMatrix();
MTLight aLight = this.getLight();
if (aLight != null){
GL gl = ((PGraphicsOpenGL)g).gl;
gl.glEnable(GL.GL_LIGHTING); //this is expensive
aLight.enable();
}
if (!this.getLocalMatrix().isIdentity())
this.applyLocalMatrix();
if (this.getClip() != null){
this.getClip().enableClip(g);
}
}
COM: <s> this method is called just before the components draw component method is invoked </s>
|
funcom_train/44339534 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testAllViews() throws Exception {
try {
ArrayList viewList = dao.getAllViews(null, null, "vw%");
for (Iterator iter = viewList.iterator(); iter.hasNext();) {
BaseDynaBean view = (BaseDynaBean) iter.next();
SelectStatementBean ssb = new SelectStatementBean();
ssb.setTopRecords(10);
ssb.setViewName(view.getString("table_name"));
dao.select(ssb);
}
}
catch (Exception e) {
fail(Dumper.dump(e));
}
}
COM: <s> select all views </s>
|
funcom_train/3522834 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Iterator getSpecificFields() {
//Those fileds are created by subclasses of this class
//And begin with a "-", the iterator contains the fields without the leading "-"
List l = new LinkedList();
Enumeration en = fields.keys();
while(en.hasMoreElements()) {
String key = (String) en.nextElement();
if( key.startsWith("-") )
l.add(key.substring(1));
}
return l.iterator();
}
COM: <s> p this creates an iterator over the specific fields for this tag </s>
|
funcom_train/26314043 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void resetPlayersDone() {
if (isReportingPhase()) {
return;
}
for (Enumeration<Player> i = game.getPlayers(); i.hasMoreElements();) {
final Player player = i.nextElement();
player.setDone(false);
}
transmitAllPlayerDones();
}
COM: <s> called at the beginning of certain phases to make every player not ready </s>
|
funcom_train/37594163 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void handleMethodInvocation(MethodData md, JExpression jexpr) {
String[] thrown = md.getThrown();
for (int i = 0; i<thrown.length; i++) {
_thrown.addLast(new Pair<SymbolData, JExpression>(getSymbolData(thrown[i], _data, jexpr), jexpr));
}
}
COM: <s> todo move this code to where it is needed </s>
|
funcom_train/6406576 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void clearZBuffer() {
final GL gl = GLU.getCurrentGL();
if (Renderer.defaultStateList[RenderState.StateType.ZBuffer.ordinal()] != null)
Renderer.defaultStateList[RenderState.StateType.ZBuffer.ordinal()].apply();
gl.glClear(GL.GL_DEPTH_BUFFER_BIT);
}
COM: <s> code clear zbuffer code clears the open gl depth buffer </s>
|
funcom_train/34568024 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean startup() throws ModuleException {
try {
alive = false;
overrideSystemProperties();
resourceList = new ResourceInternalManager();
DerbyListener listener = new DerbyListener();
if (!resourceList.addAndStartResource(listener)) {
throw new BaseException(ErrorCodes.CODE_542);
}
alive = true;
return alive;
} catch (BaseException e) {
log.error("Error on starting embedded db: "+e.toString());
return false;
} catch (Throwable ex) {
log.fatal("Error on starting embedded db: ", ex);
return false;
}
}
COM: <s> start the module </s>
|
funcom_train/2620912 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void setupTestProgram(Long programId, String programName) {
simpleJdbcTemplate.update(
"insert into solardras.program (id,creator,pro_name,enabled) values (?,?,?,?)",
programId, TEST_USER_ID, programName, Boolean.TRUE);
}
COM: <s> insert a test event into the solardras </s>
|
funcom_train/24116935 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addTask(Task task){
try{
if(task==null) throw new NullPointerException("Task does not exist");
taskList.put(task.getUniqueName(),task);
}
catch(NullPointerException e){
logger.error("Error during adding a task", e);
}
}
COM: <s> adds task to application </s>
|
funcom_train/11345305 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
m_ids = new TreeMap<String, Element>();
m_elements = new LinkedHashMap<Element, String>();
m_className = name;
}
COM: <s> start visiting a class </s>
|
funcom_train/31414788 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void dropOldestFromCache() {
List<CachedValueObject> l = new ArrayList<CachedValueObject>(values());
Collections.sort(l, sorter);
for(int i=0; i<cacheSize/10; i++)
remove(getCacheKey(l.get(i).getVO()));
}
COM: <s> removes the oldest from the cache when the cache gets too big </s>
|
funcom_train/18671873 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void parse(final InputSource input) throws SAXException {
if (input instanceof JDOMInputSource) {
try {
final Object source = ((JDOMInputSource) input).getSource();
if (source instanceof Document) {
this.output((Document) source);
} else {
this.output((List<?>) source);
}
} catch (final JDOMException e) {
throw new SAXException(e.getMessage(), e);
}
} else {
throw new SAXNotSupportedException(
"Only JDOM Documents are supported as input");
}
}
COM: <s> parses an xml document </s>
|
funcom_train/24181764 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean paramIsAnnotated(String paramName) {
for (Object o : this.md.parameters()) {
if (o instanceof SingleVariableDeclaration) {
SingleVariableDeclaration s = (SingleVariableDeclaration) o;
if (s.getName().getFullyQualifiedName().equals(paramName)) {
List<IExtendedModifier> ems = s.modifiers();
for (IExtendedModifier m : ems) {
if (m instanceof Annotation) return true;
}
return false;
}
}
}
return false;
}
COM: <s> checks if a parameter with name passed as parameter is annotated </s>
|
funcom_train/3081225 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: // public void addSnippet(String jsSnippetCode) {
// JavaScriptSnippetService snippet;
// snippet = JavaScriptSnippetService.forComponent(getContainerInstance(),
// getComponent());
// if (snippet == null) {
// snippet = new JavaScriptSnippetService(component);
// rc.getContainerInstance().getServiceRegistry().add(snippet);
// }
// snippet.setContent(jsSnippetCode);
// addLibrary(snippet);
// }
COM: <s> this adds a snippet of java script code into the mix via a </s>
|
funcom_train/44488811 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Graph constructGraph(final List<Tree> trees, final Context.Construction<Name> context) {
final GraphConstructor<Name> constructor = new GraphConstructor<Name>(context);
final Array<Node> nodes = new Array<Node>();
for (Tree tree : trees) {
final Node node = constructor.toGraph(tree, Node.end());
nodes.add(node);
}
final Node body = constructor.makeChoice(nodes);
return new Graph(body, constructor.tags);
}
COM: <s> converts the body of this nonterminal to a graph representation </s>
|
funcom_train/36165429 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getSimplePathString(String s) {
if (s != null) {
String[] splitString = s.split("/");
if (splitString.length > 0) {
s = splitString[splitString.length - 1];
splitString = s.split("\\\\");
s = splitString[splitString.length - 1];
return s;
}
else {
return "Root Folder";
}
}
return "";
}
COM: <s> break down the path string to say something more useful in the </s>
|
funcom_train/51657944 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addDrawingStrategy(Object id, IDrawingStrategy strategy) {
// don't permit null as null is used to signal that an annotation type is not
// registered with a specific strategy, and that its annotation hierarchy should be searched
if (id == null)
throw new IllegalArgumentException();
fRegisteredDrawingStrategies.put(id, strategy);
}
COM: <s> registers a new drawing strategy under the given id </s>
|
funcom_train/44869115 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setVals(double[] vals) {
for (int i = 0; i < bVals.length; i++) {
bVals[i] = 0;
}
for (int i = 0; i < Math.min(bVals.length, vals.length); i++) {
bVals[i] = vals[i];
}
if (c != null) {
c.compute();
}
}
COM: <s> set the values up to 6 to be used </s>
|
funcom_train/36195517 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void dispose() {
Iterator<YariNavigationHistoryEntry> e = history.iterator();
while (e.hasNext()) {
YariNavigationHistoryEntry entry = e.next();
disposeEntry(entry);
}
this.activeEntry = 0;
this.ignoreEntries = 0;
this.history.clear();
}
COM: <s> disposes this navigation history and all entries </s>
|
funcom_train/40684679 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ContentType getType() {
String type = getTypeString();
if (type.equalsIgnoreCase(ContentType.TEXT.getValue())) {
return ContentType.TEXT;
} else if (type.equalsIgnoreCase(ContentType.HTML.getValue())) {
return ContentType.HTML;
}
return null;
}
COM: <s> returns the content type an instance of enum </s>
|
funcom_train/21965635 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void init() {
String signButtonCaption = this.getParameter(SIGN_BUTTON_CAPTION_PARAM);
mSignButton = new Button(signButtonCaption);
mSignButton.setLocation(0, 0);
Dimension appletSize = this.getSize();
mSignButton.setSize(appletSize);
mSignButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
signSelectedFile();
}
});
this.setLayout(null);
this.add(mSignButton);
}
COM: <s> initializes the applet creates and initializes its graphical user </s>
|
funcom_train/43667073 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getJButton_Cancel() {
if (jButton_Cancel == null) {
jButton_Cancel = new JButton("Cancel");
jButton_Cancel.setFont(new Font(Constants.FONT, Constants.FONT_STYLE_TOOL,12));
jButton_Cancel.setBounds(new Rectangle(230, 150, 81, 28));
jButton_Cancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
dispose();
}
});
}
return jButton_Cancel;
}
COM: <s> this method initializes j button cancel </s>
|
funcom_train/13392678 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void sendFileChangeEvent(String fileName, FileChangeEvent.FileChangeType fileCondition) {
if (eventService != null) {
FileChangeEvent fileChangeEvent = new FileChangeEvent(fileName, fileCondition);
eventService.send(fileChangeEvent, getServiceId());
}
}
COM: <s> send a file change event </s>
|
funcom_train/37815838 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setArrows(int mode) {
if ((mode == ITreeConstants.LEFT_ROT)
|| (mode == ITreeConstants.RIGHT_ROT)) {
myArrow = Arrows.getArrows(mode);
arrowLocator = new MidpointLocator(this, 0);
add(myArrow, arrowLocator);
} else if (mode == ITreeConstants.NO_ROT) {
// remove old arrows if their exist
if (myArrow != null)
remove(myArrow);
}
}
COM: <s> chose if and how to display the arrows </s>
|
funcom_train/35657753 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void placePiece(Point pt){
super.board.placePiece(knight, pt); //place the knight on the board at the passed position
//System.out.println(knight.hashCode());
super.addHighLights(pt); //adds this point to the highLights(which is the list of illegal positions)
this.saveStates();
this.update();
//GameModel.gmodelList.add(GameModel.gmodelIndex, new KnightTourModel(this));
//GameModel.gmodelIndex++;
}
COM: <s> place piece method places the knight piece at the passed position </s>
|
funcom_train/21487704 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Image getImage1() {
if (image1 == null) {
// write pre-init user code here
try {
image1 = Image.createImage("/logo.png");
} catch (java.io.IOException e) {
e.printStackTrace();
}
// write post-init user code here
}
return image1;
}
COM: <s> returns an initiliazed instance of image1 component </s>
|
funcom_train/36062045 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public DefinitionMatchResultSet scan2(HttpResponseData httpResponse, DefinitionPolicySet definitionPolicySet, long siteGroupID, long ruleID ) throws NoDatabaseConnectionException, SQLException, InvalidDefinitionException{
return scan(httpResponse, definitionPolicySet, siteGroupID, ruleID, null);
}
COM: <s> perform a scan in order to analyze the given http response object </s>
|
funcom_train/41732017 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String formatPhoneNumber(String originalNumber) {
String newNumber = "";
Integer integer;
for (int i = 0; i < originalNumber.length(); i++) {
try {
integer = new Integer(originalNumber.substring(i, i + 1));
newNumber = newNumber + integer.intValue();
} catch (NumberFormatException e) {
; // do nothing
}
}
return newNumber;
}
COM: <s> format the phone number and remove all characters that are not integer </s>
|
funcom_train/16146512 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void insert(final AbstractInsnNode location, final AbstractInsnNode insn) {
++size;
AbstractInsnNode next = location.next;
if (next == null) {
last = insn;
} else {
next.prev = insn;
}
location.next = insn;
insn.next = next;
insn.prev = location;
cache = null;
insn.index = 0; // insn now belongs to an InsnList
}
COM: <s> inserts the given instruction after the specified instruction </s>
|
funcom_train/35284288 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected int vectorToColor(float x, float y, float z) {
int r = Math.round(255 * (x + 1f) / 2f);
int g = Math.round(255 * (y + 1f) / 2f);
int b = Math.round(255 * (z + 1f) / 2f);
return (255 << 24) + (r << 16) + (g << 8) + b;
}
COM: <s> this method transforms given vectors coordinates into argb color a is always 255 </s>
|
funcom_train/49044620 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addObjectVariablePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ModifyObjectReaction_ObjectVariable_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ModifyObjectReaction_ObjectVariable_feature", "_UI_ModifyObjectReaction_type"),
EventPackage.Literals.MODIFY_OBJECT_REACTION__OBJECT_VARIABLE,
!((ModelObject) object).isPredefined(),
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the object variable feature </s>
|
funcom_train/23018079 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Mappings read() {
Mappings result = null;
InputStream stream = null;
try {
XMLParser parser = new XMLParser();
stream = new ByteArrayInputStream(xml);
result = parser.parse(stream);
} catch (Throwable e) {
// log.error("Error in loading dozer mapping file url: [" + url + "]
// : " + e);
MappingUtils.throwMappingException(e);
} finally {
try {
if (stream != null) {
stream.close();
}
} catch (IOException e) {
MappingUtils.throwMappingException(e);
}
}
return result;
}
COM: <s> just uses a byte array input stream instead </s>
|
funcom_train/2291051 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected CmsFile readFile(CmsObject cms, CmsResource resource) throws CmsException, CmsIndexException {
CmsFile file = cms.readFile(resource);
if (file.getLength() <= 0) {
throw new CmsIndexException(Messages.get().container(Messages.ERR_NO_CONTENT_1, resource.getRootPath()));
}
return file;
}
COM: <s> upgrades the given resource to a </s>
|
funcom_train/32913424 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private MouseAdapter getPropertyAdapter() {
return new java.awt.event.MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
try {
ISApplicationMediator.getInstance().receive(ISEvent.APPLIEDCHANGES, UIContext.contextTextTable);
super.mouseClicked(e);
} catch (Exception ex) {
Debug.LogException(this, ex);
}
}
};
}
COM: <s> get the action for clicking on the property column </s>
|
funcom_train/1104328 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private IStatus longRunningRead(IProgressMonitor monitor) {
for (int i = 0; i < 60; i++) {
// every half-second, check for cancellation.
// Yield to other readers five times in each interval
ConsoleUtil.println(
CONSOLE,
NLS.bind(
Messages.readJob_msg,
new Integer(id),
new Integer(i)));
for (int j = 0; j < 5; j++) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
// assume cancellation
return Status.CANCEL_STATUS;
}
domain.yield();
}
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
}
return Status.OK_STATUS;
}
COM: <s> called within a read transaction to perform the long running </s>
|
funcom_train/2369283 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean workerCanExit() {
final ReentrantLock mainLock = this.mainLock;
mainLock.lock();
boolean canExit;
try {
canExit =
runState >= STOP
|| workQueue.isEmpty()
|| (allowCoreThreadTimeOut && poolSize > Math.max(
1, corePoolSize));
} finally {
mainLock.unlock();
}
return canExit;
}
COM: <s> check whether a worker thread that fails to get a task can </s>
|
funcom_train/44823390 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object pop (String property) throws ContextException {
Object value = null;
Stack propStack = (Stack) propMap.get(property);
if (propStack != null) {
try {
value = propStack.pop();
} catch (EmptyStackException x) {}
fireContextChangedEvent (property, get(property)); // Notify listeners of new value
}
return value;
}
COM: <s> pop a value for a given property off the context </s>
|
funcom_train/5855307 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void reset() {
try {
byte[] memoryData = Util.getData(memory);
byte[] floppyData = Util.getData(floppy);
engine.reset(memoryData, floppyData);
} catch (Exception e) {
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));
Util.displayError(sw.toString(), this);
}
}
COM: <s> reset the engine </s>
|
funcom_train/9057171 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testCompareToNegative() {
try {
//Tries to create an object that gets typecasted
sc.compareTo((SelectedCourse) new Object());
fail("Should not allow us to do that");
} catch (Exception e) {
}
try {
//Creates a Course, that gets typecasted to SelectedCourse
SelectedCourse sc2 = (SelectedCourse) new Course("01005", " ");
sc.compareTo(sc2);
//These two types are uncompareable
fail("uncompareble objects");
} catch(Exception e) {
}
}
COM: <s> a negative test of the comparing function </s>
|
funcom_train/33703992 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addNamePropertyDescriptor(Object object) {
itemPropertyDescriptors.add(createItemPropertyDescriptor(
((ComposeableAdapterFactory) adapterFactory)
.getRootAdapterFactory(), getResourceLocator(),
getString("_UI_Element_name_feature"), getString(
"_UI_PropertyDescriptor_description",
"_UI_Element_name_feature", "_UI_Element_type"),
BankabeulePackage.Literals.ELEMENT__NAME, true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}
COM: <s> this adds a property descriptor for the name feature </s>
|
funcom_train/2506055 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public X509Certificate getCACertificate() throws SeppSecurityException {
try {
X509Certificate certificate = Util
.convertCertificateChain(privateKeyStore
.getCertificateChain(CA_RSA))[0];
return certificate;
} catch (CertificateException ce) {
throw new SeppSecurityException(
"Couldn't obtain CA public key from keystore!\n"
+ ce.getMessage());
} catch (KeyStoreException kse) {
throw new SeppSecurityException(
"Couldn't obtain CA public key from keystore!\n"
+ kse.getMessage());
}
}
COM: <s> returns the certificate which has been stored in the key store as ca </s>
|
funcom_train/23216800 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addContractNamePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Contract_contractName_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Contract_contractName_feature", "_UI_Contract_type"),
ContractPackage.Literals.CONTRACT__CONTRACT_NAME,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the contract name feature </s>
|
funcom_train/48023723 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JSONWriter append(String s) throws JSONException {
if (s == null) {
throw new JSONException("Null pointer");
}
if ((mode == 'o') || (mode == 'a')) {
try {
if (comma && (mode == 'a')) {
writer.write(',');
}
writer.write(s);
} catch (IOException e) {
throw new JSONException(e);
}
if (mode == 'o') {
mode = 'k';
}
comma = true;
return this;
}
throw new JSONException("Value out of sequence.");
}
COM: <s> append a value </s>
|
funcom_train/42631047 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void load(String configFile) {
synchronized (this) {
log = Logger.getLogger(Config.class);
props = new Properties();
FileInputStream fis = null;
try {
if (StringUtils.isEmpty(configFile)) {
log.error("配置文件路径未设置。");
} else {
fis = new FileInputStream(configFile);
props.load(fis);
}
} catch (FileNotFoundException e) {
log.error("配置文件" + configFile + "未找到。");
} catch (IOException e) {
log.error(e);
} finally {
try {
if (fis != null) {
fis.close();
fis = null;
}
} catch (IOException ioe) {
log.error(ioe);
}
}
}
}
COM: <s> load the properties to the properties in the specified file </s>
|
funcom_train/5019874 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isAssignedToMe(Object objRow) {
PlannerRow plannerTableRow = (PlannerRow) objRow;
String meUuid = getVisitState().getPerson().getUuid();
String rowUuid = plannerTableRow.getPersonRef().getUuid();
if (meUuid.equals(rowUuid)) {
return true;
}
return false;
}
COM: <s> is this planner row for one of my assignments </s>
|
funcom_train/32753055 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void publishSignals() {
final ChannelGroup group = getSelectedChannelGroup();
if ( group != null ) {
try {
requestConnectionIfNeeded();
LOGGER_CONFIGURATION.publishChannelsToGroup( PENDING_GROUP_SIGNALS, group.getLabel() );
fetchChannelGroups();
clearPendingSignals();
_channelSelectorNeedsUpdate = true;
}
catch ( Exception exception ) {
exception.printStackTrace();
displayError( "Publish Error", "Error publishing new signals.", exception );
}
}
}
COM: <s> publish the pending signals </s>
|
funcom_train/29582999 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ASN1Object toASN1Object() throws CodingException{
ASN1Object result = new SEQUENCE();
result.addComponent(new ObjectID(type));
ASN1Object set = new SET();
for (Enumeration e=values.elements(); e.hasMoreElements();){
set.addComponent(((AttributeValue)e.nextElement()).toASN1Object());
}
result.addComponent(set);
return result;
}
COM: <s> this method returns the asn1 object of this attribute </s>
|
funcom_train/11703197 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected AttributesImpl getXMLAttributes() {
AttributesImpl attrs = super.getXMLAttributes();
attrs.addAttribute("", "executable", "executable", "CDATA", getExecutable());
if (dir != null && dir.trim().length() > 0) {
attrs.addAttribute("", "dir", "dir", "CDATA", getDir());
}
return attrs;
}
COM: <s> overridden to handle name and value attributes </s>
|
funcom_train/24379019 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Document getTypeAsDOM(TemplateBlockType type){
Document dom = null;
if (type!=null){
QName qname = new QName("http://www.imsglobal.org/xsd/imsqti_v2p1", "templateBlock");
JAXBElement<TemplateBlockType> jaxbe =
new JAXBElement<TemplateBlockType>(qname, TemplateBlockType.class, type);
dom = getDOM(jaxbe);
}
return dom;
}
COM: <s> gets the template block as a dom document </s>
|
funcom_train/23632045 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setBounds(Rectangle bounds) {
this.bounds = bounds;
int width = Math.abs(bounds.width);
if( width == 0 ){
//if there are too many events, the width calculated
//is less than one and so it would never show.
//this should ensure that the width is always at least one
width = 1;
}
int height= Math.abs(bounds.height);
if( height == 0 ){
height = 1;
}
bImage = new BufferedImage(width, height,
BufferedImage.TYPE_INT_ARGB);
redrawImage();
}
COM: <s> sets the bounds of this event shape </s>
|
funcom_train/49757046 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isDeviceStateValid() {
if (deviceStateValid) return true;
// Make sure all components are set
for (int chanIndex = 0; chanIndex < deviceState.length; chanIndex++) {
if (deviceState[chanIndex] == UNASSIGNED_DEVICE_STATE) return false;
}
return (deviceStateValid = true);
}
COM: <s> is the devices state known only true after we have received </s>
|
funcom_train/3721345 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isRequired(String name) throws HL7Exception {
Object o = required.get(name);
if (o == null)
throw new HL7Exception("The structure " + name + " does not exist in the group " + this.getClass().getName(), HL7Exception.APPLICATION_INTERNAL_ERROR);
Boolean req = (Boolean) o;
return req.booleanValue();
}
COM: <s> returns true if the named structure is required </s>
|
funcom_train/28297635 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean messageClientData(ArrayList al,int clientId) {
al.clear();
String msg=getNextMessage(TransSibNetMessage.netCmdTypeCtrl,
TransSibNetMessage.netCmdParamClCon,clientId);
if (msg!=null) {
al.add(getMessagePart(2,msg));
al.add(getMessagePart(3,msg));
return true;
}
return false;
}
COM: <s> returns true if a message that got client datas was received </s>
|
funcom_train/21979179 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TableCellRenderer getCellRenderer(int row, int column) {
TableColumn tableColumn = getColumnModel().getColumn(column);
TableCellRenderer renderer = tableColumn.getCellRenderer();
if (renderer == null) {
renderer = getDefaultRenderer(getCellClass(row, column));
}
return renderer;
}
COM: <s> return an appropriate renderer for the cell specified by this this row and </s>
|
funcom_train/47906374 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void prepareComponent() {
if (!contentSynced || !layoutSynced) {
if (icon == null) {
int captionWidth = width - 2 * padding;
captionLines = TextManager.getLines(caption, captionWidth, font);
height = captionLines.length * font.getHeight() + 2 * padding;
} else {
height = icon.getHeight() + 2 * padding;
}
contentSynced = true;
layoutSynced = true;
}
}
COM: <s> prepares the layout of the button </s>
|
funcom_train/49670663 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void createButtonCancel() {
cancel = new Button(dialog, SWT.PUSH);
cancel.setText("&Cancel");
cancel.setLayoutData(SharedStyle.relativeToBottomRight(null));
cancel.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
dialog.close();
}
});
}
COM: <s> creates cancel button </s>
|
funcom_train/14174718 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void loadTranslations() {
InputStream is = getTranslationsStream();
if (is != null) {
try {
translations.load(is);
if (getLogger().isDebugEnabled()) {
getLogger().debug("loaded language " + getName());
getLogger().warn("translation : " + getTranslations());
}
} catch (IOException e_io) {
getLogger().error(
"io exception for while loading "
+ " translations for language " + getName());
}
}
}
COM: <s> loads the properties file that contains all translation for </s>
|
funcom_train/17615198 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void onMessage(Message msg) {
try {
ObjectMessage objmsg = (ObjectMessage)msg;
Video video = (Video)objmsg.getObject();
String perp = msg.getStringProperty("SpudsCustomer");
System.out.println("Perpetrator " + perp + " requested video " + video);
} catch (Exception e) {
e.printStackTrace();
}
}
COM: <s> called by the messaging server when a message appears in the topic </s>
|
funcom_train/38829789 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setAutomaton(EasyHedgeAutomaton automaton, String automatonString, int inputMode) {
assert(automaton != null);
if (this.automaton != automaton || !this.automatonString.equals(automatonString) || this.inputMode != inputMode){
this.automaton = automaton;
this.automatonString = automatonString;
this.inputMode = inputMode;
super.fireItemContentSet();
}
}
COM: <s> sets automaton to be represented </s>
|
funcom_train/18032185 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getButtonFilter() {
if (m_buttonFilter == null) {
m_buttonFilter = new JButton();
m_buttonFilter.setIcon(FBImage.getIcon(FBImage.FILTER));
m_buttonFilter.setToolTipText(Messages.getString("FBToolbar.8")); //$NON-NLS-1$
m_buttonFilter.setMargin(new Insets(0, 0, 0, 0));
}
return m_buttonFilter;
}
COM: <s> returns the filter button </s>
|
funcom_train/34451345 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addInvokedBehaviourPropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(
((ComposeableAdapterFactory) adapterFactory)
.getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_MInvocationAction_invokedBehaviour_feature"),
getString(
"_UI_PropertyDescriptor_description",
"_UI_MInvocationAction_invokedBehaviour_feature",
"_UI_MInvocationAction_type"),
M3ActionsPackage.Literals.MINVOCATION_ACTION__INVOKED_BEHAVIOUR,
true, false, true, null, null, null));
}
COM: <s> this adds a property descriptor for the invoked behaviour feature </s>
|
funcom_train/7876038 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void nextMonth() {
int month = getMonth();
if (month == 11) {
setMonth(0);
fireYearChangeListenerYearIncreased(new YearChangeEvent(this));
} else {
setMonth(month + 1);
}
fireChangeListenerStateChanged(new ChangeEvent(this));
}
COM: <s> changes to the next month </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.