method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
Board board = new Board();
String result = board.paint(3, 3);
final String line = System.getProperty("line.separator");
String expected = String.format("x x%s x %sx x%s", line, line, line);
assertThat(result, is(expected));
} | Board board = new Board(); String result = board.paint(3, 3); final String line = System.getProperty(STR); String expected = String.format(STR, line, line, line); assertThat(result, is(expected)); } | /**
* Test board 3x3.
*/ | Test board 3x3 | whenPaintBoardWithWidthThreeAndHeightThreeThenStringWithThreeColsAndThreeRows | {
"repo_name": "mishkras/mkrasikov",
"path": "chapter_001/src/test/java/ru/job4j/loop/BoardTest.java",
"license": "apache-2.0",
"size": 1227
} | [
"org.hamcrest.core.Is",
"org.junit.Assert"
] | import org.hamcrest.core.Is; import org.junit.Assert; | import org.hamcrest.core.*; import org.junit.*; | [
"org.hamcrest.core",
"org.junit"
] | org.hamcrest.core; org.junit; | 2,066,721 |
private JComboBox getCmbFont() {
if (cmbFont == null) {
cmbFont = new JComboBox();
try {
mapFont=new int[sds.getFieldCount()];
int num=-1;
for (int i = 0; i < sds.getFieldCount(); i++) {
if (sds.getFieldType(i) == Types.VARCHAR){
cmbFont.addItem(sds.getFieldName(i));
num++;
... | JComboBox function() { if (cmbFont == null) { cmbFont = new JComboBox(); try { mapFont=new int[sds.getFieldCount()]; int num=-1; for (int i = 0; i < sds.getFieldCount(); i++) { if (sds.getFieldType(i) == Types.VARCHAR){ cmbFont.addItem(sds.getFieldName(i)); num++; mapFont[i]=num; } } cmbFont.addItem(STR); cmbFont.setSe... | /**
* This method initializes cmbFont
*
* @return javax.swing.JComboBox
*/ | This method initializes cmbFont | getCmbFont | {
"repo_name": "iCarto/siga",
"path": "appgvSIG/src/com/iver/cit/gvsig/gui/panels/MappingFieldsToAnotation.java",
"license": "gpl-3.0",
"size": 10467
} | [
"com.hardcode.gdbms.driver.exceptions.ReadDriverException",
"java.sql.Types",
"javax.swing.JComboBox"
] | import com.hardcode.gdbms.driver.exceptions.ReadDriverException; import java.sql.Types; import javax.swing.JComboBox; | import com.hardcode.gdbms.driver.exceptions.*; import java.sql.*; import javax.swing.*; | [
"com.hardcode.gdbms",
"java.sql",
"javax.swing"
] | com.hardcode.gdbms; java.sql; javax.swing; | 2,898,028 |
@Nullable
static SourceFile getRelativePath(String baseFilePath, String relativePath) {
return SourceFile.builder()
.withPath(
FileSystems.getDefault().getPath(baseFilePath).resolveSibling(relativePath).normalize())
.withKind(SourceKind.NON_CODE)
.build();
} | static SourceFile getRelativePath(String baseFilePath, String relativePath) { return SourceFile.builder() .withPath( FileSystems.getDefault().getPath(baseFilePath).resolveSibling(relativePath).normalize()) .withKind(SourceKind.NON_CODE) .build(); } | /**
* Returns the relative path, resolved relative to the base path, where the base path is
* interpreted as a filename rather than a directory. E.g.: getRelativeTo("../foo/bar.js",
* "baz/bam/qux.js") --> "baz/foo/bar.js"
*/ | Returns the relative path, resolved relative to the base path, where the base path is interpreted as a filename rather than a directory. E.g.: getRelativeTo("../foo/bar.js", "baz/bam/qux.js") --> "baz/foo/bar.js" | getRelativePath | {
"repo_name": "GoogleChromeLabs/chromeos_smart_card_connector",
"path": "third_party/closure-compiler/src/src/com/google/javascript/jscomp/SourceMapResolver.java",
"license": "apache-2.0",
"size": 4263
} | [
"com.google.javascript.rhino.StaticSourceFile",
"java.nio.file.FileSystems"
] | import com.google.javascript.rhino.StaticSourceFile; import java.nio.file.FileSystems; | import com.google.javascript.rhino.*; import java.nio.file.*; | [
"com.google.javascript",
"java.nio"
] | com.google.javascript; java.nio; | 2,155,880 |
public void testConstrDoubleNaN() {
double a = Double.NaN;
try {
new BigDecimal(a);
fail("NumberFormatException has not been caught");
} catch (NumberFormatException e) {
}
} | void function() { double a = Double.NaN; try { new BigDecimal(a); fail(STR); } catch (NumberFormatException e) { } } | /**
* new BigDecimal(double value) when value is NaN
*/ | new BigDecimal(double value) when value is NaN | testConstrDoubleNaN | {
"repo_name": "JSDemos/android-sdk-20",
"path": "src/org/apache/harmony/tests/java/math/BigDecimalConstructorsTest.java",
"license": "apache-2.0",
"size": 25724
} | [
"java.math.BigDecimal"
] | import java.math.BigDecimal; | import java.math.*; | [
"java.math"
] | java.math; | 2,882,654 |
public void addHole( Polygon poly )
{
if( _holes == null )
{
_holes = new ArrayList<Polygon>();
}
_holes.add( poly );
// XXX: tests could be made here to be sure it is fully inside
// addSubtraction( poly.getPoints() );
}
| void function( Polygon poly ) { if( _holes == null ) { _holes = new ArrayList<Polygon>(); } _holes.add( poly ); } | /**
* Assumes: that given polygon is fully inside the current polygon
* @param poly - a subtraction polygon
*/ | Assumes: that given polygon is fully inside the current polygon | addHole | {
"repo_name": "lyrachord/FX3DAndroid",
"path": "src/main/java/eu/mihosoft/vrl/v3d/ext/org/poly2tri/Polygon.java",
"license": "gpl-3.0",
"size": 10193
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 1,046,835 |
WebApp getWebApp()
{
return _webApp;
} | WebApp getWebApp() { return _webApp; } | /**
* Returns the SessionManager's webApp
*/ | Returns the SessionManager's webApp | getWebApp | {
"repo_name": "mdaniel/svn-caucho-com-resin",
"path": "modules/resin/src/com/caucho/server/session/SessionManager.java",
"license": "gpl-2.0",
"size": 48368
} | [
"com.caucho.server.webapp.WebApp"
] | import com.caucho.server.webapp.WebApp; | import com.caucho.server.webapp.*; | [
"com.caucho.server"
] | com.caucho.server; | 770,600 |
public void removeOutboxItems(String principalId, List<String> outboxItems) {
Criteria crit = new Criteria();
crit.addIn("id", outboxItems);
getPersistenceBrokerTemplate().deleteByQuery(new QueryByCriteria(OutboxItemActionListExtension.class, crit));
} | void function(String principalId, List<String> outboxItems) { Criteria crit = new Criteria(); crit.addIn("id", outboxItems); getPersistenceBrokerTemplate().deleteByQuery(new QueryByCriteria(OutboxItemActionListExtension.class, crit)); } | /**
*
* Deletes all outbox items specified by the list of ids
*
* @see org.kuali.rice.kew.actionlist.dao.ActionListDAO#removeOutboxItems(java.lang.String, java.util.List)
*/ | Deletes all outbox items specified by the list of ids | removeOutboxItems | {
"repo_name": "sbower/kuali-rice-1",
"path": "impl/src/main/java/org/kuali/rice/kew/actionlist/dao/impl/ActionListDAOOjbImpl.java",
"license": "apache-2.0",
"size": 40542
} | [
"java.util.List",
"org.apache.ojb.broker.query.Criteria",
"org.apache.ojb.broker.query.QueryByCriteria",
"org.kuali.rice.kew.actionitem.OutboxItemActionListExtension"
] | import java.util.List; import org.apache.ojb.broker.query.Criteria; import org.apache.ojb.broker.query.QueryByCriteria; import org.kuali.rice.kew.actionitem.OutboxItemActionListExtension; | import java.util.*; import org.apache.ojb.broker.query.*; import org.kuali.rice.kew.actionitem.*; | [
"java.util",
"org.apache.ojb",
"org.kuali.rice"
] | java.util; org.apache.ojb; org.kuali.rice; | 2,084,501 |
private void uploadCheckpoint(CheckpointSignature sig) throws IOException {
// Use the exact http addr as specified in config to deal with ip aliasing
InetSocketAddress httpSocAddr = backupNode.getHttpAddress();
int httpPort = httpSocAddr.getPort();
String fileid = "putimage=1&port=" + httpPort +
... | void function(CheckpointSignature sig) throws IOException { InetSocketAddress httpSocAddr = backupNode.getHttpAddress(); int httpPort = httpSocAddr.getPort(); String fileid = STR + httpPort + STR + infoBindAddress + STR + sig.toString() + STR + getFSImage().getStorage().getImageDigest().toString(); LOG.info(STR + backu... | /**
* Copy the new image into remote name-node.
*/ | Copy the new image into remote name-node | uploadCheckpoint | {
"repo_name": "cloudera/hadoop-hdfs",
"path": "src/java/org/apache/hadoop/hdfs/server/namenode/Checkpointer.java",
"license": "apache-2.0",
"size": 10086
} | [
"java.io.File",
"java.io.IOException",
"java.net.InetSocketAddress"
] | import java.io.File; import java.io.IOException; import java.net.InetSocketAddress; | import java.io.*; import java.net.*; | [
"java.io",
"java.net"
] | java.io; java.net; | 189,106 |
public void paint(Graphics graphicsObject) {
// Formation of initial Graphic object and list of Colors.
Graphics2D g2 = (Graphics2D) graphicsObject;
Color[] color = { Color.red, Color.blue, Color.green, Color.orange, Color.cyan, Color.lightGray, Color.magenta,
Color.white, Color.pink, Color.yellow };
... | void function(Graphics graphicsObject) { Graphics2D g2 = (Graphics2D) graphicsObject; Color[] color = { Color.red, Color.blue, Color.green, Color.orange, Color.cyan, Color.lightGray, Color.magenta, Color.white, Color.pink, Color.yellow }; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALI... | /**
* Paints the different ages that need to be represented in the Pie Chart.
*/ | Paints the different ages that need to be represented in the Pie Chart | paint | {
"repo_name": "jakemanning/basketball-teams",
"path": "Project5/src/PieChart.java",
"license": "mit",
"size": 7502
} | [
"java.awt.BorderLayout",
"java.awt.Color",
"java.awt.Dimension",
"java.awt.Graphics",
"java.awt.Graphics2D",
"java.awt.RenderingHints",
"java.awt.geom.Arc2D",
"java.util.LinkedHashMap",
"java.util.LinkedHashSet",
"javax.swing.JScrollPane",
"javax.swing.JTextPane"
] | import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.geom.Arc2D; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import javax.swing.JScrollPane; import javax.swing.JTextPane; | import java.awt.*; import java.awt.geom.*; import java.util.*; import javax.swing.*; | [
"java.awt",
"java.util",
"javax.swing"
] | java.awt; java.util; javax.swing; | 1,055,493 |
@Column(name = "removed")
public Date getRemoved(); | @Column(name = STR) Date function(); | /**
* Getter for <code>cattle.service_event.removed</code>.
*/ | Getter for <code>cattle.service_event.removed</code> | getRemoved | {
"repo_name": "vincent99/cattle",
"path": "code/iaas/model/src/main/java/io/cattle/platform/core/model/ServiceEvent.java",
"license": "apache-2.0",
"size": 6303
} | [
"java.util.Date",
"javax.persistence.Column"
] | import java.util.Date; import javax.persistence.Column; | import java.util.*; import javax.persistence.*; | [
"java.util",
"javax.persistence"
] | java.util; javax.persistence; | 1,347,297 |
protected static Properties loadConfig(String source, InputStream is) {
try {
Properties p = new Properties();
p.load(is);
// trim the value as it may have trailing white-space
Set<String> keys = p.stringPropertyNames();
for(String key: keys) {
p.setProperty(key, p.getProperty(key).trim());
}... | static Properties function(String source, InputStream is) { try { Properties p = new Properties(); p.load(is); Set<String> keys = p.stringPropertyNames(); for(String key: keys) { p.setProperty(key, p.getProperty(key).trim()); } return p; } catch (IllegalArgumentException iae) { throw iae; } catch (Exception ex) { throw... | /**
* Loads properties from the passed input stream
* @param source The name of the source the properties are being loaded from
* @param is The input stream to load from
* @return the loaded properties
*/ | Loads properties from the passed input stream | loadConfig | {
"repo_name": "nickman/OpenTSDBExeJar",
"path": "src/tools/Main.java",
"license": "gpl-3.0",
"size": 26731
} | [
"java.io.InputStream",
"java.util.Properties",
"java.util.Set"
] | import java.io.InputStream; import java.util.Properties; import java.util.Set; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 458,855 |
private boolean isProductConfigurationValid(final ButlerProduct bp) {
if (bp == null) {
return false;
}
if ((bp.getKey() == null) || bp.getKey().equals("")) {
return false;
}
if ((bp.getFormat() == null) || (bp.getFormat().getKey() == null) || bp.getFo... | boolean function(final ButlerProduct bp) { if (bp == null) { return false; } if ((bp.getKey() == null) bp.getKey().equals(STRSTR")) { return false; } return true; } | /**
* DOCUMENT ME!
*
* @param bp DOCUMENT ME!
*
* @return DOCUMENT ME!
*/ | DOCUMENT ME | isProductConfigurationValid | {
"repo_name": "cismet/cids-custom-wuppertal",
"path": "src/main/java/de/cismet/cids/custom/butler/Butler2Dialog.java",
"license": "lgpl-3.0",
"size": 59167
} | [
"de.cismet.cids.custom.utils.butler.ButlerProduct"
] | import de.cismet.cids.custom.utils.butler.ButlerProduct; | import de.cismet.cids.custom.utils.butler.*; | [
"de.cismet.cids"
] | de.cismet.cids; | 2,132,127 |
boolean IsPet() {
return getHigh() == HighGuid.PET;
} | boolean IsPet() { return getHigh() == HighGuid.PET; } | /**
* Checks if is pet.
*
* @return true, if successful
*/ | Checks if is pet | IsPet | {
"repo_name": "Furt/JMaNGOS",
"path": "Realm/src/main/java/org/jmangos/realm/model/base/guid/ObjectGuid.java",
"license": "gpl-2.0",
"size": 6756
} | [
"org.jmangos.realm.model.enums.HighGuid"
] | import org.jmangos.realm.model.enums.HighGuid; | import org.jmangos.realm.model.enums.*; | [
"org.jmangos.realm"
] | org.jmangos.realm; | 1,069,929 |
public static String generateJsonWebKey(final int size) {
final OctetSequenceJsonWebKey octetKey = OctJwkGenerator.generateJwk(size);
final Map<String, Object> params = octetKey.toParams(JsonWebKey.OutputControlLevel.INCLUDE_SYMMETRIC);
return params.get(JSON_WEB_KEY).toString();
} | static String function(final int size) { final OctetSequenceJsonWebKey octetKey = OctJwkGenerator.generateJwk(size); final Map<String, Object> params = octetKey.toParams(JsonWebKey.OutputControlLevel.INCLUDE_SYMMETRIC); return params.get(JSON_WEB_KEY).toString(); } | /**
* Generate octet json web key of given size .
*
* @param size the size
* @return the key
*/ | Generate octet json web key of given size | generateJsonWebKey | {
"repo_name": "doodelicious/cas",
"path": "core/cas-server-core-util/src/main/java/org/apereo/cas/util/EncodingUtils.java",
"license": "apache-2.0",
"size": 6680
} | [
"java.util.Map",
"org.jose4j.jwk.JsonWebKey",
"org.jose4j.jwk.OctJwkGenerator",
"org.jose4j.jwk.OctetSequenceJsonWebKey"
] | import java.util.Map; import org.jose4j.jwk.JsonWebKey; import org.jose4j.jwk.OctJwkGenerator; import org.jose4j.jwk.OctetSequenceJsonWebKey; | import java.util.*; import org.jose4j.jwk.*; | [
"java.util",
"org.jose4j.jwk"
] | java.util; org.jose4j.jwk; | 2,829,533 |
public void writeString(String str) throws TException {
try {
byte[] bytes = str.getBytes("UTF-8");
writeBinary(bytes, 0, bytes.length);
} catch (UnsupportedEncodingException e) {
throw new TException("UTF-8 not supported!");
}
} | void function(String str) throws TException { try { byte[] bytes = str.getBytes("UTF-8"); writeBinary(bytes, 0, bytes.length); } catch (UnsupportedEncodingException e) { throw new TException(STR); } } | /**
* Write a string to the wire with a varint size preceeding.
*/ | Write a string to the wire with a varint size preceeding | writeString | {
"repo_name": "SergeyMakarenko/fbthrift",
"path": "thrift/lib/java/thrift/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java",
"license": "apache-2.0",
"size": 25925
} | [
"com.facebook.thrift.TException",
"java.io.UnsupportedEncodingException"
] | import com.facebook.thrift.TException; import java.io.UnsupportedEncodingException; | import com.facebook.thrift.*; import java.io.*; | [
"com.facebook.thrift",
"java.io"
] | com.facebook.thrift; java.io; | 2,811,424 |
public CountDownLatch getSearchTuningRuleSortFieldsAsync(String responseFields, AsyncCallback<com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields> callback) throws Exception
{
MozuClient<com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields> client = com.mozu.api.clients.commer... | CountDownLatch function(String responseFields, AsyncCallback<com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields> callback) throws Exception { MozuClient<com.mozu.api.contracts.productadmin.search.SearchTuningRuleSortFields> client = com.mozu.api.clients.commerce.catalog.admin.SearchClient.getSearchTu... | /**
*
* <p><pre><code>
* Search search = new Search();
* CountDownLatch latch = search.getSearchTuningRuleSortFields( responseFields, callback );
* latch.await() * </code></pre></p>
* @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned i... | <code><code> Search search = new Search(); CountDownLatch latch = search.getSearchTuningRuleSortFields( responseFields, callback ); latch.await() * </code></code> | getSearchTuningRuleSortFieldsAsync | {
"repo_name": "Mozu/mozu-java",
"path": "mozu-javaasync-core/src/main/java/com/mozu/api/resources/commerce/catalog/admin/SearchResource.java",
"license": "mit",
"size": 65288
} | [
"com.mozu.api.AsyncCallback",
"com.mozu.api.MozuClient",
"java.util.concurrent.CountDownLatch"
] | import com.mozu.api.AsyncCallback; import com.mozu.api.MozuClient; import java.util.concurrent.CountDownLatch; | import com.mozu.api.*; import java.util.concurrent.*; | [
"com.mozu.api",
"java.util"
] | com.mozu.api; java.util; | 969,092 |
return ShrinkWrap.createFromZipFile(WebArchive.class, new File(KITCHENSINK));
} | return ShrinkWrap.createFromZipFile(WebArchive.class, new File(KITCHENSINK)); } | /**
* Creates deployment which is sent to the container upon test's start.
*
* @return war file which is deployed while testing, the whole application in our case
*/ | Creates deployment which is sent to the container upon test's start | kitchensink | {
"repo_name": "hslee9397/jboss-eap-quickstarts",
"path": "kitchensink-angularjs/functional-tests/src/test/java/org/jboss/as/quickstarts/kitchensink/test/Deployments.java",
"license": "apache-2.0",
"size": 1601
} | [
"java.io.File",
"org.jboss.shrinkwrap.api.ShrinkWrap",
"org.jboss.shrinkwrap.api.spec.WebArchive"
] | import java.io.File; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; | import java.io.*; import org.jboss.shrinkwrap.api.*; import org.jboss.shrinkwrap.api.spec.*; | [
"java.io",
"org.jboss.shrinkwrap"
] | java.io; org.jboss.shrinkwrap; | 2,604,090 |
public void setResourceId(String resourceId) {
if (resourceId == null) {
removeExtension(ResourceId.class);
} else {
setExtension(new ResourceId(resourceId));
}
} | void function(String resourceId) { if (resourceId == null) { removeExtension(ResourceId.class); } else { setExtension(new ResourceId(resourceId)); } } | /**
* Sets the document's resource id.
*
* @param resourceId the resource id.
*/ | Sets the document's resource id | setResourceId | {
"repo_name": "vanta/gdata-java-client",
"path": "java/src/com/google/gdata/data/docs/DocumentListEntry.java",
"license": "apache-2.0",
"size": 20307
} | [
"com.google.gdata.data.extensions.ResourceId"
] | import com.google.gdata.data.extensions.ResourceId; | import com.google.gdata.data.extensions.*; | [
"com.google.gdata"
] | com.google.gdata; | 527,093 |
void saveProperties(Properties props) {
props.setProperty(PROP_OS, mOs.toString());
props.setProperty(PROP_ARCH, mArch.toString());
} | void saveProperties(Properties props) { props.setProperty(PROP_OS, mOs.toString()); props.setProperty(PROP_ARCH, mArch.toString()); } | /**
* Save the properties of the current archive in the give {@link Properties} object.
* These properties will later be give the constructor that takes a {@link Properties} object.
*/ | Save the properties of the current archive in the give <code>Properties</code> object. These properties will later be give the constructor that takes a <code>Properties</code> object | saveProperties | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "sdk/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/archives/Archive.java",
"license": "gpl-2.0",
"size": 15402
} | [
"java.util.Properties"
] | import java.util.Properties; | import java.util.*; | [
"java.util"
] | java.util; | 2,005,655 |
public static Provider getProvider() {
Provider provider = new Provider();
provider.setId("id:providers:twitter");
provider.setDisplayName("Twitter");
return provider;
} | static Provider function() { Provider provider = new Provider(); provider.setId(STR); provider.setDisplayName(STR); return provider; } | /**
* Gets the common twitter {@link org.apache.streams.pojo.json.Provider} object
* @return a provider object representing Twitter
*/ | Gets the common twitter <code>org.apache.streams.pojo.json.Provider</code> object | getProvider | {
"repo_name": "w2ogroup/incubator-streams",
"path": "streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/serializer/util/TwitterActivityUtil.java",
"license": "apache-2.0",
"size": 14145
} | [
"org.apache.streams.pojo.json.Provider"
] | import org.apache.streams.pojo.json.Provider; | import org.apache.streams.pojo.json.*; | [
"org.apache.streams"
] | org.apache.streams; | 2,706,621 |
private static void removeDuplicate(List<String> arlList) {
Set<String> h = new HashSet<String>(arlList);
arlList.clear();
arlList.addAll(h);
} | static void function(List<String> arlList) { Set<String> h = new HashSet<String>(arlList); arlList.clear(); arlList.addAll(h); } | /**
* internal method to remove Duplicates from list
* @param arlList
*/ | internal method to remove Duplicates from list | removeDuplicate | {
"repo_name": "stevenhva/InfoLearn_OpenOLAT",
"path": "src/main/java/org/olat/core/commons/modules/glossary/GlossaryFlexionController.java",
"license": "apache-2.0",
"size": 9948
} | [
"java.util.HashSet",
"java.util.List",
"java.util.Set"
] | import java.util.HashSet; import java.util.List; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,425,387 |
public void saveReplyMessageChannel(Message receivedMessage, TestContext context) {
MessageChannel replyChannel = null;
if (receivedMessage.getHeader(org.springframework.messaging.MessageHeaders.REPLY_CHANNEL) instanceof MessageChannel) {
replyChannel = (MessageChannel)receivedMessage.ge... | void function(Message receivedMessage, TestContext context) { MessageChannel replyChannel = null; if (receivedMessage.getHeader(org.springframework.messaging.MessageHeaders.REPLY_CHANNEL) instanceof MessageChannel) { replyChannel = (MessageChannel)receivedMessage.getHeader(org.springframework.messaging.MessageHeaders.R... | /**
* Store reply message channel.
* @param receivedMessage
* @param context
*/ | Store reply message channel | saveReplyMessageChannel | {
"repo_name": "christophd/citrus",
"path": "endpoints/citrus-spring-integration/src/main/java/com/consol/citrus/channel/ChannelSyncConsumer.java",
"license": "apache-2.0",
"size": 5527
} | [
"com.consol.citrus.context.TestContext",
"com.consol.citrus.message.Message",
"org.springframework.messaging.MessageChannel",
"org.springframework.util.StringUtils"
] | import com.consol.citrus.context.TestContext; import com.consol.citrus.message.Message; import org.springframework.messaging.MessageChannel; import org.springframework.util.StringUtils; | import com.consol.citrus.context.*; import com.consol.citrus.message.*; import org.springframework.messaging.*; import org.springframework.util.*; | [
"com.consol.citrus",
"org.springframework.messaging",
"org.springframework.util"
] | com.consol.citrus; org.springframework.messaging; org.springframework.util; | 2,022,152 |
public FacesConfigReferencedBeanType<T> removeAllDescription()
{
childNode.removeChildren("description");
return this;
}
// --------------------------------------------------------------------------------------------------------||
// ClassName: FacesConfigReferencedBeanType ElementName: xsd... | FacesConfigReferencedBeanType<T> function() { childNode.removeChildren(STR); return this; } | /**
* Removes the <code>description</code> element
* @return the current instance of <code>FacesConfigReferencedBeanType<T></code>
*/ | Removes the <code>description</code> element | removeAllDescription | {
"repo_name": "forge/javaee-descriptors",
"path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/facesconfig21/FacesConfigReferencedBeanTypeImpl.java",
"license": "epl-1.0",
"size": 11270
} | [
"org.jboss.shrinkwrap.descriptor.api.facesconfig21.FacesConfigReferencedBeanType"
] | import org.jboss.shrinkwrap.descriptor.api.facesconfig21.FacesConfigReferencedBeanType; | import org.jboss.shrinkwrap.descriptor.api.facesconfig21.*; | [
"org.jboss.shrinkwrap"
] | org.jboss.shrinkwrap; | 2,705,664 |
public List<Message> dumpMessageCache() {
if (transitions.isEmpty()) {
return null;
}
// Copy the messages before clearing the cache.
ArrayList<Message> messages = new ArrayList<>();
for (Message msg: transitions) {
... | List<Message> function() { if (transitions.isEmpty()) { return null; } ArrayList<Message> messages = new ArrayList<>(); for (Message msg: transitions) { messages.add((Message) DeepCopy.deepCopy(msg)); } transitions.clear(); return messages; } } | /**
* Dumps the contents of the cache to a JSON string.
*
* Calling this method will irreversibly clear the cache. This method
* will return null if the cache is empty.
*
* @return The contents of the cache as JSON string or null.
*/ | Dumps the contents of the cache to a JSON string. Calling this method will irreversibly clear the cache. This method will return null if the cache is empty | dumpMessageCache | {
"repo_name": "MStefko/STEADIER-SAILOR",
"path": "src/main/java/ch/epfl/leb/sass/simulator/internal/DefaultSimulator.java",
"license": "gpl-3.0",
"size": 14153
} | [
"ch.epfl.leb.sass.logging.Message",
"ch.epfl.leb.sass.utils.DeepCopy",
"java.util.ArrayList",
"java.util.List"
] | import ch.epfl.leb.sass.logging.Message; import ch.epfl.leb.sass.utils.DeepCopy; import java.util.ArrayList; import java.util.List; | import ch.epfl.leb.sass.logging.*; import ch.epfl.leb.sass.utils.*; import java.util.*; | [
"ch.epfl.leb",
"java.util"
] | ch.epfl.leb; java.util; | 769,557 |
public void testInfoPathMissing() throws Exception {
create(igfsSecondary, paths(DIR), null);
create(igfs, null, null);
IgfsFile info = igfs.info(DIR);
assert info != null;
assertEquals(DIR, info.path());
} | void function() throws Exception { create(igfsSecondary, paths(DIR), null); create(igfs, null, null); IgfsFile info = igfs.info(DIR); assert info != null; assertEquals(DIR, info.path()); } | /**
* Test info routine when the path doesn't exist locally.
*
* @throws Exception If failed.
*/ | Test info routine when the path doesn't exist locally | testInfoPathMissing | {
"repo_name": "DoudTechData/ignite",
"path": "modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDualAbstractSelfTest.java",
"license": "apache-2.0",
"size": 58200
} | [
"org.apache.ignite.igfs.IgfsFile"
] | import org.apache.ignite.igfs.IgfsFile; | import org.apache.ignite.igfs.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 2,139,915 |
public Optional<Map.Entry<K, V>> maxByKey(Comparator<K> comparator) {
return inner.max(byKeyOnly(comparator));
} | Optional<Map.Entry<K, V>> function(Comparator<K> comparator) { return inner.max(byKeyOnly(comparator)); } | /**
* Returns the maximum element of this stream according to the provided
* {@code Comparator} applied to the key-components of this stream. This
* is a special case of a reduction.
* <p>
* This is a terminal operation.
*
* @param comparator a non-interfering, stateless {@code Comp... | Returns the maximum element of this stream according to the provided Comparator applied to the key-components of this stream. This is a special case of a reduction. This is a terminal operation | maxByKey | {
"repo_name": "Pyknic/MapStream",
"path": "src/main/java/com/speedment/stream/MapStream.java",
"license": "apache-2.0",
"size": 99760
} | [
"java.util.Comparator",
"java.util.Map",
"java.util.Optional"
] | import java.util.Comparator; import java.util.Map; import java.util.Optional; | import java.util.*; | [
"java.util"
] | java.util; | 2,398,166 |
protected VariableUsage getUsageForUpdate(String name) {
if (name == null) {
throw new NullPointerException();
}
Map<String, VariableUsage> usage = getVariableUsage();
VariableUsage u = usage.get(name);
if (u == null) {
u = new VariableUsage(name);
usage.put(name, ... | VariableUsage function(String name) { if (name == null) { throw new NullPointerException(); } Map<String, VariableUsage> usage = getVariableUsage(); VariableUsage u = usage.get(name); if (u == null) { u = new VariableUsage(name); usage.put(name, u); } return u; } | /**
* Returns variable usage in this scope for the given name.
* If no previous usage exists, create it. This method
* guarantees a non-null return
*/ | Returns variable usage in this scope for the given name. If no previous usage exists, create it. This method guarantees a non-null return | getUsageForUpdate | {
"repo_name": "ya7lelkom/swift-k",
"path": "src/org/griphyn/vdl/engine/VariableScope.java",
"license": "apache-2.0",
"size": 39903
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 166,380 |
public final void setAddress(Uri address, int presentation) {
checkImmutable();
Log.d(this, "setAddress %s", address);
mAddress = address;
mAddressPresentation = presentation;
for (Listener l : mListeners) {
l.onAddressChanged(this, address, presentation);
... | final void function(Uri address, int presentation) { checkImmutable(); Log.d(this, STR, address); mAddress = address; mAddressPresentation = presentation; for (Listener l : mListeners) { l.onAddressChanged(this, address, presentation); } } | /**
* Sets the value of the {@link #getAddress()} property.
*
* @param address The new address.
* @param presentation The presentation requirements for the address.
* See {@link TelecomManager} for valid values.
*/ | Sets the value of the <code>#getAddress()</code> property | setAddress | {
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "frameworks/base/telecomm/java/android/telecom/Connection.java",
"license": "gpl-3.0",
"size": 50468
} | [
"android.net.Uri"
] | import android.net.Uri; | import android.net.*; | [
"android.net"
] | android.net; | 1,134,807 |
public void setAbsolutePosition(int ax, int ay) {
lx = ax - sw;
ly = ay - sh;
lurd[0] = lx + sw - getRadius();
lurd[1] = ly + sh - getRadius();
lurd[2] = lx + sw + getRadius();
lurd[3] = ly + sh + getRadius();
if (lurd[0] < 0) {
lurd[0] = 0;
... | void function(int ax, int ay) { lx = ax - sw; ly = ay - sh; lurd[0] = lx + sw - getRadius(); lurd[1] = ly + sh - getRadius(); lurd[2] = lx + sw + getRadius(); lurd[3] = ly + sh + getRadius(); if (lurd[0] < 0) { lurd[0] = 0; } if (lurd[1] < 0) { lurd[1] = 0; } if (lurd[2] > w) { lurd[2] = w; } if (lurd[3] > h) { lurd[3]... | /**
* set the position of the lens inside the view
*
* @param ax lens's center horizontal coordinate expressed as an absolute position within the view (JPanel coordinate system)
* @param ay lens's center vertical coordinate expressed as an absolute position within the view (JPanel coordinate system)... | set the position of the lens inside the view | setAbsolutePosition | {
"repo_name": "sharwell/zgrnbviewer",
"path": "org-tvl-netbeans-zgrviewer/src/fr/inria/zvtm/lens/FixedSizeLens.java",
"license": "lgpl-3.0",
"size": 22880
} | [
"fr.inria.zvtm.engine.Java2DPainter",
"java.awt.Point",
"java.awt.Robot"
] | import fr.inria.zvtm.engine.Java2DPainter; import java.awt.Point; import java.awt.Robot; | import fr.inria.zvtm.engine.*; import java.awt.*; | [
"fr.inria.zvtm",
"java.awt"
] | fr.inria.zvtm; java.awt; | 2,015,169 |
public ArrayList<SelInfo> getYValsAtIndex(int xIndex) {
ArrayList<SelInfo> vals = new ArrayList<SelInfo>();
for (int i = 0; i < mCurrentData.getDataSetCount(); i++) {
// extract all y-values from all DataSets at the given x-index
float yVal = mCurrentData.getDataSetByIndex... | ArrayList<SelInfo> function(int xIndex) { ArrayList<SelInfo> vals = new ArrayList<SelInfo>(); for (int i = 0; i < mCurrentData.getDataSetCount(); i++) { float yVal = mCurrentData.getDataSetByIndex(i).getYValForXIndex(xIndex); if (!Float.isNaN(yVal)) { vals.add(new SelInfo(yVal, i)); } } return vals; } | /**
* Returns an array of SelInfo objects for the given x-index. The SelInfo
* objects give information about the value at the selected index and the
* DataSet it belongs to. INFORMATION: This method does calculations at
* runtime. Do not over-use in performance critical situations.
*
* @... | Returns an array of SelInfo objects for the given x-index. The SelInfo objects give information about the value at the selected index and the runtime. Do not over-use in performance critical situations | getYValsAtIndex | {
"repo_name": "MPieter/Notification-Analyser",
"path": "NotificationAnalyser/MPChartLib/src/com/github/mikephil/charting/charts/Chart.java",
"license": "mit",
"size": 71102
} | [
"com.github.mikephil.charting.utils.SelInfo",
"java.util.ArrayList"
] | import com.github.mikephil.charting.utils.SelInfo; import java.util.ArrayList; | import com.github.mikephil.charting.utils.*; import java.util.*; | [
"com.github.mikephil",
"java.util"
] | com.github.mikephil; java.util; | 1,274,568 |
public Vector foldRows(IgniteFunction<Vector, Double> fun); | Vector function(IgniteFunction<Vector, Double> fun); | /**
* Collects the results of applying a given function to all rows in this matrix.
*
* @param fun Aggregating function.
* @return Vector of row aggregates.
*/ | Collects the results of applying a given function to all rows in this matrix | foldRows | {
"repo_name": "nivanov/ignite",
"path": "modules/math/src/main/java/org/apache/ignite/math/Matrix.java",
"license": "apache-2.0",
"size": 16001
} | [
"org.apache.ignite.math.functions.IgniteFunction"
] | import org.apache.ignite.math.functions.IgniteFunction; | import org.apache.ignite.math.functions.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 759,564 |
@Override
public final void prepareRead() {
if (this.inputCount == 0) {
throw new BufferedDataError("To import CSV, you must use the "
+ "CSVDataCODEC constructor that specifies input and "
+ "ideal sizes.");
}
this.readCSV = new ReadCSV(this.file.toString(), this.headers,
this.format);
} | final void function() { if (this.inputCount == 0) { throw new BufferedDataError(STR + STR + STR); } this.readCSV = new ReadCSV(this.file.toString(), this.headers, this.format); } | /**
* Prepare to read from the CSV file.
*/ | Prepare to read from the CSV file | prepareRead | {
"repo_name": "larhoy/SentimentProjectV2",
"path": "SentimentAnalysisV2/encog-core-3.1.0/src/main/java/org/encog/ml/data/buffer/codec/CSVDataCODEC.java",
"license": "mit",
"size": 6954
} | [
"org.encog.ml.data.buffer.BufferedDataError",
"org.encog.util.csv.ReadCSV"
] | import org.encog.ml.data.buffer.BufferedDataError; import org.encog.util.csv.ReadCSV; | import org.encog.ml.data.buffer.*; import org.encog.util.csv.*; | [
"org.encog.ml",
"org.encog.util"
] | org.encog.ml; org.encog.util; | 13,626 |
// ------------------------------------------------------------------
static public String encode(String s)
{
try
{
return encode(s,null);
}
catch (UnsupportedEncodingException e)
{
throw new IllegalArgumentException(e.toString());
}
... | static String function(String s) { try { return encode(s,null); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(e.toString()); } } | /**
* Base 64 encode as described in RFC 1421.
* <p>Does not insert whitespace as described in RFC 1521.
* @param s String to encode.
* @return String containing the encoded form of the input.
*/ | Base 64 encode as described in RFC 1421. Does not insert whitespace as described in RFC 1521 | encode | {
"repo_name": "jamiepg1/jetty.project",
"path": "jetty-util/src/main/java/org/eclipse/jetty/util/B64Code.java",
"license": "apache-2.0",
"size": 11423
} | [
"java.io.UnsupportedEncodingException"
] | import java.io.UnsupportedEncodingException; | import java.io.*; | [
"java.io"
] | java.io; | 1,476,469 |
@Override public void exitExplicitEnumerationLiteral(@NotNull BramsprParser.ExplicitEnumerationLiteralContext ctx) { } | @Override public void exitExplicitEnumerationLiteral(@NotNull BramsprParser.ExplicitEnumerationLiteralContext ctx) { } | /**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/ | The default implementation does nothing | enterExplicitEnumerationLiteral | {
"repo_name": "bcleenders/Bramspr",
"path": "src/bramspr/BramsprBaseListener.java",
"license": "mit",
"size": 21948
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 2,277,683 |
WritableMap result;
try {
result = RNSerialization.authenticationResultToWritableMap(authResult);
this.callbackPromise.resolve(result);
//callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, result));
} catch (Exception e) {
th... | WritableMap result; try { result = RNSerialization.authenticationResultToWritableMap(authResult); this.callbackPromise.resolve(result); } catch (Exception e) { this.callbackPromise.reject(new Exception(STR)); } } | /**
* Success callback that serializes AuthenticationResult instance and passes it to Cordova
* @param authResult AuthenticationResult instance
*/ | Success callback that serializes AuthenticationResult instance and passes it to Cordova | onSuccess | {
"repo_name": "samcolby/react-native-ms-adal",
"path": "android/src/main/java/com/microsoft/aad/adal/rn/RNDefaultAuthenticationCallback.java",
"license": "apache-2.0",
"size": 2319
} | [
"com.facebook.react.bridge.WritableMap"
] | import com.facebook.react.bridge.WritableMap; | import com.facebook.react.bridge.*; | [
"com.facebook.react"
] | com.facebook.react; | 2,829,520 |
void storeTaintArrayAt(int n, String descAtDest) {
if (TaintUtils.DEBUG_DUPSWAP)
System.out.println(name + " POP AT " + n + " from " + analyzer.stack);
switch (n) {
case 0:
Object top = analyzer.stack.get(analyzer.stack.size() - 1);
if (top == Opcodes.LONG || top == Opcodes.DOUBLE || top == Opcodes.TO... | void storeTaintArrayAt(int n, String descAtDest) { if (TaintUtils.DEBUG_DUPSWAP) System.out.println(name + STR + n + STR + analyzer.stack); switch (n) { case 0: Object top = analyzer.stack.get(analyzer.stack.size() - 1); if (top == Opcodes.LONG top == Opcodes.DOUBLE top == Opcodes.TOP) super.visitInsn(POP2); else super... | /**
* Store at n means pop the nth element down from the top and store it to
* our arraystore (pop the top is n=0)
*
* @param n
*/ | Store at n means pop the nth element down from the top and store it to our arraystore (pop the top is n=0) | storeTaintArrayAt | {
"repo_name": "mikefhsu/phosphor",
"path": "Phosphor/src/edu/columbia/cs/psl/phosphor/instrumenter/TaintPassingMV.java",
"license": "mit",
"size": 120895
} | [
"edu.columbia.cs.psl.phosphor.TaintUtils",
"org.objectweb.asm.Opcodes",
"org.objectweb.asm.tree.LocalVariableNode"
] | import edu.columbia.cs.psl.phosphor.TaintUtils; import org.objectweb.asm.Opcodes; import org.objectweb.asm.tree.LocalVariableNode; | import edu.columbia.cs.psl.phosphor.*; import org.objectweb.asm.*; import org.objectweb.asm.tree.*; | [
"edu.columbia.cs",
"org.objectweb.asm"
] | edu.columbia.cs; org.objectweb.asm; | 316,987 |
protected HandlerChain buildOutboundHandlerChain() {
BasicHandlerChain handlerChain = new BasicHandlerChain(); | HandlerChain function() { BasicHandlerChain handlerChain = new BasicHandlerChain(); | /**
* Build the outbound handler chain.
*
* @return the handler chain
*/ | Build the outbound handler chain | buildOutboundHandlerChain | {
"repo_name": "jagheterfredrik/java-idp",
"path": "src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SAML2ECPProfileHandler.java",
"license": "apache-2.0",
"size": 21657
} | [
"org.opensaml.ws.message.handler.BasicHandlerChain",
"org.opensaml.ws.message.handler.HandlerChain"
] | import org.opensaml.ws.message.handler.BasicHandlerChain; import org.opensaml.ws.message.handler.HandlerChain; | import org.opensaml.ws.message.handler.*; | [
"org.opensaml.ws"
] | org.opensaml.ws; | 1,335,515 |
public static boolean isAnnotatedWithTrait(final ClassNode cNode) {
List<AnnotationNode> traitAnn = cNode.getAnnotations(Traits.TRAIT_CLASSNODE);
return traitAnn != null && !traitAnn.isEmpty();
} | static boolean function(final ClassNode cNode) { List<AnnotationNode> traitAnn = cNode.getAnnotations(Traits.TRAIT_CLASSNODE); return traitAnn != null && !traitAnn.isEmpty(); } | /**
* Returns true if the specified class node is annotated with the {@link Trait} interface.
* @param cNode a class node
* @return true if the specified class node is annotated with the {@link Trait} interface.
*/ | Returns true if the specified class node is annotated with the <code>Trait</code> interface | isAnnotatedWithTrait | {
"repo_name": "jwagenleitner/incubator-groovy",
"path": "src/main/java/org/codehaus/groovy/transform/trait/Traits.java",
"license": "apache-2.0",
"size": 17750
} | [
"java.util.List",
"org.codehaus.groovy.ast.AnnotationNode",
"org.codehaus.groovy.ast.ClassNode"
] | import java.util.List; import org.codehaus.groovy.ast.AnnotationNode; import org.codehaus.groovy.ast.ClassNode; | import java.util.*; import org.codehaus.groovy.ast.*; | [
"java.util",
"org.codehaus.groovy"
] | java.util; org.codehaus.groovy; | 1,008,332 |
@Override
public View onCreateFloatView(int position) {
// Guaranteed that this will not be null? I think so. Nope, got
// a NullPointerException once...
View v = mListView.getChildAt(position + mListView.getHeaderViewsCount() - mListView.getFirstVisiblePosition());
if (v == nul... | View function(int position) { View v = mListView.getChildAt(position + mListView.getHeaderViewsCount() - mListView.getFirstVisiblePosition()); if (v == null) { return null; } v.setPressed(false); v.setDrawingCacheEnabled(true); mFloatBitmap = Bitmap.createBitmap(v.getDrawingCache()); v.setDrawingCacheEnabled(false); if... | /**
* This simple implementation creates a Bitmap copy of the
* list item currently shown at ListView <code>position</code>.
*/ | This simple implementation creates a Bitmap copy of the list item currently shown at ListView <code>position</code> | onCreateFloatView | {
"repo_name": "aceqott/HCTControl",
"path": "app/src/main/java/com/hctrom/romcontrol/toolboxsettings/dragscroll/SimpleFloatViewManager.java",
"license": "apache-2.0",
"size": 2592
} | [
"android.graphics.Bitmap",
"android.view.View",
"android.view.ViewGroup",
"android.widget.ImageView"
] | import android.graphics.Bitmap; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; | import android.graphics.*; import android.view.*; import android.widget.*; | [
"android.graphics",
"android.view",
"android.widget"
] | android.graphics; android.view; android.widget; | 939,040 |
public static DataResult<OrgProxyServer> listProxies(Org org) {
DataResult<OrgProxyServer> retval = null;
SelectMode mode = ModeFactory.getMode("System_queries",
"org_proxy_servers");
Map<String, Object> params = new HashMap<String, Object>();
params.put("org_id", org... | static DataResult<OrgProxyServer> function(Org org) { DataResult<OrgProxyServer> retval = null; SelectMode mode = ModeFactory.getMode(STR, STR); Map<String, Object> params = new HashMap<String, Object>(); params.put(STR, org.getId()); retval = mode.execute(params); return retval; } | /**
* returns a List proxies available in the given org
* @param org needed for org information
* @return list of proxies for org
*/ | returns a List proxies available in the given org | listProxies | {
"repo_name": "renner/spacewalk",
"path": "java/code/src/com/redhat/rhn/manager/system/SystemManager.java",
"license": "gpl-2.0",
"size": 132498
} | [
"com.redhat.rhn.common.db.datasource.DataResult",
"com.redhat.rhn.common.db.datasource.ModeFactory",
"com.redhat.rhn.common.db.datasource.SelectMode",
"com.redhat.rhn.domain.org.Org",
"com.redhat.rhn.frontend.dto.OrgProxyServer",
"java.util.HashMap",
"java.util.Map"
] | import com.redhat.rhn.common.db.datasource.DataResult; import com.redhat.rhn.common.db.datasource.ModeFactory; import com.redhat.rhn.common.db.datasource.SelectMode; import com.redhat.rhn.domain.org.Org; import com.redhat.rhn.frontend.dto.OrgProxyServer; import java.util.HashMap; import java.util.Map; | import com.redhat.rhn.common.db.datasource.*; import com.redhat.rhn.domain.org.*; import com.redhat.rhn.frontend.dto.*; import java.util.*; | [
"com.redhat.rhn",
"java.util"
] | com.redhat.rhn; java.util; | 1,058,447 |
public static File[] getClasspath() {
URLClassLoader urlLoader = DynamicClassLoader.getClassLoader();
URL urls[] = urlLoader.getURLs();
File classpath[] = new File[urls.length];
for (int i = 0; i < urls.length; i++) {
try {
classpath[i] = new File(urls[i].toURI());
... | static File[] function() { URLClassLoader urlLoader = DynamicClassLoader.getClassLoader(); URL urls[] = urlLoader.getURLs(); File classpath[] = new File[urls.length]; for (int i = 0; i < urls.length; i++) { try { classpath[i] = new File(urls[i].toURI()); } catch (Exception e) { } } return classpath; } | /**
* Gets all of the currently loaded items on the classpath
*
* @return An array of files that are specified on the classpath
*/ | Gets all of the currently loaded items on the classpath | getClasspath | {
"repo_name": "simo415/spc",
"path": "src/com/sijobe/spc/util/DynamicClassLoader.java",
"license": "lgpl-3.0",
"size": 10763
} | [
"java.io.File",
"java.net.URLClassLoader"
] | import java.io.File; import java.net.URLClassLoader; | import java.io.*; import java.net.*; | [
"java.io",
"java.net"
] | java.io; java.net; | 1,869,510 |
@Bindable
public void testSettings() {
syncModel();
List<String> warnings = jobEntry.getValidationWarnings( getConfig() );
if ( !warnings.isEmpty() ) {
StringBuilder sb = new StringBuilder();
for ( String warning : warnings ) {
sb.append( warning ).append( "\n" );
}
showE... | void function() { syncModel(); List<String> warnings = jobEntry.getValidationWarnings( getConfig() ); if ( !warnings.isEmpty() ) { StringBuilder sb = new StringBuilder(); for ( String warning : warnings ) { sb.append( warning ).append( "\n" ); } showErrorDialog( BaseMessages.getString( OozieJobExecutorJobEntry.class, S... | /**
* Make sure everything required is entered and valid
*/ | Make sure everything required is entered and valid | testSettings | {
"repo_name": "pavel-sakun/big-data-plugin",
"path": "legacy/src/main/java/org/pentaho/di/ui/job/entries/oozie/OozieJobExecutorJobEntryController.java",
"license": "apache-2.0",
"size": 16117
} | [
"java.util.List",
"org.pentaho.di.i18n.BaseMessages",
"org.pentaho.di.job.entries.oozie.OozieJobExecutorJobEntry"
] | import java.util.List; import org.pentaho.di.i18n.BaseMessages; import org.pentaho.di.job.entries.oozie.OozieJobExecutorJobEntry; | import java.util.*; import org.pentaho.di.i18n.*; import org.pentaho.di.job.entries.oozie.*; | [
"java.util",
"org.pentaho.di"
] | java.util; org.pentaho.di; | 2,607,844 |
public static Draw toModel(DrawSoap soapModel) {
if (soapModel == null) {
return null;
}
Draw model = new DrawImpl();
model.setDrawId(soapModel.getDrawId());
model.setNumber1(soapModel.getNumber1());
model.setNumber2(soapModel.getNumber2());
model.setNumber3(soapModel.getNumber3());
model.setNum... | static Draw function(DrawSoap soapModel) { if (soapModel == null) { return null; } Draw model = new DrawImpl(); model.setDrawId(soapModel.getDrawId()); model.setNumber1(soapModel.getNumber1()); model.setNumber2(soapModel.getNumber2()); model.setNumber3(soapModel.getNumber3()); model.setNumber4(soapModel.getNumber4()); ... | /**
* Converts the soap model instance into a normal model instance.
*
* @param soapModel the soap model instance to convert
* @return the normal model instance
*/ | Converts the soap model instance into a normal model instance | toModel | {
"repo_name": "aritzg/EuroMillionGame-portlet",
"path": "docroot/WEB-INF/src/net/sareweb/emg/model/impl/DrawModelImpl.java",
"license": "gpl-3.0",
"size": 20284
} | [
"net.sareweb.emg.model.Draw",
"net.sareweb.emg.model.DrawSoap"
] | import net.sareweb.emg.model.Draw; import net.sareweb.emg.model.DrawSoap; | import net.sareweb.emg.model.*; | [
"net.sareweb.emg"
] | net.sareweb.emg; | 1,143,272 |
public Timeslot findByInstant (Instant time)
{
log.debug("find " + time.toString());
int index = getTimeslotIndex(time);
return findBySerialNumber(index);
} | Timeslot function (Instant time) { log.debug(STR + time.toString()); int index = getTimeslotIndex(time); return findBySerialNumber(index); } | /**
* Returns the timeslot (if any) corresponding to a particular Instant.
*/ | Returns the timeslot (if any) corresponding to a particular Instant | findByInstant | {
"repo_name": "powertac/powertac-core",
"path": "common/src/main/java/org/powertac/common/repo/TimeslotRepo.java",
"license": "apache-2.0",
"size": 7376
} | [
"org.joda.time.Instant",
"org.powertac.common.Timeslot"
] | import org.joda.time.Instant; import org.powertac.common.Timeslot; | import org.joda.time.*; import org.powertac.common.*; | [
"org.joda.time",
"org.powertac.common"
] | org.joda.time; org.powertac.common; | 704,610 |
@Override
protected JComponent createCustomEditor() {
JPanel panelAll;
JLabel label;
JPanel panelButtons;
BaseButton buttonOK;
BaseButton buttonClose; | JComponent function() { JPanel panelAll; JLabel label; JPanel panelButtons; BaseButton buttonOK; BaseButton buttonClose; | /**
* Gets the custom editor component.
*
* @return always null
*/ | Gets the custom editor component | createCustomEditor | {
"repo_name": "waikato-datamining/adams-base",
"path": "adams-core/src/main/java/adams/gui/goe/IndexEditor.java",
"license": "gpl-3.0",
"size": 10553
} | [
"javax.swing.JComponent",
"javax.swing.JLabel",
"javax.swing.JPanel"
] | import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JPanel; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 181,447 |
public Builder fragment(FragmentProvider fragmentType) {
fragment(fragmentType, fragmentType.getTag());
return this;
} | Builder function(FragmentProvider fragmentType) { fragment(fragmentType, fragmentType.getTag()); return this; } | /**
* Tell which fragment you want to show, by passing a corresponding
* {@link FragmentProvider} implementation. The tag for this fragment will be obtained
* from the {@link FragmentProvider}.
*
* @param fragmentType An implementation of {@link FragmentProvider} correspondi... | Tell which fragment you want to show, by passing a corresponding <code>FragmentProvider</code> implementation. The tag for this fragment will be obtained from the <code>FragmentProvider</code> | fragment | {
"repo_name": "Appolica/FragmentControllerAndroid",
"path": "FragmentController/fragmentcontroller/src/main/java/com/appolica/fragmentcontroller/PushBody.java",
"license": "apache-2.0",
"size": 11367
} | [
"com.appolica.fragmentcontroller.fragment.FragmentProvider"
] | import com.appolica.fragmentcontroller.fragment.FragmentProvider; | import com.appolica.fragmentcontroller.fragment.*; | [
"com.appolica.fragmentcontroller"
] | com.appolica.fragmentcontroller; | 743,317 |
@Test(expected = NullPointerException.class)
public final void testPrependSymbolWithNull()
{
assertEquals("@", XPathUtils.prependSymbol(null));
} | @Test(expected = NullPointerException.class) final void function() { assertEquals("@", XPathUtils.prependSymbol(null)); } | /**
* Tests the method {@link XPathUtils#prependSymbol(String)} with a null.
* <strong>The method is not able to handle nulls.</strong>
*/ | Tests the method <code>XPathUtils#prependSymbol(String)</code> with a null. The method is not able to handle nulls | testPrependSymbolWithNull | {
"repo_name": "byktol/jcr-qb",
"path": "src/test/java/com/byktol/jcr/qb/criteria/builder/utils/XPathUtilsTest.java",
"license": "apache-2.0",
"size": 4181
} | [
"com.byktol.jcr.qb.criteria.builder.utils.XPathUtils",
"org.junit.Assert",
"org.junit.Test"
] | import com.byktol.jcr.qb.criteria.builder.utils.XPathUtils; import org.junit.Assert; import org.junit.Test; | import com.byktol.jcr.qb.criteria.builder.utils.*; import org.junit.*; | [
"com.byktol.jcr",
"org.junit"
] | com.byktol.jcr; org.junit; | 299,943 |
public void unparsedEntityDecl(String name, XMLResourceIdentifier identifier,
String notation,
Augmentations augs) throws XNIException {
try {
// SAX2 extension
if (fDTDHandler != null) {
String pub... | void function(String name, XMLResourceIdentifier identifier, String notation, Augmentations augs) throws XNIException { try { if (fDTDHandler != null) { String publicId = identifier.getPublicId(); String systemId = fResolveDTDURIs ? identifier.getExpandedSystemId() : identifier.getLiteralSystemId(); fDTDHandler.unparse... | /**
* An unparsed entity declaration.
*
* @param name The name of the entity.
* @param identifier An object containing all location information
* pertinent to this entity.
* @param notation The name of the notation.
*
* @param augs Additional informati... | An unparsed entity declaration | unparsedEntityDecl | {
"repo_name": "openjdk/jdk8u",
"path": "jaxp/src/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java",
"license": "gpl-2.0",
"size": 91913
} | [
"com.sun.org.apache.xerces.internal.xni.Augmentations",
"com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier",
"com.sun.org.apache.xerces.internal.xni.XNIException",
"org.xml.sax.SAXException"
] | import com.sun.org.apache.xerces.internal.xni.Augmentations; import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; import com.sun.org.apache.xerces.internal.xni.XNIException; import org.xml.sax.SAXException; | import com.sun.org.apache.xerces.internal.xni.*; import org.xml.sax.*; | [
"com.sun.org",
"org.xml.sax"
] | com.sun.org; org.xml.sax; | 1,551,474 |
@Test(expected = IllegalArgumentException.class)
public void testCheckEachElementIsNotNull_1_collectionContainingNull() {
checkEachElementIsNotNull(containingNull);
}
| @Test(expected = IllegalArgumentException.class) void function() { checkEachElementIsNotNull(containingNull); } | /**
* Test to verify that the {@link NullChecker#checkEachElementIsNotNull(Collection)} method
* functions correctly when a collection containing at least one null element is supplied.
* The test will only pass if an IllegalArgumentException is thrown.
*/ | Test to verify that the <code>NullChecker#checkEachElementIsNotNull(Collection)</code> method functions correctly when a collection containing at least one null element is supplied. The test will only pass if an IllegalArgumentException is thrown | testCheckEachElementIsNotNull_1_collectionContainingNull | {
"repo_name": "MatthewTamlin/JavaUtilities",
"path": "library/src/test/java/com/matthewtamlin/java_utilities/checkers/TestNullChecker.java",
"license": "apache-2.0",
"size": 9694
} | [
"com.matthewtamlin.java_utilities.checkers.NullChecker",
"org.junit.Test"
] | import com.matthewtamlin.java_utilities.checkers.NullChecker; import org.junit.Test; | import com.matthewtamlin.java_utilities.checkers.*; import org.junit.*; | [
"com.matthewtamlin.java_utilities",
"org.junit"
] | com.matthewtamlin.java_utilities; org.junit; | 1,576,299 |
public void setMBeanServerInterceptor(MBeanServer interceptor);
/**
* <p>Return the MBeanServerDelegate representing the MBeanServer.
* Notifications can be sent from the MBean server delegate using
* the method {@link MBeanServerDelegate#sendNotification} | void function(MBeanServer interceptor); /** * <p>Return the MBeanServerDelegate representing the MBeanServer. * Notifications can be sent from the MBean server delegate using * the method {@link MBeanServerDelegate#sendNotification} | /**
* Set the MBeanServerInterceptor.
* @exception UnsupportedOperationException if
* {@link MBeanServerInterceptor}s
* are not enabled on this object.
* @see #interceptorsEnabled
**/ | Set the MBeanServerInterceptor | setMBeanServerInterceptor | {
"repo_name": "wangsongpeng/jdk-src",
"path": "src/main/java/com/sun/jmx/mbeanserver/SunJmxMBeanServer.java",
"license": "apache-2.0",
"size": 2215
} | [
"javax.management.MBeanServer",
"javax.management.MBeanServerDelegate"
] | import javax.management.MBeanServer; import javax.management.MBeanServerDelegate; | import javax.management.*; | [
"javax.management"
] | javax.management; | 1,570,441 |
private boolean startWithWildCard(String value)
{
if (CommonsLangUtils.isBlank(value)) return false;
Iterator<String> i = WILD_CARDS.iterator();
String card = null;
while (i.hasNext()) {
card = i.next();
if (value.startsWith(card)) {
return true;
}
}
return false;
} | boolean function(String value) { if (CommonsLangUtils.isBlank(value)) return false; Iterator<String> i = WILD_CARDS.iterator(); String card = null; while (i.hasNext()) { card = i.next(); if (value.startsWith(card)) { return true; } } return false; } | /**
* Returns <code>true</code> if the specified value starts with a wild card,
* <code>false</code> otherwise.
*
* @param value The value to handle.
* @return See above.
*/ | Returns <code>true</code> if the specified value starts with a wild card, <code>false</code> otherwise | startWithWildCard | {
"repo_name": "dpwrussell/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/env/data/OMEROGateway.java",
"license": "gpl-2.0",
"size": 262581
} | [
"java.util.Iterator",
"org.openmicroscopy.shoola.util.CommonsLangUtils"
] | import java.util.Iterator; import org.openmicroscopy.shoola.util.CommonsLangUtils; | import java.util.*; import org.openmicroscopy.shoola.util.*; | [
"java.util",
"org.openmicroscopy.shoola"
] | java.util; org.openmicroscopy.shoola; | 2,225,703 |
private CompletableFuture<Long> writeInputsAndCreateExecution(RuntimeContext runtimeContext,
StagingArea stagingArea) throws WorkflowExecutionException {
RuntimeModule runtimeModule = stagingArea.getAnnotatedExecutionTrace().getModule();
// All ports for which inputs wer... | CompletableFuture<Long> function(RuntimeContext runtimeContext, StagingArea stagingArea) throws WorkflowExecutionException { RuntimeModule runtimeModule = stagingArea.getAnnotatedExecutionTrace().getModule(); BitSet updatedInPorts = new BitSet(); for (SimpleName simpleName : inputValues.keySet()) { @Nullable RuntimePor... | /**
* Writes the inputs to the staging area and send a create-execution message to the master interpreter. This
* message will only return a new execution ID, but the execution will not yet be started.
*/ | Writes the inputs to the staging area and send a create-execution message to the master interpreter. This message will only return a new execution ID, but the execution will not yet be started | writeInputsAndCreateExecution | {
"repo_name": "cloudkeeper-project/cloudkeeper",
"path": "cloudkeeper-core/cloudkeeper-interpreter/src/main/java/xyz/cloudkeeper/interpreter/WorkflowExecutionBuilderImpl.java",
"license": "apache-2.0",
"size": 20607
} | [
"java.util.ArrayList",
"java.util.BitSet",
"java.util.List",
"java.util.Map",
"java.util.concurrent.CompletableFuture",
"javax.annotation.Nullable",
"xyz.cloudkeeper.model.api.RuntimeContext",
"xyz.cloudkeeper.model.api.RuntimeStateProvider",
"xyz.cloudkeeper.model.api.WorkflowExecutionException",
... | import java.util.ArrayList; import java.util.BitSet; import java.util.List; import java.util.Map; import java.util.concurrent.CompletableFuture; import javax.annotation.Nullable; import xyz.cloudkeeper.model.api.RuntimeContext; import xyz.cloudkeeper.model.api.RuntimeStateProvider; import xyz.cloudkeeper.model.api.Work... | import java.util.*; import java.util.concurrent.*; import javax.annotation.*; import xyz.cloudkeeper.model.api.*; import xyz.cloudkeeper.model.api.staging.*; import xyz.cloudkeeper.model.immutable.element.*; import xyz.cloudkeeper.model.immutable.execution.*; import xyz.cloudkeeper.model.runtime.element.module.*; | [
"java.util",
"javax.annotation",
"xyz.cloudkeeper.model"
] | java.util; javax.annotation; xyz.cloudkeeper.model; | 1,279,021 |
public void setAttributes (Attributes atts)
{
clear();
length = atts.getLength();
if (length > 0) {
data = new String[length*5];
for (int i = 0; i < length; i++) {
data[i*5] = atts.getURI(i);
data[i*5+1] = atts.getLocalName(i);
... | void function (Attributes atts) { clear(); length = atts.getLength(); if (length > 0) { data = new String[length*5]; for (int i = 0; i < length; i++) { data[i*5] = atts.getURI(i); data[i*5+1] = atts.getLocalName(i); data[i*5+2] = atts.getQName(i); data[i*5+3] = atts.getType(i); data[i*5+4] = atts.getValue(i); } } } | /**
* Copy an entire Attributes object.
*
* <p>It may be more efficient to reuse an existing object
* rather than constantly allocating new ones.</p>
*
* @param atts The attributes to copy.
*/ | Copy an entire Attributes object. It may be more efficient to reuse an existing object rather than constantly allocating new ones | setAttributes | {
"repo_name": "ccliu2015/love",
"path": "app/src/main/java/com/wisedu/scc/love/widget/html/AttributesImpl.java",
"license": "apache-2.0",
"size": 17334
} | [
"org.xml.sax.Attributes"
] | import org.xml.sax.Attributes; | import org.xml.sax.*; | [
"org.xml.sax"
] | org.xml.sax; | 33,895 |
public void addDataItemValues(ContentValues values) {
addNamedDataItemValues(Data.CONTENT_URI, values);
} | void function(ContentValues values) { addNamedDataItemValues(Data.CONTENT_URI, values); } | /**
* Creates and inserts a DataItem object that wraps the content values, and returns it.
*/ | Creates and inserts a DataItem object that wraps the content values, and returns it | addDataItemValues | {
"repo_name": "GuillaumeDelente/contact-picker",
"path": "library/src/main/java/com/guillaumedelente/android/contacts/common/model/RawContact.java",
"license": "apache-2.0",
"size": 12205
} | [
"android.content.ContentValues",
"android.provider.ContactsContract"
] | import android.content.ContentValues; import android.provider.ContactsContract; | import android.content.*; import android.provider.*; | [
"android.content",
"android.provider"
] | android.content; android.provider; | 1,929,251 |
public void write(ByteBuffer buffer)
{
int size=buffer.remaining();
adaptSize(_size+size);
int first=(_offset+_size)%_buffer.capacity();
int last=(first+size)%_buffer.capacity();
int read=size;
if(first<last)
{
_buffer.limit(last);
_buffer.position(first);
_bu... | void function(ByteBuffer buffer) { int size=buffer.remaining(); adaptSize(_size+size); int first=(_offset+_size)%_buffer.capacity(); int last=(first+size)%_buffer.capacity(); int read=size; if(first<last) { _buffer.limit(last); _buffer.position(first); _buffer.put(buffer); _size+=read; return; } _buffer.limit(_buffer.c... | /**
* Write buffer.remaining() bytes into this FIFOBuffer.
* @param buffer buffer to write.
*/ | Write buffer.remaining() bytes into this FIFOBuffer | write | {
"repo_name": "acrosoft-be/shared",
"path": "Util/src/main/java/be/acrosoft/gaia/shared/util/FIFOBuffer.java",
"license": "apache-2.0",
"size": 17123
} | [
"java.nio.ByteBuffer"
] | import java.nio.ByteBuffer; | import java.nio.*; | [
"java.nio"
] | java.nio; | 2,402,762 |
@Aspect(advice = org.support.project.ormapping.transaction.Transaction.class)
public MailHookConditionsEntity save(MailHookConditionsEntity entity) {
MailHookConditionsEntity db = selectOnKey(entity.getConditionNo(), entity.getHookId());
if (db == null) {
return insert(entity);
... | @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) MailHookConditionsEntity function(MailHookConditionsEntity entity) { MailHookConditionsEntity db = selectOnKey(entity.getConditionNo(), entity.getHookId()); if (db == null) { return insert(entity); } else { return update(entity); } } | /**
* Save.
* if same key data is exists, the data is update. otherwise the data is insert.
* @param entity entity
* @return saved entity
*/ | Save. if same key data is exists, the data is update. otherwise the data is insert | save | {
"repo_name": "support-project/knowledge",
"path": "src/main/java/org/support/project/knowledge/dao/gen/GenMailHookConditionsDao.java",
"license": "apache-2.0",
"size": 20626
} | [
"org.support.project.aop.Aspect",
"org.support.project.knowledge.entity.MailHookConditionsEntity"
] | import org.support.project.aop.Aspect; import org.support.project.knowledge.entity.MailHookConditionsEntity; | import org.support.project.aop.*; import org.support.project.knowledge.entity.*; | [
"org.support.project"
] | org.support.project; | 173,518 |
public static String searchParamsToURL(Map<String, String[]> params, boolean includeSorts, boolean includeFilters,
boolean includePaging) {
StringBuilder sb = new StringBuilder();
List<String[]> list = filterSearchParams(params, includeSorts, includeFilters, includePaging);
for (String[] param : lis... | static String function(Map<String, String[]> params, boolean includeSorts, boolean includeFilters, boolean includePaging) { StringBuilder sb = new StringBuilder(); List<String[]> list = filterSearchParams(params, includeSorts, includeFilters, includePaging); for (String[] param : list) { if (sb.length() != 0) sb.append... | /**
* <p>
* Build a URL parameter string based on the relevant search parameters in a
* request parameter map.
*
* <p>
* An example return value would be "sort=name&f-name=Da".
*/ | Build a URL parameter string based on the relevant search parameters in a request parameter map. An example return value would be "sort=name&f-name=Da" | searchParamsToURL | {
"repo_name": "xm-repo/java-web-app",
"path": "src/main/java/cmc/ps/webhelps/Util.java",
"license": "mit",
"size": 7520
} | [
"java.util.List",
"java.util.Map"
] | import java.util.List; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 733,162 |
@Deprecated
public synchronized OServerAdmin createDatabase(final String iStorageMode) throws IOException {
return createDatabase("document", iStorageMode);
}
| synchronized OServerAdmin function(final String iStorageMode) throws IOException { return createDatabase(STR, iStorageMode); } | /**
* Deprecated. Use the {@link #createDatabase(String, String)} instead.
*/ | Deprecated. Use the <code>#createDatabase(String, String)</code> instead | createDatabase | {
"repo_name": "sanyaade-g2g-repos/orientdb",
"path": "client/src/main/java/com/orientechnologies/orient/client/remote/OServerAdmin.java",
"license": "apache-2.0",
"size": 20090
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,051,877 |
@Endpoint(
describeByClass = true
)
public static <T extends TType> TakeManySparseFromTensorsMap<T> create(Scope scope,
Operand<TInt64> sparseHandles, Class<T> dtype, Options... options) {
OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TakeManySparseFromTensorsMap");
opBuilder.addInput... | @Endpoint( describeByClass = true ) static <T extends TType> TakeManySparseFromTensorsMap<T> function(Scope scope, Operand<TInt64> sparseHandles, Class<T> dtype, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, STR); opBuilder.addInput(sparseHandles.asOutput()); opBuilder.setAttr("dtype", Ope... | /**
* Factory method to create a class wrapping a new TakeManySparseFromTensorsMap operation.
*
* @param scope current scope
* @param sparseHandles 1-D, The {@code N} serialized {@code SparseTensor} objects.
* Shape: {@code [N]}.
* @param dtype The {@code dtype} of the {@code SparseTensor} objects sto... | Factory method to create a class wrapping a new TakeManySparseFromTensorsMap operation | create | {
"repo_name": "tensorflow/java",
"path": "tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/TakeManySparseFromTensorsMap.java",
"license": "apache-2.0",
"size": 8964
} | [
"org.tensorflow.Operand",
"org.tensorflow.OperationBuilder",
"org.tensorflow.op.Operands",
"org.tensorflow.op.Scope",
"org.tensorflow.op.annotation.Endpoint",
"org.tensorflow.types.TInt64",
"org.tensorflow.types.family.TType"
] | import org.tensorflow.Operand; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; | import org.tensorflow.*; import org.tensorflow.op.*; import org.tensorflow.op.annotation.*; import org.tensorflow.types.*; import org.tensorflow.types.family.*; | [
"org.tensorflow",
"org.tensorflow.op",
"org.tensorflow.types"
] | org.tensorflow; org.tensorflow.op; org.tensorflow.types; | 812,112 |
public AccountSet withFromTransaction(Transaction value)
{
for (Account obj : this)
{
obj.withFromTransaction(value);
}
return this;
} | AccountSet function(Transaction value) { for (Account obj : this) { obj.withFromTransaction(value); } return this; } | /**
* Loop through current set of ModelType objects and attach the Account object passed as parameter to the FromTransaction attribute of each of it.
*
* @return The original set of ModelType objects now with the new neighbor attached to their FromTransaction attributes.
*/ | Loop through current set of ModelType objects and attach the Account object passed as parameter to the FromTransaction attribute of each of it | withFromTransaction | {
"repo_name": "SWE443-TeamRed/open-bank",
"path": "open-bank/src/main/java/org/sdmlib/openbank/util/AccountSet.java",
"license": "mit",
"size": 30045
} | [
"org.sdmlib.openbank.Account",
"org.sdmlib.openbank.Transaction"
] | import org.sdmlib.openbank.Account; import org.sdmlib.openbank.Transaction; | import org.sdmlib.openbank.*; | [
"org.sdmlib.openbank"
] | org.sdmlib.openbank; | 1,635,416 |
WritableByteChannel decorate(WritableByteChannel channel) throws IOException, InterruptedException; | WritableByteChannel decorate(WritableByteChannel channel) throws IOException, InterruptedException; | /**
* Decorates the given channel.
* @param channel the source channel
* @return the decorated channel
* @throws IOException if I/O error was occurred while decorating the channel
* @throws InterruptedException if interrupted while decorating the channel
*/ | Decorates the given channel | decorate | {
"repo_name": "asakusafw/asakusafw-compiler",
"path": "vanilla/runtime/core/src/main/java/com/asakusafw/vanilla/core/io/ByteChannelDecorator.java",
"license": "apache-2.0",
"size": 2141
} | [
"java.io.IOException",
"java.nio.channels.WritableByteChannel"
] | import java.io.IOException; import java.nio.channels.WritableByteChannel; | import java.io.*; import java.nio.channels.*; | [
"java.io",
"java.nio"
] | java.io; java.nio; | 1,730,121 |
public void dump(PrintWriter pen, String indent); | void function(PrintWriter pen, String indent); | /**
* Print the value using a specified indent (prefix).
*/ | Print the value using a specified indent (prefix) | dump | {
"repo_name": "Grinnell-CSC207/final-2013F",
"path": "problems45/src/JSONValue.java",
"license": "gpl-3.0",
"size": 390
} | [
"java.io.PrintWriter"
] | import java.io.PrintWriter; | import java.io.*; | [
"java.io"
] | java.io; | 256,996 |
void publishFlushedSegment(SegmentCommitInfo newSegment,
FrozenBufferedUpdates packet, FrozenBufferedUpdates globalPacket) throws IOException {
try {
synchronized (this) {
// Lock order IW -> BDS
synchronized (bufferedUpdatesStream) {
if (infoStream.isEnabled("IW")) {
... | void publishFlushedSegment(SegmentCommitInfo newSegment, FrozenBufferedUpdates packet, FrozenBufferedUpdates globalPacket) throws IOException { try { synchronized (this) { synchronized (bufferedUpdatesStream) { if (infoStream.isEnabled("IW")) { infoStream.message("IW", STR); } if (globalPacket != null && globalPacket.a... | /**
* Atomically adds the segment private delete packet and publishes the flushed
* segments SegmentInfo to the index writer.
*/ | Atomically adds the segment private delete packet and publishes the flushed segments SegmentInfo to the index writer | publishFlushedSegment | {
"repo_name": "pengzong1111/solr4",
"path": "lucene/core/src/java/org/apache/lucene/index/IndexWriter.java",
"license": "apache-2.0",
"size": 176670
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,852,463 |
public AsymmetricKeyParameter bcKeyParameters()
{
return this.bcPrivateKeyParameters();
} | AsymmetricKeyParameter function() { return this.bcPrivateKeyParameters(); } | /**
* Get the generic Bouncy Castle asymmetric key parameters.
*
* @return The generic Bouncy Castle asymmetric key parameters.
*/ | Get the generic Bouncy Castle asymmetric key parameters | bcKeyParameters | {
"repo_name": "eloquent/lockbox-java",
"path": "src/main/java/co/lqnt/lockbox/key/PrivateKey.java",
"license": "mit",
"size": 10745
} | [
"org.bouncycastle.crypto.params.AsymmetricKeyParameter"
] | import org.bouncycastle.crypto.params.AsymmetricKeyParameter; | import org.bouncycastle.crypto.params.*; | [
"org.bouncycastle.crypto"
] | org.bouncycastle.crypto; | 2,840,293 |
@Test
public void testQueuedExecutionTimeoutWithFallback() {
TestHystrixCommand<?> command = getCommand(ExecutionIsolationStrategy.THREAD, AbstractTestHystrixCommand.ExecutionResult.SUCCESS, 200, AbstractTestHystrixCommand.FallbackResult.SUCCESS, 50);
try {
assertEquals(FlexibleTestH... | void function() { TestHystrixCommand<?> command = getCommand(ExecutionIsolationStrategy.THREAD, AbstractTestHystrixCommand.ExecutionResult.SUCCESS, 200, AbstractTestHystrixCommand.FallbackResult.SUCCESS, 50); try { assertEquals(FlexibleTestHystrixCommand.FALLBACK_VALUE, command.queue().get()); } catch (Exception e) { e... | /**
* Test a queued command execution timeout where the command implemented getFallback.
* <p>
* We specifically want to protect against developers queuing commands and using queue().get() without a timeout (such as queue().get(3000, TimeUnit.Milliseconds)) and ending up blocking
* indefinitely by s... | Test a queued command execution timeout where the command implemented getFallback. We specifically want to protect against developers queuing commands and using queue().get() without a timeout (such as queue().get(3000, TimeUnit.Milliseconds)) and ending up blocking indefinitely by skipping the timeout protection of th... | testQueuedExecutionTimeoutWithFallback | {
"repo_name": "davidkarlsen/Hystrix",
"path": "hystrix-core/src/test/java/com/netflix/hystrix/HystrixCommandTest.java",
"license": "apache-2.0",
"size": 282697
} | [
"com.netflix.hystrix.HystrixCommandProperties",
"com.netflix.hystrix.util.HystrixRollingNumberEvent",
"org.junit.Assert"
] | import com.netflix.hystrix.HystrixCommandProperties; import com.netflix.hystrix.util.HystrixRollingNumberEvent; import org.junit.Assert; | import com.netflix.hystrix.*; import com.netflix.hystrix.util.*; import org.junit.*; | [
"com.netflix.hystrix",
"org.junit"
] | com.netflix.hystrix; org.junit; | 2,046,040 |
public void setGeometry (CollisionGeometry geometry) {
this.geometry = geometry;
}
| void function (CollisionGeometry geometry) { this.geometry = geometry; } | /** Assigns collision geometry to this <code>GameObject</code>.
* @param geometry the new collision geometry. */ | Assigns collision geometry to this <code>GameObject</code> | setGeometry | {
"repo_name": "ryoenji/libgdx",
"path": "demos/very-angry-robots/very-angry-robots/src/com/badlydrawngames/veryangryrobots/mobiles/GameObject.java",
"license": "apache-2.0",
"size": 5100
} | [
"com.badlydrawngames.general.CollisionGeometry"
] | import com.badlydrawngames.general.CollisionGeometry; | import com.badlydrawngames.general.*; | [
"com.badlydrawngames.general"
] | com.badlydrawngames.general; | 1,725,474 |
@Override
public Timer timer(final String name) {
return getOrAdd(name, MetricBuilder.TIMERS);
} | Timer function(final String name) { return getOrAdd(name, MetricBuilder.TIMERS); } | /**
* Get the timer associated with the given name.
*
* @param name the name of the meter
* @return the meter associated with the given name
*/ | Get the timer associated with the given name | timer | {
"repo_name": "koshalt/modules",
"path": "metrics/src/main/java/org/motechproject/metrics/service/impl/MetricRegistryServiceImpl.java",
"license": "bsd-3-clause",
"size": 10065
} | [
"org.motechproject.metrics.api.Timer"
] | import org.motechproject.metrics.api.Timer; | import org.motechproject.metrics.api.*; | [
"org.motechproject.metrics"
] | org.motechproject.metrics; | 1,319,612 |
private Object readObjectFromFile(String filename) {
FileInputStream fos;
try {
fos = context.openFileInput(filename);
ObjectInputStream oin = new ObjectInputStream(fos);
Object o = oin.readObject();
oin.close();
return o;
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (O... | Object function(String filename) { FileInputStream fos; try { fos = context.openFileInput(filename); ObjectInputStream oin = new ObjectInputStream(fos); Object o = oin.readObject(); oin.close(); return o; } catch (FileNotFoundException e) { e.printStackTrace(); } catch (OptionalDataException e) { e.printStackTrace(); }... | /**
* Read a single object from the file given.
*
* @param filename
* file on which to read
* @return a single object read from file, null if an error occured.
*/ | Read a single object from the file given | readObjectFromFile | {
"repo_name": "ValentinMinder/pocketcampus",
"path": "plugin/freeroom/android/src/main/java/org/pocketcampus/plugin/freeroom/android/FreeRoomModel.java",
"license": "bsd-3-clause",
"size": 49308
} | [
"java.io.FileInputStream",
"java.io.FileNotFoundException",
"java.io.IOException",
"java.io.ObjectInputStream",
"java.io.OptionalDataException",
"java.util.List",
"org.pocketcampus.plugin.freeroom.android.utils.OrderMapListFew",
"org.pocketcampus.plugin.freeroom.shared.FRRoom"
] | import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.ObjectInputStream; import java.io.OptionalDataException; import java.util.List; import org.pocketcampus.plugin.freeroom.android.utils.OrderMapListFew; import org.pocketcampus.plugin.freeroom.shared.FRRoom; | import java.io.*; import java.util.*; import org.pocketcampus.plugin.freeroom.android.utils.*; import org.pocketcampus.plugin.freeroom.shared.*; | [
"java.io",
"java.util",
"org.pocketcampus.plugin"
] | java.io; java.util; org.pocketcampus.plugin; | 269,179 |
public Object[] cloneRow(Object[] objects) throws KettleValueException;
| Object[] function(Object[] objects) throws KettleValueException; | /**
* Clone row.
*
* @param objects object to clone
* @return a cloned objects to clone to
* @throws KettleValueException in case something is not quite right with the expected data
*/ | Clone row | cloneRow | {
"repo_name": "jjeb/kettle-trunk",
"path": "core/src/org/pentaho/di/core/row/RowMetaInterface.java",
"license": "apache-2.0",
"size": 21460
} | [
"org.pentaho.di.core.exception.KettleValueException"
] | import org.pentaho.di.core.exception.KettleValueException; | import org.pentaho.di.core.exception.*; | [
"org.pentaho.di"
] | org.pentaho.di; | 1,252,986 |
private void doLargeGetPutNextKeyBackwardsTraverse()
throws DatabaseException {
Hashtable dataMap = new Hashtable();
doLargePut(dataMap, N_KEYS); | void function() throws DatabaseException { Hashtable dataMap = new Hashtable(); doLargePut(dataMap, N_KEYS); | /**
* Helper routine for above.
*/ | Helper routine for above | doLargeGetPutNextKeyBackwardsTraverse | {
"repo_name": "nologic/nabs",
"path": "client/trunk/shared/libraries/je-3.2.44/test/com/sleepycat/je/dbi/DbCursorTest.java",
"license": "gpl-2.0",
"size": 50003
} | [
"com.sleepycat.je.DatabaseException",
"java.util.Hashtable"
] | import com.sleepycat.je.DatabaseException; import java.util.Hashtable; | import com.sleepycat.je.*; import java.util.*; | [
"com.sleepycat.je",
"java.util"
] | com.sleepycat.je; java.util; | 758,909 |
public Path getExecRoot() {
return directories.getExecRoot();
} | Path function() { return directories.getExecRoot(); } | /**
* Returns the execution root directory associated with this Blaze server
* process. This is where all input and output files visible to the actual
* build reside.
*/ | Returns the execution root directory associated with this Blaze server process. This is where all input and output files visible to the actual build reside | getExecRoot | {
"repo_name": "Krasnyanskiy/bazel",
"path": "src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java",
"license": "apache-2.0",
"size": 68285
} | [
"com.google.devtools.build.lib.vfs.Path"
] | import com.google.devtools.build.lib.vfs.Path; | import com.google.devtools.build.lib.vfs.*; | [
"com.google.devtools"
] | com.google.devtools; | 1,257,486 |
boolean visit(MediaFile file); | boolean visit(MediaFile file); | /**
* Do some work on a file. The file is guaranteed to be readable.
*
* @param file to visit
* @return whether the visit completed without errors
*/ | Do some work on a file. The file is guaranteed to be readable | visit | {
"repo_name": "patrick-conley/android-music-player",
"path": "scanner/src/main/java/io/github/patrickconley/arbutus/scanner/visitor/MediaVisitor.java",
"license": "gpl-2.0",
"size": 1197
} | [
"io.github.patrickconley.arbutus.scanner.model.impl.MediaFile"
] | import io.github.patrickconley.arbutus.scanner.model.impl.MediaFile; | import io.github.patrickconley.arbutus.scanner.model.impl.*; | [
"io.github.patrickconley"
] | io.github.patrickconley; | 744,502 |
public Object instantiate(Class<?> theClass, Object params[],
String signature[], ClassLoader loader)
throws ReflectionException, MBeanException {
checkMBeanPermission(theClass, null, null, "instantiate");
// Instantiate the new object
// -------------... | Object function(Class<?> theClass, Object params[], String signature[], ClassLoader loader) throws ReflectionException, MBeanException { checkMBeanPermission(theClass, null, null, STR); final Class<?>[] tab; Object moi; try { ((signature == null)?null: findSignatureClasses(signature,aLoader)); } catch (IllegalArgumentE... | /**
* Instantiates an object given its class, the parameters and
* signature of its constructor The call returns a reference to
* the newly created object.
*/ | Instantiates an object given its class, the parameters and signature of its constructor The call returns a reference to the newly created object | instantiate | {
"repo_name": "rokn/Count_Words_2015",
"path": "testing/openjdk2/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java",
"license": "mit",
"size": 30482
} | [
"java.lang.reflect.Constructor",
"java.lang.reflect.InvocationTargetException",
"javax.management.MBeanException",
"javax.management.ReflectionException",
"javax.management.RuntimeErrorException",
"javax.management.RuntimeMBeanException"
] | import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import javax.management.MBeanException; import javax.management.ReflectionException; import javax.management.RuntimeErrorException; import javax.management.RuntimeMBeanException; | import java.lang.reflect.*; import javax.management.*; | [
"java.lang",
"javax.management"
] | java.lang; javax.management; | 1,352,774 |
public void setValues(ArrayList<ItemSelectable> values) {
int index = this.values.size();
if (index >= 1) {
fireIntervalRemoved(this, 0, (index - 1));
}
this.values.clear();
this.values.addAll(values);
int size = values.size();
if (si... | void function(ArrayList<ItemSelectable> values) { int index = this.values.size(); if (index >= 1) { fireIntervalRemoved(this, 0, (index - 1)); } this.values.clear(); this.values.addAll(values); int size = values.size(); if (size > 0) { int index1 = size - 1; fireIntervalAdded(this, 0, index1); fireContentsChanged(this,... | /**
* Modifica los valores del modelo
*
* @param values nuevos valore
*/ | Modifica los valores del modelo | setValues | {
"repo_name": "jcrcano/DrakkarKeel",
"path": "Modules/DrakkarCover/src/drakkar/cover/swing/GenericCheckListModel.java",
"license": "gpl-2.0",
"size": 4597
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 1,853,196 |
if (Context.getCurrentContext() == null) {
Context.enter();
}
} | if (Context.getCurrentContext() == null) { Context.enter(); } } | /**
* Initialize the context if it doesn't exist
*/ | Initialize the context if it doesn't exist | initContext | {
"repo_name": "davidwebster48/jawr-main-repo",
"path": "jawr/jawr-core/src/test/java/test/net/jawr/web/util/js/rhino/RhinoEngine.java",
"license": "apache-2.0",
"size": 4502
} | [
"org.mozilla.javascript.Context"
] | import org.mozilla.javascript.Context; | import org.mozilla.javascript.*; | [
"org.mozilla.javascript"
] | org.mozilla.javascript; | 1,989,096 |
public static PartitionValueExtractor createPartitionExtractor(String partitionExtractorClass) {
try {
return (PartitionValueExtractor) ReflectionUtils.loadClass(partitionExtractorClass);
} catch (Throwable e) {
throw new HoodieException("Could not load partition extractor class " + partitionExtr... | static PartitionValueExtractor function(String partitionExtractorClass) { try { return (PartitionValueExtractor) ReflectionUtils.loadClass(partitionExtractorClass); } catch (Throwable e) { throw new HoodieException(STR + partitionExtractorClass, e); } } | /**
* Create a partition value extractor class via reflection, passing in any configs needed
*/ | Create a partition value extractor class via reflection, passing in any configs needed | createPartitionExtractor | {
"repo_name": "vinothchandar/hoodie",
"path": "hoodie-spark/src/main/java/com/uber/hoodie/DataSourceUtils.java",
"license": "apache-2.0",
"size": 9172
} | [
"com.uber.hoodie.common.util.ReflectionUtils",
"com.uber.hoodie.exception.HoodieException",
"com.uber.hoodie.hive.PartitionValueExtractor"
] | import com.uber.hoodie.common.util.ReflectionUtils; import com.uber.hoodie.exception.HoodieException; import com.uber.hoodie.hive.PartitionValueExtractor; | import com.uber.hoodie.common.util.*; import com.uber.hoodie.exception.*; import com.uber.hoodie.hive.*; | [
"com.uber.hoodie"
] | com.uber.hoodie; | 1,059,027 |
protected Model getModel() {
return this.model;
} | Model function() { return this.model; } | /**
* Returns the model
* @return
*/ | Returns the model | getModel | {
"repo_name": "jgaupp/arx",
"path": "src/gui/org/deidentifier/arx/gui/view/impl/risk/ViewRisks.java",
"license": "apache-2.0",
"size": 11597
} | [
"org.deidentifier.arx.gui.model.Model"
] | import org.deidentifier.arx.gui.model.Model; | import org.deidentifier.arx.gui.model.*; | [
"org.deidentifier.arx"
] | org.deidentifier.arx; | 1,950,817 |
public static Object findValueOfType(Collection<?> collection, Class<?>[] types) {
if (isEmpty(collection) || ObjectUtils.isEmpty(types)) {
return null;
}
for (Class<?> type : types) {
Object value = findValueOfType(collection, type);
if (value != null) {
return value;
}
}
return null;
} | static Object function(Collection<?> collection, Class<?>[] types) { if (isEmpty(collection) ObjectUtils.isEmpty(types)) { return null; } for (Class<?> type : types) { Object value = findValueOfType(collection, type); if (value != null) { return value; } } return null; } | /**
* Find a single value of one of the given types in the given Collection:
* searching the Collection for a value of the first type, then
* searching for a value of the second type, etc.
* @param collection the collection to search
* @param types the types to look for, in prioritized order
* @return a val... | Find a single value of one of the given types in the given Collection: searching the Collection for a value of the first type, then searching for a value of the second type, etc | findValueOfType | {
"repo_name": "Arabidopsis-Information-Portal/intermine",
"path": "bio/sources/araport/araport-chado-db/main/src/org/intermine/bio/dataloader/util/CollectionUtils.java",
"license": "lgpl-2.1",
"size": 14108
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 1,168,895 |
PColumn getPKColumn(String name) throws ColumnNotFoundException;
/**
* Creates a new row at the specified timestamp using the key
* for the PK values (from {@link #newKey(ImmutableBytesWritable, byte[][])} | PColumn getPKColumn(String name) throws ColumnNotFoundException; /** * Creates a new row at the specified timestamp using the key * for the PK values (from {@link #newKey(ImmutableBytesWritable, byte[][])} | /**
* Get the PK column with the given name.
* @param name the column name
* @return the PColumn with the given name
* @throws ColumnNotFoundException if no PK column with the given name
* can be found
* @throws ColumnNotFoundException
*/ | Get the PK column with the given name | getPKColumn | {
"repo_name": "ankitsinghal/phoenix",
"path": "phoenix-core/src/main/java/org/apache/phoenix/schema/PTable.java",
"license": "apache-2.0",
"size": 33322
} | [
"org.apache.hadoop.hbase.io.ImmutableBytesWritable"
] | import org.apache.hadoop.hbase.io.ImmutableBytesWritable; | import org.apache.hadoop.hbase.io.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 1,845,068 |
public static OppositeConstraint getNegation(final Class<? extends Constraint> constraintClass) {
if (constraintClass == null) {
return null;
}
synchronized (REGISTRY_OPPOSITE) {
OppositeConstraint c = REGISTRY_OPPOSITE.get(constraintClass);
if (c == null) {
Constraint regular = ... | static OppositeConstraint function(final Class<? extends Constraint> constraintClass) { if (constraintClass == null) { return null; } synchronized (REGISTRY_OPPOSITE) { OppositeConstraint c = REGISTRY_OPPOSITE.get(constraintClass); if (c == null) { Constraint regular = getRegularConstraint(constraintClass); if (regular... | /**
* Gets the singleton instance for the {@code OppositeConstraint} matching the
* given {@code Constraint} class. When such instance does not exist, it is
* created and registered.
*
* The method safely returns null when the {@code constraintClass} argument is
* null.
*
* This method is thread... | Gets the singleton instance for the OppositeConstraint matching the given Constraint class. When such instance does not exist, it is created and registered. The method safely returns null when the constraintClass argument is null. This method is thread-safe | getNegation | {
"repo_name": "lympid/lympid-core",
"path": "src/main/java/com/lympid/core/behaviorstatemachines/builder/ConstraintFactory.java",
"license": "apache-2.0",
"size": 4518
} | [
"com.lympid.core.basicbehaviors.Constraint",
"com.lympid.core.basicbehaviors.OppositeBiTransitionConstraint",
"com.lympid.core.basicbehaviors.OppositeConstraint",
"com.lympid.core.behaviorstatemachines.BiTransitionConstraint"
] | import com.lympid.core.basicbehaviors.Constraint; import com.lympid.core.basicbehaviors.OppositeBiTransitionConstraint; import com.lympid.core.basicbehaviors.OppositeConstraint; import com.lympid.core.behaviorstatemachines.BiTransitionConstraint; | import com.lympid.core.basicbehaviors.*; import com.lympid.core.behaviorstatemachines.*; | [
"com.lympid.core"
] | com.lympid.core; | 2,383,977 |
public Output<T> inputMaxBackprop() {
return inputMaxBackprop;
}
public static class Options {
private Long axis;
private Options() {
} | Output<T> function() { return inputMaxBackprop; } public static class Options { private Long axis; private Options() { } | /**
* Gets inputMaxBackprop.
*
* @return inputMaxBackprop.
*/ | Gets inputMaxBackprop | inputMaxBackprop | {
"repo_name": "tensorflow/java",
"path": "tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV4Grad.java",
"license": "apache-2.0",
"size": 5754
} | [
"org.tensorflow.Output"
] | import org.tensorflow.Output; | import org.tensorflow.*; | [
"org.tensorflow"
] | org.tensorflow; | 164,153 |
private String getCompactInfo(NodeList nodes, int tabSize) {
StringBuilder builder = new StringBuilder();
for (int i = 0; i < nodes.getLength(); i++) {
Node node = nodes.item(i);
// filter nodes that aren't menuItems
if (node.getNodeType() != Node.ELEMENT_NODE) {... | String function(NodeList nodes, int tabSize) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < nodes.getLength(); i++) { Node node = nodes.item(i); if (node.getNodeType() != Node.ELEMENT_NODE) { continue; } String nodeName = node.getNodeName(); if (!nodeName.equals(MENU_ITEM)) { continue; } builder.app... | /**
* Iterates over a list of menu entry Nodes and call
* {@link #getCompactInfo(Element, int)} to get the info of all the menu
* entry Nodes in the given list.
*
* @param nodes
* @param tabSize
* @return
*/ | Iterates over a list of menu entry Nodes and call <code>#getCompactInfo(Element, int)</code> to get the info of all the menu entry Nodes in the given list | getCompactInfo | {
"repo_name": "osroca/gvnix",
"path": "addon-web-mvc-menu/src/main/java/org/gvnix/web/menu/roo/addon/MenuEntryOperationsImpl.java",
"license": "gpl-3.0",
"size": 60356
} | [
"org.w3c.dom.Element",
"org.w3c.dom.Node",
"org.w3c.dom.NodeList"
] | import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 883,506 |
private static GdxComponent findDragTargetWithinContainer(GdxDragDropComponent draggable, GdxContainer container, float x, float y) {
for (Iterator<GdxComponent> it = container.interactionCandidatesIterator(x, y); it.hasNext(); ) {
GdxComponent component = it.next();
float componentX = x - componen... | static GdxComponent function(GdxDragDropComponent draggable, GdxContainer container, float x, float y) { for (Iterator<GdxComponent> it = container.interactionCandidatesIterator(x, y); it.hasNext(); ) { GdxComponent component = it.next(); float componentX = x - component.getX(); float componentY = y - component.getY();... | /**
* Searchs for a drag target within given container. Target must lie at given
* coordinates and have to accept the component. Targets deeper within component
* structure are preffered.
* @param draggable Component to find target for
* @param container Container to be searched
* @param x Coor... | Searchs for a drag target within given container. Target must lie at given coordinates and have to accept the component. Targets deeper within component structure are preffered | findDragTargetWithinContainer | {
"repo_name": "Kabuto5/gdx-components",
"path": "src/helpers/ComponentUtils.java",
"license": "apache-2.0",
"size": 5772
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 1,552,609 |
public Serializable saveEntity(T entity)
{
logger.executionTrace();
final Session session = sessionFactory.getCurrentSession();
final Object entityId = session.save(entity);
clearInternalCache();
fireItemSetChange();
return (Serializable) entityId;
} | Serializable function(T entity) { logger.executionTrace(); final Session session = sessionFactory.getCurrentSession(); final Object entityId = session.save(entity); clearInternalCache(); fireItemSetChange(); return (Serializable) entityId; } | /**
* This method is used to save an entity to the database and in the process it will fire an item set change event.
*/ | This method is used to save an entity to the database and in the process it will fire an item set change event | saveEntity | {
"repo_name": "veronicawwashington/enterprise-app",
"path": "src/enterpriseapp/hibernate/CustomHbnContainer.java",
"license": "agpl-3.0",
"size": 57727
} | [
"java.io.Serializable",
"org.hibernate.Session"
] | import java.io.Serializable; import org.hibernate.Session; | import java.io.*; import org.hibernate.*; | [
"java.io",
"org.hibernate"
] | java.io; org.hibernate; | 1,932,095 |
public boolean isWritable(int column) throws SQLException {
return !isReadOnly(column);
} | boolean function(int column) throws SQLException { return !isReadOnly(column); } | /**
* Is it possible for a write on the column to succeed?
*
* @param column
* the first column is 1, the second is 2, etc.
*
* @return true if so
*
* @throws SQLException
* if a database access error occurs
*/ | Is it possible for a write on the column to succeed | isWritable | {
"repo_name": "shubhanshu-gupta/Apache-Solr",
"path": "example/solr/collection1/lib/mysql-connector-java-5.1.32/src/com/mysql/jdbc/ResultSetMetaData.java",
"license": "apache-2.0",
"size": 22984
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 1,293,753 |
private void onOutputsWillChange() throws IOException {
if (rule instanceof InitializableFromDisk) {
((InitializableFromDisk<?>) rule).getBuildOutputInitializer().invalidate();
}
onDiskBuildInfo.deleteExistingMetadata();
// TODO(cjhopman): Delete old outputs.
} | void function() throws IOException { if (rule instanceof InitializableFromDisk) { ((InitializableFromDisk<?>) rule).getBuildOutputInitializer().invalidate(); } onDiskBuildInfo.deleteExistingMetadata(); } | /**
* onOutputsWillChange() should be called once we've determined that the outputs are going to
* change from their previous state (e.g. because we're about to build locally or unzip an
* artifact from the cache).
*/ | onOutputsWillChange() should be called once we've determined that the outputs are going to change from their previous state (e.g. because we're about to build locally or unzip an artifact from the cache) | onOutputsWillChange | {
"repo_name": "clonetwin26/buck",
"path": "src/com/facebook/buck/rules/CachingBuildRuleBuilder.java",
"license": "apache-2.0",
"size": 60836
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 652,039 |
@ApiModelProperty(example = "null", value = "")
public String getName() {
return name;
} | @ApiModelProperty(example = "null", value = "") String function() { return name; } | /**
* Get name
* @return name
**/ | Get name | getName | {
"repo_name": "PitneyBowes/LocationIntelligenceSDK-Java",
"path": "src/main/java/pb/locationintelligence/model/Poi.java",
"license": "apache-2.0",
"size": 11372
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 2,832,017 |
public HttpClientBuilder errorHandlingStrategy(ErrorHandlingStrategy errorStrategy) {
endpoint.getEndpointConfiguration().setErrorHandlingStrategy(errorStrategy);
return this;
} | HttpClientBuilder function(ErrorHandlingStrategy errorStrategy) { endpoint.getEndpointConfiguration().setErrorHandlingStrategy(errorStrategy); return this; } | /**
* Sets the error handling strategy.
* @param errorStrategy
* @return
*/ | Sets the error handling strategy | errorHandlingStrategy | {
"repo_name": "christophd/citrus",
"path": "endpoints/citrus-http/src/main/java/com/consol/citrus/http/client/HttpClientBuilder.java",
"license": "apache-2.0",
"size": 6790
} | [
"com.consol.citrus.message.ErrorHandlingStrategy"
] | import com.consol.citrus.message.ErrorHandlingStrategy; | import com.consol.citrus.message.*; | [
"com.consol.citrus"
] | com.consol.citrus; | 237,101 |
private ArrayList<String> getMessages(JsonReader reader) throws IOException
{
ArrayList<String> message = new ArrayList<>();
reader.beginObject();
while(reader.hasNext())
{
message.add(reader.nextName() + ":" + reader.nextString());
}
reader.endObject... | ArrayList<String> function(JsonReader reader) throws IOException { ArrayList<String> message = new ArrayList<>(); reader.beginObject(); while(reader.hasNext()) { message.add(reader.nextName() + ":" + reader.nextString()); } reader.endObject(); Log.i(STR, STR + message.toString()); return message; } | /**
* Basic Json parsing
* @param reader JsonReader to parse
* @return list of string where each string is "key:value"
* @throws IOException
*/ | Basic Json parsing | getMessages | {
"repo_name": "Jooster2/DAT255",
"path": "app/src/main/java/com/soctec/soctec/utils/APIHandler.java",
"license": "apache-2.0",
"size": 7981
} | [
"android.util.JsonReader",
"android.util.Log",
"java.io.IOException",
"java.util.ArrayList"
] | import android.util.JsonReader; import android.util.Log; import java.io.IOException; import java.util.ArrayList; | import android.util.*; import java.io.*; import java.util.*; | [
"android.util",
"java.io",
"java.util"
] | android.util; java.io; java.util; | 487,578 |
private void parseMidi (final LinkedList<String> path, final Object value) throws IllegalParameterException, UnknownCommandException, MissingCommandException
{
final OSCConfiguration conf = this.surface.getConfiguration ();
final String command = getSubCommand (path);
switch (com... | void function (final LinkedList<String> path, final Object value) throws IllegalParameterException, UnknownCommandException, MissingCommandException { final OSCConfiguration conf = this.surface.getConfiguration (); final String command = getSubCommand (path); switch (command) { case STR: final int numValue = toInteger ... | /**
* Parse virtual MIDI note commands.
*
* @param path The rest of the path
* @param value The value
* @throws MissingCommandException Could not find the sub-command
* @throws UnknownCommandException Unknown sub-command
* @throws IllegalParameterException Added an illegal para... | Parse virtual MIDI note commands | parseMidi | {
"repo_name": "git-moss/DrivenByMoss",
"path": "src/main/java/de/mossgrabers/controller/osc/module/MidiModule.java",
"license": "lgpl-3.0",
"size": 13694
} | [
"de.mossgrabers.controller.osc.OSCConfiguration",
"de.mossgrabers.controller.osc.exception.IllegalParameterException",
"de.mossgrabers.controller.osc.exception.MissingCommandException",
"de.mossgrabers.controller.osc.exception.UnknownCommandException",
"de.mossgrabers.framework.daw.midi.IMidiInput",
"de.m... | import de.mossgrabers.controller.osc.OSCConfiguration; import de.mossgrabers.controller.osc.exception.IllegalParameterException; import de.mossgrabers.controller.osc.exception.MissingCommandException; import de.mossgrabers.controller.osc.exception.UnknownCommandException; import de.mossgrabers.framework.daw.midi.IMidiI... | import de.mossgrabers.controller.osc.*; import de.mossgrabers.controller.osc.exception.*; import de.mossgrabers.framework.daw.midi.*; import de.mossgrabers.framework.scale.*; import java.util.*; | [
"de.mossgrabers.controller",
"de.mossgrabers.framework",
"java.util"
] | de.mossgrabers.controller; de.mossgrabers.framework; java.util; | 1,456,760 |
@GET
@Path("compilation-unit")
@Produces("application/json")
public CompilationUnit getCompilationUnit(@QueryParam("projectpath") String projectPath,
@QueryParam("fqn") String fqn,
@QueryParam("showinherited") bo... | @Path(STR) @Produces(STR) CompilationUnit function(@QueryParam(STR) String projectPath, @QueryParam("fqn") String fqn, @QueryParam(STR) boolean showInherited) throws JavaModelException { IJavaProject project = MODEL.getJavaProject(projectPath); return navigation.getCompilationUnitByPath(project, fqn, showInherited); } | /**
* Create compilation unit model for the opened java class.
*
* @param projectPath
* path to the project which is contained class file
* @param fqn
* fully qualified name of the class file
* @param showInherited
* <code>true</code> iff inherited members... | Create compilation unit model for the opened java class | getCompilationUnit | {
"repo_name": "dhuebner/che",
"path": "plugins/plugin-java/che-plugin-java-ext-jdt/che-jdt-ext-machine/src/main/java/org/eclipse/che/jdt/rest/JavaNavigationService.java",
"license": "epl-1.0",
"size": 6716
} | [
"javax.ws.rs.Path",
"javax.ws.rs.Produces",
"javax.ws.rs.QueryParam",
"org.eclipse.che.ide.ext.java.shared.dto.model.CompilationUnit",
"org.eclipse.jdt.core.IJavaProject",
"org.eclipse.jdt.core.JavaModelException"
] | import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import org.eclipse.che.ide.ext.java.shared.dto.model.CompilationUnit; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.JavaModelException; | import javax.ws.rs.*; import org.eclipse.che.ide.ext.java.shared.dto.model.*; import org.eclipse.jdt.core.*; | [
"javax.ws",
"org.eclipse.che",
"org.eclipse.jdt"
] | javax.ws; org.eclipse.che; org.eclipse.jdt; | 182,785 |
protected ZipFile container()
throws Exception
{
if ( this.isInArchive() )
return this.getParent().archive() ;
else
return null ;
} // container()
// ------------------------------------------------------------------------- | ZipFile function() throws Exception { if ( this.isInArchive() ) return this.getParent().archive() ; else return null ; } | /**
* Returns the zip file which is presented by the parent container
* or null in any case of error.
*/ | Returns the zip file which is presented by the parent container or null in any case of error | container | {
"repo_name": "AcademicTorrents/AcademicTorrents-Downloader",
"path": "vuze/org/pf/file/FileLocator.java",
"license": "gpl-2.0",
"size": 18536
} | [
"java.util.zip.ZipFile"
] | import java.util.zip.ZipFile; | import java.util.zip.*; | [
"java.util"
] | java.util; | 112,009 |
public List<PolicyDefinitionSummaryBean> listPolicyDefinitions() throws StorageException; | List<PolicyDefinitionSummaryBean> function() throws StorageException; | /**
* Lists the policy definitions in the system.
* @return list of policy definitions
* @throws StorageException if a storage problem occurs while storing a bean.
*/ | Lists the policy definitions in the system | listPolicyDefinitions | {
"repo_name": "KevinHorvatin/apiman",
"path": "manager/api/core/src/main/java/io/apiman/manager/api/core/IStorageQuery.java",
"license": "apache-2.0",
"size": 12577
} | [
"io.apiman.manager.api.beans.summary.PolicyDefinitionSummaryBean",
"io.apiman.manager.api.core.exceptions.StorageException",
"java.util.List"
] | import io.apiman.manager.api.beans.summary.PolicyDefinitionSummaryBean; import io.apiman.manager.api.core.exceptions.StorageException; import java.util.List; | import io.apiman.manager.api.beans.summary.*; import io.apiman.manager.api.core.exceptions.*; import java.util.*; | [
"io.apiman.manager",
"java.util"
] | io.apiman.manager; java.util; | 2,380,080 |
EOperation getPMUVoltageMeter__IsAppropriate_FWD_EMoflonEdge_36__EMoflonEdge(); | EOperation getPMUVoltageMeter__IsAppropriate_FWD_EMoflonEdge_36__EMoflonEdge(); | /**
* Returns the meta object for the '{@link rgse.ttc17.emoflon.tgg.task2.Rules.PMUVoltageMeter#isAppropriate_FWD_EMoflonEdge_36(org.moflon.tgg.runtime.EMoflonEdge) <em>Is Appropriate FWD EMoflon Edge 36</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the '<em>... | Returns the meta object for the '<code>rgse.ttc17.emoflon.tgg.task2.Rules.PMUVoltageMeter#isAppropriate_FWD_EMoflonEdge_36(org.moflon.tgg.runtime.EMoflonEdge) Is Appropriate FWD EMoflon Edge 36</code>' operation. | getPMUVoltageMeter__IsAppropriate_FWD_EMoflonEdge_36__EMoflonEdge | {
"repo_name": "georghinkel/ttc2017smartGrids",
"path": "solutions/eMoflon/rgse.ttc17.emoflon.tgg.task2/gen/rgse/ttc17/emoflon/tgg/task2/Rules/RulesPackage.java",
"license": "mit",
"size": 437406
} | [
"org.eclipse.emf.ecore.EOperation"
] | import org.eclipse.emf.ecore.EOperation; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,727,939 |
EReference getModelTurbsimtbs_Location(); | EReference getModelTurbsimtbs_Location(); | /**
* Returns the meta object for the containment reference '{@link sc.ndt.editor.turbsimtbs.ModelTurbsimtbs#getLocation <em>Location</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Location</em>'.
* @see sc.ndt.editor.turbsimtbs.Mode... | Returns the meta object for the containment reference '<code>sc.ndt.editor.turbsimtbs.ModelTurbsimtbs#getLocation Location</code>'. | getModelTurbsimtbs_Location | {
"repo_name": "cooked/NDT",
"path": "sc.ndt.editor.turbsim.tbs/src-gen/sc/ndt/editor/turbsimtbs/TurbsimtbsPackage.java",
"license": "gpl-3.0",
"size": 204585
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 786,089 |
@MBeanOperation(name="resetStatistics",
description="Resets all message and data statistics for the virtual host",
impact= MBeanOperationInfo.ACTION)
void resetStatistics() throws Exception; | @MBeanOperation(name=STR, description=STR, impact= MBeanOperationInfo.ACTION) void resetStatistics() throws Exception; | /**
* Resets all message and data statistics for the virtual host.
*
* @since Qpid JMX API 2.2
*/ | Resets all message and data statistics for the virtual host | resetStatistics | {
"repo_name": "ChamNDeSilva/andes",
"path": "modules/andes-core/management/common/src/main/java/org/wso2/andes/management/common/mbeans/ManagedBroker.java",
"license": "apache-2.0",
"size": 10394
} | [
"javax.management.MBeanOperationInfo",
"org.wso2.andes.management.common.mbeans.annotations.MBeanOperation"
] | import javax.management.MBeanOperationInfo; import org.wso2.andes.management.common.mbeans.annotations.MBeanOperation; | import javax.management.*; import org.wso2.andes.management.common.mbeans.annotations.*; | [
"javax.management",
"org.wso2.andes"
] | javax.management; org.wso2.andes; | 1,064,116 |
Builder addProperty(String name, SchemaOrgType value); | Builder addProperty(String name, SchemaOrgType value); | /**
* Add a value to property.
*
* @param name The property name.
* @param value The value of the property.
*/ | Add a value to property | addProperty | {
"repo_name": "google/schemaorg-java",
"path": "src/main/java/com/google/schemaorg/core/AssignAction.java",
"license": "apache-2.0",
"size": 8776
} | [
"com.google.schemaorg.SchemaOrgType"
] | import com.google.schemaorg.SchemaOrgType; | import com.google.schemaorg.*; | [
"com.google.schemaorg"
] | com.google.schemaorg; | 155,581 |
// get a soffice factory object
SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
try {
log.println( "creating a chartdocument" );
XComponent xComp = SOF.loadDocument(
utils.getFullTestURL("TransparencyChart.sxs"... | SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF()); try { log.println( STR ); XComponent xComp = SOF.loadDocument( utils.getFullTestURL(STR)); xChartDoc = UnoRuntime.queryInterface(XChartDocument.class,xComp); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); throw n... | /**
* Creates Chart document.
*/ | Creates Chart document | initialize | {
"repo_name": "qt-haiku/LibreOffice",
"path": "qadevOOo/tests/java/mod/_sch/ChartLegend.java",
"license": "gpl-3.0",
"size": 4759
} | [
"com.sun.star.chart.XChartDocument",
"com.sun.star.lang.XComponent",
"com.sun.star.lang.XMultiServiceFactory",
"com.sun.star.uno.UnoRuntime"
] | import com.sun.star.chart.XChartDocument; import com.sun.star.lang.XComponent; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; | import com.sun.star.chart.*; import com.sun.star.lang.*; import com.sun.star.uno.*; | [
"com.sun.star"
] | com.sun.star; | 1,280,260 |
@SuppressWarnings("unchecked")
private static Collection<Object> callGetUrls(final Object container, final String methodName) {
if (container != null) {
try {
final Collection<Object> results = (Collection<Object>) ReflectionUtils.invokeMethod(false,
c... | @SuppressWarnings(STR) static Collection<Object> function(final Object container, final String methodName) { if (container != null) { try { final Collection<Object> results = (Collection<Object>) ReflectionUtils.invokeMethod(false, container, methodName); if (results != null && !results.isEmpty()) { final Collection<Ob... | /**
* Utility to call a "getURLs" method, flattening "collections of collections" and ignoring
* "UnsupportedOperationException".
*
* All of the "getURLs" methods eventually call "com.ibm.wsspi.adaptable.module.Container#getURLs()".
*
* https://www.ibm.com/support/knowledgecenter/SSEQTP_... | Utility to call a "getURLs" method, flattening "collections of collections" and ignoring "UnsupportedOperationException". All of the "getURLs" methods eventually call "com.ibm.wsspi.adaptable.module.Container#getURLs()". HREF com.ibm.websphere.appserver.spi.artifact_1.2-javadoc com/ibm/wsspi/adaptable/module/Container.... | callGetUrls | {
"repo_name": "classgraph/classgraph",
"path": "src/main/java/nonapi/io/github/classgraph/classloaderhandler/WebsphereLibertyClassLoaderHandler.java",
"license": "mit",
"size": 10647
} | [
"java.util.Collection",
"java.util.Collections",
"java.util.HashSet"
] | import java.util.Collection; import java.util.Collections; import java.util.HashSet; | import java.util.*; | [
"java.util"
] | java.util; | 319,229 |
public void doDone_preview_new_assignment(RunData data)
{
SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid());
// back to the new assignment page
state.setAttribute(STATE_MODE, MODE_INSTRUCTOR_NEW_EDIT_ASSIGNMENT);
} // doDone_preview_new_assignment | void function(RunData data) { SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid()); state.setAttribute(STATE_MODE, MODE_INSTRUCTOR_NEW_EDIT_ASSIGNMENT); } | /**
* Action is to end the preview new assignment process
*/ | Action is to end the preview new assignment process | doDone_preview_new_assignment | {
"repo_name": "lorenamgUMU/sakai",
"path": "assignment/assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java",
"license": "apache-2.0",
"size": 677150
} | [
"org.sakaiproject.cheftool.JetspeedRunData",
"org.sakaiproject.cheftool.RunData",
"org.sakaiproject.event.api.SessionState"
] | import org.sakaiproject.cheftool.JetspeedRunData; import org.sakaiproject.cheftool.RunData; import org.sakaiproject.event.api.SessionState; | import org.sakaiproject.cheftool.*; import org.sakaiproject.event.api.*; | [
"org.sakaiproject.cheftool",
"org.sakaiproject.event"
] | org.sakaiproject.cheftool; org.sakaiproject.event; | 868,557 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.