Datasets:
apcl
/

Modalities:
Text
Formats:
webdataset
Libraries:
Datasets
WebDataset
mcmillco commited on
Commit
e789b06
·
1 Parent(s): 21ff58e
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. funcom_test/10001320.txt +11 -0
  2. funcom_test/10001325.txt +13 -0
  3. funcom_test/10214587.txt +10 -0
  4. funcom_test/10215017.txt +15 -0
  5. funcom_test/10215277.txt +17 -0
  6. funcom_test/10216042.txt +28 -0
  7. funcom_test/10216064.txt +12 -0
  8. funcom_test/10216942.txt +14 -0
  9. funcom_test/10217229.txt +14 -0
  10. funcom_test/10217245.txt +15 -0
  11. funcom_test/10217907.txt +18 -0
  12. funcom_test/10218506.txt +19 -0
  13. funcom_test/10218943.txt +11 -0
  14. funcom_test/10219363.txt +14 -0
  15. funcom_test/10219398.txt +14 -0
  16. funcom_test/10221933.txt +10 -0
  17. funcom_test/10221965.txt +23 -0
  18. funcom_test/10222579.txt +10 -0
  19. funcom_test/10222898.txt +15 -0
  20. funcom_test/10223338.txt +13 -0
  21. funcom_test/10227347.txt +14 -0
  22. funcom_test/10228059.txt +17 -0
  23. funcom_test/10228096.txt +17 -0
  24. funcom_test/10228099.txt +17 -0
  25. funcom_test/10228107.txt +17 -0
  26. funcom_test/10228580.txt +12 -0
  27. funcom_test/10237254.txt +11 -0
  28. funcom_test/10237266.txt +11 -0
  29. funcom_test/10237358.txt +11 -0
  30. funcom_test/10262852.txt +17 -0
  31. funcom_test/10262853.txt +11 -0
  32. funcom_test/10262887.txt +15 -0
  33. funcom_test/10262922.txt +10 -0
  34. funcom_test/10263089.txt +18 -0
  35. funcom_test/10263190.txt +13 -0
  36. funcom_test/10263895.txt +12 -0
  37. funcom_test/10347019.txt +18 -0
  38. funcom_test/1046747.txt +15 -0
  39. funcom_test/1046774.txt +18 -0
  40. funcom_test/1046788.txt +13 -0
  41. funcom_test/1046802.txt +13 -0
  42. funcom_test/1046818.txt +18 -0
  43. funcom_test/10576200.txt +13 -0
  44. funcom_test/10576314.txt +14 -0
  45. funcom_test/10576712.txt +11 -0
  46. funcom_test/10576766.txt +20 -0
  47. funcom_test/10576888.txt +10 -0
  48. funcom_test/10576918.txt +16 -0
  49. funcom_test/10577072.txt +15 -0
  50. funcom_test/10577109.txt +15 -0
