__key__ stringlengths 16 21 | __url__ stringclasses 1 value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/44779066 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getLeafNodeCount() {
if (myPropertyTreeNode != null) {
return myPropertyTreeNode.getLeafNodeCount();
} else if (myValues != null) {
synchronized (myValues) {
return myValues.size();
}
} else {
throw new IllegalStateException("HeadTreeNode: getleafNodeCount: HeadTreeNode must have either a PropertyTreeNode or list of values.");
}
}
COM: <s> returns the number of leaf nodes in this tree </s>
|
funcom_train/26240160 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void storeCorrectMask() {
boolean[] mask = displayQuestion.getCorrectMask();
if (mask == null || mask.length != answerBoxes.length) {
mask = new boolean[answerBoxes.length];
}
for (int i = 0; i < mask.length; i++) {
mask[i] = answerBoxes[i].isSelected();
}
displayQuestion.setCorrectMask(mask);
}
COM: <s> stores the current answer checkbox configuration to </s>
|
funcom_train/4853593 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void sendLinkEvent (Link l, int id) {
LinkEvent evt = new LinkEvent (this, id, l);
l.setStatus (id);
for (int j=0, len=linkListeners.size(); j<len; ++j) {
LinkListener listen = (LinkListener)linkListeners.elementAt(j);
listen.crawled (evt);
}
}
COM: <s> send a link event to all link listeners registered with this crawler </s>
|
funcom_train/45319420 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getJbConectar() {
if (jbConectar == null) {
jbConectar = new JButton();
jbConectar.setBounds(8, 12, 110, 25);
jbConectar.setText("Conectar");
jbConectar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
conectarODesconectar();
}
});
}
return jbConectar;
}
COM: <s> this method initializes j button </s>
|
funcom_train/26455025 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addCacheEventListener(CacheEventListener listener, Class clazz) {
if (CacheEventListener.class.isAssignableFrom(clazz)) {
listenerList.add(clazz, listener);
} else {
log.error("The class '" + clazz.getName() + "' is not a CacheEventListener. Ignoring this listener.");
}
}
COM: <s> register a listener for cache events </s>
|
funcom_train/39535387 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void createElement(final SVGHandle handle, final Point2D location){
Thread thread=new Thread(){
@Override
public void run() {
String[] values=getSVGFile(handle);
if(values!=null){
//getting the svg data
ViewOrWidgetData data=getSVGData(values);
if(data!=null){
//creating the element
final Element newElement=createElement(handle, data, location);
SwingUtilities.invokeLater(new Runnable(){
public void run() {
handle.getSelection().handleSelection(newElement, false, false);
}
});
}
}
}
};
thread.start();
}
COM: <s> creating the element to be added to the canvas </s>
|
funcom_train/33142255 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JScrollPane getStatusScrollPane() {
if (statusScrollPane == null) {
statusScrollPane = new JScrollPane();
statusScrollPane.setBounds(new java.awt.Rectangle(15, 75, 451, 256));
statusScrollPane.setViewportView(getStatusTextArea());
}
return statusScrollPane;
}
COM: <s> this method initializes status scroll pane </s>
|
funcom_train/44715037 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void initialize() {
super.initialize();
if (isNew()) {
setLabel(DEFAULT_LABEL);
setDescription(DEFAULT_DESCRIPTION);
setState(DISABLED);
// set directly to avoid calling get() while the value is null
set(IS_ACTIVE, Boolean.FALSE);
}
}
COM: <s> initializes a task </s>
|
funcom_train/35716450 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void ensureDocumentListenerInstalled() {
if (fDocumentListener == null) {
fDocumentListener= new IDocumentListener() {
public void documentAboutToBeChanged(DocumentEvent event) {
if (!fInserting)
fDocumentEvents.add(event);
}
public void documentChanged(DocumentEvent event) {
if (!fInserting)
filterProposals();
}
};
IDocument document= fContentAssistSubjectControlAdapter.getDocument();
if (document != null)
document.addDocumentListener(fDocumentListener);
}
}
COM: <s> installs the document listener if not already done </s>
|
funcom_train/12076897 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public FieldInfo (int pimId, String label,int numberOfArrayElements, int preferredIndex,int[] supportedArrayElements, int[] supportedAttributes) {
this.pimId = pimId;
this.type = PIMItem.STRING_ARRAY;
this.label = label;
this.numberOfArrayElements = numberOfArrayElements;
this.preferredIndex = preferredIndex;
this.supportedArrayElements = supportedArrayElements;
this.supportedAttributes = supportedAttributes;
}
COM: <s> this constructor can be used for arraytypes </s>
|
funcom_train/21058290 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setParameter(final String name, final String[] values) {
if (values == null || values.length == 0) {
params.remove(name);
} else {
final List<String> list = new ArrayList<String>();
list.addAll(Arrays.asList(values));
params.put(name, list);
}
}
COM: <s> stablish a new set of values for given parameter name </s>
|
funcom_train/9890125 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void handleParameterSelection() {
if(m_CurrentSelected != null) {
m_CurrentSelected.param = m_TypeCombo.getSelectionIndex() == 0 ? 0.0f : 1.0f;
m_CurrentSelected.param = m_TypeCombo.getSelectionIndex() == 2 ?
m_Parameter.getSelection() * PARAM_CORRECTION : m_CurrentSelected.param;
m_PriorityGraph.setParameter(m_CurrentSelected.param);
}
}
COM: <s> sets the parameter value to priority graph </s>
|
funcom_train/50573620 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void init(javax.servlet.ServletConfig config) throws ServletException {
super.init(config);
System.out.println("[OpenCatalog] Open Catalog is initializing.");
//Initialize the logging engine.
LogConfigurator logconf = new LogConfigurator();
(new UniqueId()).initUniqueIdBean();
System.out.println("[OpenCatalog] Open Catalog is initialized.");
}
COM: <s> initializes the servlet </s>
|
funcom_train/1386055 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getBtnModificaBanca() {
if (btnModificaBanca == null) {
btnModificaBanca = new JButton();
btnModificaBanca.setText("Modifica Banca");
btnModificaBanca.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
modificaBanca();
}
});
}
return btnModificaBanca;
}
COM: <s> this method initializes btn modifica banca </s>
|
funcom_train/10268353 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int countNodes(RdrNode root) {
if ( root == null ) return 0; // empty tree. Base case.
else {
int count = 1; // count the root.
count += countNodes(root.getTrueChild()); // add left subtree.
count += countNodes(root.getFalseChild()); // add right subtree.
return count;
}
}
COM: <s> returns the number of nodes in the tree </s>
|
funcom_train/23852370 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void log(int level, TraceId traceId, String message, Object[] args) {
log(ClassUtils.getCallingClass(CALLER_DEPTH), ClassUtils.getCallingLine(CALLER_DEPTH),
level, traceId, message, args);
}
COM: <s> generic logger function </s>
|
funcom_train/974151 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void activateExternalPage(Object[] parameters, IRequestCycle cycle) {
String key = null;
if (parameters.length > 0) {
key = (String) parameters[0];
}
if (null == key) {
recordError("activation.key.missing");
return;
}
boolean result = getUserDAO().activate(key);
if (!result) {
recordError("activation.key.failure");
return;
}
setMessage(getMessages().getMessage("activation.success.message"));
throw new RedirectException(getPageService().getLink(false,
getPageName()).getAbsoluteURL());
}
COM: <s> called from the external service </s>
|
funcom_train/32082415 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void add(int x, int y, int width, int height) {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (width < 0 || height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
GdkRectangle gdkRect = new GdkRectangle();
gdkRect.x = x;
gdkRect.y = y;
gdkRect.width = width;
gdkRect.height = height;
OS.gdk_region_union_with_rect(handle, gdkRect);
}
COM: <s> adds the given rectangle to the collection of polygons </s>
|
funcom_train/38467850 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void initialize() throws LabyException {
Log.info("IdGenerator", "initialize", "Initializing ID generator.");
try {
ms_prepGetNewUniqueID = m_connection.prepareStatement(Configuration.getProperty(PROP_SQL_UNIQUEID_MCKOI));
} catch(java.sql.SQLException e) {
throw new LabySQLException(e);
}
}
COM: <s> this method initializes the generator by </s>
|
funcom_train/12908465 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void fromBrokenBlastXML(final InputStream input) throws BioDOMException {
int c;
final int buffSize = 1024;
final byte buff[] = new byte[buffSize];
final OutputStream os = new ByteArrayOutputStream(buffSize);
try {
while ((c = input.read(buff)) != -1)
os.write(buff, 0, c);
fromBrokenBlastXML(os.toString());
} catch(IOException ex) {
throw new BioDOMException(ex.toString());
}
}
COM: <s> use data of the broken xml output from a multiple sequence blast query </s>
|
funcom_train/1655275 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void putEncoded(byte b) {
if (outputLineWidth >= 72)
putSoftBreak();
outputBuffer = appendByte(outputBuffer, (byte) '=');
outputBuffer = appendByte(outputBuffer, hexDigit((b >> 4) & 0xf));
outputBuffer = appendByte(outputBuffer, hexDigit((b & 0xf)));
outputLineWidth += 3;
}
COM: <s> output a byte in hex encoding </s>
|
funcom_train/20237699 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TextField getLogin() {
if (login == null) {//GEN-END:|17-getter|0|17-preInit
// write pre-init user code here
login = new TextField("Login", null, 32, TextField.ANY);//GEN-LINE:|17-getter|1|17-postInit
// write post-init user code here
}//GEN-BEGIN:|17-getter|2|
return login;
}
COM: <s> returns an initiliazed instance of login component </s>
|
funcom_train/44158142 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected SimplePerson getSimplePerson(String name) {
DetachedCriteria c = DetachedCriteria.forClass(SimplePerson.class);
c.add(Restrictions.eq("name", name));
List<SimplePerson> people = getSimplePersonDao().findByCriteria(c);
assertEquals(1, people.size());
SimplePerson p = people.get(0);
assertEquals(name, p.getName());
return p;
}
COM: <s> get a simple person by name </s>
|
funcom_train/36547454 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean initRequestParameterString( String requestToken ) {
boolean tokenOk = true;
if ( validIdentifyers.contains( requestToken ) ) {
currentParameter = new Parameter();
_requestParameters.put( requestToken, currentParameter );
} else if ( validActions.contains( requestToken ) ) {
if ( _requestAction.isEmpty() ) {
_requestAction = requestToken;
} else {
tokenOk = false;
}
} else {
tokenOk = false;
}
return tokenOk;
}
COM: <s> inits the request parameter string </s>
|
funcom_train/23777612 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void valueChanged(ListSelectionEvent e) {
if (!e.getValueIsAdjusting()) {
CardLayout cl = (CardLayout) displayPanel.getLayout();
if (selectionList.getSelectedIndex() != -1) {
cl.show(displayPanel, (String) selectionList.getSelectedValue());
}
}
}
COM: <s> this listes to changes besed on the list selection </s>
|
funcom_train/15411670 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int queryAutoFetchHash() {
int hash = DefaultExpressionList.class.getName().hashCode();
for (int i = 0, size = list.size(); i < size; i++) {
SpiExpression expression = list.get(i);
hash = hash * 31 + expression.queryAutoFetchHash();
}
return hash;
}
COM: <s> calculate a hash based on the expressions but excluding the actual bind </s>
|
funcom_train/27823078 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Rectangle getHandleControlRect(int row,Rectangle rectangle) {
Rectangle cellBounds=getCellRect(row,convertColumnIndexToView(m_treeColumn),false);
m_treeTableCellRenderer.getHandleControlRect(this,row,rectangle);
rectangle.x+=cellBounds.x;
return rectangle;
}
COM: <s> returns the rectangle of the expansion handle control for given path </s>
|
funcom_train/50741710 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: abstract public class HitStrategy {
public boolean maybe_surrender(Game g, int upcard, Hand to_play_hand) { return false; }
abstract public void play_hand(Game g, int upcard, Hand to_play_hand);
public static HitStrategy dealer = new DealerHitStrategy();
public static HitStrategy basic = new TableHitStrategy("strategies/basic.str");
}
COM: <s> hit strategy is an interface for a making decisions about hitting standing etc </s>
|
funcom_train/51102703 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void shutdown() throws Exception {
this.externalEventSource = null;
if (listeners != null && eventManager != null) {
Iterator it = listeners.iterator();
while (it.hasNext()) {
SubjectListener listener = (SubjectListener) it.next();
eventManager.removeListener(listener, listener.subject);
}
eventManager = null;
listeners = null;
}
shutdownExternal();
}
COM: <s> stops listening for events on both local and external interfaces </s>
|
funcom_train/50314714 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void drawImage(Image image, int x, int y) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (image == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
if (image.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
try {
lockToolkit();
if(image.alpha != -1 || image.alphaData != null)
drawImageAlpha(image, 0, 0, -1, -1, x, y, -1, -1);
else
drawImageSimple(image, x, y);
} finally {
unlockToolkit();
}
}
COM: <s> draws the given image in the receiver at the specified </s>
|
funcom_train/44833372 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void refreshVisuals() {
if (getFigure() instanceof JGComponentElementFigure) {
JGComponentElementFigure componentFigure = (JGComponentElementFigure) getFigure();
Point location = componentFigure.getLocation();
JGContainerElementPart parent = (JGContainerElementPart) getParent();
Rectangle constraint = new Rectangle(location.x, location.y, -1, -1);
parent.setLayoutConstraint(this, componentFigure, constraint);
}
}
COM: <s> reset the layout constraint and revalidate the content pane </s>
|
funcom_train/2587432 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeTag(final Writer w, final String name) throws IOException {
if (this.newLineOk) {
w.write(getLineSeparator());
}
indent(w, OPEN_TAG_INCREASE);
w.write("<");
w.write(name);
w.write(">");
if (getSafeTags().isSafeForOpen(name)) {
w.write(getLineSeparator());
}
}
COM: <s> writes an opening xml tag that has no attributes </s>
|
funcom_train/44148768 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addToHistory(int indx, int columns){
//int old = ((Integer)history.elementAt(indx - 1)).intValue();
int factorIndx = getFactorIndex(indx-1);
for(int i=0; i<columns;i++)
history.insertElementAt(new Integer(factorIndx+1+i),indx+i);
}
COM: <s> add to history vector </s>
|
funcom_train/288060 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Integer getConcurrentRequestTimeout(String viewId) {
List<Page> stack = getPageStack(viewId);
for (int i = stack.size() - 1; i >= 0; i--) {
Page page = stack.get(i);
Integer concurrentRequestTimeout = page
.getConcurrentRequestTimeout();
if (concurrentRequestTimeout != null) {
return concurrentRequestTimeout;
}
}
return Manager.instance().getConcurrentRequestTimeout();
}
COM: <s> search for a defined concurrent request timeout beginning with the most </s>
|
funcom_train/16603970 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void openChunk() throws IOException {
readFully(buffer, 0, 8);
chunkLength = readInt(buffer, 0);
chunkType = readInt(buffer, 4);
chunkRemaining = chunkLength;
crc.reset();
crc.update(buffer, 4, 4); // only chunkType
}
COM: <s> open the next chunk determine the type and setup the internal state </s>
|
funcom_train/15867496 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public MissionPlayer commitToMission(String missionId, String schId) throws MoiseConsistencyException, MoiseCardinalityException {
SchemeInstance sch = oe.findScheme(schId);
if (sch == null) {
throw new MoiseConsistencyException("the instance sch "+schId+" does not exist in the OE");
}
return commitToMission(missionId, sch);
}
COM: <s> adds a mission for an agent </s>
|
funcom_train/1300789 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected DocText buildDocText(FileIterator.FileChunkImpl fileChunk, int index) {
Tree<XmlLite.Data> xmlNode = null;
try {
xmlNode = XmlFactory.buildXmlTree(fileChunk.getLine(), false, false);
}
catch (IOException e) {
throw new IllegalStateException(e);
}
return new DocText(this, new XmlData(index, xmlNode, null, null));
}
COM: <s> build a doc text instance for the datum </s>
|
funcom_train/39811182 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: static public void updateDB2007_5(String connectionURL) throws SQLException {
Connection con = DriverManager.getConnection(connectionURL, "sa", "");
Statement prepped = con.createStatement();
prepped.executeUpdate(
"update PUBLIC.MARKET set market.owner = " +
"(select claims.owner from public.claims where claims.claims_id = market.claim)");
return;
}
COM: <s> upgrade database to format for 2007 </s>
|
funcom_train/45612132 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setCondition(Integer index, Condition meet){
Condition oldVal=null;
try{ oldVal=getCondition(index); }
catch(ArrayIndexOutOfBoundsException ae){}
conditions.set(index, meet);
propsup.fireIndexedPropertyChange("condition", index, oldVal, meet);
}
COM: <s> sets a condition by its index </s>
|
funcom_train/43245372 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetAlias() {
System.out.println("getAlias");
PatientDemographicsDG2Object instance = new PatientDemographicsDG2Object();
String expResult = "";
String result = instance.getAlias();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
COM: <s> test of get alias method of class org </s>
|
funcom_train/42944553 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(Object other) {
if (!(other instanceof DBField)) {
return false;
}
DBField fld = (DBField) other;
if (!this.getName().equals(fld.getName())) {
return false;
}
else if (!this.getSqlType().equals(fld.getSqlType())) {
return false;
}
else {
return true;
}
}
COM: <s> overiding equals method </s>
|
funcom_train/32056328 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setModel(GraphModel graphmodel) {
roots.clear();
mapping.clear();
hiddenSet.clear();
visibleSet.clear();
graphModel = graphmodel;
Object aobj[] = DefaultGraphModel.getRoots(graphmodel);
if (!isPartial()) {
insertRoots(getMapping(aobj, true));
}
if (aobj != null) {
for (int i = 0; i < aobj.length; i++) {
factory.updateAutoSize(getMapping(aobj[i], false));
}
}
updatePorts();
}
COM: <s> sets the current model </s>
|
funcom_train/21027482 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean convertibleToDxf(String from) {
log.debug("convertibleToDxf({})", from);
boolean ret = false;
if ((!Config.SYSTEM_DWG2DXF.equals("") && validAutoCad.contains(from)) ||
Config.MIME_DXF.equals(from)) {
ret = true;
}
log.debug("convertibleToDxf: {}", ret);
return ret;
}
COM: <s> test if a mime document can be converted to dxf </s>
|
funcom_train/25365928 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addResistFirePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Armor_resistFire_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Armor_resistFire_feature", "_UI_Armor_type"),
LeveleditorPackage.Literals.ARMOR__RESIST_FIRE,
true,
false,
false,
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the resist fire feature </s>
|
funcom_train/16767934 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected KeyPair generateKeyPair() {
KeyPair keyPair = null;
DHParameterSpec keySpec = new DHParameterSpec(DH_MODULUS, DH_BASE);
try {
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DH");
keyGen.initialize(keySpec);
keyPair = keyGen.generateKeyPair();
keyAgreement = KeyAgreement.getInstance("DH");
keyAgreement.init(keyPair.getPrivate());
} catch (Exception e) {
log.error("Error generating keypair", e);
}
return keyPair;
}
COM: <s> creates a diffie hellman key pair </s>
|
funcom_train/26246440 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getDistance(Planet p1, Planet p2) {
try {
StarSystem s1 = new StarSystem(factory, p1.getSystemId());
StarSystem s2 = new StarSystem(factory, p2.getSystemId());
return getDistance(s1, s2);
} catch (ObjectNotFoundException e) {
// The database foreign key constraints should prevent this.
e.printStackTrace();
}
return 0;
}
COM: <s> get the distance in parsecs between two planets </s>
|
funcom_train/16829980 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setCount(E key, int count) {
if (tempMInteger == null) {
tempMInteger = new MutableInteger();
}
tempMInteger.set(count);
tempMInteger = map.put(key, tempMInteger);
totalCount += count;
if (tempMInteger != null) {
totalCount -= tempMInteger.intValue();
}
}
COM: <s> sets the current count for the given key </s>
|
funcom_train/20843045 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void mergeContainer(ElementContainer container) {
if (container == null) return;
if (container.getContainerType() != getContainerType()) {
throw new RuntimeException("XML schema container mismatch! Cannot merge different container types.");
}
Iterator it = container.allElements();
while (it.hasNext()) {
Element e = (Element) it.next();
this.addElement(e);
}
}
COM: <s> merge one container into this container </s>
|
funcom_train/2760301 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Class getFlowLogic() {
try {
if(_flowLogic == null) {
_flowLogic = resolveClassOrInterface(getName());
}
return _flowLogic;
} catch(ClassNotFoundException e) {
throw new IllegalStateException("Failed to locate flow logic for flow("+getName()+"):"+e.getMessage());
}
}
COM: <s> returns the class that represents the logic for this flow </s>
|
funcom_train/37648669 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testRenderReportCmdNullArg7() throws CommandException {
try {
RenderReportCmd cmd = new RenderReportCmd();
cmd.setProject(null);
cmd.registerRenderer(null, null);
cmd.performExecute();
fail();
} catch (UnsetInputPropertiesException e) {
// yes cool
}
}
COM: <s> test robustness 7 </s>
|
funcom_train/43384492 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeAll() {
//gotta do this so intercpetor gets called on each delete...
Transaction tx;
Session session;
Iterator i = getReports().iterator();
while(i.hasNext()) {
session = HibernateUtil.currentSession();
tx = session.beginTransaction();
session.delete((Report)i.next());
tx.commit();
HibernateUtil.closeSession();
}
//alt batch delete, does not call interceptor...
//Transaction tx = session.beginTransaction();;
//int deleted = session.createQuery("Delete net.sf.ussrp.bus.Report")
// .executeUpdate();
//tx.commit();
}
COM: <s> remove all reports from the persistent store </s>
|
funcom_train/320717 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ClickIdInformation identify(ClickDetection click) {
if (haveClickTypes()) {
for (int i = 0; i < idParameters.clickTypeParams.size(); i++) {
ClickTypeParams clickTypeInfo = idParameters.clickTypeParams.get(i);
if (isThisType(click, clickTypeInfo)) {
return new ClickIdInformation(clickTypeInfo.code,clickTypeInfo.getDiscard());
}
}
}
return new ClickIdInformation(0);
}
COM: <s> identifies a click </s>
|
funcom_train/15918494 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getReceiverName(Receiver receiver) {
if (receiver instanceof Special)
return null;
else if (receiver instanceof X10Local_c)
return ((X10Local_c)receiver).name().toString();
else if (receiver instanceof X10Field_c)
return ((X10Field_c)receiver).name().toString();
else if (receiver instanceof X10Call_c)
return getReceiverName(((X10Call_c)receiver).target());
return null;
}
COM: <s> get the x10 field target this is for handling the recursive case e </s>
|
funcom_train/11088074 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void process(final InternalEndpoint endpoint, final InternalExchange exchange, final Subject subject) {
try {
Subject.doAs(subject, new PrivilegedExceptionAction<Object>() {
public Object run() throws Exception {
endpoint.process(exchange);
return null;
}
});
} catch (PrivilegedActionException e) {
throw new NmrRuntimeException("Unable to invoke endpoint on behalf of " + subject, e);
}
}
COM: <s> make the endpoint process the exchange on behalf of the provided security subject </s>
|
funcom_train/37519750 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void collectAbstractMethods(ArrayList v, CClassType[] args) {
protoMethods.appendAbstractMethodsTo( v , args );
if (superClass != null) {
CClassType[] superArgs=
superClass.isGenericType()?superClass.getArguments():
CClassType.EMPTY;
// java.lang.object
getSuperClass().collectAbstractMethods(v, superArgs);
}
}
COM: <s> walks up the extends hierarchy and adds all abstract methods </s>
|
funcom_train/42776051 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setToolMode(int newToolMode) {
if(newToolMode != PENCIL_MODE && newToolMode != ERASER_MODE)
MsgHandler.error("Tool mode does not exist.");
this.toolMode = newToolMode;
//Set the cursor appropriate to the mode
if(toolMode == PENCIL_MODE)
setCursor(pencilCursor);
else if(toolMode == ERASER_MODE)
setCursor(eraserCursor);
}
COM: <s> controls whether the pencil or eraser is used and sets the cursor appropriately </s>
|
funcom_train/47270754 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void actionPerformed(ActionEvent e) {
try {
// An exception should not occur here because we got here only after
// already successfully creating an instance from the same Class object
// in ToolLoader's loadMarsTools() method.
((MarsTool)this.toolClass.newInstance()).action();
} catch (Exception ex) { }
}
COM: <s> response when tools item selected from menu </s>
|
funcom_train/17008429 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void flush() throws IOException {
if (output_streams_ == null) {
throw new IOException(module_name_ + "No internal output streams.");
}
try {
for (int i = 0; i < output_streams_.length; i++) {
output_streams_[i].flush();
}
}
catch (IOException e) {
throw e;
}
}
COM: <s> flushes this output stream and forces any buffered output bytes to </s>
|
funcom_train/34557936 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addButton(ToolbarMenuButton button) {
if (isRendered()) {
JavaScriptObject componentJS = button.isCreated() ? button.getOrCreateJsObj() : button.getConfig();
addButtonPostRender(componentJS);
} else {
JavaScriptObject componentJS = button.isCreated() ? button.getOrCreateJsObj() : button.getConfig();
addButtonPreRender(componentJS);
}
}
COM: <s> adds a toolbar menu button </s>
|
funcom_train/37589849 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setJavadocInProgress() {
_errorListPositions = new Position[0];
ErrorDocument doc = new ErrorDocument(getErrorDocumentTitle());
doc.append("Generating Javadoc. Please wait...\n", NORMAL_ATTRIBUTES);
setDocument(doc);
selectNothing();
_wasSuccessful = false;
}
COM: <s> puts the error pane into compilation in progress state </s>
|
funcom_train/36489341 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void postalDelivery() {
while (true) {
messageReceived.P();
Packet p = Machine.networkLink().receive();
MailMessage mail;
try {
mail = new MailMessage(p);
}
catch (MalformedPacketException e) {
continue;
}
if (Lib.test(dbgNet))
System.out.println("delivering mail to port " + mail.dstPort
+ ": " + mail);
// atomically add message to the mailbox and wake a waiting thread
queues[mail.dstPort].add(mail);
}
}
COM: <s> wait for incoming messages and then put them in the correct mailbox </s>
|
funcom_train/14416074 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toMOF() {
StringBuffer buf = new StringBuffer();
if (iName != null && iName.length() > 0) {
buf.append(vectorToMOFString(iQualifiers, false, 1));
buf.append("\n\t");
if (iType != null) buf.append(iType);
else buf.append("void");
buf.append(" ");
buf.append(iName);
buf.append("(\n");
buf.append(vectorToMOFString(iParameters, true, 1, 0, true));
buf.append("\t);");
}
return buf.toString();
}
COM: <s> returns the mof representation of the method </s>
|
funcom_train/5395195 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean accept(File f) {
if (f.isDirectory())
return true;
String extension = null;
String s = f.getName();
int i = s.lastIndexOf('.');
if (i > 0 && i < s.length() - 1) {
extension = s.substring(i + 1).toLowerCase();
}
if (extension != null) {
return validExts.contains(extension);
}
return false;
}
COM: <s> should we accept this file </s>
|
funcom_train/14242422 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int edgesCount(Vector contents) {
int size = contents.size();
int countEdges = 0;
if (contents != null && size > 0) {
for (int i=0; i<size; i++) {
if (contents.elementAt(i) instanceof FigSeqLink) {
countEdges++;
}
}
}
return countEdges;
}
COM: <s> count the edges that are in this diagram </s>
|
funcom_train/31653637 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getNextFunctionId( ){
NodeList funcs = getFunctions( );
int max = 0;
for(int i=0;i<funcs.getLength( );i++){
Element func = (Element)funcs.item(i);
int id = Integer.parseInt(func.getAttribute(ID));
if(id>=max){
max = id+1;
}
}
return max;
}
COM: <s> gets a number that is 1 the highest function id </s>
|
funcom_train/27843672 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setPreviousBinding(Binding previousBinding) {
_previousBinding = previousBinding;
if ((_previousBinding != null) && (_previousBinding instanceof ChainedBinding)) {
ChainedBinding chainedBinding = (ChainedBinding) _previousBinding;
if (chainedBinding.getNextBinding() != this) {
chainedBinding.setNextBinding(this);
}
}
}
COM: <s> sets the previous binding </s>
|
funcom_train/35301294 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setArray (int parameterIndex, Array array) throws SQLException {
checkParamIndex(parameterIndex);
if (params == null){
throw new SQLException("Set initParams() before setArray");
}
params.put(Integer.valueOf(parameterIndex - 1), new SerialArray(array));
}
COM: <s> sets the designated parameter to an code array code object in the </s>
|
funcom_train/18215279 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String handle(Throwable e, String message) {
String result = message + "\n";
if (e != null) {
result += e.getClass().toString() + "\n";
if (e.getMessage() != null) {
result += e.getMessage() + "\n\n";
}
if (e instanceof Exception) {
try {
Log.warn(InitializationService.class, (Exception) e);
} catch (Error error) {
logError = true;
}
}
}
return result;
}
COM: <s> handles an exception within the server and returns an error message </s>
|
funcom_train/22770878 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PaloServer getServer(String serverId){
PaloConfiguration.PaloServer r = null;
for (Iterator it = servers.iterator(); it.hasNext();) {
PaloServer server = (PaloServer) it.next();
if(serverId.equals(server.getId())){
r = server;
break;
}
}
return r;
}
COM: <s> returns server configuration by server id </s>
|
funcom_train/545754 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void translate(double x, double y) {
for (int i = 0; i < summit.length; i++) {
summit[i].x += x;
summit[i].y += y;
}
origin.x += x;
origin.y += y;
updateShape();
}
COM: <s> translate this object </s>
|
funcom_train/14012778 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Element addPartGroup(String groupId) {
Element messagePartGroupElement = getDocument().createElement("message-part-group");
messagePartGroupElement.setAttribute("id", groupId);
serverMessageElement.appendChild(messagePartGroupElement);
return messagePartGroupElement;
}
COM: <s> adds a group to the document </s>
|
funcom_train/9993222 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void fireCellClickedEvent(int row, int column) {
if (listeners.size() > 0) {
CellClickEvent event = new CellClickEvent(this, row, column);
for (Iterator iterator = listeners.iterator(); iterator.hasNext();) {
BaseTreeTableListener listener = (BaseTreeTableListener) iterator.next();
listener.onCellClicked(event);
}
}
}
COM: <s> fires a cell clicked event </s>
|
funcom_train/130955 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void getScanProperties () {
try {
sendHeader (PLAYER_MSGTYPE_REQ, PLAYER_LASER_REQ_GET_CONFIG, 0);
os.flush ();
} catch (IOException e) {
throw new PlayerException
("[Laser] : Couldn't request PLAYER_LASER_REQ_GET_CONFIG: " +
e.toString(), e);
}
}
COM: <s> configuration request get scan properties </s>
|
funcom_train/2546830 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getGenericArgs() {
ArrayList a = new ArrayList();
Collection argCollection = arguments.values();
Iterator iter = argCollection.iterator();
while (iter.hasNext()) {
CommandArgument arg = (CommandArgument) iter.next();
if (!(arg.isInputFile() || arg.isOutputFile())) {
a.add(arg);
}
}
return a;
}
COM: <s> gets arguments to this application which are not input or output files </s>
|
funcom_train/38157559 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void updateVisibility() {
TreeTableModel model = (TreeTableModel) TreeTable.this.tree.getModel();
for(int i = 0, j = 1; i < columns.size(); i++, j++) {
((JCheckBox) checkboxes.get(i)).
setSelected(model.isColumnVisible(j));
}
}
COM: <s> update the visibility of the columns </s>
|
funcom_train/22108442 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getValue(String key){
String res;
synchronized(this.keyVals){
res = (String)this.keyVals.get(key);
}
if(log.isDebugEnabled()){
this.log.debug("Got " + key + "='" + res + "'");
}
return res;
}
COM: <s> gets a value from the storage object </s>
|
funcom_train/35668984 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void showMonitor(boolean show) {
Monitor monitor = playerModel.getMonitor();
int newHeight = getSize().height;
int monitorHeight = monitor.getSize().height;
if (show) {
playerPanel.add(monitor, BorderLayout.SOUTH);
newHeight += monitorHeight;
} else {
playerPanel.remove(monitor);
newHeight -= monitorHeight;
}
Dimension newSize = new Dimension(getSize().width, newHeight);
playerPanel.setSize(newSize);
setSize(newSize);
playerModel.setMonitorVisible(show);
repaint();
}
COM: <s> show hide the current monitor from the applcation frame </s>
|
funcom_train/16570509 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void refreshCommands() {
int type=IOperator.NUMBER;
if (getRbNumber().isSelected()) {
type=IOperator.NUMBER;
} else if (getRbString().isSelected()) {
type=IOperator.STRING;
} else if (getRbDate().isSelected()) {
type=IOperator.DATE;
}
refreshOperators(type);
}
COM: <s> refresh the commands </s>
|
funcom_train/18955301 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void create(MCRObjectID mcrid, org.jdom.Document xml) throws MCRException {
getXMLTable(mcrid.getTypeId()).create(mcrid.getId(), MCRUtils.getByteArray(xml), 1);
jdomCache.put(mcrid, xml);
CONFIG.systemModified();
}
COM: <s> the method create a new item in the datastore </s>
|
funcom_train/12602807 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setDimensions(int[] dims) {
checkDimensions(dims);
if ((this.dims != null) && (numberOfElements(dims) != getNumberOfElements())) {
throw new IndexOutOfBoundsException("Number of elements in array must not change");
}
this.dims = (int[]) dims.clone();
}
COM: <s> sets this arrays dimensions optional operation </s>
|
funcom_train/4349275 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setPlayersCounters(int p1Score, int p2Score) {
TextView txtP1 = (TextView) this.view.findViewById(R.id.txtPlayer1Counter);
txtP1.setText(String.format(" %d", p1Score));
TextView txtP2 = (TextView) this.view.findViewById(R.id.txtPlayer2Counter);
txtP2.setText(String.format(" %d", p2Score));
}
COM: <s> draws the scores </s>
|
funcom_train/34620195 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getSwitchLabel(TreeNode node) {
TreeNode fc = node.getFirstChild();
if (fc.getName().equals("DEFAULT")) {
return "default";
} else if (fc.getName().equals("CASE")) {
TreeNode tLabelIdent = node.getChild(1);
String sLabel = getTrimmedLabel(tLabelIdent);
return sLabel;
} else {
throw new IllegalArgumentException("Not a valid SwitchCase node");
}
}
COM: <s> returns the label of a switch case </s>
|
funcom_train/2610216 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void triggerMediaClosed(PayloadType currPt) {
ArrayList listeners = getListenersList();
Iterator iter = listeners.iterator();
while (iter.hasNext()) {
JingleListener li = (JingleListener) iter.next();
if (li instanceof JingleMediaListener) {
JingleMediaListener mli = (JingleMediaListener) li;
mli.mediaClosed(currPt);
}
}
}
COM: <s> trigger a jmf closed event </s>
|
funcom_train/4187163 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object getCellEditorValue() {
Boolean aux= false;
// Se obtiene la opción del JCheckBox elegida y se devuelve un
// Booleano adecuado.
System.out.println("getCellEditorValue\n");
if (this.isSelected())
{
aux=true;
}
else{
aux=false;
}
return aux;
}
COM: <s> returns the value contained in the editor </s>
|
funcom_train/25365948 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addFailTextPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_DialogSkillTest_failText_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_DialogSkillTest_failText_feature", "_UI_DialogSkillTest_type"),
LeveleditorPackage.Literals.DIALOG_SKILL_TEST__FAIL_TEXT,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the fail text feature </s>
|
funcom_train/19412119 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void processWindowEvent(WindowEvent e) {
try {
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
platform.close();
}
else if (e.getID() == WindowEvent.WINDOW_OPENED) {
updateToolBar();
}
}
catch (Exception ex) {
platform.handleError(ex.toString(),ex);
}
}
COM: <s> overridden to exit when window is closed </s>
|
funcom_train/44385032 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Collection collectAttributesByName(String attName) {
Collection result = new ArrayList();
Iterator it = attributes.iterator();
while (it.hasNext()) {
Attribute anAttribute = (Attribute) it.next();
if (anAttribute.getName().equals(attName)) {
result.add(anAttribute);
}
}
return result;
}
COM: <s> get registered attributes whose name are equals to a given name </s>
|
funcom_train/34146666 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setInnerWidget(IWidget innerWidget) {
if (this.innerWidget != null) {
removeInnerWidget();
}
this.innerWidget = innerWidget;
innerWidget.setParent(this);
if (isInWidgetTree())
this.innerWidget.addedToWidgetTree();
if (innerWidget instanceof ObservableWidget)
((ObservableWidget) innerWidget).addMouseListener(mouseWheelListener);
//scroll to origin point
this.scrollHorizontal(0.0d);
this.scrollVertical(1.0d);
}
COM: <s> sets the inner widget requires a code layout code call </s>
|
funcom_train/3423329 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addRecognizedProperties(String[] propertyIds) {
// add recognizedProperties
int propertyIdsCount = propertyIds != null ? propertyIds.length : 0;
for (int i = 0; i < propertyIdsCount; i++) {
String propertyId = propertyIds[i];
if (!fRecognizedProperties.contains(propertyId)) {
fRecognizedProperties.add(propertyId);
}
}
} // addRecognizedProperties(String[])
COM: <s> allows a parser to add parser specific properties to be recognized </s>
|
funcom_train/16911843 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isEmpty() {
boolean neuronsGone = false;
boolean networksGone = false;
if (this.getNeuronCount() == 0) {
neuronsGone = true;
}
if (this.getNetworkList().isEmpty()) {
networksGone = true;
}
return (neuronsGone && networksGone);
}
COM: <s> returns true if all objects are gone from this network </s>
|
funcom_train/8652544 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void linkValueUsingAColumnCopy(Column column, SimpleValue value) {
initMappingColumn(
//column.getName(),
column.getQuotedName(),
null, column.getLength(),
column.getPrecision(),
column.getScale(),
getMappingColumn().isNullable(),
column.getSqlType(),
getMappingColumn().isUnique(),
false //We do copy no strategy here
);
linkWithValue( value );
}
COM: <s> used for mapped by cases </s>
|
funcom_train/15916951 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean canReach(XPromise p) {
if (p == this) return true;
if (value != null) return value.canReach(p);
if (fields != null)
for (XPromise q : fields.values())
if (q.canReach(p)) return true;
return false;
}
COM: <s> is there a path from here to p </s>
|
funcom_train/39289585 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void showCurrentEditValue(DirectEditRequest request) {
String value = (String)request.getCellEditor().getValue();
((NoteFigure)getHostFigure()).setText(value);
//hack to prevent async layout from placing the cell editor twice.
((NoteFigure)getHostFigure()).getUpdateManager().performUpdate();
}
COM: <s> override to show the current direct edit value in the hosts figure </s>
|
funcom_train/4892238 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JSONObject put(String key, Object value) throws JSONException {
if (key == null) {
throw new JSONException("Null key.");
}
if (value != null) {
testValidity(value);
this.myLinkedHashMap.put(key, value);
} else {
remove(key);
}
return this;
}
COM: <s> put a key value pair in the jsonobject </s>
|
funcom_train/43600561 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getDeleteAction() {
ProfileBean currenProfile = (ProfileBean)getSessionScope().get("currentProfile");
ProfileBean ownerProfile = (ProfileBean)getSessionScope().get("ownerProfile");
//It checks if current profile is not the owner profile then delete action is not display.
if(ownerProfile.getUserAuth().getUserId()!=currenProfile.getUserAuth().getUserId())
deleteAction = "false";
return deleteAction;
}
COM: <s> this function is used whether delete component is visible or not </s>
|
funcom_train/22526215 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void newResource() {
NewResourceWizard wizard = new NewResourceWizard(fLDModel);
WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
if(dialog.open() == IDialogConstants.OK_ID) {
IResourceModel resource = wizard.getResource();
fResources.addResource(resource);
}
}
COM: <s> add a new resource </s>
|
funcom_train/23388817 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
String tmp = "";
try {
tmp = Build();
} catch (Exception ex) {
System.out.println("Atom.Build(): " + ex.getMessage());
// throw new Exception("Atom.Build(): " + ex.getMessage());
}
return tmp;
}
COM: <s> generate a string representation of the atom </s>
|
funcom_train/37836324 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void drawTitle(final Graphics2D g2d, final int x, final int y, final int width) {
if (titleSprite != null) {
final int tx = x + ((width - titleSprite.getWidth()) / 2);
final int ty = y - 3 - titleSprite.getHeight();
titleSprite.draw(g2d, tx, ty);
}
}
COM: <s> draw the entity title </s>
|
funcom_train/19871771 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void connect() throws IOException {
SmbTransport trans;
SmbSession ssn;
UniAddress addr;
if( isConnected() ) {
return;
}
getUncPath0();
getFirstAddress();
for ( ;; ) {
try {
doConnect();
return;
} catch(SmbException se) {
if (getNextAddress() == null)
throw se;
if (log.level >= 3)
se.printStackTrace(log);
}
}
}
COM: <s> it is not necessary to call this method directly </s>
|
funcom_train/37854750 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long doCheckout(SVNURL url, File dstPath, SVNRevision pegRevision, SVNRevision revision, boolean recursive) throws SVNException {
return doCheckout(url, dstPath, pegRevision, revision, SVNDepth.fromRecurse(recursive), false);
}
COM: <s> checks out a working copy from a repository </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.