repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
jboss/jboss-jstl-api_spec | src/main/java/org/apache/taglibs/standard/tlv/JstlBaseTLV.java | JstlBaseTLV.configure | private void configure(String info) {
"""
parses our configuration parameter for element:attribute pairs
"""
// construct our configuration map
config = new HashMap();
// leave the map empty if we have nothing to configure
if (info == null) {
return;
}
... | java | private void configure(String info) {
// construct our configuration map
config = new HashMap();
// leave the map empty if we have nothing to configure
if (info == null) {
return;
}
// separate parameter into space-separated tokens and store them
Str... | [
"private",
"void",
"configure",
"(",
"String",
"info",
")",
"{",
"// construct our configuration map",
"config",
"=",
"new",
"HashMap",
"(",
")",
";",
"// leave the map empty if we have nothing to configure",
"if",
"(",
"info",
"==",
"null",
")",
"{",
"return",
";",... | parses our configuration parameter for element:attribute pairs | [
"parses",
"our",
"configuration",
"parameter",
"for",
"element",
":",
"attribute",
"pairs"
] | train | https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/org/apache/taglibs/standard/tlv/JstlBaseTLV.java#L310-L333 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java | NetworkAddressUtils.getBindAddress | public static InetSocketAddress getBindAddress(ServiceType service, AlluxioConfiguration conf) {
"""
Helper method to get the bind hostname for a given service.
@param service the service name
@param conf Alluxio configuration
@return the InetSocketAddress the service will bind to
"""
int port = getPo... | java | public static InetSocketAddress getBindAddress(ServiceType service, AlluxioConfiguration conf) {
int port = getPort(service, conf);
assertValidPort(port);
return new InetSocketAddress(getBindHost(service, conf), getPort(service, conf));
} | [
"public",
"static",
"InetSocketAddress",
"getBindAddress",
"(",
"ServiceType",
"service",
",",
"AlluxioConfiguration",
"conf",
")",
"{",
"int",
"port",
"=",
"getPort",
"(",
"service",
",",
"conf",
")",
";",
"assertValidPort",
"(",
"port",
")",
";",
"return",
"... | Helper method to get the bind hostname for a given service.
@param service the service name
@param conf Alluxio configuration
@return the InetSocketAddress the service will bind to | [
"Helper",
"method",
"to",
"get",
"the",
"bind",
"hostname",
"for",
"a",
"given",
"service",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java#L319-L323 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/graph/SparkComputationGraph.java | SparkComputationGraph.evaluateROCMultiClass | public <T extends ROCMultiClass> T evaluateROCMultiClass(JavaRDD<DataSet> data, int thresholdSteps, int evaluationMinibatchSize) {
"""
Perform ROC analysis/evaluation (for the multi-class case, using {@link ROCMultiClass} on the given DataSet in a distributed manner
@param data Test set data ... | java | public <T extends ROCMultiClass> T evaluateROCMultiClass(JavaRDD<DataSet> data, int thresholdSteps, int evaluationMinibatchSize) {
return (T)doEvaluation(data, new org.deeplearning4j.eval.ROCMultiClass(thresholdSteps), evaluationMinibatchSize);
} | [
"public",
"<",
"T",
"extends",
"ROCMultiClass",
">",
"T",
"evaluateROCMultiClass",
"(",
"JavaRDD",
"<",
"DataSet",
">",
"data",
",",
"int",
"thresholdSteps",
",",
"int",
"evaluationMinibatchSize",
")",
"{",
"return",
"(",
"T",
")",
"doEvaluation",
"(",
"data",... | Perform ROC analysis/evaluation (for the multi-class case, using {@link ROCMultiClass} on the given DataSet in a distributed manner
@param data Test set data (to evaluate on)
@param thresholdSteps Number of threshold steps for ROC - see {@link ROC}
@param evaluationMinibatchSize Minibatch s... | [
"Perform",
"ROC",
"analysis",
"/",
"evaluation",
"(",
"for",
"the",
"multi",
"-",
"class",
"case",
"using",
"{",
"@link",
"ROCMultiClass",
"}",
"on",
"the",
"given",
"DataSet",
"in",
"a",
"distributed",
"manner"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/graph/SparkComputationGraph.java#L697-L699 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.checkDeletable | private void checkDeletable(File file, DeleteMode mode, Path path) throws IOException {
"""
Checks that the given file can be deleted, throwing an exception if it can't.
"""
if (file.isRootDirectory()) {
throw new FileSystemException(path.toString(), null, "can't delete root directory");
}
i... | java | private void checkDeletable(File file, DeleteMode mode, Path path) throws IOException {
if (file.isRootDirectory()) {
throw new FileSystemException(path.toString(), null, "can't delete root directory");
}
if (file.isDirectory()) {
if (mode == DeleteMode.NON_DIRECTORY_ONLY) {
throw new F... | [
"private",
"void",
"checkDeletable",
"(",
"File",
"file",
",",
"DeleteMode",
"mode",
",",
"Path",
"path",
")",
"throws",
"IOException",
"{",
"if",
"(",
"file",
".",
"isRootDirectory",
"(",
")",
")",
"{",
"throw",
"new",
"FileSystemException",
"(",
"path",
... | Checks that the given file can be deleted, throwing an exception if it can't. | [
"Checks",
"that",
"the",
"given",
"file",
"can",
"be",
"deleted",
"throwing",
"an",
"exception",
"if",
"it",
"can",
"t",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L467-L488 |
micrometer-metrics/micrometer | micrometer-core/src/main/java/io/micrometer/core/instrument/binder/cache/JCacheMetrics.java | JCacheMetrics.monitor | public static <K, V, C extends Cache<K, V>> C monitor(MeterRegistry registry, C cache, String... tags) {
"""
Record metrics on a JCache cache.
@param registry The registry to bind metrics to.
@param cache The cache to instrument.
@param tags Tags to apply to all recorded metrics. Must be an even number... | java | public static <K, V, C extends Cache<K, V>> C monitor(MeterRegistry registry, C cache, String... tags) {
return monitor(registry, cache, Tags.of(tags));
} | [
"public",
"static",
"<",
"K",
",",
"V",
",",
"C",
"extends",
"Cache",
"<",
"K",
",",
"V",
">",
">",
"C",
"monitor",
"(",
"MeterRegistry",
"registry",
",",
"C",
"cache",
",",
"String",
"...",
"tags",
")",
"{",
"return",
"monitor",
"(",
"registry",
"... | Record metrics on a JCache cache.
@param registry The registry to bind metrics to.
@param cache The cache to instrument.
@param tags Tags to apply to all recorded metrics. Must be an even number of arguments representing key/value pairs of tags.
@param <C> The cache type.
@param <K> The cache key type... | [
"Record",
"metrics",
"on",
"a",
"JCache",
"cache",
"."
] | train | https://github.com/micrometer-metrics/micrometer/blob/127fa3265325cc894f368312ed8890b76a055d88/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/cache/JCacheMetrics.java#L58-L60 |
alkacon/opencms-core | src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java | CmsContainerpageController.setElementView | public void setElementView(CmsElementViewInfo viewInfo, Runnable nextAction) {
"""
Sets the element view.<p>
@param viewInfo the element view
@param nextAction the action to execute after setting the view
"""
if (viewInfo != null) {
m_elementView = viewInfo;
CmsRpcAction<V... | java | public void setElementView(CmsElementViewInfo viewInfo, Runnable nextAction) {
if (viewInfo != null) {
m_elementView = viewInfo;
CmsRpcAction<Void> action = new CmsRpcAction<Void>() {
@SuppressWarnings("synthetic-access")
@Override
publi... | [
"public",
"void",
"setElementView",
"(",
"CmsElementViewInfo",
"viewInfo",
",",
"Runnable",
"nextAction",
")",
"{",
"if",
"(",
"viewInfo",
"!=",
"null",
")",
"{",
"m_elementView",
"=",
"viewInfo",
";",
"CmsRpcAction",
"<",
"Void",
">",
"action",
"=",
"new",
... | Sets the element view.<p>
@param viewInfo the element view
@param nextAction the action to execute after setting the view | [
"Sets",
"the",
"element",
"view",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java#L3232-L3258 |
grpc/grpc-java | okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/Platform.java | Platform.getAppEngineProvider | private static Provider getAppEngineProvider() {
"""
Forcibly load the conscrypt security provider on AppEngine if it's available. If not fail.
"""
try {
// Forcibly load conscrypt as it is unlikely to be an installed provider on AppEngine
return (Provider) Class.forName("org.conscrypt.OpenSSLP... | java | private static Provider getAppEngineProvider() {
try {
// Forcibly load conscrypt as it is unlikely to be an installed provider on AppEngine
return (Provider) Class.forName("org.conscrypt.OpenSSLProvider")
.getConstructor().newInstance();
} catch (Throwable t) {
throw new RuntimeExce... | [
"private",
"static",
"Provider",
"getAppEngineProvider",
"(",
")",
"{",
"try",
"{",
"// Forcibly load conscrypt as it is unlikely to be an installed provider on AppEngine",
"return",
"(",
"Provider",
")",
"Class",
".",
"forName",
"(",
"\"org.conscrypt.OpenSSLProvider\"",
")",
... | Forcibly load the conscrypt security provider on AppEngine if it's available. If not fail. | [
"Forcibly",
"load",
"the",
"conscrypt",
"security",
"provider",
"on",
"AppEngine",
"if",
"it",
"s",
"available",
".",
"If",
"not",
"fail",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/Platform.java#L305-L313 |
tencentyun/cos-java-sdk | src/main/java/com/qcloud/cos/sign/Sign.java | Sign.getPeriodEffectiveSign | public static String getPeriodEffectiveSign(String bucketName, String cosPath, Credentials cred, long expired)
throws AbstractCosException {
"""
获取多次签名, 一段时间内有效, 针对上传文件,重命名文件, 创建目录, 获取文件目录属性, 拉取目录列表
@param bucketName
bucket名称
@param cosPath
要签名的cos路径
@param cred
用户的身份信息, 包括appid, secret_id和secret_key
@... | java | public static String getPeriodEffectiveSign(String bucketName, String cosPath, Credentials cred, long expired)
throws AbstractCosException {
return appSignatureBase(cred, bucketName, cosPath, expired, true);
} | [
"public",
"static",
"String",
"getPeriodEffectiveSign",
"(",
"String",
"bucketName",
",",
"String",
"cosPath",
",",
"Credentials",
"cred",
",",
"long",
"expired",
")",
"throws",
"AbstractCosException",
"{",
"return",
"appSignatureBase",
"(",
"cred",
",",
"bucketName... | 获取多次签名, 一段时间内有效, 针对上传文件,重命名文件, 创建目录, 获取文件目录属性, 拉取目录列表
@param bucketName
bucket名称
@param cosPath
要签名的cos路径
@param cred
用户的身份信息, 包括appid, secret_id和secret_key
@param expired
签名过期时间, UNIX时间戳。如想让签名在30秒后过期, 即可将expired设成当前时间加上30秒
@return base64编码的字符串
@throws AbstractCosException | [
"获取多次签名",
"一段时间内有效",
"针对上传文件,重命名文件",
"创建目录",
"获取文件目录属性",
"拉取目录列表"
] | train | https://github.com/tencentyun/cos-java-sdk/blob/6709a48f67c1ea7b82a7215f5037d6ccf218b630/src/main/java/com/qcloud/cos/sign/Sign.java#L75-L78 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/proxyqueue/impl/ProxyQueueConversationGroupImpl.java | ProxyQueueConversationGroupImpl.createReadAheadProxyQueue | public synchronized AsynchConsumerProxyQueue createReadAheadProxyQueue(Reliability unrecoverableReliability) // f187521.2.1
throws SIResourceException, SIIncorrectCallException {
"""
Creates a new read ahead proxy queue for this group.
@see com.ibm.ws.sib.comms.client.proxyqueue.ProxyQueueConversationGroup#... | java | public synchronized AsynchConsumerProxyQueue createReadAheadProxyQueue(Reliability unrecoverableReliability) // f187521.2.1
throws SIResourceException, SIIncorrectCallException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createReadAheadProxyQueue");
checkClosed... | [
"public",
"synchronized",
"AsynchConsumerProxyQueue",
"createReadAheadProxyQueue",
"(",
"Reliability",
"unrecoverableReliability",
")",
"// f187521.2.1",
"throws",
"SIResourceException",
",",
"SIIncorrectCallException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled"... | Creates a new read ahead proxy queue for this group.
@see com.ibm.ws.sib.comms.client.proxyqueue.ProxyQueueConversationGroup#createReadAheadProxyQueue(Reliability) | [
"Creates",
"a",
"new",
"read",
"ahead",
"proxy",
"queue",
"for",
"this",
"group",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/proxyqueue/impl/ProxyQueueConversationGroupImpl.java#L220-L236 |
EdwardRaff/JSAT | JSAT/src/jsat/linear/RowColumnOps.java | RowColumnOps.swapRow | public static void swapRow(Matrix A, int j, int k) {
"""
Swaps the columns <tt>j</tt> and <tt>k</tt> in the given matrix.
@param A the matrix to perform he update on
@param j the first column to swap
@param k the second column to swap
"""
swapCol(A, j, k, 0, A.cols());
} | java | public static void swapRow(Matrix A, int j, int k)
{
swapCol(A, j, k, 0, A.cols());
} | [
"public",
"static",
"void",
"swapRow",
"(",
"Matrix",
"A",
",",
"int",
"j",
",",
"int",
"k",
")",
"{",
"swapCol",
"(",
"A",
",",
"j",
",",
"k",
",",
"0",
",",
"A",
".",
"cols",
"(",
")",
")",
";",
"}"
] | Swaps the columns <tt>j</tt> and <tt>k</tt> in the given matrix.
@param A the matrix to perform he update on
@param j the first column to swap
@param k the second column to swap | [
"Swaps",
"the",
"columns",
"<tt",
">",
"j<",
"/",
"tt",
">",
"and",
"<tt",
">",
"k<",
"/",
"tt",
">",
"in",
"the",
"given",
"matrix",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/RowColumnOps.java#L405-L408 |
apache/incubator-druid | services/src/main/java/org/apache/druid/cli/PullDependencies.java | PullDependencies.createExtensionDirectory | private void createExtensionDirectory(String coordinate, File atLocation) {
"""
Create the extension directory for a specific maven coordinate.
The name of this directory should be the artifactId in the coordinate
"""
if (atLocation.isDirectory()) {
log.info("Directory [%s] already exists, skipping ... | java | private void createExtensionDirectory(String coordinate, File atLocation)
{
if (atLocation.isDirectory()) {
log.info("Directory [%s] already exists, skipping creating a directory", atLocation.getAbsolutePath());
return;
}
if (!atLocation.mkdir()) {
throw new ISE(
"Unable to cr... | [
"private",
"void",
"createExtensionDirectory",
"(",
"String",
"coordinate",
",",
"File",
"atLocation",
")",
"{",
"if",
"(",
"atLocation",
".",
"isDirectory",
"(",
")",
")",
"{",
"log",
".",
"info",
"(",
"\"Directory [%s] already exists, skipping creating a directory\"... | Create the extension directory for a specific maven coordinate.
The name of this directory should be the artifactId in the coordinate | [
"Create",
"the",
"extension",
"directory",
"for",
"a",
"specific",
"maven",
"coordinate",
".",
"The",
"name",
"of",
"this",
"directory",
"should",
"be",
"the",
"artifactId",
"in",
"the",
"coordinate"
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/services/src/main/java/org/apache/druid/cli/PullDependencies.java#L545-L559 |
OpenLiberty/open-liberty | dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/component/_SharedRendererUtils.java | _SharedRendererUtils.getSelectItemsValueConverter | static Converter getSelectItemsValueConverter(Iterator<SelectItem> iterator, FacesContext facesContext) {
"""
Iterates through the SelectItems with the given Iterator and tries to obtain
a by-class-converter based on the Class of SelectItem.getValue().
@param iterator
@param facesContext
@return The first suit... | java | static Converter getSelectItemsValueConverter(Iterator<SelectItem> iterator, FacesContext facesContext)
{
// Attention!
// This code is duplicated in jsfapi component package.
// If you change something here please do the same in the other class!
Converter converter = null;
... | [
"static",
"Converter",
"getSelectItemsValueConverter",
"(",
"Iterator",
"<",
"SelectItem",
">",
"iterator",
",",
"FacesContext",
"facesContext",
")",
"{",
"// Attention!",
"// This code is duplicated in jsfapi component package.",
"// If you change something here please do the same i... | Iterates through the SelectItems with the given Iterator and tries to obtain
a by-class-converter based on the Class of SelectItem.getValue().
@param iterator
@param facesContext
@return The first suitable Converter for the given SelectItems or null. | [
"Iterates",
"through",
"the",
"SelectItems",
"with",
"the",
"given",
"Iterator",
"and",
"tries",
"to",
"obtain",
"a",
"by",
"-",
"class",
"-",
"converter",
"based",
"on",
"the",
"Class",
"of",
"SelectItem",
".",
"getValue",
"()",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/component/_SharedRendererUtils.java#L447-L484 |
apereo/cas | support/cas-server-support-pac4j-webflow/src/main/java/org/apereo/cas/web/DelegatedClientNavigationController.java | DelegatedClientNavigationController.getResultingView | @SneakyThrows
protected View getResultingView(final IndirectClient<Credentials, CommonProfile> client, final J2EContext webContext, final Ticket ticket) {
"""
Gets resulting view.
@param client the client
@param webContext the web context
@param ticket the ticket
@return the resulting view
""... | java | @SneakyThrows
protected View getResultingView(final IndirectClient<Credentials, CommonProfile> client, final J2EContext webContext, final Ticket ticket) {
val action = client.getRedirectAction(webContext);
if (RedirectAction.RedirectType.SUCCESS.equals(action.getType())) {
return new Dyn... | [
"@",
"SneakyThrows",
"protected",
"View",
"getResultingView",
"(",
"final",
"IndirectClient",
"<",
"Credentials",
",",
"CommonProfile",
">",
"client",
",",
"final",
"J2EContext",
"webContext",
",",
"final",
"Ticket",
"ticket",
")",
"{",
"val",
"action",
"=",
"cl... | Gets resulting view.
@param client the client
@param webContext the web context
@param ticket the ticket
@return the resulting view | [
"Gets",
"resulting",
"view",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-pac4j-webflow/src/main/java/org/apereo/cas/web/DelegatedClientNavigationController.java#L144-L154 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/thrift/CQLTranslator.java | CQLTranslator.appendSet | private boolean appendSet(StringBuilder builder, Object value) {
"""
Appends a object of type {@link java.util.Map}
@param builder
the builder
@param value
the value
@return true, if successful
"""
boolean isPresent = false;
if (value instanceof Collection)
{
Collecti... | java | private boolean appendSet(StringBuilder builder, Object value)
{
boolean isPresent = false;
if (value instanceof Collection)
{
Collection collection = ((Collection) value);
isPresent = true;
builder.append(Constants.OPEN_CURLY_BRACKET);
for (Ob... | [
"private",
"boolean",
"appendSet",
"(",
"StringBuilder",
"builder",
",",
"Object",
"value",
")",
"{",
"boolean",
"isPresent",
"=",
"false",
";",
"if",
"(",
"value",
"instanceof",
"Collection",
")",
"{",
"Collection",
"collection",
"=",
"(",
"(",
"Collection",
... | Appends a object of type {@link java.util.Map}
@param builder
the builder
@param value
the value
@return true, if successful | [
"Appends",
"a",
"object",
"of",
"type",
"{",
"@link",
"java",
".",
"util",
".",
"Map",
"}"
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/thrift/CQLTranslator.java#L1174-L1199 |
huangp/entityunit | src/main/java/com/github/huangp/entityunit/entity/EntityCleaner.java | EntityCleaner.deleteAll | public static void deleteAll(final EntityManager entityManager, Iterable<Class> entityClasses) {
"""
Delete all records from given entity representing tables and their many to many and element collection tables.
<p>
The entity classes must be in correct order. Item references Category then Category must in front... | java | public static void deleteAll(final EntityManager entityManager, Iterable<Class> entityClasses) {
for (Class entityType : entityClasses) {
EntityClass entityClass = EntityClass.from(entityType);
// delete many to many and element collection tables
Iterable<String> association... | [
"public",
"static",
"void",
"deleteAll",
"(",
"final",
"EntityManager",
"entityManager",
",",
"Iterable",
"<",
"Class",
">",
"entityClasses",
")",
"{",
"for",
"(",
"Class",
"entityType",
":",
"entityClasses",
")",
"{",
"EntityClass",
"entityClass",
"=",
"EntityC... | Delete all records from given entity representing tables and their many to many and element collection tables.
<p>
The entity classes must be in correct order. Item references Category then Category must in front of the iterable.
@param entityManager
entity manager
@param entityClasses
entity class in correct order | [
"Delete",
"all",
"records",
"from",
"given",
"entity",
"representing",
"tables",
"and",
"their",
"many",
"to",
"many",
"and",
"element",
"collection",
"tables",
".",
"<p",
">",
"The",
"entity",
"classes",
"must",
"be",
"in",
"correct",
"order",
".",
"Item",
... | train | https://github.com/huangp/entityunit/blob/1a09b530149d707dbff7ff46f5428d9db709a4b4/src/main/java/com/github/huangp/entityunit/entity/EntityCleaner.java#L59-L71 |
brutusin/commons | src/main/java/org/brutusin/commons/utils/Miscellaneous.java | Miscellaneous.formatFilePath | public static String formatFilePath(String filePath) {
"""
Replaces all "\" and "/" in the specified file path by
<code>file.separator</code> system property.
@param filePath the original file path.
@return the formatted file path.
"""
if (filePath == null) {
return null;
}
... | java | public static String formatFilePath(String filePath) {
if (filePath == null) {
return null;
}
return normalizePath(filePath.replaceAll("//*", "/").replaceAll("\\*", "\\").replaceAll("/", "\\" + System.getProperty("file.separator")).replaceAll("\\\\", "\\" + System.getProperty("fi... | [
"public",
"static",
"String",
"formatFilePath",
"(",
"String",
"filePath",
")",
"{",
"if",
"(",
"filePath",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"normalizePath",
"(",
"filePath",
".",
"replaceAll",
"(",
"\"//*\"",
",",
"\"/\"",
")"... | Replaces all "\" and "/" in the specified file path by
<code>file.separator</code> system property.
@param filePath the original file path.
@return the formatted file path. | [
"Replaces",
"all",
"\\",
"and",
"/",
"in",
"the",
"specified",
"file",
"path",
"by",
"<code",
">",
"file",
".",
"separator<",
"/",
"code",
">",
"system",
"property",
"."
] | train | https://github.com/brutusin/commons/blob/70685df2b2456d0bf1e6a4754d72c87bba4949df/src/main/java/org/brutusin/commons/utils/Miscellaneous.java#L565-L571 |
apache/incubator-druid | server/src/main/java/org/apache/druid/server/coordinator/DataSourceCompactionConfig.java | DataSourceCompactionConfig.getValidTargetCompactionSizeBytes | @Nullable
private static Long getValidTargetCompactionSizeBytes(
@Nullable Long targetCompactionSizeBytes,
@Nullable Integer maxRowsPerSegment,
@Nullable UserCompactTuningConfig tuningConfig
) {
"""
This method is copied from {@code CompactionTask#getValidTargetCompactionSizeBytes}. The only ... | java | @Nullable
private static Long getValidTargetCompactionSizeBytes(
@Nullable Long targetCompactionSizeBytes,
@Nullable Integer maxRowsPerSegment,
@Nullable UserCompactTuningConfig tuningConfig
)
{
if (targetCompactionSizeBytes != null) {
Preconditions.checkArgument(
!hasPartiti... | [
"@",
"Nullable",
"private",
"static",
"Long",
"getValidTargetCompactionSizeBytes",
"(",
"@",
"Nullable",
"Long",
"targetCompactionSizeBytes",
",",
"@",
"Nullable",
"Integer",
"maxRowsPerSegment",
",",
"@",
"Nullable",
"UserCompactTuningConfig",
"tuningConfig",
")",
"{",
... | This method is copied from {@code CompactionTask#getValidTargetCompactionSizeBytes}. The only difference is this
method doesn't check 'numShards' which is not supported by {@link UserCompactTuningConfig}.
Currently, we can't use the same method here because it's in a different module. Until we figure out how to reuse
... | [
"This",
"method",
"is",
"copied",
"from",
"{",
"@code",
"CompactionTask#getValidTargetCompactionSizeBytes",
"}",
".",
"The",
"only",
"difference",
"is",
"this",
"method",
"doesn",
"t",
"check",
"numShards",
"which",
"is",
"not",
"supported",
"by",
"{",
"@link",
... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/server/src/main/java/org/apache/druid/server/coordinator/DataSourceCompactionConfig.java#L110-L129 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/domain/builders/SubReportBuilder.java | SubReportBuilder.setDataSource | public SubReportBuilder setDataSource(int origin, int type, String expression) {
"""
Indicates from where to get the data source.<br>
@param origin Must be one of these constans located in DJConstants inteface<br>
- SUBREPORT_DATAS_OURCE_ORIGIN_PARAMETER<br>
- SUBREPORT_DATAS_OURCE_ORIGIN_FIELD<br>
- SUBREPO... | java | public SubReportBuilder setDataSource(int origin, int type, String expression) {
DJDataSource ds = new DJDataSource(expression, origin, type);
subreport.setDatasource(ds);
return this;
} | [
"public",
"SubReportBuilder",
"setDataSource",
"(",
"int",
"origin",
",",
"int",
"type",
",",
"String",
"expression",
")",
"{",
"DJDataSource",
"ds",
"=",
"new",
"DJDataSource",
"(",
"expression",
",",
"origin",
",",
"type",
")",
";",
"subreport",
".",
"setD... | Indicates from where to get the data source.<br>
@param origin Must be one of these constans located in DJConstants inteface<br>
- SUBREPORT_DATAS_OURCE_ORIGIN_PARAMETER<br>
- SUBREPORT_DATAS_OURCE_ORIGIN_FIELD<br>
- SUBREPORT_DATAS_OURCE_ORIGIN_INTERNAL<br>
@param type tell if the datasource is a Collection, an Array... | [
"Indicates",
"from",
"where",
"to",
"get",
"the",
"data",
"source",
".",
"<br",
">"
] | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/domain/builders/SubReportBuilder.java#L108-L112 |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocalHole.java | ODataLocalHole.createHole | public synchronized void createHole(final long iRecordOffset, final int iRecordSize) throws IOException {
"""
Appends the hole to the end of the segment.
@throws IOException
"""
final long timer = OProfiler.getInstance().startChrono();
// IN MEMORY
final int recycledPosition;
final ODa... | java | public synchronized void createHole(final long iRecordOffset, final int iRecordSize) throws IOException {
final long timer = OProfiler.getInstance().startChrono();
// IN MEMORY
final int recycledPosition;
final ODataHoleInfo hole;
if (!freeHoles.isEmpty()) {
// RECYCLE THE FIRST FREE H... | [
"public",
"synchronized",
"void",
"createHole",
"(",
"final",
"long",
"iRecordOffset",
",",
"final",
"int",
"iRecordSize",
")",
"throws",
"IOException",
"{",
"final",
"long",
"timer",
"=",
"OProfiler",
".",
"getInstance",
"(",
")",
".",
"startChrono",
"(",
")"... | Appends the hole to the end of the segment.
@throws IOException | [
"Appends",
"the",
"hole",
"to",
"the",
"end",
"of",
"the",
"segment",
"."
] | train | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocalHole.java#L98-L130 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java | BinaryRowProtocol.getInternalBigDecimal | public BigDecimal getInternalBigDecimal(ColumnInformation columnInfo) throws SQLException {
"""
Get BigDecimal from raw binary format.
@param columnInfo column information
@return BigDecimal value
@throws SQLException if column is not numeric
"""
if (lastValueWasNull()) {
return null;
}
... | java | public BigDecimal getInternalBigDecimal(ColumnInformation columnInfo) throws SQLException {
if (lastValueWasNull()) {
return null;
}
switch (columnInfo.getColumnType()) {
case BIT:
return BigDecimal.valueOf(parseBit());
case TINYINT:
return BigDecimal.valueOf((long) getInt... | [
"public",
"BigDecimal",
"getInternalBigDecimal",
"(",
"ColumnInformation",
"columnInfo",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"lastValueWasNull",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"switch",
"(",
"columnInfo",
".",
"getColumnType",
"(",
")... | Get BigDecimal from raw binary format.
@param columnInfo column information
@return BigDecimal value
@throws SQLException if column is not numeric | [
"Get",
"BigDecimal",
"from",
"raw",
"binary",
"format",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java#L668-L717 |
GerdHolz/TOVAL | src/de/invation/code/toval/graphic/util/GraphicUtils.java | GraphicUtils.drawArrowOffset | public static void drawArrowOffset(Graphics g, Point from, Point to, int offsetFrom, int offsetTo, double weight) {
"""
Draws an arrow between two given points using the specified weight and offsets.<br>
The arrow lies on the line between point <code>from</code> to point <code>to</code> and points to point <code>... | java | public static void drawArrowOffset(Graphics g, Point from, Point to, int offsetFrom, int offsetTo, double weight){
double xk1,xk2,s,dx,dy,sinPhi,cosPhi;
dx = to.x-from.x;
dy = to.y-from.y;
xk1=-offsetFrom/2;
xk2=-offsetTo/2;
s=Math.sqrt(dy*dy+dx*dx);
sinPhi=dy/s;
cosPhi=dx/s;
drawArrow(g, ... | [
"public",
"static",
"void",
"drawArrowOffset",
"(",
"Graphics",
"g",
",",
"Point",
"from",
",",
"Point",
"to",
",",
"int",
"offsetFrom",
",",
"int",
"offsetTo",
",",
"double",
"weight",
")",
"{",
"double",
"xk1",
",",
"xk2",
",",
"s",
",",
"dx",
",",
... | Draws an arrow between two given points using the specified weight and offsets.<br>
The arrow lies on the line between point <code>from</code> to point <code>to</code> and points to point <code>to</code>.
The distance between point <code>from</code> and the arrow start is defined by <code>offsetFrom</code>,
respectivel... | [
"Draws",
"an",
"arrow",
"between",
"two",
"given",
"points",
"using",
"the",
"specified",
"weight",
"and",
"offsets",
".",
"<br",
">",
"The",
"arrow",
"lies",
"on",
"the",
"line",
"between",
"point",
"<code",
">",
"from<",
"/",
"code",
">",
"to",
"point"... | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/graphic/util/GraphicUtils.java#L166-L176 |
haifengl/smile | symbolic/src/main/java/smile/symbolic/Calculus.java | Calculus.diff | public static final double diff(String expression, double val) throws InvalidExpressionException {
"""
Compute numeric derivative
@param expression the mathematical expression
@param val the value for which to evaluate the expression at
@return numeric derivative
"""
ExpressionTree expTree = parseT... | java | public static final double diff(String expression, double val) throws InvalidExpressionException {
ExpressionTree expTree = parseToTree(expression);
expTree.derive();
expTree.reduce();
return expTree.getVal();
} | [
"public",
"static",
"final",
"double",
"diff",
"(",
"String",
"expression",
",",
"double",
"val",
")",
"throws",
"InvalidExpressionException",
"{",
"ExpressionTree",
"expTree",
"=",
"parseToTree",
"(",
"expression",
")",
";",
"expTree",
".",
"derive",
"(",
")",
... | Compute numeric derivative
@param expression the mathematical expression
@param val the value for which to evaluate the expression at
@return numeric derivative | [
"Compute",
"numeric",
"derivative"
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/symbolic/src/main/java/smile/symbolic/Calculus.java#L45-L53 |
JadiraOrg/jadira | bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java | BasicBinder.findUnmarshaller | public <S, T> FromUnmarshaller<S, T> findUnmarshaller(Class<S> source, Class<T> target, Class<? extends Annotation> qualifier) {
"""
Resolve an UnMarshaller with the given source and target class.
The unmarshaller is used as follows: Instances of the source can be marshalled into the target class.
@param source ... | java | public <S, T> FromUnmarshaller<S, T> findUnmarshaller(Class<S> source, Class<T> target, Class<? extends Annotation> qualifier) {
return findUnmarshaller(new ConverterKey<S,T>(source, target, qualifier == null ? DefaultBinding.class : qualifier));
} | [
"public",
"<",
"S",
",",
"T",
">",
"FromUnmarshaller",
"<",
"S",
",",
"T",
">",
"findUnmarshaller",
"(",
"Class",
"<",
"S",
">",
"source",
",",
"Class",
"<",
"T",
">",
"target",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"qualifier",
")",
... | Resolve an UnMarshaller with the given source and target class.
The unmarshaller is used as follows: Instances of the source can be marshalled into the target class.
@param source The source (input) class
@param target The target (output) class
@param qualifier The qualifier for which the unmarshaller must be registere... | [
"Resolve",
"an",
"UnMarshaller",
"with",
"the",
"given",
"source",
"and",
"target",
"class",
".",
"The",
"unmarshaller",
"is",
"used",
"as",
"follows",
":",
"Instances",
"of",
"the",
"source",
"can",
"be",
"marshalled",
"into",
"the",
"target",
"class",
"."
... | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java#L1017-L1019 |
tntim96/JSCover | src/main/java/jscover/util/IoUtils.java | IoUtils.loadFromClassPath | public String loadFromClassPath(String dataFile) {
"""
/*
public List<String> readLines(String source) {
ByteArrayInputStream bais = new ByteArrayInputStream(source.getBytes(charSet));
return readLines(new BufferedReader(new InputStreamReader(bais, charSet)));
}
private List<String> readLines(BufferedReader... | java | public String loadFromClassPath(String dataFile) {
InputStream is = null;
try {
// is = Thread.currentThread().getContextClassLoader().getResourceAsStream(dataFile);
is = IoUtils.class.getResourceAsStream(dataFile);
return toString(is);
} catch (Throwable... | [
"public",
"String",
"loadFromClassPath",
"(",
"String",
"dataFile",
")",
"{",
"InputStream",
"is",
"=",
"null",
";",
"try",
"{",
"// is = Thread.currentThread().getContextClassLoader().getResourceAsStream(dataFile);\r",
"is",
"=",
"IoUtils",
".",
"class",
".",
... | /*
public List<String> readLines(String source) {
ByteArrayInputStream bais = new ByteArrayInputStream(source.getBytes(charSet));
return readLines(new BufferedReader(new InputStreamReader(bais, charSet)));
}
private List<String> readLines(BufferedReader br) {
List<String> result = new ArrayList<String>();
try {
for (S... | [
"/",
"*",
"public",
"List<String",
">",
"readLines",
"(",
"String",
"source",
")",
"{",
"ByteArrayInputStream",
"bais",
"=",
"new",
"ByteArrayInputStream",
"(",
"source",
".",
"getBytes",
"(",
"charSet",
"))",
";",
"return",
"readLines",
"(",
"new",
"BufferedR... | train | https://github.com/tntim96/JSCover/blob/87808b3aa38726b369496331d28ec4111dc5143e/src/main/java/jscover/util/IoUtils.java#L463-L474 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/protocol/ascii/OperationImpl.java | OperationImpl.matchStatus | protected final OperationStatus matchStatus(String line,
OperationStatus... statii) {
"""
Match the status line provided against one of the given OperationStatus
objects. If none match, return a failure status with the given line.
@param line the current line
@param statii several status objects
@retur... | java | protected final OperationStatus matchStatus(String line,
OperationStatus... statii) {
OperationStatus rv = null;
for (OperationStatus status : statii) {
if (line.equals(status.getMessage())) {
rv = status;
}
}
if (rv == null) {
rv = new OperationStatus(false, line, Status... | [
"protected",
"final",
"OperationStatus",
"matchStatus",
"(",
"String",
"line",
",",
"OperationStatus",
"...",
"statii",
")",
"{",
"OperationStatus",
"rv",
"=",
"null",
";",
"for",
"(",
"OperationStatus",
"status",
":",
"statii",
")",
"{",
"if",
"(",
"line",
... | Match the status line provided against one of the given OperationStatus
objects. If none match, return a failure status with the given line.
@param line the current line
@param statii several status objects
@return the appropriate status object | [
"Match",
"the",
"status",
"line",
"provided",
"against",
"one",
"of",
"the",
"given",
"OperationStatus",
"objects",
".",
"If",
"none",
"match",
"return",
"a",
"failure",
"status",
"with",
"the",
"given",
"line",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/protocol/ascii/OperationImpl.java#L66-L78 |
notnoop/java-apns | src/main/java/com/notnoop/apns/ApnsServiceBuilder.java | ApnsServiceBuilder.asBatched | public ApnsServiceBuilder asBatched(int waitTimeInSec, int maxWaitTimeInSec, ThreadFactory threadFactory) {
"""
Construct service which will process notification requests in batch.
After each request batch will wait <code>waitTimeInSec</code> for more request to come
before executing but not more than <code>maxW... | java | public ApnsServiceBuilder asBatched(int waitTimeInSec, int maxWaitTimeInSec, ThreadFactory threadFactory) {
return asBatched(waitTimeInSec, maxWaitTimeInSec, new ScheduledThreadPoolExecutor(1, threadFactory != null ? threadFactory : defaultThreadFactory()));
} | [
"public",
"ApnsServiceBuilder",
"asBatched",
"(",
"int",
"waitTimeInSec",
",",
"int",
"maxWaitTimeInSec",
",",
"ThreadFactory",
"threadFactory",
")",
"{",
"return",
"asBatched",
"(",
"waitTimeInSec",
",",
"maxWaitTimeInSec",
",",
"new",
"ScheduledThreadPoolExecutor",
"(... | Construct service which will process notification requests in batch.
After each request batch will wait <code>waitTimeInSec</code> for more request to come
before executing but not more than <code>maxWaitTimeInSec</code>
Each batch creates new connection and close it after finished.
In case reconnect policy is specifi... | [
"Construct",
"service",
"which",
"will",
"process",
"notification",
"requests",
"in",
"batch",
".",
"After",
"each",
"request",
"batch",
"will",
"wait",
"<code",
">",
"waitTimeInSec<",
"/",
"code",
">",
"for",
"more",
"request",
"to",
"come",
"before",
"execut... | train | https://github.com/notnoop/java-apns/blob/180a190d4cb49458441596ca7c69d50ec7f1dba5/src/main/java/com/notnoop/apns/ApnsServiceBuilder.java#L641-L643 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.pack | public static void pack(File rootDir, File zip, int compressionLevel) {
"""
Compresses the given directory and all its sub-directories into a ZIP file.
<p>
The ZIP file must not be a directory and its parent directory must exist.
Will not include the root directory name in the archive.
@param rootDir
root d... | java | public static void pack(File rootDir, File zip, int compressionLevel) {
pack(rootDir, zip, IdentityNameMapper.INSTANCE, compressionLevel);
} | [
"public",
"static",
"void",
"pack",
"(",
"File",
"rootDir",
",",
"File",
"zip",
",",
"int",
"compressionLevel",
")",
"{",
"pack",
"(",
"rootDir",
",",
"zip",
",",
"IdentityNameMapper",
".",
"INSTANCE",
",",
"compressionLevel",
")",
";",
"}"
] | Compresses the given directory and all its sub-directories into a ZIP file.
<p>
The ZIP file must not be a directory and its parent directory must exist.
Will not include the root directory name in the archive.
@param rootDir
root directory.
@param zip
ZIP file that will be created or overwritten.
@param compressionLe... | [
"Compresses",
"the",
"given",
"directory",
"and",
"all",
"its",
"sub",
"-",
"directories",
"into",
"a",
"ZIP",
"file",
".",
"<p",
">",
"The",
"ZIP",
"file",
"must",
"not",
"be",
"a",
"directory",
"and",
"its",
"parent",
"directory",
"must",
"exist",
".",... | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L1402-L1404 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/MergeRequestApi.java | MergeRequestApi.updateMergeRequest | @Deprecated
public MergeRequest updateMergeRequest(Object projectIdOrPath, Integer mergeRequestIid, String targetBranch,
String title, Integer assigneeId, String description, StateEvent stateEvent, String labels,
Integer milestoneId) throws GitLabApiException {
"""
Updates an existing m... | java | @Deprecated
public MergeRequest updateMergeRequest(Object projectIdOrPath, Integer mergeRequestIid, String targetBranch,
String title, Integer assigneeId, String description, StateEvent stateEvent, String labels,
Integer milestoneId) throws GitLabApiException {
Form formData = new G... | [
"@",
"Deprecated",
"public",
"MergeRequest",
"updateMergeRequest",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"mergeRequestIid",
",",
"String",
"targetBranch",
",",
"String",
"title",
",",
"Integer",
"assigneeId",
",",
"String",
"description",
",",
"StateEvent"... | Updates an existing merge request. You can change branches, title, or even close the MR.
<p>NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.</p>
<pre><code>GitLab Endpoint: PUT /projects/:id/merge_requests/:merge_request_iid</code></pre>
@param projectIdOrPath the project in the ... | [
"Updates",
"an",
"existing",
"merge",
"request",
".",
"You",
"can",
"change",
"branches",
"title",
"or",
"even",
"close",
"the",
"MR",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/MergeRequestApi.java#L486-L501 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java | Check.stateIsTrue | @ArgumentsChecked
@Throws( {
"""
Ensures that a given state is {@code true} and allows to specify the class of exception which is thrown in case
the state is not {@code true}.
@param expression
an expression that must be {@code true} to indicate a valid state
@param clazz
an subclass of {@link RuntimeExcep... | java | @ArgumentsChecked
@Throws({ IllegalNullArgumentException.class, RuntimeInstantiationException.class })
public static void stateIsTrue(final boolean expression, final Class<? extends RuntimeException> clazz) {
Check.notNull(clazz, "clazz");
if (!expression) {
RuntimeException re;
try {
re = clazz.newIns... | [
"@",
"ArgumentsChecked",
"@",
"Throws",
"(",
"{",
"IllegalNullArgumentException",
".",
"class",
",",
"RuntimeInstantiationException",
".",
"class",
"}",
")",
"public",
"static",
"void",
"stateIsTrue",
"(",
"final",
"boolean",
"expression",
",",
"final",
"Class",
"... | Ensures that a given state is {@code true} and allows to specify the class of exception which is thrown in case
the state is not {@code true}.
@param expression
an expression that must be {@code true} to indicate a valid state
@param clazz
an subclass of {@link RuntimeException} which will be thrown if the given state... | [
"Ensures",
"that",
"a",
"given",
"state",
"is",
"{",
"@code",
"true",
"}",
"and",
"allows",
"to",
"specify",
"the",
"class",
"of",
"exception",
"which",
"is",
"thrown",
"in",
"case",
"the",
"state",
"is",
"not",
"{",
"@code",
"true",
"}",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L3280-L3296 |
JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAbsSpinner.java | IcsAbsSpinner.setSelectionInt | void setSelectionInt(int position, boolean animate) {
"""
Makes the item at the supplied position selected.
@param position Position to select
@param animate Should the transition be animated
"""
if (position != mOldSelectedPosition) {
mBlockLayoutRequests = true;
int delta ... | java | void setSelectionInt(int position, boolean animate) {
if (position != mOldSelectedPosition) {
mBlockLayoutRequests = true;
int delta = position - mSelectedPosition;
setNextSelectedPositionInt(position);
layout(delta, animate);
mBlockLayoutRequests = f... | [
"void",
"setSelectionInt",
"(",
"int",
"position",
",",
"boolean",
"animate",
")",
"{",
"if",
"(",
"position",
"!=",
"mOldSelectedPosition",
")",
"{",
"mBlockLayoutRequests",
"=",
"true",
";",
"int",
"delta",
"=",
"position",
"-",
"mSelectedPosition",
";",
"se... | Makes the item at the supplied position selected.
@param position Position to select
@param animate Should the transition be animated | [
"Makes",
"the",
"item",
"at",
"the",
"supplied",
"position",
"selected",
"."
] | train | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAbsSpinner.java#L300-L308 |
venkatramanm/common | src/main/java/com/venky/core/string/Inflector.java | Inflector.camelize | public static String camelize(String underscore, boolean capitalizeFirstChar) {
"""
Generates a camel case version of a phrase from underscore.
@param underscore underscore version of a word to converted to camel case.
@param capitalizeFirstChar set to true if first character needs to be capitalized, false if ... | java | public static String camelize(String underscore, boolean capitalizeFirstChar){
String result = "";
StringTokenizer st = new StringTokenizer(LowerCaseStringCache.instance().get(underscore), "_");
while(st.hasMoreTokens()){
result += capitalize(st.nextToken());
}
... | [
"public",
"static",
"String",
"camelize",
"(",
"String",
"underscore",
",",
"boolean",
"capitalizeFirstChar",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"StringTokenizer",
"st",
"=",
"new",
"StringTokenizer",
"(",
"LowerCaseStringCache",
".",
"instance",
"(",... | Generates a camel case version of a phrase from underscore.
@param underscore underscore version of a word to converted to camel case.
@param capitalizeFirstChar set to true if first character needs to be capitalized, false if not.
@return camel case version of underscore. | [
"Generates",
"a",
"camel",
"case",
"version",
"of",
"a",
"phrase",
"from",
"underscore",
"."
] | train | https://github.com/venkatramanm/common/blob/b89583efd674f73cf4c04927300a9ea6e49a3e9f/src/main/java/com/venky/core/string/Inflector.java#L202-L209 |
radkovo/CSSBox | src/main/java/org/fit/cssbox/layout/CSSDecoder.java | CSSDecoder.getLength | public int getLength(TermLengthOrPercent value, boolean auto, int defval, int autoval, int whole) {
"""
Returns the length in pixels from a CSS definition
@param value The length or percentage value to be converted
@param auto True, if the property is set to <code>auto</code>
@param defval The length value to b... | java | public int getLength(TermLengthOrPercent value, boolean auto, int defval, int autoval, int whole)
{
if (auto)
return autoval;
else if (value == null)
return defval;
else
return (int) context.pxLength(value, whole);
} | [
"public",
"int",
"getLength",
"(",
"TermLengthOrPercent",
"value",
",",
"boolean",
"auto",
",",
"int",
"defval",
",",
"int",
"autoval",
",",
"int",
"whole",
")",
"{",
"if",
"(",
"auto",
")",
"return",
"autoval",
";",
"else",
"if",
"(",
"value",
"==",
"... | Returns the length in pixels from a CSS definition
@param value The length or percentage value to be converted
@param auto True, if the property is set to <code>auto</code>
@param defval The length value to be used when the first one is null
@param autoval The value to be used when "auto" is specified
@param whole the ... | [
"Returns",
"the",
"length",
"in",
"pixels",
"from",
"a",
"CSS",
"definition"
] | train | https://github.com/radkovo/CSSBox/blob/38aaf8f22d233d7b4dbc12a56cdbc72b447bc559/src/main/java/org/fit/cssbox/layout/CSSDecoder.java#L99-L107 |
CodeNarc/CodeNarc | src/main/java/org/codenarc/util/AstUtil.java | AstUtil.respondsTo | public static boolean respondsTo(Object object, String methodName) {
"""
Return true only if the specified object responds to the named method
@param object - the object to check
@param methodName - the name of the method
@return true if the object responds to the named method
"""
MetaClass metaCla... | java | public static boolean respondsTo(Object object, String methodName) {
MetaClass metaClass = DefaultGroovyMethods.getMetaClass(object);
if (!metaClass.respondsTo(object, methodName).isEmpty()) {
return true;
}
Map properties = DefaultGroovyMethods.getProperties(object);
... | [
"public",
"static",
"boolean",
"respondsTo",
"(",
"Object",
"object",
",",
"String",
"methodName",
")",
"{",
"MetaClass",
"metaClass",
"=",
"DefaultGroovyMethods",
".",
"getMetaClass",
"(",
"object",
")",
";",
"if",
"(",
"!",
"metaClass",
".",
"respondsTo",
"(... | Return true only if the specified object responds to the named method
@param object - the object to check
@param methodName - the name of the method
@return true if the object responds to the named method | [
"Return",
"true",
"only",
"if",
"the",
"specified",
"object",
"responds",
"to",
"the",
"named",
"method"
] | train | https://github.com/CodeNarc/CodeNarc/blob/9a7cec02cb8cbaf845030f2434309e8968f5d7a7/src/main/java/org/codenarc/util/AstUtil.java#L638-L645 |
jetty-project/jetty-npn | npn-boot/src/main/java/sun/security/ssl/Handshaker.java | Handshaker.throwSSLException | static void throwSSLException(String msg, Throwable cause)
throws SSLException {
"""
Throw an SSLException with the specified message and cause.
Shorthand until a new SSLException constructor is added.
This method never returns.
"""
SSLException e = new SSLException(msg);
e.initCa... | java | static void throwSSLException(String msg, Throwable cause)
throws SSLException {
SSLException e = new SSLException(msg);
e.initCause(cause);
throw e;
} | [
"static",
"void",
"throwSSLException",
"(",
"String",
"msg",
",",
"Throwable",
"cause",
")",
"throws",
"SSLException",
"{",
"SSLException",
"e",
"=",
"new",
"SSLException",
"(",
"msg",
")",
";",
"e",
".",
"initCause",
"(",
"cause",
")",
";",
"throw",
"e",
... | Throw an SSLException with the specified message and cause.
Shorthand until a new SSLException constructor is added.
This method never returns. | [
"Throw",
"an",
"SSLException",
"with",
"the",
"specified",
"message",
"and",
"cause",
".",
"Shorthand",
"until",
"a",
"new",
"SSLException",
"constructor",
"is",
"added",
".",
"This",
"method",
"never",
"returns",
"."
] | train | https://github.com/jetty-project/jetty-npn/blob/a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d/npn-boot/src/main/java/sun/security/ssl/Handshaker.java#L1270-L1275 |
cdk/cdk | descriptor/cip/src/main/java/org/openscience/cdk/geometry/cip/CIPTool.java | CIPTool.defineLigand | public static ILigand defineLigand(IAtomContainer container, VisitedAtoms visitedAtoms, int chiralAtom,
int ligandAtom) {
"""
Creates a ligand attached to a single chiral atom, where the involved
atoms are identified by there index in the {@link IAtomContainer}. For ligand
atom, {@link #HYDROGEN} can... | java | public static ILigand defineLigand(IAtomContainer container, VisitedAtoms visitedAtoms, int chiralAtom,
int ligandAtom) {
if (ligandAtom == HYDROGEN) {
return new ImplicitHydrogenLigand(container, visitedAtoms, container.getAtom(chiralAtom));
} else {
return new Ligan... | [
"public",
"static",
"ILigand",
"defineLigand",
"(",
"IAtomContainer",
"container",
",",
"VisitedAtoms",
"visitedAtoms",
",",
"int",
"chiralAtom",
",",
"int",
"ligandAtom",
")",
"{",
"if",
"(",
"ligandAtom",
"==",
"HYDROGEN",
")",
"{",
"return",
"new",
"ImplicitH... | Creates a ligand attached to a single chiral atom, where the involved
atoms are identified by there index in the {@link IAtomContainer}. For ligand
atom, {@link #HYDROGEN} can be passed as index, which will indicate the presence of
an implicit hydrogen, not explicitly present in the chemical graph of the
given <code>co... | [
"Creates",
"a",
"ligand",
"attached",
"to",
"a",
"single",
"chiral",
"atom",
"where",
"the",
"involved",
"atoms",
"are",
"identified",
"by",
"there",
"index",
"in",
"the",
"{",
"@link",
"IAtomContainer",
"}",
".",
"For",
"ligand",
"atom",
"{",
"@link",
"#H... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/cip/src/main/java/org/openscience/cdk/geometry/cip/CIPTool.java#L320-L327 |
Falydoor/limesurvey-rc | src/main/java/com/github/falydoor/limesurveyrc/LimesurveyRC.java | LimesurveyRC.getQuestionAnswers | public Map<String, LsQuestionAnswer> getQuestionAnswers(int questionId) throws LimesurveyRCException {
"""
Gets possible answers from a question.
@param questionId the question id you want to get the answers
@return the answers of the question
@throws LimesurveyRCException the limesurvey rc exception
"""
... | java | public Map<String, LsQuestionAnswer> getQuestionAnswers(int questionId) throws LimesurveyRCException {
LsApiBody.LsApiParams params = getParamsWithKey();
params.setQuestionId(questionId);
List<String> questionSettings = new ArrayList<>();
questionSettings.add("answeroptions");
pa... | [
"public",
"Map",
"<",
"String",
",",
"LsQuestionAnswer",
">",
"getQuestionAnswers",
"(",
"int",
"questionId",
")",
"throws",
"LimesurveyRCException",
"{",
"LsApiBody",
".",
"LsApiParams",
"params",
"=",
"getParamsWithKey",
"(",
")",
";",
"params",
".",
"setQuestio... | Gets possible answers from a question.
@param questionId the question id you want to get the answers
@return the answers of the question
@throws LimesurveyRCException the limesurvey rc exception | [
"Gets",
"possible",
"answers",
"from",
"a",
"question",
"."
] | train | https://github.com/Falydoor/limesurvey-rc/blob/b8d573389086395e46a0bdeeddeef4d1c2c0a488/src/main/java/com/github/falydoor/limesurveyrc/LimesurveyRC.java#L235-L245 |
kiegroup/drools | drools-compiler/src/main/java/org/drools/compiler/builder/impl/KnowledgeBuilderImpl.java | KnowledgeBuilderImpl.addPackage | public void addPackage(final PackageDescr packageDescr) {
"""
This adds a package from a Descr/AST This will also trigger a compile, if
there are any generated classes to compile of course.
"""
PackageRegistry pkgRegistry = getOrCreatePackageRegistry(packageDescr);
if (pkgRegistry == null) {
... | java | public void addPackage(final PackageDescr packageDescr) {
PackageRegistry pkgRegistry = getOrCreatePackageRegistry(packageDescr);
if (pkgRegistry == null) {
return;
}
// merge into existing package
mergePackage(pkgRegistry, packageDescr);
compileKnowledgePac... | [
"public",
"void",
"addPackage",
"(",
"final",
"PackageDescr",
"packageDescr",
")",
"{",
"PackageRegistry",
"pkgRegistry",
"=",
"getOrCreatePackageRegistry",
"(",
"packageDescr",
")",
";",
"if",
"(",
"pkgRegistry",
"==",
"null",
")",
"{",
"return",
";",
"}",
"// ... | This adds a package from a Descr/AST This will also trigger a compile, if
there are any generated classes to compile of course. | [
"This",
"adds",
"a",
"package",
"from",
"a",
"Descr",
"/",
"AST",
"This",
"will",
"also",
"trigger",
"a",
"compile",
"if",
"there",
"are",
"any",
"generated",
"classes",
"to",
"compile",
"of",
"course",
"."
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/builder/impl/KnowledgeBuilderImpl.java#L939-L951 |
apache/incubator-heron | heron/common/src/java/org/apache/heron/common/basics/NIOLooper.java | NIOLooper.isInterestRegistered | private boolean isInterestRegistered(SelectableChannel channel, int operation) {
"""
Check whether an operation interest was registered on a SelectableChannel
There are two cases that interest is not registered
1. The whole key does not exist; no interests ever registered for this channel
2. The key exists due ... | java | private boolean isInterestRegistered(SelectableChannel channel, int operation) {
SelectionKey key = channel.keyFor(selector);
return key != null && (key.interestOps() & operation) != 0;
} | [
"private",
"boolean",
"isInterestRegistered",
"(",
"SelectableChannel",
"channel",
",",
"int",
"operation",
")",
"{",
"SelectionKey",
"key",
"=",
"channel",
".",
"keyFor",
"(",
"selector",
")",
";",
"return",
"key",
"!=",
"null",
"&&",
"(",
"key",
".",
"inte... | Check whether an operation interest was registered on a SelectableChannel
There are two cases that interest is not registered
1. The whole key does not exist; no interests ever registered for this channel
2. The key exists due to other interests registered but not the one we are adding
If the key exists, the key for Se... | [
"Check",
"whether",
"an",
"operation",
"interest",
"was",
"registered",
"on",
"a",
"SelectableChannel",
"There",
"are",
"two",
"cases",
"that",
"interest",
"is",
"not",
"registered",
"1",
".",
"The",
"whole",
"key",
"does",
"not",
"exist",
";",
"no",
"intere... | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/common/src/java/org/apache/heron/common/basics/NIOLooper.java#L273-L277 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/LowLevelMultiViewOps.java | LowLevelMultiViewOps.computeNormalization | public static void computeNormalization(List<AssociatedPair> points, NormalizationPoint2D N1, NormalizationPoint2D N2) {
"""
<p>
Computes two normalization matrices for each set of point correspondences in the list of
{@link boofcv.struct.geo.AssociatedPair}. Same as {@link #computeNormalization(java.util.List,... | java | public static void computeNormalization(List<AssociatedPair> points, NormalizationPoint2D N1, NormalizationPoint2D N2)
{
double meanX1 = 0; double meanY1 = 0;
double meanX2 = 0; double meanY2 = 0;
for( AssociatedPair p : points ) {
meanX1 += p.p1.x; meanY1 += p.p1.y;
meanX2 += p.p2.x; meanY2 += p.p2.y;
... | [
"public",
"static",
"void",
"computeNormalization",
"(",
"List",
"<",
"AssociatedPair",
">",
"points",
",",
"NormalizationPoint2D",
"N1",
",",
"NormalizationPoint2D",
"N2",
")",
"{",
"double",
"meanX1",
"=",
"0",
";",
"double",
"meanY1",
"=",
"0",
";",
"double... | <p>
Computes two normalization matrices for each set of point correspondences in the list of
{@link boofcv.struct.geo.AssociatedPair}. Same as {@link #computeNormalization(java.util.List, NormalizationPoint2D)},
but for two views.
</p>
@param points Input: List of observed points that are to be normalized. Not modifi... | [
"<p",
">",
"Computes",
"two",
"normalization",
"matrices",
"for",
"each",
"set",
"of",
"point",
"correspondences",
"in",
"the",
"list",
"of",
"{",
"@link",
"boofcv",
".",
"struct",
".",
"geo",
".",
"AssociatedPair",
"}",
".",
"Same",
"as",
"{",
"@link",
... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/LowLevelMultiViewOps.java#L134-L167 |
igniterealtime/Smack | smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLight.java | MultiUserChatLight.createPrivateChat | @SuppressWarnings("deprecation")
@Deprecated
// Do not re-use Chat API, which was designed for XMPP-IM 1:1 chats and not MUClight private chats.
public org.jivesoftware.smack.chat.Chat createPrivateChat(EntityJid occupant, ChatMessageListener listener) {
"""
Returns a new Chat for sending private messa... | java | @SuppressWarnings("deprecation")
@Deprecated
// Do not re-use Chat API, which was designed for XMPP-IM 1:1 chats and not MUClight private chats.
public org.jivesoftware.smack.chat.Chat createPrivateChat(EntityJid occupant, ChatMessageListener listener) {
return org.jivesoftware.smack.chat.ChatManage... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"@",
"Deprecated",
"// Do not re-use Chat API, which was designed for XMPP-IM 1:1 chats and not MUClight private chats.",
"public",
"org",
".",
"jivesoftware",
".",
"smack",
".",
"chat",
".",
"Chat",
"createPrivateChat",
"("... | Returns a new Chat for sending private messages to a given room occupant.
The Chat's occupant address is the room's JID (i.e.
roomName@service/nick). The server service will change the 'from' address
to the sender's room JID and delivering the message to the intended
recipient's full JID.
@param occupant
occupant uniq... | [
"Returns",
"a",
"new",
"Chat",
"for",
"sending",
"private",
"messages",
"to",
"a",
"given",
"room",
"occupant",
".",
"The",
"Chat",
"s",
"occupant",
"address",
"is",
"the",
"room",
"s",
"JID",
"(",
"i",
".",
"e",
".",
"roomName@service",
"/",
"nick",
"... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLight.java#L149-L154 |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleConnector.java | GoogleConnector.getInstance | public static GoogleConnector getInstance() {
"""
On demand instance creator method used to get the single instance of this
google authenticator class.
@return The single instance of this class, if the instance does not exist,
this is immediately created.
"""
if (instance == null) {
tr... | java | public static GoogleConnector getInstance() {
if (instance == null) {
try {
instance = new GoogleConnector();
} catch (Exception e) {
throw new RuntimeException("The GoogleConnector could not be instanced!", e);
}
}
return insta... | [
"public",
"static",
"GoogleConnector",
"getInstance",
"(",
")",
"{",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"try",
"{",
"instance",
"=",
"new",
"GoogleConnector",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"Ru... | On demand instance creator method used to get the single instance of this
google authenticator class.
@return The single instance of this class, if the instance does not exist,
this is immediately created. | [
"On",
"demand",
"instance",
"creator",
"method",
"used",
"to",
"get",
"the",
"single",
"instance",
"of",
"this",
"google",
"authenticator",
"class",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleConnector.java#L116-L125 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/Path3f.java | Path3f.setLastPoint | public void setLastPoint(double x, double y, double z) {
"""
Change the coordinates of the last inserted point.
@param x
@param y
@param z
"""
if (this.numCoords>=3) {
this.coords[this.numCoords-3] = x;
this.coords[this.numCoords-2] = y;
this.coords[this.numCoords-1] = z;
this.graphicalBound... | java | public void setLastPoint(double x, double y, double z) {
if (this.numCoords>=3) {
this.coords[this.numCoords-3] = x;
this.coords[this.numCoords-2] = y;
this.coords[this.numCoords-1] = z;
this.graphicalBounds = null;
this.logicalBounds = null;
}
} | [
"public",
"void",
"setLastPoint",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"if",
"(",
"this",
".",
"numCoords",
">=",
"3",
")",
"{",
"this",
".",
"coords",
"[",
"this",
".",
"numCoords",
"-",
"3",
"]",
"=",
"x",
";",
... | Change the coordinates of the last inserted point.
@param x
@param y
@param z | [
"Change",
"the",
"coordinates",
"of",
"the",
"last",
"inserted",
"point",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/Path3f.java#L1817-L1825 |
voldemort/voldemort | src/java/voldemort/tools/admin/AdminToolUtils.java | AdminToolUtils.assertServerNotInRebalancingState | public static void assertServerNotInRebalancingState(AdminClient adminClient, Integer nodeId) {
"""
Utility function that checks the execution state of the server by
checking the state of {@link VoldemortState} <br>
This function checks if the nodes are not in rebalancing state (
{@link VoldemortState#REBALAN... | java | public static void assertServerNotInRebalancingState(AdminClient adminClient, Integer nodeId) {
assertServerNotInRebalancingState(adminClient, Lists.newArrayList(new Integer[]{nodeId}));
} | [
"public",
"static",
"void",
"assertServerNotInRebalancingState",
"(",
"AdminClient",
"adminClient",
",",
"Integer",
"nodeId",
")",
"{",
"assertServerNotInRebalancingState",
"(",
"adminClient",
",",
"Lists",
".",
"newArrayList",
"(",
"new",
"Integer",
"[",
"]",
"{",
... | Utility function that checks the execution state of the server by
checking the state of {@link VoldemortState} <br>
This function checks if the nodes are not in rebalancing state (
{@link VoldemortState#REBALANCING_MASTER_SERVER}).
@param adminClient An instance of AdminClient points to given cluster
@param nodeId No... | [
"Utility",
"function",
"that",
"checks",
"the",
"execution",
"state",
"of",
"the",
"server",
"by",
"checking",
"the",
"state",
"of",
"{",
"@link",
"VoldemortState",
"}",
"<br",
">"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/AdminToolUtils.java#L416-L418 |
CloudSlang/cs-actions | cs-date-time/src/main/java/io/cloudslang/content/datetime/utils/DateTimeUtils.java | DateTimeUtils.getJodaOrJavaDate | public static DateTime getJodaOrJavaDate(final DateTimeFormatter dateFormatter, final String date) throws Exception {
"""
Returns a LocalDateTime depending on how the date passes as argument is formatted.
@param date date passed as argument
@return the DateTime if it could parse it
"""
if (DateTim... | java | public static DateTime getJodaOrJavaDate(final DateTimeFormatter dateFormatter, final String date) throws Exception {
if (DateTimeUtils.isDateValid(date, dateFormatter.getLocale())) {
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, dateFormatter.getLo... | [
"public",
"static",
"DateTime",
"getJodaOrJavaDate",
"(",
"final",
"DateTimeFormatter",
"dateFormatter",
",",
"final",
"String",
"date",
")",
"throws",
"Exception",
"{",
"if",
"(",
"DateTimeUtils",
".",
"isDateValid",
"(",
"date",
",",
"dateFormatter",
".",
"getLo... | Returns a LocalDateTime depending on how the date passes as argument is formatted.
@param date date passed as argument
@return the DateTime if it could parse it | [
"Returns",
"a",
"LocalDateTime",
"depending",
"on",
"how",
"the",
"date",
"passes",
"as",
"argument",
"is",
"formatted",
"."
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-date-time/src/main/java/io/cloudslang/content/datetime/utils/DateTimeUtils.java#L78-L89 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java | UTF16.delete | public static int delete(char target[], int limit, int offset16) {
"""
Removes the codepoint at the specified position in this target (shortening target by 1
character if the codepoint is a non-supplementary, 2 otherwise).
@param target String buffer to remove codepoint from
@param limit End index of the char... | java | public static int delete(char target[], int limit, int offset16) {
int count = 1;
switch (bounds(target, 0, limit, offset16)) {
case LEAD_SURROGATE_BOUNDARY:
count++;
break;
case TRAIL_SURROGATE_BOUNDARY:
count++;
offset16--;
br... | [
"public",
"static",
"int",
"delete",
"(",
"char",
"target",
"[",
"]",
",",
"int",
"limit",
",",
"int",
"offset16",
")",
"{",
"int",
"count",
"=",
"1",
";",
"switch",
"(",
"bounds",
"(",
"target",
",",
"0",
",",
"limit",
",",
"offset16",
")",
")",
... | Removes the codepoint at the specified position in this target (shortening target by 1
character if the codepoint is a non-supplementary, 2 otherwise).
@param target String buffer to remove codepoint from
@param limit End index of the char array, limit <= target.length
@param offset16 Offset which the codepoint wil... | [
"Removes",
"the",
"codepoint",
"at",
"the",
"specified",
"position",
"in",
"this",
"target",
"(",
"shortening",
"target",
"by",
"1",
"character",
"if",
"the",
"codepoint",
"is",
"a",
"non",
"-",
"supplementary",
"2",
"otherwise",
")",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java#L1438-L1452 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/TaskInProgress.java | TaskInProgress.addDiagnosticInfo | public void addDiagnosticInfo(TaskAttemptID taskId, String diagInfo) {
"""
Save diagnostic information for a given task.
@param taskId id of the task
@param diagInfo diagnostic information for the task
"""
List<String> diagHistory = taskDiagnosticData.get(taskId);
if (diagHistory == null) {
d... | java | public void addDiagnosticInfo(TaskAttemptID taskId, String diagInfo) {
List<String> diagHistory = taskDiagnosticData.get(taskId);
if (diagHistory == null) {
diagHistory = new ArrayList<String>();
taskDiagnosticData.put(taskId, diagHistory);
}
diagHistory.add(diagInfo);
} | [
"public",
"void",
"addDiagnosticInfo",
"(",
"TaskAttemptID",
"taskId",
",",
"String",
"diagInfo",
")",
"{",
"List",
"<",
"String",
">",
"diagHistory",
"=",
"taskDiagnosticData",
".",
"get",
"(",
"taskId",
")",
";",
"if",
"(",
"diagHistory",
"==",
"null",
")"... | Save diagnostic information for a given task.
@param taskId id of the task
@param diagInfo diagnostic information for the task | [
"Save",
"diagnostic",
"information",
"for",
"a",
"given",
"task",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L675-L682 |
xm-online/xm-commons | xm-commons-permission/src/main/java/com/icthh/xm/commons/permission/domain/mapper/PrivilegeMapper.java | PrivilegeMapper.privilegesMapToYml | public String privilegesMapToYml(Map<String, Collection<Privilege>> privileges) {
"""
Convert privileges map to yml string.
@param privileges map
@return yml string
"""
try {
return mapper.writeValueAsString(privileges);
} catch (Exception e) {
log.error("Failed to c... | java | public String privilegesMapToYml(Map<String, Collection<Privilege>> privileges) {
try {
return mapper.writeValueAsString(privileges);
} catch (Exception e) {
log.error("Failed to create privileges YML file from map, error: {}", e.getMessage(), e);
}
return null;
... | [
"public",
"String",
"privilegesMapToYml",
"(",
"Map",
"<",
"String",
",",
"Collection",
"<",
"Privilege",
">",
">",
"privileges",
")",
"{",
"try",
"{",
"return",
"mapper",
".",
"writeValueAsString",
"(",
"privileges",
")",
";",
"}",
"catch",
"(",
"Exception"... | Convert privileges map to yml string.
@param privileges map
@return yml string | [
"Convert",
"privileges",
"map",
"to",
"yml",
"string",
"."
] | train | https://github.com/xm-online/xm-commons/blob/43eb2273adb96f40830d7b905ee3a767b8715caf/xm-commons-permission/src/main/java/com/icthh/xm/commons/permission/domain/mapper/PrivilegeMapper.java#L49-L56 |
apache/groovy | subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java | Sql.buildSqlWithIndexedProps | protected SqlWithParams buildSqlWithIndexedProps(String sql) {
"""
Hook to allow derived classes to override behavior associated with the
parsing and indexing of parameters from a given sql statement.
@param sql the sql statement to process
@return a {@link SqlWithParams} instance containing the parsed sql
a... | java | protected SqlWithParams buildSqlWithIndexedProps(String sql) {
// look for quick exit
if (!enableNamedQueries || !ExtractIndexAndSql.hasNamedParameters(sql)) {
return null;
}
String newSql;
List<Tuple> propList;
if (cacheNamedQueries && namedParamSqlCache.con... | [
"protected",
"SqlWithParams",
"buildSqlWithIndexedProps",
"(",
"String",
"sql",
")",
"{",
"// look for quick exit",
"if",
"(",
"!",
"enableNamedQueries",
"||",
"!",
"ExtractIndexAndSql",
".",
"hasNamedParameters",
"(",
"sql",
")",
")",
"{",
"return",
"null",
";",
... | Hook to allow derived classes to override behavior associated with the
parsing and indexing of parameters from a given sql statement.
@param sql the sql statement to process
@return a {@link SqlWithParams} instance containing the parsed sql
and parameters containing the indexed location and property
name of parameters... | [
"Hook",
"to",
"allow",
"derived",
"classes",
"to",
"override",
"behavior",
"associated",
"with",
"the",
"parsing",
"and",
"indexing",
"of",
"parameters",
"from",
"a",
"given",
"sql",
"statement",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java#L4474-L4499 |
RuedigerMoeller/kontraktor | modules/kontraktor-http/src/main/java/org/nustaq/kontraktor/remoting/http/undertow/Http4K.java | Http4K.getServer | public synchronized Pair<PathHandler, Undertow> getServer(int port, String hostName) {
"""
creates or gets an undertow web server instance mapped by port.
hostname must be given in case a new server instance has to be instantiated
@param port
@param hostName
@return
"""
return getServer(port,host... | java | public synchronized Pair<PathHandler, Undertow> getServer(int port, String hostName) {
return getServer(port,hostName,null);
} | [
"public",
"synchronized",
"Pair",
"<",
"PathHandler",
",",
"Undertow",
">",
"getServer",
"(",
"int",
"port",
",",
"String",
"hostName",
")",
"{",
"return",
"getServer",
"(",
"port",
",",
"hostName",
",",
"null",
")",
";",
"}"
] | creates or gets an undertow web server instance mapped by port.
hostname must be given in case a new server instance has to be instantiated
@param port
@param hostName
@return | [
"creates",
"or",
"gets",
"an",
"undertow",
"web",
"server",
"instance",
"mapped",
"by",
"port",
".",
"hostname",
"must",
"be",
"given",
"in",
"case",
"a",
"new",
"server",
"instance",
"has",
"to",
"be",
"instantiated"
] | train | https://github.com/RuedigerMoeller/kontraktor/blob/d5f3817f9476f3786187b8ef00400b7a4f25a404/modules/kontraktor-http/src/main/java/org/nustaq/kontraktor/remoting/http/undertow/Http4K.java#L93-L95 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/autodiff/StochasticGradientApproximation.java | StochasticGradientApproximation.estimateGradientSpsa | public static IntDoubleVector estimateGradientSpsa(Function fn, IntDoubleVector x, int numSamples) {
"""
Estimates a gradient of a function by simultaneous perterbations
stochastic approximation (SPSA) (Spall, 1992).
@param fn Function on which to approximate the gradient.
@param x Point at which to approxima... | java | public static IntDoubleVector estimateGradientSpsa(Function fn, IntDoubleVector x, int numSamples) {
int numParams = fn.getNumDimensions();
// The gradient estimate
IntDoubleVector grad = new IntDoubleDenseVector(numParams);
for (int k=0; k<numSamples; k++) {
// Get a rand... | [
"public",
"static",
"IntDoubleVector",
"estimateGradientSpsa",
"(",
"Function",
"fn",
",",
"IntDoubleVector",
"x",
",",
"int",
"numSamples",
")",
"{",
"int",
"numParams",
"=",
"fn",
".",
"getNumDimensions",
"(",
")",
";",
"// The gradient estimate",
"IntDoubleVector... | Estimates a gradient of a function by simultaneous perterbations
stochastic approximation (SPSA) (Spall, 1992).
@param fn Function on which to approximate the gradient.
@param x Point at which to approximate the gradient.
@param numSamples Number of samples to take, which will be averaged
together (typically 1).
@retu... | [
"Estimates",
"a",
"gradient",
"of",
"a",
"function",
"by",
"simultaneous",
"perterbations",
"stochastic",
"approximation",
"(",
"SPSA",
")",
"(",
"Spall",
"1992",
")",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/autodiff/StochasticGradientApproximation.java#L61-L75 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLLiteralImpl_CustomFieldSerializer.java | OWLLiteralImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLLiteralImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.c... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLLiteralImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLLiteralImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"
] | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user.clie... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{"
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLLiteralImpl_CustomFieldSerializer.java#L89-L92 |
whitesource/agents | wss-agent-api/src/main/java/org/whitesource/agent/api/dispatch/RequestFactory.java | RequestFactory.newCheckPolicyComplianceRequest | @Deprecated
public CheckPolicyComplianceRequest newCheckPolicyComplianceRequest(String orgToken,
String product,
String productVersion,
... | java | @Deprecated
public CheckPolicyComplianceRequest newCheckPolicyComplianceRequest(String orgToken,
String product,
String productVersion,
... | [
"@",
"Deprecated",
"public",
"CheckPolicyComplianceRequest",
"newCheckPolicyComplianceRequest",
"(",
"String",
"orgToken",
",",
"String",
"product",
",",
"String",
"productVersion",
",",
"Collection",
"<",
"AgentProjectInfo",
">",
"projects",
",",
"boolean",
"forceCheckAl... | Create new Check policies request.
@param orgToken WhiteSource organization token.
@param projects Projects status statement to check.
@param product Name or WhiteSource service token of the product whose policies to check.
@param productVersion Version of... | [
"Create",
"new",
"Check",
"policies",
"request",
"."
] | train | https://github.com/whitesource/agents/blob/8a947a3dbad257aff70f23f79fb3a55ca90b765f/wss-agent-api/src/main/java/org/whitesource/agent/api/dispatch/RequestFactory.java#L454-L469 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/LocalDateTime.java | LocalDateTime.plusWithOverflow | private LocalDateTime plusWithOverflow(LocalDate newDate, long hours, long minutes, long seconds, long nanos, int sign) {
"""
Returns a copy of this {@code LocalDateTime} with the specified period added.
<p>
This instance is immutable and unaffected by this method call.
@param newDate the new date to base th... | java | private LocalDateTime plusWithOverflow(LocalDate newDate, long hours, long minutes, long seconds, long nanos, int sign) {
// 9223372036854775808 long, 2147483648 int
if ((hours | minutes | seconds | nanos) == 0) {
return with(newDate, time);
}
long totDays = nanos / NANOS_PER... | [
"private",
"LocalDateTime",
"plusWithOverflow",
"(",
"LocalDate",
"newDate",
",",
"long",
"hours",
",",
"long",
"minutes",
",",
"long",
"seconds",
",",
"long",
"nanos",
",",
"int",
"sign",
")",
"{",
"// 9223372036854775808 long, 2147483648 int",
"if",
"(",
"(",
... | Returns a copy of this {@code LocalDateTime} with the specified period added.
<p>
This instance is immutable and unaffected by this method call.
@param newDate the new date to base the calculation on, not null
@param hours the hours to add, may be negative
@param minutes the minutes to add, may be negative
@param se... | [
"Returns",
"a",
"copy",
"of",
"this",
"{",
"@code",
"LocalDateTime",
"}",
"with",
"the",
"specified",
"period",
"added",
".",
"<p",
">",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/LocalDateTime.java#L1392-L1412 |
Netflix/conductor | core/src/main/java/com/netflix/conductor/core/orchestration/ExecutionDAOFacade.java | ExecutionDAOFacade.updateTask | public void updateTask(Task task) {
"""
Sets the update time for the task.
Sets the end time for the task (if task is in terminal state and end time is not set).
Updates the task in the {@link ExecutionDAO} first, then stores it in the {@link IndexDAO}.
@param task the task to be updated in the data store
@t... | java | public void updateTask(Task task) {
try {
executionDAO.updateTask(task);
indexDAO.indexTask(task);
} catch (Exception e) {
String errorMsg = String.format("Error updating task: %s in workflow: %s", task.getTaskId(), task.getWorkflowInstanceId());
LOGGER.er... | [
"public",
"void",
"updateTask",
"(",
"Task",
"task",
")",
"{",
"try",
"{",
"executionDAO",
".",
"updateTask",
"(",
"task",
")",
";",
"indexDAO",
".",
"indexTask",
"(",
"task",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"String",
"errorMsg... | Sets the update time for the task.
Sets the end time for the task (if task is in terminal state and end time is not set).
Updates the task in the {@link ExecutionDAO} first, then stores it in the {@link IndexDAO}.
@param task the task to be updated in the data store
@throws ApplicationException if the dao operations f... | [
"Sets",
"the",
"update",
"time",
"for",
"the",
"task",
".",
"Sets",
"the",
"end",
"time",
"for",
"the",
"task",
"(",
"if",
"task",
"is",
"in",
"terminal",
"state",
"and",
"end",
"time",
"is",
"not",
"set",
")",
".",
"Updates",
"the",
"task",
"in",
... | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/core/src/main/java/com/netflix/conductor/core/orchestration/ExecutionDAOFacade.java#L232-L241 |
JOML-CI/JOML | src/org/joml/Matrix3x2f.java | Matrix3x2f.get3x3 | public ByteBuffer get3x3(int index, ByteBuffer buffer) {
"""
Store this matrix as an equivalent 3x3 matrix in column-major order into the supplied {@link ByteBuffer} starting at the specified
absolute buffer position/index.
<p>
This method will not increment the position of the given ByteBuffer.
@param index... | java | public ByteBuffer get3x3(int index, ByteBuffer buffer) {
MemUtil.INSTANCE.put3x3(this, index, buffer);
return buffer;
} | [
"public",
"ByteBuffer",
"get3x3",
"(",
"int",
"index",
",",
"ByteBuffer",
"buffer",
")",
"{",
"MemUtil",
".",
"INSTANCE",
".",
"put3x3",
"(",
"this",
",",
"index",
",",
"buffer",
")",
";",
"return",
"buffer",
";",
"}"
] | Store this matrix as an equivalent 3x3 matrix in column-major order into the supplied {@link ByteBuffer} starting at the specified
absolute buffer position/index.
<p>
This method will not increment the position of the given ByteBuffer.
@param index
the absolute position into the ByteBuffer
@param buffer
will receive t... | [
"Store",
"this",
"matrix",
"as",
"an",
"equivalent",
"3x3",
"matrix",
"in",
"column",
"-",
"major",
"order",
"into",
"the",
"supplied",
"{",
"@link",
"ByteBuffer",
"}",
"starting",
"at",
"the",
"specified",
"absolute",
"buffer",
"position",
"/",
"index",
"."... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3x2f.java#L950-L953 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistriesInner.java | RegistriesInner.createOrUpdateAsync | public Observable<RegistryInner> createOrUpdateAsync(String resourceGroupName, String registryName, RegistryInner registry) {
"""
Creates or updates a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param regist... | java | public Observable<RegistryInner> createOrUpdateAsync(String resourceGroupName, String registryName, RegistryInner registry) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, registryName, registry).map(new Func1<ServiceResponse<RegistryInner>, RegistryInner>() {
@Override
... | [
"public",
"Observable",
"<",
"RegistryInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"RegistryInner",
"registry",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"reg... | Creates or updates a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param registry The parameters for creating or updating a container registry.
@throws IllegalAr... | [
"Creates",
"or",
"updates",
"a",
"container",
"registry",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistriesInner.java#L322-L329 |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java | ConfigurationPropertyName.of | static ConfigurationPropertyName of(CharSequence name, boolean returnNullIfInvalid) {
"""
Return a {@link ConfigurationPropertyName} for the specified string.
@param name the source name
@param returnNullIfInvalid if null should be returned if the name is not valid
@return a {@link ConfigurationPropertyName} in... | java | static ConfigurationPropertyName of(CharSequence name, boolean returnNullIfInvalid) {
Elements elements = elementsOf(name, returnNullIfInvalid);
return (elements != null) ? new ConfigurationPropertyName(elements) : null;
} | [
"static",
"ConfigurationPropertyName",
"of",
"(",
"CharSequence",
"name",
",",
"boolean",
"returnNullIfInvalid",
")",
"{",
"Elements",
"elements",
"=",
"elementsOf",
"(",
"name",
",",
"returnNullIfInvalid",
")",
";",
"return",
"(",
"elements",
"!=",
"null",
")",
... | Return a {@link ConfigurationPropertyName} for the specified string.
@param name the source name
@param returnNullIfInvalid if null should be returned if the name is not valid
@return a {@link ConfigurationPropertyName} instance
@throws InvalidConfigurationPropertyNameException if the name is not valid and
{@code retur... | [
"Return",
"a",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java#L490-L493 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/storage/tx/concurrency/LockTable.java | LockTable.xLock | void xLock(Object obj, long txNum) {
"""
Grants an xlock on the specified item. If any conflict lock exists when
the method is called, then the calling thread will be placed on a wait
list until the lock is released. If the thread remains on the wait list
for a certain amount of time, then an exception is throw... | java | void xLock(Object obj, long txNum) {
Object anchor = getAnchor(obj);
txWaitMap.put(txNum, anchor);
synchronized (anchor) {
Lockers lks = prepareLockers(obj);
if (hasXLock(lks, txNum))
return;
try {
long timestamp = System.currentTimeMillis();
while (!xLockable(lks, txNum) && !wai... | [
"void",
"xLock",
"(",
"Object",
"obj",
",",
"long",
"txNum",
")",
"{",
"Object",
"anchor",
"=",
"getAnchor",
"(",
"obj",
")",
";",
"txWaitMap",
".",
"put",
"(",
"txNum",
",",
"anchor",
")",
";",
"synchronized",
"(",
"anchor",
")",
"{",
"Lockers",
"lk... | Grants an xlock on the specified item. If any conflict lock exists when
the method is called, then the calling thread will be placed on a wait
list until the lock is released. If the thread remains on the wait list
for a certain amount of time, then an exception is thrown.
@param obj
a lockable item
@param txNum
a tra... | [
"Grants",
"an",
"xlock",
"on",
"the",
"specified",
"item",
".",
"If",
"any",
"conflict",
"lock",
"exists",
"when",
"the",
"method",
"is",
"called",
"then",
"the",
"calling",
"thread",
"will",
"be",
"placed",
"on",
"a",
"wait",
"list",
"until",
"the",
"lo... | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/tx/concurrency/LockTable.java#L227-L254 |
kaichunlin/android-transition | core/src/main/java/com/kaichunlin/transition/ViewTransitionBuilder.java | ViewTransitionBuilder.transitViewGroup | public ViewTransitionBuilder transitViewGroup(@NonNull final ViewGroupTransition viewGroupTransition, @NonNull final Cascade cascade) {
"""
Similar to {@link #transitViewGroup(ViewGroupTransition)}, but with builder.range() auto filled for each child View, how
the start and end value is determined is defined by {... | java | public ViewTransitionBuilder transitViewGroup(@NonNull final ViewGroupTransition viewGroupTransition, @NonNull final Cascade cascade) {
transitViewGroup(new ViewGroupTransition() {
@Override
public void transit(ViewTransitionBuilder builder, ViewGroupTransitionConfig config) {
... | [
"public",
"ViewTransitionBuilder",
"transitViewGroup",
"(",
"@",
"NonNull",
"final",
"ViewGroupTransition",
"viewGroupTransition",
",",
"@",
"NonNull",
"final",
"Cascade",
"cascade",
")",
"{",
"transitViewGroup",
"(",
"new",
"ViewGroupTransition",
"(",
")",
"{",
"@",
... | Similar to {@link #transitViewGroup(ViewGroupTransition)}, but with builder.range() auto filled for each child View, how
the start and end value is determined is defined by {@link Cascade} parameter.
@param viewGroupTransition
@param cascade
@return | [
"Similar",
"to",
"{",
"@link",
"#transitViewGroup",
"(",
"ViewGroupTransition",
")",
"}",
"but",
"with",
"builder",
".",
"range",
"()",
"auto",
"filled",
"for",
"each",
"child",
"View",
"how",
"the",
"start",
"and",
"end",
"value",
"is",
"determined",
"is",
... | train | https://github.com/kaichunlin/android-transition/blob/7b53074206622f5cf5d82091d891a7ed8b9f06cd/core/src/main/java/com/kaichunlin/transition/ViewTransitionBuilder.java#L517-L526 |
rey5137/material | material/src/main/java/com/rey/material/widget/DatePicker.java | DatePicker.goTo | public void goTo(int month, int year) {
"""
Jump to the view of a specific month.
@param month
@param year
"""
int position = mAdapter.positionOfMonth(month, year);
postSetSelectionFromTop(position, 0);
} | java | public void goTo(int month, int year){
int position = mAdapter.positionOfMonth(month, year);
postSetSelectionFromTop(position, 0);
} | [
"public",
"void",
"goTo",
"(",
"int",
"month",
",",
"int",
"year",
")",
"{",
"int",
"position",
"=",
"mAdapter",
".",
"positionOfMonth",
"(",
"month",
",",
"year",
")",
";",
"postSetSelectionFromTop",
"(",
"position",
",",
"0",
")",
";",
"}"
] | Jump to the view of a specific month.
@param month
@param year | [
"Jump",
"to",
"the",
"view",
"of",
"a",
"specific",
"month",
"."
] | train | https://github.com/rey5137/material/blob/1bbcac2686a0023ef7720d3fe455bb116d115af8/material/src/main/java/com/rey/material/widget/DatePicker.java#L397-L400 |
mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.toStringIdOrIndex | static String toStringIdOrIndex(Context cx, Object id) {
"""
If toString(id) is a decimal presentation of int32 value, then id
is index. In this case return null and make the index available
as ScriptRuntime.lastIndexResult(cx). Otherwise return toString(id).
"""
if (id instanceof Number) {
... | java | static String toStringIdOrIndex(Context cx, Object id)
{
if (id instanceof Number) {
double d = ((Number)id).doubleValue();
int index = (int)d;
if (index == d) {
storeIndexResult(cx, index);
return null;
}
return toS... | [
"static",
"String",
"toStringIdOrIndex",
"(",
"Context",
"cx",
",",
"Object",
"id",
")",
"{",
"if",
"(",
"id",
"instanceof",
"Number",
")",
"{",
"double",
"d",
"=",
"(",
"(",
"Number",
")",
"id",
")",
".",
"doubleValue",
"(",
")",
";",
"int",
"index"... | If toString(id) is a decimal presentation of int32 value, then id
is index. In this case return null and make the index available
as ScriptRuntime.lastIndexResult(cx). Otherwise return toString(id). | [
"If",
"toString",
"(",
"id",
")",
"is",
"a",
"decimal",
"presentation",
"of",
"int32",
"value",
"then",
"id",
"is",
"index",
".",
"In",
"this",
"case",
"return",
"null",
"and",
"make",
"the",
"index",
"available",
"as",
"ScriptRuntime",
".",
"lastIndexResu... | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L1483-L1506 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/FeatureOverlayQuery.java | FeatureOverlayQuery.tileFeatureCount | public long tileFeatureCount(Point point, int zoom) {
"""
Get the count of features in the tile at the point coordinate and zoom level
@param point point location
@param zoom zoom level
@return count
"""
TileGrid tileGrid = TileBoundingBoxUtils.getTileGridFromWGS84(point, zoom);
return fe... | java | public long tileFeatureCount(Point point, int zoom) {
TileGrid tileGrid = TileBoundingBoxUtils.getTileGridFromWGS84(point, zoom);
return featureTiles.queryIndexedFeaturesCount((int) tileGrid.getMinX(), (int) tileGrid.getMinY(), zoom);
} | [
"public",
"long",
"tileFeatureCount",
"(",
"Point",
"point",
",",
"int",
"zoom",
")",
"{",
"TileGrid",
"tileGrid",
"=",
"TileBoundingBoxUtils",
".",
"getTileGridFromWGS84",
"(",
"point",
",",
"zoom",
")",
";",
"return",
"featureTiles",
".",
"queryIndexedFeaturesCo... | Get the count of features in the tile at the point coordinate and zoom level
@param point point location
@param zoom zoom level
@return count | [
"Get",
"the",
"count",
"of",
"features",
"in",
"the",
"tile",
"at",
"the",
"point",
"coordinate",
"and",
"zoom",
"level"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/FeatureOverlayQuery.java#L242-L245 |
forge/javaee-descriptors | impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/connector16/ConnectorDescriptorImpl.java | ConnectorDescriptorImpl.addNamespace | public ConnectorDescriptor addNamespace(String name, String value) {
"""
Adds a new namespace
@return the current instance of <code>ConnectorDescriptor</code>
"""
model.attribute(name, value);
return this;
} | java | public ConnectorDescriptor addNamespace(String name, String value)
{
model.attribute(name, value);
return this;
} | [
"public",
"ConnectorDescriptor",
"addNamespace",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"model",
".",
"attribute",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds a new namespace
@return the current instance of <code>ConnectorDescriptor</code> | [
"Adds",
"a",
"new",
"namespace"
] | train | https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/connector16/ConnectorDescriptorImpl.java#L87-L91 |
powermock/powermock | powermock-modules/powermock-module-javaagent/src/main/java/sun/tools/attach/HotSpotVirtualMachine.java | HotSpotVirtualMachine.loadAgentPath | @Override
public void loadAgentPath(String agentLibrary, String options)
throws AgentLoadException, AgentInitializationException, IOException {
"""
/*
Load agent - absolute path of library provided to target VM
"""
loadAgentLibrary(agentLibrary, true, options);
} | java | @Override
public void loadAgentPath(String agentLibrary, String options)
throws AgentLoadException, AgentInitializationException, IOException
{
loadAgentLibrary(agentLibrary, true, options);
} | [
"@",
"Override",
"public",
"void",
"loadAgentPath",
"(",
"String",
"agentLibrary",
",",
"String",
"options",
")",
"throws",
"AgentLoadException",
",",
"AgentInitializationException",
",",
"IOException",
"{",
"loadAgentLibrary",
"(",
"agentLibrary",
",",
"true",
",",
... | /*
Load agent - absolute path of library provided to target VM | [
"/",
"*",
"Load",
"agent",
"-",
"absolute",
"path",
"of",
"library",
"provided",
"to",
"target",
"VM"
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-modules/powermock-module-javaagent/src/main/java/sun/tools/attach/HotSpotVirtualMachine.java#L85-L90 |
samskivert/samskivert | src/main/java/com/samskivert/util/Config.java | Config.getValue | public boolean getValue (String name, boolean defval) {
"""
Fetches and returns the value for the specified configuration property. If the value is not
specified in the associated properties file, the supplied default value is returned instead.
The returned value will be <code>false</code> if the config value is... | java | public boolean getValue (String name, boolean defval)
{
String val = _props.getProperty(name);
if (val != null) {
defval = !val.equalsIgnoreCase("false");
}
return defval;
} | [
"public",
"boolean",
"getValue",
"(",
"String",
"name",
",",
"boolean",
"defval",
")",
"{",
"String",
"val",
"=",
"_props",
".",
"getProperty",
"(",
"name",
")",
";",
"if",
"(",
"val",
"!=",
"null",
")",
"{",
"defval",
"=",
"!",
"val",
".",
"equalsIg... | Fetches and returns the value for the specified configuration property. If the value is not
specified in the associated properties file, the supplied default value is returned instead.
The returned value will be <code>false</code> if the config value is <code>"false"</code>
(case-insensitive), else the return value wil... | [
"Fetches",
"and",
"returns",
"the",
"value",
"for",
"the",
"specified",
"configuration",
"property",
".",
"If",
"the",
"value",
"is",
"not",
"specified",
"in",
"the",
"associated",
"properties",
"file",
"the",
"supplied",
"default",
"value",
"is",
"returned",
... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Config.java#L184-L191 |
square/phrase | src/main/java/com/squareup/phrase/ListPhrase.java | ListPhrase.from | @NonNull public static ListPhrase from(@NonNull CharSequence twoElementSeparator,
CharSequence nonFinalElementSeparator, CharSequence finalElementSeparator) {
"""
Entry point into this API.
@param twoElementSeparator separator for 2-element lists
@param nonFinalElementSeparator separator for non-final el... | java | @NonNull public static ListPhrase from(@NonNull CharSequence twoElementSeparator,
CharSequence nonFinalElementSeparator, CharSequence finalElementSeparator) {
return new ListPhrase(twoElementSeparator, nonFinalElementSeparator, finalElementSeparator);
} | [
"@",
"NonNull",
"public",
"static",
"ListPhrase",
"from",
"(",
"@",
"NonNull",
"CharSequence",
"twoElementSeparator",
",",
"CharSequence",
"nonFinalElementSeparator",
",",
"CharSequence",
"finalElementSeparator",
")",
"{",
"return",
"new",
"ListPhrase",
"(",
"twoElement... | Entry point into this API.
@param twoElementSeparator separator for 2-element lists
@param nonFinalElementSeparator separator for non-final elements of lists with 3 or more
elements
@param finalElementSeparator separator for final elements in lists with 3 or more elements | [
"Entry",
"point",
"into",
"this",
"API",
"."
] | train | https://github.com/square/phrase/blob/d91f18e80790832db11b811c462f8e5cd492d97e/src/main/java/com/squareup/phrase/ListPhrase.java#L79-L82 |
Azure/azure-sdk-for-java | policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java | PolicyStatesInner.listQueryResultsForPolicyDefinition | public PolicyStatesQueryResultsInner listQueryResultsForPolicyDefinition(PolicyStatesResource policyStatesResource, String subscriptionId, String policyDefinitionName) {
"""
Queries policy states for the subscription level policy definition.
@param policyStatesResource The virtual resource under PolicyStates re... | java | public PolicyStatesQueryResultsInner listQueryResultsForPolicyDefinition(PolicyStatesResource policyStatesResource, String subscriptionId, String policyDefinitionName) {
return listQueryResultsForPolicyDefinitionWithServiceResponseAsync(policyStatesResource, subscriptionId, policyDefinitionName).toBlocking().si... | [
"public",
"PolicyStatesQueryResultsInner",
"listQueryResultsForPolicyDefinition",
"(",
"PolicyStatesResource",
"policyStatesResource",
",",
"String",
"subscriptionId",
",",
"String",
"policyDefinitionName",
")",
"{",
"return",
"listQueryResultsForPolicyDefinitionWithServiceResponseAsyn... | Queries policy states for the subscription level policy definition.
@param policyStatesResource The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). Possible values include: 'default', 'latest'
@p... | [
"Queries",
"policy",
"states",
"for",
"the",
"subscription",
"level",
"policy",
"definition",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java#L2069-L2071 |
jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/action/BaseAction.java | BaseAction.init | public void init(String actionKey, ActionListener targetListener) {
"""
Creates a new instance of BaseAction.
@param actionKey The menu description key for this item.
"""
m_targetListener = targetListener;
m_actionKey = actionKey;
String text = BaseApplet.getSharedInstance().g... | java | public void init(String actionKey, ActionListener targetListener)
{
m_targetListener = targetListener;
m_actionKey = actionKey;
String text = BaseApplet.getSharedInstance().getString(actionKey);
String desc = BaseApplet.getSharedInstance().getString(actionKey + TIP);
... | [
"public",
"void",
"init",
"(",
"String",
"actionKey",
",",
"ActionListener",
"targetListener",
")",
"{",
"m_targetListener",
"=",
"targetListener",
";",
"m_actionKey",
"=",
"actionKey",
";",
"String",
"text",
"=",
"BaseApplet",
".",
"getSharedInstance",
"(",
")",
... | Creates a new instance of BaseAction.
@param actionKey The menu description key for this item. | [
"Creates",
"a",
"new",
"instance",
"of",
"BaseAction",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/action/BaseAction.java#L56-L73 |
alipay/sofa-rpc | extension-impl/registry-local/src/main/java/com/alipay/sofa/rpc/registry/local/LocalRegistryHelper.java | LocalRegistryHelper.buildListDataId | static String buildListDataId(AbstractInterfaceConfig config, String protocol) {
"""
服务注册中心的Key
@param config 配置
@param protocol 协议
@return 返回值
"""
if (RpcConstants.PROTOCOL_TYPE_BOLT.equals(protocol)
|| RpcConstants.PROTOCOL_TYPE_TR.equals(protocol)) {
return ConfigUniqu... | java | static String buildListDataId(AbstractInterfaceConfig config, String protocol) {
if (RpcConstants.PROTOCOL_TYPE_BOLT.equals(protocol)
|| RpcConstants.PROTOCOL_TYPE_TR.equals(protocol)) {
return ConfigUniqueNameGenerator.getUniqueName(config) + "@DEFAULT";
} else {
ret... | [
"static",
"String",
"buildListDataId",
"(",
"AbstractInterfaceConfig",
"config",
",",
"String",
"protocol",
")",
"{",
"if",
"(",
"RpcConstants",
".",
"PROTOCOL_TYPE_BOLT",
".",
"equals",
"(",
"protocol",
")",
"||",
"RpcConstants",
".",
"PROTOCOL_TYPE_TR",
".",
"eq... | 服务注册中心的Key
@param config 配置
@param protocol 协议
@return 返回值 | [
"服务注册中心的Key"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/registry-local/src/main/java/com/alipay/sofa/rpc/registry/local/LocalRegistryHelper.java#L268-L275 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.mdb/src/com/ibm/ws/ejbcontainer/mdb/internal/MDBRuntimeImpl.java | MDBRuntimeImpl.addAdminObjectService | private void addAdminObjectService(ServiceReference<AdminObjectService> reference, String id, boolean jndiName) {
"""
Internal method for adding an AdminObjectService with an id.
<p>Caller must hold a lock on this object.
@param reference the service reference
@param id the id or jndiName
@param jndiName t... | java | private void addAdminObjectService(ServiceReference<AdminObjectService> reference, String id, boolean jndiName) {
NamedAdminObjectServiceInfo aosInfo = createNamedAdminObjectServiceInfo(id);
aosInfo.getServices(jndiName).addReference(reference);
// If the highest reference after updating is the... | [
"private",
"void",
"addAdminObjectService",
"(",
"ServiceReference",
"<",
"AdminObjectService",
">",
"reference",
",",
"String",
"id",
",",
"boolean",
"jndiName",
")",
"{",
"NamedAdminObjectServiceInfo",
"aosInfo",
"=",
"createNamedAdminObjectServiceInfo",
"(",
"id",
")... | Internal method for adding an AdminObjectService with an id.
<p>Caller must hold a lock on this object.
@param reference the service reference
@param id the id or jndiName
@param jndiName true if the id is the jndiName | [
"Internal",
"method",
"for",
"adding",
"an",
"AdminObjectService",
"with",
"an",
"id",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.mdb/src/com/ibm/ws/ejbcontainer/mdb/internal/MDBRuntimeImpl.java#L449-L467 |
tencentyun/cos-java-sdk | src/main/java/com/qcloud/cos/common_utils/CommonParamCheckUtils.java | CommonParamCheckUtils.AssertSliceInRange | public static void AssertSliceInRange(int sliceSize) throws ParamException {
"""
判断分片尺寸是否在规定的范围内,抛出参数异常,目前的有效值为64KB ~ 10MB
@param sliceSize 分片大小, 单位Byte
@throws ParamException
"""
int maxSliceSize = 10 * 1024 * 1024; // 10MB
int minSliceSize = 64 * 1024; // 64KB
if (sliceSize > maxS... | java | public static void AssertSliceInRange(int sliceSize) throws ParamException {
int maxSliceSize = 10 * 1024 * 1024; // 10MB
int minSliceSize = 64 * 1024; // 64KB
if (sliceSize > maxSliceSize || sliceSize < minSliceSize) {
throw new ParamException("sliceSize legal value is [64KB, 100MB]... | [
"public",
"static",
"void",
"AssertSliceInRange",
"(",
"int",
"sliceSize",
")",
"throws",
"ParamException",
"{",
"int",
"maxSliceSize",
"=",
"10",
"*",
"1024",
"*",
"1024",
";",
"// 10MB",
"int",
"minSliceSize",
"=",
"64",
"*",
"1024",
";",
"// 64KB",
"if",
... | 判断分片尺寸是否在规定的范围内,抛出参数异常,目前的有效值为64KB ~ 10MB
@param sliceSize 分片大小, 单位Byte
@throws ParamException | [
"判断分片尺寸是否在规定的范围内,抛出参数异常,目前的有效值为64KB",
"~",
"10MB"
] | train | https://github.com/tencentyun/cos-java-sdk/blob/6709a48f67c1ea7b82a7215f5037d6ccf218b630/src/main/java/com/qcloud/cos/common_utils/CommonParamCheckUtils.java#L54-L60 |
talenguyen/PrettySharedPreferences | prettysharedpreferences/src/main/java/com/tale/prettysharedpreferences/PrettySharedPreferences.java | PrettySharedPreferences.getStringEditor | protected StringEditor getStringEditor(String key) {
"""
Call to get a {@link com.tale.prettysharedpreferences.StringEditor} object for the specific
key. <code>NOTE:</code> There is a unique {@link com.tale.prettysharedpreferences.TypeEditor}
object for a unique key.
@param key The name of the preference.
@r... | java | protected StringEditor getStringEditor(String key) {
TypeEditor typeEditor = TYPE_EDITOR_MAP.get(key);
if (typeEditor == null) {
typeEditor = new StringEditor(this, sharedPreferences, key);
TYPE_EDITOR_MAP.put(key, typeEditor);
} else if (!(typeEditor instanceof StringEdi... | [
"protected",
"StringEditor",
"getStringEditor",
"(",
"String",
"key",
")",
"{",
"TypeEditor",
"typeEditor",
"=",
"TYPE_EDITOR_MAP",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"typeEditor",
"==",
"null",
")",
"{",
"typeEditor",
"=",
"new",
"StringEditor",
"... | Call to get a {@link com.tale.prettysharedpreferences.StringEditor} object for the specific
key. <code>NOTE:</code> There is a unique {@link com.tale.prettysharedpreferences.TypeEditor}
object for a unique key.
@param key The name of the preference.
@return {@link com.tale.prettysharedpreferences.StringEditor} object ... | [
"Call",
"to",
"get",
"a",
"{",
"@link",
"com",
".",
"tale",
".",
"prettysharedpreferences",
".",
"StringEditor",
"}",
"object",
"for",
"the",
"specific",
"key",
".",
"<code",
">",
"NOTE",
":",
"<",
"/",
"code",
">",
"There",
"is",
"a",
"unique",
"{",
... | train | https://github.com/talenguyen/PrettySharedPreferences/blob/b97edf86c8fa65be2165f2cd790545c78c971c22/prettysharedpreferences/src/main/java/com/tale/prettysharedpreferences/PrettySharedPreferences.java#L32-L41 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/gradientcheck/GradientCheckUtil.java | GradientCheckUtil.checkGradients | public static boolean checkGradients(MultiLayerNetwork mln, double epsilon, double maxRelError,
double minAbsoluteError, boolean print, boolean exitOnFirstError, INDArray input, INDArray labels) {
"""
Check backprop gradients for a MultiLayerNetwork.
@param mln MultiLayerNetwork to test. This ... | java | public static boolean checkGradients(MultiLayerNetwork mln, double epsilon, double maxRelError,
double minAbsoluteError, boolean print, boolean exitOnFirstError, INDArray input, INDArray labels) {
return checkGradients(mln, epsilon, maxRelError, minAbsoluteError, print, exitOnFirstError, inp... | [
"public",
"static",
"boolean",
"checkGradients",
"(",
"MultiLayerNetwork",
"mln",
",",
"double",
"epsilon",
",",
"double",
"maxRelError",
",",
"double",
"minAbsoluteError",
",",
"boolean",
"print",
",",
"boolean",
"exitOnFirstError",
",",
"INDArray",
"input",
",",
... | Check backprop gradients for a MultiLayerNetwork.
@param mln MultiLayerNetwork to test. This must be initialized.
@param epsilon Usually on the order/ of 1e-4 or so.
@param maxRelError Maximum relative error. Usually < 1e-5 or so, though maybe more for deep networks or those with nonlinear activation
@param minAbsolute... | [
"Check",
"backprop",
"gradients",
"for",
"a",
"MultiLayerNetwork",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/gradientcheck/GradientCheckUtil.java#L129-L132 |
alkacon/opencms-core | src/org/opencms/ade/detailpage/CmsDetailPageConfigurationWriter.java | CmsDetailPageConfigurationWriter.updateAndSave | public void updateAndSave(List<CmsDetailPageInfo> infos, CmsUUID newId) throws CmsException {
"""
Writes the new detail page information to the configuration file.<p>
@param infos the new detail page information
@param newId the id to use for new pages
@throws CmsException if something goes wrong
"""
... | java | public void updateAndSave(List<CmsDetailPageInfo> infos, CmsUUID newId) throws CmsException {
if (m_resource != null) {
getDocument();
removeOldValues();
writeDetailPageInfos(infos, newId);
m_document.setAutoCorrectionEnabled(true);
m_document.correct... | [
"public",
"void",
"updateAndSave",
"(",
"List",
"<",
"CmsDetailPageInfo",
">",
"infos",
",",
"CmsUUID",
"newId",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"m_resource",
"!=",
"null",
")",
"{",
"getDocument",
"(",
")",
";",
"removeOldValues",
"(",
")",
... | Writes the new detail page information to the configuration file.<p>
@param infos the new detail page information
@param newId the id to use for new pages
@throws CmsException if something goes wrong | [
"Writes",
"the",
"new",
"detail",
"page",
"information",
"to",
"the",
"configuration",
"file",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/detailpage/CmsDetailPageConfigurationWriter.java#L93-L105 |
apache/incubator-gobblin | gobblin-restli/gobblin-throttling-service/gobblin-throttling-service-server/src/main/java/org/apache/gobblin/restli/throttling/LimiterServerResource.java | LimiterServerResource.getSync | public PermitAllocation getSync(ComplexResourceKey<PermitRequest, EmptyRecord> key) {
"""
Request permits from the limiter server. The returned {@link PermitAllocation} specifies the number of permits
that the client can use.
"""
try {
FutureCallback<PermitAllocation> callback = new FutureCallback<>... | java | public PermitAllocation getSync(ComplexResourceKey<PermitRequest, EmptyRecord> key) {
try {
FutureCallback<PermitAllocation> callback = new FutureCallback<>();
get(key, callback);
return callback.get();
} catch (ExecutionException ee) {
Throwable t = ee.getCause();
if (t instanceo... | [
"public",
"PermitAllocation",
"getSync",
"(",
"ComplexResourceKey",
"<",
"PermitRequest",
",",
"EmptyRecord",
">",
"key",
")",
"{",
"try",
"{",
"FutureCallback",
"<",
"PermitAllocation",
">",
"callback",
"=",
"new",
"FutureCallback",
"<>",
"(",
")",
";",
"get",
... | Request permits from the limiter server. The returned {@link PermitAllocation} specifies the number of permits
that the client can use. | [
"Request",
"permits",
"from",
"the",
"limiter",
"server",
".",
"The",
"returned",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-throttling-service/gobblin-throttling-service-server/src/main/java/org/apache/gobblin/restli/throttling/LimiterServerResource.java#L169-L185 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/utils/MjdbcUtils.java | MjdbcUtils.loadDriver | public static boolean loadDriver(ClassLoader classLoader, String driverClassName) {
"""
Loads and registers a database driver class.
If this succeeds, it returns true, else it returns false.
@param classLoader the class loader used to load the driver class
@param driverClassName of driver to load
@return... | java | public static boolean loadDriver(ClassLoader classLoader, String driverClassName) {
try {
classLoader.loadClass(driverClassName).newInstance();
return true;
} catch (IllegalAccessException e) {
// Constructor is private, OK for DriverManager contract
retu... | [
"public",
"static",
"boolean",
"loadDriver",
"(",
"ClassLoader",
"classLoader",
",",
"String",
"driverClassName",
")",
"{",
"try",
"{",
"classLoader",
".",
"loadClass",
"(",
"driverClassName",
")",
".",
"newInstance",
"(",
")",
";",
"return",
"true",
";",
"}",... | Loads and registers a database driver class.
If this succeeds, it returns true, else it returns false.
@param classLoader the class loader used to load the driver class
@param driverClassName of driver to load
@return boolean <code>true</code> if the driver was found, otherwise <code>false</code> | [
"Loads",
"and",
"registers",
"a",
"database",
"driver",
"class",
".",
"If",
"this",
"succeeds",
"it",
"returns",
"true",
"else",
"it",
"returns",
"false",
"."
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/utils/MjdbcUtils.java#L185-L198 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.newWriter | public static BufferedWriter newWriter(File file, boolean append) throws IOException {
"""
Creates a buffered writer for this file, optionally appending to the
existing file content.
@param file a File
@param append true if data should be appended to the file
@return a BufferedWriter
@throws IOException i... | java | public static BufferedWriter newWriter(File file, boolean append) throws IOException {
return new BufferedWriter(new FileWriter(file, append));
} | [
"public",
"static",
"BufferedWriter",
"newWriter",
"(",
"File",
"file",
",",
"boolean",
"append",
")",
"throws",
"IOException",
"{",
"return",
"new",
"BufferedWriter",
"(",
"new",
"FileWriter",
"(",
"file",
",",
"append",
")",
")",
";",
"}"
] | Creates a buffered writer for this file, optionally appending to the
existing file content.
@param file a File
@param append true if data should be appended to the file
@return a BufferedWriter
@throws IOException if an IOException occurs.
@since 1.0 | [
"Creates",
"a",
"buffered",
"writer",
"for",
"this",
"file",
"optionally",
"appending",
"to",
"the",
"existing",
"file",
"content",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L1913-L1915 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedIconOverlay.java | ItemizedIconOverlay.onSingleTapConfirmed | @Override
public boolean onSingleTapConfirmed(final MotionEvent event, final MapView mapView) {
"""
Each of these methods performs a item sensitive check. If the item is located its
corresponding method is called. The result of the call is returned.
Helper methods are provided so that child classes may more e... | java | @Override
public boolean onSingleTapConfirmed(final MotionEvent event, final MapView mapView) {
return (activateSelectedItems(event, mapView, new ActiveItem() {
@Override
public boolean run(final int index) {
final ItemizedIconOverlay<Item> that = ItemizedIconOverlay.this;
if (that.mOnItemGestureListen... | [
"@",
"Override",
"public",
"boolean",
"onSingleTapConfirmed",
"(",
"final",
"MotionEvent",
"event",
",",
"final",
"MapView",
"mapView",
")",
"{",
"return",
"(",
"activateSelectedItems",
"(",
"event",
",",
"mapView",
",",
"new",
"ActiveItem",
"(",
")",
"{",
"@"... | Each of these methods performs a item sensitive check. If the item is located its
corresponding method is called. The result of the call is returned.
Helper methods are provided so that child classes may more easily override behavior without
resorting to overriding the ItemGestureListener methods. | [
"Each",
"of",
"these",
"methods",
"performs",
"a",
"item",
"sensitive",
"check",
".",
"If",
"the",
"item",
"is",
"located",
"its",
"corresponding",
"method",
"is",
"called",
".",
"The",
"result",
"of",
"the",
"call",
"is",
"returned",
"."
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedIconOverlay.java#L118-L130 |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/operator/LookupJoinPageBuilder.java | LookupJoinPageBuilder.appendRow | public void appendRow(JoinProbe probe, LookupSource lookupSource, long joinPosition) {
"""
append the index for the probe and copy the row for the build
"""
// probe side
appendProbeIndex(probe);
// build side
buildPageBuilder.declarePosition();
lookupSource.appendTo(jo... | java | public void appendRow(JoinProbe probe, LookupSource lookupSource, long joinPosition)
{
// probe side
appendProbeIndex(probe);
// build side
buildPageBuilder.declarePosition();
lookupSource.appendTo(joinPosition, buildPageBuilder, 0);
} | [
"public",
"void",
"appendRow",
"(",
"JoinProbe",
"probe",
",",
"LookupSource",
"lookupSource",
",",
"long",
"joinPosition",
")",
"{",
"// probe side",
"appendProbeIndex",
"(",
"probe",
")",
";",
"// build side",
"buildPageBuilder",
".",
"declarePosition",
"(",
")",
... | append the index for the probe and copy the row for the build | [
"append",
"the",
"index",
"for",
"the",
"probe",
"and",
"copy",
"the",
"row",
"for",
"the",
"build"
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/operator/LookupJoinPageBuilder.java#L71-L79 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/user/UserCoreDao.java | UserCoreDao.buildWhere | public String buildWhere(Set<Map.Entry<String, Object>> fields) {
"""
Build where (or selection) statement from the fields
@param fields
fields
@return where clause
"""
StringBuilder selection = new StringBuilder();
for (Map.Entry<String, Object> field : fields) {
if (selection.length() > 0) {
... | java | public String buildWhere(Set<Map.Entry<String, Object>> fields) {
StringBuilder selection = new StringBuilder();
for (Map.Entry<String, Object> field : fields) {
if (selection.length() > 0) {
selection.append(" AND ");
}
selection.append(buildWhere(field.getKey(), field.getValue()));
}
return selec... | [
"public",
"String",
"buildWhere",
"(",
"Set",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"Object",
">",
">",
"fields",
")",
"{",
"StringBuilder",
"selection",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String"... | Build where (or selection) statement from the fields
@param fields
fields
@return where clause | [
"Build",
"where",
"(",
"or",
"selection",
")",
"statement",
"from",
"the",
"fields"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/user/UserCoreDao.java#L647-L656 |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/server/JcrServiceImpl.java | JcrServiceImpl.getProperties | private Collection<JcrProperty> getProperties( String repository, String workspace, String path, Node node ) throws RepositoryException {
"""
Reads properties of the given node.
@param repository the repository name
@param workspace the workspace name
@param path the path to the node
@param node the node ins... | java | private Collection<JcrProperty> getProperties( String repository, String workspace, String path, Node node ) throws RepositoryException {
ArrayList<PropertyDefinition> names = new ArrayList<>();
NodeType primaryType = node.getPrimaryNodeType();
PropertyDefinition[] defs = primaryType.ge... | [
"private",
"Collection",
"<",
"JcrProperty",
">",
"getProperties",
"(",
"String",
"repository",
",",
"String",
"workspace",
",",
"String",
"path",
",",
"Node",
"node",
")",
"throws",
"RepositoryException",
"{",
"ArrayList",
"<",
"PropertyDefinition",
">",
"names",... | Reads properties of the given node.
@param repository the repository name
@param workspace the workspace name
@param path the path to the node
@param node the node instance
@return list of node's properties.
@throws RepositoryException | [
"Reads",
"properties",
"of",
"the",
"given",
"node",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/server/JcrServiceImpl.java#L361-L394 |
lessthanoptimal/ddogleg | src/org/ddogleg/clustering/FactoryClustering.java | FactoryClustering.kMeans_F64 | public static StandardKMeans_F64 kMeans_F64( KMeansInitializers initializer,
int maxIterations, int maxConverge , double convergeTol) {
"""
High level interface for creating k-means cluster. If more flexibility is needed (e.g. custom seeds)
then create and instance of {@link org.ddogleg.clustering.k... | java | public static StandardKMeans_F64 kMeans_F64( KMeansInitializers initializer,
int maxIterations, int maxConverge , double convergeTol) {
InitializeKMeans_F64 seed;
if( initializer == null ) {
seed = new InitializePlusPlus();
} else {
switch (initializer) {
case PLUS_PLUS:
seed = new In... | [
"public",
"static",
"StandardKMeans_F64",
"kMeans_F64",
"(",
"KMeansInitializers",
"initializer",
",",
"int",
"maxIterations",
",",
"int",
"maxConverge",
",",
"double",
"convergeTol",
")",
"{",
"InitializeKMeans_F64",
"seed",
";",
"if",
"(",
"initializer",
"==",
"nu... | High level interface for creating k-means cluster. If more flexibility is needed (e.g. custom seeds)
then create and instance of {@link org.ddogleg.clustering.kmeans.StandardKMeans_F64} directly
@param initializer Specify which method should be used to select the initial seeds for the clusters. null means default.
@... | [
"High",
"level",
"interface",
"for",
"creating",
"k",
"-",
"means",
"cluster",
".",
"If",
"more",
"flexibility",
"is",
"needed",
"(",
"e",
".",
"g",
".",
"custom",
"seeds",
")",
"then",
"create",
"and",
"instance",
"of",
"{",
"@link",
"org",
".",
"ddog... | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/clustering/FactoryClustering.java#L67-L88 |
phax/ph-oton | ph-oton-exchange/src/main/java/com/helger/photon/exchange/bulkexport/format/ExporterCSV.java | ExporterCSV.createCSVWriter | @SuppressWarnings ("resource")
@Nonnull
@OverrideOnDemand
@WillCloseWhenClosed
protected CSVWriter createCSVWriter (@Nonnull final OutputStream aOS) {
"""
Create a new CSV writer.
@param aOS
The output stream to write to. May not be <code>null</code>.
@return The {@link CSVWriter} to used. Never <code... | java | @SuppressWarnings ("resource")
@Nonnull
@OverrideOnDemand
@WillCloseWhenClosed
protected CSVWriter createCSVWriter (@Nonnull final OutputStream aOS)
{
return new CSVWriter (new OutputStreamWriter (aOS, m_aCharset)).setSeparatorChar (m_cSeparatorChar)
... | [
"@",
"SuppressWarnings",
"(",
"\"resource\"",
")",
"@",
"Nonnull",
"@",
"OverrideOnDemand",
"@",
"WillCloseWhenClosed",
"protected",
"CSVWriter",
"createCSVWriter",
"(",
"@",
"Nonnull",
"final",
"OutputStream",
"aOS",
")",
"{",
"return",
"new",
"CSVWriter",
"(",
"... | Create a new CSV writer.
@param aOS
The output stream to write to. May not be <code>null</code>.
@return The {@link CSVWriter} to used. Never <code>null</code>. | [
"Create",
"a",
"new",
"CSV",
"writer",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-exchange/src/main/java/com/helger/photon/exchange/bulkexport/format/ExporterCSV.java#L239-L250 |
signalapp/curve25519-java | common/src/main/java/org/whispersystems/curve25519/Curve25519.java | Curve25519.verifySignature | public boolean verifySignature(byte[] publicKey, byte[] message, byte[] signature) {
"""
Verify a Curve25519 signature.
@param publicKey The Curve25519 public key the signature belongs to.
@param message The message that was signed.
@param signature The signature to verify.
@return true if valid, false if no... | java | public boolean verifySignature(byte[] publicKey, byte[] message, byte[] signature) {
if (publicKey == null || publicKey.length != 32) {
throw new IllegalArgumentException("Invalid public key!");
}
if (message == null || signature == null || signature.length != 64) {
return false;
}
ret... | [
"public",
"boolean",
"verifySignature",
"(",
"byte",
"[",
"]",
"publicKey",
",",
"byte",
"[",
"]",
"message",
",",
"byte",
"[",
"]",
"signature",
")",
"{",
"if",
"(",
"publicKey",
"==",
"null",
"||",
"publicKey",
".",
"length",
"!=",
"32",
")",
"{",
... | Verify a Curve25519 signature.
@param publicKey The Curve25519 public key the signature belongs to.
@param message The message that was signed.
@param signature The signature to verify.
@return true if valid, false if not. | [
"Verify",
"a",
"Curve25519",
"signature",
"."
] | train | https://github.com/signalapp/curve25519-java/blob/70fae57d6dccff7e78a46203c534314b07dfdd98/common/src/main/java/org/whispersystems/curve25519/Curve25519.java#L108-L118 |
Chorus-bdd/Chorus | interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/HandlerManager.java | HandlerManager.injectResourceFields | private void injectResourceFields(Object handler, Iterable<Object> handlerInstances, Scope... scopes) {
"""
Here we set the values of any handler fields annotated with @ChorusResource
"""
Class<?> featureClass = handler.getClass();
List<Field> allFields = new ArrayList<>();
addAllPubli... | java | private void injectResourceFields(Object handler, Iterable<Object> handlerInstances, Scope... scopes) {
Class<?> featureClass = handler.getClass();
List<Field> allFields = new ArrayList<>();
addAllPublicFields(featureClass, allFields);
log.trace("Now examining handler fields for ChorusR... | [
"private",
"void",
"injectResourceFields",
"(",
"Object",
"handler",
",",
"Iterable",
"<",
"Object",
">",
"handlerInstances",
",",
"Scope",
"...",
"scopes",
")",
"{",
"Class",
"<",
"?",
">",
"featureClass",
"=",
"handler",
".",
"getClass",
"(",
")",
";",
"... | Here we set the values of any handler fields annotated with @ChorusResource | [
"Here",
"we",
"set",
"the",
"values",
"of",
"any",
"handler",
"fields",
"annotated",
"with"
] | train | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/HandlerManager.java#L217-L228 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/variant/VariantUtils.java | VariantUtils.getVariantBundleName | public static String getVariantBundleName(String bundleName, String variantKey, boolean iGeneratedResource) {
"""
Get the bundle name taking in account the variant key
@param bundleName
the bundle name
@param variantKey
the variant key
@param iGeneratedResource
the flag indicating if it's a generated resou... | java | public static String getVariantBundleName(String bundleName, String variantKey, boolean iGeneratedResource) {
String newName = bundleName;
if (StringUtils.isNotEmpty(variantKey)) {
int idxSeparator = bundleName.lastIndexOf('.');
if (!iGeneratedResource && idxSeparator != -1) {
newName = bundleName.substr... | [
"public",
"static",
"String",
"getVariantBundleName",
"(",
"String",
"bundleName",
",",
"String",
"variantKey",
",",
"boolean",
"iGeneratedResource",
")",
"{",
"String",
"newName",
"=",
"bundleName",
";",
"if",
"(",
"StringUtils",
".",
"isNotEmpty",
"(",
"variantK... | Get the bundle name taking in account the variant key
@param bundleName
the bundle name
@param variantKey
the variant key
@param iGeneratedResource
the flag indicating if it's a generated resource
@return the variant bundle name | [
"Get",
"the",
"bundle",
"name",
"taking",
"in",
"account",
"the",
"variant",
"key"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/variant/VariantUtils.java#L249-L264 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java | SeleniumHelper.findByXPath | public T findByXPath(String pattern, String... parameters) {
"""
Finds element using xPath, supporting placeholder replacement.
@param pattern basic XPATH, possibly with placeholders.
@param parameters values for placeholders.
@return element if found, null if none could be found.
"""
By by = byXpat... | java | public T findByXPath(String pattern, String... parameters) {
By by = byXpath(pattern, parameters);
return findElement(by);
} | [
"public",
"T",
"findByXPath",
"(",
"String",
"pattern",
",",
"String",
"...",
"parameters",
")",
"{",
"By",
"by",
"=",
"byXpath",
"(",
"pattern",
",",
"parameters",
")",
";",
"return",
"findElement",
"(",
"by",
")",
";",
"}"
] | Finds element using xPath, supporting placeholder replacement.
@param pattern basic XPATH, possibly with placeholders.
@param parameters values for placeholders.
@return element if found, null if none could be found. | [
"Finds",
"element",
"using",
"xPath",
"supporting",
"placeholder",
"replacement",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java#L698-L701 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.createStrictPartialMockForAllMethodsExcept | public static synchronized <T> T createStrictPartialMockForAllMethodsExcept(Class<T> type, String... methodNames) {
"""
A utility method that may be used to specify several methods that should
<i>not</i> be strictly mocked in an easy manner (by just passing in the
method names of the method you wish <i>not</i> t... | java | public static synchronized <T> T createStrictPartialMockForAllMethodsExcept(Class<T> type, String... methodNames) {
if (methodNames != null && methodNames.length == 0) {
return createStrictMock(type);
}
return createStrictMock(type, WhiteboxImpl.getAllMethodExcept(type, methodNames)... | [
"public",
"static",
"synchronized",
"<",
"T",
">",
"T",
"createStrictPartialMockForAllMethodsExcept",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"...",
"methodNames",
")",
"{",
"if",
"(",
"methodNames",
"!=",
"null",
"&&",
"methodNames",
".",
"length"... | A utility method that may be used to specify several methods that should
<i>not</i> be strictly mocked in an easy manner (by just passing in the
method names of the method you wish <i>not</i> to mock). Note that you
cannot uniquely specify a method to exclude using this method if there
are several methods with the same... | [
"A",
"utility",
"method",
"that",
"may",
"be",
"used",
"to",
"specify",
"several",
"methods",
"that",
"should",
"<i",
">",
"not<",
"/",
"i",
">",
"be",
"strictly",
"mocked",
"in",
"an",
"easy",
"manner",
"(",
"by",
"just",
"passing",
"in",
"the",
"meth... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L376-L382 |
Tristan971/EasyFXML | easyfxml/src/main/java/moe/tristan/easyfxml/model/fxml/FxmlLoadResult.java | FxmlLoadResult.ensureCorrectlyLoaded | private void ensureCorrectlyLoaded() {
"""
Performs an unsafe (in the sense that it will throw a {@link RuntimeException} on failure) check of whether both
the {@link #node} and the {@link #controller} loaded successfully. The condition is that they must both be
successes (in the sense of {@link Try#isSuccess()}... | java | private void ensureCorrectlyLoaded() {
if (node.isFailure()) {
throw new IllegalStateException("Node did not properly load!", node.getCause());
}
if (controller.isFailure()) {
throw new IllegalStateException("Controller did not properly load!", controller.getCause());
... | [
"private",
"void",
"ensureCorrectlyLoaded",
"(",
")",
"{",
"if",
"(",
"node",
".",
"isFailure",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Node did not properly load!\"",
",",
"node",
".",
"getCause",
"(",
")",
")",
";",
"}",
"if",
... | Performs an unsafe (in the sense that it will throw a {@link RuntimeException} on failure) check of whether both
the {@link #node} and the {@link #controller} loaded successfully. The condition is that they must both be
successes (in the sense of {@link Try#isSuccess()} and be non-null values. | [
"Performs",
"an",
"unsafe",
"(",
"in",
"the",
"sense",
"that",
"it",
"will",
"throw",
"a",
"{"
] | train | https://github.com/Tristan971/EasyFXML/blob/f82cad1d54e62903ca5e4a250279ad315b028aef/easyfxml/src/main/java/moe/tristan/easyfxml/model/fxml/FxmlLoadResult.java#L85-L95 |
loldevs/riotapi | rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java | ThrottledApiHandler.getMastery | public Future<Mastery> getMastery(int id, MasteryData data, String version, String locale) {
"""
<p>
Get a specific mastery
</p>
This method does not count towards the rate limit and is not affected by the throttle
@param id The id of the mastery
@param data Additional information to retrieve
@param version ... | java | public Future<Mastery> getMastery(int id, MasteryData data, String version, String locale) {
return new DummyFuture<>(handler.getMastery(id, data, version, locale));
} | [
"public",
"Future",
"<",
"Mastery",
">",
"getMastery",
"(",
"int",
"id",
",",
"MasteryData",
"data",
",",
"String",
"version",
",",
"String",
"locale",
")",
"{",
"return",
"new",
"DummyFuture",
"<>",
"(",
"handler",
".",
"getMastery",
"(",
"id",
",",
"da... | <p>
Get a specific mastery
</p>
This method does not count towards the rate limit and is not affected by the throttle
@param id The id of the mastery
@param data Additional information to retrieve
@param version Data dragon version for returned data
@param locale Locale code for returned data
@return The mastery
@see <... | [
"<p",
">",
"Get",
"a",
"specific",
"mastery",
"<",
"/",
"p",
">",
"This",
"method",
"does",
"not",
"count",
"towards",
"the",
"rate",
"limit",
"and",
"is",
"not",
"affected",
"by",
"the",
"throttle"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L605-L607 |
FINRAOS/JTAF-ExtWebDriver | src/main/java/org/finra/jtaf/ewd/widget/element/Element.java | Element.isWithinBoundsOfWindow | public boolean isWithinBoundsOfWindow() throws WidgetException {
"""
*
Determine if the element is within the bounds of the window
@return true or false
@throws WidgetException
"""
JavascriptExecutor js = ((JavascriptExecutor) getGUIDriver().getWrappedDriver());
// execute javascript to get scro... | java | public boolean isWithinBoundsOfWindow() throws WidgetException {
JavascriptExecutor js = ((JavascriptExecutor) getGUIDriver().getWrappedDriver());
// execute javascript to get scroll values
Object top = js.executeScript("return document.body.scrollTop;");
Object left = js.executeScript("return document.bo... | [
"public",
"boolean",
"isWithinBoundsOfWindow",
"(",
")",
"throws",
"WidgetException",
"{",
"JavascriptExecutor",
"js",
"=",
"(",
"(",
"JavascriptExecutor",
")",
"getGUIDriver",
"(",
")",
".",
"getWrappedDriver",
"(",
")",
")",
";",
"// execute javascript to get scroll... | *
Determine if the element is within the bounds of the window
@return true or false
@throws WidgetException | [
"*",
"Determine",
"if",
"the",
"element",
"is",
"within",
"the",
"bounds",
"of",
"the",
"window"
] | train | https://github.com/FINRAOS/JTAF-ExtWebDriver/blob/78d646def1bf0904f79b19a81df0241e07f2c73a/src/main/java/org/finra/jtaf/ewd/widget/element/Element.java#L253-L282 |
infinispan/infinispan | core/src/main/java/org/infinispan/stream/impl/KeyWatchingCompletionListener.java | KeyWatchingCompletionListener.valueIterated | public void valueIterated(Object key) {
"""
This method is to be invoked on possibly a different thread at any point which states that a key has
been iterated upon. This is the signal that if a set of segments is waiting for a key to be iterated upon
to notify the iteration
@param key the key just returning
... | java | public void valueIterated(Object key) {
// If we set to null that tells segment completion to just notify above in accept
if (!currentKey.compareAndSet(key, null)) {
// Otherwise we have to check if this key was linked to a group of pending segments
Supplier<PrimitiveIterator.OfInt> segmen... | [
"public",
"void",
"valueIterated",
"(",
"Object",
"key",
")",
"{",
"// If we set to null that tells segment completion to just notify above in accept",
"if",
"(",
"!",
"currentKey",
".",
"compareAndSet",
"(",
"key",
",",
"null",
")",
")",
"{",
"// Otherwise we have to che... | This method is to be invoked on possibly a different thread at any point which states that a key has
been iterated upon. This is the signal that if a set of segments is waiting for a key to be iterated upon
to notify the iteration
@param key the key just returning | [
"This",
"method",
"is",
"to",
"be",
"invoked",
"on",
"possibly",
"a",
"different",
"thread",
"at",
"any",
"point",
"which",
"states",
"that",
"a",
"key",
"has",
"been",
"iterated",
"upon",
".",
"This",
"is",
"the",
"signal",
"that",
"if",
"a",
"set",
"... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/stream/impl/KeyWatchingCompletionListener.java#L72-L81 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.setRotationXYZ | public Matrix4f setRotationXYZ(float angleX, float angleY, float angleZ) {
"""
Set only the upper left 3x3 submatrix of this matrix to a rotation of <code>angleX</code> radians about the X axis, followed by a rotation
of <code>angleY</code> radians about the Y axis and followed by a rotation of <code>angleZ</code... | java | public Matrix4f setRotationXYZ(float angleX, float angleY, float angleZ) {
float sinX = (float) Math.sin(angleX);
float cosX = (float) Math.cosFromSin(sinX, angleX);
float sinY = (float) Math.sin(angleY);
float cosY = (float) Math.cosFromSin(sinY, angleY);
float sinZ = (float) Ma... | [
"public",
"Matrix4f",
"setRotationXYZ",
"(",
"float",
"angleX",
",",
"float",
"angleY",
",",
"float",
"angleZ",
")",
"{",
"float",
"sinX",
"=",
"(",
"float",
")",
"Math",
".",
"sin",
"(",
"angleX",
")",
";",
"float",
"cosX",
"=",
"(",
"float",
")",
"... | Set only the upper left 3x3 submatrix of this matrix to a rotation of <code>angleX</code> radians about the X axis, followed by a rotation
of <code>angleY</code> radians about the Y axis and followed by a rotation of <code>angleZ</code> radians about the Z axis.
<p>
When used with a right-handed coordinate system, the ... | [
"Set",
"only",
"the",
"upper",
"left",
"3x3",
"submatrix",
"of",
"this",
"matrix",
"to",
"a",
"rotation",
"of",
"<code",
">",
"angleX<",
"/",
"code",
">",
"radians",
"about",
"the",
"X",
"axis",
"followed",
"by",
"a",
"rotation",
"of",
"<code",
">",
"a... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L3782-L3814 |
windup/windup | config/api/src/main/java/org/jboss/windup/config/operation/iteration/AbstractIterationFilter.java | AbstractIterationFilter.checkVariableName | protected void checkVariableName(GraphRewrite event, EvaluationContext context) {
"""
Check the variable name and if not set, set it with the singleton variable being on the top of the stack.
"""
if (getInputVariablesName() == null)
{
setInputVariablesName(Iteration.getPayloadVariab... | java | protected void checkVariableName(GraphRewrite event, EvaluationContext context)
{
if (getInputVariablesName() == null)
{
setInputVariablesName(Iteration.getPayloadVariableName(event, context));
}
} | [
"protected",
"void",
"checkVariableName",
"(",
"GraphRewrite",
"event",
",",
"EvaluationContext",
"context",
")",
"{",
"if",
"(",
"getInputVariablesName",
"(",
")",
"==",
"null",
")",
"{",
"setInputVariablesName",
"(",
"Iteration",
".",
"getPayloadVariableName",
"("... | Check the variable name and if not set, set it with the singleton variable being on the top of the stack. | [
"Check",
"the",
"variable",
"name",
"and",
"if",
"not",
"set",
"set",
"it",
"with",
"the",
"singleton",
"variable",
"being",
"on",
"the",
"top",
"of",
"the",
"stack",
"."
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/config/api/src/main/java/org/jboss/windup/config/operation/iteration/AbstractIterationFilter.java#L43-L49 |
tvesalainen/util | util/src/main/java/d3/env/TSAGeoMag.java | TSAGeoMag.getEastIntensity | public double getEastIntensity( double dlat, double dlong, double year, double altitude ) {
"""
Returns the easterly magnetic field intensity from the
Department of Defense geomagnetic model and data
in nano Tesla.
@param dlat Latitude in decimal degrees.
@param dlong Longitude in decimal degrees.
@para... | java | public double getEastIntensity( double dlat, double dlong, double year, double altitude )
{
calcGeoMag( dlat, dlong, year, altitude );
return bx;
} | [
"public",
"double",
"getEastIntensity",
"(",
"double",
"dlat",
",",
"double",
"dlong",
",",
"double",
"year",
",",
"double",
"altitude",
")",
"{",
"calcGeoMag",
"(",
"dlat",
",",
"dlong",
",",
"year",
",",
"altitude",
")",
";",
"return",
"bx",
";",
"}"
] | Returns the easterly magnetic field intensity from the
Department of Defense geomagnetic model and data
in nano Tesla.
@param dlat Latitude in decimal degrees.
@param dlong Longitude in decimal degrees.
@param year Date of the calculation in decimal years.
@param altitude Altitude of the calculation in kilometers... | [
"Returns",
"the",
"easterly",
"magnetic",
"field",
"intensity",
"from",
"the",
"Department",
"of",
"Defense",
"geomagnetic",
"model",
"and",
"data",
"in",
"nano",
"Tesla",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/d3/env/TSAGeoMag.java#L1108-L1112 |
uber/NullAway | nullaway/src/main/java/com/uber/nullaway/NullAway.java | NullAway.constructorInvokesAnother | private boolean constructorInvokesAnother(MethodTree constructor, VisitorState state) {
"""
does the constructor invoke another constructor in the same class via this(...)?
"""
BlockTree body = constructor.getBody();
List<? extends StatementTree> statements = body.getStatements();
if (statements.si... | java | private boolean constructorInvokesAnother(MethodTree constructor, VisitorState state) {
BlockTree body = constructor.getBody();
List<? extends StatementTree> statements = body.getStatements();
if (statements.size() > 0) {
StatementTree statementTree = statements.get(0);
if (isThisCall(statementT... | [
"private",
"boolean",
"constructorInvokesAnother",
"(",
"MethodTree",
"constructor",
",",
"VisitorState",
"state",
")",
"{",
"BlockTree",
"body",
"=",
"constructor",
".",
"getBody",
"(",
")",
";",
"List",
"<",
"?",
"extends",
"StatementTree",
">",
"statements",
... | does the constructor invoke another constructor in the same class via this(...)? | [
"does",
"the",
"constructor",
"invoke",
"another",
"constructor",
"in",
"the",
"same",
"class",
"via",
"this",
"(",
"...",
")",
"?"
] | train | https://github.com/uber/NullAway/blob/c3979b4241f80411dbba6aac3ff653acbb88d00b/nullaway/src/main/java/com/uber/nullaway/NullAway.java#L1571-L1581 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/ImageButton.java | ImageButton.setAttribute | public void setAttribute(String name, String value, String facet)
throws JspException {
"""
Base support for the attribute tag. This is overridden to prevent setting the <code>src</code>
and <code>value</code> attributes
@param name The name of the attribute. This value may not be null or the empt... | java | public void setAttribute(String name, String value, String facet)
throws JspException
{
if (name != null) {
if (name.equals(SRC) || name.equals(VALUE)) {
String s = Bundle.getString("Tags_AttributeMayNotBeSet", new Object[]{name});
registerTagError(s, ... | [
"public",
"void",
"setAttribute",
"(",
"String",
"name",
",",
"String",
"value",
",",
"String",
"facet",
")",
"throws",
"JspException",
"{",
"if",
"(",
"name",
"!=",
"null",
")",
"{",
"if",
"(",
"name",
".",
"equals",
"(",
"SRC",
")",
"||",
"name",
"... | Base support for the attribute tag. This is overridden to prevent setting the <code>src</code>
and <code>value</code> attributes
@param name The name of the attribute. This value may not be null or the empty string.
@param value The value of the attribute. This may contain an expression.
@param facet The name of a ... | [
"Base",
"support",
"for",
"the",
"attribute",
"tag",
".",
"This",
"is",
"overridden",
"to",
"prevent",
"setting",
"the",
"<code",
">",
"src<",
"/",
"code",
">",
"and",
"<code",
">",
"value<",
"/",
"code",
">",
"attributes"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/ImageButton.java#L95-L111 |
dfoerderreuther/console-builder | console-builder/src/main/java/de/eleon/console/builder/AskBuilder.java | AskBuilder.answer | public <T extends Enum<T>> T answer(final Class<T> enumClass, final String validationErrorMessage) {
"""
Return user input as T extends Enum<T>. Complete with enum values.
@param enumClass Class of enum to return
@param validationErrorMessage error message if enum conversion fails
@param <T> the return type
... | java | public <T extends Enum<T>> T answer(final Class<T> enumClass, final String validationErrorMessage) {
validateWith(enumValidator(enumClass, validationErrorMessage));
completeWith(new EnumCompleter(enumClass));
return toEnum(enumClass).apply(answer());
} | [
"public",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"answer",
"(",
"final",
"Class",
"<",
"T",
">",
"enumClass",
",",
"final",
"String",
"validationErrorMessage",
")",
"{",
"validateWith",
"(",
"enumValidator",
"(",
"enumClass",
",",
"validatio... | Return user input as T extends Enum<T>. Complete with enum values.
@param enumClass Class of enum to return
@param validationErrorMessage error message if enum conversion fails
@param <T> the return type
@return user input as enum value | [
"Return",
"user",
"input",
"as",
"T",
"extends",
"Enum<T",
">",
".",
"Complete",
"with",
"enum",
"values",
"."
] | train | https://github.com/dfoerderreuther/console-builder/blob/814bee4a1a812a3a39a9b239e5eccb525b944e65/console-builder/src/main/java/de/eleon/console/builder/AskBuilder.java#L159-L163 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/webapp/Jsp21FacesInitializer.java | Jsp21FacesInitializer.configureResolverForJSP | private void configureResolverForJSP(JspApplicationContext appCtx, RuntimeConfig runtimeConfig) {
"""
Register a phase listener to every lifecycle. This listener will lazy fill the el resolver for jsp as soon as the
first lifecycle is executed. This is necessarry to allow a faces application further setup after M... | java | private void configureResolverForJSP(JspApplicationContext appCtx, RuntimeConfig runtimeConfig)
{
FacesCompositeELResolver facesCompositeELResolver = new FacesCompositeELResolver(Scope.JSP);
appCtx.addELResolver(facesCompositeELResolver);
PhaseListener resolverForJSPInitializer = new Resolve... | [
"private",
"void",
"configureResolverForJSP",
"(",
"JspApplicationContext",
"appCtx",
",",
"RuntimeConfig",
"runtimeConfig",
")",
"{",
"FacesCompositeELResolver",
"facesCompositeELResolver",
"=",
"new",
"FacesCompositeELResolver",
"(",
"Scope",
".",
"JSP",
")",
";",
"appC... | Register a phase listener to every lifecycle. This listener will lazy fill the el resolver for jsp as soon as the
first lifecycle is executed. This is necessarry to allow a faces application further setup after MyFaces has been
initialized. When the first request is processed no further configuation of the el resolvers... | [
"Register",
"a",
"phase",
"listener",
"to",
"every",
"lifecycle",
".",
"This",
"listener",
"will",
"lazy",
"fill",
"the",
"el",
"resolver",
"for",
"jsp",
"as",
"soon",
"as",
"the",
"first",
"lifecycle",
"is",
"executed",
".",
"This",
"is",
"necessarry",
"t... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/webapp/Jsp21FacesInitializer.java#L126-L138 |
xebia-france/xebia-servlet-extras | src/main/java/fr/xebia/servlet/filter/ExpiresFilter.java | ExpiresFilter.onBeforeWriteResponseBody | public void onBeforeWriteResponseBody(HttpServletRequest request, XHttpServletResponse response) {
"""
<p>
If no expiration header has been set by the servlet and an expiration has
been defined in the {@link ExpiresFilter} configuration, sets the '
<tt>Expires</tt>' header and the attribute '<tt>max-age</tt>' o... | java | public void onBeforeWriteResponseBody(HttpServletRequest request, XHttpServletResponse response) {
if (!isEligibleToExpirationHeaderGeneration(request, response)) {
return;
}
Date expirationDate = getExpirationDate(request, response);
if (expirationDate == null) {
... | [
"public",
"void",
"onBeforeWriteResponseBody",
"(",
"HttpServletRequest",
"request",
",",
"XHttpServletResponse",
"response",
")",
"{",
"if",
"(",
"!",
"isEligibleToExpirationHeaderGeneration",
"(",
"request",
",",
"response",
")",
")",
"{",
"return",
";",
"}",
"Dat... | <p>
If no expiration header has been set by the servlet and an expiration has
been defined in the {@link ExpiresFilter} configuration, sets the '
<tt>Expires</tt>' header and the attribute '<tt>max-age</tt>' of the '
<tt>Cache-Control</tt>' header.
</p>
<p>
Must be called on the "Start Write Response Body" event.
</p>
... | [
"<p",
">",
"If",
"no",
"expiration",
"header",
"has",
"been",
"set",
"by",
"the",
"servlet",
"and",
"an",
"expiration",
"has",
"been",
"defined",
"in",
"the",
"{"
] | train | https://github.com/xebia-france/xebia-servlet-extras/blob/b263636fc78f8794dde57d92b835edb5e95ce379/src/main/java/fr/xebia/servlet/filter/ExpiresFilter.java#L1439-L1465 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.