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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
@Test
public final void testReadUntilCRNoCR() {
// Setup the resources for the test.
byte[] contents = new byte[]{0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x06, 0x07, 0x08};
ByteArrayInputStream in = new ByteArrayInputStream(contents);
// Call the method under test.
byte[] result = ByteUtils.readUntilCR(in)... | final void function() { byte[] contents = new byte[]{0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x06, 0x07, 0x08}; ByteArrayInputStream in = new ByteArrayInputStream(contents); byte[] result = ByteUtils.readUntilCR(in); assertThat(STR, result, is(equalTo(contents))); assertThat(STR, in.available(), is(equalTo(0))); } | /**
* Test method for {@link com.digi.xbee.api.utils.ByteUtils#readUntilCR(ByteArrayInputStream)}.
*/ | Test method for <code>com.digi.xbee.api.utils.ByteUtils#readUntilCR(ByteArrayInputStream)</code> | testReadUntilCRNoCR | {
"repo_name": "digidotcom/XBeeJavaLibrary",
"path": "library/src/test/java/com/digi/xbee/api/utils/ByteUtilsTest.java",
"license": "mpl-2.0",
"size": 36318
} | [
"java.io.ByteArrayInputStream",
"org.hamcrest.core.Is",
"org.junit.Assert"
] | import java.io.ByteArrayInputStream; import org.hamcrest.core.Is; import org.junit.Assert; | import java.io.*; import org.hamcrest.core.*; import org.junit.*; | [
"java.io",
"org.hamcrest.core",
"org.junit"
] | java.io; org.hamcrest.core; org.junit; | 379,686 |
public Cursor fetch(Long ruleID) {
if (ruleID == null) {
throw new IllegalArgumentException("primary key null.");
}
// Set selectionArgs, groupBy, having, orderBy and limit to be null.
Cursor mCursor = database.query(true, DATABASE_TABLE, KEYS, KEY_RULEID + "=" + ruleID, null,
null, null... | Cursor function(Long ruleID) { if (ruleID == null) { throw new IllegalArgumentException(STR); } Cursor mCursor = database.query(true, DATABASE_TABLE, KEYS, KEY_RULEID + "=" + ruleID, null, null, null, null, null); if (mCursor != null) { mCursor.moveToFirst(); } return mCursor; } | /**
* Return a Cursor pointing to the record matches the ruleID.
*
* @param ruleID
* is the id of the record to be fetched.
* @return a Cursor pointing to the found record.
* @throws IllegalArgumentException
* if ruleID is null
*/ | Return a Cursor pointing to the record matches the ruleID | fetch | {
"repo_name": "joelmap/omnidroid",
"path": "omnidroid/src/edu/nyu/cs/omnidroid/app/model/db/RuleDbAdapter.java",
"license": "apache-2.0",
"size": 10075
} | [
"android.database.Cursor"
] | import android.database.Cursor; | import android.database.*; | [
"android.database"
] | android.database; | 402,240 |
public static String getHostnameReal() {
// In case we don't want to leave anything to doubt...
//
String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME );
if ( !Utils.isEmpty( systemHostname ) ) {
return systemHostname;
}
if ( isWindows() ) {
// Windows will ... | static String function() { if ( !Utils.isEmpty( systemHostname ) ) { return systemHostname; } if ( isWindows() ) { return System.getenv( STR ); } else { String hostname = System.getenv( STR ); if ( hostname != null ) { return hostname; } else { BufferedReader br; try { Process pr = Runtime.getRuntime().exec( STR ); br ... | /**
* Determine the hostname of the machine Kettle is running on
*
* @return The hostname
*/ | Determine the hostname of the machine Kettle is running on | getHostnameReal | {
"repo_name": "HiromuHota/pentaho-kettle",
"path": "core/src/main/java/org/pentaho/di/core/Const.java",
"license": "apache-2.0",
"size": 124749
} | [
"java.io.BufferedReader",
"java.io.IOException",
"java.io.InputStreamReader",
"org.pentaho.di.core.util.Utils"
] | import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import org.pentaho.di.core.util.Utils; | import java.io.*; import org.pentaho.di.core.util.*; | [
"java.io",
"org.pentaho.di"
] | java.io; org.pentaho.di; | 2,349,969 |
private Duration getPerformanceChangetime() {
return Duration.ofMinutes(params.getPerformanceChangetimeMinutes());
} | Duration function() { return Duration.ofMinutes(params.getPerformanceChangetimeMinutes()); } | /**
* The time required between performance runs.
*/ | The time required between performance runs | getPerformanceChangetime | {
"repo_name": "jpschewe/fll-sw",
"path": "src/main/java/fll/scheduler/ScheduleChecker.java",
"license": "gpl-2.0",
"size": 25449
} | [
"java.time.Duration"
] | import java.time.Duration; | import java.time.*; | [
"java.time"
] | java.time; | 1,365,275 |
interface WithLocalNetworkGateway2 {
Update withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2);
} | interface WithLocalNetworkGateway2 { Update withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2); } | /**
* Specifies localNetworkGateway2.
* @param localNetworkGateway2 The reference to local network gateway resource
* @return the next update stage
*/ | Specifies localNetworkGateway2 | withLocalNetworkGateway2 | {
"repo_name": "navalev/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/VirtualNetworkGatewayConnection.java",
"license": "mit",
"size": 19274
} | [
"com.microsoft.azure.management.network.v2018_12_01.implementation.LocalNetworkGatewayInner"
] | import com.microsoft.azure.management.network.v2018_12_01.implementation.LocalNetworkGatewayInner; | import com.microsoft.azure.management.network.v2018_12_01.implementation.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 877,642 |
public Builder currency(Currency currency) {
JodaBeanUtils.notNull(currency, "currency");
this.currency = currency;
return this;
} | Builder function(Currency currency) { JodaBeanUtils.notNull(currency, STR); this.currency = currency; return this; } | /**
* Sets the currency that the future is traded in.
* @param currency the new value, not null
* @return this, for chaining, not null
*/ | Sets the currency that the future is traded in | currency | {
"repo_name": "jmptrader/Strata",
"path": "modules/product/src/main/java/com/opengamma/strata/product/bond/BondFutureSecurity.java",
"license": "apache-2.0",
"size": 38183
} | [
"com.opengamma.strata.basics.currency.Currency",
"org.joda.beans.JodaBeanUtils"
] | import com.opengamma.strata.basics.currency.Currency; import org.joda.beans.JodaBeanUtils; | import com.opengamma.strata.basics.currency.*; import org.joda.beans.*; | [
"com.opengamma.strata",
"org.joda.beans"
] | com.opengamma.strata; org.joda.beans; | 1,545,939 |
public void addURL(URL url) {
if (!Arrays.asList(getURLs()).contains(url))
super.addURL(url);
} | void function(URL url) { if (!Arrays.asList(getURLs()).contains(url)) super.addURL(url); } | /**
* Appends the specified URL to the list of URLs to search for classes and
* resources.
*/ | Appends the specified URL to the list of URLs to search for classes and resources | addURL | {
"repo_name": "andreagenso/java2scala",
"path": "test/J2s/java/openjdk-6-src-b27/jdk/src/share/classes/javax/management/loading/MLet.java",
"license": "apache-2.0",
"size": 55869
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 2,382,011 |
public IEditView getView(); | IEditView function(); | /**
* return view
*
* @return the view
*/ | return view | getView | {
"repo_name": "AKSW/LIMES-dev",
"path": "limes-gui/src/main/java/org/aksw/limes/core/gui/controller/IEditController.java",
"license": "gpl-3.0",
"size": 1552
} | [
"org.aksw.limes.core.gui.view.IEditView"
] | import org.aksw.limes.core.gui.view.IEditView; | import org.aksw.limes.core.gui.view.*; | [
"org.aksw.limes"
] | org.aksw.limes; | 1,944,596 |
public static HashMap<String, HashMap<String, Float>> getAllHypotheses(
Network bn) throws ShanksException {
HashMap<String, HashMap<String, Float>> result = new HashMap<String, HashMap<String, Float>>();
for (int node : bn.getAllNodes()) {
String nodeName = bn.getNodeName(no... | static HashMap<String, HashMap<String, Float>> function( Network bn) throws ShanksException { HashMap<String, HashMap<String, Float>> result = new HashMap<String, HashMap<String, Float>>(); for (int node : bn.getAllNodes()) { String nodeName = bn.getNodeName(node); HashMap<String, Float> hypotheses = ShanksAgentBayesia... | /**
* To know all values of all nodes of the Bayesian network
*
* @param bn
* @return hashmap in format [node, [status, hypothesis]]
* @throws UnknownNodeException
*/ | To know all values of all nodes of the Bayesian network | getAllHypotheses | {
"repo_name": "gsi-upm/Shanks",
"path": "shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/reasoning/bayes/smile/ShanksAgentBayesianReasoningCapability.java",
"license": "gpl-2.0",
"size": 25021
} | [
"es.upm.dit.gsi.shanks.exception.ShanksException",
"java.util.HashMap"
] | import es.upm.dit.gsi.shanks.exception.ShanksException; import java.util.HashMap; | import es.upm.dit.gsi.shanks.exception.*; import java.util.*; | [
"es.upm.dit",
"java.util"
] | es.upm.dit; java.util; | 1,256,749 |
@Override
public int deleteCharacters(Uri uri,
String selection,
String[] selectionArgs) {
// Expand the selection if necessary.
selection = addSelectionArgs(selection,
selectionArgs,
... | int function(Uri uri, String selection, String[] selectionArgs) { selection = addSelectionArgs(selection, selectionArgs, STR); return mOpenHelper.getWritableDatabase().delete (CharacterContract.CharacterEntry.TABLE_NAME, selection, selectionArgs); } | /**
* Method called to handle delete requests from client
* applications. This plays the role of the "concrete hook
* method" in the Template Method pattern.
*/ | Method called to handle delete requests from client applications. This plays the role of the "concrete hook method" in the Template Method pattern | deleteCharacters | {
"repo_name": "bravenoob/mobilecloud-15",
"path": "ex/HobbitContentProvider/src/vandy/mooc/model/HobbitProviderSQLite.java",
"license": "apache-2.0",
"size": 10388
} | [
"android.net.Uri"
] | import android.net.Uri; | import android.net.*; | [
"android.net"
] | android.net; | 2,229,950 |
public void insert_boolean(boolean _0)
throws TypeMismatch, InvalidValue
{
throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
} | void function(boolean _0) throws TypeMismatch, InvalidValue { throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); } | /**
* The remote call of DynAny methods is not possible.
*
* @throws MARSHAL, always.
*/ | The remote call of DynAny methods is not possible | insert_boolean | {
"repo_name": "SanDisk-Open-Source/SSD_Dashboard",
"path": "uefi/gcc/gcc-4.6.3/libjava/classpath/org/omg/DynamicAny/_DynUnionStub.java",
"license": "gpl-2.0",
"size": 16960
} | [
"org.omg.DynamicAny"
] | import org.omg.DynamicAny; | import org.omg.*; | [
"org.omg"
] | org.omg; | 1,584,965 |
public FSDataOutputStream create(Path f,
FsPermission permission,
EnumSet<CreateFlag> flags,
int bufferSize,
short replication,
long blockSize,
Progressable progress) throws IOException {
return create(f, permission, flags, bufferSize, replication,
blockSize, progress, ... | FSDataOutputStream function(Path f, FsPermission permission, EnumSet<CreateFlag> flags, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException { return create(f, permission, flags, bufferSize, replication, blockSize, progress, null); } | /**
* Create an FSDataOutputStream at the indicated Path with write-progress
* reporting.
* @param f the file name to open
* @param permission
* @param flags {@link CreateFlag}s to use for this stream.
* @param bufferSize the size of the buffer to be used.
* @param replication required block replic... | Create an FSDataOutputStream at the indicated Path with write-progress reporting | create | {
"repo_name": "wankunde/cloudera_hadoop",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java",
"license": "apache-2.0",
"size": 111812
} | [
"java.io.IOException",
"java.util.EnumSet",
"org.apache.hadoop.fs.permission.FsPermission",
"org.apache.hadoop.util.Progressable"
] | import java.io.IOException; import java.util.EnumSet; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.util.Progressable; | import java.io.*; import java.util.*; import org.apache.hadoop.fs.permission.*; import org.apache.hadoop.util.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 900,807 |
public OvhTask serviceName_envVar_POST(String serviceName, String key, net.minidev.ovh.api.hosting.web.envvar.OvhTypeEnum type, String value) throws IOException {
String qPath = "/hosting/web/{serviceName}/envVar";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Obje... | OvhTask function(String serviceName, String key, net.minidev.ovh.api.hosting.web.envvar.OvhTypeEnum type, String value) throws IOException { String qPath = STR; StringBuilder sb = path(qPath, serviceName); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "key", key); addBody(o, "type", type); addBod... | /**
* Set a variable to this hosting
*
* REST: POST /hosting/web/{serviceName}/envVar
* @param type [required] Type of variable set
* @param value [required] Value of the variable
* @param key [required] Name of the new variable
* @param serviceName [required] The internal name of your hosting
*/ | Set a variable to this hosting | serviceName_envVar_POST | {
"repo_name": "UrielCh/ovh-java-sdk",
"path": "ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java",
"license": "bsd-3-clause",
"size": 99470
} | [
"java.io.IOException",
"java.util.HashMap",
"net.minidev.ovh.api.hosting.web.OvhTask",
"net.minidev.ovh.api.hosting.web.backup.OvhTypeEnum"
] | import java.io.IOException; import java.util.HashMap; import net.minidev.ovh.api.hosting.web.OvhTask; import net.minidev.ovh.api.hosting.web.backup.OvhTypeEnum; | import java.io.*; import java.util.*; import net.minidev.ovh.api.hosting.web.*; import net.minidev.ovh.api.hosting.web.backup.*; | [
"java.io",
"java.util",
"net.minidev.ovh"
] | java.io; java.util; net.minidev.ovh; | 318,215 |
@Test
public void test01PeriodicSyncOnCreate() {
KeycloakSession session = keycloakRule.startSession();
KeycloakSessionFactory sessionFactory = session.getKeycloakSessionFactory();
DummyUserFederationProviderFactory dummyFedFactory = (DummyUserFederationProviderFactory) sessionFactory.g... | void function() { KeycloakSession session = keycloakRule.startSession(); KeycloakSessionFactory sessionFactory = session.getKeycloakSessionFactory(); DummyUserFederationProviderFactory dummyFedFactory = (DummyUserFederationProviderFactory) sessionFactory.getProviderFactory(UserStorageProvider.class, DummyUserFederation... | /**
* Test that period sync is triggered when creating a synchronized User Storage Provider
*
*/ | Test that period sync is triggered when creating a synchronized User Storage Provider | test01PeriodicSyncOnCreate | {
"repo_name": "almighty/keycloak",
"path": "testsuite/integration/src/test/java/org/keycloak/testsuite/federation/sync/SyncFederationTest.java",
"license": "apache-2.0",
"size": 13705
} | [
"org.keycloak.models.KeycloakSession",
"org.keycloak.models.KeycloakSessionFactory",
"org.keycloak.storage.UserStorageProvider",
"org.keycloak.testsuite.federation.DummyUserFederationProviderFactory",
"org.keycloak.testsuite.rule.KeycloakRule"
] | import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; import org.keycloak.storage.UserStorageProvider; import org.keycloak.testsuite.federation.DummyUserFederationProviderFactory; import org.keycloak.testsuite.rule.KeycloakRule; | import org.keycloak.models.*; import org.keycloak.storage.*; import org.keycloak.testsuite.federation.*; import org.keycloak.testsuite.rule.*; | [
"org.keycloak.models",
"org.keycloak.storage",
"org.keycloak.testsuite"
] | org.keycloak.models; org.keycloak.storage; org.keycloak.testsuite; | 2,114,769 |
JSModule getModule();
}
private static enum SymbolType {
PROPERTY,
VAR
}
static class GlobalFunction implements Symbol {
private final Node nameNode;
private final Var var;
private final JSModule module;
GlobalFunction(Node nameNode, Var var, JSModule module) {
Node paren... | JSModule getModule(); } private static enum SymbolType { PROPERTY, VAR } static class GlobalFunction implements Symbol { private final Node nameNode; private final Var var; private final JSModule module; GlobalFunction(Node nameNode, Var var, JSModule module) { Node parent = nameNode.getParent(); Preconditions.checkSta... | /**
* Returns the module where this appears.
*/ | Returns the module where this appears | getModule | {
"repo_name": "anneupsc/closure-compiler",
"path": "src/com/google/javascript/jscomp/AnalyzePrototypeProperties.java",
"license": "apache-2.0",
"size": 27348
} | [
"com.google.common.base.Preconditions",
"com.google.javascript.rhino.Node"
] | import com.google.common.base.Preconditions; import com.google.javascript.rhino.Node; | import com.google.common.base.*; import com.google.javascript.rhino.*; | [
"com.google.common",
"com.google.javascript"
] | com.google.common; com.google.javascript; | 2,691,322 |
public List<User> findAll(); | List<User> function(); | /**
* Find all.
*
* @return the list
*/ | Find all | findAll | {
"repo_name": "Rajith2012204/The-First-Credit",
"path": "Code/fc-suite/fc-core/src/main/java/com/nr/fc/service/user/UserService.java",
"license": "gpl-3.0",
"size": 2683
} | [
"com.nr.fc.model.User",
"java.util.List"
] | import com.nr.fc.model.User; import java.util.List; | import com.nr.fc.model.*; import java.util.*; | [
"com.nr.fc",
"java.util"
] | com.nr.fc; java.util; | 2,521,222 |
@Override
public Request<DisassociateAddressRequest> getDryRunRequest() {
Request<DisassociateAddressRequest> request = new DisassociateAddressRequestMarshaller().marshall(this);
request.addParameter("DryRun", Boolean.toString(true));
return request;
} | Request<DisassociateAddressRequest> function() { Request<DisassociateAddressRequest> request = new DisassociateAddressRequestMarshaller().marshall(this); request.addParameter(STR, Boolean.toString(true)); return request; } | /**
* This method is intended for internal use only. Returns the marshaled request configured with additional
* parameters to enable operation dry-run.
*/ | This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run | getDryRunRequest | {
"repo_name": "aws/aws-sdk-java",
"path": "aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/DisassociateAddressRequest.java",
"license": "apache-2.0",
"size": 6475
} | [
"com.amazonaws.Request",
"com.amazonaws.services.ec2.model.transform.DisassociateAddressRequestMarshaller"
] | import com.amazonaws.Request; import com.amazonaws.services.ec2.model.transform.DisassociateAddressRequestMarshaller; | import com.amazonaws.*; import com.amazonaws.services.ec2.model.transform.*; | [
"com.amazonaws",
"com.amazonaws.services"
] | com.amazonaws; com.amazonaws.services; | 932,873 |
public char next() throws JSONException {
int c;
if(this.usePrevious) {
this.usePrevious = false;
c = this.previous;
} else {
try {
c = this.reader.read();
} catch(IOException exception) {
throw new JSONException(exception);
}
if(c <= 0) { // End of stream
this.eof = true;
c ... | char function() throws JSONException { int c; if(this.usePrevious) { this.usePrevious = false; c = this.previous; } else { try { c = this.reader.read(); } catch(IOException exception) { throw new JSONException(exception); } if(c <= 0) { this.eof = true; c = 0; } } this.index += 1; if(this.previous == '\r') { this.line ... | /**
* Get the next character in the source string.
*
* @return The next character, or 0 if past the end of the source string.
*/ | Get the next character in the source string | next | {
"repo_name": "GreenCubes/VersionGenerator",
"path": "src/org/json/JSONTokener.java",
"license": "mit",
"size": 10788
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,801,319 |
public static void combinarRegistros(List<BusLlegada> busesList) {
if (busesList == null) {
return;
}
for (int i = 0; i < busesList.size(); i++) {
for (int j = 0; j < busesList.size(); j++) {
if (i != j && busesList.get(i).getLinea().equals(busesList... | static void function(List<BusLlegada> busesList) { if (busesList == null) { return; } for (int i = 0; i < busesList.size(); i++) { for (int j = 0; j < busesList.size(); j++) { if (i != j && busesList.get(i).getLinea().equals(busesList.get(j).getLinea()) && busesList.get(i).getDestino().equals(busesList.get(j).getDestin... | /**
* Combinar los registros cuando llegan duplicados
*
* @param busesList
*/ | Combinar los registros cuando llegan duplicados | combinarRegistros | {
"repo_name": "alberapps/tiempobus",
"path": "TiempoBus/src/alberapps/java/tam/ProcesarTiemposService.java",
"license": "gpl-3.0",
"size": 6976
} | [
"android.util.Log",
"java.util.List"
] | import android.util.Log; import java.util.List; | import android.util.*; import java.util.*; | [
"android.util",
"java.util"
] | android.util; java.util; | 1,860,074 |
protected IndexShard newShard(ShardId shardId, boolean primary, String nodeId, IndexMetaData indexMetaData,
Runnable globalCheckpointSyncer,
@Nullable IndexSearcherWrapper searcherWrapper) throws IOException {
ShardRouting shardRouting = Te... | IndexShard function(ShardId shardId, boolean primary, String nodeId, IndexMetaData indexMetaData, Runnable globalCheckpointSyncer, @Nullable IndexSearcherWrapper searcherWrapper) throws IOException { ShardRouting shardRouting = TestShardRouting.newShardRouting(shardId, nodeId, primary, ShardRoutingState.INITIALIZING, p... | /**
* creates a new initializing shard. The shard will will be put in its proper path under the
* supplied node id.
*
* @param shardId the shard id to use
* @param primary indicates whether to a primary shard (ready to recover from an empty store) or a replica
* (ready to re... | creates a new initializing shard. The shard will will be put in its proper path under the supplied node id | newShard | {
"repo_name": "LeoYao/elasticsearch",
"path": "test/framework/src/main/java/org/elasticsearch/index/shard/IndexShardTestCase.java",
"license": "apache-2.0",
"size": 25542
} | [
"java.io.IOException",
"org.elasticsearch.cluster.metadata.IndexMetaData",
"org.elasticsearch.cluster.routing.RecoverySource",
"org.elasticsearch.cluster.routing.ShardRouting",
"org.elasticsearch.cluster.routing.ShardRoutingState",
"org.elasticsearch.cluster.routing.TestShardRouting",
"org.elasticsearch... | import java.io.IOException; import org.elasticsearch.cluster.metadata.IndexMetaData; import org.elasticsearch.cluster.routing.RecoverySource; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.ShardRoutingState; import org.elasticsearch.cluster.routing.TestShardRouting; impo... | import java.io.*; import org.elasticsearch.cluster.metadata.*; import org.elasticsearch.cluster.routing.*; import org.elasticsearch.common.*; | [
"java.io",
"org.elasticsearch.cluster",
"org.elasticsearch.common"
] | java.io; org.elasticsearch.cluster; org.elasticsearch.common; | 2,241,229 |
public List<FeedbackSessionAttributes> getFeedbackSessionsWhichNeedAutomatedPublishedEmailsToBeSent() {
return feedbackSessionsLogic.getFeedbackSessionsWhichNeedAutomatedPublishedEmailsToBeSent();
} | List<FeedbackSessionAttributes> function() { return feedbackSessionsLogic.getFeedbackSessionsWhichNeedAutomatedPublishedEmailsToBeSent(); } | /**
* Returns a list of sessions that require automated emails to be sent as they are published.
*
* @see FeedbackSessionsLogic#getFeedbackSessionsWhichNeedAutomatedPublishedEmailsToBeSent()
*/ | Returns a list of sessions that require automated emails to be sent as they are published | getFeedbackSessionsWhichNeedAutomatedPublishedEmailsToBeSent | {
"repo_name": "thenaesh/teammates",
"path": "src/main/java/teammates/logic/api/Logic.java",
"license": "gpl-2.0",
"size": 87996
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 602,726 |
public void sendUTF8(SocketAddress addr, String str)
throws IOException {
send(addr, str.getBytes(StandardCharsets.UTF_8), null);
} | void function(SocketAddress addr, String str) throws IOException { send(addr, str.getBytes(StandardCharsets.UTF_8), null); } | /**
* Wrapper for {@link #send(DatagramSocket, SocketAddress, byte[]) send} to
* send strings that will be encoded into UTF-8
*
* @param addr address of the host to send the data to
* @param str string to send
* @throws IOException if an I/O exception occurs
*/ | Wrapper for <code>#send(DatagramSocket, SocketAddress, byte[]) send</code> to send strings that will be encoded into UTF-8 | sendUTF8 | {
"repo_name": "wheerdam/javatools",
"path": "src/org/bbi/net/SockUDP.java",
"license": "apache-2.0",
"size": 32620
} | [
"java.io.IOException",
"java.net.SocketAddress",
"java.nio.charset.StandardCharsets"
] | import java.io.IOException; import java.net.SocketAddress; import java.nio.charset.StandardCharsets; | import java.io.*; import java.net.*; import java.nio.charset.*; | [
"java.io",
"java.net",
"java.nio"
] | java.io; java.net; java.nio; | 2,544,200 |
protected boolean getLock(InputCursor... cursors){
int locked = 0;
for (InputCursor m : cursors) {
if (m.getLock(this)) {
locked++;
}
}
return locked == cursors.length;
}
| boolean function(InputCursor... cursors){ int locked = 0; for (InputCursor m : cursors) { if (m.getLock(this)) { locked++; } } return locked == cursors.length; } | /**
* Locks the cursor with this processor if the processors lock priority
* is higher or equal than the current lock priority of this cursor.
*
* @param cursors the cursors
*
* @return true, if all specified cursors could get locked
*/ | Locks the cursor with this processor if the processors lock priority is higher or equal than the current lock priority of this cursor | getLock | {
"repo_name": "rogiermars/mt4j-core",
"path": "src/org/mt4j/input/inputProcessors/componentProcessors/AbstractCursorProcessor.java",
"license": "gpl-2.0",
"size": 22865
} | [
"org.mt4j.input.inputData.InputCursor"
] | import org.mt4j.input.inputData.InputCursor; | import org.mt4j.input.*; | [
"org.mt4j.input"
] | org.mt4j.input; | 758,871 |
public Gen<String> numericBetween(int startInclusive,
int endInclusive) {
ArgumentAssertions.checkArguments(startInclusive <= endInclusive,
"There are no Integer values to be generated between startInclusive (%s) and endInclusive (%s)",
startInclusive, endInclusive);
return Strings.boun... | Gen<String> function(int startInclusive, int endInclusive) { ArgumentAssertions.checkArguments(startInclusive <= endInclusive, STR, startInclusive, endInclusive); return Strings.boundedNumericStrings(startInclusive, endInclusive); } | /**
* Generates integers within the interval as Strings.
*
* @param startInclusive
* - lower inclusive bound of integer domain
* @param endInclusive
* - upper inclusive bound of integer domain
* @return a Source of type String
*/ | Generates integers within the interval as Strings | numericBetween | {
"repo_name": "katyrae/QuickTheories",
"path": "core/src/main/java/org/quicktheories/generators/StringsDSL.java",
"license": "apache-2.0",
"size": 4990
} | [
"org.quicktheories.core.Gen"
] | import org.quicktheories.core.Gen; | import org.quicktheories.core.*; | [
"org.quicktheories.core"
] | org.quicktheories.core; | 901,936 |
Matrix getMatrix(); | Matrix getMatrix(); | /**
* Returns the coefficients of this linear transform as a matrix.
* Converting a coordinate with this {@code MathTransform} is equivalent to multiplying the
* returned matrix by a vector containing the coordinate values with an additional 1 in the last row.
* See {@link LinearTransform} class Jav... | Returns the coefficients of this linear transform as a matrix. Converting a coordinate with this MathTransform is equivalent to multiplying the returned matrix by a vector containing the coordinate values with an additional 1 in the last row. See <code>LinearTransform</code> class Javadoc for more details | getMatrix | {
"repo_name": "apache/sis",
"path": "core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LinearTransform.java",
"license": "apache-2.0",
"size": 6589
} | [
"org.opengis.referencing.operation.Matrix"
] | import org.opengis.referencing.operation.Matrix; | import org.opengis.referencing.operation.*; | [
"org.opengis.referencing"
] | org.opengis.referencing; | 2,317,191 |
@Test
public void whenAddIntegerInTreeFail() {
Tree<Integer> tree = new Tree<>();
tree.add(1, 1);
tree.add(1, 3);
tree.add(1, 7);
assertFalse(tree.add(3, 7));
tree.add(3, 11);
assertFalse(tree.add(7, 11));
assertThat(tree.getListValue().toString(),... | void function() { Tree<Integer> tree = new Tree<>(); tree.add(1, 1); tree.add(1, 3); tree.add(1, 7); assertFalse(tree.add(3, 7)); tree.add(3, 11); assertFalse(tree.add(7, 11)); assertThat(tree.getListValue().toString(), is(STR)); } | /**
* Test when adding Integer in tree is fail.
*/ | Test when adding Integer in tree is fail | whenAddIntegerInTreeFail | {
"repo_name": "alekseyponkin/aponkin",
"path": "chapter_005/src/test/java/ru/job4j/tree/TreeTest.java",
"license": "apache-2.0",
"size": 3602
} | [
"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,788,813 |
public static ActionScriptDecoder getReferenceAwareDecoder(Object encodedObject, Class desiredClass)
{
if (encodedObject != null)
{
if (String.class.equals(desiredClass))
return stringDecoder;
// We check Number and Boolean here as well as the enco... | static ActionScriptDecoder function(Object encodedObject, Class desiredClass) { if (encodedObject != null) { if (String.class.equals(desiredClass)) return stringDecoder; if (isNumber(desiredClass)) return numberDecoder; if (isBoolean(desiredClass)) return booleanDecoder; if (Collection.class.isAssignableFrom(desiredCla... | /**
* A considerably slower entry point for decoders as it both changes the
* assumptions we can make about type translation and also keeps track of
* a lot of information when a complex type is converted.
*
* @param encodedObject
* @param desiredClass
* @return The <tt>ActionS... | A considerably slower entry point for decoders as it both changes the assumptions we can make about type translation and also keeps track of a lot of information when a complex type is converted | getReferenceAwareDecoder | {
"repo_name": "SOASTA/BlazeDS",
"path": "modules/core/src/java/flex/messaging/io/amf/translator/decoder/DecoderFactory.java",
"license": "lgpl-3.0",
"size": 14001
} | [
"java.util.Calendar",
"java.util.Collection",
"java.util.Date",
"java.util.Map"
] | import java.util.Calendar; import java.util.Collection; import java.util.Date; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 254,961 |
EAttribute getMServo_OutputVoltage(); | EAttribute getMServo_OutputVoltage(); | /**
* Returns the meta object for the attribute '{@link org.openhab.binding.tinkerforge.internal.model.MServo#getOutputVoltage <em>Output Voltage</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Output Voltage</em>'.
* @see org.openhab.binding.tin... | Returns the meta object for the attribute '<code>org.openhab.binding.tinkerforge.internal.model.MServo#getOutputVoltage Output Voltage</code>'. | getMServo_OutputVoltage | {
"repo_name": "gregfinley/openhab",
"path": "bundles/binding/org.openhab.binding.tinkerforge/src/main/java/org/openhab/binding/tinkerforge/internal/model/ModelPackage.java",
"license": "epl-1.0",
"size": 665067
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 64,063 |
HdmiDeviceInfo getSafeDeviceInfoByPath(int path) {
synchronized (mLock) {
for (HdmiDeviceInfo info : mSafeAllDeviceInfos) {
if (info.getPhysicalAddress() == path) {
return info;
}
}
return null;
}
} | HdmiDeviceInfo getSafeDeviceInfoByPath(int path) { synchronized (mLock) { for (HdmiDeviceInfo info : mSafeAllDeviceInfos) { if (info.getPhysicalAddress() == path) { return info; } } return null; } } | /**
* Returns the {@link HdmiDeviceInfo} instance whose physical address matches
* the given routing path. This is the version accessible safely from threads
* other than service thread.
*
* @param path routing path or physical address
* @return {@link HdmiDeviceInfo} if the matched info i... | Returns the <code>HdmiDeviceInfo</code> instance whose physical address matches the given routing path. This is the version accessible safely from threads other than service thread | getSafeDeviceInfoByPath | {
"repo_name": "Ant-Droid/android_frameworks_base_OLD",
"path": "services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java",
"license": "apache-2.0",
"size": 73713
} | [
"android.hardware.hdmi.HdmiDeviceInfo"
] | import android.hardware.hdmi.HdmiDeviceInfo; | import android.hardware.hdmi.*; | [
"android.hardware"
] | android.hardware; | 1,401,482 |
public static Resource PO_REF() {
return ResourceFactory.createResource("http://wiki.plantontology.org:8080/index.php/PO_REF:");
} | static Resource function() { return ResourceFactory.createResource("http: } | /**
* Returns the link-out URI for objects of "Plant Ontology custom references".
*/ | Returns the link-out URI for objects of "Plant Ontology custom references" | PO_REF | {
"repo_name": "BioInterchange/BioInterchange",
"path": "supplemental/java/biointerchange/src/main/java/org/biointerchange/vocabulary/GOXRef.java",
"license": "mit",
"size": 41277
} | [
"com.hp.hpl.jena.rdf.model.Resource",
"com.hp.hpl.jena.rdf.model.ResourceFactory"
] | import com.hp.hpl.jena.rdf.model.Resource; import com.hp.hpl.jena.rdf.model.ResourceFactory; | import com.hp.hpl.jena.rdf.model.*; | [
"com.hp.hpl"
] | com.hp.hpl; | 2,193,433 |
private void provideFlashOn() {
flashOnLabel = styling.createBoldLabel( FLASH_ON_LABEL );
add( flashOnLabel, 0, 3 );
flashOnSpinner = new IntegerPropertySpinner();
styling.configureIntegerSpinner( flashOnSpinner, properties.flashOnProperty(), 1, Integer.MAX_VALUE, 1000 );
add( ... | void function() { flashOnLabel = styling.createBoldLabel( FLASH_ON_LABEL ); add( flashOnLabel, 0, 3 ); flashOnSpinner = new IntegerPropertySpinner(); styling.configureIntegerSpinner( flashOnSpinner, properties.flashOnProperty(), 1, Integer.MAX_VALUE, 1000 ); add( flashOnSpinner, 1, 3 ); } | /**
* Method to provide configuration components for the flash on property.
*/ | Method to provide configuration components for the flash on property | provideFlashOn | {
"repo_name": "DanGrew/JenkinsTestTracker",
"path": "JttDesktop/src/uk/dangrew/jtt/desktop/buildwall/effects/flasher/configuration/ImageFlasherConfigurationPanel.java",
"license": "apache-2.0",
"size": 10281
} | [
"uk.dangrew.kode.javafx.spinner.IntegerPropertySpinner"
] | import uk.dangrew.kode.javafx.spinner.IntegerPropertySpinner; | import uk.dangrew.kode.javafx.spinner.*; | [
"uk.dangrew.kode"
] | uk.dangrew.kode; | 2,241,633 |
public MakeList getContainerMakeList(){
return item.getContainerMakeList();
}
| MakeList function(){ return item.getContainerMakeList(); } | /**
* Return the encapsulate Low Level API object.
*/ | Return the encapsulate Low Level API object | getContainerMakeList | {
"repo_name": "lhillah/pnmlframework",
"path": "pnmlFw-HLPN/src/fr/lip6/move/pnml/hlpn/lists/hlapi/HLPNListHLAPI.java",
"license": "epl-1.0",
"size": 21741
} | [
"fr.lip6.move.pnml.hlpn.lists.MakeList"
] | import fr.lip6.move.pnml.hlpn.lists.MakeList; | import fr.lip6.move.pnml.hlpn.lists.*; | [
"fr.lip6.move"
] | fr.lip6.move; | 2,586,204 |
public EntrytypeEntity save(EntrytypeEntity entrytype) ; | EntrytypeEntity function(EntrytypeEntity entrytype) ; | /**
* Saves (create or update) the given entity <br>
* Transactional operation ( begin transaction and commit )
* @param entrytype
* @return
*/ | Saves (create or update) the given entity Transactional operation ( begin transaction and commit ) | save | {
"repo_name": "obasola/master",
"path": "src/main/java/com/kumasi/journal/persistence/services/EntrytypePersistence.java",
"license": "mit",
"size": 2300
} | [
"com.kumasi.journal.domain.jpa.EntrytypeEntity"
] | import com.kumasi.journal.domain.jpa.EntrytypeEntity; | import com.kumasi.journal.domain.jpa.*; | [
"com.kumasi.journal"
] | com.kumasi.journal; | 874,107 |
private void initProxy(final ExtendedProxy proxy) {
if (proxy != null) {
Authenticator.setDefault(new ProxyAuthenticator(proxy));
} else {
Authenticator.setDefault(null);
}
} | void function(final ExtendedProxy proxy) { if (proxy != null) { Authenticator.setDefault(new ProxyAuthenticator(proxy)); } else { Authenticator.setDefault(null); } } | /**
* Initializes proxy authenticator
*
* @param proxy
*/ | Initializes proxy authenticator | initProxy | {
"repo_name": "PDavid/aTunes",
"path": "aTunes/src/main/java/net/sourceforge/atunes/kernel/modules/network/NetworkHandler.java",
"license": "gpl-2.0",
"size": 8117
} | [
"java.net.Authenticator"
] | import java.net.Authenticator; | import java.net.*; | [
"java.net"
] | java.net; | 1,081,789 |
public static boolean createTableDescriptorForTableDirectory(FileSystem fs, Path tableDir,
TableDescriptor htd, boolean forceCreation) throws IOException {
FileStatus status = getTableInfoPath(fs, tableDir);
if (status != null) {
LOG.debug("Current path=" + status.getPath());
if (!forceCreat... | static boolean function(FileSystem fs, Path tableDir, TableDescriptor htd, boolean forceCreation) throws IOException { FileStatus status = getTableInfoPath(fs, tableDir); if (status != null) { LOG.debug(STR + status.getPath()); if (!forceCreation) { if (fs.exists(status.getPath()) && status.getLen() > 0) { if (readTabl... | /**
* Create a new TableDescriptor in HDFS in the specified table directory. Happens when we create
* a new table snapshoting. Does not enforce read-only. That is for caller to determine.
* @param fs Filesystem to use.
* @param tableDir table directory under which we should write the file
* @param htd de... | Create a new TableDescriptor in HDFS in the specified table directory. Happens when we create a new table snapshoting. Does not enforce read-only. That is for caller to determine | createTableDescriptorForTableDirectory | {
"repo_name": "francisliu/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java",
"license": "apache-2.0",
"size": 29182
} | [
"java.io.IOException",
"org.apache.hadoop.fs.FileStatus",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hbase.client.TableDescriptor"
] | import java.io.IOException; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.client.TableDescriptor; | import java.io.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.client.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 2,254,958 |
private void markAuthPath(List<GraphConnection> markedConnectionList) {
GraphConnection authPath;
// List<GraphConnection> connections = leaf.getTargetConnections();
for (GraphConnection connect : markedConnectionList) {
Node myNode = (Node) connect.getDestination().getData();
Node parentNode = (Node) co... | void function(List<GraphConnection> markedConnectionList) { GraphConnection authPath; for (GraphConnection connect : markedConnectionList) { Node myNode = (Node) connect.getDestination().getData(); Node parentNode = (Node) connect.getSource().getData(); if (myNode.equals(parentNode.getLeft())) { authPath = (GraphConnec... | /**
* Marks the authentification path of the leaf
* @param markedConnectionList
* - Contains marked elements of the Changing Path
*/ | Marks the authentification path of the leaf | markAuthPath | {
"repo_name": "ChristophSonnberger/crypto",
"path": "org.jcryptool.visual.merkletree/src/org/jcryptool/visual/merkletree/ui/MerkleTreeVerifikationComposite.java",
"license": "epl-1.0",
"size": 12672
} | [
"java.util.List",
"org.eclipse.draw2d.ColorConstants",
"org.eclipse.zest.core.widgets.GraphConnection",
"org.jcryptool.visual.merkletree.algorithm.Node"
] | import java.util.List; import org.eclipse.draw2d.ColorConstants; import org.eclipse.zest.core.widgets.GraphConnection; import org.jcryptool.visual.merkletree.algorithm.Node; | import java.util.*; import org.eclipse.draw2d.*; import org.eclipse.zest.core.widgets.*; import org.jcryptool.visual.merkletree.algorithm.*; | [
"java.util",
"org.eclipse.draw2d",
"org.eclipse.zest",
"org.jcryptool.visual"
] | java.util; org.eclipse.draw2d; org.eclipse.zest; org.jcryptool.visual; | 780,999 |
public Document tokenize(String text) throws IOException {
Document document = new Document();
document.text = text;
tokenize(document);
return document;
} | Document function(String text) throws IOException { Document document = new Document(); document.text = text; tokenize(document); return document; } | /**
* Parses the text in the input string and returns a document object.
* This method calls the {#link tokenize(Document) other variant}.
*
* @return A new document object containing the parsed text from the input string.
*/ | Parses the text in the input string and returns a document object. This method calls the {#link tokenize(Document) other variant} | tokenize | {
"repo_name": "youngilcho/internet-application-2014",
"path": "main/java/org/galagosearch/core/parse/TagTokenizer.java",
"license": "mit",
"size": 23203
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,751,371 |
void addProgramToLayout(Program pg, int n_program){
LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT );
textParams.setMargins(1,1,1,1);
long difference = 0;
LinearLayout.LayoutParams params = null;
float length = 0;
Date now = ne... | void addProgramToLayout(Program pg, int n_program){ LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT ); textParams.setMargins(1,1,1,1); long difference = 0; LinearLayout.LayoutParams params = null; float length = 0; Date now = new Date(System.curr... | /**
* Adding programs to the layout
* @param pg the program to add
* @param n_program number of the program to add
*/ | Adding programs to the layout | addProgramToLayout | {
"repo_name": "Z-app/zmote",
"path": "src/se/z_app/zmote/gui/EpgHorizontalActivity.java",
"license": "bsd-2-clause",
"size": 15909
} | [
"android.view.Gravity",
"android.view.View",
"android.view.ViewGroup",
"android.widget.LinearLayout",
"android.widget.TextView",
"java.text.SimpleDateFormat",
"java.util.Calendar",
"java.util.Date",
"se.z_app.stb.Program"
] | import android.view.Gravity; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.TextView; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import se.z_app.stb.Program; | import android.view.*; import android.widget.*; import java.text.*; import java.util.*; import se.z_app.stb.*; | [
"android.view",
"android.widget",
"java.text",
"java.util",
"se.z_app.stb"
] | android.view; android.widget; java.text; java.util; se.z_app.stb; | 798,940 |
public NodeList selectNodes(Node contextNode, XML_FIELD xmlField, XMLNamespaceResolver xmlNamespaceResolver) throws XMLMarshalException {
return this.selectNodes(contextNode, xmlField, xmlNamespaceResolver, null);
} | NodeList function(Node contextNode, XML_FIELD xmlField, XMLNamespaceResolver xmlNamespaceResolver) throws XMLMarshalException { return this.selectNodes(contextNode, xmlField, xmlNamespaceResolver, null); } | /**
* Execute the XPath statement relative to the context node.
*
* @param contextNode the node relative to which the XPath statement will be executed
* @param xmlField the field containing the XPath statement to be executed
* @param namespaceResolver used to resolve namespace prefixes to the c... | Execute the XPath statement relative to the context node | selectNodes | {
"repo_name": "RallySoftware/eclipselink.runtime",
"path": "foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/oxm/UnmarshalXPathEngine.java",
"license": "epl-1.0",
"size": 21326
} | [
"org.eclipse.persistence.exceptions.XMLMarshalException",
"org.eclipse.persistence.platform.xml.XMLNamespaceResolver",
"org.w3c.dom.Node",
"org.w3c.dom.NodeList"
] | import org.eclipse.persistence.exceptions.XMLMarshalException; import org.eclipse.persistence.platform.xml.XMLNamespaceResolver; import org.w3c.dom.Node; import org.w3c.dom.NodeList; | import org.eclipse.persistence.exceptions.*; import org.eclipse.persistence.platform.xml.*; import org.w3c.dom.*; | [
"org.eclipse.persistence",
"org.w3c.dom"
] | org.eclipse.persistence; org.w3c.dom; | 2,823,730 |
@Test()
public void testDefaultSettingsHierarchicalDIT()
throws Exception
{
final InMemoryDirectoryServer ds = getTestDS();
ds.restoreSnapshot(hierarchicalDITSnapshot);
try (LDAPConnection connection = ds.getConnection())
{
assertEntryExists(connection, "dc=example,dc=com");
... | @Test() void function() throws Exception { final InMemoryDirectoryServer ds = getTestDS(); ds.restoreSnapshot(hierarchicalDITSnapshot); try (LDAPConnection connection = ds.getConnection()) { assertEntryExists(connection, STR); final SubtreeDeleter subtreeDeleter = new SubtreeDeleter(); final SubtreeDeleterResult result... | /**
* Tests the behavior of the subtree deleter when run with the default
* settings on a hierarchical DIT.
*
* @throws Exception If an unexpected problem occurs.
*/ | Tests the behavior of the subtree deleter when run with the default settings on a hierarchical DIT | testDefaultSettingsHierarchicalDIT | {
"repo_name": "UnboundID/ldapsdk",
"path": "tests/unit/src/com/unboundid/util/SubtreeDeleterTestCase.java",
"license": "gpl-2.0",
"size": 79263
} | [
"com.unboundid.ldap.listener.InMemoryDirectoryServer",
"com.unboundid.ldap.sdk.LDAPConnection",
"org.testng.annotations.Test"
] | import com.unboundid.ldap.listener.InMemoryDirectoryServer; import com.unboundid.ldap.sdk.LDAPConnection; import org.testng.annotations.Test; | import com.unboundid.ldap.listener.*; import com.unboundid.ldap.sdk.*; import org.testng.annotations.*; | [
"com.unboundid.ldap",
"org.testng.annotations"
] | com.unboundid.ldap; org.testng.annotations; | 893,067 |
public void testBug37458() throws Exception {
int ids[] = { 13, 1, 8 };
String vals[] = { "c", "a", "b" };
createTable("testBug37458", "(id int not null auto_increment, val varchar(100), primary key (id), unique (val))");
this.stmt.executeUpdate("insert into testBug37458 values (1, '... | void function() throws Exception { int ids[] = { 13, 1, 8 }; String vals[] = { "c", "a", "b" }; createTable(STR, STR); this.stmt.executeUpdate(STR); this.pstmt = this.conn.prepareStatement(STR, Statement.RETURN_GENERATED_KEYS); for (int i = 0; i < ids.length; ++i) { this.pstmt.setString(1, vals[i]); this.pstmt.addBatch... | /**
* Bug #37458 - MySQL 5.1 returns generated keys in ascending order
*/ | Bug #37458 - MySQL 5.1 returns generated keys in ascending order | testBug37458 | {
"repo_name": "seanbright/mysql-connector-j",
"path": "src/testsuite/regression/StatementRegressionTest.java",
"license": "gpl-2.0",
"size": 331459
} | [
"java.sql.ResultSet",
"java.sql.Statement"
] | import java.sql.ResultSet; import java.sql.Statement; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,725,854 |
private void notifyExecute()
{
String name = currentTask.getName();
Iterator<InitializationListener> i = initListeners.iterator();
while (i.hasNext())
i.next().onExecute(name);
} | void function() { String name = currentTask.getName(); Iterator<InitializationListener> i = initListeners.iterator(); while (i.hasNext()) i.next().onExecute(name); } | /**
* Calls the <code>onExecute</code> method of each subscriber in the
* notification set.
*/ | Calls the <code>onExecute</code> method of each subscriber in the notification set | notifyExecute | {
"repo_name": "joshmoore/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/env/init/Initializer.java",
"license": "gpl-2.0",
"size": 10330
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 710,877 |
public Logo getByOrganisationId(Integer organisationId) throws BusinessException{
Logo logo = null;
try{
logo = logoDao.getByOrganisationId(organisationId);
} catch(Exception bexc){
throw new BusinessException(ICodeException.LOGO_GET_BY_ORGANISATION_ID, bexc);
}
return lo... | Logo function(Integer organisationId) throws BusinessException{ Logo logo = null; try{ logo = logoDao.getByOrganisationId(organisationId); } catch(Exception bexc){ throw new BusinessException(ICodeException.LOGO_GET_BY_ORGANISATION_ID, bexc); } return logo; } | /**
* Returns a logo identified by the it's name
*/ | Returns a logo identified by the it's name | getByOrganisationId | {
"repo_name": "CodeSphere/termitaria",
"path": "TermitariaOM/JavaSource/ro/cs/om/business/BLLogo.java",
"license": "agpl-3.0",
"size": 3146
} | [
"ro.cs.om.entity.Logo",
"ro.cs.om.exception.BusinessException",
"ro.cs.om.exception.ICodeException"
] | import ro.cs.om.entity.Logo; import ro.cs.om.exception.BusinessException; import ro.cs.om.exception.ICodeException; | import ro.cs.om.entity.*; import ro.cs.om.exception.*; | [
"ro.cs.om"
] | ro.cs.om; | 2,015,010 |
public static <T extends Number> ILine4<T> revertScale(
final ILine4<T> lineToScale, final IScaleFactor<?> scalingFactor) {
IMatrix4<?> scalingMatrix = GeometricOperations
.inverseScalingMatrix(scalingFactor);
IPoint4<T> scaledSource = VectorAlgebraicOperations.multiply... | static <T extends Number> ILine4<T> function( final ILine4<T> lineToScale, final IScaleFactor<?> scalingFactor) { IMatrix4<?> scalingMatrix = GeometricOperations .inverseScalingMatrix(scalingFactor); IPoint4<T> scaledSource = VectorAlgebraicOperations.multiply( scalingMatrix, lineToScale.getSource(), lineToScale.getTyp... | /**
* Reverts the scaling of the {@link ILine4 Line} by the provided
* {@link IScaleFactor Scaling Factor}.
*
* @param <T>
* the {@link Number} type of the {@link ILine4 Line} to scale.
*
* @param lineToScale
* the {@link ILine4 Line} to scale.
* @param... | Reverts the scaling of the <code>ILine4 Line</code> by the provided <code>IScaleFactor Scaling Factor</code> | revertScale | {
"repo_name": "aftenkap/jutility",
"path": "jutility-math/src/main/java/org/jutility/math/geometry/GeometricOperations.java",
"license": "apache-2.0",
"size": 125764
} | [
"org.jutility.math.vectoralgebra.IMatrix4",
"org.jutility.math.vectoralgebra.IPoint4",
"org.jutility.math.vectoralgebra.VectorAlgebraicOperations"
] | import org.jutility.math.vectoralgebra.IMatrix4; import org.jutility.math.vectoralgebra.IPoint4; import org.jutility.math.vectoralgebra.VectorAlgebraicOperations; | import org.jutility.math.vectoralgebra.*; | [
"org.jutility.math"
] | org.jutility.math; | 2,838,866 |
if (!Files.exists(Paths.get(this.configPath))) {
throw new InvalidConfigurationException(String.format(CONF_NOT_FOUND, this.configPath));
}
try {
Logger logger = Logger.getLogger("lancoder");
FileInputStream fis = new FileInputStream(this.configPath);
Yaml yaml = new Yaml();
this.config = (T) yam... | if (!Files.exists(Paths.get(this.configPath))) { throw new InvalidConfigurationException(String.format(CONF_NOT_FOUND, this.configPath)); } try { Logger logger = Logger.getLogger(STR); FileInputStream fis = new FileInputStream(this.configPath); Yaml yaml = new Yaml(); this.config = (T) yaml.loadAs(fis, this.clazz); log... | /**
* Load configuration from disk from the provided path.
*
* @return The loaded configuration
* @throws InvalidConfigurationException
* If file is corrupted or missing
*/ | Load configuration from disk from the provided path | load | {
"repo_name": "jdupl/lancoder",
"path": "src/main/java/org/lancoder/common/config/ConfigManager.java",
"license": "gpl-3.0",
"size": 2869
} | [
"java.io.FileInputStream",
"java.io.IOException",
"java.nio.file.Files",
"java.nio.file.Paths",
"java.util.logging.Logger",
"org.lancoder.common.exceptions.InvalidConfigurationException",
"org.yaml.snakeyaml.Yaml"
] | import java.io.FileInputStream; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.logging.Logger; import org.lancoder.common.exceptions.InvalidConfigurationException; import org.yaml.snakeyaml.Yaml; | import java.io.*; import java.nio.file.*; import java.util.logging.*; import org.lancoder.common.exceptions.*; import org.yaml.snakeyaml.*; | [
"java.io",
"java.nio",
"java.util",
"org.lancoder.common",
"org.yaml.snakeyaml"
] | java.io; java.nio; java.util; org.lancoder.common; org.yaml.snakeyaml; | 881,169 |
public Boolean getAllowsRecordDeletion(MaintenanceDocument document) {
return document != null ? this.getAllowsRecordDeletion(document.getNewMaintainableObject().getBoClass()) : Boolean.FALSE;
}
| Boolean function(MaintenanceDocument document) { return document != null ? this.getAllowsRecordDeletion(document.getNewMaintainableObject().getBoClass()) : Boolean.FALSE; } | /**
* for issue KULRice3070, see if need delete button
*
* @see org.kuali.rice.kns.service.MaintenanceDocumentDictionaryService#getAllowsRecordDeletion(org.kuali.rice.krad.maintenance.MaintenanceDocument)
*/ | for issue KULRice3070, see if need delete button | getAllowsRecordDeletion | {
"repo_name": "ua-eas/ua-rice-2.1.9",
"path": "impl/src/main/java/org/kuali/rice/kns/service/impl/MaintenanceDocumentDictionaryServiceImpl.java",
"license": "apache-2.0",
"size": 37667
} | [
"org.kuali.rice.kns.document.MaintenanceDocument"
] | import org.kuali.rice.kns.document.MaintenanceDocument; | import org.kuali.rice.kns.document.*; | [
"org.kuali.rice"
] | org.kuali.rice; | 1,033,451 |
public static boolean isLessThanUnsigned(long n1, long n2) {
return UnsignedLongs.compare(n1, n2) < 0;
} | static boolean function(long n1, long n2) { return UnsignedLongs.compare(n1, n2) < 0; } | /**
* Work around lack of unsigned types in Java.
*/ | Work around lack of unsigned types in Java | isLessThanUnsigned | {
"repo_name": "liduanw/bitherj",
"path": "bitherj/src/main/java/net/bither/bitherj/utils/Utils.java",
"license": "apache-2.0",
"size": 36739
} | [
"com.google.common.primitives.UnsignedLongs"
] | import com.google.common.primitives.UnsignedLongs; | import com.google.common.primitives.*; | [
"com.google.common"
] | com.google.common; | 1,078,643 |
Iterable<DmTask> queryByUpdatedBy(java.lang.String updatedBy);
| Iterable<DmTask> queryByUpdatedBy(java.lang.String updatedBy); | /**
* query-by method for field updatedBy
* @param updatedBy the specified attribute
* @return an Iterable of DmTasks for the specified updatedBy
*/ | query-by method for field updatedBy | queryByUpdatedBy | {
"repo_name": "goldengekko/Meetr-Backend",
"path": "src/main/java/com/goldengekko/meetr/dao/GeneratedDmTaskDao.java",
"license": "gpl-3.0",
"size": 7714
} | [
"com.goldengekko.meetr.domain.DmTask"
] | import com.goldengekko.meetr.domain.DmTask; | import com.goldengekko.meetr.domain.*; | [
"com.goldengekko.meetr"
] | com.goldengekko.meetr; | 696,028 |
void bind(String jndiUrl, Hashtable<?, ?> attributes,
RMIServer rmiServer, boolean rebind)
throws NamingException, MalformedURLException {
// if jndiURL is not null, we nust bind the stub to a
// directory.
InitialContext ctx =
new InitialContext(attributes)... | void bind(String jndiUrl, Hashtable<?, ?> attributes, RMIServer rmiServer, boolean rebind) throws NamingException, MalformedURLException { InitialContext ctx = new InitialContext(attributes); if (rebind) ctx.rebind(jndiUrl, rmiServer); else ctx.bind(jndiUrl, rmiServer); ctx.close(); } | /**
* Bind a stub to a registry.
* @param jndiUrl URL of the stub in the registry, extracted
* from the <code>JMXServiceURL</code>.
* @param attributes A Hashtable containing environment parameters,
* built from the Map specified at this object creation.
* @param rmiServer Th... | Bind a stub to a registry | bind | {
"repo_name": "md-5/jdk10",
"path": "src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectorServer.java",
"license": "gpl-2.0",
"size": 35062
} | [
"java.net.MalformedURLException",
"java.util.Hashtable",
"javax.naming.InitialContext",
"javax.naming.NamingException"
] | import java.net.MalformedURLException; import java.util.Hashtable; import javax.naming.InitialContext; import javax.naming.NamingException; | import java.net.*; import java.util.*; import javax.naming.*; | [
"java.net",
"java.util",
"javax.naming"
] | java.net; java.util; javax.naming; | 1,612,317 |
@Override public void exitLiteralFloat(@NotNull AQLParser.LiteralFloatContext ctx) { } | @Override public void exitLiteralFloat(@NotNull AQLParser.LiteralFloatContext ctx) { } | /**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/ | The default implementation does nothing | enterLiteralFloat | {
"repo_name": "chriswhite199/jdbc-driver",
"path": "src/main/java/com/ibm/si/jaql/aql/AQLBaseListener.java",
"license": "apache-2.0",
"size": 13047
} | [
"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,190,138 |
String startSession(DBObject data); | String startSession(DBObject data); | /**
* Starts a new session, persisting the given data and giving back a unique session ID.
* The session start time is marked with the current time.
*
* @param data a map of session data to be stored (<tt>null</tt> allowed)
* @return a new, unique session ID
... | Starts a new session, persisting the given data and giving back a unique session ID. The session start time is marked with the current time | startSession | {
"repo_name": "AlfrescoBenchmark/alfresco-benchmark",
"path": "server/src/main/java/org/alfresco/bm/session/SessionService.java",
"license": "lgpl-3.0",
"size": 3754
} | [
"com.mongodb.DBObject"
] | import com.mongodb.DBObject; | import com.mongodb.*; | [
"com.mongodb"
] | com.mongodb; | 1,096,121 |
private ChannelSelection createChannelSelectionError(
StyleFactoryImpl styleFactory, ContrastMethod contrastMethod) {
ContrastEnhancement contrastEnhancement =
(ContrastEnhancement) styleFactory.contrastEnhancement(null, contrastMethod.name());
FilterFactory ff = CommonF... | ChannelSelection function( StyleFactoryImpl styleFactory, ContrastMethod contrastMethod) { ContrastEnhancement contrastEnhancement = (ContrastEnhancement) styleFactory.contrastEnhancement(null, contrastMethod.name()); FilterFactory ff = CommonFactoryFinder.getFilterFactory(); Map<String, Expression> options = contrastE... | /**
* Creates the channel selection error object.
*
* @param styleFactory the style factory
* @param contrastMethod the contrast method
* @return the channel selection
*/ | Creates the channel selection error object | createChannelSelectionError | {
"repo_name": "robward-scisys/sldeditor",
"path": "modules/application/src/test/java/com/sldeditor/test/unit/ui/detail/vendor/geoserver/raster/VOGeoServerContrastEnhancementNormalizeBlueTest.java",
"license": "gpl-3.0",
"size": 8692
} | [
"java.util.Map",
"org.geotools.factory.CommonFactoryFinder",
"org.geotools.styling.ChannelSelection",
"org.geotools.styling.ContrastEnhancement",
"org.geotools.styling.SelectedChannelType",
"org.geotools.styling.StyleFactoryImpl",
"org.opengis.filter.FilterFactory",
"org.opengis.filter.expression.Expr... | import java.util.Map; import org.geotools.factory.CommonFactoryFinder; import org.geotools.styling.ChannelSelection; import org.geotools.styling.ContrastEnhancement; import org.geotools.styling.SelectedChannelType; import org.geotools.styling.StyleFactoryImpl; import org.opengis.filter.FilterFactory; import org.opengis... | import java.util.*; import org.geotools.factory.*; import org.geotools.styling.*; import org.opengis.filter.*; import org.opengis.filter.expression.*; import org.opengis.style.*; | [
"java.util",
"org.geotools.factory",
"org.geotools.styling",
"org.opengis.filter",
"org.opengis.style"
] | java.util; org.geotools.factory; org.geotools.styling; org.opengis.filter; org.opengis.style; | 2,268,390 |
private void locateUriRoot( File f ) {
String tUriBase = uriBase;
if (tUriBase == null) {
tUriBase = "/";
}
try {
if (f.exists()) {
f = new File(f.getCanonicalPath());
while (f != null) {
File g = new File(f,... | void function( File f ) { String tUriBase = uriBase; if (tUriBase == null) { tUriBase = "/"; } try { if (f.exists()) { f = new File(f.getCanonicalPath()); while (f != null) { File g = new File(f, STR); if (g.exists() && g.isDirectory()) { uriRoot = f.getCanonicalPath(); uriBase = tUriBase; if (log.isInfoEnabled()) { lo... | /**
* Find the WEB-INF dir by looking up in the directory tree.
* This is used if no explicit docbase is set, but only files.
* XXX Maybe we should require the docbase.
*/ | Find the WEB-INF dir by looking up in the directory tree. This is used if no explicit docbase is set, but only files. XXX Maybe we should require the docbase | locateUriRoot | {
"repo_name": "devjin24/howtomcatworks",
"path": "bookrefer/jakarta-tomcat-5.0.18-src/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java",
"license": "apache-2.0",
"size": 36318
} | [
"java.io.File",
"java.io.IOException",
"org.apache.jasper.compiler.Localizer"
] | import java.io.File; import java.io.IOException; import org.apache.jasper.compiler.Localizer; | import java.io.*; import org.apache.jasper.compiler.*; | [
"java.io",
"org.apache.jasper"
] | java.io; org.apache.jasper; | 2,647,151 |
public static boolean isDirectoryURL(URL url) {
try {
File f = new File(url.toURI());
if (f.exists() && f.isDirectory()) {
return true;
}
} catch (Exception e) {
}
return false;
} | static boolean function(URL url) { try { File f = new File(url.toURI()); if (f.exists() && f.isDirectory()) { return true; } } catch (Exception e) { } return false; } | /**
* Determine whether the given URL points to a directory in the file system
*
* @param url
* the URL to check
* @return whether the URL has been identified as a file system URL
*/ | Determine whether the given URL points to a directory in the file system | isDirectoryURL | {
"repo_name": "alpapad/HotswapAgent",
"path": "hotswap-agent-core/src/main/java/org/hotswap/agent/util/IOUtils.java",
"license": "gpl-2.0",
"size": 4307
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 2,122,268 |
public Optional<StoredTabletFile> updateTabletDataFile(long maxCommittedTime,
TabletFile newDatafile, DataFileValue dfv, Set<String> unusedWalLogs, long flushId) {
synchronized (timeLock) {
if (maxCommittedTime > persistedTime) {
persistedTime = maxCommittedTime;
}
return ManagerM... | Optional<StoredTabletFile> function(long maxCommittedTime, TabletFile newDatafile, DataFileValue dfv, Set<String> unusedWalLogs, long flushId) { synchronized (timeLock) { if (maxCommittedTime > persistedTime) { persistedTime = maxCommittedTime; } return ManagerMetadataUtil.updateTabletDataFile(getTabletServer().getCont... | /**
* Update tablet file data from flush. Returns a StoredTabletFile if there are data entries.
*/ | Update tablet file data from flush. Returns a StoredTabletFile if there are data entries | updateTabletDataFile | {
"repo_name": "phrocker/accumulo-1",
"path": "server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java",
"license": "apache-2.0",
"size": 81302
} | [
"java.util.Optional",
"java.util.Set",
"org.apache.accumulo.core.metadata.StoredTabletFile",
"org.apache.accumulo.core.metadata.TabletFile",
"org.apache.accumulo.core.metadata.schema.DataFileValue",
"org.apache.accumulo.server.util.ManagerMetadataUtil"
] | import java.util.Optional; import java.util.Set; import org.apache.accumulo.core.metadata.StoredTabletFile; import org.apache.accumulo.core.metadata.TabletFile; import org.apache.accumulo.core.metadata.schema.DataFileValue; import org.apache.accumulo.server.util.ManagerMetadataUtil; | import java.util.*; import org.apache.accumulo.core.metadata.*; import org.apache.accumulo.core.metadata.schema.*; import org.apache.accumulo.server.util.*; | [
"java.util",
"org.apache.accumulo"
] | java.util; org.apache.accumulo; | 1,391,439 |
public String getMaterialName()
{
return this.theToolMaterial.toString();
}
static final class SwitchDirtType
{
static final int[] field_179590_a = new int[BlockDirt.DirtType.values().length];
private static final String __OBFID = "CL_00002179";
static
{
... | String function() { return this.theToolMaterial.toString(); } static final class SwitchDirtType { static final int[] field_179590_a = new int[BlockDirt.DirtType.values().length]; private static final String __OBFID = STR; static { try { field_179590_a[BlockDirt.DirtType.DIRT.ordinal()] = 1; } catch (NoSuchFieldError va... | /**
* Returns the name of the material this tool is made from as it is declared in EnumToolMaterial (meaning diamond
* would return "EMERALD")
*/ | Returns the name of the material this tool is made from as it is declared in EnumToolMaterial (meaning diamond would return "EMERALD") | getMaterialName | {
"repo_name": "Hexeption/Youtube-Hacked-Client-1.8",
"path": "minecraft/net/minecraft/item/ItemHoe.java",
"license": "mit",
"size": 4197
} | [
"net.minecraft.block.BlockDirt"
] | import net.minecraft.block.BlockDirt; | import net.minecraft.block.*; | [
"net.minecraft.block"
] | net.minecraft.block; | 804,305 |
public APIKeyValidationInfoDTO validateKey(String context, String version, String accessToken,
String requiredAuthenticationLevel) throws APIManagementException {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs = null;
... | APIKeyValidationInfoDTO function(String context, String version, String accessToken, String requiredAuthenticationLevel) throws APIManagementException { Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; String tier; String status; String type; String userType; String subscriberName; String subsc... | /**
* Validate the provided key against the given API. First it will validate the key is valid
* , ACTIVE and not expired.
*
* @param context Requested Context
* @param version version of the API
* @param accessToken Provided Access Token
* @return APIKeyValidationInfoDTO inst... | Validate the provided key against the given API. First it will validate the key is valid , ACTIVE and not expired | validateKey | {
"repo_name": "charithag/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java",
"license": "apache-2.0",
"size": 345861
} | [
"java.sql.Connection",
"java.sql.PreparedStatement",
"java.sql.ResultSet",
"java.sql.SQLException",
"java.util.Calendar",
"java.util.HashSet",
"java.util.Set",
"java.util.TimeZone",
"org.wso2.carbon.apimgt.api.APIManagementException",
"org.wso2.carbon.apimgt.impl.APIConstants",
"org.wso2.carbon.... | import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Calendar; import java.util.HashSet; import java.util.Set; import java.util.TimeZone; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.impl.APICo... | import java.sql.*; import java.util.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.impl.*; import org.wso2.carbon.apimgt.impl.dao.constants.*; import org.wso2.carbon.apimgt.impl.dto.*; import org.wso2.carbon.apimgt.impl.utils.*; import org.wso2.carbon.core.util.*; import org.wso2.carbon.identity.... | [
"java.sql",
"java.util",
"org.wso2.carbon"
] | java.sql; java.util; org.wso2.carbon; | 2,010,604 |
@Test
public void testDeserialisationReuseAvroRecordFalse() throws IOException {
Configuration parameters = new Configuration();
AvroInputFormat<User> format = new AvroInputFormat<User>(new Path(testFile.getAbsolutePath()), User.class);
format.setReuseAvroValue(false);
format.configure(parameters);
File... | void function() throws IOException { Configuration parameters = new Configuration(); AvroInputFormat<User> format = new AvroInputFormat<User>(new Path(testFile.getAbsolutePath()), User.class); format.setReuseAvroValue(false); format.configure(parameters); FileInputSplit[] splits = format.createInputSplits(1); assertEqu... | /**
* Test if the AvroInputFormat is able to properly read data from an avro file.
* @throws IOException
*/ | Test if the AvroInputFormat is able to properly read data from an avro file | testDeserialisationReuseAvroRecordFalse | {
"repo_name": "zimmermatt/flink",
"path": "flink-formats/flink-avro/src/test/java/org/apache/flink/formats/avro/AvroRecordInputFormatTest.java",
"license": "apache-2.0",
"size": 16898
} | [
"java.io.IOException",
"java.util.List",
"java.util.Map",
"org.apache.avro.util.Utf8",
"org.apache.flink.configuration.Configuration",
"org.apache.flink.core.fs.FileInputSplit",
"org.apache.flink.core.fs.Path",
"org.apache.flink.formats.avro.generated.Colors",
"org.apache.flink.formats.avro.generate... | import java.io.IOException; import java.util.List; import java.util.Map; import org.apache.avro.util.Utf8; import org.apache.flink.configuration.Configuration; import org.apache.flink.core.fs.FileInputSplit; import org.apache.flink.core.fs.Path; import org.apache.flink.formats.avro.generated.Colors; import org.apache.f... | import java.io.*; import java.util.*; import org.apache.avro.util.*; import org.apache.flink.configuration.*; import org.apache.flink.core.fs.*; import org.apache.flink.formats.avro.generated.*; import org.junit.*; | [
"java.io",
"java.util",
"org.apache.avro",
"org.apache.flink",
"org.junit"
] | java.io; java.util; org.apache.avro; org.apache.flink; org.junit; | 343,899 |
public ObjectDataDTO waitForEntityDto(String entityId) throws InterruptedException{
Long expectedBenefactor = null;
return waitForEntityDto(entityId, expectedBenefactor);
}
| ObjectDataDTO function(String entityId) throws InterruptedException{ Long expectedBenefactor = null; return waitForEntityDto(entityId, expectedBenefactor); } | /**
* Helper to wait for an entity's replication data to appear.
*
* @param entityId
* @return
* @throws InterruptedException
*/ | Helper to wait for an entity's replication data to appear | waitForEntityDto | {
"repo_name": "zimingd/Synapse-Repository-Services",
"path": "services/workers/src/test/java/org/sagebionetworks/replication/workers/ObjectReplicationReconciliationWorkerIntegrationTest.java",
"license": "apache-2.0",
"size": 8361
} | [
"org.sagebionetworks.repo.model.table.ObjectDataDTO"
] | import org.sagebionetworks.repo.model.table.ObjectDataDTO; | import org.sagebionetworks.repo.model.table.*; | [
"org.sagebionetworks.repo"
] | org.sagebionetworks.repo; | 1,947,771 |
public TrimResult trimFields(Project project, ImmutableBitSet fieldsUsed,
Set<RelDataTypeField> extraFields) {
// set columnAccessInfo for ViewColumnAuthorization
final ColumnAccessInfo columnAccessInfo = COLUMN_ACCESS_INFO.get();
final Map<HiveProject, Table> viewProjectToTableSchema = VIEW_PROJECT... | TrimResult function(Project project, ImmutableBitSet fieldsUsed, Set<RelDataTypeField> extraFields) { final ColumnAccessInfo columnAccessInfo = COLUMN_ACCESS_INFO.get(); final Map<HiveProject, Table> viewProjectToTableSchema = VIEW_PROJECT_TO_TABLE_SCHEMA.get(); if (columnAccessInfo != null && viewProjectToTableSchema ... | /**
* Variant of {@link #trimFields(RelNode, ImmutableBitSet, Set)} for
* {@link org.apache.calcite.rel.logical.LogicalProject}.
*/ | Variant of <code>#trimFields(RelNode, ImmutableBitSet, Set)</code> for <code>org.apache.calcite.rel.logical.LogicalProject</code> | trimFields | {
"repo_name": "sankarh/hive",
"path": "ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveRelFieldTrimmer.java",
"license": "apache-2.0",
"size": 36682
} | [
"java.util.Map",
"java.util.Set",
"org.apache.calcite.linq4j.Ord",
"org.apache.calcite.rel.core.Project",
"org.apache.calcite.rel.type.RelDataTypeField",
"org.apache.calcite.rex.RexNode",
"org.apache.calcite.util.ImmutableBitSet",
"org.apache.hadoop.hive.ql.metadata.Table",
"org.apache.hadoop.hive.q... | import java.util.Map; import java.util.Set; import org.apache.calcite.linq4j.Ord; import org.apache.calcite.rel.core.Project; import org.apache.calcite.rel.type.RelDataTypeField; import org.apache.calcite.rex.RexNode; import org.apache.calcite.util.ImmutableBitSet; import org.apache.hadoop.hive.ql.metadata.Table; impor... | import java.util.*; import org.apache.calcite.linq4j.*; import org.apache.calcite.rel.core.*; import org.apache.calcite.rel.type.*; import org.apache.calcite.rex.*; import org.apache.calcite.util.*; import org.apache.hadoop.hive.ql.metadata.*; import org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.*; import or... | [
"java.util",
"org.apache.calcite",
"org.apache.hadoop"
] | java.util; org.apache.calcite; org.apache.hadoop; | 1,541,916 |
public void doPatchsetCreatedHook(Change change, PatchSet patchSet,
ReviewDb db) throws OrmException; | void function(Change change, PatchSet patchSet, ReviewDb db) throws OrmException; | /**
* Fire the Patchset Created Hook.
*
* @param change The change itself.
* @param patchSet The Patchset that was created.
* @throws OrmException
*/ | Fire the Patchset Created Hook | doPatchsetCreatedHook | {
"repo_name": "gcoders/gerrit",
"path": "gerrit-server/src/main/java/com/google/gerrit/common/ChangeHooks.java",
"license": "apache-2.0",
"size": 6386
} | [
"com.google.gerrit.reviewdb.client.Change",
"com.google.gerrit.reviewdb.client.PatchSet",
"com.google.gerrit.reviewdb.server.ReviewDb",
"com.google.gwtorm.server.OrmException"
] | import com.google.gerrit.reviewdb.client.Change; import com.google.gerrit.reviewdb.client.PatchSet; import com.google.gerrit.reviewdb.server.ReviewDb; import com.google.gwtorm.server.OrmException; | import com.google.gerrit.reviewdb.client.*; import com.google.gerrit.reviewdb.server.*; import com.google.gwtorm.server.*; | [
"com.google.gerrit",
"com.google.gwtorm"
] | com.google.gerrit; com.google.gwtorm; | 1,756,530 |
@Source("com/google/appinventor/images/textToSpeech.png")
ImageResource textToSpeech(); | @Source(STR) ImageResource textToSpeech(); | /**
* Designer palette item: TextToSpeech component
*/ | Designer palette item: TextToSpeech component | textToSpeech | {
"repo_name": "codimeo/codi-studio",
"path": "appinventor/appengine/src/com/google/appinventor/client/Images.java",
"license": "apache-2.0",
"size": 13788
} | [
"com.google.gwt.resources.client.ImageResource"
] | import com.google.gwt.resources.client.ImageResource; | import com.google.gwt.resources.client.*; | [
"com.google.gwt"
] | com.google.gwt; | 1,823,393 |
@NotNull
public Set<File> getCorrespondingOutputFiles(@NotNull final PsiFile srcFile,
@Nullable final Module module,
@NotNull final CoverageSuitesBundle suite) {
final VirtualFile virtualFile = srcFil... | Set<File> function(@NotNull final PsiFile srcFile, @Nullable final Module module, @NotNull final CoverageSuitesBundle suite) { final VirtualFile virtualFile = srcFile.getVirtualFile(); return virtualFile == null ? Collections.<File>emptySet() : Collections.singleton(VfsUtilCore.virtualToIoFile(virtualFile)); } | /**
* E.g. all *.class files for java source file with several classes
*
*
* @param srcFile
* @param module
* @return files
*/ | E.g. all *.class files for java source file with several classes | getCorrespondingOutputFiles | {
"repo_name": "ernestp/consulo",
"path": "platform/coverage-impl/src/com/intellij/coverage/CoverageEngine.java",
"license": "apache-2.0",
"size": 15738
} | [
"com.intellij.openapi.module.Module",
"com.intellij.openapi.vfs.VfsUtilCore",
"com.intellij.openapi.vfs.VirtualFile",
"com.intellij.psi.PsiFile",
"java.io.File",
"java.util.Collections",
"java.util.Set",
"org.jetbrains.annotations.NotNull",
"org.jetbrains.annotations.Nullable"
] | import com.intellij.openapi.module.Module; import com.intellij.openapi.vfs.VfsUtilCore; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiFile; import java.io.File; import java.util.Collections; import java.util.Set; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullab... | import com.intellij.openapi.module.*; import com.intellij.openapi.vfs.*; import com.intellij.psi.*; import java.io.*; import java.util.*; import org.jetbrains.annotations.*; | [
"com.intellij.openapi",
"com.intellij.psi",
"java.io",
"java.util",
"org.jetbrains.annotations"
] | com.intellij.openapi; com.intellij.psi; java.io; java.util; org.jetbrains.annotations; | 1,621,948 |
public byte[] makeTile(double uvx, double uvy, ZoomLevelMaker zoomInfo, Proj proj) {
Point2D center = tileUVToLatLon(new Point2D.Double(uvx + .5, uvy + .5), zoomInfo.getZoomLevel());
proj.setScale(mtcTransform.getScaleForZoom(zoomInfo.getZoomLevel()));
proj.setCenter(center);
proj.se... | byte[] function(double uvx, double uvy, ZoomLevelMaker zoomInfo, Proj proj) { Point2D center = tileUVToLatLon(new Point2D.Double(uvx + .5, uvy + .5), zoomInfo.getZoomLevel()); proj.setScale(mtcTransform.getScaleForZoom(zoomInfo.getZoomLevel())); proj.setCenter(center); proj.setHeight(TILE_SIZE); proj.setWidth(TILE_SIZE... | /**
* Creating the tile using the ImageServer methodology, knowing that the
* MapTileMaker has been configured with an openmap.properties.file and
* knows about layers and their marker names.
*
* @param uvx uv x pixel coordinate
* @param uvy uv y pixel coordinate
* @param zoomInfo zo... | Creating the tile using the ImageServer methodology, knowing that the MapTileMaker has been configured with an openmap.properties.file and knows about layers and their marker names | makeTile | {
"repo_name": "d2fn/passage",
"path": "src/main/java/com/bbn/openmap/dataAccess/mapTile/MapTileMaker.java",
"license": "mit",
"size": 22503
} | [
"com.bbn.openmap.proj.Proj",
"java.awt.geom.Point2D"
] | import com.bbn.openmap.proj.Proj; import java.awt.geom.Point2D; | import com.bbn.openmap.proj.*; import java.awt.geom.*; | [
"com.bbn.openmap",
"java.awt"
] | com.bbn.openmap; java.awt; | 212,977 |
private synchronized boolean markAsFailed(String details, Exception reason) {
if (committedOrFailed()) {
return committed == false;
}
logger.trace((org.apache.logging.log4j.util.Supplier<?>) () -> new ParameterizedMessage("failed to commit version [{}]. {}",
... | synchronized boolean function(String details, Exception reason) { if (committedOrFailed()) { return committed == false; } logger.trace((org.apache.logging.log4j.util.Supplier<?>) () -> new ParameterizedMessage(STR, clusterState.version(), details), reason); committed = false; committedOrFailedLatch.countDown(); return ... | /**
* tries marking the publishing as failed, if a decision wasn't made yet
*
* @return true if the publishing was failed and the cluster state is *not* committed
**/ | tries marking the publishing as failed, if a decision wasn't made yet | markAsFailed | {
"repo_name": "qwerty4030/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/discovery/zen/PublishClusterStateAction.java",
"license": "apache-2.0",
"size": 33362
} | [
"org.apache.logging.log4j.message.ParameterizedMessage"
] | import org.apache.logging.log4j.message.ParameterizedMessage; | import org.apache.logging.log4j.message.*; | [
"org.apache.logging"
] | org.apache.logging; | 330,762 |
public static boolean hasAnnotation(AnnotatedElement elem, Class<? extends Annotation> annotationType,
boolean checkMetaAnnotations) {
if (elem.isAnnotationPresent(annotationType)) {
return true;
}
if (checkMetaAnnotations) {
fo... | static boolean function(AnnotatedElement elem, Class<? extends Annotation> annotationType, boolean checkMetaAnnotations) { if (elem.isAnnotationPresent(annotationType)) { return true; } if (checkMetaAnnotations) { for (Annotation a : elem.getAnnotations()) { for (Annotation meta : a.annotationType().getAnnotations()) {... | /**
* Checks if a Class or Method are annotated with the given annotation
*
* @param elem the Class or Method to reflect on
* @param annotationType the annotation type
* @param checkMetaAnnotations check for meta annotations
* @return true if annotations is present
*/ | Checks if a Class or Method are annotated with the given annotation | hasAnnotation | {
"repo_name": "trohovsky/camel",
"path": "camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java",
"license": "apache-2.0",
"size": 70972
} | [
"java.lang.annotation.Annotation",
"java.lang.reflect.AnnotatedElement"
] | import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; | import java.lang.annotation.*; import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 1,326,715 |
public void setExternalIdSearchType(ExternalIdSearchType type) {
if (getExternalIdSearch() == null) {
setExternalIdSearch(ExternalIdSearch.of(type));
} else {
setExternalIdSearch(getExternalIdSearch().withSearchType(type));
}
} | void function(ExternalIdSearchType type) { if (getExternalIdSearch() == null) { setExternalIdSearch(ExternalIdSearch.of(type)); } else { setExternalIdSearch(getExternalIdSearch().withSearchType(type)); } } | /**
* Sets the search type to use in {@code ExternalIdSearch}.
*
* @param type the type to set, not null
*/ | Sets the search type to use in ExternalIdSearch | setExternalIdSearchType | {
"repo_name": "ChinaQuants/OG-Platform",
"path": "projects/OG-Master/src/main/java/com/opengamma/master/exchange/ExchangeSearchRequest.java",
"license": "apache-2.0",
"size": 17411
} | [
"com.opengamma.id.ExternalIdSearch",
"com.opengamma.id.ExternalIdSearchType"
] | import com.opengamma.id.ExternalIdSearch; import com.opengamma.id.ExternalIdSearchType; | import com.opengamma.id.*; | [
"com.opengamma.id"
] | com.opengamma.id; | 1,387,205 |
public Server addHandler(LogEventHandler handler) {
if (hasStarted.get()) {
throw new IllegalStateException("Cannot add LogEventHandler after server started");
}
dispatcher.addHandler(handler);
return this;
} | Server function(LogEventHandler handler) { if (hasStarted.get()) { throw new IllegalStateException(STR); } dispatcher.addHandler(handler); return this; } | /**
* Add a log handler to the server. This can only be done before
* the server is started.
*
* @param handler the LogEventHandler we wish to add to the
* server.
*/ | Add a log handler to the server. This can only be done before the server is started | addHandler | {
"repo_name": "Cloudname/cloudname",
"path": "timber/src/main/java/org/cloudname/timber/server/Server.java",
"license": "apache-2.0",
"size": 4016
} | [
"org.cloudname.timber.server.handler.LogEventHandler"
] | import org.cloudname.timber.server.handler.LogEventHandler; | import org.cloudname.timber.server.handler.*; | [
"org.cloudname.timber"
] | org.cloudname.timber; | 510,452 |
public IElementType advance() throws java.io.IOException {
int zzInput;
int zzAction;
// cached fields:
int zzCurrentPosL;
int zzMarkedPosL;
int zzEndReadL = zzEndRead;
CharSequence zzBufferL = zzBuffer;
char[] zzBufferArrayL = zzBufferArray;
char [] zzCMapL = ZZ_CMAP;
int []... | IElementType function() throws java.io.IOException { int zzInput; int zzAction; int zzCurrentPosL; int zzMarkedPosL; int zzEndReadL = zzEndRead; CharSequence zzBufferL = zzBuffer; char[] zzBufferArrayL = zzBufferArray; char [] zzCMapL = ZZ_CMAP; int [] zzTransL = ZZ_TRANS; int [] zzRowMapL = ZZ_ROWMAP; int [] zzAttrL =... | /**
* Resumes scanning until the next regular expression is matched,
* the end of input is encountered or an I/O-Error occurs.
*
* @return the next token
* @exception java.io.IOException if any I/O-Error occurs
*/ | Resumes scanning until the next regular expression is matched, the end of input is encountered or an I/O-Error occurs | advance | {
"repo_name": "salguarnieri/intellij-community",
"path": "plugins/yaml/gen/org/jetbrains/yaml/lexer/_YAMLLexer.java",
"license": "apache-2.0",
"size": 41040
} | [
"com.intellij.psi.tree.IElementType"
] | import com.intellij.psi.tree.IElementType; | import com.intellij.psi.tree.*; | [
"com.intellij.psi"
] | com.intellij.psi; | 1,647,842 |
private void addBundleHelper(WriteTuple tuple) {
boolean tupleProcessed = false;
while (!tupleProcessed) {
try {
if (waitForDiskFlushThread) {
buffer.put(tuple);
tupleProcessed = true;
... | void function(WriteTuple tuple) { boolean tupleProcessed = false; while (!tupleProcessed) { try { if (waitForDiskFlushThread) { buffer.put(tuple); tupleProcessed = true; } else { tupleProcessed = buffer.offer(tuple); } } catch (InterruptedException e) { log.error(STR, e); tupleProcessed = true; setErrorCause(new IOExce... | /**
* Helper function to {@link #addBundle} method. Returns
* when no further processing is needed on the input
* tuple. Method returns when the bundle is successfully
* inserted into the buffer or when an exception is thrown.
*/ | Helper function to <code>#addBundle</code> method. Returns when no further processing is needed on the input tuple. Method returns when the bundle is successfully inserted into the buffer or when an exception is thrown | addBundleHelper | {
"repo_name": "mythguided/hydra",
"path": "hydra-task/src/main/java/com/addthis/hydra/task/output/AbstractOutputWriter.java",
"license": "apache-2.0",
"size": 14218
} | [
"java.io.IOException",
"java.util.List"
] | import java.io.IOException; import java.util.List; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 1,293,778 |
public void addSimpleIndexKey(byte[] bytes) {
this.simpleIndexKeys.add(new ByteArrayWrapper(bytes));
} | void function(byte[] bytes) { this.simpleIndexKeys.add(new ByteArrayWrapper(bytes)); } | /**
* Add keys the id of the current object is added to on save.
*
* @param bytes
*/ | Add keys the id of the current object is added to on save | addSimpleIndexKey | {
"repo_name": "christophstrobl/spring-data-keyvalue-redis",
"path": "src/main/java/org/springframework/data/keyvalue/redis/convert/RedisData.java",
"license": "apache-2.0",
"size": 4941
} | [
"org.springframework.data.redis.connection.util.ByteArrayWrapper"
] | import org.springframework.data.redis.connection.util.ByteArrayWrapper; | import org.springframework.data.redis.connection.util.*; | [
"org.springframework.data"
] | org.springframework.data; | 2,511,585 |
void removeRow(int row)
{
SheetRangeImpl sr = null;
Iterator i = ranges.iterator();
while (i.hasNext())
{
sr = (SheetRangeImpl) i.next();
if (sr.getTopLeft().getRow() == row &&
sr.getBottomRight().getRow() == row)
{
// The row with the merged cells on has been r... | void removeRow(int row) { SheetRangeImpl sr = null; Iterator i = ranges.iterator(); while (i.hasNext()) { sr = (SheetRangeImpl) i.next(); if (sr.getTopLeft().getRow() == row && sr.getBottomRight().getRow() == row) { i.remove(); } else { sr.removeRow(row); } } } | /**
* Used to adjust the merged cells following a row removal
*/ | Used to adjust the merged cells following a row removal | removeRow | {
"repo_name": "miraculix0815/jexcelapi",
"path": "src/jxl/write/biff/MergedCells.java",
"license": "lgpl-3.0",
"size": 7807
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 2,779,945 |
public String getStyleSheetURI() {
WebXDocumentImpl webxDoc = (WebXDocumentImpl) getOwnerDocument();
ParsedURL url = webxDoc.getParsedURL();
String href = (String)getPseudoAttributes().get("href");
if (url != null) {
return new ParsedURL(url, href).toString();
}
return hr... | String function() { WebXDocumentImpl webxDoc = (WebXDocumentImpl) getOwnerDocument(); ParsedURL url = webxDoc.getParsedURL(); String href = (String)getPseudoAttributes().get("href"); if (url != null) { return new ParsedURL(url, href).toString(); } return href; } | /**
* Returns the URI of the referenced stylesheet.
*/ | Returns the URI of the referenced stylesheet | getStyleSheetURI | {
"repo_name": "ggeorg/WebXView",
"path": "src/plasma/webx/dom/impl/WebXStyleSheetProcessingInstruction.java",
"license": "apache-2.0",
"size": 3021
} | [
"org.apache.batik.util.ParsedURL"
] | import org.apache.batik.util.ParsedURL; | import org.apache.batik.util.*; | [
"org.apache.batik"
] | org.apache.batik; | 1,465,618 |
public void applyInlineStyle(Object node, boolean applyStylesToChildNodes)
throws IOException;
| void function(Object node, boolean applyStylesToChildNodes) throws IOException; | /**
* Apply inline style of the object node. If
* <code>applyStylesToChildNodes</code> is true, apply style inline to the
* child nodes (ex : if node is SWT Composite, styles are applied to the
* child controls too).
*
* @param node
* @param applyStylesToChildNodes
* @throws IOException
*/ | Apply inline style of the object node. If <code>applyStylesToChildNodes</code> is true, apply style inline to the child nodes (ex : if node is SWT Composite, styles are applied to the child controls too) | applyInlineStyle | {
"repo_name": "bdaum/zoraPD",
"path": "com.bdaum.zoom.css/src/org/akrogen/tkui/css/core/engine/CSSEngine.java",
"license": "gpl-2.0",
"size": 12756
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 500,184 |
return new TestSuite(XYImageAnnotationTests.class);
}
public XYImageAnnotationTests(String name) {
super(name);
} | return new TestSuite(XYImageAnnotationTests.class); } public XYImageAnnotationTests(String name) { super(name); } | /**
* Returns the tests as a test suite.
*
* @return The test suite.
*/ | Returns the tests as a test suite | suite | {
"repo_name": "JSansalone/JFreeChart",
"path": "tests/org/jfree/chart/annotations/junit/XYImageAnnotationTests.java",
"license": "lgpl-2.1",
"size": 5241
} | [
"junit.framework.TestSuite"
] | import junit.framework.TestSuite; | import junit.framework.*; | [
"junit.framework"
] | junit.framework; | 1,208,581 |
public boolean merge(final Subroutine subroutine) {
boolean changed = false;
for (int i = 0; i < localsUsed.length; ++i) {
if (subroutine.localsUsed[i] && !localsUsed[i]) {
localsUsed[i] = true;
changed = true;
}
}
if (subroutine.start == start) {
for (int i = 0; i < ... | boolean function(final Subroutine subroutine) { boolean changed = false; for (int i = 0; i < localsUsed.length; ++i) { if (subroutine.localsUsed[i] && !localsUsed[i]) { localsUsed[i] = true; changed = true; } } if (subroutine.start == start) { for (int i = 0; i < subroutine.callers.size(); ++i) { JumpInsnNode caller = ... | /**
* Merges the given subroutine into this subroutine. The local variables read or written by the
* given subroutine are marked as read or written by this one, and the callers of the given
* subroutine are added as callers of this one (if both have the same start).
*
* @param subroutine another subrouti... | Merges the given subroutine into this subroutine. The local variables read or written by the given subroutine are marked as read or written by this one, and the callers of the given subroutine are added as callers of this one (if both have the same start) | merge | {
"repo_name": "apache/tapestry-5",
"path": "plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/analysis/Subroutine.java",
"license": "apache-2.0",
"size": 4223
} | [
"org.apache.tapestry5.internal.plastic.asm.tree.JumpInsnNode"
] | import org.apache.tapestry5.internal.plastic.asm.tree.JumpInsnNode; | import org.apache.tapestry5.internal.plastic.asm.tree.*; | [
"org.apache.tapestry5"
] | org.apache.tapestry5; | 365,623 |
public void assertIsEmptyFile(AssertionInfo info, File actual) {
assertIsFile(info, actual);
if (actual.length() == 0) return;
throw failures.failure(info, shouldBeEmpty(actual));
} | void function(AssertionInfo info, File actual) { assertIsFile(info, actual); if (actual.length() == 0) return; throw failures.failure(info, shouldBeEmpty(actual)); } | /**
* Asserts that the given {@code File} is empty (i.e. size is equal to zero bytes).
* @param info contains information about the assertion.
* @param actual the given file.
* @throws AssertionError if the given {@code File} is {@code null}.
* @throws AssertionError if the given {@code File} does not ex... | Asserts that the given File is empty (i.e. size is equal to zero bytes) | assertIsEmptyFile | {
"repo_name": "joel-costigliola/assertj-core",
"path": "src/main/java/org/assertj/core/internal/Files.java",
"license": "apache-2.0",
"size": 27343
} | [
"java.io.File",
"org.assertj.core.api.AssertionInfo",
"org.assertj.core.error.ShouldBeEmpty"
] | import java.io.File; import org.assertj.core.api.AssertionInfo; import org.assertj.core.error.ShouldBeEmpty; | import java.io.*; import org.assertj.core.api.*; import org.assertj.core.error.*; | [
"java.io",
"org.assertj.core"
] | java.io; org.assertj.core; | 1,290,872 |
public Instruction loadDOM() {
return _aloadDom;
} | Instruction function() { return _aloadDom; } | /**
* Get index of the register where the DOM is stored.
*/ | Get index of the register where the DOM is stored | loadDOM | {
"repo_name": "shun634501730/java_source_cn",
"path": "src_en/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MatchGenerator.java",
"license": "apache-2.0",
"size": 3258
} | [
"com.sun.org.apache.bcel.internal.generic.Instruction"
] | import com.sun.org.apache.bcel.internal.generic.Instruction; | import com.sun.org.apache.bcel.internal.generic.*; | [
"com.sun.org"
] | com.sun.org; | 305,906 |
private boolean highlightAsAttribute(@Nonnull PyQualifiedExpression node, @Nonnull String name)
{
final LanguageLevel languageLevel = LanguageLevel.forElement(node);
if(PyNames.UnderscoredAttributes.contains(name) || PyNames.getBuiltinMethods(languageLevel).containsKey(name))
{
// things like __len__: foo.... | boolean function(@Nonnull PyQualifiedExpression node, @Nonnull String name) { final LanguageLevel languageLevel = LanguageLevel.forElement(node); if(PyNames.UnderscoredAttributes.contains(name) PyNames.getBuiltinMethods(languageLevel).containsKey(name)) { if(node.isQualified() ScopeUtil.getScopeOwner(node) instanceof P... | /**
* Try to highlight a node as a class attribute.
*
* @param node what to work with
* @return true iff the node was highlighted.
*/ | Try to highlight a node as a class attribute | highlightAsAttribute | {
"repo_name": "consulo/consulo-python",
"path": "python-impl/src/main/java/com/jetbrains/python/validation/PyBuiltinAnnotator.java",
"license": "apache-2.0",
"size": 3438
} | [
"com.intellij.lang.ASTNode",
"com.intellij.lang.annotation.Annotation",
"com.jetbrains.python.PyNames",
"com.jetbrains.python.PyTokenTypes",
"com.jetbrains.python.codeInsight.dataflow.scope.ScopeUtil",
"com.jetbrains.python.highlighting.PyHighlighter",
"com.jetbrains.python.psi.LanguageLevel",
"com.je... | import com.intellij.lang.ASTNode; import com.intellij.lang.annotation.Annotation; import com.jetbrains.python.PyNames; import com.jetbrains.python.PyTokenTypes; import com.jetbrains.python.codeInsight.dataflow.scope.ScopeUtil; import com.jetbrains.python.highlighting.PyHighlighter; import com.jetbrains.python.psi.Langu... | import com.intellij.lang.*; import com.intellij.lang.annotation.*; import com.jetbrains.python.*; import com.jetbrains.python.highlighting.*; import com.jetbrains.python.psi.*; import javax.annotation.*; | [
"com.intellij.lang",
"com.jetbrains.python",
"javax.annotation"
] | com.intellij.lang; com.jetbrains.python; javax.annotation; | 133,596 |
public Integer getJvmMemPoolIndex() throws SnmpStatusException {
return new Integer(jvmMemPoolIndex);
} | Integer function() throws SnmpStatusException { return new Integer(jvmMemPoolIndex); } | /**
* Getter for the "JvmMemPoolIndex" variable.
*/ | Getter for the "JvmMemPoolIndex" variable | getJvmMemPoolIndex | {
"repo_name": "isaacl/openjdk-jdk",
"path": "src/share/classes/sun/management/snmp/jvminstr/JvmMemPoolEntryImpl.java",
"license": "gpl-2.0",
"size": 17045
} | [
"com.sun.jmx.snmp.SnmpStatusException"
] | import com.sun.jmx.snmp.SnmpStatusException; | import com.sun.jmx.snmp.*; | [
"com.sun.jmx"
] | com.sun.jmx; | 372,267 |
@Deprecated
@InterfaceAudience.Private
public static byte [] createRegionName(final TableName tableName,
final byte [] startKey, final long regionid, int replicaId, boolean newFormat) {
return RegionInfo.createRegionName(tableName, startKey, Bytes.toBytes(Long.toString(regionid)),
replicaId, new... | @InterfaceAudience.Private static byte [] function(final TableName tableName, final byte [] startKey, final long regionid, int replicaId, boolean newFormat) { return RegionInfo.createRegionName(tableName, startKey, Bytes.toBytes(Long.toString(regionid)), replicaId, newFormat); } | /**
* Make a region name of passed parameters.
* @param tableName
* @param startKey Can be null
* @param regionid Region id (Usually timestamp from when region was created).
* @param replicaId
* @param newFormat should we create the region name in the new format
* (such that it con... | Make a region name of passed parameters | createRegionName | {
"repo_name": "JingchengDu/hbase",
"path": "hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java",
"license": "apache-2.0",
"size": 37163
} | [
"org.apache.hadoop.hbase.client.RegionInfo",
"org.apache.hadoop.hbase.util.Bytes",
"org.apache.yetus.audience.InterfaceAudience"
] | import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.util.Bytes; import org.apache.yetus.audience.InterfaceAudience; | import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.util.*; import org.apache.yetus.audience.*; | [
"org.apache.hadoop",
"org.apache.yetus"
] | org.apache.hadoop; org.apache.yetus; | 2,387,324 |
public void setSelectedDriver(DatabaseDriver driver) {
parent.setSelectedDriver(driver);
} | void function(DatabaseDriver driver) { parent.setSelectedDriver(driver); } | /**
* Sets the selected driver tree node to the specified driver.
*
* @param driver - the driver to select
*/ | Sets the selected driver tree node to the specified driver | setSelectedDriver | {
"repo_name": "takisd123/executequery",
"path": "src/org/executequery/gui/drivers/DriverViewPanel.java",
"license": "gpl-3.0",
"size": 4211
} | [
"org.executequery.databasemediators.DatabaseDriver"
] | import org.executequery.databasemediators.DatabaseDriver; | import org.executequery.databasemediators.*; | [
"org.executequery.databasemediators"
] | org.executequery.databasemediators; | 1,652,073 |
public Object instantiateObject(String expr){
try {
Object result = evaluate(expr);
if (result != null && ! result.getClass().getName().startsWith("java.lang.")) {
//special case of the date in which case jdk.nashorn.api.scripting.ScriptObjectMirror will
... | Object function(String expr){ try { Object result = evaluate(expr); if (result != null && ! result.getClass().getName().startsWith(STR)) { JsDate jsDate = ((Invocable) engine).getInterface(result, JsDate.class); if (jsDate != null ) { Date date = new Date(jsDate.getTime() + jsDate.getTimezoneOffset() * 60 * 1000); Cale... | /**
* Instantiate object from expression
* @param expr
* @return
*/ | Instantiate object from expression | instantiateObject | {
"repo_name": "Nimco/sling",
"path": "contrib/extensions/sling-pipes/src/main/java/org/apache/sling/pipes/PipeBindings.java",
"license": "apache-2.0",
"size": 8902
} | [
"java.util.Calendar",
"java.util.Date",
"javax.script.Invocable",
"javax.script.ScriptException"
] | import java.util.Calendar; import java.util.Date; import javax.script.Invocable; import javax.script.ScriptException; | import java.util.*; import javax.script.*; | [
"java.util",
"javax.script"
] | java.util; javax.script; | 1,843,391 |
public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Messages.SimpleResponse> unaryCall(
io.grpc.testing.integration.Messages.SimpleRequest request) {
return futureUnaryCall(
getChannel().newCall(METHOD_UNARY_CALL, getCallOptions()), request);
}
}
pr... | com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Messages.SimpleResponse> function( io.grpc.testing.integration.Messages.SimpleRequest request) { return futureUnaryCall( getChannel().newCall(METHOD_UNARY_CALL, getCallOptions()), request); } } private static final int METHODID_EMPTY_CALL = ... | /**
* <pre>
* One request followed by one response.
* </pre>
*/ | <code> One request followed by one response. </code> | unaryCall | {
"repo_name": "xzy256/grpc-java-mips64",
"path": "interop-testing/src/generated/main/grpc/io/grpc/testing/integration/TestServiceGrpc.java",
"license": "bsd-3-clause",
"size": 22514
} | [
"io.grpc.stub.ClientCalls"
] | import io.grpc.stub.ClientCalls; | import io.grpc.stub.*; | [
"io.grpc.stub"
] | io.grpc.stub; | 1,630,145 |
public void estimatePoseVelocity() {
m_currentTime = Timer.getFPGATimestamp();
m_deltaTime = m_currentTime - m_lastTime;
m_lastTime = m_currentTime;
m_newPose = Kinematics.getNewPose(m_lastPose, m_rightVelocity, m_leftVelocity, m_deltaTime);
m_newPose.setTimestamp(m_currentTime);
m_lastPose = m_newPose;
... | void function() { m_currentTime = Timer.getFPGATimestamp(); m_deltaTime = m_currentTime - m_lastTime; m_lastTime = m_currentTime; m_newPose = Kinematics.getNewPose(m_lastPose, m_rightVelocity, m_leftVelocity, m_deltaTime); m_newPose.setTimestamp(m_currentTime); m_lastPose = m_newPose; } | /**
* Pose estimation based on velocity
*/ | Pose estimation based on velocity | estimatePoseVelocity | {
"repo_name": "tedklin/NerdyDrive",
"path": "src/com/team687/frc2017/Odometry.java",
"license": "mit",
"size": 4191
} | [
"com.team687.frc2017.utilities.Kinematics",
"edu.wpi.first.wpilibj.Timer"
] | import com.team687.frc2017.utilities.Kinematics; import edu.wpi.first.wpilibj.Timer; | import com.team687.frc2017.utilities.*; import edu.wpi.first.wpilibj.*; | [
"com.team687.frc2017",
"edu.wpi.first"
] | com.team687.frc2017; edu.wpi.first; | 1,714,682 |
public MappingAddress getAddress() {
return address;
} | MappingAddress function() { return address; } | /**
* Obtains address.
*
* @return address
*/ | Obtains address | getAddress | {
"repo_name": "gkatsikas/onos",
"path": "drivers/lisp/src/main/java/org/onosproject/drivers/lisp/extensions/LispSegmentAddress.java",
"license": "apache-2.0",
"size": 4832
} | [
"org.onosproject.mapping.addresses.MappingAddress"
] | import org.onosproject.mapping.addresses.MappingAddress; | import org.onosproject.mapping.addresses.*; | [
"org.onosproject.mapping"
] | org.onosproject.mapping; | 2,341,698 |
@SmallTest
public void testRetryManageInfinite() throws Exception {
RetryManager rm = new RetryManager();
assertTrue(rm.configure("1000,2000,3000,max_retries=infinite"));
assertTrue(rm.isRetryNeeded());
assertEquals(1000, rm.getRetryTimer());
rm.increaseRetryCount();
... | void function() throws Exception { RetryManager rm = new RetryManager(); assertTrue(rm.configure(STR)); assertTrue(rm.isRetryNeeded()); assertEquals(1000, rm.getRetryTimer()); rm.increaseRetryCount(); assertTrue(rm.isRetryNeeded()); assertEquals(2000, rm.getRetryTimer()); rm.increaseRetryCount(); assertTrue(rm.isRetryN... | /**
* Test infinite retires
*/ | Test infinite retires | testRetryManageInfinite | {
"repo_name": "JSDemos/android-sdk-20",
"path": "src/com/android/internal/telephony/TelephonyUtilsTest.java",
"license": "apache-2.0",
"size": 7144
} | [
"com.android.internal.telephony.RetryManager"
] | import com.android.internal.telephony.RetryManager; | import com.android.internal.telephony.*; | [
"com.android.internal"
] | com.android.internal; | 1,022,405 |
public List<String> getAgentListLoggedIn(final Discipline discipline)
{
StringBuilder sb = new StringBuilder();
sb.append("SELECT specifyuser.SpecifyUserID from specifyuser ");
sb.append(" WHERE specifyuser.IsLoggedIn <> 0 and loginDisciplineName = '" + discipline.getName() + "'... | List<String> function(final Discipline discipline) { StringBuilder sb = new StringBuilder(); sb.append(STR); sb.append(STR + discipline.getName() + "'"); SpecifyUser spUser = getClassObject(SpecifyUser.class); sb.append(STR + spUser.getId()); Vector<Integer> ids = new Vector<Integer>(); Vector<Object[]> idList = BasicS... | /**
* Returns a list of pre-formatted Agent names of those that are logged in.
* Note: the current logged in person is not added to the list.
* @param discipline the current discipline (if null no discipline restrictions are applied)
* @return null on error, an empty list if no one else is logged in... | Returns a list of pre-formatted Agent names of those that are logged in. Note: the current logged in person is not added to the list | getAgentListLoggedIn | {
"repo_name": "specify/specify6",
"path": "src/edu/ku/brc/specify/config/SpecifyAppContextMgr.java",
"license": "gpl-2.0",
"size": 143740
} | [
"edu.ku.brc.dbsupport.DataProviderFactory",
"edu.ku.brc.dbsupport.DataProviderSessionIFace",
"edu.ku.brc.specify.conversion.BasicSQLUtils",
"edu.ku.brc.specify.datamodel.Agent",
"edu.ku.brc.specify.datamodel.Discipline",
"edu.ku.brc.specify.datamodel.SpecifyUser",
"java.util.List",
"java.util.Vector"
... | import edu.ku.brc.dbsupport.DataProviderFactory; import edu.ku.brc.dbsupport.DataProviderSessionIFace; import edu.ku.brc.specify.conversion.BasicSQLUtils; import edu.ku.brc.specify.datamodel.Agent; import edu.ku.brc.specify.datamodel.Discipline; import edu.ku.brc.specify.datamodel.SpecifyUser; import java.util.List; im... | import edu.ku.brc.dbsupport.*; import edu.ku.brc.specify.conversion.*; import edu.ku.brc.specify.datamodel.*; import java.util.*; | [
"edu.ku.brc",
"java.util"
] | edu.ku.brc; java.util; | 2,740,177 |
private HazelcastJsonValue createJsonValueWithRandomStructure(String[] names, String[] values) {
Random random = new Random();
for (int i = names.length - 1; i > 0; i--) {
int swapIndex = random.nextInt(i + 1);
String tempName = names[i];
names[i] = names[swapInde... | HazelcastJsonValue function(String[] names, String[] values) { Random random = new Random(); for (int i = names.length - 1; i > 0; i--) { int swapIndex = random.nextInt(i + 1); String tempName = names[i]; names[i] = names[swapIndex]; names[swapIndex] = tempName; String tempValue = values[i]; values[i] = values[swapInde... | /**
* Creates a one level json object from given names and values. Each
* value is associated with the respective name in given order. However,
* the order of name-value pairs within object are random
* @param names
* @param values
* @return
*/ | Creates a one level json object from given names and values. Each value is associated with the respective name in given order. However, the order of name-value pairs within object are random | createJsonValueWithRandomStructure | {
"repo_name": "mdogan/hazelcast",
"path": "hazelcast/src/test/java/com/hazelcast/query/impl/getters/AbstractJsonGetterTest.java",
"license": "apache-2.0",
"size": 8293
} | [
"com.hazelcast.core.HazelcastJsonValue",
"com.hazelcast.internal.json.Json",
"com.hazelcast.internal.json.JsonObject",
"java.util.Random"
] | import com.hazelcast.core.HazelcastJsonValue; import com.hazelcast.internal.json.Json; import com.hazelcast.internal.json.JsonObject; import java.util.Random; | import com.hazelcast.core.*; import com.hazelcast.internal.json.*; import java.util.*; | [
"com.hazelcast.core",
"com.hazelcast.internal",
"java.util"
] | com.hazelcast.core; com.hazelcast.internal; java.util; | 2,848,275 |
public ServiceFuture<List<FaceList>> listAsync(final ServiceCallback<List<FaceList>> serviceCallback) {
return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback);
} | ServiceFuture<List<FaceList>> function(final ServiceCallback<List<FaceList>> serviceCallback) { return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); } | /**
* Retrieve information about all existing face lists. Only faceListId, name and userData will be returned.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return th... | Retrieve information about all existing face lists. Only faceListId, name and userData will be returned | listAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/cognitiveservices/ms-azure-cs-faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/FaceListsImpl.java",
"license": "mit",
"size": 58127
} | [
"com.microsoft.azure.cognitiveservices.vision.faceapi.models.FaceList",
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceFuture",
"java.util.List"
] | import com.microsoft.azure.cognitiveservices.vision.faceapi.models.FaceList; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import java.util.List; | import com.microsoft.azure.cognitiveservices.vision.faceapi.models.*; import com.microsoft.rest.*; import java.util.*; | [
"com.microsoft.azure",
"com.microsoft.rest",
"java.util"
] | com.microsoft.azure; com.microsoft.rest; java.util; | 2,493,103 |
public void onTick(LivingEntity target, RpgPotionEffect effect);
| void function(LivingEntity target, RpgPotionEffect effect); | /**
* Triggers when the potion effect ticks.
*
* @param target
* The target of this effect.
* @param effect
* The detail of the effect.
* @author HomieDion
* @since 1.0.0
*/ | Triggers when the potion effect ticks | onTick | {
"repo_name": "homiedion/RpgCore",
"path": "src/main/java/com/homiedion/rpgcore/container/potioneffect/RpgPotionEffectType.java",
"license": "mit",
"size": 1437
} | [
"org.bukkit.entity.LivingEntity"
] | import org.bukkit.entity.LivingEntity; | import org.bukkit.entity.*; | [
"org.bukkit.entity"
] | org.bukkit.entity; | 2,413,787 |
public void toggleShelf(ActionEvent event)
{
this.shelfExpanded = !this.shelfExpanded;
} | void function(ActionEvent event) { this.shelfExpanded = !this.shelfExpanded; } | /**
* Action handler to toggle the expanded state of the shelf.
* The panel component wrapping the shelf area of the UI is value bound to the shelfExpanded property.
*/ | Action handler to toggle the expanded state of the shelf. The panel component wrapping the shelf area of the UI is value bound to the shelfExpanded property | toggleShelf | {
"repo_name": "nguyentienlong/community-edition",
"path": "projects/web-client/source/java/org/alfresco/web/bean/NavigationBean.java",
"license": "lgpl-3.0",
"size": 41146
} | [
"javax.faces.event.ActionEvent"
] | import javax.faces.event.ActionEvent; | import javax.faces.event.*; | [
"javax.faces"
] | javax.faces; | 1,073,703 |
public static String getLauncherName(Context context) {
// Get name of launcher (we don't want to kill him yet!)
Intent home = new Intent("android.intent.action.MAIN");
home.addCategory("android.intent.category.HOME");
final ResolveInfo mInfo = context.getPackageMan... | static String function(Context context) { Intent home = new Intent(STR); home.addCategory(STR); final ResolveInfo mInfo = context.getPackageManager().resolveActivity(home, 0); return mInfo.activityInfo.processName; } | /**
* Get launcher name
*
* @param context application context. Can not be null.
* @see <a href="https://www.linkedin.com/groups/How-close-all-activities-in-86481.S.235755042">
* Neeraj R. - How-close-all-activities...</a>
*/ | Get launcher name | getLauncherName | {
"repo_name": "beegee-tokyo/coolit",
"path": "app/src/main/java/tk/giesecke/coolit/CoolIt.java",
"license": "gpl-2.0",
"size": 15986
} | [
"android.content.Context",
"android.content.Intent",
"android.content.pm.ResolveInfo"
] | import android.content.Context; import android.content.Intent; import android.content.pm.ResolveInfo; | import android.content.*; import android.content.pm.*; | [
"android.content"
] | android.content; | 2,622,402 |
private Result pBitwiseAndExpression$$Tail1(final int yyStart)
throws IOException {
Result yyResult;
Action<Node> yyValue;
ParseError yyError = ParseError.DUMMY;
// Alternative <And>.
yyResult = pSymbol(yyStart);
if (yyResult.hasValue("&")) {
yyResult = pEqualityExpressi... | private Result pBitwiseAndExpression$$Tail1(final int yyStart) throws IOException { Result yyResult; Action<Node> yyValue; ParseError yyError = ParseError.DUMMY; yyResult = pSymbol(yyStart); if (yyResult.hasValue("&")) { yyResult = pEqualityExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.ha... | /**
* Parse synthetic nonterminal
* xtc.lang.JavaFive.BitwiseAndExpression$$Tail1.
*
* @param yyStart The index.
* @return The result.
* @throws IOException Signals an I/O error.
*/ | Parse synthetic nonterminal xtc.lang.JavaFive.BitwiseAndExpression$$Tail1 | pBitwiseAndExpression$$Tail1 | {
"repo_name": "wandoulabs/xtc-rats",
"path": "xtc-core/src/main/java/xtc/lang/JavaFiveParser.java",
"license": "lgpl-2.1",
"size": 313913
} | [
"java.io.IOException",
"xtc.parser.ParseError",
"xtc.parser.Result",
"xtc.tree.Node",
"xtc.util.Action"
] | import java.io.IOException; import xtc.parser.ParseError; import xtc.parser.Result; import xtc.tree.Node; import xtc.util.Action; | import java.io.*; import xtc.parser.*; import xtc.tree.*; import xtc.util.*; | [
"java.io",
"xtc.parser",
"xtc.tree",
"xtc.util"
] | java.io; xtc.parser; xtc.tree; xtc.util; | 2,746,265 |
public void testAddNull() {
TreeSet q = populatedSet(SIZE);
try {
q.add(null);
shouldThrow();
} catch (NullPointerException success) {}
} | void function() { TreeSet q = populatedSet(SIZE); try { q.add(null); shouldThrow(); } catch (NullPointerException success) {} } | /**
* add(null) throws NPE if nonempty
*/ | add(null) throws NPE if nonempty | testAddNull | {
"repo_name": "AdmireTheDistance/android_libcore",
"path": "jsr166-tests/src/test/java/jsr166/TreeSetTest.java",
"license": "gpl-2.0",
"size": 29478
} | [
"java.util.TreeSet"
] | import java.util.TreeSet; | import java.util.*; | [
"java.util"
] | java.util; | 1,212,610 |
protected Role createOrUpdateModelRole(SecurityModel newSecurityModel) {
RoleService roleService = KimApiServiceLocator.getRoleService();
// the roles are created in the KFS-SEC namespace with the same name as the model
Role modelRole = roleService.getRoleByNamespaceCodeAndName(KFSConstants... | Role function(SecurityModel newSecurityModel) { RoleService roleService = KimApiServiceLocator.getRoleService(); Role modelRole = roleService.getRoleByNamespaceCodeAndName(KFSConstants.CoreModuleNamespaces.ACCESS_SECURITY, newSecurityModel.getName()); if ( modelRole != null ) { Role.Builder updatedRole = Role.Builder.c... | /**
* Creates a new role for the model (if the model is new), otherwise updates the role
*
* @param oldSecurityModel SecurityModel record before updates
* @param newSecurityModel SecurityModel after updates
*/ | Creates a new role for the model (if the model is new), otherwise updates the role | createOrUpdateModelRole | {
"repo_name": "Ariah-Group/Finance",
"path": "af_webapp/src/main/java/org/kuali/kfs/sec/document/SecurityModelMaintainableImpl.java",
"license": "apache-2.0",
"size": 14518
} | [
"org.kuali.kfs.sec.businessobject.SecurityModel",
"org.kuali.kfs.sys.KFSConstants",
"org.kuali.rice.kim.api.role.Role",
"org.kuali.rice.kim.api.role.RoleService",
"org.kuali.rice.kim.api.services.KimApiServiceLocator"
] | import org.kuali.kfs.sec.businessobject.SecurityModel; import org.kuali.kfs.sys.KFSConstants; import org.kuali.rice.kim.api.role.Role; import org.kuali.rice.kim.api.role.RoleService; import org.kuali.rice.kim.api.services.KimApiServiceLocator; | import org.kuali.kfs.sec.businessobject.*; import org.kuali.kfs.sys.*; import org.kuali.rice.kim.api.role.*; import org.kuali.rice.kim.api.services.*; | [
"org.kuali.kfs",
"org.kuali.rice"
] | org.kuali.kfs; org.kuali.rice; | 1,089,402 |
public BitmapDrawable getBitmapFromMemCache(String data) {
//BEGIN_INCLUDE(get_bitmap_from_mem_cache)
BitmapDrawable memValue = null;
if (mMemoryCache != null) {
memValue = mMemoryCache.get(data);
}
if (BuildConfig.DEBUG && memValue != null) {
Log.d(... | BitmapDrawable function(String data) { BitmapDrawable memValue = null; if (mMemoryCache != null) { memValue = mMemoryCache.get(data); } if (BuildConfig.DEBUG && memValue != null) { Log.d(TAG, STR); } return memValue; } | /**
* Get from memory cache.
*
* @param data Unique identifier for which item to get
* @return The bitmap drawable if found in cache, null otherwise
*/ | Get from memory cache | getBitmapFromMemCache | {
"repo_name": "zxfhacker/StocksAnalyzer",
"path": "app/src/main/java/com/alex/develop/cache/ImageCache.java",
"license": "apache-2.0",
"size": 29062
} | [
"android.graphics.drawable.BitmapDrawable",
"android.util.Log",
"com.alex.develop.stockanalyzer.BuildConfig"
] | import android.graphics.drawable.BitmapDrawable; import android.util.Log; import com.alex.develop.stockanalyzer.BuildConfig; | import android.graphics.drawable.*; import android.util.*; import com.alex.develop.stockanalyzer.*; | [
"android.graphics",
"android.util",
"com.alex.develop"
] | android.graphics; android.util; com.alex.develop; | 562,286 |
public synchronized int pack(ByteBuffer dataOut) throws Exception {
if (dataOut.remaining() < getNumBytes())
throw new Exception("Not enough bytes in ByteBuffer to pack object");
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while (li.hasNext()) {
UAVObjectField field = li... | synchronized int function(ByteBuffer dataOut) throws Exception { if (dataOut.remaining() < getNumBytes()) throw new Exception(STR); int numBytes = 0; ListIterator<UAVObjectField> li = fields.listIterator(); while (li.hasNext()) { UAVObjectField field = li.next(); numBytes += field.pack(dataOut); } return numBytes; } | /**
* Pack the object data into a byte array
*
* @param dataOut
* ByteBuffer to receive the data.
* @throws Exception
* @returns The number of bytes copied
* @note The array must already have enough space allocated for the object
*/ | Pack the object data into a byte array | pack | {
"repo_name": "mluessi/dronin",
"path": "androidgcs/src/org/taulabs/uavtalk/UAVObject.java",
"license": "gpl-3.0",
"size": 22286
} | [
"java.nio.ByteBuffer",
"java.util.ListIterator"
] | import java.nio.ByteBuffer; import java.util.ListIterator; | import java.nio.*; import java.util.*; | [
"java.nio",
"java.util"
] | java.nio; java.util; | 894,578 |
public static Method getAtMostOneMethodWithoutArgs(Class classType, Class<? extends Annotation> annotationType,
Class returnType) {
return getAtMostOneMethod(classType, annotationType, ALWAYS_FILTER, returnType, false);
} | static Method function(Class classType, Class<? extends Annotation> annotationType, Class returnType) { return getAtMostOneMethod(classType, annotationType, ALWAYS_FILTER, returnType, false); } | /**
* Searches for an optional method without arguments of the given annotation type with a custom return type.
*
* @param classType Class to scan
* @param annotationType Type of the annotation
* @param returnType Assert the return type of the method, use <tt>null</tt> for void methods... | Searches for an optional method without arguments of the given annotation type with a custom return type | getAtMostOneMethodWithoutArgs | {
"repo_name": "gAmUssA/hazelcast-simulator",
"path": "simulator/src/main/java/com/hazelcast/simulator/utils/AnnotationReflectionUtils.java",
"license": "apache-2.0",
"size": 7671
} | [
"java.lang.annotation.Annotation",
"java.lang.reflect.Method"
] | import java.lang.annotation.Annotation; import java.lang.reflect.Method; | import java.lang.annotation.*; import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 582,106 |
public Map<String, Integer> labelFrequencies() {
return labelFrequencies;
} | Map<String, Integer> function() { return labelFrequencies; } | /**
* Gets the map of frequencies by value in partition for label.
*
* @return The frequencies.
*/ | Gets the map of frequencies by value in partition for label | labelFrequencies | {
"repo_name": "ascherbakoff/ignite",
"path": "modules/ml/src/main/java/org/apache/ignite/ml/preprocessing/encoding/EncoderPartitionData.java",
"license": "apache-2.0",
"size": 3289
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,255,929 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.