__key__ stringlengths 16 21 | __url__ stringclasses 1 value | txt stringlengths 183 1.2k |
|---|---|---|
funcom_train/26517943 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int processStack( int stack, DualInt di ) {
if ( di.getOne() > di.getTwo() ) {
stack -= (di.getOne() - di.getTwo() );
} else if ( di.getOne() < di.getTwo() ) {
stack += (di.getTwo() - di.getOne() );
} else {
//
// should be fine
//
}
return stack;
}
COM: <s> used for max stack calculation called from process stack </s>
|
funcom_train/4223631 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setConflictResolver(String conflictReolver0) throws RepException {
if (! (conflictReolver0.equalsIgnoreCase(_Publication.publisher_wins) ||
conflictReolver0.equalsIgnoreCase(_Publication.subscriber_wins))) {
throw new RepException("REP016", null);
}
conflictResolver = conflictReolver0;
log.info("conflictResolver " + conflictResolver);
}
COM: <s> sets the conflict resolver for publication </s>
|
funcom_train/2369673 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setBoolean(final Boolean value) {
if (value == null) {
this.getRepository().removeEntry(this);
} else {
if (value.booleanValue()) {
this.setBinary(new byte[] { (byte) 1 });
} else {
this.setBinary(new byte[] { (byte) 0 });
}
this.getRepository().valueChanged(this);
}
}
COM: <s> sets the boolean value of the entry </s>
|
funcom_train/21406320 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean answerContainsValue(String val){
if(getAnswer() == null)
return false;
if(getDef().getType() == QuestionDef.QTN_TYPE_LIST_MULTIPLE){
Vector optionAnswers = (Vector)getAnswer();
for(byte i=0; i<optionAnswers.size(); i++){
if(((OptionData)optionAnswers.elementAt(i)).getValue().equals(val))
return true;
}
return false;
}
return val.equals(getValueAnswer());
}
COM: <s> checks if a value is one of the multiple selected values answered </s>
|
funcom_train/18846431 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String createSequenceFlowTargetNodeIDMissingException(String tscToken, String componentID, String subSystemCode, String arcID) {
PropertyMap propertyMap = new PropertyMap();
DiagnosticsListCreator edg = new DiagnosticsListCreator();
String severityType = "E";
String exceptionID = "82031";
propertyMap.addPropertyValuePair("arcID", arcID);
String serExMsg = edg.constructErrorDocOneItemParam(tscToken,
componentID,
severityType,
subSystemCode,
exceptionID,
propertyMap);
return serExMsg;
}
COM: <s> target node id of sequence flow arc not supplied </s>
|
funcom_train/46455880 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setTitle(String title, String font_name) {
titleLine.setText(title);
if((font_name==null)||font_name.equals("")) {
return;
}
titleLine.setFont(Font.decode(font_name));
setTitleFont(font_name);
}
COM: <s> set the title of the graph </s>
|
funcom_train/50091050 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setCharge() throws Exception {
List data = new Vector();
st.nextToken();
String sid1 = st.nextToken();
String value1 = st.nextToken();
try {
double va1 = new Double(value1).doubleValue();
data.add(new Double(va1));
} catch (NumberFormatException nfe) {
throw new IOException("setCharge: Malformed Number due to "+nfe.toString());
}
key = "charge" + sid1;
parameterSet.put(key, data);
}
COM: <s> sets the charge attribute stored into the parameter set </s>
|
funcom_train/3946051 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addTitlePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(new ItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_DocumentRoot_title_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_DocumentRoot_title_feature", "_UI_DocumentRoot_type"),
ImscpRootv1p1p2Package.eINSTANCE.getDocumentRoot_Title(),
true,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
}
COM: <s> this adds a property descriptor for the title feature </s>
|
funcom_train/26546588 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void broadcast (Socket senderSocket, byte[] rawPacket) throws IOException {
try {
sendToParent (senderSocket, rawPacket);
} catch (IOException e) {
throw new IOException ("Could not send to parent: " + e.getMessage ());
}
try {
sendToChildren (senderSocket, rawPacket);
} catch (IOException e) {
throw new IOException ("Could not send to child: " + e.getMessage ());
}
}
COM: <s> broadcast the socket uses parent child scope </s>
|
funcom_train/50141828 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object calculate(){
GregorianCalendar gc = new GregorianCalendar();
gc.add(GregorianCalendar.MONTH,1);
gc.set(GregorianCalendar.DAY_OF_MONTH,1);
gc.add(GregorianCalendar.DAY_OF_MONTH,-1);
return gc.getTime();
}
COM: <s> calculates the last day of the last day of the current month </s>
|
funcom_train/1662881 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isCustom() {
if (insert != DEFAULT_INSERT) {
return true;
}
if (!customKey.equals(DEFAULT_CUSTOM_KEY)) {
return true;
}
if (!defaultMimeType.equals(mimeType)) {
return true;
}
if (!DEFAULT_CONTAINER.equals(container)) {
return true;
}
if (replaceEdition != DEFAULT_REPLACE_EDITION) {
return true;
}
if (editionRange != DEFAULT_EDITION_RANGE) {
return true;
}
return false;
}
COM: <s> returns whether the options for this file have been modified i </s>
|
funcom_train/1842722 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addPrefix(String prefix) {
Enumeration pnames = super.propertyNames();
while (pnames.hasMoreElements()) {
String key = ((String)pnames.nextElement());
String val = super.getProperty(key);
if (val == null) val = "";
super.remove(key);
super.put(prefix+"."+key, val);
}
}
COM: <s> add a prefix to all propery names </s>
|
funcom_train/14282621 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getDefault(String slotName) throws JerbilException {
for (Slot slot : slots) {
if (slot.getName().equals(slotName)) {
return slot.getDefault();
}
}
throw new JerbilException(COMMAND_TEMPLATE + ' ' + name + " does not contain " + SUBCOMMAND_SLOT + ' ' + slotName);
}
COM: <s> returns the default vale of the slot for a slot name </s>
|
funcom_train/36715195 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public AbstractSeleniumDriver cannonLogin(String userName, String password) {
String userLocator = "//table[@class='loginTable']//input[@id='USERNAME']";
String passLocator = "//table[@class='loginTable']//input[@name='PASSWORD']";
String submit = "//table[@class='loginTable']//input[@name='login']";
selenium.type(userLocator, userName);
selenium.type(passLocator, password);
selenium.click(submit);
return this;
}
COM: <s> api level method that accept any username and password as a string </s>
|
funcom_train/1422497 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
if ("Servicios".equals(portName)) {
setServiciosEndpointAddress(address);
}
else
{ // Unknown Port Name
throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
}
}
COM: <s> set the endpoint address for the specified port name </s>
|
funcom_train/24067916 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String removeUnwantedCharacters(final String isil) {
final StringBuilder result = new StringBuilder(isil.length());
for (int i = 0; i < isil.length(); i++) {
if (org.apache.commons.lang.StringUtils.isAlphanumeric(isil.substring(i, i + 1))) {
result.append(isil.charAt(i));
} else {
result.append('-');
}
}
return result.toString();
}
COM: <s> removes all non alphanumeric characters in an isil by </s>
|
funcom_train/3100311 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Class loadClass(String name, boolean resolve) throws ClassNotFoundException {
// System.out.println("RESOLVE = '"+resolve+"' NAME = '"+name+"'");
Class c = findClass(name);
if (resolve) {
resolveClass(c);
}
// System.out.println("GOT = '"+c+"'");
return c;
}
COM: <s> loads a class by name with or without resolving it first </s>
|
funcom_train/50640478 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
addNamePropertyDescriptor(object);
addDescriptionPropertyDescriptor(object);
addExclusivePropertyDescriptor(object);
addTargetPropertyDescriptor(object);
addModelPropertyDescriptor(object);
addReferencedSetsPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
COM: <s> this returns the property descriptors for the adapted class </s>
|
funcom_train/8767051 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void saveChangedList() {
if (DeploymentPlugin.getChangedList() != null) {
String changedListContent = "";
for (Iterator it = DeploymentPlugin.getChangedList().keySet()
.iterator(); it.hasNext();) {
changedListContent += "," + it.next();
}
this.getPreferenceStore().putValue(CHANGED_LIST_KEY,
changedListContent);
}
}
COM: <s> save the change list into preference store </s>
|
funcom_train/1674836 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Long getFileNum(boolean first) {
String[] names = listFiles(JE_SUFFIXES);
if (names.length == 0) {
return null;
} else {
int index = 0;
if (!first) {
index = names.length - 1;
}
return getNumFromName(names[index]);
}
}
COM: <s> get the first or last file number in the set of je files </s>
|
funcom_train/34748847 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object borrowObject() throws Exception, NoSuchElementException, IllegalStateException {
final Object obj = pool.borrowObject();
if (type.isInstance(obj)) {
return obj;
} else {
throw new ClassCastException("Borrowed object is not of type: " + type.getName() + " was: " + obj);
}
}
COM: <s> borrow an object from the pool checking its type </s>
|
funcom_train/20443302 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getItemHistorico() {
if (itemHistorico == null) {//GEN-END:|43-getter|0|43-preInit
// write pre-init user code here
itemHistorico = new Command("Historico", Command.ITEM, 0);//GEN-LINE:|43-getter|1|43-postInit
// write post-init user code here
}//GEN-BEGIN:|43-getter|2|
return itemHistorico;
}
COM: <s> returns an initiliazed instance of item historico component </s>
|
funcom_train/17469426 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected int balance(int valuable, int valueless) {
int total = valuable + valueless;
if(total==0)
return 0;
int yes = (valuable * 100 / total + 5) / 10;
if(total<BALANCE_COUNT) {
int abs = yes - 5;
int ax = abs * (BALANCE_COUNT - total) / BALANCE_COUNT;
yes -= ax;
}
if(yes<1)
return 1;
return yes;
}
COM: <s> return balance between yes and no </s>
|
funcom_train/4233204 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setPropertiesVisible(boolean visible) {
propertiesPanel.setVisible(visible);
showPropertiesMenuItem.setSelected(visible);
if (visible) {
properties.remove(DATA_PANEL_PROPERTY_SHOW_PROPERTIES);
} else {
properties.setProperty(DATA_PANEL_PROPERTY_SHOW_PROPERTIES, "false");
}
}
COM: <s> sets the properties panel visibility </s>
|
funcom_train/16849355 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public List getSources() {
List result = new ArrayList();
PreparedStatement stmt = null;
ResultSet rs = null;
try {
stmt = DB.prepare(FIND_SOURCES);
rs = stmt.executeQuery();
while (rs.next()) {
result.add(loadSource(rs));
}
return result;
} catch (SQLException e) {
throw new SeismoException(e);
} finally {
DB.cleanUp(stmt, rs);
}
}
COM: <s> gets a list with all the data sources that </s>
|
funcom_train/45289639 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void processWhiteSpace(int pos, int endPos) {
if (scannerDebug)
System.out.println("processWhitespace(" + pos
+ "," + endPos + ")=|" +
new String(reader.getRawCharacters(pos, endPos))
+ "|");
}
COM: <s> called when a complete whitespace run has been scanned </s>
|
funcom_train/49045259 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JRadioButtonMenuItem getJRadioButtonH_DAB() {
if (buttH_DAB == null) {
buttH_DAB = new JRadioButtonMenuItem();
buttH_DAB.setText("H DAB");
buttH_DAB.setToolTipText("H DAB");
buttH_DAB.addActionListener(this);
buttH_DAB.setActionCommand("parameter");
}
return buttH_DAB;
}
COM: <s> this method initializes the option h dab </s>
|
funcom_train/31649883 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Listener findByRegistrationID(int registrationID) throws Exception{
Iterator it = listeners.iterator();
while (it.hasNext()) {
RegisteredListener rl = (RegisteredListener) it.next();
if (rl.getOID() == registrationID) {
return rl.getListener();
}
}
throw new SQLException("Listener not found for oid " + registrationID);
}
COM: <s> finds a listener instance based on registration id </s>
|
funcom_train/27823216 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deletePropertyInstance(int modelID,OIModelEntity property,OIModelEntity sourceInstance,OIModelEntity targetInstance,String textValue) throws SQLException {
if (targetInstance!=null)
deleteRelationInstance(modelID,property,sourceInstance,targetInstance);
if (textValue!=null)
deleteAttributeInstance(modelID,property,sourceInstance,textValue);
}
COM: <s> deletes a property instance object </s>
|
funcom_train/42375504 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void ErrorOccured(String error){
ErrorOccuredEvent event = new ErrorOccuredEvent(this, error);
for(int i=0;i<this.error_occured_listener.size();i++) {
this.error_occured_listener.get(i).ErrorOccured(event);
}
}
COM: <s> to specifie that a new error occured </s>
|
funcom_train/47302077 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected double repulsiveForce(double distance,LayoutNode u, LayoutNode v, double emptyRadius) {
final double baseForce = .1;
final double tableSizes = u.getHeight() + u.getWidth() + v.getHeight() + v.getWidth();
double force;
force = baseForce * tableSizes *( emptyRadius * emptyRadius ) / (distance * distance );
return force;
}
COM: <s> calculate the repulsive force </s>
|
funcom_train/46590766 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void connect(String serverAddress, Integer serverPort) throws IOException {
if (isConfigured() && this.isRunning) {
kryonetClient.connect(5000, serverAddress, serverPort);
Log.CLIENT.info("Client connected to " + serverAddress + " on port " + serverPort + ".");
} else {
throw new IOException();
}
}
COM: <s> connects to a server </s>
|
funcom_train/14416529 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void start() {
if (iClose) {
iClose = false;
ThreadGroup group = new ThreadGroup("CIMListener on port " + String.valueOf(iPort));
iDispatcher = new HttpConnectionDispatcher(group, iHandler, new ThreadPool(1, 16,
group, "Handler "));
iDispatcher.start();
iRunner = new Thread(group, this, iServerName);
iRunner.setDaemon(true);
iRunner.start();
}
}
COM: <s> starts the server thread </s>
|
funcom_train/1518936 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void scaleTime(float t1, float t2){
if(this.t1 != this.t2){
float mult = (t2 - t1) / (this.t2 - this.t1);
for(int i = 0; i < points.length; i++){
points[i][0] -= this.t1;
points[i][0] *= mult;
points[i][0] += t1;
}
this.t1 = t1;
this.t2 = t2;
}
else{
this.t1 = t1;
this.t2 = t2;
calcPoints();
}
}
COM: <s> scales the linear envelope to the specified time segment </s>
|
funcom_train/24091630 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void hyperlinkUpdate(HyperlinkEvent arg0) {
try {
if (arg0.getEventType().toString().equals("ACTIVATED")) {
FileNode node = currentNode.resolveURL(arg0.getURL());
if(node == null){
node = new ExternalNode(arg0.getURL());
}
currentNode = node;
}
} catch (Exception e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null,
e.getMessage() + e.getStackTrace(), "ERROR",
JOptionPane.ERROR_MESSAGE);
}
}
COM: <s> load the link activated </s>
|
funcom_train/29932260 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public IntRange highlightText(int from, int to) {
IntRange result = new IntRange(from, to);
clearHighlighlted();
highlightedText = new StyledTextImpl(result, ranges, styles.HIGHLIGHTED);
setTextStyle(highlightedText, highlightedText.getStyle(), false);
// log.debug(String.format("Text highlighted: Begining: %s, len: %s", result.start(), result.getLength()));
return result;
}
COM: <s> sets the text at the given position as highlighted </s>
|
funcom_train/1058290 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private AnimationModel calculateAnimationModel(double zoom) {
double dmod = Math.pow(zoom / getZoom(),(double)1/8);
int steps = (int)Math.round(dmod > 1 ? dmod : 1/dmod);
int duration = Math.max(DURATION_INCREMENT, steps * DURATION_INCREMENT);
AnimationModel animationModel = new AnimationModel(duration, true);
animationModel.animationStarted();
return animationModel;
}
COM: <s> calculate the animation duration based on the number of zoom increments being traversed </s>
|
funcom_train/21422824 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private NcxItem getNcxItem(Iterator<?> iterator, URI target) {
NcxItem navItem = null;
try {
URI ncxURI = this.ncxURL.toURI();
while(iterator.hasNext()) {
navItem = (NcxItem) iterator.next();
URI navItemURI = ncxURI.resolve(navItem.target);
if(navItemURI.compareTo(target)==0) return navItem;
}
} catch (URISyntaxException e) {
e.printStackTrace();
}
return null;
}
COM: <s> get an ncx item whose target uri refers to given uri </s>
|
funcom_train/51292877 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void transrepresent(INKFConvenienceHelper context) throws Exception
{ IAspectString sa=(IAspectString)context.sourceAspect(INKFRequestReadOnly.URI_SYSTEM, IAspectString.class);
WireFeedInput wfi=new WireFeedInput();
SyndFeedImpl sfi=new SyndFeedImpl(wfi.build(new StringReader(sa.getString())));
FeedAspect fa=new FeedAspect(sfi);
context.createResponseFrom(fa);
}
COM: <s> transrept can be made more efficient by testing the source aspect </s>
|
funcom_train/38300523 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void saveResolverAID(AID aid, AID resolverAid) throws SQLException {
saveAID(resolverAid);
PreparedStatements pss = getPreparedStatements();
pss.stm_insAgentResolverAID.setString(1, getGUID());
pss.stm_insAgentResolverAID.setString(2, aid.getName());
pss.stm_insAgentResolverAID.setString(3, resolverAid.getName());
pss.stm_insAgentResolverAID.addBatch();
}
COM: <s> stores the information of an aid of a resolver </s>
|
funcom_train/16826932 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void forEach(ProcessOnBeanDef iter) throws Exception {
final SFigParser.file_return rtn = this.beanDefsContext.get();
if (rtn == null) return;
if (!closeLock.tryLock())
throw new CloseInProgressException();
try {
forEach(rtn,iter);
} finally {
closeLock.unlock();
}
}
COM: <s> use to iterate each bean definition that has been parsed from sfig configuration </s>
|
funcom_train/28171318 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String toText(IXMLElement elem, String value) throws IOException {
String space = readInheritAttribute(elem, "xml:space", "default");
if (space.equals("default")) {
return value.trim().replaceAll("\\s++", " ");
} else /*if (space.equals("preserve"))*/ {
return value;
}
}
COM: <s> reads a text attribute </s>
|
funcom_train/7992484 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Dialog getDialogById(String dialogId) {
if(dialogId == null || dialogId.equals("")){
return null;
}
if(getDialogs().isEmpty())
return null;
for(Dialog dialog:getDialogs()){
if(dialogId.equals(dialog.getId())){
return dialog;
}
}
return null;
}
COM: <s> begin user doc </s>
|
funcom_train/25564711 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void dataChanged(Data dataToUpdate) {
javax.swing.tree.DefaultMutableTreeNode treeNodeToUpdate = ((TreeChoiceModel)manager.
getModel()).getNodeWith(dataToUpdate);
if(treeNodeToUpdate==null)return;
isSilent = true;//for renaming events
manager.getTreeModel().nodeChanged(treeNodeToUpdate);
isSilent = false;//for renaming events
}
COM: <s> calls the method of tree model nodechanged node </s>
|
funcom_train/31480515 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getKeyID() {
// Potential race here, but it's harmless. Well mostly. Worst case is
// that the keyid is generated multiple times, once.
if (null == this.cachedKeyID) {
this.cachedKeyID = this.getHashOfKey().getB64Value();
}
return this.cachedKeyID;
}
COM: <s> return the key id of the principal </s>
|
funcom_train/12561507 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void validateState(boolean activeOperation) {
if (activeOperation && mediator == null) {
throw new IllegalStateException(
"Illegal operation on an input session already in progress");
} else if (!activeOperation && mediator != null) {
throw new IllegalStateException(
"Illegal operation on an input session which is not in progress");
}
}
COM: <s> this method will validate the state of this input mode </s>
|
funcom_train/10835189 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ResourceMetadata getResourceMetadata() {
if (metaData == null) {
metaData = new ResourceMetadata();
metaData.setContentLength(file.length());
metaData.setModificationTime(file.lastModified());
metaData.setResolutionPath(resourcePath);
}
return metaData;
}
COM: <s> returns the resource meta data for this resource containing the file </s>
|
funcom_train/17905197 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void selectDriver() {
if (databaseConnection == null) {
return;
}
if (databaseConnection.getDriverId() == 0) {
driverCombo.setSelectedIndex(0);
} else {
long driverId = databaseConnection.getDriverId();
if (driverId != 0) {
DatabaseDriver driver = driverRepository().findById(driverId);
if (driver != null) {
driverCombo.setSelectedItem(driver.getName());
}
}
}
}
COM: <s> selects the driver for the current connection </s>
|
funcom_train/48390850 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public HandlerRegistration addTabIconClickHandler(com.smartgwt.client.widgets.tab.events.TabIconClickHandler handler) {
if(getHandlerCount(com.smartgwt.client.widgets.tab.events.TabClickEvent.getType()) == 0) setupTabIconClickEvent();
return doAddHandler(handler, com.smartgwt.client.widgets.tab.events.TabClickEvent.getType());
}
COM: <s> add a tab icon click handler </s>
|
funcom_train/29546693 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Tree getIncidentTree() {
Control[] tabControls = null;
int loop = 0;
Tree treeIncidents = null;
// Find the Tree control.
tabControls = this.getChildren();
for (loop = 0; loop <= tabControls.length - 1; loop++) {
if (tabControls[loop] instanceof Tree) {
treeIncidents = (Tree)tabControls[loop];
break;
}
}
return treeIncidents;
}
COM: <s> get the main tree object on this tab </s>
|
funcom_train/2586891 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private List parseName(final String name) {
final ArrayList list = new ArrayList();
final StringTokenizer strTok = new StringTokenizer(name, "/");
while (strTok.hasMoreElements()) {
final String s = (String) strTok.nextElement();
if (s.length() != 0) {
list.add(s);
}
}
return list;
}
COM: <s> parses the given name and returns the name elements as list of strings </s>
|
funcom_train/31660049 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getEntry(String key) {
CacheEntry entry = (CacheEntry) cachetable.get(key);
if (entry == null) {
return null;
} else {
Date now = new Date();
if (now.after(entry.getExpireDate())) {
cachetable.remove(key);
return null;
} else {
return entry.getContent();
}
}
}
COM: <s> get an entry from the cache </s>
|
funcom_train/37831636 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void destroyRing(SlotOwner container, final WeddingRing ring, final RPSlot slot) {
// The players need to be told first, while the ring still
// exist in the world
informNearbyPlayers(ring);
RPEntity player = null;
if (container instanceof RPEntity) {
player = (RPEntity) container;
}
new ItemLogger().destroy(player, slot, ring, "another ring");
ring.removeFromWorld();
logger.info("Destroyed a wedding ring: " + ring);
}
COM: <s> destroy a wedding ring </s>
|
funcom_train/50848128 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testUpdateTimestamp() throws Exception {
if (!isTestUpdates()) {
return;
}
try {
ResultSet rs = this.newUpdateableJdbcResultSet();
rs.next();
rs.updateTimestamp(
"timestamp_column",
java.sql.Timestamp.valueOf("2005-12-14 11:57:02.1234"));
} catch (Exception e) {
fail(e.toString());
}
}
COM: <s> test of update timestamp method of interface java </s>
|
funcom_train/20342524 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getBackCommand3() {
if (backCommand3 == null) {//GEN-END:|84-getter|0|84-preInit
// write pre-init user code here
backCommand3 = new Command("Back", Command.BACK, 0);//GEN-LINE:|84-getter|1|84-postInit
// write post-init user code here
}//GEN-BEGIN:|84-getter|2|
return backCommand3;
}
COM: <s> returns an initiliazed instance of back command3 component </s>
|
funcom_train/40846694 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Integer coundEloRating(Integer ra, Integer rb, boolean firstWon) {
double d = (rb - ra) / 400.0;
double expected = 1.0d / (1 + Math.pow(10, d));
double actual = firstWon ? 1 : 0;
return Integer.valueOf((int) Math.round(ra + 32 * (actual - expected)));
}
COM: <s> count rating using elo rating system </s>
|
funcom_train/20881427 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getValue(boolean kind, int beamernumber) {
if (kind) {
return new Integer(this.BeamerValues[beamernumber - 1].get(0))
.intValue();
}
else {
return new Integer(this.GUIValues[beamernumber - 1].get(0)).intValue();
}
}
COM: <s> returns an int value for the desired setting </s>
|
funcom_train/7427998 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void insertTimer(final SWTTimer timer, final long expirationTime) {
SWTTimer previousTimer = findLastTimerExpiringBefore(expirationTime);
if (previousTimer == null) {
firstTimer = timer;
}
else {
timer.setNextTimer(previousTimer.getNextTimer());
previousTimer.setNextTimer(timer);
}
}
COM: <s> insert the timer into the queue in the order they will expire </s>
|
funcom_train/40382623 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean selectPreviousAppointment() {
boolean moveSucceeded = false;
if (getSelectedAppointment() != null) {
int selectedApptIndex =
getAppointments().indexOf(getSelectedAppointment());
Appointment prevAppt;
if (selectedApptIndex > 0 && (prevAppt =
getAppointments().get(selectedApptIndex - 1)) != null) {
selectedAppointment = prevAppt;
moveSucceeded = true;
}
}
return moveSucceeded;
}
COM: <s> moves the quot currently selected quot to the previous appointment in </s>
|
funcom_train/36153807 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object getFromDatabase(MetaData metadata, String tableName, String colName) throws JSQLException {
try {
this.value = metadata.getSession().getConnection().res.getDouble(tableName + "." + colName);
return value;
} catch (Exception e) {
throw new JSQLException("Column not found", colName, e);
}
}
COM: <s> gets double value from database and sets it to value </s>
|
funcom_train/4388532 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public DiscreteAction getBestAction() {
DiscreteAction action = null;
double bestValue = Double.NEGATIVE_INFINITY;
for(Map.Entry<DiscreteAction, Double> e: values.entrySet()) {
if(e.getValue() > bestValue) {
bestValue = e.getValue();
action = e.getKey();
}
}
return action;
}
COM: <s> returns the action associated with the highest value </s>
|
funcom_train/1800923 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int compareTo(ExtensionDescription desc) {
String ns1 = namespace.getUri();
if (ns1 == null) {
ns1 = "";
}
String ns2 = desc.namespace.getUri();
if (ns2 == null) {
ns2 = "";
}
int nscomp = ns1.compareTo(ns2);
if (nscomp != 0) {
return nscomp;
}
return localName.compareTo(desc.localName);
}
COM: <s> defines a natural ordering for extension description based upon </s>
|
funcom_train/19913063 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getLastWord() {
StringBuffer result = new StringBuffer();
String text = textField.getText();
if (text.length() == 0) {
return "";
}
int caretPos = this.textField.getCaretPosition();
int pointer = caretPos - 1;
while (pointer > 0) {
if (!isDelimiter(text.charAt(pointer))) {
pointer--;
} else {
pointer++;
break;
}
}
if (pointer >= 0 && pointer < caretPos)
result.append(text.substring(pointer, caretPos));
return result.toString();
}
COM: <s> this method will read the string form the current textcursor back to a </s>
|
funcom_train/32757326 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setValueAt( final Object stringValue, final int row, final int column ) {
if ( column == PARAMETER_VALUE_COLUMN && row < ATTRIBUTE_DESCRIPTORS.size() ) {
final AttributeDescriptor attributeDescriptor = ATTRIBUTE_DESCRIPTORS.get( row );
final Object value = stringValue != null ? attributeDescriptor.parseValue( stringValue.toString() ) : null;
PARAMETERS.put( attributeDescriptor.getAttribute(), value );
}
}
COM: <s> set a new value for the specified table cell </s>
|
funcom_train/19317974 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException {
checkClosed();
if(transacted) {
acknowledgeMode = Session.SESSION_TRANSACTED;
}
JMSSession session = new JMSSession(this, transacted, acknowledgeMode, false);
synchronized(sessions) {
sessions.put(session.getSessionId(), session);
}
return session;
}
COM: <s> if a code session code is transacted the acknowledgement mode </s>
|
funcom_train/20443857 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getOkCommand() {
if (okCommand == null) {//GEN-END:|110-getter|0|110-preInit
// write pre-init user code here
okCommand = new Command("Ok", Command.OK, 0);//GEN-LINE:|110-getter|1|110-postInit
// write post-init user code here
}//GEN-BEGIN:|110-getter|2|
return okCommand;
}
COM: <s> returns an initiliazed instance of ok command component </s>
|
funcom_train/30199021 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getJButton() {
if (jButton == null) {
jButton = new JButton();
jButton.setText("Show neigbours");
jButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
endpoint.route(node.getLeafSet().get(0).getId(),new DebugMessage(node.getLocalNodeHandle()),null);
}
});
}
return jButton;
}
COM: <s> this method initializes j button </s>
|
funcom_train/16565593 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Point3D mult(Point3D p) {
Point3D ret = new Point3D(xx*p.x + xy*p.y + xz*p.z + xw,
yx*p.x + yy*p.y + yz*p.z + yw,
zx*p.x + zy*p.y + zz*p.z + zw);
ret.scale(1f/(wx*p.x + wy*p.y + wz*p.z + ww));
return ret;
}
COM: <s> matrix multiplication of point </s>
|
funcom_train/51502447 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JRadioButton getJRadioButton4() {
if (rbFr == null) {
rbFr = new JRadioButton();
rbFr.setText("Freitag");
rbFr.setActionCommand("Fr");
rbFr.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
rbFr.setPreferredSize(new java.awt.Dimension(58,14));
}
return rbFr;
}
COM: <s> this method initializes j radio button4 </s>
|
funcom_train/7502234 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int getRecordId(String name) {
int result = -1;
MazeFilter filter = new MazeFilter(name);
try {
RecordEnumeration re = rs.enumerateRecords(filter, null, false);
while (re.hasNextElement()) {
result = re.nextRecordId();
}
} catch (RecordStoreNotOpenException e) {
e.printStackTrace();
} catch (InvalidRecordIDException e) {
e.printStackTrace();
}
return result;
}
COM: <s> gets record id based on maze name </s>
|
funcom_train/17290867 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void isValid() throws StorageException {
if (file == null || !file.getChannel().isOpen()) {
exceptionHandler.errorThrow(this.getClass().getName(), "isValid",
new StorageException(mcat.getMessage("ES0001", name)));
}
}
COM: <s> checks if the file is available for reading and writing </s>
|
funcom_train/181376 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addPendingObject(Object obj) {
if ((obj != null) && (!objectMap.containsKey(obj)) && (!pendingObjects.contains(obj))) {
DbObject object = (DbObject)obj;
if (!object.getObjectServer().equals(server)) {
Tracer.getInstance().developerWarning("object maintained by other ObjectServer is out of responsibility");
return;
}
pendingObjects.add(obj);
}
}
COM: <s> keep objects to write to xml instance in mind </s>
|
funcom_train/28418865 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private ControllerInterface getController(String controllername) {
for (int i = 0; i < controllers.size(); i++) {
if (controllers.get(i).toString().equals(controllername)) {
return controllers.get(i).getController();
}
}
return null; //should never ever happen
}
COM: <s> returns the controller object that corresponds with the given name </s>
|
funcom_train/43757026 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean isAuthenticated(HttpServletRequest request) {
boolean isAuthenticated = false;
HttpSession session = request.getSession();
if (session.getAttribute("UserBase") != null) {
UserBase userBase = (UserBase) session.getAttribute("UserBase");
if(userBase.getUserName()!=null && !userBase.getUserName().trim().equals("")){
isAuthenticated = true;
}
}
return isAuthenticated;
}
COM: <s> returns true if the session contains the authentication token </s>
|
funcom_train/45256127 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private ImageBindingRegistry getCategoryImageBindingRegistry() {
if (categoryImageBindingRegistry == null) {
categoryImageBindingRegistry = new ImageBindingRegistry(IWorkbenchRegistryConstants.TAG_CATEGORY_IMAGE_BINDING);
PlatformUI
.getWorkbench()
.getExtensionTracker()
.registerHandler(
categoryImageBindingRegistry,
ExtensionTracker
.createExtensionPointFilter(getActivitySupportExtensionPoint()));
}
return categoryImageBindingRegistry;
}
COM: <s> return the category image registry </s>
|
funcom_train/51812950 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testProvidedProperties() throws Exception {
Properties props = new Properties();
props.setProperty("A", "${B}");
props.setProperty("B", "C");
sps.setProperties(props);
sps.setString("${A}");
assertEquals("Wrong value returned", "C", sps.getObject());
}
COM: <s> tests that substitution occurs when using externally provided properties </s>
|
funcom_train/15718541 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setApplicationString(String application) {
if(mParameterTokens != null) {
for(int i = 0; i < mParameterTokens.length; i++) {
if(mParameterTokens[i].equals(mApplication)) {
mParameterTokens[i] = application;
}
}
}
mApplication = application;
}
COM: <s> sets the application string of this task </s>
|
funcom_train/36189789 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeServiceListener(ServiceListener listener) {
if (m_serviceContext == null) {
PSSEventDispatcher dispatcher = PSSEventDispatcher.getDispatcher();
if (dispatcher == null || ! dispatcher.removeListener(listener)) {
m_bundleContext.removeServiceListener(listener);
}
} else {
m_serviceContext.removeServiceListener(listener);
}
}
COM: <s> removes a service listener </s>
|
funcom_train/29849886 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void printoutLabels(Node[] matchingNodes, String prefix) {
/* print out the labels from the graph! */
for (int i = 0; i < matchingNodes.length; i++) {
Node n1 = matchingNodes[i];
try {
NodeLabelAttribute nl1 =
(NodeLabelAttribute) n1.getAttribute("label");
System.err.println(prefix + " : " + nl1.getLabel());
} catch (AttributeNotFoundException e) {
System.err.println(prefix + " : NO-LABEL!");
}
}
}
COM: <s> prints the labels of the nodes to stderr </s>
|
funcom_train/27779172 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setCapacity(int capacity, int mergeFac) {
this.capacity = capacity;
this.mergeFac = mergeFac;
this.slot = new int[capacity][mergeFac];
this.used = new int[capacity];
for (int row = 0; row < capacity; row++) {
used[row] = 0;
for (int col = 0; col < mergeFac; col++) {
slot[row][col] = EMPTYSLOT;
}
}
}
COM: <s> set the capacity to the given value </s>
|
funcom_train/50716432 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void fadeIn(double fadeLength, double cphraseStartTime){
Enumeration enum = this.phraseList.elements();
while(enum.hasMoreElements()){
Phrase nextPhrase = (Phrase)enum.nextElement();
//make the correction for phrases that don't start at the same time as the Part does (0.0)
nextPhrase.fadeIn(fadeLength, (cphraseStartTime + nextPhrase.getStartTime()));
}
}
COM: <s> linearly fades in the cphrase </s>
|
funcom_train/8347466 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public TextField getTxtLocalidadD() {
if (txtLocalidadD == null) {//GEN-END:|86-getter|0|86-preInit
// write pre-init user code here
txtLocalidadD = new TextField("Localidad", null, 32, TextField.ANY);//GEN-LINE:|86-getter|1|86-postInit
// write post-init user code here
}//GEN-BEGIN:|86-getter|2|
return txtLocalidadD;
}
COM: <s> returns an initiliazed instance of txt localidad d component </s>
|
funcom_train/2582083 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void delete(int start, int end) {
if (end < start) {
throw new IllegalArgumentException("Requires start <= end.");
}
for (int i = 0; i <= (end - start); i++) {
this.data.remove(start);
}
if (this.data.isEmpty()) {
this.timePeriodClass = null;
}
fireSeriesChanged();
}
COM: <s> deletes data from start until end index end inclusive </s>
|
funcom_train/2293559 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getCurrentResourceName() {
if (isMultiOperation()) {
return "";
}
String resourceName = CmsResource.getName(getParamResource());
if (resourceName.endsWith("/")) {
resourceName = resourceName.substring(0, resourceName.length() - 1);
}
return resourceName;
}
COM: <s> returns the current name of the resource without path information </s>
|
funcom_train/49139403 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JPanel getJContentPane() {
if (jContentPane == null) {
jContentPane = new JPanel();
jContentPane.setLayout(null);
jContentPane.add(getChatTextAreaSrollPane(), null);
jContentPane.add(getUsersTextArea(), null);
jContentPane.add(getEditableTextArea(), null);
jContentPane.add(getBtnSend(), null);
}
return jContentPane;
}
COM: <s> this method initializes j content pane </s>
|
funcom_train/16482755 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deleteSypmthomValue(int sympthomIndex, int deletedValueIndex) {
sympthomsDefinition.getSympthomValuesVector(sympthomIndex).remove(deletedValueIndex);
if(deletedValueIndex>0) {
applyDateIntDelta(sympthomIndex, deletedValueIndex, -1);
} else {
applyDateIntDelta(sympthomIndex, deletedValueIndex+1, -1);
}
modified = true;
}
COM: <s> deletes the sympthom value from the definition and updates the file data </s>
|
funcom_train/5268595 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void save(byte[] data, int offset) {
SaveGameHandler.intIntoByteArray(correctStreak, data, offset + 0);
SaveGameHandler.intIntoByteArray(total, data, offset + 4);
wordIndex.intoByteArray(offset+8, data);
}
COM: <s> inserts this word into the byte array at the specified offset </s>
|
funcom_train/47184098 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean removeRepresentative(long representer, long representee) throws DBException {
Connection conn = null;
PreparedStatement ps = null;
try {
conn = factory.getConnection();
ps = conn
.prepareStatement("DELETE FROM Representatives WHERE RepresenterMID=? AND RepresenteeMID=?");
ps.setLong(1, representer);
ps.setLong(2, representee);
return 1 == ps.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
throw new DBException(e);
} finally {
DBUtil.closeConnection(conn, ps);
}
}
COM: <s> unassign the representation </s>
|
funcom_train/1031451 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setAutoCommit(boolean autoCommit) throws SQLException {
checkClosed();
if (autoCommit && isInGlobalTx()) {
throw SQLError.createSQLException(
"Can't set autocommit to 'true' on an XAConnection",
SQLError.SQL_STATE_INVALID_TRANSACTION_TERMINATION,
MysqlErrorNumbers.ER_XA_RMERR);
}
try {
this.mc.setAutoCommit(autoCommit);
} catch (SQLException sqlException) {
checkAndFireConnectionError(sqlException);
}
}
COM: <s> passes call to method on physical connection instance </s>
|
funcom_train/40419381 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public PathResolver getPathResolver() {
PathResolver pathResolver = new PathResolver(this, this.getApplicationRule());
if (pathResolver != null)
{
log.debug("Loaded Pathresolver for " + this.getName());
}
else
{
log.error("Could not initialize Pathresolver for "+ this.getName());
}
return pathResolver;
}
COM: <s> gets the path resolver of this config </s>
|
funcom_train/24512059 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void install(JComponent popup) {
if (textComponent == null) return;
int caretPos = textComponent.getCaret().getDot();
try {
Rectangle caretBounds = textComponent.modelToView(caretPos);
install(popup, caretBounds, Largest);
} catch (BadLocationException e) {
// do not install if the caret position is invalid
}
}
COM: <s> install popup component to text component root pane </s>
|
funcom_train/13961823 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void restoreCache(String fileName) {
fileName = fileName == null ? "dmp.cache": fileName;
synchronized(this) {
try {
_cache = cacheFromBytes(ERXFileUtilities.bytesFromFile(new File(fileName)));
} catch(IOException ex) {
log.error(ex);
}
}
}
COM: <s> means to restore the cache </s>
|
funcom_train/46982722 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void updateProperty(String name, String value) {
boolean found = false;
for(Property property : propertyList) {
if (property.getName().equals(name)) {
property.setValue(value);
found = true;
}
}
if (found == false) {
addProperty(name, value);
}
}
COM: <s> changes the value of the property name if it exists if it </s>
|
funcom_train/50142307 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected String getValidation(String objRef) {
String out = "(" + objRef + ".value.indexOf ('http://',0) != -1 || " + objRef + ".value.indexOf ('.',0) != -1)";
if (required) {
out += " && " + super.getValidation(objRef);
}
return out;
}
COM: <s> returns the scriptcode to check the http url </s>
|
funcom_train/45882563 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addToListField(String fieldName, Object item) {
List<Object> listField = null;
if (containsKey(fieldName)) {
listField = getFieldAsList(fieldName);
} else {
listField = new ArrayList<Object>();
}
listField.add(item);
put(fieldName, listField);
}
COM: <s> adds the passed object to the list field with the specified name </s>
|
funcom_train/5894379 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object getValue(PageDefinition pgdef, Page page) {
final Evaluator eval = pgdef.getEvaluator();
if (_cond == null || _cond.isEffective(eval, page)) {
final Object val = _value.getValue(eval, page);
return val != null ? val instanceof Date ? val: val.toString(): "";
}
return "";
}
COM: <s> returns the value of the response header </s>
|
funcom_train/28347918 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void actionPerformed(ActionEvent e) {
JComboBox cb = (JComboBox)e.getSource();
String chainName = (String)cb.getSelectedItem();
// Create listener
_deviceBox.removeAllItems();
_subsystemBox.removeAllItems();
_NoneButton.setSelected(true);
}
COM: <s> listens to the combo box </s>
|
funcom_train/13346044 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getRootString() throws Exception {
if (root instanceof ASTIdentifier) {
return ((ASTIdentifier) root).getIdentifierString();
}
if (root instanceof ASTArrayAccess) {
return ((ASTArrayAccess) root).getIdentifierString();
}
throwExpressionException("programmer error : ASTReference : root not known" + root);
return null;
}
COM: <s> gets the variable name of </s>
|
funcom_train/26213051 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getResponse() {
byte[] resp;
if (currentResponse.length > currentPosition) {
byte[] tmp = new byte[currentPosition];
for (int i = 0; i < currentPosition; i++) {
tmp[i] = currentResponse[i];
}
resp = tmp;
} else {
resp = currentResponse;
}
return HttpConstants.getString(Base64.encode(resp));
}
COM: <s> returns the response that has been generated after shrinking the array if </s>
|
funcom_train/44421068 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void initialize() throws NoNetworkHookException, NoModuleLoaderException, NoSuchModuleException{
if( networkHook == null ){ //sanity check
throw new NoNetworkHookException("ModuleManager initialization error: No network hook");
}
if( moduleLoader == null){//sanity check
throw new NoModuleLoaderException("ModuleManager initialization error: No module loader");
}
init();
setInitializedFlag(true);
}
COM: <s> called to initialize the module manager </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.