funcom_test/10001320.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: private void parse(Connection con, ByteBuffer buf) {
2
+ int sz = buf.getShort() & 0xFFFF;
3
+ sz -= 2;
4
+ ByteBuffer b = (ByteBuffer)buf.slice().limit(sz);
5
+ b.order(ByteOrder.LITTLE_ENDIAN);
6
+ buf.position(buf.position()+sz); // read message fully
7
+ con.decript(b);
8
+ con.addReceivedMsg(b);
9
+ }
10
+ COM: <s> parse received packet push a message into inbound queue </s>
11
+
funcom_test/10001325.txt ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: private void closeClient(Connection c) {
2
+ if (c.readBuffer != null) {
3
+ releaseBuffer(c.readBuffer);
4
+ c.readBuffer = null;
5
+ }
6
+ if (c.writeBuffer != null) {
7
+ releaseBuffer(c.writeBuffer);
8
+ c.writeBuffer = null;
9
+ }
10
+ try { c.close(); } catch (Exception dummy) {}
11
+ }
12
+ COM: <s> a helper method to close client if connection was </s>
13
+
funcom_test/10214587.txt ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: protected Document toDocument(String value) throws Exception {
2
+ org.apache.xerces.parsers.DOMParser parser = new org.apache.xerces.parsers.DOMParser();
3
+ parser.setFeature("http://xml.org/sax/features/namespaces", true);
4
+ StringReader reader = new StringReader(value);
5
+ parser.parse(new InputSource(reader));
6
+ reader.close();
7
+ return parser.getDocument();
8
+ }
9
+ COM: <s> convert xml string value to dom </s>
10
+
funcom_test/10215017.txt ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: private void updateUIFromDOMModel() {
2
+
3
+ // 1. Get DOM Document from DOM Model.
4
+ Document document = model.getDocument();
5
+
6
+ // 3. Update SWT Table with DOM list of shapes (rectangle, ellipse)
7
+ if (shapesTableViewer.getInput() == null)
8
+ // Input is not initialized, set it
9
+ shapesTableViewer.setInput(document);
10
+ else
11
+ // refresh SWT Table
12
+ shapesTableViewer.refresh();
13
+ }
14
+ COM: <s> update the ui from dom model </s>
15
+
funcom_test/10215277.txt ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: protected void addControllerErrorListener() {
2
+ ITkuiController controller = tkuiDocument.getController();
3
+ if (controller != null
4
+ && this.getContainer() instanceof ITkuiWizardContainer) {
5
+ final ITkuiWizardContainer tkuiContainer = (ITkuiWizardContainer) this
6
+ .getContainer();
7
+ final ITkuiWizardPage page = this;
8
+ controller
9
+ .addControllerErrorListener(new ITkuiControllerErrorListener() {
10
+ public void errorThrowed(Exception e) {
11
+ tkuiContainer.addControllerError(page, e);
12
+ }
13
+ });
14
+ }
15
+ }
16
+ COM: <s> add controller error listner to display icon with error when controller </s>
17
+
funcom_test/10216042.txt ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public void editElement(Object element, int column) {
2
+ if (cellEditor != null) {
3
+ applyEditorValue();
4
+ }
5
+
6
+ IStructuredSelection structuredSelection;
7
+ if (element instanceof TreePath) {
8
+ structuredSelection = new TreeSelection((TreePath) element, viewer
9
+ .getComparer());
10
+ } else {
11
+ structuredSelection = new StructuredSelection(element);
12
+ }
13
+ setSelection(structuredSelection, true);
14
+ Item[] selection = getSelection();
15
+ if (selection.length != 1) {
16
+ return;
17
+ }
18
+
19
+ treeItem = selection[0];
20
+
21
+ // Make sure selection is visible
22
+ showSelection();
23
+ columnNumber = column;
24
+ activateCellEditor();
25
+
26
+ }
27
+ COM: <s> start editing the given element </s>
28
+
funcom_test/10216064.txt ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: private void saveEditorValue(CellEditor cellEditor, Item treeItem) {
2
+ if (cellModifier != null) {
3
+ String property = null;
4
+ if (columnProperties != null
5
+ && columnNumber < columnProperties.length) {
6
+ property = columnProperties[columnNumber];
7
+ }
8
+ cellModifier.modify(treeItem, property, cellEditor.getValue(), columnNumber);
9
+ }
10
+ }
11
+ COM: <s> saves the value of the currently active cell editor by delegating to the </s>
12
+
funcom_test/10216942.txt ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public IMenuitem insertItemAt(int index, String label) {
2
+ IMenuitem menuitem = (IMenuitem) this.getOwnerDocument()
3
+ .createElementNS(XulConstants.XUL_NAMESPACE_URI,
4
+ XulConstants.MENUITEM_ELEMENT);
5
+ menuitem.setAttribute("label", label);
6
+ NodeList nodes = menupopup.getElementsByTagNameNS(
7
+ XulConstants.XUL_NAMESPACE_URI, XulConstants.MENUITEM_ELEMENT);
8
+ IMenuitem item = (IMenuitem) nodes.item(index);
9
+ menupopup.insertBefore(menuitem, item);
10
+ ((MenupopupImpl) menupopup).addComboItem(index, menuitem);
11
+ return menuitem;
12
+ }
13
+ COM: <s> creates a new menuitem element and inserts it at a specific position in </s>
14
+
funcom_test/10217229.txt ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public void setSharedVariables(Map variables) throws TemplateModelException {
2
+ if (variables != null) {
3
+ for (Iterator iter = variables.entrySet().iterator(); iter
4
+ .hasNext();) {
5
+ Map.Entry entry = (Map.Entry) iter.next();
6
+ String key = (String) entry.getKey();
7
+ Object value = entry.getValue();
8
+ super.setSharedVariable(key, value);
9
+ }
10
+
11
+ }
12
+ }
13
+ COM: <s> set shared variables </s>
14
+
funcom_test/10217245.txt ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public ITemplateEngine getTemplateEngine(String type) throws Exception {
2
+ // Get template engine defined into the Spring config
3
+ ITemplateEngine templateEngine = (ITemplateEngine) applicationContext
4
+ .getBean(type);
5
+ // Test if template engine have configuration ID
6
+ String configurationId = templateEngine.getConfigurationId();
7
+ if (!StringUtils.isEmpty(configurationId)) {
8
+ // Template engine works with Configuration, get it
9
+ ITemplateConfiguration configuration = getTemplateConfiguration(configurationId);
10
+ templateEngine.setConfiguration(configuration);
11
+ }
12
+ return templateEngine;
13
+ }
14
+ COM: <s> return template engine of type code type code </s>
15
+
funcom_test/10217907.txt ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: private Composite createComposite(Composite parent, int numColumns) {
2
+ Composite composite = new Composite(parent, SWT.NULL);
3
+
4
+ // GridLayout
5
+ GridLayout layout = new GridLayout();
6
+ layout.numColumns = numColumns;
7
+ layout.makeColumnsEqualWidth = false;
8
+ layout.marginHeight = 0;
9
+ layout.marginWidth = 0;
10
+ composite.setLayout(layout);
11
+
12
+ // GridData
13
+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
14
+ composite.setLayoutData(data);
15
+ return composite;
16
+ }
17
+ COM: <s> creates composite control and sets the default layout data </s>
18
+
funcom_test/10218506.txt ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: private EditPart getPartForElement(Object modelElement) {
2
+ if (modelElement instanceof Docflow) {
3
+ return new DocflowPart();
4
+ }
5
+ if (modelElement instanceof State) {
6
+ return new StatePart();
7
+ }
8
+ if (modelElement instanceof Transition) {
9
+ return new TransitionPart();
10
+ }
11
+ if (modelElement instanceof Connection) {
12
+ return new ConnectionPart();
13
+ }
14
+ throw new RuntimeException("Can't create part for model element: "
15
+ + ((modelElement != null) ? modelElement.getClass().getName()
16
+ : "null"));
17
+ }
18
+ COM: <s> maps an object to an edit part </s>
19
+
funcom_test/10218943.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public void saveColumnSettings() {
2
+ int columnCount = getTable().getColumnCount();
3
+ for (int i = 0; i < columnCount; i++) {
4
+ getDialogSettings()
5
+ .put(
6
+ getQualifier() + ".columnWidth" + i, getTable().getColumn(i).getWidth()); //$NON-NLS-1$
7
+ }
8
+ getDialogSettings().put(getQualifier() + ".sortColumn", fSortColumn); //$NON-NLS-1$
9
+ }
10
+ COM: <s> persist table settings into the give dialog store prefixed with the </s>
11
+
funcom_test/10219363.txt ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: private SearchPatternData getPatternData() {
2
+ SearchPatternData match = findInPrevious(xpathCombo.getText());
3
+ if (match != null) {
4
+ fPreviousSearchPatterns.remove(match);
5
+ }
6
+ match = new SearchPatternData(getXPath(), getXPathProcessorId(),
7
+ fFileTypeEditor.getFileTypes(), getContainer()
8
+ .getSelectedScope(), getContainer()
9
+ .getSelectedWorkingSets());
10
+ fPreviousSearchPatterns.add(0, match);
11
+ return match;
12
+ }
13
+ COM: <s> return search pattern data and update previous searches </s>
14
+
funcom_test/10219398.txt ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public void reset() throws XFormsException {
2
+ if (logger.isDebugEnabled()) {
3
+ logger.debug(this + " perform reset");
4
+ }
5
+ // recreate instance document
6
+ this.instanceDocument = createInstanceDocument();
7
+ // notify to another elements (UI or DOM) whcih are bounded
8
+ // with this instance that the instanceDocument to observe
9
+ // has changed.
10
+ rootNodeObservable.setRootNode(this.instanceDocument);
11
+
12
+ }
13
+ COM: <s> performs element reset </s>
14
+
funcom_test/10221933.txt ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public void setDecorationBounds(int x, int y, int w, int h) {
2
+ if (this.bounds == null) {
3
+ this.bounds = new Rectangle(x, y, w, h);
4
+ } else {
5
+ this.bounds.setBounds(x, y, w, h);
6
+ }
7
+ synch();
8
+ }
9
+ COM: <s> change the current decorated bounds </s>
10
+
funcom_test/10221965.txt ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: protected void fillTextareaWithStyleSheetContent(InputStream stream) {
2
+ try {
3
+ StringWriter writer = new StringWriter();
4
+ InputStreamReader streamReader = new InputStreamReader(stream);
5
+ BufferedReader buffer = new BufferedReader(streamReader);
6
+ String line = "";
7
+ boolean b = false;
8
+ while (null != (line = buffer.readLine())) {
9
+ if (b)
10
+ writer.write("\n");
11
+ writer.write(line);
12
+ b = true;
13
+ }
14
+ buffer.close();
15
+ streamReader.close();
16
+ String content = writer.toString();
17
+ setStyleSheetContent(content);
18
+ } catch (Exception e) {
19
+ handleExceptions(e);
20
+ }
21
+ }
22
+ COM: <s> fill the text area which store the style sheet content with the </s>
23
+
funcom_test/10222579.txt ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public boolean equals(Object obj) {
2
+ if (obj == null || (obj.getClass() != getClass())) {
3
+ return false;
4
+ }
5
+ CSSConditionalSelectorImpl s = (CSSConditionalSelectorImpl)obj;
6
+ return (s.simpleSelector.equals(simpleSelector) &&
7
+ s.condition.equals(condition));
8
+ }
9
+ COM: <s> indicates whether some other object is equal to this one </s>
10
+
funcom_test/10222898.txt ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public CSSStyleDeclaration getComputedStyle(Element elt, String pseudoElt) {
2
+ // Loop for CSS StyleSheet list parsed
3
+ StyleSheetList styleSheetList = documentCSS.getStyleSheets();
4
+ int l = styleSheetList.getLength();
5
+ for (int i = 0; i < l; i++) {
6
+ CSSStyleSheet styleSheet = (CSSStyleSheet) styleSheetList.item(i);
7
+ CSSStyleDeclaration styleDeclaration = getComputedStyle(styleSheet,
8
+ elt, pseudoElt);
9
+ if (styleDeclaration != null)
10
+ return styleDeclaration;
11
+ }
12
+ return null;
13
+ }
14
+ COM: <s> b dom b implements </s>
15
+
funcom_test/10223338.txt ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: protected String getHandlerClassName(String property) {
2
+ String handlerClassName = "CSSProperty";
3
+ String[] s = StringUtils.split(property, "-");
4
+ for (int i = 0; i < s.length; i++) {
5
+ String p = s[i];
6
+ p = p.substring(0, 1).toUpperCase() + p.substring(1, p.length());
7
+ handlerClassName += p;
8
+ }
9
+ handlerClassName += "Handler";
10
+ return handlerClassName;
11
+ }
12
+ COM: <s> return the handler class name corresponding to the property label given </s>
13
+
funcom_test/10227347.txt ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public Command getCommand(Request request) {
2
+ if (request instanceof ReconnectRequest) {
3
+ Object view = ((ReconnectRequest) request).getConnectionEditPart()
4
+ .getModel();
5
+ if (view instanceof View) {
6
+ Integer id = new Integer(ModelVisualIDRegistry
7
+ .getVisualID((View) view));
8
+ request.getExtendedData().put(VISUAL_ID_KEY, id);
9
+ }
10
+ }
11
+ return super.getCommand(request);
12
+ }
13
+ COM: <s> extended request data key to hold editpart visual id </s>
14
+
funcom_test/10228059.txt ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: protected void addReturnValuePropertyDescriptor(Object object) {
2
+ itemPropertyDescriptors.add
3
+ (createItemPropertyDescriptor
4
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
5
+ getResourceLocator(),
6
+ getString("_UI_Operation_returnValue_feature"),
7
+ getString("_UI_PropertyDescriptor_description", "_UI_Operation_returnValue_feature", "_UI_Operation_type"),
8
+ ModelPackage.Literals.OPERATION__RETURN_VALUE,
9
+ false,
10
+ false,
11
+ false,
12
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
13
+ null,
14
+ null));
15
+ }
16
+ COM: <s> this adds a property descriptor for the return value feature </s>
17
+
funcom_test/10228096.txt ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: protected void addIsInPropertyDescriptor(Object object) {
2
+ itemPropertyDescriptors.add
3
+ (createItemPropertyDescriptor
4
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
5
+ getResourceLocator(),
6
+ getString("_UI_Parameter_isIn_feature"),
7
+ getString("_UI_PropertyDescriptor_description", "_UI_Parameter_isIn_feature", "_UI_Parameter_type"),
8
+ ModelPackage.Literals.PARAMETER__IS_IN,
9
+ false,
10
+ false,
11
+ false,
12
+ ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
13
+ null,
14
+ null));
15
+ }
16
+ COM: <s> this adds a property descriptor for the is in feature </s>
17
+
funcom_test/10228099.txt ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: protected void addIsOutPropertyDescriptor(Object object) {
2
+ itemPropertyDescriptors.add
3
+ (createItemPropertyDescriptor
4
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
5
+ getResourceLocator(),
6
+ getString("_UI_Parameter_isOut_feature"),
7
+ getString("_UI_PropertyDescriptor_description", "_UI_Parameter_isOut_feature", "_UI_Parameter_type"),
8
+ ModelPackage.Literals.PARAMETER__IS_OUT,
9
+ false,
10
+ false,
11
+ false,
12
+ ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
13
+ null,
14
+ null));
15
+ }
16
+ COM: <s> this adds a property descriptor for the is out feature </s>
17
+
funcom_test/10228107.txt ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: protected void addReferencedInstancesPropertyDescriptor(Object object) {
2
+ itemPropertyDescriptors.add
3
+ (createItemPropertyDescriptor
4
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
5
+ getResourceLocator(),
6
+ getString("_UI_Instance_referencedInstances_feature"),
7
+ getString("_UI_PropertyDescriptor_description", "_UI_Instance_referencedInstances_feature", "_UI_Instance_type"),
8
+ ModelPackage.Literals.INSTANCE__REFERENCED_INSTANCES,
9
+ true,
10
+ false,
11
+ true,
12
+ null,
13
+ null,
14
+ null));
15
+ }
16
+ COM: <s> this adds a property descriptor for the referenced instances feature </s>
17
+
funcom_test/10228580.txt ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public boolean equal(InputStream xml1, InputStream xml2) throws SAXException, IOException {
2
+ DOMParser parser1 = new DOMParser();
3
+ DOMParser parser2 = new DOMParser();
4
+ parser1.parse(new InputSource(xml1));
5
+ parser2.parse(new InputSource(xml2));
6
+ Document doc1 = parser1.getDocument();
7
+ Document doc2 = parser2.getDocument();
8
+
9
+ return compareNodes(doc1.getDocumentElement(), doc2.getDocumentElement());
10
+ }
11
+ COM: <s> performs the comparison of 2 xml files </s>
12
+
funcom_test/10237254.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public void eventPerfomed(FelperEvent event) {
2
+ if (event instanceof FelperMessageReceiveEvent) {
3
+ FelperMessageReceiveEvent newFelperMessageReceiveEvent = (FelperMessageReceiveEvent) event;
4
+
5
+ if(logger.isDebugEnabled())
6
+ logger.debug("Receive Event: " + newFelperMessageReceiveEvent + " with Message " +
7
+ newFelperMessageReceiveEvent.getMessage());
8
+ }
9
+ }
10
+ COM: <s> receive event and process it </s>
11
+
funcom_test/10237266.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public void removeUser(User removableUser) throws FelperUserAddRemoveOperationException{
2
+ if (this.users.remove(removableUser)) {
3
+ if(logger.isDebugEnabled())
4
+ logger.debug("User is Removed: " + removableUser);
5
+ } else {
6
+ logger.warn("Can`t remove user: " + removableUser);
7
+ throw new FelperUserAddRemoveOperationException("Can`t remove user: " + removableUser);
8
+ }
9
+ }
10
+ COM: <s> remove user and resize users array </s>
11
+
funcom_test/10237358.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public void sendMessageToPeer(UserConnection userConnection, Message message) throws FelperNotSentMessageException {
2
+
3
+ SendMessageThread sendMessageThread = new SendMessageThread(userConnection, message);
4
+ sendMessageThread.start();
5
+
6
+ if (sendMessageThread.isInterrupted())
7
+ throw new FelperNotSentMessageException();
8
+
9
+ }
10
+ COM: <s> send message to peer </s>
11
+
funcom_test/10262852.txt ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: private boolean vectorsToNearestCentroid() {
2
+ boolean converged = true;
3
+ for (int i = 0; i < vectors.size(); ++i) {
4
+ // Find centroid closest to current vector.
5
+ int nearest = vectors.get(i).nearest(centroids);
6
+
7
+ // If there was a change then there is no convergence.
8
+ if (nearest != nearestCentroid[i]) {
9
+ converged = false;
10
+ }
11
+ nearestCentroid[i] = nearest;
12
+ }
13
+ updateNearestNeighbours();
14
+ return converged;
15
+ }
16
+ COM: <s> assign vectors to nearest centroid </s>
17
+
funcom_test/10262853.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: private void updateNearestNeighbours() {
2
+ for (List<V> nn : nearestNeighbours) {
3
+ nn.clear();
4
+ }
5
+ for (int i = 0; i < nearestCentroid.length; ++i) {
6
+ int nearest = nearestCentroid[i];
7
+ nearestNeighbours.get(nearest).add(vectors.get(i));
8
+ }
9
+ }
10
+ COM: <s> pre nearest centroid has been updated with nearest indexes </s>
11
+
funcom_test/10262887.txt ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public double sumSquaredError(V parentEntry) {
2
+ double distance = 0.0;
3
+ if (isLeaf()) {
4
+ for (V key : keys) {
5
+ distance += key.distanceSquared(parentEntry);
6
+ }
7
+ } else {
8
+ for (int i = 0; i < count(); ++i) {
9
+ distance += children.get(i).sumSquaredError(keys.get(i));
10
+ }
11
+ }
12
+ return distance;
13
+ }
14
+ COM: <s> calculate sum of squared error between vecotrs in leaves and their </s>
15
+
funcom_test/10262922.txt ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: private void updateMean(V parentEntry) {
2
+ assert (!isLeaf());
3
+ int[] weights = new int[count()];
4
+ for (int iChild = 0; iChild < count(); ++iChild) {
5
+ weights[iChild] = children.get(iChild).totalCount;
6
+ }
7
+ parentEntry.updateMean(keys, weights);
8
+ }
9
+ COM: <s> update the means entries based on child entries 1 level down the tree </s>
10
+
funcom_test/10263089.txt ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: private boolean vectorsToNearestCentroid() {
2
+ boolean converged = true;
3
+
4
+ for (int i = 0; i < data.size(); ++i) {
5
+ // Find centroid closest to current vector.
6
+ int nearest = data.get(i).nearest(centroids);
7
+
8
+ // If there was a change then there is no convergence.
9
+ if (nearest != nearestCentroid[i]) {
10
+ converged = false;
11
+ }
12
+ nearestCentroid[i] = nearest;
13
+ }
14
+
15
+ return converged;
16
+ }
17
+ COM: <s> pre set data </s>
18
+
funcom_test/10263190.txt ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: private void remove(int index) {
2
+ assert(!isLeaf());
3
+ totalCount -= children[index].totalCount;
4
+ for (int i = index + 1; i < count; ++i) {
5
+ entries[i - 1] = entries[i];
6
+ children[i - 1] = children[i];
7
+ }
8
+ entries[count - 1] = null;
9
+ children[count - 1] = null;
10
+ --count;
11
+ }
12
+ COM: <s> remove a entry child pair </s>
13
+
funcom_test/10263895.txt ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: private float distortion(Vector[] currCentroids) {
2
+ // currently inefficient
3
+ // cost could be calculated when determining nearest centroids
4
+ float cost = 0.0f;
5
+ int[] nearestCentroids = vectorsToNearestCentroid(currCentroids);
6
+ for (int i = 0; i < vectorCount; ++i) {
7
+ cost += vectors[i].distance(currCentroids[nearestCentroids[i]]);
8
+ }
9
+ return cost;
10
+ }
11
+ COM: <s> sum of distances to nearest centroid </s>
12
+
funcom_test/10347019.txt ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: protected void insertContent(Element element, Component component, Method method) {
2
+
3
+ ResourceManager resourceManager = this.usiXMLInterfaceRenderer.resourceRetriever;
4
+ String resourceContent = resourceManager.getStringResourceContent(element);
5
+
6
+ try {
7
+ method.invoke(component, resourceContent);
8
+ } catch (IllegalArgumentException e) {
9
+ e.printStackTrace();
10
+ } catch (IllegalAccessException e) {
11
+ e.printStackTrace();
12
+ } catch (InvocationTargetException e) {
13
+ e.printStackTrace();
14
+ }
15
+
16
+ }
17
+ COM: <s> inserts static content in a specific ui element </s>
18
+
funcom_test/1046747.txt ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: protected TilesContainer createTilesContainer() throws TilesException {
2
+ ServletContextAdapter adaptedContext = new ServletContextAdapter(
3
+ new DelegatingServletConfig());
4
+ TilesApplicationContext preliminaryContext = new ServletTilesApplicationContext(
5
+ adaptedContext);
6
+ AbstractTilesApplicationContextFactory contextFactory = AbstractTilesApplicationContextFactory
7
+ .createFactory(preliminaryContext);
8
+ this.tilesContext = contextFactory
9
+ .createApplicationContext(adaptedContext);
10
+ AbstractTilesContainerFactory factory = AbstractTilesContainerFactory
11
+ .getTilesContainerFactory(this.tilesContext);
12
+ return factory.createContainer(this.tilesContext);
13
+ }
14
+ COM: <s> create a tiles container for this web application </s>
15
+
funcom_test/1046774.txt ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public void testDeleteBlobDataType() {
2
+ // 1. insert init data
3
+ insertBlobDataType();
4
+
5
+ // 2. select a blobDataType data
6
+ BlobDataType blobDataType = (BlobDataType) session.get(
7
+ BlobDataType.class, new Integer(4491));
8
+
9
+ // 3. remove data
10
+ session.delete(blobDataType);
11
+
12
+ // 4. check if deletion is successful
13
+ blobDataType = (BlobDataType) session.get(BlobDataType.class,
14
+ new Integer(4491));
15
+ assertNull(blobDataType);
16
+ }
17
+ COM: <s> flow 3 positive case blob type entity </s>
18
+
funcom_test/1046788.txt ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public void testAddCountryWithSequenceGenerator() throws Exception {
2
+ CountryWithSequence country1 = new CountryWithSequence();
3
+ country1.setCountryId("KR");
4
+ country1.setCountryName("Korea");
5
+
6
+ Integer countryCode = (Integer) session.save(country1);
7
+ assertEquals("fail to generate a new countryCode.", 0, countryCode
8
+ .intValue());
9
+ assertNotNull("fail to add a new country with sequence generator.",
10
+ countryCode);
11
+ }
12
+ COM: <s> flow 2 positive case hibernate sequence generator </s>
13
+
funcom_test/1046802.txt ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public void testAddCountryWithUUIDGenerator() throws Exception {
2
+ CountryWithUUID country1 = new CountryWithUUID();
3
+ country1.setCountryId("KR");
4
+ country1.setCountryName("대한민국");
5
+
6
+ String countryCode = (String) session.save(country1);
7
+ assertTrue("fail to generate a new countryCode.", countryCode
8
+ .indexOf("#") != -1);
9
+ assertNotNull("fail to add a new country with UUID generator.",
10
+ countryCode);
11
+ }
12
+ COM: <s> flow 6 positive case hibernate uuid generator country </s>
13
+
funcom_test/1046818.txt ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public void testDeleteClobDataType() {
2
+ // 1. insert init data
3
+ insertClobDataType();
4
+
5
+ // 2. select a clobDataType data
6
+ ClobDataType clobDataType = (ClobDataType) session.get(
7
+ ClobDataType.class, new Integer(4491));
8
+
9
+ // 3. remove data
10
+ session.delete(clobDataType);
11
+
12
+ // 4. check if deletion is successful
13
+ clobDataType = (ClobDataType) session.get(ClobDataType.class,
14
+ new Integer(4491));
15
+ assertNull(clobDataType);
16
+ }
17
+ COM: <s> flow 3 positive case clob type entity </s>
18
+
funcom_test/10576200.txt ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: protected void cleanup(ChannelHandlerContext ctx) {
2
+ // Make sure we dispose everything on exit on session close
3
+ SMTPSession smtpSession = (SMTPSession) ctx.getAttachment();
4
+
5
+ if (smtpSession != null) {
6
+ LifecycleUtil.dispose(smtpSession.getState().get(SMTPConstants.MAIL));
7
+ LifecycleUtil.dispose(smtpSession.getState().get(SMTPConstants.DATA_MIMEMESSAGE_STREAMSOURCE));
8
+ }
9
+
10
+ super.cleanup(ctx);
11
+ }
12
+ COM: <s> cleanup temporary files </s>
13
+
funcom_test/10576314.txt ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: static protected String hostFromUriStr(String uriStr) {
2
+ debugOut("hostFromUriStr(\"" + uriStr + "\")");
3
+ String host = null;
4
+ URI uri;
5
+ try {
6
+ uri = new URI(uriStr);
7
+ host = uri.getHost();
8
+ } catch (URISyntaxException e) {
9
+ debugOut(e.getMessage());
10
+ }
11
+ return host;
12
+ }
13
+ COM: <s> extracts and returns the host portion of uri string </s>
14
+
funcom_test/10576712.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public void testInetAddress() throws UnknownHostException {
2
+
3
+ // Test name alone (can be IPv4 or IPv6 depending on the OS plaform
4
+ // configuration).
5
+ address = InetAddress.getByName("localhost");
6
+ assertEquals(true, address instanceof InetAddress);
7
+ assertEquals(true, address.toString().contains("localhost"));
8
+
9
+ }
10
+ COM: <s> preliminary test method to validate the inet address behaviour v4 and v6 </s>
11
+
funcom_test/10576766.txt ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public void testHasCorrectArguments() {
2
+ CmdType cmd;
3
+ boolean result;
4
+
5
+ cmd = CmdType.ADDDOMAIN;
6
+
7
+ // Test bogus number
8
+ result = cmd.hasCorrectArguments(-1);
9
+ assertEquals(false, result);
10
+
11
+ // Test actual number
12
+ result = cmd.hasCorrectArguments(cmd.getArguments());
13
+ assertEquals(true, result);
14
+
15
+ // Test known bad number
16
+ result = cmd.hasCorrectArguments(cmd.getArguments() - 1);
17
+ assertEquals(false, result);
18
+ }
19
+ COM: <s> test the has correct arguments method </s>
20
+
funcom_test/10576888.txt ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: private Date getLastUpdated(Node node) throws RepositoryException {
2
+ try {
3
+ node = node.getNode("jcr:content");
4
+ } catch (PathNotFoundException e) {
5
+ node = node.getProperty("jcr:content").getNode();
6
+ }
7
+ return node.getProperty("jcr:lastModified").getDate().getTime();
8
+ }
9
+ COM: <s> reads the update timestamp from the </s>
10
+
funcom_test/10576918.txt ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: public String getRealName(String name, boolean ignoreCase) throws UsersRepositoryException {
2
+ if (ignoreCase) {
3
+ Iterator<String> it = list();
4
+ while (it.hasNext()) {
5
+ String temp = it.next();
6
+ if (name.equalsIgnoreCase(temp)) {
7
+ return temp;
8
+ }
9
+ }
10
+ return null;
11
+ } else {
12
+ return objectRepository.containsKey(name) ? name : null;
13
+ }
14
+ }
15
+ COM: <s> return the real name given the ignore case boolean parameter </s>
16
+
funcom_test/10577072.txt ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: protected void rejectRemoteRecipient(MailAddress recipient) throws MessagingException {
2
+ // Update the flags of the received message
3
+ if (!isLeaveRemoteRecipient())
4
+ setMessageDeleted();
5
+
6
+ if (isMarkRemoteRecipientSeen())
7
+ setMessageSeen();
8
+
9
+ StringBuilder messageBuffer = new StringBuilder("Rejected mail intended for remote recipient: ");
10
+ messageBuffer.append(recipient);
11
+ messageBuffer.append('.');
12
+ logStatusInfo(messageBuffer.toString());
13
+ }
14
+ COM: <s> method reject remote recipient </s>
15
+
funcom_test/10577109.txt ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TDAT: protected void rejectUserUndefined(MailAddress recipient) throws MessagingException {
2
+ // Update the flags of the received message
3
+ if (!isLeaveUserUndefined())
4
+ setMessageDeleted();
5
+
6
+ if (isMarkUserUndefinedSeen())
7
+ setMessageSeen();
8
+
9
+ StringBuilder messageBuffer = new StringBuilder("Rejected mail intended for undefined user: ");
10
+ messageBuffer.append(recipient);
11
+ messageBuffer.append('.');
12
+ logStatusInfo(messageBuffer.toString());
13
+ }
14
+ COM: <s> method reject user undefined </s>
15
+