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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
public DLockRemoteToken queryLock(final Object name) {
// long statStart = getStats().startLockRelease();
try {
DLockQueryReplyMessage queryReply = null;
while (queryReply == null || queryReply.repliedNotGrantor()) {
checkDestroyed();
// TODO: consider using peekLockGrantor instea... | DLockRemoteToken function(final Object name) { try { DLockQueryReplyMessage queryReply = null; while (queryReply == null queryReply.repliedNotGrantor()) { checkDestroyed(); LockGrantorId theLockGrantorId = getLockGrantorId(); try { queryReply = DLockQueryProcessor.query(theLockGrantorId.getLockGrantorMember(), this.ser... | /**
* Query the grantor for current leasing information of a lock. Returns the current lease info.
*
* @param name the named lock to get lease information for
* @return snapshot of the remote lock information
* @throws LockServiceDestroyedException if local instance of lock service has been destroyed
... | Query the grantor for current leasing information of a lock. Returns the current lease info | queryLock | {
"repo_name": "shankarh/geode",
"path": "geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockService.java",
"license": "apache-2.0",
"size": 122176
} | [
"java.util.concurrent.TimeUnit",
"org.apache.geode.distributed.internal.locks.DLockQueryProcessor"
] | import java.util.concurrent.TimeUnit; import org.apache.geode.distributed.internal.locks.DLockQueryProcessor; | import java.util.concurrent.*; import org.apache.geode.distributed.internal.locks.*; | [
"java.util",
"org.apache.geode"
] | java.util; org.apache.geode; | 1,045,313 |
@SuppressWarnings("unchecked")
private JAXBElement<Fault> createFaultFromException(final Throwable exception) {
WebFault webFault = exception.getClass().getAnnotation(WebFault.class);
if (webFault == null || webFault.targetNamespace() == null) {
throw new RuntimeException(
... | @SuppressWarnings(STR) JAXBElement<Fault> function(final Throwable exception) { WebFault webFault = exception.getClass().getAnnotation(WebFault.class); if (webFault == null webFault.targetNamespace() == null) { throw new RuntimeException( STR + exception.getClass().getName() + STR, exception); } QName name = new QName(... | /**
* Creates a SOAP fault from the exception and populates the message as well as the detail. The detail object is
* read from the method getFaultInfo of the throwable if present
*
* @param exception the cause exception
* @return SOAP fault from given Throwable
*/ | Creates a SOAP fault from the exception and populates the message as well as the detail. The detail object is read from the method getFaultInfo of the throwable if present | createFaultFromException | {
"repo_name": "nikhilvibhav/camel",
"path": "components/camel-soap/src/main/java/org/apache/camel/dataformat/soap/Soap12DataFormatAdapter.java",
"license": "apache-2.0",
"size": 10588
} | [
"java.lang.reflect.Method",
"javax.xml.bind.JAXBElement",
"javax.xml.namespace.QName",
"javax.xml.ws.WebFault",
"org.apache.camel.RuntimeCamelException",
"org.w3._2003._05.soap_envelope.Detail",
"org.w3._2003._05.soap_envelope.Fault",
"org.w3._2003._05.soap_envelope.Faultcode",
"org.w3._2003._05.soa... | import java.lang.reflect.Method; import javax.xml.bind.JAXBElement; import javax.xml.namespace.QName; import javax.xml.ws.WebFault; import org.apache.camel.RuntimeCamelException; import org.w3._2003._05.soap_envelope.Detail; import org.w3._2003._05.soap_envelope.Fault; import org.w3._2003._05.soap_envelope.Faultcode; i... | import java.lang.reflect.*; import javax.xml.bind.*; import javax.xml.namespace.*; import javax.xml.ws.*; import org.apache.camel.*; import org.w3.*; | [
"java.lang",
"javax.xml",
"org.apache.camel",
"org.w3"
] | java.lang; javax.xml; org.apache.camel; org.w3; | 1,811,557 |
public void zkCreate(String path,
CreateMode mode,
byte[] data,
List<ACL> acls) throws IOException {
Preconditions.checkArgument(data != null, "null data");
checkServiceLive();
String fullpath = createFullPath(path);
try {
if (LOG.isDebugEnabled()) {
LOG.debug("Creating... | void function(String path, CreateMode mode, byte[] data, List<ACL> acls) throws IOException { Preconditions.checkArgument(data != null, STR); checkServiceLive(); String fullpath = createFullPath(path); try { if (LOG.isDebugEnabled()) { LOG.debug(STR, fullpath, data.length, new RegistrySecurity.AclListInfo(acls)); } cur... | /**
* Create a path with given data. byte[0] is used for a path
* without data
* @param path path of operation
* @param data initial data
* @param acls
* @throws IOException
*/ | Create a path with given data. byte[0] is used for a path without data | zkCreate | {
"repo_name": "bruthe/hadoop-2.6.0r",
"path": "src/yarn/registry/org/apache/hadoop/registry/client/impl/zk/CuratorService.java",
"license": "apache-2.0",
"size": 23994
} | [
"com.google.common.base.Preconditions",
"java.io.IOException",
"java.util.List",
"org.apache.zookeeper.CreateMode"
] | import com.google.common.base.Preconditions; import java.io.IOException; import java.util.List; import org.apache.zookeeper.CreateMode; | import com.google.common.base.*; import java.io.*; import java.util.*; import org.apache.zookeeper.*; | [
"com.google.common",
"java.io",
"java.util",
"org.apache.zookeeper"
] | com.google.common; java.io; java.util; org.apache.zookeeper; | 1,726,086 |
public static boolean isParameterOptional(String operatorKey, String parameterName) {
Operator operator = null;
int index = operatorKey.indexOf(".");
if (index != -1) {
operatorKey = operatorKey.substring(index + 1);
}
try {
OperatorDescription description = OperatorService.getOperatorDescription(ope... | static boolean function(String operatorKey, String parameterName) { Operator operator = null; int index = operatorKey.indexOf("."); if (index != -1) { operatorKey = operatorKey.substring(index + 1); } try { OperatorDescription description = OperatorService.getOperatorDescription(operatorKey); if (description == null) {... | /**
* Returns if the given parameter is optional.
*
* @param operatorKey
* The key of the operator
* @param parameterName
* The name of the parameter
* @return {@code true} if the parameter is optional. {@code false} if the parameter is not
* optional or if no parameter exi... | Returns if the given parameter is optional | isParameterOptional | {
"repo_name": "transwarpio/rapidminer",
"path": "rapidMiner/rapidminer-studio-core/src/main/java/com/rapidminer/gui/OperatorDocToHtmlConverter.java",
"license": "gpl-3.0",
"size": 27560
} | [
"com.rapidminer.operator.Operator",
"com.rapidminer.operator.OperatorCreationException",
"com.rapidminer.operator.OperatorDescription",
"com.rapidminer.parameter.ParameterType",
"com.rapidminer.parameter.Parameters",
"com.rapidminer.tools.LogService",
"com.rapidminer.tools.OperatorService",
"java.util... | import com.rapidminer.operator.Operator; import com.rapidminer.operator.OperatorCreationException; import com.rapidminer.operator.OperatorDescription; import com.rapidminer.parameter.ParameterType; import com.rapidminer.parameter.Parameters; import com.rapidminer.tools.LogService; import com.rapidminer.tools.OperatorSe... | import com.rapidminer.operator.*; import com.rapidminer.parameter.*; import com.rapidminer.tools.*; import java.util.logging.*; | [
"com.rapidminer.operator",
"com.rapidminer.parameter",
"com.rapidminer.tools",
"java.util"
] | com.rapidminer.operator; com.rapidminer.parameter; com.rapidminer.tools; java.util; | 1,223,345 |
public ImageOSDisk withSnapshot(SubResource snapshot) {
this.snapshot = snapshot;
return this;
} | ImageOSDisk function(SubResource snapshot) { this.snapshot = snapshot; return this; } | /**
* Set the snapshot value.
*
* @param snapshot the snapshot value to set
* @return the ImageOSDisk object itself.
*/ | Set the snapshot value | withSnapshot | {
"repo_name": "jianghaolu/azure-sdk-for-java",
"path": "azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageOSDisk.java",
"license": "mit",
"size": 4627
} | [
"com.microsoft.azure.SubResource"
] | import com.microsoft.azure.SubResource; | import com.microsoft.azure.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 481,898 |
public Address getVerifiedAddress(byte[] addressFile,
byte[] identitySignatureFile,
byte[] addressSignatureFile,
X509Certificate rrnCertificate) {
byte[] trimmedAddressFile = trimRight(addressFile);
PublicKey publicKey = rrnCertificate.getPublicKey();
try {
if (!verifySignat... | Address function(byte[] addressFile, byte[] identitySignatureFile, byte[] addressSignatureFile, X509Certificate rrnCertificate) { byte[] trimmedAddressFile = trimRight(addressFile); PublicKey publicKey = rrnCertificate.getPublicKey(); try { if (!verifySignature(rrnCertificate.getSigAlgName(), addressSignatureFile, publ... | /**
* Gives back a parsed address file after integrity verification.
*/ | Gives back a parsed address file after integrity verification | getVerifiedAddress | {
"repo_name": "Fedict/commons-eid",
"path": "commons-eid-consumer/src/main/java/be/bosa/commons/eid/consumer/BeIDIntegrity.java",
"license": "lgpl-3.0",
"size": 6792
} | [
"be.bosa.commons.eid.consumer.tlv.TlvParser",
"java.security.InvalidKeyException",
"java.security.NoSuchAlgorithmException",
"java.security.PublicKey",
"java.security.SignatureException",
"java.security.cert.X509Certificate"
] | import be.bosa.commons.eid.consumer.tlv.TlvParser; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.security.PublicKey; import java.security.SignatureException; import java.security.cert.X509Certificate; | import be.bosa.commons.eid.consumer.tlv.*; import java.security.*; import java.security.cert.*; | [
"be.bosa.commons",
"java.security"
] | be.bosa.commons; java.security; | 1,832,152 |
public RequestSettings setDownloadTo(File downloadTo){
this.downloadTo = downloadTo;
return this;
}
| RequestSettings function(File downloadTo){ this.downloadTo = downloadTo; return this; } | /**
* If this is not null, the resulting page will be downloaded to the
* specified file location.
* @param downloadTo The file location to download to, or null.
* @return
*/ | If this is not null, the resulting page will be downloaded to the specified file location | setDownloadTo | {
"repo_name": "dbuxo/CommandHelper",
"path": "src/main/java/com/laytonsmith/PureUtilities/Web/RequestSettings.java",
"license": "mit",
"size": 5903
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 701,228 |
@SuppressWarnings("squid:S1181") // suppress "Throwable and Error should not be caught"
// because a Future also handles Throwable, this is required for asynchronous reporting
public <T> Future<T> withConn(AsyncResult<SQLConnection> sqlConnection, Function<Conn, Future<T>> function) {
try {
if (sqlConn... | @SuppressWarnings(STR) <T> Future<T> function(AsyncResult<SQLConnection> sqlConnection, Function<Conn, Future<T>> function) { try { if (sqlConnection.failed()) { return Future.failedFuture(sqlConnection.cause()); } return function.apply(new Conn(this, sqlConnection.result().conn)); } catch (Throwable e) { log.error(e.g... | /**
* Take the connection from the {@link SQLConnection}, wrap it into a {@link Conn} and execute the function.
*
* @return the result from the function, the failure of sqlConnection or any thrown Throwable.
*/ | Take the connection from the <code>SQLConnection</code>, wrap it into a <code>Conn</code> and execute the function | withConn | {
"repo_name": "folio-org/raml-module-builder",
"path": "domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java",
"license": "apache-2.0",
"size": 164512
} | [
"io.vertx.core.AsyncResult",
"io.vertx.core.Future",
"io.vertx.pgclient.PgConnection",
"io.vertx.pgclient.PgPool",
"java.util.function.Function"
] | import io.vertx.core.AsyncResult; import io.vertx.core.Future; import io.vertx.pgclient.PgConnection; import io.vertx.pgclient.PgPool; import java.util.function.Function; | import io.vertx.core.*; import io.vertx.pgclient.*; import java.util.function.*; | [
"io.vertx.core",
"io.vertx.pgclient",
"java.util"
] | io.vertx.core; io.vertx.pgclient; java.util; | 367,350 |
public static Tag outcome(ServerWebExchange exchange) {
Integer statusCode = extractStatusCode(exchange);
Outcome outcome = (statusCode != null) ? Outcome.forStatus(statusCode) : Outcome.UNKNOWN;
return outcome.asTag();
} | static Tag function(ServerWebExchange exchange) { Integer statusCode = extractStatusCode(exchange); Outcome outcome = (statusCode != null) ? Outcome.forStatus(statusCode) : Outcome.UNKNOWN; return outcome.asTag(); } | /**
* Creates an {@code outcome} tag based on the response status of the given
* {@code exchange}.
* @param exchange the exchange
* @return the outcome tag derived from the response status
* @since 2.1.0
*/ | Creates an outcome tag based on the response status of the given exchange | outcome | {
"repo_name": "tiarebalbi/spring-boot",
"path": "spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/WebFluxTags.java",
"license": "apache-2.0",
"size": 5400
} | [
"io.micrometer.core.instrument.Tag",
"org.springframework.boot.actuate.metrics.http.Outcome",
"org.springframework.web.server.ServerWebExchange"
] | import io.micrometer.core.instrument.Tag; import org.springframework.boot.actuate.metrics.http.Outcome; import org.springframework.web.server.ServerWebExchange; | import io.micrometer.core.instrument.*; import org.springframework.boot.actuate.metrics.http.*; import org.springframework.web.server.*; | [
"io.micrometer.core",
"org.springframework.boot",
"org.springframework.web"
] | io.micrometer.core; org.springframework.boot; org.springframework.web; | 438,424 |
private TitledAjaxSubmitLink getImportButton(
final CachingDescriptorHelper cachingDescriptorHelper, Form form) {
return new TitledAjaxSubmitLink("import", "Import", form) { | TitledAjaxSubmitLink function( final CachingDescriptorHelper cachingDescriptorHelper, Form form) { return new TitledAjaxSubmitLink(STR, STR, form) { | /**
* Constructs and returns the repository import button
*
* @param form Form to associate button to
* @return Import button
*/ | Constructs and returns the repository import button | getImportButton | {
"repo_name": "alancnet/artifactory",
"path": "web/application/src/main/java/org/artifactory/webapp/wicket/page/config/repos/remote/importer/RemoteRepoImportPanel.java",
"license": "apache-2.0",
"size": 21273
} | [
"org.apache.wicket.markup.html.form.Form",
"org.artifactory.common.wicket.component.links.TitledAjaxSubmitLink",
"org.artifactory.webapp.wicket.page.config.repos.CachingDescriptorHelper"
] | import org.apache.wicket.markup.html.form.Form; import org.artifactory.common.wicket.component.links.TitledAjaxSubmitLink; import org.artifactory.webapp.wicket.page.config.repos.CachingDescriptorHelper; | import org.apache.wicket.markup.html.form.*; import org.artifactory.common.wicket.component.links.*; import org.artifactory.webapp.wicket.page.config.repos.*; | [
"org.apache.wicket",
"org.artifactory.common",
"org.artifactory.webapp"
] | org.apache.wicket; org.artifactory.common; org.artifactory.webapp; | 1,684,513 |
public Iterator getSignaturesForID(
String id)
{
return getSignaturesForID(new UserIDPacket(id));
} | Iterator function( String id) { return getSignaturesForID(new UserIDPacket(id)); } | /**
* Return any signatures associated with the passed in id.
*
* @param id the id to be matched.
* @return an iterator of PGPSignature objects.
*/ | Return any signatures associated with the passed in id | getSignaturesForID | {
"repo_name": "sergeypayu/bc-java",
"path": "pg/src/main/java/org/bouncycastle/openpgp/PGPPublicKey.java",
"license": "mit",
"size": 29755
} | [
"java.util.Iterator",
"org.bouncycastle.bcpg.UserIDPacket"
] | import java.util.Iterator; import org.bouncycastle.bcpg.UserIDPacket; | import java.util.*; import org.bouncycastle.bcpg.*; | [
"java.util",
"org.bouncycastle.bcpg"
] | java.util; org.bouncycastle.bcpg; | 1,237,815 |
public void setRole(List<RoleEntity> role) {
this.authorities = role;
} | void function(List<RoleEntity> role) { this.authorities = role; } | /**
* Setter role property
*
* @param role
*/ | Setter role property | setRole | {
"repo_name": "raulsuarezdabo/flight",
"path": "src/main/java/com/raulsuarezdabo/flight/entity/UserEntity.java",
"license": "mit",
"size": 10458
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,050,459 |
public DateTime executionStateTransitionTime() {
return this.executionStateTransitionTime;
} | DateTime function() { return this.executionStateTransitionTime; } | /**
* Get the time at which the job entered its current execution state.
*
* @return the executionStateTransitionTime value
*/ | Get the time at which the job entered its current execution state | executionStateTransitionTime | {
"repo_name": "navalev/azure-sdk-for-java",
"path": "sdk/batchai/mgmt-v2018_03_01/src/main/java/com/microsoft/azure/management/batchai/v2018_03_01/implementation/JobInner.java",
"license": "mit",
"size": 26475
} | [
"org.joda.time.DateTime"
] | import org.joda.time.DateTime; | import org.joda.time.*; | [
"org.joda.time"
] | org.joda.time; | 2,377,107 |
boolean maybeOverrideCodeGen(Node n, Context ctx) {
if (n.getType().equals(Token.UNDEFINED_TYPE)) {
add("undefined");
return true;
}
return false;
} | boolean maybeOverrideCodeGen(Node n, Context ctx) { if (n.getType().equals(Token.UNDEFINED_TYPE)) { add(STR); return true; } return false; } | /**
* Attempts to seize control of code generation if necessary.
* @return true if no further code generation on this node is needed.
*/ | Attempts to seize control of code generation if necessary | maybeOverrideCodeGen | {
"repo_name": "polybuildr/clutz",
"path": "src/main/java/com/google/javascript/gents/GentsCodeGenerator.java",
"license": "mit",
"size": 1157
} | [
"com.google.javascript.rhino.Node",
"com.google.javascript.rhino.Token"
] | import com.google.javascript.rhino.Node; import com.google.javascript.rhino.Token; | import com.google.javascript.rhino.*; | [
"com.google.javascript"
] | com.google.javascript; | 1,965,053 |
private void createInformationGroup(Composite parent, String info) {
grpInformation = new Group(parent, SWT.NONE);
grpInformation.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 2));
grpInformation.setText(Messages.DesView_3);
grpInformation.setLayout(new GridLayout());
// infobox
tx... | void function(Composite parent, String info) { grpInformation = new Group(parent, SWT.NONE); grpInformation.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 2)); grpInformation.setText(Messages.DesView_3); grpInformation.setLayout(new GridLayout()); txtInformation = new StyledText(grpInformation, SWT.WRAP... | /**
* Creates the information Group on the left.
* @param parent
*/ | Creates the information Group on the left | createInformationGroup | {
"repo_name": "jcryptool/crypto",
"path": "org.jcryptool.visual.des/src/org/jcryptool/visual/des/view/DesView.java",
"license": "epl-1.0",
"size": 60076
} | [
"org.eclipse.swt.custom.StyledText",
"org.eclipse.swt.layout.GridData",
"org.eclipse.swt.layout.GridLayout",
"org.eclipse.swt.widgets.Composite",
"org.eclipse.swt.widgets.Group"
] | import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Group; | import org.eclipse.swt.custom.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; | [
"org.eclipse.swt"
] | org.eclipse.swt; | 954,668 |
public boolean isClosed() {
return Instant.now().isAfter(endTime.plus(gracePeriod));
} | boolean function() { return Instant.now().isAfter(endTime.plus(gracePeriod)); } | /**
* Returns {@code true} if it is after the closing time of this feedback session; {@code false} if not.
*/ | Returns true if it is after the closing time of this feedback session; false if not | isClosed | {
"repo_name": "amarlearning/teammates",
"path": "src/main/java/teammates/common/datatransfer/attributes/FeedbackSessionAttributes.java",
"license": "gpl-2.0",
"size": 27320
} | [
"java.time.Instant"
] | import java.time.Instant; | import java.time.*; | [
"java.time"
] | java.time; | 1,011,262 |
public boolean getRememberBookmark() {
return Dispatch.get(this, "RememberBookmark").toBoolean();
} | boolean function() { return Dispatch.get(this, STR).toBoolean(); } | /**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*
* @return the result is of type boolean
*/ | Wrapper for calling the ActiveX-Method with input-parameter(s) | getRememberBookmark | {
"repo_name": "cpesch/MetaMusic",
"path": "itunes-com-library/src/main/java/slash/metamusic/itunes/com/binding/IITFileOrCDTrack.java",
"license": "gpl-2.0",
"size": 32709
} | [
"com.jacob.com.Dispatch"
] | import com.jacob.com.Dispatch; | import com.jacob.com.*; | [
"com.jacob.com"
] | com.jacob.com; | 1,587,968 |
void preGetTableDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx,
List<TableName> tableNamesList,
List<HTableDescriptor> descriptors) throws IOException; | void preGetTableDescriptors(ObserverContext<MasterCoprocessorEnvironment> ctx, List<TableName> tableNamesList, List<HTableDescriptor> descriptors) throws IOException; | /**
* Called before a getTableDescriptors request has been processed.
* @param ctx the environment to interact with the framework and master
* @param tableNamesList the list of table names, or null if querying for all
* @param descriptors an empty list, can be filled with what to return if bypassing
* @t... | Called before a getTableDescriptors request has been processed | preGetTableDescriptors | {
"repo_name": "Jackygq1982/hbase_src",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MasterObserver.java",
"license": "apache-2.0",
"size": 31996
} | [
"java.io.IOException",
"java.util.List",
"org.apache.hadoop.hbase.HTableDescriptor",
"org.apache.hadoop.hbase.TableName"
] | import java.io.IOException; import java.util.List; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.TableName; | import java.io.*; import java.util.*; import org.apache.hadoop.hbase.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 2,870,050 |
private KeyStore loadKeyStore(File keystore, String password)
throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
try (InputStream in = new FileInputStream(keystore)) {
ks.load(... | KeyStore function(File keystore, String password) throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException { KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); try (InputStream in = new FileInputStream(keystore)) { ks.load(in, password.toCharArray()); } catch (IOException e) { k... | /**
* load a keystore from a file. if it fails create a new keystore.
*
* @param keystore path to the keystore.
* @param password password of the keystore.
* @return the keystore loaded.
* @throws KeyStoreException @see KeyStoreException
* @throws IOException @see ... | load a keystore from a file. if it fails create a new keystore | loadKeyStore | {
"repo_name": "jenkinsci/saml-plugin",
"path": "src/main/java/org/jenkinsci/plugins/saml/BundleKeyStore.java",
"license": "apache-2.0",
"size": 14684
} | [
"java.io.File",
"java.io.FileInputStream",
"java.io.IOException",
"java.io.InputStream",
"java.security.KeyStore",
"java.security.KeyStoreException",
"java.security.NoSuchAlgorithmException",
"java.security.cert.CertificateException"
] | import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateException; | import java.io.*; import java.security.*; import java.security.cert.*; | [
"java.io",
"java.security"
] | java.io; java.security; | 2,451,327 |
public static ApplicationId createApplicationId(long timestamp, int id) {
try {
try {
// For Hadoop-2.1
Method method = ApplicationId.class.getMethod("newInstance", long.class, int.class);
return (ApplicationId) method.invoke(null, timestamp, id);
} catch (NoSuchMethodException... | static ApplicationId function(long timestamp, int id) { try { try { Method method = ApplicationId.class.getMethod(STR, long.class, int.class); return (ApplicationId) method.invoke(null, timestamp, id); } catch (NoSuchMethodException e) { ApplicationId appId = Records.newRecord(ApplicationId.class); Method setClusterTim... | /**
* Creates {@link ApplicationId} from the given cluster timestamp and id.
*/ | Creates <code>ApplicationId</code> from the given cluster timestamp and id | createApplicationId | {
"repo_name": "serranom/twill",
"path": "twill-yarn/src/main/java/org/apache/twill/internal/yarn/YarnUtils.java",
"license": "apache-2.0",
"size": 13314
} | [
"com.google.common.base.Throwables",
"java.lang.reflect.Method",
"org.apache.hadoop.yarn.api.records.ApplicationId",
"org.apache.hadoop.yarn.util.Records"
] | import com.google.common.base.Throwables; import java.lang.reflect.Method; import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.util.Records; | import com.google.common.base.*; import java.lang.reflect.*; import org.apache.hadoop.yarn.api.records.*; import org.apache.hadoop.yarn.util.*; | [
"com.google.common",
"java.lang",
"org.apache.hadoop"
] | com.google.common; java.lang; org.apache.hadoop; | 2,115,468 |
return INSTANCE;
}
DefaultMonitorRegistry() {
this(System.getProperties());
}
DefaultMonitorRegistry(Properties props) {
final String className = props.getProperty(REGISTRY_CLASS_PROP);
final String registryName = props.getProperty(REGISTRY_NAME_PROP, DEFAULT_REGISTRY... | return INSTANCE; } DefaultMonitorRegistry() { this(System.getProperties()); } DefaultMonitorRegistry(Properties props) { final String className = props.getProperty(REGISTRY_CLASS_PROP); final String registryName = props.getProperty(REGISTRY_NAME_PROP, DEFAULT_REGISTRY_NAME); if (className != null) { MonitorRegistry r; ... | /**
* Returns the instance of this registry.
*/ | Returns the instance of this registry | getInstance | {
"repo_name": "samhendley/servo",
"path": "servo-core/src/main/java/com/netflix/servo/DefaultMonitorRegistry.java",
"license": "apache-2.0",
"size": 5602
} | [
"com.netflix.servo.jmx.JmxMonitorRegistry",
"com.netflix.servo.jmx.ObjectNameMapper",
"java.util.Properties"
] | import com.netflix.servo.jmx.JmxMonitorRegistry; import com.netflix.servo.jmx.ObjectNameMapper; import java.util.Properties; | import com.netflix.servo.jmx.*; import java.util.*; | [
"com.netflix.servo",
"java.util"
] | com.netflix.servo; java.util; | 2,680,092 |
private void createMonitorPanel() {
JPanel leftPanel = new JPanel();
leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.Y_AXIS));
JPanel batteryPanel = new JPanel();
batteryPanel.setBorder(etchedBorder);
batteryPanel.add(batteryGauge);
leftPanel.add(batteryPanel);
JPanel setSensorPanel = new JPanel... | void function() { JPanel leftPanel = new JPanel(); leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.Y_AXIS)); JPanel batteryPanel = new JPanel(); batteryPanel.setBorder(etchedBorder); batteryPanel.add(batteryGauge); leftPanel.add(batteryPanel); JPanel setSensorPanel = new JPanel(); setSensorPanel.setBorder(etched... | /**
* Lay out Monitor Panel
*/ | Lay out Monitor Panel | createMonitorPanel | {
"repo_name": "AndrewZurn/sju-compsci-archive",
"path": "CS200s/CS217b/OriginalFiles/lejos/pc/tools/NXJControl.java",
"license": "apache-2.0",
"size": 48387
} | [
"javax.swing.BoxLayout",
"javax.swing.JButton",
"javax.swing.JLabel",
"javax.swing.JPanel"
] | import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 1,694,368 |
void setUploadChannel(String contentType, ReadableByteChannel channel,
long contentLength); | void setUploadChannel(String contentType, ReadableByteChannel channel, long contentLength); | /**
* Sets a readable byte channel to upload as part of a POST request.
*
* <p>Once {@link #start()} is called, this channel is guaranteed to be
* closed, either when the upload completes, or when it is canceled.
*
* @param contentType MIME type of the post content or null if this is not a... | Sets a readable byte channel to upload as part of a POST request. Once <code>#start()</code> is called, this channel is guaranteed to be closed, either when the upload completes, or when it is canceled | setUploadChannel | {
"repo_name": "SaschaMester/delicium",
"path": "components/cronet/android/java/src/org/chromium/net/HttpUrlRequest.java",
"license": "bsd-3-clause",
"size": 5386
} | [
"java.nio.channels.ReadableByteChannel"
] | import java.nio.channels.ReadableByteChannel; | import java.nio.channels.*; | [
"java.nio"
] | java.nio; | 929,772 |
protected static void procNTCreateAndX(SMBSrvSession sess, SMBSrvPacket smbPkt)
throws IOException, SMBSrvException {
// Get the tree id from the received packet and validate that it is a valid
// connection id.
TreeConnection conn = sess.findTreeConnection(smbPkt);
if ( conn == null) {
sess.sendErro... | static void function(SMBSrvSession sess, SMBSrvPacket smbPkt) throws IOException, SMBSrvException { TreeConnection conn = sess.findTreeConnection(smbPkt); if ( conn == null) { sess.sendErrorResponseSMB( smbPkt, SMBStatus.NTInvalidParameter, SMBStatus.NTErr); return; } NTParameterPacker prms = new NTParameterPacker(smbP... | /**
* Process an NT create andX request
*
* @param sess SMBSrvSession
* @param smbPkt SMBSrvPacket
* @exception IOException
* @exception SMBSrvException
*/ | Process an NT create andX request | procNTCreateAndX | {
"repo_name": "loftuxab/community-edition-old",
"path": "projects/alfresco-jlan/source/java/org/alfresco/jlan/smb/server/IPCHandler.java",
"license": "lgpl-3.0",
"size": 22483
} | [
"java.io.IOException",
"org.alfresco.jlan.debug.Debug",
"org.alfresco.jlan.netbios.RFCNetBIOSProtocol",
"org.alfresco.jlan.server.filesys.NetworkFile",
"org.alfresco.jlan.server.filesys.TooManyFilesException",
"org.alfresco.jlan.server.filesys.TreeConnection",
"org.alfresco.jlan.smb.SMBStatus",
"org.a... | import java.io.IOException; import org.alfresco.jlan.debug.Debug; import org.alfresco.jlan.netbios.RFCNetBIOSProtocol; import org.alfresco.jlan.server.filesys.NetworkFile; import org.alfresco.jlan.server.filesys.TooManyFilesException; import org.alfresco.jlan.server.filesys.TreeConnection; import org.alfresco.jlan.smb.... | import java.io.*; import org.alfresco.jlan.debug.*; import org.alfresco.jlan.netbios.*; import org.alfresco.jlan.server.filesys.*; import org.alfresco.jlan.smb.*; import org.alfresco.jlan.smb.dcerpc.*; import org.alfresco.jlan.smb.dcerpc.server.*; import org.alfresco.jlan.util.*; | [
"java.io",
"org.alfresco.jlan"
] | java.io; org.alfresco.jlan; | 273,101 |
public void removeDatabaseObject(Operator op)
{
// elements is a hash table and if we rename the operator we need to do it with care since
// by modifying the name of the operator we modify its hashCode. So what we do here is to
// first remove the value from the hash
Entry<Oper... | void function(Operator op) { Entry<Operator> entry = elements.remove(op); if (entry == null) throw new NoSuchElementException(STR + op); if (System.identityHashCode(entry.getElement()) != System.identityHashCode(op)) throw new NoSuchElementException(STR + op); op.removeDatabaseObject(); elements.put(op, entry); } | /**
* Removes the database object associated with the operator.
*
* @param op
* operator whose database object is to be removed
*/ | Removes the database object associated with the operator | removeDatabaseObject | {
"repo_name": "dbgroup-at-ucsc/dbtune",
"path": "src/edu/ucsc/dbtune/optimizer/plan/SQLStatementPlan.java",
"license": "bsd-3-clause",
"size": 13284
} | [
"java.util.NoSuchElementException"
] | import java.util.NoSuchElementException; | import java.util.*; | [
"java.util"
] | java.util; | 1,709,678 |
@SuppressWarnings("unchecked")
default void autocomplete(Supplier<By> selector, Object value, Locator<T, Stream<Element>> locator) {
new Input<>((T) this, selector).autocomplete(value, locator);
} | @SuppressWarnings(STR) default void autocomplete(Supplier<By> selector, Object value, Locator<T, Stream<Element>> locator) { new Input<>((T) this, selector).autocomplete(value, locator); } | /**
* Autocomplete for text field and return the first found suggestion match the whole word.
*
* @param selector selector
* @param value value
* @param locator locator
*/ | Autocomplete for text field and return the first found suggestion match the whole word | autocomplete | {
"repo_name": "yujunliang/seleniumcapsules",
"path": "src/main/java/com/algocrafts/forms/FormControl.java",
"license": "apache-2.0",
"size": 3972
} | [
"com.algocrafts.selenium.Element",
"com.algocrafts.selenium.Locator",
"java.util.function.Supplier",
"java.util.stream.Stream",
"org.openqa.selenium.By"
] | import com.algocrafts.selenium.Element; import com.algocrafts.selenium.Locator; import java.util.function.Supplier; import java.util.stream.Stream; import org.openqa.selenium.By; | import com.algocrafts.selenium.*; import java.util.function.*; import java.util.stream.*; import org.openqa.selenium.*; | [
"com.algocrafts.selenium",
"java.util",
"org.openqa.selenium"
] | com.algocrafts.selenium; java.util; org.openqa.selenium; | 1,699,470 |
public void setVersionedItemDAO(VersionedItemDAO versionedItemDAO) {
this.versionedItemDAO = versionedItemDAO;
}
| void function(VersionedItemDAO versionedItemDAO) { this.versionedItemDAO = versionedItemDAO; } | /**
* Set the versioned item data access object.
*
* @param versionedItemDAO
*/ | Set the versioned item data access object | setVersionedItemDAO | {
"repo_name": "nate-rcl/irplus",
"path": "ir_service/src/edu/ur/ir/item/service/DefaultItemService.java",
"license": "apache-2.0",
"size": 16172
} | [
"edu.ur.ir.item.VersionedItemDAO"
] | import edu.ur.ir.item.VersionedItemDAO; | import edu.ur.ir.item.*; | [
"edu.ur.ir"
] | edu.ur.ir; | 554,627 |
public boolean contains(Node s)
{
runTo(-1);
if (null == m_map)
return false;
for (int i = 0; i < m_firstFree; i++)
{
Node node = m_map[i];
if ((null != node) && node.equals(s))
return true;
}
return false;
} | boolean function(Node s) { runTo(-1); if (null == m_map) return false; for (int i = 0; i < m_firstFree; i++) { Node node = m_map[i]; if ((null != node) && node.equals(s)) return true; } return false; } | /**
* Tell if the table contains the given node.
*
* @param s Node to look for
*
* @return True if the given node was found.
*/ | Tell if the table contains the given node | contains | {
"repo_name": "YouDiSN/OpenJDK-Research",
"path": "jdk9/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/NodeSet.java",
"license": "gpl-2.0",
"size": 35779
} | [
"org.w3c.dom.Node"
] | import org.w3c.dom.Node; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 1,360,164 |
@Test
public void testGetBdr() throws Exception {
ospfInterface.setBdr(Ip4Address.valueOf("1.1.1.1"));
assertThat(ospfInterface.bdr(), is(Ip4Address.valueOf("1.1.1.1")));
} | void function() throws Exception { ospfInterface.setBdr(Ip4Address.valueOf(STR)); assertThat(ospfInterface.bdr(), is(Ip4Address.valueOf(STR))); } | /**
* Tests bdr() getter method.
*/ | Tests bdr() getter method | testGetBdr | {
"repo_name": "Phaneendra-Huawei/demo",
"path": "protocols/ospf/ctl/src/test/java/org/onosproject/ospf/controller/area/OspfInterfaceImplTest.java",
"license": "apache-2.0",
"size": 16164
} | [
"org.hamcrest.MatcherAssert",
"org.hamcrest.Matchers",
"org.onlab.packet.Ip4Address"
] | import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.onlab.packet.Ip4Address; | import org.hamcrest.*; import org.onlab.packet.*; | [
"org.hamcrest",
"org.onlab.packet"
] | org.hamcrest; org.onlab.packet; | 1,480,771 |
public void init() {
Polygon source = new Polygon();
source.addPoint(100,100);
source.addPoint(150,80);
source.addPoint(210,120);
source.addPoint(340,150);
source.addPoint(150,200);
source.addPoint(120,250);
this.source = source;
circle = new Circle(0,0,50);
rect = new Rectangle(-100,-40,200,8... | void function() { Polygon source = new Polygon(); source.addPoint(100,100); source.addPoint(150,80); source.addPoint(210,120); source.addPoint(340,150); source.addPoint(150,200); source.addPoint(120,250); this.source = source; circle = new Circle(0,0,50); rect = new Rectangle(-100,-40,200,80); star = new Polygon(); flo... | /**
* Perform the cut
*/ | Perform the cut | init | {
"repo_name": "TomyLobo/Slick",
"path": "src/main/java/org/newdawn/slick/tests/GeomUtilTest.java",
"license": "bsd-3-clause",
"size": 6034
} | [
"org.newdawn.slick.geom.Circle",
"org.newdawn.slick.geom.Polygon",
"org.newdawn.slick.geom.Rectangle"
] | import org.newdawn.slick.geom.Circle; import org.newdawn.slick.geom.Polygon; import org.newdawn.slick.geom.Rectangle; | import org.newdawn.slick.geom.*; | [
"org.newdawn.slick"
] | org.newdawn.slick; | 167,830 |
public static FakeExtractorOutput extractAllSamplesFromFile(
Extractor extractor, Context context, String fileName)
throws IOException, InterruptedException {
byte[] data = TestUtil.getByteArray(context, fileName);
FakeExtractorOutput expectedOutput = new FakeExtractorOutput();
extractor.init(... | static FakeExtractorOutput function( Extractor extractor, Context context, String fileName) throws IOException, InterruptedException { byte[] data = TestUtil.getByteArray(context, fileName); FakeExtractorOutput expectedOutput = new FakeExtractorOutput(); extractor.init(expectedOutput); FakeExtractorInput input = new Fa... | /**
* Extracts all samples from the given file into a {@link FakeTrackOutput}.
*
* @param extractor The {@link Extractor} to extractor from input.
* @param context A {@link Context}.
* @param fileName The name of the input file.
* @return The {@link FakeTrackOutput} containing the extracted samples.
... | Extracts all samples from the given file into a <code>FakeTrackOutput</code> | extractAllSamplesFromFile | {
"repo_name": "superbderrick/ExoPlayer",
"path": "testutils/src/main/java/com/google/android/exoplayer2/testutil/TestUtil.java",
"license": "apache-2.0",
"size": 17562
} | [
"android.content.Context",
"com.google.android.exoplayer2.extractor.Extractor",
"com.google.android.exoplayer2.extractor.PositionHolder",
"java.io.IOException"
] | import android.content.Context; import com.google.android.exoplayer2.extractor.Extractor; import com.google.android.exoplayer2.extractor.PositionHolder; import java.io.IOException; | import android.content.*; import com.google.android.exoplayer2.extractor.*; import java.io.*; | [
"android.content",
"com.google.android",
"java.io"
] | android.content; com.google.android; java.io; | 2,744,092 |
@Generated
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected void receive(final UUID receiver, final Event e) {
getSkill(io.sarl.core.DefaultContextInteractions.class).receive(receiver, e);
}
| @ImportedCapacityFeature(DefaultContextInteractions.class) void function(final UUID receiver, final Event e) { getSkill(io.sarl.core.DefaultContextInteractions.class).receive(receiver, e); } | /**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#receive(java.util.UUID,io.sarl.lang.core.Event)}.
*
* @see io.sarl.core.DefaultContextInteractions#receive(java.util.UUID,io.sarl.lang.core.Event)
*/ | See the capacity <code>io.sarl.core.DefaultContextInteractions#receive(java.util.UUID,io.sarl.lang.core.Event)</code> | receive | {
"repo_name": "trollmcqueen/eurock_vi51",
"path": "EuroSim/src/main/generated-sources/xtend/fr/utbm/info/vi51/framework/environment/EnvironmentAgent.java",
"license": "gpl-2.0",
"size": 24780
} | [
"io.sarl.core.DefaultContextInteractions",
"io.sarl.lang.annotation.ImportedCapacityFeature",
"io.sarl.lang.core.Event"
] | import io.sarl.core.DefaultContextInteractions; import io.sarl.lang.annotation.ImportedCapacityFeature; import io.sarl.lang.core.Event; | import io.sarl.core.*; import io.sarl.lang.annotation.*; import io.sarl.lang.core.*; | [
"io.sarl.core",
"io.sarl.lang"
] | io.sarl.core; io.sarl.lang; | 274,091 |
public Result cherryPick(Change change, PatchSet patch, CherryPickInput input, BranchNameKey dest)
throws IOException, InvalidChangeOperationException, UpdateException, RestApiException,
ConfigInvalidException, NoSuchProjectException {
return cherryPick(
change,
change.getProject()... | Result function(Change change, PatchSet patch, CherryPickInput input, BranchNameKey dest) throws IOException, InvalidChangeOperationException, UpdateException, RestApiException, ConfigInvalidException, NoSuchProjectException { return cherryPick( change, change.getProject(), patch.commitId(), input, dest, TimeUtil.now()... | /**
* This function is used for cherry picking a change.
*
* @param change Change to cherry pick.
* @param patch The patch of that change.
* @param input Input object for different configurations of cherry pick.
* @param dest Destination branch for the cherry pick.
* @return Result object that desc... | This function is used for cherry picking a change | cherryPick | {
"repo_name": "GerritCodeReview/gerrit",
"path": "java/com/google/gerrit/server/restapi/change/CherryPickChange.java",
"license": "apache-2.0",
"size": 29221
} | [
"com.google.gerrit.entities.BranchNameKey",
"com.google.gerrit.entities.Change",
"com.google.gerrit.entities.PatchSet",
"com.google.gerrit.extensions.api.changes.CherryPickInput",
"com.google.gerrit.extensions.restapi.RestApiException",
"com.google.gerrit.server.project.InvalidChangeOperationException",
... | import com.google.gerrit.entities.BranchNameKey; import com.google.gerrit.entities.Change; import com.google.gerrit.entities.PatchSet; import com.google.gerrit.extensions.api.changes.CherryPickInput; import com.google.gerrit.extensions.restapi.RestApiException; import com.google.gerrit.server.project.InvalidChangeOpera... | import com.google.gerrit.entities.*; import com.google.gerrit.extensions.api.changes.*; import com.google.gerrit.extensions.restapi.*; import com.google.gerrit.server.project.*; import com.google.gerrit.server.update.*; import com.google.gerrit.server.util.time.*; import java.io.*; import org.eclipse.jgit.errors.*; | [
"com.google.gerrit",
"java.io",
"org.eclipse.jgit"
] | com.google.gerrit; java.io; org.eclipse.jgit; | 1,910,675 |
public static Spanned getHtml(String text, int bulletRadius, int bulletColor) {
return trimWhitespace(Html.fromHtml(text, null, new HtmlListsTagHandler(bulletRadius, bulletColor)));
} | static Spanned function(String text, int bulletRadius, int bulletColor) { return trimWhitespace(Html.fromHtml(text, null, new HtmlListsTagHandler(bulletRadius, bulletColor))); } | /**
* Used by text views to convert text to html with special handling of ul and ol items
*
* @param text text that needs to be converted to html span
* @param bulletRadius radius of the bullet in pixels
* @param bulletColor color of the bullet in pixels
* @return trimmed html spa... | Used by text views to convert text to html with special handling of ul and ol items | getHtml | {
"repo_name": "IsUncommon/Droidcon-India-2015",
"path": "Workshop/src/main/java/is/uncommon/droidcon2015/utils/HtmlUtils.java",
"license": "apache-2.0",
"size": 2871
} | [
"android.text.Html",
"android.text.Spanned"
] | import android.text.Html; import android.text.Spanned; | import android.text.*; | [
"android.text"
] | android.text; | 2,643,908 |
private void defineTest(Description description) {
if (description.isTest()) {
sendMessage(MessageIds.TEST_DEFINE + ":" + description.getClassName() + "-" + description
.getMethodName());
return;
}
... | void function(Description description) { if (description.isTest()) { sendMessage(MessageIds.TEST_DEFINE + ":" + description.getClassName() + "-" + description .getMethodName()); return; } if (description.getChildren() == null description.getChildren().size() == 0) { return; } for (Description child : description.getChi... | /**
* Called internally for defining tests.
*/ | Called internally for defining tests | defineTest | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios.junit/src/main/java/org/moe/mdt/junit/MoeRemoteTestRunnerNoUI.java",
"license": "apache-2.0",
"size": 7433
} | [
"org.junit.runner.Description"
] | import org.junit.runner.Description; | import org.junit.runner.*; | [
"org.junit.runner"
] | org.junit.runner; | 2,196,546 |
public void majorCompact(final byte [] tableNameOrRegionName,
final byte[] columnFamily) throws IOException, InterruptedException {
compact(tableNameOrRegionName, columnFamily, true);
} | void function(final byte [] tableNameOrRegionName, final byte[] columnFamily) throws IOException, InterruptedException { compact(tableNameOrRegionName, columnFamily, true); } | /**
* Major compact a column family within a table or region.
* Asynchronous operation.
*
* @param tableNameOrRegionName table or region to major compact
* @param columnFamily column family within a table or region
* @throws IOException if a remote or network exception occurs
* @throws InterruptedE... | Major compact a column family within a table or region. Asynchronous operation | majorCompact | {
"repo_name": "infospace/hbase",
"path": "src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java",
"license": "apache-2.0",
"size": 93687
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 839,107 |
static byte[] toIntegerBytes(final BigInteger bigInt) {
int bitlen = bigInt.bitLength();
// round bitlen
bitlen = bitlen + 7 >> 3 << 3;
final byte[] bigBytes = bigInt.toByteArray();
if (bigInt.bitLength() % 8 != 0 && bigInt.bitLength() / 8 + 1 == bitlen / 8) {
return bigBytes;
}
// ... | static byte[] toIntegerBytes(final BigInteger bigInt) { int bitlen = bigInt.bitLength(); bitlen = bitlen + 7 >> 3 << 3; final byte[] bigBytes = bigInt.toByteArray(); if (bigInt.bitLength() % 8 != 0 && bigInt.bitLength() / 8 + 1 == bitlen / 8) { return bigBytes; } int startSrc = 0; int len = bigBytes.length; if (bigInt.... | /**
* Returns a byte-array representation of a <code>BigInteger</code> without sign bit.
*
* @param bigInt <code>BigInteger</code> to be converted
* @return a byte array representation of the BigInteger parameter
*/ | Returns a byte-array representation of a <code>BigInteger</code> without sign bit | toIntegerBytes | {
"repo_name": "Latency/UtopianBot",
"path": "src/org/rsbot/util/Base64.java",
"license": "lgpl-3.0",
"size": 41737
} | [
"java.math.BigInteger"
] | import java.math.BigInteger; | import java.math.*; | [
"java.math"
] | java.math; | 1,202,486 |
FSFileSystemView getFSRepositories(SecurityContext ctx, long userID)
throws DSOutOfServiceException, DSAccessException
{
if (fsViews == null) fsViews = new HashMap<Long, FSFileSystemView>();
if (fsViews.containsKey(userID)) return fsViews.get(userID);
//Review that code
FSFileSystemView view = null;
try... | FSFileSystemView getFSRepositories(SecurityContext ctx, long userID) throws DSOutOfServiceException, DSAccessException { if (fsViews == null) fsViews = new HashMap<Long, FSFileSystemView>(); if (fsViews.containsKey(userID)) return fsViews.get(userID); FSFileSystemView view = null; try { RepositoryMap m = getSharedResou... | /**
* Retrieves the system view hosting the repositories.
*
* @param ctx The security context.
* @param userID The id of the user.
* @return See above.
* @throws DSOutOfServiceException If the connection is broken, or logged in.
* @throws DSAccessException If an error occurred while trying to
* retrieve... | Retrieves the system view hosting the repositories | getFSRepositories | {
"repo_name": "jballanc/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/env/data/OMEROGateway.java",
"license": "gpl-2.0",
"size": 286379
} | [
"java.util.HashMap",
"java.util.Iterator",
"java.util.List",
"java.util.Map",
"org.openmicroscopy.shoola.env.data.util.SecurityContext"
] | import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.openmicroscopy.shoola.env.data.util.SecurityContext; | import java.util.*; import org.openmicroscopy.shoola.env.data.util.*; | [
"java.util",
"org.openmicroscopy.shoola"
] | java.util; org.openmicroscopy.shoola; | 2,598,122 |
public static String getText(URL url, String charset) throws IOException {
BufferedReader reader = newReader(url, charset);
return getText(reader);
} | static String function(URL url, String charset) throws IOException { BufferedReader reader = newReader(url, charset); return getText(reader); } | /**
* Read the data from this URL and return it as a String. The connection
* stream is closed before this method returns.
*
* @param url URL to read content from
* @param charset opens the stream with a specified charset
* @return the text from that URL
* @throws IOException if ... | Read the data from this URL and return it as a String. The connection stream is closed before this method returns | getText | {
"repo_name": "xien777/yajsw",
"path": "yajsw/wrapper/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java",
"license": "lgpl-2.1",
"size": 704150
} | [
"java.io.BufferedReader",
"java.io.IOException"
] | import java.io.BufferedReader; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,416,096 |
private static void setEndpointSecurityFromApiDTOToModel(APIDTO dto, API api) {
APIEndpointSecurityDTO securityDTO = dto.getEndpointSecurity();
if (dto.getEndpointSecurity() != null && securityDTO.getType() != null) {
api.setEndpointSecured(true);
api.setEndpointUTUsername(se... | static void function(APIDTO dto, API api) { APIEndpointSecurityDTO securityDTO = dto.getEndpointSecurity(); if (dto.getEndpointSecurity() != null && securityDTO.getType() != null) { api.setEndpointSecured(true); api.setEndpointUTUsername(securityDTO.getUsername()); api.setEndpointUTPassword(securityDTO.getPassword()); ... | /**
* Method to set Endpoint Security From APIDTO To API Model
*
* @param dto DTO model of the API
* @param api API
*/ | Method to set Endpoint Security From APIDTO To API Model | setEndpointSecurityFromApiDTOToModel | {
"repo_name": "bhathiya/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.hybrid.gateway/org.wso2.carbon.apimgt.hybrid.gateway.api.synchronizer/src/main/java/org/wso2/carbon/apimgt/hybrid/gateway/api/synchronizer/util/APIMappingUtil.java",
"license": "apache-2.0",
"size": 13945
} | [
"org.wso2.carbon.apimgt.hybrid.gateway.api.synchronizer.dto.APIEndpointSecurityDTO"
] | import org.wso2.carbon.apimgt.hybrid.gateway.api.synchronizer.dto.APIEndpointSecurityDTO; | import org.wso2.carbon.apimgt.hybrid.gateway.api.synchronizer.dto.*; | [
"org.wso2.carbon"
] | org.wso2.carbon; | 734,994 |
public boolean remove(@NonNull final String key) {
DiskCacheManager diskCacheManager = getDiskCacheManager();
if (diskCacheManager == null) return true;
return diskCacheManager.removeByKey(TYPE_BYTE + key)
&& diskCacheManager.removeByKey(TYPE_STRING + key)
&& ... | boolean function(@NonNull final String key) { DiskCacheManager diskCacheManager = getDiskCacheManager(); if (diskCacheManager == null) return true; return diskCacheManager.removeByKey(TYPE_BYTE + key) && diskCacheManager.removeByKey(TYPE_STRING + key) && diskCacheManager.removeByKey(TYPE_JSON_OBJECT + key) && diskCache... | /**
* Remove the cache by key.
*
* @param key The key of cache.
* @return {@code true}: success<br>{@code false}: fail
*/ | Remove the cache by key | remove | {
"repo_name": "Blankj/AndroidUtilCode",
"path": "lib/utilcode/src/main/java/com/blankj/utilcode/util/CacheDiskUtils.java",
"license": "apache-2.0",
"size": 30297
} | [
"androidx.annotation.NonNull"
] | import androidx.annotation.NonNull; | import androidx.annotation.*; | [
"androidx.annotation"
] | androidx.annotation; | 2,519,735 |
public H2FeatureService getSbefAttr() {
return sbefAttr;
} | H2FeatureService function() { return sbefAttr; } | /**
* DOCUMENT ME!
*
* @return the sbefAttr
*/ | DOCUMENT ME | getSbefAttr | {
"repo_name": "cismet/watergis-client",
"path": "src/main/java/de/cismet/watergis/gui/actions/checks/AusbauCheckAction.java",
"license": "lgpl-3.0",
"size": 64923
} | [
"de.cismet.cismap.commons.featureservice.H2FeatureService"
] | import de.cismet.cismap.commons.featureservice.H2FeatureService; | import de.cismet.cismap.commons.featureservice.*; | [
"de.cismet.cismap"
] | de.cismet.cismap; | 948,998 |
Bundle fromUrl(String url) {
if (!url.endsWith("&")) {
url = url.concat("&");
}
return decode(url);
} | Bundle fromUrl(String url) { if (!url.endsWith("&")) { url = url.concat("&"); } return decode(url); } | /**
* decode the given url to {@code Bundle} representation
* @param url url to decode
* @return url Bundle representation
*/ | decode the given url to Bundle representation | fromUrl | {
"repo_name": "eju-front/router-android",
"path": "routersdk/src/main/java/com/eju/router/sdk/ParamAdapter.java",
"license": "mit",
"size": 19490
} | [
"android.os.Bundle"
] | import android.os.Bundle; | import android.os.*; | [
"android.os"
] | android.os; | 504,320 |
@Deprecated
public static boolean isEmpty( CharSequence[] vals ) {
return Utils.isEmpty( vals );
} | static boolean function( CharSequence[] vals ) { return Utils.isEmpty( vals ); } | /**
* Check if the CharSequence array supplied is empty. A CharSequence array is empty when it is null or when the number of elements
* is 0
*
* @param vals
* The string array to check
* @return true if the string array supplied is empty
* @deprecated
* @see org.pentaho.di.core.util.Uti... | Check if the CharSequence array supplied is empty. A CharSequence array is empty when it is null or when the number of elements is 0 | isEmpty | {
"repo_name": "bmorrise/pentaho-kettle",
"path": "core/src/main/java/org/pentaho/di/core/Const.java",
"license": "apache-2.0",
"size": 122915
} | [
"org.pentaho.di.core.util.Utils"
] | import org.pentaho.di.core.util.Utils; | import org.pentaho.di.core.util.*; | [
"org.pentaho.di"
] | org.pentaho.di; | 2,795,585 |
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
} | void function(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); } | /**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This adds <code>org.eclipse.emf.edit.command.CommandParameter</code>s describing the children that can be created under this object. | collectNewChildDescriptors | {
"repo_name": "sohaniwso2/devstudio-tooling-esb",
"path": "plugins/org.wso2.developerstudio.eclipse.gmf.esb.edit/src/org/wso2/developerstudio/eclipse/gmf/esb/provider/CacheMediatorInputConnectorItemProvider.java",
"license": "apache-2.0",
"size": 2893
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 1,743,344 |
public void PUT(Model model) {
gsp().PUT(model.getGraph());
}
//
// public void putModel(Model model) {
// // Synonym
// PUT(graph);
// } | void function(Model model) { gsp().PUT(model.getGraph()); } | /**
* PUT a graph.
*/ | PUT a graph | PUT | {
"repo_name": "apache/jena",
"path": "jena-arq/src/main/java/org/apache/jena/query/ModelStore.java",
"license": "apache-2.0",
"size": 9170
} | [
"org.apache.jena.rdf.model.Model"
] | import org.apache.jena.rdf.model.Model; | import org.apache.jena.rdf.model.*; | [
"org.apache.jena"
] | org.apache.jena; | 2,246,062 |
public static java.util.List extractQuestionInformationList(ims.domain.ILightweightDomainFactory domainFactory, ims.core.vo.QuestionInformationShortVoCollection voCollection)
{
return extractQuestionInformationList(domainFactory, voCollection, null, new HashMap());
}
| static java.util.List function(ims.domain.ILightweightDomainFactory domainFactory, ims.core.vo.QuestionInformationShortVoCollection voCollection) { return extractQuestionInformationList(domainFactory, voCollection, null, new HashMap()); } | /**
* Create the ims.core.clinical.domain.objects.QuestionInformation list from the value object collection.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param voCollection - the collection of value objects
*/ | Create the ims.core.clinical.domain.objects.QuestionInformation list from the value object collection | extractQuestionInformationList | {
"repo_name": "open-health-hub/openmaxims-linux",
"path": "openmaxims_workspace/ValueObjects/src/ims/core/vo/domain/QuestionInformationShortVoAssembler.java",
"license": "agpl-3.0",
"size": 25911
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 2,725,422 |
@Generated
@Selector("initWithDevice:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY:")
public native MPSCNNPoolingGradient initWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY(
@Mapped(ObjCObjectMapper.class) MTLDevice device, @NUInt long kernelWidth, @NUInt long kernelH... | @Selector(STR) native MPSCNNPoolingGradient function( @Mapped(ObjCObjectMapper.class) MTLDevice device, @NUInt long kernelWidth, @NUInt long kernelHeight, @NUInt long strideInPixelsX, @NUInt long strideInPixelsY); | /**
* Initialize a gradient pooling filter
*
* @param device The device the filter will run on
* @param kernelWidth The width of the kernel. Can be an odd or even value.
* @param kernelHeight The height of the kernel. Can be an odd or even value.
* @param strideInPixelsX ... | Initialize a gradient pooling filter | initWithDeviceKernelWidthKernelHeightStrideInPixelsXStrideInPixelsY | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/metalperformanceshaders/MPSCNNPoolingGradient.java",
"license": "apache-2.0",
"size": 11475
} | [
"org.moe.natj.general.ann.Mapped",
"org.moe.natj.general.ann.NUInt",
"org.moe.natj.objc.ann.Selector",
"org.moe.natj.objc.map.ObjCObjectMapper"
] | import org.moe.natj.general.ann.Mapped; import org.moe.natj.general.ann.NUInt; import org.moe.natj.objc.ann.Selector; import org.moe.natj.objc.map.ObjCObjectMapper; | import org.moe.natj.general.ann.*; import org.moe.natj.objc.ann.*; import org.moe.natj.objc.map.*; | [
"org.moe.natj"
] | org.moe.natj; | 2,778,732 |
public void remove(char[] key) {
int index = hashCodeChar(key);
while (keyTable[index] != null) {
if (CharOperation.equals(keyTable[index], key)) {
valueTable[index] = 0;
keyTable[index] = null;
return;
}
index = (index + 1) % keyTable.length;
}
} | void function(char[] key) { int index = hashCodeChar(key); while (keyTable[index] != null) { if (CharOperation.equals(keyTable[index], key)) { valueTable[index] = 0; keyTable[index] = null; return; } index = (index + 1) % keyTable.length; } } | /** Remove the object associated with the specified key in the
* hashtable.
* @param key <CODE>char[]</CODE> the specified key
*/ | Remove the object associated with the specified key in the hashtable | remove | {
"repo_name": "kcsl/immutability-benchmark",
"path": "benchmark-applications/reiminfer-oopsla-2012/source/ejc/src/org/eclipse/jdt/internal/compiler/codegen/CharArrayCache.java",
"license": "mit",
"size": 6369
} | [
"org.eclipse.jdt.core.compiler.CharOperation"
] | import org.eclipse.jdt.core.compiler.CharOperation; | import org.eclipse.jdt.core.compiler.*; | [
"org.eclipse.jdt"
] | org.eclipse.jdt; | 539,060 |
private void onActiveDatabaseChanged(Optional<BibDatabaseContext> newDatabase) {
if (newDatabase.isPresent()) {
GroupNodeViewModel newRoot = newDatabase
.map(BibDatabaseContext::getMetaData)
.flatMap(MetaData::getGroups)
.map(root -> ne... | void function(Optional<BibDatabaseContext> newDatabase) { if (newDatabase.isPresent()) { GroupNodeViewModel newRoot = newDatabase .map(BibDatabaseContext::getMetaData) .flatMap(MetaData::getGroups) .map(root -> new GroupNodeViewModel(newDatabase.get(), stateManager, taskExecutor, root)) .orElse(GroupNodeViewModel.getAl... | /**
* Gets invoked if the user changes the active database.
* We need to get the new group tree and update the view
*/ | Gets invoked if the user changes the active database. We need to get the new group tree and update the view | onActiveDatabaseChanged | {
"repo_name": "conde2/DC-UFSCar-ES2-201701-BoxTesters",
"path": "src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java",
"license": "mit",
"size": 13705
} | [
"java.util.Optional",
"java.util.stream.Collectors",
"org.jabref.model.database.BibDatabaseContext",
"org.jabref.model.metadata.MetaData"
] | import java.util.Optional; import java.util.stream.Collectors; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.metadata.MetaData; | import java.util.*; import java.util.stream.*; import org.jabref.model.database.*; import org.jabref.model.metadata.*; | [
"java.util",
"org.jabref.model"
] | java.util; org.jabref.model; | 1,821,299 |
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
} | void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } | /**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/ | Handles the HTTP <code>POST</code> method | doPost | {
"repo_name": "bd-king/E-notice",
"path": "src/main/java/Servlet/Preference.java",
"license": "mit",
"size": 4374
} | [
"java.io.IOException",
"javax.servlet.ServletException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse"
] | import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; | import java.io.*; import javax.servlet.*; import javax.servlet.http.*; | [
"java.io",
"javax.servlet"
] | java.io; javax.servlet; | 752,689 |
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
Activity activity = getActivity();
Intent intent = activity.getIntent();
if (DevicePolicyManager.ACTION_START_ENCRYPTION.equals(intent.getAction())) {
Dev... | void function(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); Activity activity = getActivity(); Intent intent = activity.getIntent(); if (DevicePolicyManager.ACTION_START_ENCRYPTION.equals(intent.getAction())) { DevicePolicyManager dpm = (DevicePolicyManager) activity.getSystemService(Context... | /**
* If encryption is already started, and this launched via a "start encryption" intent,
* then exit immediately - it's already up and running, so there's no point in "starting" it.
*/ | If encryption is already started, and this launched via a "start encryption" intent, then exit immediately - it's already up and running, so there's no point in "starting" it | onActivityCreated | {
"repo_name": "manuelmagix/android_packages_apps_Settings",
"path": "src/com/android/settings/CryptKeeperSettings.java",
"license": "apache-2.0",
"size": 8133
} | [
"android.app.Activity",
"android.app.admin.DevicePolicyManager",
"android.content.Context",
"android.content.Intent",
"android.os.Bundle"
] | import android.app.Activity; import android.app.admin.DevicePolicyManager; import android.content.Context; import android.content.Intent; import android.os.Bundle; | import android.app.*; import android.app.admin.*; import android.content.*; import android.os.*; | [
"android.app",
"android.content",
"android.os"
] | android.app; android.content; android.os; | 57,818 |
@Override
public boolean isFlushSucceeded() {
return result == Result.FLUSHED_NO_COMPACTION_NEEDED || result == Result
.FLUSHED_COMPACTION_NEEDED;
} | boolean function() { return result == Result.FLUSHED_NO_COMPACTION_NEEDED result == Result .FLUSHED_COMPACTION_NEEDED; } | /**
* Convenience method, the equivalent of checking if result is
* FLUSHED_NO_COMPACTION_NEEDED or FLUSHED_NO_COMPACTION_NEEDED.
* @return true if the memstores were flushed, else false.
*/ | Convenience method, the equivalent of checking if result is FLUSHED_NO_COMPACTION_NEEDED or FLUSHED_NO_COMPACTION_NEEDED | isFlushSucceeded | {
"repo_name": "gustavoanatoly/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java",
"license": "apache-2.0",
"size": 328407
} | [
"org.apache.hadoop.hbase.client.Result"
] | import org.apache.hadoop.hbase.client.Result; | import org.apache.hadoop.hbase.client.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 1,503,231 |
public void execute() {
WasmStack<Object> stack = instance.stack();
if ((stack.peek() instanceof I32) == false) {
throw new WasmRuntimeException(UUID.fromString("41ab1a4c-050e-4283-8844-d0b5894a8ce3"),
"I32_ge_s: Value2 type is incorrect");
}
I32 value2 = (I32) stack.pop();
if ((stack.peek() instan... | void function() { WasmStack<Object> stack = instance.stack(); if ((stack.peek() instanceof I32) == false) { throw new WasmRuntimeException(UUID.fromString(STR), STR); } I32 value2 = (I32) stack.pop(); if ((stack.peek() instanceof I32) == false) { throw new WasmRuntimeException(UUID.fromString(STR), STR); } I32 value1 =... | /**
* Execute the opcode.
*/ | Execute the opcode | execute | {
"repo_name": "fishjd/HappyNewMoonWithReport",
"path": "src/main/java/happynewmoonwithreport/opcode/comparison/I32_ge_s.java",
"license": "apache-2.0",
"size": 2661
} | [
"java.util.UUID"
] | import java.util.UUID; | import java.util.*; | [
"java.util"
] | java.util; | 969,922 |
public TreeSet<CuboidSelection> getAreaRegions(String regionName) {
return regions.get(regionName);
} | TreeSet<CuboidSelection> function(String regionName) { return regions.get(regionName); } | /**
* Gets all areas for a given region.
* @param regionName The name of the region.
* @return A TreeSet of the areas.
*/ | Gets all areas for a given region | getAreaRegions | {
"repo_name": "TheRealNuke/Plugins",
"path": "TRN-SnowSlam/src/info/therealnuke/playingfield/Arena.java",
"license": "gpl-3.0",
"size": 8862
} | [
"com.sk89q.worldedit.bukkit.selections.CuboidSelection",
"java.util.TreeSet"
] | import com.sk89q.worldedit.bukkit.selections.CuboidSelection; import java.util.TreeSet; | import com.sk89q.worldedit.bukkit.selections.*; import java.util.*; | [
"com.sk89q.worldedit",
"java.util"
] | com.sk89q.worldedit; java.util; | 955,898 |
public void assertIsToday(AssertionInfo info, Date actual) {
assertNotNull(info, actual);
Date todayWithoutTime = truncateTime(now());
Date actualWithoutTime = truncateTime(actual);
if (areEqual(actualWithoutTime, todayWithoutTime)) return;
throw failures.failure(info, shouldBeToday(actual, compar... | void function(AssertionInfo info, Date actual) { assertNotNull(info, actual); Date todayWithoutTime = truncateTime(now()); Date actualWithoutTime = truncateTime(actual); if (areEqual(actualWithoutTime, todayWithoutTime)) return; throw failures.failure(info, shouldBeToday(actual, comparisonStrategy)); } | /**
* Verifies that the actual {@code Date} is today, by comparing only year, month and day of actual to today (ie. we don't check
* hours).
* @param info contains information about the assertion.
* @param actual the "actual" {@code Date}.
* @throws AssertionError if {@code actual} is {@code null}.
* ... | Verifies that the actual Date is today, by comparing only year, month and day of actual to today (ie. we don't check hours) | assertIsToday | {
"repo_name": "AlexBischof/assertj-core",
"path": "src/main/java/org/assertj/core/internal/Dates.java",
"license": "apache-2.0",
"size": 39187
} | [
"java.util.Date",
"org.assertj.core.api.AssertionInfo",
"org.assertj.core.error.ShouldBeToday",
"org.assertj.core.util.Dates"
] | import java.util.Date; import org.assertj.core.api.AssertionInfo; import org.assertj.core.error.ShouldBeToday; import org.assertj.core.util.Dates; | import java.util.*; import org.assertj.core.api.*; import org.assertj.core.error.*; import org.assertj.core.util.*; | [
"java.util",
"org.assertj.core"
] | java.util; org.assertj.core; | 1,609,588 |
private static SortedSet<NativeCodeDescription> resolveNativeCodeDependencies(Papoose framework, List<NativeCodeDescription> bundleNativeCodeList) throws BundleException
{
SortedSet<NativeCodeDescription> set = new TreeSet<NativeCodeDescription>();
if (!bundleNativeCodeList.isEmpty())
... | static SortedSet<NativeCodeDescription> function(Papoose framework, List<NativeCodeDescription> bundleNativeCodeList) throws BundleException { SortedSet<NativeCodeDescription> set = new TreeSet<NativeCodeDescription>(); if (!bundleNativeCodeList.isEmpty()) { VersionRange osVersionRange = VersionRange.parseVersionRange(... | /**
* Make sure that at least one native code description is valid.
*
* @param bundleNativeCodeList the raw list of native code descriptions to be processed
* @return a list of resolvable native code descriptions
* @throws BundleException if the method is unable to find at least one valid nativ... | Make sure that at least one native code description is valid | resolveNativeCodeDependencies | {
"repo_name": "papoose/papoose-core",
"path": "core/src/main/java/org/papoose/core/util/BundleUtils.java",
"license": "apache-2.0",
"size": 11170
} | [
"java.util.List",
"java.util.Map",
"java.util.SortedSet",
"java.util.TreeSet",
"org.osgi.framework.BundleException",
"org.osgi.framework.Constants",
"org.osgi.framework.Filter",
"org.osgi.framework.InvalidSyntaxException",
"org.papoose.core.DefaultFilter",
"org.papoose.core.Papoose",
"org.papoos... | import java.util.List; import java.util.Map; import java.util.SortedSet; import java.util.TreeSet; import org.osgi.framework.BundleException; import org.osgi.framework.Constants; import org.osgi.framework.Filter; import org.osgi.framework.InvalidSyntaxException; import org.papoose.core.DefaultFilter; import org.papoose... | import java.util.*; import org.osgi.framework.*; import org.papoose.core.*; import org.papoose.core.descriptions.*; | [
"java.util",
"org.osgi.framework",
"org.papoose.core"
] | java.util; org.osgi.framework; org.papoose.core; | 1,500,999 |
private void setHandshakeFailure(Throwable cause) {
// Release all resources such as internal buffers that SSLEngine
// is managing.
engine.closeOutbound();
try {
engine.closeInbound();
} catch (SSLException e) {
// only log in debug mode as it most l... | void function(Throwable cause) { engine.closeOutbound(); try { engine.closeInbound(); } catch (SSLException e) { String msg = e.getMessage(); if (msg == null !msg.contains(STR)) { logger.debug(STR, e); } } notifyHandshakeFailure(cause); for (;;) { PendingWrite write = pendingUnencryptedWrites.poll(); if (write == null)... | /**
* Notify all the handshake futures about the failure during the handshake.
*/ | Notify all the handshake futures about the failure during the handshake | setHandshakeFailure | {
"repo_name": "daschl/netty",
"path": "handler/src/main/java/io/netty/handler/ssl/SslHandler.java",
"license": "apache-2.0",
"size": 46235
} | [
"io.netty.util.internal.PendingWrite",
"javax.net.ssl.SSLException"
] | import io.netty.util.internal.PendingWrite; import javax.net.ssl.SSLException; | import io.netty.util.internal.*; import javax.net.ssl.*; | [
"io.netty.util",
"javax.net"
] | io.netty.util; javax.net; | 2,130,694 |
private void buildStateFromLedger(byte[] data, Object ctx){
if(LOG.isDebugEnabled()){
LOG.debug("Building state from ledger");
}
if(data == null){
LOG.error("No data on znode, can't determine ledger id");
((BookKeeperStateBuilder.Context) ctx).set... | void function(byte[] data, Object ctx){ if(LOG.isDebugEnabled()){ LOG.debug(STR); } if(data == null){ LOG.error(STR); ((BookKeeperStateBuilder.Context) ctx).setState(null); } if(LOG.isDebugEnabled()){ LOG.debug(STR); } try{ this.lp = new LoggerProtocol(timestampOracle); } catch (Exception e) { LOG.error(STR, e); ((Book... | /**
* Builds state from a ledger.
*
*
* @param data
* @param ctx
* @return
*/ | Builds state from a ledger | buildStateFromLedger | {
"repo_name": "dgomezferro/omid",
"path": "src/main/java/com/yahoo/omid/tso/persistence/BookKeeperStateBuilder.java",
"license": "apache-2.0",
"size": 13800
} | [
"java.nio.ByteBuffer"
] | import java.nio.ByteBuffer; | import java.nio.*; | [
"java.nio"
] | java.nio; | 1,885,838 |
@Test
public void testInPlaceModificationErrorHandling() throws IOException {
File tmpFile = File.createTempFile("credentials.", null);
Profile[] abcd = {
new Profile("a", basicCredA),
new Profile("b", basicCredB),
new Profile("c", sessionCredC),
... | void function() throws IOException { File tmpFile = File.createTempFile(STR, null); Profile[] abcd = { new Profile("a", basicCredA), new Profile("b", basicCredB), new Profile("c", sessionCredC), new Profile("d", sessionCredD) }; ProfilesConfigFileWriter.dumpToFile(tmpFile, true, abcd); String originalContent = FileUtil... | /**
* Tests that the original credentials file is properly restored if the
* in-place modification fails with error.
*/ | Tests that the original credentials file is properly restored if the in-place modification fails with error | testInPlaceModificationErrorHandling | {
"repo_name": "dagnir/aws-sdk-java",
"path": "aws-java-sdk-core/src/test/java/com/amazonaws/auth/profile/ProfilesConfigFileWriterTest.java",
"license": "apache-2.0",
"size": 12286
} | [
"com.amazonaws.AmazonClientException",
"com.amazonaws.auth.profile.internal.Profile",
"java.io.File",
"java.io.IOException",
"org.apache.commons.io.FileUtils",
"org.junit.Assert"
] | import com.amazonaws.AmazonClientException; import com.amazonaws.auth.profile.internal.Profile; import java.io.File; import java.io.IOException; import org.apache.commons.io.FileUtils; import org.junit.Assert; | import com.amazonaws.*; import com.amazonaws.auth.profile.internal.*; import java.io.*; import org.apache.commons.io.*; import org.junit.*; | [
"com.amazonaws",
"com.amazonaws.auth",
"java.io",
"org.apache.commons",
"org.junit"
] | com.amazonaws; com.amazonaws.auth; java.io; org.apache.commons; org.junit; | 70,223 |
public FSDataInputStream open(Path f) throws IOException {
return open(f, getConf().getInt("io.file.buffer.size", 4096));
} | FSDataInputStream function(Path f) throws IOException { return open(f, getConf().getInt(STR, 4096)); } | /**
* Opens an FSDataInputStream at the indicated Path.
* @param f the file to open
*/ | Opens an FSDataInputStream at the indicated Path | open | {
"repo_name": "moreus/hadoop",
"path": "hadoop-0.23.10/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java",
"license": "apache-2.0",
"size": 86505
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,727,647 |
private TaskWorkingDir createTaskSandbox(Invocation invocation) throws IOException {
// Check if an specific working dir is provided
String specificWD = null;
switch (invocation.getMethodImplementation().getMethodType()) {
case BINARY:
BinaryImplementation binaryI... | TaskWorkingDir function(Invocation invocation) throws IOException { String specificWD = null; switch (invocation.getMethodImplementation().getMethodType()) { case BINARY: BinaryImplementation binaryImpl = (BinaryImplementation) invocation.getMethodImplementation(); specificWD = binaryImpl.getWorkingDir(); break; case M... | /**
* Creates a sandbox for a task.
*
* @param invocation task description
* @return Sandbox dir
* @throws IOException Error creating sandbox
*/ | Creates a sandbox for a task | createTaskSandbox | {
"repo_name": "mF2C/COMPSs",
"path": "compss/runtime/adaptors/execution/src/main/java/es/bsc/compss/executor/Executor.java",
"license": "apache-2.0",
"size": 42292
} | [
"es.bsc.compss.types.annotations.Constants",
"es.bsc.compss.types.execution.Invocation",
"es.bsc.compss.types.implementations.BinaryImplementation",
"es.bsc.compss.types.implementations.COMPSsImplementation",
"es.bsc.compss.types.implementations.DecafImplementation",
"es.bsc.compss.types.implementations.M... | import es.bsc.compss.types.annotations.Constants; import es.bsc.compss.types.execution.Invocation; import es.bsc.compss.types.implementations.BinaryImplementation; import es.bsc.compss.types.implementations.COMPSsImplementation; import es.bsc.compss.types.implementations.DecafImplementation; import es.bsc.compss.types.... | import es.bsc.compss.types.annotations.*; import es.bsc.compss.types.execution.*; import es.bsc.compss.types.implementations.*; import java.io.*; import java.nio.file.*; | [
"es.bsc.compss",
"java.io",
"java.nio"
] | es.bsc.compss; java.io; java.nio; | 1,593,518 |
private void cleanUpPendingSubscriptionCreationProcessesByAPI(APIIdentifier apiId) throws APIManagementException {
WorkflowExecutor createSubscriptionWFExecutor = getWorkflowExecutor(
WorkflowConstants.WF_TYPE_AM_SUBSCRIPTION_CREATION);
Set<Integer> pendingSubscriptions = apiMgtDAO.... | void function(APIIdentifier apiId) throws APIManagementException { WorkflowExecutor createSubscriptionWFExecutor = getWorkflowExecutor( WorkflowConstants.WF_TYPE_AM_SUBSCRIPTION_CREATION); Set<Integer> pendingSubscriptions = apiMgtDAO.getPendingSubscriptionsByAPIId(apiId); String workflowExtRef = null; for (int subscri... | /**
* Clean-up pending subscriptions of a given API
*
* @param apiId API Identifier
* @throws APIManagementException
*/ | Clean-up pending subscriptions of a given API | cleanUpPendingSubscriptionCreationProcessesByAPI | {
"repo_name": "Rajith90/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java",
"license": "apache-2.0",
"size": 520854
} | [
"java.util.Set",
"org.wso2.carbon.apimgt.api.APIManagementException",
"org.wso2.carbon.apimgt.api.model.APIIdentifier",
"org.wso2.carbon.apimgt.impl.workflow.WorkflowConstants",
"org.wso2.carbon.apimgt.impl.workflow.WorkflowException",
"org.wso2.carbon.apimgt.impl.workflow.WorkflowExecutor"
] | import java.util.Set; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.model.APIIdentifier; import org.wso2.carbon.apimgt.impl.workflow.WorkflowConstants; import org.wso2.carbon.apimgt.impl.workflow.WorkflowException; import org.wso2.carbon.apimgt.impl.workflow.WorkflowExecuto... | import java.util.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.api.model.*; import org.wso2.carbon.apimgt.impl.workflow.*; | [
"java.util",
"org.wso2.carbon"
] | java.util; org.wso2.carbon; | 707,925 |
public void setRemoved(Date value); | void function(Date value); | /**
* Setter for <code>cattle.network.removed</code>.
*/ | Setter for <code>cattle.network.removed</code> | setRemoved | {
"repo_name": "vincent99/cattle",
"path": "code/iaas/model/src/main/java/io/cattle/platform/core/model/Network.java",
"license": "apache-2.0",
"size": 5126
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 33,921 |
@SuppressWarnings("unchecked")
public static ArrayList<Label> getSelected(Bundle arguments) {
return arguments.getParcelableArrayList(ARG_SELECTED);
} | @SuppressWarnings(STR) static ArrayList<Label> function(Bundle arguments) { return arguments.getParcelableArrayList(ARG_SELECTED); } | /**
* Get selected labels from result bundle
*
* @param arguments
* @return selected labels
*/ | Get selected labels from result bundle | getSelected | {
"repo_name": "hufsm/PocketHub",
"path": "app/src/main/java/com/github/pockethub/ui/issue/LabelsDialogFragment.java",
"license": "apache-2.0",
"size": 7749
} | [
"android.os.Bundle",
"com.alorma.github.sdk.bean.dto.response.Label",
"java.util.ArrayList"
] | import android.os.Bundle; import com.alorma.github.sdk.bean.dto.response.Label; import java.util.ArrayList; | import android.os.*; import com.alorma.github.sdk.bean.dto.response.*; import java.util.*; | [
"android.os",
"com.alorma.github",
"java.util"
] | android.os; com.alorma.github; java.util; | 2,361,974 |
String rerunWorkflow(
@NotEmpty(message = "WorkflowId cannot be null or empty.") String workflowId,
@NotNull(message = "RerunWorkflowRequest cannot be null.")
RerunWorkflowRequest request); | String rerunWorkflow( @NotEmpty(message = STR) String workflowId, @NotNull(message = STR) RerunWorkflowRequest request); | /**
* Reruns the workflow from a specific task.
*
* @param workflowId WorkflowId of the workflow you want to rerun.
* @param request (@link RerunWorkflowRequest) for the workflow.
* @return WorkflowId of the rerun workflow.
*/ | Reruns the workflow from a specific task | rerunWorkflow | {
"repo_name": "Netflix/conductor",
"path": "core/src/main/java/com/netflix/conductor/service/WorkflowService.java",
"license": "apache-2.0",
"size": 17712
} | [
"com.netflix.conductor.common.metadata.workflow.RerunWorkflowRequest",
"javax.validation.constraints.NotEmpty",
"javax.validation.constraints.NotNull"
] | import com.netflix.conductor.common.metadata.workflow.RerunWorkflowRequest; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; | import com.netflix.conductor.common.metadata.workflow.*; import javax.validation.constraints.*; | [
"com.netflix.conductor",
"javax.validation"
] | com.netflix.conductor; javax.validation; | 1,741,279 |
private CampPattern translateContainsAny(SemValue x, SemValue y) {
boolean started = checkPassertStart();
CampPattern countIntersect = new UnaryPattern(UnaryOperator.OpCount,
new BinaryPattern(BinaryOperator.OpBagMin, x.accept(this), y.accept(this)));
CampPattern eq0 = new BinaryPattern(BinaryOperator.OpEq... | CampPattern function(SemValue x, SemValue y) { boolean started = checkPassertStart(); CampPattern countIntersect = new UnaryPattern(UnaryOperator.OpCount, new BinaryPattern(BinaryOperator.OpBagMin, x.accept(this), y.accept(this))); CampPattern eq0 = new BinaryPattern(BinaryOperator.OpEqual, new ConstPattern(0), countIn... | /**
* Translate a "containsAny" method call to the bag intersection equivalent expression for CAMP
* @param x the SemValue for one collection
* @param y the SemValue for the other collection
* @return the CAMP pattern required
*/ | Translate a "containsAny" method call to the bag intersection equivalent expression for CAMP | translateContainsAny | {
"repo_name": "querycert/qcert",
"path": "compiler/parsingJava/jrulesParser/src/org/qcert/camp/translator/SemRule2CAMP.java",
"license": "apache-2.0",
"size": 70950
} | [
"com.ibm.rules.engine.lang.semantics.SemValue",
"org.qcert.camp.pattern.BinaryOperator",
"org.qcert.camp.pattern.BinaryPattern",
"org.qcert.camp.pattern.CampPattern",
"org.qcert.camp.pattern.ConstPattern",
"org.qcert.camp.pattern.UnaryOperator",
"org.qcert.camp.pattern.UnaryPattern"
] | import com.ibm.rules.engine.lang.semantics.SemValue; import org.qcert.camp.pattern.BinaryOperator; import org.qcert.camp.pattern.BinaryPattern; import org.qcert.camp.pattern.CampPattern; import org.qcert.camp.pattern.ConstPattern; import org.qcert.camp.pattern.UnaryOperator; import org.qcert.camp.pattern.UnaryPattern; | import com.ibm.rules.engine.lang.semantics.*; import org.qcert.camp.pattern.*; | [
"com.ibm.rules",
"org.qcert.camp"
] | com.ibm.rules; org.qcert.camp; | 1,273,892 |
private void checkSourceNodeForPreventionClass(NodeRef sourceNode)
{
// A node's content class is its type and all its aspects.
// We'll not check the source node for null and leave that to the rendering action.
if (sourceNode != null && nodeService.exists(sourceNode))
{
... | void function(NodeRef sourceNode) { if (sourceNode != null && nodeService.exists(sourceNode)) { Set<QName> nodeContentClasses = nodeService.getAspects(sourceNode); nodeContentClasses.add(nodeService.getType(sourceNode)); for (QName contentClass : nodeContentClasses) { if (renditionPreventionRegistry.isContentClassRegis... | /**
* This method checks whether the specified source node is of a content class which has been registered for rendition prevention.
*
* @param sourceNode the node to check.
* @throws RenditionPreventedException if the source node is configured for rendition prevention.
* @since 4.0.1
... | This method checks whether the specified source node is of a content class which has been registered for rendition prevention | checkSourceNodeForPreventionClass | {
"repo_name": "Alfresco/community-edition",
"path": "projects/repository/source/java/org/alfresco/repo/rendition/RenditionServiceImpl.java",
"license": "lgpl-3.0",
"size": 24919
} | [
"java.util.Set",
"org.alfresco.service.cmr.rendition.RenditionPreventedException",
"org.alfresco.service.cmr.repository.NodeRef",
"org.alfresco.service.namespace.QName"
] | import java.util.Set; import org.alfresco.service.cmr.rendition.RenditionPreventedException; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.namespace.QName; | import java.util.*; import org.alfresco.service.cmr.rendition.*; import org.alfresco.service.cmr.repository.*; import org.alfresco.service.namespace.*; | [
"java.util",
"org.alfresco.service"
] | java.util; org.alfresco.service; | 1,835,940 |
private void hardwareChangeMode(HvacMode modeFrom, HvacMode modeTo) {
executor.execute(new CommandChangeMode(hvacDriver, modeTo));
} | void function(HvacMode modeFrom, HvacMode modeTo) { executor.execute(new CommandChangeMode(hvacDriver, modeTo)); } | /**
* Change the HVAC hardware operating mode.
*
* This operation must be asynchronous, return immediately and never throw any exceptions.
* Whatever problems that may have been encountered must be reported via separate channels.
*
* @param modeFrom Mode to change from.
* @param mod... | Change the HVAC hardware operating mode. This operation must be asynchronous, return immediately and never throw any exceptions. Whatever problems that may have been encountered must be reported via separate channels | hardwareChangeMode | {
"repo_name": "marcass/dz-1",
"path": "dz3-model/src/main/java/net/sf/dz3/device/actuator/impl/HvacControllerImpl.java",
"license": "gpl-3.0",
"size": 14994
} | [
"net.sf.dz3.device.model.HvacMode"
] | import net.sf.dz3.device.model.HvacMode; | import net.sf.dz3.device.model.*; | [
"net.sf.dz3"
] | net.sf.dz3; | 1,233,105 |
private void ackRemoteManagement() {
assert log != null;
if (!log.isInfoEnabled())
return;
SB sb = new SB();
sb.a("Remote Management [");
boolean on = isJmxRemoteEnabled();
sb.a("restart: ").a(onOff(isRestartEnabled())).a(", ");
sb.a("REST: ")... | void function() { assert log != null; if (!log.isInfoEnabled()) return; SB sb = new SB(); sb.a(STR); boolean on = isJmxRemoteEnabled(); sb.a(STR).a(onOff(isRestartEnabled())).a(STR); sb.a(STR).a(onOff(isRestEnabled())).a(STR); sb.a(STR); sb.a(STR).a(onOff(on)); if (on) { sb.a(STR); sb.a(STR).a(System.getProperty("com.s... | /**
* Acks remote management.
*/ | Acks remote management | ackRemoteManagement | {
"repo_name": "endian675/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java",
"license": "apache-2.0",
"size": 150901
} | [
"org.apache.ignite.IgniteSystemProperties"
] | import org.apache.ignite.IgniteSystemProperties; | import org.apache.ignite.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,488,756 |
public Builder add(Iterable<Descriptor> messageTypes) {
if (types == null) {
throw new IllegalStateException(
"A TypeRegistry.Builer can only be used once.");
}
for (Descriptor type : messageTypes) {
addFile(type.getFile());
}
return this;
... | Builder function(Iterable<Descriptor> messageTypes) { if (types == null) { throw new IllegalStateException( STR); } for (Descriptor type : messageTypes) { addFile(type.getFile()); } return this; } | /**
* Adds message types and all types defined in the same .proto file as
* well as all transitively imported .proto files to this {@link Builder}.
*/ | Adds message types and all types defined in the same .proto file as well as all transitively imported .proto files to this <code>Builder</code> | add | {
"repo_name": "bowlofstew/kythe",
"path": "third_party/proto/java/util/src/main/java/com/google/protobuf/util/JsonFormat.java",
"license": "apache-2.0",
"size": 56599
} | [
"com.google.protobuf.Descriptors"
] | import com.google.protobuf.Descriptors; | import com.google.protobuf.*; | [
"com.google.protobuf"
] | com.google.protobuf; | 1,094,470 |
int getRestrictionType(String restrictionName) throws RepositoryException; | int getRestrictionType(String restrictionName) throws RepositoryException; | /**
* Return the expected {@link javax.jcr.PropertyType property type} of the
* restriction with the specified <code>restrictionName</code>.
*
* @param restrictionName Any of the restriction names retrieved from
* {@link #getRestrictionNames()}.
* @return expected {@link javax.jcr.Property... | Return the expected <code>javax.jcr.PropertyType property type</code> of the restriction with the specified <code>restrictionName</code> | getRestrictionType | {
"repo_name": "SylvesterAbreu/jackrabbit",
"path": "jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/JackrabbitAccessControlList.java",
"license": "apache-2.0",
"size": 8242
} | [
"javax.jcr.RepositoryException"
] | import javax.jcr.RepositoryException; | import javax.jcr.*; | [
"javax.jcr"
] | javax.jcr; | 150,992 |
public static MozuUrl getPackageLabelUrl(String orderId, String packageId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/packages/{packageId}/label");
formatter.formatUrl("orderId", orderId);
formatter.formatUrl("packageId", packageId);
return new MozuUrl(formatter.getReso... | static MozuUrl function(String orderId, String packageId) { UrlFormatter formatter = new UrlFormatter(STR); formatter.formatUrl(STR, orderId); formatter.formatUrl(STR, packageId); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; } | /**
* Get Resource Url for GetPackageLabel
* @param orderId Unique identifier of the order.
* @param packageId Unique identifier of the package for which to retrieve the label.
* @return String Resource Url
*/ | Get Resource Url for GetPackageLabel | getPackageLabelUrl | {
"repo_name": "johngatti/mozu-java",
"path": "mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/orders/PackageUrl.java",
"license": "mit",
"size": 4406
} | [
"com.mozu.api.MozuUrl",
"com.mozu.api.utils.UrlFormatter"
] | import com.mozu.api.MozuUrl; import com.mozu.api.utils.UrlFormatter; | import com.mozu.api.*; import com.mozu.api.utils.*; | [
"com.mozu.api"
] | com.mozu.api; | 2,031,891 |
String getWbGetEntitiesUrl(List<String> entityIds) {
final String entityString = implodeObjects(entityIds);
Map<String, String> parameters = new HashMap<>();
parameters.put("ids", entityString);
return getWbGetEntitiesUrl(parameters);
} | String getWbGetEntitiesUrl(List<String> entityIds) { final String entityString = implodeObjects(entityIds); Map<String, String> parameters = new HashMap<>(); parameters.put("ids", entityString); return getWbGetEntitiesUrl(parameters); } | /**
* Returns the URL string for a wbgetentities request to the Wikibase API,
* or null if it was not possible to build such a string with the current
* settings.
*
* @param entityIds
* list of string IDs (e.g., "P31", "Q42") of requested entities
* @return URL string
*/ | Returns the URL string for a wbgetentities request to the Wikibase API, or null if it was not possible to build such a string with the current settings | getWbGetEntitiesUrl | {
"repo_name": "GlorimarCastro/glorimar-wikidata-toolkit",
"path": "wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/WikibaseDataFetcher.java",
"license": "apache-2.0",
"size": 14952
} | [
"java.util.HashMap",
"java.util.List",
"java.util.Map"
] | import java.util.HashMap; import java.util.List; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 533,230 |
void blocked(HttpServletRequest request, HttpServletResponse response, BlockException ex) throws IOException; | void blocked(HttpServletRequest request, HttpServletResponse response, BlockException ex) throws IOException; | /**
* Handle the request when blocked.
*
* @param request Servlet request
* @param response Servlet response
* @param ex the block exception.
* @throws IOException some error occurs
*/ | Handle the request when blocked | blocked | {
"repo_name": "alibaba/Sentinel",
"path": "sentinel-adapter/sentinel-web-servlet/src/main/java/com/alibaba/csp/sentinel/adapter/servlet/callback/UrlBlockHandler.java",
"license": "apache-2.0",
"size": 1331
} | [
"com.alibaba.csp.sentinel.slots.block.BlockException",
"java.io.IOException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse"
] | import com.alibaba.csp.sentinel.slots.block.BlockException; import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; | import com.alibaba.csp.sentinel.slots.block.*; import java.io.*; import javax.servlet.http.*; | [
"com.alibaba.csp",
"java.io",
"javax.servlet"
] | com.alibaba.csp; java.io; javax.servlet; | 1,708,897 |
private void createNotification(int notificationId, int mediaType, String url) {
int notificationContentTextId = 0;
int notificationIconId = 0;
if (mediaType == MEDIATYPE_AUDIO_AND_VIDEO) {
notificationContentTextId = R.string.video_audio_call_notification_text_2;
not... | void function(int notificationId, int mediaType, String url) { int notificationContentTextId = 0; int notificationIconId = 0; if (mediaType == MEDIATYPE_AUDIO_AND_VIDEO) { notificationContentTextId = R.string.video_audio_call_notification_text_2; notificationIconId = R.drawable.webrtc_video; } else if (mediaType == MED... | /**
* Creates a notification for the provided notificationId and mediaType.
* @param notificationId Unique id of the notification.
* @param mediaType Media type of the notification.
* @param url Url of the current webrtc call.
*/ | Creates a notification for the provided notificationId and mediaType | createNotification | {
"repo_name": "js0701/chromium-crosswalk",
"path": "chrome/android/java/src/org/chromium/chrome/browser/media/MediaCaptureNotificationService.java",
"license": "bsd-3-clause",
"size": 12265
} | [
"android.app.Notification",
"android.app.PendingIntent",
"android.content.Intent",
"android.support.v4.app.NotificationCompat",
"org.chromium.chrome.browser.tab.Tab"
] | import android.app.Notification; import android.app.PendingIntent; import android.content.Intent; import android.support.v4.app.NotificationCompat; import org.chromium.chrome.browser.tab.Tab; | import android.app.*; import android.content.*; import android.support.v4.app.*; import org.chromium.chrome.browser.tab.*; | [
"android.app",
"android.content",
"android.support",
"org.chromium.chrome"
] | android.app; android.content; android.support; org.chromium.chrome; | 1,367,085 |
private static String extractQualifiedName(DetailAST classExtend) {
final String className;
if (classExtend.findFirstToken(TokenTypes.IDENT) == null) {
// Name specified with packages, have to traverse DOT
final DetailAST firstChild = classExtend.findFirstToken(TokenTypes.DO... | static String function(DetailAST classExtend) { final String className; if (classExtend.findFirstToken(TokenTypes.IDENT) == null) { final DetailAST firstChild = classExtend.findFirstToken(TokenTypes.DOT); final List<String> qualifiedNameParts = new LinkedList<>(); qualifiedNameParts.add(0, firstChild.findFirstToken(Tok... | /**
* Get name of class(with qualified package if specified) in extend clause.
* @param classExtend extend clause to extract class name
* @return super class name
*/ | Get name of class(with qualified package if specified) in extend clause | extractQualifiedName | {
"repo_name": "liscju/checkstyle",
"path": "src/main/java/com/puppycrawl/tools/checkstyle/checks/design/FinalClassCheck.java",
"license": "lgpl-2.1",
"size": 13127
} | [
"com.puppycrawl.tools.checkstyle.api.DetailAST",
"com.puppycrawl.tools.checkstyle.api.TokenTypes",
"java.util.LinkedList",
"java.util.List"
] | import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes; import java.util.LinkedList; import java.util.List; | import com.puppycrawl.tools.checkstyle.api.*; import java.util.*; | [
"com.puppycrawl.tools",
"java.util"
] | com.puppycrawl.tools; java.util; | 1,135,661 |
@FIXVersion(introduced = "4.3")
@TagNumRef(tagNum = TagNum.TradeOriginationDate)
public Date getTradeOriginationDate() {
return tradeOriginationDate;
} | @FIXVersion(introduced = "4.3") @TagNumRef(tagNum = TagNum.TradeOriginationDate) Date function() { return tradeOriginationDate; } | /**
* Message field getter.
* @return field value
*/ | Message field getter | getTradeOriginationDate | {
"repo_name": "marvisan/HadesFIX",
"path": "Model/src/main/java/net/hades/fix/message/group/QuoteRequestRejectGroup.java",
"license": "gpl-3.0",
"size": 50378
} | [
"java.util.Date",
"net.hades.fix.message.anno.FIXVersion",
"net.hades.fix.message.anno.TagNumRef",
"net.hades.fix.message.type.TagNum"
] | import java.util.Date; import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.TagNum; | import java.util.*; import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*; | [
"java.util",
"net.hades.fix"
] | java.util; net.hades.fix; | 1,896,658 |
public static void determineCacheVisibilities(Configuration job)
throws IOException {
URI[] tarchives = DistributedCache.getCacheArchives(job);
if (tarchives != null) {
StringBuffer archiveVisibilities =
new StringBuffer(String.valueOf(isPublic(job, tarchives[0])));
for (int i = 1; i <... | static void function(Configuration job) throws IOException { URI[] tarchives = DistributedCache.getCacheArchives(job); if (tarchives != null) { StringBuffer archiveVisibilities = new StringBuffer(String.valueOf(isPublic(job, tarchives[0]))); for (int i = 1; i < tarchives.length; i++) { archiveVisibilities.append(","); ... | /**
* Determines the visibilities of the distributed cache files and
* archives. The visibility of a cache path is "public" if the leaf component
* has READ permissions for others, and the parent subdirs have
* EXECUTE permissions for others
* @param job
* @throws IOException
*/ | Determines the visibilities of the distributed cache files and archives. The visibility of a cache path is "public" if the leaf component has READ permissions for others, and the parent subdirs have EXECUTE permissions for others | determineCacheVisibilities | {
"repo_name": "dianping/cosmos-hadoop",
"path": "src/mapred/org/apache/hadoop/filecache/TrackerDistributedCacheManager.java",
"license": "apache-2.0",
"size": 41528
} | [
"java.io.IOException",
"org.apache.hadoop.conf.Configuration"
] | import java.io.IOException; import org.apache.hadoop.conf.Configuration; | import java.io.*; import org.apache.hadoop.conf.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,649,226 |
public void setPoint(final LatLng point) {
start = point;
} | void function(final LatLng point) { start = point; } | /**
* Add a point to this segment.
*
* @param point GeoPoint to add.
*/ | Add a point to this segment | setPoint | {
"repo_name": "sjeuquay1224/5Minutes",
"path": "library_map/src/main/java/com/directions/route/Segment.java",
"license": "mit",
"size": 2109
} | [
"com.google.android.gms.maps.model.LatLng"
] | import com.google.android.gms.maps.model.LatLng; | import com.google.android.gms.maps.model.*; | [
"com.google.android"
] | com.google.android; | 1,088,657 |
public void testUrlValid() {
// start by initialising the mock context
setParameterToInitMockMethod("http://myurl.com", TestSolution.PASSED);
SeoRule01071 test = new SeoRule01071();
test.setProcessResultDataService(mockProcessResultDataService);
test.setTest(mockTest);
... | void function() { setParameterToInitMockMethod("http: SeoRule01071 test = new SeoRule01071(); test.setProcessResultDataService(mockProcessResultDataService); test.setTest(mockTest); ProcessResult processResult = test.processImpl(mockSspHandler); assertEquals(mockDefiniteResult, processResult); } | /**
* Test to validate a simple url without parameter.
*/ | Test to validate a simple url without parameter | testUrlValid | {
"repo_name": "Asqatasun/Asqatasun",
"path": "rules/rules-seo1.0/src/test/java/org/asqatasun/rules/seo/SeoRule01071Test.java",
"license": "agpl-3.0",
"size": 7075
} | [
"junit.framework.Assert",
"org.asqatasun.entity.audit.ProcessResult"
] | import junit.framework.Assert; import org.asqatasun.entity.audit.ProcessResult; | import junit.framework.*; import org.asqatasun.entity.audit.*; | [
"junit.framework",
"org.asqatasun.entity"
] | junit.framework; org.asqatasun.entity; | 2,395,530 |
public Set<String> getUncountables() {
return uncountables;
} | Set<String> function() { return uncountables; } | /**
* Get the set of words that are not processed by the Inflector. The resulting map is directly
* modifiable.
*
* @return the set of uncountable words
*/ | Get the set of words that are not processed by the Inflector. The resulting map is directly modifiable | getUncountables | {
"repo_name": "danielnorberg/auto-matter",
"path": "processor/src/main/java/io/norberg/automatter/processor/Inflector.java",
"license": "apache-2.0",
"size": 23856
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 930,595 |
@ApiModelProperty(value = "Allow files to be viewed in Office Online")
public Boolean isAllowOfficeOnline() {
return allowOfficeOnline;
} | @ApiModelProperty(value = STR) Boolean function() { return allowOfficeOnline; } | /**
* Allow files to be viewed in Office Online
* @return allowOfficeOnline
**/ | Allow files to be viewed in Office Online | isAllowOfficeOnline | {
"repo_name": "iterate-ch/cyberduck",
"path": "storegate/src/main/java/ch/cyberduck/core/storegate/io/swagger/client/model/CreateFileShareRequest.java",
"license": "gpl-3.0",
"size": 13214
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 30,926 |
public synchronized float getAscent(float pointSize,
AffineTransform transform,
boolean antialiased,
boolean fractionalMetrics,
boolean horizontal)
{
return sca... | synchronized float function(float pointSize, AffineTransform transform, boolean antialiased, boolean fractionalMetrics, boolean horizontal) { return scaler.getAscent(pointSize, transform, antialiased, fractionalMetrics, horizontal); } | /**
* Determines the distance between the base line and the highest
* ascender.
*
* @param pointSize the point size of the font.
*
* @param transform a transform that is applied in addition to
* scaling to the specified point size. This is often used for
* scaling according to the device resolut... | Determines the distance between the base line and the highest ascender | getAscent | {
"repo_name": "taciano-perez/JamVM-PH",
"path": "src/classpath/gnu/java/awt/font/opentype/OpenTypeFont.java",
"license": "gpl-2.0",
"size": 28650
} | [
"java.awt.geom.AffineTransform"
] | import java.awt.geom.AffineTransform; | import java.awt.geom.*; | [
"java.awt"
] | java.awt; | 1,756,886 |
@SuppressWarnings("unchecked")
public List<String> search(Collection<? extends String> keywords) {
BasicDBObject query = new BasicDBObject();
query.put("keywords", new BasicDBObject("$in", keywords));
return events().distinct("signature", query);
} | @SuppressWarnings(STR) List<String> function(Collection<? extends String> keywords) { BasicDBObject query = new BasicDBObject(); query.put(STR, new BasicDBObject("$in", keywords)); return events().distinct(STR, query); } | /**
* Returns a list of distinct (!) signatures of all events that have these keywords.
*/ | Returns a list of distinct (!) signatures of all events that have these keywords | search | {
"repo_name": "rkapsi/gibson",
"path": "gibson-dashboard/app/org/ardverk/gibson/dashboard/EventDAO.java",
"license": "apache-2.0",
"size": 5252
} | [
"com.mongodb.BasicDBObject",
"java.util.Collection",
"java.util.List"
] | import com.mongodb.BasicDBObject; import java.util.Collection; import java.util.List; | import com.mongodb.*; import java.util.*; | [
"com.mongodb",
"java.util"
] | com.mongodb; java.util; | 1,089,850 |
public Room getRoom(int number) {
String query = "SELECT *" +
" FROM " + TABLE_ROOMS +
" WHERE " + COLUMN_ROOM_NUMBER + " = " + number;
Cursor cursor = getReadableDatabase().rawQuery(query, new String[0]);
if (cursor.moveToFirst()) {
int seats = ... | Room function(int number) { String query = STR + STR + TABLE_ROOMS + STR + COLUMN_ROOM_NUMBER + STR + number; Cursor cursor = getReadableDatabase().rawQuery(query, new String[0]); if (cursor.moveToFirst()) { int seats = cursor.getInt(cursor.getColumnIndex(COLUMN_ROOM_SEATS)); return new Room(number, seats); } return nu... | /**
* Zoekt naar een zaal met een specifiek nummer.
* Returnt null als de zaal niet bestaat.
* @param number Het nummer van de zaal
* @return De zaal met het corresponderende id
*/ | Zoekt naar een zaal met een specifiek nummer. Returnt null als de zaal niet bestaat | getRoom | {
"repo_name": "Hebury/BioscoopCasus",
"path": "app/src/main/java/io/github/hebury/bioscoopcasus/storage/DatabaseHandler.java",
"license": "apache-2.0",
"size": 14666
} | [
"android.database.Cursor",
"io.github.hebury.bioscoopcasus.domain.Room"
] | import android.database.Cursor; import io.github.hebury.bioscoopcasus.domain.Room; | import android.database.*; import io.github.hebury.bioscoopcasus.domain.*; | [
"android.database",
"io.github.hebury"
] | android.database; io.github.hebury; | 248,665 |
private void initStore() {
store.nodeExist(DeviceResourceIds.DEVICES_ID)
.thenAccept(exists -> {
if (!exists) {
log.info("devices node does not exist!, creating...");
store.addNode(ResourceIds.ROOT_ID,
Inne... | void function() { store.nodeExist(DeviceResourceIds.DEVICES_ID) .thenAccept(exists -> { if (!exists) { log.info(STR); store.addNode(ResourceIds.ROOT_ID, InnerNode.builder(DeviceResourceIds.DEVICES_NAME, DCS_NAMESPACE) .type(Type.SINGLE_INSTANCE_NODE).build()); } }).join(); } | /**
* Ensure built-in tree nodes exists.
*/ | Ensure built-in tree nodes exists | initStore | {
"repo_name": "gkatsikas/onos",
"path": "apps/config/src/main/java/org/onosproject/config/impl/DynamicConfigManager.java",
"license": "apache-2.0",
"size": 8166
} | [
"org.onosproject.d.config.DeviceResourceIds",
"org.onosproject.d.config.ResourceIds",
"org.onosproject.yang.model.DataNode",
"org.onosproject.yang.model.InnerNode"
] | import org.onosproject.d.config.DeviceResourceIds; import org.onosproject.d.config.ResourceIds; import org.onosproject.yang.model.DataNode; import org.onosproject.yang.model.InnerNode; | import org.onosproject.d.config.*; import org.onosproject.yang.model.*; | [
"org.onosproject.d",
"org.onosproject.yang"
] | org.onosproject.d; org.onosproject.yang; | 2,281,609 |
public Map<PValue, TransformTreeNode> getInputs() {
return Collections.unmodifiableMap(inputs);
} | Map<PValue, TransformTreeNode> function() { return Collections.unmodifiableMap(inputs); } | /**
* Returns a mapping of inputs to the producing nodes for all inputs to
* the transform.
*/ | Returns a mapping of inputs to the producing nodes for all inputs to the transform | getInputs | {
"repo_name": "PieterDM/DataflowJavaSDK",
"path": "sdk/src/main/java/com/google/cloud/dataflow/sdk/runners/TransformTreeNode.java",
"license": "apache-2.0",
"size": 7377
} | [
"com.google.cloud.dataflow.sdk.values.PValue",
"java.util.Collections",
"java.util.Map"
] | import com.google.cloud.dataflow.sdk.values.PValue; import java.util.Collections; import java.util.Map; | import com.google.cloud.dataflow.sdk.values.*; import java.util.*; | [
"com.google.cloud",
"java.util"
] | com.google.cloud; java.util; | 2,279,297 |
public Quaternion normalize() {
final double norm = getNorm();
if (norm < Precision.SAFE_MIN) {
throw new ZeroException(LocalizedFormats.NORM, norm);
}
return new Quaternion(q0 / norm,
q1 / norm,
q2 / norm,
... | Quaternion function() { final double norm = getNorm(); if (norm < Precision.SAFE_MIN) { throw new ZeroException(LocalizedFormats.NORM, norm); } return new Quaternion(q0 / norm, q1 / norm, q2 / norm, q3 / norm); } /** * {@inheritDoc} | /**
* Computes the normalized quaternion (the versor of the instance).
* The norm of the quaternion must not be zero.
*
* @return a normalized quaternion.
* @throws ZeroException if the norm of the quaternion is zero.
*/ | Computes the normalized quaternion (the versor of the instance). The norm of the quaternion must not be zero | normalize | {
"repo_name": "SpoonLabs/astor",
"path": "examples/math_20/src/main/java/org/apache/commons/math3/complex/Quaternion.java",
"license": "gpl-2.0",
"size": 14067
} | [
"org.apache.commons.math3.exception.ZeroException",
"org.apache.commons.math3.exception.util.LocalizedFormats",
"org.apache.commons.math3.util.Precision"
] | import org.apache.commons.math3.exception.ZeroException; import org.apache.commons.math3.exception.util.LocalizedFormats; import org.apache.commons.math3.util.Precision; | import org.apache.commons.math3.exception.*; import org.apache.commons.math3.exception.util.*; import org.apache.commons.math3.util.*; | [
"org.apache.commons"
] | org.apache.commons; | 1,149,165 |
@Override
public void onMapReady(GoogleMap gMap) {
googleMap = gMap;
googleMap.setMyLocationEnabled(true);
} | void function(GoogleMap gMap) { googleMap = gMap; googleMap.setMyLocationEnabled(true); } | /**
* Connect to LocationService to get the location
*/ | Connect to LocationService to get the location | onMapReady | {
"repo_name": "jagrutkosti/dashit",
"path": "app/src/main/java/dashit/uni/com/dashit/view/activity/MainActivity.java",
"license": "mit",
"size": 10763
} | [
"com.google.android.gms.maps.GoogleMap"
] | import com.google.android.gms.maps.GoogleMap; | import com.google.android.gms.maps.*; | [
"com.google.android"
] | com.google.android; | 1,069,736 |
protected final String encodeAndCompressImage(BufferedImage image) {
//Set its size to the server requested bounds
BufferedImage compressed = ImageUtils.resize(image, configuration.getWidth(), configuration.getHeight());
//Encode it to a sendable string
String encoded = Base64.getEnc... | final String function(BufferedImage image) { BufferedImage compressed = ImageUtils.resize(image, configuration.getWidth(), configuration.getHeight()); String encoded = Base64.getEncoder().encodeToString(ImageUtils.toByteArray(image)); return encoded; } | /**
* Sets the image to desired size ({@link StreamableConfig#getWidth()}, {@link StreamableConfig#getHeight()})
* and encodes it to {@link Base64} for sending
*/ | Sets the image to desired size (<code>StreamableConfig#getWidth()</code>, <code>StreamableConfig#getHeight()</code>) and encodes it to <code>Base64</code> for sending | encodeAndCompressImage | {
"repo_name": "ShaneHD/Global-Utilities",
"path": "Global Utilities/src/com/github/shanehd/utilities/net/stream/Streamable.java",
"license": "mpl-2.0",
"size": 3975
} | [
"com.github.shanehd.utilities.ImageUtils",
"java.awt.image.BufferedImage",
"java.util.Base64"
] | import com.github.shanehd.utilities.ImageUtils; import java.awt.image.BufferedImage; import java.util.Base64; | import com.github.shanehd.utilities.*; import java.awt.image.*; import java.util.*; | [
"com.github.shanehd",
"java.awt",
"java.util"
] | com.github.shanehd; java.awt; java.util; | 2,385,947 |
private ResultColumn createGeneratedColumn
(
TableDescriptor targetTD,
ColumnDescriptor colDesc
)
throws StandardException
{
ValueNode dummy = new UntypedNullConstantNode(getContextManager());
ResultColumn newResultColumn =
new Re... | ResultColumn function ( TableDescriptor targetTD, ColumnDescriptor colDesc ) throws StandardException { ValueNode dummy = new UntypedNullConstantNode(getContextManager()); ResultColumn newResultColumn = new ResultColumn(colDesc.getType(), dummy, getContextManager()); newResultColumn.setColumnDescriptor( targetTD, colDe... | /**
* Create a ResultColumn for a column with a generation clause.
*/ | Create a ResultColumn for a column with a generation clause | createGeneratedColumn | {
"repo_name": "trejkaz/derby",
"path": "java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java",
"license": "apache-2.0",
"size": 65254
} | [
"org.apache.derby.iapi.error.StandardException",
"org.apache.derby.iapi.sql.dictionary.ColumnDescriptor",
"org.apache.derby.iapi.sql.dictionary.TableDescriptor"
] | import org.apache.derby.iapi.error.StandardException; import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor; import org.apache.derby.iapi.sql.dictionary.TableDescriptor; | import org.apache.derby.iapi.error.*; import org.apache.derby.iapi.sql.dictionary.*; | [
"org.apache.derby"
] | org.apache.derby; | 1,267,829 |
public void setEnvironmentImpl(EnvironmentImpl envImpl)
throws DatabaseException {
this.envImpl = envImpl;
initWithEnvironment();
tree.setDatabase(this);
} | void function(EnvironmentImpl envImpl) throws DatabaseException { this.envImpl = envImpl; initWithEnvironment(); tree.setDatabase(this); } | /**
* Set the db environment after reading in the DatabaseImpl from the log.
*/ | Set the db environment after reading in the DatabaseImpl from the log | setEnvironmentImpl | {
"repo_name": "plast-lab/DelphJ",
"path": "examples/berkeleydb/com/sleepycat/je/dbi/DatabaseImpl.java",
"license": "mit",
"size": 83526
} | [
"com.sleepycat.je.DatabaseException"
] | import com.sleepycat.je.DatabaseException; | import com.sleepycat.je.*; | [
"com.sleepycat.je"
] | com.sleepycat.je; | 534,604 |
public void addZIncludedListener(ActionListener listener) {
zCheckbox.addActionListener(listener);
} | void function(ActionListener listener) { zCheckbox.addActionListener(listener); } | /**
* Add a listener for including the Z subelement.
*
* @param listener the ActionListener for the parameter
*/ | Add a listener for including the Z subelement | addZIncludedListener | {
"repo_name": "googleinterns/wifirtt",
"path": "WifiART/src/userinterface/ArtMvcView.java",
"license": "apache-2.0",
"size": 17363
} | [
"java.awt.event.ActionListener"
] | import java.awt.event.ActionListener; | import java.awt.event.*; | [
"java.awt"
] | java.awt; | 1,004,981 |
public Paint getDomainGridlinePaint() {
return this.domainGridlinePaint;
}
| Paint function() { return this.domainGridlinePaint; } | /**
* Returns the paint for the grid lines (if any) plotted against the domain
* axis.
*
* @return The paint (never <code>null</code>).
*
* @see #setDomainGridlinePaint(Paint)
*/ | Returns the paint for the grid lines (if any) plotted against the domain axis | getDomainGridlinePaint | {
"repo_name": "martingwhite/astor",
"path": "examples/chart_11/source/org/jfree/chart/plot/FastScatterPlot.java",
"license": "gpl-2.0",
"size": 34448
} | [
"java.awt.Paint"
] | import java.awt.Paint; | import java.awt.*; | [
"java.awt"
] | java.awt; | 829,928 |
public Message read() throws IOException
{
Message.Builder tempBuilder = builder.clone();
cis.readMessage(tempBuilder, extensionRegistry);
return tempBuilder.build();
} | Message function() throws IOException { Message.Builder tempBuilder = builder.clone(); cis.readMessage(tempBuilder, extensionRegistry); return tempBuilder.build(); } | /**
* Reads a Message from inputStream of the type provided by either builder, descriptor, or metadata.
*
* @return A {@link Message} of the type provided.
*
* @throws IOException Thrown for errors with inputStream.
*/ | Reads a Message from inputStream of the type provided by either builder, descriptor, or metadata | read | {
"repo_name": "metamx/milano",
"path": "core/src/main/java/com/metamx/milano/io/MilanoProtoFile.java",
"license": "apache-2.0",
"size": 10288
} | [
"com.google.protobuf.Message",
"java.io.IOException"
] | import com.google.protobuf.Message; import java.io.IOException; | import com.google.protobuf.*; import java.io.*; | [
"com.google.protobuf",
"java.io"
] | com.google.protobuf; java.io; | 2,814,487 |
public static Int32 fromJsonObject(JsonObject jsonObject) {
// check the fields
int data = jsonObject.containsKey(Int32.FIELD_DATA) ? jsonObject
.getInt(Int32.FIELD_DATA) : 0;
return new Int32(data);
} | static Int32 function(JsonObject jsonObject) { int data = jsonObject.containsKey(Int32.FIELD_DATA) ? jsonObject .getInt(Int32.FIELD_DATA) : 0; return new Int32(data); } | /**
* Create a new Int32 based on the given JSON object. Any missing values
* will be set to their defaults.
*
* @param jsonObject
* The JSON object to parse.
* @return A Int32 message based on the given JSON object.
*/ | Create a new Int32 based on the given JSON object. Any missing values will be set to their defaults | fromJsonObject | {
"repo_name": "kbendick/jrosbridge",
"path": "src/main/java/edu/wpi/rail/jrosbridge/messages/std/Int32.java",
"license": "bsd-3-clause",
"size": 2390
} | [
"javax.json.JsonObject"
] | import javax.json.JsonObject; | import javax.json.*; | [
"javax.json"
] | javax.json; | 1,632,310 |
@Override
public void IF_ICMPGT(String className, String methName, int branchIndex,
int left, int right) {
// FIXME: Replace following five instructions with SWAP
IntegerValue rightBv = env.topFrame().operandStack.popBv32();
IntegerValue leftBv = env.topFrame().operandStack.popBv32();
env.topFr... | void function(String className, String methName, int branchIndex, int left, int right) { IntegerValue rightBv = env.topFrame().operandStack.popBv32(); IntegerValue leftBv = env.topFrame().operandStack.popBv32(); env.topFrame().operandStack.pushBv32(rightBv); env.topFrame().operandStack.pushBv32(leftBv); IF_ICMPLT(class... | /**
* (left > right) is just (right < left). (left <= right) is just (not (left
* > right)).
*
* http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.
* doc6.html#if_icmpcond
*/ | (left > right) is just (right right)). HREF doc6.html#if_icmpcond | IF_ICMPGT | {
"repo_name": "sefaakca/EvoSuite-Sefa",
"path": "client/src/main/java/org/evosuite/symbolic/vm/JumpVM.java",
"license": "lgpl-3.0",
"size": 14192
} | [
"org.evosuite.symbolic.expr.bv.IntegerValue"
] | import org.evosuite.symbolic.expr.bv.IntegerValue; | import org.evosuite.symbolic.expr.bv.*; | [
"org.evosuite.symbolic"
] | org.evosuite.symbolic; | 2,557,379 |
public Iterator<T> iterator() {
if (iterable == null) {
iterable = new ArrayIterable(this);
}
return iterable.iterator();
} | Iterator<T> function() { if (iterable == null) { iterable = new ArrayIterable(this); } return iterable.iterator(); } | /**
* Returns an iterator for the items in the array. Remove is supported. Note
* that the same iterator instance is returned each time this method is
* called. Use the {@link ArrayIterator} constructor for nested or
* multithreaded iteration.
*/ | Returns an iterator for the items in the array. Remove is supported. Note that the same iterator instance is returned each time this method is called. Use the <code>ArrayIterator</code> constructor for nested or multithreaded iteration | iterator | {
"repo_name": "atomixnmc/AtomMini",
"path": "src/sg/atom/core/datastructure/collection/Array.java",
"license": "mit",
"size": 22993
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 617,052 |
public void addResultingViewBinding(String viewParamsPath, Object value) {
RSFUtil.addResultingViewBinding(this, viewParamsPath, value);
}
| void function(String viewParamsPath, Object value) { RSFUtil.addResultingViewBinding(this, viewParamsPath, value); } | /** Adds a "literal" resulting view binding to this control. Rather than reading
* a path in the final request context as in {@link #addResultingViewBinding(String, String)},
* this supplies a constant, literal value into the outgoing state.
* @param viewParamsPath The path within the outgoing ViewParamete... | Adds a "literal" resulting view binding to this control. Rather than reading a path in the final request context as in <code>#addResultingViewBinding(String, String)</code>, this supplies a constant, literal value into the outgoing state | addResultingViewBinding | {
"repo_name": "axxter99/RSFUtil",
"path": "src/uk/org/ponder/rsf/components/UIParameterHolder.java",
"license": "bsd-3-clause",
"size": 2066
} | [
"uk.org.ponder.rsf.util.RSFUtil"
] | import uk.org.ponder.rsf.util.RSFUtil; | import uk.org.ponder.rsf.util.*; | [
"uk.org.ponder"
] | uk.org.ponder; | 1,854,778 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.