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 |
|---|---|---|---|---|---|---|---|---|---|---|
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/ui/SeaGlassButtonUI.java | SeaGlassButtonUI.paintBackground | void paintBackground(SeaGlassContext context, Graphics g, JComponent c) {
"""
Paint the button background.
@param context the Synth context.
@param g the Graphics context.
@param c the button component.
"""
if (((AbstractButton) c).isContentAreaFilled()) {
context.getPainte... | java | void paintBackground(SeaGlassContext context, Graphics g, JComponent c) {
if (((AbstractButton) c).isContentAreaFilled()) {
context.getPainter().paintButtonBackground(context, g, 0, 0, c.getWidth(), c.getHeight());
}
} | [
"void",
"paintBackground",
"(",
"SeaGlassContext",
"context",
",",
"Graphics",
"g",
",",
"JComponent",
"c",
")",
"{",
"if",
"(",
"(",
"(",
"AbstractButton",
")",
"c",
")",
".",
"isContentAreaFilled",
"(",
")",
")",
"{",
"context",
".",
"getPainter",
"(",
... | Paint the button background.
@param context the Synth context.
@param g the Graphics context.
@param c the button component. | [
"Paint",
"the",
"button",
"background",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/ui/SeaGlassButtonUI.java#L341-L345 |
joniles/mpxj | src/main/java/net/sf/mpxj/RecurringData.java | RecurringData.setWeeklyDay | public void setWeeklyDay(Day day, boolean value) {
"""
Set the state of an individual day in a weekly recurrence.
@param day Day instance
@param value true if this day is included in the recurrence
"""
if (value)
{
m_days.add(day);
}
else
{
m_days.remove(day)... | java | public void setWeeklyDay(Day day, boolean value)
{
if (value)
{
m_days.add(day);
}
else
{
m_days.remove(day);
}
} | [
"public",
"void",
"setWeeklyDay",
"(",
"Day",
"day",
",",
"boolean",
"value",
")",
"{",
"if",
"(",
"value",
")",
"{",
"m_days",
".",
"add",
"(",
"day",
")",
";",
"}",
"else",
"{",
"m_days",
".",
"remove",
"(",
"day",
")",
";",
"}",
"}"
] | Set the state of an individual day in a weekly recurrence.
@param day Day instance
@param value true if this day is included in the recurrence | [
"Set",
"the",
"state",
"of",
"an",
"individual",
"day",
"in",
"a",
"weekly",
"recurrence",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/RecurringData.java#L180-L190 |
aequologica/geppaequo | geppaequo-core/src/main/java/net/aequologica/neo/geppaequo/auth/MethodUtils.java | MethodUtils.getTotalTransformationCost | private static float getTotalTransformationCost(Class<?>[] srcArgs, Class<?>[] destArgs) {
"""
Returns the sum of the object transformation cost for each class in the source
argument list.
@param srcArgs The source arguments
@param destArgs The destination arguments
@return The total transformation cost
""... | java | private static float getTotalTransformationCost(Class<?>[] srcArgs, Class<?>[] destArgs) {
float totalCost = 0.0f;
for (int i = 0; i < srcArgs.length; i++) {
Class<?> srcClass, destClass;
srcClass = srcArgs[i];
destClass = destArgs[i];
totalCost +=... | [
"private",
"static",
"float",
"getTotalTransformationCost",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"srcArgs",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"destArgs",
")",
"{",
"float",
"totalCost",
"=",
"0.0f",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | Returns the sum of the object transformation cost for each class in the source
argument list.
@param srcArgs The source arguments
@param destArgs The destination arguments
@return The total transformation cost | [
"Returns",
"the",
"sum",
"of",
"the",
"object",
"transformation",
"cost",
"for",
"each",
"class",
"in",
"the",
"source",
"argument",
"list",
"."
] | train | https://github.com/aequologica/geppaequo/blob/b72e5f6356535fd045a931f8c544d4a8ea6e35a2/geppaequo-core/src/main/java/net/aequologica/neo/geppaequo/auth/MethodUtils.java#L1103-L1114 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/RedisClient.java | RedisClient.connectSentinel | public <K, V> StatefulRedisSentinelConnection<K, V> connectSentinel(RedisCodec<K, V> codec, RedisURI redisURI) {
"""
Open a connection to a Redis Sentinel using the supplied {@link RedisURI} and use the supplied {@link RedisCodec codec}
to encode/decode keys and values. The client {@link RedisURI} must contain on... | java | public <K, V> StatefulRedisSentinelConnection<K, V> connectSentinel(RedisCodec<K, V> codec, RedisURI redisURI) {
assertNotNull(redisURI);
return getConnection(connectSentinelAsync(codec, redisURI, redisURI.getTimeout()));
} | [
"public",
"<",
"K",
",",
"V",
">",
"StatefulRedisSentinelConnection",
"<",
"K",
",",
"V",
">",
"connectSentinel",
"(",
"RedisCodec",
"<",
"K",
",",
"V",
">",
"codec",
",",
"RedisURI",
"redisURI",
")",
"{",
"assertNotNull",
"(",
"redisURI",
")",
";",
"ret... | Open a connection to a Redis Sentinel using the supplied {@link RedisURI} and use the supplied {@link RedisCodec codec}
to encode/decode keys and values. The client {@link RedisURI} must contain one or more sentinels.
@param codec the Redis server to connect to, must not be {@literal null}
@param redisURI the Redis se... | [
"Open",
"a",
"connection",
"to",
"a",
"Redis",
"Sentinel",
"using",
"the",
"supplied",
"{",
"@link",
"RedisURI",
"}",
"and",
"use",
"the",
"supplied",
"{",
"@link",
"RedisCodec",
"codec",
"}",
"to",
"encode",
"/",
"decode",
"keys",
"and",
"values",
".",
... | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/RedisClient.java#L493-L498 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/util/AbstractLog.java | AbstractLog.note | public void note(JavaFileObject file, String key, Object ... args) {
"""
Provide a non-fatal notification, unless suppressed by the -nowarn option.
@param key The key for the localized notification message.
@param args Fields of the notification message.
"""
note(file, diags.noteKey(key, args));... | java | public void note(JavaFileObject file, String key, Object ... args) {
note(file, diags.noteKey(key, args));
} | [
"public",
"void",
"note",
"(",
"JavaFileObject",
"file",
",",
"String",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"note",
"(",
"file",
",",
"diags",
".",
"noteKey",
"(",
"key",
",",
"args",
")",
")",
";",
"}"
] | Provide a non-fatal notification, unless suppressed by the -nowarn option.
@param key The key for the localized notification message.
@param args Fields of the notification message. | [
"Provide",
"a",
"non",
"-",
"fatal",
"notification",
"unless",
"suppressed",
"by",
"the",
"-",
"nowarn",
"option",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/util/AbstractLog.java#L370-L372 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/SessionsInner.java | SessionsInner.createOrUpdate | public IntegrationAccountSessionInner createOrUpdate(String resourceGroupName, String integrationAccountName, String sessionName, IntegrationAccountSessionInner session) {
"""
Creates or updates an integration account session.
@param resourceGroupName The resource group name.
@param integrationAccountName The ... | java | public IntegrationAccountSessionInner createOrUpdate(String resourceGroupName, String integrationAccountName, String sessionName, IntegrationAccountSessionInner session) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, integrationAccountName, sessionName, session).toBlocking().single().body();... | [
"public",
"IntegrationAccountSessionInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"integrationAccountName",
",",
"String",
"sessionName",
",",
"IntegrationAccountSessionInner",
"session",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",... | Creates or updates an integration account session.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration account name.
@param sessionName The integration account session name.
@param session The integration account session.
@throws IllegalArgumentException thrown if parameters... | [
"Creates",
"or",
"updates",
"an",
"integration",
"account",
"session",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/SessionsInner.java#L442-L444 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/ExtendedPropertyUrl.java | ExtendedPropertyUrl.getExtendedPropertiesUrl | public static MozuUrl getExtendedPropertiesUrl(Boolean draft, String orderId) {
"""
Get Resource Url for GetExtendedProperties
@param draft If true, retrieve the draft version of the order, which might include uncommitted changes to the order or its components.
@param orderId Unique identifier of the order.
@re... | java | public static MozuUrl getExtendedPropertiesUrl(Boolean draft, String orderId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/extendedproperties?draft={draft}");
formatter.formatUrl("draft", draft);
formatter.formatUrl("orderId", orderId);
return new MozuUrl(formatter.getResour... | [
"public",
"static",
"MozuUrl",
"getExtendedPropertiesUrl",
"(",
"Boolean",
"draft",
",",
"String",
"orderId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/orders/{orderId}/extendedproperties?draft={draft}\"",
")",
";",
"formatter"... | Get Resource Url for GetExtendedProperties
@param draft If true, retrieve the draft version of the order, which might include uncommitted changes to the order or its components.
@param orderId Unique identifier of the order.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"GetExtendedProperties"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/ExtendedPropertyUrl.java#L22-L28 |
jenkinsci/java-client-api | jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java | JenkinsServer.createJob | public JenkinsServer createJob(String jobName, String jobXml, Boolean crumbFlag) throws IOException {
"""
Create a job on the server using the provided xml
@param jobName name of the job to be created.
@param jobXml the <code>config.xml</code> which should be used to create
the job.
@param crumbFlag <code>tr... | java | public JenkinsServer createJob(String jobName, String jobXml, Boolean crumbFlag) throws IOException {
return createJob(null, jobName, jobXml, crumbFlag);
} | [
"public",
"JenkinsServer",
"createJob",
"(",
"String",
"jobName",
",",
"String",
"jobXml",
",",
"Boolean",
"crumbFlag",
")",
"throws",
"IOException",
"{",
"return",
"createJob",
"(",
"null",
",",
"jobName",
",",
"jobXml",
",",
"crumbFlag",
")",
";",
"}"
] | Create a job on the server using the provided xml
@param jobName name of the job to be created.
@param jobXml the <code>config.xml</code> which should be used to create
the job.
@param crumbFlag <code>true</code> to add <b>crumbIssuer</b>
<code>false</code> otherwise.
@throws IOException in case of an error. | [
"Create",
"a",
"job",
"on",
"the",
"server",
"using",
"the",
"provided",
"xml"
] | train | https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java#L358-L360 |
mikepenz/FastAdapter | library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java | FastAdapter.saveInstanceState | public Bundle saveInstanceState(@Nullable Bundle savedInstanceState, String prefix) {
"""
add the values to the bundle for saveInstanceState
@param savedInstanceState If the activity is being re-initialized after
previously being shut down then this Bundle contains the data it most
recently supplied in Note: ... | java | public Bundle saveInstanceState(@Nullable Bundle savedInstanceState, String prefix) {
// handle our extensions
for (IAdapterExtension<Item> ext : mExtensions.values()) {
ext.saveInstanceState(savedInstanceState, prefix);
}
return savedInstanceState;
} | [
"public",
"Bundle",
"saveInstanceState",
"(",
"@",
"Nullable",
"Bundle",
"savedInstanceState",
",",
"String",
"prefix",
")",
"{",
"// handle our extensions",
"for",
"(",
"IAdapterExtension",
"<",
"Item",
">",
"ext",
":",
"mExtensions",
".",
"values",
"(",
")",
"... | add the values to the bundle for saveInstanceState
@param savedInstanceState If the activity is being re-initialized after
previously being shut down then this Bundle contains the data it most
recently supplied in Note: Otherwise it is null.
@param prefix a prefix added to the savedInstance key so we can s... | [
"add",
"the",
"values",
"to",
"the",
"bundle",
"for",
"saveInstanceState"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L1017-L1023 |
intellimate/Izou | src/main/java/org/intellimate/izou/resource/ResourceManager.java | ResourceManager.generatedResource | @Deprecated
public void generatedResource(ResourceModel resource, Consumer<List<ResourceModel>> consumer) throws IllegalIDException {
"""
generates a resources
<p>
It will use the first matching resource! So if you really want to be sure, set the provider
Identification
</p>
@param resource the resource t... | java | @Deprecated
public void generatedResource(ResourceModel resource, Consumer<List<ResourceModel>> consumer) throws IllegalIDException {
generateResource(resource)
.ifPresent(completableFuture -> completableFuture.thenAccept(consumer));
} | [
"@",
"Deprecated",
"public",
"void",
"generatedResource",
"(",
"ResourceModel",
"resource",
",",
"Consumer",
"<",
"List",
"<",
"ResourceModel",
">",
">",
"consumer",
")",
"throws",
"IllegalIDException",
"{",
"generateResource",
"(",
"resource",
")",
".",
"ifPresen... | generates a resources
<p>
It will use the first matching resource! So if you really want to be sure, set the provider
Identification
</p>
@param resource the resource to request
@param consumer the callback when the ResourceBuilder finishes
@throws IllegalIDException not yet implemented | [
"generates",
"a",
"resources",
"<p",
">",
"It",
"will",
"use",
"the",
"first",
"matching",
"resource!",
"So",
"if",
"you",
"really",
"want",
"to",
"be",
"sure",
"set",
"the",
"provider",
"Identification",
"<",
"/",
"p",
">"
] | train | https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/resource/ResourceManager.java#L96-L100 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java | ComputerVisionImpl.generateThumbnailInStreamAsync | public Observable<InputStream> generateThumbnailInStreamAsync(int width, int height, byte[] image, GenerateThumbnailInStreamOptionalParameter generateThumbnailInStreamOptionalParameter) {
"""
This operation generates a thumbnail image with the user-specified width and height. By default, the service analyzes the i... | java | public Observable<InputStream> generateThumbnailInStreamAsync(int width, int height, byte[] image, GenerateThumbnailInStreamOptionalParameter generateThumbnailInStreamOptionalParameter) {
return generateThumbnailInStreamWithServiceResponseAsync(width, height, image, generateThumbnailInStreamOptionalParameter).m... | [
"public",
"Observable",
"<",
"InputStream",
">",
"generateThumbnailInStreamAsync",
"(",
"int",
"width",
",",
"int",
"height",
",",
"byte",
"[",
"]",
"image",
",",
"GenerateThumbnailInStreamOptionalParameter",
"generateThumbnailInStreamOptionalParameter",
")",
"{",
"return... | This operation generates a thumbnail image with the user-specified width and height. By default, the service analyzes the image, identifies the region of interest (ROI), and generates smart cropping coordinates based on the ROI. Smart cropping helps when you specify an aspect ratio that differs from that of the input i... | [
"This",
"operation",
"generates",
"a",
"thumbnail",
"image",
"with",
"the",
"user",
"-",
"specified",
"width",
"and",
"height",
".",
"By",
"default",
"the",
"service",
"analyzes",
"the",
"image",
"identifies",
"the",
"region",
"of",
"interest",
"(",
"ROI",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L934-L941 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/CoGroupedStreams.java | CoGroupedStreams.where | public <KEY> Where<KEY> where(KeySelector<T1, KEY> keySelector) {
"""
Specifies a {@link KeySelector} for elements from the first input.
@param keySelector The KeySelector to be used for extracting the first input's key for partitioning.
"""
Preconditions.checkNotNull(keySelector);
final TypeInformation... | java | public <KEY> Where<KEY> where(KeySelector<T1, KEY> keySelector) {
Preconditions.checkNotNull(keySelector);
final TypeInformation<KEY> keyType = TypeExtractor.getKeySelectorTypes(keySelector, input1.getType());
return where(keySelector, keyType);
} | [
"public",
"<",
"KEY",
">",
"Where",
"<",
"KEY",
">",
"where",
"(",
"KeySelector",
"<",
"T1",
",",
"KEY",
">",
"keySelector",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"keySelector",
")",
";",
"final",
"TypeInformation",
"<",
"KEY",
">",
"keyTy... | Specifies a {@link KeySelector} for elements from the first input.
@param keySelector The KeySelector to be used for extracting the first input's key for partitioning. | [
"Specifies",
"a",
"{",
"@link",
"KeySelector",
"}",
"for",
"elements",
"from",
"the",
"first",
"input",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/CoGroupedStreams.java#L104-L108 |
noboomu/proteus | core/src/main/java/io/sinistral/proteus/ProteusApplication.java | ProteusApplication.setServerConfigurationFunction | public ProteusApplication setServerConfigurationFunction(Function<Undertow.Builder, Undertow.Builder> serverConfigurationFunction) {
"""
Allows direct access to the Undertow.Builder for custom configuration
@param serverConfigurationFunction the serverConfigurationFunction
"""
this.serverConfigurati... | java | public ProteusApplication setServerConfigurationFunction(Function<Undertow.Builder, Undertow.Builder> serverConfigurationFunction)
{
this.serverConfigurationFunction = serverConfigurationFunction;
return this;
} | [
"public",
"ProteusApplication",
"setServerConfigurationFunction",
"(",
"Function",
"<",
"Undertow",
".",
"Builder",
",",
"Undertow",
".",
"Builder",
">",
"serverConfigurationFunction",
")",
"{",
"this",
".",
"serverConfigurationFunction",
"=",
"serverConfigurationFunction",... | Allows direct access to the Undertow.Builder for custom configuration
@param serverConfigurationFunction the serverConfigurationFunction | [
"Allows",
"direct",
"access",
"to",
"the",
"Undertow",
".",
"Builder",
"for",
"custom",
"configuration"
] | train | https://github.com/noboomu/proteus/blob/9bf999e19e9b491b13912f3ee0e3fbefdbacc509/core/src/main/java/io/sinistral/proteus/ProteusApplication.java#L465-L469 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric_ca/sdk/HFCAAffiliation.java | HFCAAffiliation.createDecendent | public HFCAAffiliation createDecendent(String name) throws InvalidArgumentException, AffiliationException {
"""
The identities affected during request
@param name Name of the child affiliation
@return The requested child affiliation
@throws InvalidArgumentException
@throws AffiliationException
"""
... | java | public HFCAAffiliation createDecendent(String name) throws InvalidArgumentException, AffiliationException {
if (this.deleted) {
throw new AffiliationException("Affiliation has been deleted");
}
validateAffiliationNames(name);
return new HFCAAffiliation(this.name + "." + name,... | [
"public",
"HFCAAffiliation",
"createDecendent",
"(",
"String",
"name",
")",
"throws",
"InvalidArgumentException",
",",
"AffiliationException",
"{",
"if",
"(",
"this",
".",
"deleted",
")",
"{",
"throw",
"new",
"AffiliationException",
"(",
"\"Affiliation has been deleted\... | The identities affected during request
@param name Name of the child affiliation
@return The requested child affiliation
@throws InvalidArgumentException
@throws AffiliationException | [
"The",
"identities",
"affected",
"during",
"request",
"@param",
"name",
"Name",
"of",
"the",
"child",
"affiliation"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric_ca/sdk/HFCAAffiliation.java#L147-L153 |
kaichunlin/android-transition | core/src/main/java/com/kaichunlin/transition/internal/TransitionControllerManager.java | TransitionControllerManager.addAnimatorAsTransition | public TransitionController addAnimatorAsTransition(@NonNull Animator mAnim) {
"""
Adds an Animator as {@link TransitionController}
@param mAnim
@return
"""
AnimatorSet as = new AnimatorSet();
as.play(mAnim);
return addAnimatorSetAsTransition(null, as);
} | java | public TransitionController addAnimatorAsTransition(@NonNull Animator mAnim) {
AnimatorSet as = new AnimatorSet();
as.play(mAnim);
return addAnimatorSetAsTransition(null, as);
} | [
"public",
"TransitionController",
"addAnimatorAsTransition",
"(",
"@",
"NonNull",
"Animator",
"mAnim",
")",
"{",
"AnimatorSet",
"as",
"=",
"new",
"AnimatorSet",
"(",
")",
";",
"as",
".",
"play",
"(",
"mAnim",
")",
";",
"return",
"addAnimatorSetAsTransition",
"("... | Adds an Animator as {@link TransitionController}
@param mAnim
@return | [
"Adds",
"an",
"Animator",
"as",
"{",
"@link",
"TransitionController",
"}"
] | train | https://github.com/kaichunlin/android-transition/blob/7b53074206622f5cf5d82091d891a7ed8b9f06cd/core/src/main/java/com/kaichunlin/transition/internal/TransitionControllerManager.java#L40-L44 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java | BpmnParse.setActivityAsyncDelegates | protected void setActivityAsyncDelegates(final ActivityImpl activity) {
"""
Sets the delegates for the activity, which will be called
if the attribute asyncAfter or asyncBefore was changed.
@param activity the activity which gets the delegates
"""
activity.setDelegateAsyncAfterUpdate(new ActivityImpl.A... | java | protected void setActivityAsyncDelegates(final ActivityImpl activity) {
activity.setDelegateAsyncAfterUpdate(new ActivityImpl.AsyncAfterUpdate() {
@Override
public void updateAsyncAfter(boolean asyncAfter, boolean exclusive) {
if (asyncAfter) {
addMessageJobDeclaration(new AsyncAfterMe... | [
"protected",
"void",
"setActivityAsyncDelegates",
"(",
"final",
"ActivityImpl",
"activity",
")",
"{",
"activity",
".",
"setDelegateAsyncAfterUpdate",
"(",
"new",
"ActivityImpl",
".",
"AsyncAfterUpdate",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"updateAsyncAft... | Sets the delegates for the activity, which will be called
if the attribute asyncAfter or asyncBefore was changed.
@param activity the activity which gets the delegates | [
"Sets",
"the",
"delegates",
"for",
"the",
"activity",
"which",
"will",
"be",
"called",
"if",
"the",
"attribute",
"asyncAfter",
"or",
"asyncBefore",
"was",
"changed",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L1797-L1819 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark-nlp/src/main/java/org/deeplearning4j/spark/models/embeddings/word2vec/Word2VecPerformerVoid.java | Word2VecPerformerVoid.trainSentence | public void trainSentence(final List<VocabWord> sentence, double alpha) {
"""
Train on a list of vocab words
@param sentence the list of vocab words to train on
"""
if (sentence != null && !sentence.isEmpty()) {
for (int i = 0; i < sentence.size(); i++) {
if (!sentence.get(... | java | public void trainSentence(final List<VocabWord> sentence, double alpha) {
if (sentence != null && !sentence.isEmpty()) {
for (int i = 0; i < sentence.size(); i++) {
if (!sentence.get(i).getWord().endsWith("STOP")) {
nextRandom.set(nextRandom.get() * 25214903917L +... | [
"public",
"void",
"trainSentence",
"(",
"final",
"List",
"<",
"VocabWord",
">",
"sentence",
",",
"double",
"alpha",
")",
"{",
"if",
"(",
"sentence",
"!=",
"null",
"&&",
"!",
"sentence",
".",
"isEmpty",
"(",
")",
")",
"{",
"for",
"(",
"int",
"i",
"=",... | Train on a list of vocab words
@param sentence the list of vocab words to train on | [
"Train",
"on",
"a",
"list",
"of",
"vocab",
"words"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark-nlp/src/main/java/org/deeplearning4j/spark/models/embeddings/word2vec/Word2VecPerformerVoid.java#L247-L257 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/AbstractDb.java | AbstractDb.query | public List<Entity> query(String sql, Object... params) throws SQLException {
"""
查询
@param sql 查询语句
@param params 参数
@return 结果对象
@throws SQLException SQL执行异常
@since 3.1.1
"""
return query(sql, new EntityListHandler(), params);
} | java | public List<Entity> query(String sql, Object... params) throws SQLException {
return query(sql, new EntityListHandler(), params);
} | [
"public",
"List",
"<",
"Entity",
">",
"query",
"(",
"String",
"sql",
",",
"Object",
"...",
"params",
")",
"throws",
"SQLException",
"{",
"return",
"query",
"(",
"sql",
",",
"new",
"EntityListHandler",
"(",
")",
",",
"params",
")",
";",
"}"
] | 查询
@param sql 查询语句
@param params 参数
@return 结果对象
@throws SQLException SQL执行异常
@since 3.1.1 | [
"查询"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/AbstractDb.java#L78-L80 |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/ForkedJvm.java | ForkedJvm._getResourceSource | @Nullable
private static File _getResourceSource (final String resource, final ClassLoader loader) {
"""
Gets the JAR file or directory that contains the specified resource.
@param resource
The absolute name of the resource to find, may be <code>null</code>.
@param loader
The class loader to use for search... | java | @Nullable
private static File _getResourceSource (final String resource, final ClassLoader loader)
{
if (resource != null)
{
URL url;
if (loader != null)
{
url = loader.getResource (resource);
}
else
{
url = ClassLoader.getSystemResource (resource);
... | [
"@",
"Nullable",
"private",
"static",
"File",
"_getResourceSource",
"(",
"final",
"String",
"resource",
",",
"final",
"ClassLoader",
"loader",
")",
"{",
"if",
"(",
"resource",
"!=",
"null",
")",
"{",
"URL",
"url",
";",
"if",
"(",
"loader",
"!=",
"null",
... | Gets the JAR file or directory that contains the specified resource.
@param resource
The absolute name of the resource to find, may be <code>null</code>.
@param loader
The class loader to use for searching the resource, may be
<code>null</code>.
@return The absolute path to the resource location or <code>null</code> i... | [
"Gets",
"the",
"JAR",
"file",
"or",
"directory",
"that",
"contains",
"the",
"specified",
"resource",
"."
] | train | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/ForkedJvm.java#L234-L251 |
lawloretienne/ImageGallery | library/src/main/java/com/etiennelawlor/imagegallery/library/ui/TouchImageView.java | TouchImageView.getZoomedRect | public RectF getZoomedRect() {
"""
Return a Rect representing the zoomed image.
@return rect representing zoomed image
"""
if (mScaleType == ScaleType.FIT_XY) {
throw new UnsupportedOperationException("getZoomedRect() not supported with FIT_XY");
}
PointF topLeft = transf... | java | public RectF getZoomedRect() {
if (mScaleType == ScaleType.FIT_XY) {
throw new UnsupportedOperationException("getZoomedRect() not supported with FIT_XY");
}
PointF topLeft = transformCoordTouchToBitmap(0, 0, true);
PointF bottomRight = transformCoordTouchToBitmap(viewWidth, v... | [
"public",
"RectF",
"getZoomedRect",
"(",
")",
"{",
"if",
"(",
"mScaleType",
"==",
"ScaleType",
".",
"FIT_XY",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"getZoomedRect() not supported with FIT_XY\"",
")",
";",
"}",
"PointF",
"topLeft",
"=",
... | Return a Rect representing the zoomed image.
@return rect representing zoomed image | [
"Return",
"a",
"Rect",
"representing",
"the",
"zoomed",
"image",
"."
] | train | https://github.com/lawloretienne/ImageGallery/blob/960d68dfb2b81d05322a576723ac4f090e10eda7/library/src/main/java/com/etiennelawlor/imagegallery/library/ui/TouchImageView.java#L221-L231 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.getTopology | public TopologyInner getTopology(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) {
"""
Gets the current network topology by resource group.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param parameters ... | java | public TopologyInner getTopology(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) {
return getTopologyWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body();
} | [
"public",
"TopologyInner",
"getTopology",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"TopologyParameters",
"parameters",
")",
"{",
"return",
"getTopologyWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"networkWatcherName",
",",
"... | Gets the current network topology by resource group.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param parameters Parameters that define the representation of topology.
@throws IllegalArgumentException thrown if parameters fail the validation
@th... | [
"Gets",
"the",
"current",
"network",
"topology",
"by",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L866-L868 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java | JobsImpl.listFromJobScheduleWithServiceResponseAsync | public Observable<ServiceResponseWithHeaders<Page<CloudJob>, JobListFromJobScheduleHeaders>> listFromJobScheduleWithServiceResponseAsync(final String jobScheduleId, final JobListFromJobScheduleOptions jobListFromJobScheduleOptions) {
"""
Lists the jobs that have been created under the specified job schedule.
@p... | java | public Observable<ServiceResponseWithHeaders<Page<CloudJob>, JobListFromJobScheduleHeaders>> listFromJobScheduleWithServiceResponseAsync(final String jobScheduleId, final JobListFromJobScheduleOptions jobListFromJobScheduleOptions) {
return listFromJobScheduleSinglePageAsync(jobScheduleId, jobListFromJobSchedul... | [
"public",
"Observable",
"<",
"ServiceResponseWithHeaders",
"<",
"Page",
"<",
"CloudJob",
">",
",",
"JobListFromJobScheduleHeaders",
">",
">",
"listFromJobScheduleWithServiceResponseAsync",
"(",
"final",
"String",
"jobScheduleId",
",",
"final",
"JobListFromJobScheduleOptions",... | Lists the jobs that have been created under the specified job schedule.
@param jobScheduleId The ID of the job schedule from which you want to get a list of jobs.
@param jobListFromJobScheduleOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@retu... | [
"Lists",
"the",
"jobs",
"that",
"have",
"been",
"created",
"under",
"the",
"specified",
"job",
"schedule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L2706-L2725 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java | BeanUtil.copyProperties | public static void copyProperties(Object source, Object target, CopyOptions copyOptions) {
"""
复制Bean对象属性<br>
限制类用于限制拷贝的属性,例如一个类我只想复制其父类的一些属性,就可以将editable设置为父类
@param source 源Bean对象
@param target 目标Bean对象
@param copyOptions 拷贝选项,见 {@link CopyOptions}
"""
if (null == copyOptions) {
copyOptions = ne... | java | public static void copyProperties(Object source, Object target, CopyOptions copyOptions) {
if (null == copyOptions) {
copyOptions = new CopyOptions();
}
BeanCopier.create(source, target, copyOptions).copy();
} | [
"public",
"static",
"void",
"copyProperties",
"(",
"Object",
"source",
",",
"Object",
"target",
",",
"CopyOptions",
"copyOptions",
")",
"{",
"if",
"(",
"null",
"==",
"copyOptions",
")",
"{",
"copyOptions",
"=",
"new",
"CopyOptions",
"(",
")",
";",
"}",
"Be... | 复制Bean对象属性<br>
限制类用于限制拷贝的属性,例如一个类我只想复制其父类的一些属性,就可以将editable设置为父类
@param source 源Bean对象
@param target 目标Bean对象
@param copyOptions 拷贝选项,见 {@link CopyOptions} | [
"复制Bean对象属性<br",
">",
"限制类用于限制拷贝的属性,例如一个类我只想复制其父类的一些属性,就可以将editable设置为父类"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java#L617-L622 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java | FormatUtil.appendZeros | public static StringBuilder appendZeros(StringBuilder buf, int zeros) {
"""
Append zeros to a buffer.
@param buf Buffer to append to
@param zeros Number of zeros to append.
@return Buffer
"""
for(int i = zeros; i > 0; i -= ZEROPADDING.length) {
buf.append(ZEROPADDING, 0, i < ZEROPADDING.length ?... | java | public static StringBuilder appendZeros(StringBuilder buf, int zeros) {
for(int i = zeros; i > 0; i -= ZEROPADDING.length) {
buf.append(ZEROPADDING, 0, i < ZEROPADDING.length ? i : ZEROPADDING.length);
}
return buf;
} | [
"public",
"static",
"StringBuilder",
"appendZeros",
"(",
"StringBuilder",
"buf",
",",
"int",
"zeros",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"zeros",
";",
"i",
">",
"0",
";",
"i",
"-=",
"ZEROPADDING",
".",
"length",
")",
"{",
"buf",
".",
"append",
"(... | Append zeros to a buffer.
@param buf Buffer to append to
@param zeros Number of zeros to append.
@return Buffer | [
"Append",
"zeros",
"to",
"a",
"buffer",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L975-L980 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/validation/rules/AttributeConstraintRule.java | AttributeConstraintRule.validateMinValue | private boolean validateMinValue(Object validationObject, Annotation annotate) {
"""
Checks whether a given value is greater than given min value or not
@param validationObject
@param annotate
@return
"""
if (checkNullObject(validationObject))
{
return true;
}
... | java | private boolean validateMinValue(Object validationObject, Annotation annotate)
{
if (checkNullObject(validationObject))
{
return true;
}
Long minValue = ((Min) annotate).value();
if (checkvalidDigitTypes(validationObject.getClass()))
{
if ((Nu... | [
"private",
"boolean",
"validateMinValue",
"(",
"Object",
"validationObject",
",",
"Annotation",
"annotate",
")",
"{",
"if",
"(",
"checkNullObject",
"(",
"validationObject",
")",
")",
"{",
"return",
"true",
";",
"}",
"Long",
"minValue",
"=",
"(",
"(",
"Min",
... | Checks whether a given value is greater than given min value or not
@param validationObject
@param annotate
@return | [
"Checks",
"whether",
"a",
"given",
"value",
"is",
"greater",
"than",
"given",
"min",
"value",
"or",
"not"
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/validation/rules/AttributeConstraintRule.java#L401-L419 |
finmath/finmath-lib | src/main/java/net/finmath/marketdata/model/curves/DiscountCurveInterpolation.java | DiscountCurveInterpolation.createDiscountCurveFromZeroRates | @Deprecated
public static DiscountCurveInterpolation createDiscountCurveFromZeroRates(
String name,
double[] times, double[] givenZeroRates, boolean[] isParameter,
InterpolationMethod interpolationMethod, ExtrapolationMethod extrapolationMethod, InterpolationEntity interpolationEntity) {
"""
Create a dis... | java | @Deprecated
public static DiscountCurveInterpolation createDiscountCurveFromZeroRates(
String name,
double[] times, double[] givenZeroRates, boolean[] isParameter,
InterpolationMethod interpolationMethod, ExtrapolationMethod extrapolationMethod, InterpolationEntity interpolationEntity) {
return createDisco... | [
"@",
"Deprecated",
"public",
"static",
"DiscountCurveInterpolation",
"createDiscountCurveFromZeroRates",
"(",
"String",
"name",
",",
"double",
"[",
"]",
"times",
",",
"double",
"[",
"]",
"givenZeroRates",
",",
"boolean",
"[",
"]",
"isParameter",
",",
"InterpolationM... | Create a discount curve from given times and given zero rates using given interpolation and extrapolation methods.
The discount factor is determined by
<code>
givenDiscountFactors[timeIndex] = Math.exp(- givenZeroRates[timeIndex] * times[timeIndex]);
</code>
@param name The name of this discount curve.
@param times Ar... | [
"Create",
"a",
"discount",
"curve",
"from",
"given",
"times",
"and",
"given",
"zero",
"rates",
"using",
"given",
"interpolation",
"and",
"extrapolation",
"methods",
".",
"The",
"discount",
"factor",
"is",
"determined",
"by",
"<code",
">",
"givenDiscountFactors",
... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/marketdata/model/curves/DiscountCurveInterpolation.java#L239-L246 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/quotes/OrderItemUrl.java | OrderItemUrl.deleteQuoteItemUrl | public static MozuUrl deleteQuoteItemUrl(String quoteId, String quoteItemId) {
"""
Get Resource Url for DeleteQuoteItem
@param quoteId
@param quoteItemId
@return String Resource Url
"""
UrlFormatter formatter = new UrlFormatter("/api/commerce/quotes/{quoteId}/items/{quoteItemId}");
formatter.formatUrl... | java | public static MozuUrl deleteQuoteItemUrl(String quoteId, String quoteItemId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/quotes/{quoteId}/items/{quoteItemId}");
formatter.formatUrl("quoteId", quoteId);
formatter.formatUrl("quoteItemId", quoteItemId);
return new MozuUrl(formatter.getResourceUrl()... | [
"public",
"static",
"MozuUrl",
"deleteQuoteItemUrl",
"(",
"String",
"quoteId",
",",
"String",
"quoteItemId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/quotes/{quoteId}/items/{quoteItemId}\"",
")",
";",
"formatter",
".",
"fo... | Get Resource Url for DeleteQuoteItem
@param quoteId
@param quoteItemId
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"DeleteQuoteItem"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/quotes/OrderItemUrl.java#L114-L120 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/kits/WalletAppKit.java | WalletAppKit.connectToLocalHost | public WalletAppKit connectToLocalHost() {
"""
Will only connect to localhost. Cannot be called after startup.
"""
try {
final InetAddress localHost = InetAddress.getLocalHost();
return setPeerNodes(new PeerAddress(params, localHost, params.getPort()));
} catch (UnknownH... | java | public WalletAppKit connectToLocalHost() {
try {
final InetAddress localHost = InetAddress.getLocalHost();
return setPeerNodes(new PeerAddress(params, localHost, params.getPort()));
} catch (UnknownHostException e) {
// Borked machine with no loopback adapter configur... | [
"public",
"WalletAppKit",
"connectToLocalHost",
"(",
")",
"{",
"try",
"{",
"final",
"InetAddress",
"localHost",
"=",
"InetAddress",
".",
"getLocalHost",
"(",
")",
";",
"return",
"setPeerNodes",
"(",
"new",
"PeerAddress",
"(",
"params",
",",
"localHost",
",",
"... | Will only connect to localhost. Cannot be called after startup. | [
"Will",
"only",
"connect",
"to",
"localhost",
".",
"Cannot",
"be",
"called",
"after",
"startup",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/kits/WalletAppKit.java#L129-L137 |
threerings/narya | core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java | PresentsDObjectMgr.objectRemoved | public boolean objectRemoved (DEvent event, DObject target) {
"""
Called as a helper for <code>ObjectRemovedEvent</code> events. It updates the object/oid
list tracking structures.
@return true if the event should be dispatched, false if it should be aborted.
"""
ObjectRemovedEvent ore = (ObjectRem... | java | public boolean objectRemoved (DEvent event, DObject target)
{
ObjectRemovedEvent ore = (ObjectRemovedEvent)event;
String field = ore.getName();
int toid = target.getOid();
int oid = ore.getOid();
// log.info("Processing object removed", "from", toid, "roid", toid);
/... | [
"public",
"boolean",
"objectRemoved",
"(",
"DEvent",
"event",
",",
"DObject",
"target",
")",
"{",
"ObjectRemovedEvent",
"ore",
"=",
"(",
"ObjectRemovedEvent",
")",
"event",
";",
"String",
"field",
"=",
"ore",
".",
"getName",
"(",
")",
";",
"int",
"toid",
"... | Called as a helper for <code>ObjectRemovedEvent</code> events. It updates the object/oid
list tracking structures.
@return true if the event should be dispatched, false if it should be aborted. | [
"Called",
"as",
"a",
"helper",
"for",
"<code",
">",
"ObjectRemovedEvent<",
"/",
"code",
">",
"events",
".",
"It",
"updates",
"the",
"object",
"/",
"oid",
"list",
"tracking",
"structures",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java#L596-L630 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/machinelearning/ensemblelearning/FixedCombinationRules.java | FixedCombinationRules.majorityVote | public static AssociativeArray majorityVote(DataTable2D classifierClassProbabilityMatrix) {
"""
Combines the responses of the classifiers by summing the votes of each
winner class.
@param classifierClassProbabilityMatrix
@return
"""
AssociativeArray combinedClassProbabilities = new AssociativeArra... | java | public static AssociativeArray majorityVote(DataTable2D classifierClassProbabilityMatrix) {
AssociativeArray combinedClassProbabilities = new AssociativeArray();
//extract all the classes first
for(Map.Entry<Object, AssociativeArray> entry : classifierClassProbabilityMatrix.entrySet())... | [
"public",
"static",
"AssociativeArray",
"majorityVote",
"(",
"DataTable2D",
"classifierClassProbabilityMatrix",
")",
"{",
"AssociativeArray",
"combinedClassProbabilities",
"=",
"new",
"AssociativeArray",
"(",
")",
";",
"//extract all the classes first",
"for",
"(",
"Map",
"... | Combines the responses of the classifiers by summing the votes of each
winner class.
@param classifierClassProbabilityMatrix
@return | [
"Combines",
"the",
"responses",
"of",
"the",
"classifiers",
"by",
"summing",
"the",
"votes",
"of",
"each",
"winner",
"class",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/machinelearning/ensemblelearning/FixedCombinationRules.java#L261-L292 |
google/closure-compiler | src/com/google/javascript/jscomp/PeepholeRemoveDeadCode.java | PeepholeRemoveDeadCode.removeCase | private void removeCase(Node switchNode, Node caseNode) {
"""
Remove the case from the switch redeclaring any variables declared in it.
@param caseNode The case to remove.
"""
NodeUtil.redeclareVarsInsideBranch(caseNode);
switchNode.removeChild(caseNode);
reportChangeToEnclosingScope(switchNode);
... | java | private void removeCase(Node switchNode, Node caseNode) {
NodeUtil.redeclareVarsInsideBranch(caseNode);
switchNode.removeChild(caseNode);
reportChangeToEnclosingScope(switchNode);
} | [
"private",
"void",
"removeCase",
"(",
"Node",
"switchNode",
",",
"Node",
"caseNode",
")",
"{",
"NodeUtil",
".",
"redeclareVarsInsideBranch",
"(",
"caseNode",
")",
";",
"switchNode",
".",
"removeChild",
"(",
"caseNode",
")",
";",
"reportChangeToEnclosingScope",
"("... | Remove the case from the switch redeclaring any variables declared in it.
@param caseNode The case to remove. | [
"Remove",
"the",
"case",
"from",
"the",
"switch",
"redeclaring",
"any",
"variables",
"declared",
"in",
"it",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/PeepholeRemoveDeadCode.java#L651-L655 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/FileUtils.java | FileUtils.toElement | public static Element toElement(final String aFilePath, final boolean aBool) throws FileNotFoundException,
ParserConfigurationException {
"""
Creates an <code>Element</code> that describes the supplied file or directory (and, possibly, all its
subdirectories). Includes absolute path, last modified tim... | java | public static Element toElement(final String aFilePath, final boolean aBool) throws FileNotFoundException,
ParserConfigurationException {
return toElement(aFilePath, WILDCARD, aBool);
} | [
"public",
"static",
"Element",
"toElement",
"(",
"final",
"String",
"aFilePath",
",",
"final",
"boolean",
"aBool",
")",
"throws",
"FileNotFoundException",
",",
"ParserConfigurationException",
"{",
"return",
"toElement",
"(",
"aFilePath",
",",
"WILDCARD",
",",
"aBool... | Creates an <code>Element</code> that describes the supplied file or directory (and, possibly, all its
subdirectories). Includes absolute path, last modified time, read/write permissions, etc.
@param aFilePath A file system path to turn into XML
@param aBool A boolean indicating whether the XML should contain more than... | [
"Creates",
"an",
"<code",
">",
"Element<",
"/",
"code",
">",
"that",
"describes",
"the",
"supplied",
"file",
"or",
"directory",
"(",
"and",
"possibly",
"all",
"its",
"subdirectories",
")",
".",
"Includes",
"absolute",
"path",
"last",
"modified",
"time",
"rea... | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/FileUtils.java#L107-L110 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java | BigtableDataClient.readRow | public Row readRow(String tableId, String rowKey, @Nullable Filter filter) {
"""
Convenience method for synchronously reading a single row. If the row does not exist, the value
will be null.
<p>Sample code:
<pre>{@code
try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[IN... | java | public Row readRow(String tableId, String rowKey, @Nullable Filter filter) {
return ApiExceptions.callAndTranslateApiException(
readRowAsync(tableId, ByteString.copyFromUtf8(rowKey), filter));
} | [
"public",
"Row",
"readRow",
"(",
"String",
"tableId",
",",
"String",
"rowKey",
",",
"@",
"Nullable",
"Filter",
"filter",
")",
"{",
"return",
"ApiExceptions",
".",
"callAndTranslateApiException",
"(",
"readRowAsync",
"(",
"tableId",
",",
"ByteString",
".",
"copyF... | Convenience method for synchronously reading a single row. If the row does not exist, the value
will be null.
<p>Sample code:
<pre>{@code
try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
String tableId = "[TABLE]";
// Build the filter expression
Filter filter = FIL... | [
"Convenience",
"method",
"for",
"synchronously",
"reading",
"a",
"single",
"row",
".",
"If",
"the",
"row",
"does",
"not",
"exist",
"the",
"value",
"will",
"be",
"null",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java#L235-L238 |
tvesalainen/util | util/src/main/java/org/vesalainen/math/Circles.java | Circles.isInside | public static boolean isInside(Circle circle, double x, double y) {
"""
Returns true if point (x, y) is inside circle
@param circle
@param x
@param y
@return
"""
return distanceFromCenter(circle, x, y) < circle.getRadius();
} | java | public static boolean isInside(Circle circle, double x, double y)
{
return distanceFromCenter(circle, x, y) < circle.getRadius();
} | [
"public",
"static",
"boolean",
"isInside",
"(",
"Circle",
"circle",
",",
"double",
"x",
",",
"double",
"y",
")",
"{",
"return",
"distanceFromCenter",
"(",
"circle",
",",
"x",
",",
"y",
")",
"<",
"circle",
".",
"getRadius",
"(",
")",
";",
"}"
] | Returns true if point (x, y) is inside circle
@param circle
@param x
@param y
@return | [
"Returns",
"true",
"if",
"point",
"(",
"x",
"y",
")",
"is",
"inside",
"circle"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/Circles.java#L50-L53 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/MutableArray.java | MutableArray.setValue | @NonNull
@Override
public MutableArray setValue(int index, Object value) {
"""
Set an object at the given index.
@param index the index. This value must not exceed the bounds of the array.
@param value the object
@return The self object
"""
synchronized (lock) {
if (Fleece.valu... | java | @NonNull
@Override
public MutableArray setValue(int index, Object value) {
synchronized (lock) {
if (Fleece.valueWouldChange(value, internalArray.get(index), internalArray)
&& (!internalArray.set(index, Fleece.toCBLObject(value)))) {
throwRangeException(index)... | [
"@",
"NonNull",
"@",
"Override",
"public",
"MutableArray",
"setValue",
"(",
"int",
"index",
",",
"Object",
"value",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"Fleece",
".",
"valueWouldChange",
"(",
"value",
",",
"internalArray",
".",
"get... | Set an object at the given index.
@param index the index. This value must not exceed the bounds of the array.
@param value the object
@return The self object | [
"Set",
"an",
"object",
"at",
"the",
"given",
"index",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L98-L108 |
unbescape/unbescape | src/main/java/org/unbescape/java/JavaEscape.java | JavaEscape.escapeJava | public static void escapeJava(final Reader reader, final Writer writer)
throws IOException {
"""
<p>
Perform a Java level 2 (basic set and all non-ASCII chars) <strong>escape</strong> operation
on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 2</em> means this m... | java | public static void escapeJava(final Reader reader, final Writer writer)
throws IOException {
escapeJava(reader, writer, JavaEscapeLevel.LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET);
} | [
"public",
"static",
"void",
"escapeJava",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeJava",
"(",
"reader",
",",
"writer",
",",
"JavaEscapeLevel",
".",
"LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET",
"... | <p>
Perform a Java level 2 (basic set and all non-ASCII chars) <strong>escape</strong> operation
on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 2</em> means this method will escape:
</p>
<ul>
<li>The Java basic escape set:
<ul>
<li>The <em>Single Escape Characters</em>:
<tt>\b<... | [
"<p",
">",
"Perform",
"a",
"Java",
"level",
"2",
"(",
"basic",
"set",
"and",
"all",
"non",
"-",
"ASCII",
"chars",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"Reader<",
"/",
"tt",
">",
"input",
"writing",
... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/java/JavaEscape.java#L608-L611 |
b3log/latke | latke-core/src/main/java/org/json/JSONObject.java | JSONObject.getEnum | public <E extends Enum<E>> E getEnum(Class<E> clazz, String key) throws JSONException {
"""
Get the enum value associated with a key.
@param <E>
Enum Type
@param clazz
The type of enum to retrieve.
@param key
A key string.
@return The enum value associated with the key
@throws JSONException
if the key i... | java | public <E extends Enum<E>> E getEnum(Class<E> clazz, String key) throws JSONException {
E val = optEnum(clazz, key);
if(val==null) {
// JSONException should really take a throwable argument.
// If it did, I would re-implement this with the Enum.valueOf
// method and p... | [
"public",
"<",
"E",
"extends",
"Enum",
"<",
"E",
">",
">",
"E",
"getEnum",
"(",
"Class",
"<",
"E",
">",
"clazz",
",",
"String",
"key",
")",
"throws",
"JSONException",
"{",
"E",
"val",
"=",
"optEnum",
"(",
"clazz",
",",
"key",
")",
";",
"if",
"(",... | Get the enum value associated with a key.
@param <E>
Enum Type
@param clazz
The type of enum to retrieve.
@param key
A key string.
@return The enum value associated with the key
@throws JSONException
if the key is not found or if the value cannot be converted
to an enum. | [
"Get",
"the",
"enum",
"value",
"associated",
"with",
"a",
"key",
"."
] | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/json/JSONObject.java#L585-L596 |
hudson3-plugins/warnings-plugin | src/main/java/hudson/plugins/warnings/parser/fxcop/FxCopRuleSet.java | FxCopRuleSet.getNamedTagText | private String getNamedTagText(final Element element, final String tagName) {
"""
Returns the text value of the named child element if it exists
@param element the element to check look for child elements
@param tagName the name of the child element
@return the text value; or "" if no element was found
"""
... | java | private String getNamedTagText(final Element element, final String tagName) {
Element foundElement = XmlElementUtil.getFirstElementByTagName(element, tagName);
if (foundElement == null) {
return "";
} else {
return foundElement.getTextContent();
}
} | [
"private",
"String",
"getNamedTagText",
"(",
"final",
"Element",
"element",
",",
"final",
"String",
"tagName",
")",
"{",
"Element",
"foundElement",
"=",
"XmlElementUtil",
".",
"getFirstElementByTagName",
"(",
"element",
",",
"tagName",
")",
";",
"if",
"(",
"foun... | Returns the text value of the named child element if it exists
@param element the element to check look for child elements
@param tagName the name of the child element
@return the text value; or "" if no element was found | [
"Returns",
"the",
"text",
"value",
"of",
"the",
"named",
"child",
"element",
"if",
"it",
"exists"
] | train | https://github.com/hudson3-plugins/warnings-plugin/blob/462c9f3dffede9120173935567392b22520b0966/src/main/java/hudson/plugins/warnings/parser/fxcop/FxCopRuleSet.java#L38-L45 |
cerner/beadledom | jaxrs/src/main/java/com/cerner/beadledom/jaxrs/JaxRsParamConditions.java | JaxRsParamConditions.checkParam | public static void checkParam(boolean expression, Object errorMessage) {
"""
Ensures the truth of an expression involving a jax-rs parameter.
@param expression a boolean expression
@param errorMessage the exception message to use if the check fails; will
be converted to a string using {@link String#valueOf(Ob... | java | public static void checkParam(boolean expression, Object errorMessage) {
if (!expression) {
Response response = Response.status(Response.Status.BAD_REQUEST)
.type(MediaType.TEXT_PLAIN)
.build();
throw new WebApplicationException(String.valueOf(errorMessage), response);
}
} | [
"public",
"static",
"void",
"checkParam",
"(",
"boolean",
"expression",
",",
"Object",
"errorMessage",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"Response",
"response",
"=",
"Response",
".",
"status",
"(",
"Response",
".",
"Status",
".",
"BAD_REQUEST... | Ensures the truth of an expression involving a jax-rs parameter.
@param expression a boolean expression
@param errorMessage the exception message to use if the check fails; will
be converted to a string using {@link String#valueOf(Object)}
@throws WebApplicationException with response status 400 if {@code expression} ... | [
"Ensures",
"the",
"truth",
"of",
"an",
"expression",
"involving",
"a",
"jax",
"-",
"rs",
"parameter",
"."
] | train | https://github.com/cerner/beadledom/blob/75435bced5187d5455b46518fadf85c93cf32014/jaxrs/src/main/java/com/cerner/beadledom/jaxrs/JaxRsParamConditions.java#L44-L51 |
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/tree/InsnList.java | InsnList.set | public void set(final AbstractInsnNode location, final AbstractInsnNode insn) {
"""
Replaces an instruction of this list with another instruction.
@param location
an instruction <i>of this list</i>.
@param insn
another instruction, <i>which must not belong to any
{@link InsnList}</i>.
"""
Abstra... | java | public void set(final AbstractInsnNode location, final AbstractInsnNode insn) {
AbstractInsnNode next = location.next;
insn.next = next;
if (next != null) {
next.prev = insn;
} else {
last = insn;
}
AbstractInsnNode prev = location.prev;
in... | [
"public",
"void",
"set",
"(",
"final",
"AbstractInsnNode",
"location",
",",
"final",
"AbstractInsnNode",
"insn",
")",
"{",
"AbstractInsnNode",
"next",
"=",
"location",
".",
"next",
";",
"insn",
".",
"next",
"=",
"next",
";",
"if",
"(",
"next",
"!=",
"null"... | Replaces an instruction of this list with another instruction.
@param location
an instruction <i>of this list</i>.
@param insn
another instruction, <i>which must not belong to any
{@link InsnList}</i>. | [
"Replaces",
"an",
"instruction",
"of",
"this",
"list",
"with",
"another",
"instruction",
"."
] | train | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/tree/InsnList.java#L212-L237 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/HpelCBEFormatter.java | HpelCBEFormatter.createMessageElement | private void createMessageElement(StringBuilder sb, RepositoryLogRecord record) {
"""
Appends the CBE Message Element XML element of a record to a String buffer
@param sb the string buffer the element will be added to
@param record the record that represents the common base event
""" // 660484 elim... | java | private void createMessageElement(StringBuilder sb, RepositoryLogRecord record){ // 660484 elim string concat
sb.append(lineSeparator).append(INDENT[0]).append("<msgDataElement msgLocale=\"").append(record.getMessageLocale()).append("\">");
if (record.getParameters() != null) {
// how many params do we have?
... | [
"private",
"void",
"createMessageElement",
"(",
"StringBuilder",
"sb",
",",
"RepositoryLogRecord",
"record",
")",
"{",
"// 660484 elim string concat",
"sb",
".",
"append",
"(",
"lineSeparator",
")",
".",
"append",
"(",
"INDENT",
"[",
"0",
"]",
")",
".",
"append"... | Appends the CBE Message Element XML element of a record to a String buffer
@param sb the string buffer the element will be added to
@param record the record that represents the common base event | [
"Appends",
"the",
"CBE",
"Message",
"Element",
"XML",
"element",
"of",
"a",
"record",
"to",
"a",
"String",
"buffer"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/HpelCBEFormatter.java#L209-L238 |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/RefineDualQuadraticAlgebra.java | RefineDualQuadraticAlgebra.recomputeQ | void recomputeQ( DMatrixRMaj p , DMatrix4x4 Q ) {
"""
Compuets the absolute dual quadratic from the first camera parameters and
plane at infinity
@param p plane at infinity
@param Q (Output) ABQ
"""
Equation eq = new Equation();
DMatrix3x3 K = new DMatrix3x3();
encodeK(K,0,3,param.data);
eq.alias(p,... | java | void recomputeQ( DMatrixRMaj p , DMatrix4x4 Q ) {
Equation eq = new Equation();
DMatrix3x3 K = new DMatrix3x3();
encodeK(K,0,3,param.data);
eq.alias(p,"p",K,"K");
eq.process("w=K*K'");
eq.process("Q=[w , -w*p;-p'*w , p'*w*p]");
DMatrixRMaj _Q = eq.lookupDDRM("Q");
CommonOps_DDRM.divide(_Q, NormOps_DDRM.... | [
"void",
"recomputeQ",
"(",
"DMatrixRMaj",
"p",
",",
"DMatrix4x4",
"Q",
")",
"{",
"Equation",
"eq",
"=",
"new",
"Equation",
"(",
")",
";",
"DMatrix3x3",
"K",
"=",
"new",
"DMatrix3x3",
"(",
")",
";",
"encodeK",
"(",
"K",
",",
"0",
",",
"3",
",",
"par... | Compuets the absolute dual quadratic from the first camera parameters and
plane at infinity
@param p plane at infinity
@param Q (Output) ABQ | [
"Compuets",
"the",
"absolute",
"dual",
"quadratic",
"from",
"the",
"first",
"camera",
"parameters",
"and",
"plane",
"at",
"infinity"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/RefineDualQuadraticAlgebra.java#L155-L165 |
spring-projects/spring-boot | spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundrySecurityService.java | CloudFoundrySecurityService.getAccessLevel | public AccessLevel getAccessLevel(String token, String applicationId)
throws CloudFoundryAuthorizationException {
"""
Return the access level that should be granted to the given token.
@param token the token
@param applicationId the cloud foundry application ID
@return the access level that should be granted... | java | public AccessLevel getAccessLevel(String token, String applicationId)
throws CloudFoundryAuthorizationException {
try {
URI uri = getPermissionsUri(applicationId);
RequestEntity<?> request = RequestEntity.get(uri)
.header("Authorization", "bearer " + token).build();
Map<?, ?> body = this.restTemplate... | [
"public",
"AccessLevel",
"getAccessLevel",
"(",
"String",
"token",
",",
"String",
"applicationId",
")",
"throws",
"CloudFoundryAuthorizationException",
"{",
"try",
"{",
"URI",
"uri",
"=",
"getPermissionsUri",
"(",
"applicationId",
")",
";",
"RequestEntity",
"<",
"?"... | Return the access level that should be granted to the given token.
@param token the token
@param applicationId the cloud foundry application ID
@return the access level that should be granted
@throws CloudFoundryAuthorizationException if the token is not authorized | [
"Return",
"the",
"access",
"level",
"that",
"should",
"be",
"granted",
"to",
"the",
"given",
"token",
"."
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundrySecurityService.java#L69-L93 |
samskivert/pythagoras | src/main/java/pythagoras/d/CubicCurve.java | CubicCurve.setCurve | public void setCurve (double[] coords, int offset) {
"""
Configures the start, control and end points for this curve, using the values at the
specified offset in the {@code coords} array.
"""
setCurve(coords[offset + 0], coords[offset + 1], coords[offset + 2], coords[offset + 3],
coor... | java | public void setCurve (double[] coords, int offset) {
setCurve(coords[offset + 0], coords[offset + 1], coords[offset + 2], coords[offset + 3],
coords[offset + 4], coords[offset + 5], coords[offset + 6], coords[offset + 7]);
} | [
"public",
"void",
"setCurve",
"(",
"double",
"[",
"]",
"coords",
",",
"int",
"offset",
")",
"{",
"setCurve",
"(",
"coords",
"[",
"offset",
"+",
"0",
"]",
",",
"coords",
"[",
"offset",
"+",
"1",
"]",
",",
"coords",
"[",
"offset",
"+",
"2",
"]",
",... | Configures the start, control and end points for this curve, using the values at the
specified offset in the {@code coords} array. | [
"Configures",
"the",
"start",
"control",
"and",
"end",
"points",
"for",
"this",
"curve",
"using",
"the",
"values",
"at",
"the",
"specified",
"offset",
"in",
"the",
"{"
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/CubicCurve.java#L81-L84 |
BotMill/fb-botmill | src/main/java/co/aurasphere/botmill/fb/api/UploadApi.java | UploadApi.uploadAttachment | public static UploadAttachmentResponse uploadAttachment(
AttachmentType attachmentType, String attachmentUrl) {
"""
Method to upload an attachment to Facebook's server in order to use it
later. Requires the pages_messaging permission.
@param attachmentType
the type of attachment to upload to Facebook. Plea... | java | public static UploadAttachmentResponse uploadAttachment(
AttachmentType attachmentType, String attachmentUrl) {
AttachmentPayload payload = new AttachmentPayload(attachmentUrl, true);
Attachment attachment = new Attachment(attachmentType, payload);
AttachmentMessage message = new AttachmentMessage(attachment);... | [
"public",
"static",
"UploadAttachmentResponse",
"uploadAttachment",
"(",
"AttachmentType",
"attachmentType",
",",
"String",
"attachmentUrl",
")",
"{",
"AttachmentPayload",
"payload",
"=",
"new",
"AttachmentPayload",
"(",
"attachmentUrl",
",",
"true",
")",
";",
"Attachme... | Method to upload an attachment to Facebook's server in order to use it
later. Requires the pages_messaging permission.
@param attachmentType
the type of attachment to upload to Facebook. Please notice
that currently Facebook supports only image, audio, video and
file attachments.
@param attachmentUrl
the URL of the at... | [
"Method",
"to",
"upload",
"an",
"attachment",
"to",
"Facebook",
"s",
"server",
"in",
"order",
"to",
"use",
"it",
"later",
".",
"Requires",
"the",
"pages_messaging",
"permission",
"."
] | train | https://github.com/BotMill/fb-botmill/blob/d94da3615a7339822c137ef75c92a03d791ee969/src/main/java/co/aurasphere/botmill/fb/api/UploadApi.java#L61-L68 |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/ValueMap.java | ValueMap.getValueMap | public ValueMap getValueMap(Object key) {
"""
Returns the value mapped by {@code key} if it exists and is a {@link ValueMap}. Returns null
otherwise.
"""
Object value = get(key);
if (value instanceof ValueMap) {
return (ValueMap) value;
} else if (value instanceof Map) {
//noinspection... | java | public ValueMap getValueMap(Object key) {
Object value = get(key);
if (value instanceof ValueMap) {
return (ValueMap) value;
} else if (value instanceof Map) {
//noinspection unchecked
return new ValueMap((Map<String, Object>) value);
} else {
return null;
}
} | [
"public",
"ValueMap",
"getValueMap",
"(",
"Object",
"key",
")",
"{",
"Object",
"value",
"=",
"get",
"(",
"key",
")",
";",
"if",
"(",
"value",
"instanceof",
"ValueMap",
")",
"{",
"return",
"(",
"ValueMap",
")",
"value",
";",
"}",
"else",
"if",
"(",
"v... | Returns the value mapped by {@code key} if it exists and is a {@link ValueMap}. Returns null
otherwise. | [
"Returns",
"the",
"value",
"mapped",
"by",
"{"
] | train | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/ValueMap.java#L311-L321 |
samskivert/samskivert | src/main/java/com/samskivert/swing/GroupLayout.java | GroupLayout.makeHBox | public static JPanel makeHBox (Policy policy, Justification justification) {
"""
Creates a {@link JPanel} that is configured with an {@link
HGroupLayout} with the specified on-axis policy and justification
(default configuration otherwise).
"""
return new JPanel(new HGroupLayout(policy, justification... | java | public static JPanel makeHBox (Policy policy, Justification justification)
{
return new JPanel(new HGroupLayout(policy, justification));
} | [
"public",
"static",
"JPanel",
"makeHBox",
"(",
"Policy",
"policy",
",",
"Justification",
"justification",
")",
"{",
"return",
"new",
"JPanel",
"(",
"new",
"HGroupLayout",
"(",
"policy",
",",
"justification",
")",
")",
";",
"}"
] | Creates a {@link JPanel} that is configured with an {@link
HGroupLayout} with the specified on-axis policy and justification
(default configuration otherwise). | [
"Creates",
"a",
"{"
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/GroupLayout.java#L364-L367 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.getGroupsOfUser | public List<CmsGroup> getGroupsOfUser(String username, boolean directGroupsOnly) throws CmsException {
"""
Returns all the groups the given user belongs to.<p>
@param username the name of the user
@param directGroupsOnly if set only the direct assigned groups will be returned, if not also indirect roles
@re... | java | public List<CmsGroup> getGroupsOfUser(String username, boolean directGroupsOnly) throws CmsException {
return getGroupsOfUser(username, directGroupsOnly, true);
} | [
"public",
"List",
"<",
"CmsGroup",
">",
"getGroupsOfUser",
"(",
"String",
"username",
",",
"boolean",
"directGroupsOnly",
")",
"throws",
"CmsException",
"{",
"return",
"getGroupsOfUser",
"(",
"username",
",",
"directGroupsOnly",
",",
"true",
")",
";",
"}"
] | Returns all the groups the given user belongs to.<p>
@param username the name of the user
@param directGroupsOnly if set only the direct assigned groups will be returned, if not also indirect roles
@return a list of <code>{@link CmsGroup}</code> objects
@throws CmsException if operation was not successful | [
"Returns",
"all",
"the",
"groups",
"the",
"given",
"user",
"belongs",
"to",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L1455-L1458 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/security/UnixUserGroupInformation.java | UnixUserGroupInformation.login | public static UnixUserGroupInformation login() throws LoginException {
"""
Get current user's name and the names of all its groups from Unix.
It's assumed that there is only one UGI per user. If this user already
has a UGI in the ugi map, return the ugi in the map.
Otherwise get the current user's information f... | java | public static UnixUserGroupInformation login() throws LoginException {
try {
String userName;
// if an exception occurs, then uses the
// default user
try {
userName = getUnixUserName();
} catch (Exception e) {
userName = DEFAULT_USERNAME;
}
// check if t... | [
"public",
"static",
"UnixUserGroupInformation",
"login",
"(",
")",
"throws",
"LoginException",
"{",
"try",
"{",
"String",
"userName",
";",
"// if an exception occurs, then uses the",
"// default user",
"try",
"{",
"userName",
"=",
"getUnixUserName",
"(",
")",
";",
"}"... | Get current user's name and the names of all its groups from Unix.
It's assumed that there is only one UGI per user. If this user already
has a UGI in the ugi map, return the ugi in the map.
Otherwise get the current user's information from Unix, store it
in the map, and return it.
If the current user's UNIX username ... | [
"Get",
"current",
"user",
"s",
"name",
"and",
"the",
"names",
"of",
"all",
"its",
"groups",
"from",
"Unix",
".",
"It",
"s",
"assumed",
"that",
"there",
"is",
"only",
"one",
"UGI",
"per",
"user",
".",
"If",
"this",
"user",
"already",
"has",
"a",
"UGI"... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/security/UnixUserGroupInformation.java#L256-L295 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/sdx_network_config.java | sdx_network_config.update | public static sdx_network_config update(nitro_service client, sdx_network_config resource) throws Exception {
"""
<pre>
Use this operation to modify SDX network configuration.
</pre>
"""
resource.validate("modify");
return ((sdx_network_config[]) resource.update_resource(client))[0];
} | java | public static sdx_network_config update(nitro_service client, sdx_network_config resource) throws Exception
{
resource.validate("modify");
return ((sdx_network_config[]) resource.update_resource(client))[0];
} | [
"public",
"static",
"sdx_network_config",
"update",
"(",
"nitro_service",
"client",
",",
"sdx_network_config",
"resource",
")",
"throws",
"Exception",
"{",
"resource",
".",
"validate",
"(",
"\"modify\"",
")",
";",
"return",
"(",
"(",
"sdx_network_config",
"[",
"]"... | <pre>
Use this operation to modify SDX network configuration.
</pre> | [
"<pre",
">",
"Use",
"this",
"operation",
"to",
"modify",
"SDX",
"network",
"configuration",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/sdx_network_config.java#L200-L204 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/LocalDate.java | LocalDate.plus | @Override
public LocalDate plus(long amountToAdd, TemporalUnit unit) {
"""
Returns a copy of this date with the specified period added.
<p>
This method returns a new date based on this date with the specified period added.
This can be used to add any period that is defined by a unit, for example to add year... | java | @Override
public LocalDate plus(long amountToAdd, TemporalUnit unit) {
if (unit instanceof ChronoUnit) {
ChronoUnit f = (ChronoUnit) unit;
switch (f) {
case DAYS: return plusDays(amountToAdd);
case WEEKS: return plusWeeks(amountToAdd);
... | [
"@",
"Override",
"public",
"LocalDate",
"plus",
"(",
"long",
"amountToAdd",
",",
"TemporalUnit",
"unit",
")",
"{",
"if",
"(",
"unit",
"instanceof",
"ChronoUnit",
")",
"{",
"ChronoUnit",
"f",
"=",
"(",
"ChronoUnit",
")",
"unit",
";",
"switch",
"(",
"f",
"... | Returns a copy of this date with the specified period added.
<p>
This method returns a new date based on this date with the specified period added.
This can be used to add any period that is defined by a unit, for example to add years, months or days.
The unit is responsible for the details of the calculation, includin... | [
"Returns",
"a",
"copy",
"of",
"this",
"date",
"with",
"the",
"specified",
"period",
"added",
".",
"<p",
">",
"This",
"method",
"returns",
"a",
"new",
"date",
"based",
"on",
"this",
"date",
"with",
"the",
"specified",
"period",
"added",
".",
"This",
"can"... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/LocalDate.java#L1065-L1082 |
google/closure-compiler | src/com/google/javascript/jscomp/AmbiguateProperties.java | AmbiguateProperties.addRelatedType | private void addRelatedType(JSType type, JSTypeBitSet related) {
"""
Adds the given type and all its related types to the given bit set.
"""
computeRelatedTypesForNonUnionType(type);
related.or(relatedBitsets.get(type));
} | java | private void addRelatedType(JSType type, JSTypeBitSet related) {
computeRelatedTypesForNonUnionType(type);
related.or(relatedBitsets.get(type));
} | [
"private",
"void",
"addRelatedType",
"(",
"JSType",
"type",
",",
"JSTypeBitSet",
"related",
")",
"{",
"computeRelatedTypesForNonUnionType",
"(",
"type",
")",
";",
"related",
".",
"or",
"(",
"relatedBitsets",
".",
"get",
"(",
"type",
")",
")",
";",
"}"
] | Adds the given type and all its related types to the given bit set. | [
"Adds",
"the",
"given",
"type",
"and",
"all",
"its",
"related",
"types",
"to",
"the",
"given",
"bit",
"set",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AmbiguateProperties.java#L342-L345 |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java | MassToFormulaTool.getFormula | private IMolecularFormula getFormula(List<IIsotope> isoToCond_new, int[] value_In) {
"""
Set the formula molecular as IMolecularFormula object.
@param elemToCond_new List with IIsotope
@param value_In Array matrix with occurrences
@return The IMolecularFormula
"""
IMolecu... | java | private IMolecularFormula getFormula(List<IIsotope> isoToCond_new, int[] value_In) {
IMolecularFormula mf = builder.newInstance(IMolecularFormula.class);
for (int i = 0; i < isoToCond_new.size(); i++) {
if (value_In[i] != 0) {
for (int j = 0; j < value_In[i]; j++)
... | [
"private",
"IMolecularFormula",
"getFormula",
"(",
"List",
"<",
"IIsotope",
">",
"isoToCond_new",
",",
"int",
"[",
"]",
"value_In",
")",
"{",
"IMolecularFormula",
"mf",
"=",
"builder",
".",
"newInstance",
"(",
"IMolecularFormula",
".",
"class",
")",
";",
"for"... | Set the formula molecular as IMolecularFormula object.
@param elemToCond_new List with IIsotope
@param value_In Array matrix with occurrences
@return The IMolecularFormula | [
"Set",
"the",
"formula",
"molecular",
"as",
"IMolecularFormula",
"object",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java#L486-L497 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/AlignedBox3d.java | AlignedBox3d.setX | @Override
public void setX(double min, double max) {
"""
Set the x bounds of the box.
@param min the min value for the x axis.
@param max the max value for the x axis.
"""
if (min <= max) {
this.minxProperty.set(min);
this.maxxProperty.set(max);
} else {
this.minxProperty.set(max);
this.ma... | java | @Override
public void setX(double min, double max) {
if (min <= max) {
this.minxProperty.set(min);
this.maxxProperty.set(max);
} else {
this.minxProperty.set(max);
this.maxxProperty.set(min);
}
} | [
"@",
"Override",
"public",
"void",
"setX",
"(",
"double",
"min",
",",
"double",
"max",
")",
"{",
"if",
"(",
"min",
"<=",
"max",
")",
"{",
"this",
".",
"minxProperty",
".",
"set",
"(",
"min",
")",
";",
"this",
".",
"maxxProperty",
".",
"set",
"(",
... | Set the x bounds of the box.
@param min the min value for the x axis.
@param max the max value for the x axis. | [
"Set",
"the",
"x",
"bounds",
"of",
"the",
"box",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/AlignedBox3d.java#L671-L680 |
lucee/Lucee | core/src/main/java/lucee/runtime/ComponentImpl.java | ComponentImpl._set | private Object _set(PageContext pc, Collection.Key key, Object value) throws ExpressionException {
"""
sets a value to the current Component, dont to base Component
@param key
@param value
@return value set
@throws ExpressionException
"""
if (value instanceof Member) {
Member m = (Member) value;
... | java | private Object _set(PageContext pc, Collection.Key key, Object value) throws ExpressionException {
if (value instanceof Member) {
Member m = (Member) value;
if (m instanceof UDFPlus) {
UDFPlus udf = (UDFPlus) m;
if (udf.getAccess() > Component.ACCESS_PUBLIC) udf.setAccess(Component.ACCESS_PUBLIC);
_dat... | [
"private",
"Object",
"_set",
"(",
"PageContext",
"pc",
",",
"Collection",
".",
"Key",
"key",
",",
"Object",
"value",
")",
"throws",
"ExpressionException",
"{",
"if",
"(",
"value",
"instanceof",
"Member",
")",
"{",
"Member",
"m",
"=",
"(",
"Member",
")",
... | sets a value to the current Component, dont to base Component
@param key
@param value
@return value set
@throws ExpressionException | [
"sets",
"a",
"value",
"to",
"the",
"current",
"Component",
"dont",
"to",
"base",
"Component"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/ComponentImpl.java#L1634-L1655 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java | AccountsInner.updateStorageAccountAsync | public Observable<Void> updateStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) {
"""
Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix.
@param resourceGro... | java | public Observable<Void> updateStorageAccountAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) {
return updateStorageAccountWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, parameters).map(new Func1<ServiceResponse<V... | [
"public",
"Observable",
"<",
"Void",
">",
"updateStorageAccountAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"storageAccountName",
",",
"AddStorageAccountParameters",
"parameters",
")",
"{",
"return",
"updateStorageAccountWithServi... | Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.
@param accountName The name of the Data Lake Analytics account to modify storage acco... | [
"Updates",
"the",
"Data",
"Lake",
"Analytics",
"account",
"to",
"replace",
"Azure",
"Storage",
"blob",
"account",
"details",
"such",
"as",
"the",
"access",
"key",
"and",
"/",
"or",
"suffix",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java#L406-L413 |
h2oai/h2o-2 | src/main/java/hex/deeplearning/DeepLearning.java | DeepLearning.crossValidate | @Override public void crossValidate(Frame[] splits, Frame[] cv_preds, long[] offsets, int i) {
"""
Cross-Validate a DeepLearning model by building new models on N train/test holdout splits
@param splits Frames containing train/test splits
@param cv_preds Array of Frames to store the predictions for each cross-va... | java | @Override public void crossValidate(Frame[] splits, Frame[] cv_preds, long[] offsets, int i) {
// Train a clone with slightly modified parameters (to account for cross-validation)
final DeepLearning cv = (DeepLearning) this.clone();
cv.genericCrossValidation(splits, offsets, i);
cv_preds[i] = ((DeepLear... | [
"@",
"Override",
"public",
"void",
"crossValidate",
"(",
"Frame",
"[",
"]",
"splits",
",",
"Frame",
"[",
"]",
"cv_preds",
",",
"long",
"[",
"]",
"offsets",
",",
"int",
"i",
")",
"{",
"// Train a clone with slightly modified parameters (to account for cross-validatio... | Cross-Validate a DeepLearning model by building new models on N train/test holdout splits
@param splits Frames containing train/test splits
@param cv_preds Array of Frames to store the predictions for each cross-validation run
@param offsets Array to store the offsets of starting row indices for each cross-validation r... | [
"Cross",
"-",
"Validate",
"a",
"DeepLearning",
"model",
"by",
"building",
"new",
"models",
"on",
"N",
"train",
"/",
"test",
"holdout",
"splits"
] | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/deeplearning/DeepLearning.java#L1305-L1320 |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/SslServerCustomizer.java | SslServerCustomizer.configureSsl | protected void configureSsl(SslContextFactory factory, Ssl ssl,
SslStoreProvider sslStoreProvider) {
"""
Configure the SSL connection.
@param factory the Jetty {@link SslContextFactory}.
@param ssl the ssl details.
@param sslStoreProvider the ssl store provider
"""
factory.setProtocol(ssl.getProtocol()... | java | protected void configureSsl(SslContextFactory factory, Ssl ssl,
SslStoreProvider sslStoreProvider) {
factory.setProtocol(ssl.getProtocol());
configureSslClientAuth(factory, ssl);
configureSslPasswords(factory, ssl);
factory.setCertAlias(ssl.getKeyAlias());
if (!ObjectUtils.isEmpty(ssl.getCiphers())) {
f... | [
"protected",
"void",
"configureSsl",
"(",
"SslContextFactory",
"factory",
",",
"Ssl",
"ssl",
",",
"SslStoreProvider",
"sslStoreProvider",
")",
"{",
"factory",
".",
"setProtocol",
"(",
"ssl",
".",
"getProtocol",
"(",
")",
")",
";",
"configureSslClientAuth",
"(",
... | Configure the SSL connection.
@param factory the Jetty {@link SslContextFactory}.
@param ssl the ssl details.
@param sslStoreProvider the ssl store provider | [
"Configure",
"the",
"SSL",
"connection",
"."
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/SslServerCustomizer.java#L141-L167 |
mgm-tp/jfunk | jfunk-core/src/main/java/com/mgmtp/jfunk/core/mail/MailService.java | MailService.findMessage | public MailMessage findMessage(final String accountReservationKey, final Predicate<MailMessage> condition,
final long timeoutSeconds, final long sleepMillis) {
"""
Tries to find a message for the mail account reserved under the specified
{@code accountReservationKey} applying the specified {@code condition} un... | java | public MailMessage findMessage(final String accountReservationKey, final Predicate<MailMessage> condition,
final long timeoutSeconds, final long sleepMillis) {
MailAccount mailAccount = checkNotNull(mailAccountManager.lookupUsedMailAccountForCurrentThread(accountReservationKey),
"No mail account reserved for c... | [
"public",
"MailMessage",
"findMessage",
"(",
"final",
"String",
"accountReservationKey",
",",
"final",
"Predicate",
"<",
"MailMessage",
">",
"condition",
",",
"final",
"long",
"timeoutSeconds",
",",
"final",
"long",
"sleepMillis",
")",
"{",
"MailAccount",
"mailAccou... | Tries to find a message for the mail account reserved under the specified
{@code accountReservationKey} applying the specified {@code condition} until it times out
using the specified {@code timeout} and and {@code sleepMillis}.
@param accountReservationKey
the key under which the account has been reserved
@param cond... | [
"Tries",
"to",
"find",
"a",
"message",
"for",
"the",
"mail",
"account",
"reserved",
"under",
"the",
"specified",
"{",
"@code",
"accountReservationKey",
"}",
"applying",
"the",
"specified",
"{",
"@code",
"condition",
"}",
"until",
"it",
"times",
"out",
"using",... | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-core/src/main/java/com/mgmtp/jfunk/core/mail/MailService.java#L161-L166 |
aoindustries/aocode-public | src/main/java/com/aoindustries/util/StringUtility.java | StringUtility.wordWrap | @Deprecated
public static String wordWrap(String string, int width) {
"""
Word wraps a <code>String</code> to be no longer than the provided number of characters wide.
@deprecated Use new version with Appendable for higher performance
"""
// Leave room for two word wrap characters every width / 2 charac... | java | @Deprecated
public static String wordWrap(String string, int width) {
// Leave room for two word wrap characters every width / 2 characters, on average.
int inputLength = string.length();
int estimatedLines = 2 * inputLength / width;
int initialLength = inputLength + estimatedLines * 2;
try {
StringBuilde... | [
"@",
"Deprecated",
"public",
"static",
"String",
"wordWrap",
"(",
"String",
"string",
",",
"int",
"width",
")",
"{",
"// Leave room for two word wrap characters every width / 2 characters, on average.",
"int",
"inputLength",
"=",
"string",
".",
"length",
"(",
")",
";",
... | Word wraps a <code>String</code> to be no longer than the provided number of characters wide.
@deprecated Use new version with Appendable for higher performance | [
"Word",
"wraps",
"a",
"<code",
">",
"String<",
"/",
"code",
">",
"to",
"be",
"no",
"longer",
"than",
"the",
"provided",
"number",
"of",
"characters",
"wide",
"."
] | train | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L1008-L1021 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/bci/AbstractRasMethodAdapter.java | AbstractRasMethodAdapter.visitTryCatchBlock | @Override
public void visitTryCatchBlock(Label start, Label end, Label handler, String type) {
"""
Visit a try catch block. We will use this to determine the exception
handler labels for the try block.
@param start
the beginning of the try block
@param end
the end of the try block
@param handler
the e... | java | @Override
public void visitTryCatchBlock(Label start, Label end, Label handler, String type) {
if (type != null) {
handlers.put(handler, type);
}
super.visitTryCatchBlock(start, end, handler, type);
} | [
"@",
"Override",
"public",
"void",
"visitTryCatchBlock",
"(",
"Label",
"start",
",",
"Label",
"end",
",",
"Label",
"handler",
",",
"String",
"type",
")",
"{",
"if",
"(",
"type",
"!=",
"null",
")",
"{",
"handlers",
".",
"put",
"(",
"handler",
",",
"type... | Visit a try catch block. We will use this to determine the exception
handler labels for the try block.
@param start
the beginning of the try block
@param end
the end of the try block
@param handler
the exception handler
@param type
the internal name of the throwable being handled | [
"Visit",
"a",
"try",
"catch",
"block",
".",
"We",
"will",
"use",
"this",
"to",
"determine",
"the",
"exception",
"handler",
"labels",
"for",
"the",
"try",
"block",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/bci/AbstractRasMethodAdapter.java#L1006-L1012 |
jenkinsci/jenkins | core/src/main/java/jenkins/util/ResourceBundleUtil.java | ResourceBundleUtil.getBundle | private static @CheckForNull ResourceBundle getBundle(@Nonnull String baseName, @Nonnull Locale locale, @Nonnull ClassLoader classLoader) {
"""
Get a plugin bundle using the supplied Locale and classLoader
@param baseName The bundle base name.
@param locale The Locale.
@param classLoader The classLoader
@ret... | java | private static @CheckForNull ResourceBundle getBundle(@Nonnull String baseName, @Nonnull Locale locale, @Nonnull ClassLoader classLoader) {
try {
return ResourceBundle.getBundle(baseName, locale, classLoader);
} catch (MissingResourceException e) {
// fall through and return null... | [
"private",
"static",
"@",
"CheckForNull",
"ResourceBundle",
"getBundle",
"(",
"@",
"Nonnull",
"String",
"baseName",
",",
"@",
"Nonnull",
"Locale",
"locale",
",",
"@",
"Nonnull",
"ClassLoader",
"classLoader",
")",
"{",
"try",
"{",
"return",
"ResourceBundle",
".",... | Get a plugin bundle using the supplied Locale and classLoader
@param baseName The bundle base name.
@param locale The Locale.
@param classLoader The classLoader
@return The bundle JSON. | [
"Get",
"a",
"plugin",
"bundle",
"using",
"the",
"supplied",
"Locale",
"and",
"classLoader"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/ResourceBundleUtil.java#L112-L120 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/RandomUtil.java | RandomUtil.randomString | public String randomString(String permitted, int length) {
"""
Creates a random string consisting only of supplied characters.
@param permitted string consisting of permitted characters.
@param length length of string to create.
@return random string.
"""
StringBuilder result = new StringBuilder(len... | java | public String randomString(String permitted, int length) {
StringBuilder result = new StringBuilder(length);
int maxIndex = permitted.length();
for (int i = 0; i < length; i++) {
int index = random(maxIndex);
char value = permitted.charAt(index);
result.append... | [
"public",
"String",
"randomString",
"(",
"String",
"permitted",
",",
"int",
"length",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
"length",
")",
";",
"int",
"maxIndex",
"=",
"permitted",
".",
"length",
"(",
")",
";",
"for",
"(",
... | Creates a random string consisting only of supplied characters.
@param permitted string consisting of permitted characters.
@param length length of string to create.
@return random string. | [
"Creates",
"a",
"random",
"string",
"consisting",
"only",
"of",
"supplied",
"characters",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/RandomUtil.java#L50-L59 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UScript.java | UScript.hasScript | public static final boolean hasScript(int c, int sc) {
"""
Do the Script_Extensions of code point c contain script sc?
If c does not have explicit Script_Extensions, then this tests whether
c has the Script property value sc.
<p>Some characters are commonly used in multiple scripts.
For more information, see... | java | public static final boolean hasScript(int c, int sc) {
int scriptX=UCharacterProperty.INSTANCE.getAdditional(c, 0)&UCharacterProperty.SCRIPT_X_MASK;
if(scriptX<UCharacterProperty.SCRIPT_X_WITH_COMMON) {
return sc==scriptX;
}
char[] scriptExtensions=UCharacterProperty.INSTANC... | [
"public",
"static",
"final",
"boolean",
"hasScript",
"(",
"int",
"c",
",",
"int",
"sc",
")",
"{",
"int",
"scriptX",
"=",
"UCharacterProperty",
".",
"INSTANCE",
".",
"getAdditional",
"(",
"c",
",",
"0",
")",
"&",
"UCharacterProperty",
".",
"SCRIPT_X_MASK",
... | Do the Script_Extensions of code point c contain script sc?
If c does not have explicit Script_Extensions, then this tests whether
c has the Script property value sc.
<p>Some characters are commonly used in multiple scripts.
For more information, see UAX #24: http://www.unicode.org/reports/tr24/.
@param c code point
... | [
"Do",
"the",
"Script_Extensions",
"of",
"code",
"point",
"c",
"contain",
"script",
"sc?",
"If",
"c",
"does",
"not",
"have",
"explicit",
"Script_Extensions",
"then",
"this",
"tests",
"whether",
"c",
"has",
"the",
"Script",
"property",
"value",
"sc",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UScript.java#L972-L992 |
mike10004/common-helper | imnetio-helper/src/main/java/com/github/mike10004/common/io/ByteSources.java | ByteSources.concatOpenable | public static ByteSource concatOpenable(ByteSource first, ByteSource...others) {
"""
Concatenates multiple byte sources, skipping sources for which
opening an input stream fails.
@param first the first byte source
@param others other byte sources
@return the concatenated source
"""
return concatOpe... | java | public static ByteSource concatOpenable(ByteSource first, ByteSource...others) {
return concatOpenable(Lists.asList(first, others));
} | [
"public",
"static",
"ByteSource",
"concatOpenable",
"(",
"ByteSource",
"first",
",",
"ByteSource",
"...",
"others",
")",
"{",
"return",
"concatOpenable",
"(",
"Lists",
".",
"asList",
"(",
"first",
",",
"others",
")",
")",
";",
"}"
] | Concatenates multiple byte sources, skipping sources for which
opening an input stream fails.
@param first the first byte source
@param others other byte sources
@return the concatenated source | [
"Concatenates",
"multiple",
"byte",
"sources",
"skipping",
"sources",
"for",
"which",
"opening",
"an",
"input",
"stream",
"fails",
"."
] | train | https://github.com/mike10004/common-helper/blob/744f82d9b0768a9ad9c63a57a37ab2c93bf408f4/imnetio-helper/src/main/java/com/github/mike10004/common/io/ByteSources.java#L30-L32 |
hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/collection/MultiMap.java | MultiMap.addValues | public void addValues(String name, List<V> values) {
"""
Add values to multi valued entry. If the entry is single valued, it is
converted to the first value of a multi valued entry.
@param name The entry key.
@param values The List of multiple values.
"""
List<V> lo = get(name);
if (lo =... | java | public void addValues(String name, List<V> values) {
List<V> lo = get(name);
if (lo == null) {
lo = new ArrayList<>();
}
lo.addAll(values);
put(name, lo);
} | [
"public",
"void",
"addValues",
"(",
"String",
"name",
",",
"List",
"<",
"V",
">",
"values",
")",
"{",
"List",
"<",
"V",
">",
"lo",
"=",
"get",
"(",
"name",
")",
";",
"if",
"(",
"lo",
"==",
"null",
")",
"{",
"lo",
"=",
"new",
"ArrayList",
"<>",
... | Add values to multi valued entry. If the entry is single valued, it is
converted to the first value of a multi valued entry.
@param name The entry key.
@param values The List of multiple values. | [
"Add",
"values",
"to",
"multi",
"valued",
"entry",
".",
"If",
"the",
"entry",
"is",
"single",
"valued",
"it",
"is",
"converted",
"to",
"the",
"first",
"value",
"of",
"a",
"multi",
"valued",
"entry",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/collection/MultiMap.java#L165-L172 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/TimestampBound.java | TimestampBound.ofReadTimestamp | public static TimestampBound ofReadTimestamp(Timestamp timestamp) {
"""
Returns a timestamp bound that will perform reads and queries at the given timestamp. Unlike
other modes, reads at a specific timestamp are repeatable; the same read at the same timestamp
always returns the same data. If the timestamp is in ... | java | public static TimestampBound ofReadTimestamp(Timestamp timestamp) {
return new TimestampBound(Mode.READ_TIMESTAMP, checkNotNull(timestamp), null);
} | [
"public",
"static",
"TimestampBound",
"ofReadTimestamp",
"(",
"Timestamp",
"timestamp",
")",
"{",
"return",
"new",
"TimestampBound",
"(",
"Mode",
".",
"READ_TIMESTAMP",
",",
"checkNotNull",
"(",
"timestamp",
")",
",",
"null",
")",
";",
"}"
] | Returns a timestamp bound that will perform reads and queries at the given timestamp. Unlike
other modes, reads at a specific timestamp are repeatable; the same read at the same timestamp
always returns the same data. If the timestamp is in the future, the read will block until the
specified timestamp, modulo the read'... | [
"Returns",
"a",
"timestamp",
"bound",
"that",
"will",
"perform",
"reads",
"and",
"queries",
"at",
"the",
"given",
"timestamp",
".",
"Unlike",
"other",
"modes",
"reads",
"at",
"a",
"specific",
"timestamp",
"are",
"repeatable",
";",
"the",
"same",
"read",
"at"... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/TimestampBound.java#L152-L154 |
m-m-m/util | gwt/src/main/java/net/sf/mmm/util/nls/impl/rebind/NlsBundleFactoryGenerator.java | NlsBundleFactoryGenerator.generateMethodCreateBundle | protected void generateMethodCreateBundle(SourceWriter sourceWriter, TreeLogger logger,
GeneratorContext context) {
"""
Generates the {@code createBundle} method.
@param sourceWriter is the {@link SourceWriter}.
@param logger is the {@link TreeLogger}.
@param context is the {@link GeneratorContext}.
... | java | protected void generateMethodCreateBundle(SourceWriter sourceWriter, TreeLogger logger,
GeneratorContext context) {
// method declaration
sourceWriter.print("public <BUNDLE extends ");
sourceWriter.print(NlsBundle.class.getSimpleName());
sourceWriter.println("> BUNDLE createBundle(Class<BUNDLE> b... | [
"protected",
"void",
"generateMethodCreateBundle",
"(",
"SourceWriter",
"sourceWriter",
",",
"TreeLogger",
"logger",
",",
"GeneratorContext",
"context",
")",
"{",
"// method declaration",
"sourceWriter",
".",
"print",
"(",
"\"public <BUNDLE extends \"",
")",
";",
"sourceW... | Generates the {@code createBundle} method.
@param sourceWriter is the {@link SourceWriter}.
@param logger is the {@link TreeLogger}.
@param context is the {@link GeneratorContext}. | [
"Generates",
"the",
"{",
"@code",
"createBundle",
"}",
"method",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/gwt/src/main/java/net/sf/mmm/util/nls/impl/rebind/NlsBundleFactoryGenerator.java#L69-L93 |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLineLayer.java | BusLineLayer.onBusItineraryRemoved | protected boolean onBusItineraryRemoved(BusItinerary itinerary, int index) {
"""
Invoked when a bus itinerary was removed from the attached line.
<p>This function exists to allow be override to provide a specific behaviour
when a bus itinerary has been removed.
@param itinerary is the removed itinerary.
@p... | java | protected boolean onBusItineraryRemoved(BusItinerary itinerary, int index) {
if (this.autoUpdate.get()) {
try {
removeMapLayerAt(index);
return true;
} catch (Throwable exception) {
//
}
}
return false;
} | [
"protected",
"boolean",
"onBusItineraryRemoved",
"(",
"BusItinerary",
"itinerary",
",",
"int",
"index",
")",
"{",
"if",
"(",
"this",
".",
"autoUpdate",
".",
"get",
"(",
")",
")",
"{",
"try",
"{",
"removeMapLayerAt",
"(",
"index",
")",
";",
"return",
"true"... | Invoked when a bus itinerary was removed from the attached line.
<p>This function exists to allow be override to provide a specific behaviour
when a bus itinerary has been removed.
@param itinerary is the removed itinerary.
@param index is the index of the bus itinerary.
@return <code>true</code> if the events was fi... | [
"Invoked",
"when",
"a",
"bus",
"itinerary",
"was",
"removed",
"from",
"the",
"attached",
"line",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLineLayer.java#L274-L284 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/services/task/factory/TaskInstanceStrategyFactory.java | TaskInstanceStrategyFactory.getPrioritizationStrategy | public static PrioritizationStrategy getPrioritizationStrategy(String attributeValue, Long processInstanceId) throws StrategyException {
"""
Returns a Prioritization routing strategy instance based on an attribute value and bundle spec
which can consist of either the routing strategy logical name, or an xml docum... | java | public static PrioritizationStrategy getPrioritizationStrategy(String attributeValue, Long processInstanceId) throws StrategyException {
Package packageVO = processInstanceId == null ? null : getPackage(processInstanceId);
TaskInstanceStrategyFactory factory = getInstance();
String className = f... | [
"public",
"static",
"PrioritizationStrategy",
"getPrioritizationStrategy",
"(",
"String",
"attributeValue",
",",
"Long",
"processInstanceId",
")",
"throws",
"StrategyException",
"{",
"Package",
"packageVO",
"=",
"processInstanceId",
"==",
"null",
"?",
"null",
":",
"getP... | Returns a Prioritization routing strategy instance based on an attribute value and bundle spec
which can consist of either the routing strategy logical name, or an xml document.
@param attributeValue
@return the Prioritization strategy implementor instance | [
"Returns",
"a",
"Prioritization",
"routing",
"strategy",
"instance",
"based",
"on",
"an",
"attribute",
"value",
"and",
"bundle",
"spec",
"which",
"can",
"consist",
"of",
"either",
"the",
"routing",
"strategy",
"logical",
"name",
"or",
"an",
"xml",
"document",
... | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/services/task/factory/TaskInstanceStrategyFactory.java#L125-L131 |
sahan/IckleBot | icklebot/src/main/java/com/lonepulse/icklebot/state/StateUtils.java | StateUtils.onRestoreInstanceState | public static void onRestoreInstanceState(Object context, Bundle savedInstanceState) {
"""
<p><b>Restores</b> instance variables annotated with {@code @Stateful}.</p>
"""
if(ProfileService.getInstance(context).isActive(context, Profile.STATE) && savedInstanceState != null) {
long millis = System.cu... | java | public static void onRestoreInstanceState(Object context, Bundle savedInstanceState) {
if(ProfileService.getInstance(context).isActive(context, Profile.STATE) && savedInstanceState != null) {
long millis = System.currentTimeMillis();
StateService.newInstance(ContextUtils.discover(context)).restore(con... | [
"public",
"static",
"void",
"onRestoreInstanceState",
"(",
"Object",
"context",
",",
"Bundle",
"savedInstanceState",
")",
"{",
"if",
"(",
"ProfileService",
".",
"getInstance",
"(",
"context",
")",
".",
"isActive",
"(",
"context",
",",
"Profile",
".",
"STATE",
... | <p><b>Restores</b> instance variables annotated with {@code @Stateful}.</p> | [
"<p",
">",
"<b",
">",
"Restores<",
"/",
"b",
">",
"instance",
"variables",
"annotated",
"with",
"{"
] | train | https://github.com/sahan/IckleBot/blob/a19003ceb3ad7c7ee508dc23a8cb31b5676aa499/icklebot/src/main/java/com/lonepulse/icklebot/state/StateUtils.java#L73-L86 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java | KeyVaultClientCustomImpl.listKeyVersionsAsync | public ServiceFuture<List<KeyItem>> listKeyVersionsAsync(final String vaultBaseUrl, final String keyName,
final ListOperationCallback<KeyItem> serviceCallback) {
"""
Retrieves a list of individual key versions with the same key name. The full
key identifier, attributes, and tags are provided in the re... | java | public ServiceFuture<List<KeyItem>> listKeyVersionsAsync(final String vaultBaseUrl, final String keyName,
final ListOperationCallback<KeyItem> serviceCallback) {
return getKeyVersionsAsync(vaultBaseUrl, keyName, serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"List",
"<",
"KeyItem",
">",
">",
"listKeyVersionsAsync",
"(",
"final",
"String",
"vaultBaseUrl",
",",
"final",
"String",
"keyName",
",",
"final",
"ListOperationCallback",
"<",
"KeyItem",
">",
"serviceCallback",
")",
"{",
"return",
... | Retrieves a list of individual key versions with the same key name. The full
key identifier, attributes, and tags are provided in the response.
Authorization: Requires the keys/list permission.
@param vaultBaseUrl
The vault name, e.g. https://myvault.vault.azure.net
@param keyName
The name of the key
@param serviceCal... | [
"Retrieves",
"a",
"list",
"of",
"individual",
"key",
"versions",
"with",
"the",
"same",
"key",
"name",
".",
"The",
"full",
"key",
"identifier",
"attributes",
"and",
"tags",
"are",
"provided",
"in",
"the",
"response",
".",
"Authorization",
":",
"Requires",
"t... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java#L782-L785 |
google/error-prone-javac | src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor6.java | TypeKindVisitor6.visitPrimitive | @Override
public R visitPrimitive(PrimitiveType t, P p) {
"""
Visits a primitive type, dispatching to the visit method for
the specific {@linkplain TypeKind kind} of primitive type:
{@code BOOLEAN}, {@code BYTE}, etc.
@param t {@inheritDoc}
@param p {@inheritDoc}
@return the result of the kind-specific... | java | @Override
public R visitPrimitive(PrimitiveType t, P p) {
TypeKind k = t.getKind();
switch (k) {
case BOOLEAN:
return visitPrimitiveAsBoolean(t, p);
case BYTE:
return visitPrimitiveAsByte(t, p);
case SHORT:
return visitPrimitiveAsShort(t,... | [
"@",
"Override",
"public",
"R",
"visitPrimitive",
"(",
"PrimitiveType",
"t",
",",
"P",
"p",
")",
"{",
"TypeKind",
"k",
"=",
"t",
".",
"getKind",
"(",
")",
";",
"switch",
"(",
"k",
")",
"{",
"case",
"BOOLEAN",
":",
"return",
"visitPrimitiveAsBoolean",
"... | Visits a primitive type, dispatching to the visit method for
the specific {@linkplain TypeKind kind} of primitive type:
{@code BOOLEAN}, {@code BYTE}, etc.
@param t {@inheritDoc}
@param p {@inheritDoc}
@return the result of the kind-specific visit method | [
"Visits",
"a",
"primitive",
"type",
"dispatching",
"to",
"the",
"visit",
"method",
"for",
"the",
"specific",
"{",
"@linkplain",
"TypeKind",
"kind",
"}",
"of",
"primitive",
"type",
":",
"{",
"@code",
"BOOLEAN",
"}",
"{",
"@code",
"BYTE",
"}",
"etc",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor6.java#L116-L147 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java | BusGroup.generateReplySubscriptionMessage | protected SubscriptionMessage generateReplySubscriptionMessage() {
"""
Generates the reply subscription message that should be sent to a
the neighbor on the Bus who sent the request.
@return a new ReplySubscriptionMessage
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.... | java | protected SubscriptionMessage generateReplySubscriptionMessage()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "generateReplySubscriptionMessage");
// Get the Message Handler for doing this operation.
final SubscriptionMessageHandler messageHandler =
... | [
"protected",
"SubscriptionMessage",
"generateReplySubscriptionMessage",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"generateReplySubsc... | Generates the reply subscription message that should be sent to a
the neighbor on the Bus who sent the request.
@return a new ReplySubscriptionMessage | [
"Generates",
"the",
"reply",
"subscription",
"message",
"that",
"should",
"be",
"sent",
"to",
"a",
"the",
"neighbor",
"on",
"the",
"Bus",
"who",
"sent",
"the",
"request",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java#L805-L834 |
geomajas/geomajas-project-server | impl/src/main/java/org/geomajas/internal/service/CommandDispatcherImpl.java | CommandDispatcherImpl.getErrorMessage | private String getErrorMessage(final Throwable throwable, final Locale locale) {
"""
Get localized error message for a {@link Throwable}.
@param throwable throwable to get message for
@param locale locale to use for message
@return exception message
"""
String message;
if (!(throwable instanceof Geoma... | java | private String getErrorMessage(final Throwable throwable, final Locale locale) {
String message;
if (!(throwable instanceof GeomajasException)) {
message = throwable.getMessage();
} else {
message = ((GeomajasException) throwable).getMessage(locale);
}
if (null == message || 0 == message.length()) {
... | [
"private",
"String",
"getErrorMessage",
"(",
"final",
"Throwable",
"throwable",
",",
"final",
"Locale",
"locale",
")",
"{",
"String",
"message",
";",
"if",
"(",
"!",
"(",
"throwable",
"instanceof",
"GeomajasException",
")",
")",
"{",
"message",
"=",
"throwable... | Get localized error message for a {@link Throwable}.
@param throwable throwable to get message for
@param locale locale to use for message
@return exception message | [
"Get",
"localized",
"error",
"message",
"for",
"a",
"{",
"@link",
"Throwable",
"}",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/internal/service/CommandDispatcherImpl.java#L208-L219 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/PrefHelper.java | PrefHelper.setLong | public void setLong(String key, long value) {
"""
<p>Sets the value of the {@link String} key value supplied in preferences.</p>
@param key A {@link String} value containing the key to reference.
@param value A {@link Long} value to set the preference record to.
"""
prefHelper_.prefsEditor_.putLo... | java | public void setLong(String key, long value) {
prefHelper_.prefsEditor_.putLong(key, value);
prefHelper_.prefsEditor_.apply();
} | [
"public",
"void",
"setLong",
"(",
"String",
"key",
",",
"long",
"value",
")",
"{",
"prefHelper_",
".",
"prefsEditor_",
".",
"putLong",
"(",
"key",
",",
"value",
")",
";",
"prefHelper_",
".",
"prefsEditor_",
".",
"apply",
"(",
")",
";",
"}"
] | <p>Sets the value of the {@link String} key value supplied in preferences.</p>
@param key A {@link String} value containing the key to reference.
@param value A {@link Long} value to set the preference record to. | [
"<p",
">",
"Sets",
"the",
"value",
"of",
"the",
"{",
"@link",
"String",
"}",
"key",
"value",
"supplied",
"in",
"preferences",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/PrefHelper.java#L981-L984 |
andreitognolo/raidenjpa | raidenjpa-core/src/main/java/org/raidenjpa/reflection/Cloner.java | Cloner.shallowCopy | @SuppressWarnings("unchecked")
public static <T> T shallowCopy(T original) {
"""
Requires a no-args constructor
@param original
@return shallow copy of original
"""
Class<? extends T> clazz = (Class<? extends T>) original.getClass();
BeanClass<? extends T> beanClass = (BeanClass<? extends T>) class... | java | @SuppressWarnings("unchecked")
public static <T> T shallowCopy(T original) {
Class<? extends T> clazz = (Class<? extends T>) original.getClass();
BeanClass<? extends T> beanClass = (BeanClass<? extends T>) classes.get(clazz);
if (beanClass == null) {
beanClass = BeanClass.buildFrom(clazz);
classes.pu... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"shallowCopy",
"(",
"T",
"original",
")",
"{",
"Class",
"<",
"?",
"extends",
"T",
">",
"clazz",
"=",
"(",
"Class",
"<",
"?",
"extends",
"T",
">",
")",
"origin... | Requires a no-args constructor
@param original
@return shallow copy of original | [
"Requires",
"a",
"no",
"-",
"args",
"constructor"
] | train | https://github.com/andreitognolo/raidenjpa/blob/1c6e320f9f9d26c89e54f41eab1ef123815d2f06/raidenjpa-core/src/main/java/org/raidenjpa/reflection/Cloner.java#L16-L28 |
syphr42/libmythtv-java | protocol/src/main/java/org/syphr/mythtv/protocol/ProtocolFactory.java | ProtocolFactory.createInstance | public static Protocol createInstance(ProtocolVersion version, SocketManager socketManager) {
"""
Create a new protocol instance. This instance cannot be used until the
associated socket manager is connected.
@param version
the desired protocol version (this must match the backend to
which the socket manager... | java | public static Protocol createInstance(ProtocolVersion version, SocketManager socketManager)
{
switch (version)
{
case _63:
return new Protocol63(socketManager);
case _72:
return new Protocol72(socketManager);
case _73:
... | [
"public",
"static",
"Protocol",
"createInstance",
"(",
"ProtocolVersion",
"version",
",",
"SocketManager",
"socketManager",
")",
"{",
"switch",
"(",
"version",
")",
"{",
"case",
"_63",
":",
"return",
"new",
"Protocol63",
"(",
"socketManager",
")",
";",
"case",
... | Create a new protocol instance. This instance cannot be used until the
associated socket manager is connected.
@param version
the desired protocol version (this must match the backend to
which the socket manager is connecting)
@param socketManager
the socket manager that will control communication between the
client a... | [
"Create",
"a",
"new",
"protocol",
"instance",
".",
"This",
"instance",
"cannot",
"be",
"used",
"until",
"the",
"associated",
"socket",
"manager",
"is",
"connected",
"."
] | train | https://github.com/syphr42/libmythtv-java/blob/cc7a2012fbd4a4ba2562dda6b2614fb0548526ea/protocol/src/main/java/org/syphr/mythtv/protocol/ProtocolFactory.java#L57-L76 |
thymeleaf/thymeleaf | src/main/java/org/thymeleaf/standard/expression/OGNLShortcutExpression.java | OGNLShortcutExpression.checkExecInfo | @Deprecated
private static Object checkExecInfo(final String propertyName, final Map<String,Object> context) {
"""
Translation from 'execInfo' context variable (${execInfo}) to 'execInfo' expression object (${#execInfo}), needed
since 3.0.0.
Note this is expressed as a separate method in order to mark this... | java | @Deprecated
private static Object checkExecInfo(final String propertyName, final Map<String,Object> context) {
if ("execInfo".equals(propertyName)) {
LOGGER.warn(
"[THYMELEAF][{}] Found Thymeleaf Standard Expression containing a call to the context variable " +
... | [
"@",
"Deprecated",
"private",
"static",
"Object",
"checkExecInfo",
"(",
"final",
"String",
"propertyName",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"context",
")",
"{",
"if",
"(",
"\"execInfo\"",
".",
"equals",
"(",
"propertyName",
")",
")",
... | Translation from 'execInfo' context variable (${execInfo}) to 'execInfo' expression object (${#execInfo}), needed
since 3.0.0.
Note this is expressed as a separate method in order to mark this as deprecated and make it easily locatable.
@param propertyName the name of the property being accessed (we are looking for '... | [
"Translation",
"from",
"execInfo",
"context",
"variable",
"(",
"$",
"{",
"execInfo",
"}",
")",
"to",
"execInfo",
"expression",
"object",
"(",
"$",
"{",
"#execInfo",
"}",
")",
"needed",
"since",
"3",
".",
"0",
".",
"0",
"."
] | train | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/standard/expression/OGNLShortcutExpression.java#L194-L207 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/util/GosuStringUtil.java | GosuStringUtil.containsNone | public static boolean containsNone(String str, char[] invalidChars) {
"""
<p>Checks that the String does not contain certain characters.</p>
<p>A <code>null</code> String will return <code>true</code>.
A <code>null</code> invalid character array will return <code>true</code>.
An empty String ("") always retur... | java | public static boolean containsNone(String str, char[] invalidChars) {
if (str == null || invalidChars == null) {
return true;
}
int strSize = str.length();
int validSize = invalidChars.length;
for (int i = 0; i < strSize; i++) {
char ch = str.charAt(i);
for (i... | [
"public",
"static",
"boolean",
"containsNone",
"(",
"String",
"str",
",",
"char",
"[",
"]",
"invalidChars",
")",
"{",
"if",
"(",
"str",
"==",
"null",
"||",
"invalidChars",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"int",
"strSize",
"=",
"str"... | <p>Checks that the String does not contain certain characters.</p>
<p>A <code>null</code> String will return <code>true</code>.
A <code>null</code> invalid character array will return <code>true</code>.
An empty String ("") always returns true.</p>
<pre>
GosuStringUtil.containsNone(null, *) = true
GosuStringUti... | [
"<p",
">",
"Checks",
"that",
"the",
"String",
"does",
"not",
"contain",
"certain",
"characters",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/GosuStringUtil.java#L1349-L1364 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Query.java | Query.insideBoundingBox | public Query insideBoundingBox(float latitudeP1, float longitudeP1, float latitudeP2, float longitudeP2) {
"""
Search for entries inside a given area defined by the two extreme points of a rectangle.
At indexing, you should specify geoloc of an object with the _geoloc attribute (in the form "_geoloc":{"lat":48.85... | java | public Query insideBoundingBox(float latitudeP1, float longitudeP1, float latitudeP2, float longitudeP2) {
if (insideBoundingBox == null) {
insideBoundingBox = "insideBoundingBox=" + latitudeP1 + "," + longitudeP1 + "," + latitudeP2 + "," + longitudeP2;
} else if (insideBoundingBox.length() > 18) {
... | [
"public",
"Query",
"insideBoundingBox",
"(",
"float",
"latitudeP1",
",",
"float",
"longitudeP1",
",",
"float",
"latitudeP2",
",",
"float",
"longitudeP2",
")",
"{",
"if",
"(",
"insideBoundingBox",
"==",
"null",
")",
"{",
"insideBoundingBox",
"=",
"\"insideBoundingB... | Search for entries inside a given area defined by the two extreme points of a rectangle.
At indexing, you should specify geoloc of an object with the _geoloc attribute (in the form "_geoloc":{"lat":48.853409, "lng":2.348800} or
"_geoloc":[{"lat":48.853409, "lng":2.348800},{"lat":48.547456, "lng":2.972075}] if you have ... | [
"Search",
"for",
"entries",
"inside",
"a",
"given",
"area",
"defined",
"by",
"the",
"two",
"extreme",
"points",
"of",
"a",
"rectangle",
".",
"At",
"indexing",
"you",
"should",
"specify",
"geoloc",
"of",
"an",
"object",
"with",
"the",
"_geoloc",
"attribute",
... | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Query.java#L528-L535 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/wrapper/PAbstractObject.java | PAbstractObject.optLong | @Override
public final long optLong(final String key, final long defaultValue) {
"""
Get a property as an long or default value.
@param key the property name
@param defaultValue the default value
"""
Long result = optLong(key);
return result == null ? defaultValue : result;
} | java | @Override
public final long optLong(final String key, final long defaultValue) {
Long result = optLong(key);
return result == null ? defaultValue : result;
} | [
"@",
"Override",
"public",
"final",
"long",
"optLong",
"(",
"final",
"String",
"key",
",",
"final",
"long",
"defaultValue",
")",
"{",
"Long",
"result",
"=",
"optLong",
"(",
"key",
")",
";",
"return",
"result",
"==",
"null",
"?",
"defaultValue",
":",
"res... | Get a property as an long or default value.
@param key the property name
@param defaultValue the default value | [
"Get",
"a",
"property",
"as",
"an",
"long",
"or",
"default",
"value",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/wrapper/PAbstractObject.java#L91-L95 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/PrincipalUserDto.java | PrincipalUserDto.transformToDto | public static List<PrincipalUserDto> transformToDto(List<PrincipalUser> users) {
"""
Converts list of alert entity objects to list of alertDto objects.
@param users alerts List of alert entities. Cannot be null.
@return List of alertDto objects.
@throws WebApplicationException If an error occurs.
... | java | public static List<PrincipalUserDto> transformToDto(List<PrincipalUser> users) {
if (users == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
List<PrincipalUserDto> result = new ArrayList<>();
... | [
"public",
"static",
"List",
"<",
"PrincipalUserDto",
">",
"transformToDto",
"(",
"List",
"<",
"PrincipalUser",
">",
"users",
")",
"{",
"if",
"(",
"users",
"==",
"null",
")",
"{",
"throw",
"new",
"WebApplicationException",
"(",
"\"Null entity object cannot be conve... | Converts list of alert entity objects to list of alertDto objects.
@param users alerts List of alert entities. Cannot be null.
@return List of alertDto objects.
@throws WebApplicationException If an error occurs. | [
"Converts",
"list",
"of",
"alert",
"entity",
"objects",
"to",
"list",
"of",
"alertDto",
"objects",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/PrincipalUserDto.java#L96-L107 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/activity/AdviceActivity.java | AdviceActivity.putAspectAdviceBean | protected void putAspectAdviceBean(String aspectId, Object adviceBean) {
"""
Puts the aspect advice bean.
@param aspectId the aspect id
@param adviceBean the advice bean
"""
if (aspectAdviceResult == null) {
aspectAdviceResult = new AspectAdviceResult();
}
aspectAdviceRe... | java | protected void putAspectAdviceBean(String aspectId, Object adviceBean) {
if (aspectAdviceResult == null) {
aspectAdviceResult = new AspectAdviceResult();
}
aspectAdviceResult.putAspectAdviceBean(aspectId, adviceBean);
} | [
"protected",
"void",
"putAspectAdviceBean",
"(",
"String",
"aspectId",
",",
"Object",
"adviceBean",
")",
"{",
"if",
"(",
"aspectAdviceResult",
"==",
"null",
")",
"{",
"aspectAdviceResult",
"=",
"new",
"AspectAdviceResult",
"(",
")",
";",
"}",
"aspectAdviceResult",... | Puts the aspect advice bean.
@param aspectId the aspect id
@param adviceBean the advice bean | [
"Puts",
"the",
"aspect",
"advice",
"bean",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/activity/AdviceActivity.java#L461-L466 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/word/Word07Writer.java | Word07Writer.flush | public Word07Writer flush(OutputStream out, boolean isCloseOut) throws IORuntimeException {
"""
将Word Document刷出到输出流
@param out 输出流
@param isCloseOut 是否关闭输出流
@return this
@throws IORuntimeException IO异常
"""
Assert.isFalse(this.isClosed, "WordWriter has been closed!");
try {
this.doc.write(out);... | java | public Word07Writer flush(OutputStream out, boolean isCloseOut) throws IORuntimeException {
Assert.isFalse(this.isClosed, "WordWriter has been closed!");
try {
this.doc.write(out);
out.flush();
} catch (IOException e) {
throw new IORuntimeException(e);
} finally {
if (isCloseOut) {
IoUt... | [
"public",
"Word07Writer",
"flush",
"(",
"OutputStream",
"out",
",",
"boolean",
"isCloseOut",
")",
"throws",
"IORuntimeException",
"{",
"Assert",
".",
"isFalse",
"(",
"this",
".",
"isClosed",
",",
"\"WordWriter has been closed!\"",
")",
";",
"try",
"{",
"this",
"... | 将Word Document刷出到输出流
@param out 输出流
@param isCloseOut 是否关闭输出流
@return this
@throws IORuntimeException IO异常 | [
"将Word",
"Document刷出到输出流"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/word/Word07Writer.java#L174-L187 |
authlete/authlete-java-common | src/main/java/com/authlete/common/util/TypedProperties.java | TypedProperties.getFloat | public float getFloat(Enum<?> key, float defaultValue) {
"""
Equivalent to {@link #getFloat(String, float)
getFloat}{@code (key.name(), defaultValue)}.
If {@code key} is null, {@code defaultValue} is returned.
"""
if (key == null)
{
return defaultValue;
}
return g... | java | public float getFloat(Enum<?> key, float defaultValue)
{
if (key == null)
{
return defaultValue;
}
return getFloat(key.name(), defaultValue);
} | [
"public",
"float",
"getFloat",
"(",
"Enum",
"<",
"?",
">",
"key",
",",
"float",
"defaultValue",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"return",
"getFloat",
"(",
"key",
".",
"name",
"(",
")",
",",
"d... | Equivalent to {@link #getFloat(String, float)
getFloat}{@code (key.name(), defaultValue)}.
If {@code key} is null, {@code defaultValue} is returned. | [
"Equivalent",
"to",
"{"
] | train | https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/util/TypedProperties.java#L173-L181 |
galan/commons | src/main/java/de/galan/commons/net/flux/Response.java | Response.getStreamAsBytearray | public byte[] getStreamAsBytearray() throws IOException {
"""
Converts the inputstream to a string in UTF-8. Subsequent the inputstream will be empty/closed.
"""
byte[] result = null;
try {
result = IOUtils.toByteArray(getStream());
}
catch (NullPointerException npex) {
throw new IOException("Tim... | java | public byte[] getStreamAsBytearray() throws IOException {
byte[] result = null;
try {
result = IOUtils.toByteArray(getStream());
}
catch (NullPointerException npex) {
throw new IOException("Timeout has been forced by CommonHttpClient", npex);
}
return result;
} | [
"public",
"byte",
"[",
"]",
"getStreamAsBytearray",
"(",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"result",
"=",
"null",
";",
"try",
"{",
"result",
"=",
"IOUtils",
".",
"toByteArray",
"(",
"getStream",
"(",
")",
")",
";",
"}",
"catch",
"(",... | Converts the inputstream to a string in UTF-8. Subsequent the inputstream will be empty/closed. | [
"Converts",
"the",
"inputstream",
"to",
"a",
"string",
"in",
"UTF",
"-",
"8",
".",
"Subsequent",
"the",
"inputstream",
"will",
"be",
"empty",
"/",
"closed",
"."
] | train | https://github.com/galan/commons/blob/45d2f36c69958d3f847e5fed66603ea629471822/src/main/java/de/galan/commons/net/flux/Response.java#L58-L67 |
alkacon/opencms-core | src-gwt/org/opencms/ade/contenteditor/client/CmsContentEditor.java | CmsContentEditor.openModelSelectDialog | void openModelSelectDialog(final CmsEditorContext context, final CmsContentDefinition definition) {
"""
Opens the model file select dialog.<p>
@param context the editor context
@param definition the content definition
"""
I_CmsModelSelectHandler handler = new I_CmsModelSelectHandler() {
... | java | void openModelSelectDialog(final CmsEditorContext context, final CmsContentDefinition definition) {
I_CmsModelSelectHandler handler = new I_CmsModelSelectHandler() {
public void onModelSelect(CmsUUID modelStructureId) {
if (modelStructureId == null) {
mo... | [
"void",
"openModelSelectDialog",
"(",
"final",
"CmsEditorContext",
"context",
",",
"final",
"CmsContentDefinition",
"definition",
")",
"{",
"I_CmsModelSelectHandler",
"handler",
"=",
"new",
"I_CmsModelSelectHandler",
"(",
")",
"{",
"public",
"void",
"onModelSelect",
"("... | Opens the model file select dialog.<p>
@param context the editor context
@param definition the content definition | [
"Opens",
"the",
"model",
"file",
"select",
"dialog",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/contenteditor/client/CmsContentEditor.java#L1689-L1719 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/util/LambdaUtil.java | LambdaUtil.getMessage | public static Message getMessage(final Supplier<?> supplier, final MessageFactory messageFactory) {
"""
Returns a Message, either the value supplied by the specified function, or a new Message created by the specified
Factory.
@param supplier a lambda expression or {@code null}
@return the Message resulting fro... | java | public static Message getMessage(final Supplier<?> supplier, final MessageFactory messageFactory) {
if (supplier == null) {
return null;
}
final Object result = supplier.get();
return result instanceof Message ? (Message) result : messageFactory.newMessage(result);
} | [
"public",
"static",
"Message",
"getMessage",
"(",
"final",
"Supplier",
"<",
"?",
">",
"supplier",
",",
"final",
"MessageFactory",
"messageFactory",
")",
"{",
"if",
"(",
"supplier",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"Object",
"res... | Returns a Message, either the value supplied by the specified function, or a new Message created by the specified
Factory.
@param supplier a lambda expression or {@code null}
@return the Message resulting from evaluating the lambda expression or the Message created by the factory for
supplied values that are not of typ... | [
"Returns",
"a",
"Message",
"either",
"the",
"value",
"supplied",
"by",
"the",
"specified",
"function",
"or",
"a",
"new",
"Message",
"created",
"by",
"the",
"specified",
"Factory",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/util/LambdaUtil.java#L87-L93 |
pressgang-ccms/PressGangCCMSContentSpecProcessor | src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java | ContentSpecParser.readFileData | protected void readFileData(final ParserData parserData, final BufferedReader br) throws IOException {
"""
Reads the data from a file that is passed into a BufferedReader and processes it accordingly.
@param parserData
@param br A BufferedReader object that has been initialised with a file's data.
@th... | java | protected void readFileData(final ParserData parserData, final BufferedReader br) throws IOException {
// Read in the entire file so we can peek ahead later on
String line;
while ((line = br.readLine()) != null) {
parserData.addLine(line);
}
} | [
"protected",
"void",
"readFileData",
"(",
"final",
"ParserData",
"parserData",
",",
"final",
"BufferedReader",
"br",
")",
"throws",
"IOException",
"{",
"// Read in the entire file so we can peek ahead later on",
"String",
"line",
";",
"while",
"(",
"(",
"line",
"=",
"... | Reads the data from a file that is passed into a BufferedReader and processes it accordingly.
@param parserData
@param br A BufferedReader object that has been initialised with a file's data.
@throws IOException Thrown if an IO Error occurs while reading from the BufferedReader. | [
"Reads",
"the",
"data",
"from",
"a",
"file",
"that",
"is",
"passed",
"into",
"a",
"BufferedReader",
"and",
"processes",
"it",
"accordingly",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java#L198-L204 |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/SourceWriteUtil.java | SourceWriteUtil.createFieldInjection | public SourceSnippet createFieldInjection(final FieldLiteral<?> field, final String injecteeName,
NameGenerator nameGenerator, List<InjectorMethod> methodsOutput)
throws NoSourceNameException {
"""
Creates a field injecting method and returns a string that invokes the
written method.
@param field f... | java | public SourceSnippet createFieldInjection(final FieldLiteral<?> field, final String injecteeName,
NameGenerator nameGenerator, List<InjectorMethod> methodsOutput)
throws NoSourceNameException {
final boolean hasInjectee = injecteeName != null;
final boolean useNativeMethod = field.isPrivate()
... | [
"public",
"SourceSnippet",
"createFieldInjection",
"(",
"final",
"FieldLiteral",
"<",
"?",
">",
"field",
",",
"final",
"String",
"injecteeName",
",",
"NameGenerator",
"nameGenerator",
",",
"List",
"<",
"InjectorMethod",
">",
"methodsOutput",
")",
"throws",
"NoSource... | Creates a field injecting method and returns a string that invokes the
written method.
@param field field to be injected
@param injecteeName variable that references the object into which values
are injected, in the context of the returned call string
@param nameGenerator NameGenerator to be used for ensuring method n... | [
"Creates",
"a",
"field",
"injecting",
"method",
"and",
"returns",
"a",
"string",
"that",
"invokes",
"the",
"written",
"method",
"."
] | train | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/SourceWriteUtil.java#L93-L155 |
eclipse/hawkbit | hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPDateTimeUtil.java | SPDateTimeUtil.formatLastModifiedAt | public static String formatLastModifiedAt(final BaseEntity baseEntity, final String datePattern) {
"""
Get formatted date 'last modified at' by entity.
@param baseEntity
the entity
@param datePattern
pattern how to format the date (cp. {@code SimpleDateFormat})
@return String formatted date
"""
... | java | public static String formatLastModifiedAt(final BaseEntity baseEntity, final String datePattern) {
if (baseEntity == null) {
return "";
}
return formatDate(baseEntity.getLastModifiedAt(), "", datePattern);
} | [
"public",
"static",
"String",
"formatLastModifiedAt",
"(",
"final",
"BaseEntity",
"baseEntity",
",",
"final",
"String",
"datePattern",
")",
"{",
"if",
"(",
"baseEntity",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"return",
"formatDate",
"(",
"baseEnti... | Get formatted date 'last modified at' by entity.
@param baseEntity
the entity
@param datePattern
pattern how to format the date (cp. {@code SimpleDateFormat})
@return String formatted date | [
"Get",
"formatted",
"date",
"last",
"modified",
"at",
"by",
"entity",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPDateTimeUtil.java#L151-L156 |
mockito/mockito | src/main/java/org/mockito/AdditionalMatchers.java | AdditionalMatchers.and | public static <T> T and(T first, T second) {
"""
Object argument that matches both given argument matchers.
<p>
See examples in javadoc for {@link AdditionalMatchers} class
@param <T>
the type of the object, it is passed through to prevent casts.
@param first
placeholder for the first argument matcher.
@p... | java | public static <T> T and(T first, T second) {
mockingProgress().getArgumentMatcherStorage().reportAnd();
return null;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"and",
"(",
"T",
"first",
",",
"T",
"second",
")",
"{",
"mockingProgress",
"(",
")",
".",
"getArgumentMatcherStorage",
"(",
")",
".",
"reportAnd",
"(",
")",
";",
"return",
"null",
";",
"}"
] | Object argument that matches both given argument matchers.
<p>
See examples in javadoc for {@link AdditionalMatchers} class
@param <T>
the type of the object, it is passed through to prevent casts.
@param first
placeholder for the first argument matcher.
@param second
placeholder for the second argument matcher.
@retu... | [
"Object",
"argument",
"that",
"matches",
"both",
"given",
"argument",
"matchers",
".",
"<p",
">",
"See",
"examples",
"in",
"javadoc",
"for",
"{",
"@link",
"AdditionalMatchers",
"}",
"class"
] | train | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/AdditionalMatchers.java#L742-L745 |
leancloud/java-sdk-all | core/src/main/java/cn/leancloud/upload/QiniuAccessor.java | QiniuAccessor.createBlockInQiniu | public QiniuBlockResponseData createBlockInQiniu(int blockSize, int firstChunkSize,
final byte[] firstChunkData, int retry) {
"""
REST API:
- POST /mkblk/<blockSize> HTTP/1.1
- Host: upload.qiniu.com
- Content-Type: application/octet-stream
- Conte... | java | public QiniuBlockResponseData createBlockInQiniu(int blockSize, int firstChunkSize,
final byte[] firstChunkData, int retry) {
try {
String endPoint = String.format(QINIU_CREATE_BLOCK_EP, this.uploadUrl, blockSize);
Request.Builder builder = new Request... | [
"public",
"QiniuBlockResponseData",
"createBlockInQiniu",
"(",
"int",
"blockSize",
",",
"int",
"firstChunkSize",
",",
"final",
"byte",
"[",
"]",
"firstChunkData",
",",
"int",
"retry",
")",
"{",
"try",
"{",
"String",
"endPoint",
"=",
"String",
".",
"format",
"(... | REST API:
- POST /mkblk/<blockSize> HTTP/1.1
- Host: upload.qiniu.com
- Content-Type: application/octet-stream
- Content-Length: <firstChunkSize>
- Authorization: UpToken <UploadToken>
- <firstChunkBinary>
- Response
{
"ctx": "<Ctx string>",
"checksum": "<Checksum string>",
"cr... | [
"REST",
"API",
":",
"-",
"POST",
"/",
"mkblk",
"/",
"<blockSize",
">",
"HTTP",
"/",
"1",
".",
"1",
"-",
"Host",
":",
"upload",
".",
"qiniu",
".",
"com",
"-",
"Content",
"-",
"Type",
":",
"application",
"/",
"octet",
"-",
"stream",
"-",
"Content",
... | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/core/src/main/java/cn/leancloud/upload/QiniuAccessor.java#L206-L231 |
derari/cthul | strings/src/main/java/org/cthul/strings/format/conversion/FormatConversionBase.java | FormatConversionBase.justifyRight | protected static String justifyRight(CharSequence csq, char pad, int width) {
"""
Right-justifies {@code csq}.
@param csq
@param pad padding character
@param width minimum of characters that will be written
@return justified string
"""
try {
StringBuilder sb = new StringBuilder(width);
... | java | protected static String justifyRight(CharSequence csq, char pad, int width) {
try {
StringBuilder sb = new StringBuilder(width);
justifyRight(sb, csq, pad, width);
return sb.toString();
} catch (IOException e) {
throw new AssertionError("StringBuilder fail... | [
"protected",
"static",
"String",
"justifyRight",
"(",
"CharSequence",
"csq",
",",
"char",
"pad",
",",
"int",
"width",
")",
"{",
"try",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"width",
")",
";",
"justifyRight",
"(",
"sb",
",",
"csq",
... | Right-justifies {@code csq}.
@param csq
@param pad padding character
@param width minimum of characters that will be written
@return justified string | [
"Right",
"-",
"justifies",
"{"
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/strings/src/main/java/org/cthul/strings/format/conversion/FormatConversionBase.java#L66-L74 |
olivergondza/dumpling | core/src/main/java/com/github/olivergondza/dumpling/model/ProcessThread.java | ProcessThread.waitingToLock | public static @Nonnull Predicate waitingToLock(final @Nonnull String className) {
"""
Match thread that is waiting on lock identified by <tt>className</tt>.
"""
return new Predicate() {
@Override
public boolean isValid(@Nonnull ProcessThread<?, ?, ?> thread) {
fi... | java | public static @Nonnull Predicate waitingToLock(final @Nonnull String className) {
return new Predicate() {
@Override
public boolean isValid(@Nonnull ProcessThread<?, ?, ?> thread) {
final ThreadLock lock = thread.getWaitingToLock();
return lock != null && ... | [
"public",
"static",
"@",
"Nonnull",
"Predicate",
"waitingToLock",
"(",
"final",
"@",
"Nonnull",
"String",
"className",
")",
"{",
"return",
"new",
"Predicate",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"isValid",
"(",
"@",
"Nonnull",
"ProcessThread",... | Match thread that is waiting on lock identified by <tt>className</tt>. | [
"Match",
"thread",
"that",
"is",
"waiting",
"on",
"lock",
"identified",
"by",
"<tt",
">",
"className<",
"/",
"tt",
">",
"."
] | train | https://github.com/olivergondza/dumpling/blob/ac698735fcc7c023db0c1637cc1f522cb3576c7f/core/src/main/java/com/github/olivergondza/dumpling/model/ProcessThread.java#L553-L561 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.eligibility_search_fiberStreets_POST | public OvhAsyncTaskArray<OvhFiberStreet> eligibility_search_fiberStreets_POST(String inseeCode) throws IOException {
"""
Get all street linked to a locality
REST: POST /xdsl/eligibility/search/fiberStreets
@param inseeCode [required] French INSEE identifier (you can get it with POST /xdsl/eligibility/search/ci... | java | public OvhAsyncTaskArray<OvhFiberStreet> eligibility_search_fiberStreets_POST(String inseeCode) throws IOException {
String qPath = "/xdsl/eligibility/search/fiberStreets";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "inseeCode", inseeCode);
String resp... | [
"public",
"OvhAsyncTaskArray",
"<",
"OvhFiberStreet",
">",
"eligibility_search_fiberStreets_POST",
"(",
"String",
"inseeCode",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/eligibility/search/fiberStreets\"",
";",
"StringBuilder",
"sb",
"=",
"path",
... | Get all street linked to a locality
REST: POST /xdsl/eligibility/search/fiberStreets
@param inseeCode [required] French INSEE identifier (you can get it with POST /xdsl/eligibility/search/cities)
@deprecated | [
"Get",
"all",
"street",
"linked",
"to",
"a",
"locality"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L392-L399 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java | ComputerVisionImpl.tagImageAsync | public Observable<TagResult> tagImageAsync(String url, TagImageOptionalParameter tagImageOptionalParameter) {
"""
This operation generates a list of words, or tags, that are relevant to the content of the supplied image. The Computer Vision API can return tags based on objects, living beings, scenery or actions fo... | java | public Observable<TagResult> tagImageAsync(String url, TagImageOptionalParameter tagImageOptionalParameter) {
return tagImageWithServiceResponseAsync(url, tagImageOptionalParameter).map(new Func1<ServiceResponse<TagResult>, TagResult>() {
@Override
public TagResult call(ServiceResponse<T... | [
"public",
"Observable",
"<",
"TagResult",
">",
"tagImageAsync",
"(",
"String",
"url",
",",
"TagImageOptionalParameter",
"tagImageOptionalParameter",
")",
"{",
"return",
"tagImageWithServiceResponseAsync",
"(",
"url",
",",
"tagImageOptionalParameter",
")",
".",
"map",
"(... | This operation generates a list of words, or tags, that are relevant to the content of the supplied image. The Computer Vision API can return tags based on objects, living beings, scenery or actions found in images. Unlike categories, tags are not organized according to a hierarchical classification system, but corresp... | [
"This",
"operation",
"generates",
"a",
"list",
"of",
"words",
"or",
"tags",
"that",
"are",
"relevant",
"to",
"the",
"content",
"of",
"the",
"supplied",
"image",
".",
"The",
"Computer",
"Vision",
"API",
"can",
"return",
"tags",
"based",
"on",
"objects",
"li... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L1609-L1616 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/setting/session/ValidationSessionComponent.java | ValidationSessionComponent.createSession | public ValidationSessionInfo createSession(HttpServletRequest req, HttpServletResponse res) {
"""
Create session validation session info.
@param req the req
@param res the res
@return the validation session info
"""
String key = this.getSessionKey();
ValidationSessionInfo sessionInfo = new... | java | public ValidationSessionInfo createSession(HttpServletRequest req, HttpServletResponse res) {
String key = this.getSessionKey();
ValidationSessionInfo sessionInfo = new ValidationSessionInfo(req, key);
this.sessionMap.put(key, sessionInfo);
res.addCookie(new Cookie("AuthToken", key));
... | [
"public",
"ValidationSessionInfo",
"createSession",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"{",
"String",
"key",
"=",
"this",
".",
"getSessionKey",
"(",
")",
";",
"ValidationSessionInfo",
"sessionInfo",
"=",
"new",
"ValidationSession... | Create session validation session info.
@param req the req
@param res the res
@return the validation session info | [
"Create",
"session",
"validation",
"session",
"info",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/setting/session/ValidationSessionComponent.java#L122-L128 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionPersistenceImpl.java | CPDefinitionPersistenceImpl.findByUUID_G | @Override
public CPDefinition findByUUID_G(String uuid, long groupId)
throws NoSuchCPDefinitionException {
"""
Returns the cp definition where uuid = ? and groupId = ? or throws a {@link NoSuchCPDefinitionException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return ... | java | @Override
public CPDefinition findByUUID_G(String uuid, long groupId)
throws NoSuchCPDefinitionException {
CPDefinition cpDefinition = fetchByUUID_G(uuid, groupId);
if (cpDefinition == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("uuid=");
msg.... | [
"@",
"Override",
"public",
"CPDefinition",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchCPDefinitionException",
"{",
"CPDefinition",
"cpDefinition",
"=",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
")",
";",
"if",
"(",
"... | Returns the cp definition where uuid = ? and groupId = ? or throws a {@link NoSuchCPDefinitionException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching cp definition
@throws NoSuchCPDefinitionException if a matching cp definition could not be found | [
"Returns",
"the",
"cp",
"definition",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCPDefinitionException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionPersistenceImpl.java#L663-L689 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.