__key__ stringlengths 16 21 | __url__ stringclasses 1 value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/26207756 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setDomain(double value, int inx) throws IllegalArgumentException {
if (inx < 0 || inx > (VECMAX - 1))
throw new IllegalArgumentException(
getQualifiedName() + " invalid index for domain " + inx);
synchronized (domain) {
domain[inx]= value;
}
setChanged();
}
COM: <s> inject an arbitrary value into the domain array </s>
|
funcom_train/12161874 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testNullHref() throws Exception {
// Create the menu item to test.
ConcreteMenuItem item = new ConcreteMenuItem(
new ElementDetailsStub(), new MenuLabelStub());
item.setHref(new LiteralLinkAssetReference(null));
item.setShortcut(new LiteralTextAssetReference("the shortcut"));
// Check that the renderer did not open any output.
checkUnopened(item);
}
COM: <s> test rendering of an external link with no href </s>
|
funcom_train/32055897 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void redirect() {
stdout = System.out;
stderr = System.err;
System.setOut(new JTextAreaOutputStream(stdoutText, stdout, true));
// System.out.println("Standard out has been re-directed");
System.setErr(new JTextAreaOutputStream(stderrText, stderr, true));
// System.err.println("Standard error has been re-directed");
}
COM: <s> redirects the new output stream for system </s>
|
funcom_train/37578119 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void paint(Graphics g) {
g.setColor(0xFFFFFF);
g.fillRect(0, 0, getWidth(), getHeight());
g.translate(translateX, translateY);
g.drawImage(image, 0, 0, g.TOP|g.LEFT);
locationPointer.paint(g);
}
COM: <s> paint the canvas </s>
|
funcom_train/40793923 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Ticker getMessageTicker() {
if (messageTicker == null) {//GEN-END:|186-getter|0|186-preInit
// write pre-init user code here
messageTicker = new Ticker("");//GEN-LINE:|186-getter|1|186-postInit
}//GEN-BEGIN:|186-getter|2|
return messageTicker;
}
COM: <s> returns an initiliazed instance of message ticker component </s>
|
funcom_train/49637771 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void waitForThreads() {
long endTime = System.currentTimeMillis() + THREADTIMEOUT;
while (System.currentTimeMillis() < endTime && threads.size() > 0) {
try {
wait(10);
} catch (InterruptedException e) {
// Ignore, as we are just waiting
}
}
}
COM: <s> wait for the polling threads to finish </s>
|
funcom_train/3926511 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: static public void setProgressIndicator( ProgressIndicator pi, String title, int total ) {
progressIndicator = pi;
if ( progressIndicator != null ) {
progressIndicator.setTitle( title );
}
totalItems = total;
currentItem = 0;
lastPercent = 0;
if ( pi != null ) {
pi.reset();
}
}
COM: <s> assign a global progress indicator </s>
|
funcom_train/1208571 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Iterator getJavaIterator(Context cx, Scriptable scope, Object obj) {
if (obj instanceof Wrapper) {
Object unwrapped = ((Wrapper) obj).unwrap();
Iterator iterator = null;
if (unwrapped instanceof Iterator)
iterator = (Iterator) unwrapped;
if (unwrapped instanceof Iterable)
iterator = ((Iterable)unwrapped).iterator();
return iterator;
}
return null;
}
COM: <s> if obj is a java </s>
|
funcom_train/46736565 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setFacilityLocationRef(DisplayModel facilityLocationRef) {
if (Converter.isDifferent(this.facilityLocationRef, facilityLocationRef)) {
DisplayModel oldfacilityLocationRef= new DisplayModel(this);
oldfacilityLocationRef.copyAllFrom(this.facilityLocationRef);
this.facilityLocationRef.copyAllFrom(facilityLocationRef);
setModified("facilityLocationRef");
firePropertyChange(String.valueOf(FORMS_FACILITYLOCATIONREFID), oldfacilityLocationRef, facilityLocationRef);
}
}
COM: <s> facility owning this document </s>
|
funcom_train/25093432 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Process startProcessAndConsumer(IConsumer consumer) throws IOException{
try{
setExecutableFlagIfPossible(executable);
} catch (Exception e) {
e.printStackTrace();
}
// redirect stderr to stdout
pb.redirectErrorStream(true);
// start process
Process p = pb.start();
// start consumer thread for stdout
UnbufferedStreamConsumer outHandler = new UnbufferedStreamConsumer(p.getInputStream(), consumer);
Thread consumerThread = new Thread(outHandler, "UnbufferedStreamConsumer-" + ++no);
consumerThread.start();
return p;
}
COM: <s> sets the executable flag if possible combines stdout and stderr </s>
|
funcom_train/3561575 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Dimension getInitialDimension(int numComponent) throws IndexOutOfBoundsException {
if (numComponent >= 0 && numComponent < initialDimensions.size())
return new Dimension((Dimension) initialDimensions.get(numComponent));
else
throw new IndexOutOfBoundsException("Component number not valid!");
}
COM: <s> returns initial dimension of a component </s>
|
funcom_train/11005811 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PPFont getFont(int idx) {
PPFont font = null;
FontCollection fonts = getDocumentRecord().getEnvironment().getFontCollection();
Record[] ch = fonts.getChildRecords();
for (int i = 0; i < ch.length; i++) {
if (ch[i] instanceof FontEntityAtom) {
FontEntityAtom atom = (FontEntityAtom) ch[i];
if (atom.getFontIndex() == idx) {
font = new PPFont(atom);
break;
}
}
}
return font;
}
COM: <s> get a font by index </s>
|
funcom_train/4286465 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addPagesPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_AccessData_pages_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_AccessData_pages_feature", "_UI_AccessData_type"),
OrmUsageProfilePackage.Literals.ACCESS_DATA__PAGES,
true,
false,
false,
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the pages feature </s>
|
funcom_train/31077207 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeSceneListener(SceneGraphObjectListener l) {
this.sceneListeners.remove(SceneGraphObjectListener.class, l);
/* the lister "l" might have a reference of this object.
so, remove it!
*/
if (l instanceof Proxy) {
InvocationHandler handler = Proxy.getInvocationHandler(l);
Object target = AdapterHandler.getTarget(handler);
detachSceneFrom(target);
}
}
COM: <s> removes an geometry listener from the shape </s>
|
funcom_train/18218208 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addNPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_QualityModel_n_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_QualityModel_n_feature", "_UI_QualityModel_type"),
QualityModelPackage.Literals.QUALITY_MODEL__N,
true,
false,
false,
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the n feature </s>
|
funcom_train/5666754 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setStringValue(editablestring originalText)
{
editableText = originalText;
area.setText(editableText.getStringValue());
JViewport port = scroll.getViewport();
if (port != null)
port.setViewPosition(new Point(0,0));
else
System.out.println("NULL VIEWPORT");
}
COM: <s> sets the attribute value in the text area of the attribute editor </s>
|
funcom_train/50938002 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean definesMatchingVariable(String p) {
if (this instanceof SymbolTable) {
for (Iterator i = symbols.values().iterator();i.hasNext();) {
Variable v = (Variable)i.next();
if (v.matches(p)) return true;
}
}
SymbolTable parent = getParentSymbolTable();
if (parent != null)
return parent.definesMatchingVariable(p);
else
return false;
}
COM: <s> answers whether a variable whose name matches the pattern exists at any level </s>
|
funcom_train/25503255 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean validate(ByteBuffer buffer) {
boolean valid = false;
if (buffer != null && this.size <= buffer.remaining()) {
valid = true;
buffer.order(order());
for (int attributeIndex = 0; attributeIndex < this.attributes.length && valid; attributeIndex++) {
if (!(valid = this.attributes[attributeIndex].validate(buffer))) {
break;
}
}
}
return valid;
}
COM: <s> validate read data against this structure </s>
|
funcom_train/28298504 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean checkSelection(TransBaseMap map, int x, int y) {
if (map!=null) {
TransBaseSelection oldSel=map.getSelection();
TransBaseSelection sel=map.getSelection(x,y);
if (sel!=null || (sel==null && oldSel!=null)) return true;
}
return false;
}
COM: <s> checks if something on the map is selected </s>
|
funcom_train/3434027 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(Object obj) {
if (this == obj)
return true;
if (!(obj instanceof OSFCodeSetRegistry.Entry))
return false;
OSFCodeSetRegistry.Entry other
= (OSFCodeSetRegistry.Entry)obj;
return (javaName.equals(other.javaName) &&
encodingNum == other.encodingNum &&
isFixedWidth == other.isFixedWidth &&
maxBytesPerChar == other.maxBytesPerChar);
}
COM: <s> first checks reference equality since its expected </s>
|
funcom_train/31362262 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void flush() {
int bsize = bout.size();
if (bsize > 0) {
if (size > buffer.length) increaseCapacity(size);
System.arraycopy(bout.toByteArray(), 0, buffer, size - bsize, bsize);
bout.reset();
}
}
COM: <s> flush data from the backing up stream into the byte buffer </s>
|
funcom_train/22287658 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void schedule(long delayMillis) {
if (delayMillis <= 0 || delayMillis >= MAX_PERIOD) {
throw new IllegalArgumentException("must be positive and less than "
+ MAX_PERIOD);
}
cancel();
isRepeating = false;
timerId = createTimeout(this, delayMillis);
timers.add(this);
}
COM: <s> schedules a timer to elapse in the future </s>
|
funcom_train/4639804 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getPrivilegedID() {
String privilegedID = _cookies.readCookieValue(SESSION_PID);
//Still null, so no request, or no cookie
if (privilegedID == null) {
privilegedID = Long.toString(Math.round(Math.random() * Long.MAX_VALUE), 16); //Terribly unsafe, but at least provides some measure of uniqueness
_cookies.writeCookieValue(SESSION_PID, privilegedID);
}
return privilegedID;
}
COM: <s> this implementation generates a relatively unique char sequence in order to allow </s>
|
funcom_train/13749915 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setVerticalBarGraph(boolean narrow, int column, int height) throws IOException{
_BUFFER[0] = 254;
_BUFFER[1] = (char)(narrow ? 115 : 118);
capture();
start();
write(_BUFFER, 2);
// initialize the h bar graph
//stop();
_BUFFER[0] = 254;
_BUFFER[1] = 61;
_BUFFER[2] = (char)column;
_BUFFER[3] = (char)height;
start();
write(_BUFFER, 4);
// draw the h bar graph
stop();
release();
}
COM: <s> sets the vertical bar graph attribute of the lcd0821 object </s>
|
funcom_train/4026057 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void initialize(ParseHandler ch, ObjectsTable ot) {
if( ch == null ) {
throw new IllegalArgumentException("parseHandler cannot be null");
}
if( ot == null ) {
throw new IllegalArgumentException("ot cannot be null");
}
parseHandler = ch;
objectsTable = ot;
}
COM: <s> initializes the parser with the given parse handler and objects table </s>
|
funcom_train/10659760 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSaslException04() {
SaslException tE = new SaslException(null, null);
assertNull("getMessage() must return null", tE.getMessage());
assertNull("getCause() must return null", tE.getCause());
}
COM: <s> test for code sasl exception string detail throwable ex code constructor </s>
|
funcom_train/31467930 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object visit(ConditionalExpression node) {
if (node.hasProperty(NodeProperties.VALUE)) {
// The expression is constant
return node.getProperty(NodeProperties.VALUE);
} else {
Boolean b = (Boolean)node.getConditionExpression().acceptVisitor(this);
if (b.booleanValue()) {
return node.getIfTrueExpression().acceptVisitor(this);
} else {
return node.getIfFalseExpression().acceptVisitor(this);
}
}
}
COM: <s> visits a conditional expression </s>
|
funcom_train/33395765 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int searchAnswers(String s){
int total = 0;
Iterator<Answer> i = answers.iterator();
while(i.hasNext()){
Answer a = i.next();
if(s.compareTo(a.getAnswer())==0){
total++;
}
}
return total;
}
COM: <s> searchs for the answers in the arraylist </s>
|
funcom_train/5157975 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public UrlSearchResults urlSearch(UrlSearchRequest request) throws IOException, MyWeb2Exception {
request.getParameters().put(APPID_KEY, appId);
Map results = executeAndParse(request.getRequestUrl(), request.getParameters());
return new XmlParserUrlSearchResults(results);
}
COM: <s> allows you to search for urls that have been tagged by particular tags </s>
|
funcom_train/6475967 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ArrayList getPlatformSpecificAgentNames() {
Agent agent = null;
ArrayList list = new ArrayList();
for (int i = 0; i < agents.size(); i++) {
agent = (Agent) agents.get(i);
if (agent.getName().indexOf('@') > -1) {
list.add(agent.getName());
}
}
return list;
}
COM: <s> returns a list of strings that represent the agents that have platform </s>
|
funcom_train/18136667 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName() == Specification.ROOT_WORKFLOW_ID_FIELD) {
specificationTree.repaint();
} else if (evt.getPropertyName() == Workflow.NAME_FIELD
&& evt.getSource() instanceof Workflow) {
specificationTree.repaint();
} else if (evt.getPropertyName() == Specification.WORKFLOWS_FIELD) {
specificationTree.repaint();
}
}
COM: <s> method for repainting the tree if the root workflow is changed </s>
|
funcom_train/4780074 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getFormNamePanel() {
if (formNamePanel == null) {
formNamePanel = new JPanel(new FlowLayout());
JLabel label = new JLabel(ResourceUtil.getString(type + ".label"));
label.setHorizontalAlignment(JLabel.RIGHT);
label.setPreferredSize(new Dimension(100, 15));
formNamePanel.add(label);
formNamePanel.add(getNameText());
}
return formNamePanel;
}
COM: <s> this method initializes form name panel </s>
|
funcom_train/5374502 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void add (int[] pointArray) {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
/*
if (OS.IsWinCE) SWT.error(SWT.ERROR_NOT_IMPLEMENTED);
int polyRgn = OS.CreatePolygonRgn(pointArray, pointArray.length / 2, OS.ALTERNATE);
OS.CombineRgn (handle, handle, polyRgn, OS.RGN_OR);
OS.DeleteObject (polyRgn);
*/
}
COM: <s> adds the given polygon to the collection of polygons </s>
|
funcom_train/12639117 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Extension get(String alias) {
X509AttributeName attr = new X509AttributeName(alias);
String name;
String id = attr.getPrefix();
if (id.equalsIgnoreCase(X509CertImpl.NAME)) { // fully qualified
int index = alias.lastIndexOf(".");
name = alias.substring(index + 1);
} else
name = alias;
return (Extension)map.get(name);
}
COM: <s> get the extension with this alias </s>
|
funcom_train/26487117 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getLineProperties() {
StringBuffer stringBuffer = new StringBuffer("");
boolean isFirst = true;
for(Enumeration allNames = this.properties.propertyNames(); allNames.hasMoreElements();) {
String key = (String)allNames.nextElement();
String value = this.properties.getProperty(key);
if (isFirst) {
isFirst = false;
}
else {
stringBuffer.append(" ");
}
stringBuffer.append(key);
stringBuffer.append(" ");
stringBuffer.append(value);
}
return stringBuffer.toString();
}
COM: <s> method get line properties </s>
|
funcom_train/44930689 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JTextField findTextField(Container in){
System.out.println("Looking for a JTextField inside of JComboBox");
Component[] allComponents = in.getComponents();
JTextField retValue;
for (int i=0; i<allComponents.length; i++){
try{
retValue = (JTextField)allComponents[i];
}catch(ClassCastException e){continue;}
return retValue;
}
System.out.println("Couldn't find JTextField inside of JComboBox");
return null;
}
COM: <s> returns the jtext field that should contain user input </s>
|
funcom_train/11379417 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getMaxWorkerThreads() {
int maxWorkerThreads = getCSConf().getInt(
"mapred.capacity-scheduler.init-worker-threads",
MAX_INITIALIZATION_WORKER_THREADS);
if(maxWorkerThreads <= 0) {
throw new IllegalArgumentException(
"Invalid initializater worker thread number " + maxWorkerThreads);
}
return maxWorkerThreads;
}
COM: <s> gets maximum number of threads which are spawned to initialize jobs </s>
|
funcom_train/32353167 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void setSelectedObject(final T newSelectedObject) {
if (currentSelectedObject != null) {
currentSelectedObject.setSelected(false);
}
if (newSelectedObject == null
|| currentSelectedObject == newSelectedObject) {
currentSelectedObject = null;
return;
}
final T oldSelectedObject = currentSelectedObject;
currentSelectedObject = newSelectedObject;
currentSelectedObject.setSelected(true);
delegate.getDelegate().selectionChanged(oldSelectedObject,
newSelectedObject);
}
COM: <s> set a object selected </s>
|
funcom_train/31414352 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void refreshStructure() {
getTree().setCellRenderer(new StandardTreeCellRenderer());
TreePath path = getTree().getSelectionPath();
StandardTreeModel sm = getTreeModel();
if(sm!= null)
sm.fireTreeStructureChanged(this);
getTree().expandPath(path);
}
COM: <s> rebuilds refreshes the trees structure </s>
|
funcom_train/2762499 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Long getFlowProgressOid(PreparedCalls preparedCalls, String[] flowProgressId, boolean create) throws SQLException, JAXBException {
ResultSet rs = getFlowProgressRS(preparedCalls, flowProgressId, create);
if(rs == null) {
return null;
}
return (Long) _typeConverter.convert(rs.getObject(_config.FLOW_PROGRESS_COL_OID), Long.class);
}
COM: <s> returns the oid of the supplied flow progress </s>
|
funcom_train/48053882 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addElement(CompositeNodeItemElement element) {
if (containsNode(element.getItemData())) {
throw new IllegalArgumentException("The the item " + element.getItemData() + " was already added to the composite node " + this);
}
elements.add(element);
element.getItemData().addCompositeNodeListener(node);
}
COM: <s> adds a new script variable element to the list </s>
|
funcom_train/11674723 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void clip(Shape s){
if (s != null) {
s = transform.createTransformedShape(s);
}
if (clip != null) {
Area newClip = new Area(clip);
newClip.intersect(new Area(s));
clip = new GeneralPath(newClip);
} else {
clip = s;
}
}
COM: <s> intersects the current code clip code with the interior of the </s>
|
funcom_train/21762273 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JTextArea getJTextAreaLeader() {
if (jTextAreaLeader == null) {
jTextAreaLeader = new JTextArea();
jTextAreaLeader.setBounds(new Rectangle(138, 60, 165, 20));
jTextAreaLeader.setForeground(Color.green);
jTextAreaLeader.setBackground(Color.black);
}
return jTextAreaLeader;
}
COM: <s> this method initializes j text area leader </s>
|
funcom_train/7440511 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSimpleDenyMethod() throws ServletException, IOException {
assertEquals(SimpleInterceptor.RETURN, invoke("/inters2/simpleDeny/method"));
assertEquals(true, request.getAttribute(SimpleInterceptor.AFTER_COMPLETION));
assertEquals(true, request.getAttribute(AdvanceInterceptor.AFTER_COMPLETION));
}
COM: <s> inters2 simple deny method intercepted simple advance </s>
|
funcom_train/13812786 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: final public void activateTransition(final TransitionTimerPort port) throws Exception {
synchronized(timerQueue) {
if (!isActivated(port)) {
TransitionTimerPort previousFirstElement = null;
if (!timerQueue.isEmpty())
previousFirstElement = (TransitionTimerPort) timerQueue.first();
activate(port);
if (!(timerQueue.isEmpty()) && previousFirstElement != timerQueue.first())
timerQueue.notify();
}
}
}
COM: <s> if port not currently activated then activate it otherwise </s>
|
funcom_train/31955667 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public float readFloat() throws IOException {
if (read(bb, 0, 4) < 4) {
throw new EOFException();
}
int i = bb[0] << 24 | (bb[1] & 0xFF) << 16 | (bb[2] & 0xFF) << 8
| (bb[3] & 0xFF);
return Float.intBitsToFloat(i);
}
COM: <s> read a 4 byte real number </s>
|
funcom_train/42638945 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean beforeIterations(ConvergenceInfo info) throws SolveException{
if (X0 == null) throw new SolveException("Initial vector must be set to solve nonlinear algebraic system");
boolean byTolerance = info.getDeviationValue()>=0.;
if (!byTolerance && info.getIterationCount()==Integer.MAX_VALUE)
throw new SolveException("Iterations must be stopped by tolerance or by iteration count; set at least one of them");
return byTolerance;
}
COM: <s> called in the beginning of solve </s>
|
funcom_train/4014953 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected DesignWidgetWrapper addNewDateTimeWidget(boolean select){
DateTimeWidget tb = new DateTimeWidget();
DOM.setStyleAttribute(tb.getElement(), "height","25"+PurcConstants.UNITS);
DOM.setStyleAttribute(tb.getElement(), "width","200"+PurcConstants.UNITS);
return addNewWidget(tb,select);
}
COM: <s> adds a new date time widget to the selected page </s>
|
funcom_train/48189948 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void delete(PosKind entity) {
LogUtil.log("deleting PosKind instance", Level.INFO, null);
try {
entity = entityManager.getReference(PosKind.class, entity.getId());
entityManager.remove(entity);
LogUtil.log("delete successful", Level.INFO, null);
} catch (RuntimeException re) {
LogUtil.log("delete failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> delete a persistent pos kind entity </s>
|
funcom_train/16395094 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ActionForward enter(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
ContentParserInteractionEnterOrEditForm f = (ContentParserInteractionEnterOrEditForm)form;
f.setSortLabel(sortLabelProposalFromSession(req));
req.getSession().setAttribute("enterOrEdit", "enter");
req.getSession().setAttribute("formActionPath", req.getParameter("formActionPath"));
return mapping.findForward("enter");
}
COM: <s> initializes a new content parser interaction entry </s>
|
funcom_train/18703130 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Group createGroup(Composite parent, String text) {
Group group = new Group(parent, SWT.NULL);
group.setText(text);
GridData data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan = 2;
group.setLayoutData(data);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
group.setLayout(layout);
return group;
}
COM: <s> creates a component group </s>
|
funcom_train/40360176 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testNullConnectorName() {
try {
new StoreContext(null, "test");
fail("failed to throw exception");
} catch (IllegalArgumentException e) {
assertEquals("StoreContext.connectorName may not be null or empty.",
e.getMessage());
}
}
COM: <s> tests if the exception is thrown correctly when the connector name is null </s>
|
funcom_train/26314438 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void changePhase(IGame.Phase phase) {
game.setLastPhase(game.getPhase());
game.setPhase(phase);
// prepare for the phase
prepareForPhase(phase);
if (isPhasePlayable(phase)) {
// tell the players about the new phase
send(new Packet(Packet.COMMAND_PHASE_CHANGE, phase));
// post phase change stuff
executePhase(phase);
} else {
endCurrentPhase();
}
}
COM: <s> changes the current phase does some bookkeeping and then tells the </s>
|
funcom_train/45468383 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isCached (final Class cls, final Object identity) throws PersistenceException {
if (_transactionContext != null && _transactionContext.isOpen()) {
return _transactionContext.isCached(_lockEngine.getClassMolder(cls), cls,
new Identity(identity));
}
throw new PersistenceException("isCached() has to be called within an active transaction.");
}
COM: <s> indicates whether am instance of cls is currently cached </s>
|
funcom_train/3391660 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void printIndexContents(PackageDoc[] packages, String text) {
if (packages.length > 0) {
Arrays.sort(packages);
printIndexHeader(text);
printAllClassesPackagesLink();
for(int i = 0; i < packages.length; i++) {
if (packages[i] != null) {
printIndexRow(packages[i]);
}
}
printIndexFooter();
}
}
COM: <s> generate code for package index contents </s>
|
funcom_train/50395969 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeJKS(String fileName)throws IOException{
char[] pass=PROXY_JKS_PASSWORD.toCharArray();
OutputStream out=null;
try{
out=new FileOutputStream(fileName);
KeyStore ks=KeyStore.getInstance("JKS");
ks.load(null, pass);
ks.setKeyEntry(PROXY_JKS_ALIAS, getPrivateKey(), pass, getCertChain());
ks.store(out, pass);
}catch(Exception ex){
IOException ioe=new IOException("Can't write keystore.");
ioe.initCause(ex);
throw ioe;
}finally{
if(out!=null)out.close();
}
}
COM: <s> write to a jks keystore password is unicore </s>
|
funcom_train/21619839 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetIdByUsername() throws Exception {
System.out.println("getIdByUsername");
Connection conn = ConnectionPool.getInstance().get();
String id = UserDAO.getInstance().getIdByUsername("dmcquay", conn);
ConnectionPool.getInstance().release(conn);
assertEquals("C1", id);
}
COM: <s> test of get id by username method of class edu </s>
|
funcom_train/16615291 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ComparaDriver getComparaDriver() throws AdaptorException {
System.out.println("Getting compara driver");
if (comparaDriver == null && comparaConfig != null) {
System.out.println("Creating new compara driver");
comparaDriver = ComparaDriverFactory.createComparaDriver(comparaConfig);
}
return comparaDriver;
}
COM: <s> returns the compara driver if a compara configuration is set </s>
|
funcom_train/40639615 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addPathPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ArchitectureEntity_path_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ArchitectureEntity_path_feature", "_UI_ArchitectureEntity_type"),
ArchitecturePackage.Literals.ARCHITECTURE_ENTITY__PATH,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the path feature </s>
|
funcom_train/37556024 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setEnabled (boolean enabled) {
checkWidget();
/*
* This line is intentionally commented. Currently
* always show scrollbar as being enabled and visible.
*/
// if (OS.IsWinCE) error (SWT.ERROR_NOT_IMPLEMENTED);
if (!OS.IsWinCE) {
int hwnd = hwndScrollBar (), type = scrollBarType ();
int flags = enabled ? OS.ESB_ENABLE_BOTH : OS.ESB_DISABLE_BOTH;
OS.EnableScrollBar (hwnd, type, flags);
state &= ~DISABLED;
if (!enabled) state |= DISABLED;
}
}
COM: <s> enables the receiver if the argument is code true code </s>
|
funcom_train/25484752 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean canAddRole(final Role role) {
if (isWeak() && fRoles.size() == 2) {
/* Only 2 roles are allowed for a weak relationship */
return false;
} else if (isRecursive(role.getEntity())) {
/* Only 2 roles to the same entity are allowed */
return false;
}
return true;
}
COM: <s> returns if a role can be added to this relationship </s>
|
funcom_train/18479735 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Point3 clamp(double min,double max) {
return new Point3(
Math.max(min,Math.min(x,max)),
Math.max(min,Math.min(y,max)),
Math.max(min,Math.min(z,max))) ;
}
COM: <s> clamps all components to be in range min max </s>
|
funcom_train/44850599 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getLanguage() {
//pre: Context not null
if (context == null) {
return VSys.dftLanguage;
}
String outLanguage = (String)context.get(AbstractContext.LANGUAGE_KEY);
if (outLanguage == null) {
try {
outLanguage = VSys.getVSysProperties().getProperty(VSysConstants.KEY_DFT_LANGUAGE);
}
catch (IOException exc) {
outLanguage = VSys.dftLanguage;
}
}
return outLanguage;
}
COM: <s> returns the language id set in the context of this view </s>
|
funcom_train/38252946 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSVGCursor(java.awt.Cursor cursor) {
Shell shell = gvtCanvas.getControl().getShell();
// convert AWT curor to SWT cursor
if (cursor.getType() == java.awt.Cursor.DEFAULT_CURSOR)
shell.setCursor(CURSOR_ARROW);
else if (cursor.getType() == java.awt.Cursor.HAND_CURSOR)
shell.setCursor(CURSOR_HAND);
else if (cursor.getType() == java.awt.Cursor.WAIT_CURSOR)
shell.setCursor(CURSOR_WAIT);
}
COM: <s> informs the user agent to change the cursor </s>
|
funcom_train/7510947 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenuItem getJMenuItemOpen() {
if (jMenuItemOpen == null) {
jMenuItemOpen = new JMenuItem();
jMenuItemOpen.setText(Messages.getString("MainFrame.menu.open")); //$NON-NLS-1$
jMenuItemOpen.setAccelerator(KeyStroke
.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_MASK));
registerAction(jMenuItemOpen, Actions.OPEN);
}
return jMenuItemOpen;
}
COM: <s> this method initializes j menu item open </s>
|
funcom_train/46824955 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void parseTableMessage (ServerConnectionThread conn, XMLElement message, int tableNum) {
String messageType = message.getName();
if (messageType.equals (CommBattleshipPlaceShip.XML_NAME)) {
CommBattleshipPlaceShip placeShip = new CommBattleshipPlaceShip (message);
placeShip(conn, tableNum, placeShip);
} else if (messageType.equals (CommBattleshipMove.XML_NAME)) {
CommBattleshipMove move = new CommBattleshipMove (message);
move(conn, tableNum, move);
}
}
COM: <s> parse a checkers message </s>
|
funcom_train/2380229 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void fireEvent(PlexApplicationEvent event) {
// Use temp array to avoid interference of simultaneous additions/removals
Object[] listenerArray = _appListeners.toArray();
for(int i = 0; i < listenerArray.length; i++) {
IPlexApplicationListener listener = (IPlexApplicationListener)listenerArray[i];
listener.applicationEvent(event);
}
}
COM: <s> notify application listeners </s>
|
funcom_train/32071244 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void mnuFileSaveSelected() {
Properties properties = new Properties();
properties.setProperty("db.dir", "/data");
try {
FileOutputStream stream = new FileOutputStream("preferences.xml");
properties.storeToXML(stream, "Preferences file for "
+ Version.getInstance().getAppName()
+ " " + Version.getInstance().getAppVersion());
} catch (IOException e1) {
e1.printStackTrace();
}
JOptionPane
.showMessageDialog(view, "Optionen erfolgreich gespeichert.");
}
COM: <s> menu file save was selected </s>
|
funcom_train/22665149 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getBtnLogin() {
if (btnLogin == null) {
btnLogin = new JButton();
btnLogin.setBounds(new Rectangle(458, 260, 124, 68));
btnLogin.setText("Login");
btnLogin.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent e) {
login();
}
});
}
return btnLogin;
}
COM: <s> this method initializes btn login </s>
|
funcom_train/46730946 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setMedItemId(Long medItemId) {
if (!(this.medItemId.longValue() == medItemId.longValue())) {
Long oldmedItemId= 0L;
oldmedItemId = this.medItemId.longValue();
this.medItemId = medItemId.longValue();
setModified("medItemId");
firePropertyChange(String.valueOf(MEDDISPENSES_MEDITEMID), oldmedItemId, medItemId);
}
}
COM: <s> medication item dispensed </s>
|
funcom_train/18448044 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setHelpContext(final HelpContext value) {
helpContext = value;
if (helpButton != null) {
if ((helpContext == null) || (helpContext.getType() != HelpContext.Type.URI))
helpButton.setToolTipText(MActionInfo.HELP.getText());
else
helpButton.setToolTipText(UI.getLinkToolTipText(helpContext.getID()));
}
}
COM: <s> sets the help context for this dialog to </s>
|
funcom_train/44184947 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void scanActionDirectory() {
File dir = actionDir.getFile();
File[] files = dir.listFiles((FileFilter)FileFilterUtils.fileFileFilter());
Arrays.sort(files);
for(File f : files) {
try {
actOn(f);
} catch (Throwable e) {
LOGGER.log(Level.SEVERE,"unhandled exception from actifile: "+f,e);
}
}
}
COM: <s> find any new files in the action directory process each in </s>
|
funcom_train/7661151 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testInvokeAll2() {
ExecutorService e = new ScheduledThreadPoolExecutor(2);
try {
List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>());
assertTrue(r.isEmpty());
} catch(Exception ex) {
unexpectedException();
} finally {
joinPool(e);
}
}
COM: <s> invoke all empty collection returns empty collection </s>
|
funcom_train/19326903 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String traitTargetPresentationContext(final FObj fobj) {
final PdTargetPresentationContext property =
(PdTargetPresentationContext) getProperty(
FoProperty.TARGET_PRESENTATION_CONTEXT);
if (property != null) {
return property.getValue(fobj);
}
return PdTargetPresentationContext.getValueNoInstance(fobj);
}
COM: <s> returns the target presentation context property </s>
|
funcom_train/27845519 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeFromParent() {
MutableTreeNode parent = (MutableTreeNode) getParent();
int index = getParent().getIndex(this);
parent.remove(this);
setParent(null);
fireModelChange(BasicModel.VALUE_CHANGED, null);
((OldSTreeNode) parent).fireModelChange(BasicModel.VALUE_REMOVED, Selector.fromInt(index));
}
COM: <s> removes the receiver from its parent </s>
|
funcom_train/44325552 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean isEqualTo(Object object) {
if (!(object instanceof Proxy))
return false;
object = Proxy.getInvocationHandler(object);
if (!(object instanceof AbstractProxyHandler))
return false;
AbstractProxyHandler handler = (AbstractProxyHandler) object;
if (handler == this)
return true;
return equals(handler);
}
COM: <s> this method is used to compare proxies between them </s>
|
funcom_train/17046077 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public MappedString append(String string) {
int origPos = originalString.length();
int mappedPos = mappedString.length();
originalString.append(string);
mappedString.append(string);
for (int i = 0; i < string.length(); ++i) {
reverseMap.put(mappedPos++, new int[]{origPos++, 1});
}
return this;
}
COM: <s> append the given string with identity mapping as is </s>
|
funcom_train/18659545 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void actionPerformed(ActionEvent ae) {
Object object = ae.getSource(); // get a reference to the button that was pressed
if(object == transformButton) {
transform();
} else if(object == setXSLTButton) {
setxsltFile();
} else if(object == setOutputButton) {
saveToFile();
}
}
COM: <s> called when a button has been pressed </s>
|
funcom_train/5304723 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void encodeEdgePoints(List points, Element parent){
Element pointSetElement = xmldoc.createElement("pointSet");
Element pointElement = null;
for(Object p : points){
pointElement = xmldoc.createElement("point");
pointElement.setAttribute("x", String.valueOf(((Point2D) p).getX()));
pointElement.setAttribute("y", String.valueOf(((Point2D) p).getY()));
pointSetElement.appendChild(pointElement);
}
parent.appendChild(pointSetElement);
}
COM: <s> encodes a list of points for use with an edge element </s>
|
funcom_train/20882598 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void cancel() {
if (audioMetrics)
timer.start("audioCancel");
if (currentClip != null) {
currentClip.stop();
currentClip.close();
}
synchronized (this) {
cancelled = true;
paused = false;
notifyAll();
}
if (audioMetrics) {
timer.stop("audioCancel");
timer.getTimer("audioCancel").showTimesShortTitle("");
timer.getTimer("audioCancel").showTimesShort(0);
}
}
COM: <s> cancels all queued audio </s>
|
funcom_train/31322573 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void assertSpell(final ISpell theOut, final String description) {
assertNotNull("Caster", theOut.getCaster());
assertNotNull("Target", theOut.getTarget());
assertEquals("Description", description, theOut.getDescription());
}
COM: <s> assert the basics are correct on the spell </s>
|
funcom_train/37854368 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void doLog(File[] paths, SVNRevision startRevision, SVNRevision endRevision, boolean stopOnCopy, boolean discoverChangedPaths, long limit, final ISVNLogEntryHandler handler) throws SVNException {
doLog(paths, startRevision, endRevision, SVNRevision.UNDEFINED, stopOnCopy, discoverChangedPaths, false, limit, null, handler);
}
COM: <s> gets commit log messages with other revision specific information from a repository </s>
|
funcom_train/18577470 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void send(Packet packet) {
NodeHandle nodeHandle = null;
Transport transport;
Iterator iter;
try {
iter = transportCache.keySet().iterator();
while (iter.hasNext()) {
nodeHandle = (NodeHandle) iter.next();
transport = transportCache.get(nodeHandle);
transport.send(packet);
logger.debug("Sent packet " + packet.getName() + " to all connected nodes");
}
} catch (Exception e) {
logger.error("Could not send packet to node " + nodeHandle.toString());
}
}
COM: <s> sends a packet to all connected nodes </s>
|
funcom_train/3845885 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeDataChunkHeader() throws IOException {
long chunkSize = totalSamples * audioFormat.channels
* ((audioFormat.bitsPerSample + 7) / 8);
/* Data Chunk - "data" */
// Chunk ID
os.write("data".getBytes());
// Chunk size
writeInt((int) chunkSize); // data size
}
COM: <s> writes a data chunk header </s>
|
funcom_train/46825885 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createNodes () {
// Create the various tables
Table table;
int [] tableNums = tableList.getTablesNumbers();
for (int i = 0; i < tableNums.length; i++) {
table = tableList.getTable(tableNums[i]);
add (new TableTreeNode (table));
}
}
COM: <s> create nodes for a table </s>
|
funcom_train/9386709 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void changeProject(IProject newProject) {
mProject = newProject;
// enable types based on new API level
enableTypesBasedOnApi();
// update the folder name based on API level
resetFolderPath(false /*validate*/);
// update the Type with the new descriptors.
initializeRootValues();
// update the combo
updateRootCombo(getSelectedType());
validatePage();
}
COM: <s> changes m project to the given new project and update the ui accordingly </s>
|
funcom_train/26528813 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addDataPoint(double x, double y) {
if (dataPointsList == null) {
if (dataPoints == null || dataPoints.length == 0)
dataPointsList = new LinkedList();
else
dataPointsList = new LinkedList(Arrays.asList(dataPoints));
}
dataPointsList.add(new DataPoint(x, y));
}
COM: <s> add a historical data point </s>
|
funcom_train/43683285 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void printToFile(){
try
{
//print
OutputFormat format = new OutputFormat(dom);
format.setIndenting(true);
//to generate output to console use this serializer
//XMLSerializer serializer = new XMLSerializer(System.out, format);
//to generate a file output use fileoutputstream instead of system.out
XMLSerializer serializer = new XMLSerializer(
new FileOutputStream(new File("book.xml")), format);
serializer.serialize(dom);
} catch(IOException ie) {
ie.printStackTrace();
}
}
COM: <s> this method uses xerces specific classes </s>
|
funcom_train/31294423 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setupEnvironment() {
// obtain all the available repositories
Iterator repositories = repositoryManager.getRepositories().iterator();
while (repositories.hasNext()) {
Repository repository = (Repository) repositories.next();
TagControlManager manager = new TagControlManagerImpl(repository);
managers.put(repository, manager);
managers.put(repository.getId(), manager);
// TODO maybe remove it if there are similar names for repositories
managers.put(repository.getName(), manager);
}
}
COM: <s> set up all the tag control manager </s>
|
funcom_train/28312434 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean legalRectangleContains(ImPoint tryThisPoint) {
ReadOnlyWorld world = modelRoot.getWorld();
int width = world.getMapWidth();
int height = world.getMapHeight();
Rectangle legalRectangle = new Rectangle(0, 0, width, height);
return legalRectangle.contains(tryThisPoint.toPoint());
}
COM: <s> checks whether specified point is in legal rectangle </s>
|
funcom_train/10589414 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSuggestionLabel(String label) {
if (this.definition.getSuggestionList() == null) {
throw new FormsRuntimeException("Field '" + getRequestParameterName() + "' has no suggestion list.",
getLocation());
}
setAttribute(SUGGESTED_LABEL_ATTR, label);
}
COM: <s> set the suggestion label associated to the widgets current value </s>
|
funcom_train/26221562 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object retrieveTreasureAsHost(String key, boolean isRemove) {
if (null == key) {
return null;
}
// Get treasure from heap.
synchronized (treasureMap) {
final TreasureHeap.Treasure treasureChest = treasureMap.get(key);
if (null == treasureChest) {
return null;
}
// Remove if wished so.
if (isRemove) {
treasureMap.remove(key);
}
return treasureChest.treasureContent;
}
}
COM: <s> returns the treasure to a given key regardless of who is asking </s>
|
funcom_train/1442651 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void allChanged() {
SceneSet sceneSet = WorldModel.getSceneSet();
ScenePlayModeList pml = sceneSet.getScenePlayModeList();
remove(box);
box = new JComboBox(new Vector(pml.getAllScenePlayModes()));
add(box);
box.setVisible(true);
}
COM: <s> thie method is called when the whole list has changed e </s>
|
funcom_train/25664983 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void minorSavePoint(final String name, final VolatileGameState state) {
synchronized (this.majorSavePoints) {
final int index = this.majorSavePoints.size() - 1;
final LinkedHashMap<String, VolatileGameState> minorSPs = this.minorSavePoints.get(index);
minorSPs.put(name, state.clone());
this.lastMinorSavePoint = name;
}
}
COM: <s> creates a minor save point </s>
|
funcom_train/41290543 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean removeConfiguration(String name){
name=name.toLowerCase();
if(name.equalsIgnoreCase(currentconf))return false;
if(name.equalsIgnoreCase(macchina1956))return false;
boolean res= (name==null)?true:configs.remove(name)!=null;
if(res)notifica(CONFIGURATION_SET_CHANGED);
return res;
}
COM: <s> removes a confiuration </s>
|
funcom_train/10251680 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int findColumn(String columnName) {
if (namedJoinColumnExpressions != null
&& namedJoinColumnExpressions.containsKey(columnName)) {
return -1;
}
if (variables != null) {
return variables.getIndex(columnName);
} else if (columnAliases != null) {
return columnAliases.getIndex(columnName);
} else {
return rangeTable.findColumn(columnName);
}
}
COM: <s> retruns index for column </s>
|
funcom_train/23891244 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setImage(File imageFile) {
//only if the image still exist
if(imageFile.exists()) {
try {
//read the image from file
BufferedImage loadedImage = javax.imageio.ImageIO.read(imageFile);
//set the loaded image as the image to draw on
imGra = (Graphics2D)loadedImage.getGraphics();
this.image = loadedImage;
//draw changes
this.paintComponent(this.getGraphics());
} catch (IOException e) {
e.printStackTrace();
}
}
}
COM: <s> set a new image from a file </s>
|
funcom_train/11344230 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void stateChanged(ComponentInstance instance, int newState) {
switch (newState) {
case ComponentInstance.DISPOSED:
case ComponentInstance.STOPPED:
break; // Should not happen
case ComponentInstance.VALID:
if (!getValidity()) {
checkValidity();
}
break;
case ComponentInstance.INVALID:
if (getValidity()) {
checkValidity();
}
break;
default:
break;
}
}
COM: <s> instance state listener </s>
|
funcom_train/9819110 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private BV nextSign(){
switch( sign_flag ){
case POSITIVE_SIGN:
return new BV( SIGN_WIDTH, 0, false );
case NEGATIVE_SIGN:
return new BV( SIGN_WIDTH, 1, false );
case RANDOM_SIGN:
return new BV( SIGN_WIDTH, new BigInteger( SIGN_WIDTH, random_generator ), false );
default:
throw new RuntimeException( "Invalid sign_flag value: " + sign_flag );
} // end switch( sign_flag...
}
COM: <s> helper function that generates a constrained random sign value </s>
|
funcom_train/16178342 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Class getStaticFieldType(String fieldName) {
Field f = (Field)staticFields.get(fieldName);
if (f == null) throw new NoSuchElementException("Class " + clazz.getName() +
" does not contain field " + fieldName);
return f.getType();
}
COM: <s> returns the type of the named static field </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.