__key__
stringlengths 16
21
| __url__
stringclasses 1
value | txt
stringlengths 183
1.2k
|
|---|---|---|
funcom_train/46836610
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private JLabel getJTextFieldAddedFrom() {
if (jTextFieldAddedFrom == null) {
jTextFieldAddedFrom = new JLabel();
jTextFieldAddedFrom.setBounds(new Rectangle(548, 5, 98, 20));
jTextFieldAddedFrom.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
jTextFieldAddedFrom.setOpaque(false);
jTextFieldAddedFrom.setFocusable(false);
}
return jTextFieldAddedFrom;
}
COM: <s> this method initializes j text field added from </s>
|
funcom_train/35020935
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void createRequests() {
VirtualMachine vm = location.virtualMachine();
EventRequestManager erm = vm.eventRequestManager();
eventRequest = erm.createBreakpointRequest(location);
register(eventRequest);
// We are always resolved, but nothing wrong with firing this anyway.
propSupport.firePropertyChange(PROP_RESOLVED, false, true);
}
COM: <s> create the breakpoint request </s>
|
funcom_train/45895934
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void addThis() {
for (Field f : getClass().getDeclaredFields()) {
if (UIComponent.class.isAssignableFrom(f.getType())
&& f.getDeclaringClass() == getClass()
&& !f.isSynthetic()) {
try {
f.setAccessible(true);
UIComponent c = UIComponent.class.cast(f.get(this));
if (c != null) {
add(c);
}
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
}
COM: <s> add declared fields of type uicomponent </s>
|
funcom_train/28352857
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void updateCell( final LiveParameter parameter, final int column ) {
synchronized( PARAMETERS_LOCK ) {
final int row = _parameters.indexOf( parameter );
//fireTableRowsUpdated( row, row ); -- this call seems to cause a column spasm
fireTableCellUpdated( row, column ); // this call seems to cause a column spasm
//fireTableDataChanged(); //this call clears table row selections which can be very irritating
}
}
COM: <s> update the row for the specified parameter </s>
|
funcom_train/24233920
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void connect(String host, int port)throws InterruptedException, UnknownHostException, IOException{
InetAddress address=InetAddress.getByName(host);
Destination destination=new Destination(address,port);
//create client session...
clientSession=new ClientSession(clientEndpoint,destination);
clientEndpoint.addSession(clientSession.getSocketID(), clientSession);
clientEndpoint.start();
clientSession.connect();
//wait for handshake
while(!clientSession.isReady()){
Thread.sleep(50);
}
logger.info("The UDTClient is connected");
}
COM: <s> establishes a connection to the given server </s>
|
funcom_train/42643914
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void clearSearchResults(int page) {
// clear highlighted state for this page index.
WeakReference<PageText> pageReference = searchResultCache.get(page);
if (pageReference != null){
PageText currentPageText = pageReference.get();
if (currentPageText != null) {
currentPageText.clearHighlighted();
}
}
// clear caches.
searchResultCache.remove(page);
}
COM: <s> clears cached search results for this page index and clears the highlighted </s>
|
funcom_train/32780819
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setPriority(int priority) {
if (defaultMode != null) {
defaultMode.setPriority(priority);
} else {
sendWarning(
"Trying set the priority of a Transition that "
+ "possibly has multiple modes",
"Transition: " + getName(),
"Method setPriority(int priority) of class Transition is only to be "
+ "used on Transitions that only have a single mode and are"
+ " constructed as such",
"Use setPriority(int priority) on the specific TransitionModes instead");
}
}
COM: <s> sets the priority value for the default mode of this transition default </s>
|
funcom_train/25093510
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public TransactionSet gammaHpAndSelf(Task tau_ua){
TransactionSet gammaHp = new TransactionSet(gamma.getName());
for (Transaction gammaI : gamma){
List<Task> hpI = hpAndSelf(gammaI, tau_ua);
Transaction gammaHpI = new Transaction(gammaI.getName(), gammaI.getT(), hpI);
gammaHp.add(gammaHpI);
}
return gammaHp;
}
COM: <s> creates a transaction set of higher prior tasks but includes task tau ua </s>
|
funcom_train/29618394
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private MgisRadioButton getJRadioNotAvailable() {
if (jRadioNotAvailable == null) {
jRadioNotAvailable = new MgisRadioButton();
jRadioNotAvailable.setValue("1");
m_availability.add(jRadioNotAvailable);
jRadioNotAvailable.setText(AppTextsDAO.get("LABEL_NOT_AVAILABLE"));
jRadioNotAvailable.setBounds(11, 40, 133, 19);
}
return jRadioNotAvailable;
}
COM: <s> this method initializes j radio not available </s>
|
funcom_train/51197029
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void testAdd() {
System.out.println("Add");
try {
jjil.core.PipelineStage p = this.rgbTest;
jjil.core.Sequence instance = new jjil.core.Sequence();
instance.Add(p);
} catch (Exception ex) {
ex.printStackTrace();
fail(ex.toString() + " thrown");
}
}
COM: <s> test of add method of class jjil </s>
|
funcom_train/6433952
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void operator() {
String command;
try {
outStream.writeBytes("Password: ");
command = inStream.readLine();
while(!command.equals("goodbye")) {
command = inStream.readLine();
}
}catch (java.io.IOException E) {cleanup();}
}
COM: <s> handles requests for operator access </s>
|
funcom_train/7508345
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void testGetUser() throws AuthenticationException {
System.out.println("getUser");
Authenticator instance = ESAPI.authenticator();
String password = instance.generateStrongPassword();
String accountName=ESAPI.randomizer().getRandomString(8, DefaultEncoder.CHAR_ALPHANUMERICS);
instance.createUser(accountName, password, password);
assertNotNull(instance.getUser( accountName ));
assertNull(instance.getUser( ESAPI.randomizer().getRandomString(8, DefaultEncoder.CHAR_ALPHANUMERICS) ));
}
COM: <s> test of get user method of class org </s>
|
funcom_train/12113144
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void connEtoC26(java.util.EventObject arg1) {
try {
// user code begin {1}
// user code end
this.vediCopiaDocumento_ProposteJButtonAction_actionPerformed(arg1);
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
COM: <s> conn eto c26 vedi copia documento </s>
|
funcom_train/29870387
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void actionJEditTemplateFieldUpdateButton(ActionEvent e) {
if (curField!=null) {
curField.setName(getJEditTemplateFieldNameTextField().getText());
curField.setType(getFieldType((String) getJEditTemplateFieldTypeComboBox().getSelectedItem()));
curField.setDefault(getJEditTemplateFieldDefaultTextField().getText());
// update list since name or type may have changed
refreshEditTemplateFieldList();
}
}
COM: <s> function called whenever the update button is clicked </s>
|
funcom_train/38878654
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void onCreate() {
super.onCreate();
// initialize preferences
Preferences.setContext(getBaseContext());
// prepare program logic
bl = new BenderLogic(getApplicationContext());
// notify user of service started
Toast.makeText(this, R.string.serviceStartedMessage, Toast.LENGTH_LONG).show();
acquireSensor();
acquireLock();
listenStarted();
sendStarted();
BenderService.started = true;
}
COM: <s> service starting procedures </s>
|
funcom_train/16218049
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void actionPerformed(ActionEvent e) {
if (e.getSource() == this.btnOK) {
// dispose this frame
this.dispose();
new Thread(this).start();
} else if (e.getSource() == this.btnCancel) {
System.exit(0);
}
}
COM: <s> notified when the user press ok or cancel button </s>
|
funcom_train/9278566
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void testSecurityMechanismOnEmbedded() throws SQLException {
DataSource ds = JDBCDataSource.getDataSource();
JDBCDataSource.setBeanProperty(
ds, "connectionAttributes", "securityMechanism=8");
// DERBY-3025: NullPointerException or AssertFailure was thrown here
Connection c = ds.getConnection("calvin", "calvinpw");
c.close();
}
COM: <s> test that security mechanism 8 is ignored by the embedded driver </s>
|
funcom_train/3099393
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public Object evaluate(State state) {
Object newObject = null;
List evaluatedArguments = new ArrayList();
Iterator iter = arguments.iterator();
while (iter.hasNext())
evaluatedArguments.add(Operator.evaluateArgument(iter.next(), state));
//TODO constuct new object
return newObject;
}
COM: <s> returns the new object resulting from constructing the given class using </s>
|
funcom_train/22285044
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void layout() {
layoutContainer();
int itemHeight = getItemHeight();
int yPos = firstItem * itemHeight + 1;
for (int i = firstItem; i <= lastItem; i++) {
getItem(i).setBounds(1, yPos, container.content.width-2, itemHeight);
yPos += itemHeight;
}
if (container.vert != null) {
container.vert.setLineSize(itemHeight);
}
}
COM: <s> lay out the menu items </s>
|
funcom_train/33588758
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private JTextField getJTextField_Account() {
if (jTextField_Account == null) {
jTextField_Account = new JTextField();
jTextField_Account.setColumns(10);
jTextField_Account.setBounds(100, 80, 439, 19);
}
return jTextField_Account;
}
COM: <s> this method initializes j text field3 </s>
|
funcom_train/1588513
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public boolean isNameCompatible(String simpleName, Kind kind) {
String baseName = simpleName + kind.extension;
return kind.equals(getKind())
&& (baseName.equals(toUri().getPath())
|| toUri().getPath().endsWith("/" + baseName));
}
COM: <s> this implementation compares the path of its uri to the given </s>
|
funcom_train/106254
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void inALitColPrimaryExpression(ALitColPrimaryExpression lcpe) {
String javaType=getJavaType( tree.getNodeType(lcpe) );
appendCode(createDecl(javaType,getVariable(lcpe))+myOclLibPackageName+javaType+".getEmpty"+javaType+"();\n");
}
COM: <s> this method breaks the usual pattern of generating java code postfix </s>
|
funcom_train/3710619
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setParameterValues (Parameter[] par) {
for (int i = 0, k = 0; i < getNumberOfComponents(); i++) {
Function f = getComponent (i);
for (int j = 0; j < f.getNumberOfParameters(); j++) {
f.replaceParameterValue (par[k++], j);
}
}
}
COM: <s> sets the values of code parameter code objects stored in this </s>
|
funcom_train/32134965
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void verifyStateIsValid() throws InvalidConfigurationException {
if (LA == null) {
throw new InvalidConfigurationException(
"The learning algorithm must not be null.");
}
// Check the settings on the learning algorithm.
LA.verifyStateIsValid();
if (neuronLayers == null) {
throw new InvalidConfigurationException(
"The neuron layers must not be null.");
}
}
COM: <s> verifies that the configuration is in a usable state </s>
|
funcom_train/4779939
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private JRadioButton getReadWriteRadioButton() {
if (readWriteRadioButton == null) {
readWriteRadioButton = new JRadioButton();
readWriteRadioButton.setText(ResourceUtil.getString("accesslevel.readwrite"));
readWriteRadioButton.setFont(GuiConstants.FONT_PLAIN);
if (accessRule != null && accessRule.getLevel().equals(SubversionConstants.SVN_ACCESS_LEVEL_READWRITE)) {
readWriteRadioButton.setSelected(true);
}
}
return readWriteRadioButton;
}
COM: <s> this method initializes read write radio button </s>
|
funcom_train/18582237
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private Collection createTelecomElementList(Collection telecomList) {
ArrayList list = new ArrayList();
for (Iterator iter = telecomList.iterator(); iter.hasNext(); ) {
TEL tel = (TEL) iter.next();
Element telElement = new Element("telecom");
telElement.setAttribute("value", tel.getText());
list.add(telElement);
}
return list;
}
COM: <s> create telecom element list </s>
|
funcom_train/9027065
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public NodeList getChildNodes() {
NodeList nodeList = context.getNodeList(getDispatchProperty("childNodes")); //$NON-NLS-1$
for (int i = 0; i < nodeList.getLength(); i++) {
Node child = nodeList.item(i);
child.logicalParent = this;
}
return nodeList;
}
COM: <s> a code node list code that contains all children of this node </s>
|
funcom_train/4478916
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private TimeZone getTimeZone(final DateTime dateTime) {
TimeZone zone = TimeZone.getDefault();
if (dateTime.getClass().getName().equals("lotus.domino.cso.DateTime")) {
zone = TimeZone.getTimeZone("GMT");
}
return zone;
}
COM: <s> returns the java time zone as expected when converting a given notes </s>
|
funcom_train/2888347
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void hostDeleted(HostType h) {
String hostAddress = h.getId().toLowerCase();
// if client is a valid machine on the network
if (hostAddress != null) {
// Delete user
listenerAdapter.removeUserFromRoster(hostAddress);
adminAdapter.deleteUser(hostAddress, hostAddress);
// Remove the ActiveProfile
ActiveProfileUpdater updater = new ActiveProfileUpdater();
updater.removeActiveProfile(hostAddress);
}
}
COM: <s> deletes the xmpp username used by the host </s>
|
funcom_train/18497949
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void drawQuad(JaselColor color, float x, float y, float w, float h) {
GL.glDisable(GL.GL_TEXTURE_2D);
setColor(color);
GL.glBegin(GL.GL_QUADS);
{
GL.glVertex2f(x, y);
GL.glVertex2f(x + w, y);
GL.glVertex2f(x + w, y + h);
GL.glVertex2f(x, y + h);
}
GL.glEnd();
GL.glEnable(GL.GL_TEXTURE_2D);
resetColor();
}
COM: <s> draw a colored rectangle on the screen </s>
|
funcom_train/4858316
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private String parseOuterClassName() {
StringBuilder sb = new StringBuilder();
sb.append(lexer.nextToken(TokenType.JAVA_ID).text);
Token token = lexer.peekToken(0);
boolean isFullyQualifiedName = false;
while (token.tokenType == TokenType.PACKAGE_SEPARATOR) {
isFullyQualifiedName = true;
token = lexer.nextToken();
sb.append('.');
token = lexer.nextToken(TokenType.JAVA_ID);
sb.append(token.text);
token = lexer.peekToken(0);
}
if (!isFullyQualifiedName) {
return getFullyQualifiedName(sb.toString());
} else {
return sb.toString();
}
}
COM: <s> parse the outer class name </s>
|
funcom_train/25763870
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void printHTMLDocument(Node element, Writer out) throws IOException {
try {
Transformer transformer = TransformerFactory.newInstance()
.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,
"yes");
transformer.setOutputProperty(OutputKeys.METHOD, "xml");
transformer
.transform(new DOMSource(element), new StreamResult(out));
} catch (TransformerException e) {
throw new IOException(e);
}
}
COM: <s> print a pretty formatted </s>
|
funcom_train/22598719
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private JButton getNodeFilterButton() {
if (nodeFilterButton == null) {
nodeFilterButton = new JButton();
nodeFilterButton.setText("Filter Nodes");
nodeFilterButton.setEnabled(true);
nodeFilterButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
((DBNetwork) getNetwork()).setNodeFilter(getNodeFilterField().getText());
}
});
}
return nodeFilterButton;
}
COM: <s> this method initializes get node filter button </s>
|
funcom_train/27843923
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public Object set(int index, Object element) {
checkNullContents();
Object oldElement = _contents.set(index, element);
Pointer elementPointer = getIndexedPointer(index);
if (_propagateModelChanges) {
unregisterElement(oldElement);
registerElement(element, elementPointer);
}
valueChanged(elementPointer, ModelChangeTypes.VALUE_CHANGED);
return oldElement;
}
COM: <s> replaces the element at the specified position in this list with the </s>
|
funcom_train/41596907
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private JButton getJAusDemHeldenToolLadenButton() {
if (jAusDemHeldenToolLadenButton == null) {
jAusDemHeldenToolLadenButton = new JButton();
jAusDemHeldenToolLadenButton.setText("reset");
jAusDemHeldenToolLadenButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
heldenController.reset();
}
});
}
return jAusDemHeldenToolLadenButton;
}
COM: <s> this method initializes j aus dem helden tool laden button </s>
|
funcom_train/5619542
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void traverse(RawBytecodeVisitor visitor, CharReader reader) {
BytecodeInstruction instr = null;
while (instr != BytecodeInstruction.STOP_CODE) {
if (reader.hasData()) {
instr = get(reader.read());
} else {
instr = BytecodeInstruction.STOP_CODE;
}
instr.read(this, visitor, reader);
}
}
COM: <s> feeds a visitor by reading opcodes from a char stream </s>
|
funcom_train/46336309
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void testGetMappedParams() {
System.out.println("getMappedParams");
PlsqlCall instance = new PlsqlCall();
List<PlsqlCallParameter> expResult = new ArrayList<PlsqlCallParameter>();
List<PlsqlCallParameter> result = instance.getMappedParams();
assertEquals(expResult, result);
}
COM: <s> test of get mapped params method of class plsql call </s>
|
funcom_train/29686518
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void testID3v2_2() throws Exception {
ID3MetadataResourceFactory factory = new ID3MetadataResourceFactory();
URL u = getClass().getClassLoader().getResource(
"magoffin/matt/meta/audio/id3v2_2.mp3");
File file = new File(URLDecoder.decode(u.getFile(), "UTF-8"));
MetadataResource mResource = handleFile(factory, file);
assertEquals(ID3v2_2MetadataResource.class, mResource.getClass());
}
COM: <s> test able to get id3v2 </s>
|
funcom_train/11010666
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void insertTable(int pos, XWPFTable table) {
bodyElements.add(pos, table);
int i;
for (i = 0; i < ctFtnEdn.getTblList().size(); i++) {
CTTbl tbl = ctFtnEdn.getTblArray(i);
if(tbl == table.getCTTbl()){
break;
}
}
tables.add(i, table);
}
COM: <s> inserts an existing xwpftable to the arrays body elements and tables </s>
|
funcom_train/4178919
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void addTest (final TestCase aTest) {
Validate.notNull(aTest, "The test cannot be null.");
if (tests.containsKey(aTest.getName())) {
throw new IllegalArgumentException("The test '" + aTest.getName() +
"' already exists in this module.");
}
aTest.setSuite(this);
tests.put(aTest.getName(), aTest);
}
COM: <s> adds a new test to this module </s>
|
funcom_train/7615027
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void removeAWTEventListener(AWTEventListener listener) {
lockAWT();
try {
SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkPermission(awtEventsManager.permission);
}
awtEventsManager.removeAWTEventListener(listener);
} finally {
unlockAWT();
}
}
COM: <s> removes the specified awt event listener </s>
|
funcom_train/10798040
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void releaseEmbedded(ValueMetaData vmd, Object obj) {
if (obj == null)
return;
StateManagerImpl sm = _broker.getStateManagerImpl(obj, false);
if (sm != null && sm.getOwner() == _sm
&& sm.getOwnerIndex() == vmd.getFieldMetaData().getIndex())
sm.release(true);
}
COM: <s> release the given embedd object </s>
|
funcom_train/43321948
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public boolean start() {
log.debug("Called start on " + user);
if (!startCalled.compareAndSet(false, true))
throw new IllegalStateException(
"start can only be called once per StartHandle");
stopManager.removeStartHandle(this);
stopManager.initiateUnlock(this);
return stopManager.getStartHandles(user).isEmpty();
}
COM: <s> notifies the stop manager that the operation for which this istart handle </s>
|
funcom_train/38350315
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void processModel(IFile file) throws Exception {
loadModel(file);
resetXSD(schemaf);
// ensure a full rebuild of all xsd schema's
// generate all xsd files
JAXBCodeGenerator jcg = new JAXBCodeGenerator(jaxbf, schemaf);
JAXBPlugin.instance().getWorkspace().run(jcg, null);
}
COM: <s> responds to model changes reloads model and re processes </s>
|
funcom_train/7794302
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public ITextRegion getNextPHPToken() throws BadLocationException {
ITextRegion phpToken = getPHPToken();
do {
phpToken = phpScriptRegion.getPhpToken(phpToken.getEnd());
if (!PHPPartitionTypes.isPHPCommentState(phpToken.getType()) && phpToken.getType() != PHPRegionTypes.WHITESPACE) {
break;
}
}
while (phpToken.getEnd() < phpScriptRegion.getLength());
return phpToken;
}
COM: <s> returns next php token after offset </s>
|
funcom_train/3388177
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void throttleLoopOnException() {
long now = System.currentTimeMillis();
if (lastExceptionTime == 0L || (now - lastExceptionTime) > 5000) {
// last exception was long ago (or this is the first)
lastExceptionTime = now;
recentExceptionCount = 0;
} else {
// exception burst window was started recently
if (++recentExceptionCount >= 10) {
try {
Thread.sleep(10000);
} catch (InterruptedException ignore) {
}
}
}
}
COM: <s> throttles the accept loop after an exception has been </s>
|
funcom_train/11009352
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setNoFill(boolean noFill) {
CTShapeProperties props = getShapeProperties();
//unset solid and pattern fills if they are set
if (props.isSetPattFill()) props.unsetPattFill();
if (props.isSetSolidFill()) props.unsetSolidFill();
props.setNoFill(CTNoFillProperties.Factory.newInstance());
}
COM: <s> sets whether this shape is filled or transparent </s>
|
funcom_train/43014739
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public int getId() {
if (Revision_Type.featOkTst && ((Revision_Type) jcasType).casFeat_id == null) {
jcasType.jcas.throwFeatMissing("id", "org.apache.uima.mediawiki.types.Revision");
}
return jcasType.ll_cas.ll_getIntValue(addr, ((Revision_Type) jcasType).casFeatCode_id);
}
COM: <s> getter for id gets internal identifier of the revision in media wiki </s>
|
funcom_train/42775426
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public String getXML(String indent){
String trackStr = indent + "<track>";
trackStr += indent + "\t<position>";
trackStr += indent + "\t\t<x>" + this.xPos + "</x><y>" + this.yPos + "</y>";
trackStr += indent + "\t</position>";
trackStr += midiTrack.getXML(indent + "\t");
trackStr += indent + "</track>";
return trackStr;
}
COM: <s> returns the gui and midi track information in xml format </s>
|
funcom_train/8751063
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void businessValidationTest(PositionType existing){
try{
createNew(existing.getPositionTypeName());
Assert.fail("Remote exeption, caused by BusinessValidationException expected.");
} catch (Exception re) {
ValidationException e = TestUtils.extractValidationException(re);
Assert.assertNotNull(e);
}
}
COM: <s> test inserting updating invalid pattern mask formats </s>
|
funcom_train/7607450
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public boolean isActive() {
if (body1.getPosition().distanceSquared(body2.getPosition()) < distance) {
Vector2f to2 = new Vector2f(body2.getPosition());
to2.sub(body1.getPosition());
to2.normalise();
Vector2f vel = new Vector2f(body1.getVelocity());
vel.normalise();
if (body1.getVelocity().dot(to2) < 0) {
return true;
}
}
return false;
}
COM: <s> check if this contraining joint is currently pulling the bodies back together </s>
|
funcom_train/1042236
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public Quaternion inverse() {
float norm = norm();
if (norm > 0.0) {
float invNorm = 1.0f / norm;
return new Quaternion(-x * invNorm, -y * invNorm, -z * invNorm, w
* invNorm);
}
// return an invalid result to flag the error
return null;
}
COM: <s> code inverse code returns the inverse of this quaternion as a new </s>
|
funcom_train/39986505
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void appendList(Output out, Collection collection, String seperator) {
Iterator i = collection.iterator();
boolean hasNext = i.hasNext();
while (hasNext) {
Outputable curr = (Outputable) i.next();
hasNext = i.hasNext();
curr.write(out);
out.print(' ');
if (hasNext) {
out.print(seperator);
}
out.println();
}
}
COM: <s> iterate through a collection and append all entries using </s>
|
funcom_train/11105283
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void fireAttributeReplaced(String key, Object value) {
if (attributeListeners.size() < 1) {
return;
}
ServletContextAttributeEvent event =
new ServletContextAttributeEvent(this, key, value);
Iterator listeners = attributeListeners.iterator();
while (listeners.hasNext()) {
ServletContextAttributeListener listener =
(ServletContextAttributeListener) listeners.next();
listener.attributeReplaced(event);
}
}
COM: <s> p fire an attribute replaced event to interested listeners </s>
|
funcom_train/17398810
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public Color intensify(float coefficient) throws InvalidInputException{
float redC = intToFloat((int)(Utils.byteToInt(red) * coefficient));
float greenC = intToFloat((int)(Utils.byteToInt(green) * coefficient));
float blueC = intToFloat((int)(Utils.byteToInt(blue) * coefficient));
return new Color(redC,greenC,blueC);
}
COM: <s> new color values are required when reflection is considered </s>
|
funcom_train/3802734
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void redo() {
//System.out.println("redo " + strName);
if (listEdits.size() == 0) {
throw new IllegalStateException("CompoundEdit " + hashCode() + " is empty!");
}
for (int e = 0; e < listEdits.size(); e++) {
((JPatchUndoableEdit)listEdits.get(e)).redo();
}
}
COM: <s> redoes all child edits </s>
|
funcom_train/26571793
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public GameController (String fileName) throws RuntimeException{
this.numberofPlayers=2;
Piece.LASTCOLOR = Piece.BLACK;
moveHistory = new ArrayList();
if (fileName == null)
readFromFile (standardGameFile);
else{
// readFromFile/String will throw an exception which
// should be handled by the calling code
readFromFile (fileName);
}
}
COM: <s> creates a new game from the given filename </s>
|
funcom_train/2294370
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void jspForwardTool(CmsWorkplace wp, String toolPath, Map params) throws IOException, ServletException {
Map newParams;
if (params == null) {
newParams = new HashMap();
} else {
newParams = new HashMap(params);
}
// update path param
newParams.put(CmsToolDialog.PARAM_PATH, toolPath);
jspForwardPage(wp, VIEW_JSPPAGE_LOCATION, newParams);
}
COM: <s> redirects to the given tool with the given parameters </s>
|
funcom_train/32356719
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private JTextField getJTextField() {
if (jTextField == null) {
jTextField = new JTextField();
}
jTextField.setText("");
jTextField.setColumns(20);
jTextField.setPreferredSize(new Dimension(224, 20));
jTextField.setBounds(new Rectangle(104, 30, 162, 20));
jTextField.setBackground(Color.white);
return jTextField;
}
COM: <s> this method initializes j text field </s>
|
funcom_train/43357898
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private boolean alreadyReported(int stackPos) {
if (stack.getStackDepth() > stackPos) {
OpcodeStack.Item item = stack.getStackItem(stackPos);
XField field = item.getXField();
if (field == null)
return false;
else {
String fieldName = field.getName();
boolean checked = checkedFields.contains(fieldName);
checkedFields.add(fieldName);
return checked;
}
}
return false;
}
COM: <s> returns whether the collection has already been reported on </s>
|
funcom_train/22950148
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public double calculateOutputResidualError(double desiredOutput, int outputIndex) throws Exception{
Neuron outputNeuron = this.outputLayer().getNeuron(outputIndex);
double derivative = outputNeuron.calculateDerivative();
double outputValue = outputNeuron.currentOutput();
double residualError = (outputValue - desiredOutput)*derivative;
return residualError;
}
COM: <s> calculates residual error at outputs </s>
|
funcom_train/25290613
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void lastButtons(int k, int[] values) {
if(k >= sensorReadCount) {
throw new IllegalArgumentException(Ding3dI18N.getString("Sensor5"));
}
System.arraycopy(readings[previousIndex(k)].buttonValues, 0, values,
0, sensorButtonCount);
}
COM: <s> places the kth most recent sensor reading value for each button into </s>
|
funcom_train/48108109
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void write(File file) throws Exception {
final FileStorage fileStorage = FileStorage.instance();
if (isInMemory()) {
fileStorage.write(new ByteArrayInputStream(get()), file.getName());
} else {
InputStream in = fileStorage.getFileInputStream(getFileName());
fileStorage.write(in, file.getName());
fileStorage.delete(getFileName());
}
}
COM: <s> a convenience method to write an uploaded item to disk </s>
|
funcom_train/33850536
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public int getLineOffset(int line) {
try {
loadFileData();
} catch (IOException e) {
System.err.println("SourceFile.getLineOffset: " + e.getMessage());
return -1;
}
if (line < 0 || line >= numLines)
return -1;
return lineNumberMap[line];
}
COM: <s> get the byte offset in the data for a source line </s>
|
funcom_train/35488634
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void logMessage(ELogMsgType type, String pack, IMessage msg) {
String logMessage = Dispatcher.getInstance().getTime()
+ " " + type + ": " + pack + " - " + msg + " ";
for (ILoggerListener l: listeners) {
l.stringLogged(logMessage);
}
for (PrintStream p: outs) {
p.println(logMessage);
}
}
COM: <s> compound message logging </s>
|
funcom_train/37607833
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void fixLaneLth() {
int stct, fgct;
OStreet sss;
stct = this.getStCount();
for (int kkk = 0; kkk < stct; kkk++) {
sss = this.useSt(kkk);
fgct = sss.getFragCount();
for (int mmm = 0; mmm < fgct; mmm++)
sss.useFrag(mmm).fixLaneLth();
}
} // end fixLaneLth()
COM: <s> walk the lanes and reset lane lengths </s>
|
funcom_train/1942289
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void showDialog(File helpfile) {
try {
this.helpcontent.setPage(helpfile.toURL());
this.setVisible(true);
} catch (IOException e) {
e.printStackTrace(); //Debug
JOptionPane.showMessageDialog(this, "Sorry there was an error loading the helpfile!\bAborting\n", "error", JOptionPane.ERROR_MESSAGE);
}
}
COM: <s> code show dialog code pops pup this dialog and shows the </s>
|
funcom_train/5165005
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public String toString() {
String s = "StringGene=";
if (m_value == null) {
s += "null";
}
else {
if (m_value.equals("")) {
s += "\"\"";
}
else {
s += m_value;
}
}
return s;
}
COM: <s> retrieves a string representation of this string genes value that </s>
|
funcom_train/17291442
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void disabledTestTryReadLockFailsWhenUpdateLocked() throws Exception {
// Test disabled because SHARED locks are now compatible with
// UPDATE locks
final Latch latch = latchFactory.newReadWriteUpdateLatch();
latch.updateLock();
testfailed = false;
Thread t = new Thread(new Runnable() {
public void run() {
if (latch.trySharedLock()) {
testfailed = true;
latch.unlockShared();
}
}
});
t.start();
t.join();
latch.unlockUpdate();
assertFalse(testfailed);
}
COM: <s> try read lock fails when update locked </s>
|
funcom_train/5165787
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void sort(Comparator c) {
Arrays.sort(m_programs, c);
float f = 0;
for (int i = 0; i < m_programs.length; i++) {
if (m_fitnessRank.length > i) {
m_fitnessRank[i] = f;
}
if (m_programs[i] != null) {
f += m_programs[i].getFitnessValue();
}
}
}
COM: <s> sorts the population into ascending order using some criterion for </s>
|
funcom_train/17784552
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public TypeReference resolve(ModelObject modelObject) {
TypeReference ret=null;
java.util.List<Object> typeResolverRules=
org.scribble.extensions.RegistryFactory.getRegistry().getExtensions(
TypeResolverRule.class, null);
for (int i=0; ret == null &&
i < typeResolverRules.size(); i++) {
TypeResolverRule resolver=(TypeResolverRule)
typeResolverRules.get(i);
if (resolver.isSupported(modelObject)) {
ret = resolver.resolve(modelObject);
}
}
return(ret);
}
COM: <s> this method returns the type reference associated </s>
|
funcom_train/28473537
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private JTextField getProbSuccBetaTextField() {
if (probSuccBetaTextField == null) {
probSuccBetaTextField = new NumberTextField(DEFAULT_PROB_SUCC_BETA, 8, true, true);
probSuccBetaTextField.setPreferredSize(new Dimension(50, 20));
}
return probSuccBetaTextField;
}
COM: <s> this method initializes prob succ beta text field </s>
|
funcom_train/20084042
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void mousePressed(MouseEvent me) {
boolean hitGUI = display.fireMousePressedEvent(me.getX(), display.getHeight()-me.getY(),
EventHelper.getMouseButton(me), me.getClickCount());
if(!hitGUI) {
System.out.println("MousePressed on underlying scene: "+me);
}
}
COM: <s> invoked when a mouse button just went down </s>
|
funcom_train/13865308
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected int addString(String string) {
if (string == null) {
return 0;
}
Integer o = stringMap.get(string);
if (o != null) {
return o;
}
stringTable.add(string);
// index is 1-based
int index = stringTable.size();
stringMap.put(string, index);
return index;
}
COM: <s> add a string to the string table and return its index </s>
|
funcom_train/12165309
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void testWriteFormPostamble() throws Exception {
final VolantisProtocol protocol = getProtocol();
MethodInvoker invoker = new MethodInvoker() {
public void invoke() throws Exception {
protocol.writeFormPostamble(getOutputBuffer(protocol));
}
};
String expecting = getExpectedWriteFormPostambleResult();
ProtocolIntegrationTestHelper.doTest(expectations, protocol, invoker, expecting);
}
COM: <s> this method tests the method public void write form postamble </s>
|
funcom_train/13598949
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void suspend() {
isSuspended = true;
suspendJobs();
suspendTaskInstances();
// propagate to child tokens
if (children!=null) {
Iterator iter = children.values().iterator();
while (iter.hasNext()) {
Token child = (Token) iter.next();
child.suspend();
}
}
}
COM: <s> suspends a process execution </s>
|
funcom_train/44777955
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public PhenotypeOntologyGroup testGetPhenotypeOntologyGroup() {
// create phenotype ontology filter
PhenotypeOntologyFilter filter = new PhenotypeOntologyFilter();
// add value to filter
filter.addValue(new FilterSingleValue(PhenotypeOntologyProperty.NAME, "Days to Silk"));
// retrieve phenotype ontology group using filter
PhenotypeOntologyGroup group = myDBGateway.getPhenotypeOntologyGroup(filter);
return group;
}
COM: <s> tests the gateway method to get a phenotype ontology group </s>
|
funcom_train/12561239
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void lRemoveCommand(Command cmd, int i) {
super.lRemoveCommand(cmd, i);
// default to PLAIN appearance if there are no commands left
if (strItem.numCommands < 1) {
appearanceMode = Item.PLAIN;
lRequestInvalidate(true, true);
}
// checkTraverse(); right now traversability is not command dependent
// lRequestInvalidate(true, true);
}
COM: <s> notifies l amps f of a command removal in the corresponding string item </s>
|
funcom_train/13271546
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setPhotoWidth(int photoWidth) {
if (this.photoWidth != photoWidth) {
int oldPhotoWidth = this.photoWidth;
this.photoWidth = photoWidth;
this.propertyChangeSupport.firePropertyChange(Property.PHOTO_WIDTH.name(),
oldPhotoWidth, photoWidth);
}
}
COM: <s> sets the preferred photo width and notifies </s>
|
funcom_train/43133498
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public SimpleDocument removeDocument(Target target) {
SimpleDocument removedDocument = docTargets.remove(target);
if (removedDocument != null) {
LibraryEvent event = new LibraryEvent(this);
event.setDocument(removedDocument);
event.setTarget(target);
fireDocumentRemovedEvent(event);
}
return removedDocument;
}
COM: <s> remove a document from the library </s>
|
funcom_train/29271003
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void testMailTemplateError() throws Exception {
JAXBContext context = JAXBContext.newInstance(getPackageName(MailTemplate.class));
Unmarshaller unmarshaller = context.createUnmarshaller();
MyEventHandler h = new MyEventHandler();
unmarshaller.setEventHandler(h);
try {
unmarshaller.unmarshal(new InputSource(new StringReader(getMailTemplate3(false))));
} catch (Throwable t) {
}
assertTrue(h.ok);
}
COM: <s> tests proper handling of the choice group </s>
|
funcom_train/8664307
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public boolean getBoolean(final String key) throws JSONException {
final Object o = this.get(key);
if (o.equals(Boolean.FALSE)
|| ((o instanceof String) && ((String) o)
.equalsIgnoreCase("false"))) {
return false;
} else if (o.equals(Boolean.TRUE)
|| ((o instanceof String) && ((String) o)
.equalsIgnoreCase("true"))) {
return true;
}
throw new JSONException("JSONObject[" + JSONObject.quote(key)
+ "] is not a Boolean.");
}
COM: <s> get the boolean value associated with a key </s>
|
funcom_train/39533805
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void selectionModeChanged(){
//getting the set of all the shape modules
Set<AbstractShape> modules=Editor.getEditor().getShapeModules();
//notifying all the shape modules that the selection mode has changed
for(AbstractShape shapeModule : modules){
if(shapeModule!=null) {
shapeModule.notifyDrawingAction(
svgHandle, null, 0, AbstractShape.DRAWING_END);
}
}
}
COM: <s> notifies that the selection mode has changed </s>
|
funcom_train/28278214
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void applyToStatusLine(IStatus status) {
String message = status.getMessage();
if (message.length() == 0)
message = null;
switch (status.getSeverity()) {
case IStatus.OK:
setErrorMessage(null);
setMessage(message);
break;
case IStatus.WARNING:
setErrorMessage(null);
setMessage(message, WizardPage.WARNING);
break;
case IStatus.INFO:
setErrorMessage(null);
setMessage(message, WizardPage.INFORMATION);
break;
default:
setErrorMessage(null);
setMessage(message, WizardPage.ERROR);
break;
}
}
COM: <s> applies the status to the status line of a dialog page </s>
|
funcom_train/5864356
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void setColspan(int colspan) throws WrongValueException {
if (colspan <= 0)
throw new WrongValueException("Positive only");
if (_colspan != colspan) {
_colspan = colspan;
final Component parent = getParent();
if (parent != null)
parent.invalidate();
else {
final Execution exec = Executions.getCurrent();
if (exec != null && exec.isExplorer())
invalidate();
else smartUpdate("colspan", Integer.toString(_colspan));
}
}
}
COM: <s> sets the number of columns to span this header </s>
|
funcom_train/1116862
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private JButton getDelButton() {
if (delButton == null) {
delButton = new JButton();
delButton.setText(Resource.getPlainResourceString("Delete_Memo"));
delButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
deleteMemo();
}
});
}
return delButton;
}
COM: <s> this method initializes del button </s>
|
funcom_train/8094382
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void copy(ParentSet other) {
m_nCardinalityOfParents = other.m_nCardinalityOfParents;
m_nNrOfParents = other.m_nNrOfParents;
for (int iParent = 0; iParent < m_nNrOfParents; iParent++) {
m_nParents[iParent] = other.m_nParents[iParent];
}
} // Copy
COM: <s> copy makes current parents set equal to other parent set </s>
|
funcom_train/49995494
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private TelemetryStreamYAxis newYAxis(String streamUnitName, double streamMax, double streamMin) {
TelemetryStreamYAxis axis = new TelemetryStreamYAxis(streamUnitName);
axis.setMaximum(streamMax);
axis.setMinimum(streamMin);
axis.setColor(GoogleChart.getRandomColor());
return axis;
}
COM: <s> create a new telemetry stream yaxis instance with given parameters </s>
|
funcom_train/9979883
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void encodeAsVisibleString(String value, TypeInformation typeInformation) throws IOException {
if (!typeInformation.hasConstraint()) {
encodeUnconstrainedRestrictedCharacterString(value, typeInformation, VisibleStringInfo.getInstance());
} else {
encodeRestrictedCharacterString(value, typeInformation, VisibleStringInfo.getInstance());
}
}
COM: <s> encoding of the restricted character string type visible string </s>
|
funcom_train/3387801
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public Object invokeNoChecked(Object obj, Object ... args) {
try {
return invoke(obj, args);
} catch (InvocationTargetException ex) {
if (ex.getCause() instanceof RuntimeException) {
throw (RuntimeException)ex.getCause();
} else {
throw new RuntimeException(ex.getCause());
}
}
}
COM: <s> invoke the method that this object represents with the </s>
|
funcom_train/45130216
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void parseInitialFileName() {
int lastIndex = Math.max(configFileName.lastIndexOf("/"), configFileName.lastIndexOf("\\"));
if (lastIndex > 0) {
setConfigDirectory(configFileName.substring(0, lastIndex + 1));
this.configFileName = configFileName.substring(lastIndex + 1);
}
}
COM: <s> parse the directory name if one is specified </s>
|
funcom_train/2283727
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: protected void init() {
contractMapStorage = new HashMap<K, List<V>>();
subscribedContractMapSer = new HashMap<K, Ser>();
subscribedSymbolMapContract = new HashMap<String, K>();
serMapchainSer = new HashMap<Ser, Ser>();
}
COM: <s> this should be called before really usage </s>
|
funcom_train/50572173
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void pre_toString() {
assert super.getTargetField("from") != null;
assert super.getTargetField("to") != null;
assert super.getTargetField("received") != null;
assert super.getTargetField("body") != null;
} // end pre_toString()
COM: <s> pre condition for to string method </s>
|
funcom_train/24370422
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: final public GeoConicPart CircleSector(String label, GeoPoint A, GeoPoint B, GeoPoint C) {
AlgoConicPartCircle algo = new AlgoConicPartCircle(cons, label, A,B, C,
GeoConicPart.CONIC_PART_SECTOR);
processCreateCommand(algo.getConicPart()); //VMT modification
return algo.getConicPart();
}
COM: <s> circle sector from center and twho points on arc </s>
|
funcom_train/7502245
|
/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;
UserProfileFilter filter = new UserProfileFilter(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 user name </s>
|
funcom_train/21701241
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public void removeIdentitiesFromSearchResult(UserRequest ureq, List<Identity> tobeRemovedIdentities) {
int counter = PersistenceHelper.removeObjectsFromList(identitiesList, tobeRemovedIdentities);
initUserListCtr(ureq, identitiesList, null);
userListVC.put("userlist", tableCtr.getInitialComponent());
}
COM: <s> remove the given identites from the list of identites in the table model </s>
|
funcom_train/49128187
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: public String getValue(String key) {
try {
getSetting.clearParameters();
getSetting.setString(1, key);
final ResultSet result = getSetting.executeQuery();
if (result.next()) {
return result.getString("value");
}
} catch(SQLException e) {
logger.warn("Query failed.", e);
}
return null;
}
COM: <s> returns the value of the specified setting </s>
|
funcom_train/50081382
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private IRing getSmallestRing(IRingSet ringSet, IBond bond) {
IRingSet rings = ringSet.getRings(bond);
IRing ring = null;
int minOrderSum = Integer.MAX_VALUE;
for (Object ring1 : rings.atomContainers()) {
if (minOrderSum > ((IRing) ring1).getBondOrderSum()) {
ring = (IRing) ring1;
minOrderSum = ring.getBondOrderSum();
}
}
return ring;
}
COM: <s> this is an alternative for get heaviest ring </s>
|
funcom_train/5002880
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private String makeFunctionCall(String functionName, String[] arguments) {
StringBuffer sb = new StringBuffer();
sb.append(functionName);
sb.append(RConstant.OPEN_PAREN);
for (int i = 0; i < arguments.length; i++) {
sb.append(arguments[i]);
if ((i + 1) < arguments.length) {
sb.append(", "); //$NON-NLS-1$
}
}
sb.append(RConstant.CLOSE_PAREN);
return sb.toString();
}
COM: <s> make function call </s>
|
funcom_train/9828095
|
/tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716
|
TDAT: private void portsUpdated() {
if ( _portSettingsListeners == null ) return;
Object[][] portSettings = getPorts();
for ( Iterator itr = _portSettingsListeners.iterator();
itr.hasNext(); ) {
PortSettingsListener psl = (PortSettingsListener)itr.next();
psl.dtbPortSettingsUpdated( portSettings );
}
} // end method portsUpdated
COM: <s> tells all of the port settings listeners that the port settings </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.