__key__ stringlengths 16 21 | __url__ stringclasses 1 value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/1872477 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public long nextLong(long n) {
if (n<=0)
throw new IllegalArgumentException("n must be positive");
if ((n & -n) == n) // i.e., n is a power of 2
{
return nextLong()&(n-1);
}
long bits, val;
do
{
bits = (nextLong()>>>1);
val = bits % n;
}
while(bits - val + (n-1) < 0);
return val;
}
COM: <s> implements next long long the same way nex int int is implemented in </s>
|
funcom_train/1029157 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testCommentParsing() throws Exception {
createTable("PERSON", "(NAME VARCHAR(32), PERID VARCHAR(32))");
try {
this.pstmt = this.conn.prepareStatement("SELECT NAME AS name2749_0_, PERID AS perid2749_0_ FROM PERSON WHERE PERID=? /*FOR UPDATE*/");
} finally {
closeMemberJDBCResources();
}
}
COM: <s> tests error with slash star comment at eol </s>
|
funcom_train/1805212 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private GenericFeed batchInsertGmailFilters(GenericEntry ... filters)
throws ServiceException, IOException {
GenericFeed feed = new GenericFeed();
for (int i = 0; i < filters.length; i++) {
BatchUtils.setBatchId(filters[i], Integer.toString(i));
feed.getEntries().add(filters[i]);
}
return gmailFilterService.batch(domain, feed);
}
COM: <s> insert one or more gmail filter entries in a single batch operation </s>
|
funcom_train/2295711 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String user(String property) {
if (isNotInitialized()) {
return getMessage(NOT_INITIALIZED);
}
try {
return CmsJspTagUser.userTagAction(property, getRequest());
} catch (Throwable t) {
handleException(t);
}
CmsMessageContainer msgContainer = Messages.get().container(Messages.GUI_ERR_USER_PROP_READ_1, property);
return getMessage(msgContainer);
}
COM: <s> returns a selected user property i </s>
|
funcom_train/4406576 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Event createEvent(int eventType, boolean removable, int special){
Event event = new Event(-1, -1, removable);
if(0 != special){
event = new Event(eventType, special, removable);
}
else{
int factor = Math.abs(random.nextInt());
event = new Event(eventType, factor, removable);
}
return event;
}
COM: <s> creates a new event </s>
|
funcom_train/9545725 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void scheduleEvent(Object content, long simulationTime, SimulationEventHandler handler, SimulationEvent.Type eventType) {
assert currentTime <= simulationTime : "event " + content + " has time " + simulationTime;
SchedulerEventImpl event = new SchedulerEventImpl(eventType, content, simulationTime, handler);
log.debug("Schedule event " + content + " @ " + simulationTime);
this.eventQueue.insert(event);
}
COM: <s> inserts new event in event queue </s>
|
funcom_train/37653447 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean accept(File dir, String name) {
// Any source file should have a '.' in its name...
int lastDotIndex = name.lastIndexOf('.');
if (lastDotIndex < 0) {
return false;
}
String extension = name.substring(1 + lastDotIndex).toUpperCase();
for (Language language : languages) {
for (String ext : language.getExtensions()) {
if (extension.equalsIgnoreCase(ext)) {
return true;
}
}
}
return false;
}
COM: <s> check if a file should be checked by pmd </s>
|
funcom_train/45916334 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void doSell(int i) {
int j = gameWorld.getInventoryCount(gameWorld.player.selectedTech);
gameWorld.player.inventory.put(gameWorld.player.selectedTech, Math.max(0, j - i));
if (j > i) {
j = i;
}
gameWorld.player.money += j * gameWorld.player.selectedTech.buildCost / 2;
repaint();
}
COM: <s> sell the given amount of items from the currently selected one </s>
|
funcom_train/36258854 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeCodec(final C codec) {
codecs.remove(codec);
if (codec == defaultCodec) {
defaultCodec = null;
if (codecs.size() > 0) {
defaultCodec = codecs.get(0);
}
}
fileFilterMap = obtainFileFilterMap();
fileFilters = fileFilterMap.keySet();
}
COM: <s> remove a codec from the list </s>
|
funcom_train/26216112 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void responseBodyConsumed() {
// make sure this is the initial invocation of the notification,
// ignore subsequent ones.
responseStream = null;
if (responseConnection != null) {
responseConnection.setLastResponseInputStream(null);
if (shouldCloseConnection(responseConnection)) {
responseConnection.close();
}
}
this.connectionCloseForced = false;
doneWithConnection = true;
if (!inExecute) {
ensureConnectionRelease();
}
}
COM: <s> a response has been consumed </s>
|
funcom_train/3486144 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean accessMatch(String list, InetAddress addr) {
StringTokenizer tok = new StringTokenizer(list.toLowerCase(), " \t,");
while (tok.hasMoreTokens()) {
String pattern = tok.nextToken();
if (FNMatch.fnmatch(pattern, addr.getHostName(), 0))
return true;
if (matchAddress(addr, pattern))
return true;
}
return false;
}
COM: <s> match an address a hostname or a numeric address to a list of </s>
|
funcom_train/47303922 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void transferInvalidIndexItem(OLAPObject item, PaneSection<OLAPObject> insertSection) {
try {
item.getParent().removeChild(item);
} catch (Exception e) {
throw new RuntimeException(e);
}
getModel().addChild(item, getModel().getChildren().size());
}
COM: <s> handle drag and drop transfer for items with invalid index </s>
|
funcom_train/46760527 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ViewOrderInstanceModel getViewOrderInstance(final long viewOrderInstanceId, final IChainStore chain, final ServiceCall call) throws Exception {
IBeanMethod method = new IBeanMethod() { public Object execute() throws Exception {
return OrderData.getViewOrderInstance(viewOrderInstanceId, chain, call);
}}; return (ViewOrderInstanceModel) call(method, call);
}
COM: <s> same transaction return the single view order instance model for the primary key </s>
|
funcom_train/35442793 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetId_casilla() {
System.out.println("getId_casilla");
Casilla instance = new Casilla();
int expResult = 0;
int result = this.casilla.getId_casilla(); //llama al metodo de la clase casilla
assertEquals(expResult, result);
}
COM: <s> test of get id casilla method of class clases </s>
|
funcom_train/34262262 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String validateExecutables() {
FileAction lFileAction;
for (FileAction theFileAction : this.getCurrentFilePreference().getFileActionList()) {
if (theFileAction.getFileExecutable().length() > 0) {
try {
new FileInputStream(theFileAction.getFileExecutable());
}
catch(FileNotFoundException fnfe) {return theFileAction.getFileExecutable();}
}
}
return null;
}
COM: <s> validates that the executable is a valid </s>
|
funcom_train/18746737 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean removeOmega(CtrlTransition trans) {
assert trans.getCall().isOmega();
assert trans.getNumber() == this.transitions.size() - 1;
this.transitions.remove(trans.getNumber());
boolean result = this.transitionMap.remove(trans.getRule()) != null;
if (result) {
getAut().removeOmega(trans);
}
return result;
}
COM: <s> removes an outgoing transition from this control state </s>
|
funcom_train/3701378 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void initActivityVal(float x) {
for (int i = 0; i < wnd1Min.length; i++) {
wnd1Min[i] = x;
}
for (int i = 0; i < wnd5Min.length; i++) {
wnd5Min[i] = x;
}
for (int i = 0; i < wnd15Min.length; i++) {
wnd15Min[i] = x;
}
} // of method
COM: <s> initialize the activity windows to the specified value </s>
|
funcom_train/42652137 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TableView setTableManager(TableManager mgr) {
this.mgr = mgr ;
// apply same settings to the table (only if it is already initialized)
try {
this.mgrStub.applyStatus(mgr);
} catch(Exception e) {
logger.warn("Could not apply previous status to newly linked table", e);
}
return this ;
}
COM: <s> sets the table manager </s>
|
funcom_train/4925735 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void enterChatName(TextBox nameText, DialogBox userDialog) {
// Ensure user name provided
String name = nameText.getText();
if ((name == null) || (name.trim().length() == 0)) {
Window.alert("Must provide name!");
return;
}
// Name provided
this.userName = name;
userDialog.hide();
// Provide focus for writing message
this.messageText.setFocus(true);
}
COM: <s> enters the chat name </s>
|
funcom_train/28367052 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private double phaseWrappingFunction(double inValue) {
double outValue = inValue;
if (phaseScan_Button.isSelected()) {
if (Math.abs(inValue) > 180.) {
outValue += 180.;
while (outValue < 0.) {
outValue += 360.;
}
outValue = outValue % 360.;
outValue -= 180.;
}
}
return outValue;
}
COM: <s> wrapps the phase if the phase button is on </s>
|
funcom_train/14010858 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getMessage() throws Exception {
StringWriter writer = new StringWriter();
Reader template = new InputStreamReader(getEmailTemplate().openStream());
try {
engine.evaluate(context, writer, "VelocityEmail", template);
return writer.toString();
} finally {
if (template != null) {
template.close();
}
}
}
COM: <s> get the e mail message content evaluated </s>
|
funcom_train/34357481 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void addPredefinedPrefixes() {
prefixes.put("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
prefixes.put("rdfs", "http://www.w3.org/2000/01/rdf-schema#");
prefixes.put("owl", "http://www.w3.org/2002/07/owl#");
prefixes.put("xsd", "http://www.w3.org/2001/XMLSchema#");
prefixes.put("sswap", SSWAPVocabulary.SSWAP_NS);
}
COM: <s> adds predefined prefixes to the map of prefixes </s>
|
funcom_train/450636 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void update (Observable observable, Object object) {
//Ensure Observable is an Environment.
Environment environment = null;
if (observable instanceof Environment) {environment = (Environment) observable;}
else {return;}
//While object count is greater than MaxPopulation:
while (environment.getObjectCount() > maxPopulation) {
//Call findOldestObject() on the environment.
GameObject oldestObject = findOldestObject(environment);
//If an object was found, remove it from the environment.
if (oldestObject != null) {environment.removeObject(oldestObject);}
}
}
COM: <s> act on the specified environments objects </s>
|
funcom_train/2903411 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private ZDrawable restoreDrawable(JToggleButton b){
String l = label.getText();
if((l!=null) && (l.length()>0)){
b.setText(l);
}
String path = icon.getText();
if((path!=null) && (path.length()>0)){
ImageIcon icon = ZImageRetriever.getImageIcon(path);
if(icon != null){
b.setIcon(icon);
}
}
String tooltip = tip.getText();
if((tooltip!=null) && (tooltip.length()>0)){
b.setToolTipText(tooltip);
}
ZDrawable dw = new ZDrawable(l, path);
dw.setTooltip(tooltip);
return dw;
}
COM: <s> restore drawable data </s>
|
funcom_train/18717256 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void center(final Rectangle bounds) {
// get the frame's current size
final Dimension frameSize = getSize();
// calculate center position and set it on the frame
if (frameSize.height > bounds.height) {
frameSize.height = bounds.height;
}
if (frameSize.width > bounds.width) {
frameSize.width = bounds.width;
}
setLocation(bounds.x + (bounds.width - frameSize.width) / 2, bounds.y
+ (bounds.height - frameSize.height) / 2);
}
COM: <s> center the frame over a given rectangle on the screen </s>
|
funcom_train/32057098 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetParentView() {
System.out.println("testGetParentView");
Object obj = new Object();
JGraph jgraph = new JGraph();
CellMapper cellmapper = null;
PortView pView = new PortView(obj, jgraph, cellmapper);
pView.getParentView();
}
COM: <s> this function tests get parent view function of port view class </s>
|
funcom_train/1429228 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPasswordField getJPasswordField() {
if (jPasswordField == null) {
jPasswordField = new JPasswordField();
jPasswordField.setLocation(new Point(290, 30));
jPasswordField.setSize(new Dimension(158, 20));
}
return jPasswordField;
}
COM: <s> this method initializes j password field </s>
|
funcom_train/17343391 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public V get(K key1, K key2) {
V ret = null;
List<Entry<K,V>> el = key1Entries.get(key1);
for(Entry<K,V> en : el) {
if(en.key2 == key2) {
ret = en.val;
break;
}
}
return ret;
}
COM: <s> returns the value associated with the given keys or null if </s>
|
funcom_train/21343973 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean checkAnswer(int usrAns){
boolean isCorrect = false;
if(usrAns == ansNote){
printToast("Correct!");
isCorrect = true;
}
else if(usrAns != ansNote && profile.getOpts().showAns){
printToast("Incorrect! Answer was " + notes.notes[ansNote].getName());
}
else if(usrAns != ansNote && !profile.getOpts().showAns){
printToast("Incorrect!");
}
return isCorrect;
}
COM: <s> checks to see if answer is correct </s>
|
funcom_train/3440071 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public AudioFileFormat getAudioFileFormat(URL url) throws UnsupportedAudioFileException, IOException {
InputStream urlStream = url.openStream(); // throws IOException
AudioFileFormat fileFormat = null;
try {
fileFormat = getFMT(urlStream, false);
} finally {
urlStream.close();
}
return fileFormat;
}
COM: <s> obtains the audio file format of the url provided </s>
|
funcom_train/10748763 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void test4() {
try {
Object o = java.lang.PackageAccessible
.getProtectedClassInstance();
Constructor c = o.getClass().getDeclaredConstructor((Class[]) null);
c.newInstance((Object[]) null);
fail("Exception expected");
} catch (Exception e) {
assertTrue(e.getMessage(), e instanceof IllegalAccessException);
}
}
COM: <s> attempt to create an inner class which is package accessible </s>
|
funcom_train/8130978 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Page checkPage(String pageName) throws ServletException {
pageName = pageName.replace('/', '.');
Page p;
try {
p = (Page) Class.forName(pageName).newInstance();
} catch (InstantiationException e) {
throw new ServletException(e);
} catch (IllegalAccessException e) {
throw new ServletException(e);
} catch (ClassNotFoundException e) {
// will happen if more than one import in servlet config is used.
p = null;
} catch (ClassCastException e) {
throw new ServletException(e);
}
return p;
}
COM: <s> check if a page exist with the name page name </s>
|
funcom_train/9238105 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean callChannelPart(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sReason) {
final CallbackOnChannelPart cb = (CallbackOnChannelPart)getCallbackManager().getCallbackType("OnChannelPart");
if (cb != null) { return cb.call(cChannel, cChannelClient, sReason); }
return false;
}
COM: <s> callback to all objects implementing the channel part callback </s>
|
funcom_train/38481682 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isValid(){
/* Gradient test for validity. If the two sides of the subflame are similar then it is invalid */
if( (int)(gradient(points[0], points[1] )*100.0) != (int)(gradient(points[points.length - 1], points[points.length - 2])*100.0)){
valid = true;
}else{
valid = false;
}
return valid;
}
COM: <s> decides if the subflame is valid </s>
|
funcom_train/3703778 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void handleRightClickOnProperty(TreePath selPath, int x, int y) {
DefaultMutableTreeNode node;
NodeProperty prop;
node = (DefaultMutableTreeNode) selPath.getLastPathComponent();
prop = (NodeProperty) node.getUserObject();
// xxx
System.out.println("display context menu property " + prop.getKey());
} // of method
COM: <s> handle a right click on a property </s>
|
funcom_train/4802031 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void executeQuery(String query, boolean setXML) throws SQLException {
boolean foundResults =
statement.execute(query);
System.out.println(query);
if(foundResults){
ResultSet set = statement.getResultSet();
statement2.execute(query);
ResultSet anotherset = statement2.getResultSet();
if(set!=null) {
//check to see if we need to output to xml or not
if (setXML == true){
displayResults(set);
}
//displayonGUI(screen,anotherset);
}
}else {
connection.close();
}
}
COM: <s> sql execution without displaying the sql statement on the display screen </s>
|
funcom_train/32040451 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addParametersPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_LearningActivityType_parameters_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_LearningActivityType_parameters_feature", "_UI_LearningActivityType_type"),
ImsldPackage.eINSTANCE.getLearningActivityType_Parameters(),
true,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the parameters feature </s>
|
funcom_train/864551 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void checkIsNotNan( String message ) {
String notNan = newLabel();
dup();
findPropStrict( "isNaN" );
swap();
callProperty( "isNaN", 1 );
iffalse( notNan );
trace( message );
pushString( message );
instructions.append( OP_throw );
target( notNan );
label();
}
COM: <s> check that stack top is not na n </s>
|
funcom_train/12187239 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setMode(String mode) {
if ("lower".equals(mode)) {
convertToLowerCase = true;
} else if ("upper".equals(mode)) {
convertToLowerCase = false;
} else {
throw new IllegalArgumentException(
"Mode should be 'upper' or 'lower' only.");
}
}
COM: <s> the mode of this operation process which may be lowercase or uppercase </s>
|
funcom_train/37422336 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Tool findToolByName(String pName) throws ClassNotFoundException, SQLException {
Vector tVect = findToolByQuery("select * from tool where name = " + Utility.isNull(pName));
if (tVect.size() > 0)
return (Tool) tVect.firstElement();
else
return null;
}
COM: <s> finds a tool in the database using its name </s>
|
funcom_train/13995258 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void initTransientState() {
super.initTransientState();
area = new JTextArea(10, getConfig().getWidth());
area.setFont(new JTextField().getFont());
JScrollPane scrollpane = new JScrollPane(area);
setJComponent(scrollpane);
documentListener = new UpdateListener();
getTextArea().getDocument().addDocumentListener(documentListener);
}
COM: <s> creates a new component and registers listeners </s>
|
funcom_train/14433312 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Properties loadFromFile(String fileName) {
final Properties properties = new Properties();
try {
properties.load(new FileInputStream(fileName));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return properties;
}
COM: <s> p load all application strings from the properties file </s>
|
funcom_train/7310185 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Method findAnalyseMethod(JComponent c) {
for (Class clazz = c.getClass();
clazz != null;
clazz = clazz.getSuperclass()) {
try {
return getClass().getMethod("analyse", new Class[] { clazz });
} catch (NoSuchMethodException e) {
log("parameter=" + clazz + "; Receiver=" + getClass());
}
}
return null;
}
COM: <s> looks up and returns the appropriate analyse method </s>
|
funcom_train/2864847 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Vector getSubfields(IniFileSection section) {
Vector sfields = new Vector();
int j = 0;
for (int i=1; true; i++) {
j = section.getIntValue("subfield"+i, 0);
if (j > 0)
sfields.addElement(new Integer(j));
else
break;
}
if (sfields.size() > 0)
return sfields;
else
return null;
}
COM: <s> reads repeatable integer values from an ini file section </s>
|
funcom_train/33598673 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public StringItem getStringItem5() {
if (stringItem5 == null) {//GEN-END:|59-getter|0|59-preInit
// write pre-init user code here
stringItem5 = new StringItem("press sendAudio to send audio", null);//GEN-LINE:|59-getter|1|59-postInit
// write post-init user code here
}//GEN-BEGIN:|59-getter|2|
return stringItem5;
}
COM: <s> returns an initiliazed instance of string item5 component </s>
|
funcom_train/29606671 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int getDepth(final XebeceTreeNode node) {
int depth = 0;
TreeNode currentNode = node;
while (currentNode != null) {
currentNode = currentNode.getParent();
depth++;
}
int newMaxDepth = Math.max(maxDepth, depth);
if (newMaxDepth != maxDepth) {
maxDepth = newMaxDepth;
rebuildColorMaps();
}
return depth;
}
COM: <s> computes the depth of a node in its tree </s>
|
funcom_train/16315856 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void editTagPainterMenuItemActionPerformed() {
String sourceText = Core.getEditor().getCurrentEntry().getSrcText();
String tagString = StaticUtils.buildPaintTagList(sourceText);
if(!tagString.equals("")) {
Core.getEditor().insertText(tagString);
}
}
COM: <s> identify all the tags in the source text and automatically inserts </s>
|
funcom_train/10911890 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public short getCodePointForGlyph(String charName) {
String[] names = this.charNameMap;
if (names == null) {
names = getCharNameMap();
}
for (short i = 0, c = (short)names.length; i < c; i++) {
if (names[i].equals(charName)) {
return i;
}
}
return -1;
}
COM: <s> returns the index of a character glyph with the given name </s>
|
funcom_train/46616975 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JMenuBar getMainMenuBar() {
if (mainMenuBar == null) {
mainMenuBar = new JMenuBar();
mainMenuBar.add(getFileMenu());
mainMenuBar.add(getExtraMenu());
mainMenuBar.add(getInfoMenu());
}
return mainMenuBar;
}
COM: <s> this method initializes main menu bar </s>
|
funcom_train/22106304 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addPortlets(List definitions, int column) {
Iterator i = definitions.iterator();
while (i.hasNext()) {
Object o = i.next();
if (o instanceof Portlet) {
addPortlet((Portlet) o, column);
}
else {
addPortlet(new Portlet((String) o), column);
}
}
}
COM: <s> attach a list of portlets to the indicated column of the </s>
|
funcom_train/45349224 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Rule getNoDrinkRule() {
Random r = new Random();
int random = r.nextInt(ruleGroups.size());
RuleGroup rg = ruleGroups.get(random);
while (rg.isDrinkingGroup()) {
random = r.nextInt(ruleGroups.size());
rg = ruleGroups.get(random);
}
return rg.getRandomRule();
}
COM: <s> returns a non drinking rule </s>
|
funcom_train/19845487 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: static public Value colorValue(String name, Color currentValue) {
return new DefaultValue(name, EffectUtil.toString(currentValue)) {
public void showDialog() {
Color newColor = JColorChooser.showDialog(null,
"Choose a color", EffectUtil.fromString(value));
if (newColor != null)
value = EffectUtil.toString(newColor);
}
public Object getObject() {
return EffectUtil.fromString(value);
}
};
}
COM: <s> prompts the user for a colour value </s>
|
funcom_train/2438925 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void publish(IntegrationEntity entity) {
if (entity == null) {
ApplicationMessageEvent.postInformationMessage(sender, " "); //$NON-NLS-1$
} else {
EntityPath path = new EntityPath(entity, includeProject);
ApplicationMessageEvent.postInformationMessage(sender, path.toString(), new ApplicationMessageEvent.LifeTime(lifetime));
}
}
COM: <s> publishes the path to the given entity </s>
|
funcom_train/13568438 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void moveWaitToBuffer(final double now) {
while (hasBufferSpace()) {
DBSimVehicle veh = this.waitingList.poll();
if (veh == null) {
return;
}
DBSimulation.getEvents().processEvent(
new AgentWait2LinkEventImpl(now, veh.getDriver().getPerson().getId(), this.getLink().getId(), null));
addToBuffer(veh, now);
}
}
COM: <s> move as many waiting cars to the link as it is possible </s>
|
funcom_train/46466789 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString(TransactionProduct txProduct) {
if(memberId == null)
{
return String.valueOf(id) + "," + txProduct.getProductId() + "," + ContentConstants.PUBLIC_MEMBER + "," + txProduct.getQuantity();
}
else
{
return String.valueOf(id) + "," + txProduct.getProductId() + "," + memberId + "," + txProduct.getQuantity();
}
}
COM: <s> covert the transaction to a string for saving in data file </s>
|
funcom_train/46189804 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testConstructionOfSimpleInstance() {
Category blogCategory = new Category("/testCategory1", "Test Category 1");
assertEquals("/testCategory1", blogCategory.getId());
assertEquals("Test Category 1", blogCategory.getName());
}
COM: <s> test that a category instance can be created correctly </s>
|
funcom_train/43913971 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void handleCapability() {
start("Capability");
start("Request");
handleGetCapabilities();
handleDescribeFT();
handleGetFeature();
if (wfs.getServiceLevel() >= WFS.TRANSACTIONAL) {
handleTransaction();
}
if (wfs.getServiceLevel() == WFS.COMPLETE) {
handleLock();
handleFeatureWithLock();
}
end("Request");
end("Capability");
}
COM: <s> encodes the wfs capability element </s>
|
funcom_train/18087372 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setAddressLocation(GeoPosition addressLocation) {
GeoPosition old = getAddressLocation();
this.addressLocation = addressLocation;
setCenter(getTileFactory().geoToPixel(addressLocation, getZoom()));
firePropertyChange("addressLocation", old, getAddressLocation());
}
COM: <s> gets the current address location of the map </s>
|
funcom_train/4114312 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String toString() {
String output = "";
output += getUnitList() + "\n";
for (int i = 0; i < height; i++) {
for (int j = 0; j < i; j++) {
output += ' ';
}
for (int j = 0; j < width; j++) {
output += '|';
output += tiles[i][j].getChar();
}
output += "|\n";
}
return output;
}
COM: <s> print the board </s>
|
funcom_train/18661705 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void streamLoad( InputStream is ) {
getPictureCollection().setSendModelUpdates( false ); // turn off model notification of each add for performance
new XmlReader( is, this );
getPictureCollection().setSendModelUpdates( true );
getPictureCollection().sendNodeStructureChanged( this );
}
COM: <s> loads the collection indicated by the input stream at the this node </s>
|
funcom_train/51602087 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void fillHostList(DefaultListModel dlm) {
Log.log(this, Log.Level.DEBUG, "Filling host list");
hostsList.setModel(dlm);
if(dlm != null && dlm.getSize() > 0) detectOSButton.setEnabled(true);
}
COM: <s> fill the host list </s>
|
funcom_train/39370640 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void persist(IContext aContext, IEvent anEvent) {
try {
ContextEventOutputStream outputStream = new ContextEventOutputStream(new FileOutputStream(getFileName(),
true));
outputStream.writeContextEventPair(new ContextEventPair(aContext, anEvent));
outputStream.flush();
outputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
COM: <s> persiste context and event </s>
|
funcom_train/20271210 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private long getLastModifiedTime(File file) {
long fileLastModified = file.lastModified();
// If the file is absent, we don't know if it changed (maybe was deleted),
// so assume it has just changed.
if (fileLastModified == 0) {
fileLastModified = new Date().getTime();
}
return fileLastModified;
}
COM: <s> returns the last modified timestamp of the given file </s>
|
funcom_train/51376436 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void delete() throws AuthValidationException {
if (vq == null) {
throw new AuthValidationException("Use loadQueueEntry(...) method first");
}
try {
vq.delete(true);
vq = null;
} catch (DBException dbe) {
throw new AuthValidationException("DB error", dbe);
}
}
COM: <s> deletes the validation entry and all the connected parameters </s>
|
funcom_train/39169567 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getLrName(Object lrId) {
int secondSeparator = ((String) lrId).lastIndexOf("___");
lrId = ((String) lrId).substring(0, secondSeparator);
int firstSeparator = ((String) lrId).lastIndexOf("___");
return ((String) lrId).substring(0, firstSeparator);
} // getLrName
COM: <s> get the name of an lr from its id </s>
|
funcom_train/11733133 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public NodeStateEx getNode(NodeId id) throws RepositoryException {
try {
NodeState state = (NodeState) stateMgr.getItemState(id);
return new NodeStateEx(stateMgr, ntReg, state, name);
} catch (ItemStateException e) {
throw new RepositoryException("Unable to getNode: " + e.toString());
}
}
COM: <s> returns the node with the given id </s>
|
funcom_train/49654443 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int compare(Object obj1, Object obj2) {
EventScore a = (EventScore) obj1;
EventScore b = (EventScore) obj2;
Match m = MatchManager.getInstance().getMatch(matchName);
int compare = m.getEvent(b).computePoints(b) - m.getEvent(a).computePoints(a);
if (!ascending) {
compare *= -1;
}
return compare;
}
COM: <s> override compare so that event scores can be sorted by due date </s>
|
funcom_train/49350001 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getProgressPanel() {
if (progressPanel == null) {
waitLabel = new JLabel();
waitLabel.setText(resource.getString("pleaseWait"));
GridLayout gridLayout = new GridLayout();
gridLayout.setRows(2);
gridLayout.setVgap(2);
gridLayout.setColumns(1);
progressPanel = new JPanel();
progressPanel.setLayout(gridLayout);
progressPanel.add(waitLabel, null);
progressPanel.add(getGraphicProgressBar(), null);
}
return progressPanel;
}
COM: <s> this method initializes progress panel </s>
|
funcom_train/23868892 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void onPointSelect(final PointSelectEvent event) {
final LatLng point = event.getLatLng();
JsfMessageUtil.addMessage(
JsfMessageUtil.getMessage("primefacesBundle", "googleMapsPointMessage", point.getLat(), point.getLng()));
}
COM: <s> handles clicking on a point by adding a message with positional </s>
|
funcom_train/3063693 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void createFieldEditors() {
TabFolder folder = new TabFolder(getFieldEditorParent(), SWT.NONE);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.horizontalSpan = 3;
folder.setLayoutData(gd);
List analysisPackageDescriptors = AnalysisRecord.getAnalysisPackageDescriptors();
for (Iterator iter = analysisPackageDescriptors.iterator(); iter.hasNext();) {
AnalysisPackageDescriptor packageDescriptor = (AnalysisPackageDescriptor) iter.next();
createAnalysisPackagePreferencesPage(packageDescriptor, folder);
}
}
COM: <s> creates the field editors </s>
|
funcom_train/43918277 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void endElement(Feature feature) throws IOException {
Iterator iter=extraAttributes.keySet().iterator();
while(iter.hasNext()) {
String attrName=(String)iter.next();
write(" "+attrName+"=\""+extraAttributes.get(attrName)+"\"");
}
write("/>\n");
}
COM: <s> encodes feature ending </s>
|
funcom_train/49469580 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public RiskGroupId createGroup(Group group) throws Exception, RaciException{
Db db = dbRW();
try{
db.begin();
_logger.info("RiskRegister : createGroup "+group);
int peopleId = getCurrentUser();
DbPerso.checkUserCanCreateGroup(db, peopleId);
RiskGroupId id = DbRiskGroup.createGroup(db, group, peopleId);
db.commit();
return id;
} catch (Exception e) { store(e); throw e; } finally { db.safeClose(); }
}
COM: <s> create a group of risks </s>
|
funcom_train/3927822 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Component findComponentFor(String url) {
Enumeration enumeration = elements();
while (enumeration.hasMoreElements()) {
ProcessedFileViewer viewer = (ProcessedFileViewer) enumeration.nextElement();
ProcessedFile file = viewer.getProcessedFile();
if (file != null && file.getUrl().equals(url)) {
return viewer.getComponent();
}
}
return null;
}
COM: <s> return the first component viewing a particular file or null if </s>
|
funcom_train/3760095 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: synchronized public void onRegistered() {
logger.info(toString() + " registered");
Iterator i = channels.iterator();
if (isConnected()) {
while (i.hasNext()) {
String channel = (String) i.next();
conn.doJoin(channel);
}
}
}
COM: <s> ircevent listener api </s>
|
funcom_train/24926717 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean printBytes(MobileDeviceInfo deviceInfo, String deviceAddress, byte[] printData) {
boolean returnValue = false;
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
for (BluetoothDevice device : adapter.getBondedDevices()) {
if (device.getAddress().equals(deviceAddress)) {
Thread connectThread = new ConnectThread(device, UUID.randomUUID(), printData);
connectThread.start();
returnValue = true;
break;
}
}
return returnValue;
}
COM: <s> print bytes creating a basic bluetooth connection </s>
|
funcom_train/51358638 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double maxY() {
if (values == null || values.size() == 0) {
System.out.println("MAXY Error");
return -1;
}
double max = ((Point)values.elementAt(0)).y;
for (int i = 0; i < values.size(); i++) {
if (((Point)values.elementAt(i)).y > max) {
max = ((Point)values.elementAt(i)).y;
}
}
return max;
}
COM: <s> returns the largest y value in the database </s>
|
funcom_train/34098102 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int compare(Object o1, Object o2) {
double a = Double.parseDouble(((String) o1).split(";")[2]);
double b = Double.parseDouble(((String) o2).split(";")[2]);
if (a < b) {
return -1;
} else if (b < a) {
return 1;
} else {
return 0;
}
}
COM: <s> compares the hash times </s>
|
funcom_train/42718934 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void scrollPanelResized() {
if (!dataLoaded || !spFilesAreValid) {
return;
}
dataChanged = true;
int minHeight = Math.max(scrollPanel.getSize().height - 50,MIN_HEIGHT);
int width = Math.max(traceLength,
phdPeakLocations[phdPeakLocations.length - 1]);
setPreferredSize(new Dimension((int)(width * zoomX) + 25,
minHeight));
revalidate();
repaint();
rowHeader.revalidate();
rowHeader.repaint();
}
COM: <s> invoked when the scroll panel is resized </s>
|
funcom_train/5445154 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public float getFloat(int Index) {
if ((Index < 1) || (Index >= ItemType.length) || (ItemType[Index] != CONSTANT_FLOAT))
throw new ClassFormatError("Constant pool item does not exist");
return ((Float)ItemValue1[Index]).floatValue();
}
COM: <s> get the float value of a float constant </s>
|
funcom_train/10267943 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getObjectsForClass(String className) {
List result = null;
try {
Query query = createQuery("from " + className);
if (query != null) result = query.list();
}
catch (HibernateException he) {
_log.error("Error restoring data for class: " + className, he);
}
return result ;
}
COM: <s> returns all the instances currently persisted for the class passed </s>
|
funcom_train/37074658 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String parseChadoDbFromFeatureName(String featureName) {
Matcher m = validIdPattern.matcher(featureName);
if (!m.matches()) {
throw new IllegalArgumentException("feature name " + featureName + " does not follow TIGR annotation db naming convention");
}
return m.group(1);
}
COM: <s> assumes a feature uniquename of the form eia1 </s>
|
funcom_train/11096825 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testCreateRobustInOnlyExchange() throws Exception {
MockExchangeFactory instance = new MockExchangeFactory();
RobustInOnly exchange = instance.createRobustInOnlyExchange();
assertNotNull(exchange.getExchangeId());
assertEquals(MockExchangeFactory.ROBUST_IN_ONLY,exchange.getPattern());
}
COM: <s> test of create robust in only exchange method of class mock exchange factory </s>
|
funcom_train/14005386 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String buildOppSearchURL(String id, String key) {
StringBuffer buffer = new StringBuffer();
buffer.append(oppSearchURL);
buffer.append("?");
buffer.append(OppSearchXML.QUERY_REQUEST).append("=");
buffer.append(OppSearchXML.buildRequest(id, key));
return buffer.toString();
}
COM: <s> create the opportunity search url with parameters for sending to the server </s>
|
funcom_train/32777129 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void notifyListeners(int eventType, Object eventContent) {
if (listeners != null) {
// Modifiziert v. Nick (20.11.): Nur 1 Event erzeugen und an alle
// schicken
EnvironmentEvent e = new EnvironmentEvent(this.getModel()
.getExperiment(), eventType, eventContent);
for (Iterator i = listeners.iterator(); i.hasNext();)
((EnvironmentListener) i.next()).environmentChanged(e);
}
}
COM: <s> notifies the environment listeners of a change </s>
|
funcom_train/47925644 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addMavenPluginRepository(String idValue, String nameValue, String urlValue) {
Element pluginRepository = document.createElement("pluginRepository");
Element id = document.createElement("id");
Element name = document.createElement("name");
Element url = document.createElement("url");
id.setTextContent(idValue);
name.setTextContent(nameValue);
url.setTextContent(urlValue);
pluginRepository.appendChild(id);
pluginRepository.appendChild(name);
pluginRepository.appendChild(url);
pluginRepositories.appendChild(pluginRepository);
}
COM: <s> adds new maven plugin repository to the pom file </s>
|
funcom_train/48231102 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deleteWord(String word, Dictionary dictionary) {
try {
PreparedStatement ps = dbConnection.prepareStatement("DELETE FROM ? WHERE word=? and dictionary_id=?");
ps.setString(1, DictionaryEntry.TABLE_NAME);
ps.setString(2, word);
ps.setLong(3, dictionary.getId());
} catch (SQLException e) {
e.printStackTrace();
}
}
COM: <s> deletes a word from the specified dictionary </s>
|
funcom_train/6256850 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initialize() {
setTitle("RemindMe");
JPanel content = new JPanel();
content.setLayout(new BorderLayout());
label = new JLabel();
label.setHorizontalAlignment(SwingConstants.CENTER);
content.add(label, BorderLayout.CENTER);
setContentPane(content);
setSize(new Dimension(350, 100));
setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/images/clock.png")));
}
COM: <s> this method initializes this class </s>
|
funcom_train/41623292 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void modifyAxisLabelFont(Axis axis, int sizeIncreaseInPixels) {
Font labelFont = axis.getLabelFont();
int labelFontSize = labelFont.getSize();
Font newLabelFont = labelFont.deriveFont(Font.BOLD, labelFontSize + sizeIncreaseInPixels);
axis.setLabelFont(newLabelFont);
}
COM: <s> increases the font size and makes it bold </s>
|
funcom_train/4429290 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void fail() {
if (this.card == null) {
Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "Card not initialised while pressing fail(). (Probably a programming error.)");
return;
}
this.progress.fail(this.card);
}
COM: <s> fail the current card </s>
|
funcom_train/16612770 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void inflateDnaFragment(DnaFragment fragment) throws AdaptorException{
GenomeDBAdaptor genomeDBAdaptor =
(GenomeDBAdaptor)getDriver().getAdaptor(GenomeDBAdaptor.TYPE);
if(fragment.getGenomeDB() == null){
fragment.setGenomeDB(genomeDBAdaptor.fetch(fragment.getGenomeDbInternalId()));
}//end if
}
COM: <s> input dnafragment with no genome db object </s>
|
funcom_train/38868393 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: @Test public void testParseSecond() {
// Too high
String grpdata="AA20000820322083260 ";
sao.setGrpData(grpdata);
Assert.assertEquals(1, sao.parseGrp());
// Too high
grpdata="AA20000820322083299 ";
sao.setGrpData(grpdata);
Assert.assertEquals(1, sao.parseGrp());
}
COM: <s> test parse grp for sao group 3 second exceptions </s>
|
funcom_train/2879069 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testOrdering() throws Exception {
OrderedHashtable table = null;
table = new OrderedHashtable(5,5);
for (Object testItem : testItems) {
table.put(testItem, testItem);
}
Enumeration keys=table.keys();
for (Object testItem1 : testItems) {
assertEquals(testItem1, keys.nextElement());
}
}
COM: <s> test the ordering by saving some data then verifying the order </s>
|
funcom_train/13307214 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public LocalRepository getLocalRepository() {
synchronized (id) {
if (localRepository == null) {
try {
localRepository = (LocalRepository) SesameServer.getLocalService().getRepository(id);
} catch (ConfigurationException e) {
logger.log(Level.SEVERE, null, e);
} catch (UnknownRepositoryException e) {
logger.log(Level.SEVERE, null, e);
}
}
}
return localRepository;
}
COM: <s> gets a local repository object for this repository </s>
|
funcom_train/19623037 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void connect() {
TuioTime.initSession();
currentTime = new TuioTime();
currentTime.reset();
try {
oscPort = new OSCPortIn(port);
oscPort.addListener("/tuio/2Dobj", this);
oscPort.addListener("/tuio/2Dcur", this);
// TODO ENDRING
oscPort.addListener("/tuio/2Dblb", this);
oscPort.startListening();
connected = true;
} catch (Exception e) {
System.out.println("TuioClient: failed to connect to port " + port);
connected = false;
}
}
COM: <s> the tuio client starts listening to tuio messages on the configured udp </s>
|
funcom_train/43326046 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void print(Printf outfile) throws IOException {
for (int i=0; i<dimension(); i++) {
outfile.printf("%f ", min_v + (float)i * FBinsize);
outfile.printf("%f ", min_v + ((float)i+0.5) * FBinsize);
outfile.printf("%f ", min_v + (float)(i+1) * FBinsize);
outfile.printf("%d\n",data[i]);
}
}
COM: <s> print out fbins to an open printf </s>
|
funcom_train/14140765 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initialize() {
this.setSize(465, 326);
this.setTitle("Specification Scheduler");
this.setModal(true);
this.setBackground(SystemColor.control);
this.setContentPane( getJContentPane() );
this.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
SchedulerDialog.this.setVisible(false);
}
});
}
COM: <s> this method initializes this </s>
|
funcom_train/45720434 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public WigList () {
setCellRenderer(new ListItemRenderer());
getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
MouseListener ml = new MouseAdapter() {
@Override
public void mousePressed (MouseEvent e) {
int idx = locationToIndex(e.getPoint());
if (idx != -1) {
onClick(idx, getModel().getElementAt(idx));
}
}
};
addMouseListener(ml);
}
COM: <s> creates a wig list instance </s>
|
funcom_train/6328828 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void fireTreeStructureChanged() {
int len = this.treeModelListeners.size();
TreeModelEvent e = new TreeModelEvent(this, new Object[]{rootItem});
for (int i = 0; i < len; i++) {
((TreeModelListener) this.treeModelListeners.elementAt(i)).
treeStructureChanged(e);
}
}
COM: <s> the only event raised by this model is tree structure changed with the </s>
|
funcom_train/22034222 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public VisADRay cursorRay(double[] cursor) {
VisADRay ray = new VisADRay();
ray.position[0] = cursor[0];
ray.position[1] = cursor[1];
ray.position[2] = 0.0;
ray.vector[0] = 0.0;
ray.vector[1] = 0.0;
ray.vector[2] = -1.0;
return ray;
}
COM: <s> return the vis ad ray corresponding to the vis ad cursor coordinates </s>
|
funcom_train/3713100 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setPlotStatus (PlotStatus plot_status) {
this.plot_status = plot_status;
Spectrum spectrum = getSpectrum();
if (plot_status != null && (! spectrum.isNormalizable())) {
String name = plot_status.getYAxisName();
spectrum.selectIntensity(name);
setRestWavelengthsFlag (plot_status.getXAxisName(), spectrum);
}
}
COM: <s> associates a code plot status code object with the spectrum </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.