__key__
stringlengths 16
21
| __url__
stringclasses 1
value | txt
stringlengths 183
1.2k
|
---|---|---|
funcom_train/50167878 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object getInstance(String className) throws PedroException {
try {
Class cls = loadClass(className);
Constructor constructor = cls.getConstructor(new Class[0]);
return constructor.newInstance(new Object[0]);
} catch (Exception err) {
throw new PedroException(err.toString());
} // end try-catch
}
COM: <s> convenience method to get an instance of a class by </s>
|
funcom_train/15913663 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void handleGrepButtonPressed() {
SimpleTextDialog dlg = new SimpleTextDialog(getSite().getShell(), Messages.getString("views.QuickRExView.dlg.title"), hits.grep()); //$NON-NLS-1$
dlg.open();
}
COM: <s> the handle method for grepping </s>
|
funcom_train/47978181 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getFullUsageDescription() {
final StringBuffer buffer = new StringBuffer();
buffer.append(QUOTATION_CHAR);
buffer.append(toString());
buffer.append(QUOTATION_CHAR);
buffer.append(SPACE_CHAR);
buffer.append(COLON_CHAR);
buffer.append(SPACE_CHAR);
buffer.append(getUsageDescription());
return buffer.toString();
}
COM: <s> gets the string containing the full display usage description </s>
|
funcom_train/12782520 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean sameValue(BitVectorVariable other) {
if (other == null) {
throw new IllegalArgumentException("null other");
}
if (V == null) {
return (other.V == null);
} else {
if (other.V == null) {
return false;
} else {
return V.sameValue(other.V);
}
}
}
COM: <s> does this variable have the same value as another </s>
|
funcom_train/50152504 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void add_appt() throws Warning, Exception {
// get a new appt from the model and set it from the user data
AppointmentModel calmod_ = AppointmentModel.getReference();
Appointment r = calmod_.newAppt();
setAppt(r, true);
// encrypt it
if (encryptBox.isSelected()) {
encryptAppt(r);
}
// save it
calmod_.saveAppt(r);
// clear UI and show a new appt
showapp(-1, null);
}
COM: <s> add an appointment to the model based on the ui settings </s>
|
funcom_train/4805263 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addActiveHandler(ContentHandler handler, ModeUsage attributeModeUsage) {
activeHandlers.addElement(handler);
activeHandlersAttributeModeUsage.addElement(attributeModeUsage);
attributeProcessing = Math.max(attributeProcessing,
attributeModeUsage.getAttributeProcessing());
if (attributeModeUsage.isContextDependent())
contextDependent = true;
}
COM: <s> adds a handler for a mode usage </s>
|
funcom_train/2999458 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Element toXML(String tag) {
Element e = new Element(tag);
if (id != null) {
e.setAttribute("id", id);
}
if (description != null) {
e.addContent(new Element("description").setText(description));
}
return e;
}
COM: <s> convert myself to an xml element </s>
|
funcom_train/15400231 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Shape getShape() {
Point2D[] points = getLocation();
Polygon myShape = new Polygon();
for (int i = 0; i < points.length; i++) {
myShape.addPoint((int)points[i].getX(), (int)points[i].getY());
}
return(myShape);
}
COM: <s> returns shape object of the polygon that the collection of 2 d points </s>
|
funcom_train/44708241 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public OID getGranteeOID() {
if (granteeIsUser()) {
return new OID (User.BASE_DATA_OBJECT_TYPE,
m_dataQuery.get("granteeID"));
} else {
return new OID (Group.BASE_DATA_OBJECT_TYPE,
m_dataQuery.get("granteeID"));
}
}
COM: <s> returns the party oid of the grantee of the current permission record </s>
|
funcom_train/4424475 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void remove(Var variable) {
List<Def> definitions = variable.getDefs();
while (!definitions.isEmpty()) {
Def def = definitions.get(0);
Instruction instruction = EcoreHelper.getContainerOfType(def,
Instruction.class);
IrUtil.delete(instruction);
}
List<Use> uses = variable.getUses();
while (!uses.isEmpty()) {
Use use = uses.get(0);
Instruction instruction = EcoreHelper.getContainerOfType(use,
Instruction.class);
IrUtil.delete(instruction);
}
}
COM: <s> removes the instructions that define an unused state variable </s>
|
funcom_train/124236 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected ImportDataFrame getImportFrame() {
if (importFrame == null) {
try {
importFrame = new ImportDataFrame();
importFrame.setImportPanel(getImportPanel());
} catch (Throwable ex) {
log.error("Error creating import frame", ex);
}
}
return importFrame;
}
COM: <s> gets the import data frame </s>
|
funcom_train/35683149 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void errorDialog(final String context, final CoreException e) {
ErrorDialog.openError(getSite().getShell(),
NLS.bind(Messages.editor_generic_error_msg,
context, e.getMessage()),
null, e.getStatus());
}
COM: <s> report a core exception </s>
|
funcom_train/34353170 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Set oneLineDescriptionStems(String oneLineDescription) {
Set stems = new HashSet();
Tokenizer t = new Tokenizer(new StringReader(oneLineDescription), true, true);
Tokenizer.TokenPair pair;
while ((pair = t.nextToken()) != null) {
stems.add(pair.getModified());
}
return stems;
}
COM: <s> return the stems of the one line description string </s>
|
funcom_train/47021364 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getItemCommand1() {
if (itemCommand1 == null) {//GEN-END:|147-getter|0|147-preInit
// write pre-init user code here
itemCommand1 = new Command("Keys", Command.ITEM, 1);//GEN-LINE:|147-getter|1|147-postInit
// write post-init user code here
}//GEN-BEGIN:|147-getter|2|
return itemCommand1;
}
COM: <s> returns an initiliazed instance of item command1 component </s>
|
funcom_train/19703329 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getJButtonCD() {
if (jButtonCD == null) {
jButtonCD = new JButton();
jButtonCD.setText("CDAnalyzer");
jButtonCD.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
new CDResultViewer(MainFrame.this).setVisible(true);
}
});
}
return jButtonCD;
}
COM: <s> this method initializes j button cd </s>
|
funcom_train/36799797 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getSettingsCommand () {
if (settingsCommand == null) {//GEN-END:|135-getter|0|135-preInit
// write pre-init user code here
settingsCommand = new Command ("Settings", Command.SCREEN, 3);//GEN-LINE:|135-getter|1|135-postInit
// write post-init user code here
}//GEN-BEGIN:|135-getter|2|
return settingsCommand;
}
COM: <s> returns an initiliazed instance of settings command component </s>
|
funcom_train/32112279 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public CoreMorphAnimation getCoreMorphAnimation(int coreMorphAnimationId) {
if((coreMorphAnimationId < 0) || (coreMorphAnimationId >= vectorCoreMorphAnimation.size())) {
//CalError::setLastError(CalError::INVALID_HANDLE, __FILE__, __LINE__);
//TODO afegir exepcio
return null;
}
return vectorCoreMorphAnimation.get(coreMorphAnimationId);
}
COM: <s> provides access to a core morph animation </s>
|
funcom_train/18847195 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String createInvalidProcessSubProcessTypeException(String tscToken, String connectableNodeID) {
PropertyMap propertyMap = new PropertyMap();
DiagnosticsListCreator edg;
edg = new DiagnosticsListCreator();
String severityType = DiagnosticsCodes.getErrorDiagnosticsCode();
String exceptionID = "80240";
propertyMap.addPropertyValuePair("connectableNodeID", connectableNodeID);
String serExMsg = edg.constructErrorDocOneItemParam(tscToken,
componentID,
severityType,
subSystemCode,
exceptionID,
propertyMap);
return serExMsg;
}
COM: <s> create invalid process sub process type exception </s>
|
funcom_train/2955220 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int getRelativeY(int square, int orientation) {
switch (orientation % 4) {
case 0 :
return shapeY[square];
case 1 :
return shapeX[square];
case 2 :
return -shapeY[square];
case 3 :
return -shapeX[square];
default:
return 0; // Should never occur
}
}
COM: <s> rotates the relative vertical position of a specified square </s>
|
funcom_train/43617247 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Cursor fetchNote(long rowId) throws SQLException {
Cursor mCursor =
mDb.query(true, TABLE_NAME, new String[] {ROWID, COMMENT, IP_ADDRESS
, MAC_ADDRESS}, ROWID + "=" + rowId, null, null, null, null, null);
if (mCursor != null) {
mCursor.moveToFirst();
}
return mCursor;
}
COM: <s> return a cursor positioned at the note that matches the given row id </s>
|
funcom_train/47366342 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getExecButton() {
if (ExecButton == null) {
ExecButton = new JButton();
ExecButton.setBounds(new Rectangle(90, 210, 241, 29));
ExecButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
execAction();
}
});
}
return ExecButton;
}
COM: <s> this method initializes exec button </s>
|
funcom_train/2293314 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String getCacheKey(String prefix, boolean flag, CmsUUID projectId, String resource) {
StringBuffer b = new StringBuffer(64);
if (prefix != null) {
b.append(prefix);
b.append(flag ? '+' : '-');
}
b.append(CmsProject.isOnlineProject(projectId) ? '+' : '-');
return b.append(resource).toString();
}
COM: <s> return a cache key build from the provided information </s>
|
funcom_train/4125746 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean canTradeWith(Settlement settlement) {
return canCarryGoods()
&& goodsContainer.getGoodsCount() > 0
&& getOwner().getStance(settlement.getOwner()) != Stance.WAR
&& (settlement instanceof IndianSettlement
|| hasAbility("model.ability.tradeWithForeignColonies"));
}
COM: <s> returns true if this unit can enter a settlement in order to trade </s>
|
funcom_train/2629135 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean moveCellSelectionTo(int row, int col) {
if(col >= 0 && col < CellCollection.SUDOKU_SIZE
&& row >= 0 && row < CellCollection.SUDOKU_SIZE) {
mSelectedCell = mCells.getCell(row, col);
onCellSelected(mSelectedCell);
postInvalidate();
return true;
}
return false;
}
COM: <s> moves selection to the cell given by row and column index </s>
|
funcom_train/47944727 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void loadOpendapMetaData(String url) throws MotuException, NetCdfAttributeException {
if (LOG.isDebugEnabled()) {
LOG.debug("loadOpendapMetaData() - entering");
}
setLocationData(url);
setProductIdFromLocation();
loadOpendapMetaData();
if (LOG.isDebugEnabled()) {
LOG.debug("loadOpendapMetaData() - exiting");
}
}
COM: <s> reads product metadata from an url opendap dataset </s>
|
funcom_train/20553125 | /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) {
BorderLayout borderLayout = new BorderLayout();
borderLayout.setHgap(0);
borderLayout.setVgap(0);
jContentPane = new JPanel();
jContentPane.setLayout(borderLayout);
jContentPane.add(getJPanel1(), BorderLayout.SOUTH);
jContentPane.add(getJPanel(), BorderLayout.CENTER);
jContentPane.add(getJPanel2(), BorderLayout.NORTH);
}
return jContentPane;
}
COM: <s> this method initializes j content pane </s>
|
funcom_train/44602569 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void test_expression_03(){
compileAndExecGivenStatementExpectRuntimeError(
"X.java",
"public class X {\n" +
" int x = 10;\n" +
" //@ requires x == 5;\n" +
" public void m() {\n" +
" }\n" +
"}\n",
"new X().m()",
null,
JMLInternalPreconditionError.class);
}
COM: <s> single name reference </s>
|
funcom_train/49018199 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Album registerAlbum(String sId, String sName) {
synchronized (TrackManager.getInstance().getLock()) {
Album album = (Album) hmItems.get(sId);
if (album != null) {
return album;
}
album = new Album(sId, sName);
hmItems.put(sId, album);
return album;
}
}
COM: <s> register an album with a known id </s>
|
funcom_train/42273387 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void closeCachedReadingDirectory() {
if (cachedReadingDirectory != null) {
log.debug("closing cached reading directory");
try {
accessProvider.close(cachedReadingDirectory);
} catch (RuntimeException e) {
log.error("", e);
} finally {
cachedReadingDirectory = null;
}
}
}
COM: <s> close the cached reading directory </s>
|
funcom_train/7291517 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean containsTab(TabStop tabToTest) {
for (TabStop tab = firstTab();
tab.getType() != TabStop.kAuto;
tab = nextTab(tab.getPosition())) {
if (tab.getPosition() >= tabToTest.getPosition()) {
return tabToTest.equals(tab);
}
}
return false;
}
COM: <s> return true if this tab ruler contains the given tab </s>
|
funcom_train/44890102 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: // public boolean equals(Object object) {
// if (!(object instanceof Module))
// return false;
// Module other = (Module) object;
// if (this.getResource() == null) {
// System.out.println(this.getName() + " has a null resource.");
// return false;
// }
// return this.getResource().equals(other.getResource());
// }
COM: <s> todo this method is here because otherwise selection of a module in the </s>
|
funcom_train/7508250 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testEncrypt() throws EncryptionException {
System.out.println("testEncrypt()");
Encryptor instance = ESAPI.encryptor();
String plaintext = "test123456"; // Not multiple of block cipher size
String ciphertext = instance.encrypt(plaintext);
String result = instance.decrypt(ciphertext);
assertEquals(plaintext, result);
}
COM: <s> test of deprecated encrypt method for strings </s>
|
funcom_train/2538013 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private float getWidthXYRealtiveToParent() {
Vector3D p = this.getWidthXYVectLocal();
Matrix m = new Matrix(this.peerComponent.getLocalMatrix());
m.removeTranslationFromMatrix();
p.transform(m);
return p.length();
// Vector3D[] v = xyBoundsRect.getVectorsRelativeToParent();
// float[] minMax = ToolsGeometry.getMinXYMaxXY(v);
// return minMax[2] - minMax[0];
}
COM: <s> calculates the width of this shape by using the </s>
|
funcom_train/33006160 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void run() {
while (started) {
synchronized (this) {
while (transferHandler == null && started) {
try {
wait(1000);
}
catch (InterruptedException ie) {}
} // while
}
if (started && transferHandler != null) {
transferHandler.transferData(this);
try {
Thread.currentThread().sleep( 10 );
}
catch (InterruptedException ise) {}
}
} // while (started)
} // run
COM: <s> the execution method of the thread </s>
|
funcom_train/38578378 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Stroke transform(Link e) {
if (empty_view) {
return new BasicStroke(new Float(DataStructure.getInstance()
.getVisualisationData().getDefaultEdgeSize()));
} else if (datatransfers_view) {
return ComputeEdgeSizeTransfer(e.getSize());
} else {
return new BasicStroke(new Float(DataStructure.getInstance()
.getVisualisationData().getDefaultEdgeSize()));
}
}
COM: <s> transforms the edge into the size of the edge </s>
|
funcom_train/15827885 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void handleArrayType(Token<JavaTokenType> type, int start) {
Token<JavaTokenType> array = LA(start);
while (tokens.size() > 1) {
if (array.getType() == JavaTokenType.LBRACK) {
type.setValue(type.getValue() + "[");
tokens.remove(1);
}
else if (array.getType() == JavaTokenType.RBRACK) {
type.setValue(type.getValue() + "]");
tokens.remove(1);
}
else {
break;
}
array = LA(start);
}
}
COM: <s> handles array types eg </s>
|
funcom_train/37854634 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void handleStatus(SVNStatus status) throws SVNException {
try {
sendToHandler(status);
} catch (SAXException th) {
getDebugLog().logSevere(SVNLogType.DEFAULT, th);
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.XML_MALFORMED, th.getLocalizedMessage());
SVNErrorManager.error(err, th, SVNLogType.DEFAULT);
}
}
COM: <s> handles a next code status code object producing corresponding xml </s>
|
funcom_train/45539169 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void highlightingStyleChanged(Highlighting highlighting) {
for (int i= 0, n= fPositions.size(); i < n; i++) {
HighlightedPosition position= (HighlightedPosition) fPositions.get(i);
if (position.getHighlighting() == highlighting)
fSourceViewer.invalidateTextPresentation(position.getOffset(), position.getLength());
}
}
COM: <s> invalidate text presentation of positions with the given highlighting </s>
|
funcom_train/10048192 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String authenticate(HttpServletRequest request, HttpServletResponse response) throws LoginException {
HttpSession session = request.getSession();
Subject subject = (Subject) session.getAttribute(Constants.SUBJECT_SESSION_KEY);
String username = "" + request.getParameter(Constants.AUTH_USERNAME_KEY);
String password = PasswordUtils.createHash("" + request.getParameter(Constants.AUTH_PASSWORD_KEY));
AuthenticationManager manager = AuthenticationManager.getInstance();
subject = manager.login(username, password.toCharArray());
session.setAttribute(Constants.SUBJECT_SESSION_KEY, subject);
return null;
}
COM: <s> authenticate a user returning a message if applicable </s>
|
funcom_train/46998695 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getJButton1() {
if (jButton1 == null) {
jButton1 = new JButton();
jButton1.setBounds(new Rectangle(97, 138, 269, 47));
jButton1.setText("Click Here to Stream at Higher Ports");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
StreamTable.LowerPorts = 4000;
new StreamTable();
dispose();
}
});
}
return jButton1;
}
COM: <s> this method initializes j button1 </s>
|
funcom_train/10209827 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void onRenameDataset() {
StatDataset dataset = getDataset((ListValue) datasetsList.getSelectedValue());
if (dataset != null){
String newName = JOptionPane.showInputDialog(
parentWindow,
"Please enter new name for this data set",
"Rename data set", JOptionPane.PLAIN_MESSAGE);
if (!((newName == null) || (newName == "")))
dataset.setDisplayText(newName);
onDatasetsChanged();
}else
onDatasetsCleared();
}
COM: <s> slot opens an </s>
|
funcom_train/38823979 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void showIntro() {
HTMLPanel jp = new HTMLPanel();
jp.setHTML(new Dimension(jfMain.getWidth() - 120,
jfMain.getHeight() - 200), config.getFileHelp());
JOptionPane.showMessageDialog(jfMain, jp,
config.getL().get("Introduction"), JOptionPane.PLAIN_MESSAGE);
}
COM: <s> shows the introduction </s>
|
funcom_train/29618349 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JTextArea getJInibapVernacularNameField() {
if (jInibapVernacularNameField == null) {
jInibapVernacularNameField = new MgisTextArea();
jInibapVernacularNameField.setEditable(false);
jInibapVernacularNameField.setLineWrap(true);
jInibapVernacularNameField.setWrapStyleWord(true);
jInibapVernacularNameField.setText(m_pdf.getAccession().getLNomversge());
}
return jInibapVernacularNameField;
}
COM: <s> this method initializes j inibap vernacular name field </s>
|
funcom_train/41165927 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ToExercise2Group update(ToExercise2Group entity) {
EntityManagerHelper.log("updating ToExercise2Group instance", Level.INFO, null);
try {
ToExercise2Group result = getEntityManager().merge(entity);
EntityManagerHelper.log("update successful", Level.INFO, null);
return result;
} catch (RuntimeException re) {
EntityManagerHelper.log("update failed", Level.SEVERE, re);
throw re;
}
}
COM: <s> persist a previously saved to exercise2 group entity and return it or a </s>
|
funcom_train/19177454 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void processDisconnect() {
Iterator it = selector.keys().iterator();
while(it.hasNext()) {
SelectionKey sk = (SelectionKey)it.next();
SelectableChannel channel = (SelectableChannel)sk.channel();
if (channel instanceof SocketChannel) {
cancel(sk);
}
}
}
COM: <s> disconnects all clients from this server </s>
|
funcom_train/45843435 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void processArgs(String[] args) {
for (int i=0; i<args.length;i++) {
if (args[i].equals("-fps")) {
m_desiredFrameRate = Integer.parseInt(args[i+1]);
System.out.println("DesiredFrameRate: " + m_desiredFrameRate);
i++;
}
}
}
COM: <s> process any command line args </s>
|
funcom_train/25946824 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initComponents(){
ImageItem img = new ImageItem("", ImageLoader.getImage(ImageLoader.GLOBSEARCH), ImageItem.LAYOUT_CENTER, null);
message = new StringItem("loading...", null);
message.setLayout(StringItem.LAYOUT_NEWLINE_AFTER);
message.setLayout(StringItem.LAYOUT_CENTER);
gauge = new Gauge(null, false, 50, 0);
gauge.setLayout(Gauge.LAYOUT_NEWLINE_BEFORE);
gauge.setLayout(Gauge.LAYOUT_CENTER);
this.append(img);
this.append(message);
this.append(gauge);
}
COM: <s> initializes the visual components </s>
|
funcom_train/21625317 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void removeNode(IFigure nodeFigure) {
if (!this.getChildren().contains(nodeFigure)) {
throw new RuntimeException("Node not contained on the ZestRootLayer");
}
int nodePosition = this.getChildren().indexOf(nodeFigure);
if (nodePosition > getHighlightNodeStartPosition()) {
// The node is in the highlight node area
numberOfHighlightedNodes--;
} else {
// The node is in the node area
numberOfNodes--;
}
this.remove(nodeFigure);
}
COM: <s> removes a node from the layer </s>
|
funcom_train/17531472 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void notifyWindowsOfRender() {
List<Window> allWindows = new ArrayList<Window>();
getAllWindows(allWindows);
int last = allWindows.size();
int cur;
while (true) {
// notify every window
for (Window w : allWindows)
w.onRender();
allWindows.clear();
getAllWindows(allWindows);
cur = allWindows.size();
// if the window amount is same, no need to repeat.
if (cur == last)
break;
last = cur;
}
}
COM: <s> notify all windows that they are going to be rendered </s>
|
funcom_train/13814614 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setCropBounds( Rectangle2D cropBounds ) {
ODMGXAWrapper txw = new ODMGXAWrapper();
txw.lock( this, Transaction.WRITE );
cropMinX = cropBounds.getMinX();
cropMinY = cropBounds.getMinY();
cropMaxX = cropBounds.getMaxX();
cropMaxY = cropBounds.getMaxY();
txw.commit();
}
COM: <s> set the preferred cropping operation </s>
|
funcom_train/3594827 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void drawLine(Graphics g, int x1, int y1, int x2, int y2, Color colour, int width) {
Graphics2D gr = (Graphics2D) g;
gr.setColor(colour);
gr.setStroke(new BasicStroke());
gr.drawLine(x1, y1, x2, y2);
}
COM: <s> draw a line on the background </s>
|
funcom_train/27810583 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public XMLBuilder end() throws IllegalStateException, IOException {
if (elementStack.isEmpty()) {
throw new IllegalStateException("There are no unclosed elements.");
}
String element = elementStack.pop();
indent();
writer.write("</");
writer.write(element);
writer.write('>');
newline();
return this;
}
COM: <s> closes the current element </s>
|
funcom_train/28754224 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setPosthybstartdate(String newVal) {
if ((newVal != null && this.posthybstartdate != null && (newVal.compareTo(this.posthybstartdate) == 0)) ||
(newVal == null && this.posthybstartdate == null && posthybstartdate_is_initialized)) {
return;
}
this.posthybstartdate = newVal;
posthybstartdate_is_modified = true;
posthybstartdate_is_initialized = true;
}
COM: <s> setter method for posthybstartdate </s>
|
funcom_train/18328964 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getSpaceFree(final User user) throws DatabaseException {
return getMaxSpace() - runQuery(SELECT_SPACE_USED,new Query<Integer>(){
void setup(PreparedStatement ps) throws SQLException {
setResult(0);
ps.setInt(1, user.getUid());
}
void update(ResultSet rs) throws SQLException {
setResult(rs.getInt(1));
}
});
}
COM: <s> return the amount of available space for this users jar and data </s>
|
funcom_train/2806875 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double getTotalSalesTax() {
double tempTax = 0.0;
Iterator i = iterator();
while (i.hasNext()) {
tempTax += ((ShoppingCartItem) i.next()).getItemTax();
}
tempTax += OrderReadHelper.calcOrderAdjustments(this.getAdjustments(), getSubTotal(), false, true, false);
return tempTax;
}
COM: <s> returns the tax amount from the cart object </s>
|
funcom_train/1460370 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void show() {
try {
Messagebox.show(getMessage(),
getTitle(),
Messagebox.YES + Messagebox.NO,
Messagebox.EXCLAMATION,
new org.zkoss.zk.ui.event.EventListener() {
public void onEvent(Event event) {
if ("onYes".equals(event.getName())) {
doYes();
}
}
});
} catch (InterruptedException ex) {
//ignore
}
}
COM: <s> show the confirm delete messagebox </s>
|
funcom_train/21656634 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getBtAgregarCargos() {
if (btAgregarCargos == null) {
btAgregarCargos = new JButton();
btAgregarCargos.setBounds(new Rectangle(445, 150, 41, 25));
btAgregarCargos.setText("+");
btAgregarCargos.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
ControladorPrincipal.mostrarAgregarCargo();
}
});
}
return btAgregarCargos;
}
COM: <s> this method initializes bt agregar cargos </s>
|
funcom_train/18736126 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public static final IMessageRenderer MESSAGE_LABEL = new IMessageRenderer() {
public String toString() { return "MESSAGE_LABEL"; }
public String renderToString(IMessage message) {
if (null == message) {
return "((IMessage) null)";
}
return renderMessageLine(message, 5, 5, 32);
}
};
COM: <s> render message as label i </s>
|
funcom_train/34133486 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setAttributes( XAttribute[] attributes) {
Vector usedAttributes = new Vector();
if ( attributes != null) {
for ( int i = 0; i < attributes.length; i++) {
XAttribute attribute = attributes[i];
boolean found = false;
AttributeItem node = null;
node = new AttributeItem( attribute.getQualifiedName(), attribute.getValue(), true, false);
usedAttributes.addElement( node);
}
}
setListModel( new AttributeListModel( usedAttributes, new Vector()));
}
COM: <s> sets the list of attributes </s>
|
funcom_train/3309339 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String expandString(@Nonnull String string, @Nonnegative int length) {
if (string.length() >= length)
return string;
StringBuilder buf = new StringBuilder(length);
buf.append(string);
while (buf.length() < length) {
buf.append(' ');
}
return buf.toString();
}
COM: <s> expands a string to the specified length by appending blanks </s>
|
funcom_train/43889829 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(final Object object) {
if ((object != null) && object.getClass().equals(getClass())) {
final Identification that = (Identification) object;
return Utilities.equals(this.name, that.name) && Utilities.equals(this.type, that.type);
}
return false;
}
COM: <s> compares the specified object with this identification for equality </s>
|
funcom_train/34185925 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Matrix3f getOrientation(float time, float precision) {
Matrix3f rotation = new Matrix3f();
//calculate tangent
Vector3f point = getPoint(time);
Vector3f tangent = point.subtract(getPoint(time + precision));
tangent = tangent.normalize();
//calculate normal
Vector3f tangent2 = getPoint(time - precision).subtract(point);
Vector3f normal = tangent.cross(tangent2);
normal = normal.normalize();
//calculate binormal
Vector3f binormal = tangent.cross(normal);
binormal = binormal.normalize();
rotation.setColumn(0, tangent);
rotation.setColumn(1, normal);
rotation.setColumn(2, binormal);
return rotation;
}
COM: <s> code get orientation code calculates the rotation matrix for any </s>
|
funcom_train/124824 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setModel(TableModel model) {
super.setModel(model);
if (getModel() instanceof JSCAbstractTableModel) {
JSCAbstractTableModel m = (JSCAbstractTableModel) getModel();
m.setEditable(isEditable);
m.setColEditableMap(colIndexEditableMap);
m.setRowEditableMap(rowIndexEditableMap);
}
firePropertyChange("model", null, model);
}
COM: <s> overwrites supermethod to fire a model property change event </s>
|
funcom_train/29286928 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void relocate(CellEditor celleditor) {
Text text = (Text)celleditor.getControl();
Rectangle rect = figure.getHandleBounds();
figure.translateToAbsolute(rect);
org.eclipse.swt.graphics.Rectangle trim = text.computeTrim(0, 0, 0, 0);
rect.translate(trim.x, trim.y);
rect.width += trim.width;
rect.height += trim.height;
text.setBounds(rect.x + 15, rect.y + 15, rect.width - 30, rect.height - 30 );
}
COM: <s> relocates a cell editor </s>
|
funcom_train/43370456 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void stop() throws IOException {
log.entering(this.getClass().getName(), "stop");
log.finer("stopping socket adaptor on port: " + port);
// close the socket
server.close();
// stop the thread
running = false;
runThread.interrupt();
runThread = null;
log.exiting(this.getClass().getName(), "stop");
}
COM: <s> stop the adaptor </s>
|
funcom_train/947731 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Hashtable allFolderMessages(int argFolderId) throws DomainException {
Hashtable result = null;
try {
result = this.getContent(argFolderId, this.content);
} catch (IOException e) {
throw new DomainException(e.getMessage());
} catch (AuthenticationException e) {
throw new DomainException(e.getMessage());
}
return result;
}
COM: <s> gets id read unread sender and date </s>
|
funcom_train/27955265 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean validateAggregatorType_Enumeration(String aggregatorType, DiagnosticChain diagnostics, Map context) {
boolean result = AGGREGATOR_TYPE__ENUMERATION__VALUES.contains(aggregatorType);
if (!result && diagnostics != null)
reportEnumerationViolation(MondrianPackage.eINSTANCE.getAggregatorType(), aggregatorType, AGGREGATOR_TYPE__ENUMERATION__VALUES, diagnostics, context);
return result;
}
COM: <s> validates the enumeration constraint of em aggregator type em </s>
|
funcom_train/14628730 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addTo(Bus from, Bus to) {
this.from = from;
this.to = to;
powerSystem = from.getPowerSystem();
if (from.getPowerSystem() != to.getPowerSystem())
System.out.println("The endpoints of branch " + id + " are in different power systems! By default, this branch will belong to the system of the FROM bus.");
this.from.add(this);
this.to.add(this);
}
COM: <s> this method connects this branch to the given bus objects </s>
|
funcom_train/47745730 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void animateHorizontally( int posy, int fromX, int toX ) throws InterruptedException{
toaster.setLocation( fromX, posy);
if ( toX < fromX ){
for (int i = fromX; i > toX; i -= step){
toaster.setLocation(i, posy);
Thread.sleep(stepTime);
}
}else{
for (int i = fromX; i < toX; i += step){
toaster.setLocation(i, posy);
Thread.sleep(stepTime);
}
}
toaster.setLocation( toX, posy );
}
COM: <s> animate horizontally the toaster </s>
|
funcom_train/21953849 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setActive(Hashtable commands) {
if (currentAction != null) {
removeActionListener(currentAction);
}
try {
currentAction = (Action)commands.get(getActionCommand());
} catch (ClassCastException cce) {
currentAction = null;
}
if (currentAction != null) {
addActionListener(currentAction);
setEnabled(true);
} else {
setEnabled(false);
}
}
COM: <s> this updates the actions on the ui component </s>
|
funcom_train/21066731 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getUriPattern(String scheme) {
String pattern = null;
Map<String, PatternDescriptor> patterns = getURIPatterns();
if (hasUriPatternConfigured(scheme)) {
pattern = patterns.get(scheme).getPattern();
} else {
throw new IllegalArgumentException(
"There is no pattern defined for the " + scheme
+ " add an extension "
+ ID
+ " to your plugin and try again.");
}
return pattern;
}
COM: <s> get the pattern for a scheme </s>
|
funcom_train/41457604 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void uninstalls(String name) {
//unregister localy
Endpoint endpoint = endpoints.remove(name);
//send notification to manager
for (ServerManager manager : managers) {
manager.onStarted(endpoint);
}
try {
//TODO: lookup irrespective of endpoint usage
endpoint = namingService.lookup(name, true);
if (endpoint != null) {
endpoint.stop();
namingService.unregister(endpoint);
}
} catch (Exception e) {
}
}
COM: <s> uninstalls the endpoint </s>
|
funcom_train/22155778 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setColor(Color c) {
if (c == null) {
super.setBackground(Color.white);
// setLayout(new GridLayout(1,0));
// BorderPanel bp = new BorderPanel();
// add(bp);
// bp.add(new Label("<default>", Label.CENTER));
repaint();
}
else {
if (color == null && getComponentCount() != 0) {
removeAll();
repaint();
}
}
color = c;
}
COM: <s> sets the color property java </s>
|
funcom_train/37564843 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Object nextElement() {
if (nextItem == null) {
throw new NoSuchElementException("PageDB Enumeration");
}
Page toReturn = nextItem;
this.nextItem = new Page();
try {
if (! reader.next(nextItem)) {
this.nextItem = null;
}
} catch (IOException ie) {
this.nextItem = null;
}
return toReturn;
}
COM: <s> set aside the item we have in store </s>
|
funcom_train/48406886 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addRequiredResultsPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Milestone_requiredResults_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Milestone_requiredResults_feature", "_UI_Milestone_type"),
SpemxtcompletePackage.eINSTANCE.getMilestone_RequiredResults(),
true,
false,
true,
null,
null,
null));
}
COM: <s> this adds a property descriptor for the required results feature </s>
|
funcom_train/46459631 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double worldToImageXComponent(int n, double worldX, double worldY) {
if (n >= length) setLength(n + 1);
point.setLocation(worldX, worldY);
toImage.get(n).deltaTransform(point, point);
return point.getX();
}
COM: <s> converts the specified world vector components to an image </s>
|
funcom_train/15410267 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void visitInheritanceProperties(BeanDescriptor<?> descriptor, PropertyVisitor pv) {
InheritInfo inheritInfo = descriptor.getInheritInfo();
if (inheritInfo != null && inheritInfo.isRoot()){
// add all properties on the children objects
InheritChildVisitor childVisitor = new InheritChildVisitor(pv);
inheritInfo.visitChildren(childVisitor);
}
}
COM: <s> visit all the other inheritance properties that are not on the root </s>
|
funcom_train/311200 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int ensureCapacity(int capacity) {
if (capacity > data.length) {
capacity = Math.max(capacity, data.length * 2);
long[] newdata = new long[capacity];
System.arraycopy(data, 0, newdata, 0, size);
data = newdata;
}
return capacity;
}
COM: <s> ensures that this list has at least a specified capacity </s>
|
funcom_train/5265056 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void changeKey(byte[] keyBytes) {
state = CCState.WAIT_FOR_IV;
key = CryptoUtils.decodeSymmetricKey(keyBytes);
Cipher newOut = CryptoUtils.getSymmetricCipher();
try {
newOut.init(Cipher.ENCRYPT_MODE, key);
} catch (InvalidKeyException ex) {
Logger.getLogger("").log(Level.SEVERE, null, ex);
close();
}
sendEncypted(newOut.getIV(), true);
cOut = newOut;
}
COM: <s> change the encryption key </s>
|
funcom_train/42402364 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void onBeforeHandleYMouseDown() {
final int newValue = Math.max(0, this.getYValue() - this.getDeltaY());
final InlineStyle handle = InlineStyle.getInlineStyle(this.getHandle().getElement() );
final int top = handle.getInteger(Css.TOP, CssUnit.PX, 0);
this.setYValue(newValue);
handle.setInteger(Css.TOP, top - 1, CssUnit.PX);
}
COM: <s> decreases the y value of this slider ensuring that it does not underflow </s>
|
funcom_train/29982381 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void loadBundle() {
InputStream allTranslations = ResourceBundle.class.getResourceAsStream("/Localization.tmx20.xml");
InputStream stateTranslations = ResourceBundle.class.getResourceAsStream("/StateLocalization.tmx20.xml");
Tmx20 tmx = new Tmx20();
LocaleStore store = tmx.read(allTranslations);
store = tmx.read(stateTranslations, store);
this.setStore(store);
}
COM: <s> loads the localization files </s>
|
funcom_train/21342639 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Rectangle getBounds() {
// The y coords is relative to the client area because it may return
// wrong values
// on win32 when using the scroll bars. Instead, I use the absolute
// position and make is relative using the current translation.
if (parent.isVertical()) {
return new Rectangle(x, y - parent.translate, width, height);
} else {
return new Rectangle(x - parent.translate, y, width, height);
}
}
COM: <s> return the current bounds of the item </s>
|
funcom_train/18428013 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int variableAlreadyDefined(String varName) {
Iterator varIt = variables.iterator();
int pos = 0;
while (varIt.hasNext()) {
if (((Variable) varIt.next()).getName().equals(varName)) return pos;
pos++;
}
return -1;
}
COM: <s> returns a positive if the variable var name has already been defined </s>
|
funcom_train/20205897 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void removeIndex(Control control) {
if (control.getName() == null) {
return;
}
int index = control.getName().lastIndexOf("_");
if (index >= 0) {
control.setName(control.getName().substring(0, index));
}
}
COM: <s> remove the index from the given control name </s>
|
funcom_train/12625575 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeConfigFile(String[] parameters) throws IOException{
String paramConfiguration = new String();
for(int i=0 ; i<parameters.length ; i++){
paramConfiguration += parameters[i];
paramConfiguration += ";";
}
openConfigFile();
writeConfiguration(paramConfiguration);
closeConfigFile();
}
COM: <s> receives and writes configuration parameters to config file </s>
|
funcom_train/4519235 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private RButton getRButton31113() {
if (RButton31113 == null) {
RButton31113 = new RButton(4);
RButton31113.setText("Sort");
RButton31113.setBounds(new Rectangle(550, 200, 60, 60));
RButton31113.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
JFrame f = new JFrame("SortableTable Example");
f.getContentPane().add(new TestMyTableSorter(),
BorderLayout.CENTER);
f.setSize(400, 200);
f.setVisible(true);
}
});
}
return RButton31113;
}
COM: <s> this method initializes rbutton31113 </s>
|
funcom_train/8078568 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void normalize() {
for (int y=0; y<size(); y++) {
double diag = getElement(y, y);
for (int x=0; x<size(); x++)
setElement(x, y, getElement(x, y) - diag);
}
}
COM: <s> normalizes the matrix so that the diagonal contains zeros </s>
|
funcom_train/12685205 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void chooseClient(WSRPClient client) {
for (int i = 0; i < model.getSize(); i++) {
ClientWrapper<ClientType, RepresentationType> clientItem = model.getElementAt(i);
if (clientItem.getClient().equals(client)) {
setSelectedValue(clientItem, true);
break;
}
clearSelection();
}
}
COM: <s> select some client </s>
|
funcom_train/3441135 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean setLocale(Locale locale) {
if (locale.getLanguage().equals(this.locale.getLanguage())) {
//System.out.println("returning true for locale " + locale);
return true;
}
else {
//System.out.println("returning false for locale " + locale);
return false;
}
}
COM: <s> attempts to set the input locale </s>
|
funcom_train/18549690 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Timestamp compareDates(Timestamp start, Timestamp temp, boolean isEarliest){
Timestamp response = start;
if (response==null){
response = temp;
} else {
if (isEarliest) {
if (temp.before(response)) response = temp;
} else {
if (temp.after(response)) response = temp;
}
}
return response;
}
COM: <s> compare two dates based on criteria latest or earliest </s>
|
funcom_train/47691857 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public double getMaxDensity() {
double mode;
if (alpha < 1) mode = 0.01;
else if (beta <= 1) mode = 0.99;
else mode = (alpha - 1) / (alpha + beta - 2);
// System.err.println("mode: " + mode);
return probability(mode);
}
COM: <s> compute the maximum get density </s>
|
funcom_train/46455280 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setDashedStroke(int dashPoint, int dashLength) {
if(dashLength==0) {
drawingStroke = new BasicStroke(dashPoint, 0, 1, 0, null, 0); //regular line
} else {
drawingStroke = new BasicStroke(dashPoint, 0, 1, 0, new float[]{dashLength}, 0); //dashes
}
}
COM: <s> sets the the dash line stroke </s>
|
funcom_train/47140017 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setMenuSheet (MenuSheet ms) {
if (m_msCurrent != null) {
m_msCurrent.setVisible (false);
}
m_msCurrent = ms;
if (m_msCurrent != null) {
m_msCurrent.setVisible (true);
setJMenuBar (ms.getMenuBar());
}
else {
setJMenuBar (null);
}
pack();
}
COM: <s> remove any old menu sheet and display the new one </s>
|
funcom_train/4461850 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void exportTableAsTabDelimited() {
// export the table to the file, etc.
File file = getFile("Where would you like to export this table to?", FileDialog.SAVE);
if(file == null)
return;
try {
matrix.getExporter().exportTableAsTabDelimited(file);
} catch(IOException e) {
reportIOException(e, file, IOE_WRITING);
}
}
COM: <s> export the table itself as a tab delimited file </s>
|
funcom_train/19454390 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int calculateUnEstablished(UnEstablished player) {
int rating = player.getRating();
int performance = getRatingPerformance(player);
int m = player.getGameCount();
int n = m;
if(performance < rating) {
if((n + m) == 0) {
return 0;
}
else {
return ((n * rating) + (m * performance)) / (n + m);
}
}
else if(performance > rating) {
return ((((n - m) * rating) + (m * performance)) / n);
}
else {
return rating;
}
}
COM: <s> caclulates the new rating for an unestablished player </s>
|
funcom_train/36946750 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ActionErrors getActionErrors() throws ErrorDoInternalException {
ActionErrors errors = new ActionErrors();
Enumeration processorsIterator = container.elements();
StrutsErrorDo procesor = null;
while (processorsIterator.hasMoreElements()) {
procesor = (StrutsErrorDo) processorsIterator.nextElement();
errors.add(
procesor.getFieldName(),
new ActionError(procesor.getMessage()));
}
return errors;
}
COM: <s> gets an action error object properly filled </s>
|
funcom_train/28309823 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void createCounterLists() {
selectedCountersTableModel = new SingleColumnTableModel(resources
.getString(ResourceStrings.SELECTED_COUNTERS));
availableCountersTableModel = new SingleColumnTableModel(resources
.getString(ResourceStrings.AVAILABLE_COUNTERS));
availableCountersTableModel.add(new Counter(0, ""));
availableCountersTable = new JTable(availableCountersTableModel);
}
COM: <s> populate class member counter list </s>
|
funcom_train/20769414 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void logData(BasicEvent ev, EventPacket<BasicEvent> ae) {
if (logDataEnabled && clusterLoggingMethod == ClusterLoggingMethod.LogFrames) {
if ((ev.timestamp / loggingIntervalUs) >= logFrameNumber) {
logFrameNumber = ev.timestamp / loggingIntervalUs;
clusterLogger.logClusters(ae, logFrameNumber);
}
}
}
COM: <s> logs data if cluster logging method cluster logging method </s>
|
funcom_train/44494702 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void assertTextContains(final String text, final String textContained) {
String message = "assertTextContains: '"+textContained+"' not in given text";
int assertLevel = AssertLevel.NO_LEVEL;
assertTextContains(message, text, textContained, assertLevel);
}
COM: <s> asserts that two objects are equal </s>
|
funcom_train/42871313 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void printHunk(Diff.Change hunk) {
// Determine range of line numbers involved in each file.
analyzeHunk(hunk);
if (!hasDiff()) {
return;
}
if (model.getShowExpandMode().equals(ShowExpandMode.left) || model.getShowNumMode().equals(ShowNumMode.left)) {
insertRight();
} else {
insertLeft();
}
}
COM: <s> print a hunk of a normal diff </s>
|