__key__ stringlengths 16 21 | __url__ stringclasses 1
value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/35291871 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private FilterMatcher getFilterMatcherByProperty(String property) {
if (property == null) {
return null;
}
for (MatcherKey key : matchers.keySet()) {
String prop = key.getProperty();
if (prop != null && prop.equals(property)) {
return matchers.get(key);
}
}
return null;
}
COM: <s> if there is a filter matcher that is registered by the specific property </s>
|
funcom_train/40866442 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Long add(SyndicationFeed feed, String sourceUrl) {
NameValuePair[] data = {
new NameValuePair("user", username),
new NameValuePair("password", password),
new NameValuePair("feed", (new FeedElement(feed, sourceUrl)).toString())
};
FeedBurnerResponse response = this.doPost(ADD_API_URL, data);
return response != null ? response.getFeedId() : null;
}
COM: <s> adds the given syndication feed to feed burner </s>
|
funcom_train/29415800 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getProperty(final File file, final String property, final Locale locale) {
// get the base name of the file
final String filename = file.getName();
final String base = filename.substring(0, filename.lastIndexOf(AbstractXmileMojo.EXTENSION_SEPARATOR));
return getProperty(base, property, locale);
}
COM: <s> gets a localized property from the resource bundle </s>
|
funcom_train/26036600 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Graph createDeductionsGraph() {
if (fdeductions != null) {
Graph dg = fdeductions.getGraph();
if (dg != null) {
// Reuse the old graph in order to preserve any listeners
safeDeductions.getBulkUpdateHandler().removeAll();
return dg;
}
}
Graph dg = Factory.createGraphMem( style );
safeDeductions = new SafeGraph( dg );
return dg;
}
COM: <s> create the graph used to hold the deductions </s>
|
funcom_train/28555167 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean setTeamResult(int room, int teamID, double result, double s1, double s2){
Team[] roomTeams = roomAllocations[room];
// Find the team in the room
for (int i = 0; i < roomTeams.length; i++){
if (roomTeams[i].getPosition() == teamID){
// Found it
roomTeams[i].setResult(roundNum, result);
roomTeams[i].setSpeaks(roundNum, s1, s2);
this.resultCounter++;
return true;
}
}
return false;
}
COM: <s> set the result of a team in a debate </s>
|
funcom_train/28109277 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setCategory(String category) throws IllegalArgumentException {
if ((category==null)||(category.trim().equals("")))
throw new IllegalArgumentException("Product category is required.");
else this.category = category;
// TODO: Should check the category exists before allowing it to be set.
}
COM: <s> set product category name </s>
|
funcom_train/45192500 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void sendSetDisabled(boolean disabled) {
StringBuilder out = openScriptBuffer();
if (out != null) {
out.append("wa.setDisabled('");
out.append(elementId);
out.append("',");
out.append(disabled ? "true" : "false");
out.append(");\n");
}
}
COM: <s> send a set disabled command to the browser </s>
|
funcom_train/19811003 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createNoFnReport() {
String message = "Node" + getNode().getNodeName() + "must be a valid hCard and must contain a fn property";
Report report = new Report(message, getNode());
engine = ValidatorCache.getInstance().getEngine(getDocumentName());
engine.addReport(report);
}
COM: <s> convenience method for report creation in case of missing fn class attribute </s>
|
funcom_train/41164825 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void save(CoResponseWordE1 entity) {
EntityManagerHelper.log("saving CoResponseWordE1 instance", Level.INFO, null);
try {
getEntityManager().persist(entity);
EntityManagerHelper.log("save successful", Level.INFO, null);
} catch (RuntimeException re) {
EntityManagerHelper.log("save failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> perform an initial save of a previously unsaved co response word e1 entity </s>
|
funcom_train/22769285 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addTreeModel(int i, ITreeModel model){
Assertions.assertNotNull(model, "Model");
if(treeModels.contains(model))
throw new IllegalArgumentException("IntegrationTreeModel can not hold the same model twice.");
if(model == this)
throw new IllegalArgumentException("The model can not contain itself.");
treeModels.add(i, model);
}
COM: <s> adds the tree model to a header </s>
|
funcom_train/855922 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Image getImage(final String key) {
if (key == null) {
throw new IllegalArgumentException("Argument key is null.");
}
// standard size
int width = 64;
int height = 80;
int type = BufferedImage.TYPE_INT_ARGB;
BufferedImage image = new BufferedImage(width, height, type);
if (containsKey(key)) {
String imagename = getFilename(key);
File f = new File(imagename);
if (f.exists()) {
try {
image = ImageIO.read(f);
} catch (IOException e) {
image = new BufferedImage(width, height, type);
}
}
}
return image;
}
COM: <s> returns an image for the given key if available </s>
|
funcom_train/43612683 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean hasInEdgeWithLabel(String label) {
SMEdge edge;
Iterator it = incoming.iterator();
while(it.hasNext()) {
edge = (SMEdge) it.next();
if(edge.isSkipEdge()) continue;
if(edge.getLabel() == label || (label != null && label.equals(edge.getLabel()))) {
return true;
}
}
return false;
}
COM: <s> determines whether this node has an incoming edge with a given label </s>
|
funcom_train/4009160 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Console createConsole(String input,Writer output,Writer error) {
StringReader in = new StringReader(input) ;
PrintWriter out = new PrintWriter(output,true) ;
PrintWriter err = new PrintWriter(error,true) ;
Console console = new Console(in,out,err,false) ;
return console ;
}
COM: <s> create a default console instance with no command </s>
|
funcom_train/2580244 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void axisChanged(AxisChangeEvent event) {
Object source = event.getSource();
if (source.equals(this.rangeAxis) || source.equals(this.domainAxis)) {
ColorBar cba = this.colorBar;
if (this.colorBar.getAxis().isAutoRange()) {
cba.getAxis().configure();
}
}
super.axisChanged(event);
}
COM: <s> receives notification of a change to one of the plots axes </s>
|
funcom_train/45251506 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void createButtonsForButtonBar(Composite parent) {
okButton = createButton(parent, IDialogConstants.OK_ID,
IDialogConstants.OK_LABEL, true);
createButton(parent, IDialogConstants.CANCEL_ID,
IDialogConstants.CANCEL_LABEL, false);
updateButtons();
text.setFocus();
}
COM: <s> add buttons to the dialogs button bar </s>
|
funcom_train/43540247 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testOpenView() {
IUIContext ui = getUI();
IWorkbenchHelper workbench = EclipseHelperFactory.getWorkbenchHelper();
Perspective[] allPerspectives = Perspective.values();
for (Perspective nextPerspective : allPerspectives) {
workbench.openPerspective(ui, nextPerspective);
}
View[] allViews = View.values();
for (View nextView : allViews) {
workbench.openView(ui, nextView);
}
}
COM: <s> test open view verify that opening each view does not throw test failures </s>
|
funcom_train/9666827 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getCurrentDate() {
StringBuffer buf = new StringBuffer("");
try {
ResultSet rs = executeQuery("SELECT CURDATE()");
rs.next();
buf.append((rs.getString(1)));
}
catch (SQLException sqlex) {
sqlex.printStackTrace();
}
return buf.toString();
}
COM: <s> gets the current date from the sql database </s>
|
funcom_train/13675486 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getListIndex(int msgnum) {
for (Iterator iter = iterator(); iter.hasNext();) {
JwmaMessageInfoImpl msginfo = (JwmaMessageInfoImpl) iter.next();
if (msginfo.getMessageNumber() == msgnum) {
return m_MessageInfos.indexOf(msginfo);
}
}
return -1;
}//getListIndex
COM: <s> returns the list index of message given by its </s>
|
funcom_train/1243343 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
if ("IphoneServiceHttpPort".equals(portName)) {
setIphoneServiceHttpPortEndpointAddress(address);
}
else
{ // Unknown Port Name
throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
}
}
COM: <s> set the endpoint address for the specified port name </s>
|
funcom_train/33783964 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public AttributeDO saveAttribute(final AttributeDO attributeDO) throws StorageException {
final Session session = getSession();
final Transaction transaction = session.beginTransaction();
try {
session.saveOrUpdate(attributeDO);
transaction.commit();
} catch (final HibernateException e) {
transaction.rollback();
throw new StorageException(e, MapErrorCodes.STORAGE_ERROR);
}
return attributeDO;
}
COM: <s> stores the supplied attribute do in the database </s>
|
funcom_train/51626368 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addDetachedPart(LayoutPart part) {
// Calculate detached window size.
Rectangle bounds = parentWidget.getShell().getBounds();
bounds.x = bounds.x + (bounds.width - 300) / 2;
bounds.y = bounds.y + (bounds.height - 300) / 2;
addDetachedPart(part, bounds);
// enable direct manipulation
//enableDrop(part);
}
COM: <s> create a detached window containing a part </s>
|
funcom_train/9909069 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void createBusinessEntityObject(Object businessEntityObject) throws PojoActionException {
CodeTableService service = this.getService();
try {
service.createCodeMap((CodeMap) businessEntityObject);
} catch (CodeTableException e) {
throw new UIException(e.getErrorCode(), e);
}
}
COM: <s> create code map </s>
|
funcom_train/8745090 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void updateGeneralPricelist(UUID parentDataObjectId) {
Pricelist pricelist = checkGeneralPricelist(parentDataObjectId);
List<SimpleProduct> notIncluded = getMissingGeneralPricelistProducts(pricelist);
createGeneralPricelistItems(pricelist, notIncluded);
em.flush();//make sure the general price-list is updated successfully before continue
}
COM: <s> create the general price list if not created </s>
|
funcom_train/42651317 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addParameter(String alias, Object object) {
if(this.initialParameters.containsKey(alias)) {
throw new IllegalArgumentException("Parameter already defined: " + alias);
}
this.initialParameters.put(alias, object);
if(logger.isDebugEnabled()) {
logger.debug("Added object: " + alias + " --> " + object);
}
}
COM: <s> adds a new parameter to the context </s>
|
funcom_train/13668254 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void help() {
System.out.println("");
System.out.println("Jad Helper");
System.out.println("");
System.out.println("usage: JadHelper<version>.jar <file>");
System.out.println("");
System.out
.println("option: -path (working path, place where the log file will be created)");
System.out.println("");
System.out.println("usage: JadHelper<version>.jar <file> -path <path>");
System.out.println("");
}
COM: <s> print help text </s>
|
funcom_train/32355128 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean canSee(File file) {
boolean isAdmin = LoginController.isAdminLogged();
boolean isOwner = LoginController.getLoggedUser().getUserBO()
.isOwnerFor(file);
boolean isEditor = LoginController.getLoggedUser().getUserBO()
.isEditorFor(file);
boolean isCollaborator = LoginController.getLoggedUser().getUserBO()
.isCollaboratorFor(file);
if ((isAdmin) || (isOwner) || (isEditor) || (isCollaborator)) {
return true;
} else
return false;
}
COM: <s> verifies if a user can see the file in the tree </s>
|
funcom_train/51119326 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeAllComponents() {
LinkedList l = new LinkedList();
// Add all components
for (Iterator i = getComponentIterator(); i.hasNext();)
l.add(i.next());
// Remove all component
for (Iterator i = l.iterator(); i.hasNext();)
removeComponent((Component)i.next());
}
COM: <s> removes all components from the container </s>
|
funcom_train/2292467 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addLabeledFolder(String uri) {
m_labelSiteFolders.add(uri);
if (CmsLog.INIT.isInfoEnabled()) {
CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_LABEL_LINKS_IN_FOLDER_1, uri));
}
}
COM: <s> adds a folder to the list of labeled folders </s>
|
funcom_train/18728181 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetColorName() {
String expResult;
String result;
for (int i = 0; i < nofColors; i++) {
expResult = colorName[i];
result = JaxoColor.getColorName(i);
assertEquals("Colornames do not match!", expResult, result);
result = JaxoColor.getColorName(colorList[i]);
assertEquals("Colornames do not match!", expResult, result);
}
}
COM: <s> test of get color name method </s>
|
funcom_train/50879939 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setImageFile(File inImageFile) throws Exception{
if (inImageFile != null){
if (!inImageFile.exists()) throw new Exception("Error File "+inImageFile.getAbsolutePath() + " does not exist");
}
myImageFile = inImageFile;
setName(myImageFile.getName());
}
COM: <s> set the name of the file </s>
|
funcom_train/22782920 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel createPreviewPanel() {
// preview panel
JPanel preview = new JPanel();
BorderLayout previewLayout = new BorderLayout();
previewLayout.setHgap(5);
previewLayout.setVgap(5);
preview.setLayout(new BorderLayout());
preview.setOpaque(true);
image = new ImageViewer();
image.setMinimumSize(PREVIEW_DIMENSION);
image.setPreferredSize(PREVIEW_DIMENSION);
image.setMaximumSize(PREVIEW_DIMENSION);
image.setBorder(new EmptyBorder(5, 5, 5, 5));
image.setOpaque(false);
image.addMouseListener(new PreviewImageDoubleClickListener());
preview.add(image, BorderLayout.CENTER);
return preview;
}
COM: <s> creates the preview head </s>
|
funcom_train/14329685 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetMetaData() throws Exception {
PreparedStatement pstmt = con.prepareStatement("SELECT name, id, type FROM sysobjects WHERE type = 'U'");
ResultSetMetaData rsmd = pstmt.getMetaData();
assertEquals("name", rsmd.getColumnName(1));
pstmt.close();
}
COM: <s> test for sun bug prep stmt1 </s>
|
funcom_train/51102462 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void connectionClosedNotification() {
synchronized (connectionEventListeners) {
if (connectionEventListeners.size() == 0)
return;
ConnectionEvent closedEvent = new ConnectionEvent(this);
Iterator listeners = connectionEventListeners.iterator();
while (listeners.hasNext()) {
ConnectionEventListener nextListener = (ConnectionEventListener) listeners
.next();
nextListener.connectionClosed(closedEvent);
}
}
}
COM: <s> creates and sends an event to listeners when a user closes java </s>
|
funcom_train/24526969 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addMainHandler(Object handler, String prefix) {
if (handler == null) {
throw new NullPointerException();
}
allHandlers.add(handler);
addDeclaredMethods(handler, prefix);
inputConverter.addDeclaredConverters(handler);
outputConverter.addDeclaredConverters(handler);
if (handler instanceof ShellDependent) {
((ShellDependent)handler).cliSetShell(this);
}
}
COM: <s> method for registering command hanlers or providers </s>
|
funcom_train/31456636 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setOrganisms(DigitalOrganism[] orgs) {
update.Lock();
Map<Integer, DigitalOrganism> target = update.IsUpdate() ? tempOrgs : orgsTree;
for (int i=0; i<orgs.length; i++) {
if ( orgs[i] != null )
target.put(orgs[i].getID(), orgs[i]);
}
update.UnLock();
}
COM: <s> adds organisms to tree </s>
|
funcom_train/42904432 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void updateAssignment(int AssignmentId,String teacher,int amount, LectureType lectureType){
try {
PreparedStatement pstmt = conn.prepareStatement("UPDATE ASSIGNMENT SET TEACHER=?, AMOUNT=?, TYPE=? " +
"WHERE ID = ?");
pstmt.setString(1, teacher);
pstmt.setInt(2, amount);
pstmt.setString(3, lectureType.toString());
pstmt.setInt(4, AssignmentId);
pstmt.execute();
} catch (SQLException e) {
e.printStackTrace();
}
}
COM: <s> to update an assignment with new teacher amount and type </s>
|
funcom_train/44869715 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void updateSize() {
int w = (getXyTable().getWidth() - cols - 1) / (cols - 1);
TableColumnModel tModel = getVelTable().getColumnModel();
for (int i = 0; i < cols; i++) {
int width = w;
if (i == 1 || i == cols - 1) {
width = w / 2;
}
tModel.getColumn(i).setPreferredWidth(width);
}
repaint();
}
COM: <s> update the column widths </s>
|
funcom_train/7667446 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String nextTo(char d) {
StringBuilder sb = new StringBuilder();
for (;;) {
char c = next();
if (c == d || c == 0 || c == '\n' || c == '\r') {
if (c != 0) {
back();
}
return sb.toString().trim();
}
sb.append(c);
}
}
COM: <s> get the text up but not including the specified character or the </s>
|
funcom_train/26595041 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean first() throws com.daffodilwoods.database.resource.DException {
checkInSecondIterator = true;
if (!leftIterator.first()) {
state = AFTERLAST;
return false;
}
if (!rightIterator.first()) {
checkInSecondIterator = false;
state = VALIDSTATE;
return true;
}
return (state = alignNext() ? VALIDSTATE : AFTERLAST) != AFTERLAST;
}
COM: <s> this method is responsible for retrieving the first record </s>
|
funcom_train/1427106 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void removeSelectedFromResultList() {
final int[] selectedIndices = resultTable.getSelectedRows();
for ( int i = selectedIndices.length - 1; i >= 0; i-- ) { // Downward is a must, indices change when an element is removed!
lastSearchResultFileList.remove( selectedIndices[ i ] );
lastSearchResultRowsData.remove( selectedIndices[ i ] );
}
refreshResultTable();
updatedResultsCountLabel();
}
COM: <s> removes selected lines from result list </s>
|
funcom_train/27785136 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean checkSettings() {
String error = graphUI.checkSettings();
if(error != null)
JOptionPane.showInternalMessageDialog(this,
error,
Locale.getString("ERROR_GRAPH_SETTINGS_TITLE"),
JOptionPane.ERROR_MESSAGE);
return(error == null);
}
COM: <s> check the settings entered by the user </s>
|
funcom_train/40527679 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Expression getPermitsUsed(Identifier varName) {
// TODO(erights): Permit should generate a JSON AST directly,
// rather than generating a string which we then parse.
Permit subPermit = permitsUsed.canRead(varName);
if (null == subPermit) { return null; }
return (Expression)substV(
"(" + subPermit.getPermitsUsedAsJSONString() + ")");
}
COM: <s> if var name is not a statically permitted base name return null </s>
|
funcom_train/4359395 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean isRequestWithoutSessionChange(String uri) {
boolean filterfound = false;
for (int i = 0; (i < reqFilters.length) && (!filterfound); i++) {
java.util.regex.Matcher matcher = reqFilters[i].matcher(uri);
filterfound = matcher.matches();
}
return filterfound;
}
COM: <s> is request without possible session change </s>
|
funcom_train/22492746 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PlatformRegistrar lookupRegistrar(String connectionClass) {
PlatformRegistrar instance = registrarCache.get(connectionClass);
if (instance == null) {
instance = createNewInstance(classMappings, connectionClass);
if (instance == null) {
instance = createNewInstance(defaultMappings, connectionClass);
}
if (instance != null) {
registrarCache.put(connectionClass, instance);
}
}
return instance;
}
COM: <s> looks up a platform registrar by connection class name </s>
|
funcom_train/20284742 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void markProcessed(Connection db) throws SQLException {
PreparedStatement pst = db.prepareStatement(
"UPDATE user_request " +
"SET processed = CURRENT_TIMESTAMP " +
"WHERE request_id = ?");
pst.setInt(1, id);
pst.executeUpdate();
pst.close();
}
COM: <s> updates the record to indicate that it has been processed </s>
|
funcom_train/45650033 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setUpEditorActionTable(JTextComponent textComponent) {
editorKitActionMap = new HashMap<Object, Action>();
Action[] actionsArray = textComponent.getActions();
for (int i = 0; i < actionsArray.length; i++) {
Action a = actionsArray[i];
editorKitActionMap.put(a.getValue(Action.NAME), a);
}
}
COM: <s> build a map to find editor actions by name </s>
|
funcom_train/29667736 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT:
public void remove() throws XmlParserException, DOMException {
// Parent node
Node parentNode = null;
if(m_currentNode == null) {
if(m_docRoot != null)
m_currentNode = m_docRoot;
else
return;
}
if(m_currentNode != m_docRoot) {
parentNode = m_currentNode.getParentNode();
parentNode.removeChild(m_currentNode);
m_currentNode = parentNode;
grabNodeInformation(m_currentNode);
} else
resetXmlDocument();
m_attribIndex = -1;
return;
}
COM: <s> remove the current node move to the parent node </s>
|
funcom_train/43889867 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Integer getInteger(final String attribute) {
String value = getString(attribute);
if (value != null) {
value = trimFractionalPart(value);
try {
return Integer.valueOf(value);
} catch (NumberFormatException e) {
warning("getInteger", ErrorKeys.UNPARSABLE_NUMBER_$1, value);
}
}
return null;
}
COM: <s> returns an attribute as an integer for the </s>
|
funcom_train/38723769 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initializeMemeticOperator() {
graph = new SparseMultigraph<Integer, Integer>();
layout = new SpringLayout(graph);
layout.setSize(new Dimension(config.userConfig.getBounds()[0], config.userConfig.getBounds()[1]));
fillGraph();
}
COM: <s> initializes the memetic operator by loading a graph with the cytoscape network </s>
|
funcom_train/44656829 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean hasListeners(String propertyName) {
if (listeners != null && listeners.getListenerCount(PropertyChangeListener.class) > 0) {
// there is a generic listener
return true;
}
if (children != null) {
PropertyChangeSupport child = (PropertyChangeSupport) children.get(propertyName);
if (child != null) {
// The child will always have a listeners ArrayList.
return child.hasListeners(propertyName);
}
}
return false;
}
COM: <s> check if there are any listeners for a specific property </s>
|
funcom_train/3925631 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Field getInterfaceField( String fieldId ) {
if ( scriptInterface != null ) {
int interfaceSize = scriptInterface.size();
for ( int i = 0; i < interfaceSize; i++ ) {
Field f = (Field)scriptInterface.elementAt( i );
if ( f.getFieldId().compareTo( fieldId ) == 0 ) {
return( f );
}
}
}
return( null );
}
COM: <s> get the interface field of the given name </s>
|
funcom_train/2713986 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void insertUpdate(final DocumentEvent e) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
int offset = e.getOffset() + e.getLength();
offset = Math.min(offset, editArea.getDocument().
getLength());
editArea.setCaretPosition(offset);
}
});
}
COM: <s> updates the current caret position </s>
|
funcom_train/4780027 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void unassignMembers() {
if (!getMemberList().isSelectionEmpty()) {
List<Object> values = Arrays.asList(getMemberList().getSelectedValues());
for (Object object : values) {
if (object instanceof Group) {
groupMembers.remove(object);
groupNonMembers.add((Group) object);
}
if (object instanceof User) {
userMembers.remove(object);
userNonMembers.add((User) object);
}
}
refreshLists();
}
}
COM: <s> unassigns selected members </s>
|
funcom_train/25457311 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private MinMaxFloatSelector getUncertaintyAmountOffset() {
if (UncertaintyAmountOffset == null)
{
UncertaintyAmountOffset = new MinMaxFloatSelector(270,"offset.patch.assessment.uncertainty.amount <- ", "666.0", "Offset uncertainty amount:");
UncertaintyAmountOffset.setMinMax((float)0.0, (float)1.0);
UncertaintyAmountOffset.setEnabled(false);
}
return UncertaintyAmountOffset;
}
COM: <s> this method initializes uncertainty amount offset </s>
|
funcom_train/3403886 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getIndexFast(String uri, String localName) {
for (int i = (length-1)*5; i>=0; i-=5) {
// local names tend to be different, so test it first
if (data[i + 1] == localName && data[i] == uri ) {
return i / 5;
}
}
return -1;
}
COM: <s> can be used if parameters are interned </s>
|
funcom_train/49094004 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeText(int atomicID, int line, int begin, int end) {
assert atomicID != 0;
AxedEvent e = eventPool.newEvent(atomicID, AxedEvent.REMOVE_TEXT);
e.getRemoveText().issue(AxedEvent.REMOVE_TEXT, line, begin, line, end);
listeners.fireEvent(e);
eventPool.releaseEvent(e);
}
COM: <s> removes text from begin to end column in linenr </s>
|
funcom_train/38414042 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Font getFont( String fontName ) {
if( !fonts.containsKey(fontName) ) {
if(DEBUG_MODE)
System.out.println( "Font "+fontName +" not found !" );
return (Font) fonts.get("dialog");
}
return (Font) fonts.get( fontName );
}
COM: <s> to get a font </s>
|
funcom_train/51813418 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean putJob(Job job, long wait) throws InterruptedException {
if ( log.isDebugEnabled() )
log.debug( "job="+job+", wait="+wait );
boolean ret = newJobs.push( job, wait );
if ( ret )
super.putJob( job, wait );
return ret;
}
COM: <s> submit a new job for computation </s>
|
funcom_train/38878733 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void updateStartStop(long millisecs) {
Timer t = new Timer();
t.schedule(new TimerTask() {
public void run() {
/*
* Handler is needed because only creating thread
* can interact with user interface, and Timer uses
* a different one
*/
handler.post(new Runnable() {
public void run() {
updateStartStop();
}
});
}
}, millisecs);
}
COM: <s> updates start and stop buttons after a specified time </s>
|
funcom_train/42901991 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void encodeBlock(int channels, int[] inBuffer, int length, int[] steps, byte[] outBuffer, int option) {
for (int ch = 0; ch < channels; ch++) {
encodeChannel(ch, channels, inBuffer, length, steps, ch, outBuffer, option);
}
}
COM: <s> mash one block </s>
|
funcom_train/40018875 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void distributeRandomTiles()
{
for (int i = 0; i<nrow; i++)
{
for (int j = 0; j<ncol; j++)
{
Tile t = Tile.newRandomTile(i,j);
setTile(i,j,t);
}
}
}
COM: <s> change all tiles with random shape and direction </s>
|
funcom_train/29311320 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public LogFilter get(String name) {
if (name == null) {
return null;
}
for (int i = 0; i < size(); i++) {
if (name.equals(get(i).getName()) ||
name.equals(get(i).getClass().getName()) ) {
return get(i);
}
}
return null;
}
COM: <s> get a log filter by its name </s>
|
funcom_train/2546696 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void handleLoadException(Exception e) {
MessageDialog.openError(getSite().getWorkbenchWindow().getShell(), Messages.getString("WorkflowModeller.0"), Messages.getString("WorkflowModeller.1")); //$NON-NLS-1$ //$NON-NLS-2$
e.printStackTrace();
diagram = new WorkflowDiagram();
}
COM: <s> handles exceptions that occur while loading the workflow model from xml </s>
|
funcom_train/3391695 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected int writeTypeParameters(ExecutableMemberDoc member) {
LinkInfoImpl linkInfo = new LinkInfoImpl(
LinkInfoImpl.CONTEXT_MEMBER_TYPE_PARAMS, member, false);
String typeParameters = writer.getTypeParameterLinks(linkInfo);
if (linkInfo.displayLength > 0) {
writer.print(typeParameters + " ");
writer.displayLength += linkInfo.displayLength + 1;
}
return linkInfo.displayLength;
}
COM: <s> write the type parameters for the executable member </s>
|
funcom_train/26225653 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean parseArguments(String[] args) {
options = new MsggenOptions();
if (!options.parseCommandLine(args)) {
return false;
}
if (options.nonOptions.length == 0) {
System.err.println(MsggenMessages.NO_INPUT_FILE.getFormat());
return false;
} else if (options.nonOptions.length > 1) {
options.usage();
return false;
}
return true;
}
COM: <s> parse the argument list </s>
|
funcom_train/37508380 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JProgressBar getBar() {
if (m_bar == null) {
m_bar = new JProgressBar();
m_bar.setMinimum(0);
m_bar.setMaximum(100);
m_bar.setPreferredSize(new Dimension(250,
m_bar.getPreferredSize().height));
}
return m_bar;
}
COM: <s> returns the progress bar </s>
|
funcom_train/13812671 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: final private void removeSatisfiesTerminalStateIndex(int i) {
// clear flag for referenced submachine from list of machines in
// their terminal states
satisfiesTerminalState[i] = false;
// reset cached index value
satisfiesTerminalStateIndex = -1;
// now find next machine in its terminal state
for (int j = 0; j < bound && satisfiesTerminalStateIndex == -1; j++) {
if (satisfiesTerminalState[j]) satisfiesTerminalStateIndex = j;
}
}
COM: <s> method called to update the cached value of the index of the </s>
|
funcom_train/35084709 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public HashTree getReplacementSubTree() {
HashTree tree = new ListedHashTree();
if (selectedNode != null) {
if (!selectedNode.isEnabled()) {
selectedNode = cloneTreeNode(selectedNode);
selectedNode.setEnabled(true);
}
tree.add(selectedNode);
createSubTree(tree, selectedNode);
}
return tree;
}
COM: <s> copies the controllers subelements into the execution tree </s>
|
funcom_train/36171397 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMember parseMember(Scanner fin) {
JMember jm = new JMember();
jm.setName(removeTags(fin.next(), "name"));
jm.setPwner(removeTags(fin.next(), "pwner"));
jm.setMods(removeTags(fin.next(), "mods"));
jm.setType(removeTags(fin.next(), "type"));
return jm;
}
COM: <s> builds a jmember object from an existing xml file </s>
|
funcom_train/2903664 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ZItem getLauncherData(){
Dimension d = getPreferredSize();
int width = getWidth();
int height = getHeight();
int pwidth = (int)d.getWidth();
int pheight = (int)d.getHeight();
if(width > pwidth){
width = pwidth;
}
if(height > pheight){
height = pheight;
}
data.setBoundsData(new ZBounds(getX(), getY(), width, height));
return data;
}
COM: <s> get the data model for this launcher </s>
|
funcom_train/19959971 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException{
saveObject(parameterIndex, (reader==null?"NULL":"<stream length= " + length+">"));
ps.setCharacterStream(parameterIndex,reader,length);
}
COM: <s> debug string prints null if reader is null or adds stream length length </s>
|
funcom_train/26018911 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String toHexString(byte[] value) {
int pos = 0;
char[] c = new char[value.length * 2];
for (int i = 0; i < value.length; i++) {
c[pos++] = HEX[value[i] >> 4 & 0xf];
c[pos++] = HEX[value[i] & 0xf];
}
return new String(c);
}
COM: <s> convert to hexa string </s>
|
funcom_train/41251747 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createDestination() {
String destinationName = "New";
D destinationElement = destinationConverter.convert(destinationName);
associator.getRightList().add(destinationElement);
LearningEntityEditor
.getEditorDialog(
(LearningEntity) destinationElement,
createDestinationButton.getLocationOnScreen())
.setVisible(true);
}
COM: <s> create a new entity of the destination class </s>
|
funcom_train/31079278 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public BCField getField() {
String dec = getFieldDeclarerName();
if (dec == null)
return null;
BCClass bc = getProject().loadClass(dec, getClassLoader());
BCField[] fields = bc.getFields(getFieldName());
if (fields.length == 0)
return null;
return fields[0];
}
COM: <s> return the field this instruction operates on or null if not set </s>
|
funcom_train/37017907 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void setStructure(int structure){
switch(structure){
case CHeader.FREE:
theDisplay= new DisplayFree(this);
break;
case CHeader.LINEAR:
theDisplay= new DisplayFlow(this);
break;
case CHeader.COMPLEX:
theDisplay= new DisplayComplex(this);
break;
}
if(theDisplay != null){
this.add(theDisplay.getMap());
}
}
COM: <s> set the structure </s>
|
funcom_train/36203649 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isOrHasChangedSuccessor(String title, Collection<Class<? extends Type>> filteredTypes) {
if (isChanged(title, filteredTypes)) {
return true;
}
else {
for (Section<?> child : this.getChildren()) {
if (child.isOrHasChangedSuccessor(title, filteredTypes)) return true;
}
return false;
}
}
COM: <s> checks whether this section or a successor is not reused </s>
|
funcom_train/18837055 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private DefaultMutableTreeNode cloneNode(DefaultMutableTreeNode root) {
DefaultMutableTreeNode copy = (DefaultMutableTreeNode) root.clone();
for (int i = 0; i < root.getChildCount(); i++) {
copy.add(cloneNode((DefaultMutableTreeNode) root.getChildAt(i)));
}
return copy;
}
COM: <s> clone node on the tree with all sub nodes </s>
|
funcom_train/9869092 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run() {
try {
if (targetBrowser != null) {
launcher.openUrl(targetBrowser,
url);
}
else if(targetBrowsers != null) {
launcher.openUrl(targetBrowsers,
url);
}
else {
launcher.openUrl(url);
}
}
catch (Exception ex) {
logger.error("fatal error opening url", ex);
errorHandler.handleException(ex);
}
}
COM: <s> when an object implementing interface code runnable code is used to </s>
|
funcom_train/31930929 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected JPanel createDisplayPane(JLabel label, final JTextField field) {
JPanel pane = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0));
pane.add(label);
pane.add(Box.createRigidArea(new Dimension(5, 5)));
pane.add(field);
return pane;
}
COM: <s> create and return a display pane with the code label code and </s>
|
funcom_train/7276047 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addUDPFailover(RemoteFileDesc file) {
synchronized (UDP_FAILOVER) {
byte[] key = file.getClientGUID();
IntWrapper requests = UDP_FAILOVER.get(key);
if (requests == null) {
requests = new IntWrapper(0);
UDP_FAILOVER.put(key, requests);
}
requests.addInt(1);
}
}
COM: <s> adds the necessary data into udp failover so that a push failover requestor </s>
|
funcom_train/51343166 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isClosureProgram(IStep step) {
if (step == null)
throw new IllegalArgumentException();
if(step.isRule()) return false;
final IProgram program = (IProgram)step;
if (program.isClosure())
return false;
final Iterator<IStep> itr = program.steps();
while (itr.hasNext()) {
if (isClosureProgram2(itr.next()))
return true;
}
return false;
}
COM: <s> code true code iff the program contains an embedded closure </s>
|
funcom_train/19717932 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void repaintNode(Node node) {
JPowerGraphRectangle nodeScreenRectangle = new JPowerGraphRectangle(0, 0, 0, 0);
getNodeScreenBounds(node, nodeScreenRectangle);
synchronized (SWTJGraphPane.this) {
SWTJGraphPane.this.redraw();
}
}
COM: <s> repaints the given node </s>
|
funcom_train/22547170 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void extractAAEndpoints(final String entityId) {
EndpointManager manager = this.aaDescriptor.getAttributeServiceManager();
Iterator<Endpoint> endpointIterator = manager.getEndpoints();
while (endpointIterator.hasNext()) {
Endpoint endpoint = endpointIterator.next();
if (endpoint.getBinding().equals(SAMLBinding.SOAP)) {
this.endPoints.add(endpoint);
}
}
}
COM: <s> extract all of the aa endpoints for a users id p </s>
|
funcom_train/19279724 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setNumSteps(int numSteps) {
if (numSteps < 0 || numSteps > MAX_NUM_STEPS)
throw new IllegalArgumentException("Invalid step count: " //$NON-NLS-1$
+ numSteps);
data[PARAMETER_1_OFFSET] = (byte)(numSteps % 256);
data[PARAMETER_2_OFFSET] = (byte)(numSteps / 256);
}
COM: <s> sets the umber of steps the motor shall turn </s>
|
funcom_train/3924479 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void init(Store store) throws Exception {
db = new org.vrspace.server.db.HibernateDB();
db.setProperties( properties );
db.addClasses( "Keyword NGUser Node Uri UriTriple Predicate Event EventType UriDesc" ); // FIXME
//db.connect( properties.getProperty( "vrspace.db.url" ));
db.init();
instance = this;
}
COM: <s> initialize the adapter </s>
|
funcom_train/41016707 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void initializeMap() {
if (!APPSettings.featureMap)
return;
if (!mapInitialized) {
initializeMapStart();
// start mapping
map.startMapping();
// old full screen call
map.resize(mapWidth, mapHeight);
// update map listener
ml.update(true);
initializeMapEnd();
mapInitialized = true;
}
addCommands();
setCanvas();
invalidate(INV_SHOW);
}
COM: <s> initialize the map the first time it is used </s>
|
funcom_train/50872963 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSetElements() {
OMError error = new OMError();
error.setSymbol( new OMSymbol( "cd", "name" ) );
Vector elements = new Vector();
elements.add( new OMInteger( "1" ) );
error.setElements( elements );
assertTrue( !error.getElements().isEmpty() );
}
COM: <s> test of set elements method of class nl </s>
|
funcom_train/11792425 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void getFileList(DiffContentType[] content) {
logger.debug("getFileList started");
for (int i = 0; i < content.length; i++) {
String operation = content[i].getOperation().getValue();
if (!operation.equalsIgnoreCase(OperationType._delete)) {
fileList.add(content[i].getPathname());
}
}
logger.debug("getFileList finished");
}
COM: <s> gets the file paths of the aa contents </s>
|
funcom_train/13537202 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private List addRoles(User user, String[] ids) {
log.debug("addRoles(" + user.getFullName() + ", "
+ Arrays.toString(ids) + ")");
RoleDAO roleDAO = new RoleDAO();
List<Role> roles = roleDAO.getRoles(ids);
user.getRoles().addAll(roles);
return getRemainingRoles(user);
}
COM: <s> add the given roles to a user </s>
|
funcom_train/24503436 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PieceImageSet toPieceImageSet() {
final Properties pieces = new Properties();
final InputStream is = getClass().getResourceAsStream(propertiesFile);
try {
pieces.load(is);
} catch (IOException e) {
throw new RuntimeException(e);
}
return new PropertiesFilePieceImageSet(pieces);
}
COM: <s> renders a piece image set from this member </s>
|
funcom_train/7402518 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testDateConstructor2() {
TimeZone zone = TimeZone.getTimeZone("America/Chicago");
Second s1 = new Second(new Date(1016751358999L), zone);
Second s2 = new Second(new Date(1016751359000L), zone);
assertEquals(58, s1.getSecond());
assertEquals(1016751358999L, s1.getLastMillisecond(zone));
assertEquals(59, s2.getSecond());
assertEquals(1016751359000L, s2.getFirstMillisecond(zone));
}
COM: <s> in chicago the 4 </s>
|
funcom_train/50361063 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: final public StringWrapper prepare(String s) {
MultiStringWrapper ms = new MultiStringWrapper(s,delim);
if (!isLegalMultiStringWrapperSize(ms.size())) {
throw new IllegalArgumentException("string has invalid number of fields");
}
for (int i=0; i<ms.size(); i++) {
ms.set(i, getDistance(i).prepare( ms.get(i).unwrap() ));
}
return ms;
}
COM: <s> prepare a string </s>
|
funcom_train/45262350 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JNumberFloatField getJNumberFloatFieldFracaoSitiosInvariantesTF84() {
if (jNumberFloatFieldFracaoSitiosInvariantesTF84 == null) {
jNumberFloatFieldFracaoSitiosInvariantesTF84 = new JNumberFloatField();
jNumberFloatFieldFracaoSitiosInvariantesTF84.setLocation(new Point(435, 216));
jNumberFloatFieldFracaoSitiosInvariantesTF84.setSize(new Dimension(30, 20));
}
return jNumberFloatFieldFracaoSitiosInvariantesTF84;
}
COM: <s> this method initializes j number float field fracao sitios invariantes tf84 </s>
|
funcom_train/3033243 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean deleteContext(boolean internal) {
if (! internal)
gcontext.debug_dump("deleteContext");
assert (rowner != null);
if (rowner != null) {
int index = rowner.props.indexOf(gcontext);
assert (index >= 0);
return rowner.deleteProperty(index);
}
return false;
}
COM: <s> deletes the context within the parent context </s>
|
funcom_train/2291099 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Map getCategoryCountResult() {
Map result = new TreeMap();
Iterator i = m_categories.keySet().iterator();
while (i.hasNext()) {
String category = (String)i.next();
CmsCategroyCount count = (CmsCategroyCount)m_categories.get(category);
result.put(category, count.toInteger());
}
return result;
}
COM: <s> returns the category count result the returned map </s>
|
funcom_train/43343426 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void prepareResponse() {
//get dh offset
int dhOffset = -1;
switch (validationScheme) {
case 1:
dhOffset = getDHOffset1();
break;
default:
log.debug("Scheme 0 will be used for DH offset");
case 0:
dhOffset = getDHOffset0();
}
//create keypair
KeyPair keys = generateKeyPair();
//get public key
byte[] publicKey = getPublicKey(keys);
//add to handshake bytes
System.arraycopy(publicKey, 0, handshakeBytes, dhOffset, 128);
}
COM: <s> gets the dh offset in the handshake bytes array based on validation scheme </s>
|
funcom_train/36168686 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void set(int pos) {
if (pos < 0) {
throw new IndexOutOfBoundsException(("K0006")); //$NON-NLS-1$
}
int len = (pos >> OFFSET) + 1;
if (len > bits.length) {
growLength(len);
}
bits[len - 1] |= TWO_N_ARRAY[pos & RIGHT_BITS];
if (len > actualArrayLength) {
actualArrayLength = len;
isLengthActual = true;
}
needClear();
}
COM: <s> sets the bit at index </s>
|
funcom_train/4757315 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Vector3D crossProduct(final Vector<Euclidean3D> v) {
final Vector3D v3 = (Vector3D) v;
return new Vector3D(MathUtils.linearCombination(y, v3.z, -z, v3.y),
MathUtils.linearCombination(z, v3.x, -x, v3.z),
MathUtils.linearCombination(x, v3.y, -y, v3.x));
}
COM: <s> compute the cross product of the instance with another vector </s>
|
funcom_train/4956533 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
switch(value) {
case CONNECT_BYTE:
return "CONNECT";
case GREET_BYTE:
return "GREET";
case MAIL_BYTE:
return "MAIL";
case RCPT_BYTE:
return "RCPT";
case DATA_HEADER_BYTE:
return "DATA_HDR";
case DATA_BODY_BYTE:
return "DATA_BODY";
case QUIT_BYTE:
return "QUIT";
default:
return "Unknown";
}
}
COM: <s> string representation of this smtp state </s>
|
funcom_train/44212527 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void onHistoryChanged(String _historyToken) {
if (Integer.parseInt(_historyToken) + 1 != historyToken) {
if (historyMap.get(_historyToken) != null) {
historyToken = Integer.parseInt(_historyToken);
todoList = (List) historyMap.get(_historyToken);
}
}
printTodoList();
}
COM: <s> this method is called whenever the applications history changes </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.